./PaxHeaders.9215/tdom-0.9.10000644000175000001440000000013113325717053013514 xustar000000000000000030 mtime=1532468779.151460475 29 atime=1532468780.73345483 30 ctime=1532468779.151460475 tdom-0.9.1/0000755000175000001440000000000013325717053012653 5ustar00rolfusers00000000000000tdom-0.9.1/PaxHeaders.9215/configure.in0000644000175000001440000000013213325450307015742 xustar000000000000000030 mtime=1532383431.412385885 30 atime=1532383431.488385657 30 ctime=1532383431.412385885 tdom-0.9.1/configure.in0000644000175000001440000002227613325450307015171 0ustar00rolfusers00000000000000#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. # This will also define a special symbol for Windows (BUILD_sample in # this case) so that we create the export library with the dll. #----------------------------------------------------------------------- AC_INIT([tdom], [0.9.1]) TDOM_EXPAT_ENTROPY #-------------------------------------------------------------------- # 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.13]) AC_CONFIG_AUX_DIR(tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC and a few others to create the basic setup # necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #----------------------------------------------------------------------- # Those two are needed for compiling expat. #----------------------------------------------------------------------- AC_CHECK_FUNCS(memmove bcopy) #-------------------------------------------------------------------- # Add optional AOLserver includes #-------------------------------------------------------------------- TDOM_PATH_AOLSERVER #-------------------------------------------------------------------- # Add shared expat includes #-------------------------------------------------------------------- TDOM_PATH_EXPAT #-------------------------------------------------------------------- # Add HTML5 parsing support. #-------------------------------------------------------------------- TDOM_ENABLE_HTML5 #----------------------------------------------------------------------- # __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([generic/xmlsimple.c \ generic/dom.c \ generic/domhtml.c \ generic/domhtml5.c \ generic/domjson.c \ generic/domxpath.c \ generic/domxslt.c \ generic/domlock.c \ generic/tcldom.c \ generic/nodecmd.c \ generic/tdominit.c \ generic/tclexpat.c \ generic/tclpull.c \ generic/tdomStubInit.c]) TEA_ADD_HEADERS([generic/tdom.h]) TEA_ADD_INCLUDES([-I${srcdir}/generic ${AOL_INCLUDES} ${HTML5_INCLUDES}]) TEA_ADD_LIBS([${AOL_LIBS} ${HTML5_LIBS}]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([generic/tdomStubLib.c]) TEA_ADD_TCL_SOURCES([lib/tdom.tcl]) #-------------------------------------------------------------------- # __CHANGE__ # # You can add more files to clean if your extension creates any extra # files by extending CLEANFILES. # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. # # A few miscellaneous platform-specific items: # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then 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 tdom.tcl tcldomsh" #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. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS TDOM_LD_SEARCH_FLAGS=${LD_SEARCH_FLAGS} AC_SUBST(TDOM_LD_SEARCH_FLAGS) #-------------------------------------------------------------------- # 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, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [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 #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH #TEA_PROG_WISH #-------------------------------------------------------------------- # Add some private preprocessor options #-------------------------------------------------------------------- TDOM_ENABLE_DTD TDOM_ENABLE_NS TDOM_ENABLE_UNKNOWN TDOM_ENABLE_TDOMALLOC TDOM_ENABLE_LESS_NS TDOMSHELL=tcldomsh AC_SUBST(TDOMSHELL) TDOM_EXPORT_CONFIG #-------------------------------------------------------------------- # 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 tdomConfig.sh]) tdom-0.9.1/PaxHeaders.9215/extensions0000644000175000001440000000013213325450307015553 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532446226.511747858 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/0000755000175000001440000000000013325450307015046 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/PaxHeaders.9215/tnc0000644000175000001440000000013213325450307016337 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532446226.512747855 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/0000755000175000001440000000000013325450307015632 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tnc/PaxHeaders.9215/configure.in0000644000175000001440000000013213325450307020725 xustar000000000000000030 mtime=1532383431.427385839 30 atime=1532383431.493385642 30 ctime=1532383431.427385839 tdom-0.9.1/extensions/tnc/configure.in0000644000175000001440000001712313325450307020147 0ustar00rolfusers00000000000000#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([tnc], [0.3.0]) #-------------------------------------------------------------------- # 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.10]) AC_CONFIG_AUX_DIR(../../tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # 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 tdomConfig.sh file #-------------------------------------------------------------------- TDOM_PATH_CONFIG TDOM_LOAD_CONFIG #----------------------------------------------------------------------- # __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([tnc.c]) TEA_ADD_HEADERS([]) TEA_ADD_INCLUDES([-I${srcdir}/../../generic -I${srcdir}/../../expat]) TEA_ADD_LIBS([${TDOM_STUB_LIB_SPEC}]) TEA_ADD_CFLAGS([-DUSE_TDOM_STUBS=1]) 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_tnc, 1, [Build windows export dll]) 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. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # 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, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [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 #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH #TEA_PROG_WISH #-------------------------------------------------------------------- # 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 pkgIndex.tcl]) tdom-0.9.1/extensions/tnc/PaxHeaders.9215/test.tcl0000644000175000001440000000013213325450307020077 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/test.tcl0000644000175000001440000000120213325450307017310 0ustar00rolfusers00000000000000 if {[catch {package require tnc 0.3} errMsg]} { if {[catch {load ./libtnc0.3.0.so}]} { puts $errMsg exit 1 } } if {[lsearch [namespace children] ::tDOM] == -1} { # tcldomsh without the script library. Source the lib. source [file join [file dir [info script]] ../../lib tdom.tcl] } if {[llength $argv] != 1} { puts stderr "usage: $argv0 " exit 1 } set parser [expat \ -baseurl [tDOM::baseURL $argv] \ -externalentitycommand tDOM::extRefHandler \ -paramentityparsing notstandalone] tnc $parser enable $parser parsefile $argv tdom-0.9.1/extensions/tnc/PaxHeaders.9215/aclocal.m40000644000175000001440000000013213325450307020254 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532383431.493385642 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/tnc/aclocal.m40000644000175000001440000000026713325450307017477 0ustar00rolfusers00000000000000# # Include the TEA standard macro set # builtin(include,../../tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # builtin(include,../../tdom.m4) tdom-0.9.1/extensions/tnc/PaxHeaders.9215/mkinstalldirs0000644000175000001440000000013213325450307021217 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/mkinstalldirs0000755000175000001440000000123713325450307020443 0ustar00rolfusers00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here tdom-0.9.1/extensions/tnc/PaxHeaders.9215/tnc.c0000644000175000001440000000013213325450307017344 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/tnc.c0000644000175000001440000030677313325450307016602 0ustar00rolfusers00000000000000/* This code implements a set of tDOM C Handlers that can be dynamically loaded into a tclsh with already loaded tDOM package. This parser extension does some tests according to the DTD against the data within an XML document. Copyright (c) 2001-2003 Rolf Ade */ #include #include #include #ifndef TCL_THREADS # define TDomThreaded(x) #else # define TDomThreaded(x) x #endif /* The initial stack sizes must be at least 1 */ #define TNC_INITCONTENTSTACKSIZE 512 /*---------------------------------------------------------------------------- | local globals | \---------------------------------------------------------------------------*/ /* Counter to generate unique validateCmd names */ static int uniqueCounter = 0; TDomThreaded(static Tcl_Mutex counterMutex;) /* Protect the counter */ /* To enable some debugging output at stdout use this. But beware: this debugging output isn't systematic and only understandable, if you know the internals of tnc. */ /* #define TNC_DEBUG */ /* The elements of TNC_Content carry exactly the same information as expats XML_Content. But the element is identified by his Tcl_HashEntry entry within the "tagNames" Hashtable (see TNC_Data) and not the element name. This should be much more efficient. */ typedef struct TNC_cp TNC_Content; typedef struct TNC_elemAttInfo TNC_ElemAttInfo; struct TNC_cp { enum XML_Content_Type type; enum XML_Content_Quant quant; Tcl_HashEntry *nameId; unsigned int numchildren; TNC_Content *children; TNC_ElemAttInfo *attInfo; }; typedef struct TNC_contentStack { TNC_Content *model; int activeChild; int deep; int alreadymatched; } TNC_ContentStack; typedef struct TNC_data { char *doctypeName; /* From DOCTYPE declaration */ int skipWhiteCDATAs; /* Flag: white space allowed in current content model? */ int ignorePCDATA; /* Flag: currently mixed content model? */ Tcl_HashTable *tagNames; /* Hash table of all ELEMENT declarations of the DTD. Element name is the key. While parsing, entry points to the XML_Content of that Element, after finishing of DTD parsing, entry holds a pointer to the TNC_Content of that element. */ TNC_ElemAttInfo *elemAttInfo; /* TncElementStartCommand stores the elemAttInfo pointer of the current element here for DOM validation, to avoid two element name lookups. */ int elemContentsRewriten; /* Signals, if the tagNames entries point to TNC_Contents */ int dtdstatus; /* While used with expat obj: 1 after successful parsed DTD, 0 otherwise. For validateCmd used for error report during validation: 0 OK, 1 validation error. */ int idCheck; /* Flag: check IDREF resolution*/ Tcl_HashTable *attDefsTables; /* Used to store ATTLIST declarations while parsing. Keys are the element names. */ Tcl_HashTable *entityDecls; /* Used to store ENTITY declarations. */ Tcl_HashTable *notationDecls; /* Used to store NOTATION declarations. */ Tcl_HashTable *ids; /* Used to track IDs */ Tcl_Interp *interp; Tcl_Obj *expatObj; /* If != NULL, points to the parserCmd structure. NULL for ValidateCmds. Used, to distinguish between SAX and DOM validation. */ int contentStackSize; /* Current size of the content stack */ int contentStackPtr; /* Points to the currently active content model on the stack */ TNC_ContentStack *contentStack; /* Stack for the currently nested open content models. */ } TNC_Data; typedef enum TNC_attType { TNC_ATTTYPE_CDATA, TNC_ATTTYPE_ID, TNC_ATTTYPE_IDREF, TNC_ATTTYPE_IDREFS, TNC_ATTTYPE_ENTITY, TNC_ATTTYPE_ENTITIES, TNC_ATTTYPE_NMTOKEN, TNC_ATTTYPE_NMTOKENS, TNC_ATTTYPE_NOTATION, TNC_ATTTYPE_ENUMERATION, } TNC_AttType; struct TNC_elemAttInfo { Tcl_HashTable *attributes; int nrOfreq; int nrOfIdAtts; }; typedef struct TNC_attDecl { TNC_AttType att_type; char *dflt; int isrequired; Tcl_HashTable *lookupTable; /* either NotationTypes or enum values */ } TNC_AttDecl; typedef struct TNC_entityInfo { int is_notation; char *notationName; } TNC_EntityInfo; typedef Tcl_HashEntry TNC_NameId; static char tnc_usage[] = "Usage tnc , where subCommand can be: \n" " enable \n" " remove \n" " getValidateCmd ?cmdName?\n" ; static char validateCmd_usage[] = "Usage validateCmd , where method can be: \n" " validateDocument \n" " validateTree \n" " validateAttributes \n" " delete \n" ; enum TNC_Error { TNC_ERROR_NONE, TNC_ERROR_DUPLICATE_ELEMENT_DECL, TNC_ERROR_DUPLICATE_MIXED_ELEMENT, TNC_ERROR_UNKNOWN_ELEMENT, TNC_ERROR_EMPTY_ELEMENT, TNC_ERROR_DISALLOWED_PCDATA, TNC_ERROR_DISALLOWED_CDATA, TNC_ERROR_NO_DOCTYPE_DECL, TNC_ERROR_WRONG_ROOT_ELEMENT, TNC_ERROR_NO_ATTRIBUTES, TNC_ERROR_UNKNOWN_ATTRIBUTE, TNC_ERROR_WRONG_FIXED_ATTVALUE, TNC_ERROR_MISSING_REQUIRED_ATTRIBUTE, TNC_ERROR_MORE_THAN_ONE_ID_ATT, TNC_ERROR_ID_ATT_DEFAULT, TNC_ERROR_DUPLICATE_ID_VALUE, TNC_ERROR_UNKNOWN_ID_REFERRED, TNC_ERROR_ENTITY_ATTRIBUTE, TNC_ERROR_ENTITIES_ATTRIBUTE, TNC_ERROR_ATT_ENTITY_DEFAULT_MUST_BE_DECLARED, TNC_ERROR_NOTATION_REQUIRED, TNC_ERROR_NOTATION_MUST_BE_DECLARED, TNC_ERROR_IMPOSSIBLE_DEFAULT, TNC_ERROR_ENUM_ATT_WRONG_VALUE, TNC_ERROR_NMTOKEN_REQUIRED, TNC_ERROR_NAME_REQUIRED, TNC_ERROR_NAMES_REQUIRED, TNC_ERROR_ELEMENT_NOT_ALLOWED_HERE, TNC_ERROR_ELEMENT_CAN_NOT_END_HERE, TNC_ERROR_ONLY_THREE_BYTE_UTF8, TNC_ERROR_UNKNOWN_NODE_TYPE }; const char * TNC_ErrorString (int code) { static const char *message[] = { "No error.", "Element declared more than once.", "The same name must not appear more than once in \n\tone mixed-content declaration.", "No declaration for this element.", "Element is declared to be empty, but isn't.", "PCDATA not allowed here.", "CDATA section not allowed here.", "No DOCTYPE declaration.", "Root element doesn't match DOCTYPE name.", "No attributes defined for this element.", "Unknown attribute for this element.", "Attribute value must match the FIXED default.", "Required attribute missing.", "Only one attribute with type ID allowed.", "No default value allowed for attribute type ID.", "ID attribute values must be unique within the document.", "Unknown ID referred.", "Attribute value has to be a unparsed entity.", "Attribute value has to be a sequence of unparsed entities.", "The defaults of attributes with type ENTITY or ENTITIES\nhas to be unparsed entities.", "Attribute value has to be one of the allowed notations.", "Every used NOTATION must be declared.", "Attribute default is not one of the allowed values", "Attribute hasn't one of the allowed values.", "Attribute value has to be a NMTOKEN.", "Attribute value has to be a Name.", "Attribute value has to match production Names.", "Element is not allowed here.", "Element can not end here (required element(s) missing).", "Can only handle UTF8 chars up to 3 bytes length." "Unknown or unexpected dom node type." }; /* if (code > 0 && code < sizeof(message)/sizeof(message[0])) */ return message[code]; return 0; } #define CHECK_UTF_CHARLEN(d) if (!(d)) { \ signalNotValid (userData, TNC_ERROR_ONLY_THREE_BYTE_UTF8);\ return;\ } #define CHECK_UTF_CHARLENR(d) if (!(d)) { \ signalNotValid (userData, TNC_ERROR_ONLY_THREE_BYTE_UTF8);\ return 0;\ } #define CHECK_UTF_CHARLEN_COPY(d) if (!(d)) { \ signalNotValid (userData, TNC_ERROR_ONLY_THREE_BYTE_UTF8);\ FREE (copy);\ return;\ } #define SetResult(str) Tcl_ResetResult(interp); \ Tcl_SetStringObj(Tcl_GetObjResult(interp), (str), -1) #define SetBooleanResult(i) Tcl_ResetResult(interp); \ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (i)) extern char *Tdom_InitStubs (Tcl_Interp *interp, char *version, int exact); static void signalNotValid ( void *userData, int code ) { TNC_Data *tncdata = (TNC_Data *) userData; TclGenExpatInfo *expat; char s[1000]; if (tncdata->expatObj) { expat = GetExpatInfo (tncdata->interp, tncdata->expatObj); sprintf (s, "Validation error at line %ld, character %ld: %s", XML_GetCurrentLineNumber (expat->parser), XML_GetCurrentColumnNumber (expat->parser), TNC_ErrorString (code)); expat->status = TCL_ERROR; expat->result = Tcl_NewStringObj (s, -1); Tcl_IncrRefCount (expat->result); } else { tncdata->dtdstatus = 1; Tcl_SetResult (tncdata->interp, (char *)TNC_ErrorString (code), TCL_VOLATILE); } } /* *---------------------------------------------------------------------------- * * FindUniqueCmdName -- * * Generate new command name. Used for getValidateCmd. * * Results: * Returns newly allocated Tcl object containing name. * * Side effects: * Allocates Tcl object. * *---------------------------------------------------------------------------- */ static void FindUniqueCmdName( Tcl_Interp *interp, char *s ) { Tcl_CmdInfo info; TDomThreaded(Tcl_MutexLock(&counterMutex);) do { sprintf(s, "DTDvalidator%d", uniqueCounter++); } while (Tcl_GetCommandInfo(interp, s, &info)); TDomThreaded(Tcl_MutexUnlock(&counterMutex);) } /* *---------------------------------------------------------------------------- * * TncStartDoctypeDeclHandler -- * * This procedure is called for the start of the DOCTYPE * declaration. * * Results: * None. * * Side effects: * Stores the doctype Name in the TNC_data. * *---------------------------------------------------------------------------- */ void TncStartDoctypeDeclHandler ( void *userData, const char *doctypeName, const char *sysid, const char *pubid, int has_internal_subset ) { TNC_Data *tncdata = (TNC_Data *) userData; #ifdef TNC_DEBUG printf ("TncStartDoctypeDeclHandler start\n"); #endif tncdata->doctypeName = tdomstrdup (doctypeName); } /* *---------------------------------------------------------------------------- * * TncFreeTncModel -- * * This helper procedure frees recursively TNC_Contents. * * Results: * None. * * Side effects: * Frees memory. * *---------------------------------------------------------------------------- */ static void TncFreeTncModel ( TNC_Content *tmodel ) { unsigned int i; if (tmodel->children) { for (i = 0; i < tmodel->numchildren; i++) { TncFreeTncModel (&tmodel->children[i]); } FREE ((char *) tmodel->children); } } /* *---------------------------------------------------------------------------- * * TncRewriteModel -- * * This helper procedure creates recursively a TNC_Content from * a XML_Content. * * Results: * None. * * Side effects: * Allocates memory for the TNC_Content models. * *---------------------------------------------------------------------------- */ static void TncRewriteModel ( XML_Content *emodel, TNC_Content *tmodel, Tcl_HashTable *tagNames ) { Tcl_HashEntry *entryPtr; unsigned int i; tmodel->type = emodel->type; tmodel->quant = emodel->quant; tmodel->numchildren = emodel->numchildren; tmodel->children = NULL; tmodel->nameId = NULL; switch (emodel->type) { case XML_CTYPE_MIXED: if (emodel->quant == XML_CQUANT_REP) { tmodel->children = (TNC_Content *) MALLOC (sizeof (TNC_Content) * emodel->numchildren); for (i = 0; i < emodel->numchildren; i++) { TncRewriteModel (&emodel->children[i], &tmodel->children[i], tagNames); } } break; case XML_CTYPE_ANY: case XML_CTYPE_EMPTY: /* do nothing */ break; case XML_CTYPE_SEQ: case XML_CTYPE_CHOICE: tmodel->children = (TNC_Content *) MALLOC (sizeof (TNC_Content) * emodel->numchildren); for (i = 0; i < emodel->numchildren; i++) { TncRewriteModel (&emodel->children[i], &tmodel->children[i], tagNames); } break; case XML_CTYPE_NAME: entryPtr = Tcl_FindHashEntry (tagNames, emodel->name); /* Notice, that it is possible for entryPtr to be NULL. This means, a content model uses a not declared element. This is legal even in valid documents. (Of course, if the undeclared element actually shows up in the document that would make the document invalid.) See rec 3.2 QUESTION: Should there be a flag to enable a warning, when a declaration contains an element type for which no declaration is provided, as rec 3.2 metioned? This would be the appropriated place to omit the warning. */ tmodel->nameId = entryPtr; } } /* *---------------------------------------------------------------------------- * * TncEndDoctypeDeclHandler -- * * This procedure is called at the end of the DOCTYPE * declaration, after processing any external subset. * It rewrites the XML_Content models to TNC_Content * models and frees the XML_Content models. * * Results: * None. * * Side effects: * Rewrites the XML_Content models to TNC_Content * models. * *---------------------------------------------------------------------------- */ void TncEndDoctypeDeclHandler ( void *userData ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr, *ePtr1; Tcl_HashSearch search; XML_Content *emodel; TNC_Content *tmodel = NULL; char *elementName; entryPtr = Tcl_FirstHashEntry (tncdata->tagNames, &search); while (entryPtr != NULL) { #ifdef TNC_DEBUG printf ("name: %-20s nameId: %p\n", Tcl_GetHashKey (tncdata->tagNames, entryPtr), entryPtr); #endif emodel = (XML_Content*) Tcl_GetHashValue (entryPtr); tmodel = (TNC_Content*) MALLOC (sizeof (TNC_Content)); TncRewriteModel (emodel, tmodel, tncdata->tagNames); elementName = Tcl_GetHashKey (tncdata->tagNames, entryPtr); ePtr1 = Tcl_FindHashEntry (tncdata->attDefsTables, elementName); if (ePtr1) { tmodel->attInfo = (TNC_ElemAttInfo *) Tcl_GetHashValue (ePtr1); } else { tmodel->attInfo = NULL; } Tcl_SetHashValue (entryPtr, tmodel); entryPtr = Tcl_NextHashEntry (&search); } tncdata->elemContentsRewriten = 1; /* Checks, if every used notation name is in deed declared */ entryPtr = Tcl_FirstHashEntry (tncdata->notationDecls, &search); while (entryPtr != NULL) { #ifdef TNC_DEBUG printf ("check notation name %s\n", Tcl_GetHashKey (tncdata->notationDecls, entryPtr)); printf ("value %p\n", Tcl_GetHashValue (entryPtr)); #endif if (!Tcl_GetHashValue (entryPtr)) { signalNotValid (userData, TNC_ERROR_NOTATION_MUST_BE_DECLARED); return; } entryPtr = Tcl_NextHashEntry (&search); } /* Checks, if every used entity name is indeed declared */ entryPtr = Tcl_FirstHashEntry (tncdata->entityDecls, &search); while (entryPtr != NULL) { if (!Tcl_GetHashValue (entryPtr)) { signalNotValid (userData, TNC_ERROR_ATT_ENTITY_DEFAULT_MUST_BE_DECLARED); return; } entryPtr = Tcl_NextHashEntry (&search); } tncdata->dtdstatus = 1; } /* *---------------------------------------------------------------------------- * * TncEntityDeclHandler -- * * This procedure is called for every entity declaration. * * Results: * None. * * Side effects: * Stores either the name of the entity and * type information in a lookup table. * *---------------------------------------------------------------------------- */ void TncEntityDeclHandler ( void *userData, const char *entityName, int is_parameter_entity, const char *value, int value_length, const char *base, const char *systemId, const char *publicId, const char *notationName ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; int newPtr; TNC_EntityInfo *entityInfo; /* expat collects entity definitions internaly by itself. So this is maybe superfluous, if it possible to access the expat internal representation. To study this is left to the reader. */ if (is_parameter_entity) return; entryPtr = Tcl_CreateHashEntry (tncdata->entityDecls, entityName, &newPtr); /* multiple declaration of the same entity are allowed; first definition wins (rec. 4.2) */ if (!newPtr) { /* Eventually, an attribute declaration with type ENTITY or ENTITIES has used this (up to the attribute declaration undeclared) ENTITY within his default value. In this case, the hash value has to be NULL and the entity must be a unparsed entity. */ if (!Tcl_GetHashValue (entryPtr)) { if (notationName == NULL) { signalNotValid (userData, TNC_ERROR_ATT_ENTITY_DEFAULT_MUST_BE_DECLARED); return; } newPtr = 1; } } if (newPtr) { entityInfo = (TNC_EntityInfo *) MALLOC (sizeof (TNC_EntityInfo)); if (notationName != NULL) { entityInfo->is_notation = 1; Tcl_CreateHashEntry (tncdata->notationDecls, notationName, &newPtr); entityInfo->notationName = tdomstrdup (notationName); } else { entityInfo->is_notation = 0; } Tcl_SetHashValue (entryPtr, entityInfo); } } /* *---------------------------------------------------------------------------- * * TncNotationDeclHandler -- * * This procedure is called for every notation declaration. * * Results: * None. * * Side effects: * Stores the notationName in the notationDecls table with value * one. * *---------------------------------------------------------------------------- */ void TncNotationDeclHandler ( void *userData, const char *notationName, const char *base, const char *systemId, const char *publicId ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; int newPtr; entryPtr = Tcl_CreateHashEntry (tncdata->notationDecls, notationName, &newPtr); #ifdef TNC_DEBUG printf ("Notation %s declared\n", notationName); #endif Tcl_SetHashValue (entryPtr, (char *) 1); } /* *---------------------------------------------------------------------------- * * TncElementDeclCommand -- * * This procedure is called for every element declaration. * * Results: * None. * * Side effects: * Stores the tag name of the element in a lookup table. * *---------------------------------------------------------------------------- */ void TncElementDeclCommand ( void *userData, const char *name, XML_Content *model ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; int newPtr; unsigned int i, j; entryPtr = Tcl_CreateHashEntry (tncdata->tagNames, name, &newPtr); /* "No element type may be declared more than once." (rec. 3.2) */ if (!newPtr) { signalNotValid (userData, TNC_ERROR_DUPLICATE_ELEMENT_DECL); return; } /* "The same name must not appear more than once in a single mixed-content declaration." (rec. 3.2.2) NOTE: OK, OK, doing it this way may not be optimal or even fast in some cases. Please step in with a more fancy solution, if you feel the need. */ if (model->type == XML_CTYPE_MIXED && model->quant == XML_CQUANT_REP) { for (i = 0; i < model->numchildren; i++) { for (j = i + 1; j < model->numchildren; j++) { if (strcmp ((&model->children[i])->name, (&model->children[j])->name) == 0) { signalNotValid (userData, TNC_ERROR_DUPLICATE_MIXED_ELEMENT); return; } } } } Tcl_SetHashValue (entryPtr, model); return; } /* *---------------------------------------------------------------------------- * * TncAttDeclCommand -- * * This procedure is called for *each* attribute in an XML * ATTLIST declaration. It stores the attribute definition in * an element specific hash table. * * Results: * None. * * Side effects: * Stores the tag name of the element in a lookup table. * *---------------------------------------------------------------------------- */ void TncAttDeclCommand ( void *userData, const char *elname, const char *attname, const char *att_type, const char *dflt, int isrequired ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr, *entryPtr1; Tcl_HashTable *elemAtts; TNC_ElemAttInfo *elemAttInfo; TNC_AttDecl *attDecl; TNC_EntityInfo *entityInfo; int newPtr, start, i, clen; char *copy; entryPtr = Tcl_CreateHashEntry (tncdata->attDefsTables, elname, &newPtr); if (newPtr) { elemAttInfo = (TNC_ElemAttInfo *) MALLOC (sizeof (TNC_ElemAttInfo)); elemAtts = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (elemAtts, TCL_STRING_KEYS); elemAttInfo->attributes = elemAtts; elemAttInfo->nrOfreq = 0; elemAttInfo->nrOfIdAtts = 0; Tcl_SetHashValue (entryPtr, elemAttInfo); } else { elemAttInfo = (TNC_ElemAttInfo *) Tcl_GetHashValue (entryPtr); elemAtts = elemAttInfo->attributes; } entryPtr = Tcl_CreateHashEntry (elemAtts, attname, &newPtr); /* Multiple Attribute declarations are allowed, but later declarations are ignored. See rec 3.3. */ if (newPtr) { attDecl = (TNC_AttDecl *) MALLOC (sizeof (TNC_AttDecl)); if (strcmp (att_type, "CDATA") == 0) { attDecl->att_type = TNC_ATTTYPE_CDATA; } else if (strcmp (att_type, "ID") == 0) { if (elemAttInfo->nrOfIdAtts) { signalNotValid (userData, TNC_ERROR_MORE_THAN_ONE_ID_ATT); return; } elemAttInfo->nrOfIdAtts++; if (dflt != NULL) { signalNotValid (userData, TNC_ERROR_ID_ATT_DEFAULT); return; } attDecl->att_type = TNC_ATTTYPE_ID; } else if (strcmp (att_type, "IDREF") == 0) { attDecl->att_type = TNC_ATTTYPE_IDREF; } else if (strcmp (att_type, "IDREFS") == 0) { attDecl->att_type = TNC_ATTTYPE_IDREFS; } else if (strcmp (att_type, "ENTITY") == 0) { attDecl->att_type = TNC_ATTTYPE_ENTITY; } else if (strcmp (att_type, "ENTITIES") == 0) { attDecl->att_type = TNC_ATTTYPE_ENTITIES; } else if (strcmp (att_type, "NMTOKEN") == 0) { attDecl->att_type = TNC_ATTTYPE_NMTOKEN; } else if (strcmp (att_type, "NMTOKENS") == 0) { attDecl->att_type = TNC_ATTTYPE_NMTOKENS; } else if (strncmp (att_type, "NOTATION(", 9) == 0) { /* This is a bit puzzling. expat returns something like as att_type "NOTATION(gif)". */ attDecl->att_type = TNC_ATTTYPE_NOTATION; attDecl->lookupTable = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (attDecl->lookupTable, TCL_STRING_KEYS); copy = tdomstrdup (att_type); start = i = 9; while (i) { if (copy[i] == ')') { copy[i] = '\0'; #ifdef TNC_DEBUG printf ("att type NOTATION: notation %s allowed\n", ©[start]); #endif Tcl_CreateHashEntry (attDecl->lookupTable, ©[start], &newPtr); entryPtr1 = Tcl_CreateHashEntry (tncdata->notationDecls, ©[start], &newPtr); #ifdef TNC_DEBUG if (newPtr) { printf ("up to now unknown NOTATION\n"); } else { printf ("NOTATION already known\n"); } #endif FREE (copy); break; } if (copy[i] == '|') { copy[i] = '\0'; #ifdef TNC_DEBUG printf ("att type NOTATION: notation %s allowed\n", ©[start]); #endif Tcl_CreateHashEntry (attDecl->lookupTable, ©[start], &newPtr); entryPtr1 = Tcl_CreateHashEntry (tncdata->notationDecls, ©[start], &newPtr); #ifdef TNC_DEBUG if (newPtr) { printf ("up to now unknown NOTATION\n"); } else { printf ("NOTATION already known\n"); } #endif start = ++i; continue; } clen = UTF8_CHAR_LEN (copy[i]); CHECK_UTF_CHARLEN_COPY (clen); if (!UTF8_GET_NAMING_NMTOKEN (©[i], clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); FREE (copy); return; } i += clen; } } else { /* expat returns something like as att_type "(numbered|bullets)", e.g. in some "non-official" normalized way. Makes things easier for us. */ attDecl->att_type = TNC_ATTTYPE_ENUMERATION; attDecl->lookupTable = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (attDecl->lookupTable, TCL_STRING_KEYS); copy = tdomstrdup (att_type); start = i = 1; while (1) { if (copy[i] == ')') { copy[i] = '\0'; Tcl_CreateHashEntry (attDecl->lookupTable, ©[start], &newPtr); FREE (copy); break; } if (copy[i] == '|') { copy[i] = '\0'; Tcl_CreateHashEntry (attDecl->lookupTable, ©[start], &newPtr); start = ++i; continue; } clen = UTF8_CHAR_LEN (copy[i]); CHECK_UTF_CHARLEN_COPY (clen); if (!UTF8_GET_NAMING_NMTOKEN (©[i], clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); FREE (copy); return; } i += clen; } } if (dflt != NULL) { switch (attDecl->att_type) { case TNC_ATTTYPE_ENTITY: case TNC_ATTTYPE_IDREF: clen = UTF8_CHAR_LEN (*dflt); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAME_START (dflt, clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return; } i = clen; while (1) { if (dflt[i] == '\0') { break; } clen = UTF8_CHAR_LEN (dflt[i]); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAMING_NMTOKEN (&dflt[i], clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return; } i += clen; } if (attDecl->att_type == TNC_ATTTYPE_ENTITY) { entryPtr1 = Tcl_CreateHashEntry (tncdata->entityDecls, dflt, &newPtr); if (!newPtr) { entityInfo = (TNC_EntityInfo *) Tcl_GetHashValue (entryPtr1); if (!entityInfo->is_notation) { signalNotValid (userData,TNC_ERROR_ATT_ENTITY_DEFAULT_MUST_BE_DECLARED); } } } break; case TNC_ATTTYPE_IDREFS: start = i = 0; while (1) { if (dflt[i] == '\0') { break; } if (dflt[i] == ' ') { start = ++i; } if (start == i) { clen = UTF8_CHAR_LEN (dflt[i]); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAME_START (&dflt[i], clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return; } i += clen; } else { clen = UTF8_CHAR_LEN (dflt[i]); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAMING_NMTOKEN (&dflt[i], clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return; } i += clen; } } break; case TNC_ATTTYPE_ENTITIES: copy = tdomstrdup (dflt); start = i = 0; while (1) { if (copy[i] == '\0') { FREE (copy); break; } if (copy[i] == ' ') { copy[i] = '\0'; entryPtr1 = Tcl_CreateHashEntry (tncdata->entityDecls, ©[start], &newPtr); if (!newPtr) { entityInfo = (TNC_EntityInfo *) Tcl_GetHashValue (entryPtr1); if (!entityInfo->is_notation) { signalNotValid (userData,TNC_ERROR_ATT_ENTITY_DEFAULT_MUST_BE_DECLARED); } } start = ++i; } if (start == i) { clen = UTF8_CHAR_LEN (copy[i]); CHECK_UTF_CHARLEN_COPY (clen); if (!UTF8_GET_NAME_START (©[i], clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); FREE (copy); return; } i += clen; } else { clen = UTF8_CHAR_LEN (copy[i]); CHECK_UTF_CHARLEN_COPY (clen); if (!UTF8_GET_NAMING_NMTOKEN (©[i], clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); FREE (copy); return; } i += clen; } } break; case TNC_ATTTYPE_NMTOKEN: i = 0; while (1) { if (dflt[i] == '\0') { break; } clen = UTF8_CHAR_LEN (dflt[i]); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAMING_NMTOKEN (&dflt[i], clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); return; } i += clen; } if (!i) signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); break; case TNC_ATTTYPE_NMTOKENS: i = 0; while (1) { if (dflt[i] == '\0') { break; } if (dflt[i] == ' ') { i++; } clen = UTF8_CHAR_LEN (dflt[i]); CHECK_UTF_CHARLEN (clen); if (!UTF8_GET_NAMING_NMTOKEN (&dflt[i], clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); return; } i += clen; } if (!i) signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); break; case TNC_ATTTYPE_NOTATION: if (!Tcl_FindHashEntry (attDecl->lookupTable, dflt)) { signalNotValid (userData, TNC_ERROR_IMPOSSIBLE_DEFAULT); return; } case TNC_ATTTYPE_ENUMERATION: if (!Tcl_FindHashEntry (attDecl->lookupTable, dflt)) { signalNotValid (userData, TNC_ERROR_IMPOSSIBLE_DEFAULT); return; } case TNC_ATTTYPE_CDATA: case TNC_ATTTYPE_ID: /* This both cases are only there, to pacify -Wall. CDATA may have any allowed characters (and everything else is detected by extpat). ID's not allowed to have defaults (handled above). */ ; } attDecl->dflt = tdomstrdup (dflt); } else { attDecl->dflt = NULL; } if (isrequired) { elemAttInfo->nrOfreq++; } attDecl->isrequired = isrequired; Tcl_SetHashValue (entryPtr, attDecl); } } #ifdef TNC_DEBUG void printNameIDs (TNC_Data *tncdata) { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; for (entryPtr = Tcl_FirstHashEntry (tncdata->tagNames, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry (&search)) { printf ("name: %-20s nameId: %p\n", Tcl_GetHashKey (tncdata->tagNames, entryPtr), entryPtr); } } void printStackElm (TNC_ContentStack *stackelm) { if (stackelm->model->type == XML_CTYPE_NAME) { printf ("\tmodel %p\tNAME: %p\n\tactiveChild %d\n\tdeep %d\n\talreadymatched %d\n", stackelm->model, stackelm->model->nameId, stackelm->activeChild, stackelm->deep, stackelm->alreadymatched); } else { printf ("\tmodel %p\n\tactiveChild %d\n\tdeep %d\n\talreadymatched %d\n", stackelm->model, stackelm->activeChild, stackelm->deep, stackelm->alreadymatched); } } void printTNC_Content (TNC_Content *model) { printf ("TNC_Content..\n\ttype %d\n\tquant %d\n\tnameId %p\n\tnumchildren %d\n\tchildren %p\n", model->type, model->quant, model->nameId, model->numchildren, model->children); } void printContentStack (TNC_Data *tncdata) { TNC_ContentStack stackelm; int i; printf ("Current contentStack state (used stack slots %d):\n", tncdata->contentStackPtr); for (i = 0; i < tncdata->contentStackPtr; i++) { stackelm = tncdata->contentStack[i]; printf ("%3d:\n", i); printStackElm (&stackelm); } } #endif /* TNC_DEBUG */ /* *---------------------------------------------------------------------------- * * TncProbeElement -- * * This function checks, if the element match the * topmost content model on the content stack. * * Results: * 1 if the element match, * 0 if not. * -1 if not, but this isn't a validation error * * Side effects: * Eventually pushes data to the contentStack (even in * recurive calls). * *---------------------------------------------------------------------------- */ static int TncProbeElement ( TNC_NameId *nameId, TNC_Data *tncdata ) { TNC_ContentStack *stackelm; TNC_Content *activeModel; int myStackPtr, zeroMatchPossible, result; unsigned int i, seqstartindex; #ifdef TNC_DEBUG printf ("TncProbeElement start\n"); printContentStack (tncdata); #endif myStackPtr = tncdata->contentStackPtr - 1; stackelm = &(tncdata->contentStack)[myStackPtr]; switch (stackelm->model->type) { case XML_CTYPE_MIXED: #ifdef TNC_DEBUG printf ("TncProbeElement XML_CTYPE_MIXED\n"); #endif for (i = 0; i < stackelm->model->numchildren; i++) { if ((&stackelm->model->children[i])->nameId == nameId) { return 1; } } return 0; case XML_CTYPE_ANY: #ifdef TNC_DEBUG printf ("TncProbeElement XML_CTYPE_ANY\n"); #endif return 1; case XML_CTYPE_EMPTY: #ifdef TNC_DEBUG printf ("TncProbeElement XML_CTYPE_EMPTY\n"); #endif return 0; case XML_CTYPE_CHOICE: #ifdef TNC_DEBUG printf ("TncProbeElement XML_CTYPE_CHOICE\n"); #endif if (stackelm->alreadymatched) { activeModel = &stackelm->model->children[stackelm->activeChild]; if (activeModel->type == XML_CTYPE_NAME) { /* so this stackelement must be the topmost */ if (activeModel->quant == XML_CQUANT_REP || activeModel->quant == XML_CQUANT_PLUS) { /* the last matched element is multiple, maybe it matches again */ if (nameId == activeModel->nameId) { #ifdef TNC_DEBUG printf ("-->matched! child Nr. %d\n", stackelm->activeChild); #endif /* stack and activeChild nr. are already OK, just report success. */ return 1; } } } /* The active child is a SEQ or CHOICE. */ if (stackelm->model->quant == XML_CQUANT_NONE || stackelm->model->quant == XML_CQUANT_OPT) { /*The child cp's type SEQ or CHOICE keep track by themselve about if they are repeated. Because we are here, they don't. Since the current cp has already matched and isn't multiple, the current cp as a whole is done. But no contradiction detected, so return "search further" */ return -1; } } /* If one of the alternatives within the CHOICE cp is quant REP or OPT, it isn't a contradition to the document structure, if the cp doesn't match, even if it is quant NONE or PLUS, because of the "zero time" match of this one alternative. We use zeroMatchPossible, to know about this.*/ zeroMatchPossible = 0; for (i = 0; i < stackelm->model->numchildren; i++) { if ((&stackelm->model->children[i])->type == XML_CTYPE_NAME) { #ifdef TNC_DEBUG printf ("child is type NAME\n"); #endif if ((&stackelm->model->children[i])->nameId == nameId) { #ifdef TNC_DEBUG printf ("-->matched! child Nr. %d\n",i); #endif (&tncdata->contentStack[myStackPtr])->activeChild = i; (&tncdata->contentStack[myStackPtr])->alreadymatched = 1; return 1; } else { /* If the name child is optional, we have a candidat for "zero match". */ if ((&stackelm->model->children[i])->quant == XML_CQUANT_OPT || (&stackelm->model->children[i])->quant == XML_CQUANT_REP) { #ifdef TNC_DEBUG printf ("zero match possible\n"); #endif zeroMatchPossible = 1; } } } else { #ifdef TNC_DEBUG printf ("complex child type\n"); #endif if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *) * 2 * tncdata->contentStackSize); tncdata->contentStackSize *= 2; } (&tncdata->contentStack[tncdata->contentStackPtr])->model = &stackelm->model->children[i]; tncdata->contentStack[tncdata->contentStackPtr].activeChild = 0; tncdata->contentStack[tncdata->contentStackPtr].deep = stackelm->deep + 1; tncdata->contentStack[tncdata->contentStackPtr].alreadymatched = 0; tncdata->contentStackPtr++; result = TncProbeElement (nameId, tncdata); if (result == 1) { #ifdef TNC_DEBUG printf ("-->matched! child nr. %d\n",i); #endif (&tncdata->contentStack[myStackPtr])->activeChild = i; (&tncdata->contentStack[myStackPtr])->alreadymatched = 1; return 1; } /* The child cp says, it doesn't has matched, but says also, it's perfectly OK, if it doesn't at all. So we have a candidat for "zero match". */ if (result == -1) { zeroMatchPossible = 1; } tncdata->contentStackPtr--; } } /* OK, nobody has claimed a match. Question is: try further or is this a document structure error. */ if (zeroMatchPossible || stackelm->alreadymatched || stackelm->model->quant == XML_CQUANT_REP || stackelm->model->quant == XML_CQUANT_OPT) { return -1; } #ifdef TNC_DEBUG printf ("validation error\n"); #endif return 0; case XML_CTYPE_SEQ: #ifdef TNC_DEBUG printf ("TncProbeElement XML_CTYPE_SEQ\n"); #endif if (stackelm->alreadymatched) { activeModel = &stackelm->model->children[stackelm->activeChild]; if (activeModel->type == XML_CTYPE_NAME) { /* so this stackelement must be the topmost */ if (activeModel->quant == XML_CQUANT_REP || activeModel->quant == XML_CQUANT_PLUS) { /* the last matched element is multiple, maybe it matches again */ if (nameId == activeModel->nameId) { #ifdef TNC_DEBUG printf ("-->matched! child Nr. %d\n", stackelm->activeChild); #endif /* stack and activeChild nr. are already OK, just report success. */ return 1; } } } } if (stackelm->alreadymatched) { seqstartindex = stackelm->activeChild + 1; } else { seqstartindex = 0; } /* This time zeroMatchPossible flags, if every of the remaining childs - that may every child, if !alreadymatched - doesn't must occur. We assume, the (outstanding childs of, in case of alreadymatched) current stackelement model has only optional childs, and set to wrong, if we find any non-optional child */ zeroMatchPossible = 1; for (i = seqstartindex; i < stackelm->model->numchildren; i++) { if ((&stackelm->model->children[i])->type == XML_CTYPE_NAME) { if ((&stackelm->model->children[i])->nameId == nameId) { #ifdef TNC_DEBUG printf ("-->matched! child Nr. %d\n",i); #endif (&tncdata->contentStack[myStackPtr])->activeChild = i; (&tncdata->contentStack[myStackPtr])->alreadymatched = 1; return 1; } else if ((&stackelm->model->children[i])->quant == XML_CQUANT_NONE || (&stackelm->model->children[i])->quant == XML_CQUANT_PLUS) { zeroMatchPossible = 0; break; } } else { if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *) * 2 * tncdata->contentStackSize); tncdata->contentStackSize *= 2; } (&tncdata->contentStack[tncdata->contentStackPtr])->model = &stackelm->model->children[i]; tncdata->contentStack[tncdata->contentStackPtr].activeChild = 0; tncdata->contentStack[tncdata->contentStackPtr].deep = stackelm->deep + 1; tncdata->contentStack[tncdata->contentStackPtr].alreadymatched = 0; tncdata->contentStackPtr++; result = TncProbeElement (nameId, tncdata); if (result == 1) { (&tncdata->contentStack[myStackPtr])->activeChild = i; (&tncdata->contentStack[myStackPtr])->alreadymatched = 1; return 1; } tncdata->contentStackPtr--; if (result == 0) { zeroMatchPossible = 0; break; } } } if (!stackelm->alreadymatched) { if (zeroMatchPossible) { /* The stackelm hasn't matched, but don't have to after all. Return try further */ return -1; } else { /* No previous match, but at least one child is necessary. Return depends of the quant of the entire seq */ if (stackelm->model->quant == XML_CQUANT_NONE || stackelm->model->quant == XML_CQUANT_PLUS) { /* DTD claims, the seq as to be there, but isn't */ return 0; } else { /* The seq is optional */ return -1; } } } if (stackelm->alreadymatched) { if (!zeroMatchPossible) { /* Some child at the start of the seq has matched in the past, but since zeroMatchPossible has changed to zero, there must be a non-matching non-optional child later. Error in document structure. */ return 0; } else { /* OK, SEQ has matched befor. But after the last match, there where no required (quant NONE or PLUS) childs. */ if (stackelm->model->quant == XML_CQUANT_NONE || stackelm->model->quant == XML_CQUANT_OPT) { /* The entire seq isn't multiple. Just look further. */ return -1; } } } /* The last untreated case is alreadymatched true, zeroMatchPossible (of the rest of the seq childs after the last match) true and the entire seq may be multiple. Therefore start again with activeChild = 0, to see, if the current nameId starts a repeated match of the seq. By the way: zeroMatchPossible still has initial value 1, therefor no second initialiation is needed */ for (i = 0; i < seqstartindex; i++) { if ((&stackelm->model->children[i])->type == XML_CTYPE_NAME) { if ((&stackelm->model->children[i])->nameId == nameId) { #ifdef TNC_DEBUG printf ("-->matched! child Nr. %d\n",i); #endif (&tncdata->contentStack[myStackPtr])->activeChild = i; (&tncdata->contentStack[myStackPtr])->alreadymatched = 1; return 1; } else if ((&stackelm->model->children[i])->quant == XML_CQUANT_NONE || (&stackelm->model->children[i])->quant == XML_CQUANT_PLUS) { zeroMatchPossible = 0; break; } } else { if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *) * 2 * tncdata->contentStackSize); tncdata->contentStackSize *= 2; } (&tncdata->contentStack[tncdata->contentStackPtr])->model = &stackelm->model->children[i]; tncdata->contentStack[tncdata->contentStackPtr].activeChild = 0; tncdata->contentStack[tncdata->contentStackPtr].deep = stackelm->deep + 1; tncdata->contentStack[tncdata->contentStackPtr].alreadymatched = 0; tncdata->contentStackPtr++; result = TncProbeElement (nameId, tncdata); if (result) { (&tncdata->contentStack[myStackPtr])->activeChild = i; /* alreadymatched is already 1 */ return 1; } tncdata->contentStackPtr--; if (result == 0) { /* OK, the seq doesn't match again. But since it have already matched, this isn't return 0 but.. */ return -1; } } } /* seq doesn't match again and every seq child from the very first up to (not including) the last match aren't required. This last fact may be nice to know, but after all since the entire seq have matched already ... */ return -1; case XML_CTYPE_NAME: /* NAME type doesn't occur at top level of a content model and is handled in some "shotcut" way directly in the CHOICE and SEQ cases. It's only here to pacify gcc -Wall. */ printf ("error!!! - in TncProbeElement: XML_CTYPE_NAME shouldn't reached in any case.\n"); default: printf ("error!!! - in TncProbeElement: unknown content type: %d\n", stackelm->model->type); } /* not reached */ printf ("error!!! - in TncProbeElement: end of function reached.\n"); return 0; } /* *---------------------------------------------------------------------------- * * TncProbeAttribute -- * * This function checks, if the given attribute * and it's value are allowed for this element. * * Results: * 1 if the attribute name/value is OK, * 0 if not. * * Side effects: * Eventually increments the required attributes counter. * *---------------------------------------------------------------------------- */ static int TncProbeAttribute ( void *userData, Tcl_HashTable *elemAtts, char *attrName, char *attrValue, int *nrOfreq ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; TNC_AttDecl *attDecl; char *pc, *copy, save; int clen, i, start, hnew; TNC_EntityInfo *entityInfo; entryPtr = Tcl_FindHashEntry (elemAtts, attrName); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_UNKNOWN_ATTRIBUTE); return 0; } /* NOTE: attribute uniqueness per element is a wellformed constrain and therefor done by expat. */ attDecl = (TNC_AttDecl *) Tcl_GetHashValue (entryPtr); switch (attDecl->att_type) { case TNC_ATTTYPE_CDATA: if (attDecl->isrequired && attDecl->dflt) { if (strcmp (attDecl->dflt, attrValue) != 0) { signalNotValid (userData, TNC_ERROR_WRONG_FIXED_ATTVALUE); return 0; } } break; case TNC_ATTTYPE_ID: pc = (char*)attrValue; clen = UTF8_CHAR_LEN (*pc); CHECK_UTF_CHARLENR (clen); if (!UTF8_GET_NAME_START (pc, clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); } pc += clen; while (1) { if (*pc == '\0') { break; } clen = UTF8_CHAR_LEN (*pc); CHECK_UTF_CHARLENR (clen); if (!UTF8_GET_NAMING_NMTOKEN (pc, clen)) { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return 0; } pc += clen; } entryPtr = Tcl_CreateHashEntry (tncdata->ids, attrValue, &hnew); if (!hnew) { if (Tcl_GetHashValue (entryPtr)) { signalNotValid (userData, TNC_ERROR_DUPLICATE_ID_VALUE); return 0; } } Tcl_SetHashValue (entryPtr, (char *) 1); break; case TNC_ATTTYPE_IDREF: /* Name type constraint "implicit" checked. If the referenced ID exists, the type must be OK, because the type of the ID's within the document are checked. If there isn't such an ID, it's an error anyway. */ if (attrValue[0] == '\0') { signalNotValid (userData, TNC_ERROR_NAME_REQUIRED); return 0; } entryPtr = Tcl_CreateHashEntry (tncdata->ids, attrValue, &hnew); break; case TNC_ATTTYPE_IDREFS: if (attrValue[0] == '\0') { signalNotValid (userData, TNC_ERROR_NAMES_REQUIRED); return 0; } /* Due to attribute value normalization (xml rec 3.3.3) this is a simple list "ref ref ref ..." without leading or trailing spaces and exact one space between the refs. */ start = i = 0; while (attrValue[i]) { if (attrValue[i] == ' ') { save = attrValue[i]; attrValue[i] = '\0'; entryPtr = Tcl_CreateHashEntry (tncdata->ids, &attrValue[start], &hnew); attrValue[i] = save; start = ++i; continue; } i++; } entryPtr = Tcl_CreateHashEntry (tncdata->ids, &attrValue[start], &hnew); break; case TNC_ATTTYPE_ENTITY: /* There is a validity constraint requesting entity attributes values to be type Name. But if there would be an entity declaration that doesn't fit this constraint, expat would have already complained about the definition. So we go the easy way and just look up the att value. If it's declared, type must be OK, if not, it's an error anyway. */ entryPtr = Tcl_FindHashEntry (tncdata->entityDecls, attrValue); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_ENTITY_ATTRIBUTE); return 0; } entityInfo = (TNC_EntityInfo *) Tcl_GetHashValue (entryPtr); if (!entityInfo->is_notation) { signalNotValid (userData, TNC_ERROR_ENTITY_ATTRIBUTE); return 0; } break; case TNC_ATTTYPE_ENTITIES: /* Normalized by exapt; for type see comment to TNC_ATTTYPE_ENTITY */ copy = tdomstrdup (attrValue); start = i = 0; while (1) { if (copy[i] == '\0') { entryPtr = Tcl_FindHashEntry (tncdata->entityDecls, ©[start]); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_ENTITIES_ATTRIBUTE); FREE (copy); return 0; } entityInfo = (TNC_EntityInfo *) Tcl_GetHashValue (entryPtr); if (!entityInfo->is_notation) { signalNotValid (userData, TNC_ERROR_ENTITIES_ATTRIBUTE); FREE (copy); return 0; } FREE (copy); break; } if (copy[i] == ' ') { copy[i] = '\0'; entryPtr = Tcl_FindHashEntry (tncdata->entityDecls, ©[start]); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_ENTITIES_ATTRIBUTE); FREE (copy); return 0; } entityInfo = (TNC_EntityInfo *) Tcl_GetHashValue (entryPtr); if (!entityInfo->is_notation) { signalNotValid (userData, TNC_ERROR_ENTITIES_ATTRIBUTE); FREE (copy); return 0; } start = ++i; continue; } i++; } break; case TNC_ATTTYPE_NMTOKEN: /* We assume, that the UTF-8 representation of the value is valid (no partial chars, minimum encoding). This makes things a little more easy and faster. I guess (but haven't deeply checked - QUESTION -), expat would have already complained otherwise. */ pc = (char*)attrValue; clen = 0; while (1) { if (*pc == '\0') { break; } clen = UTF8_CHAR_LEN (*pc); CHECK_UTF_CHARLENR (clen); if (!UTF8_GET_NAMING_NMTOKEN (pc, clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); return 0; } pc += clen; } if (!clen) signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); break; case TNC_ATTTYPE_NMTOKENS: pc = (char*)attrValue; clen = 0; while (1) { if (*pc == '\0') { break; } /* NMTOKENS are normalized by expat, so this should be secure. */ if (*pc == ' ') { pc++; } clen = UTF8_CHAR_LEN (*pc); CHECK_UTF_CHARLENR (clen); if (!UTF8_GET_NAMING_NMTOKEN (pc, clen)) { signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); return 0; } pc += clen; } if (!clen) signalNotValid (userData, TNC_ERROR_NMTOKEN_REQUIRED); break; case TNC_ATTTYPE_NOTATION: entryPtr = Tcl_FindHashEntry (attDecl->lookupTable, attrValue); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_NOTATION_REQUIRED); return 0; } break; case TNC_ATTTYPE_ENUMERATION: if (!Tcl_FindHashEntry (attDecl->lookupTable, attrValue)) { signalNotValid (userData, TNC_ERROR_ENUM_ATT_WRONG_VALUE); return 0; } break; } if (attDecl->isrequired) { (*nrOfreq)++; } return 1; } /* *---------------------------------------------------------------------------- * * TncElementStartCommand -- * * This procedure is called for every element start event * while parsing XML Data with a "tnc" enabled tclexpat * parser. Checks, if the element can occur here and if it * has an acceptable set of attributes. * * Results: * None. * * Side effects: * Eventually signals application error. * *---------------------------------------------------------------------------- */ void TncElementStartCommand ( void *userData, const char *name, const char **atts ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; Tcl_HashTable *elemAtts; const char **atPtr; TNC_ElemAttInfo *elemAttInfo; TNC_Content *model; int result, nrOfreq, acceptNoDoctype = 0; #ifdef TNC_DEBUG printf ("TncElementStartCommand name: %s\n", name); #endif /* If the document doesn't have a doctype declaration, but the user have used the -useForeignDTD 1 feature, the collected data out of the provided DTD isn't postprocessed by TncElementStartCommand. We do this now. NOTE: Since there wasn't a doctype declaration, there is no information available which element is expected to be the document element. Eventually it would be desirable, to set this somehow. For now, this means, that every valid subtree of the given DTD information is accepted. */ if (!tncdata->contentStackPtr && !tncdata->elemContentsRewriten) { TncEndDoctypeDeclHandler (userData); acceptNoDoctype = 1; } entryPtr = Tcl_FindHashEntry (tncdata->tagNames, name); if (!entryPtr) { signalNotValid (userData, TNC_ERROR_UNKNOWN_ELEMENT); return; } model = (TNC_Content *) Tcl_GetHashValue (entryPtr); switch (model->type) { case XML_CTYPE_MIXED: case XML_CTYPE_ANY: tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 1; break; case XML_CTYPE_EMPTY: tncdata->skipWhiteCDATAs = 0; break; case XML_CTYPE_CHOICE: case XML_CTYPE_SEQ: tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 0; break; case XML_CTYPE_NAME: break; } if (tncdata->contentStackPtr) { /* This is the normal case, within some content, at least the root element content. */ while (1) { result = TncProbeElement (entryPtr, tncdata); if (result == -1) { if (tncdata->contentStack[tncdata->contentStackPtr - 1].deep == 0) { signalNotValid (userData, TNC_ERROR_ELEMENT_NOT_ALLOWED_HERE); return; } tncdata->contentStackPtr--; continue; } if (result) { break; } if (!result) { signalNotValid (userData, TNC_ERROR_ELEMENT_NOT_ALLOWED_HERE); return; } } if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStackSize *= 2; tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *)*tncdata->contentStackSize); } (&tncdata->contentStack[tncdata->contentStackPtr])->model = model; (&tncdata->contentStack[tncdata->contentStackPtr])->activeChild = 0; (&tncdata->contentStack[tncdata->contentStackPtr])->deep = 0; (&tncdata->contentStack[tncdata->contentStackPtr])->alreadymatched = 0; tncdata->contentStackPtr++; } else { /* This is only in case of the root element */ if (atts) { if (!tncdata->doctypeName) { if (!acceptNoDoctype) { signalNotValid (userData, TNC_ERROR_NO_DOCTYPE_DECL); return; } } else { if (strcmp (tncdata->doctypeName, name) != 0) { signalNotValid (userData, TNC_ERROR_WRONG_ROOT_ELEMENT); return; } } } (&(tncdata->contentStack)[0])->model = model; (&(tncdata->contentStack)[0])->activeChild = 0; (&(tncdata->contentStack)[0])->deep = 0; (&(tncdata->contentStack)[0])->alreadymatched = 0; tncdata->contentStackPtr++; } if (atts) { elemAttInfo = model->attInfo; if (!elemAttInfo) { if (atts[0] != NULL) { signalNotValid (userData, TNC_ERROR_NO_ATTRIBUTES); return; } } else { elemAtts = elemAttInfo->attributes; nrOfreq = 0; for (atPtr = atts; atPtr[0]; atPtr += 2) { if (!TncProbeAttribute (userData, elemAtts, (char *) atPtr[0], (char *) atPtr[1], &nrOfreq)) return; } if (nrOfreq != elemAttInfo->nrOfreq) { signalNotValid (userData, TNC_ERROR_MISSING_REQUIRED_ATTRIBUTE); return; } } } else { tncdata->elemAttInfo = model->attInfo; } #ifdef TNC_DEBUG printf ("TncElementStartCommand end\n"); #endif } /* *---------------------------------------------------------------------------- * * TncProbeElementEnd -- * * This procedure checks, if the current content allows the * the element to end here. * * Results: * 1 if element end is OK, * 0 if not. * * Side effects: * Let the contentStackPtr point to the last current content * model before the element had started. * *---------------------------------------------------------------------------- */ static int TncProbeElementEnd ( TNC_Data *tncdata ) { TNC_ContentStack stackelm; unsigned int i; int zeroMatchPossible, seqstartindex; stackelm = tncdata->contentStack[tncdata->contentStackPtr - 1]; switch (stackelm.model->type) { case XML_CTYPE_MIXED: case XML_CTYPE_ANY: case XML_CTYPE_EMPTY: return 1; case XML_CTYPE_CHOICE: if (stackelm.alreadymatched) { return 1; } if (stackelm.model->quant == XML_CQUANT_REP || stackelm.model->quant == XML_CQUANT_OPT) { return 1; } zeroMatchPossible = 0; for (i = 0; i < stackelm.model->numchildren; i++) { if ((&stackelm.model->children[i])->type == XML_CTYPE_NAME) { if ((&stackelm.model->children[i])->quant == XML_CQUANT_OPT || (&stackelm.model->children[i])->quant == XML_CQUANT_REP) { zeroMatchPossible = 1; break; } } else { if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *) * 2 * tncdata->contentStackSize); tncdata->contentStackSize *= 2; } (&tncdata->contentStack[tncdata->contentStackPtr])->model = &stackelm.model->children[i]; tncdata->contentStack[tncdata->contentStackPtr].activeChild = 0; tncdata->contentStack[tncdata->contentStackPtr].deep = stackelm.deep + 1; tncdata->contentStack[tncdata->contentStackPtr].alreadymatched = 0; tncdata->contentStackPtr++; if (TncProbeElementEnd (tncdata)) { zeroMatchPossible = 1; tncdata->contentStackPtr--; break; } tncdata->contentStackPtr--; } } if (zeroMatchPossible) { return 1; } else { return 0; } case XML_CTYPE_SEQ: if (!stackelm.alreadymatched) { if (stackelm.model->quant == XML_CQUANT_REP || stackelm.model->quant == XML_CQUANT_OPT) { return 1; } } if (!stackelm.alreadymatched) { seqstartindex = 0; } else { seqstartindex = stackelm.activeChild + 1; } for (i = seqstartindex; i < stackelm.model->numchildren; i++) { if ((&stackelm.model->children[i])->type == XML_CTYPE_NAME) { if ((&stackelm.model->children[i])->quant == XML_CQUANT_OPT || (&stackelm.model->children[i])->quant == XML_CQUANT_REP) { continue; } else { return 0; } } else { if (tncdata->contentStackPtr == tncdata->contentStackSize) { tncdata->contentStack = (TNC_ContentStack *) Tcl_Realloc ((char *)tncdata->contentStack, sizeof (TNC_Content *) * 2 * tncdata->contentStackSize); tncdata->contentStackSize *= 2; } (&tncdata->contentStack[tncdata->contentStackPtr])->model = &stackelm.model->children[i]; tncdata->contentStack[tncdata->contentStackPtr].activeChild = 0; tncdata->contentStack[tncdata->contentStackPtr].deep = stackelm.deep + 1; tncdata->contentStack[tncdata->contentStackPtr].alreadymatched = 0; tncdata->contentStackPtr++; if (TncProbeElementEnd (tncdata)) { tncdata->contentStackPtr--; continue; } else { tncdata->contentStackPtr--; return 0; } } } return 1; case XML_CTYPE_NAME: /* NAME type doesn't occur at top level of a content model and is handled in some "shotcut" way directly in the CHOICE and SEQ cases. It's only here to pacify gcc -Wall. */ fprintf (stderr, "error!!! - in TncProbeElementEnd: XML_CTYPE_NAME " "shouldn't be reached in any case.\n"); default: fprintf (stderr, "error!!! - in TncProbeElementEnd: unknown content " "type: %d\n", stackelm.model->type); return 1; } } /* *---------------------------------------------------------------------------- * * TncElementEndCommand -- * * This procedure is called for every element end event * while parsing XML Data with a "tnc" enabled tclexpat * parser. Checks, if the content model allows the element * to end at this point. * * Results: * None. * * Side effects: * Eventually signals application error. * *---------------------------------------------------------------------------- */ void TncElementEndCommand ( void *userData, const char *name ) { TNC_Data *tncdata = (TNC_Data *) userData; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; #ifdef TNC_DEBUG printf ("TncElementEndCommand start\n"); printContentStack (tncdata); #endif while (1) { if (!TncProbeElementEnd (tncdata)) { signalNotValid (userData, TNC_ERROR_ELEMENT_CAN_NOT_END_HERE); return; } if (tncdata->contentStack[tncdata->contentStackPtr - 1].deep == 0) { break; } tncdata->contentStackPtr--; } /* Remove the content model of the closed element from the stack */ tncdata->contentStackPtr--; #ifdef TNC_DEBUG printf ("after removing ended element from the stack\n"); printContentStack (tncdata); #endif if (tncdata->contentStackPtr) { switch ((&tncdata->contentStack[tncdata->contentStackPtr - 1])->model->type) { case XML_CTYPE_MIXED: case XML_CTYPE_ANY: tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 1; break; case XML_CTYPE_EMPTY: tncdata->skipWhiteCDATAs = 0; break; case XML_CTYPE_CHOICE: case XML_CTYPE_SEQ: case XML_CTYPE_NAME: tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 0; break; } } else { /* This means, the root element is closed, therefor the place to check, if every IDREF points to a ID. */ if (tncdata->idCheck) { for (entryPtr = Tcl_FirstHashEntry (tncdata->ids, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry (&search)) { #ifdef TNC_DEBUG printf ("check id value %s\n", Tcl_GetHashKey (tncdata->ids, entryPtr)); printf ("value %p\n", Tcl_GetHashValue (entryPtr)); #endif if (!Tcl_GetHashValue (entryPtr)) { signalNotValid (userData, TNC_ERROR_UNKNOWN_ID_REFERRED); return; } } } } } /* *---------------------------------------------------------------------------- * * TncCharacterdataCommand -- * * This procedure is called with a piece of CDATA found in * document. * * Results: * None. * * Side effects: * Eventually signals application error. * *---------------------------------------------------------------------------- */ void TncCharacterdataCommand ( void *userData, const char *data, int len ) { TNC_Data *tncdata = (TNC_Data *) userData; int i; char *pc; if (!tncdata->skipWhiteCDATAs && len > 0) { signalNotValid (userData, TNC_ERROR_EMPTY_ELEMENT); return; } if (!tncdata->ignorePCDATA) { for (i = 0, pc = (char*)data; i < len; i++, pc++) { if ( (*pc == ' ') || (*pc == '\n') || (*pc == '\r') || (*pc == '\t') ) { continue; } signalNotValid (userData, TNC_ERROR_DISALLOWED_PCDATA); return; } } } /* *---------------------------------------------------------------------------- * * TncStartCdataSectionHandler -- * * This procedure is called at the start of a CDATA section * within the document. * * Results: * None. * * Side effects: * Eventually signals application error. * *---------------------------------------------------------------------------- */ void TncStartCdataSectionHandler ( void *userData ) { TNC_Data *tncdata = (TNC_Data *) userData; if (!tncdata->ignorePCDATA) { signalNotValid (userData, TNC_ERROR_DISALLOWED_CDATA); } } /* *---------------------------------------------------------------------------- * * validateNodeAttributes -- * * Validates the attributes of the given domNode. The domNode must be * an ELEMENT_NODE. * * Results: * 1 if OK, 0 for validation error. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int validateNodeAttributes ( TNC_Data *tncdata, TNC_ElemAttInfo *elemAttInfo, domNode *node ) { int nrOfreq; domAttrNode *attr; if (!elemAttInfo) { if (node->firstAttr) { signalNotValid (tncdata, TNC_ERROR_NO_ATTRIBUTES); return 0; } } else { attr = node->firstAttr; nrOfreq = 0; while (attr) { if (!TncProbeAttribute (tncdata, elemAttInfo->attributes, attr->nodeName, attr->nodeValue, &nrOfreq)) return 0; attr = attr->nextSibling; } if (nrOfreq != elemAttInfo->nrOfreq) { signalNotValid (tncdata, TNC_ERROR_MISSING_REQUIRED_ATTRIBUTE); return 0; } } return 1; } /* *---------------------------------------------------------------------------- * * validateTree -- * * Validates a complete DOM (sub-)tree against a the DTD informations in * the given tncdata structure. The node argument acts as root of the * (sub-)tree. * * Results: * 1 if OK, 0 for validation error. * * Side effects: * May alter the context state part of the tnc clientData (and even * mallocs additional memory for them). * *---------------------------------------------------------------------------- */ static int validateTree ( TNC_Data *tncdata, domNode *node ) { domNode *child; switch (node->nodeType) { case ELEMENT_NODE: TncElementStartCommand (tncdata, node->nodeName, NULL); if (tncdata->dtdstatus) return 0; if (!validateNodeAttributes (tncdata, tncdata->elemAttInfo, node)) return 0; if (node->firstChild) { child = node->firstChild; while (child) { if (!validateTree (tncdata, child)) return 0; child = child->nextSibling; } } TncElementEndCommand (tncdata, node->nodeName); if (tncdata->dtdstatus) return 0; break; case TEXT_NODE: case CDATA_SECTION_NODE: TncCharacterdataCommand (tncdata, ((domTextNode*)node)->nodeValue, ((domTextNode*)node)->valueLength); if (tncdata->dtdstatus) return 0; break; case COMMENT_NODE: case PROCESSING_INSTRUCTION_NODE: break; default: signalNotValid (tncdata, TNC_ERROR_UNKNOWN_NODE_TYPE); return 0; } return 1; } /* *---------------------------------------------------------------------------- * * tnc_ValidateObjCmd * * Implements the validateObjCmds. See the user documentation * for details. * * Results: * A standard Tcl result. * * Side effects: * May alter some parts of the tnc_ValidateObjCmd clientData * structure. * *---------------------------------------------------------------------------- */ static int tnc_ValidateObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[] ) { TNC_Data *tncdata = (TNC_Data*) clientData; int methodIndex, result = 1; domNode *node; char *errMsg = NULL; Tcl_HashEntry *entryPtr; TNC_Content *model; static const char *validateMethods[] = { "validateTree", "validateDocument", "validateAttributes", "delete", NULL }; enum validateMethod { m_validateTree, m_validateDocument, m_validateAttributes, m_delete }; if (objc < 2 || objc > 4) { SetResult (validateCmd_usage); return TCL_ERROR; } if (Tcl_GetIndexFromObj (interp, objv[1], validateMethods, "method", 0, &methodIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum validateMethod) methodIndex) { case m_validateTree: if (objc < 3 || objc > 4) { SetResult (validateCmd_usage); return TCL_ERROR; } node = tcldom_getNodeFromName ( interp, Tcl_GetStringFromObj(objv[2], NULL), &errMsg ); if (!node || (node->nodeType != ELEMENT_NODE)) { SetResult ("The validateTree method needs a domNode as argument."); return TCL_ERROR; } tncdata->dtdstatus = 0; tncdata->idCheck = 0; if (tncdata->ids->numEntries) { Tcl_DeleteHashTable (tncdata->ids); Tcl_InitHashTable (tncdata->ids, TCL_STRING_KEYS); } tncdata->contentStackPtr = 0; Tcl_ResetResult (interp); result = validateTree (tncdata, node); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } if (result) { SetBooleanResult (1); } else { SetBooleanResult (0); } break; case m_validateDocument: if (objc < 3 || objc > 4) { SetResult (validateCmd_usage); return TCL_ERROR; } node = (domNode *) tcldom_getDocumentFromName ( interp, Tcl_GetStringFromObj (objv[2], NULL), &errMsg ); if (!node) { SetResult ("The validateDocument method needs a domDocument as argument."); return TCL_ERROR; } node = ((domDocument *) node)->documentElement; if (!tncdata->doctypeName) { signalNotValid (tncdata, TNC_ERROR_NO_DOCTYPE_DECL); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } SetBooleanResult (0); return TCL_OK; } if (strcmp (tncdata->doctypeName, node->nodeName) != 0) { signalNotValid (tncdata, TNC_ERROR_WRONG_ROOT_ELEMENT); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } SetBooleanResult (0); return TCL_OK; } tncdata->dtdstatus = 0; tncdata->idCheck = 1; if (tncdata->ids->numEntries) { Tcl_DeleteHashTable (tncdata->ids); Tcl_InitHashTable (tncdata->ids, TCL_STRING_KEYS); } tncdata->contentStackPtr = 0; Tcl_ResetResult (interp); result = validateTree (tncdata, node); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } if (result) { SetBooleanResult (1); } else { SetBooleanResult (0); } break; case m_validateAttributes: if (objc < 3 || objc > 4) { SetResult (validateCmd_usage); return TCL_ERROR; } node = tcldom_getNodeFromName ( interp, Tcl_GetStringFromObj(objv[2], NULL), &errMsg ); if (!node || (node->nodeType != ELEMENT_NODE)) { SetResult ("The validateAttributes method needs a domNode as argument."); return TCL_ERROR; } entryPtr = Tcl_FindHashEntry (tncdata->tagNames, node->nodeName); if (!entryPtr) { signalNotValid (tncdata, TNC_ERROR_UNKNOWN_ELEMENT); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } SetBooleanResult (0); return TCL_OK; } model = (TNC_Content *) Tcl_GetHashValue (entryPtr); tncdata->dtdstatus = 0; tncdata->idCheck = 0; if (tncdata->ids->numEntries) { Tcl_DeleteHashTable (tncdata->ids); Tcl_InitHashTable (tncdata->ids, TCL_STRING_KEYS); } Tcl_ResetResult (interp); result = validateNodeAttributes (tncdata, model->attInfo, node); if (objc == 4) { if (Tcl_ObjSetVar2(interp, objv[3], NULL, Tcl_GetObjResult(interp), 0) == NULL) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "couldn't save msg in variable", -1); return TCL_ERROR; } } if (result) { SetBooleanResult (1); } else { SetBooleanResult (0); } break; case m_delete: if (objc != 2) { SetResult (validateCmd_usage); return TCL_ERROR; } Tcl_DeleteCommand (interp, Tcl_GetStringFromObj (objv[0], NULL)); SetResult (""); break; } return TCL_OK; } /* *---------------------------------------------------------------------------- * * FreeTncData * * Helper proc, used from TncResetProc and TncFreeProc. Frees all * collected DTD data and the id table. * * Results: * None. * * Side effects: * Frees memory. * *---------------------------------------------------------------------------- */ static void FreeTncData ( TNC_Data *tncdata ) { Tcl_HashEntry *entryPtr, *attentryPtr; Tcl_HashSearch search, attsearch; TNC_Content *model; TNC_ElemAttInfo *elemAttInfo; TNC_EntityInfo *entityInfo; TNC_AttDecl *attDecl; if (tncdata->elemContentsRewriten) { entryPtr = Tcl_FirstHashEntry (tncdata->tagNames, &search); while (entryPtr) { model = Tcl_GetHashValue (entryPtr); if (model) { TncFreeTncModel (model); FREE ((char *) model); } entryPtr = Tcl_NextHashEntry (&search); } } Tcl_DeleteHashTable (tncdata->tagNames); entryPtr = Tcl_FirstHashEntry (tncdata->attDefsTables, &search); while (entryPtr) { elemAttInfo = Tcl_GetHashValue (entryPtr); if (!elemAttInfo) { entryPtr = Tcl_NextHashEntry (&search); continue; } attentryPtr = Tcl_FirstHashEntry (elemAttInfo->attributes, &attsearch); while (attentryPtr) { attDecl = Tcl_GetHashValue (attentryPtr); if (attDecl) { if (attDecl->att_type == TNC_ATTTYPE_NOTATION || attDecl->att_type == TNC_ATTTYPE_ENUMERATION) { Tcl_DeleteHashTable (attDecl->lookupTable); FREE ((char *) attDecl->lookupTable); } if (attDecl->dflt) { FREE (attDecl->dflt); } FREE ((char *) attDecl); } attentryPtr = Tcl_NextHashEntry (&attsearch); } Tcl_DeleteHashTable (elemAttInfo->attributes); FREE ((char *) elemAttInfo->attributes); FREE ((char *) elemAttInfo); entryPtr = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (tncdata->attDefsTables); entryPtr = Tcl_FirstHashEntry (tncdata->entityDecls, &search); while (entryPtr) { entityInfo = Tcl_GetHashValue (entryPtr); if (entityInfo) { if (entityInfo->is_notation) { FREE (entityInfo->notationName); } FREE ((char *) entityInfo); } entryPtr = Tcl_NextHashEntry (&search); } Tcl_DeleteHashTable (tncdata->entityDecls); Tcl_DeleteHashTable (tncdata->notationDecls); Tcl_DeleteHashTable (tncdata->ids); if (tncdata->doctypeName) { FREE (tncdata->doctypeName); } } /* *---------------------------------------------------------------------------- * * TncResetProc * * Called for C handler set specific reset actions in case of * parser reset. * * Results: * None. * * Side effects: * Resets the "userData" of the C handler set parser extension. * *---------------------------------------------------------------------------- */ void TncResetProc ( Tcl_Interp *interp, void *userData ) { TNC_Data *tncdata = (TNC_Data *) userData; FreeTncData (tncdata); Tcl_InitHashTable (tncdata->tagNames, TCL_STRING_KEYS); tncdata->elemContentsRewriten = 0; tncdata->dtdstatus = 0; tncdata->idCheck = 1; Tcl_InitHashTable (tncdata->attDefsTables, TCL_STRING_KEYS); Tcl_InitHashTable (tncdata->entityDecls, TCL_STRING_KEYS); Tcl_InitHashTable (tncdata->notationDecls, TCL_STRING_KEYS); Tcl_InitHashTable (tncdata->ids, TCL_STRING_KEYS); tncdata->doctypeName = NULL; tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 0; tncdata->contentStackPtr = 0; } /* *---------------------------------------------------------------------------- * * createTncData -- * * Helper proc. Allocates a TNC_Data structure and initializes it. * * Results: * None. * * Side effects: * Memory allocation and initialization. * *---------------------------------------------------------------------------- */ static TNC_Data * createTncData ( Tcl_Interp *interp, Tcl_Obj *expatObj ) { TNC_Data *tncdata; tncdata = (TNC_Data *) MALLOC (sizeof (TNC_Data)); tncdata->tagNames = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (tncdata->tagNames, TCL_STRING_KEYS); tncdata->elemContentsRewriten = 0; tncdata->dtdstatus = 0; tncdata->idCheck = 1; tncdata->attDefsTables = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (tncdata->attDefsTables, TCL_STRING_KEYS); tncdata->entityDecls = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (tncdata->entityDecls, TCL_STRING_KEYS); tncdata->notationDecls = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (tncdata->notationDecls, TCL_STRING_KEYS); tncdata->ids = (Tcl_HashTable *) MALLOC (sizeof (Tcl_HashTable)); Tcl_InitHashTable (tncdata->ids, TCL_STRING_KEYS); tncdata->doctypeName = NULL; tncdata->interp = interp; tncdata->expatObj = expatObj; tncdata->skipWhiteCDATAs = 1; tncdata->ignorePCDATA = 0; tncdata->contentStack = (TNC_ContentStack *) MALLOC (sizeof (TNC_ContentStack) * TNC_INITCONTENTSTACKSIZE); tncdata->contentStackSize = TNC_INITCONTENTSTACKSIZE; tncdata->contentStackPtr = 0; return tncdata; } /* *---------------------------------------------------------------------------- * * TncFreeProc * * Called for C handler set specific cleanup in case of parser * delete. * * Results: * None. * * Side effects: * C handler set specific userData gets free'd. * *---------------------------------------------------------------------------- */ void TncFreeProc ( Tcl_Interp *interp, void *userData ) { TNC_Data *tncdata = (TNC_Data *) userData; FreeTncData (tncdata); FREE ((char *) tncdata->tagNames); FREE ((char *) tncdata->attDefsTables); FREE ((char *) tncdata->entityDecls); FREE ((char *) tncdata->notationDecls); FREE ((char *) tncdata->ids); FREE ((char *) tncdata->contentStack); FREE ((char *) tncdata); } /* *---------------------------------------------------------------------------- * * tnc_ValidateObjDeleteCmd * * Called when a validateObjCmd is deleted. It's infact nothing * but a wrapper for TncFreeProc. * * Results: * None. * * Side effects: * The clientData structure will be freed, during cleanup routine calls. * *---------------------------------------------------------------------------- */ static void tnc_ValidateObjDeleteCmd ( ClientData clientData ) { TNC_Data *tncdata = (TNC_Data*) clientData; TncFreeProc (tncdata->interp, tncdata); } /* *---------------------------------------------------------------------------- * * TclTncObjCmd -- * * This procedure is invoked to process the "tnc" command. * * Results: * A standard Tcl result. * * Side effects: * The expat parser object provided as argument is enhanced by * by the "tnc" handler set. * *---------------------------------------------------------------------------- */ int TclTncObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *const objv[]; { char *cmdName, s[20]; CHandlerSet *handlerSet; int methodIndex, result; TNC_Data *tncdata; static const char *tncMethods[] = { "enable", "remove", "getValidateCmd", NULL }; enum tncMethod { m_enable, m_remove, m_getValidateCmd }; if (!CheckExpatParserObj (interp, objv[1])) { SetResult ("First argument has to be a expat parser object"); return TCL_ERROR; } if (Tcl_GetIndexFromObj (interp, objv[2], tncMethods, "method", 0, &methodIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum tncMethod) methodIndex) { case m_enable: if (objc != 3) { Tcl_WrongNumArgs (interp, 1, objv, tnc_usage); return TCL_ERROR; } handlerSet = CHandlerSetCreate ("tnc"); handlerSet->userData = createTncData (interp, objv[1]); handlerSet->ignoreWhiteCDATAs = 0; handlerSet->resetProc = TncResetProc; handlerSet->freeProc = TncFreeProc; handlerSet->elementDeclCommand = TncElementDeclCommand; handlerSet->attlistDeclCommand = TncAttDeclCommand; handlerSet->entityDeclCommand = TncEntityDeclHandler; handlerSet->notationcommand = TncNotationDeclHandler; handlerSet->elementstartcommand = TncElementStartCommand; handlerSet->elementendcommand = TncElementEndCommand; handlerSet->datacommand = TncCharacterdataCommand; handlerSet->startCdataSectionCommand = TncStartCdataSectionHandler; handlerSet->startDoctypeDeclCommand = TncStartDoctypeDeclHandler; handlerSet->endDoctypeDeclCommand = TncEndDoctypeDeclHandler; result = CHandlerSetInstall (interp, objv[1], handlerSet); if (result != 0) { SetResult ("already have tnc C handler set"); TncFreeProc (interp, handlerSet->userData); FREE (handlerSet->name); FREE ((char *) handlerSet); return TCL_ERROR; } return TCL_OK; case m_remove: if (objc != 3) { Tcl_WrongNumArgs (interp, 1, objv, tnc_usage); return TCL_ERROR; } result = CHandlerSetRemove (interp, objv[1], "tnc"); if (result == 1) { /* This should not happen if CheckExpatParserObj() is used. */ SetResult ("argument has to be a expat parser object"); return TCL_ERROR; } if (result == 2) { SetResult("expat parser obj hasn't a C handler set named \"tnc\""); return TCL_ERROR; } return TCL_OK; case m_getValidateCmd: if (objc != 3 && objc != 4) { Tcl_WrongNumArgs (interp, 1, objv, tnc_usage); return TCL_ERROR; } handlerSet = CHandlerSetGet (interp, objv[1], "tnc"); if (!handlerSet) { SetResult("expat parser obj hasn't a C handler set named \"tnc\""); return TCL_ERROR; } tncdata = (TNC_Data *) handlerSet->userData; if (!tncdata->dtdstatus) { SetResult ("No complete and error free DTD data available."); return TCL_ERROR; } /* After we finished, the validator structure is its own command, there isn't a parser cmd anymore. */ tncdata->expatObj = NULL; tncdata->dtdstatus = 0; handlerSet->userData = createTncData (interp, objv[1]); if (objc == 4) { cmdName = Tcl_GetStringFromObj (objv[3], NULL); } else { FindUniqueCmdName (interp, s); cmdName = s; } Tcl_CreateObjCommand (interp, cmdName, tnc_ValidateObjCmd, tncdata, tnc_ValidateObjDeleteCmd); Tcl_SetResult (interp, cmdName, TCL_VOLATILE); return TCL_OK; default: Tcl_SetResult (interp, "unknown method", NULL); return TCL_ERROR; } } #ifdef BUILD_tnc # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT #endif /* *---------------------------------------------------------------------------- * * Tnc_Init -- * * Initialization routine for loadable module * * Results: * None. * * Side effects: * Defines "tnc" enhancement command for expat parser obj * *---------------------------------------------------------------------------- */ #if defined(_MSC_VER) || defined(__MINGW32__) # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT #endif EXTERN int Tnc_Init (interp) Tcl_Interp *interp; { #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8", 0) == NULL) { return TCL_ERROR; } #endif #ifdef USE_TDOM_STUBS if (Tdom_InitStubs(interp, "0.8", 0) == NULL) { return TCL_ERROR; } #endif Tcl_PkgRequire (interp, "tdom", NULL, 0); Tcl_CreateObjCommand (interp, "tnc", TclTncObjCmd, NULL, NULL ); Tcl_PkgProvide (interp, "tnc", PACKAGE_VERSION); return TCL_OK; } tdom-0.9.1/extensions/tnc/PaxHeaders.9215/win0000644000175000001440000000013213325450307017134 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532446226.521747815 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/0000755000175000001440000000000013325450307016427 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tnc/win/PaxHeaders.9215/rules.vc0000644000175000001440000000013213325450307020675 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/rules.vc0000644000175000001440000016004113325450307020115 0ustar00rolfusers00000000000000#------------------------------------------------------------- -*- makefile -*- # rules.vc -- # # Part of the nmake based build system for Tcl and its extensions. # This file does all the hard work in terms of parsing build options, # compiler switches, defining common targets and macros. The Tcl makefile # directly includes this. Extensions include it via "rules-ext.vc". # # See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for # detailed documentation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2003 David Gravereaux. # Copyright (c) 2003-2008 Patrick Thoyts # Copyright (c) 2017 Ashok P. Nadkarni #------------------------------------------------------------------------------ !ifndef _RULES_VC _RULES_VC = 1 # The following macros define the version of the rules.vc nmake build system # For modifications that are not backward-compatible, you *must* change # the major version. RULES_VERSION_MAJOR = 1 RULES_VERSION_MINOR = 1 # The PROJECT macro must be defined by parent makefile. !if "$(PROJECT)" == "" !error *** Error: Macro PROJECT not defined! Please define it before including rules.vc !endif !if "$(PRJ_PACKAGE_TCLNAME)" == "" PRJ_PACKAGE_TCLNAME = $(PROJECT) !endif # Also special case Tcl and Tk to save some typing later DOING_TCL = 0 DOING_TK = 0 !if "$(PROJECT)" == "tcl" DOING_TCL = 1 !elseif "$(PROJECT)" == "tk" DOING_TK = 1 !endif !ifndef NEED_TK # Backwards compatibility !ifdef PROJECT_REQUIRES_TK NEED_TK = $(PROJECT_REQUIRES_TK) !else NEED_TK = 0 !endif !endif !ifndef NEED_TCL_SOURCE NEED_TCL_SOURCE = 0 !endif !ifdef NEED_TK_SOURCE !if $(NEED_TK_SOURCE) NEED_TK = 1 !endif !else NEED_TK_SOURCE = 0 !endif ################################################################ # Nmake is a pretty weak environment in syntax and capabilities # so this file is necessarily verbose. It's broken down into # the following parts. # # 0. Sanity check that compiler environment is set up and initialize # any built-in settings from the parent makefile # 1. First define the external tools used for compiling, copying etc. # as this is independent of everything else. # 2. Figure out our build structure in terms of the directory, whether # we are building Tcl or an extension, etc. # 3. Determine the compiler and linker versions # 4. Build the nmakehlp helper application # 5. Determine the supported compiler options and features # 6. Parse the OPTS macro value for user-specified build configuration # 7. Parse the STATS macro value for statistics instrumentation # 8. Parse the CHECKS macro for additional compilation checks # 9. Extract Tcl, and possibly Tk, version numbers from the headers # 10. Based on this selected configuration, construct the output # directory and file paths # 11. Construct the paths where the package is to be installed # 12. Set up the actual options passed to compiler and linker based # on the information gathered above. # 13. Define some standard build targets and implicit rules. These may # be optionally disabled by the parent makefile. # 14. (For extensions only.) Compare the configuration of the target # Tcl and the extensions and warn against discrepancies. # # One final note about the macro names used. They are as they are # for historical reasons. We would like legacy extensions to # continue to work with this make include file so be wary of # changing them for consistency or clarity. # 0. Sanity check compiler environment # Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or # VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) MSG = ^ Visual C++ compiler environment not initialized. !error $(MSG) !endif # We need to run from the directory the parent makefile is located in. # nmake does not tell us what makefile was used to invoke it so parent # makefile has to set the MAKEFILEVC macro or we just make a guess and # warn if we think that is not the case. !if "$(MAKEFILEVC)" == "" !if exist("$(PROJECT).vc") MAKEFILEVC = $(PROJECT).vc !elseif exist("makefile.vc") MAKEFILEVC = makefile.vc !endif !endif # "$(MAKEFILEVC)" == "" !if !exist("$(MAKEFILEVC)") MSG = ^ You must run nmake from the directory containing the project makefile.^ If you are doing that and getting this message, set the MAKEFILEVC^ macro to the name of the project makefile. !message WARNING: $(MSG) !endif ################################################################ # 1. Define external programs being used #---------------------------------------------------------- # Set the proper copy method to avoid overwrite questions # to the user when copying files and selecting the right # "delete all" method. #---------------------------------------------------------- RMDIR = rmdir /S /Q CPY = xcopy /i /y >NUL CPYDIR = xcopy /e /i /y >NUL COPY = copy /y >NUL MKDIR = mkdir ###################################################################### # 2. Figure out our build environment in terms of what we're building. # # (a) Tcl itself # (b) Tk # (c) a Tcl extension using libraries/includes from an *installed* Tcl # (d) a Tcl extension using libraries/includes from Tcl source directory # # This last is needed because some extensions still need # some Tcl interfaces that are not publicly exposed. # # The fragment will set the following macros: # ROOT - root of this module sources # COMPATDIR - source directory that holds compatibility sources # DOCDIR - source directory containing documentation files # GENERICDIR - platform-independent source directory # WINDIR - Windows-specific source directory # TESTDIR - directory containing test files # TOOLSDIR - directory containing build tools # _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set # when building Tcl itself. # _INSTALLDIR - native form of the installation path. For Tcl # this will be the root of the Tcl installation. For extensions # this will be the lib directory under the root. # TCLINSTALL - set to 1 if _TCLDIR refers to # headers and libraries from an installed Tcl, and 0 if built against # Tcl sources. Not set when building Tcl itself. Yes, not very well # named. # _TCL_H - native path to the tcl.h file # # If Tk is involved, also sets the following # _TKDIR - native form Tk installation OR Tk source. Not set if building # Tk itself. # TKINSTALL - set 1 if _TKDIR refers to installed Tk and 0 if Tk sources # _TK_H - native path to the tk.h file # Root directory for sources and assumed subdirectories ROOT = $(MAKEDIR)\.. # The following paths CANNOT have spaces in them as they appear on the # left side of implicit rules. !ifndef COMPATDIR COMPATDIR = $(ROOT)\compat !endif !ifndef DOCDIR DOCDIR = $(ROOT)\doc !endif !ifndef GENERICDIR GENERICDIR = $(ROOT)\generic !endif !ifndef TOOLSDIR TOOLSDIR = $(ROOT)\tools !endif !ifndef TESTDIR TESTDIR = $(ROOT)\tests !endif !ifndef LIBDIR !if exist("$(ROOT)\library") LIBDIR = $(ROOT)\library !else LIBDIR = $(ROOT)\lib !endif !endif !ifndef DEMODIR !if exist("$(LIBDIR)\demos") DEMODIR = $(LIBDIR)\demos !else DEMODIR = $(ROOT)\demos !endif !endif # ifndef DEMODIR # Do NOT enclose WINDIR in a !ifndef because Windows always defines # WINDIR env var to point to c:\windows! # TBD - This is a potentially dangerous conflict, rename WINDIR to # something else WINDIR = $(ROOT)\win !ifndef RCDIR !if exist("$(WINDIR)\rc") RCDIR = $(WINDIR)\rc !else RCDIR = $(WINDIR) !endif !endif RCDIR = $(RCDIR:/=\) # The target directory where the built packages and binaries will be installed. # INSTALLDIR is the (optional) path specified by the user. # _INSTALLDIR is INSTALLDIR using the backslash separator syntax !ifdef INSTALLDIR ### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\) !else ### Assume the normal default. _INSTALLDIR = $(HOMEDRIVE)\Tcl !endif !if $(DOING_TCL) # BEGIN Case 2(a) - Building Tcl itself # Only need to define _TCL_H _TCL_H = ..\generic\tcl.h # END Case 2(a) - Building Tcl itself !elseif $(DOING_TK) # BEGIN Case 2(b) - Building Tk TCLINSTALL = 0 # Tk always builds against Tcl source, not an installed Tcl !if "$(TCLDIR)" == "" !if [echo TCLDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] !error *** Could not locate Tcl source directory. !endif !include nmakehlp.out !endif # TCLDIR == "" _TCLDIR = $(TCLDIR:/=\) _TCL_H = $(_TCLDIR)\generic\tcl.h !if !exist("$(_TCL_H)") !error Could not locate tcl.h. Please set the TCLDIR macro to point to the Tcl *source* directory. !endif _TK_H = ..\generic\tk.h # END Case 2(b) - Building Tk !else # BEGIN Case 2(c) or (d) - Building an extension other than Tk # If command line has specified Tcl location through TCLDIR, use it # else default to the INSTALLDIR setting !if "$(TCLDIR)" != "" _TCLDIR = $(TCLDIR:/=\) !if exist("$(_TCLDIR)\include\tcl.h") # Case 2(c) with TCLDIR defined TCLINSTALL = 1 _TCL_H = $(_TCLDIR)\include\tcl.h !elseif exist("$(_TCLDIR)\generic\tcl.h") # Case 2(d) with TCLDIR defined TCLINSTALL = 0 _TCL_H = $(_TCLDIR)\generic\tcl.h !endif !else # # Case 2(c) for extensions with TCLDIR undefined # Need to locate Tcl depending on whether it needs Tcl source or not. # If we don't, check the INSTALLDIR for an installed Tcl first !if exist("$(_INSTALLDIR)\include\tcl.h") && !$(NEED_TCL_SOURCE) TCLINSTALL = 1 TCLDIR = $(_INSTALLDIR)\.. # NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions # later so the \.. accounts for the /lib _TCLDIR = $(_INSTALLDIR)\.. _TCL_H = $(_TCLDIR)\include\tcl.h !else # exist(...) && ! $(NEED_TCL_SOURCE) !if [echo _TCLDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] !error *** Could not locate Tcl source directory. !endif !include nmakehlp.out TCLINSTALL = 0 TCLDIR = $(_TCLDIR) _TCL_H = $(_TCLDIR)\generic\tcl.h !endif # exist(...) && ! $(NEED_TCL_SOURCE) !endif # TCLDIR !ifndef _TCL_H MSG =^ Failed to find tcl.h. The TCLDIR macro is set incorrectly or is not set and default path does not contain tcl.h. !error $(MSG) !endif # Now do the same to locate Tk headers and libs if project requires Tk !if $(NEED_TK) !if "$(TKDIR)" != "" _TKDIR = $(TKDIR:/=\) !if exist("$(_TKDIR)\include\tk.h") TKINSTALL = 1 _TK_H = $(_TKDIR)\include\tk.h !elseif exist("$(_TKDIR)\generic\tk.h") TKINSTALL = 0 _TK_H = $(_TKDIR)\generic\tk.h !endif !else # TKDIR not defined # Need to locate Tcl depending on whether it needs Tcl source or not. # If we don't, check the INSTALLDIR for an installed Tcl first !if exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) TKINSTALL = 1 # NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions # later so the \.. accounts for the /lib _TKDIR = $(_INSTALLDIR)\.. _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !else # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) !if [echo _TKDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tk.h >> nmakehlp.out] !error *** Could not locate Tk source directory. !endif !include nmakehlp.out TKINSTALL = 0 TKDIR = $(_TKDIR) _TK_H = $(_TKDIR)\generic\tk.h !endif # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) !endif # TKDIR !ifndef _TK_H MSG =^ Failed to find tk.h. The TKDIR macro is set incorrectly or is not set and default path does not contain tk.h. !error $(MSG) !endif !endif # NEED_TK !if $(NEED_TCL_SOURCE) && $(TCLINSTALL) MSG = ^ *** Warning: This extension requires the source distribution of Tcl.^ *** Please set the TCLDIR macro to point to the Tcl sources. !error $(MSG) !endif !if $(NEED_TK_SOURCE) !if $(TKINSTALL) MSG = ^ *** Warning: This extension requires the source distribution of Tk.^ *** Please set the TKDIR macro to point to the Tk sources. !error $(MSG) !endif !endif # If INSTALLDIR set to Tcl installation root dir then reset to the # lib dir for installing extensions !if exist("$(_INSTALLDIR)\include\tcl.h") _INSTALLDIR=$(_INSTALLDIR)\lib !endif # END Case 2(c) or (d) - Building an extension !endif # if $(DOING_TCL) ################################################################ # 3. Determine compiler version and architecture # In this section, we figure out the compiler version and the # architecture for which we are building. This sets the # following macros: # VCVERSION - the internal compiler version as 1200, 1400, 1910 etc. # This is also printed by the compiler in dotted form 19.10 etc. # VCVER - the "marketing version", for example Visual C++ 6 for internal # compiler version 1200. This is kept only for legacy reasons as it # does not make sense for recent Microsoft compilers. Only used for # output directory names. # ARCH - set to IX86 or AMD64 depending on 32- or 64-bit target # NATIVE_ARCH - set to IX86 or AMD64 for the host machine # MACHINE - same as $(ARCH) - legacy # _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed # CFG_ENCODING - set to an character encoding. # TBD - this is passed to compiler as TCL_CFGVAL_ENCODING but can't # see where it is used cc32 = $(CC) # built-in default. link32 = link lib32 = lib rc32 = $(RC) # built-in default. #---------------------------------------------------------------- # Figure out the compiler architecture and version by writing # the C macros to a file, preprocessing them with the C # preprocessor and reading back the created file _HASH=^# _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ && ![echo ARCH=IX86 >> vercl.x] \ && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ && ![echo ARCH=AMD64 >> vercl.x] \ && ![echo $(_HASH)endif >> vercl.x] \ && ![$(cc32) -nologo -TC -P vercl.x 2>NUL] !include vercl.i !if $(VCVERSION) < 1900 !if ![echo VCVER= ^\> vercl.vc] \ && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] !include vercl.vc !endif !else # The simple calculation above does not apply to new Visual Studio releases # Keep the compiler version in its native form. VCVER = $(VCVERSION) !endif !endif !if ![del 2>NUL /q/f vercl.x vercl.i vercl.vc] !endif #---------------------------------------------------------------- # The MACHINE macro is used by legacy makefiles so set it as well !ifdef MACHINE !if "$(MACHINE)" == "x86" !undef MACHINE MACHINE = IX86 !elseif "$(MACHINE)" == "x64" !undef MACHINE MACHINE = AMD64 !endif !if "$(MACHINE)" != "$(ARCH)" !error Specified MACHINE macro $(MACHINE) does not match detected target architecture $(ARCH). !endif !else MACHINE=$(ARCH) !endif #------------------------------------------------------------ # Figure out the *host* architecture by reading the registry !if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] NATIVE_ARCH=IX86 !else NATIVE_ARCH=AMD64 !endif # Since MSVC8 we must deal with manifest resources. !if $(VCVERSION) >= 1400 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !endif !ifndef CFG_ENCODING CFG_ENCODING = \"cp1252\" !endif ################################################################ # 4. Build the nmakehlp program # This is a helper app we need to overcome nmake's limiting # environment. We will call out to it to get various bits of # information about supported compiler options etc. # # Tcl itself will always use the nmakehlp.c program which is # in its own source. This is the "master" copy and kept updated. # # Extensions built against an installed Tcl will use the installed # copy of Tcl's nmakehlp.c if there is one and their own version # otherwise. In the latter case, they would also be using their own # rules.vc. Note that older versions of Tcl do not install nmakehlp.c # or rules.vc. # # Extensions built against Tcl sources will use the one from the Tcl source. # # When building an extension using a sufficiently new version of Tcl, # rules-ext.vc will define NMAKEHLPC appropriately to point to the # copy of nmakehlp.c to be used. !ifndef NMAKEHLPC # Default to the one in the current directory (the extension's own nmakehlp.c) NMAKEHLPC = nmakehlp.c !if !$(DOING_TCL) !if $(TCLINSTALL) !if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c") NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c !endif !else # ! $(TCLINSTALL) !if exist("$(_TCLDIR)\win\nmakehlp.c") NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c !endif !endif # $(TCLINSTALL) !endif # !$(DOING_TCL) !endif # NMAKEHLPC # We always build nmakehlp even if it exists since we do not know # what source it was built from. !if [$(cc32) -nologo "$(NMAKEHLPC)" -link -subsystem:console > nul] !endif ################################################################ # 5. Test for compiler features # Visual C++ compiler options have changed over the years. Check # which options are supported by the compiler in use. # # The following macros are set: # OPTIMIZATIONS - the compiler flags to be used for optimized builds # DEBUGFLAGS - the compiler flags to be used for debug builds # LINKERFLAGS - Flags passed to the linker # # Note that these are the compiler settings *available*, not those # that will be *used*. The latter depends on the OPTS macro settings # which we have not yet parsed. # # Also note that some of the flags in OPTIMIZATIONS are not really # related to optimization. They are placed there only for legacy reasons # as some extensions expect them to be included in that macro. # -Op improves float consistency. Note only needed for older compilers # Newer compilers do not need or support this option. !if [nmakehlp -c -Op] FPOPTS = -Op !endif # Strict floating point semantics - present in newer compilers in lieu of -Op !if [nmakehlp -c -fp:strict] FPOPTS = $(FPOPTS) -fp:strict !endif !if "$(MACHINE)" == "IX86" ### test for pentium errata !if [nmakehlp -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' FPOPTS = $(FPOPTS) -QI0f !else !message *** Compiler does not have 'Pentium 0x0f fix' !endif !endif ### test for optimizations # /O2 optimization includes /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy as per # documentation. Note we do NOT want /Gs as that inserts a _chkstk # stack probe at *every* function entry, not just those with more than # a page of stack allocation resulting in a performance hit. However, # /O2 documentation is misleading as its stack probes are simply the # default page size locals allocation probes and not what is implied # by an explicit /Gs option. OPTIMIZATIONS = $(FPOPTS) !if [nmakehlp -c -O2] OPTIMIZING = 1 OPTIMIZATIONS = $(OPTIMIZATIONS) -O2 !else # Legacy, really. All modern compilers support this !message *** Compiler does not have 'Optimizations' OPTIMIZING = 0 !endif # Checks for buffer overflows in local arrays !if [nmakehlp -c -GS] OPTIMIZATIONS = $(OPTIMIZATIONS) -GS !endif # Link time optimization. Note that this option (potentially) makes # generated libraries only usable by the specific VC++ version that # created it. Requires /LTCG linker option !if [nmakehlp -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -GL CC_GL_OPT_ENABLED = 1 !else # In newer compilers -GL and -YX are incompatible. !if [nmakehlp -c -YX] OPTIMIZATIONS = $(OPTIMIZATIONS) -YX !endif !endif # [nmakehlp -c -GL] DEBUGFLAGS = $(FPOPTS) # Run time error checks. Not available or valid in a release, non-debug build # RTC is for modern compilers, -GZ is legacy !if [nmakehlp -c -RTC1] DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 !elseif [nmakehlp -c -GZ] DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif #---------------------------------------------------------------- # Linker flags # LINKER_TESTFLAGS are for internal use when we call nmakehlp to test # if the linker supports a specific option. Without these flags link will # return "LNK1561: entry point must be defined" error compiling from VS-IDE: # They are not passed through to the actual application / extension # link rules. !ifndef LINKER_TESTFLAGS LINKER_TESTFLAGS = /DLL /NOENTRY /OUT:nmakehlp.out !endif LINKERFLAGS = # If compiler has enabled link time optimization, linker must too with -ltcg !ifdef CC_GL_OPT_ENABLED !if [nmakehlp -l -ltcg $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS) -ltcg !endif !endif ######################################################################## # 6. Parse the OPTS macro to work out the requested build configuration. # Based on this, we will construct the actual switches to be passed to the # compiler and linker using the macros defined in the previous section. # The following macros are defined by this section based on OPTS # STATIC_BUILD - 0 -> Tcl is to be built as a shared library # 1 -> build as a static library and shell # TCL_THREADS - legacy but always 1 on Windows since winsock requires it. # DEBUG - 1 -> debug build, 0 -> release builds # SYMBOLS - 1 -> generate PDB's, 0 -> no PDB's # PROFILE - 1 -> generate profiling info, 0 -> no profiling # PGO - 1 -> profile based optimization, 0 -> no # MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build # 0 -> link to static C runtime for static Tcl build. # Does not impact shared Tcl builds (STATIC_BUILD == 0) # TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions # in the Tcl shell. 0 -> keep them as shared libraries # Does not impact shared Tcl builds. # USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. # 0 -> Use the non-thread allocator. # UNCHECKED - 1 -> when doing a debug build with symbols, use the release # C runtime, 0 -> use the debug C runtime. # USE_STUBS - 1 -> compile to use stubs interfaces, 0 -> direct linking # CONFIG_CHECK - 1 -> check current build configuration against Tcl # configuration (ignored for Tcl itself) # Further, LINKERFLAGS are modified based on above. # Default values for all the above STATIC_BUILD = 0 TCL_THREADS = 1 DEBUG = 0 SYMBOLS = 0 PROFILE = 0 PGO = 0 MSVCRT = 1 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 UNCHECKED = 0 CONFIG_CHECK = 1 !if $(DOING_TCL) USE_STUBS = 0 !else USE_STUBS = 1 !endif # If OPTS is not empty AND does not contain "none" which turns off all OPTS # set the above macros based on OPTS content !if "$(OPTS)" != "" && ![nmakehlp -f "$(OPTS)" "none"] # OPTS are specified, parse them !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static STATIC_BUILD = 1 !endif !if [nmakehlp -f $(OPTS) "nostubs"] !message *** Not using stubs USE_STUBS = 0 !endif !if [nmakehlp -f $(OPTS) "nomsvcrt"] !message *** Doing nomsvcrt MSVCRT = 0 !else !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt MSVCRT = 1 !else !if !$(STATIC_BUILD) MSVCRT = 1 !else MSVCRT = 0 !endif !endif !endif # [nmakehlp -f $(OPTS) "nomsvcrt"] !if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !else TCL_USE_STATIC_PACKAGES = 0 !endif !if [nmakehlp -f $(OPTS) "nothreads"] !message *** Compile explicitly for non-threaded Tcl TCL_THREADS = 0 USE_THREAD_ALLOC= 0 !else TCL_THREADS = 1 USE_THREAD_ALLOC= 1 !endif !if [nmakehlp -f $(OPTS) "symbols"] !message *** Doing symbols DEBUG = 1 !else DEBUG = 0 !endif !if [nmakehlp -f $(OPTS) "pdbs"] !message *** Doing pdbs SYMBOLS = 1 !else SYMBOLS = 0 !endif !if [nmakehlp -f $(OPTS) "profile"] !message *** Doing profile PROFILE = 1 !else PROFILE = 0 !endif !if [nmakehlp -f $(OPTS) "pgi"] !message *** Doing profile guided optimization instrumentation PGO = 1 !elseif [nmakehlp -f $(OPTS) "pgo"] !message *** Doing profile guided optimization PGO = 2 !else PGO = 0 !endif !if [nmakehlp -f $(OPTS) "loimpact"] !message *** Warning: ignoring option "loimpact" - deprecated on modern Windows. !endif # TBD - should get rid of this option !if [nmakehlp -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 !endif !if [nmakehlp -f $(OPTS) "tclalloc"] USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] !message *** Doing unchecked UNCHECKED = 1 !else UNCHECKED = 0 !endif !if [nmakehlp -f $(OPTS) "noconfigcheck"] CONFIG_CHECK = 1 !else CONFIG_CHECK = 0 !endif !endif # "$(OPTS)" != "" && ... parsing of OPTS # Set linker flags based on above !if $(PGO) > 1 !if [nmakehlp -l -ltcg:pgoptimize $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize !else MSG=^ This compiler does not support profile guided optimization. !error $(MSG) !endif !elseif $(PGO) > 0 !if [nmakehlp -l -ltcg:pginstrument $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument !else MSG=^ This compiler does not support profile guided optimization. !error $(MSG) !endif !endif ################################################################ # 7. Parse the STATS macro to configure code instrumentation # The following macros are set by this section: # TCL_MEM_DEBUG - 1 -> enables memory allocation instrumentation # 0 -> disables # TCL_COMPILE_DEBUG - 1 -> enables byte compiler logging # 0 -> disables # Default both are off TCL_MEM_DEBUG = 0 TCL_COMPILE_DEBUG = 0 !if "$(STATS)" != "" && ![nmakehlp -f "$(STATS)" "none"] !if [nmakehlp -f $(STATS) "memdbg"] !message *** Doing memdbg TCL_MEM_DEBUG = 1 !else TCL_MEM_DEBUG = 0 !endif !if [nmakehlp -f $(STATS) "compdbg"] !message *** Doing compdbg TCL_COMPILE_DEBUG = 1 !else TCL_COMPILE_DEBUG = 0 !endif !endif #################################################################### # 8. Parse the CHECKS macro to configure additional compiler checks # The following macros are set by this section: # WARNINGS - compiler switches that control the warnings level # TCL_NO_DEPRECATED - 1 -> disable support for deprecated functions # 0 -> enable deprecated functions # Defaults - Permit deprecated functions and warning level 3 TCL_NO_DEPRECATED = 0 WARNINGS = -W3 !if "$(CHECKS)" != "" && ![nmakehlp -f "$(CHECKS)" "none"] !if [nmakehlp -f $(CHECKS) "nodep"] !message *** Doing nodep check TCL_NO_DEPRECATED = 1 !endif !if [nmakehlp -f $(CHECKS) "fullwarn"] !message *** Doing full warnings check WARNINGS = -W4 !if [nmakehlp -l -warn:3 $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS) -warn:3 !endif !endif !if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] !message *** Doing 64bit portability warnings WARNINGS = $(WARNINGS) -Wp64 !endif !endif ################################################################ # 9. Extract various version numbers # For Tcl and Tk, version numbers are extracted from tcl.h and tk.h # respectively. For extensions, versions are extracted from the # configure.in or configure.ac from the TEA configuration if it # exists, and unset otherwise. # Sets the following macros: # TCL_MAJOR_VERSION # TCL_MINOR_VERSION # TCL_PATCH_LEVEL # TCL_VERSION # TK_MAJOR_VERSION # TK_MINOR_VERSION # TK_PATCH_LEVEL # TK_VERSION # DOTVERSION - set as (for example) 2.5 # VERSION - set as (for example 25) #-------------------------------------------------------------- !if [echo REM = This file is generated from rules.vc > versions.vc] !endif !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] !endif !if [echo TCL_MINOR_VERSION = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] !endif !if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] !endif !if defined(_TK_H) !if [echo TK_MAJOR_VERSION = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] !endif !if [echo TK_MINOR_VERSION = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] !endif !if [echo TK_PATCH_LEVEL = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] !endif !endif # _TK_H !include versions.vc TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) !if defined(_TK_H) TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) !endif # Set DOTVERSION and VERSION !if $(DOING_TCL) DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) VERSION = $(TCL_VERSION) !elseif $(DOING_TK) DOTVERSION = $(TK_DOTVERSION) VERSION = $(TK_VERSION) !else # Doing a non-Tk extension # If parent makefile has not defined DOTVERSION, try to get it from TEA # first from a configure.in file, and then from configure.ac !ifndef DOTVERSION !if [echo DOTVERSION = \> versions.vc] \ || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc] !if [echo DOTVERSION = \> versions.vc] \ || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc] !error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc. !endif !endif !include versions.vc !endif # DOTVERSION VERSION = $(DOTVERSION:.=) !endif # $(DOING_TCL) ... etc. ################################################################ # 10. Construct output directory and file paths # Figure-out how to name our intermediate and output directories. # In order to avoid inadvertent mixing of object files built using # different compilers, build configurations etc., # # Naming convention (suffixes): # t = full thread support. # s = static library (as opposed to an import library) # g = linked to the debug enabled C run-time. # x = special static build when it links to the dynamic C run-time. # # The following macros are set in this section: # SUFX - the suffix to use for binaries based on above naming convention # BUILDDIRTOP - the toplevel default output directory # is of the form {Release,Debug}[_AMD64][_COMPILERVERSION] # TMP_DIR - directory where object files are created # OUT_DIR - directory where output executables are created # Both TMP_DIR and OUT_DIR are defaulted only if not defined by the # parent makefile (or command line). The default values are # based on BUILDDIRTOP. # STUBPREFIX - name of the stubs library for this project # PRJIMPLIB - output path of the generated project import library # PRJLIBNAME - name of generated project library # PRJLIB - output path of generated project library # PRJSTUBLIBNAME - name of the generated project stubs library # PRJSTUBLIB - output path of the generated project stubs library # RESFILE - output resource file (only if not static build) SUFX = tsgx !if $(DEBUG) BUILDDIRTOP = Debug !else BUILDDIRTOP = Release !endif !if "$(MACHINE)" != "IX86" BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) !endif !if $(VCVER) > 6 BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) !endif !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD) TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib !if !$(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !endif !if !$(TCL_THREADS) TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) SUFX = $(SUFX:t=) !endif !ifndef TMP_DIR TMP_DIR = $(TMP_DIRFULL) !ifndef OUT_DIR OUT_DIR = .\$(BUILDDIRTOP) !endif !else !ifndef OUT_DIR OUT_DIR = $(TMP_DIR) !endif !endif # Relative paths -> absolute !if [echo OUT_DIR = \> nmakehlp.out] \ || [nmakehlp -Q "$(OUT_DIR)" >> nmakehlp.out] !error *** Could not fully qualify path OUT_DIR=$(OUT_DIR) !endif !if [echo TMP_DIR = \>> nmakehlp.out] \ || [nmakehlp -Q "$(TMP_DIR)" >> nmakehlp.out] !error *** Could not fully qualify path TMP_DIR=$(TMP_DIR) !endif !include nmakehlp.out # The name of the stubs library for the project being built STUBPREFIX = $(PROJECT)stub # Set up paths to various Tcl executables and libraries needed by extensions !if $(DOING_TCL) TCLSHNAME = $(PROJECT)sh$(TCL_VERSION)$(SUFX).exe TCLSH = $(OUT_DIR)\$(TCLSHNAME) TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" !else # ! $(DOING_TCL) !if $(TCLINSTALL) # Building against an installed Tcl # When building extensions, we need to locate tclsh. Depending on version # of Tcl we are building against, this may or may not have a "t" suffix. # Try various possibilities in turn. TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe !if !exist("$(TCLSH)") && $(TCL_THREADS) TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe !endif !if !exist("$(TCLSH)") TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe !endif TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. !if !exist("$(TCLIMPLIB)") TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib !endif TCL_LIBRARY = $(_TCLDIR)\lib TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib TCLDDELIB = $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target TCL_INCLUDES = -I"$(_TCLDIR)\include" !else # Building against Tcl sources TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe !if !exist($(TCLSH)) && $(TCL_THREADS) TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe !endif !if !exist($(TCLSH)) TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe !endif TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. !if !exist("$(TCLIMPLIB)") TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib !endif TCL_LIBRARY = $(_TCLDIR)\library TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib TCLTOOLSDIR = $(_TCLDIR)\tools TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif # TCLINSTALL tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)" !endif # $(DOING_TCL) # We need a tclsh that will run on the host machine as part of the build. # IX86 runs on all architectures. !ifndef TCLSH_NATIVE !if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" TCLSH_NATIVE = $(TCLSH) !else !error You must explicitly set TCLSH_NATIVE for cross-compilation !endif !endif # Do the same for Tk and Tk extensions that require the Tk libraries !if $(DOING_TK) || $(NEED_TK) WISHNAMEPREFIX = wish WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) TKSTUBLIBNAME = tkstub$(TK_VERSION).lib TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib !if $(DOING_TK) WISH = $(OUT_DIR)\$(WISHNAME) TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME) TKLIB = $(OUT_DIR)\$(TKLIBNAME) TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" !else # effectively NEED_TK !if $(TKINSTALL) # Building against installed Tk WISH = $(_TKDIR)\bin\$(WISHNAME) TKSTUBLIB = $(_TKDIR)\lib\$(TKSTUBLIBNAME) TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) # When building extensions, may be linking against Tk that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. !if !exist("$(TKIMPLIB)") TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) !endif TK_INCLUDES = -I"$(_TKDIR)\include" !else # Building against Tk sources WISH = $(_TKDIR)\win\$(BUILDDIRTOP)\$(WISHNAME) TKSTUBLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSTUBLIBNAME) TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) # When building extensions, may be linking against Tk that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. !if !exist("$(TKIMPLIB)") TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) !endif TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !endif # TKINSTALL tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" !endif # $(DOING_TK) !endif # $(DOING_TK) || $(NEED_TK) # Various output paths PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib PRJLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) # If extension parent makefile has not defined a resource definition file, # we will generate one from standard template. !if !$(DOING_TCL) && !$(DOING_TK) && !$(STATIC_BUILD) !ifdef RCFILE RESFILE = $(TMP_DIR)\$(RCFILE:.rc=.res) !else RESFILE = $(TMP_DIR)\$(PROJECT).res !endif !endif ################################################################### # 11. Construct the paths for the installation directories # The following macros get defined in this section: # LIB_INSTALL_DIR - where libraries should be installed # BIN_INSTALL_DIR - where the executables should be installed # DOC_INSTALL_DIR - where documentation should be installed # SCRIPT_INSTALL_DIR - where scripts should be installed # INCLUDE_INSTALL_DIR - where C include files should be installed # DEMO_INSTALL_DIR - where demos should be installed # PRJ_INSTALL_DIR - where package will be installed (not set for Tcl and Tk) !if $(DOING_TCL) || $(DOING_TK) LIB_INSTALL_DIR = $(_INSTALLDIR)\lib BIN_INSTALL_DIR = $(_INSTALLDIR)\bin DOC_INSTALL_DIR = $(_INSTALLDIR)\doc !if $(DOING_TCL) SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) !else # DOING_TK SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) !endif DEMO_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)\demos INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include !else # extension other than Tk PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION) LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR) BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR) DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) DEMO_INSTALL_DIR = $(PRJ_INSTALL_DIR)\demos INCLUDE_INSTALL_DIR = $(_TCLDIR)\include !endif ################################################################### # 12. Set up actual options to be passed to the compiler and linker # Now we have all the information we need, set up the actual flags and # options that we will pass to the compiler and linker. The main # makefile should use these in combination with whatever other flags # and switches are specific to it. # The following macros are defined, names are for historical compatibility: # OPTDEFINES - /Dxxx C macro flags based on user-specified OPTS # COMPILERFLAGS - /Dxxx C macro flags independent of any configuration opttions # crt - Compiler switch that selects the appropriate C runtime # cdebug - Compiler switches related to debug AND optimizations # cwarn - Compiler switches that set warning levels # cflags - complete compiler switches (subsumes cdebug and cwarn) # ldebug - Linker switches controlling debug information and optimization # lflags - complete linker switches (subsumes ldebug) except subsystem type # dlllflags - complete linker switches to build DLLs (subsumes lflags) # conlflags - complete linker switches for console program (subsumes lflags) # guilflags - complete linker switches for GUI program (subsumes lflags) # baselibs - minimum Windows libraries required. Parent makefile can # define PRJ_LIBS before including rules.rc if additional libs are needed OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS !if $(TCL_MEM_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG !endif !if $(TCL_COMPILE_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS !endif !if $(TCL_THREADS) OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 !if $(USE_THREAD_ALLOC) OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 !endif !endif !if $(STATIC_BUILD) OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD !endif !if $(TCL_NO_DEPRECATED) OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED !endif !if $(USE_STUBS) # Note we do not define USE_TCL_STUBS even when building Tk since some # test targets in Tk do not use stubs !if ! $(DOING_TCL) USE_STUBS_DEFS = -DUSE_TCL_STUBS -DUSE_TCLOO_STUBS !if $(NEED_TK) USE_STUBS_DEFS = $(USE_STUBS_DEFS) -DUSE_TK_STUBS !endif !endif !endif # USE_STUBS !if !$(DEBUG) OPTDEFINES = $(OPTDEFINES) -DNDEBUG !if $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED !endif !endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "AMD64" OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT !endif !if $(VCVERSION) < 1300 OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 !endif # _ATL_XP_TARGETING - Newer SDK's need this to build for XP COMPILERFLAGS = /D_ATL_XP_TARGETING # Following is primarily for the benefit of extensions. Tcl 8.5 builds # Tcl without /DUNICODE, while 8.6 builds with it defined. When building # an extension, it is advisable (but not mandated) to use the same Windows # API as the Tcl build. This is accordingly defaulted below. A particular # extension can override this by pre-defining USE_WIDECHAR_API. !ifndef USE_WIDECHAR_API !if $(TCL_VERSION) > 85 USE_WIDECHAR_API = 1 !else USE_WIDECHAR_API = 0 !endif !endif !if $(USE_WIDECHAR_API) COMPILERFLAGS = $(COMPILERFLAGS) /DUNICODE /D_UNICODE !endif # Like the TEA system only set this non empty for non-Tk extensions # Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME # so we pass both !if !$(DOING_TCL) && !$(DOING_TK) PKGNAMEFLAGS = -DPACKAGE_NAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ -DPACKAGE_TCLNAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \ -DMODULE_SCOPE=extern !endif # crt picks the C run time based on selected OPTS !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else crt = -MD !endif !else !if $(DEBUG) && !$(UNCHECKED) crt = -MTd !else crt = -MT !endif !endif # cdebug includes compiler options for debugging as well as optimization. !if $(DEBUG) # In debugging mode, optimizations need to be disabled cdebug = -Zi -Od $(DEBUGFLAGS) !else cdebug = $(OPTIMIZATIONS) !if $(SYMBOLS) cdebug = $(cdebug) -Zi !endif !endif # $(DEBUG) # cwarn includes default warning levels. cwarn = $(WARNINGS) !if "$(MACHINE)" == "AMD64" # Disable pointer<->int warnings related to cast between different sizes # There are a gadzillion of these due to use of ClientData and # clutter up compiler # output increasing chance of a real warning getting lost. So disable them. # Eventually some day, Tcl will be 64-bit clean. cwarn = $(cwarn) -wd4311 -wd4312 !endif ### Common compiler options that are architecture specific !if "$(MACHINE)" == "ARM" carch = -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE !else carch = !endif !if $(DEBUG) # Turn warnings into errors cwarn = $(cwarn) -WX !endif INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES) !if !$(DOING_TCL) && !$(DOING_TK) INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WINDIR)" -I"$(COMPATDIR)" !endif # These flags are defined roughly in the order of the pre-reform # rules.vc/makefile.vc to help visually compare that the pre- and # post-reform build logs # cflags contains generic flags used for building practically all object files cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug) # appcflags contains $(cflags) and flags for building the application # object files (e.g. tclsh, or wish) pkgcflags contains $(cflags) plus # flags used for building shared object files The two differ in the # BUILD_$(PROJECT) macro which should be defined only for the shared # library *implementation* and not for its caller interface appcflags = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES) $(USE_STUBS_DEFS) appcflags_nostubs = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES) pkgcflags = $(appcflags) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT) pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT) # stubscflags contains $(cflags) plus flags used for building a stubs # library for the package. Note: -DSTATIC_BUILD is defined in # $(OPTDEFINES) only if the OPTS configuration indicates a static # library. However the stubs library is ALWAYS static hence included # here irrespective of the OPTS setting. # # TBD - tclvfs has a comment that stubs libs should not be compiled with -GL # without stating why. Tcl itself compiled stubs libs with this flag. # so we do not remove it from cflags. -GL may prevent extensions # compiled with one VC version to fail to link against stubs library # compiled with another VC version. Check for this and fix accordingly. stubscflags = $(cflags) $(PKGNAMEFLAGS) $(PRJ_DEFINES) $(OPTDEFINES) -Zl -DSTATIC_BUILD $(INCLUDES) # Link flags !if $(DEBUG) ldebug = -debug -debugtype:cv !else ldebug = -release -opt:ref -opt:icf,3 !if $(SYMBOLS) ldebug = $(ldebug) -debug -debugtype:cv !endif !endif # Note: Profiling is currently only possible with the Visual Studio Enterprise !if $(PROFILE) ldebug= $(ldebug) -profile !endif ### Declarations common to all linker versions lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) !if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 lflags = $(lflags) -nodefaultlib:libucrt.lib !endif # Old linkers (Visual C++ 6 in particular) will link for fast loading # on Win98. Since we do not support Win98 any more, we specify nowin98 # as recommended for NT and later. However, this is only required by # IX86 on older compilers and only needed if we are not doing a static build. !if "$(MACHINE)" == "IX86" && !$(STATIC_BUILD) !if [nmakehlp -l -opt:nowin98 $(LINKER_TESTFLAGS)] # Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 !endif !endif dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows # Libraries that are required for every image. # Extensions should define any additional libraries with $(PRJ_LIBS) winlibs = kernel32.lib advapi32.lib !if $(NEED_TK) winlibs = $(winlibs) gdi32.lib user32.lib uxtheme.lib !endif # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "AMD64" !if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 winlibs = $(winlibs) bufferoverflowU.lib !endif !endif baselibs = $(winlibs) $(PRJ_LIBS) !if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 baselibs = $(baselibs) ucrt.lib !endif ################################################################ # 13. Define standard commands, common make targets and implicit rules CCPKGCMD = $(cc32) $(pkgcflags) -Fo$(TMP_DIR)^\ CCAPPCMD = $(cc32) $(appcflags) -Fo$(TMP_DIR)^\ CCSTUBSCMD = $(cc32) $(stubscflags) -Fo$(TMP_DIR)^\ LIBCMD = $(lib32) -nologo $(LINKERFLAGS) -out:$@ DLLCMD = $(link32) $(dlllflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) CONEXECMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ $(TCL_INCLUDES) \ -DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ -DCOMMAVERSION=$(DOTVERSION:.=,),0 \ -DDOTVERSION=\"$(DOTVERSION)\" \ -DVERSION=\"$(VERSION)\" \ -DSUFX=\"$(SUFX)\" \ -DPROJECT=\"$(PROJECT)\" \ -DPRJLIBNAME=\"$(PRJLIBNAME)\" !ifndef DEFAULT_BUILD_TARGET DEFAULT_BUILD_TARGET = $(PROJECT) !endif default-target: $(DEFAULT_BUILD_TARGET) default-pkgindex: @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ [list load [file join $$dir $(PRJLIBNAME)]] > $(OUT_DIR)\pkgIndex.tcl default-pkgindex-tea: @if exist $(ROOT)\pkgIndex.tcl.in nmakehlp -s << $(ROOT)\pkgIndex.tcl.in > $(OUT_DIR)\pkgIndex.tcl @PACKAGE_VERSION@ $(DOTVERSION) @PACKAGE_NAME@ $(PRJ_PACKAGE_TCLNAME) @PACKAGE_TCLNAME@ $(PRJ_PACKAGE_TCLNAME) @PKG_LIB_FILE@ $(PRJLIBNAME) << default-install: default-install-binaries default-install-libraries default-install-binaries: $(PRJLIB) @echo Installing binaries to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL default-install-libraries: $(OUT_DIR)\pkgIndex.tcl @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' @$(CPY) $(OUT_DIR)\pkgIndex.tcl $(SCRIPT_INSTALL_DIR) default-install-stubs: @echo Installing stubs library to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJSTUBLIB) "$(SCRIPT_INSTALL_DIR)" >NUL default-install-docs-html: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.html" "$(DOCDIR)\*.css" "$(DOCDIR)\*.png") do @$(COPY) %f "$(DOC_INSTALL_DIR)" default-install-docs-n: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.n") do @$(COPY) %f "$(DOC_INSTALL_DIR)" default-install-demos: @echo Installing demos to '$(DEMO_INSTALL_DIR)' @if not exist "$(DEMO_INSTALL_DIR)" mkdir "$(DEMO_INSTALL_DIR)" @if exist $(DEMODIR) $(CPYDIR) "$(DEMODIR)" "$(DEMO_INSTALL_DIR)" default-clean: @echo Cleaning $(TMP_DIR)\* ... @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) @echo Cleaning $(WINDIR)\nmakehlp.obj, nmakehlp.exe ... @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe @if exist $(WINDIR)\nmakehlp.out del $(WINDIR)\nmakehlp.out @echo Cleaning $(WINDIR)\nmhlp-out.txt ... @if exist $(WINDIR)\nmhlp-out.txt del $(WINDIR)\nmhlp-out.txt @echo Cleaning $(WINDIR)\_junk.pch ... @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch @echo Cleaning $(WINDIR)\vercl.x, vercl.i ... @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i @echo Cleaning $(WINDIR)\versions.vc, version.vc ... @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc default-hose: default-clean @echo Hosing $(OUT_DIR)\* ... @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) # Only for backward compatibility default-distclean: default-hose default-setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) !if "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !endif default-test: default-setup $(PROJECT) @set TCLLIBPATH=$(OUT_DIR:\=/) @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" cd "$(TESTDIR)" && $(DEBUGGER) $(TCLSH) all.tcl $(TESTFLAGS) default-shell: default-setup $(PROJECT) @set TCLLIBPATH=$(OUT_DIR:\=/) @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" $(DEBUGGER) $(TCLSH) # Generation of Windows version resource !ifdef RCFILE # Note: don't use $** in below rule because there may be other dependencies # and only the "master" rc must be passed to the resource compiler $(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc $(RESCMD) $(RCDIR)\$(PROJECT).rc !else # If parent makefile has not defined a resource definition file, # we will generate one from standard template. $(TMP_DIR)\$(PROJECT).res: $(TMP_DIR)\$(PROJECT).rc $(TMP_DIR)\$(PROJECT).rc: @$(COPY) << $(TMP_DIR)\$(PROJECT).rc #include VS_VERSION_INFO VERSIONINFO FILEVERSION COMMAVERSION PRODUCTVERSION COMMAVERSION FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Tcl extension " PROJECT VALUE "OriginalFilename", PRJLIBNAME VALUE "FileVersion", DOTVERSION VALUE "ProductName", "Package " PROJECT " for Tcl" VALUE "ProductVersion", DOTVERSION END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END << !endif # ifdef RCFILE !ifndef DISABLE_IMPLICIT_RULES DISABLE_IMPLICIT_RULES = 0 !endif !if !$(DISABLE_IMPLICIT_RULES) # Implicit rule definitions - only for building library objects. For stubs and # main application, the master makefile should define explicit rules. {$(ROOT)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(WINDIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(COMPATDIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(RCDIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< {$(WINDIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< {$(TMP_DIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< .SUFFIXES: .SUFFIXES:.c .rc !endif ################################################################ # 14. Sanity check selected options against Tcl build options # When building an extension, certain configuration options should # match the ones used when Tcl was built. Here we check and # warn on a mismatch. !if ! $(DOING_TCL) !if $(TCLINSTALL) # Building against an installed Tcl !if exist("$(_TCLDIR)\lib\nmake\tcl.nmake") TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake" !endif !else # ! $(TCLINSTALL) - building against Tcl source !if exist("$(OUT_DIR)\tcl.nmake") TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake" !endif !endif # TCLINSTALL !if $(CONFIG_CHECK) !ifdef TCLNMAKECONFIG !include $(TCLNMAKECONFIG) !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)" !error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)). !endif !if defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC) !message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)). !endif !if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG) !message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)). !endif !endif !endif # TCLNMAKECONFIG !endif # ! $(DOING_TCL) #---------------------------------------------------------- # Display stats being used. #---------------------------------------------------------- !if !$(DOING_TCL) !message *** Building against Tcl at '$(_TCLDIR)' !endif !if !$(DOING_TK) && $(NEED_TK) !message *** Building against Tk at '$(_TKDIR)' !endif !message *** Intermediate directory will be '$(TMP_DIR)' !message *** Output directory will be '$(OUT_DIR)' !message *** Installation, if selected, will be in '$(_INSTALLDIR)' !message *** Suffix for binaries will be '$(SUFX)' !message *** Compiler version $(VCVER). Target $(MACHINE), host $(NATIVE_ARCH). !endif # ifdef _RULES_VC tdom-0.9.1/extensions/tnc/win/PaxHeaders.9215/rules-ext.vc0000644000175000001440000000013213325450307021473 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/rules-ext.vc0000644000175000001440000000730313325450307020714 0ustar00rolfusers00000000000000# This file should only be included in makefiles for Tcl extensions, # NOT in the makefile for Tcl itself. !ifndef _RULES_EXT_VC # We need to run from the directory the parent makefile is located in. # nmake does not tell us what makefile was used to invoke it so parent # makefile has to set the MAKEFILEVC macro or we just make a guess and # warn if we think that is not the case. !if "$(MAKEFILEVC)" == "" !if exist("$(PROJECT).vc") MAKEFILEVC = $(PROJECT).vc !elseif exist("makefile.vc") MAKEFILEVC = makefile.vc !endif !endif # "$(MAKEFILEVC)" == "" !if !exist("$(MAKEFILEVC)") MSG = ^ You must run nmake from the directory containing the project makefile.^ If you are doing that and getting this message, set the MAKEFILEVC^ macro to the name of the project makefile. !message WARNING: $(MSG) !endif !if "$(PROJECT)" == "tcl" !error The rules-ext.vc file is not intended for Tcl itself. !endif # We extract version numbers using the nmakehlp program. For now use # the local copy of nmakehlp. Once we locate Tcl, we will use that # one if it is newer. !if [$(CC) -nologo "nmakehlp.c" -link -subsystem:console > nul] !endif # First locate the Tcl directory that we are working with. !ifdef TCLDIR _RULESDIR = $(TCLDIR:/=\) !else # If an installation path is specified, that is also the Tcl directory. # Also Tk never builds against an installed Tcl, it needs Tcl sources !if defined(INSTALLDIR) && "$(PROJECT)" != "tk" _RULESDIR=$(INSTALLDIR:/=\) !else # Locate Tcl sources !if [echo _RULESDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] _RULESDIR = ..\..\tcl !else !include nmakehlp.out !endif !endif # defined(INSTALLDIR).... !endif # ifndef TCLDIR # Now look for the targets.vc file under the Tcl root. Note we check this # file and not rules.vc because the latter also exists on older systems. !if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl _RULESDIR = $(_RULESDIR)\lib\nmake !elseif exist("$(_RULESDIR)\win\targets.vc") # Building against Tcl sources _RULESDIR = $(_RULESDIR)\win !else # If we have not located Tcl's targets file, most likely we are compiling # against an older version of Tcl and so must use our own support files. _RULESDIR = . !endif !if "$(_RULESDIR)" != "." # Potentially using Tcl's support files. If this extension has its own # nmake support files, need to compare the versions and pick newer. !if exist("rules.vc") # The extension has its own copy !if [echo TCL_RULES_MAJOR = \> versions.vc] \ && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc] !endif !if [echo TCL_RULES_MINOR = \>> versions.vc] \ && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc] !endif !if [echo OUR_RULES_MAJOR = \>> versions.vc] \ && [nmakehlp -V "rules.vc" RULES_VERSION_MAJOR >> versions.vc] !endif !if [echo OUR_RULES_MINOR = \>> versions.vc] \ && [nmakehlp -V "rules.vc" RULES_VERSION_MINOR >> versions.vc] !endif !include versions.vc # We have a newer version of the support files, use them !if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR)) _RULESDIR = . !endif !endif # if exist("rules.vc") !endif # if $(_RULESDIR) != "." # Let rules.vc know what copy of nmakehlp.c to use. NMAKEHLPC = $(_RULESDIR)\nmakehlp.c # Get rid of our internal defines before calling rules.vc !undef TCL_RULES_MAJOR !undef TCL_RULES_MINOR !undef OUR_RULES_MAJOR !undef OUR_RULES_MINOR !if exist("$(_RULESDIR)\rules.vc") !message *** Using $(_RULESDIR)\rules.vc !include "$(_RULESDIR)\rules.vc" !else !error *** Could not locate rules.vc in $(_RULESDIR) !endif !endif # _RULES_EXT_VCtdom-0.9.1/extensions/tnc/win/PaxHeaders.9215/makefile.vc0000644000175000001440000000013213325450307021320 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/makefile.vc0000644000175000001440000000267113325450307020544 0ustar00rolfusers00000000000000#------------------------------------------------------------- -*- makefile -*- # # Makefile for tnc # # Basic build, test and install # nmake /f makefile.vc INSTALLDIR=c:\tcl # nmake /f makefile.vc INSTALLDIR=c:\tcl test # nmake /f makefile.vc INSTALLDIR=c:\tcl install # # For other build options (debug, static etc.), # See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for # detailed documentation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # #------------------------------------------------------------------------------ PROJECT = tnc !include "rules-ext.vc" PRJ_OBJS = $(TMP_DIR)\tnc.obj !if [echo TDOM_DOTVERSION = \> versions.vc] \ || [nmakehlp -V ..\..\..\configure.in ^[tdom^] >> versions.vc] !error *** Could not figure out tdom version. !endif !include versions.vc TDOMVER = $(TDOM_DOTVERSION:.=) # tdom root TDOMROOT = ..\..\.. PRJ_DEFINES = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE \ -DHAVE_MEMMOVE=1 -DXML_DTD=1 -DXML_NS=1 -DTDOM_NO_UNKNOWN_CMD=1 \ !if !$(STATIC_BUILD) -DUSE_TDOM_STUBS !endif TDOMLIBPATH = "$(TDOMROOT)\win\$(BUILDDIRTOP)" PRJ_INCLUDES = -I$(TDOMROOT)\generic -I$(TDOMROOT)\expat TNCDIR = $(TDOMROOT)\extensions\tnc !if !$(STATIC_BUILD) PRJ_LIBS = $(TDOMLIBPATH)\tdomstub$(TDOMVER).lib !endif !include "$(_RULESDIR)\targets.vc" pkgindex: default-pkgindex tdom-0.9.1/extensions/tnc/win/PaxHeaders.9215/nmakehlp.c0000644000175000001440000000013213325450307021154 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/nmakehlp.c0000644000175000001440000005127513325450307020404 0ustar00rolfusers00000000000000/* * ---------------------------------------------------------------------------- * nmakehlp.c -- * * This is used to fix limitations within nmake and the environment. * * Copyright (c) 2002 by David Gravereaux. * Copyright (c) 2006 by Pat Thoyts * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include #define NO_SHLWAPI_GDI #define NO_SHLWAPI_STREAM #define NO_SHLWAPI_REG #include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #pragma comment (lib, "shlwapi.lib") #include #include /* * This library is required for x64 builds with _some_ versions of MSVC */ #if defined(_M_IA64) || defined(_M_AMD64) #if _MSC_VER >= 1400 && _MSC_VER < 1500 #pragma comment(lib, "bufferoverflowU") #endif #endif /* ISO hack for dumb VC++ */ #ifdef _MSC_VER #define snprintf _snprintf #endif /* protos */ static int CheckForCompilerFeature(const char *option); static int CheckForLinkerFeature(const char **options, int count); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); static int LocateDependency(const char *keyfile); static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); static DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ #define CHUNK 25 #define STATICBUFFERSIZE 1000 typedef struct { HANDLE pipe; char buffer[STATICBUFFERSIZE]; } pipeinfo; pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; /* * exitcodes: 0 == no, 1 == yes, 2 == error */ int main( int argc, char *argv[]) { char msg[300]; DWORD dwWritten; int chars; char *s; /* * Make sure children (cl.exe and link.exe) are kept quiet. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); /* * Make sure the compiler and linker aren't effected by the outside world. */ SetEnvironmentVariable("CL", ""); SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c \n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForCompilerFeature(argv[2]); case 'l': if (argc < 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -l ? ...?\n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForLinkerFeature(&argv[2], argc-2); case 'f': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -f \n" "Find a substring within another\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } else if (argc == 3) { /* * If the string is blank, there is no match. */ return 0; } else { return IsIn(argv[2], argv[3]); } case 's': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -s \n" "Perform a set of string map type substutitions on a file\n" "exitcodes: 0\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return SubstituteFile(argv[2], argv[3]); case 'V': if (argc != 4) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -V filename matchstring\n" "Extract a version from a file:\n" "eg: pkgIndex.tcl \"package ifneeded http\"", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 0; } s = GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0'); if (s && *s) { printf("%s\n", s); return 0; } else return 1; /* Version not found. Return non-0 exit code */ case 'Q': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -Q path\n" "Emit the fully qualified path\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return QualifyPath(argv[2]); case 'L': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -L keypath\n" "Emit the fully qualified path of directory containing keypath\n" "exitcodes: 0 == success, 1 == not found, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return LocateDependency(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c|-f|-l|-Q|-s|-V ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } static int CheckForCompilerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = FALSE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch "); /* * Append our option for testing */ lstrcat(cmdline, option); /* * Filename to compile, which exists, but is nothing and empty. */ lstrcat(cmdline, " .\\nul"); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL || strstr(Out.buffer, "D9002") != NULL || strstr(Err.buffer, "D9002") != NULL || strstr(Out.buffer, "D2021") != NULL || strstr(Err.buffer, "D2021") != NULL); } static int CheckForLinkerFeature( const char **options, int count) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; int i; char cmdline[255]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "link.exe -nologo "); /* * Append our option for testing. */ for (i = 0; i < count; i++) { lstrcat(cmdline, " \""); lstrcat(cmdline, options[i]); lstrcat(cmdline, "\""); } ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in the stderr stream. */ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL || strstr(Out.buffer, "LNK4044") != NULL || strstr(Err.buffer, "LNK4044") != NULL || strstr(Out.buffer, "LNK4224") != NULL || strstr(Err.buffer, "LNK4224") != NULL); } static DWORD WINAPI ReadFromPipe( LPVOID args) { pipeinfo *pi = (pipeinfo *) args; char *lastBuf = pi->buffer; DWORD dwRead; BOOL ok; again: if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { CloseHandle(pi->pipe); return (DWORD)-1; } ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); if (!ok || dwRead == 0) { CloseHandle(pi->pipe); return 0; } lastBuf += dwRead; goto again; return 0; /* makes the compiler happy */ } static int IsIn( const char *string, const char *substring) { return (strstr(string, substring) != NULL); } /* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version * following the match where a version is anything acceptable to * package provide or package ifneeded. */ static const char * GetVersionFromFile( const char *filename, const char *match, int numdots) { size_t cbBuffer = 100; static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); if (fp != NULL) { /* * Read data until we see our match string. */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); if (p != NULL) { /* * Skip to first digit after the match. */ p += strlen(match); while (*p && !isdigit(*p)) { ++p; } /* * Find ending whitespace. */ q = p; while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) && (!strchr("ab", q[-1])) || --numdots))) { ++q; } memcpy(szBuffer, p, q - p); szBuffer[q-p] = 0; szResult = szBuffer; break; } } fclose(fp); } return szResult; } /* * List helpers for the SubstituteFile function */ typedef struct list_item_t { struct list_item_t *nextPtr; char * key; char * value; } list_item_t; /* insert a list item into the list (list may be null) */ static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { list_item_t *itemPtr = malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); itemPtr->nextPtr = NULL; while(*listPtrPtr) { listPtrPtr = &(*listPtrPtr)->nextPtr; } *listPtrPtr = itemPtr; } return itemPtr; } static void list_free(list_item_t **listPtrPtr) { list_item_t *tmpPtr, *listPtr = *listPtrPtr; while (listPtr) { tmpPtr = listPtr; listPtr = listPtr->nextPtr; free(tmpPtr->key); free(tmpPtr->value); free(tmpPtr); } } /* * SubstituteFile -- * As windows doesn't provide anything useful like sed and it's unreliable * to use the tclsh you are building against (consider x-platform builds - * eg compiling AMD64 target from IX86) we provide a simple substitution * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ * @PACKAGE_NAME@ $(PACKAGE_NAME) * @PACKAGE_VERSION@ $(PACKAGE_VERSION) * << */ static int SubstituteFile( const char *substitutions, const char *filename) { size_t cbBuffer = 1024; static char szBuffer[1024], szCopy[1024]; char *szResult = NULL; list_item_t *substPtr = NULL; FILE *fp, *sp; fp = fopen(filename, "rt"); if (fp != NULL) { /* * Build a list of substutitions from the first filename */ sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { unsigned char *ks, *ke, *vs, *ve; ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; vs = ke; while (vs && *vs && isspace(*vs)) ++vs; ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } /* debug: dump the list */ #ifdef _DEBUG { int n = 0; list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr, ++n) { fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value); } } #endif /* * Run the substitutions over each line of the input */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); if (m) { char *cp, *op, *sp; cp = szCopy; op = szBuffer; while (op != m) *cp++ = *op++; sp = p->value; while (sp && *sp) *cp++ = *sp++; op += strlen(p->key); while (*op) *cp++ = *op++; *cp = 0; memcpy(szBuffer, szCopy, sizeof(szCopy)); } } printf(szBuffer); } list_free(&substPtr); } fclose(fp); return 0; } /* * QualifyPath -- * * This composes the current working directory with a provided path * and returns the fully qualified and normalized path. * Mostly needed to setup paths for testing. */ static int QualifyPath( const char *szPath) { char szCwd[MAX_PATH + 1]; char szTmp[MAX_PATH + 1]; char *p; GetCurrentDirectory(MAX_PATH, szCwd); while ((p = strchr(szPath, '/')) && *p) *p = '\\'; PathCombine(szTmp, szCwd, szPath); PathCanonicalize(szCwd, szTmp); printf("%s\n", szCwd); return 0; } /* * Implements LocateDependency for a single directory. See that command * for an explanation. * Returns 0 if found after printing the directory. * Returns 1 if not found but no errors. * Returns 2 on any kind of error * Basically, these are used as exit codes for the process. */ static int LocateDependencyHelper(const char *dir, const char *keypath) { HANDLE hSearch; char path[MAX_PATH+1]; int dirlen, keylen, ret; WIN32_FIND_DATA finfo; if (dir == NULL || keypath == NULL) return 2; /* Have no real error reporting mechanism into nmake */ dirlen = strlen(dir); if ((dirlen + 3) > sizeof(path)) return 2; strncpy(path, dir, dirlen); strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ keylen = strlen(keypath); #if 0 /* This function is not available in Visual C++ 6 */ /* * Use numerics 0 -> FindExInfoStandard, * 1 -> FindExSearchLimitToDirectories, * as these are not defined in Visual C++ 6 */ hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0); #else hSearch = FindFirstFile(path, &finfo); #endif if (hSearch == INVALID_HANDLE_VALUE) return 1; /* Not found */ /* Loop through all subdirs checking if the keypath is under there */ ret = 1; /* Assume not found */ do { int sublen; /* * We need to check it is a directory despite the * FindExSearchLimitToDirectories in the above call. See SDK docs */ if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) continue; sublen = strlen(finfo.cFileName); if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) continue; /* Path does not fit, assume not matched */ strncpy(path+dirlen+1, finfo.cFileName, sublen); path[dirlen+1+sublen] = '\\'; strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); if (PathFileExists(path)) { /* Found a match, print to stdout */ path[dirlen+1+sublen] = '\0'; QualifyPath(path); ret = 0; break; } } while (FindNextFile(hSearch, &finfo)); FindClose(hSearch); return ret; } /* * LocateDependency -- * * Locates a dependency for a package. * keypath - a relative path within the package directory * that is used to confirm it is the correct directory. * The search path for the package directory is currently only * the parent and grandparent of the current working directory. * If found, the command prints * name_DIRPATH= * and returns 0. If not found, does not print anything and returns 1. */ static int LocateDependency(const char *keypath) { int i, ret; static char *paths[] = {"..", "..\\..", "..\\..\\.."}; for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { ret = LocateDependencyHelper(paths[i], keypath); if (ret == 0) return ret; } return ret; } /* * Local variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * indent-tabs-mode: t * tab-width: 8 * End: */ tdom-0.9.1/extensions/tnc/win/PaxHeaders.9215/targets.vc0000644000175000001440000000013213325450307021214 xustar000000000000000030 mtime=1532383431.429385833 30 atime=1532383431.494385639 30 ctime=1532383431.429385833 tdom-0.9.1/extensions/tnc/win/targets.vc0000644000175000001440000000505113325450307020433 0ustar00rolfusers00000000000000#------------------------------------------------------------- -*- makefile -*- # targets.vc -- # # Part of the nmake based build system for Tcl and its extensions. # This file defines some standard targets for the convenience of extensions # and can be optionally included by the extension makefile. # See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for docs. $(PROJECT): setup pkgindex $(PRJLIB) !ifdef PRJ_STUBOBJS $(PROJECT): $(PRJSTUBLIB) $(PRJSTUBLIB): $(PRJ_STUBOBJS) $(LIBCMD) $** $(PRJ_STUBOBJS): $(CCSTUBSCMD) %s !endif # PRJ_STUBOBJS !ifdef PRJ_MANIFEST $(PROJECT): $(PRJLIB).manifest $(PRJLIB).manifest: $(PRJ_MANIFEST) @nmakehlp -s << $** >$@ @MACHINE@ $(MACHINE:IX86=X86) << !endif !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" $(PRJLIB): $(PRJ_OBJS) $(RESFILE) !if $(STATIC_BUILD) $(LIBCMD) $** !else $(DLLCMD) $** $(_VC_MANIFEST_EMBED_DLL) !endif -@del $*.exp !endif !if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != "" $(PRJ_OBJS): $(PRJ_HEADERS) !endif # If parent makefile has defined stub objects, add their installation # to the default install !if "$(PRJ_STUBOBJS)" != "" default-install: default-install-stubs !endif # Unlike the other default targets, these cannot be in rules.vc because # the executed command depends on existence of macro PRJ_HEADERS_PUBLIC # that the parent makefile will not define until after including rules-ext.vc !if "$(PRJ_HEADERS_PUBLIC)" != "" default-install: default-install-headers default-install-headers: @echo Installing headers to '$(INCLUDE_INSTALL_DIR)' @for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)" !endif !if "$(DISABLE_STANDARD_TARGETS)" == "" DISABLE_STANDARD_TARGETS = 0 !endif !if "$(DISABLE_TARGET_setup)" == "" DISABLE_TARGET_setup = 0 !endif !if "$(DISABLE_TARGET_install)" == "" DISABLE_TARGET_install = 0 !endif !if "$(DISABLE_TARGET_clean)" == "" DISABLE_TARGET_clean = 0 !endif !if "$(DISABLE_TARGET_test)" == "" DISABLE_TARGET_test = 0 !endif !if "$(DISABLE_TARGET_shell)" == "" DISABLE_TARGET_shell = 0 !endif !if !$(DISABLE_STANDARD_TARGETS) !if !$(DISABLE_TARGET_setup) setup: default-setup !endif !if !$(DISABLE_TARGET_install) install: default-install !endif !if !$(DISABLE_TARGET_clean) clean: default-clean realclean: hose hose: default-hose distclean: realclean default-distclean !endif !if !$(DISABLE_TARGET_test) test: default-test !endif !if !$(DISABLE_TARGET_shell) shell: default-shell !endif !endif # DISABLE_STANDARD_TARGETS tdom-0.9.1/extensions/tnc/PaxHeaders.9215/tests0000644000175000001440000000013213325450307017501 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532446226.522747811 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/tests/0000755000175000001440000000000013325450307016774 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tnc/tests/PaxHeaders.9215/tnc.test0000644000175000001440000000013213325450307021243 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/tests/tnc.test0000644000175000001440000003032313325450307020462 0ustar00rolfusers00000000000000# Features covered: tnc interface. # # This file contains a collection of tests of the tnc command. This tests # are primary there to test the tcl interface of the tnc command and the # validation commands. # # tnc-1.*: Basics # tnc-2.*: Parsing with tnc enabled # tnc-3.*: ValidationCmds # tnc-4.*: parser uses -useForeignDTD # # Copyright (c) 2003 Rolf Ade. set testDir [file dir [info script]] source [file join $testDir loadtnc.tcl] set xml { ]> texttextmore text } test tnc-1.1 {tnc enable} { set parser [expat] tnc $parser enable $parser free set result "" } {} test tnc-1.2 {tnc enable} { expat parser tnc parser enable parser free set result "" } {} test tnc-1.3 {try to enable tnc for an already tnc enabled parser} { set parser [expat] tnc $parser enable set result [catch {tnc $parser enable}] $parser free set result } {1} test tnc-1.4 {tnc - first arg isn't a parser} { set errMsg "" set result [catch {tnc foo enable} errMsg] list $result $errMsg } {1 {First argument has to be a expat parser object}} test tnc-1.5 {tnc - wrong method name (second arg)} { set parser [expat] set errMsg "" set result [catch {tnc $parser foobaz} errMsg] $parser free list $result $errMsg } {1 {bad method "foobaz": must be enable, remove, or getValidateCmd}} test tnc-2.1 {parse with tnc enabled} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] $parser free set result } {0} test tnc-2.2 {parse with tnc enabled} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] $parser free set result } {0} test tnc-2.3 {parse with tnc enabled} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] $parser free set result } {0} # This is like $xml, only with wrong root element set xmlWrong { ]> texttextmore text } test tnc-2.4 {parse with tnc enable - wrong document element} { set parser [expat] tnc $parser enable set errMsg "" set result [catch {$parser parse $xmlWrong} errMsg] $parser free lappend result $errMsg } {1 {Validation error at line 6, character 0: No declaration for this element.}} test tnc-2.5 {invalid DTD} { set parser [expat] tnc $parser enable set result [catch {$parser parse { ]> texttextmore text }}] $parser free set result } {1} test tnc-2.6 {invalid document} { set parser [expat] tnc $parser enable set errMsg "" set result [catch {$parser parse { ]> }} errMsg] $parser free set result } {1} test tnc-2.7 {not valid document} { set parser [expat] tnc $parser enable set result [catch {$parser parse { ]> text}} errMsg] $parser free set errMsg } {Validation error at line 6, character 17: Element can not end here (required element(s) missing).} proc 2.8-resolver {base systemId publicId} { switch $publicId { "-//W3C//DTD Specification V2.0//EN" { set fd [open [file join [file dir [info script]] \ ../../../tests/data/xmlspec-v20.dtd]] set xmlspec [read $fd] close $fd return [list "string" "" $xmlspec] } default { puts stderr "Unexpected systemId '$systemId'" return "" } } } test tnc-2.8 {Validate REC-xslt-19991116.xml} { set ::tDOM::extRefHandlerDebug 1 set parser [expat -externalentitycommand 2.8-resolver \ -paramentityparsing always] tnc $parser enable $parser parsefile [file join [file dir [info script]] \ ../../../tests/data/REC-xslt-19991116.xml] $parser free } {} test tnc-2.9 {check #PCDATA only element} { set parser [expat] tnc $parser enable set result [catch {$parser parse { ]> texttext}} errMsg] $parser free set errMsg } {Validation error at line 6, character 13: Element is not allowed here.} test tnc-3.1 {validate cmd} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] set validator [tnc $parser getValidateCmd] rename $validator {} $parser free set result } {0} test tnc-3.2 {validate cmd} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] set validator [tnc $parser getValidateCmd] $parser free rename $validator {} set result } {0} test tnc-3.3 {validate cmd} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xml}] set validator [tnc $parser getValidateCmd] $parser reset lappend result [catch {$parser parse $xml}] rename $validator {} $parser free set result } {0 0} test tnc-3.4 {validate cmd} { set parser [expat] tnc $parser enable tdom $parser enable $parser parse $xml set validator [tnc $parser getValidateCmd] set doc [tdom $parser getdoc] $parser free set result [catch {$validator validateTree [$doc documentElement]} errMsg] rename $validator {} $doc delete if {$result} { set errMsg } else { set result } } {0} test tnc-3.5 {validate cmd} { set parser [expat] tnc $parser enable tdom $parser enable $parser parse $xml set validator [tnc $parser getValidateCmd] tnc $parser remove $parser reset $parser parse $xml set doc [tdom $parser getdoc] $parser free set result [catch {$validator validateTree [$doc documentElement]} errMsg] rename $validator {} $doc delete if {$result} { set errMsg } else { set result } } {0} test tnc-3.6 {validate cmd} { set parser [expat] tnc $parser enable tdom $parser enable $parser parse $xml set validator [tnc $parser getValidateCmd] tnc $parser remove $parser reset $parser parse $xml set doc [tdom $parser getdoc] $parser free set root [$doc documentElement] set result [catch {$validator validateTree $root}] foreach child [$root childNodes] { if {[$child nodeType] == "ELEMENT_NODE"} { lappend result [catch {$validator validateTree $child}] } } rename $validator {} $doc delete set result } {0 0 0} test tnc-3.7 {validate cmd} { set parser [expat] tnc $parser enable set result [catch {$parser parse $xmlWrong}] set validator [tnc $parser getValidateCmd] $parser free set doc [dom parse $xml] set root [$doc documentElement] lappend result [catch {$validator validateTree $root}] lappend result [catch {$validator validateDocument $doc}] $validator delete $doc delete set result } {1 0 0} test tnc-3.8 {validator cmd generated from not-wellformed document with well-formed DTD} { set parser [expat] tnc $parser enable set errMsg "" catch {$parser parse { ]> }} tnc $parser getValidateCmd validator set doc [dom parse $xml] set result [validator validateDocument $doc] $parser free validator delete $doc delete set result } {1} test tnc-3.9 {validator cmd - validation error info} { set parser [expat] tnc $parser enable $parser parse $xml tnc $parser getValidateCmd validator $parser free set doc [dom parse $xml] set result [validator validateDocument $doc errInfo] validator delete $doc delete set result lappend result $errInfo } {1 {}} test tnc-3.10 {validator cmd - validation error info} { set parser [expat] tnc $parser enable $parser parse $xml tnc $parser getValidateCmd validator $parser free set doc [dom parse $xml] set errInfo "something" set result [validator validateDocument $doc errInfo] validator delete $doc delete set result lappend result $errInfo } {1 {}} test tnc-3.11 {validator cmd - validation error info} { set parser [expat] tnc $parser enable $parser parse $xml tnc $parser getValidateCmd validator $parser free set doc [dom parse $xmlWrong] set result [validator validateDocument $doc errInfo] validator delete $doc delete set result lappend result $errInfo } {0 {Root element doesn't match DOCTYPE name.}} test tnc-3.12 {validator cmd - validation error info} { set parser [expat] tnc $parser enable $parser parse $xml tnc $parser getValidateCmd validator $parser free set doc [dom parse $xml] set root [$doc documentElement] $root appendChild [$doc createElement wrong] set result [validator validateDocument $doc errInfo] lappend result $errInfo lappend result [validator validateTree $root errInfo] lappend result $errInfo validator delete $doc delete set result } {0 {No declaration for this element.} 0 {No declaration for this element.}} set xmlID { ]> } test tnc-3.13 {validator cmd - validateDocument with ID's} { set parser [expat] tnc $parser enable tdom $parser enable $parser parse $xmlID set validator [tnc $parser getValidateCmd] set doc [tdom $parser getdoc] $parser free set result [$validator validateDocument $doc errInfo] lappend result $errInfo set root [$doc documentElement] $root setAttribute id "id1" lappend result [$validator validateTree $root errInfo] lappend result $errInfo lappend result [$validator validateDocument $doc errInfo] lappend result $errInfo $doc delete $validator delete set result } {1 {} 0 {ID attribute values must be unique within the document.} 0 {ID attribute values must be unique within the document.}} test tnc-3.14 {validator cmd - validateAttributes} { set parser [expat] tnc $parser enable tdom $parser enable $parser parse $xmlID set validator [tnc $parser getValidateCmd] set doc [tdom $parser getdoc] $parser free set root [$doc documentElement] $root setAttribute wrongAtt "id1" set result [$validator validateAttributes $root errInfo] lappend result $errInfo $doc delete $validator delete set result } {0 {Unknown attribute for this element.}} proc extrefhandler-4.1 {base systemId publicId} { if {$systemId == ""} { return [list "string" $base { }] } else { error "error in tnc-4.1" } } test tnc-4.1 {document has no DTD, DTD provided via -useForeignDTD} { set parser [expat -externalentitycommand extrefhandler-4.1 \ -paramentityparsing always \ -useForeignDTD 1] tnc $parser enable $parser parse { texttextmore text } $parser free set result 1 } {1} proc extrefhandler-4.2 {base systemId publicId} { global parser if {$systemId == ""} { tnc $parser remove return [list string $base ""] } else { error "error in tnc-4.2" } } test tnc-4.2 {remove tnc from parser in extrefhandler} { set parser [expat -externalentitycommand extrefhandler-4.2 \ -paramentityparsing always \ -useForeignDTD 1] tnc $parser enable $parser parse $parser free set result 1 } {1} # cleanup ::tcltest::cleanupTests return tdom-0.9.1/extensions/tnc/tests/PaxHeaders.9215/all.tcl0000644000175000001440000000013213325450307021032 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/tests/all.tcl0000644000175000001440000000453013325450307020252 0ustar00rolfusers00000000000000# all.tcl -- # # This file contains a top-level script to run all of the Tcl # tests. Execute it by invoking "tclsh all.test". # # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # # RCS: @(#) $Id$ # source [file join [file dir [info script]] loadtnc.tcl] if {$tcl_version >= 8.1} { if {[lsearch [info proc ::tcltest::testConstraint] \ ::tcltest::testConstraint] == -1} { set ::tcltest::testConfig(need_i18n) 1 set ::tcltest::testConstraints(need_i18n) 1 } else { ::tcltest::testConstraint need_i18n 1 } } set timeCmd {clock format [clock seconds]} set ::tcltest::testSingleFile false puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" if {$tcl_version < 8.2} { set TESTS_DIR [file join [pwd] [file dirname [info script]]] set currentDir [pwd] set globPattern [file join $TESTS_DIR *.test] foreach file [lsort [glob $globPattern]] { set tail [file tail $file] if {[string match l.*.test $tail]} { # This is an SCCS lockfile; ignore it continue } puts stdout $tail if {[catch {source $file} msg]} { puts stdout $msg } } } else { set ::tcltest::testsDirectory [file dir [info script]] puts stdout "Tests running in working dir: $::tcltest::testsDirectory" if {[llength $::tcltest::skip] > 0} { puts stdout "Skipping tests that match: $::tcltest::skip" } if {[llength $::tcltest::match] > 0} { puts stdout "Only running tests that match: $::tcltest::match" } if {[llength $::tcltest::skipFiles] > 0} { puts stdout "Skipping test files that match: $::tcltest::skipFiles" } if {[llength $::tcltest::matchFiles] > 0} { puts stdout "Only sourcing test files that match: $::tcltest::matchFiles" } puts stdout "Tests began at [eval $timeCmd]" # source each of the specified tests foreach file [lsort [::tcltest::getMatchingFiles]] { set tail [file tail $file] puts stdout $tail if {[catch {source $file} msg]} { puts stdout $msg } } } # cleanup puts stdout "\nTests ended at [eval $timeCmd]" ::tcltest::cleanupTests 1 # Just a dirty trick, to make life of mem leak debuggers a bit easier. # See http://mini.net/tcl/3248 proc exit args {} tdom-0.9.1/extensions/tnc/tests/PaxHeaders.9215/loadtnc.tcl0000644000175000001440000000013213325450307021706 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/tests/loadtnc.tcl0000644000175000001440000000133013325450307021121 0ustar00rolfusers00000000000000catch {load ../../../unix/libtdom0.9.1.so} catch {load ../libtnc0.3.0.so} catch {load ../../unix/libtdom0.9.1.so} catch {load libtnc0.3.0.so} # loadtnc.tcl -- # # This file is [source]d by all.tcl and all test files, to ensure, that # the tcltest package and the lastest tnc build is present. if {[lsearch [namespace children] ::tcltest] == -1} { if {$tcl_version < 8.2} { puts stderr "sourcing def.tcl" source [file join [file dir [info script]] defs.tcl] set auto_path [pwd] } else { package require tcltest namespace import ::tcltest::* } } if {[catch {package present tdom}]} { package require tdom } if {[catch {package require tnc}]} { package require tnc } tdom-0.9.1/extensions/tnc/PaxHeaders.9215/install-sh0000644000175000001440000000013213325450307020415 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/install-sh0000755000175000001440000003305413325450307017643 0ustar00rolfusers00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-04-20.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -S $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -S) stripcmd="$stripprog $2" shift;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: tdom-0.9.1/extensions/tnc/PaxHeaders.9215/Makefile.in0000644000175000001440000000013213325450307020461 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532383431.493385642 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/tnc/Makefile.in0000644000175000001440000003757513325450307017720 0ustar00rolfusers00000000000000# 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-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #======================================================================== # 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@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PKG_DIR) top_builddir = . INSTALL_OPTIONS = INSTALL = $(SHELL) $(srcdir)/../../tclconfig/install-sh -c ${INSTALL_OPTIONS} INSTALL_DATA_DIR = ${INSTALL} -d -m 755 INSTALL_PROGRAM = ${INSTALL} -m 555 INSTALL_DATA = ${INSTALL} -m 444 INSTALL_SCRIPT = ${INSTALL_PROGRAM} INSTALL_LIBRARY = ${INSTALL_DATA} PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # 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) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG) #WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` #WISH_PROG = @WISH_PROG@ #WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_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@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl CLEANFILES = @CLEANFILES@ CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) .SUFFIXES: .c .$(OBJEXT) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target includes 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 #======================================================================== # 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-hand libraries: #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: install: all install-binaries install-libraries install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir) #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: doc @$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" @list='$(srcdir)/doc/*.n'; for i in $$list; do \ echo "Installing $$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) VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \ --leak-check=yes --show-reachable=yes -v valgrind: binaries libraries $(TCLSH_ENV) valgrind $(VALGRINDARGS) $(TCLSH_PROG) \ `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) valgrindshell: binaries libraries $(TCLSH_ENV) valgrind $(VALGRINDARGS) $(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:$(srcdir)/macosx .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # Create the pkgIndex.tcl file. #======================================================================== pkgIndex.tcl-hand: @(echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ "package require tdom;\ load [list [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 = tar 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 for i in $(srcdir)/*.[ch]; do \ if [ -f $$i ]; then \ cp -p $$i $(DIST_DIR)/ ; \ fi; \ done; 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: binaries @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ 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 @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi #======================================================================== # 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: binaries @$(INSTALL_DATA_DIR) $(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 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: tdom-0.9.1/extensions/tnc/PaxHeaders.9215/configure0000644000175000001440000000013213325450307020320 xustar000000000000000030 mtime=1532383431.427385839 30 atime=1532383431.493385642 30 ctime=1532383431.427385839 tdom-0.9.1/extensions/tnc/configure0000755000175000001440000104671013325450307017552 0ustar00rolfusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for tnc 0.3.0. # # # Copyright (C) 1992-1996, 1998-2012 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tnc' PACKAGE_TARNAME='tnc' PACKAGE_VERSION='0.3.0' PACKAGE_STRING='tnc 0.3.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS TCLSH_PROG VC_MANIFEST_EMBED_EXE VC_MANIFEST_EMBED_DLL RANLIB_STUB MAKE_STUB_LIB MAKE_STATIC_LIB MAKE_SHARED_LIB MAKE_LIB TCL_DBGX LDFLAGS_DEFAULT CFLAGS_DEFAULT LD_LIBRARY_PATH_VAR SHLIB_CFLAGS SHLIB_LD_LIBS SHLIB_LD STLIB_LD CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG RC CELIB_DIR AR STUBS_BUILD SHARED_BUILD TCL_THREADS TCL_INCLUDES PKG_OBJECTS PKG_SOURCES TDOM_SRC_DIR TDOM_STUB_LIB_SPEC TDOM_VERSION MATH_LIBS EGREP GREP RANLIB SET_MAKE INSTALL_LIBRARY INSTALL_SCRIPT INSTALL_PROGRAM INSTALL_DATA INSTALL_DATA_DIR INSTALL CPP TCL_SHLIB_LD_LIBS TCL_LD_FLAGS TCL_EXTRA_CFLAGS TCL_DEFS TCL_LIBS CLEANFILES OBJEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_PATCH_LEVEL TCL_VERSION PKG_CFLAGS PKG_LIBS PKG_INCLUDES PKG_HEADERS PKG_TCL_SOURCES PKG_STUB_OBJECTS PKG_STUB_SOURCES PKG_STUB_LIB_FILE PKG_LIB_FILE EXEEXT CYGPATH target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_tcl with_tdom with_tclinclude enable_threads enable_shared enable_stubs enable_64bit enable_64bit_vis enable_rpath enable_wince with_celib enable_symbols ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 tnc 0.3.0 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tnc] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tnc 0.3.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --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-stubs build and link with stub libraries. Always true for shared builds (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-wince enable Win/CE support (where applicable) --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-tcl directory containing tcl configuration (tclConfig.sh) --with-tdom directory containig tDOM configuration (tdomConfig.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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) 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. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tnc configure 0.3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tnc $as_me 0.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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.10" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5 $as_echo_n "checking for correct TEA configuration... " >&6; } if test x"${PACKAGE_NAME}" = x ; then as_fn_error $? " The PACKAGE_NAME variable must be defined by your TEA configure.ac" "$LINENO" 5 fi if test x"3.10" = x ; then as_fn_error $? " TEA version not specified." "$LINENO" 5 elif test "3.10" != "${TEA_VERSION}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.10\", have \"${TEA_VERSION}\"" >&5 $as_echo "warning: requested TEA version \"3.10\", have \"${TEA_VERSION}\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5 $as_echo "ok (TEA ${TEA_VERSION})" >&6; } fi # If the user did not set CFLAGS, set it now to keep macros # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi case "`uname -s`" in *win32*|*WIN32*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *CYGWIN_*) EXEEXT=".exe" # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG ;; *) CYGPATH=echo # Maybe we are cross-compiling.... case ${host_alias} in *mingw32*) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) EXEEXT="" TEA_PLATFORM="unix" ;; esac ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5 $as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;} # 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 ../../tclconfig "$srcdir"/../../tclconfig; 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../tclconfig \"$srcdir\"/../../tclconfig" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. #-------------------------------------------------------------------- # 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 was given. if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } if ${ac_cv_c_tclconfig+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 $as_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 as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 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 "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi 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 # TEA specific: 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/contrib/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/lib/tcl8.5 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 "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi 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" as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "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 arbitrary 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" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${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}\"" { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } hold_cc=$CC; CC="$TCL_CC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifdef _WIN32 #error win32 #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : TEA_PLATFORM="unix" CYGPATH=echo else TEA_PLATFORM="windows" # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CC=$hold_cc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5 $as_echo "$TEA_PLATFORM" >&6; } # The BUILD_$pkg is to define the correct extern storage class # handling when making this package cat >>confdefs.h <<_ACEOF #define BUILD_${PACKAGE_NAME} /**/ _ACEOF # Do this here as we have fully defined TEA_PLATFORM now if test "${TEA_PLATFORM}" = "windows" ; then EXEEXT=".exe" CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp" fi # TEA specific: #-------------------------------------------------------------------- # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 $as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 $as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5 $as_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. 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c' INSTALL_DATA_DIR='${INSTALL} -d -m 755' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_LIBRARY='${INSTALL_DATA}' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 $as_echo_n "checking if the compiler understands -pipe... " >&6; } if ${tcl_cv_cc_pipe+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_pipe=yes else tcl_cv_cc_pipe=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 $as_echo "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; 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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 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"). #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" if test "x$ac_cv_func_sin" = xyes; then : MATH_LIBS="" else MATH_LIBS="-lm" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5 $as_echo_n "checking for main in -lieee... " >&6; } if ${ac_cv_lib_ieee_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ieee_main=yes else ac_cv_lib_ieee_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5 $as_echo "$ac_cv_lib_ieee_main" >&6; } if test "x$ac_cv_lib_ieee_main" = xyes; 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. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 $as_echo_n "checking for main in -linet... " >&6; } if ${ac_cv_lib_inet_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_main=yes else ac_cv_lib_inet_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 $as_echo "$ac_cv_lib_inet_main" >&6; } if test "x$ac_cv_lib_inet_main" = xyes; then : LIBS="$LIBS -linet" fi ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" if test "x$ac_cv_header_net_errno_h" = xyes; then : $as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h 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 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" if test "x$ac_cv_func_setsockopt" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 $as_echo_n "checking for setsockopt in -lsocket... " >&6; } if ${ac_cv_lib_socket_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_setsockopt=yes else ac_cv_lib_socket_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 $as_echo "$ac_cv_lib_socket_setsockopt" >&6; } if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" if test "x$ac_cv_func_accept" = xyes; then : tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : LIBS="$LIBS -lnsl" fi fi # TEA specific: 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}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5 $as_echo_n "checking dirent.h... " >&6; } if ${tcl_cv_dirent_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : tcl_cv_dirent_h=yes else tcl_cv_dirent_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5 $as_echo "$tcl_cv_dirent_h" >&6; } if test $tcl_cv_dirent_h = no; then $as_echo "#define NO_DIRENT_H 1" >>confdefs.h fi # TEA specific: ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : else $as_echo "#define NO_ERRNO_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" if test "x$ac_cv_header_float_h" = xyes; then : else $as_echo "#define NO_FLOAT_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default" if test "x$ac_cv_header_values_h" = xyes; then : else $as_echo "#define NO_VALUES_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : $as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h else $as_echo "#define NO_LIMITS_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $as_echo "#define NO_STDLIB_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $as_echo "#define NO_STRING_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes; then : else $as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : else $as_echo "#define NO_DLFCN_H 1" >>confdefs.h fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PARAM_H 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 tdomConfig.sh file #-------------------------------------------------------------------- if test x"${no_tdom}" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tDOM configuration" >&5 $as_echo_n "checking for tDOM configuration... " >&6; } # Check whether --with-tdom was given. if test "${with_tdom+set}" = set; then : withval=$with_tdom; with_tdomconfig=${withval} fi no_tdom=true if test "${TEA_PLATFORM}" = "windows" ; then tdom_bindir=win else tdom_bindir=unix fi if ${ac_cv_c_tdomconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tdom was specified. if test x"${with_tdomconfig}" != x ; then if test -f "${with_tdomconfig}/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ${with_tdomconfig}; pwd)` else as_fn_error $? "${with_tdomconfig} directory doesn't contain tdomConfig.sh" "$LINENO" 5 fi fi # Then check for a sibling installation if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ../tdom `ls -dr ../tdom-* 2>/dev/null` \ ../../tdom `ls -dr ../../tdom-* 2>/dev/null` \ ../../../tdom `ls -dr ../../../tdom-* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi # Then check if tnc/tdom are compilied in the source tree if test x"${ac_cv_c_tdomconfig}" = x ; then if test -f "../../$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ../../$tdom_bindir; pwd)` fi fi # Check in a few common install locations if test x"${ac_cv_c_tdomconfig}" = 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/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i; pwd)` fi done fi # Check in a few other private locations if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ${srcdir}/../tdom \ `ls -dr ${srcdir}/../tdom[0-9].[0-9]* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi fi if test x"${ac_cv_c_tdomconfig}" = x ; then TDOM_BIN_DIR="# no tDOM configuration file found" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find tDOM configuration definitions" >&5 $as_echo "$as_me: WARNING: Can't find tDOM configuration definitions" >&2;} exit 0 else no_tdom= TDOM_BIN_DIR=${ac_cv_c_tdomconfig} { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TDOM_BIN_DIR/tdomConfig.sh" >&5 $as_echo "found $TDOM_BIN_DIR/tdomConfig.sh" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of $TDOM_BIN_DIR/tdomConfig.sh" >&5 $as_echo_n "checking for existence of $TDOM_BIN_DIR/tdomConfig.sh... " >&6; } if test -f "$TDOM_BIN_DIR/tdomConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . $TDOM_BIN_DIR/tdomConfig.sh else { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 $as_echo "file not found" >&6; } fi if test -f "${TDOM_BIN_DIR}/Makefile" ; then TDOM_STUB_LIB_SPEC=${TDOM_BUILD_STUB_LIB_SPEC} 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="tnc.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" \ -a ! -f "${srcdir}/macosx/$i" \ ; then as_fn_error $? "could not find source file '$i'" "$LINENO" 5 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 as_fn_error $? "could not find header file '${srcdir}/$i'" "$LINENO" 5 fi PKG_HEADERS="$PKG_HEADERS $i" done vars="-I${srcdir}/../../generic -I${srcdir}/../../expat" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="${TDOM_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 -DUSE_TDOM_STUBS=1" 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" \ -a ! -f "${srcdir}/macosx/$i" \ ; then as_fn_error $? "could not find stub source file '$i'" "$LINENO" 5 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 as_fn_error $? "could not find tcl source file '${srcdir}/$i'" "$LINENO" 5 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 #AC_DEFINE(BUILD_tnc, 1, [Build windows export dll]) 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 #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5 $as_echo_n "checking for Tcl public headers... " >&6; } # Check whether --with-tclinclude was given. if test "${with_tclinclude+set}" = set; then : withval=$with_tclinclude; with_tclinclude=${withval} fi if ${ac_cv_c_tclh+:} false; then : $as_echo_n "(cached) " >&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 as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5 fi else list="" 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 as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5 $as_echo "${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. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-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 $as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h $as_echo "#define _REENTRANT 1" >>confdefs.h if test "`uname -s`" = "SunOS" ; then $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h fi $as_echo "#define _THREAD_SAFE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; 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] { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (); int main () { return __pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_mutex_init=yes else ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_mutex_init=yes else ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 $as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_pthread_mutex_init=yes else ac_cv_lib_c_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 $as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_mutex_init=yes else ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 $as_echo_n "checking for building with threads... " >&6; } if test "${TCL_THREADS}" = 1; then $as_echo "#define TCL_THREADS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 $as_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 { $as_echo "$as_me:${as_lineno-$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 $as_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. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 $as_echo_n "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; shared_ok=$enableval else shared_ok=yes fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" shared_ok=$enableval else shared_ok=yes fi # Check whether --enable-stubs was given. if test "${enable_stubs+set}" = set; then : enableval=$enable_stubs; stubs_ok=$enableval else stubs_ok=yes fi if test "${enable_stubs+set}" = set; then enableval="$enable_stubs" stubs_ok=$enableval else stubs_ok=yes fi # Stubs are always enabled for shared builds if test "$shared_ok" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 $as_echo "shared" >&6; } SHARED_BUILD=1 STUBS_BUILD=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 $as_echo "static" >&6; } SHARED_BUILD=0 $as_echo "#define STATIC_BUILD 1" >>confdefs.h if test "$stubs_ok" = "yes" ; then STUBS_BUILD=1 else STUBS_BUILD=0 fi fi if test "${STUBS_BUILD}" = "1" ; then $as_echo "#define USE_TCL_STUBS 1" >>confdefs.h $as_echo "#define USE_TCLOO_STUBS 1" >>confdefs.h if test "${TEA_WINDOWINGSYSTEM}" != ""; then $as_echo "#define USE_TK_STUBS 1" >>confdefs.h fi 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. #-------------------------------------------------------------------- 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Step 0.a: Enable 64 bit support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 $as_echo_n "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test "${enable_64bit+set}" = set; then : enableval=$enable_64bit; do64bit=$enableval else do64bit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 $as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 $as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes"; then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 $as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } if ${tcl_cv_cc_visibility_hidden+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main () { f(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes else tcl_cv_cc_visibility_hidden=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 $as_echo "$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes; then : $as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h $as_echo "#define HAVE_HIDDEN 1" >>confdefs.h fi # Step 0.d: Disable -rpath support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 $as_echo_n "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; doRpath=$enableval else doRpath=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 $as_echo "$doRpath" >&6; } # TEA specific: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = windows; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 $as_echo_n "checking if Windows/CE build is requested... " >&6; } # Check whether --enable-wince was given. if test "${enable_wince+set}" = set; then : enableval=$enable_wince; doWince=$enableval else doWince=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 $as_echo "$doWince" >&6; } fi # Set the variable "system" to hold the name and version number # for the system. { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 $as_echo_n "checking system version... " >&6; } if ${tcl_cv_sys_version+:} false; then : $as_echo_n "(cached) " >&6 else # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 $as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 $as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Require ranlib early so we can override it in special cases below. # 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 and removed some core-only vars. do64bit_ok=no # default to '{$LIBS}' and set to "" on per-platform necessary basis SHLIB_LD_LIBS='${LIBS}' # 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="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" if test "x$SHLIB_VERSION" = x; then : SHLIB_VERSION="" else SHLIB_VERSION=".$SHLIB_VERSION" fi case $system in # TEA specific: 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 "$GCC" != "yes" -a ! -d "${PATH64}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 $as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5 $as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 $as_echo " Using 64-bit $MACHINE mode" >&6; } do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5 fi if test "$GCC" = "yes" ; then as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5 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 was given. if test "${with_celib+set}" = set; then : withval=$with_celib; with_celibconfig=${withval} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 $as_echo_n "checking for Windows/CE celib directory... " >&6; } if ${ac_cv_c_celibconfig+:} false; then : $as_echo_n "(cached) " >&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 as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5 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 as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5 else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5 $as_echo "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 as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 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 case "x`echo \${VisualStudioVersion}`" in x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" vars="ucrt.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 ;; *) ;; esac 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="${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="${lflags} -MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="${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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RC"; then ac_cv_prog_RC="$RC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 $as_echo "$RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 $as_echo "$ac_ct_RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RC" = x; then RC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RC=$ac_ct_RC fi else RC="$ac_cv_prog_RC" fi 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}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 $as_echo_n "checking for cross-compile version of gcc... " >&6; } if ${ac_cv_cross+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 #error cross-compiler #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cross=yes else ac_cv_cross=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 $as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-gcc" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-gcc" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi 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 # and also # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx # This essentially turns it all on. LDFLAGS_DEBUG="-debug -debugtype:cv" 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_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots ;; 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|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 $as_echo "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_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" 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='${CC} -shared -Wl,-bexpall' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" fi SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" #----------------------------------------------------------- # 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. #----------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 $as_echo_n "checking for inet_ntoa in -lbind... " >&6; } if ${ac_cv_lib_bind_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes else ac_cv_lib_bind_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 $as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" SHLIB_SUFFIX=".dll" EXEEXT=".exe" do64bit_ok=yes CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 $as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } if ${ac_cv_lib_network_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes else ac_cv_lib_network_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 $as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi ;; HP-UX-*.11.*) # Use updated header definitions where possible $as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h # TEA specific: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then : 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='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else CFLAGS="$CFLAGS -z" # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes"; then : if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_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 ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi 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_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 $as_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*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' LDFLAGS="$LDFLAGS -Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 $as_echo_n "checking if compiler accepts -m64 flag... " >&6; } if ${tcl_cv_cc_m64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes else tcl_cv_cc_m64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 $as_echo "$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 ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" if test "${TCL_THREADS}" = "1"; then : # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} 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 ;; FreeBSD-*) # This configuration from FreeBSD Ports. SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@" SHLIB_SUFFIX=".so" LDFLAGS="" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi case $system in FreeBSD-3.*) # Version numbers are dot-stripped by system policy. TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .` UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1' 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 $as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } if ${tcl_cv_cc_arch_ppc64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes else tcl_cv_cc_arch_ppc64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 $as_echo "$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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 $as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } if ${tcl_cv_cc_arch_x86_64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes else tcl_cv_cc_arch_x86_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 $as_echo "$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;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 $as_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 if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 $as_echo_n "checking if ld accepts -single_module flag... " >&6; } if ${tcl_cv_ld_single_module+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes else tcl_cv_ld_single_module=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 $as_echo "$tcl_cv_ld_single_module" >&6; } if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi # TEA specific: link shlib with current and compatibility version flags vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" SHLIB_SUFFIX=".dylib" # Don't use -prebind when building for Mac OS X 10.4 or later only: if 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; then : LDFLAGS="$LDFLAGS -prebind" fi LDFLAGS="$LDFLAGS -headerpad_max_install_names" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 $as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } if ${tcl_cv_ld_search_paths_first+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes else tcl_cv_ld_search_paths_first=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 $as_echo "$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then : if test "${TEA_WINDOWINGSYSTEM}" = x11; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 $as_echo_n "checking for 64-bit X11... " >&6; } if ${tcl_cv_lib_x11_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_x11_64=yes else tcl_cv_lib_x11_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 $as_echo "$tcl_cv_lib_x11_64" >&6; } fi if test "${TEA_WINDOWINGSYSTEM}" = aqua; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5 $as_echo_n "checking for 64-bit Tk... " >&6; } if ${tcl_cv_lib_tk_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { Tk_InitStubs(NULL, "", 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_tk_64=yes else tcl_cv_lib_tk_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5 $as_echo "$tcl_cv_lib_tk_64" >&6; } fi # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi fi ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy $as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; 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_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi 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" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) 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" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; 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. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" 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. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h 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 "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 $as_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 else if test "$arch" = "amd64 i386"; then : if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else do64bit_ok=yes case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi fi SHLIB_SUFFIX=".so" 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 : if test "$arch" = "sparcv9 sparc"; 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" else if test "$arch" = "amd64 i386"; then : # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi fi fi else case $system in SunOS-5.[1-9][0-9]*) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac 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" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 $as_echo_n "checking for ld accepts -Bexport flag... " >&6; } if ${tcl_cv_ld_Bexport+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_Bexport=yes else tcl_cv_ld_Bexport=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 $as_echo "$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 : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 $as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Add in the arch flags late to ensure it wasn't removed. # Not necessary in TEA, but this is aligned with core 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 "$GCC" = yes; then : case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE extern" >>confdefs.h fi if test "$SHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 $as_echo_n "checking for SEH support in compiler... " >&6; } if ${tcl_cv_seh+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : tcl_cv_seh=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tcl_cv_seh=yes else tcl_cv_seh=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 $as_echo "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then $as_echo "#define HAVE_NO_SEH 1" >>confdefs.h fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 $as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } if ${tcl_cv_eh_disposition+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN int main () { EXCEPTION_DISPOSITION x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_eh_disposition=yes else tcl_cv_eh_disposition=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 $as_echo "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then $as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi # Check to see if winnt.h defines CHAR, SHORT, and LONG # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 $as_echo_n "checking for winnt.h that ignores VOID define... " >&6; } if ${tcl_cv_winnt_ignore_void+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define VOID void #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main () { CHAR c; SHORT s; LONG l; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_winnt_ignore_void=yes else tcl_cv_winnt_ignore_void=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 $as_echo "$tcl_cv_winnt_ignore_void" >&6; } if test "$tcl_cv_winnt_ignore_void" = "yes" ; then $as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h fi fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 $as_echo_n "checking for cast to union support... " >&6; } if ${tcl_cv_cast_to_union+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else tcl_cv_cast_to_union=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 $as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 $as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" if ${tcl_cv_flag__isoc99_source+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes else tcl_cv_flag__isoc99_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then $as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if ${tcl_cv_flag__largefile64_source+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=yes else tcl_cv_flag__largefile64_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then $as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if ${tcl_cv_flag__largefile_source64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=yes else tcl_cv_flag__largefile_source64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then $as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 $as_echo "${tcl_flags}" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 $as_echo_n "checking for 64-bit integer type... " >&6; } if ${tcl_cv_type_64bit+:} false; then : $as_echo_n "(cached) " >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_type_64bit=__int64 else tcl_type_64bit="long long" fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit=${tcl_type_64bit} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then $as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 $as_echo "using long" >&6; } elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5 $as_echo "using Tcl header defaults" >&6; } else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 $as_echo "${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 $as_echo_n "checking for struct dirent64... " >&6; } if ${tcl_cv_struct_dirent64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes else tcl_cv_struct_dirent64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 $as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 $as_echo_n "checking for struct stat64... " >&6; } if ${tcl_cv_struct_stat64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes else tcl_cv_struct_stat64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 $as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi for ac_func in open64 lseek64 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 $as_echo_n "checking for off64_t... " >&6; } if ${tcl_cv_type_off64_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes else tcl_cv_type_off64_t=no fi rm -f core 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 $as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 $as_echo_n "checking for build with symbols... " >&6; } # Check whether --enable-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} -DNDEBUG" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 $as_echo "yes (standard debugging)" >&6; } fi fi # TEA specific: if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then $as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 $as_echo "enabled symbols mem debugging" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 $as_echo "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. #-------------------------------------------------------------------- $as_echo "#define USE_TCL_STUBS 1" >>confdefs.h #AC_DEFINE(USE_TK_STUBS, 1, [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)" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 print("manifest needed") #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "manifest needed" >/dev/null 2>&1; then : # Could do a CHECK_PROG for mt, but should always be with MSVC8+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi" VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi" MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}" CLEANFILES="$CLEANFILES *.manifest" fi rm -f conftest* MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -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. if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test "$GCC" = "yes"; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc" fi eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_LIB_FILE=lib${PKG_LIB_FILE} fi fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX}${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_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${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 #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 $as_echo_n "checking for tclsh... " >&6; } if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5 $as_echo "${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 pkgIndex.tcl" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # 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 branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tnc $as_me 0.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ tnc config.status 0.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tdom-0.9.1/extensions/tnc/PaxHeaders.9215/pkgIndex.tcl.in0000644000175000001440000000013213325450307021276 xustar000000000000000030 mtime=1532383431.428385836 30 atime=1532383431.494385639 30 ctime=1532383431.428385836 tdom-0.9.1/extensions/tnc/pkgIndex.tcl.in0000644000175000001440000000024113325450307020511 0ustar00rolfusers00000000000000# tnc Tcl package index file package ifneeded tnc @PACKAGE_VERSION@ \ "package require tdom; \ [list load [file join $dir @PKG_LIB_FILE@] tnc]" tdom-0.9.1/extensions/PaxHeaders.9215/example0000644000175000001440000000013213325450307017206 xustar000000000000000030 mtime=1532383431.424385848 30 atime=1532446226.522747811 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/example/0000755000175000001440000000000013325450307016501 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/example/PaxHeaders.9215/configure.in0000644000175000001440000000013213325450307021574 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.492385645 30 ctime=1532383431.423385851 tdom-0.9.1/extensions/example/configure.in0000644000175000001440000001721613325450307021021 0ustar00rolfusers00000000000000#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. # This will also define a special symbol for Windows (BUILD_sample in # this case) so that we create the export library with the dll. #----------------------------------------------------------------------- AC_INIT([example], [1.0]) #-------------------------------------------------------------------- # 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.10]) AC_CONFIG_AUX_DIR(../../tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC and a few others to create the basic setup # necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #-------------------------------------------------------------------- # Load the tdomConfig.sh file #-------------------------------------------------------------------- TDOM_PATH_CONFIG TDOM_LOAD_CONFIG #----------------------------------------------------------------------- # __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([example.c]) TEA_ADD_HEADERS([]) TEA_ADD_INCLUDES([-I${srcdir}/../../generic -I${srcdir}/../../expat]) TEA_ADD_LIBS([${TDOM_STUB_LIB_SPEC}]) TEA_ADD_CFLAGS([-DUSE_TDOM_STUBS=1]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([]) #-------------------------------------------------------------------- # __CHANGE__ # # You can add more files to clean if your extension creates any extra # files by extending CLEANFILES. # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. # # A few miscellaneous platform-specific items: # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- #CLEANFILES="$CLEANFILES pkgIndex.tcl" if test "${TEA_PLATFORM}" = "windows" ; then # Ensure no empty if clauses : #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else # Ensure no empty else clauses : #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # 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, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [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 #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH #TEA_PROG_WISH #-------------------------------------------------------------------- # 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 pkgIndex.tcl]) tdom-0.9.1/extensions/example/PaxHeaders.9215/aclocal.m40000644000175000001440000000013213325450307021123 xustar000000000000000030 mtime=1532383431.422385854 30 atime=1532383431.491385648 30 ctime=1532383431.422385854 tdom-0.9.1/extensions/example/aclocal.m40000644000175000001440000000026713325450307020346 0ustar00rolfusers00000000000000# # Include the TEA standard macro set # builtin(include,../../tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # builtin(include,../../tdom.m4) tdom-0.9.1/extensions/example/PaxHeaders.9215/exampletest.tcl0000644000175000001440000000013213325450307022322 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.492385645 30 ctime=1532383431.423385851 tdom-0.9.1/extensions/example/exampletest.tcl0000644000175000001440000000341513325450307021543 0ustar00rolfusers00000000000000#!tclsh load ../../unix/libtdom0.8.3.so load ./libexample1.0.so set counter1 0 set counter2 0 proc eh1 {args} { global counter1 incr counter1 } proc eh2 {args} { global counter2 incr counter2 } set parser [expat] $parser configure -elementstartcommand eh1 \ -handlerset doMore \ -elementstartcommand eh2 example $parser enable tdom $parser enable set fd [open ../../tests/data/books.xml] $parser parse [read $fd] puts "First tcl element start handler has counted the elements" puts "(and 42 isn't a bad answer at all)" puts "counter1: $counter1" puts "\nSecond tcl element start handler has also counted the elements" puts "(and should therefore report the same reasonable result)" puts "counter2: $counter2" puts "\nthe example C level handler set also counts the elements..." puts "(and should maybe do some validation, instead of this ridiculous counting..)" puts "example result: [example $parser getresult]" set doc [tdom $parser getdoc] set root [$doc documentElement] puts "\n... but the second C level handler has done some serious work" puts "DOM result tree root: [$root nodeName]" puts "\nOK, reset the parser..." $parser reset puts "\nSome senseless fiddling with the result encoding" puts [tdom $parser setResultEncoding] puts [tdom $parser setResultEncoding iso8859-1] puts [tdom $parser setResultEncoding] puts "\nRemove the tdom handler set and parse again" tdom $parser remove seek $fd 0 start $parser parse [read $fd] puts "\nthe both tcl counters count further, thats OK" puts "counter1: $counter1" puts "counter2: $counter2" puts "\nthe example counter is reseted because of the parser reset" puts "example result: [example $parser getresult]" puts "\nthe DOM tree created in the first parser run is still alive" puts [$root childNodes] tdom-0.9.1/extensions/example/PaxHeaders.9215/mkinstalldirs0000644000175000001440000000013213325450307022066 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.492385645 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/example/mkinstalldirs0000755000175000001440000000123713325450307021312 0ustar00rolfusers00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here tdom-0.9.1/extensions/example/PaxHeaders.9215/example.c0000644000175000001440000000013213325450307021062 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.492385645 30 ctime=1532383431.423385851 tdom-0.9.1/extensions/example/example.c0000644000175000001440000001433213325450307020303 0ustar00rolfusers00000000000000 #include #include /* * Beginning with 8.4, Tcl API is CONST'ified */ #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION <= 3) # define CONST84 #endif extern char *Tdom_InitStubs (Tcl_Interp *interp, char *version, int exact); typedef struct simpleCounter { int elementCounter; } simpleCounter; static char example_usage[] = "Usage example , where subCommand can be: \n" " enable \n" " getresult \n" " remove \n" ; /* *---------------------------------------------------------------------------- * * ExampleElementStartCommand -- * * This procedure is called for every element start event * while parsing XML Data with an "example" enabled tclexpat * parser. * * Results: * None. * * Side effects: * Uses the "userData" field as int and increments it by every call. * *---------------------------------------------------------------------------- */ void ExampleElementStartCommand (userData, name, atts) void *userData; const char *name; const char **atts; { simpleCounter *counter = (simpleCounter*) userData; counter->elementCounter++; } /* *---------------------------------------------------------------------------- * * ExampleResetProc * * Called for C handler set specific reset actions in case of * parser reset. * * Results: * None. * * Side effects: * Resets the "userData" of the C handler set parser extension. * *---------------------------------------------------------------------------- */ void ExampleResetProc (interp, userData) Tcl_Interp *interp; void *userData; { simpleCounter *counter = (simpleCounter*) userData; counter->elementCounter = 0; } /* *---------------------------------------------------------------------------- * * ExampleFreeProc * * Called for C handler set specific cleanup in case of parser * delete. * * Results: * None. * * Side effects: * C handler set specific userData gets free'd. * *---------------------------------------------------------------------------- */ void ExampleFreeProc (interp, userData) Tcl_Interp *interp; void *userData; { free (userData); } /* *---------------------------------------------------------------------------- * * TclExampleObjCmd -- * * This procedure is invoked to process the "example" command. * * Results: * A standard Tcl result. * * Side effects: * The expat parser object provided as argument is enhanced by * by the "example" handler set. * *---------------------------------------------------------------------------- */ int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; static CONST84 char *exampleMethods[] = { "enable", "getresult", "remove", NULL }; enum exampleMethod { m_enable, m_getresult, m_remove }; if (objc != 3) { Tcl_WrongNumArgs (interp, 1, objv, example_usage); return TCL_ERROR; } if (!CheckExpatParserObj (interp, objv[1])) { Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj (interp, objv[2], exampleMethods, "method", 0, &methodIndex) != TCL_OK) { Tcl_SetResult (interp, example_usage, NULL); return TCL_ERROR; } switch ((enum exampleMethod) methodIndex) { case m_enable: counter = (simpleCounter *) malloc (sizeof (simpleCounter)); counter->elementCounter = 0; handlerSet = CHandlerSetCreate ("example"); handlerSet->userData = counter; handlerSet->resetProc = ExampleResetProc; handlerSet->freeProc = ExampleFreeProc; handlerSet->elementstartcommand = ExampleElementStartCommand; result = CHandlerSetInstall (interp, objv[1], handlerSet); if (result == 1) { /* This should not happen if CheckExpatParserObj() is used. */ Tcl_SetResult (interp, "argument has to be a expat parser object", NULL); return TCL_ERROR; } if (result == 2) { Tcl_SetResult (interp, "there is already a C handler set with this name installed", NULL); /* In error case malloc'ed memory should be free'ed */ free (handlerSet->name); Tcl_Free ( (char *) handlerSet); return TCL_ERROR; } return TCL_OK; case m_getresult: counter = CHandlerSetGetUserData (interp, objv[1], "example"); Tcl_SetIntObj (Tcl_GetObjResult (interp), counter->elementCounter); return TCL_OK; case m_remove: result = CHandlerSetRemove (interp, objv[1], "example"); if (result == 1) { /* This should not happen if CheckExpatParserObj() is used. */ Tcl_SetResult (interp, "argument has to be a expat parser object", NULL); return TCL_ERROR; } if (result == 2) { Tcl_SetResult (interp, "expat parser obj hasn't a C handler set named \"example\"", NULL); return TCL_ERROR; } return TCL_OK; default: Tcl_SetResult (interp, "unknown method", NULL); return TCL_ERROR; } } /* *---------------------------------------------------------------------------- * * Example_Init -- * * Initialization routine for loadable module * * Results: * None. * * Side effects: * Defines "example" enhancement command for expat parser obj * *---------------------------------------------------------------------------- */ int Example_Init (interp) Tcl_Interp *interp; { #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8", 0) == NULL) { return TCL_ERROR; } #endif #ifdef USE_TDOM_STUBS if (Tdom_InitStubs(interp, "0.8", 0) == NULL) { return TCL_ERROR; } #endif Tcl_PkgRequire (interp, "tdom", "0.8.0", 0); Tcl_CreateObjCommand (interp, "example", TclExampleObjCmd, NULL, NULL ); Tcl_PkgProvide (interp, "example", "1.0"); return TCL_OK; } tdom-0.9.1/extensions/example/PaxHeaders.9215/install-sh0000644000175000001440000000013213325450307021264 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.492385645 30 ctime=1532383431.423385851 tdom-0.9.1/extensions/example/install-sh0000755000175000001440000000421213325450307020504 0ustar00rolfusers00000000000000#!/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 tdom-0.9.1/extensions/example/PaxHeaders.9215/Makefile.in0000644000175000001440000000013213325450307021330 xustar000000000000000030 mtime=1532383431.421385857 30 atime=1532383431.491385648 30 ctime=1532383431.421385857 tdom-0.9.1/extensions/example/Makefile.in0000644000175000001440000003771413325450307020562 0ustar00rolfusers00000000000000# 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-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #======================================================================== # 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@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PKG_DIR) top_builddir = . INSTALL_OPTIONS = INSTALL = $(SHELL) $(srcdir)/tclconfig/install-sh -c ${INSTALL_OPTIONS} INSTALL_DATA_DIR = ${INSTALL} -d -m 755 INSTALL_PROGRAM = ${INSTALL} -m 555 INSTALL_DATA = ${INSTALL} -m 444 INSTALL_SCRIPT = ${INSTALL_PROGRAM} INSTALL_LIBRARY = ${INSTALL_DATA} PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # 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) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG) #WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` #WISH_PROG = @WISH_PROG@ #WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_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@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl CLEANFILES = @CLEANFILES@ CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) .SUFFIXES: .c .$(OBJEXT) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target includes executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) libraries: #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: @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 #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir) @echo "Installing header files in $(DESTDIR)$(includedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: doc @$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" @list='$(srcdir)/doc/*.n'; for i in $$list; do \ echo "Installing $$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) VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \ --leak-check=yes --show-reachable=yes -v valgrind: binaries libraries $(TCLSH_ENV) valgrind $(VALGRINDARGS) $(TCLSH_PROG) \ `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) valgrindshell: binaries libraries $(TCLSH_ENV) valgrind $(VALGRINDARGS) $(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:$(srcdir)/macosx .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # 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 = tar 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 for i in $(srcdir)/*.[ch]; do \ if [ -f $$i ]; then \ cp -p $$i $(DIST_DIR)/ ; \ fi; \ done; 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: binaries @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ 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 @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi #======================================================================== # 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: binaries @$(INSTALL_DATA_DIR) $(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 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: tdom-0.9.1/extensions/example/PaxHeaders.9215/configure0000644000175000001440000000013213325450307021167 xustar000000000000000030 mtime=1532383431.423385851 30 atime=1532383431.491385648 30 ctime=1532383431.423385851 tdom-0.9.1/extensions/example/configure0000755000175000001440000104665113325450307020425 0ustar00rolfusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for example 1.0. # # # Copyright (C) 1992-1996, 1998-2012 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='example' PACKAGE_TARNAME='example' PACKAGE_VERSION='1.0' PACKAGE_STRING='example 1.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS TCLSH_PROG VC_MANIFEST_EMBED_EXE VC_MANIFEST_EMBED_DLL RANLIB_STUB MAKE_STUB_LIB MAKE_STATIC_LIB MAKE_SHARED_LIB MAKE_LIB TCL_DBGX LDFLAGS_DEFAULT CFLAGS_DEFAULT LD_LIBRARY_PATH_VAR SHLIB_CFLAGS SHLIB_LD_LIBS SHLIB_LD STLIB_LD CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG RC CELIB_DIR AR STUBS_BUILD SHARED_BUILD TCL_THREADS TCL_INCLUDES PKG_OBJECTS PKG_SOURCES TDOM_SRC_DIR TDOM_STUB_LIB_SPEC TDOM_VERSION MATH_LIBS EGREP GREP RANLIB SET_MAKE INSTALL_LIBRARY INSTALL_SCRIPT INSTALL_PROGRAM INSTALL_DATA INSTALL_DATA_DIR INSTALL CPP TCL_SHLIB_LD_LIBS TCL_LD_FLAGS TCL_EXTRA_CFLAGS TCL_DEFS TCL_LIBS CLEANFILES OBJEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_PATCH_LEVEL TCL_VERSION PKG_CFLAGS PKG_LIBS PKG_INCLUDES PKG_HEADERS PKG_TCL_SOURCES PKG_STUB_OBJECTS PKG_STUB_SOURCES PKG_STUB_LIB_FILE PKG_LIB_FILE EXEEXT CYGPATH target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_tcl with_tdom with_tclinclude enable_threads enable_shared enable_stubs enable_64bit enable_64bit_vis enable_rpath enable_wince with_celib enable_symbols ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 example 1.0 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/example] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of example 1.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --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-stubs build and link with stub libraries. Always true for shared builds (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-wince enable Win/CE support (where applicable) --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-tcl directory containing tcl configuration (tclConfig.sh) --with-tdom directory containig tDOM configuration (tdomConfig.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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) 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. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF example configure 1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by example $as_me 1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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.10" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5 $as_echo_n "checking for correct TEA configuration... " >&6; } if test x"${PACKAGE_NAME}" = x ; then as_fn_error $? " The PACKAGE_NAME variable must be defined by your TEA configure.ac" "$LINENO" 5 fi if test x"3.10" = x ; then as_fn_error $? " TEA version not specified." "$LINENO" 5 elif test "3.10" != "${TEA_VERSION}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.10\", have \"${TEA_VERSION}\"" >&5 $as_echo "warning: requested TEA version \"3.10\", have \"${TEA_VERSION}\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5 $as_echo "ok (TEA ${TEA_VERSION})" >&6; } fi # If the user did not set CFLAGS, set it now to keep macros # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi case "`uname -s`" in *win32*|*WIN32*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *CYGWIN_*) EXEEXT=".exe" # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG ;; *) CYGPATH=echo # Maybe we are cross-compiling.... case ${host_alias} in *mingw32*) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) EXEEXT="" TEA_PLATFORM="unix" ;; esac ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5 $as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;} # 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 ../../tclconfig "$srcdir"/../../tclconfig; 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../tclconfig \"$srcdir\"/../../tclconfig" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. #-------------------------------------------------------------------- # 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 was given. if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig="${withval}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } if ${ac_cv_c_tclconfig+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 $as_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 as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 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 "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi 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 # TEA specific: 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/contrib/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/lib/tcl8.5 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 "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi 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" as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "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 arbitrary 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" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${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}\"" { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } hold_cc=$CC; CC="$TCL_CC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifdef _WIN32 #error win32 #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : TEA_PLATFORM="unix" CYGPATH=echo else TEA_PLATFORM="windows" # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CC=$hold_cc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5 $as_echo "$TEA_PLATFORM" >&6; } # The BUILD_$pkg is to define the correct extern storage class # handling when making this package cat >>confdefs.h <<_ACEOF #define BUILD_${PACKAGE_NAME} /**/ _ACEOF # Do this here as we have fully defined TEA_PLATFORM now if test "${TEA_PLATFORM}" = "windows" ; then EXEEXT=".exe" CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp" fi # TEA specific: #-------------------------------------------------------------------- # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 $as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 $as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5 $as_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 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. 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c' INSTALL_DATA_DIR='${INSTALL} -d -m 755' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_LIBRARY='${INSTALL_DATA}' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 $as_echo_n "checking if the compiler understands -pipe... " >&6; } if ${tcl_cv_cc_pipe+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_pipe=yes else tcl_cv_cc_pipe=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 $as_echo "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; 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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 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"). #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" if test "x$ac_cv_func_sin" = xyes; then : MATH_LIBS="" else MATH_LIBS="-lm" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5 $as_echo_n "checking for main in -lieee... " >&6; } if ${ac_cv_lib_ieee_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ieee_main=yes else ac_cv_lib_ieee_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5 $as_echo "$ac_cv_lib_ieee_main" >&6; } if test "x$ac_cv_lib_ieee_main" = xyes; 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. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 $as_echo_n "checking for main in -linet... " >&6; } if ${ac_cv_lib_inet_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_main=yes else ac_cv_lib_inet_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 $as_echo "$ac_cv_lib_inet_main" >&6; } if test "x$ac_cv_lib_inet_main" = xyes; then : LIBS="$LIBS -linet" fi ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" if test "x$ac_cv_header_net_errno_h" = xyes; then : $as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h 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 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" if test "x$ac_cv_func_setsockopt" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 $as_echo_n "checking for setsockopt in -lsocket... " >&6; } if ${ac_cv_lib_socket_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_setsockopt=yes else ac_cv_lib_socket_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 $as_echo "$ac_cv_lib_socket_setsockopt" >&6; } if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" if test "x$ac_cv_func_accept" = xyes; then : tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : LIBS="$LIBS -lnsl" fi fi # TEA specific: 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}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5 $as_echo_n "checking dirent.h... " >&6; } if ${tcl_cv_dirent_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : tcl_cv_dirent_h=yes else tcl_cv_dirent_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5 $as_echo "$tcl_cv_dirent_h" >&6; } if test $tcl_cv_dirent_h = no; then $as_echo "#define NO_DIRENT_H 1" >>confdefs.h fi # TEA specific: ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : else $as_echo "#define NO_ERRNO_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" if test "x$ac_cv_header_float_h" = xyes; then : else $as_echo "#define NO_FLOAT_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default" if test "x$ac_cv_header_values_h" = xyes; then : else $as_echo "#define NO_VALUES_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : $as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h else $as_echo "#define NO_LIMITS_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $as_echo "#define NO_STDLIB_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $as_echo "#define NO_STRING_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes; then : else $as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : else $as_echo "#define NO_DLFCN_H 1" >>confdefs.h fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PARAM_H 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 tdomConfig.sh file #-------------------------------------------------------------------- if test x"${no_tdom}" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tDOM configuration" >&5 $as_echo_n "checking for tDOM configuration... " >&6; } # Check whether --with-tdom was given. if test "${with_tdom+set}" = set; then : withval=$with_tdom; with_tdomconfig=${withval} fi no_tdom=true if test "${TEA_PLATFORM}" = "windows" ; then tdom_bindir=win else tdom_bindir=unix fi if ${ac_cv_c_tdomconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tdom was specified. if test x"${with_tdomconfig}" != x ; then if test -f "${with_tdomconfig}/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ${with_tdomconfig}; pwd)` else as_fn_error $? "${with_tdomconfig} directory doesn't contain tdomConfig.sh" "$LINENO" 5 fi fi # Then check for a sibling installation if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ../tdom `ls -dr ../tdom-* 2>/dev/null` \ ../../tdom `ls -dr ../../tdom-* 2>/dev/null` \ ../../../tdom `ls -dr ../../../tdom-* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi # Then check if tnc/tdom are compilied in the source tree if test x"${ac_cv_c_tdomconfig}" = x ; then if test -f "../../$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd ../../$tdom_bindir; pwd)` fi fi # Check in a few common install locations if test x"${ac_cv_c_tdomconfig}" = 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/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i; pwd)` fi done fi # Check in a few other private locations if test x"${ac_cv_c_tdomconfig}" = x ; then for i in \ ${srcdir}/../tdom \ `ls -dr ${srcdir}/../tdom[0-9].[0-9]* 2>/dev/null` ; do if test -f "$i/$tdom_bindir/tdomConfig.sh" ; then ac_cv_c_tdomconfig=`(cd $i/$tdom_bindir; pwd)` fi done fi fi if test x"${ac_cv_c_tdomconfig}" = x ; then TDOM_BIN_DIR="# no tDOM configuration file found" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find tDOM configuration definitions" >&5 $as_echo "$as_me: WARNING: Can't find tDOM configuration definitions" >&2;} exit 0 else no_tdom= TDOM_BIN_DIR=${ac_cv_c_tdomconfig} { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TDOM_BIN_DIR/tdomConfig.sh" >&5 $as_echo "found $TDOM_BIN_DIR/tdomConfig.sh" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of $TDOM_BIN_DIR/tdomConfig.sh" >&5 $as_echo_n "checking for existence of $TDOM_BIN_DIR/tdomConfig.sh... " >&6; } if test -f "$TDOM_BIN_DIR/tdomConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . $TDOM_BIN_DIR/tdomConfig.sh else { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 $as_echo "file not found" >&6; } fi if test -f "${TDOM_BIN_DIR}/Makefile" ; then TDOM_STUB_LIB_SPEC=${TDOM_BUILD_STUB_LIB_SPEC} 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="example.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" \ -a ! -f "${srcdir}/macosx/$i" \ ; then as_fn_error $? "could not find source file '$i'" "$LINENO" 5 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 as_fn_error $? "could not find header file '${srcdir}/$i'" "$LINENO" 5 fi PKG_HEADERS="$PKG_HEADERS $i" done vars="-I${srcdir}/../../generic -I${srcdir}/../../expat" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="${TDOM_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 -DUSE_TDOM_STUBS=1" 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" \ -a ! -f "${srcdir}/macosx/$i" \ ; then as_fn_error $? "could not find stub source file '$i'" "$LINENO" 5 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 as_fn_error $? "could not find tcl source file '${srcdir}/$i'" "$LINENO" 5 fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # # You can add more files to clean if your extension creates any extra # files by extending CLEANFILES. # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. # # A few miscellaneous platform-specific items: # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- #CLEANFILES="$CLEANFILES pkgIndex.tcl" if test "${TEA_PLATFORM}" = "windows" ; then # Ensure no empty if clauses : #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else # Ensure no empty else clauses : #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5 $as_echo_n "checking for Tcl public headers... " >&6; } # Check whether --with-tclinclude was given. if test "${with_tclinclude+set}" = set; then : withval=$with_tclinclude; with_tclinclude=${withval} fi if ${ac_cv_c_tclh+:} false; then : $as_echo_n "(cached) " >&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 as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5 fi else list="" 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 as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5 $as_echo "${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. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-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 $as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h $as_echo "#define _REENTRANT 1" >>confdefs.h if test "`uname -s`" = "SunOS" ; then $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h fi $as_echo "#define _THREAD_SAFE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; 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] { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (); int main () { return __pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_mutex_init=yes else ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_mutex_init=yes else ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 $as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_pthread_mutex_init=yes else ac_cv_lib_c_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 $as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_mutex_init=yes else ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 $as_echo_n "checking for building with threads... " >&6; } if test "${TCL_THREADS}" = 1; then $as_echo "#define TCL_THREADS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 $as_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 { $as_echo "$as_me:${as_lineno-$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 $as_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. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 $as_echo_n "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; shared_ok=$enableval else shared_ok=yes fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" shared_ok=$enableval else shared_ok=yes fi # Check whether --enable-stubs was given. if test "${enable_stubs+set}" = set; then : enableval=$enable_stubs; stubs_ok=$enableval else stubs_ok=yes fi if test "${enable_stubs+set}" = set; then enableval="$enable_stubs" stubs_ok=$enableval else stubs_ok=yes fi # Stubs are always enabled for shared builds if test "$shared_ok" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 $as_echo "shared" >&6; } SHARED_BUILD=1 STUBS_BUILD=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 $as_echo "static" >&6; } SHARED_BUILD=0 $as_echo "#define STATIC_BUILD 1" >>confdefs.h if test "$stubs_ok" = "yes" ; then STUBS_BUILD=1 else STUBS_BUILD=0 fi fi if test "${STUBS_BUILD}" = "1" ; then $as_echo "#define USE_TCL_STUBS 1" >>confdefs.h $as_echo "#define USE_TCLOO_STUBS 1" >>confdefs.h if test "${TEA_WINDOWINGSYSTEM}" != ""; then $as_echo "#define USE_TK_STUBS 1" >>confdefs.h fi 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. #-------------------------------------------------------------------- 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Step 0.a: Enable 64 bit support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 $as_echo_n "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test "${enable_64bit+set}" = set; then : enableval=$enable_64bit; do64bit=$enableval else do64bit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 $as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 $as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes"; then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 $as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } if ${tcl_cv_cc_visibility_hidden+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main () { f(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes else tcl_cv_cc_visibility_hidden=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 $as_echo "$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes; then : $as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h $as_echo "#define HAVE_HIDDEN 1" >>confdefs.h fi # Step 0.d: Disable -rpath support? { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 $as_echo_n "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; doRpath=$enableval else doRpath=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 $as_echo "$doRpath" >&6; } # TEA specific: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = windows; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 $as_echo_n "checking if Windows/CE build is requested... " >&6; } # Check whether --enable-wince was given. if test "${enable_wince+set}" = set; then : enableval=$enable_wince; doWince=$enableval else doWince=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 $as_echo "$doWince" >&6; } fi # Set the variable "system" to hold the name and version number # for the system. { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 $as_echo_n "checking system version... " >&6; } if ${tcl_cv_sys_version+:} false; then : $as_echo_n "(cached) " >&6 else # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 $as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 $as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Require ranlib early so we can override it in special cases below. # 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 and removed some core-only vars. do64bit_ok=no # default to '{$LIBS}' and set to "" on per-platform necessary basis SHLIB_LD_LIBS='${LIBS}' # 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="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" if test "x$SHLIB_VERSION" = x; then : SHLIB_VERSION="" else SHLIB_VERSION=".$SHLIB_VERSION" fi case $system in # TEA specific: 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 "$GCC" != "yes" -a ! -d "${PATH64}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 $as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5 $as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 $as_echo " Using 64-bit $MACHINE mode" >&6; } do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5 fi if test "$GCC" = "yes" ; then as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5 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 was given. if test "${with_celib+set}" = set; then : withval=$with_celib; with_celibconfig=${withval} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 $as_echo_n "checking for Windows/CE celib directory... " >&6; } if ${ac_cv_c_celibconfig+:} false; then : $as_echo_n "(cached) " >&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 as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5 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 as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5 else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5 $as_echo "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 as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 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 case "x`echo \${VisualStudioVersion}`" in x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" vars="ucrt.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 ;; *) ;; esac 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="${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="${lflags} -MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="${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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RC"; then ac_cv_prog_RC="$RC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 $as_echo "$RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 $as_echo "$ac_ct_RC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RC" = x; then RC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RC=$ac_ct_RC fi else RC="$ac_cv_prog_RC" fi 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}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 $as_echo_n "checking for cross-compile version of gcc... " >&6; } if ${ac_cv_cross+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 #error cross-compiler #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cross=yes else ac_cv_cross=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 $as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-gcc" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-gcc" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi 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 # and also # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx # This essentially turns it all on. LDFLAGS_DEBUG="-debug -debugtype:cv" 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_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots ;; 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|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 $as_echo "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_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" 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='${CC} -shared -Wl,-bexpall' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" fi SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" #----------------------------------------------------------- # 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. #----------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 $as_echo_n "checking for inet_ntoa in -lbind... " >&6; } if ${ac_cv_lib_bind_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes else ac_cv_lib_bind_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 $as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" SHLIB_SUFFIX=".dll" EXEEXT=".exe" do64bit_ok=yes CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 $as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } if ${ac_cv_lib_network_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes else ac_cv_lib_network_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 $as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi ;; HP-UX-*.11.*) # Use updated header definitions where possible $as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h # TEA specific: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then : 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='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else CFLAGS="$CFLAGS -z" # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes"; then : if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_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 ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi 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_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then : if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 $as_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*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' LDFLAGS="$LDFLAGS -Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 $as_echo_n "checking if compiler accepts -m64 flag... " >&6; } if ${tcl_cv_cc_m64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes else tcl_cv_cc_m64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 $as_echo "$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 ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" if test "${TCL_THREADS}" = "1"; then : # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} 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 ;; FreeBSD-*) # This configuration from FreeBSD Ports. SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@" SHLIB_SUFFIX=".so" LDFLAGS="" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi case $system in FreeBSD-3.*) # Version numbers are dot-stripped by system policy. TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .` UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1' 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 $as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } if ${tcl_cv_cc_arch_ppc64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes else tcl_cv_cc_arch_ppc64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 $as_echo "$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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 $as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } if ${tcl_cv_cc_arch_x86_64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes else tcl_cv_cc_arch_x86_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 $as_echo "$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;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 $as_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 if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 $as_echo_n "checking if ld accepts -single_module flag... " >&6; } if ${tcl_cv_ld_single_module+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes else tcl_cv_ld_single_module=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 $as_echo "$tcl_cv_ld_single_module" >&6; } if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi # TEA specific: link shlib with current and compatibility version flags vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" SHLIB_SUFFIX=".dylib" # Don't use -prebind when building for Mac OS X 10.4 or later only: if 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; then : LDFLAGS="$LDFLAGS -prebind" fi LDFLAGS="$LDFLAGS -headerpad_max_install_names" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 $as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } if ${tcl_cv_ld_search_paths_first+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes else tcl_cv_ld_search_paths_first=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 $as_echo "$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then : if test "${TEA_WINDOWINGSYSTEM}" = x11; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 $as_echo_n "checking for 64-bit X11... " >&6; } if ${tcl_cv_lib_x11_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_x11_64=yes else tcl_cv_lib_x11_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 $as_echo "$tcl_cv_lib_x11_64" >&6; } fi if test "${TEA_WINDOWINGSYSTEM}" = aqua; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5 $as_echo_n "checking for 64-bit Tk... " >&6; } if ${tcl_cv_lib_tk_64+:} false; then : $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { Tk_InitStubs(NULL, "", 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_tk_64=yes else tcl_cv_lib_tk_64=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5 $as_echo "$tcl_cv_lib_tk_64" >&6; } fi # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi fi ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy $as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; 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_SUFFIX=".so" if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi 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" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) 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" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; 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. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" 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. $as_echo "#define _REENTRANT 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h 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 "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 $as_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 else if test "$arch" = "amd64 i386"; then : if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else do64bit_ok=yes case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi fi SHLIB_SUFFIX=".so" 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 : if test "$arch" = "sparcv9 sparc"; 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" else if test "$arch" = "amd64 i386"; then : # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi fi fi else case $system in SunOS-5.[1-9][0-9]*) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac 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" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 $as_echo_n "checking for ld accepts -Bexport flag... " >&6; } if ${tcl_cv_ld_Bexport+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_Bexport=yes else tcl_cv_ld_Bexport=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 $as_echo "$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 : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 $as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Add in the arch flags late to ensure it wasn't removed. # Not necessary in TEA, but this is aligned with core 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 "$GCC" = yes; then : case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$tcl_cv_cc_visibility_hidden" != yes; then : $as_echo "#define MODULE_SCOPE extern" >>confdefs.h fi if test "$SHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 $as_echo_n "checking for SEH support in compiler... " >&6; } if ${tcl_cv_seh+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : tcl_cv_seh=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tcl_cv_seh=yes else tcl_cv_seh=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 $as_echo "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then $as_echo "#define HAVE_NO_SEH 1" >>confdefs.h fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 $as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } if ${tcl_cv_eh_disposition+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN int main () { EXCEPTION_DISPOSITION x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_eh_disposition=yes else tcl_cv_eh_disposition=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 $as_echo "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then $as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi # Check to see if winnt.h defines CHAR, SHORT, and LONG # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 $as_echo_n "checking for winnt.h that ignores VOID define... " >&6; } if ${tcl_cv_winnt_ignore_void+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define VOID void #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main () { CHAR c; SHORT s; LONG l; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_winnt_ignore_void=yes else tcl_cv_winnt_ignore_void=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 $as_echo "$tcl_cv_winnt_ignore_void" >&6; } if test "$tcl_cv_winnt_ignore_void" = "yes" ; then $as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h fi fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 $as_echo_n "checking for cast to union support... " >&6; } if ${tcl_cv_cast_to_union+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else tcl_cv_cast_to_union=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 $as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 $as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" if ${tcl_cv_flag__isoc99_source+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes else tcl_cv_flag__isoc99_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then $as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if ${tcl_cv_flag__largefile64_source+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=yes else tcl_cv_flag__largefile64_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then $as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if ${tcl_cv_flag__largefile_source64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=yes else tcl_cv_flag__largefile_source64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then $as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 $as_echo "${tcl_flags}" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 $as_echo_n "checking for 64-bit integer type... " >&6; } if ${tcl_cv_type_64bit+:} false; then : $as_echo_n "(cached) " >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_type_64bit=__int64 else tcl_type_64bit="long long" fi rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit=${tcl_type_64bit} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then $as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 $as_echo "using long" >&6; } elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5 $as_echo "using Tcl header defaults" >&6; } else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 $as_echo "${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 $as_echo_n "checking for struct dirent64... " >&6; } if ${tcl_cv_struct_dirent64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes else tcl_cv_struct_dirent64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 $as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 $as_echo_n "checking for struct stat64... " >&6; } if ${tcl_cv_struct_stat64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes else tcl_cv_struct_stat64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 $as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then $as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi for ac_func in open64 lseek64 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 $as_echo_n "checking for off64_t... " >&6; } if ${tcl_cv_type_off64_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes else tcl_cv_type_off64_t=no fi rm -f core 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 $as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 $as_echo_n "checking for build with symbols... " >&6; } # Check whether --enable-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} -DNDEBUG" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 $as_echo "yes (standard debugging)" >&6; } fi fi # TEA specific: if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then $as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 $as_echo "enabled symbols mem debugging" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 $as_echo "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. #-------------------------------------------------------------------- $as_echo "#define USE_TCL_STUBS 1" >>confdefs.h #AC_DEFINE(USE_TK_STUBS, 1, [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)" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 print("manifest needed") #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "manifest needed" >/dev/null 2>&1; then : # Could do a CHECK_PROG for mt, but should always be with MSVC8+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi" VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi" MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}" CLEANFILES="$CLEANFILES *.manifest" fi rm -f conftest* MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -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. if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test "$GCC" = "yes"; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc" fi eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_LIB_FILE=lib${PKG_LIB_FILE} fi fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX}${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_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${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 #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 $as_echo_n "checking for tclsh... " >&6; } if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5 $as_echo "${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 pkgIndex.tcl" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # 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 branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by example $as_me 1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ example config.status 1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tdom-0.9.1/extensions/example/PaxHeaders.9215/pkgIndex.tcl.in0000644000175000001440000000013213325450307022145 xustar000000000000000030 mtime=1532383431.424385848 30 atime=1532383431.492385645 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/example/pkgIndex.tcl.in0000644000175000001440000000027713325450307021371 0ustar00rolfusers00000000000000# tDOM Tcl package index file package ifneeded example @VERSION@ \ "package require expat; \ [list load [file join $dir example@VERSION@[info sharedlibextension] ] example]" tdom-0.9.1/extensions/example/PaxHeaders.9215/tcl.m40000644000175000001440000000013213325450307020307 xustar000000000000000030 mtime=1532383431.424385848 30 atime=1532383431.492385645 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/example/tcl.m40000644000175000001440000017324413325450307017540 0ustar00rolfusers00000000000000# tcl.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_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(SC_PATH_TCLCONFIG, [ # # 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, [ --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 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]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi 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 ]) #------------------------------------------------------------------------ # SC_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(SC_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, [ --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 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]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `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 # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = 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/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]]* 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 ]) #------------------------------------------------------------------------ # SC_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(SC_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([file not found]) fi # # The eval is required to do the TCL_DBGX substitution in the # TCL_LIB_FILE variable # eval TCL_LIB_FILE=${TCL_LIB_FILE} eval TCL_LIB_FLAG=${TCL_LIB_FLAG} AC_SUBST(TCL_DBGX) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_SHLIB_LD_LIBS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # SC_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(SC_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 AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # SC_ENABLE_GCC -- # # Allows the use of GCC if available # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-gcc # # Sets the following vars: # CC Command to use for the compiler #------------------------------------------------------------------------ AC_DEFUN(SC_ENABLE_GCC, [ AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available [--disable-gcc]], [ok=$enableval], [ok=no]) if test "$ok" = "yes"; then CC=gcc else case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) CC=cl ;; *) CC=${CC-cc} ;; esac fi AC_PROG_CC ]) #------------------------------------------------------------------------ # SC_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(SC_ENABLE_SHARED, [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, [ --enable-shared build and link with shared libraries [--enable-shared]], [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) fi ]) #------------------------------------------------------------------------ # SC_ENABLE_THREADS -- # # Specify if thread support should be enabled # # 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 # #------------------------------------------------------------------------ AC_DEFUN(SC_ENABLE_THREADS, [ AC_MSG_CHECKING(for building with threads) AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then TCL_THREADS=1 AC_DEFINE(TCL_THREADS) AC_DEFINE(_REENTRANT) case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) AC_MSG_RESULT(yes) ;; *) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" AC_MSG_RESULT(yes) else TCL_THREADS=0 AC_MSG_RESULT(no) AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") fi ;; esac else TCL_THREADS=0 AC_MSG_RESULT(no (default)) fi ]) #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used # # Arguments: # none # # Requires the following vars to be set: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # 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 Debug library extension # #------------------------------------------------------------------------ AC_DEFUN(SC_ENABLE_SYMBOLS, [ case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) tcl_dbgx=d ;; *) tcl_dbgx=g ;; esac AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" DBGX=${tcl_dbgx} TCL_DBGX=${tcl_dbgx} AC_MSG_RESULT([yes]) else CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" DBGX="" TCL_DBGX="" AC_MSG_RESULT([no]) fi AC_SUBST(TCL_DBGX) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) ]) #-------------------------------------------------------------------- # SC_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 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. # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # 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. # TCL_LIB_FILE - Name of the file that contains the Tcl library, such # as libtcl7.8.so or libtcl7.8.a. # TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl" # in the 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 the Tcl 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 # # EXTRA_CFLAGS # # Subst's the following vars: # DL_LIBS # CFLAGS_DEBUG # CFLAGS_OPTIMIZE #-------------------------------------------------------------------- AC_DEFUN(SC_CONFIG_CFLAGS, [ # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is enabled]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support],,enableval="no") if test "$enableval" = "yes"; then AC_MSG_RESULT(Will compile with 64bit support) do64bit=yes else do64bit=no fi AC_MSG_RESULT($do64bit) # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. AC_MSG_CHECKING([system version (for dynamic loading)]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_RESULT([unknown (can't find uname command)]) system=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 system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi AC_MSG_RESULT($system) fi fi # 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) # Step 3: set configuration options based on system name and version. do64bit_ok=no fullSrcDir=`cd $srcdir; pwd` EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" STLIB_LD="ar cr" case $system in AIX-4.[[2-9]]) SHLIB_CFLAGS="" SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' ;; AIX-*) SHLIB_CFLAGS="" SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LIBOBJS="$LIBOBJS tclLoadAix.o" DL_LIBS="-lld" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' ;; 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" LDFLAGS="" 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="-export-dynamic" LD_SEARCH_FLAGS="" ;; *win32*|*WIN32*|CYGWIN_NT*|cygwin_nt*) CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}" LDFLAGS_CONSOLE="-subsystem:console" LDFLAGS_WINDOW="-subsystem:windows" LDFLAGS_DEBUG="-debug:full -debugtype:cv" LDFLAGS_OPTIMIZE="-release" EXTRA_CFLAGS="-YX" PATHTYPE=-w STLIB_LD="lib -nologo" SHLIB_LD="link -dll -nologo" SHLIB_LD_LIBS="user32.lib advapi32.lib" RC="rc" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*) 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="-Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; IRIX-5.*|IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then EXTRA_CFLAGS="-mabi=n32" LDFLAGS="-mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS" ;; *) EXTRA_CFLAGS="-n32" ;; esac LDFLAGS="-n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" # 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" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LDFLAGS="" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then EXTRA_CFLAGS="-mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" 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="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[12]].*|OpenBSD-*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ SHLIB_CFLAGS="-fpic" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fpic" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h ;; 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="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fpic" SHLIB_LD="ld -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" SHLIB_LD='ld -shared -expect_unresolved "*"' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; 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. SHLIB_CFLAGS="-Kpic -belf" SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="-belf -Wl,-Bexport" 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" LDFLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # 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}\$\{DBGX\}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" # 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" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ;; SunOS-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" do64bit_ok=no if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then do64bit_ok=yes EXTRA_CFLAGS="-xarch=v9" LDFLAGS="-xarch=v9" else AC_MSG_WARN("64bit mode not supported using GCC on $system") fi else AC_MSG_WARN("64bit mode only supported sparcv9 system") 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 "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; 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. hold_ldflags=$LDFLAGS AC_MSG_CHECKING(for ld accepts -Bexport flag) LDFLAGS="${LDFLAGS} -Wl,-Bexport" AC_TRY_LINK(, [int i;], found=yes, found=no) LDFLAGS=$hold_ldflags AC_MSG_RESULT($found) if test $found = yes; then LDFLAGS="-Wl,-Bexport" else LDFLAGS="" fi LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN("64bit support being disabled -- not supported on this platform") fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then AC_MSG_CHECKING(sys/exec.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_H) else AC_MSG_CHECKING(a.out.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_A_OUT_H) else AC_MSG_CHECKING(sys/exec_aout.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_AOUT_H) else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command], [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="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # 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 "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; RISCos-*) ;; ULTRIX-4.*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_LDFLAGS) AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) ]) #-------------------------------------------------------------------- # SC_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. # # Arguments: # none # # Results: # # Defines only one of the following vars: # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN(SC_SERIAL_PORT, [ AC_MSG_CHECKING([termios vs. termio vs. sgtty]) AC_TRY_RUN([ #include main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tk_ok=termios, tk_ok=no, tk_ok=no) if test $tk_ok = termios; then AC_DEFINE(USE_TERMIOS) else AC_TRY_RUN([ #include main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tk_ok=termio, tk_ok=no, tk_ok=no) if test $tk_ok = termio; then AC_DEFINE(USE_TERMIO) else AC_TRY_RUN([ #include main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tk_ok=sgtty, tk_ok=none, tk_ok=none) if test $tk_ok = sgtty; then AC_DEFINE(USE_SGTTY) fi fi fi AC_MSG_RESULT($tk_ok) ]) #-------------------------------------------------------------------- # SC_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 # NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_UNISTD_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # #-------------------------------------------------------------------- AC_DEFUN(SC_MISSING_POSIX_HEADERS, [ AC_MSG_CHECKING(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_ok=yes, tcl_ok=no) if test $tcl_ok = no; then AC_DEFINE(NO_DIRENT_H) fi AC_MSG_RESULT($tcl_ok) AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H)) AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H)) AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H)) AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H)) 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) 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) fi AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H)) AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H)) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(unistd.h sys/param.h) ]) #-------------------------------------------------------------------- # SC_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. # # Arguments: # none # # Results: # # Sets the the following vars: # XINCLUDES # XLIBSW # #-------------------------------------------------------------------- AC_DEFUN(SC_PATH_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) XINCLUDES="# no special path needed" AC_TRY_CPP([#include ], , XINCLUDES="nope") if test "$XINCLUDES" = nope; 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" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then AC_MSG_RESULT(couldn't find any!) XINCLUDES="# no include files found" 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(couldn't find any! Using -lX11.) XLIBSW=-lX11 fi ]) #-------------------------------------------------------------------- # SC_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(SC_BLOCKING_STYLE, [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then system=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 system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi fi fi 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) AC_MSG_RESULT(FIONBIO) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT(FIONBIO) ;; ULTRIX-4.*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT(FIONBIO) ;; *) AC_MSG_RESULT(O_NONBLOCK) ;; esac ]) #-------------------------------------------------------------------- # SC_HAVE_VFORK # # Check to see whether the system provides a vfork kernel call. # If not, then use fork instead. Also, check for a problem with # vforks and signals that can cause core dumps if a vforked child # resets a signal handler. If the problem exists, then use fork # instead of vfork. # # Arguments: # none # # Results: # # Defines some of the following vars: # vfork (=fork) # #-------------------------------------------------------------------- AC_DEFUN(SC_HAVE_VFORK, [ AC_TYPE_SIGNAL() AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0) if test "$tcl_ok" = 1; then AC_MSG_CHECKING([vfork/signal bug]); AC_TRY_RUN([ #include #include #include int gotSignal = 0; sigProc(sig) int sig; { gotSignal = 1; } main() { int pid, sts; (void) signal(SIGCHLD, sigProc); pid = vfork(); if (pid < 0) { exit(1); } else if (pid == 0) { (void) signal(SIGCHLD, SIG_DFL); _exit(0); } else { (void) wait(&sts); } exit((gotSignal) ? 0 : 1); }], tcl_ok=1, tcl_ok=0, tcl_ok=0) if test "$tcl_ok" = 1; then AC_MSG_RESULT(ok) else AC_MSG_RESULT([buggy, using fork instead]) fi fi rm -f core if test "$tcl_ok" = 0; then AC_DEFINE(vfork, fork) fi ]) #-------------------------------------------------------------------- # SC_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(SC_TIME_HANDLER, [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_MSG_CHECKING([tm_tzadj in struct tm]) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], [AC_DEFINE(HAVE_TM_TZADJ) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) AC_MSG_CHECKING([tm_gmtoff in struct tm]) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], [AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # have_timezone=no AC_MSG_CHECKING([long timezone variable]) AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], [have_timezone=yes AC_DEFINE(HAVE_TIMEZONE_VAR) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # if test "$have_timezone" = no; then AC_MSG_CHECKING([time_t timezone variable]) AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], [AC_DEFINE(HAVE_TIMEZONE_VAR) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) fi # # 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. # if test "`uname -s`" = "AIX" ; then AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) if test $libbsd = yes; then AC_DEFINE(USE_DELTA_FOR_TZ) fi fi ]) #-------------------------------------------------------------------- # SC_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. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN(SC_BUGGY_STRTOD, [ AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0) if test "$tk_strtod" = 1; then AC_MSG_CHECKING([for Solaris 2.4 strtod bug]) AC_TRY_RUN([ extern double strtod(); int main() { char *string = "NaN"; char *term; strtod(string, &term); if ((term != string) && (term[-1] == 0)) { exit(1); } exit(0); }], tk_ok=1, tk_ok=0, tk_ok=0) if test "$tk_ok" = 1; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(buggy) AC_DEFINE(strtod, fixstrtod) fi fi ]) #-------------------------------------------------------------------- # SC_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(SC_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"]) #-------------------------------------------------------------------- # On AIX 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. #-------------------------------------------------------------------- libbsd=no if test "`uname -s`" = "AIX" ; then AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" fi fi #-------------------------------------------------------------------- # 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)) #-------------------------------------------------------------------- # 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_LIB(socket, main, 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, main, [LIBS="$LIBS -lnsl"])) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call SC_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #------------------------------------------------------------------------ # SC_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: # MAKE_LIB Makefile rule for building a library # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_UNSHARED_LIB Makefile rule for building a static # library #------------------------------------------------------------------------ AC_DEFUN(SC_MAKE_LIB, [ case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) if test "${CC-cc}" = "cl"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$]@_OBJECTS) " MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$]@_OBJECTS) " fi ;; *) MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$]@_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$]@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" ;; esac if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB=${MAKE_SHARED_LIB} else MAKE_LIB=${MAKE_STATIC_LIB} fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) ]) #------------------------------------------------------------------------ # SC_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: # CYGPATH command used to generate native style paths # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN(SC_LIB_SPEC, [ AC_MSG_CHECKING(for $1 library) # Look in exec-prefix and prefix for the library. If neither of # these were specified, look in libdir. It doesn't matter if libdir # wasn't specified since a search in the unspecified directory will # fail (NONE/lib) if test x"${exec_prefix}" != x"NONE" ; then sc_lib_name_dir="${exec_prefix}/lib" elif test x"${prefix}" != "NONE" ; then sc_lib_name_dir="${prefix}/lib" else eval "sc_lib_name_dir=${libdir}" fi if test x"$2" != x ; then sc_extra_lib_dir=$2 else sc_extra_lib_dir=NONE fi for i in \ `ls -dr ${sc_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${sc_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${sc_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${sc_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 sc_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME}`\" ;; *) # Strip off the leading "lib" and trailing ".a" or ".so" sc_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//'` $1_LIB_SPEC="-L${sc_lib_name_dir} -l${sc_lib_name_lib}" ;; esac if test "x$1_LIB_NAME" = x ; then AC_MSG_ERROR(not found) else AC_MSG_RESULT(${$1_LIB_SPEC}) fi ]) #------------------------------------------------------------------------ # SC_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that SC_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(SC_PRIVATE_TCL_HEADERS, [ AC_MSG_CHECKING(for Tcl private include files) case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/..`\" TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../generic`\" TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../unix`\" TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../win`\" TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../bitmaps`\" TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../tools`\" TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../compat`\" TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} ;; *) TCL_TOP_DIR_NATIVE='$(TCL_SRC_DIR)' TCL_GENERIC_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/generic' TCL_UNIX_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/unix' TCL_WIN_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/win' TCL_BMAP_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/bitmaps' TCL_TOOL_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/tools' TCL_COMPAT_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/compat' TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} ;; esac 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) TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT(Using srcdir found in tclConfig.sh) ]) #------------------------------------------------------------------------ # SC_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(SC_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}) 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 public header file tcl.h]) fi else AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then ac_cv_c_tclh=${with_tclinclude} else # Check in the includedir, if --prefix was specified eval "temp_includedir=${includedir}" for i in \ `ls -d ${temp_includedir} 2>/dev/null` \ /usr/local/include /usr/include ; 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 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) ]) #------------------------------------------------------------------------ # SC_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that SC_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(SC_PRIVATE_TK_HEADERS, [ AC_MSG_CHECKING(for Tk private include files) case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) TK_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/../unix`\" TK_WIN_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/../win`\" TK_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/../generic`\" TK_XLIB_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/../xlib`\" TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE} -I${TK_XLIB_DIR_NATIVE}" ;; *) TK_GENERIC_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/generic' TK_UNIX_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/unix' TK_WIN_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/win' TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" ;; esac 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) ]) #------------------------------------------------------------------------ # SC_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(SC_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}) 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 public header file tk.h]) fi else AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then ac_cv_c_tkh=${with_tkinclude} else # Check in the includedir, if --prefix was specified eval "temp_includedir=${includedir}" for i in \ `ls -d ${temp_includedir} 2>/dev/null` \ /usr/local/include /usr/include ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) 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) ]) #------------------------------------------------------------------------ # SC_SIMPLE_EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. # # Arguments # none # # Results # Subst's the following values: # EXEEXT #------------------------------------------------------------------------ AC_DEFUN(SC_SIMPLE_EXEEXT, [ AC_MSG_CHECKING(executable extension based on host type) case "`uname -s`" in *win32* | *WIN32* | *CYGWIN_NT*) EXEEXT=".exe" ;; *) EXEEXT="" ;; esac AC_MSG_RESULT(${EXEEXT}) AC_SUBST(EXEEXT) ]) #------------------------------------------------------------------------ # SC_PROG_TCLSH # Locate a tclsh shell in the following directories: # ${exec_prefix}/bin # ${prefix}/bin # ${TCL_BIN_DIR} # ${TCL_BIN_DIR}/../bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN(SC_PROG_TCLSH, [ AC_MSG_CHECKING([for tclsh]) AC_CACHE_VAL(ac_cv_path_tclsh, [ search_path=`echo ${exec_prefix}/bin:${prefix}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ]) if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh AC_MSG_RESULT($TCLSH_PROG) else AC_MSG_ERROR(No tclsh found in PATH: $search_path) fi AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # SC_PROG_WISH # Locate a wish shell in the following directories: # ${exec_prefix}/bin # ${prefix}/bin # ${TCL_BIN_DIR} # ${TCL_BIN_DIR}/../bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN(SC_PROG_WISH, [ AC_MSG_CHECKING([for wish]) AC_CACHE_VAL(ac_cv_path_wish, [ search_path=`echo ${exec_prefix}/bin:${prefix}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/wish[[8-9]]* 2> /dev/null` \ `ls -r $dir/wish* 2> /dev/null` ; do if test x"$ac_cv_path_wish" = x ; then if test -f "$j" ; then ac_cv_path_wish=$j break fi fi done done ]) if test -f "$ac_cv_path_wish" ; then WISH_PROG=$ac_cv_path_wish AC_MSG_RESULT($WISH_PROG) else AC_MSG_ERROR(No wish found in PATH: $search_path) fi AC_SUBST(WISH_PROG) ]) tdom-0.9.1/extensions/PaxHeaders.9215/tdomhtml0000644000175000001440000000013213325450307017403 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532446226.522747811 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/tdomhtml/0000755000175000001440000000000013325450307016676 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/configure.in0000644000175000001440000000013213325450307021771 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/configure.in0000644000175000001440000001703113325450307021211 0ustar00rolfusers00000000000000#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. #----------------------------------------------------------------------- # Sample configure.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(tdomhtml.tcl) AC_CONFIG_AUX_DIR(../../tclconfig) CONFIGDIR=${srcdir}/../../tclconfig AC_SUBST(CONFIGDIR) #---------------------------------------------------------------------- # __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=tdomhtml MAJOR_VERSION=0 MINOR_VERSION=1 PATCHLEVEL=0 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL} NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}${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}") #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # 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 # Since we're not compiling, only installing... AC_PROG_INSTALL #-------------------------------------------------------------------- # __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 #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then CLEANFILES="pkgIndex.tcl" EXTRA_SOURCES='$(WIN_SOURCES)' else CLEANFILES="pkgIndex.tcl" EXTRA_SOURCES='$(UNIX_SOURCES)' fi AC_SUBST(CLEANFILES) AC_SUBST(EXTRA_SOURCES) #-------------------------------------------------------------------- # 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. # For tDOM we always build both, static and shared libraries #-------------------------------------------------------------------- #TEA_MAKE_LIB #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- #LIBS="${LIBS} --lsuperfly" #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # Add some private include directories #-------------------------------------------------------------------- #-------------------------------------------------------------------- # 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 pkgIndex.tcl]) tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/doc0000644000175000001440000000013213325450307020150 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532446226.522747811 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/doc/0000755000175000001440000000000013325450307017443 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tdomhtml/doc/PaxHeaders.9215/tdomhtml.tmml0000644000175000001440000000013213325450307022750 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/doc/tdomhtml.tmml0000644000175000001440000000000013325450307022154 0ustar00rolfusers00000000000000tdom-0.9.1/extensions/tdomhtml/doc/PaxHeaders.9215/tdomhtml.n0000644000175000001440000000013213325450307022234 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/doc/tdomhtml.n0000644000175000001440000000000013325450307021440 0ustar00rolfusers00000000000000tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/CONFIG0000644000175000001440000000013213325450307020350 xustar000000000000000030 mtime=1532383431.424385848 30 atime=1532383431.492385645 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/tdomhtml/CONFIG0000644000175000001440000000072413325450307017571 0ustar00rolfusers00000000000000#!/bin/sh # # This is a small collection of example settings you can use to # compile tdom on different platforms. Just uncomment the line(s) # you need and run this script with "sh CONFIG". # # # Tcl on Unix (uses public Tcl library) # -------------------------------------------- # ./configure # # Mac OS X. Uses public Tcl library. # -------------------------------------------- # ./configure \ # --mandir=/usr/local/share/man \ # --libdir=/Library/Tcl # # EOF tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/mkinstalldirs0000644000175000001440000000013213325450307022263 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/mkinstalldirs0000755000175000001440000000123713325450307021507 0ustar00rolfusers00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/win0000644000175000001440000000013213325450307020200 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532446226.522747811 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/tdomhtml/win/0000755000175000001440000000000013325450307017473 5ustar00rolfusers00000000000000tdom-0.9.1/extensions/tdomhtml/win/PaxHeaders.9215/makefile.vc0000644000175000001440000000013213325450307022364 xustar000000000000000030 mtime=1532383431.426385842 30 atime=1532383431.493385642 30 ctime=1532383431.426385842 tdom-0.9.1/extensions/tdomhtml/win/makefile.vc0000644000175000001440000000222513325450307021603 0ustar00rolfusers00000000000000# Simple makefile for pure Tcl package PROJECT = tdomhtml DOTVERSION = 0.1.0 VERSION = $(DOTVERSION:.=) CPY = echo y | xcopy /i >NUL !ifndef INSTALLDIR ### Assume the normal default. _INSTALLDIR = C:\Program Files\Tcl\lib !else ### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\)\lib !endif PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION) DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) all: @echo This is a pure Tcl package. Just run 'make /f makefile.vc install INSTALLDIR=path\to\tcl\root' install: install-libraries install-libraries: @if not exist $(SCRIPT_INSTALL_DIR)\nul mkdir $(SCRIPT_INSTALL_DIR) @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' $(CPY) ..\tdomhtml.tcl "$(SCRIPT_INSTALL_DIR)" >NUL @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" package ifneeded tdomhtml $(DOTVERSION) "set _V_ $(DOTVERSION); source [list [file join $$dir tdomhtml.tcl]]" << install-docs: # @echo Installing documentation files to '$(DOC_INSTALL_DIR)' # @if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.n "$(DOC_INSTALL_DIR)"tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/install-sh0000644000175000001440000000013213325450307021461 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/install-sh0000755000175000001440000000421213325450307020701 0ustar00rolfusers00000000000000#!/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 tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/Makefile.in0000644000175000001440000000013213325450307021525 xustar000000000000000030 mtime=1532383431.424385848 30 atime=1532383431.492385645 30 ctime=1532383431.424385848 tdom-0.9.1/extensions/tdomhtml/Makefile.in0000644000175000001440000001253713325450307020753 0ustar00rolfusers00000000000000# 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 ActiveState SRL. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id$ #======================================================================== # RUNTIME_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== RUNTIME_SOURCES = tdomhtml.tcl #======================================================================== # 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. #======================================================================== lib_BINARIES = 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)$(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 = @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_STUB_LIB = @MAKE_STUB_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_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@ #======================================================================== # 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="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \ LIBPATH="$(EXTRA_PATH):${LIBPATH}" \ SHLIB_PATH="$(EXTRA_PATH):${SHLIB_PATH}" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(top_builddir)" TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @TCL_INCLUDES@ @TNC_INCLUDES@ EXTRA_CFLAGS = $(MEM_DEBUG_FLAGS) @EXTRA_CFLAGS@ DEFS = $(TCL_DEFS) @DEFS@ $(EXTRA_CFLAGS) CONFIG_CLEAN_FILES = Makefile CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== all: @echo "This is a Tcl-only package; nothing to make, really." @echo "Just do a 'make install' to install docs and the library." install: install-doc install-libraries install-libraries: @mkdir -p $(DESTDIR)$(pkglibdir) @echo "Installing library files in $(DESTDIR)$(libdir)" @list='$(RUNTIME_SOURCES)'; for p in $$list; do\ if test -f $(srcdir)/$$p; then\ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkglibdir)/$$p";\ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$p;\ fi;\ done @$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir) install-doc: @mkdir -p $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" @for i in $(srcdir)/doc/*.n; do\ echo " $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann/`basename $$i`";\ rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`;\ $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ;\ done test: depend: #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status .PHONY: all clean depend distclean doc install libraries # 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: tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/configure0000644000175000001440000000013213325450307021364 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.492385645 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/configure0000755000175000001440000027051213325450307020614 0ustar00rolfusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="tdomhtml.tcl" ac_subst_vars='LTLIBOBJS LIBOBJS EXTRA_SOURCES CLEANFILES INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM VERSION PACKAGE CONFIGDIR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 this package 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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_aux_dir= for ac_dir in ../../tclconfig "$srcdir"/../../tclconfig; 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../tclconfig \"$srcdir\"/../../tclconfig" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. CONFIGDIR=${srcdir}/../../tclconfig #---------------------------------------------------------------------- # __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=tdomhtml MAJOR_VERSION=0 MINOR_VERSION=1 PATCHLEVEL=0 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL} NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}${PATCHLEVEL} #-------------------------------------------------------------------- # We put this here so that you can compile with -DVERSION="1.2" to # encode the package version directly into the source files. #-------------------------------------------------------------------- eval cat >>confdefs.h <<_ACEOF #define VERSION "${VERSION}" _ACEOF #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # 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 # Since we're not compiling, only installing... # 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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_fn_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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' #-------------------------------------------------------------------- # __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 #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then CLEANFILES="pkgIndex.tcl" EXTRA_SOURCES='$(WIN_SOURCES)' else CLEANFILES="pkgIndex.tcl" EXTRA_SOURCES='$(UNIX_SOURCES)' fi #-------------------------------------------------------------------- # 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. # For tDOM we always build both, static and shared libraries #-------------------------------------------------------------------- #TEA_MAKE_LIB #-------------------------------------------------------------------- # __CHANGE__ # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. #-------------------------------------------------------------------- #LIBS="${LIBS} --lsuperfly" #-------------------------------------------------------------------- # 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 #-------------------------------------------------------------------- # Add some private include directories #-------------------------------------------------------------------- #-------------------------------------------------------------------- # 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 pkgIndex.tcl" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # 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 branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/tdomhtml.tcl0000644000175000001440000000013213325450307022014 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/tdomhtml.tcl0000644000175000001440000002310113325450307021227 0ustar00rolfusers00000000000000#---------------------------------------------------------------------------- # Copyright (c) 1999,2000 Jochen Loewer (loewerj@hotmail.com) et al. #---------------------------------------------------------------------------- # # Rcsid: @(#)$Id$ # # Implements simple HTML layer on top of core DOM Level-1 specification, # as implemented in tDOM package. # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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 tDOM. # The Initial Developer of the Original Code is Jochen Loewer. # # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Portions created by Zoran Vasiljevic are Copyright (C) 2000-2002 # Zoran Vasiljevic. All Rights Reserved. # # Portions created by Rolf Ade are Copyright (C) 1999-2002 # Rolf Ade. All Rights Reserved. # Contributor(s): # # 3 Apr 2000 Zoran Vasiljevic (zoran@v-connect.com) # Initial idea # # 20 Oct 2002 Rolf Ade (rolf@pointsman.de) # Suggestion to rewrite with new tdom :) # # 23 Oct 2002 Zoran Vasiljevic (zoran@archiware.com) # Rewritten from scratch using new tdom. # # Written by Zoran Vasiljevic # April, 2000 # #---------------------------------------------------------------------------- # # This package requires the loaded tdom # so bark early if we can't find it. # package require tdom # # Caller (usually our pkgIndex.tcl loader) will supply the package # version by defining the _V_ variable before sourcing this file. # For all other cases, we just provide the no-version package. # if {[info exists _V_] == 0} { package provide tdomhtml } else { package provide tdomhtml $_V_ } # # Declare HTML generating commands # namespace eval ::dom::domHTML { # # Create commands for generating HTML tags. This is a complete # set taken from http://www.w3.org/TR/html4/index/elements.html # variable elementNodeCmd { a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol optgroup option p param pre q s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var } foreach nodecmd $elementNodeCmd { dom createNodeCmd elementNode $nodecmd } # # Miscellaneous commands. Not part of HTML specs but needed # for generation of special DOM nodes. # variable textNodeCmd t dom createNodeCmd textNode $textNodeCmd variable commentNodeCmd c dom createNodeCmd commentNode $commentNodeCmd } #----------------------------------------------------------------------------- # ::dom::domHTML::newdoc -- # # Creates the HTML document and fils it with content. # Note: script is evaluated in the context of ::dom::domHTML namespace. #----------------------------------------------------------------------------- proc ::dom::domHTML::newdoc {script {upvars {}}} { foreach name $upvars { upvar $name $name } set doc [dom createDocument html] [$doc documentElement] appendFromScript $script return $doc } #----------------------------------------------------------------------------- # ::dom::domHTML::putdoc -- # # Convenience wrapper to serialize the document to the output channel #----------------------------------------------------------------------------- proc ::dom::domHTML::putdoc {doc chan} { [$doc documentElement] asHTML -channel $chan } #----------------------------------------------------------------------------- # ::dom::domHTML::deldoc -- # # Convenience wrapper to dispose the html document #----------------------------------------------------------------------------- proc ::dom::domHTML::deldoc {doc} { $doc delete } #----------------------------------------------------------------------------- # ::dom::domHTML::html2tcl -- # # Parses the html file and creates a Tcl script usable for passing # to the ::dom::domHTML::newdoc command. #----------------------------------------------------------------------------- proc ::dom::domHTML::html2tcl {htmlfile {outfile ""}} { # # Slurp-in the entire html file # set ichan [open $htmlfile] set html [read $ichan] close $ichan # # Create in-memory DOM tree by parsing # the html content with the built-in # tdom html parser. # dom parse -html $html doc # # Open output file and recursively # format all elements found there. # if {$outfile == ""} { set outfile [file root $htmlfile].tcl } set ochan [open $outfile w] _2tcl [$doc documentElement] $ochan close $ochan } #----------------------------------------------------------------------------- # ::dom::domHTML::_2tcl -- # # Helper procedure for recursively parsing the html tag #----------------------------------------------------------------------------- proc ::dom::domHTML::_2tcl {top ochan {indent 2} {offset 0}} { variable commentNodeCmd variable textNodeCmd variable elementNodeCmd set space [string repeat " " $offset] foreach child [$top childNodes] { switch -- [$child nodeType] { ELEMENT_NODE { # Emit the nodename as html command # and create node command if missing set nodecmd [string tolower [$child nodeName]] if {[lsearch $elementNodeCmd $name] == -1} { dom createNodeCmd elementNode $nodecmd } puts -nonewline $ochan $space puts -nonewline $ochan $nodecmd # Emit node attributes as key/value pairs foreach att [$child attributes] { puts -nonewline $ochan " " puts -nonewline $ochan [string tolower $att] puts -nonewline $ochan " " set val [_entityesc [$child getAttribute $att]] if {[regexp { } $val]} { puts -nonewline $ochan \"$val\" } else { puts -nonewline $ochan $val } } # Recurse to child nodes if {[llength [$child childNodes]]} { puts $ochan " {" _2tcl $child $ochan $indent [expr {$offset+$indent}] puts -nonewline $ochan $space puts $ochan "}" } else { puts $ochan "" } } TEXT_NODE - CDATA_SECTION_NODE { # Escape contents of text nodes puts -nonewline $ochan $space puts -nonewline $ochan "$textNodeCmd {" puts -nonewline $ochan [_entityesc [$child nodeValue]] puts $ochan "}" } COMMENT_NODE { # Pass contents of comment nodes as-is puts -nonewline $ochan $space puts -nonewline $ochan "$commentNodeCmd {" puts -nonewline $ochan [$child nodeValue] puts $ochan "}" } } } } #----------------------------------------------------------------------------- # ::dom::domHTML::_entityesc -- # # Helper procedure for entity escaping #----------------------------------------------------------------------------- proc ::dom::domHTML::_entityesc {string} { regsub -all {(&[^;]+;)} $string {\\\1} string regsub -all {([\#\[\]])} $string {\\\1} string return $string } #----------------------------------------------------------------------------- # Short usage example. # #----------------------------------------------------------------------------- if {0} { set doc [dom::domHTML::newdoc { title {t "Test document generated with tDOM"} body { table border 1 width 100 { for {set i 0} {$i < 5} {incr i} { tr { td { i { t "italic $i and " b {t "italic-bold $i"} } } } } } } }] dom::domHTML::putdoc $doc stdout dom::domHTML::deldoc $doc } # - EOF - tdom-0.9.1/extensions/tdomhtml/PaxHeaders.9215/pkgIndex.tcl.in0000644000175000001440000000013213325450307022342 xustar000000000000000030 mtime=1532383431.425385845 30 atime=1532383431.493385642 30 ctime=1532383431.425385845 tdom-0.9.1/extensions/tdomhtml/pkgIndex.tcl.in0000644000175000001440000000014613325450307021561 0ustar00rolfusers00000000000000package ifneeded tdomhtml @VERSION@ "set _V_ @VERSION@; source [list [file join $dir tdomhtml.tcl]]" tdom-0.9.1/PaxHeaders.9215/README0000644000175000001440000000013113325450307014310 xustar000000000000000030 mtime=1532383431.410385893 29 atime=1532383431.48738566 30 ctime=1532383431.410385893 tdom-0.9.1/README0000644000175000001440000001003313325450307013524 0ustar00rolfusers00000000000000 tDOM - a XML/DOM/XPath/XSLT/HTML/JSON implementation for Tcl (Version 0.9.1) This directory contains a freely distributable thread-safe extension to Tcl/Tk called tDOM. tDOM contains: * for convenience expat 2.2.5, the XML parser originated from James Clark, although you're able to link tDOM with other expat versions or the library provided by the system. * building a DOM tree from XML in one go implemented in C for maximum performance and minimum memory usage, and DOM I and II methods to work on such a tree using either a OO-like or a handle syntax. * a Tcl interface to expat for event-like (SAX-like) XML parsing. * a complete, compliant and fast XPath implementation in C following the November 99 W3C recommendation for navigating and data extraction. * a fast XSLT implementation in C following the W3C Recommendation 16 November 1999. * optional DTD validation. * a JSON parser which parses any possible JSON input into a DOM tree without losing information. * an efficient and Tcl'ish way to create XML and HTML documents and JSON string. * as build option an interface to the gumbo HTML5 parser, which also digests almost any other HTML. * an even faster simple XML parser for trusted XML input. * A slim Tcl interface to use expat as pull-parser. * additional convenience methods. * and more. DOCUMENTATION The documentation is included into the source distribution in HTML and man format. Alternatively, read it online starting at http://tdom.org/index.html/doc/trunk/doc/index.html GETTING THE CODE The development repository is hosted at http://tdom.org and is mirrored at http://core.tcl.tk/tdom. You are encouraged to use trunk. If you insist on using an older tDOM with lesser features and probably more bugs, you should use the latest release 0.9.1. Get the source code release from http://tdom.org/downloads/tdom-0.9.1-src.tgz or http://tdom.org/downloads/tdom-0.9.1-src.zip Windows binaries (32 bit as well as 64 bit) of the 0.9.1 release are also available. Get it from http://tdom.org/downloads/tdom-0.9.1-windows-x64.zip and http://tdom.org/downloads/tdom-0.9.1-windows-x86.zip The provided windows binaries include (statically linked) the HTML5 parser. COMPILING tDOM Depending on your platform (unix/mac or win), go to the corresponding directory and invoke the configure script: ../configure make make test make install Alternatively, you can build the tDOM package in just about any directory elsewhere on the fileystem (since TEA-compatible). You might also want to do "../configure --help" to get a list of all supported options of the configure script. In the "unix" directory there is a "CONFIG" file containing some examples on how to invoke the "configure" script for some common cases. You can peek there. This file also includes a short description of the tDOM specific configure options. Since tDOM is TEA-compatible you should be able to build it using the MinGW build environment for Windows. There is also the MSVC nmake file so you can compile the package with Microsoft tools. Refer to the README in the win directory for more details about building on Windows. The compile process will build the tDOM shared library suitable for loading into the Tcl shell using standard "package require" mechanism. REPORTING BUGS Please head to http://tdom.org/index.html/ticket and click on "New Ticket". Log in as anonymous and report your findings. If you prefer to have an individual login write Rolf a mail. HISTORY tDOM was started by Jochen Loewer (loewerj@hotmail.com) and developed by Jochen and Rolf Ade (rolf@pointsman.de) with contributions by Zoran Vasiljevic (zv@archiware.com). Since more than a dozen years it is maintained and developed by Rolf Ade. tdom-0.9.1/PaxHeaders.9215/lib0000644000175000001440000000013213325450307014122 xustar000000000000000030 mtime=1532383431.438385806 30 atime=1532446226.522747811 30 ctime=1532383431.438385806 tdom-0.9.1/lib/0000755000175000001440000000000013325450307013415 5ustar00rolfusers00000000000000tdom-0.9.1/lib/PaxHeaders.9215/tdom.tcl0000644000175000001440000000013213325450307015646 xustar000000000000000030 mtime=1532383431.438385806 30 atime=1532383431.498385627 30 ctime=1532383431.438385806 tdom-0.9.1/lib/tdom.tcl0000644000175000001440000007505013325450307015073 0ustar00rolfusers00000000000000#---------------------------------------------------------------------------- # Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # $Id$ # # # The higher level functions of tDOM written in plain Tcl. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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 tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # Rolf Ade (rolf@pointsman.de): 'fake' nodelists/live childNodes # # written by Jochen Loewer # April, 1999 # #---------------------------------------------------------------------------- package require tdom #---------------------------------------------------------------------------- # setup namespaces for additional Tcl level methods, etc. # #---------------------------------------------------------------------------- namespace eval ::dom { namespace eval domDoc { } namespace eval domNode { } namespace eval DOMImplementation { } namespace eval xpathFunc { } namespace eval xpathFuncHelper { } } namespace eval ::tdom { variable extRefHandlerDebug 0 variable useForeignDTD "" namespace export xmlOpenFile xmlReadFile xmlReadFileForSimple \ extRefHandler baseURL } #---------------------------------------------------------------------------- # hasFeature (DOMImplementation method) # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::hasFeature { dom feature {version ""} } { switch $feature { xml - XML { if {($version == "") || ($version == "1.0")} { return 1 } } } return 0 } #---------------------------------------------------------------------------- # load (DOMImplementation method) # # requests a XML document via http using the given URL and # builds up a DOM tree in memory returning the document object # # # @in url the URL, where to get the XML document # # @return document object # @exception XML parse errors, ... # #---------------------------------------------------------------------------- proc ::dom::DOMImplementation::load { dom url } { error "Sorry, load method not implemented yet!" } #---------------------------------------------------------------------------- # isa (docDoc method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domDoc::isa { doc className } { if {$className == "domDoc"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domDoc method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::info { doc subcommand args } { switch $subcommand { class { return "domDoc" } inherit { return "" } heritage { return "domDoc {}" } default { error "domDoc::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # importNode (domDoc method) # # Document Object Model (Core) Level 2 method # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domDoc::importNode { doc importedNode deep } { if {$deep || ($deep == "-deep")} { set node [$importedNode cloneNode -deep] } else { set node [$importedNode cloneNode] } return $node } #---------------------------------------------------------------------------- # isa (domNode method, for [incr tcl] compatibility) # # # @in className # # @return 1 iff inherits from the given class # #---------------------------------------------------------------------------- proc ::dom::domNode::isa { doc className } { if {$className == "domNode"} { return 1 } return 0 } #---------------------------------------------------------------------------- # info (domNode method, for [incr tcl] compatibility) # # # @in subcommand # @in args # #---------------------------------------------------------------------------- proc ::dom::domNode::info { doc subcommand args } { switch $subcommand { class { return "domNode" } inherit { return "" } heritage { return "domNode {}" } default { error "domNode::info subcommand $subcommand not yet implemented!" } } } #---------------------------------------------------------------------------- # isWithin (domNode method) # # tests, whether a node object is nested below another tag # # # @in tagName the nodeName of an elment node # # @return 1 iff node is nested below a element with nodeName tagName # 0 otherwise # #---------------------------------------------------------------------------- proc ::dom::domNode::isWithin { node tagName } { while {[$node parentNode] != ""} { set node [$node parentNode] if {[$node nodeName] == $tagName} { return 1 } } return 0 } #---------------------------------------------------------------------------- # tagName (domNode method) # # same a nodeName for element interface # #---------------------------------------------------------------------------- proc ::dom::domNode::tagName { node } { if {[$node nodeType] == "ELEMENT_NODE"} { return [$node nodeName] } return -code error "NOT_SUPPORTED_ERR not an element!" } #---------------------------------------------------------------------------- # simpleTranslate (domNode method) # # applies simple translation rules similar to Cost's simple # translations to a node # # # @in output_var # @in trans_specs # #---------------------------------------------------------------------------- proc ::dom::domNode::simpleTranslate { node output_var trans_specs } { upvar $output_var output if {[$node nodeType] == "TEXT_NODE"} { append output [cgiQuote [$node nodeValue]] return } set found 0 foreach {match action} $trans_specs { if {[catch { if {!$found && ([$node selectNode self::$match] != "") } { set found 1 } } err]} { if {![string match "NodeSet expected for parent axis!" $err]} { error $err } } if {$found && ($action != "-")} { set stop 0 foreach {type value} $action { switch $type { prefix { append output [subst $value] } tag { append output <$value> } start { append output [eval $value] } stop { set stop 1 } } } if {!$stop} { foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } foreach {type value} $action { switch $type { suffix { append output [subst $value] } end { append output [eval $value] } tag { append output } } } return } } foreach child [$node childNodes] { simpleTranslate $child output $trans_specs } } #---------------------------------------------------------------------------- # a DOM conformant 'live' childNodes # # @return a 'nodelist' object (it is just the normal node) # #---------------------------------------------------------------------------- proc ::dom::domNode::childNodesLive { node } { return $node } #---------------------------------------------------------------------------- # item method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::item { nodeListNode index } { return [lindex [$nodeListNode childNodes] $index] } #---------------------------------------------------------------------------- # length method on a 'nodelist' object # # @return a 'nodelist' object (it is just a normal # #---------------------------------------------------------------------------- proc ::dom::domNode::length { nodeListNode } { return [llength [$nodeListNode childNodes]] } #---------------------------------------------------------------------------- # appendData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::appendData { node arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set oldValue [$node nodeValue] $node nodeValue [append oldValue $arg] } #---------------------------------------------------------------------------- # deleteData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::deleteData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $after] } #---------------------------------------------------------------------------- # insertData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::insertData { node offset arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # replaceData on a 'CharacterData' object # #---------------------------------------------------------------------------- proc ::dom::domNode::replaceData { node offset count arg } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } incr offset -1 set before [string range [$node nodeValue] 0 $offset] incr offset incr offset $count set after [string range [$node nodeValue] $offset end] $node nodeValue [append before $arg $after] } #---------------------------------------------------------------------------- # substringData on a 'CharacterData' object # # @return part of the node value (text) # #---------------------------------------------------------------------------- proc ::dom::domNode::substringData { node offset count } { set type [$node nodeType] if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") && ($type != "COMMENT_NODE") } { return -code error "NOT_SUPPORTED_ERR: node is not a cdata node" } set endOffset [expr $offset + $count - 1] return [string range [$node nodeValue] $offset $endOffset] } #---------------------------------------------------------------------------- # coerce2number # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2number { type value } { switch $type { empty { return 0 } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes number()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # coerce2string # #---------------------------------------------------------------------------- proc ::dom::xpathFuncHelper::coerce2string { type value } { switch $type { empty { return "" } number - string { return $value } attrvalues { return [lindex $value 0] } nodes { return [[lindex $value 0] selectNodes string()] } attrnodes { return [lindex $value 1] } } } #---------------------------------------------------------------------------- # function-available # #---------------------------------------------------------------------------- proc ::dom::xpathFunc::function-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "function-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { boolean - ceiling - concat - contains - count - current - document - element-available - false - floor - format-number - generate-id - id - key - last - lang - local-name - name - namespace-uri - normalize-space - not - number - position - round - starts-with - string - string-length - substring - substring-after - substring-before - sum - translate - true - unparsed-entity-uri { return [list bool true] } default { set TclXpathFuncs [info procs ::dom::xpathFunc::*] if {[lsearch -exact $TclXpathFuncs $str] != -1} { return [list bool true] } else { return [list bool false] } } } } #---------------------------------------------------------------------------- # element-available # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::element-available { ctxNode pos nodeListType nodeList args} { if {[llength $args] != 2} { error "element-available(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] # The XSLT recommendation says: "The element-available # function returns true if and only if the expanded-name # is the name of an instruction." The following xsl # elements are not in the category instruction. # xsl:attribute-set # xsl:decimal-format # xsl:include # xsl:key # xsl:namespace-alias # xsl:output # xsl:param # xsl:strip-space # xsl:preserve-space # xsl:template # xsl:import # xsl:otherwise # xsl:sort # xsl:stylesheet # xsl:transform # xsl:with-param # xsl:when switch $str { xsl:apply-templates - xsl:apply-imports - xsl:call-template - xsl:element - xsl:attribute - xsl:text - xsl:processing-instruction - xsl:comment - xsl:copy - xsl:value-of - xsl:number - xsl:for-each - xsl:if - xsl:choose - xsl:variable - xsl:copy-of - xsl:message - xsl:fallback { return [list bool true] } default { return [list bool false] } } } #---------------------------------------------------------------------------- # system-property # # This is not strictly correct. The XSLT namespace may be bound # to another prefix (and the prefix 'xsl' may be bound to another # namespace). Since the expression context isn't available at the # moment at tcl coded XPath functions, this couldn't be done better # than this "works in the 'normal' cases" version. #---------------------------------------------------------------------------- proc ::dom::xpathFunc::system-property { ctxNode pos nodeListType nodeList args } { if {[llength $args] != 2} { error "system-property(): wrong # of args!" } foreach { arg1Typ arg1Value } $args break set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ] switch $str { xsl:version { return [list number 1.0] } xsl:vendor { return [list string "Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."] } xsl:vendor-url { return [list string "http://www.tdom.org"] } default { return [list string ""] } } } #---------------------------------------------------------------------------- # IANAEncoding2TclEncoding # #---------------------------------------------------------------------------- # As of version 8.3.4 tcl supports # cp860 cp861 cp862 cp863 tis-620 cp864 cp865 cp866 gb12345 cp949 # cp950 cp869 dingbats ksc5601 macCentEuro cp874 macUkraine jis0201 # gb2312 euc-cn euc-jp iso8859-10 macThai jis0208 iso2022-jp # macIceland iso2022 iso8859-13 iso8859-14 jis0212 iso8859-15 cp737 # iso8859-16 big5 euc-kr macRomania macTurkish gb1988 iso2022-kr # macGreek ascii cp437 macRoman iso8859-1 iso8859-2 iso8859-3 ebcdic # macCroatian koi8-r iso8859-4 iso8859-5 cp1250 macCyrillic iso8859-6 # cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253 # iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852 # macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode # cp857 # # Just add more mappings (and mail them to the tDOM mailing list, please). proc tdom::IANAEncoding2TclEncoding {IANAName} { # First the most widespread encodings with there # preferred MIME name, to speed lookup in this # usual cases. Later the official names and the # aliases. # # For "official names for character sets that may be # used in the Internet" see # http://www.iana.org/assignments/character-sets # (that's the source for the encoding names below) # # Matching is case-insensitive switch [string tolower $IANAName] { "us-ascii" {return ascii} "utf-8" {return utf-8} "utf-16" {return unicode} "iso-8859-1" {return iso8859-1} "iso-8859-2" {return iso8859-2} "iso-8859-3" {return iso8859-3} "iso-8859-4" {return iso8859-4} "iso-8859-5" {return iso8859-5} "iso-8859-6" {return iso8859-6} "iso-8859-7" {return iso8859-7} "iso-8859-8" {return iso8859-8} "iso-8859-9" {return iso8859-9} "iso-8859-10" {return iso8859-10} "iso-8859-13" {return iso8859-13} "iso-8859-14" {return iso8859-14} "iso-8859-15" {return iso8859-15} "iso-8859-16" {return iso8859-16} "iso-2022-kr" {return iso2022-kr} "euc-kr" {return euc-kr} "iso-2022-jp" {return iso2022-jp} "koi8-r" {return koi8-r} "shift_jis" {return shiftjis} "euc-jp" {return euc-jp} "gb2312" {return gb2312} "big5" {return big5} "cp866" {return cp866} "cp1250" {return cp1250} "cp1253" {return cp1253} "cp1254" {return cp1254} "cp1255" {return cp1255} "cp1256" {return cp1256} "cp1257" {return cp1257} "windows-1251" - "cp1251" {return cp1251} "windows-1252" - "cp1252" {return cp1252} "iso_8859-1:1987" - "iso-ir-100" - "iso_8859-1" - "latin1" - "l1" - "ibm819" - "cp819" - "csisolatin1" {return iso8859-1} "iso_8859-2:1987" - "iso-ir-101" - "iso_8859-2" - "iso-8859-2" - "latin2" - "l2" - "csisolatin2" {return iso8859-2} "iso_8859-5:1988" - "iso-ir-144" - "iso_8859-5" - "iso-8859-5" - "cyrillic" - "csisolatincyrillic" {return iso8859-5} "ms_kanji" - "csshiftjis" {return shiftjis} "csiso2022kr" {return iso2022-kr} "ibm866" - "csibm866" {return cp866} default { # There are much more encoding names out there # It's only laziness, that let me stop here. error "Unrecognized encoding name '$IANAName'" } } } #---------------------------------------------------------------------------- # xmlOpenFileWorker # #---------------------------------------------------------------------------- proc tdom::xmlOpenFileWorker {filename {encodingString {}} {forSimple 0} {forRead 0}} { # This partly (mis-)use the encoding of a channel handed to [dom # parse -channel ..] as a marker: if the channel encoding is utf-8 # then behind the scene Tcl_Read() is used, otherwise # Tcl_ReadChars(). This is used for the encodings understood (and # checked) by the used expat implementation: utf-8 and utf-16 (in # either byte order). set fd [open $filename] if {$encodingString != {}} { upvar $encodingString encString } # The autodetection of the encoding follows # XML Recomendation, Appendix F fconfigure $fd -encoding binary if {![binary scan [read $fd 4] "H8" firstBytes]} { # very short (< 4 Bytes) file seek $fd 0 start set encString UTF-8 return $fd } # First check for BOM switch [string range $firstBytes 0 3] { "feff" { # feff: UTF-16, big-endian BOM if {$forSimple || $forRead} { error "UTF-16be is not supported" } seek $fd 0 start set encString UTF-16be fconfigure $fd -encoding utf-8 return $fd } "fffe" { # ffef: UTF-16, little-endian BOM set encString UTF-16le if {$forSimple || $forRead} { seek $fd 2 start fconfigure $fd -encoding unicode } else { seek $fd 0 start fconfigure $fd -encoding utf-8 } return $fd } } # If the entity has a XML Declaration, the first four characters # must be "" $head] if {$closeIndex == -1} { error "Weird XML data or not XML data at all" } seek $fd 0 start set xmlDeclaration [read $fd [expr {$closeIndex + 5}]] # extract the encoding information set pattern {^[^>]+encoding=[\x20\x9\xd\xa]*["']([^ "']+)['"]} # emacs: " if {![regexp $pattern $head - encStr]} { # Probably something like . # Without encoding declaration this must be UTF-8 set encoding utf-8 set encString UTF-8 } else { set encoding [IANAEncoding2TclEncoding $encStr] set encString $encStr } } "0000003c" - "0000003c" - "3c000000" - "00003c00" { # UCS-4 error "UCS-4 not supported" } "003c003f" { # UTF-16, big-endian, no BOM if {$forSimple} { error "UTF-16be is not supported by the simple parser" } seek $fd 0 start set encoding utf-8 set encString UTF-16be } "3c003f00" { # UTF-16, little-endian, no BOM if {$forSimple} { seek $fd 2 start set encoding unicode } else { seek $fd 0 start set encoding utf-8 } set encString UTF-16le } "4c6fa794" { # EBCDIC in some flavor error "EBCDIC not supported" } default { # UTF-8 without an encoding declaration seek $fd 0 start set encoding utf-8 set encString "UTF-8" } } fconfigure $fd -encoding $encoding return $fd } #---------------------------------------------------------------------------- # xmlOpenFile # #---------------------------------------------------------------------------- proc tdom::xmlOpenFile {filename {encodingString {}}} { if {$encodingString != {}} { upvar $encodingString encString } set fd [xmlOpenFileWorker $filename encString] return $fd } #---------------------------------------------------------------------------- # xmlReadFile # #---------------------------------------------------------------------------- proc tdom::xmlReadFile {filename {encodingString {}}} { if {$encodingString != {}} { upvar $encodingString encString } set fd [xmlOpenFileWorker $filename encString 0 1] set data [read $fd [file size $filename]] close $fd return $data } #---------------------------------------------------------------------------- # xmlReadFileForSimple # #---------------------------------------------------------------------------- proc tdom::xmlReadFileForSimple {filename {encodingString {}}} { if {$encodingString != {}} { upvar $encodingString encString } set fd [xmlOpenFileWorker $filename encString 1] set data [read $fd [file size $filename]] close $fd return $data } #---------------------------------------------------------------------------- # extRefHandler # # A very simple external entity resolver, included for convenience. # Depends on the tcllib package uri and resolves only file URLs. # #---------------------------------------------------------------------------- if {![catch {package require uri}]} { proc tdom::extRefHandler {base systemId publicId} { variable extRefHandlerDebug variable useForeignDTD if {$extRefHandlerDebug} { puts stderr "tdom::extRefHandler called with:" puts stderr "\tbase: '$base'" puts stderr "\tsystemId: '$systemId'" puts stderr "\tpublicId: '$publicId'" } if {$systemId == ""} { if {$useForeignDTD != ""} { set systemId $useForeignDTD } else { error "::tdom::useForeignDTD does\ not point to the foreign DTD" } } set absolutURI [uri::resolve $base $systemId] array set uriData [uri::split $absolutURI] switch $uriData(scheme) { file { if {$::tcl_platform(platform) eq "windows"} { # Strip leading / for drive based paths if {[string match /?:* $uriData(path)]} { set uriData(path) [string range $uriData(path) 1 end] } } # FIXME - path should be URL-decoded return [list string $absolutURI [xmlReadFile $uriData(path)]] } default { error "can only handle file URI's" } } } } #---------------------------------------------------------------------------- # baseURL # # A simple convenience proc which returns an absolute URL for a given # filename. # #---------------------------------------------------------------------------- proc tdom::baseURL {path} { # FIXME - path components need to be URL-encoded # Note [file join] will return path as is if it is already absolute. # Also on Windows, it will change \ -> /. This is necessary because # file URIs must always use /, never \. set path [file join [pwd] $path] if {$::tcl_platform(platform) ne "windows"} { return "file://$path" } else { if {[string match //* $path]} { # UNC path return "file:$path" } else { # Drive based path return "file:///$path" } } } namespace eval ::tDOM { variable extRefHandlerDebug 0 variable useForeignDTD "" namespace export xmlOpenFile xmlReadFile xmlReadFileForSimple \ extRefHandler baseURL } foreach cmd { xmlOpenFile xmlReadFile xmlReadFileForSimple extRefHandler baseURL } { interp alias {} tDOM::$cmd {} tdom::$cmd } # EOF tdom-0.9.1/PaxHeaders.9215/xe0000644000175000001440000000013013325450307013766 xustar000000000000000029 mtime=1532383431.45038577 30 atime=1532446226.527747799 29 ctime=1532383431.45038577 tdom-0.9.1/xe/0000755000175000001440000000000013325450307013263 5ustar00rolfusers00000000000000tdom-0.9.1/xe/PaxHeaders.9215/README0000644000175000001440000000013013325450307014723 xustar000000000000000029 mtime=1532383431.45038577 30 atime=1532383431.503385612 29 ctime=1532383431.45038577 tdom-0.9.1/xe/README0000644000175000001440000000052113325450307014141 0ustar00rolfusers00000000000000 XE needs saves the upper input window in the file ~/.xe-input, if it is called without arguments. Otherwise the first argument gives the file name for the saved input windos. To start playing with XE copy you could do either: 1) cp xe-input ~/.xe-input xe 2) xe xe-input Latter should be more appropriate for Wn32 users. tdom-0.9.1/xe/PaxHeaders.9215/xe0000644000175000001440000000013013325450307014402 xustar000000000000000029 mtime=1532383431.45038577 30 atime=1532383431.503385612 29 ctime=1532383431.45038577 tdom-0.9.1/xe/xe0000755000175000001440000023263213325450307013635 0ustar00rolfusers00000000000000#!/opt/tcl/bin/wish #---------------------------------------------------------------------------- # Copyright (c) 1999 - 2000 Jochen C. Loewer (loewerj@hotmail.com) #---------------------------------------------------------------------------- # # A XML/DOM/XPath evaluator/viewer... featuring the Tk text widget. # # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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 tDOM. # # The Initial Developer of the Original Code is Jochen Loewer # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 # Jochen Loewer. All Rights Reserved. # # Contributor(s): # # # # $Log$ # Revision 1.1 2002/02/22 01:05:35 rolf # Initial revision # # # # # written by Jochen Loewer # December, 1999 # # # # Contains emacsbinds.tcl: # # Copyright 1993 by Paul Raines (raines@bohr.physics.upenn.edu) # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies. The University of Pennsylvania # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # #---------------------------------------------------------------------------- # ! All that needs some code cleanup! The code should be more readable! # ! Currently just use xe! #---------------------------------------------------------------------------- # Package/Includes #---------------------------------------------------------------------------- package require http 2 if {[catch { load ../unix/tdom0.6[info shared] }]} { catch { load ../win/tdom0.6.dll } } catch { package require tdom 0.6 } catch { source ../lib/tdom.tcl } #---------------------------------------------------------------------------- # Globals #---------------------------------------------------------------------------- set HttpProxyHost "" set HttpProxyPort "" #---------------------------------------------------------------------------- # $Header$ # # # p a n e implements the new widget 'pane' to realize a # resizing of the space between two sub windows # in fixed size outer window, the pane window. # Uses plain tcl/tk code # # # $Log$ # Revision 1.1 2002/02/22 01:05:35 rolf # Initial revision # # Revision 1.1 96/12/06 15:59:14 15:59:14 jolo (#Jochen Loewer) # Initial revision # # # # written by Jochen Loewer # July, 1996 # #---------------------------------------------------------------------------- #----------------------------------------------------------------------pane-- proc pane { path type width height } { global _pane_Priv set _pane_Priv(moving) no frame $path -height $height -width $width -relief flat frame $path.separator -height 7 -relief flat frame $path.separator.line -height 4 -relief ridge -borderwidth 1 frame $path.separator.handle -width 8 -height 8 -relief raised -borderwidth 1 place $path.separator.line -anchor nw -x 0 -rely 0.4 -relwidth 1.0 place $path.separator.handle -anchor center -relx 1.0 -rely 0.5 -x -8 place $path.separator -anchor nw -x 0 -y 0 -relwidth 1.0 $path.separator.handle config -cursor sb_v_double_arrow set _pane_Priv(maxy) $height set _pane_Priv(moving) no } #----------------------------------------------------------------------pane-- proc pane_place { path type ratio win1 win2 } { global _pane_Priv set _pane_Priv(moving) no update scan [winfo geometry $path] "%dx%d+%d+%d" w h x y set middley [expr $h*$ratio] place $path.separator -anchor nw -x 0 -y $middley -relwidth 1.0 update pane_partionize $path $win1 $win2 $path.separator.handle config -cursor sb_v_double_arrow bind $path.separator.handle "pane_down $path" bind $path.separator.handle "pane_motion $path" bind $path.separator.handle "pane_release $path $win1 $win2" bind $path "pane_resize $path $win1 $win2 %w %h" set _pane_Priv(maxy) $h set _pane_Priv(moving) no } #-----------------------------------------------------------------pane_down-- proc pane_down { pane } { global _pane_Priv $pane.separator.handle configure -relief sunken raise $pane.separator set _pane_Priv(rooty) [winfo pointery $pane] scan [winfo geometry $pane] "%dx%d+%d+%d" w h x y set _pane_Priv(maxy) $h scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h x y set _pane_Priv(oldy) $y set _pane_Priv(moving) yes } #---------------------------------------------------------------pane_motion-- proc pane_motion { pane } { global _pane_Priv set y [winfo pointery $pane] set delta [expr $y-$_pane_Priv(rooty)] set newy [expr $_pane_Priv(oldy)+$delta] if { ($newy > 8) && ([expr $newy+16] <$_pane_Priv(maxy)) } { place $pane.separator -anchor nw -x 0 -y $newy -relwidth 1.0 } } #--------------------------------------------------------------pane_release-- proc pane_partionize { pane win1 win2 } { scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h x y place $win1 -anchor nw -x 0 -y 0 -relwidth 1.0 -height $y -relheight {} set ywin2 [expr $y+$h] scan [winfo geometry $pane] "%dx%d+%d+%d" w h x y set hwin2 [expr $h-$ywin2-1] place $win2 -anchor se -relx 1.0 -rely 1.0 -relwidth 1.0 -height $hwin2 } #--------------------------------------------------------------pane_release-- proc pane_release { pane win1 win2 } { global _pane_Priv $pane.separator.handle configure -relief raised pane_partionize $pane $win1 $win2 set _pane_Priv(moving) no } #---------------------------------------------------------------pane_resize-- proc pane_resize { pane win1 win2 neww newh} { global _pane_Priv if { $_pane_Priv(moving) != "yes" } { scan [winfo geometry $pane.separator] "%dx%d+%d+%d" w h xp y set newy [expr ($y*$newh)/$_pane_Priv(maxy)] place $pane.separator -anchor nw -x 0 -y $newy -relwidth 1.0 update pane_partionize $pane $win1 $win2 } set _pane_Priv(maxy) $newh } ############################################################################ # include bindings.tk from TkMail (Thanks Paul!) ############################################################################ # # COPYRIGHT: # Copyright 1993 by Paul Raines (raines@bohr.physics.upenn.edu) # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies. The University of Pennsylvania # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # global bind_xnd btp # USER SETTINGS set btp(prevcmd) "begin-line" # maximum number of kills to save in ring set btp(maxkill) 10 # maximum number of marks to save in ring set btp(maxmark) 10 # syntax for letter not part of a "word" set btp(not-word) {[^a-zA-Z_0-9]} # procedure to use for errors set btp(error) error # procedure to use for beeping set btp(beep) "" # whether to bind Escape prefix commands also to the Meta modifier set btp(use-meta) 1 # column at which to line wrap set btp(fillcol) 0 # prefix for line wrapping (NOT REALLY WORKING YET) set btp(fillprefix) "" # PRIVATE SETTINGS set btp(lastkill) 0.0 set btp(killring) "" set btp(killptr) 0 set btp(killlen) 0 set btp(arg) def proc tk_entryForwspace w { set x [expr [$w index insert] - 1] catch {$w delete $x} } # selection_if_any - return selection if it exists, else {} # this is from kjx@comp.vuw.ac.nz (R. James Noble) proc selection_if_any {} { if {[catch {selection get} s]} {return ""} {return $s} } proc bind_cleanup { w } { global btp catch {unset btp($w,markring)} } proc bt:current-line { w } { return [lindex [split [$w index insert] .] 0] } proc bt:current-col { w } { return [lindex [split [$w index insert] .] 1] } proc bt:move-line { w {num 1} } { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$btp(prevcmd) != "move-line"} { set btp(goalcol) [lindex [split [$w index insert] .] 1] } if {$num > -1} {set num "+$num"} $w tag remove sel 1.0 end set ndx [$w index "insert $num line lineend"] set goalndx [lindex [split $ndx .] 0].$btp(goalcol) if {$btp(goalcol) < [lindex [split $ndx .] 1]} { $w mark set insert $goalndx } else { $w mark set insert $ndx } $w yview -pickplace insert set btp(prevcmd) move-line } proc bt:move-char { w {num 1} } { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$num > -1} {set num "+$num"} $w tag remove sel 1.0 end $w mark set insert "insert $num char" $w yview -pickplace insert set btp(prevcmd) "move-char" } proc bt:move-word {w {num 1}} { global btp set btp(lastkill) 0.0 $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num [expr $num*$btp(arg)] set btp(arg) def } if {$num > 0} { for {set i 0} {$i < $num } {incr i} { while {[regexp $btp(not-word) [$w get insert]]} { $w mark set insert insert+1c } $w mark set insert {insert wordend} } } else { for {set i 0} {$i > $num } {incr i -1} { $w mark set insert insert-1c while {[regexp $btp(not-word) [$w get insert]]} { $w mark set insert insert-1c } $w mark set insert {insert wordstart} } } $w yview -pickplace insert set btp(prevcmd) "move-word" } proc bt:begin-line { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != 0} {set num [expr $num-1]} bt:move-line $w $num $w mark set insert {insert linestart} $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) "begin-line" } proc bt:end-line { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != 0} {set num [expr $num-1]} bt:move-line $w $num $w mark set insert {insert lineend} $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) end-line } proc bt:begin-buffer { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:set-mark $w set ndx [expr 1+[lindex [split [$w index end] .] 0]*$num/10] $w mark set insert $ndx.0 $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) begin-buffer } proc bt:end-buffer { w {num 0}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:set-mark $w set ndx [expr [lindex [split [$w index end] .] 0]*$num/10] $w mark set insert "end - $ndx lines" $w tag remove sel 1.0 end $w yview -pickplace insert set btp(prevcmd) end-buffer } proc bt:scroll-next { w {num 1}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } $w tag remove sel 1.0 end set scr [lindex [lindex [$w configure -yscroll] 4] 0] $w mark set insert [lindex [$scr get] 3].0 $w yview insert-1l set btp(prevcmd) scroll-next } proc bt:scroll-prior { w {num 1}} { global btp set btp(lastkill) 0.0 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } $w tag remove sel 1.0 end set scr [lindex [lindex [$w configure -yscroll] 4] 0] set tndx [expr [lindex [$scr get] 2]-[lindex [$scr get] 1]+5].0 if {$tndx < 1.0} {set tndx 1.0} $w mark set insert $tndx $w yview insert-1l set btp(prevcmd) scroll-prior } proc bt:delete-word { w {num 1}} { global btp $w tag remove sel 1.0 end if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut "" } set beg [$w index insert] if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } bt:move-word $w $num #puts "$num : $beg [$w index insert]" if {$beg < [$w index insert]} { bt:push-cut "$lastcut[$w get $beg insert]" $w delete $beg insert } else { bt:push-cut "[$w get insert $beg]$lastcut" $w delete insert $beg } set btp(lastkill) [$w index insert] $w yview -pickplace insert set btp(prevcmd) delete-word } proc bt:delete-line { w {num 0}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} # while {[$w get insert] == " "} { # $w mark set insert insert+1c # } if {[$w compare insert == "insert lineend"] && $num == 0} { set num 1 } set beg [$w index insert] if {$num != 0} { bt:move-line $w $num bt:begin-line $w if {$beg < [$w index insert]} { bt:push-cut "$lastcut[$w get $beg insert]" $w delete $beg insert } else { bt:push-cut "[$w get insert $beg]$lastcut" $w delete insert $beg } } else { bt:push-cut "$lastcut[$w get insert {insert lineend}]" $w delete insert {insert lineend}; $w yview -pickplace insert } $w yview -pickplace insert set btp(lastkill) [$w index insert] set btp(prevcmd) delete-line } proc bt:delete-back-char-or-sel { w {num 1} } { global btp if {$btp(arg) != "def"} { set num $btp(arg) } else {set btp(lastkill) 0.0} set num [expr -1*$num] if {$num > -1} {set num "+$num"} if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if [catch {set tmp [$w get sel.first sel.last]}] { if {$btp(arg) != "def"} { if {$num < 0} { bt:push-cut "[$w get "insert $num char" insert]$lastcut" $w delete "insert $num char" insert } else { bt:push-cut "$lastcut[$w get insert "insert $num char"]" $w delete insert "insert $num char" } set btp(lastkill) [$w index insert] } else { if {$num < 0} { $w delete "insert $num char" insert } else { $w delete insert "insert $num char" } set btp(lastkill) 0.0 } } else { $w delete sel.first sel.last bt:push-cut $tmp set btp(lastkill) 0.0 } set btp(arg) def $w yview -pickplace insert set btp(prevcmd) delete-back-char-or-sel } proc bt:delete-region-or-sel { w } { global btp if {[catch {set tmp [$w get sel.first sel.last]}]} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if {[$w compare emacs < insert]} { bt:push-cut "$lastcut[$w get emacs insert]" $w delete emacs insert } else { bt:push-cut "[$w get insert emacs]$lastcut" $w delete insert emacs } set btp(lastkill) [$w index insert] } else { $w delete sel.first sel.last bt:push-cut $tmp set btp(lastkill) 0.0 } set btp(arg) def set btp(prevcmd) delete-region-or-sel } proc bt:copy-region-or-sel { w } { global btp if {[catch {set tmp [$w get sel.first sel.last]}]} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } if {[$w compare $btp(lastkill) == insert]} { set lastcut [bt:pop-cut] } else { set lastcut ""} if {[$w compare emacs < insert]} { bt:push-cut "$lastcut[$w get emacs insert]" } else { bt:push-cut "[$w get insert emacs]$lastcut" } bt:exchange-point-and-mark $w after 200 bt:exchange-point-and-mark $w } else { bt:push-cut $tmp } set btp(arg) def set btp(lastkill) 0.0 set btp(prevcmd) copy-region-or-sel } proc bt:append-next-kill { w } { global btp set btp(lastkill) [$w index insert] } proc bt:push-cut { txt } { global btp set btp(killlen) [llength [lappend btp(killring) $txt]] if { $btp(killlen) > $btp(maxkill)} { set btp(killring) [lreplace $btp(killring) 0 0] incr btp(killlen) -1 } set btp(killptr) 0 } proc bt:pop-cut { } { global btp if {$btp(killlen) == 0} {return ""} set txt [bt:get-cut 1] set ndx [expr $btp(killlen)-1] set btp(killring) [lreplace $btp(killring) $ndx $ndx ] incr btp(killlen) -1 set btp(killptr) 0 return $txt } proc bt:get-cut { {ndx 1} } { global btp set ndx [expr $ndx+$btp(killptr)] set btp(killptr) [expr $ndx-1] set ndx [expr $ndx%$btp(killlen)] if {$ndx == 0} {set ndx $btp(killlen)} return [lindex $btp(killring) [expr $btp(killlen)-$ndx]] } proc bt:yank { w {num 1}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } set btp(lastkill) 0.0 set tmp [$w index insert] $w insert insert [bt:get-cut $num] $w mark set emacs $tmp $w yview -pickplace insert set btp(prevcmd) yank } proc bt:yank-pop { w {num 1}} { global btp if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$btp(prevcmd) != "yank"} return $w tag remove sel 1.0 end $w delete emacs insert set tmp [$w index insert] $w insert insert [bt:get-cut [expr $num+1]] $w mark set emacs $tmp $w yview -pickplace insert } proc bt:pop-mark { w } { global btp set ndx [expr [llength $btp($w,markring)]-1] set oldmark [lindex $btp($w,markring) $ndx] $w mark set emacs $oldmark set btp($w,markring) [concat $oldmark [lreplace $btp($w,markring) $ndx $ndx]] } proc bt:push-mark { w ndx } { global btp lappend btp($w,markring) $ndx $w tag remove emacssel 1.0 end } proc bt:set-mark { w {num def}} { global btp $w tag remove sel 1.0 end if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } if {$num != "def"} { if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } #puts stdout "$w.yview \n" $w yview -pickplace insert bt:pop-mark $w $w mark set insert emacs } else { bt:push-mark $w [$w index insert] $w mark set emacs insert } set btp(lastkill) 0.0 set btp(prevcmd) set-mark } proc bt:exchange-point-and-mark { w } { global btp if {[catch "$w index emacs"]} { $btp(error) "No emacs mark has been set yet!" } set tmp [$w index insert] $w mark set insert emacs $w mark set emacs $tmp set btp(lastkill) 0.0 set btp(prevcmd) set-mark } proc bt:open-line {w {num 1}} { global btp if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } catch {$w delete sel.first sel.last} for {set i 0} {$i < $num } {incr i} { $w insert insert \n } $w mark set insert insert-1c $w yview -pickplace insert set btp(prevcmd) open-line } proc bt:argkey { w a } { global btp set btp(arg) $a } proc bt:numkey { w a } { global btp if {$btp(arg) == "def"} { catch {%W delete sel.first sel.last} $w insert insert $a if {$btp(fillcol) && [bt:current-col $w] >= $btp(fillcol)} { bt:wrap-word $w } $w yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) self-insert } else { if {$a == "-"} { if {$btp(arg) == "-"} { set btp(arg) "0" } elseif {$btp(arg) == "0"} { set btp(arg) "-" } else { set btp(arg) [expr -1*$btp(arg)] } } else { append btp(arg) $a } } } proc bt:univ-arg { w } { global btp if {$btp(arg) == "def"} { set btp(arg) 4 } else { if {$btp(arg) == "-"} { set btp(arg) "-4" } else { set btp(arg) [expr 4*$btp(arg)] } } } proc bt:wrap-word { w } { global btp bt:move-word $w -1 $w insert insert \n bt:end-line $w } proc bt:set-fill-col { w {num 0}} { global btp if {$btp(arg) == "def"} { if {$num < 1} { set btp(fillcol) [bt:current-col $w] } else { set btp(fillcol) $num } } else { if {$btp(arg) < 1} { set btp(fillcol) [bt:current-col $w] } else { set btp(fillcol) $btp(arg) } } set btp(arg) def set btp(lastkill) 0.0 set btp(prevcmd) set-fill-col } proc bind_motiftext { tw } { global bind_xnd bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } # Some better bindings for text and entry bind $tw {bt:move-line %W -1} bind $tw {bt:move-line %W 1} bind $tw {bt:move-char %W -1} bind $tw {bt:move-char %W 1} bind $tw {bt:begin-line %W} bind $tw {bt:end-line %W} bind $tw {bt:begin-buffer %W} bind $tw {bt:end-buffer %W} bind $tw {bt:move-word %W -1} bind $tw {bt:move-word %W 1} bind $tw {bt:scroll-next %W} bind $tw {bt:scroll-prior %W} bind $tw { global btp set num 1 if {"%A" != ""} { if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } catch {%W delete sel.first sel.last} for {set i 0} { $i < $num} {incr i} {%W insert insert %A} if {$btp(fillcol) && [bt:current-col %W] >= $btp(fillcol)} { if {"%A" == " "} { %W insert insert \n } elseif {"%A" == "\t"} { %W insert insert \n\t } else { bt:wrap-word %W } } %W yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) self-insert } } bind $tw { global btp catch {%W delete sel.first sel.last} set num 1 if {$btp(arg) != "def"} { set num $btp(arg) set btp(arg) def } for {set i 0} { $i < $num} {incr i} {%W insert insert "\n"} %W yview -pickplace insert set btp(lastkill) 0.0 set btp(prevcmd) newline } bind $tw {bt:delete-back-char-or-sel %W 1} bind $tw {bt:delete-back-char-or-sel %W 1} bind $tw <1> "[bind Text <1>]; \ global btp; set btp(lastkill) 0.0; \ set btp(prevcmd) mouse-set" bind $tw <3> {%W tag remove sel 1.0 end} bind $tw {bind_textB1motion %W @%x,%y} set bind_xnd(b2-time) 0 set bind_xnd(b2-y) 0 bind $tw <2> { global bind_xnd %W scan mark %y set bind_xnd(b2-time) %t set bind_xnd(b2-y) %y } bind $tw { global bind_xnd if {[expr %t-$bind_xnd(b2-time)]<1000} { %W insert insert [selection_if_any] global btp set btp(lastkill) 0.0 set btp(prevcmd) mouse-insert } } # only one mouse, so no need have separate vars for each widget set bind_xnd(txnd) 0 set bind_xnd(xdelay) 100 proc bind_textB1motion { w loc } { global bind_xnd set ypos [lindex [split $loc ","] 1] if {$ypos > [winfo height $w]} { if {!$bind_xnd(txnd)} {after $bind_xnd(xdelay) bind_textExtend $w} set bind_xnd(txnd) 1 set bind_xnd(direction) down } elseif {$ypos < 0} { if {!$bind_xnd(txnd)} {after $bind_xnd(xdelay) bind_textExtend $w} set bind_xnd(txnd) 1 set bind_xnd(direction) up } else { set bind_xnd(txnd) 0 set bind_xnd(direction) 0 } if {!$bind_xnd(txnd)} { tk_textSelectTo $w $loc } } bind $tw { global bind_xnd btp set bind_xnd(txnd) 0 set btp(lastkill) 0.0 set btp(prevcmd) mouse-select } proc bind_textExtend { w } { global bind_xnd if {$bind_xnd(txnd)} { if {$bind_xnd(direction) == "down"} { tk_textSelectTo $w sel.last+1l $w yview -pickplace sel.last+1l } elseif {$bind_xnd(direction) == "up"} { tk_textSelectTo $w sel.first-1l $w yview -pickplace sel.first-1l } else { return } after $bind_xnd(xdelay) bind_textExtend $w } } } proc bind_emacstext { tw } { global btp bind $tw { if [catch {set tmp [%W get emacssel.first emacssel.last]}] { } else { %W tag remove emacssel 1.0 $first %W tag add emacssel $first $last %W tag remove emacssel $last end update idletasks } %W insert insert %A } # make Escape key simulate a state Alt key bind $tw { } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:begin-line %W} bind $tw {bt:end-line %W} bind $tw {bt:move-char %W 1} bind $tw {bt:move-char %W -1} bind $tw {bt:move-word %W 1} bind $tw {bt:move-word %W -1} bind $tw {bt:move-line %W 1} bind $tw {bt:move-line %W -1} bind $tw { %W yview -pickplace insert } bind $tw {bt:open-line %W 1} bind $tw {bt:delete-back-char-or-sel %W -1} bind $tw {bt:delete-word %W 1} bind $tw {bt:delete-back-char-or-sel %W -1} bind $tw {bt:delete-line %W 0} bind $tw {bt:delete-region-or-sel %W} bind $tw {bt:copy-region-or-sel %W} bind $tw {bt:yank %W} bind $tw {bt:yank-pop %W} bind $tw {bt:set-mark %W} bind $tw {bt:univ-arg %W} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:numkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} # make C-x key a state bind $tw { } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:exchange-point-and-mark %W} bind $tw {bt:set-fill-col %W} # Make Meta key like and Escape prefix if {$btp(use-meta)} { bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw { global btp if {"%A" != ""} {eval $btp(beep) } } bind $tw {bt:move-word %W 1} bind $tw {bt:move-word %W -1} bind $tw {bt:delete-word %W 1} bind $tw {bt:copy-region-or-sel %W} bind $tw {bt:yank-pop %W} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} bind $tw {bt:argkey %W %A} } } #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- # # The xe main code follows now ... # #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- #--------------------------------------------------------------- # PrintOutputWindow # #--------------------------------------------------------------- proc PrintOutputWindow { printer_pipe } { set f [open "|$printer_pipe" w] puts $f [.pane.output.text get 1.0 end ] close $f } #--------------------------------------------------------------- # PrintPreDefined # #--------------------------------------------------------------- proc PrintPreDefined { } { global landscape doublesided nobanner prsize set printerName [.printdlg.input.predef.f.prname.name get] #puts stderr "printer_name: $printerName" #puts stderr "landscape: $landscape" #puts stderr "doublesided: $doublesided" #puts stderr "prsize: $prsize" array set sizeoption { yes-large { -o vsi7 -o fp16 -o landscape } yes-normal { -o vsi6 -o fp18 -o landscape -o height80 } yes-small { -o vsi5 -o fp20 -o landscape -o height90 } yes-smallest { -o vsi4 -o fp24 -o landscape -o height100 } yes-micro { -o vsi3 -o fp28 -o landscape -o height110 } no-large { -o vsi7 -o fp16 -o portrait } no-normal { -o vsi6 -o fp18 -o portrait } no-small { -o vsi5 -o fp20 -o portrait } no-smallest { -o vsi4 -o fp24 -o portrait } } set command $sizeoption(${landscape}-${prsize}) if {$doublesided == "yes"} { append command " -o duplex" } else { append command " -o simplex" } if {$nobanner == "yes"} { append command " -o nb" } append command " -d $printerName" PrintOutputWindow "lp $command" } #--------------------------------------------------------------- # PrintDialog # #--------------------------------------------------------------- proc PrintDialog { } { global dbname dbsname set w .printdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "Print Output" wm iconname $w "Print Output" wm protocol $w WM_DELETE_WINDOW { } frame $w.input \ -relief flat -borderwidth 0 -highlightthickness 0 frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.print \ -text " Print " \ -command "PrintPreDefined; destroy $w" button $w.buttons.cancel \ -text " Cancel " -command "destroy $w" pack $w.buttons.print $w.buttons.cancel -side top -pady 10 -fill x #----------------------------------------------- # pre-customized printer configuration #----------------------------------------------- frame $w.input.predef \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.input.predef.h \ -text "Pre-customized Printer Configuration:" frame $w.input.predef.f \ -relief groove -borderwidth 2 -highlightthickness 0 pack $w.input.predef.h -anchor w -side top pack $w.input.predef.f -side top -ipadx 5 -ipady 5 -fill x frame $w.input.predef.f.prname \ -relief groove -borderwidth 0 -highlightthickness 0 label $w.input.predef.f.prname.l \ -text "Printer Name:" entry $w.input.predef.f.prname.name \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes pack $w.input.predef.f.prname.l -side left pack $w.input.predef.f.prname.name -side left -anchor w -fill x frame $w.input.predef.f.kind \ -relief groove -borderwidth 0 -highlightthickness 0 radiobutton $w.input.predef.f.kind.large \ -text "Large (100 char width) " -variable prsize -relief flat -value large radiobutton $w.input.predef.f.kind.normal \ -text "Normal (150 char width)" -variable prsize -relief flat -value normal radiobutton $w.input.predef.f.kind.small \ -text "Small (200 char width)" -variable prsize -relief flat -value small radiobutton $w.input.predef.f.kind.smallest \ -text "Smallest (240 char width)" -variable prsize -relief flat -value smallest radiobutton $w.input.predef.f.kind.micro \ -text "Micro (>240 char width)" -variable prsize -relief flat -value micro $w.input.predef.f.kind.small select pack $w.input.predef.f.kind.large \ $w.input.predef.f.kind.normal \ $w.input.predef.f.kind.small \ $w.input.predef.f.kind.smallest \ $w.input.predef.f.kind.micro -anchor w -side top frame $w.input.predef.f.optionskind \ -relief groove -borderwidth 0 -highlightthickness 0 checkbutton $w.input.predef.f.optionskind.landscape -text "landscape (-o landscape)" \ -variable landscape -onvalue "yes" -offvalue "no" -relief flat $w.input.predef.f.optionskind.landscape select checkbutton $w.input.predef.f.optionskind.double -text "double sided (-o duplex)" \ -variable doublesided -onvalue "yes" -offvalue "no" -relief flat checkbutton $w.input.predef.f.optionskind.nobanner -text "no banner (-o nb)" \ -variable nobanner -onvalue "yes" -offvalue "no" -relief flat pack $w.input.predef.f.optionskind.landscape \ $w.input.predef.f.optionskind.double \ $w.input.predef.f.optionskind.nobanner -anchor w -side top pack $w.input.predef.f.prname \ $w.input.predef.f.kind \ $w.input.predef.f.optionskind -side top -padx 1 -pady 5 -fill x #----------------------------------------------- # self printer configuration #----------------------------------------------- frame $w.input.self \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.input.self.h \ -text "Full Command Line:" frame $w.input.self.f2 \ -relief groove -borderwidth 2 -highlightthickness 0 entry $w.input.self.f2.cmdline \ -relief sunken -borderwidth 2 -highlightthickness 1 \ -width 40 -background gray90 -exportselection yes button $w.input.self.f2.print \ -text " Print " -command { set printer_pipe [.printdlg.input.self.f2.cmdline get]; PrintOutputWindow "$printer_pipe" } pack $w.input.self.f2.cmdline $w.input.self.f2.print \ -side left -padx 5 pack $w.input.self.h -anchor w -side top pack $w.input.self.f2 -side top -ipadx 5 -ipady 5 #------------------------------------------------------------- pack $w.input.predef $w.input.self -side top -pady 10 -fill x pack $w.input -side left -padx 10 -pady 10 -fill x pack $w.buttons -side left -padx 10 -pady 30 -fill y } #---------------------------------------------------------------------------- # SaveTextWindow # #---------------------------------------------------------------------------- proc SaveTextWindow { textw filename } { set f [open $filename w ]; $textw mark set insert end #--remove the empty part at the bottom while {1} { set line [$textw get {insert linestart} {insert lineend}] if {$line != ""} { break; } $textw mark set insert {insert -1 line} if {[$textw compare insert < 3.0]} { break; } } puts $f [$textw get 1.0 {insert lineend} ] close $f } #---------------------------------------------------------------------------- # Base64Init # #---------------------------------------------------------------------------- proc Base64Init { } { global base64_b2c base64_c2b set i -1 foreach a { 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 + / } { binary scan [binary format c1 [incr i]] B* v set base64_b2c([string range $v 2 end]) $a set base64_c2b($a) [string range $v 2 end] } } #---------------------------------------------------------------------------- # Base64EncodeBufferData # #---------------------------------------------------------------------------- proc Base64EncodeBufferData { data } { global base64_b2c # Get the bit stream binary scan $data B* bits # Convert groups of six bits to a list for easy traversal regsub -all {((0|1)(0|1)(0|1)(0|1)(0|1)(0|1))} $bits {\1 } bits foreach b $bits { append result $base64_b2c($b) } return $result } #---------------------------------------------------------------------------- # Base64Encode # #---------------------------------------------------------------------------- proc Base64Encode { data {buffersize 6144} } { global base64_b2c if { ![array exists base64_b2c] } { Base64Init } # Convert the data to a bitstream and then encode. # This approach requires a buffer eight times the size of the # data to be encoded, so just work on a buffer at a time. # The default buffer size is 6 * 1024 bytes (6KB). # This is a trade-off between speed and space. if {$buffersize % 3} { # Buffer must be a multiple of 3 bytes set buffersize [expr $buffersize - $buffersize % 3] } set linelen 0 while {[string length $data] > $buffersize} { # Get the buffer to work on set buffer [string range $data 0 [expr $buffersize - 1]] set data [string range $data $buffersize end] append result [Base64EncodeBufferData $buffer] } if {[string length $data]} { # Deal with remaining data # Encode to an even multiple of 3 bytes, and then # pad the rest set buffer [string range $data 0 [expr [string length $data] - [string length $data] % 3 - 1]] set remainder [string range $data [expr [string length $data] - [string length $data] % 3] end] append result [Base64EncodeBufferData $buffer] switch [string length $remainder] { 1 { binary scan $remainder B* bits append result $base64_b2c([string range $bits 0 5]) append result $base64_b2c([string range $bits 6 7]0000) append result == } 2 { binary scan $remainder B* bits append result $base64_b2c([string range $bits 0 5]) append result $base64_b2c([string range $bits 6 11]) append result $base64_b2c([string range $bits 12 15]00) append result = } } } # Ensure lines are no more than 76 characters regsub -all {(........................................................................)} \ $result "\\1\n" result return $result } #---------------------------------------------------------------------------- # IntroWindow # #---------------------------------------------------------------------------- proc IntroWindow { } { global HelvB12 Helv12 frame .splash -borderwidth 4 -relief raised label .splash.info1 -font $HelvB12 -text "XE - a simple XML/XPath Browser/Viewer" label .splash.info2 -font $Helv12 -text "Version 0.2" label .splash.info3 -font $Helv12 -text "Copyright (c) 1999,2001 Jochen Loewer (loewerj@hotmail.com)" pack .splash.info1 \ .splash.info2 \ .splash.info3 -padx 4 -pady 4 -anchor w place .splash -anchor c -relx .5 -rely .5 after 2500 destroy .splash update } #---------------------------------------------------------------------------- # ConfigureProxy # #---------------------------------------------------------------------------- proc ConfigureProxy { } { global HttpProxyHost HttpProxyPort gotProxy set gotProxy -1 set w .proxyDdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "Configure HTTP Proxy" wm iconname $w "HTTP Proxy" wm protocol $w WM_DELETE_WINDOW { } frame $w.hdr \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.hdr.icon -bitmap questhead label $w.hdr.msg -text "Specify HTTP proxy server: " frame $w.fields \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.fields.hostlabel -text "Proxy Host:" entry $w.fields.hostvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes label $w.fields.portlabel -text "Porxy Port:" entry $w.fields.portvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.ok -text " OK " \ -command "set gotProxy \[list 1 \[$w.fields.hostvalue get\] \ \[$w.fields.portvalue get\] \]; \ destroy $w" bind $w.fields.portvalue " \ set gotProxy \[list 1 \[$w.fields.hostvalue get\] \ \[$w.fields.portvalue get\] \]; \ destroy $w" button $w.buttons.cancel -text " Cancel " \ -command "destroy $w; set gotProxy {0 {} {}}" $w.fields.hostvalue insert 0 $HttpProxyHost $w.fields.portvalue insert 0 $HttpProxyPort pack $w.hdr.icon $w.hdr.msg -side left grid $w.fields.hostlabel -in $w.fields -column 0 -row 0 -sticky e grid $w.fields.portlabel -in $w.fields -column 0 -row 1 -sticky e grid $w.fields.hostvalue -in $w.fields -column 1 -row 0 -sticky w grid $w.fields.portvalue -in $w.fields -column 1 -row 1 -sticky w pack $w.buttons.ok $w.buttons.cancel -side left pack $w.hdr \ $w.fields \ $w.buttons -side top -anchor w -padx 9 -pady 9 focus $w.fields.hostvalue while {$gotProxy == -1} { vwait gotProxy } if {[lindex $gotProxy 0]} { set HttpProxyHost [lindex $gotProxy 1] set HttpProxyPort [lindex $gotProxy 2] } } #---------------------------------------------------------------------------- # GetUserPassword # #---------------------------------------------------------------------------- proc GetUserPassword { state_var login_var password_var } { global gotPassword Login upvar $state_var state upvar $login_var login upvar $password_var password #parray state set server "" set realm "" regexp {http://([^/]*)/(.*)} $state(url) all server file array set meta $state(meta) if {[info exists meta(WWW-authenticate)]} { set realmStr [lindex $meta(WWW-authenticate) 1] regexp {realm="([^"]*)"} $realmStr all realm } #puts stderr "login='$login' password='$password' server='$server' realm='$realm'" if {[info exists Login($server,$realm)]} { foreach { new_login new_password } $Login($server,$realm) break if {($new_login != $login ) || ($new_password != $password)} { set login $new_login set password $new_password return 1 } } set gotPassword -1 set login "" set password "" set w .passwordDdlg catch {destroy $w} toplevel $w -class Dialog wm title $w "HTTP Password" wm iconname $w "HTTP Password" wm protocol $w WM_DELETE_WINDOW { } frame $w.hdr \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.hdr.icon -bitmap questhead label $w.hdr.msg -text "Enter username for $realm at $server " frame $w.fields \ -relief flat -borderwidth 0 -highlightthickness 0 label $w.fields.userlabel -text "User name:" entry $w.fields.uservalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes label $w.fields.passlabel -text "Password:" entry $w.fields.passvalue \ -relief sunken -borderwidth 1 -highlightthickness 1 \ -width 20 -background gray90 -exportselection yes -show * frame $w.buttons \ -relief flat -borderwidth 0 -highlightthickness 0 button $w.buttons.ok -text " OK " \ -command "set gotPassword \[list 1 \[$w.fields.uservalue get\] \ \[$w.fields.passvalue get\] \]; \ destroy $w" bind $w.fields.passvalue " \ set gotPassword \[list 1 \[$w.fields.uservalue get\] \ \[$w.fields.passvalue get\] \]; \ destroy $w" button $w.buttons.cancel -text " Cancel " \ -command "destroy $w; set gotPassword {0 {} {}}" pack $w.hdr.icon $w.hdr.msg -side left grid $w.fields.userlabel -in $w.fields -column 0 -row 0 -sticky e grid $w.fields.passlabel -in $w.fields -column 0 -row 1 -sticky e grid $w.fields.uservalue -in $w.fields -column 1 -row 0 -sticky w grid $w.fields.passvalue -in $w.fields -column 1 -row 1 -sticky w pack $w.buttons.ok $w.buttons.cancel -side left pack $w.hdr \ $w.fields \ $w.buttons -side top -anchor w -padx 9 -pady 9 focus $w.fields.uservalue while {$gotPassword == -1} { vwait gotPassword } if {[lindex $gotPassword 0]} { set login [lindex $gotPassword 1] set password [lindex $gotPassword 2] set Login($server,$realm) [list $login $password] return 1 } return 0 } #---------------------------------------------------------------------------- # xmlEdit # #---------------------------------------------------------------------------- proc xmlEdit { {line 0} {column 0} } { global xml Cour12 Helv12 if {[winfo exists .edit]} { .edit.f.text mark set insert $line.$column .edit.f.text see insert focus .edit.f.text return } toplevel .edit wm title .edit "XML Source" set path .edit.f frame $path -relief flat -borderwidth 3 -highlightthickness 0 text $path.text -width 100 -height 30 -font $Cour12 \ -bg gray90 \ -exportselection yes -wrap none \ -yscrollcommand "$path.vsb set" \ -xscrollcommand "$path.hsb set" scrollbar $path.vsb -relief sunken -orient vertical \ -command "$path.text yview" scrollbar $path.hsb -relief sunken -orient horizontal \ -command "$path.text xview" button .edit.reload -text " Reload " -command xmlReload \ -font $Helv12 pack $path.vsb -side right -fill y -expand no pack $path.hsb -side bottom -fill x -expand no pack $path.text -side top -fill both -expand yes pack $path -expand yes -fill both pack .edit.reload -anchor e $path.text delete 1.0 end $path.text insert end $xml .edit.f.text mark set insert $line.$column .edit.f.text see insert focus .edit.f.text } #---------------------------------------------------------------------------- # xmlHighlight # #---------------------------------------------------------------------------- proc xmlHighlight { path pos tag highlight_tag} { set range [$path tag nextrange $tag $pos [$path index "$pos lineend"] ] if {$range == ""} { set range [$path tag prevrange $tag $pos [$path index "$pos linestart"] ] } if {$range != ""} { eval $path tag add $highlight_tag [lrange $range 0 1] } } #---------------------------------------------------------------------------- # xmlHighlightMotion # #---------------------------------------------------------------------------- proc xmlHighlightMotion { path pos tag highlight_tag} { set tags [$path tag names $pos] if {[lsearch -exact $tags $highlight_tag] < 0} { $path tag remove $highlight_tag 1.0 end } xmlHighlight $path $pos $tag $highlight_tag } #---------------------------------------------------------------------------- # xmlJump # #---------------------------------------------------------------------------- proc xmlJump { path pos } { foreach tag [$path tag names $pos] { if { ($tag != "tag") } { xmlEdit [$tag getLine] [$tag getColumn] } } } #---------------------------------------------------------------------------- # xmlOpen # #---------------------------------------------------------------------------- proc xmlOpen { path pos } { global levels foreach tag [$path tag names $pos] { if {($tag != "open") && ($tag != "hot") && ($tag != "sel")} { $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$levels($tag) *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $levels($tag) $tag 2 $path see $start } } # that's a hack to remove selections, which occur sometimes after 50 "$path tag remove sel 1.0 end" } #---------------------------------------------------------------------------- # xmlClose # #---------------------------------------------------------------------------- proc xmlClose { path pos } { global levels foreach tag [$path tag names $pos] { if {($tag != "close") && ($tag != "hot") && ($tag != "sel")} { $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$levels($tag) *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $levels($tag) $tag 1 $path see $start } } # that's a hack to remove selections, which occur sometimes after 50 "$path tag remove sel 1.0 end" } #---------------------------------------------------------------------------- # xmlWidget # #---------------------------------------------------------------------------- proc xmlWidget { path } { global Cour12 HelvB12 set tagFont $HelvB12 set attrFont $Cour12 set opnclFont $Cour12 frame $path -relief flat -borderwidth 0 -highlightthickness 0 text $path.text -width 100 -height 25 -font $Cour12 \ -bg gray85 -cursor left_ptr \ -exportselection yes -wrap none \ -yscrollcommand "$path.vsb set" \ -xscrollcommand "$path.hsb set" scrollbar $path.vsb -relief sunken -orient vertical \ -command "$path.text yview" scrollbar $path.hsb -relief sunken -orient horizontal \ -command "$path.text xview" pack $path.vsb -side right -fill y -expand no pack $path.hsb -side bottom -fill x -expand no pack $path.text -side top -fill both -expand yes #$path.text tag configure tag -font $tagFont \ # -background #ffffa666a666 \ # -foreground black $path.text tag configure tag -font $tagFont \ -foreground #40004000D000 $path.text tag configure comment -font $attrFont \ -background #d000e800d000 \ -foreground black $path.text tag configure textValue -font $attrFont \ -background #d200d200f000 \ -foreground black #$path.text tag configure attr -font $attrFont \ # -background #fae0d53fdaaa \ # -foreground black # -background #D000D000ffff \ $path.text tag configure attrName -font $attrFont \ -foreground black # -background #D000D000ffff \ # -background #e800d000d000 \ # -background gray90 \ # -foreground #d00000000000 $path.text tag configure attrValue -font $attrFont \ -background #f000d000d000 \ -foreground black $path.text tag configure header -background gray90 \ -foreground red2 $path.text tag configure query -background gray95 \ -foreground red2 $path.text tag configure hot -background #a666a666ffff $path.text tag configure open -font $opnclFont $path.text tag configure close -font $opnclFont $path.text tag configure leave -font $opnclFont $path.text tag bind tag <2> "xmlJump $path.text @%x,%y" $path.text tag bind open "xmlHighlight $path.text @%x,%y open hot" $path.text tag bind open "xmlHighlightMotion $path.text @%x,%y open hot" $path.text tag bind open "$path.text tag remove hot 1.0 end" $path.text tag bind open <1> "xmlOpen $path.text @%x,%y" $path.text tag bind close "xmlHighlight $path.text @%x,%y open hot" $path.text tag bind close "xmlHighlightMotion $path.text @%x,%y close hot" $path.text tag bind close "$path.text tag remove hot 1.0 end" $path.text tag bind close <1> "xmlClose $path.text @%x,%y" } #---------------------------------------------------------------------------- # xmlWidgetLoad_Recurs # #---------------------------------------------------------------------------- proc xmlWidgetLoad_Recurs { path doSiblings level node maxlevel } { global levels incr maxlevel -1 if {$maxlevel < 0} { return } while {$node != ""} { set levels($node) $level $path insert insert $level set type [$node nodeType] if { $type == "ELEMENT_NODE" } { set firstChild [$node firstChild] if {$firstChild == ""} { $path insert insert " = " leave } else { if {$maxlevel > 0} { $path insert insert " - " [list close $node] } else { $path insert insert " + " [list open $node] } } $path insert insert "[$node nodeName] " [list tag $node] set attr_line_width 0 set attr_name_width 0 set attr_value_width [string length $level] foreach attr [$node attributes] { if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } set l [string length $attr] if {$l > $attr_name_width} { set attr_name_width $l } incr attr_line_width $l set l [string length [$node getAttribute $attr]] if {$l > $attr_value_width} { set attr_value_width $l } incr attr_line_width $l } set recurseToChilds 1 set attrDisplayMode [expr $attr_line_width > 80] if {$attrDisplayMode} { foreach attr [$node attributes] { $path insert insert "\n" $path insert insert "$level " #$path insert insert [format " %-${attr_name_width}s = %-${attr_value_width}s " \ # $attr [$node getAttribute $attr] \ # ] attr if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } $path insert insert [format " %-${attr_name_width}s= " \ $attr \ ] attrName $path insert insert [$node getAttribute $attr] attrValue #$path insert insert [format "%-${attr_value_width}s " \ # '[$node getAttribute $attr]' \ # ] attrValue } $path insert insert "\n" } else { if {[$node attributes] == ""} { set childs [$node childNodes] if {[llength $childs] == 1} { if {[$childs nodeType] == "TEXT_NODE"} { set value [$childs nodeValue] if {([string length $value] < 60) && ([string first \n $value] == -1)} { $path insert insert $value textValue set recurseToChilds 0 } } } } else { foreach attr [$node attributes] { if {[llength $attr] > 1} { if {[lindex $attr 1] == ""} { set attr [lindex $attr 0] } else { set attr "[lindex $attr 1]:[lindex $attr 0]" } } $path insert insert " $attr=" attrName $path insert insert [$node getAttribute $attr] attrValue #$path insert insert ' attrName } } $path insert insert "\n" } set recurseToChilds 1 if {$recurseToChilds} { foreach child [$node childNodes] { xmlWidgetLoad_Recurs $path 1 "$level " $child $maxlevel } } } else { switch $type { COMMENT_NODE { $path insert insert " C " $path insert insert [$node nodeValue] comment $path insert insert "\n" } CDATA_SECTION_NODE - TEXT_NODE { set lines 0 foreach line [split [$node nodeValue] \n] { if {$lines == 0} { $path insert insert " T " } else { $path insert insert "$level " } if {$line == ""} { $path insert insert " " textValue } else { $path insert insert $line textValue } $path insert insert "\n" incr lines } } PROCESSING_INSTRUCTION_NODE { $path insert insert " P " $path insert insert [$node target] tag set lines 0 foreach line [split [$node data] \n] { if {$lines == 0} { $path insert insert " " } else { $path insert insert "$level " } $path insert insert $line attrValue $path insert insert "\n" incr lines } } default { $path insert insert " ? " $path insert insert [$node nodeValue] attrValue $path insert insert "\n" } } } if {!$doSiblings} { return } break #set node [$node nextSibling] } } #---------------------------------------------------------------------------- # xmlWidgetLoad # #---------------------------------------------------------------------------- proc xmlWidgetLoad { path mode location xml query } { global doc root keepEmpties useSimple if {$mode == "xml"} { if {$useSimple} { if {$keepEmpties} { set doc [dom parse -keepEmpties -simple $xml] } else { set doc [dom parse -simple $xml] } } else { if {$keepEmpties} { set doc [dom parse -keepEmpties $xml] } else { set doc [dom parse $xml] } } } else { if {$keepEmpties} { set doc [dom parse -keepEmpties -html $xml] } else { set doc [dom parse -html $xml] } } set root [$doc documentElement] set query [string trim $query] if {$query == ""} { set query / } $path insert end \n $path insert end xml( header $path insert end $location query $path insert end ") " header $path insert end $query query $path insert end \n set nodes 0 set rows 0 set results [$root selectNodes $query type] switch $type { nodes { foreach node $results { $path mark set insert end xmlWidgetLoad_Recurs $path 1 "" $node 2 $path insert end \n incr nodes } } attrnodes { foreach {attrName attrValue} $results { $path insert end $attrName attrName $path insert end " " $path insert end $attrValue attrValue $path insert end \n incr rows } } attrvalues { foreach result $results { $path insert end "$result\n" incr rows } } default { $path insert end "$results\n" } } if {$rows != 0} { $path insert end "---$rows result(s)---\n" } if {$nodes != 0} { $path insert end "---$nodes node(s)---\n" } $path yview -pickplace end } #---------------------------------------------------------------------------- # xmlReload # #---------------------------------------------------------------------------- proc xmlReload { } { global xml set xml [.edit.f.text get 1.0 end] xmlWidgetLoad .xml.text xml $xml } #---------------------------------------------------------------------------- # GetXML # #---------------------------------------------------------------------------- proc GetXML { url } { global Login HttpProxyHost HttpProxyPort if {[regexp { *file:(.*)} $url all path]} { #puts stderr "file path='$path'" set fd [open $path] set xml [read $fd [file size $path]] close $fd } if {[regexp { *http:(.*)} $url all path]} { #puts stderr "http url='$path'" set xml "" set login "" set password "" #------------------------------------------------------ # try to re-use old login and password # #------------------------------------------------------ regexp {//([^/]*)/(.*)} $url all server file set indexes [array names Login $server,*] if {[llength $indexes] == 1} { foreach { login password } $Login($indexes) break } while 1 { set hdrs {} if {$login != ""} { #------------------------------------------- # generate Basic Authenication header #------------------------------------------ set hdrs [list Authorization "Basic [Base64Encode $login:$password]" ] } #------------------------------------------- # do HTTP request #------------------------------------------- http::config -proxyhost $HttpProxyHost -proxyport $HttpProxyPort set token [http::geturl $url -headers $hdrs] #------------------------------------------- # wait till HTTP request finishes #------------------------------------------ http::wait $token upvar $token state set statuscode [lindex $state(http) 1] if {$statuscode != "200"} { if {$statuscode == "401"} { if {[GetUserPassword state login password]} { #puts stderr "login='$login' password='$password'" continue } else { return "" } } else { puts stderr "\n\n\nstatuscode=$statuscode" puts stderr "$state(http)" break } } else { set xml [http::data $token] break } } } return $xml } #---------------------------------------------------------------------------- # xmlExecute # #---------------------------------------------------------------------------- proc xmlExecute { sel } { #puts stderr $sel if {[regexp { *(xml|html)\(([^)]*)\)(.*)} $sel all mode location query]} { #puts stderr "'$sel' location='$location' query='$query'" .pane.output.text configure -cursor watch . configure -cursor watch update set xml [GetXML $location] if {$xml != ""} { xmlWidgetLoad .pane.output.text $mode $location $xml $query } .pane.output.text configure -cursor left_ptr . configure -cursor left_ptr } else { error "Not a complete query!!" } } #---------------------------------------------------------------------------- # GotoParent # #---------------------------------------------------------------------------- proc GotoParent { } { global PointerXY set pos $PointerXY set path .pane.output.text foreach tag [$path tag names $pos] { #puts stderr "tag=$tag" if {[string match domNode* $tag]} { set tag [$tag parentNode] if {$tag == ""} return $path configure -state normal set start [$path index "$pos linestart"] set end [$path index "$start + 1 lines"] regexp {$( *)} [$path index "$start + 1 lines"] all level $path delete $start $end while 1 { set end [$path index "$start + 1 lines"] set nextLine [$path get $start $end] if {[string match "$level *" $nextLine]} { $path delete $start $end } else { break } } $path mark set insert $start xmlWidgetLoad_Recurs $path 0 $level $tag 2 $path see $start } } } #---------------------------------------------------------------------------- # As # #---------------------------------------------------------------------------- proc As { method } { global PointerXY set path .pane.output.text foreach tag [$path tag names $PointerXY] { if {[string match domNode* $tag]} { set oldEnd [$path index end] $path insert end \n[$tag $method] $path see $oldEnd } } } #---------------------------------------------------------------------------- # ToXPath # #---------------------------------------------------------------------------- proc ToXPath { } { global PointerXY set path .pane.output.text foreach tag [$path tag names $PointerXY] { if {[string match domNode* $tag]} { set oldEnd [$path index end] $path insert end \n[$tag toXPath] $path see $oldEnd } } } #---------------------------------------------------------------------------- # begin main part #---------------------------------------------------------------------------- namespace eval ::dom::xpathFunc { proc names { ctxNode pos nodeListType nodeList args } { if {[llength $args] != 2} { error "wrong # of args for XPATH function 'names'" } foreach { type value } $args break if {($type != "nodes") && ($type != "attrnodes") } { error "names only applicable for node or attribute node lists!" } set n {} if {$type == "nodes"} { foreach node $value { lappend n [$node nodeName] } } else { foreach {attrName attrValue} $value { lappend n $attrName } } return [list string $n] } } set xe_save "~/.xe-input" set xe_config "~/.xe-config" if {[llength $argv] > 0} { set xe_save [lindex $argv 0] } set bgcolor "grey90" set fgcolor "black" switch $tcl_platform(platform) { unix { set Cour12 8x13 set CourB12 8x13b set Helv10 "-Adobe-helvetica-medium-r-normal--*-100-*" set Helv12 "-Adobe-helvetica-medium-r-normal--*-120-*" set HelvB10 "-Adobe-helvetica-bold-r-normal--*-100-*" set HelvB12 "-Adobe-helvetica-bold-r-normal--*-120-*" } windows { set Cour12 "{Courier New} 10" set CourB12 "{Courier New} 10 bold" set Helv10 "Arial 9" set Helv12 "Arial 10" set HelvB10 "Arial 9 bold" set HelvB12 "Arial 10 bold" } } option add *background gray80 option add *foreground black option add *selector black option add *Scrollbar.foreground #dfdfdf option add *Scrollbar.activeForeground #efefef option add *font $HelvB12 wm title . "xe - [lindex $argv 0]" wm minsize . 30 10 wm geometry . 80x20 #--------------------------------------- # set up iconwin #--------------------------------------- if {$tcl_platform(platform)== "unix"} { toplevel .icwin frame .icwin.f -relief flat -borderwidth 1 label .icwin.f.l1 -text xe -font $Helv12 label .icwin.f.l2 -text [lindex $argv 0] -font $Helv12 pack .icwin.f pack .icwin.f.l1 .icwin.f.l2 -anchor nw .icwin configure -relief ridge -borderwidth 2 wm geometry .icwin 60x60 wm iconwindow . .icwin } set keepEmpties 0 set useSimple 0 frame .menu -relief raised -borderwidth 1 -highlightthickness 0 #-- File -------------- menubutton .menu.file -text " File " -menu .menu.file.m menu .menu.file.m -tearoff 0 .menu.file.m add command -label " Clear Input Window " -command { .pane.upper.input.text delete 0.0 end } .menu.file.m add separator .menu.file.m add command -label " Save Output Window in ~/xe-out" -command { SaveTextWindow .pane.output.text "~/xe-out" } .menu.file.m add command -label " Print Output Window" -command { PrintDialog } .menu.file.m add separator .menu.file.m add command -label " Quit without Save" -command { exit } .menu.file.m add command -label " Save Input Window in $xe_save" -command { SaveTextWindow .pane.upper.input.text $xe_save } .menu.file.m add command -label " Quit and Save Input Window in $xe_save" \ -command { SaveTextWindow .pane.upper.input.text $xe_save exit } #-- Options -------------- menubutton .menu.options -text " Options " -menu .menu.options.m menu .menu.options.m -tearoff 0 .menu.options.m add command -label " http proxy " -command ConfigureProxy .menu.options.m add check -label " keep empties " \ -underline 1 -variable keepEmpties .menu.options.m add check -label " use simple parser " \ -underline 1 -variable useSimple pack .menu.file \ .menu.options -side left label .menu.info -text "XE " -font $HelvB12 pack .menu.info -side right pane .pane vertical 1000 1000 .pane configure -highlightthickness 0 frame .pane.upper -borderwidth 0 -highlightthickness 0 frame .pane.upper.input -borderwidth 2 -highlightthickness 0 text .pane.upper.input.text -relief sunken -bd 2 -height 10 -width 80 \ -bg $bgcolor -fg $fgcolor \ -font $Cour12 -padx 2 -pady 2 -setgrid 1 \ -yscrollcommand ".pane.upper.input.sb set" .pane.upper.input.text configure -exportselection yes .pane.upper.input.text tag configure search -background white -foreground black scrollbar .pane.upper.input.sb -relief sunken -command ".pane.upper.input.text yview" pack .pane.upper.input.sb -side right -fill y -expand no pack .pane.upper.input.text -side top -fill both -expand yes xmlWidget .pane.output pack .pane.output -side bottom -fill both -expand yes frame .pane.upper.buttons -borderwidth 1 -highlightthickness 0 label .pane.upper.buttons.searchL -text " search:" -underline 4 -font $Helv12 entry .pane.upper.buttons.search -width 20 -relief sunken -borderwidth 2 \ -textvariable searchString -exportselection yes \ -font $Cour12 -highlightthickness 1 \ -background gray90 button .pane.upper.buttons.padb1 -state disabled -relief flat \ -highlightthickness 0 \ -borderwidth 0 -padx 15 -pady 0 button .pane.upper.buttons.padb2 -state disabled -relief flat \ -highlightthickness 0 \ -borderwidth 0 -padx 15 -pady 0 button .pane.upper.buttons.execute -text "execute " -command { set sel [selection get] if {$sel != ""} { xmlExecute $sel } } -pady 2 button .pane.upper.buttons.clearoutput -text clearoutput -command { .pane.output.text delete 0.0 en foreach doc [info commands domDoc*] { $doc delete } } -pady 2 pack .pane.upper.buttons.searchL \ .pane.upper.buttons.search \ .pane.upper.buttons.padb1 \ .pane.upper.buttons.execute \ .pane.upper.buttons.padb2 \ .pane.upper.buttons.clearoutput -side left pack .pane.upper.buttons -anchor w pack .pane.upper.input -side top -fill both -expand yes pack .pane.upper.buttons -side bottom -fill x -expand no pack .pane.upper -fill both -expand yes pack .menu -fill x -side top -expand no pack .pane -side top -fill both -expand yes pane_place .pane vertical 0.25 .pane.upper .pane.output bind_emacstext Text menu .pane.output.m -tearoff 0 .pane.output.m add command -label " goto parent " -command GotoParent .pane.output.m add command -label " asXML " -command "As asXML" .pane.output.m add command -label " asHTML " -command "As asHTML" .pane.output.m add command -label " toXPath " -command ToXPath bind .pane.output.text <3> { .pane.output.text configure -cursor left_ptr set PointerXY @%x,%y eval tk_popup .pane.output.m [winfo pointerxy %W] } #-------------------------------------------------------------------- # search feature #-------------------------------------------------------------------- set origSearchWin .pane.upper.input.text .pane.output.text tag configure search -background white -foreground black .pane.upper.input.text tag configure search -background white -foreground black bind Text { global origSearchWin set origSearchWin %W focus .pane.upper.buttons.search } bind .pane.upper.buttons.search { set len [string length $searchString] .pane.upper.input.text tag remove search 0.0 end .pane.output.text tag remove search 0.0 end set curinsert [$origSearchWin index insert] set spos [$origSearchWin search -regexp $searchString insert] if {$spos != ""} { if {[$origSearchWin compare $curinsert == $spos]} { $origSearchWin mark set insert {insert +1char} } set spos [$origSearchWin search -regexp $searchString insert] if {$spos != ""} { $origSearchWin mark set insert $spos $origSearchWin see insert $origSearchWin tag add search insert "insert + $len char" } } break } #-------------------------------------------------------------------- # load the xe save file into the input window # #-------------------------------------------------------------------- if {[catch { set f [open $xe_save r ] }] == 0} { .pane.upper.input.text delete 1.0 end while { [gets $f i] >= 0 } { .pane.upper.input.text insert end $i .pane.upper.input.text insert end "\n" } close $f } IntroWindow # button .startedit -text " Edit plain XML " -font $Helv12 -command xmlEdit # button .dump -text " dump " -font $Helv12 -command {puts stderr [info commands xmlelem*]} # pack .xml -fill both -expand yes # pack .dump .startedit -anchor e # set fd [open [lindex $argv 0]] # set xml [read $fd] # close $fd # xmlWidgetLoad .pane.output.text $xml #---------------------------------------------------------------------------- # end of main part #---------------------------------------------------------------------------- tdom-0.9.1/xe/PaxHeaders.9215/xe.bat0000644000175000001440000000013013325450307015147 xustar000000000000000029 mtime=1532383431.45038577 30 atime=1532383431.503385612 29 ctime=1532383431.45038577 tdom-0.9.1/xe/xe.bat0000644000175000001440000000004613325450307014367 0ustar00rolfusers00000000000000d:\opt\tcl8.2.3\bin\wish82 xe xe-inputtdom-0.9.1/xe/PaxHeaders.9215/xe-input0000644000175000001440000000013013325450307015537 xustar000000000000000029 mtime=1532383431.45038577 30 atime=1532383431.503385612 29 ctime=1532383431.45038577 tdom-0.9.1/xe/xe-input0000644000175000001440000000236713325450307014767 0ustar00rolfusers00000000000000 xml(file:../tests/data/mondial-europe.xml)/country[name='Germany'] xml(file:../tests/data/mondial-europe.xml) contains(//country[name='Germany']/name,"any") xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']/province[population>5000000]/name xml(file:../tests/data/mondial-europe.xml)count(//country[name='Germany']/province) xml(file:../tests/data/mondial-europe.xml) //mountain[in_country[@ref = string(//country[name='Germany']/@id)]] xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/name xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']//city[population>1000000] xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/city[population<100000] xml(file:../tests/data/mondial-europe.xml)//river[length>4000] xml(file:../tests/data/mondial-europe.xml)//river/name xml(file:../tests/data/mondial-europe.xml) //country/car_code/text() xml(file:../tests/data/books.xml) //book[@style="novel"] xml(file:../doc/domNode.xml) //method/text() xml(http://www.fernweh.com/wap/info.wml) xml(http://www.fernweh.com/wap/categories.wml) xml(http://wap.is.danet.de/lh/flugplan/index.wml) xml(http://wap.t-d1-wap.de/t-online/) xml(http://www.vbxml.com/downloads/files/dropdown_xsl.txt) tdom-0.9.1/PaxHeaders.9215/aclocal.m40000644000175000001440000000013113325450307015270 xustar000000000000000030 mtime=1532383431.410385893 29 atime=1532383431.48738566 30 ctime=1532383431.410385893 tdom-0.9.1/aclocal.m40000644000175000001440000000025413325450307014510 0ustar00rolfusers00000000000000# # Include the TEA standard macro set # builtin(include,tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # builtin(include,tdom.m4) tdom-0.9.1/PaxHeaders.9215/doc0000644000175000001440000000013213325450307014121 xustar000000000000000030 mtime=1532383431.417385869 30 atime=1532446226.527747799 30 ctime=1532383431.417385869 tdom-0.9.1/doc/0000755000175000001440000000000013325450307013414 5ustar00rolfusers00000000000000tdom-0.9.1/doc/PaxHeaders.9215/tdomcmd.xml0000644000175000001440000000013213325450307016347 xustar000000000000000030 mtime=1532383431.416385872 30 atime=1532383431.489385654 30 ctime=1532383431.416385872 tdom-0.9.1/doc/tdomcmd.xml0000644000175000001440000000463013325450307015570 0ustar00rolfusers00000000000000 tdom tdom is an expat parser object extension to create an in-memory DOM tree from the input while parsing. package require tdom set parser [expat] tdom $parser enable
DESCRIPTION

tdom adds the C handler set "tdom" to an tcl expat parser obj. This handler set builds an in-memory DOM tree out of the input, parsed by the parser. A DOM tree created this way behave exactly like a DOM tree created by the "dom" command (see there). In fact, tdom is only another interface to the same functionality; it uses the code behind the dom code for building the DOM tree.

tdom parserObj enable

Adds the tdom C handler set to a Tcl expat parser object. Next time, the parser parses input, the tdom C handler functions create an in-memory DOM tree.

tdom parserObj getdoc

Returns the DOM tree as domDoc (see there) object.

tdom parserObj setStoreLineColumn ?boolean?

See the method setStoreLineColumn of the dom command.

tdom parserObj remove

Removes the tdom C handler set from the parser object.

tdom parserObj keepEmpties

See the option -keepEmpties of the dom command.

tdom parserObj setExternalEntityResolver script
dom expat DOM SAX C handler set
tdom-0.9.1/doc/PaxHeaders.9215/pullparser.html0000644000175000001440000000013213325450307017255 xustar000000000000000030 mtime=1532383431.416385872 30 atime=1532383431.489385654 30 ctime=1532383431.416385872 tdom-0.9.1/doc/pullparser.html0000644000175000001440000002014613325450307016476 0ustar00rolfusers00000000000000 tDOM manual: pullparser

NAME

tdom::pullparser -
Create an XML pull parser command

SYNOPSIS

package require tdom

    tdom::pullparser cmdName  ? -ignorewhitecdata ? 
    

DESCRIPTION

This command creates XML pull parser commands with a simple API, along the lines of a simple StAX parser. After creation, you've to set an input source, to do anything useful with the pull parser. For this see the methods input, inputchannel and inputfile.

The parser has always a state. You start parsing the XML data until some next state, do what has to be done and skip again to the next state. XML well-formedness errors along the way will be reported as TCL_ERROR with additional info in the error message.

The pull parsers don't follow external entities and are XML 1.0 only, they know nothing about XML Namespaces. You get the tags and attribute names as in the source. You aren't noticed about comments, processing instructions and external entities; they are silently ignored for you. CDATA Sections are handled as if their content would have been provided without using a CDATA Section.

On the brighter side is that character entity and attribute default declarations in the internal subset are respected (because of using expat as underlying parser). It is probably somewhat faster than a comperable implementation with the SAX interface. It's a nice programming model. It's a slim interface.

If the option -ignorewhitecdata is given, the created XML pull parser command will ignore any white space only (' ', \t, \n and \r) text content between START_TAG and START_TAG / END_TAG. The parser won't stop at such input and will create TEXT state events only for not white space only text.

Not all methods are valid in every state. The parser will raise TCL_ERROR if a method is called in a state the method isn't valid for. Valid methods of the created commands are:

state
This method is valid in all parser states. The possible return values and their meanings are:
  • READY - The parser is created or reset, but no input is set.
  • START_DOCUMENT - Input is set, parser is ready to start parsing.
  • START_TAG - Parser has stopped parsing at a start tag.
  • END_TAG - Parser has stopped parsing at an end tag
  • TEXT - Parser has stopped parsing to report text between tags.
  • END_DOKUMENT - Parser has finished parsing without error.
  • PARSE_ERROR - Parser stopped parsing at XML error in input.
input data
This method is only valid in state READY. It prepares the parser to use data as XML input to parse and switches the parser into state START_DOCUMENT.
inputchannel channel
This method is only valid in state READY. It prepares the parser to read the XML input to parse out of channel and switches the parser into state START_DOCUMENT.
inputfile filename
This method is only valid in state READY. It open filename and prepares the parser to read the XML input to parse out of that file. The method returns TCL_ERROR, if the file could not be open in read mode. Otherwise it switches the parser into state START_DOCUMENT.
next
This method is valid in state START_DOCUMENT, START_TAG, END_TAG and TEXT. It continues parsing of the XML input until the next event, which it will return.
tag
This method is only valid in states START_TAG and END_TAG. It returns the tag name of the current start or end tag.
attributes
This method is only valid in state START_TAG. It returns all attributes of the element in a name value list.
text
This method is only valid in state TEXT. It returns the character data of the event. There will be always at most one TEXT event between START_TAG and the next START_TAG or END_TAG event.
skip
This method is only valid in state START_TAG. It skips to the corresponding end tag and ignores all events (but not XML parsing errors) on the way and returns the new state END_TAG.
find-element tagname
This method is only valid in states START_DOCUMENT, START_TAG and END_TAG. It skips forward until the next element start tag with tag name tagname and returns the new start START_TAG. If there isn't such an element the parser stops at the end of the input and returns END_DOCUMENT.
reset
This method is valid in all parser states. It resets the parser into READY state and returns that.
delete
This method is valid in all parser states. It deletes the parser command.

Miscellaneous methods:

line
This method is valid in all parser states except READY and TEXT. It returns the line number of the parsing position.
line
This method is valid in all parser states except READY and TEXT. It returns the offset, from the beginning of the current line, of the parsing position.

KEYWORDS

XML, pull, parsing

tdom-0.9.1/doc/PaxHeaders.9215/domNode.html0000644000175000001440000000013213325450307016451 xustar000000000000000030 mtime=1532383431.414385878 30 atime=1532383431.489385654 30 ctime=1532383431.414385878 tdom-0.9.1/doc/domNode.html0000644000175000001440000007564213325450307015705 0ustar00rolfusers00000000000000 tDOM manual: domNode

NAME

domNode -
Manipulates an instance of a DOM node object

SYNOPSIS

$nodeObject method arg arg ...
domNode nodeToken method arg arg ...

DESCRIPTION

This command manipulates one particular instance of a DOM node object. method indicates a specific method of the node class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html) as well to parts of the W3C draft "XML Pointer Language (XPointer)" (http://www.w3.org/TR/1998/WD-xptr-19980303). Please note, that the XPointer methods are deprecated. Use DOM methods or XPath expressions instead of them.

The selectNodes method implements the "XML Path Language (XPath) Version 1.0" W3C recommendation 16 November 1999 (http://www.w3.org/TR/1999/REC-xpath-19991116). Look at these documents for a deeper understanding of the functionality.

The valid methods are:

nodeType
Returns the node type of that node object. This can be: ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE.
nodeName
Returns the node name of that node object. This is the element (tag) name for element nodes (type ELEMENT_NODE), the processing-instruction target for processing-instructions, "#text" for text node, "#comment" for comment nodes or "#cdata" for cdata section nodes.
nodeValue ?newValue?
Returns the value of that node object. This is the text or the data for element nodes of type TEXT_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE or CDATA_SECTION_NODE). Otherwise it is empty. If the node is a TEXT_NODE, COMMENT_NODE or PROCESSING_INSTRUCTION_NODE and the optional argument newValue is given, the node is set to that value.
hasChildNodes
Returns 1 if the node has children. Otherwise 0 is returned.
parentNode ?objVar?
Returns the parent node.
childNodes
Returns a list of direct children node objects.
childNodesLive
Returns a "live" nodeList object of the child nodes of the node in the sense of the DOM recommendation. This nodeList object is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. The two accessors known by the nodeList object are "item <index>", which returns the indexth item in the collection, and "length", which returns the number of nodes in the list.
firstChild ?objVar?
Returns the first child as a node object.
lastChild ?objVar?
Returns the last child as a node object.
nextSibling ?objVar?
Returns the next sibling relative to the current node as a node object.
previousSibling ?objVar?
Returns the next sibling relative to the current node as a node object.
getElementsByTagName name
Returns a list of all elements in the subtree matching (glob style) name.
getElementsByTagNameNS uri localname
Returns a list of all elements in the subtree matching (glob style) localname and having the given namespace uri.
getElementById id
Returns the node having an id attribute with value id or the empty string if no node has an id attribute with that value.
hasAttribute attributeName
Returns 1 if the object node contains an attribute with name attributeName . Otherwise 0 is returned.
getAttribute attributeName ?defaultValue?
Returns the value of the attribute attributeName. If the attribute is not available defaultValue is returned.
setAttribute attributeName newValue ?attributeName newValue ...?
Sets the value for one or more attributes. Every attributeName is set to the corresponding newValue. If there isn't an attribute for one or more of the attributeName, this will create that attribute. It is not recommended to set attributes that look like xml namespace declarations.
removeAttribute attributeName
Removes the attribute attributeName.
hasAttributeNS uri localName
Returns 1 if the object node contains an attribute with the local name localName within the namespace uri. Otherwise 0 is returned.
getAttributeNS uri localName ?defaultValue?
Returns the value of the attribute with the local name localName within the namespace URI uri. If the node dosn't have that attribute the defaultValue is returned.
setAttributeNS uri qualifiedName newValue ?uri qualifiedName newValue ...?

Sets the value for one or more full qualified attributes. Every attribute qualifiedName with the namespace URI uri will be set to newValue. This will create a new attribute, if it wasn't avialble before. If you want to set an attribute within a namespace you must specify the attribute name with prefix, even if you want to set an already existing attribute to a new value. While searching, if the attribute already exists, only the given uri and the localname of the qualifiedName is used.

$node setAttributeNS "http://some.uri.com/wow" prefix:attr1 attrValue

If the uri is the empty string and the attribute name hasn't a prefix, this method has the same effect as the method setAttribute.

$node setAttributeNS "" attri "some Value"

With the exceptions of the special prefixes "xmlns" and "xml" you always must provide a non empty uri, if your qualifiedName has a prefix. It is not recommended to set xml namespace declarations. The effects are complicated and not always obvious up to resulting a not well-formed serializations after further processing.

removeAttributeNS uri localName
Removes the attribute with the local name localName within the namespace uri.
attributes ?attributeNamePattern?
Returns information about the attriubtes matching the attributeNamePattern. If attributeNamePattern isn't given, information about all attributes are returned. The return value is a Tcl list, the elements just the attriubute name in case of non namespaced attriubtes and three element sublists for namespaced attributes. n case of an "ordinary" namespaced attribute, the sublist elements are {<localname> <prefix> <namespace_uri>}. In the special case of an xml namespace declaration it is {<the prefix defined> <localname> ""}.
attributeNames ?attributeNamePattern?
Returns a flat list of all attributes names (as found in the XML source) matching the attributeNamePattern. If attributeNamePattern isn't given, all attribute names are returned as a Tcl list.
appendChild newChild
Appends newChild to the end of the child list of the node.
insertBefore newChild refChild
Inserts newChild before the refChild into the list of children of node. If refChild is the empty string, insert newChild at the end of the child nodes list of that node.
replaceChild newChild oldChild
Replaces oldChild with newChild in the list of children of that node. The oldChild node will be part of the document fragment list after this operation.
removeChild child
Removes child from the list of children of that node. child will be part of the document fragment list after this operation.
delete
Deletes the given node and its complete child tree and frees the complete internal memory. The affected nodes are not accessible through the document fragment list.
cloneNode ?-deep?
Clones this node and adds the new create node into the document fragment list. If the -deep option is specified, all descendant nodes are also cloned.
ownerDocument ?domObjVar?
Returns the document object of the document this node belongs to.
find attrName attrVal ?objVar?
Finds the node with the attribute name attrName, and attribute value attrVal in the subtree starting the current node.
child number|all type attrName attrValue
(XPointer) child
descendant number|all type attrName attrValue
(XPointer) descendant
ancestor number|all type attrName attrValue
(XPointer) ancestor
fsibling number|all type attrName attrValue
(XPointer) fsibling
psibling number|all type attrName attrValue
(XPointer) psibling
root objVar
(XPointer) root
text
Returns all text node children of that current node combined, i.e. appended into one string.
target
For a processing instruction node the target part is returned. Otherwise an error is generated.
data
For a processing instruction node the data part is returned. For a text node, comment node or cdata section node the value is returned. Otherwise an error is generated.
prefix
Returns the namespace prefix.
namespaceURI
Returns the namespace URI.
localName
Returns the localName from the tag name of the given node.
selectNodes ?-namespaces prefixUriList? ?-cache <boolean>? xpathQuery ?typeVar?

Returns the result of applying the XPath query xpathQuery to the subtree. This can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If typeVar is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed).

The argument xpathQuery has to be a valid XPath expression. However there are a few exceptions to that rule. Tcl variable references (in the usual tcl syntax: $varname) may appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on. The value will always be seen as string literal by the xpath engine. Cast the value explicitly with the according xpath functions (number(), boolean()) to another data type, if needed.

Similar to the way described above to inject literals in a secure way into the XPath expression using tcl variable references there is a syntax to inject element names from tcl variables. At every place where the XPath syntax allows a node test there could be a tcl variable reference (in any form), just the leading $ replaced with %. This allows one to select nodes with 'strange' (invalid, according to the appropriate XML production rule) node names which may be needed in case of working with JSON data.

The option -namespaces expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document, the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list binds the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual.

If the -cache option is used with a true value, then the xpathQuery will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be compiled and stored in the cache, for use in further calls. Please note that the xpathQuery given as string is used as key for the cache. This means, that equal XPath expressions, which differ only in white space are treated as different cache entries. Special care is needed, if the XPath expression includes namespace prefixes or references to tcl variables. Both namespace prefixes and tcl variable references will be resolved according to the XML prefix namespace mappings and tcl variable values at expression compilation time. If the same XPath expression is used later on in a context with other XML prefix namespace mappings or values of the used tcl variables, make sure to first remove the compiled expression from the cache with the help of the deleteXPathCache method, to force a recompilation. Without using the -cache option such consideration is never needed.

Examples:

set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ]
foreach paragraph $paragraphNodes {
    lappend  values [$paragraph selectNodes attribute::type]
}

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
getLine
Returns the line number of that node in the originally parsed XML.
getColumn
Returns the column number of that node in the originally parsed XML.
asList
Returns the DOM substree starting form the current node as a nested Tcl list.
asXML ?-indent none/1..8? ?-channel channelId? ?-escapeNonASCII? -xmlDeclaration <boolean>? -encString <string> ?-escapeAllQuot? ?-indentAttrs? ?-nogtescape? ?-noEmptyElementTag?

Returns the DOM substree starting from the current node as the root node of the result as an (optional indented) XML string or sends the output directly to the given channelId.

If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation.

The flag -xmlDeclaration determines whether there will be an XML Declaration and a newline emitted before anything else. The default is, to do not. If this flag is given with a true argument then

-encString sets the encoding value in the XML Declaration. Otherwise, this option is ignored. Please note, that this option just enhance the string representation of the generated XML Declaration with an encoding information string, nothing more. It's up to the user to handle encoding in case of writing to a channel or reparsing.

If the option -escapeAllQuot is given, quotation marks will be escaped with &quot; even in text content of elements.

If the option -indentAttrs is given, then attributes will each be separated with newlines and indented to the same level as the parent node plus the value given as argument to -indentAttrs (0..8).

If the option -nogtescape is given then the character '>' won't get escaped in attribute values and text content of elements. The default is to escape this character.

If the option -noEmptyElementTag is given then no empty tag syntax will be used. Instead, if an element has empty content it will be serialized with an element start tag and an immediately following element end tag.

asHTML ?-channel channelId? ?-escapeNonASCII? ?-htmlEntities?
Returns the DOM substree starting from the current node as the root node of the result serialized according to HTML rules (HTML elements are recognized regardless of case, without end tags for empty HTML elements etc.), as string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -htmlEntities is given, a character is written using its HTML 4.01 character entity reference, if one is defined for it.
asText
For ELEMENT_NODEs, the asText method outputs the string-value of every text node descendant of node in document order without any escaping. For every other node type, this method outputs the XPath string value of that node.
appendFromList list
Parses list , creates an according DOM subtree and appends this subtree to the current node.
appendFromScript tclScript
Appends the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, to the given node.
insertBeforeFromScript tclScript refChild
Inserts the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, before the refChild into the list of children of node. If refChild is the empty string, the new nodes will be appended.
appendXML XMLstring
Parses XMLstring, creates an according DOM subtree and appends this subtree to the current node.
simpleTranslate outputVar specifications
Translates the subtree starting at the object node according to the specifications in specifications and outputs the result in the variable outputVar . The translation is very similar to Cost Simple mode.
toXPath ?-legacy?
Returns an XPath, which exactly addresses the given node in its document. This XPath is only valid as there are no changes to DOM tree made later one. With the -legacy option, other XPath expressions are returned, which doesn't work in all cases.
getBaseURI
Returns the baseURI of the node. This method is deprecated in favor of the baseURI method.
baseURI ?URI?
Returns the present baseURI of the node. If the optional argument URI is given, it sets the base URI of the node and of all of its child nodes out of the same entity as node to the given URI.
disableOutputEscaping ?boolean?
This method works only for text nodes; for every other node it returns error. Without the optional argument it returns, if disabling output escaping is on. The return value 0 means, the characters of the text node will be escaped, to generate valid XML, if serialized. This is the default for every parsed or created text node (with the exception of that text nodes in a result tree of an XSLT transformation, for which disabling output escaping was requested explicitly in the stylesheet). The return value 1 means, that output escaping is disabled for this text node. If such a text node is serialized (with asXML or asHTML), it is literally written, without escaping of the special XML characters. If the optional boolean value boolean is given, the flag is set accordingly. You should not set this flag to 1 until you really know what you do.
precedes refnode
Compares the relative order of the node and refnode. Both nodes must be part of the same documents and not out of the fragment list of the document. Returns true if node is in document order (in the sense of the XPath 1.0 recommendation) before refnode, and false otherwise.
normalize ?-forXPath?
Puts all Text nodes in the full depth of the sub-tree underneath this Node into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. If the option -forXPath is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization.
xslt ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-maxApplyDepth int? ?-xsltmessagecmd script? stylesheet ?outputVar?
Applies an XSLT transformation on the document using the XSLT stylesheet (given as domDoc). Returns a document object containing the result document of that transformation and stores it in the optional outputVar.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised if the user tries to set a top-level parameter which is not declared in the stylesheet.

The option -maxApplyDepth expects a positive integer as argument. By default, the xslt engine allows xslt templates to nest up to 3000 levels (and raises error if they nest deeper). This limit can be set by the -maxApplyDepth option.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates whether the xsl:message has an attribute "terminate" with the value "yes". If the called script returns anything else then TCL_OK then the xslt transformation will be aborted, returning error. If the called script returns -code break the error message is empty, otherwise the result code is reported. In case of terminated transformation the outputVar, if given, is set to the empty string.

@attrName
Returns the value of the attribute attrName. Short cut for getAttribute.
jsonType ?OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?
Only element and text nodes may have a JSON type and only this types of nodes support the jsonType method; the other node types return error if called with this method. Returns the jsonType of the node. If the optional argument is given, the JSON type of the node is set to the given type and returned. Valid type arguments for element nodes are OBJECT, ARRAY and NONE. Valid type arguments for text nodes are STRING, NUMBER, TRUE, FALSE, NULL and NONE.

Otherwise, if an unknown method name is given, the command with the same name as the given method within the namespace ::dom::domNode is tried to be executed. This allows quick method additions on Tcl level.

SEE ALSO

dom, domDoc

KEYWORDS

XML, DOM, document, node, parsing

tdom-0.9.1/doc/PaxHeaders.9215/domDoc.html0000644000175000001440000000013213325450307016271 xustar000000000000000030 mtime=1532383431.413385881 30 atime=1532383431.488385657 30 ctime=1532383431.413385881 tdom-0.9.1/doc/domDoc.html0000644000175000001440000010107713325450307015515 0ustar00rolfusers00000000000000 tDOM manual: domDoc

NAME

domDoc -
Manipulates an instance of a DOM document object

SYNOPSIS

domDocObjCmd method ?arg arg ...?
domDoc docToken method ?arg arg ...?

DESCRIPTION

This command manipulates one particular instance of a document object. method indicates a specific method of the document class. These methods should closely conform to the W3C recommendation "Document Object Model (Core) Level 1" (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html). Look at these documents for a deeper understanding of the functionality.

The valid methods are:

documentElement ?objVar?
Returns the top most element in the document (the root element).
getElementsByTagName name
Returns a list of all elements in the document matching (glob style) name.
getElementsByTagNameNS uri localname
Returns a list of all elements in the subtree matching (glob style) localname and having the given namespace uri.
createElement tagName ?objVar?
Creates (allocates) a new element node with node name tagName, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object is stored in this variable.
createElementNS url tagName ?objVar?
Creates (allocates) a new element node within a namespace having uri as the URI and node name tagName, which could include the namespace prefix, append it to the hidden fragment list in the document object and returns the node object. If objVar is given the new node object is stored in this variable.
createTextNode text ?objVar?
Creates (allocates) a new text node with node value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
createComment text ?objVar?
Creates (allocates) a new comment node with value text, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new comment node object is stored in this variable.
createCDATASection data ?objVar?
Creates (allocates) a new CDATA node with node value data, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
createProcessingInstruction target data ?objVar?
Creates a process instruction, appends it to the hidden fragment list in the document object and returns the node object. If objVar is given, the new node object is stored in this variable.
delete
Explicitly deletes the document, including the associated Tcl object commands (for nodes, fragment/new nodes, the document object itself) and the underlying DOM tree.
getDefaultOutputMethod
Returns the default output method of the document. This is usually a result of a XSLT transformation.
asXML ?-indent none/1..8? ?-channel channelId? ?-escapeNonASCII? ?-doctypeDeclaration <boolean>? -xmlDeclaration <boolean>? -encString <string> ?-escapeAllQuot? ?-indentAttrs? ?-nogtescape? ?-noEmptyElementTag?

Returns the DOM tree as an (optional indented) XML string or sends the output directly to the given channelId.

If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation.

The flag -doctypeDeclaration determines whether there will be a DOCTYPE declaration emitted before the first node of the document. The default is not to emit it. The DOCTYPE name will always be the element name of the document element. An external entity declaration of the external subset is only emitted if the document has a system identifier.

The flag -xmlDeclaration determines whether there will be an XML Declaration and a newline emitted before anything else. The default is not to emit one. If this flag is given with a true argument then

-encString sets the encoding value in the XML Declaration. Otherwise this option is ignored. Please note that this option just enhances the string representation of the generated XML Declaration with an encoding information string, nothing more. It's up to the user to handle encoding in case of writing to a channel or reparsing.

If the option -escapeAllQuot is given, quotation marks will be escaped with &quot; even in text content of elements.

If the option -indentAttrs is given, then attributes will each be separated with newlines and indented to the same level as the parent node plus the value given as argument to -indentAttrs (0..8).

If the option -nogtescape is given then the character '>' won't get escaped in attribute values and text content of elements. The default is to escape this character.

If the option -noEmptyElementTag is given then no empty tag syntax will be used. Instead, if an element has empty content it will be serialized with an element start tag and an immediately following element end tag.

asHTML ?-channel channelId? ?-escapeNonASCII? ?-htmlEntities? ?-doctypeDeclaration <boolean>?
Returns the DOM tree serialized according to HTML rules (HTML elements are recognized regardless of case, without end tags for empty HTML elements etc.) as string or sends the output directly to the given channelId. If the option -escapeNonASCII is given, every non 7 bit ASCII character in attribute values or element PCDATA content will be escaped as character reference in decimal representation. If the option -htmlEntities is given, a character is written using its HTML 4.01 character entity reference, if it has one. If the flag -doctypeDeclaration is given there will be a DOCTYPE declaration emitted before the first node of the document. The default is, to do not. The DOCTYPE name will always be the element name of the document element without case normalization. An external entity declaration of the external subset is only emitted, if the document has a system identifier. The doctype declaration will be written from the available information, without check, if this is a known (w3c) HTML version information or if the document confirms to the given HTML version.
asText
The asText method returns the tree by serializing the string-value of every text node in document order without any escaping. In effect, this is what the xslt output method "text" (XSLT 1.0 recommendation, section 16.3) does.
asJSON ?-indent none/0..8? ?-channel channelId?

The asJSON method serializes the tree into a valid JSON data string. In general, this may be a lossy serialization. For this serialization all comment, character data sections and processing instruction nodes, all attributes and all XML namespaces are ignored. Only element and text nodes may be reflected in the generated JSON serialization. Appropriate JSON data type information of a node will be respected.

If an element node has the JSON type OBJECT, then every element node child of this element will be serialized as member of that object, with the node name of the child as the member name and the relevant children of that child as the value. Every other child nodes will be ignored.

If an element node has the JSON type ARRAY, then the text and element node children of that element node are serialized as the consecutive values of the array. Element node children of an ARRAY element will be container nodes for nested ARRAY or OBJECT values.

Text nodes with the JSON types TRUE, FALSE or NULL will be serialized to the corresponding JSON token without looking at the value of the text node. A text node without JSON type will always be serialized as a JSON string token. A text node with JSON type NUMBER will be serialized as JSON number token if the text node value is in fact a valid JSON number and as a JSON string if not.

If an element node doesn't has a JSON type then the serialization of its children is determined by the following rules:

Only text and element node child are relevant. If the element node to serialize is the member of a JSON object and there is no relevant child node the value of that member will be an empty JSON string. If the only relevant child node of this element node is a text node then the JSON value of that text node will be the value of the object member. If the element has more than one relevant child nodes and the first one is a text node then the relevant children will be serialized as JSON array. If the only relevant child node is an element node or the first relevant child is an element node and the node name of that only or first relevant child isn't equal to the array container node name all element node children will be serialized as the members of a JSON object (while ignoring any intermixed text nodes). If the only or first relevant child is an element node and the node name of this child is equal to the array container element name then all relevant children will be serialized as the values of a JSON array.

If the element to serialize is a value of a JSON array and the node name of this element isn't equal to the array container node name that element will be seen as a container node for a JSON object and all element node children will be serialized as the members of that array while ignoring any text node children. If the element to serialize is a value of a JSON array and the node name of this element is equal to the array container node name, all relevant children will be serialized as JSON array.

If the -channel option is given the serialization isn't returned as string but send directly to the channel, given as argument to the option.

If the -indent option is given and the argument given to this option isn't "none" then the returned JSON string is "pretty-printed". The numeric argument to this option defines the number of spaces for any indentation level. The default is to not emit any additional white space.

publicId ?publicId?
Returns the public identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the public identifier of the document is set to this value.
systemId ?systemId?
Returns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value.
internalSubset ?internalSubset?
Returns the internal subset of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the internal subset of the document is set to this value. Note that none of the parsing methods preserve the internal subset of a document; a freshly parsed document will always have an empty internal subset. Also note, that the method doesn't do any syntactical check on a given internal subset.
cdataSectionElements (?URI:?localname|*) ?<boolean>?
This method allows one to control for which element nodes the text node children will be serialized as CDATA sections (this affects only serialization with the asXML method, no text node is altered in any way by this method). IF the method is called with an element name as first argument and a boolean with value true as second argument, every text node child of every element node in the document with the same name as the first argument will be serialized as CDATA section. If the second argument is a boolean with value false, all text nodes of all elements with the same name as the first argument will be serialized as usual. Namespaced element names have to be given in the form namespace_URI:localname, not in the otherwise usual prefix:localname form. With two arguments called, the method returns the used boolean value. If the method is called with only an element name, it will return a boolean value, indicating that the text node children of all elements with that name in the document will be serialized as CDATA section elements (return value 1) or not (return value 0). If the method is called with only one argument and that argument is an asterisk ('*'), then the method returns an unordered list of all element names of the document, for which the text node children will be serialized as CDATA section nodes.
selectNodesNamespaces ?prefixUriList?
This method allows one to control a document global prefix to namespace URI mapping, which will be used for selectNodes method calls (on document as well as on all nodes, which belongs to the document) if it is not overwritten by using the -namespaces option of the selectNodes method. Any namespace prefix within an xpath expression will be first resolved against this list. If the list binds the same prefix to different namespaces, then the first binding will win. If a prefix could not resolved against the document global prefix / namespaces list, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual. If the optional argument prefixUriList is given, then the global prefix / namespace list is set to this list and returns it. Without the optional argument the method returns the current list. The default is the empty list.
xslt ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-maxApplyDepth int? ?-xsltmessagecmd script? stylesheet ?outputVar?
Applies an XSLT transformation on the whole document of the node object using the XSLT stylesheet (given as domDoc). Returns a document object containing the result document of the transformation and stores that document object in the optional outputVar, if that was given.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised if the user tries to set a top-level parameter that is not declared in the stylesheet.

The option -maxApplyDepth expects a positiv integer as argument. By default, the xslt engine allows xslt templates to nest up to 3000 levels (and raises error if they nest deeper). This limit can be set by the -maxApplyDepth option.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes". If the called script returns anything else then TCL_OK then the xslt transformation will be aborted, returning error. If the called script returns -code break, the error message is empty, otherwise the result code is reported. In case of terminated transformation, the outputVar, if given, is set to the empty string.

toXSLTcmd ?objVar?
If the DOM tree represents a valid XSLT stylesheet, this method transforms the DOM tree into an xslt command, otherwise it returns error. The created xsltCmd is returned and stored in the objVar, if a var name was given. A successful transformation of the DOM tree to an xsltCmd removes the domDoc cmd and all nodeCmds of the document.

The syntax of the created xsltCmd is:

xsltCmd method ?arg ...?

The valid methods are:

transform ?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-maxApplyDepth int? ?-xsltmessagecmd script? domDoc ?outputVar?
Applies XSLT transformation on the document domDoc. Returns a document object containing the result document of that transformation and stores it in the optional outputVar.

The optional -parameters option sets top level <xsl:param> to string values. The parameterList has to be a tcl list consisting of parameter name and value pairs.

If the option -ignoreUndeclaredParameters is given, then parameter names in the parameterList given to the -parameters options that are not declared as top-level parameters in the stylesheet are silently ignored. Without this option, an error is raised if the user tries to set a top-level parameter, which is not declared in the stylesheet.

The option -maxApplyDepth expects a positiv integer as argument. By default, the xslt engine allows xslt templates to nest up to 3000 levels (and raises error if they nest deeper). This limit can be set by the -maxApplyDepth option.

The -xsltmessagecmd option sets a callback for xslt:message elements in the stylesheet. The actual command consists of the script, given as argument to the option, appended with the XML Fragment from instantiating the xsl:message element content as string (as if the XPath string() function would have been applied to the XML Fragment) and a flag, which indicates, if the xsl:message has an attribute "terminate" with the value "yes".

delete
Deletes the xsltCmd and cleans up all used recourses

If the first argument to an xsltCmd is a domDoc or starts with a "-", then the command is processed in the same way as <xsltCmd> transform.

normalize ?-forXPath?
Puts all text nodes in the document into a "normal" form where only structure (e.g., elements, comments, processing instructions and CDATA sections) separates text nodes, i.e., there are neither adjacent text nodes nor empty text nodes. If the option -forXPath is given, all CDATA sections in the nodes are converted to text nodes, as a first step before the normalization.
nodeType
Returns the node type of the document node. This is always DOCUMENT_NODE.
getElementById id
Returns the node having a id attribute with value id or the empty string, if no node has an id attribute with that value.
firstChild ?objVar?
Returns the first top level node of the document.
lastChild ?objVar?
Returns the last top level node of the document.
appendChild newChild
Append newChild to the end of the list of top level nodes of the document.
removeChild child
Removes child from the list of top level nodes of the document. child will be part of the document fragment list after this operation. It is not physically deleted.
hasChildNodes
Returns 1 if the document has any nodes in the tree. Otherwise 0 is returned.
childNodes
Returns a list of the top level nodes of the document.
ownerDocument ?domObjVar?
Returns the document itself.
insertBefore newChild refChild
Insert newChild before the refChild into the list of top level nodes of the document. If refChild is the empty string, inserts newChild at the end of the top level nodes.
replaceChild newChild oldChild
Replaces oldChild with newChild in the list of children of that node. The oldChild node will be part of the document fragment list after this operation.
appendFromList list
Parses list , creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document.
appendXML XMLstring
Parses XMLstring, creates an according DOM subtree and appends this subtree at the end of the current list of top level nodes of the document.
selectNodes ?-namespaces prefixUriList? ?-cache <boolean>? xpathQuery ?typeVar?

Returns the result of applying the XPath query xpathQuery to the document. The context node of the query is the root node in the sense of the XPath recommendation (not the document element). The result can be a string/value, a list of strings, a list of nodes or a list of attribute name / value pairs. If typeVar is given the result type name is stored into that variable (empty, bool, number, string, nodes, attrnodes or mixed).

The argument xpathQuery has to be a valid XPath expression. However, there is one exception to that rule. Tcl variable names can appear in the XPath statement at any position where it is legal according to the rules of the XPath syntax to put an XPath variable. The value of the variable is substituted for the variable name. Ignoring the syntax rules of XPath the Tcl variable name may be any legal Tcl var name: local variables, global variables, array entries and so on. The value will always be seen as string literal by the xpath engine. Cast the value explicitly with the according xpath functions (number(), boolean()) to another data type, if needed.

The option -namespaces expects a tcl list with prefix / namespace pairs as argument. If this option is not given, then any namespace prefix within the xpath expression will be first resolved against the list of prefix / namespace pairs set with the selectNodesNamespaces method for the document the node belongs to. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix. If this option is given, any namespace prefix within the xpath expression will be first resolved against that given list (and ignoring the document global prefix / namespace list). If the list binds the same prefix to different namespaces, then the first binding will win. If this fails, then the namespace definitions in scope of the context node will be used to resolve the prefix, as usual.

If the -cache option is used with a true value, then the xpathQuery will be looked up in a document specific cache. If the query is found, then the stored pre-compiled query will be used. If the query isn't found, it will be compiled and stored in the cache, for use in further calls. Please notice, that the xpathQuery as given as string is used as key for the cache. This means that equal XPath expressions, which differ only in white space, are treated as different cache entries. Special care is needed if the XPath expression includes namespace prefixes or references to tcl variables. Both namespace prefixes and tcl variable references will be resolved according to the XML prefix namespace mappings and tcl variable values at expression compilation time. If the same XPath expression is used later on in a context with other XML prefix namespace mappings or values of the used tcl variables, make sure to first remove the compiled expression from the cache with the help of the deleteXPathCache method, to force a recompilation. Without using the -cache option such consideration is never needed.

Examples:

set paragraphNodes [$node selectNodes {chapter[3]//para[@type='warning' or @type='error'} ]
foreach paragraph $paragraphNodes {
    lappend  values [$paragraph selectNodes attribute::type]
}

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
baseURI ?URI?
Returns the present baseURI of the document. If the optional argument URI is given, sets the base URI of the document to the given URI.
appendFromScript tclScript
Appends the nodes created by the tclScript by Tcl functions, which have been built using dom createNodeCmd, at the end of the current list of top level nodes of the document.
insertBeforeFromScript tclScript refChild
Inserts the nodes created in the tclScript by Tcl functions, which have been built using dom createNodeCmd, before the refChild into to the list of top level nodes of the document. If refChild is the empty string, the new nodes will be appended.
deleteXPathCache ?xpathQuery?
If called without the optional argument, all cached XPath expressions of the document are freed. If called with the optional argument xpathQuery, this single XPath query will be removed from the cache, if it is there. The method always returns an empty string.

Otherwise, if an unknown method name is given, the command with the same name as the given method within the namespace ::dom::domDoc is tried to be executed. This allows quick method additions on Tcl level.

Newly created nodes are appended to a hidden fragment list. If they are not moved into the tree they are automatically deleted as soon as the whole document gets deleted.

SEE ALSO

dom, domNode

KEYWORDS

DOM node creation, document element

tdom-0.9.1/doc/PaxHeaders.9215/README0000644000175000001440000000013213325450307015056 xustar000000000000000030 mtime=1532383431.412385885 30 atime=1532383431.488385657 30 ctime=1532383431.412385885 tdom-0.9.1/doc/README0000644000175000001440000000320213325450307014271 0ustar00rolfusers00000000000000 The documentation is written in TMML (developed by Joe English). See http://tmml.sourceforge.net/ for informations about TMML. The HTML files and man pages are created from the TMML sources. To process the TMML files you need: o tDOM tDOM must be already successfully installed. o TMML VERY IMPORTANT: Make sure, you have the current CVS HEAD of TMML. The latest TMML distribution dates from August 2000 and could not used for the steps, described below. Informations about how to get TMML CVS HEAD could be found at http://sourceforge.net/cvs/?group_id=16386 You only need to check out the actual version of TMML, no further installation or modification is needed. o tcllib The TMML tools uses a module out of tcllib. Any recent distribution should do. If you really don't have it already, it's worth to install it, regardless of this TMML stuff. Installation should be completely painless. Find it at http://sourceforge.net/project/showfiles.php?group_id=12883 If you have all requirements in place, just do: tclsh path/to/your/tmml/tools/tmml.tcl toman dom.xml ?domDoc.xml ...? This creates nroff man pages of the accordingly documentation in the sub dir man (which will be automatically created, if it doesn't exist.) The next command creates the HTML pages: tclsh path/to/your/tmml/tools/tmml.tcl tohtml dom.xml ?domDoc.xml ...? This creates the HTML pages in the html sub dir (also, will be created, if needed). And you may do tclsh path/to/your/tmml/tools/tmml.tcl navpages This will create an index.html, the category-index.html and the keyword-index.html for the HTML version of the documentation. tdom-0.9.1/doc/PaxHeaders.9215/pullparser.xml0000644000175000001440000000013213325450307017111 xustar000000000000000030 mtime=1532383431.416385872 30 atime=1532383431.489385654 30 ctime=1532383431.416385872 tdom-0.9.1/doc/pullparser.xml0000644000175000001440000001634613325450307016341 0ustar00rolfusers00000000000000 tdom::pullparser Create an XML pull parser command package require tdom tdom::pullparser cmdName -ignorewhitecdata
DESCRIPTION

This command creates XML pull parser commands with a simple API, along the lines of a simple StAX parser. After creation, you've to set an input source, to do anything useful with the pull parser. For this see the methods input, inputchannel and inputfile.

The parser has always a state. You start parsing the XML data until some next state, do what has to be done and skip again to the next state. XML well-formedness errors along the way will be reported as TCL_ERROR with additional info in the error message.

The pull parsers don't follow external entities and are XML 1.0 only, they know nothing about XML Namespaces. You get the tags and attribute names as in the source. You aren't noticed about comments, processing instructions and external entities; they are silently ignored for you. CDATA Sections are handled as if their content would have been provided without using a CDATA Section.

On the brighter side is that character entity and attribute default declarations in the internal subset are respected (because of using expat as underlying parser). It is probably somewhat faster than a comperable implementation with the SAX interface. It's a nice programming model. It's a slim interface.

If the option -ignorewhitecdata is given, the created XML pull parser command will ignore any white space only (' ', \t, \n and \r) text content between START_TAG and START_TAG / END_TAG. The parser won't stop at such input and will create TEXT state events only for not white space only text.

Not all methods are valid in every state. The parser will raise TCL_ERROR if a method is called in a state the method isn't valid for. Valid methods of the created commands are:

state This method is valid in all parser states. The possible return values and their meanings are:
  • READY - The parser is created or reset, but no input is set.
  • START_DOCUMENT - Input is set, parser is ready to start parsing.
  • START_TAG - Parser has stopped parsing at a start tag.
  • END_TAG - Parser has stopped parsing at an end tag
  • TEXT - Parser has stopped parsing to report text between tags.
  • END_DOKUMENT - Parser has finished parsing without error.
  • PARSE_ERROR - Parser stopped parsing at XML error in input.
input data This method is only valid in state READY. It prepares the parser to use data as XML input to parse and switches the parser into state START_DOCUMENT. inputchannel channel This method is only valid in state READY. It prepares the parser to read the XML input to parse out of channel and switches the parser into state START_DOCUMENT. inputfile filename This method is only valid in state READY. It open filename and prepares the parser to read the XML input to parse out of that file. The method returns TCL_ERROR, if the file could not be open in read mode. Otherwise it switches the parser into state START_DOCUMENT. next This method is valid in state START_DOCUMENT, START_TAG, END_TAG and TEXT. It continues parsing of the XML input until the next event, which it will return. tag This method is only valid in states START_TAG and END_TAG. It returns the tag name of the current start or end tag. attributes This method is only valid in state START_TAG. It returns all attributes of the element in a name value list. text This method is only valid in state TEXT. It returns the character data of the event. There will be always at most one TEXT event between START_TAG and the next START_TAG or END_TAG event. skip This method is only valid in state START_TAG. It skips to the corresponding end tag and ignores all events (but not XML parsing errors) on the way and returns the new state END_TAG. find-element tagname This method is only valid in states START_DOCUMENT, START_TAG and END_TAG. It skips forward until the next element start tag with tag name tagname and returns the new start START_TAG. If there isn't such an element the parser stops at the end of the input and returns END_DOCUMENT. reset This method is valid in all parser states. It resets the parser into READY state and returns that. delete This method is valid in all parser states. It deletes the parser command.

Miscellaneous methods:

line This method is valid in all parser states except READY and TEXT. It returns the line number of the parsing position. line This method is valid in all parser states except READY and TEXT. It returns the offset, from the beginning of the current line, of the parsing position.
XML pull parsing
tdom-0.9.1/doc/PaxHeaders.9215/tmml.options0000644000175000001440000000013213325450307016564 xustar000000000000000030 mtime=1532383431.416385872 30 atime=1532383431.490385651 30 ctime=1532383431.416385872 tdom-0.9.1/doc/tmml.options0000644000175000001440000000025213325450307016001 0ustar00rolfusers00000000000000array set Options { xsltProcessor tdom masterDocument "tDOM.xml" tomanOptions -soelim htmlDirectory . nroffDirectory . } tdom-0.9.1/doc/PaxHeaders.9215/pullparser.n0000644000175000001440000000013213325450307016546 xustar000000000000000030 mtime=1532383431.416385872 30 atime=1532383431.489385654 30 ctime=1532383431.416385872 tdom-0.9.1/doc/pullparser.n0000644000175000001440000001646213325450307015775 0ustar00rolfusers00000000000000'\" '\" Generated from pullparser.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .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 .\} .\} .. .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 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .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 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .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 .. .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 .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH pullparser n "" Tcl "" .BS .SH NAME tdom::pullparser \- Create an XML pull parser command .SH SYNOPSIS .nf package require tdom \fBtdom::pullparser\fP \fIcmdName\fR \fR?\fP -ignorewhitecdata \fR?\fP .fi .BE .SH "DESCRIPTION " .PP This command creates XML pull parser commands with a simple API, along the lines of a simple StAX parser. After creation, you've to set an input source, to do anything useful with the pull parser. For this see the methods \fIinput\fR, \fIinputchannel\fR and \fIinputfile\fR. .PP The parser has always a \fIstate\fR. You start parsing the XML data until some next state, do what has to be done and skip again to the next state. XML well-formedness errors along the way will be reported as TCL_ERROR with additional info in the error message. .PP The pull parsers don't follow external entities and are XML 1.0 only, they know nothing about XML Namespaces. You get the tags and attribute names as in the source. You aren't noticed about comments, processing instructions and external entities; they are silently ignored for you. CDATA Sections are handled as if their content would have been provided without using a CDATA Section. .PP On the brighter side is that character entity and attribute default declarations in the internal subset are respected (because of using expat as underlying parser). It is probably somewhat faster than a comperable implementation with the SAX interface. It's a nice programming model. It's a slim interface. .PP If the option \fI-ignorewhitecdata\fR is given, the created XML pull parser command will ignore any white space only (' ', \et, \&\en and \er) text content between START_TAG and START_TAG / END_TAG. The parser won't stop at such input and will create TEXT state events only for not white space only text. .PP Not all methods are valid in every state. The parser will raise TCL_ERROR if a method is called in a state the method isn't valid for. Valid methods of the created commands are: .TP \&\fB\fBstate\fP \&\fRThis method is valid in all parser states. The possible return values and their meanings are: .RS .IP "\(bu" \&\fIREADY\fR - The parser is created or reset, but no input is set. .IP "\(bu" \&\fISTART_DOCUMENT\fR - Input is set, parser is ready to start parsing. .IP "\(bu" \&\fISTART_TAG\fR - Parser has stopped parsing at a start tag. .IP "\(bu" \&\fIEND_TAG\fR - Parser has stopped parsing at an end tag .IP "\(bu" \&\fITEXT\fR - Parser has stopped parsing to report text between tags. .IP "\(bu" \&\fIEND_DOKUMENT\fR - Parser has finished parsing without error. .IP "\(bu" \&\fIPARSE_ERROR\fR - Parser stopped parsing at XML error in input. .RE .TP \&\fB\fBinput\fP \fIdata\fB \&\fRThis method is only valid in state \fIREADY\fR. It prepares the parser to use \fIdata\fR as XML input to parse and switches the parser into state START_DOCUMENT. .TP \&\fB\fBinputchannel\fP \fIchannel\fB \&\fRThis method is only valid in state \fIREADY\fR. It prepares the parser to read the XML input to parse out of \&\fIchannel\fR and switches the parser into state START_DOCUMENT. .TP \&\fB\fBinputfile\fP \fIfilename\fB \&\fRThis method is only valid in state \fIREADY\fR. It open \fIfilename\fR and prepares the parser to read the XML input to parse out of that file. The method returns TCL_ERROR, if the file could not be open in read mode. Otherwise it switches the parser into state START_DOCUMENT. .TP \&\fB\fBnext\fP \&\fRThis method is valid in state \fISTART_DOCUMENT\fR, \&\fISTART_TAG\fR, \fIEND_TAG\fR and \fITEXT\fR. It continues parsing of the XML input until the next event, which it will return. .TP \&\fB\fBtag\fP \&\fRThis method is only valid in states \fISTART_TAG\fR and \&\fIEND_TAG\fR. It returns the tag name of the current start or end tag. .TP \&\fB\fBattributes\fP \&\fRThis method is only valid in state \fISTART_TAG\fR. It returns all attributes of the element in a name value list. .TP \&\fB\fBtext\fP \&\fRThis method is only valid in state \fITEXT\fR. It returns the character data of the event. There will be always at most one TEXT event between START_TAG and the next START_TAG or END_TAG event. .TP \&\fB\fBskip\fP \&\fRThis method is only valid in state \fISTART_TAG\fR. It skips to the corresponding end tag and ignores all events (but not XML parsing errors) on the way and returns the new state END_TAG. .TP \&\fB\fBfind-element\fP \fItagname\fB \&\fRThis method is only valid in states \&\fISTART_DOCUMENT\fR, \fISTART_TAG\fR and \fIEND_TAG\fR. It skips forward until the next element start tag with tag name \&\fItagname\fR and returns the new start START_TAG. If there isn't such an element the parser stops at the end of the input and returns END_DOCUMENT. .TP \&\fB\fBreset\fP \&\fRThis method is valid in all parser states. It resets the parser into READY state and returns that. .TP \&\fB\fBdelete\fP \&\fRThis method is valid in all parser states. It deletes the parser command. .PP Miscellaneous methods: .TP \&\fB\fBline\fP \&\fRThis method is valid in all parser states except READY and TEXT. It returns the line number of the parsing position. .TP \&\fB\fBline\fP \&\fRThis method is valid in all parser states except READY and TEXT. It returns the offset, from the beginning of the current line, of the parsing position. .SH KEYWORDS XML, pull, parsing tdom-0.9.1/doc/PaxHeaders.9215/dom.n0000644000175000001440000000013213325450307015134 xustar000000000000000030 mtime=1532383431.413385881 30 atime=1532383431.488385657 30 ctime=1532383431.413385881 tdom-0.9.1/doc/dom.n0000644000175000001440000005642013325450307014361 0ustar00rolfusers00000000000000'\" '\" Generated from dom.xml '\" '\" BEGIN man.macros .if t .wh -1.3i ^B .nr ^l \n(.l .ad b .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 .\} .\} .. .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 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. .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 .. .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. .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 .. .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 .\} .. .de DS .RS .nf .sp .. .de DE .fi .RE .sp .. .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. .de CS .RS .nf .ta .25i .5i .75i 1i .if t .ft C .. .de CE .fi .if t .ft R .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. '\" END man.macros .TH dom n "" Tcl "" .BS .SH NAME dom \- Create an in-memory DOM tree from XML .SH SYNOPSIS .nf package require tdom \&\fBdom\fP \fImethod\fR ?\fIarg arg ...\fR? .fi .BE .SH "DESCRIPTION " .PP This command provides the creation of DOM trees in memory. In the usual case a string containing a XML information is parsed and converted into a DOM tree. Other possible parse input may be HTML or JSON. The \fImethod\fR indicates a specific subcommand. .PP The valid methods are: .TP \&\fB\fBdom\fP \fBparse\fP ?\fIoptions\fB? ?\fIdata\fB? \&\fRParses the XML information and builds up the DOM tree in memory providing a Tcl object command to this DOM document object. Example: .RS .CS dom parse $xml doc $doc documentElement root .CE .PP parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically. .CS set document [dom parse $xml] set root [$document documentElement] .CE .PP parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in \&\fIdocument\fR. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by: .CS $document delete .CE or .CS rename $document "" .CE .PP The valid options are: .IP "\fB-simple\fR" If \fI-simple\fR is specified, a simple but fast parser is used (conforms not fully to XML recommendation). That should double parsing and DOM generation speed. The encoding of the data is not transformed inside the parser. The simple parser does not respect any encoding information in the XML declaration. It skips over the internal DTD subset and ignores any information in it. Therefore it doesn't include defaulted attribute values into the tree, even if the according attribute declaration is in the internal subset. It also doesn't expand internal or external entity references other than the predefined entities and character references. .IP "\fB-html\fR" If \fI-html\fR is specified, a fast HTML parser is used, which tries to even parse badly formed HTML into a DOM tree. .IP "\fB-html5\fR" This option is only available if tDOM was build with --enable-html5. Try the \fIfeatureinfo\fR method if you need to know if this feature is build in. If \&\fI-html5\fR is specified, the gumbo lib html5 parser (https://github.com/google/gumbo-parser) is used to build the DOM tree. This is, as far as it goes, XML namespace-aware. Since this probably isn't wanted by a lot of users and adds only burden for no good in a lot of use cases \fI-html5\fR can be combined with \&\fI-ignorexmlns\fR, in which case all nodes and attributes in the DOM tree are not in an XML namespace. All tag and attribute names in the DOM tree will be lower case, even for foreign elements not in the xhtml, svg or mathml namespace. The DOM tree may include nodes, that the parser inserted because they are implied by the context (as , , etc.). .IP "\fB-json\fR" If \fI-json\fR is specified, the \fIdata\fR is expected to be a valid JSON string (according to RFC 7159). The command returns an ordinary DOM document with nesting token inside the JSON data translated into tree hierarchy. If a JSON array value is itself an object or array then container element nodes named (in a default build) arraycontainer or objectcontainer, respectively, are inserted into the tree. The JSON serialization of this document (with the domDoc method \fIasJSON\fR) is the same JSON information as the \fIdata\fR, preserving JSON datatypes, allowing non-unique member names of objects while preserving their order and the full range of JSON string values. JSON datatype handling is done with an additional property "sticking" at the doc and tree nodes. This property isn't contained in an XML serialization of the document. If you need to store the JSON data represented by a document, store the JSON serialization and parse it back from there. Apart from this JSON type information the returned doc command or handle is an ordinary DOM doc, which may be investigated or modified with the full range of the doc and node methods. Please note that the element node names and the text node values within the tree may be outside of what the appropriate XML productions allow. .IP "\fB-jsonmaxnesting \fIinteger\fP\fR" This option only has effect if used together with the \fI-json\fR option. The current implementation uses recursive descent JSON parser. In order to avoid using excess stack space, any JSON input that has more than a certain levels of nesting is considered invalid. The default maximum nesting is 2000. The option -jsonmaxnesting allows the user to adjust that. .IP "\fB--\fR" The option \fI--\fR marks the end of options. While respected in general this option is only needed in case of parsing JSON data, which may start with a "-". .IP "\fB-keepEmpties\fR" If \fI-keepEmpties\fR is specified then text nodes which contain only whitespaces will be part of the resulting DOM tree. In default case (\fI-keepEmpties\fR not given) those empty text nodes are removed at parsing time. .IP "\fB-keepCDATA\fR" If \fI-keepCDATA\fR is specified then CDATA sections aren't added to the tree as text nodes (and, if necessary, combined with sibling text nodes into one text node) as without this option but are added as CDATA_SECTION_NODEs to the tree. Please note that the resulting tree isn't prepared for XPath selects or to be the source or the stylesheet of an XSLT transformation. If not combined with \fI-keepEmpties\fR only not whitespace only CDATA sections will be added to the resulting DOM tree. .IP "\fB-channel \fI\fP\fR" If \fI-channel \fR is specified, the input to be parsed is read from the specified channel. The encoding setting of the channel (via fconfigure -encoding) is respected, ie the data read from the channel are converted to UTF-8 according to the encoding settings before the data is parsed. .IP "\fB-baseurl \fI\fP\fR" If \fI-baseurl \fR is specified, the baseURI is used as the base URI of the document. External entities references in the document are resolved relative to this base URI. This base URI is also stored within the DOM tree. .IP "\fB-feedbackAfter \fI<#bytes>\fP\fR" If \fI-feedbackAfter <#bytes>\fR is specified, the tcl command given by \&\fI-feedbackcmd\fR is evaluated at the first element start within the document (or an external entity) after the start of the document or external entity or the last such call after #bytes. For backward compatibility if no -feedbackcmd is given but there is a tcl proc named ::dom::domParseFeedback this proc is used as -feedbackcmd. If there isn't such a proc and -feedbackAfter is used it is an error to not also use -feedbackcmd. If the called script raises error, then parsing will be aborted, the \fIdom parse\fR call returns error, with the script error msg as error msg. If the called script \fIreturn -code break\fR, the parsing will abort and the \fIdom parse\fR call will return the empty string. .IP "\fB-feedbackcmd \fI} test html5-3.2 {Bad data} {html5} { set doc [dom parse -html5 -ignorexmlns {}] set result [$doc asXML -indent none] $doc delete set result } {} test html5-4.1 {Tag name case normalization} {html5} { set doc [dom parse -html5 -ignorexmlns {}] set result [$doc asXML -indent none] $doc delete set result } {} test html5-4.2 {Tag name case normalization} {html5} { set doc [dom parse -html5 -ignorexmlns {}] set result [$doc asXML -indent none] $doc delete set result } {} test html5-4.3 {Attribute normalization} {html5} { set doc [dom parse -html5 -ignorexmlns {}] set result [$doc asXML -indent none] $doc delete set result } {} test html5-4.4 {ID Attribute handling} {html5} { set doc [dom parse -html5 -ignorexmlns {

}] set result [[$doc getElementById 1] getAttribute id] $doc delete set result } {1} set xhtml {h "http://www.w3.org/1999/xhtml"} set svg {svg "http://www.w3.org/2000/svg"} set mathml {mml "http://www.w3.org/1998/Math/MathML"} set xlink {xlink "http://www.w3.org/1999/xlink"} set html5 {

text

} test html5-5.1 {svg subtrees} {html5} { set doc [dom parse -html5 $html5] set result [$doc selectNodes -namespaces $xhtml {string(/h:html/h:body/h:p[2])}] $doc delete set result } {text} set html5 { HTML5 SVG demo

HTML5 SVG Demo

A nice green circle:
Created by DKS. This is free code
} test html5-5.2 {svg subtrees} {html5} { set doc [dom parse -html5 $html5] set svg [$doc selectNodes -namespaces $svg //svg:circle] set result [$svg @fill] $doc delete set result } {green} set html5 { Binomial Theorem

Binomial Theorem:

a + b 2 = a 2 + b 2 + 2 a b } test html5-5.3 {mathml subtrees} {html5} { set doc [dom parse -html5 $html5] set mis [$doc selectNodes -namespaces $mathml //mml:mi] set result "" foreach mi $mis { append result [$mi text] } $doc delete set result } {ababab} set html5 { } test html5-5.4 {xlink attribute} {html5} { set doc [dom parse -html5 $html5] set node [$doc selectNodes -namespaces $xlink {//*[@xlink:href]}] set result [$node getAttributeNS [lindex $xlink 1] href] $doc delete set result } {huge-red-circle.svg} test html5-5.5 {xlink attribute} {html5} { set doc [dom parse -html5 -ignorexmlns $html5] set node [$doc getElementById "image"] set result [$node getAttribute "xlink:href"] $doc delete set result } {huge-red-circle.svg} # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/attribute.test0000644000175000001440000000012613325450307017502 xustar000000000000000028 mtime=1532383431.4403858 30 atime=1532383431.499385624 28 ctime=1532383431.4403858 tdom-0.9.1/tests/attribute.test0000644000175000001440000002121013325450307016711 0ustar00rolfusers00000000000000# Features covered: Attribute Lists # # This file tests the parser's performance on Attribute Lists. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2000 Zveno Pty Ltd. # # $Id$ source [file join [file dir [info script]] loadtdom.tcl] catch {unset result} proc EStart {tagName attrList} { global result countAttributesOnly if {![llength $attrList] && !$countAttributesOnly} { if {[info exists result($tagName)]} { set count 0 while {[info exists result($tagName/[incr count])]} {} set result($tagName/$count) {} } else { set result($tagName) {} } return {} } foreach {name value} $attrList { if {[info exists result($tagName,$name)]} { set count 0 while {[info exists result($tagName,$name,[incr count])]} {} set result($tagName,$name,$count) $value } else { set result($tagName,$name) $value } } } catch {unset ::pcdata} proc pcdata t { append ::pcdata $t } test attrList-1.1 {empty attribute list} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-1.1 {}} set parser [xml::parser attrList-1.1 \ -elementstartcommand EStart] $parser parse { } array size result } 0 test attrList-1.2 {single attribute} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-1.2 {}} set parser [xml::parser attrList-1.2 \ -elementstartcommand EStart] $parser parse { } array get result } {Test,attr 1} test attrList-1.3 {multiple distinct attributes} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-1.3 {}} set parser [xml::parser attrList-1.3 \ -elementstartcommand EStart] $parser parse { } list [array size result] $result(Test,first) $result(Test,second) } {2 1 2} test attrList-1.4 {hyphen in attribute name} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-1.4 {}} set parser [xml::parser attrList-1.4 \ -elementstartcommand EStart] $parser parse { } array get result } {Test,first-attr 1} test attrList-2.1 {right angle bracket in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-2.1 {}} set parser [xml::parser attrList-2.1 \ -elementstartcommand EStart] $parser parse { } array get result } {Test,attr value>} test attrList-2.2 {right angle bracket in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-2.2 {}} set parser [xml::parser attrList-2.2 \ -elementstartcommand EStart] $parser parse { } array get result } {Test,attr value1>value2} test attrList-2.3 {right angle bracket in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-2.3 {}} set parser [xml::parser attrList-2.3 \ -elementstartcommand EStart] $parser parse { } set r "" foreach key [lsort [array names result]] { lappend r $key $result($key) } set r } {Test,attr1 value1 Test,attr2 value2>} test attrList-2.4 {right angle bracket in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-2.4 {}} set parser [xml::parser attrList-2.4 \ -elementstartcommand EStart] $parser parse { } set r "" foreach key [lsort [array names result]] { lappend r $key $result($key) } set r } {Test,attr1 value1 Test,attr2 value2>} test attrList-2.5 {right angle brackets in attribute values} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-2.5 {}} set parser [xml::parser attrList-2.5 \ -elementstartcommand EStart] $parser parse { } set r "" foreach key [lsort [array names result]] { lappend r $key $result($key) } set r } {Test,attr1 value>1 Test,attr2 value>2} test attrList-2.6 {right angle brackets in attribute values} { catch {unset ::result} catch {unset ::pcdata} set ::countAttributesOnly 1 catch {rename xml::attrList-2.6 {}} set parser [xml::parser attrList-2.6 \ -elementstartcommand EStart \ -characterdatacommand pcdata] $parser parse { some text } list [array get result] $::pcdata } {{Test,attr1 value>1} {some text}} test attrList-3.1 {unnested left brace in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-3.1 {}} set parser [xml::parser attrList-3.1 \ -elementstartcommand EStart] $parser parse [format { } \{] array get result } [list Test,attr [format {%svalue} \{]] test attrList-3.2 {unnested right brace in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-3.2 {}} set parser [xml::parser attrList-3.2 \ -elementstartcommand EStart] $parser parse [format { } \}] array get result } [list Test,attr [format {value%s} \}]] test attrList-3.3 {Tcl special characters in attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-3.3 {}} set parser [xml::parser attrList-3.3 \ -elementstartcommand EStart] $parser parse { } array get result } {Test,attr {dollar $ backslash \ brackets [puts hello]}} test attrList-4.1 {Unquoted attribute value} { catch {unset ::result} set ::countAttributesOnly 1 catch {rename xml::attrList-4.1 {}} set parser [xml::parser attrList-4.1 \ -elementstartcommand EStart] set retval [catch { $parser parse { }} msg] list $retval $msg } [list 1 {error "not well-formed (invalid token)" at line 3 character 11}] # Test case contributed by David Sutton test attrList-5.0 {Complicated attribute list} { catch {unset ::result} catch {unset ::pcdata} set ::countAttributesOnly 0 catch {rename xml::attrList-5.0 {}} set parser [xml::parser attrList-5.0 \ -elementstartcommand EStart \ -characterdatacommand pcdata] set retval [catch { $parser parse { LightState = LightCtl LOG(AlarmSwitch) DISABLE(BlinkLight) NOTIFY( AlarmSwitch,"Alarm has been reset") }} msg] regsub -all "\[ \t\n\]+" $::pcdata { } ::pcdata set sortedResult {} foreach key [lsort -dictionary [array names ::result]] { lappend sortedResult $key $::result($key) } list $retval $sortedResult $::pcdata } [list 0 {event,deleteOnCompletion no event,endDateTime {} event,ID 22 event,name LogAlarmReset event,startDateTime {} event,startDisabled no eventAction {} eventAction/1 {} eventAction/2 {} eventAction/3 {} stateChangeTrigger,condition {AlarmSwitch = FALSE} stateChangeTrigger,initialState true} { LightState = LightCtl LOG(AlarmSwitch) DISABLE(BlinkLight) NOTIFY( AlarmSwitch,"Alarm has been reset") }] # Test case contributed by Marshall Rose test attrList-5.1 {Attribute list with quoted value} { catch {unset ::result} set ::countAttributesOnly 0 catch {rename xml::attrList-5.1 {}} set parser [xml::parser attrList-5.1 \ -elementstartcommand EStart] set retval [catch { $parser parse {} }] list $retval [array get ::result] } {0 {test,example {isn't this legal?}}} foreach parser [info commands attrList-*] { $parser free } # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/pcdata.test0000644000175000001440000000013213325450307016730 xustar000000000000000030 mtime=1532383431.447385779 30 atime=1532383431.502385615 30 ctime=1532383431.447385779 tdom-0.9.1/tests/pcdata.test0000644000175000001440000000460313325450307016151 0ustar00rolfusers00000000000000# Features covered: PCDATA # # This file tests the parser's performance on PCDATA. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2000 Zveno Pty Ltd. # # $Id$ source [file join [file dir [info script]] loadtdom.tcl] catch {unset result} proc pcdata data { append ::result $data incr ::pcdataCounter } proc Estart {tagName attrList} { switch -- $tagName { Test { } default { incr ::element } } } proc EStop tagname { } test pcdata-1.1 {Simple PCDATA} { set ::result {} set ::element 0 set ::pcdataCounter 0 catch {rename xml::pcdata-1.1 {}} set parser [xml::parser xml::pcdata-1.1 \ -elementstartcommand Estart \ -elementendcommand EStop \ -characterdatacommand pcdata] $parser parse { This is PCDATA } list $::result $::element } {{This is PCDATA} 0} test pcdata-1.2 {PCDATA section with Tcl specials} { set ::result {} set ::element 0 set ::pcdataCounter 0 catch {rename xml::pcdata-1.2 {}} set parser [xml::parser xml::pcdata-1.2 \ -elementstartcommand Estart \ -elementendcommand EStop \ -characterdatacommand pcdata] $parser parse { Dollar $ backslash \ square brackets [ ] braces { } } list $::result $::element } {{Dollar $ backslash \ square brackets [ ] braces { }} 0} # Requested by Marshall Rose, 20/3/1999 test pcdata-1.3 {PCDATA with no entity expansion} { set ::result {} set ::element 0 set ::pcdataCounter 0 catch {rename xml::pcdata-1.3 {}} set parser [xml::parser xml::pcdata-1.3 \ -elementstartcommand Estart \ -elementendcommand EStop \ -characterdatacommand pcdata] $parser parse { This is <PCDATA> } list $::result $::pcdataCounter } {{This is } 1} test pcdata-1.4 {keep all PCDATA for not white space only PCDATA content} { set ::result {} catch {rename xml::pcdata-1.4 {}} set parser [xml::parser xml::pcdata-1.4 \ -characterdatacommand pcdata \ -ignorewhitecdata 1] $parser parse { some content } set ::result } { some content } foreach parser [info commands pcdata-*] { $parser free } # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/doctype.test0000644000175000001440000000013213325450307017143 xustar000000000000000030 mtime=1532383431.444385788 30 atime=1532383431.501385618 30 ctime=1532383431.444385788 tdom-0.9.1/tests/doctype.test0000644000175000001440000000231013325450307016355 0ustar00rolfusers00000000000000# Features covered: Document Type Declaration # # This file tests the parser's performance on Document Type Declarations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 1998-2000 Zveno Pty Ltd. # # $Id$ source [file join [file dir [info script]] loadtdom.tcl] catch {unset result} proc doctype {name pub system dtd} { lappend ::result $name $pub $system $dtd } test doctype-1.1 {Document Type Declaration: no internal DTD subset} { set ::result {} catch {rename xml::doctype-1.1 {}} set parser [xml::parser doctype-1.1 \ -startdoctypedeclcommand doctype] $parser parse { } set ::result } {Test NULL NULL 0} test doctype-2.1 {Document Type Declaration: internal DTD subset} { set ::result {} catch {rename xml::doctype-2.1 {}} set parser [xml::parser doctype-2.1 \ -startdoctypedeclcommand doctype] $parser parse { ]> } set ::result } {Test NULL NULL 1} foreach parser [info commands doctype-*] { $parser free } # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/data0000644000175000001440000000013213325715607015436 xustar000000000000000030 mtime=1532468103.625890141 30 atime=1532468741.420595754 30 ctime=1532468103.625890141 tdom-0.9.1/tests/data/0000755000175000001440000000000013325715607014731 5ustar00rolfusers00000000000000tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-5.1.dtd0000644000175000001440000000013213325450307017255 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-5.1.dtd0000644000175000001440000000003213325450307016466 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/xslt_1.xsl0000644000175000001440000000013213325450307017446 xustar000000000000000030 mtime=1532383431.444385788 30 atime=1532383431.501385618 30 ctime=1532383431.444385788 tdom-0.9.1/tests/data/xslt_1.xsl0000644000175000001440000000042213325450307016662 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/xmlspec-v20.dtd0000644000175000001440000000013213325450307020261 xustar000000000000000030 mtime=1532383431.444385788 30 atime=1532383431.500385621 30 ctime=1532383431.444385788 tdom-0.9.1/tests/data/xmlspec-v20.dtd0000644000175000001440000014575613325450307017521 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/i18n_1.xml0000644000175000001440000000013213325450307017225 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.500385621 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/i18n_1.xml0000644000175000001440000000004213325450307016437 0ustar00rolfusers00000000000000абвгдежзий tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.5.dtd0000644000175000001440000000013213325450307017262 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.5.dtd0000644000175000001440000000013713325450307016501 0ustar00rolfusers00000000000000 ]]> tdom-0.9.1/tests/data/PaxHeaders.9215/mondial-europe.xml0000644000175000001440000000013213325450307021146 xustar000000000000000030 mtime=1532383431.444385788 30 atime=1532383431.500385621 30 ctime=1532383431.444385788 tdom-0.9.1/tests/data/mondial-europe.xml0000644000175000001440000132414013325450307020371 0ustar00rolfusers00000000000000 Albania AL 28750 3249136 1.34 49.2 4100 55 16 28 11 1912 emerging democracy 100 3 95 70 10 20 282 151 287 Tirane 10.7 46.2 192000 Shkoder 19.2 42.2 62000 Durres 19.3 41.2 60000 Vlore 19.3 40.3 56000 Elbasan 20.1 41.1 53000 Korce 20.5 40.4 52000 Greece GR 131940 10538594 0.42 7.4 101700 11.8 22.2 66 8.1 01 01 1829 parliamentary republic 100 98 1.3 98 282 228 494 206 Anatoliki Makedhonia kai Thraki 14157 574308 Attiki 3808 3522769 Athens 23.7167 37.9667 885737 Dhytiki Ellas 11350 702027 Dhytiki Makedhonia 9451 292751 Ionioi Nisoi 2307 191003 Ipiros 9203 339210 Kedriki Makedhonia 19147 1729581 Kriti 8336 537183 Notion Aiyaion 5286 262522 Peloponnisos 15490 605663 Sterea Ellas 15549 578876 Thessalia 14037 731030 Voreion Aiyaion 3836 189541 Macedonia MK 25333 2104035 0.46 29.7 1900 24 44 32 14.8 17 09 1991 emerging democracy 100 22 2 65 4 3 30 67 21 70 3 3 151 228 221 148 Skopje Serbia and Montenegro YU 102350 10614558 20600 20 11 04 1992 republic 100 63 14 6 4 19 4 1 65 5 95 287 221 151 527 266 318 476 Belgrade 20.4667 44.8 1407073 Andorra AND 450 72766 2.96 2.2 1000 parliamentary democracy that retains as its heads of state a coprincipality 100 6 61 30 100 60 65 Andorra la Vella 1.3 42.3 15600 France F 547030 58317450 0.34 5.3 1173000 2.4 26.5 71.1 1.7 republic 100 1 1 90 2 100 60 623 451 488 573 620 73 4.4 Alsace 8280 1624000 Strasbourg 7.76667 48.5833 252338 Mulhouse 108357 Aquitaine 41309 2796000 Bordeaux -0.4 44.51 210336 Auvergne 26013 1321000 Clermont Ferrand 3.4 45.5 136181 Basse Normandie 17589 1391000 Caen -0.2 49.3 112846 Bretagne 27209 2796000 Rennes -1.4 48.1 197536 Brest 147956 Bourgogne 31582 1609000 Dijon 5.2 47.2 146703 Centre 39151 2371000 Orleans 1.5 47.5 105111 Tours 129509 Champagne Ardenne 25606 1348000 Reims 180620 Chalons sur Marne Corse 8680 250000 Ajaccio 8.4 41.4 53500 Franche Comte 16202 1097000 Besancon 6.2 47.1 113828 Haute Normandie 12318 1737000 Rouen 1.5 49.3 102723 Le Havre 195854 Ile de France 12011 10660000 Paris 2.48333 48.8167 2152423 Boulogne Billancourt 101743 Languedoc Rousillon 27376 2115000 Montpellier 3.5 43.3 207996 Nimes 128471 Perpignan 105983 Limousin 16942 723000 Limoges 1.2 45.5 133464 Lorraine 23547 2306000 Metz 119594 Nancy 6.1 48.4 99351 Midi Pyrenees 45349 2431000 Toulouse 1.2 43.4 358688 Nord Pas de Calais 12413 3965000 Lille 3.3 50.37 172142 Pays de la Loire 32082 3059000 Nantes -1.56667 47.25 244995 Angers 141404 Le Mans 145502 Picardie 19399 1811000 Amiens 2.19 49.55 131872 Poitou Charentes 25809 1595000 Poitiers 0.2 46.4 79300 Provence Cote dAzur 31400 4258000 Marseille 5.2 43.2 800550 Nice 7.26667 43.7 342439 Toulon 167619 Aix en Provence 123842 Rhone Alpes 43698 5351000 Lyon 4.78333 45.7 415487 Grenoble 150758 Saint Etienne 199396 Villeurbanne 116872 Spain E 504750 39181114 0.16 6.3 565000 3.6 33.6 62.8 4.3 01 01 1492 parliamentary monarchy 100 100 99 null 17 7 2 65 623 1214 Andalusia 87600 7053043 Sevilla 714148 Almeria 167361 Cadiz -6.2 36.3 155438 Cordoba 315948 Granada 271180 Huelva 145049 Malaga 531443 Jerez de la Frontera 190390 Jaen 112772 Algeciras 103787 Aragon 47720 1183576 Zaragoza 606620 Asturias 10604 1083388 Oviedo 201712 Gijon 269644 Balearic Islands 4992 736865 Palma de Mallorca 322008 Basque Country 7235 2075561 Vitoria Gasteiz 214148 Bilbao 371876 Donostia 177929 Canary Islands 7447 1534897 Santa Cruz de Tenerife 203929 Las Palmas de Gran Canaria 371787 La Laguna 125183 Cantabria 5321 526090 Santander 194822 Castile and Leon 94224 2504371 Valladolid 336917 Albacete 141179 Burgos 166251 Leon 147311 Salamanca 167382 Castile La Mancha 79462 1656179 Toledo Catalonia 32113 6090107 Barcelona 2.15 41.4 1630867 Lleida 114234 Tarragona 114630 Hospitalet de Llobregat 266242 Badalona 219340 Sabadell 189006 Terrassa 161428 Santa Coloma de Gramanet 131764 Baracaldo 103594 Mataro 102117 Estremadura 41635 1050590 Badajoz 130153 Merida Galicia 29574 2720761 La Coruna 255087 Vigo 288573 Orense 108547 Santiago de Compostella Madrid 8028 5034548 Madrid -3.68333 40.4167 3041101 Mostoles 199141 Leganes 178162 Alcala de Henares 166250 Fuenlabrada 158212 Getafe 144368 Alcorcon 142165 Murcia 11314 1070401 Murcia 341531 Cartagena 179659 Navarre 10391 523614 Pamplona 182465 Rioja 5045 263437 Logrono 124823 Valencia 23255 3909047 Valencia -0.383333 39.4667 764293 Alacant 274964 Elx 191305 Castellon de la Plana 139094 Austria A 83850 8023244 0.41 6.2 152000 2 34 64 2.3 12 11 1918 federal republic 100 99.4 0.2 0.3 85 6 100 362 784 366 430 37 91 324 164 Burgenland 3965 273000 Eisenstadt 16 48 10102 Carinthia 9533 559000 Klagenfurt 14.21 46.38 87321 Vorarlberg 2601 341000 Bregenz 9.45 47.3 Vienna 415 1583000 Vienna 16.3667 48.25 1583000 Upper Austria 11979 1373000 Linz 14.18 48.18 203000 Tyrol 12647 649000 Innsbruck 11.22 47.17 118000 Styria 16386 1203000 Graz 15.26 47.4 238000 Salzburg 7154 501000 Salzburg 13.2 47.49 144000 Lower Austria 19170 1507000 St. Polten 15.38 48.13 51102 Czech Republic CZ 78703 10321120 -0.03 8.4 106200 5.8 40.7 53.5 9.1 01 01 1993 parliamentary democracy 100 0.5 0.6 0.3 0.2 94.4 3 39.2 4.6 3 362 646 214 658 Jihocesky 11345 702000 Ceske Budejovice 174000 Jihomoravsky 15028 2059000 Brno 393000 Zlin 198000 Severocesky 7819 1190000 Liberec 160000 Usti nad Labem Severomoravsky 11067 1976000 Ostrava 332000 Olomouc 225000 Praha 11490 2329000 Prague 14.4167 50.0833 1215000 Vychodocesky 11240 1240000 Hradec Kralove 164000 Pardubice 163000 Zapadocesky 10875 869000 Plzen 175000 Germany D 356910 83536115 0.67 6 1452200 1 34.2 64.8 18 01 1871 federal republic 100 0.4 2.3 95.1 0.7 0.4 37 45 100 451 784 646 334 456 167 138 577 68 Baden Wurttemberg 35742 10272069 Stuttgart 9.1 48.7 588482 Mannheim 8.46667 49.5667 316223 Karlsruhe 277011 Freiburg im Breisgau 198496 Heidelberg 138964 Heilbronn 122253 Pforzheim 117960 Ulm 115123 Reutlingen 107782 Bayern 70546 11921944 Munich 11.5667 48.15 1244676 Nurnberg 495845 Augsburg 262110 Oberhausen 225443 Wurzburg 127946 Regensburg 125608 Ingolstadt 110910 Furth 107799 Erlangen 101450 Berlin 889 3472009 Berlin 13.3 52.45 3472009 Brandenburg 29480 2536747 Potsdam 138268 Cottbus 125643 Bremen 404 680000 Bremen 8.5 53.7 549182 Bremerhaven 130847 Hamburg 755 1705872 Hamburg 9.96667 53.55 1705872 Hessen 21115 5980693 Wiesbaden 8.17 50.07 266081 Frankfurt am Main 652412 Kassel 201789 Darmstadt 139063 Offenbach am Main 116482 Mecklenburg Vorpommern 23170 1832298 Schwerin 118291 Rostock 232634 Niedersachsen 47609 7715363 Hannover 9.66667 52.4 525763 Braunschweig 254130 Osnabruck 168050 Oldenburg 149691 Gottingen 127519 Wolfsburg 126965 Salzgitter 117842 Hildesheim 106095 Nordrhein Westfalen 34077 17816079 Dusseldorf 572638 Koln 963817 Essen 617955 Dortmund 600918 Duisburg 536106 Bochum 401129 Wuppertal 383776 Bielefeld 324067 Gelsenkirchen 293542 Bonn 293072 Monchengladbach 266073 Munster 264887 Krefeld 249662 Aachen 247113 Hagen 213747 Hamm 184020 Herne 180029 Mulheim an der Ruhr 176513 Solingen 165973 Leverkusen 161832 Neuss 148870 Paderborn 131513 Recklinghausen 127139 Remscheid 123069 Bottrop 119669 Siegen 111541 Moers 107011 Witten 105423 Bergisch Gladbach 105122 Rheinland Pfalz 19851 3951573 Mainz 8.1 50 184627 Ludwigshafen 167883 Koblenz 109550 Kaiserslautern 101910 Saarland 2570 1084201 Saarbrucken 6.6 49.1 189012 Sachsen 18412 4584345 Dresden 474443 Leipzig 481121 Chemnitz 274162 Zwickau 104921 Sachsen Anhalt 20446 2759213 Magdeburg 265379 Halle 290051 Schleswig Holstein 15738 2708392 Kiel 10.7 54.2 246586 Lubeck 216854 Thuringen 16171 2517776 Erfurt 213472 Gera 126035 Jena 102204 Hungary H 93030 10002541 -0.68 12.3 72500 7.3 37.5 55.2 28.3 01 01 1001 republic 100 2 2.6 4 89.9 0.8 0.7 67.5 5 20 98.2 151 366 515 102 103 329 443 Baranya 4487 417100 Bacs Kiskun 8363 540800 Kecskemet 105000 Bekes 5632 404000 Bekescaba Borsod Abauj Zemplen 7248 749100 Csongrad 4263 437600 Hodmezovasarhely Fejer 4374 422500 Szekesfehervar 109000 Gyor Sopron 4012 426800 Hajdu Bihar 6212 549700 Heves 3637 330200 Eger Komarom Esztergom 2250 312900 Tatabanya Nograd 2544 222700 Salgotarjan Pest 6394 957900 Somogy 6035 340000 Kaposvar Szabolcs Szatmar 5938 563500 Nyiregyhaza 115000 Szolnok 5608 420900 Szolnok Tolna 3702 251000 Szekszard Vas 3337 273900 Szombathely Veszprem 4689 378300 Veszprem Zala 3786 302600 Zalaegerszeg Budapest (munic.) 525 2008500 Budapest 19.0333 47.5167 2016000 Debrecen (munic.) 446 217300 Debrecen 216000 Gyor (munic.) 175 130600 Gyor 130000 Miskolc (munic.) 224 191000 Miskolc 192000 Pecs (munic.) 113 171600 Pecs 171000 Szeged (munic.) 145 178500 Szeged 178000 Italy I 301230 57460274 0.13 6.9 1088600 2.9 31.6 65.5 5.4 17 03 1861 republic 100 98 488 430 235 740 3.2 39 Piemonte 25399 4307000 Novara 103349 Turin 7.39 45.5 991870 Valle dAosta 3262 118000 Aosta 7.22 45.45 Lombardia 23857 8901000 Bergamo 117886 Brescia 196766 Milan 9.28333 45.45 1432184 Monza 123188 Trentino Alto Adige 13618 904000 Bolzano 100380 Trento 102124 Veneto 18364 4415000 Padova 218186 Verona 258946 Vicenza 109333 Venice 12.2 45.27 317837 Friuli Venezia Giulia 7845 1193000 Trieste 231047 Liguria 5418 1663000 La Spezia 103008 Genua 8.58 44.25 701032 Emilia Romagna 22123 3924000 Bologna 11.22 44.3 411803 Ferrara 140600 Modena 177501 Parma 173991 Piacenza 103536 Ravenna 136724 Reggio nellEmilia 131880 Rimini 130896 Toscana 22992 3528000 Livorno 171265 Pisa 101500 Firenze 11.17 43.48 408403 Prato 166688 Umbria 8456 819000 Perugia 12.2 43.1 150576 Terni 109809 Marche 9693 1438000 Ancona 13.28 43.38 103268 Lazio 17203 5185000 Rome 12.6 41.8 2791354 Latina 103630 Abruzzo 10794 1263000 Pescara 128553 LAquila 13.2 42.24 Molise 4438 332000 Campobasso 14.5 41.5 Campania 13595 5709000 Salerno 151374 Napoli 14.15 40.5 1206013 Torre del Greco 102647 Puglia 19348 4066000 Bari 16.5 41.8 353032 Foggia 159541 Lecce 102344 Taranto 244033 Basilicata 9992 611000 Potenza 15.47 40.4 Calabria 15080 2080000 Catanzaro 16.35 38.55 103802 Cosenza 104483 Messina 274846 Reggio di Calabria 178496 Sicilia 25709 5025000 Palermo 13.2 38.1 734238 Catania 364176 Siracusa 125444 Sardegna 24090 1657000 Cagliari 9.5 39.15 211719 Sassari 120011 Liechtenstein FL 160 31122 1.08 5.3 630 5.4 23 01 1719 hereditary constitutional monarchy 100 5 95 87.3 8.3 37 41 Vaduz 9.3 47.08 27714 Slovakia SK 48845 5374362 0.34 10.7 39000 6.7 47.6 45.7 7.5 01 01 1993 parliamentary democracy 100 0.1 0.1 1.5 10.7 1 85.7 0.3 0.3 60.3 8.4 4.1 91 215 515 444 90 Bratislava Slovenia SLO 20256 1951443 -0.27 7.3 22600 5.3 39.9 54.8 8 25 06 1991 emerging democracy 100 2 91 1 3 1 96 91 7 324 102 235 546 Ljubljana Switzerland CH 41290 7207060 0.59 5.4 158500 3 33.5 63.5 1.8 federal republic 100 47.6 44.3 18 65 12 1 573 164 334 740 41 AG 1403 528887 Aarau AR 242 54104 Herisau AI 172 14750 Appenzell BL 517 252331 Liestal BS 37 195759 Basel 172768 BE 5960 941952 Bern 7.3 46.6 134393 Biel 53308 FR 1670 224552 Fribourg GE 282 395466 Geneva 6.9 46.12 167697 GL 685 39410 Glarus GR 7105 185063 Chur JU 836 69188 Delemont LU 1493 340536 Luzern 59811 NE 803 165258 Neuchatel NW 276 36466 Stans OW 490 31310 Sarnen SG 2025 442350 Sankt Gallen 74106 SH 298 74035 Schaffhausen SZ 908 122409 Schwyz SO 790 239264 Solothurn TG 990 223372 Frauenfeld TI 2812 305199 Bellinzona UR 1076 35876 Altdorf VS 5224 271291 Sion VD 3211 605677 Lausanne 123149 ZG 238 92392 Zug ZH 1728 1175457 Zurich 343106 Winterthur 86340 Belarus BY 207600 10415973 0.2 13.4 49200 21 49 30 244 25 08 1991 republic 100 4.1 2.9 13.2 77.9 60 141 502 605 891 959 Minsk 27.55 53.9 1540000 Latvia LV 64100 2468982 -1.39 21.2 14700 9 31 60 20 06 09 1991 republic 100 2.3 3.4 33.8 4.5 51.8 141 453 217 267 Riga 14.1 57 900000 Lithuania LT 65200 3646041 -0.35 17 13300 20 42 38 35 06 09 1991 republic 100 7.7 8.6 1.5 80.1 502 453 91 227 Vilnius 25.3 54.4 566000 Poland PL 312683 38642565 0.14 12.4 226700 7 38 55 21.6 11 11 1918 democratic state 100 1.3 97.6 0.6 0.5 95 100 658 456 444 605 91 428 206 Warszwaskie 3788 2421000 Warsaw 21.0333 52.2167 1655000 Bialskopodlaskie 5348 306700 Biala Podlaska Bialostockie 10055 697000 Bialystok 268000 Bielskie 3704 911500 Bielsko Biala 180000 Bydgoskie 10349 1120300 Bydgoszcz 380000 Chelmskie 3866 248500 Chelm Ciechanowskie 6362 431400 Ciechanow Czestochowskie 6182 748000 Czestochowa 258000 Elblaskie 6103 483200 Elblag 125000 Gdanskie 7394 1445000 Gdansk 465000 Gdynia 251000 Gorzowskie 8484 505600 Gorzow Wielkopolski 123000 Gorzow Wielkopolskie Jeleniogorskie 4379 519200 Jelenia Gora Kaliskie 6512 715600 Kalisz 106000 Katowickie 6650 4013200 Katowice 367000 Sosnowiec 259000 Bytom 230000 Gliwice 216000 Zabrze 203000 Tychy 190000 Ruda Slaska 170000 Rybnik 143000 Chorzow 133000 Wodzilaw Slaski 111000 Kieleckie 9211 1127700 Kielce 213000 Koninskie 5139 472400 Konin Koszalinskie 8470 513700 Koszalin 108000 Krakowskie 3254 1238100 Krakow 19.95 50.0667 748000 Krosnienskie 5702 500700 Krosno Legnickie 4037 521500 Legnica 104000 Leszczynskie 4154 391500 Leszno Lubelskie 6792 1022600 Lublin 350000 Lomzynskie 6684 349000 Lomza Lodzkie 1523 1132400 Lodz 852000 Nowosadeckie 5576 709500 Nowy Sacz Olsztynskie 12327 761300 Olsztyn 161000 Opolskie 8535 1023800 Opole 128000 Ostroleckie 6498 400500 Ostroleka Pilskie 8205 485700 Pila Piotrkowskie 6266 644200 Piottrkow Trybunalski Plockie 5117 518600 Plock 122000 Poznanskie 8151 1344200 Poznan 589000 Przemyskie 4437 409600 Przemysl Radomskie 7294 755500 Radom 226000 Rzeszowskie 4397 734100 Rzeszow 151000 Siedleckie 8499 655300 Siedlce Sieradzkie 4869 408700 Sieradz Skierniewickie 3960 421700 Skierniewice Slupskie 7453 419300 Slupsk Suwalskie 10490 477100 Suwalki Szczecinskie 9982 979500 Szczecin 412000 Tarnobrzeskie 6283 604300 Tarnobrzeg Tarnowskie 4151 678400 Tarnow 120000 Torunskie 5348 662600 Torun 201000 Grudziadz 101000 Walbrzyskie 4168 740000 Walbrzych 141000 Wloclawskie 4402 430800 Wloclawek 121000 Wroclawskie 6287 1132800 Wroclaw 642000 Zamojskie 6980 490800 Zamosc Zielonogorskie 8868 664700 Zielona Gora 113000 Ukraine UA 603700 50864009 -0.4 22.5 174600 31 43 26 9 01 12 1991 republic 100 73 22 1 103 90 891 428 1576 531 939 Cherkaska 20900 1530900 Cherkasy 297000 Chernihivska 31900 938600 Chernihiv 301000 Chernivetska 8100 1405800 Chernivtsi 257000 Dnipropetrovska 31900 3908700 Dnipropetrovsk 1187000 Kryvyy Rih 717000 Dniprodzerzhynsk 284000 Donetska 26500 5346700 Donetsk 1117000 Mariupol 520000 Makiyivka 427000 Horlivka 338000 Ivano Frankivska 13900 1442900 Ivano Frankivsk 220000 Kharkivska 31400 3194800 Kharkiv 36.2333 50 1618000 Khersonska 28500 1258700 Kherson 361000 Khmelnytska 20600 1520600 Khmelnytskyy 241000 Kyyivska 28900 4589800 Kiev 30.5 50.45 2616000 Kirovohradska 24600 1245300 Kirovohrad 274000 Luhanska 26700 2871100 Luhansk 501000 Lvivska 21800 2764400 Lviv 798000 Mykolayivska 24600 1342400 Mykolayiv 508000 Odeska 33300 2635300 Odesa 30.7333 46.4833 1106000 Poltavska 28800 1756900 Poltava 317000 Kremenchuk 238000 Rivnenska 20100 1176800 Rivne 233000 Sumska 23800 1430200 Sumy 296000 Ternopilska 13800 1175100 Ternopil 212000 Vinnytska 26500 1914400 Vinnytsya 379000 Volynska 20200 1069000 Lutsk 204000 Zakarpatska 12800 1265900 Uzhhorod Zaporizka 27200 2099600 Zaporizhzhya 891000 Zhytomyrska 29900 1510700 Zhytomyr 296000 Krym 27000 2549800 Simferopol 349000 Sevastopol 361000 Russia R 17075200 148178487 -0.07 24.7 796000 6 41 53 7 24 08 1991 federation 20 3 81.5 0.8 3.8 1.2 0.9 0.7 100 959 217 227 206 1576 290 1313 167 Rep. of Karelia 172400 785000 Petrozavodsk 280000 Rep. of Komi 415900 1185500 Syktyvkar 229000 Ukhta 106000 Vorkuta 104000 Arkhangelskaya oblast 587400 1520800 Arkhangelsk 40.5333 64.55 374000 Severodvinsk 241000 Vologodskaya oblast 145700 1349800 Vologda 299000 Cherepovets 320000 Murmanskaya oblast 144900 1048000 Murmansk 407000 Kaliningradskaya oblast 15100 932200 Kaliningrad 20.5 54.7167 419000 Sankt Peterburg 0 4801500 Sankt Peterburg 4838000 Leningradskaya oblast 85900 1675900 Kolpino 143000 Novgorodskaya oblast 55300 742600 Novgorod 233000 Pskovskaya oblast 55300 832300 Pskov 207000 Velikiye Luki 116000 Bryanskaya oblast 34900 1479700 Bryansk 462000 Vladimirskaya oblast 29000 1644700 Vladimir 339000 Kovrov 162000 Murom 126000 Ivanovskaya oblast 23900 1266400 Ivanovo 474000 Kineshma 103000 Kaluzhskaya oblast 29900 1097300 Kaluga 347000 Obninsk 108000 Kostromskaya oblast 60100 805700 Kostroma 285000 Moskva 0 8664400 Moscow 37.6667 55.7667 8717000 Moskovskaya oblast 47000 6596600 Podolsk 202000 Zelenograd 191000 Lyubertsy 166000 Kolomna 154000 Mytishchi 152000 Elektrostal 150000 Serpukhov 139000 Balashikha 136000 Khimki 134000 Odintsovo 129000 Orekhovo Zuyevo 126000 Noginsk 119000 Shchyolkovo 108000 Orlovskaya oblast 24700 914000 Orel 348000 Ryazanskaya oblast 39600 1325300 Ryazan 536000 Smolenskaya oblast 49800 1172400 Smolensk 355000 Tverskaya oblast 84100 1650600 Tver 455000 Tulskaya oblast 25700 1814500 Tula 532000 Novomoskovsk 144000 Yaroslavskaya oblast 36400 1451400 Yaroslavl 629000 Rybinsk 248000 Rep. of Mariy El 23200 766300 Yoshkar Ola 251000 Rep. of Mordovia 26200 955800 Saransk 320000 Chuvash Republic 18300 1360800 Cheboksary 450000 Novocheboksarsk 123000 Kirovskaya oblast 120800 1634500 Kirov 464000 Nizhegorodskaya oblast 74800 3726400 Nizhniy Novgorod 1383000 Dzerzhinsk 285000 Arzamas 112000 Belgorodskaya oblast 27100 1469100 Belgorod 322000 Stary Oskol 198000 Voronezhskaya oblast 52400 2503800 Voronezh 908000 Kurskaya oblast 29800 1346900 Kursk 442000 Lipetskaya oblast 24100 1250200 Lipetsk 474000 Yelets 119000 Tambovskaya oblast 34300 1310600 Tambov 316000 Michurinsk 108000 Rep. of Kalmykiya 76100 318500 Elista Rep. of Tatarstan 68000 3760500 Kazan 1085000 Naberezhnye Chelny 526000 Nizhnekamsk 210000 Almetyevsk 138000 Zelenodolysk 101000 Astrakhanskaya oblast 44100 1028900 Astrakhan 486000 Volgogradskaya oblast 113900 2703700 Volgograd 44.5167 48.7 1003000 Volzhsky 288000 Kamyshin 128000 Penzenskaya oblast 43200 1562300 Penza 534000 Kuznetsk 100000 Samarskaya oblast 53600 3311500 Samara 1184000 Tolyatti 702000 Syzran 177000 Novokuybyshevsk 115000 Saratovskaya oblast 100200 2739500 Saratov 895000 Balakovo 206000 Engels 186000 Ulyanovskaya oblast 37300 1495200 Simbirsk 678000 Dimitrovgrad 135000 Rostovskaya oblast 100800 4426400 Rostov na Donu 1026000 Taganrog 292000 Shakhty 230000 Novocherkassk 190000 Volgodonsk 183000 Novoshakhtinsk 107000 Rostov no Donu Rep. of Bashkortostan 143600 4096600 Ufa 1094000 Sterlitamak 259000 Salavat 156000 Oktyabrsky 110000 Udmurt Republic 42100 1639100 Izhevsk 654000 Sarapul 109000 Glazov 107000 Votkinsk 104000 Orenburgskaya oblast 124000 2228600 Orenburg 532000 Orsk 275000 Novotroitsk 110000 Permskaya oblast 160600 3009400 Perm 1032000 Berezniki 184000 Solikamsk 108000 Rep. of Adygeya 7600 450500 Maykop 165000 Rep. of Dagestan 50300 2097500 Makhachkala 339000 Rep. of Ingushetiya 3750 299700 Nazran Kabardino Balkar Rep. 12500 789900 Nalchik 239000 Karachayevo Cherkessk Rep. 14100 436300 Cherkessk 119000 Rep. of North Ossetiya 8000 662600 Vladikavkaz 312000 Chechen Rep. 12300 865100 Grozny 364000 Krasnodarsky kray 76000 5043900 Krasnodar 646000 Sochi 355000 Novorossiysk 202000 Armavir 164000 Stavropolsky kray 66500 2667000 Stavropol 342000 Pyatigorsk 133000 Nevinnomyssk 131000 Kislovodsk 120000 Neftekamsk 117000 Kurganskaya oblast 71000 1112200 Kurgan 363000 Sverdlovskaya oblast 194300 4686300 Yekaterinburg 1280000 Nizhniy Tagil 409000 Kamensk Uralskiy 197000 Pervouralsk 137000 Serov 100000 Chelyabinskaya oblast 87900 3688700 Chelyabinsk 1086000 Magnitogorsk 427000 Zlatoust 203000 Miass 167000 Rep. of Altay 92600 201600 Gorno Altaysk Altayskiy kray 169100 2690100 Barnaul 596000 Biysk 228000 Rubtsovsk 170000 Kemerovskaya oblast 95500 3063500 Kemerovo 503000 Novokuznetsk 572000 Prokopyevsk 253000 Leninsk Kuznetskiy 121000 Kiselyovsk 116000 Mezhdurechensk 105000 Anzhero Sudzhensk 101000 Novosibirskaya oblast 178200 2748600 Novosibirsk 1369000 Omskaya oblast 139700 2176400 Omsk 1163000 Tomskaya oblast 316900 1077600 Tomsk 470000 Tyumenskaya oblast 1435200 3169900 Tyumen 494000 Surgut 263000 Nizhnevartovsk 238000 Rep. of Buryatiya 351300 1052500 Ulan Ude 366000 Rep. of Tyva 170500 309700 Kyzyl Rep. of Khakassiya 61900 585800 Abakan 161000 Krasnoyarskiy kray 2339700 3105900 Krasnoyarsk 92.95 56.0167 869000 Norilsk 159000 Achinsk 123000 Kansk 109000 Irkutskaya oblast 767900 2795200 Irkutsk 585000 Angarsk 267000 Bratsk 257000 Ust Ilimsk 110000 Usolye Sibirskoye 106000 Chitinskaya oblast 431500 1295000 Chita 322000 Rep. of Sakha 3103200 1022800 Yakutsk 192000 Yevreyskaya avt. oblast 36000 209900 Birobidzhan Chukotsky ao 737700 90500 Anadyr Primorsky kray 165900 2255400 Vladivostok 131.917 43.1167 632000 Nakhodka 163000 Ussuriysk 162000 Khabarovskiy kray 752600 1571200 Khabarovsk 618000 Komsomolsk na Amure 309000 Amurskaya oblast 363700 1037800 Blagoveshchensk 214000 Kamchatskaya oblast 472300 411100 Petropavlovsk Kamchatsky 210000 Magadanskaya oblast 461400 258200 Magadan 128000 Sakhalinskaya oblast 87100 647800 Yuzhno Sakhalinsk 160000 Belgium B 30510 10170241 0.33 6.4 197000 2 28 70 1.6 04 10 1830 constitutional monarchy 100 55 33 75 25 32 1 56 620 167 148 450 Antwerp 2867 1610695 Antwerp 4.23 51.1 459072 Brabant 3358 2253794 Brussels 4.35 50.8 951580 East Flanders 2982 1340056 Ghent 3.5 51.4 227483 Hainaut 3787 1283252 Charleroi 206491 Mons 3.6 50.3 90720 Liege 3862 1006081 Liege 5.5 50.5 192393 Limburg 2422 755593 Hasselt 5.2 50.7 65348 Luxembourg 4441 234664 Arlon 5.5 49.4 23150 Namur 3665 426305 Namur 4.5 50.3 105014 West Flanders 3134 1111557 Bruges 116273 Brugge 2.08 51.1 117799 Luxembourg L 2586 415870 1.57 4.7 10000 1.4 33.7 64.9 3.6 constitutional monarchy 100 97 3 73 138 148 Luxembourg 6.08 49.4 76600 Netherlands NL 37330 15568034 0.56 4.9 301900 3.4 26.9 69.7 2.25 01 01 1579 constitutional monarchy 100 96 3 34 25 100 577 450 Groningen 2344 557995 Groningen 210708 Friesland 3361 609579 Leeuwarden Drenthe 2652 454864 Assen Overijssel 3337 1050389 Enschede 254480 Zwolle Flevoland 1425 262325 Lelystad Gelderland 4995 1864732 Arnhem 314159 Nijmegen 249490 Utrecht 1356 1063460 Utrecht 547070 Noord Holland 265978 2463611 Amsterdam 4.91667 52.3833 1101407 Haarlem 212631 Zaanstreek 147917 Velsen 134973 Hilversum 102023 Zuid Holland 2859 3325064 s Gravenhage 694249 Rotterdam 1078747 Dordrecht 213963 Leiden 194935 Zeeland 1791 365846 Middelburg Noord Brabant 4938 2276207 s Hertogenbosch 199127 Eindhoven 395612 Tilburg 237958 Breda 166616 Limburg 2167 1130050 Maastricht 164701 Heerlen 270952 Geleen 186011 Bosnia and Herzegovina BIH 51233 2656240 -2.84 43.2 1000 01 04 1992 emerging democracy 100 40 38 22 40 4 31 15 99 527 932 Sarajevo Croatia HR 56538 5004112 0.58 10.2 20100 12.7 30.6 56.7 3.7 25 06 1991 parliamentary democracy 100 12 0.5 0.9 78 0.5 0.4 11.1 76.5 1.2 96 266 329 546 932 Zagreb Bulgaria BG 110910 8612757 0.46 15.7 43200 12 36 52 35 22 09 1908 emerging democracy 100 2.5 2.6 0.2 8.5 85.3 0.3 13 0.8 0.5 85 0.2 100 494 148 318 608 240 Sofia 23.3333 42.7 1300000 Romania RO 237500 21657162 -1.21 23.2 105700 19.6 36.3 44.1 25 01 01 1881 republic 100 0.4 1.6 8.9 89.1 6 6 70 476 443 531 608 450 Alba 6231 428000 Alba Iulia Arad 7652 507000 Arad 191000 Arges 6801 678000 Pitesti 162000 Bacau 6606 731000 Bacau 193000 Bihor 7535 660000 Oradea 225000 Bistrita Nasaud 5305 328000 Bistrita Botosani 4965 468000 Botosani Braila 4724 404000 Braila 243000 Brasov 5351 695000 Brasov 353000 Bucuresti 1521 2319000 Bucharest 26.1 44.4167 2037000 Buzau 6072 524000 Buzau 145000 Calarasi 5075 351000 Calarasi Caras Severin 8503 408000 Resita Cluj 6650 743000 Cluj Napoca 318000 Constanta 7055 737000 Constanta 316000 Covasha 3705 238000 Sfintu Gheorghe Dimbovita 4035 570000 Tirgoviste Dolj 7413 772000 Craiova 300000 Galati 4425 642000 Galati 307000 Giurgiu 3810 325000 Giurgiu Gorj 5641 388000 Tirgu Jiu Harghita 6610 363000 Miercurea Ciuc Hunedoara 7016 567000 Deva Ialomita 4449 309000 Slobozia Iasi 5469 810000 Iasi 330000 Maramures 6215 556000 Baia Mare 150000 Mehedinti 4900 329000 Drobeta Turnu Severin Mures 6696 621000 Tirgu Mures 165000 Neamt 5890 580000 Piatra Neamt Olt 5507 535000 Slatina Prahova 4694 877000 Ploiesti Salaj 3850 269000 Zalau Satu Mare 4405 417000 Satu Mare 137000 Sibiu 5422 509000 Sibiu 184000 Suceava 8555 699000 Suceava Teleorman 5760 504000 Alexandria Timis 8692 726000 Timisoara 333000 Tulcea 8430 275000 Tulcea Vaslui 5297 468000 Vaslui Vilcea 5705 430000 Rimnicu Vilcea Vrancea 4863 394000 Focsani Turkey TR 780580 62484478 1.67 43.2 345700 15.5 33.2 51.3 94 29 10 1923 republican parliamentary democracy 32 80 20 99.8 206 240 Adana 17253 1934907 Adana 35.3 36.9833 1047300 Osmaniye 138000 Adiyaman 7614 513131 Adiyaman 128000 Afyon 14230 739223 Afyon Agri 11376 437093 Agri Aksaray 7626 326399 Aksaray Amasya 5520 357191 Amasya Ankara 25706 3236626 Ankara 32.8833 39.95 2782200 Antalya 20591 1132211 Antalya 497200 Artvin 7436 212833 Artvin Aydin 8007 824816 Aydin 121200 Balikesir 14292 973314 Balikesir 187600 Batman 4694 344669 Batman 182800 Bayburt 3652 107330 Bayburt Bilecik 4307 175526 Bilecik Bingol 8125 250966 Bingol Bitlis 6707 330115 Bitlis Bolu 11051 536869 Bolu Burdur 6887 254899 Burdur Bursa 11043 1603137 Bursa 996600 Canakkale 9737 432263 Canakkale Cankiri 8454 279129 Cankiri Corum 12820 609863 Corum Denizli 11868 750882 Denizli 234500 Diyarbakir 15355 1094996 Diyarbakir 448300 Edirne 6276 404599 Edirne 115500 Elazig 9153 498225 Elazig 222800 Erzincan 11903 299251 Erzincan Erzurum 25066 848201 Erzurum 250100 Eskisehir 13652 641057 Eskisehir 451000 Gaziantep 7642 1140594 Gaziantep 716000 Giresun 6934 499087 Giresun Gumushane 6575 169375 Gumushane Hakkari 7121 172479 Hakkari Hatay 5403 1109754 Iskenderun 156800 Antakya 137200 Icel 15853 1266995 Mersin 523000 Tarsus 225000 Isparta 8933 434771 Isparta 120900 Istanbul 5712 7309190 Istanbul 28.8333 40.9667 7615500 Izmir 11973 2694770 Izmir 27.1667 38.4333 1985300 Karaman 9163 217536 Karaman Karamanmaras 14327 892952 Karaman Maras 242200 Kars 18557 662155 Kars Kastamonu 13108 423611 Kastamonu Kayseri 16917 943484 Kayseri 454000 Kirikkale 4365 349396 Kirikkale 170300 Kirklareli 6550 309512 Kirklareli Kirsehir 6570 256862 Kirsehir Kocaeli 3626 936163 Izmit 275800 Kocaeli 256882 Gebze 237300 Adapazari 186000 Konya 38257 1750303 Konya 576000 Kutahya 11875 578020 Kutahya 140700 Malatya 12313 702055 Malatya 319700 Manisa 13810 1154418 Manisa 187500 Mardin 8891 557727 Mardin Mugla 13338 562809 Mugla Mus 8196 376543 Mus Nevsehir 5467 289509 Nevsehir Nigde 7312 305861 Nigde Ordu 6001 830105 Ordu 121300 Rize 3920 348776 Rize Sakarya 4817 683061 Sakarya Samsun 9579 1158400 Samsun 326900 Sanliurfa 18584 1001455 Urfa 357900 Siirt 5406 243435 Siirt Sinop 5862 265153 Sinop Sirnak 7172 262006 Sirnak Sivas 28488 767481 Sivas 240100 Tekirdag 6218 468842 Tekirdag Tokat 9958 719251 Tokat Trabzon 4685 795849 Trabzon 145400 Tunceli 7774 133143 Tunceli Usak 5341 290283 Usak 119900 Van 19069 637433 Van 194600 Yozgat 14123 579150 Yozgat Zonguldak 8629 1073560 Zonguldak 115900 Karabuk 113900 Denmark DK 43070 5249632 0.38 4.8 112800 3 23.5 73.5 2.4 constitutional monarchy 100 91 2 68 Copenhagen 12.55 55.6833 1358540 Aarhus 10.1 56.1 194345 Odense 10.2 55.3 136803 Aalborg 10 57 113865 Esbjerg 8.3 55.3 70975 Randers 10 56.3 55780 Estonia EW 45100 1459428 -1.13 17.4 12300 10 37 53 29 06 09 1991 republic 100 3.2 30.3 1.8 1.1 61.5 267 290 Tallinn 25 59.3 478000 Finland SF 337030 5105230 0.1 4.9 92400 4.6 28 67.4 2 06 12 1917 republic 100 1 89 6.3 93.5 1313 729 586 Aland 23000 Mariehamn 19.5 60.1 9500 Haeme 662000 Haemeenlinna 24.3 61 42000 Tampere 23.5 61.3 170097 Lahti 25.2 60.5 94234 Kuopio 252000 Kuopio 27.4 62.5 78571 Kymi 345000 Kotka 26.5 60.3 58345 Lappeenrenta 26.5 60.5 53922 Lappia 195000 Rovaniemi 24.4 66.3 31000 Mikkeli 209000 Mikkeli 27.2 61.4 28000 Suomi 242000 Jyvaeskylae 25.2 62.1 65511 Pohjols-Karjala 177000 Joensuu 29.5 62.4 44000 Oulu 415000 Oulu 25.2 65.3 97898 Turku-Pori 702000 Turku 22.1 60.3 161292 Pori 21.2 61.3 77763 Uusimaa 1119000 Helsinki 24.95 60.1667 487428 Espoo 24.3 60.2 160480 Vaasa 430000 Vaasa 21.3 63 54275 Norway N 324220 4383807 0.48 4.9 106200 2.9 34.7 62.4 2.5 26 10 1905 constitutional monarchy 100 87.8 3.8 100 167 729 1619 Oslo 449337 Oslo 10.7333 59.9333 449337 Akershus 393217 Oestfold 234941 Moss 10.4 59.3 24517 Hedmark 186355 Hamar 11.5 60.5 15685 Oppland 181791 Lillehammer 10.3 61.1 22118 Buskerud 219967 Drammen 10.1 59.4 50855 Vestfold 191600 Toensberg 10.2 59.2 8984 Telemark 162547 Skien 9.4 59.1 47010 Aust Agder 94688 Arendal 8.4 58.3 12174 Vest Agder 140232 Kristiansand 8 58.1 62640 Rogaland 323365 Stavanger 5.5 59 95089 Hordaland 399702 Bergen 5.2 60.2 207916 Sogn og Fjordane 106116 Hermannsverk 6.5 61.1 706 Moere og Romsdal 237290 Molde 7.1 62.5 21448 Soer Trondelag 246824 Trondheim 10.2 63.3 134426 Nord Trondelag 126692 Steinkjer 11.3 64 20480 Nordland 242268 Bodoe 14.2 67.2 34479 Svolvaer 14.3 68.2 4500 Narvik 17.3 68.3 18754 Troms 146736 Tromsoe 19 69.4 48109 Finnmark 75667 Vadsoe 29.5 70.5 5961 Hammerfest 23.4 70.4 7089 Sweden S 449964 8900954 0.56 4.5 177300 2 27 71 2.6 constitutional monarchy 100 12 1.5 94 1 100 586 1619 Ĭvsborg 11395 444259 Vanersborg Blekinge 2941 151168 Karlskrona 15.3 56.1 59007 Gavleborg 18191 289339 Gavle Goteborg och Bohus 5141 742550 Goteborg 449189 Gotland 3140 57383 Visby 18.2 57.3 20000 Halland 5454 257874 Halmstad 13 56.4 77601 Jamtland 49443 136009 Ostersund Jonkoping 9944 309738 Jonkoping 115429 Kalmar 11170 241883 Kalmar 16.3 56.4 54554 Kopparberg 28194 290388 Falun 15.3 60.3 51900 Kristianstad 6087 291468 Kristianstad 14 56 69941 Kronoberg 8458 178612 Vaxjo Malmohus 4938 786757 Malmo 245699 Helsingborg 114339 Norrbotten 98913 264834 Lulea Orebro 8519 273608 Orebro 119635 Ostergotland 10562 406100 Linkoping 131370 Norrkoping 123795 Skaraborg 7937 278162 Mariestad 13.5 58.4 24255 Sodermanland 6060 256818 Nykoping Stockholm 6488 1654511 Stockholm 18.0667 59.35 711119 Uppsala 6989 273918 Uppsala 17.4 59.5 183472 Varmland 17584 284187 Karlstad 13.3 59.3 74669 Vasterbotten 55401 253835 Umea Vasternorrland 21678 261280 Harnosand Vastmanland 6302 259438 Vasteras 123728 Monaco MC 1.9 31719 0.59 6.9 788 01 01 1419 constitutional monarchy 100 47 16 16 95 4.4 Monaco 7.2 43.7 1234 Holy See V 0.44 840 11 02 1929 monarchical sacerdotal state 100 100 3.2 Vatican City 12.3 41.5 392 Iceland IS 103000 270292 0.83 4.3 5000 9.6 22.1 68.3 2.5 17 06 1944 republic 100 100 96 3 100 Reykjavik 21.9333 64.1333 84000 Keflavik -22.5 64 6600 Hafnarfjoerdur -22 64 12000 Akureyri 18.3 65.4 13000 Ireland IRL 70280 3566833 -0.22 6.4 54600 6.8 35.3 57.9 2.8 06 12 1921 republic 100 93 3 Dublin -6.35 53.3667 502337 San Marino RSM 60 24521 0.82 5.5 380 5.5 01 01 0301 republic 100 100 100 39 San Marino 12.2 43.5 4416 Malta M 320 375576 1.01 6.9 4400 5 21 09 1964 parliamentary democracy 100 98 Valletta 14.2 35.08 9302 Moldova MD 33700 4463847 0.18 47.6 10400 33 36 31 24 27 08 1991 republic 100 13.8 13 1.5 2 3.5 64.5 1.5 98.5 null 939 450 Chisinau 28.1 47.2 663000 Portugal P 92080 9865114 0.02 7.6 116200 6 35.8 58.2 4.6 01 01 1140 republic 100 97 1 100 1214 Aveiro 2808 656000 Beja 10225 167900 Braga 2673 746100 Braga 63033 Braganca 6608 158300 Castelo Branco 6675 214700 Coimbra 3947 427600 Coimbra 74616 Evora 7393 173500 Faro 4960 340100 Guarda 5518 187800 Leiria 3515 427800 Lisbon 2761 2063800 Lisbon -9.13333 38.7167 807937 Amadora 95518 Barreiro 50863 Almada 42607 Portalegre 6065 134300 Porto 2395 1622300 Porto 327368 Vila Nova de Gaia 62468 Santarem 6747 442700 Setubal 5064 713700 Setubal 77885 Viana do Castelo 2255 248700 Vila Real 4328 237100 Viseu 5007 401000 Azores, The 2247 236700 Madeira 794 253000 Funchal 44111 United Kingdom GB 244820 58489975 0.22 6.4 1138400 1.7 27.7 70.6 3.1 01 01 1801 constitutional monarchy 100 81.5 2.4 1.9 9.6 1.8 360 Avon 1346 962000 Bristol 399200 Bedfordshire 1235 534300 Bedford 137300 Luton 178600 Berkshire 1259 752500 Reading 137700 Wokingham 142900 Newbury 141000 Windsor 136700 Slough 103500 Bracknell 101900 Buckinghamshire 1883 640200 Aylesbury 151600 Milton Keynes 184400 Wycombe 161400 Cambridgeshire 3409 669900 Cambridge 113800 Peterborough 156400 Huntingdon 148800 Cheshire 2329 966500 Chester 120800 Warrington 185000 Macclesfield 151400 Crewe 109500 Cleveland 583 557500 Middlesbrough 145800 Stockton on Tees 177800 Cornwall _ Isles of Scilly 3564 475200 Truro Cumbria 6810 489700 Carlisle 102900 Derbyshire 2631 938800 Derby 230500 Sutton in Ashfield 109800 Chesterfield 101200 Matlock Devon 6711 1040000 Plymouth 255800 Exeter 105100 Dorset 2654 662900 Bournemouth 159900 Poole 137200 Dorchester Durham 2436 604300 Darlington 100200 Durham East Sussex 1795 716500 Brighton 154400 Lewes Essex 3672 1548800 Chelmsford 155700 Southend on Sea 167500 Basildon 161700 Colchester 149100 Braintree 121800 Epping Forest 118200 Gloucestershire 2643 538800 Cheltenham 106700 Stroud 105400 Gloucester 104800 Glouchester Greater London 1579 6803100 London 0 51.4833 6967500 Greater Manchester 1287 2561600 Manchester 431100 Wigan 310000 Stockport 291400 Bolton 265200 Salford 230700 Tameside 221800 Oldham 220400 Trafford 218100 Rochdale 207100 Bury 181400 Hampshire 3777 1578700 Winchester 100500 Southampton 211700 Portsmouth 189100 Basingstoke 146500 Havant 117500 Eastleigh 109600 Fareham 101000 Hereford and Worcester 3927 696000 Worcester Hertfordshire 1634 989500 Saint Albans 127700 Hertford Humberside 3512 874400 Kingston upon Hull 269100 Beverley 115800 Hull Isle of Wight 381 126600 Kent 3731 1538800 Maidstone 138500 Rochester upon Medway 148200 Canterbury 132400 Swale 117200 Sevenoaks 109400 Dover 106100 Tonbridge 102100 Tunbridge Wells 101800 Lancashire 3064 1408300 Preston 132200 Blackpool 153600 Blackburn 139500 Lancaster 133600 Leicestershire 2553 890800 Leicester 293400 Leichester Lincolnshire 5915 592600 Lincoln Merseyside 652 1441100 Liverpool 474000 Wiral 331100 Sefton 292400 Saint Helens 180200 Knowsley 155300 Norfolk 5368 759400 Norwich 128100 Kings Lynn 131600 Northamptonshire 2367 587100 Northampton 187200 Northumberland 5032 307100 North Yorkshire 8309 720900 Harrogate 146500 Scarborough 108700 York 104000 Northallerton Nottinghamshire 2164 1015500 Nottingham 282400 Newark on Trent 104400 Mansfield 102100 Oxfordshire 2608 597700 Oxford 132000 Shropshire 3490 412500 Shrewsbury Somerset 3451 469400 Taunton South Yorkshire 1560 1292700 Barnsley 226500 Sheffield 530100 Doncaster 292500 Rotherham 256300 Staffordshire 2716 1047400 Stafford 121500 Stoke on Trent 254200 Newcastle under Lyme 123000 Suffolk 3797 661900 Ipswich 114800 Surrey 1679 1035500 Guildford 126200 Reigate 118800 Elmbridge 117300 Kingston Tyne and Wear 540 1125600 Sunderland 292200 Newcastle upon Tyne 283600 Gateshead 202400 Newcastle Warwickshire 1981 489900 Warwick 118600 Nuneaton 118500 Stratford on Avon 108600 West Midlands 899 2619000 Birmingham -1.93333 52.4833 1008400 Dudley 312200 Coventry 302500 Walsall 263900 Wolverhampton 245100 Solihull 202000 West Bromwich 154500 West Sussex 1989 713600 Chichester 102500 Horsham 112300 West Yorkshire 2039 2066200 Wakefield 317300 Leeds 724400 Bradford 481700 Kirklees 386900 Huddersfield 148500 Wiltshire 3480 575100 Salisbury 109800 Trowbridge Borders 4698 105700 Newtown St. Boswells Central 2700 273400 Stirling Dumfries and Galloway 6425 147800 Dumfries Fife 1319 352100 Glenrothes Grampian 8752 532500 Aberdeen 219100 Highland 26137 207500 Inverness Lothian 1770 758600 Edinburgh -3.18333 55.9167 447600 Strathclyde 13773 2287800 Glasgow -4.28333 55.8667 674800 Renfrew 201700 Tayside 7643 395000 Dundee 167600 Island Areas (munic.) 5566 72000 Island Areas Aberconwy and Colwyn 1130 110700 Colwyn Bay Anglesey 719 68500 Llangefni Blaenau Gwent 109 73300 Ebbw Vale Bridgend 246 130900 Bridgend Caerphilly 279 171000 Ystrad Fawr Cardiff 139 306600 Cardiff -3.16667 51.4667 300000 Carmarthenshire 2398 169000 Carmarthen Ceredigion 1797 69700 Aberystwyth Denbighshire 844 91300 Ruthin Flintshire 437 145300 Mold Gwynedd 2548 117000 Caernarfon Merthyr Tydfil 111 59500 Merthyr Tydfil Monmouthshire 851 84200 Cwmbran Neath and Port Talbot 441 140100 Port Talbot Newport 191 137400 Newport 137000 Pembrokeshire 1590 113600 Haverfordwest Powys 5204 121800 Llandrindod Wells Rhondda Cynon Taff 424 239000 Rhondda Swansea 378 230900 Swansea 189300 Torfaen 126 90600 Pontypool Vale of Glamorgan 337 119200 Rhymney Valley 104300 Barry Wrexham 499 123500 Wrexham Northern Ireland 14120 1594400 Belfast -5.91667 54.6 297100 Cyprus CY 9250 744609 1.11 8.4 7800 5.6 24.9 69.5 16 08 1960 republic 100 18 78 Nicosia 33.2 35.4 161100 Europe 9562488 Agency for Cultural and Technical Cooperation ACCT 21 03 1970 Bank for International Settlements BIS 20 01 1930 Benelux Economic Union Benelux 03 02 1958 Central European Initiative CEI 27 07 1991 Commonwealth C 31 12 1931 Commonwealth of Independent States CIS 08 12 1991 Council of Europe CE 05 05 1949 Customs Cooperation Council CCC 15 12 1950 Economic Commission for Europe ECE 28 03 1947 European Bank for Reconstruction and Development EBRD 15 04 1991 European Free Trade Association EFTA 04 01 1960 European Investment Bank EIB 25 03 1957 European Organization for Nuclear Research CERN 01 07 1953 European Space Agency ESA 31 07 1973 European Union EU 07 02 1992 Food and Agriculture Organization FAO 16 10 1945 Franc Zone FZ 20 12 1945 Group of 10 G-10 01 10 1962 International Atomic Energy Agency IAEA 26 10 1956 International Chamber of Commerce ICC 01 01 1919 International Confederation of Free Trade Unions ICFTU 01 12 1949 International Criminal Police Organization Interpol 13 06 1956 International Energy Agency IEA 15 11 1974 International Federation of Red Cross and Red Crescent Societies IFRCS 05 05 1919 International Fund for Agricultural Development IFAD 01 11 1974 International Labor Organization ILO 11 04 1919 International Maritime Organization IMO 17 03 1958 International Mobile Satellite Organization Inmarsat 03 09 1976 International Olympic Committee IOC 23 06 1894 International Organization for Migration IOM 05 12 1951 International Organization for Standardization ISO 01 02 1947 International Red Cross and Red Crescent Movement ICRM 01 01 1928 International Telecommunication Union ITU 09 12 1932 Nordic Council NC 16 03 1952 Nordic Investment Bank NIB 04 12 1975 North Atlantic Cooperation Council ANC 08 11 1991 North Atlantic Treaty Organization NATO 17 09 1949 Nuclear Suppliers Group NSG Organization for Economic Cooperation and Development OECD 14 12 1960 Organization for Security and Cooperation in Europe OSCE 01 01 1995 United Nations Conference on Trade and Development UNCTAD 30 12 1964 United Nations Educational, Scientific, and Cultural Organization UNESCO 16 11 1945 United Nations Industrial Development Organization UNIDO 17 11 1966 United Nations Office of the High Commissioner for Refugees UNHCR 03 12 1949 United Nations Relief and Works Agency for Palestine Refugees in the Near East UNRWA 08 12 1949 Universal Postal Union UPU 09 10 1874 Western European Union WEU 23 10 1954 World Confederation of Labor WCL 19 06 1920 World Federation of Trade Unions WFTU 03 10 1945 World Health Organization WHO 22 07 1946 World Intellectual Property Organization WIPO 14 07 1967 World Meteorological Organization WMO 11 10 1947 World Tourism Organization WToO 02 01 1975 Jezerce 19.4 42.3 2694 Korab 20.3 41.4 2751 Kebnekaise 18.3 67.5 2114 Sarektjokko 17.4 67.3 2090 Portefjaellen 17.4 67.1 2021 Tarrekaise 17.3 67 1850 Sulitjelma 16.2 67.1 1914 Galdhoeppig 8 61.4 2469 Jostedalsbre 5.5 61.4 2083 Glittertind 8.1 61.4 2452 Joekul 7.2 60.3 1876 Snoehetta 9 62.1 2286 Elbrus 42.26 43.21 5642 Kasbek 44.31 42.42 5033 Bjelucha 86.4 49.48 4506 Oeraefajoekull -17 64.1 2119 Snoefell -15.2 64.5 1833 Haltiatunturi 21.4 67 1328 Feldberg 7.5 47.5 1493 Grosser Arber 13 49.1 1456 Zugspitze 11.1 47.3 2963 Grossglockner 12.5 47 3797 Montblanc 6 45 4807 776 Seine North Sea 200 2850 Donau Black Sea 2211 1020 Western Dwina Baltic Sea 459 1068 Weichsel 2201 Dnepr 346 Thames 1364 Kura Caspian Sea 424200 1010 Loire Atlantic Ocean 9219 650 Garonne 812 Rhone Mediterranean Sea 5121 477 Weser 1144 Elbe 1320 Rhein Bodensee 538.5 347 Klaraelv Vaenern 5546 435 Moldau 93 Goetaaelv Umeaelv Ounasjoki 520 Kemijoki Oulujoki 169 Kokemaeenjoki 740 Northern Dwina Arctic Ocean 5220 4130 Jenissej 3531 Volga 74 Neva White Drin Drin 133 Black Drin 230 Thjorsa 206 Joekulsa a Fjoellum Norwegian Sea 3860 Oesterdalaelv 520 Dalaelv Vaesterdalaelv 375 Torneaelv 598 Gloma 4400 Lena 3680 Ob 2918 Amur 1809 Petschora 2513 Kolyma 1636 Chatanga 688 Bija 306 Katun 4248 Irtysch 1591 Tobol 2450 Ischim 560 Schilka 1620 Argun 708 Ingoda 1032 Onon 200 Ajan-Jurjach 300 Kulu 605 Grosser Jenissej 680 Kleiner Jenissej 562 Suchona 574 Jug 1480 Oka 1870 Don Sea of Azov 100 2428 Ural 292 Werra 218 Fulda Pacific Ocean 11034 Irish Sea 272 Sea of Japan 4036 Maelaren 1140 Vaettern 1900 Lake Kalla 900 Lake Saima 1460 Paeijaenne 1090 Lake Ori 200 Mjoesen 368 Lake Naesi 250 Lake Skutari 300 Ozero Baikal 31500 Lake Prespa 285 Lake Ohrid 367 Ozero Ladoga 18400 Ozero Onega 9610 Ozero Taimyr 4560 Ozero Chanka 4400 Ozero Pskovskoje 3550 Ozero Tschany 2500 Inari 1085 Lago di Garda 370 Arresee 40.2 Lac Leman 581 Lago Maggiore 216 Lago di Como 146 tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.3.dtd0000644000175000001440000000013213325450307017260 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.3.dtd0000644000175000001440000000002013325450307016466 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/REC-xslt-19991116.xml0000644000175000001440000000013213325450307020551 xustar000000000000000030 mtime=1532383431.441385797 30 atime=1532383431.499385624 30 ctime=1532383431.441385797 tdom-0.9.1/tests/data/REC-xslt-19991116.xml0000644000175000001440000074326713325450307020012 0ustar00rolfusers00000000000000 ]>
XSL Transformations (XSLT) Version 1.0 &LEV;-xslt-&YYYYMMDD; W3C Recommendation &day;&month;&year; http://www.w3.org/TR/&year;/&LEV;-xslt-&YYYYMMDD; XML HTML http://www.w3.org/TR/xslt http://www.w3.org/TR/1999/PR-xslt-19991008 http://www.w3.org/1999/08/WD-xslt-19990813 http://www.w3.org/1999/07/WD-xslt-19990709 http://www.w3.org/TR/1999/WD-xslt-19990421 http://www.w3.org/TR/1998/WD-xsl-19981216 http://www.w3.org/TR/1998/WD-xsl-19980818 James Clark jjc@jclark.com

This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from other documents. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

The list of known errors in this specification is available at http://www.w3.org/&year;/&MM;/&LEV;-xslt-&YYYYMMDD;-errata.

Comments on this specification may be sent to xsl-editors@w3.org; archives of the comments are available. Public discussion of XSL, including XSL Transformations, takes place on the XSL-List mailing list.

The English version of this specification is the only normative version. However, for translations of this document, see http://www.w3.org/Style/XSL/translations.html.

A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR.

This specification has been produced as part of the W3C Style activity.

This specification defines the syntax and semantics of XSLT, which is a language for transforming XML documents into other XML documents.

XSLT is designed for use as part of XSL, which is a stylesheet language for XML. In addition to XSLT, XSL includes an XML vocabulary for specifying formatting. XSL specifies the styling of an XML document by using XSLT to describe how the document is transformed into another XML document that uses the formatting vocabulary.

XSLT is also designed to be used independently of XSL. However, XSLT is not intended as a completely general-purpose XML transformation language. Rather it is designed primarily for the kinds of transformations that are needed when XSLT is used as part of XSL.

English EBNF See RCS log for revision history.
Introduction

This specification defines the syntax and semantics of the XSLT language. A transformation in the XSLT language is expressed as a well-formed XML document conforming to the Namespaces in XML Recommendation , which may include both elements that are defined by XSLT and elements that are not defined by XSLT. XSLT-defined elements are distinguished by belonging to a specific XML namespace (see ), which is referred to in this specification as the XSLT namespace. Thus this specification is a definition of the syntax and semantics of the XSLT namespace.

A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.

A transformation expressed in XSLT is called a stylesheet. This is because, in the case when XSLT is transforming into the XSL formatting vocabulary, the transformation functions as a stylesheet.

This document does not specify how an XSLT stylesheet is associated with an XML document. It is recommended that XSL processors support the mechanism described in . When this or any other mechanism yields a sequence of more than one XSLT stylesheet to be applied simultaneously to a XML document, then the effect should be the same as applying a single stylesheet that imports each member of the sequence in order (see ).

A stylesheet contains a set of template rules. A template rule has two parts: a pattern which is matched against nodes in the source tree and a template which can be instantiated to form part of the result tree. This allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures.

A template is instantiated for a particular source element to create part of the result tree. A template can contain elements that specify literal result element structure. A template can also contain elements from the XSLT namespace that are instructions for creating result tree fragments. When a template is instantiated, each instruction is executed and replaced by the result tree fragment that it creates. Instructions can select and process descendant source elements. Processing a descendant element creates a result tree fragment by finding the applicable template rule and instantiating its template. Note that elements are only processed when they have been selected by the execution of an instruction. The result tree is constructed by finding the template rule for the root node and instantiating its template.

In the process of finding the applicable template rule, more than one template rule may have a pattern that matches a given element. However, only one template rule will be applied. The method for deciding which template rule to apply is described in .

A single template by itself has considerable power: it can create structures of arbitrary complexity; it can pull string values out of arbitrary locations in the source tree; it can generate structures that are repeated according to the occurrence of elements in the source tree. For simple transformations where the structure of the result tree is independent of the structure of the source tree, a stylesheet can often consist of only a single template, which functions as a template for the complete result tree. Transformations on XML documents that represent data are often of this kind (see ). XSLT allows a simplified syntax for such stylesheets (see ).

When a template is instantiated, it is always instantiated with respect to a current node and a current node list. The current node is always a member of the current node list. Many operations in XSLT are relative to the current node. Only a few instructions change the current node list or the current node (see and ); during the instantiation of one of these instructions, the current node list changes to a new list of nodes and each member of this new list becomes the current node in turn; after the instantiation of the instruction is complete, the current node and current node list revert to what they were before the instruction was instantiated.

XSLT makes use of the expression language defined by for selecting elements for processing, for conditional processing and for generating text.

XSLT provides two hooks for extending the language, one hook for extending the set of instruction elements used in templates and one hook for extending the set of functions used in XPath expressions. These hooks are both based on XML namespaces. This version of XSLT does not define a mechanism for implementing the hooks. See .

The XSL WG intends to define such a mechanism in a future version of this specification or in a separate specification.

The element syntax summary notation used to describe the syntax of XSLT-defined elements is described in .

The MIME media types text/xml and application/xml should be used for XSLT stylesheets. It is possible that a media type will be registered specifically for XSLT stylesheets; if and when it is, that media type may also be used.

Stylesheet Structure XSLT Namespace

The XSLT namespace has the URI &XSLT.ns;.

The 1999 in the URI indicates the year in which the URI was allocated by the W3C. It does not indicate the version of XSLT being used, which is specified by attributes (see and ).

XSLT processors must use the XML namespaces mechanism to recognize elements and attributes from this namespace. Elements from the XSLT namespace are recognized only in the stylesheet not in the source document. The complete list of XSLT-defined elements is specified in . Vendors must not extend the XSLT namespace with additional elements or attributes. Instead, any extension must be in a separate namespace. Any namespace that is used for additional instruction elements must be identified by means of the extension element mechanism specified in .

This specification uses a prefix of xsl: for referring to elements in the XSLT namespace. However, XSLT stylesheets are free to use any prefix, provided that there is a namespace declaration that binds the prefix to the URI of the XSLT namespace.

An element from the XSLT namespace may have any attribute not from the XSLT namespace, provided that the expanded-name of the attribute has a non-null namespace URI. The presence of such attributes must not change the behavior of XSLT elements and functions defined in this document. Thus, an XSLT processor is always free to ignore such attributes, and must ignore such attributes without giving an error if it does not recognize the namespace URI. Such attributes can provide, for example, unique identifiers, optimization hints, or documentation.

It is an error for an element from the XSLT namespace to have attributes with expanded-names that have null namespace URIs (i.e. attributes with unprefixed names) other than attributes defined for the element in this document.

The conventions used for the names of XSLT elements, attributes and functions are that names are all lower-case, use hyphens to separate words, and use abbreviations only if they already appear in the syntax of a related language such as XML or HTML.

Stylesheet Element

A stylesheet is represented by an xsl:stylesheet element in an XML document. xsl:transform is allowed as a synonym for xsl:stylesheet.

An xsl:stylesheet element must have a version attribute, indicating the version of XSLT that the stylesheet requires. For this version of XSLT, the value should be 1.0. When the value is not equal to 1.0, forwards-compatible processing mode is enabled (see ).

The xsl:stylesheet element may contain the following types of elements:

xsl:import

xsl:include

xsl:strip-space

xsl:preserve-space

xsl:output

xsl:key

xsl:decimal-format

xsl:namespace-alias

xsl:attribute-set

xsl:variable

xsl:param

xsl:template

An element occurring as a child of an xsl:stylesheet element is called a top-level element.

This example shows the structure of a stylesheet. Ellipses (...) indicate where attribute values or content have been omitted. Although this example shows one of each type of allowed element, stylesheets may contain zero or more of each of these elements.

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;"> ... ... ... ... ... ]]>

The order in which the children of the xsl:stylesheet element occur is not significant except for xsl:import elements and for error recovery. Users are free to order the elements as they prefer, and stylesheet creation tools need not provide control over the order in which the elements occur.

In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace, provided that the expanded-name of the element has a non-null namespace URI. The presence of such top-level elements must not change the behavior of XSLT elements and functions defined in this document; for example, it would not be permitted for such a top-level element to specify that xsl:apply-templates was to use different rules to resolve conflicts. Thus, an XSLT processor is always free to ignore such top-level elements, and must ignore a top-level element without giving an error if it does not recognize the namespace URI. Such elements can provide, for example,

information used by extension elements or extension functions (see ),

information about what to do with the result tree,

information about how to obtain the source tree,

metadata about the stylesheet,

structured documentation for the stylesheet.

Literal Result Element as Stylesheet

A simplified syntax is allowed for stylesheets that consist of only a single template for the root node. The stylesheet may consist of just a literal result element (see ). Such a stylesheet is equivalent to a stylesheet with an xsl:stylesheet element containing a template rule containing the literal result element; the template rule has a match pattern of /. For example

<html xsl:version="1.0" xmlns:xsl="&XSLT.ns;" xmlns="&XHTML.ns;"> Expense Report Summary

Total Amount:

]]>

has the same meaning as

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" xmlns="&XHTML.ns;"> Expense Report Summary

Total Amount:

]]>

A literal result element that is the document element of a stylesheet must have an xsl:version attribute, which indicates the version of XSLT that the stylesheet requires. For this version of XSLT, the value should be 1.0; the value must be a Number. Other literal result elements may also have an xsl:version attribute. When the xsl:version attribute is not equal to 1.0, forwards-compatible processing mode is enabled (see ).

The allowed content of a literal result element when used as a stylesheet is no different from when it occurs within a stylesheet. Thus, a literal result element used as a stylesheet cannot contain top-level elements.

In some situations, the only way that a system can recognize that an XML document needs to be processed by an XSLT processor as an XSLT stylesheet is by examining the XML document itself. Using the simplified syntax makes this harder.

For example, another XML language (AXL) might also use an axl:version on the document element to indicate that an XML document was an AXL document that required processing by an AXL processor; if a document had both an axl:version attribute and an xsl:version attribute, it would be unclear whether the document should be processed by an XSLT processor or an AXL processor.

Therefore, the simplified syntax should not be used for XSLT stylesheets that may be used in such a situation. This situation can, for example, arise when an XSLT stylesheet is transmitted as a message with a MIME media type of text/xml or application/xml to a recipient that will use the MIME media type to determine how the message is processed.

Qualified Names

The name of an internal XSLT object, specifically a named template (see ), a mode (see ), an attribute set (see ), a key (see ), a decimal-format (see ), a variable or a parameter (see ) is specified as a QName. If it has a prefix, then the prefix is expanded into a URI reference using the namespace declarations in effect on the attribute in which the name occurs. The expanded-name consisting of the local part of the name and the possibly null URI reference is used as the name of the object. The default namespace is not used for unprefixed names.

Forwards-Compatible Processing

An element enables forwards-compatible mode for itself, its attributes, its descendants and their attributes if either it is an xsl:stylesheet element whose version attribute is not equal to 1.0, or it is a literal result element that has an xsl:version attribute whose value is not equal to 1.0, or it is a literal result element that does not have an xsl:version attribute and that is the document element of a stylesheet using the simplified syntax (see ). A literal result element that has an xsl:version attribute whose value is equal to 1.0 disables forwards-compatible mode for itself, its attributes, its descendants and their attributes.

If an element is processed in forwards-compatible mode, then:

if it is a top-level element and XSLT 1.0 does not allow such elements as top-level elements, then the element must be ignored along with its content;

if it is an element in a template and XSLT 1.0 does not allow such elements to occur in templates, then if the element is not instantiated, an error must not be signaled, and if the element is instantiated, the XSLT must perform fallback for the element as specified in ;

if the element has an attribute that XSLT 1.0 does not allow the element to have or if the element has an optional attribute with a value that the XSLT 1.0 does not allow the attribute to have, then the attribute must be ignored.

Thus, any XSLT 1.0 processor must be able to process the following stylesheet without error, although the stylesheet includes elements from the XSLT namespace that are not defined in this specification:

<xsl:stylesheet version="1.1" xmlns:xsl="&XSLT.ns;"> XSLT 1.1 required

Sorry, this stylesheet requires XSLT 1.1.

]]>

If a stylesheet depends crucially on a top-level element introduced by a version of XSL after 1.0, then the stylesheet can use an xsl:message element with terminate="yes" (see ) to ensure that XSLT processors implementing earlier versions of XSL will not silently ignore the top-level element. For example,

<xsl:stylesheet version="1.5" xmlns:xsl="&XSLT.ns;"> Sorry, this stylesheet requires XSLT 1.1. ... ... ]]>

If an expression occurs in an attribute that is processed in forwards-compatible mode, then an XSLT processor must recover from errors in the expression as follows:

if the expression does not match the syntax allowed by the XPath grammar, then an error must not be signaled unless the expression is actually evaluated;

if the expression calls a function with an unprefixed name that is not part of the XSLT library, then an error must not be signaled unless the function is actually called;

if the expression calls a function with a number of arguments that XSLT does not allow or with arguments of types that XSLT does not allow, then an error must not be signaled unless the function is actually called.

Combining Stylesheets

XSLT provides two mechanisms to combine stylesheets:

an inclusion mechanism that allows stylesheets to be combined without changing the semantics of the stylesheets being combined, and an import mechanism that allows stylesheets to override each other. Stylesheet Inclusion

An XSLT stylesheet may include another XSLT stylesheet using an xsl:include element. The xsl:include element has an href attribute whose value is a URI reference identifying the stylesheet to be included. A relative URI is resolved relative to the base URI of the xsl:include element (see ).

The xsl:include element is only allowed as a top-level element.

The inclusion works at the XML tree level. The resource located by the href attribute value is parsed as an XML document, and the children of the xsl:stylesheet element in this document replace the xsl:include element in the including document. The fact that template rules or definitions are included does not affect the way they are processed.

The included stylesheet may use the simplified syntax described in . The included stylesheet is treated the same as the equivalent xsl:stylesheet element.

It is an error if a stylesheet directly or indirectly includes itself.

Including a stylesheet multiple times can cause errors because of duplicate definitions. Such multiple inclusions are less obvious when they are indirect. For example, if stylesheet B includes stylesheet A, stylesheet C includes stylesheet A, and stylesheet D includes both stylesheet B and stylesheet C, then A will be included indirectly by D twice. If all of B, C and D are used as independent stylesheets, then the error can be avoided by separating everything in B other than the inclusion of A into a separate stylesheet B' and changing B to contain just inclusions of B' and A, similarly for C, and then changing D to include A, B', C'.

Stylesheet Import

An XSLT stylesheet may import another XSLT stylesheet using an xsl:import element. Importing a stylesheet is the same as including it (see ) except that definitions and template rules in the importing stylesheet take precedence over template rules and definitions in the imported stylesheet; this is described in more detail below. The xsl:import element has an href attribute whose value is a URI reference identifying the stylesheet to be imported. A relative URI is resolved relative to the base URI of the xsl:import element (see ).

The xsl:import element is only allowed as a top-level element. The xsl:import element children must precede all other element children of an xsl:stylesheet element, including any xsl:include element children. When xsl:include is used to include a stylesheet, any xsl:import elements in the included document are moved up in the including document to after any existing xsl:import elements in the including document.

For example,

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;"> italic ]]>

The xsl:stylesheet elements encountered during processing of a stylesheet that contains xsl:import elements are treated as forming an import tree. In the import tree, each xsl:stylesheet element has one import child for each xsl:import element that it contains. Any xsl:include elements are resolved before constructing the import tree. An xsl:stylesheet element in the import tree is defined to have lower import precedence than another xsl:stylesheet element in the import tree if it would be visited before that xsl:stylesheet element in a post-order traversal of the import tree (i.e. a traversal of the import tree in which an xsl:stylesheet element is visited after its import children). Each definition and template rule has import precedence determined by the xsl:stylesheet element that contains it.

For example, suppose

stylesheet A imports stylesheets B and C in that order;

stylesheet B imports stylesheet D;

stylesheet C imports stylesheet E.

Then the order of import precedence (lowest first) is D, B, E, C, A.

Since xsl:import elements are required to occur before any definitions or template rules, an implementation that processes imported stylesheets at the point at which it encounters the xsl:import element will encounter definitions and template rules in increasing order of import precedence.

In general, a definition or template rule with higher import precedence takes precedence over a definition or template rule with lower import precedence. This is defined in detail for each kind of definition and for template rules.

It is an error if a stylesheet directly or indirectly imports itself. Apart from this, the case where a stylesheet with a particular URI is imported in multiple places is not treated specially. The import tree will have a separate xsl:stylesheet for each place that it is imported.

If xsl:apply-imports is used (see ), the behavior may be different from the behavior if the stylesheet had been imported only at the place with the highest import precedence.

Embedding Stylesheets

Normally an XSLT stylesheet is a complete XML document with the xsl:stylesheet element as the document element. However, an XSLT stylesheet may also be embedded in another resource. Two forms of embedding are possible:

the XSLT stylesheet may be textually embedded in a non-XML resource, or the xsl:stylesheet element may occur in an XML document other than as the document element.

To facilitate the second form of embedding, the xsl:stylesheet element is allowed to have an ID attribute that specifies a unique identifier.

In order for such an attribute to be used with the XPath id function, it must actually be declared in the DTD as being an ID.

The following example shows how the xml-stylesheet processing instruction can be used to allow a document to contain its own stylesheet. The URI reference uses a relative URI with a fragment identifier to locate the xsl:stylesheet element:

xmlns:xsl="&XSLT.ns;" xmlns:fo="&XSLFO.ns;"> ... ]]>

A stylesheet that is embedded in the document to which it is to be applied or that may be included or imported into an stylesheet that is so embedded typically needs to contain a template rule that specifies that xsl:stylesheet elements are to be ignored.

Data Model

The data model used by XSLT is the same as that used by XPath with the additions described in this section. XSLT operates on source, result and stylesheet documents using the same data model. Any two XML documents that have the same tree will be treated the same by XSLT.

Processing instructions and comments in the stylesheet are ignored: the stylesheet is treated as if neither processing instruction nodes nor comment nodes were included in the tree that represents the stylesheet.

Root Node Children

The normal restrictions on the children of the root node are relaxed for the result tree. The result tree may have any sequence of nodes as children that would be possible for an element node. In particular, it may have text node children, and any number of element node children. When written out using the XML output method (see ), it is possible that a result tree will not be a well-formed XML document; however, it will always be a well-formed external general parsed entity.

When the source tree is created by parsing a well-formed XML document, the root node of the source tree will automatically satisfy the normal restrictions of having no text node children and exactly one element child. When the source tree is created in some other way, for example by using the DOM, the usual restrictions are relaxed for the source tree as for the result tree.

Base URI

Every node also has an associated URI called its base URI, which is used for resolving attribute values that represent relative URIs into absolute URIs. If an element or processing instruction occurs in an external entity, the base URI of that element or processing instruction is the URI of the external entity; otherwise, the base URI is the base URI of the document. The base URI of the document node is the URI of the document entity. The base URI for a text node, a comment node, an attribute node or a namespace node is the base URI of the parent of the node.

Unparsed Entities

The root node has a mapping that gives the URI for each unparsed entity declared in the document's DTD. The URI is generated from the system identifier and public identifier specified in the entity declaration. The XSLT processor may use the public identifier to generate a URI for the entity instead of the URI specified in the system identifier. If the XSLT processor does not use the public identifier to generate the URI, it must use the system identifier; if the system identifier is a relative URI, it must be resolved into an absolute URI using the URI of the resource containing the entity declaration as the base URI .

Whitespace Stripping

After the tree for a source document or stylesheet document has been constructed, but before it is otherwise processed by XSLT, some text nodes are stripped. A text node is never stripped unless it contains only whitespace characters. Stripping the text node removes the text node from the tree. The stripping process takes as input a set of element names for which whitespace must be preserved. The stripping process is applied to both stylesheets and source documents, but the set of whitespace-preserving element names is determined differently for stylesheets and for source documents.

A text node is preserved if any of the following apply:

The element name of the parent of the text node is in the set of whitespace-preserving element names.

The text node contains at least one non-whitespace character. As in XML, a whitespace character is #x20, #x9, #xD or #xA.

An ancestor element of the text node has an xml:space attribute with a value of preserve, and no closer ancestor element has xml:space with a value of default.

Otherwise, the text node is stripped.

The xml:space attributes are not stripped from the tree.

This implies that if an xml:space attribute is specified on a literal result element, it will be included in the result.

For stylesheets, the set of whitespace-preserving element names consists of just xsl:text.

For source documents, the set of whitespace-preserving element names is specified by xsl:strip-space and xsl:preserve-space top-level elements. These elements each have an elements attribute whose value is a whitespace-separated list of NameTests. Initially, the set of whitespace-preserving element names contains all element names. If an element name matches a NameTest in an xsl:strip-space element, then it is removed from the set of whitespace-preserving element names. If an element name matches a NameTest in an xsl:preserve-space element, then it is added to the set of whitespace-preserving element names. An element matches a NameTest if and only if the NameTest would be true for the element as an XPath node test. Conflicts between matches to xsl:strip-space and xsl:preserve-space elements are resolved the same way as conflicts between template rules (see ). Thus, the applicable match for a particular element name is determined as follows:

First, any match with lower import precedence than another match is ignored.

Next, any match with a NameTest that has a lower default priority than the default priority of the NameTest of another match is ignored.

It is an error if this leaves more than one match. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing, from amongst the matches that are left, the one that occurs last in the stylesheet.

Expressions

XSLT uses the expression language defined by XPath . Expressions are used in XSLT for a variety of purposes including:

selecting nodes for processing; specifying conditions for different ways of processing a node; generating text to be inserted in the result tree.

An expression must match the XPath production Expr.

Expressions occur as the value of certain attributes on XSLT-defined elements and within curly braces in attribute value templates.

In XSLT, an outermost expression (i.e. an expression that is not part of another expression) gets its context as follows:

the context node comes from the current node

the context position comes from the position of the current node in the current node list; the first position is 1

the context size comes from the size of the current node list

the variable bindings are the bindings in scope on the element which has the attribute in which the expression occurs (see )

the set of namespace declarations are those in scope on the element which has the attribute in which the expression occurs; this includes the implicit declaration of the prefix xml required by the the XML Namespaces Recommendation ; the default namespace (as declared by xmlns) is not part of this set

the function library consists of the core function library together with the additional functions defined in and extension functions as described in ; it is an error for an expression to include a call to any other function

Template Rules Processing Model

A list of source nodes is processed to create a result tree fragment. The result tree is constructed by processing a list containing just the root node. A list of source nodes is processed by appending the result tree structure created by processing each of the members of the list in order. A node is processed by finding all the template rules with patterns that match the node, and choosing the best amongst them; the chosen rule's template is then instantiated with the node as the current node and with the list of source nodes as the current node list. A template typically contains instructions that select an additional list of source nodes for processing. The process of matching, instantiation and selection is continued recursively until no new source nodes are selected for processing.

Implementations are free to process the source document in any way that produces the same result as if it were processed using this processing model.

Patterns

Template rules identify the nodes to which they apply by using a pattern. As well as being used in template rules, patterns are used for numbering (see ) and for declaring keys (see ). A pattern specifies a set of conditions on a node. A node that satisfies the conditions matches the pattern; a node that does not satisfy the conditions does not match the pattern. The syntax for patterns is a subset of the syntax for expressions. In particular, location paths that meet certain restrictions can be used as patterns. An expression that is also a pattern always evaluates to an object of type node-set. A node matches a pattern if the node is a member of the result of evaluating the pattern as an expression with respect to some possible context; the possible contexts are those whose context node is the node being matched or one of its ancestors.

Here are some examples of patterns:

para matches any para element

* matches any element

chapter|appendix matches any chapter element and any appendix element

olist/item matches any item element with an olist parent

appendix//para matches any para element with an appendix ancestor element

/ matches the root node

text() matches any text node

processing-instruction() matches any processing instruction

node() matches any node other than an attribute node and the root node

id("W11") matches the element with unique ID W11

para[1] matches any para element that is the first para child element of its parent

*[position()=1 and self::para] matches any para element that is the first child element of its parent

para[last()=1] matches any para element that is the only para child element of its parent

items/item[position()>1] matches any item element that has a items parent and that is not the first item child of its parent

item[position() mod 2 = 1] would be true for any item element that is an odd-numbered item child of its parent.

div[@class="appendix"]//p matches any p element with a div ancestor element that has a class attribute with value appendix

@class matches any class attribute (not any element that has a class attribute)

@* matches any attribute

A pattern must match the grammar for Pattern. A Pattern is a set of location path patterns separated by |. A location path pattern is a location path whose steps all use only the child or attribute axes. Although patterns must not use the descendant-or-self axis, patterns may use the // operator as well as the / operator. Location path patterns can also start with an id or key function call with a literal argument. Predicates in a pattern can use arbitrary expressions just like predicates in a location path.

Patterns Pattern LocationPathPattern | Pattern '|' LocationPathPattern LocationPathPattern '/' RelativePathPattern? | IdKeyPattern (('/' | '//') RelativePathPattern)? | '//'? RelativePathPattern IdKeyPattern 'id' '(' Literal ')' | 'key' '(' Literal ',' Literal ')' RelativePathPattern StepPattern | RelativePathPattern '/' StepPattern | RelativePathPattern '//' StepPattern StepPattern ChildOrAttributeAxisSpecifier NodeTest Predicate* ChildOrAttributeAxisSpecifier AbbreviatedAxisSpecifier | ('child' | 'attribute') '::'

A pattern is defined to match a node if and only if there is possible context such that when the pattern is evaluated as an expression with that context, the node is a member of the resulting node-set. When a node is being matched, the possible contexts have a context node that is the node being matched or any ancestor of that node, and a context node list containing just the context node.

For example, p matches any p element, because for any p if the expression p is evaluated with the parent of the p element as context the resulting node-set will contain that p element as one of its members.

This matches even a p element that is the document element, since the document root is the parent of the document element.

Although the semantics of patterns are specified indirectly in terms of expression evaluation, it is easy to understand the meaning of a pattern directly without thinking in terms of expression evaluation. In a pattern, | indicates alternatives; a pattern with one or more | separated alternatives matches if any one of the alternative matches. A pattern that consists of a sequence of StepPatterns separated by / or // is matched from right to left. The pattern only matches if the rightmost StepPattern matches and a suitable element matches the rest of the pattern; if the separator is / then only the parent is a suitable element; if the separator is //, then any ancestor is a suitable element. A StepPattern that uses the child axis matches if the NodeTest is true for the node and the node is not an attribute node. A StepPattern that uses the attribute axis matches if the NodeTest is true for the node and the node is an attribute node. When [] is present, then the first PredicateExpr in a StepPattern is evaluated with the node being matched as the context node and the siblings of the context node that match the NodeTest as the context node list, unless the node being matched is an attribute node, in which case the context node list is all the attributes that have the same parent as the attribute being matched and that match the NameTest.

For example

appendix//ulist/item[position()=1]

matches a node if and only if all of the following are true:

the NodeTest item is true for the node and the node is not an attribute; in other words the node is an item element

evaluating the PredicateExpr position()=1 with the node as context node and the siblings of the node that are item elements as the context node list yields true

the node has a parent that matches appendix//ulist; this will be true if the parent is a ulist element that has an appendix ancestor element.

Defining Template Rules

A template rule is specified with the xsl:template element. The match attribute is a Pattern that identifies the source node or nodes to which the rule applies. The match attribute is required unless the xsl:template element has a name attribute (see ). It is an error for the value of the match attribute to contain a VariableReference. The content of the xsl:template element is the template that is instantiated when the template rule is applied.

For example, an XML document might contain:

important point.]]>

The following template rule matches emph elements and produces a fo:inline-sequence formatting object with a font-weight property of bold.

]]>

Examples in this document use the fo: prefix for the namespace &XSLFO.ns;, which is the namespace of the formatting objects defined in .

As described next, the xsl:apply-templates element recursively processes the children of the source element.

Applying Template Rules

This example creates a block for a chapter element and then processes its immediate children.

]]>

In the absence of a select attribute, the xsl:apply-templates instruction processes all of the children of the current node, including text nodes. However, text nodes that have been stripped as specified in will not be processed. If stripping of whitespace nodes has not been enabled for an element, then all whitespace in the content of the element will be processed as text, and thus whitespace between child elements will count in determining the position of a child element as returned by the position function.

A select attribute can be used to process nodes selected by an expression instead of processing all children. The value of the select attribute is an expression. The expression must evaluate to a node-set. The selected set of nodes is processed in document order, unless a sorting specification is present (see ). The following example processes all of the author children of the author-group:

]]>

The following example processes all of the given-names of the authors that are children of author-group:

]]>

This example processes all of the heading descendant elements of the book element.

]]>

It is also possible to process elements that are not descendants of the current node. This example assumes that a department element has group children and employee descendants. It finds an employee's department and then processes the group children of the department.

Employee belongs to group ]]>

Multiple xsl:apply-templates elements can be used within a single template to do simple reordering. The following example creates two HTML tables. The first table is filled with domestic sales while the second table is filled with foreign sales.

]]>

It is possible for there to be two matching descendants where one is a descendant of the other. This case is not treated specially: both descendants will be processed as usual. For example, given a source document

]]>

the rule

]]>

will process both the outer div and inner div elements.

Typically, xsl:apply-templates is used to process only nodes that are descendants of the current node. Such use of xsl:apply-templates cannot result in non-terminating processing loops. However, when xsl:apply-templates is used to process elements that are not descendants of the current node, the possibility arises of non-terminating loops. For example,

]]>

Implementations may be able to detect such loops in some cases, but the possibility exists that a stylesheet may enter a non-terminating loop that an implementation is unable to detect. This may present a denial of service security risk.

Conflict Resolution for Template Rules

It is possible for a source node to match more than one template rule. The template rule to be used is determined as follows:

First, all matching template rules that have lower import precedence than the matching template rule or rules with the highest import precedence are eliminated from consideration.

Next, all matching template rules that have lower priority than the matching template rule or rules with the highest priority are eliminated from consideration. The priority of a template rule is specified by the priority attribute on the template rule. The value of this must be a real number (positive or negative), matching the production Number with an optional leading minus sign (-). The default priority is computed as follows:

If the pattern contains multiple alternatives separated by |, then it is treated equivalently to a set of template rules, one for each alternative.

If the pattern has the form of a QName preceded by a ChildOrAttributeAxisSpecifier or has the form processing-instruction(Literal) preceded by a ChildOrAttributeAxisSpecifier, then the priority is 0.

If the pattern has the form NCName:* preceded by a ChildOrAttributeAxisSpecifier, then the priority is -0.25.

Otherwise, if the pattern consists of just a NodeTest preceded by a ChildOrAttributeAxisSpecifier, then the priority is -0.5.

Otherwise, the priority is 0.5.

Thus, the most common kind of pattern (a pattern that tests for a node with a particular type and a particular expanded-name) has priority 0. The next less specific kind of pattern (a pattern that tests for a node with a particular type and an expanded-name with a particular namespace URI) has priority -0.25. Patterns less specific than this (patterns that just tests for nodes with particular types) have priority -0.5. Patterns more specific than the most common kind of pattern have priority 0.5.

It is an error if this leaves more than one matching template rule. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing, from amongst the matching template rules that are left, the one that occurs last in the stylesheet.

Overriding Template Rules

A template rule that is being used to override a template rule in an imported stylesheet (see ) can use the xsl:apply-imports element to invoke the overridden template rule.

At any point in the processing of a stylesheet, there is a current template rule. Whenever a template rule is chosen by matching a pattern, the template rule becomes the current template rule for the instantiation of the rule's template. When an xsl:for-each element is instantiated, the current template rule becomes null for the instantiation of the content of the xsl:for-each element.

xsl:apply-imports processes the current node using only template rules that were imported into the stylesheet element containing the current template rule; the node is processed in the current template rule's mode. It is an error if xsl:apply-imports is instantiated when the current template rule is null.

For example, suppose the stylesheet doc.xsl contains a template rule for example elements:

]]>

Another stylesheet could import doc.xsl and modify the treatment of example elements as follows:

]]>

The combined effect would be to transform an example into an element of the form:

...
]]>
Modes

Modes allow an element to be processed multiple times, each time producing a different result.

Both xsl:template and xsl:apply-templates have an optional mode attribute. The value of the mode attribute is a QName, which is expanded as described in . If xsl:template does not have a match attribute, it must not have a mode attribute. If an xsl:apply-templates element has a mode attribute, then it applies only to those template rules from xsl:template elements that have a mode attribute with the same value; if an xsl:apply-templates element does not have a mode attribute, then it applies only to those template rules from xsl:template elements that do not have a mode attribute.

Built-in Template Rules

There is a built-in template rule to allow recursive processing to continue in the absence of a successful pattern match by an explicit template rule in the stylesheet. This template rule applies to both element nodes and the root node. The following shows the equivalent of the built-in template rule:

]]>

There is also a built-in template rule for each mode, which allows recursive processing to continue in the same mode in the absence of a successful pattern match by an explicit template rule in the stylesheet. This template rule applies to both element nodes and the root node. The following shows the equivalent of the built-in template rule for mode m.

<xsl:template match="*|/" mode="m"> <xsl:apply-templates mode="m"/> </xsl:template>

There is also a built-in template rule for text and attribute nodes that copies text through:

]]>

The built-in template rule for processing instructions and comments is to do nothing.

]]>

The built-in template rule for namespace nodes is also to do nothing. There is no pattern that can match a namespace node; so, the built-in template rule is the only template rule that is applied for namespace nodes.

The built-in template rules are treated as if they were imported implicitly before the stylesheet and so have lower import precedence than all other template rules. Thus, the author can override a built-in template rule by including an explicit template rule.

Named Templates

Templates can be invoked by name. An xsl:template element with a name attribute specifies a named template. The value of the name attribute is a QName, which is expanded as described in . If an xsl:template element has a name attribute, it may, but need not, also have a match attribute. An xsl:call-template element invokes a template by name; it has a required name attribute that identifies the template to be invoked. Unlike xsl:apply-templates, xsl:call-template does not change the current node or the current node list.

The match, mode and priority attributes on an xsl:template element do not affect whether the template is invoked by an xsl:call-template element. Similarly, the name attribute on an xsl:template element does not affect whether the template is invoked by an xsl:apply-templates element.

It is an error if a stylesheet contains more than one template with the same name and same import precedence.

Creating the Result Tree

This section describes instructions that directly create nodes in the result tree.

Creating Elements and Attributes Literal Result Elements

In a template, an element in the stylesheet that does not belong to the XSLT namespace and that is not an extension element (see ) is instantiated to create an element node with the same expanded-name. The content of the element is a template, which is instantiated to give the content of the created element node. The created element node will have the attribute nodes that were present on the element node in the stylesheet tree, other than attributes with names in the XSLT namespace.

The created element node will also have a copy of the namespace nodes that were present on the element node in the stylesheet tree with the exception of any namespace node whose string-value is the XSLT namespace URI (&XSLT.ns;), a namespace URI declared as an extension namespace (see ), or a namespace URI designated as an excluded namespace. A namespace URI is designated as an excluded namespace by using an exclude-result-prefixes attribute on an xsl:stylesheet element or an xsl:exclude-result-prefixes attribute on a literal result element. The value of both these attributes is a whitespace-separated list of namespace prefixes. The namespace bound to each of the prefixes is designated as an excluded namespace. It is an error if there is no namespace bound to the prefix on the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute. The default namespace (as declared by xmlns) may be designated as an excluded namespace by including #default in the list of namespace prefixes. The designation of a namespace as an excluded namespace is effective within the subtree of the stylesheet rooted at the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute; a subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element.

When a stylesheet uses a namespace declaration only for the purposes of addressing the source tree, specifying the prefix in the exclude-result-prefixes attribute will avoid superfluous namespace declarations in the result tree.

The value of an attribute of a literal result element is interpreted as an attribute value template: it can contain expressions contained in curly braces ({}).

A namespace URI in the stylesheet tree that is being used to specify a namespace URI in the result tree is called a literal namespace URI. This applies to:

the namespace URI in the expanded-name of a literal result element in the stylesheet

the namespace URI in the expanded-name of an attribute specified on a literal result element in the stylesheet

the string-value of a namespace node on a literal result element in the stylesheet

A stylesheet can use the xsl:namespace-alias element to declare that one namespace URI is an alias for another namespace URI. When a literal namespace URI has been declared to be an alias for another namespace URI, then the namespace URI in the result tree will be the namespace URI that the literal namespace URI is an alias for, instead of the literal namespace URI itself. The xsl:namespace-alias element declares that the namespace URI bound to the prefix specified by the stylesheet-prefix attribute is an alias for the namespace URI bound to the prefix specified by the result-prefix attribute. Thus, the stylesheet-prefix attribute specifies the namespace URI that will appear in the stylesheet, and the result-prefix attribute specifies the corresponding namespace URI that will appear in the result tree. The default namespace (as declared by xmlns) may be specified by using #default instead of a prefix. If a namespace URI is declared to be an alias for multiple different namespace URIs, then the declaration with the highest import precedence is used. It is an error if there is more than one such declaration. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing, from amongst the declarations with the highest import precedence, the one that occurs last in the stylesheet.

When literal result elements are being used to create element, attribute, or namespace nodes that use the XSLT namespace URI, the stylesheet must use an alias. For example, the stylesheet

<xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" xmlns:fo="&XSLFO.ns;" xmlns:axsl="&XSLTA.ns;"> ]]>

will generate an XSLT stylesheet from a document of the form:

p h1 h2 h3 h4 ]]>

It may be necessary also to use aliases for namespaces other than the XSLT namespace URI. For example, literal result elements belonging to a namespace dealing with digital signatures might cause XSLT stylesheets to be mishandled by general-purpose security software; using an alias for the namespace would avoid the possibility of such mishandling.

Creating Elements with xsl:element

The xsl:element element allows an element to be created with a computed name. The expanded-name of the element to be created is specified by a required name attribute and an optional namespace attribute. The content of the xsl:element element is a template for the attributes and children of the created element.

The name attribute is interpreted as an attribute value template. It is an error if the string that results from instantiating the attribute value template is not a QName. An XSLT processor may signal the error; if it does not signal the error, then it must recover by making the the result of instantiating the xsl:element element be the sequence of nodes created by instantiating the content of the xsl:element element, excluding any initial attribute nodes. If the namespace attribute is not present then the QName is expanded into an expanded-name using the namespace declarations in effect for the xsl:element element, including any default namespace declaration.

If the namespace attribute is present, then it also is interpreted as an attribute value template. The string that results from instantiating the attribute value template should be a URI reference. It is not an error if the string is not a syntactically legal URI reference. If the string is empty, then the expanded-name of the element has a null namespace URI. Otherwise, the string is used as the namespace URI of the expanded-name of the element to be created. The local part of the QName specified by the name attribute is used as the local part of the expanded-name of the element to be created.

XSLT processors may make use of the prefix of the QName specified in the name attribute when selecting the prefix used for outputting the created element as XML; however, they are not required to do so.

Creating Attributes with xsl:attribute

The xsl:attribute element can be used to add attributes to result elements whether created by literal result elements in the stylesheet or by instructions such as xsl:element. The expanded-name of the attribute to be created is specified by a required name attribute and an optional namespace attribute. Instantiating an xsl:attribute element adds an attribute node to the containing result element node. The content of the xsl:attribute element is a template for the value of the created attribute.

The name attribute is interpreted as an attribute value template. It is an error if the string that results from instantiating the attribute value template is not a QName or is the string xmlns. An XSLT processor may signal the error; if it does not signal the error, it must recover by not adding the attribute to the result tree. If the namespace attribute is not present, then the QName is expanded into an expanded-name using the namespace declarations in effect for the xsl:attribute element, not including any default namespace declaration.

If the namespace attribute is present, then it also is interpreted as an attribute value template. The string that results from instantiating it should be a URI reference. It is not an error if the string is not a syntactically legal URI reference. If the string is empty, then the expanded-name of the attribute has a null namespace URI. Otherwise, the string is used as the namespace URI of the expanded-name of the attribute to be created. The local part of the QName specified by the name attribute is used as the local part of the expanded-name of the attribute to be created.

XSLT processors may make use of the prefix of the QName specified in the name attribute when selecting the prefix used for outputting the created attribute as XML; however, they are not required to do so and, if the prefix is xmlns, they must not do so. Thus, although it is not an error to do:

<xsl:attribute name="xmlns:xsl" namespace="whatever">&XSLT.ns;</xsl:attribute>

it will not result in a namespace declaration being output.

Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name.

The following are all errors:

Adding an attribute to an element after children have been added to it; implementations may either signal the error or ignore the attribute.

Adding an attribute to a node that is not an element; implementations may either signal the error or ignore the attribute.

Creating nodes other than text nodes during the instantiation of the content of the xsl:attribute element; implementations may either signal the error or ignore the offending nodes.

When an xsl:attribute contains a text node with a newline, then the XML output must contain a character reference. For example,

x y]]>

will result in the output

(or with any equivalent character reference). The XML output cannot be

This is because XML 1.0 requires newline characters in attribute values to be normalized into spaces but requires character references to newline characters not to be normalized. The attribute values in the data model represent the attribute value after normalization. If a newline occurring in an attribute value in the tree were output as a newline character rather than as character reference, then the attribute value in the tree created by reparsing the XML would contain a space not a newline, which would mean that the tree had not been output correctly.

Named Attribute Sets

The xsl:attribute-set element defines a named set of attributes. The name attribute specifies the name of the attribute set. The value of the name attribute is a QName, which is expanded as described in . The content of the xsl:attribute-set element consists of zero or more xsl:attribute elements that specify the attributes in the set.

Attribute sets are used by specifying a use-attribute-sets attribute on xsl:element, xsl:copy (see ) or xsl:attribute-set elements. The value of the use-attribute-sets attribute is a whitespace-separated list of names of attribute sets. Each name is specified as a QName, which is expanded as described in . Specifying a use-attribute-sets attribute is equivalent to adding xsl:attribute elements for each of the attributes in each of the named attribute sets to the beginning of the content of the element with the use-attribute-sets attribute, in the same order in which the names of the attribute sets are specified in the use-attribute-sets attribute. It is an error if use of use-attribute-sets attributes on xsl:attribute-set elements causes an attribute set to directly or indirectly use itself.

Attribute sets can also be used by specifying an xsl:use-attribute-sets attribute on a literal result element. The value of the xsl:use-attribute-sets attribute is a whitespace-separated list of names of attribute sets. The xsl:use-attribute-sets attribute has the same effect as the use-attribute-sets attribute on xsl:element with the additional rule that attributes specified on the literal result element itself are treated as if they were specified by xsl:attribute elements before any actual xsl:attribute elements but after any xsl:attribute elements implied by the xsl:use-attribute-sets attribute. Thus, for a literal result element, attributes from attribute sets named in an xsl:use-attribute-sets attribute will be added first, in the order listed in the attribute; next, attributes specified on the literal result element will be added; finally, any attributes specified by xsl:attribute elements will be added. Since adding an attribute to an element replaces any existing attribute of that element with the same name, this means that attributes specified in attribute sets can be overridden by attributes specified on the literal result element itself.

The template within each xsl:attribute element in an xsl:attribute-set element is instantiated each time the attribute set is used; it is instantiated using the same current node and current node list as is used for instantiating the element bearing the use-attribute-sets or xsl:use-attribute-sets attribute. However, it is the position in the stylesheet of the xsl:attribute element rather than of the element bearing the use-attribute-sets or xsl:use-attribute-sets attribute that determines which variable bindings are visible (see ); thus, only variables and parameters declared by top-level xsl:variable and xsl:param elements are visible.

The following example creates a named attribute set title-style and uses it in a template rule.

12pt bold ]]>

Multiple definitions of an attribute set with the same expanded-name are merged. An attribute from a definition that has higher import precedence takes precedence over an attribute from a definition that has lower import precedence. It is an error if there are two attribute sets that have the same expanded-name and equal import precedence and that both contain the same attribute, unless there is a definition of the attribute set with higher import precedence that also contains the attribute. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing from amongst the definitions that specify the attribute that have the highest import precedence the one that was specified last in the stylesheet. Where the attributes in an attribute set were specified is relevant only in merging the attributes into the attribute set; it makes no difference when the attribute set is used.

Creating Text

A template can also contain text nodes. Each text node in a template remaining after whitespace has been stripped as specified in will create a text node with the same string-value in the result tree. Adjacent text nodes in the result tree are automatically merged.

Note that text is processed at the tree level. Thus, markup of &lt; in a template will be represented in the stylesheet tree by a text node that includes the character <. This will create a text node in the result tree that contains a < character, which will be represented by the markup &lt; (or an equivalent character reference) when the result tree is externalized as an XML document (unless output escaping is disabled as described in ).

Literal data characters may also be wrapped in an xsl:text element. This wrapping may change what whitespace characters are stripped (see ) but does not affect how the characters are handled by the XSLT processor thereafter.

The xml:lang and xml:space attributes are not treated specially by XSLT. In particular,

it is the responsibility of the stylesheet author explicitly to generate any xml:lang or xml:space attributes that are needed in the result;

specifying an xml:lang or xml:space attribute on an element in the XSLT namespace will not cause any xml:lang or xml:space attributes to appear in the result.

Creating Processing Instructions

The xsl:processing-instruction element is instantiated to create a processing instruction node. The content of the xsl:processing-instruction element is a template for the string-value of the processing instruction node. The xsl:processing-instruction element has a required name attribute that specifies the name of the processing instruction node. The value of the name attribute is interpreted as an attribute value template.

For example, this

href="book.css" type="text/css"]]>

would create the processing instruction

]]>

It is an error if the string that results from instantiating the name attribute is not both an NCName and a PITarget. An XSLT processor may signal the error; if it does not signal the error, it must recover by not adding the processing instruction to the result tree.

This means that xsl:processing-instruction cannot be used to output an XML declaration. The xsl:output element should be used instead (see ).

It is an error if instantiating the content of xsl:processing-instruction creates nodes other than text nodes. An XSLT processor may signal the error; if it does not signal the error, it must recover by ignoring the offending nodes together with their content.

It is an error if the result of instantiating the content of the xsl:processing-instruction contains the string ?>. An XSLT processor may signal the error; if it does not signal the error, it must recover by inserting a space after any occurrence of ? that is followed by a >.

Creating Comments

The xsl:comment element is instantiated to create a comment node in the result tree. The content of the xsl:comment element is a template for the string-value of the comment node.

For example, this

This file is automatically generated. Do not edit!]]>

would create the comment

]]>

It is an error if instantiating the content of xsl:comment creates nodes other than text nodes. An XSLT processor may signal the error; if it does not signal the error, it must recover by ignoring the offending nodes together with their content.

It is an error if the result of instantiating the content of the xsl:comment contains the string -- or ends with -. An XSLT processor may signal the error; if it does not signal the error, it must recover by inserting a space after any occurrence of - that is followed by another - or that ends the comment.

Copying

The xsl:copy element provides an easy way of copying the current node. Instantiating the xsl:copy element creates a copy of the current node. The namespace nodes of the current node are automatically copied as well, but the attributes and children of the node are not automatically copied. The content of the xsl:copy element is a template for the attributes and children of the created node; the content is instantiated only for nodes of types that can have attributes or children (i.e. root nodes and element nodes).

The xsl:copy element may have a use-attribute-sets attribute (see ). This is used only when copying element nodes.

The root node is treated specially because the root node of the result tree is created implicitly. When the current node is the root node, xsl:copy will not create a root node, but will just use the content template.

For example, the identity transformation can be written using xsl:copy as follows:

]]>

When the current node is an attribute, then if it would be an error to use xsl:attribute to create an attribute with the same name as the current node, then it is also an error to use xsl:copy (see ).

The following example shows how xml:lang attributes can be easily copied through from source to result. If a stylesheet defines the following named template:

]]>

then it can simply do

]]>

instead of

]]>

when it wants to copy the xml:lang attribute.

Computing Generated Text

Within a template, the xsl:value-of element can be used to compute generated text, for example by extracting text from the source tree or by inserting the value of a variable. The xsl:value-of element does this with an expression that is specified as the value of the select attribute. Expressions can also be used inside attribute values of literal result elements by enclosing the expression in curly braces ({}).

Generating Text with xsl:value-of

The xsl:value-of element is instantiated to create a text node in the result tree. The required select attribute is an expression; this expression is evaluated and the resulting object is converted to a string as if by a call to the string function. The string specifies the string-value of the created text node. If the string is empty, no text node will be created. The created text node will be merged with any adjacent text nodes.

The xsl:copy-of element can be used to copy a node-set over to the result tree without converting it to a string. See .

For example, the following creates an HTML paragraph from a person element with given-name and family-name attributes. The paragraph will contain the value of the given-name attribute of the current node followed by a space and the value of the family-name attribute of the current node.

]]>

For another example, the following creates an HTML paragraph from a person element with given-name and family-name children elements. The paragraph will contain the string-value of the first given-name child element of the current node followed by a space and the string-value of the first family-name child element of the current node.

]]>

The following precedes each procedure element with a paragraph containing the security level of the procedure. It assumes that the security level that applies to a procedure is determined by a security attribute on the procedure element or on an ancestor element of the procedure. It also assumes that if more than one such element has a security attribute then the security level is determined by the element that is closest to the procedure.

]]>
Attribute Value Templates

In an attribute value that is interpreted as an attribute value template, such as an attribute of a literal result element, an expression can be used by surrounding the expression with curly braces ({}). The attribute value template is instantiated by replacing the expression together with surrounding curly braces by the result of evaluating the expression and converting the resulting object to a string as if by a call to the string function. Curly braces are not recognized in an attribute value in an XSLT stylesheet unless the attribute is specifically stated to be one that is interpreted as an attribute value template; in an element syntax summary, the value of such attributes is surrounded by curly braces.

Not all attributes are interpreted as attribute value templates. Attributes whose value is an expression or pattern, attributes of top-level elements and attributes that refer to named XSLT objects are not interpreted as attribute value templates. In addition, xmlns attributes are not interpreted as attribute value templates; it would not be conformant with the XML Namespaces Recommendation to do this.

The following example creates an img result element from a photograph element in the source; the value of the src attribute of the img element is computed from the value of the image-dir variable and the string-value of the href child of the photograph element; the value of the width attribute of the img element is computed from the value of the width attribute of the size child of the photograph element:

/images ]]>

With this source

headquarters.jpg ]]>

the result would be

]]>

When an attribute value template is instantiated, a double left or right curly brace outside an expression will be replaced by a single curly brace. It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. A right curly brace inside a Literal in an expression is not recognized as terminating the expression.

Curly braces are not recognized recursively inside expressions. For example:

]]>

is not allowed. Instead, use simply:

]]>
Numbering

The xsl:number element is used to insert a formatted number into the result tree. The number to be inserted may be specified by an expression. The value attribute contains an expression. The expression is evaluated and the resulting object is converted to a number as if by a call to the number function. The number is rounded to an integer and then converted to a string using the attributes specified in ; in this context, the value of each of these attributes is interpreted as an attribute value template. After conversion, the resulting string is inserted in the result tree. For example, the following example numbers a sorted list:

]]>

If no value attribute is specified, then the xsl:number element inserts a number based on the position of the current node in the source tree. The following attributes control how the current node is to be numbered:

The level attribute specifies what levels of the source tree should be considered; it has the values single, multiple or any. The default is single.

The count attribute is a pattern that specifies what nodes should be counted at those levels. If count attribute is not specified, then it defaults to the pattern that matches any node with the same node type as the current node and, if the current node has an expanded-name, with the same expanded-name as the current node.

The from attribute is a pattern that specifies where counting starts.

In addition, the attributes specified in are used for number to string conversion, as in the case when the value attribute is specified.

The xsl:number element first constructs a list of positive integers using the level, count and from attributes:

When level="single", it goes up to the first node in the ancestor-or-self axis that matches the count pattern, and constructs a list of length one containing one plus the number of preceding siblings of that ancestor that match the count pattern. If there is no such ancestor, it constructs an empty list. If the from attribute is specified, then the only ancestors that are searched are those that are descendants of the nearest ancestor that matches the from pattern. Preceding siblings has the same meaning here as with the preceding-sibling axis.

When level="multiple", it constructs a list of all ancestors of the current node in document order followed by the element itself; it then selects from the list those nodes that match the count pattern; it then maps each node in the list to one plus the number of preceding siblings of that node that match the count pattern. If the from attribute is specified, then the only ancestors that are searched are those that are descendants of the nearest ancestor that matches the from pattern. Preceding siblings has the same meaning here as with the preceding-sibling axis.

When level="any", it constructs a list of length one containing the number of nodes that match the count pattern and belong to the set containing the current node and all nodes at any level of the document that are before the current node in document order, excluding any namespace and attribute nodes (in other words the union of the members of the preceding and ancestor-or-self axes). If the from attribute is specified, then only nodes after the first node before the current node that match the from pattern are considered.

The list of numbers is then converted into a string using the attributes specified in ; in this context, the value of each of these attributes is interpreted as an attribute value template. After conversion, the resulting string is inserted in the result tree.

The following would number the items in an ordered list:

. ]]>

The following two rules would number title elements. This is intended for a document that contains a sequence of chapters followed by a sequence of appendices, where both chapters and appendices contain sections, which in turn contain subsections. Chapters are numbered 1, 2, 3; appendices are numbered A, B, C; sections in chapters are numbered 1.1, 1.2, 1.3; sections in appendices are numbered A.1, A.2, A.3.

]]>

The following example numbers notes sequentially within a chapter:

]]>

The following example would number H4 elements in HTML with a three-part label:

. . ]]> Number to String Conversion Attributes

The following attributes are used to control conversion of a list of numbers into a string. The numbers are integers greater than 0. The attributes are all optional.

The main attribute is format. The default value for the format attribute is 1. The format attribute is split into a sequence of tokens where each token is a maximal sequence of alphanumeric characters or a maximal sequence of non-alphanumeric characters. Alphanumeric means any character that has a Unicode category of Nd, Nl, No, Lu, Ll, Lt, Lm or Lo. The alphanumeric tokens (format tokens) specify the format to be used for each number in the list. If the first token is a non-alphanumeric token, then the constructed string will start with that token; if the last token is non-alphanumeric token, then the constructed string will end with that token. Non-alphanumeric tokens that occur between two format tokens are separator tokens that are used to join numbers in the list. The nth format token will be used to format the nth number in the list. If there are more numbers than format tokens, then the last format token will be used to format remaining numbers. If there are no format tokens, then a format token of 1 is used to format all numbers. The format token specifies the string to be used to represent the number 1. Each number after the first will be separated from the preceding number by the separator token preceding the format token used to format that number, or, if there are no separator tokens, then by . (a period character).

Format tokens are a superset of the allowed values for the type attribute for the OL element in HTML 4.0 and are interpreted as follows:

Any token where the last character has a decimal digit value of 1 (as specified in the Unicode character property database), and the Unicode value of preceding characters is one less than the Unicode value of the last character generates a decimal representation of the number where each number is at least as long as the format token. Thus, a format token 1 generates the sequence 1 2 ... 10 11 12 ..., and a format token 01 generates the sequence 01 02 ... 09 10 11 12 ... 99 100 101.

A format token A generates the sequence A B C ... Z AA AB AC....

A format token a generates the sequence a b c ... z aa ab ac....

A format token i generates the sequence i ii iii iv v vi vii viii ix x ....

A format token I generates the sequence I II III IV V VI VII VIII IX X ....

Any other format token indicates a numbering sequence that starts with that token. If an implementation does not support a numbering sequence that starts with that token, it must use a format token of 1.

When numbering with an alphabetic sequence, the lang attribute specifies which language's alphabet is to be used; it has the same range of values as xml:lang ; if no lang value is specified, the language should be determined from the system environment. Implementers should document for which languages they support numbering.

Implementers should not make any assumptions about how numbering works in particular languages and should properly research the languages that they wish to support. The numbering conventions of many languages are very different from English.

The letter-value attribute disambiguates between numbering sequences that use letters. In many languages there are two commonly used numbering sequences that use letters. One numbering sequence assigns numeric values to letters in alphabetic sequence, and the other assigns numeric values to each letter in some other manner traditional in that language. In English, these would correspond to the numbering sequences specified by the format tokens a and i. In some languages, the first member of each sequence is the same, and so the format token alone would be ambiguous. A value of alphabetic specifies the alphabetic sequence; a value of traditional specifies the other sequence. If the letter-value attribute is not specified, then it is implementation-dependent how any ambiguity is resolved.

It is possible for two conforming XSLT processors not to convert a number to exactly the same string. Some XSLT processors may not support some languages. Furthermore, there may be variations possible in the way conversions are performed for any particular language that are not specifiable by the attributes on xsl:number. Future versions of XSLT may provide additional attributes to provide control over these variations. Implementations may also use implementation-specific namespaced attributes on xsl:number for this.

The grouping-separator attribute gives the separator used as a grouping (e.g. thousands) separator in decimal numbering sequences, and the optional grouping-size specifies the size (normally 3) of the grouping. For example, grouping-separator="," and grouping-size="3" would produce numbers of the form 1,000,000. If only one of the grouping-separator and grouping-size attributes is specified, then it is ignored.

Here are some examples of conversion specifications:

format="&#x30A2;" specifies Katakana numbering

format="&#x30A4;" specifies Katakana numbering in the iroha order

format="&#x0E51;" specifies numbering with Thai digits

format="&#x05D0;" letter-value="traditional" specifies traditional Hebrew numbering

format="&#x10D0;" letter-value="traditional" specifies Georgian numbering

format="&#x03B1;" letter-value="traditional" specifies classical Greek numbering

format="&#x0430;" letter-value="traditional" specifies Old Slavic numbering

Repetition

When the result has a known regular structure, it is useful to be able to specify directly the template for selected nodes. The xsl:for-each instruction contains a template, which is instantiated for each node selected by the expression specified by the select attribute. The select attribute is required. The expression must evaluate to a node-set. The template is instantiated with the selected node as the current node, and with a list of all of the selected nodes as the current node list. The nodes are processed in document order, unless a sorting specification is present (see ).

For example, given an XML document with this structure

... ... ... ... ... ... ]]>

the following would create an HTML document containing a table with a row for each customer element

Customers
]]>
Conditional Processing

There are two instructions in XSLT that support conditional processing in a template: xsl:if and xsl:choose. The xsl:if instruction provides simple if-then conditionality; the xsl:choose instruction supports selection of one choice when there are several possibilities.

Conditional Processing with xsl:if

The xsl:if element has a test attribute, which specifies an expression. The content is a template. The expression is evaluated and the resulting object is converted to a boolean as if by a call to the boolean function. If the result is true, then the content template is instantiated; otherwise, nothing is created. In the following example, the names in a group of names are formatted as a comma separated list:

, ]]>

The following colors every other table row yellow:

yellow ]]>
Conditional Processing with xsl:choose

The xsl:choose element selects one among a number of possible alternatives. It consists of a sequence of xsl:when elements followed by an optional xsl:otherwise element. Each xsl:when element has a single attribute, test, which specifies an expression. The content of the xsl:when and xsl:otherwise elements is a template. When an xsl:choose element is processed, each of the xsl:when elements is tested in turn, by evaluating the expression and converting the resulting object to a boolean as if by a call to the boolean function. The content of the first, and only the first, xsl:when element whose test is true is instantiated. If no xsl:when is true, the content of the xsl:otherwise element is instantiated. If no xsl:when element is true, and no xsl:otherwise element is present, nothing is created.

The following example enumerates items in an ordered list using arabic numerals, letters, or roman numerals depending on the depth to which the ordered lists are nested.

. ]]>
Sorting

Sorting is specified by adding xsl:sort elements as children of an xsl:apply-templates or xsl:for-each element. The first xsl:sort child specifies the primary sort key, the second xsl:sort child specifies the secondary sort key and so on. When an xsl:apply-templates or xsl:for-each element has one or more xsl:sort children, then instead of processing the selected nodes in document order, it sorts the nodes according to the specified sort keys and then processes them in sorted order. When used in xsl:for-each, xsl:sort elements must occur first. When a template is instantiated by xsl:apply-templates and xsl:for-each, the current node list list consists of the complete list of nodes being processed in sorted order.

xsl:sort has a select attribute whose value is an expression. For each node to be processed, the expression is evaluated with that node as the current node and with the complete list of nodes being processed in unsorted order as the current node list. The resulting object is converted to a string as if by a call to the string function; this string is used as the sort key for that node. The default value of the select attribute is ., which will cause the string-value of the current node to be used as the sort key.

This string serves as a sort key for the node. The following optional attributes on xsl:sort control how the list of sort keys are sorted; the values of all of these attributes are interpreted as attribute value templates.

order specifies whether the strings should be sorted in ascending or descending order; ascending specifies ascending order; descending specifies descending order; the default is ascending

lang specifies the language of the sort keys; it has the same range of values as xml:lang ; if no lang value is specified, the language should be determined from the system environment

data-type specifies the data type of the strings; the following values are allowed:

text specifies that the sort keys should be sorted lexicographically in the culturally correct manner for the language specified by lang

number specifies that the sort keys should be converted to numbers and then sorted according to the numeric value; the sort key is converted to a number as if by a call to the number function; the lang attribute is ignored

a QName with a prefix is expanded into an expanded-name as described in ; the expanded-name identifies the data-type; the behavior in this case is not specified by this document

The default value is text.

The XSL Working Group plans that future versions of XSLT will leverage XML Schemas to define further values for this attribute.

case-order has the value upper-first or lower-first; this applies when data-type="text", and specifies that upper-case letters should sort before lower-case letters or vice-versa respectively. For example, if lang="en", then A a B b are sorted with case-order="upper-first" and a A b B are sorted with case-order="lower-first". The default value is language dependent.

It is possible for two conforming XSLT processors not to sort exactly the same. Some XSLT processors may not support some languages. Furthermore, there may be variations possible in the sorting of any particular language that are not specified by the attributes on xsl:sort, for example, whether Hiragana or Katakana is sorted first in Japanese. Future versions of XSLT may provide additional attributes to provide control over these variations. Implementations may also use implementation-specific namespaced attributes on xsl:sort for this.

It is recommended that implementers consult for information on internationalized sorting.

The sort must be stable: in the sorted list of nodes, any sub list that has sort keys that all compare equal must be in document order.

For example, suppose an employee database has the form

James Clark ... ]]>

Then a list of employees sorted by name could be generated using:

  • ]]>
    Variables and Parameters

    A variable is a name that may be bound to a value. The value to which a variable is bound (the value of the variable) can be an object of any of the types that can be returned by expressions. There are two elements that can be used to bind variables: xsl:variable and xsl:param. The difference is that the value specified on the xsl:param variable is only a default value for the binding; when the template or stylesheet within which the xsl:param element occurs is invoked, parameters may be passed that are used in place of the default values.

    Both xsl:variable and xsl:param have a required name attribute, which specifies the name of the variable. The value of the name attribute is a QName, which is expanded as described in .

    For any use of these variable-binding elements, there is a region of the stylesheet tree within which the binding is visible; within this region, any binding of the variable that was visible on the variable-binding element itself is hidden. Thus, only the innermost binding of a variable is visible. The set of variable bindings in scope for an expression consists of those bindings that are visible at the point in the stylesheet where the expression occurs.

    Result Tree Fragments

    Variables introduce an additional data-type into the expression language. This additional data type is called result tree fragment. A variable may be bound to a result tree fragment instead of one of the four basic XPath data-types (string, number, boolean, node-set). A result tree fragment represents a fragment of the result tree. A result tree fragment is treated equivalently to a node-set that contains just a single root node. However, the operations permitted on a result tree fragment are a subset of those permitted on a node-set. An operation is permitted on a result tree fragment only if that operation would be permitted on a string (the operation on the string may involve first converting the string to a number or boolean). In particular, it is not permitted to use the /, //, and [] operators on result tree fragments. When a permitted operation is performed on a result tree fragment, it is performed exactly as it would be on the equivalent node-set.

    When a result tree fragment is copied into the result tree (see ), then all the nodes that are children of the root node in the equivalent node-set are added in sequence to the result tree.

    Expressions can only return values of type result tree fragment by referencing variables of type result tree fragment or calling extension functions that return a result tree fragment or getting a system property whose value is a result tree fragment.

    Values of Variables and Parameters

    A variable-binding element can specify the value of the variable in three alternative ways.

    If the variable-binding element has a select attribute, then the value of the attribute must be an expression and the value of the variable is the object that results from evaluating the expression. In this case, the content must be empty.

    If the variable-binding element does not have a select attribute and has non-empty content (i.e. the variable-binding element has one or more child nodes), then the content of the variable-binding element specifies the value. The content of the variable-binding element is a template, which is instantiated to give the value of the variable. The value is a result tree fragment equivalent to a node-set containing just a single root node having as children the sequence of nodes produced by instantiating the template. The base URI of the nodes in the result tree fragment is the base URI of the variable-binding element.

    It is an error if a member of the sequence of nodes created by instantiating the template is an attribute node or a namespace node, since a root node cannot have an attribute node or a namespace node as a child. An XSLT processor may signal the error; if it does not signal the error, it must recover by not adding the attribute node or namespace node.

    If the variable-binding element has empty content and does not have a select attribute, then the value of the variable is an empty string. Thus

    ]]>

    is equivalent to

    ]]>

    When a variable is used to select nodes by position, be careful not to do:

    2 ... ]]>

    This will output the value of the first item element, because the variable n will be bound to a result tree fragment, not a number. Instead, do either

    ... ]]>

    or

    2 ... ]]>

    One convenient way to specify the empty node-set as the default value of a parameter is:

    ]]>
    Using Values of Variables and Parameters with xsl:copy-of

    The xsl:copy-of element can be used to insert a result tree fragment into the result tree, without first converting it to a string as xsl:value-of does (see ). The required select attribute contains an expression. When the result of evaluating the expression is a result tree fragment, the complete fragment is copied into the result tree. When the result is a node-set, all the nodes in the set are copied in document order into the result tree; copying an element node copies the attribute nodes, namespace nodes and children of the element node as well as the element node itself; a root node is copied by copying its children. When the result is neither a node-set nor a result tree fragment, the result is converted to a string and then inserted into the result tree, as with xsl:value-of.

    Top-level Variables and Parameters

    Both xsl:variable and xsl:param are allowed as top-level elements. A top-level variable-binding element declares a global variable that is visible everywhere. A top-level xsl:param element declares a parameter to the stylesheet; XSLT does not define the mechanism by which parameters are passed to the stylesheet. It is an error if a stylesheet contains more than one binding of a top-level variable with the same name and same import precedence. At the top-level, the expression or template specifying the variable value is evaluated with the same context as that used to process the root node of the source document: the current node is the root node of the source document and the current node list is a list containing just the root node of the source document. If the template or expression specifying the value of a global variable x references a global variable y, then the value for y must be computed before the value of x. It is an error if it is impossible to do this for all global variable definitions; in other words, it is an error if the definitions are circular.

    This example declares a global variable para-font-size, which it references in an attribute value template.

    12pt ]]>
    Variables and Parameters within Templates

    As well as being allowed at the top-level, both xsl:variable and xsl:param are also allowed in templates. xsl:variable is allowed anywhere within a template that an instruction is allowed. In this case, the binding is visible for all following siblings and their descendants. Note that the binding is not visible for the xsl:variable element itself. xsl:param is allowed as a child at the beginning of an xsl:template element. In this context, the binding is visible for all following siblings and their descendants. Note that the binding is not visible for the xsl:param element itself.

    A binding shadows another binding if the binding occurs at a point where the other binding is visible, and the bindings have the same name. It is an error if a binding established by an xsl:variable or xsl:param element within a template shadows another binding established by an xsl:variable or xsl:param element also within the template. It is not an error if a binding established by an xsl:variable or xsl:param element in a template shadows another binding established by an xsl:variable or xsl:param top-level element. Thus, the following is an error:

    ]]>

    However, the following is allowed:

    ]]>

    The nearest equivalent in Java to an xsl:variable element in a template is a final local variable declaration with an initializer. For example,

    ]]>

    has similar semantics to

    final Object x = "value";

    XSLT does not provide an equivalent to the Java assignment operator

    x = "value";

    because this would make it harder to create an implementation that processes a document other than in a batch-like way, starting at the beginning and continuing through to the end.

    Passing Parameters to Templates

    Parameters are passed to templates using the xsl:with-param element. The required name attribute specifies the name of the parameter (the variable the value of whose binding is to be replaced). The value of the name attribute is a QName, which is expanded as described in . xsl:with-param is allowed within both xsl:call-template and xsl:apply-templates. The value of the parameter is specified in the same way as for xsl:variable and xsl:param. The current node and current node list used for computing the value specified by xsl:with-param element is the same as that used for the xsl:apply-templates or xsl:call-template element within which it occurs. It is not an error to pass a parameter x to a template that does not have an xsl:param element for x; the parameter is simply ignored.

    This example defines a named template for a numbered-block with an argument to control the format of the number.

    1. a. ]]>
    Additional Functions

    This section describes XSLT-specific additions to the core XPath function library. Some of these additional functions also make use of information specified by top-level elements in the stylesheet; this section also describes these elements.

    Multiple Source Documents

    The document function allows access to XML documents other than the main source document.

    When the document function has exactly one argument and the argument is a node-set, then the result is the union, for each node in the argument node-set, of the result of calling the document function with the first argument being the string-value of the node, and the second argument being a node-set with the node as its only member. When the document function has two arguments and the first argument is a node-set, then the result is the union, for each node in the argument node-set, of the result of calling the document function with the first argument being the string-value of the node, and with the second argument being the second argument passed to the document function.

    When the first argument to the document function is not a node-set, the first argument is converted to a string as if by a call to the string function. This string is treated as a URI reference; the resource identified by the URI is retrieved. The data resulting from the retrieval action is parsed as an XML document and a tree is constructed in accordance with the data model (see ). If there is an error retrieving the resource, then the XSLT processor may signal an error; if it does not signal an error, it must recover by returning an empty node-set. One possible kind of retrieval error is that the XSLT processor does not support the URI scheme used by the URI. An XSLT processor is not required to support any particular URI schemes. The documentation for an XSLT processor should specify which URI schemes the XSLT processor supports.

    If the URI reference does not contain a fragment identifier, then a node-set containing just the root node of the document is returned. If the URI reference does contain a fragment identifier, the function returns a node-set containing the nodes in the tree identified by the fragment identifier of the URI reference. The semantics of the fragment identifier is dependent on the media type of the result of retrieving the URI. If there is an error in processing the fragment identifier, the XSLT processor may signal the error; if it does not signal the error, it must recover by returning an empty node-set. Possible errors include:

    The fragment identifier identifies something that cannot be represented by an XSLT node-set (such as a range of characters within a text node).

    The XSLT processor does not support fragment identifiers for the media-type of the retrieval result. An XSLT processor is not required to support any particular media types. The documentation for an XSLT processor should specify for which media types the XSLT processor supports fragment identifiers.

    The data resulting from the retrieval action is parsed as an XML document regardless of the media type of the retrieval result; if the top-level media type is text, then it is parsed in the same way as if the media type were text/xml; otherwise, it is parsed in the same way as if the media type were application/xml.

    Since there is no top-level xml media type, data with a media type other than text/xml or application/xml may in fact be XML.

    The URI reference may be relative. The base URI (see ) of the node in the second argument node-set that is first in document order is used as the base URI for resolving the relative URI into an absolute URI. If the second argument is omitted, then it defaults to the node in the stylesheet that contains the expression that includes the call to the document function. Note that a zero-length URI reference is a reference to the document relative to which the URI reference is being resolved; thus document("") refers to the root node of the stylesheet; the tree representation of the stylesheet is exactly the same as if the XML document containing the stylesheet was the initial source document.

    Two documents are treated as the same document if they are identified by the same URI. The URI used for the comparison is the absolute URI into which any relative URI was resolved and does not include any fragment identifier. One root node is treated as the same node as another root node if the two nodes are from the same document. Thus, the following expression will always be true:

    generate-id(document("foo.xml"))=generate-id(document("foo.xml"))

    The document function gives rise to the possibility that a node-set may contain nodes from more than one document. With such a node-set, the relative document order of two nodes in the same document is the normal document order defined by XPath . The relative document order of two nodes in different documents is determined by an implementation-dependent ordering of the documents containing the two nodes. There are no constraints on how the implementation orders documents other than that it must do so consistently: an implementation must always use the same order for the same set of documents.

    Keys

    Keys provide a way to work with documents that contain an implicit cross-reference structure. The ID, IDREF and IDREFS attribute types in XML provide a mechanism to allow XML documents to make their cross-reference explicit. XSLT supports this through the XPath id function. However, this mechanism has a number of limitations:

    ID attributes must be declared as such in the DTD. If an ID attribute is declared as an ID attribute only in the external DTD subset, then it will be recognized as an ID attribute only if the XML processor reads the external DTD subset. However, XML does not require XML processors to read the external DTD, and they may well choose not to do so, especially if the document is declared standalone="yes".

    A document can contain only a single set of unique IDs. There cannot be separate independent sets of unique IDs.

    The ID of an element can only be specified in an attribute; it cannot be specified by the content of the element, or by a child element.

    An ID is constrained to be an XML name. For example, it cannot contain spaces.

    An element can have at most one ID.

    At most one element can have a particular ID.

    Because of these limitations XML documents sometimes contain a cross-reference structure that is not explicitly declared by ID/IDREF/IDREFS attributes.

    A key is a triple containing:

    the node which has the key

    the name of the key (an expanded-name)

    the value of the key (a string)

    A stylesheet declares a set of keys for each document using the xsl:key element. When this set of keys contains a member with node x, name y and value z, we say that node x has a key with name y and value z.

    Thus, a key is a kind of generalized ID, which is not subject to the same limitations as an XML ID:

    Keys are declared in the stylesheet using xsl:key elements.

    A key has a name as well as a value; each key name may be thought of as distinguishing a separate, independent space of identifiers.

    The value of a named key for an element may be specified in any convenient place; for example, in an attribute, in a child element or in content. An XPath expression is used to specify where to find the value for a particular named key.

    The value of a key can be an arbitrary string; it is not constrained to be a name.

    There can be multiple keys in a document with the same node, same key name, but different key values.

    There can be multiple keys in a document with the same key name, same key value, but different nodes.

    The xsl:key element is used to declare keys. The name attribute specifies the name of the key. The value of the name attribute is a QName, which is expanded as described in . The match attribute is a Pattern; an xsl:key element gives information about the keys of any node that matches the pattern specified in the match attribute. The use attribute is an expression specifying the values of the key; the expression is evaluated once for each node that matches the pattern. If the result is a node-set, then for each node in the node-set, the node that matches the pattern has a key of the specified name whose value is the string-value of the node in the node-set; otherwise, the result is converted to a string, and the node that matches the pattern has a key of the specified name with value equal to that string. Thus, a node x has a key with name y and value z if and only if there is an xsl:key element such that:

    x matches the pattern specified in the match attribute of the xsl:key element;

    the value of the name attribute of the xsl:key element is equal to y; and

    when the expression specified in the use attribute of the xsl:key element is evaluated with x as the current node and with a node list containing just x as the current node list resulting in an object u, then either z is equal to the result of converting u to a string as if by a call to the string function, or u is a node-set and z is equal to the string-value of one or more of the nodes in u.

    Note also that there may be more than one xsl:key element that matches a given node; all of the matching xsl:key elements are used, even if they do not have the same import precedence.

    It is an error for the value of either the use attribute or the match attribute to contain a VariableReference.

    The key function does for keys what the id function does for IDs. The first argument specifies the name of the key. The value of the argument must be a QName, which is expanded as described in . When the second argument to the key function is of type node-set, then the result is the union of the result of applying the key function to the string value of each of the nodes in the argument node-set. When the second argument to key is of any other type, the argument is converted to a string as if by a call to the string function; it returns a node-set containing the nodes in the same document as the context node that have a value for the named key equal to this string.

    For example, given a declaration

    ]]>

    an expression key("idkey",@ref) will return the same node-set as id(@ref), assuming that the only ID attribute declared in the XML source document is:

    ]]>

    and that the ref attribute of the current node contains no whitespace.

    Suppose a document describing a function library uses a prototype element to define functions

    ]]>

    and a function element to refer to function names

    key]]>

    Then the stylesheet could generate hyperlinks between the references and definitions as follows:

    Function: ...

    ]]>

    The key can be used to retrieve a key from a document other than the document containing the context node. For example, suppose a document contains bibliographic references in the form XSLT]]>, and there is a separate XML document bib.xml containing a bibliographic database with entries in the form:

    ...]]>

    Then the stylesheet could use the following to transform the bibref elements:

    ]]> Number Formatting

    The format-number function converts its first argument to a string using the format pattern string specified by the second argument and the decimal-format named by the third argument, or the default decimal-format, if there is no third argument. The format pattern string is in the syntax specified by the JDK 1.1 DecimalFormat class. The format pattern string is in a localized notation: the decimal-format determines what characters have a special meaning in the pattern (with the exception of the quote character, which is not localized). The format pattern must not contain the currency sign (#x00A4); support for this feature was added after the initial release of JDK 1.1. The decimal-format name must be a QName, which is expanded as described in . It is an error if the stylesheet does not contain a declaration of the decimal-format with the specified expanded-name.

    Implementations are not required to use the JDK 1.1 implementation, nor are implementations required to be implemented in Java.

    Stylesheets can use other facilities in XPath to control rounding.

    The xsl:decimal-format element declares a decimal-format, which controls the interpretation of a format pattern used by the format-number function. If there is a name attribute, then the element declares a named decimal-format; otherwise, it declares the default decimal-format. The value of the name attribute is a QName, which is expanded as described in . It is an error to declare either the default decimal-format or a decimal-format with a given name more than once (even with different import precedence), unless it is declared every time with the same value for all attributes (taking into account any default values).

    The other attributes on xsl:decimal-format correspond to the methods on the JDK 1.1 DecimalFormatSymbols class. For each get/set method pair there is an attribute defined for the xsl:decimal-format element.

    The following attributes both control the interpretation of characters in the format pattern and specify characters that may appear in the result of formatting the number:

    decimal-separator specifies the character used for the decimal sign; the default value is the period character (.)

    grouping-separator specifies the character used as a grouping (e.g. thousands) separator; the default value is the comma character (,)

    percent specifies the character used as a percent sign; the default value is the percent character (%)

    per-mille specifies the character used as a per mille sign; the default value is the Unicode per-mille character (#x2030)

    zero-digit specifies the character used as the digit zero; the default value is the digit zero (0)

    The following attributes control the interpretation of characters in the format pattern:

    digit specifies the character used for a digit in the format pattern; the default value is the number sign character (#)

    pattern-separator specifies the character used to separate positive and negative sub patterns in a pattern; the default value is the semi-colon character (;)

    The following attributes specify characters or strings that may appear in the result of formatting the number:

    infinity specifies the string used to represent infinity; the default value is the string Infinity

    NaN specifies the string used to represent the NaN value; the default value is the string NaN

    minus-sign specifies the character used as the default minus sign; the default value is the hyphen-minus character (-, #x2D)

    Miscellaneous Additional Functions

    The current function returns a node-set that has the current node as its only member. For an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node. Thus,

    ]]>

    means the same as

    ]]>

    However, within square brackets the current node is usually different from the context node. For example,

    ]]>

    will process all item elements that have a glossary parent element and that have a name attribute with value equal to the value of the current node's ref attribute. This is different from

    ]]>

    which means the same as

    ]]>

    and so would process all item elements that have a glossary parent element and that have a name attribute and a ref attribute with the same value.

    It is an error to use the current function in a pattern.

    The unparsed-entity-uri returns the URI of the unparsed entity with the specified name in the same document as the context node (see ). It returns the empty string if there is no such entity.

    The generate-id function returns a string that uniquely identifies the node in the argument node-set that is first in document order. The unique identifier must consist of ASCII alphanumeric characters and must start with an alphabetic character. Thus, the string is syntactically an XML name. An implementation is free to generate an identifier in any convenient way provided that it always generates the same identifier for the same node and that different identifiers are always generated from different nodes. An implementation is under no obligation to generate the same identifiers each time a document is transformed. There is no guarantee that a generated unique identifier will be distinct from any unique IDs specified in the source document. If the argument node-set is empty, the empty string is returned. If the argument is omitted, it defaults to the context node.

    The argument must evaluate to a string that is a QName. The QName is expanded into a name using the namespace declarations in scope for the expression. The system-property function returns an object representing the value of the system property identified by the name. If there is no such system property, the empty string should be returned.

    Implementations must provide the following system properties, which are all in the XSLT namespace:

    xsl:version, a number giving the version of XSLT implemented by the processor; for XSLT processors implementing the version of XSLT specified by this document, this is the number 1.0 xsl:vendor, a string identifying the vendor of the XSLT processor xsl:vendor-url, a string containing a URL identifying the vendor of the XSLT processor; typically this is the host page (home page) of the vendor's Web site.
    Messages

    The xsl:message instruction sends a message in a way that is dependent on the XSLT processor. The content of the xsl:message instruction is a template. The xsl:message is instantiated by instantiating the content to create an XML fragment. This XML fragment is the content of the message.

    An XSLT processor might implement xsl:message by popping up an alert box or by writing to a log file.

    If the terminate attribute has the value yes, then the XSLT processor should terminate processing after sending the message. The default value is no.

    One convenient way to do localization is to put the localized information (message text, etc.) in an XML document, which becomes an additional input file to the stylesheet. For example, suppose messages for a language L are stored in an XML file resources/L.xml in the form:

    A problem was detected. An error was detected. ]]>

    Then a stylesheet could use the following approach to localize messages:

    problem ]]>
    Extensions

    XSLT allows two kinds of extension, extension elements and extension functions.

    This version of XSLT does not provide a mechanism for defining implementations of extensions. Therefore, an XSLT stylesheet that must be portable between XSLT implementations cannot rely on particular extensions being available. XSLT provides mechanisms that allow an XSLT stylesheet to determine whether the XSLT processor by which it is being processed has implementations of particular extensions available, and to specify what should happen if those extensions are not available. If an XSLT stylesheet is careful to make use of these mechanisms, it is possible for it to take advantage of extensions and still work with any XSLT implementation.

    Extension Elements

    The element extension mechanism allows namespaces to be designated as extension namespaces. When a namespace is designated as an extension namespace and an element with a name from that namespace occurs in a template, then the element is treated as an instruction rather than as a literal result element. The namespace determines the semantics of the instruction.

    Since an element that is a child of an xsl:stylesheet element is not occurring in a template, non-XSLT top-level elements are not extension elements as defined here, and nothing in this section applies to them.

    A namespace is designated as an extension namespace by using an extension-element-prefixes attribute on an xsl:stylesheet element or an xsl:extension-element-prefixes attribute on a literal result element or extension element. The value of both these attributes is a whitespace-separated list of namespace prefixes. The namespace bound to each of the prefixes is designated as an extension namespace. It is an error if there is no namespace bound to the prefix on the element bearing the extension-element-prefixes or xsl:extension-element-prefixes attribute. The default namespace (as declared by xmlns) may be designated as an extension namespace by including #default in the list of namespace prefixes. The designation of a namespace as an extension namespace is effective within the subtree of the stylesheet rooted at the element bearing the extension-element-prefixes or xsl:extension-element-prefixes attribute; a subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element.

    If the XSLT processor does not have an implementation of a particular extension element available, then the element-available function must return false for the name of the element. When such an extension element is instantiated, then the XSLT processor must perform fallback for the element as specified in . An XSLT processor must not signal an error merely because a template contains an extension element for which no implementation is available.

    If the XSLT processor has an implementation of a particular extension element available, then the element-available function must return true for the name of the element.

    Extension Functions

    If a FunctionName in a FunctionCall expression is not an NCName (i.e. if it contains a colon), then it is treated as a call to an extension function. The FunctionName is expanded to a name using the namespace declarations from the evaluation context.

    If the XSLT processor does not have an implementation of an extension function of a particular name available, then the function-available function must return false for that name. If such an extension function occurs in an expression and the extension function is actually called, the XSLT processor must signal an error. An XSLT processor must not signal an error merely because an expression contains an extension function for which no implementation is available.

    If the XSLT processor has an implementation of an extension function of a particular name available, then the function-available function must return true for that name. If such an extension is called, then the XSLT processor must call the implementation passing it the function call arguments; the result returned by the implementation is returned as the result of the function call.

    Fallback

    Normally, instantiating an xsl:fallback element does nothing. However, when an XSLT processor performs fallback for an instruction element, if the instruction element has one or more xsl:fallback children, then the content of each of the xsl:fallback children must be instantiated in sequence; otherwise, an error must be signaled. The content of an xsl:fallback element is a template.

    The following functions can be used with the xsl:choose and xsl:if instructions to explicitly control how a stylesheet should behave if particular elements or functions are not available.

    The argument must evaluate to a string that is a QName. The QName is expanded into an expanded-name using the namespace declarations in scope for the expression. The element-available function returns true if and only if the expanded-name is the name of an instruction. If the expanded-name has a namespace URI equal to the XSLT namespace URI, then it refers to an element defined by XSLT. Otherwise, it refers to an extension element. If the expanded-name has a null namespace URI, the element-available function will return false.

    The argument must evaluate to a string that is a QName. The QName is expanded into an expanded-name using the namespace declarations in scope for the expression. The function-available function returns true if and only if the expanded-name is the name of a function in the function library. If the expanded-name has a non-null namespace URI, then it refers to an extension function; otherwise, it refers to a function defined by XPath or XSLT.

    Output

    An XSLT processor may output the result tree as a sequence of bytes, although it is not required to be able to do so (see ). The xsl:output element allows stylesheet authors to specify how they wish the result tree to be output. If an XSLT processor outputs the result tree, it should do so as specified by the xsl:output element; however, it is not required to do so.

    The xsl:output element is only allowed as a top-level element.

    The method attribute on xsl:output identifies the overall method that should be used for outputting the result tree. The value must be a QName. If the QName does not have a prefix, then it identifies a method specified in this document and must be one of xml, html or text. If the QName has a prefix, then the QName is expanded into an expanded-name as described in ; the expanded-name identifies the output method; the behavior in this case is not specified by this document.

    The default for the method attribute is chosen as follows. If

    the root node of the result tree has an element child,

    the expanded-name of the first element child of the root node (i.e. the document element) of the result tree has local part html (in any combination of upper and lower case) and a null namespace URI, and

    any text nodes preceding the first element child of the root node of the result tree contain only whitespace characters,

    then the default output method is html; otherwise, the default output method is xml. The default output method should be used if there are no xsl:output elements or if none of the xsl:output elements specifies a value for the method attribute.

    The other attributes on xsl:output provide parameters for the output method. The following attributes are allowed:

    version specifies the version of the output method

    indent specifies whether the XSLT processor may add additional whitespace when outputting the result tree; the value must be yes or no

    encoding specifies the preferred character encoding that the XSLT processor should use to encode sequences of characters as sequences of bytes; the value of the attribute should be treated case-insensitively; the value must contain only characters in the range #x21 to #x7E (i.e. printable ASCII characters); the value should either be a charset registered with the Internet Assigned Numbers Authority , or start with X-

    media-type specifies the media type (MIME content type) of the data that results from outputting the result tree; the charset parameter should not be specified explicitly; instead, when the top-level media type is text, a charset parameter should be added according to the character encoding actually used by the output method

    doctype-system specifies the system identifier to be used in the document type declaration

    doctype-public specifies the public identifier to be used in the document type declaration

    omit-xml-declaration specifies whether the XSLT processor should output an XML declaration; the value must be yes or no

    standalone specifies whether the XSLT processor should output a standalone document declaration; the value must be yes or no

    cdata-section-elements specifies a list of the names of elements whose text node children should be output using CDATA sections

    The detailed semantics of each attribute will be described separately for each output method for which it is applicable. If the semantics of an attribute are not described for an output method, then it is not applicable to that output method.

    A stylesheet may contain multiple xsl:output elements and may include or import stylesheets that also contain xsl:output elements. All the xsl:output elements occurring in a stylesheet are merged into a single effective xsl:output element. For the cdata-section-elements attribute, the effective value is the union of the specified values. For other attributes, the effective value is the specified value with the highest import precedence. It is an error if there is more than one such value for an attribute. An XSLT processor may signal the error; if it does not signal the error, if should recover by using the value that occurs last in the stylesheet. The values of attributes are defaulted after the xsl:output elements have been merged; different output methods may have different default values for an attribute.

    XML Output Method

    The xml output method outputs the result tree as a well-formed XML external general parsed entity. If the root node of the result tree has a single element node child and no text node children, then the entity should also be a well-formed XML document entity. When the entity is referenced within a trivial XML document wrapper like this

    entity-URI ]> &e;]]>

    where entity-URI is a URI for the entity, then the wrapper document as a whole should be a well-formed XML document conforming to the XML Namespaces Recommendation . In addition, the output should be such that if a new tree was constructed by parsing the wrapper as an XML document as specified in , and then removing the document element, making its children instead be children of the root node, then the new tree would be the same as the result tree, with the following possible exceptions:

    The order of attributes in the two trees may be different.

    The new tree may contain namespace nodes that were not present in the result tree.

    An XSLT processor may need to add namespace declarations in the course of outputting the result tree as XML.

    If the XSLT processor generated a document type declaration because of the doctype-system attribute, then the above requirements apply to the entity with the generated document type declaration removed.

    The version attribute specifies the version of XML to be used for outputting the result tree. If the XSLT processor does not support this version of XML, it should use a version of XML that it does support. The version output in the XML declaration (if an XML declaration is output) should correspond to the version of XML that the processor used for outputting the result tree. The value of the version attribute should match the VersionNum production of the XML Recommendation . The default value is 1.0.

    The encoding attribute specifies the preferred encoding to use for outputting the result tree. XSLT processors are required to respect values of UTF-8 and UTF-16. For other values, if the XSLT processor does not support the specified encoding it may signal an error; if it does not signal an error it should use UTF-8 or UTF-16 instead. The XSLT processor must not use an encoding whose name does not match the EncName production of the XML Recommendation . If no encoding attribute is specified, then the XSLT processor should use either UTF-8 or UTF-16. It is possible that the result tree will contain a character that cannot be represented in the encoding that the XSLT processor is using for output. In this case, if the character occurs in a context where XML recognizes character references (i.e. in the value of an attribute node or text node), then the character should be output as a character reference; otherwise (for example if the character occurs in the name of an element) the XSLT processor should signal an error.

    If the indent attribute has the value yes, then the xml output method may output whitespace in addition to the whitespace in the result tree (possibly based on whitespace stripped from either the source document or the stylesheet) in order to indent the result nicely; if the indent attribute has the value no, it should not output any additional whitespace. The default value is no. The xml output method should use an algorithm to output additional whitespace that ensures that the result if whitespace were to be stripped from the output using the process described in with the set of whitespace-preserving elements consisting of just xsl:text would be the same when additional whitespace is output as when additional whitespace is not output.

    It is usually not safe to use indent="yes" with document types that include element types with mixed content.

    The cdata-section-elements attribute contains a whitespace-separated list of QNames. Each QName is expanded into an expanded-name using the namespace declarations in effect on the xsl:output element in which the QName occurs; if there is a default namespace, it is used for QNames that do not have a prefix. The expansion is performed before the merging of multiple xsl:output elements into a single effective xsl:output element. If the expanded-name of the parent of a text node is a member of the list, then the text node should be output as a CDATA section. For example,

    ]]>

    would cause a literal result element written in the stylesheet as

    <foo>]]>

    or as

    <example><![CDATA[<foo>]]></example>

    to be output as

    <example><![CDATA[<foo>]]></example>

    If the text node contains the sequence of characters ]]>, then the currently open CDATA section should be closed following the ]] and a new CDATA section opened before the >. For example, a literal result element written in the stylesheet as

    <example>]]&gt;</example>

    would be output as

    <example><![CDATA[]]]]><![CDATA[>]]></example>

    If the text node contains a character that is not representable in the character encoding being used to output the result tree, then the currently open CDATA section should be closed before the character, the character should be output using a character reference or entity reference, and a new CDATA section should be opened for any further characters in the text node.

    CDATA sections should not be used except for text nodes that the cdata-section-elements attribute explicitly specifies should be output using CDATA sections.

    The xml output method should output an XML declaration unless the omit-xml-declaration attribute has the value yes. The XML declaration should include both version information and an encoding declaration. If the standalone attribute is specified, it should include a standalone document declaration with the same value as the value as the value of the standalone attribute. Otherwise, it should not include a standalone document declaration; this ensures that it is both a XML declaration (allowed at the beginning of a document entity) and a text declaration (allowed at the beginning of an external general parsed entity).

    If the doctype-system attribute is specified, the xml output method should output a document type declaration immediately before the first element. The name following <!DOCTYPE should be the name of the first element. If doctype-public attribute is also specified, then the xml output method should output PUBLIC followed by the public identifier and then the system identifier; otherwise, it should output SYSTEM followed by the system identifier. The internal subset should be empty. The doctype-public attribute should be ignored unless the doctype-system attribute is specified.

    The media-type attribute is applicable for the xml output method. The default value for the media-type attribute is text/xml.

    HTML Output Method

    The html output method outputs the result tree as HTML; for example,

    <xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;"> ... ]]>

    The version attribute indicates the version of the HTML. The default value is 4.0, which specifies that the result should be output as HTML conforming to the HTML 4.0 Recommendation .

    The html output method should not output an element differently from the xml output method unless the expanded-name of the element has a null namespace URI; an element whose expanded-name has a non-null namespace URI should be output as XML. If the expanded-name of the element has a null namespace URI, but the local part of the expanded-name is not recognized as the name of an HTML element, the element should output in the same way as a non-empty, inline element such as span.

    The html output method should not output an end-tag for empty elements. For HTML 4.0, the empty elements are area, base, basefont, br, col, frame, hr, img, input, isindex, link, meta and param. For example, an element written as <br/> or <br></br> in the stylesheet should be output as <br>.

    The html output method should recognize the names of HTML elements regardless of case. For example, elements named br, BR or Br should all be recognized as the HTML br element and output without an end-tag.

    The html output method should not perform escaping for the content of the script and style elements. For example, a literal result element written in the stylesheet as

    if (a < b) foo()]]>

    or

    ]]>

    should be output as

    if (a < b) foo()]]>

    The html output method should not escape < characters occurring in attribute values.

    If the indent attribute has the value yes, then the html output method may add or remove whitespace as it outputs the result tree, so long as it does not change how an HTML user agent would render the output. The default value is yes.

    The html output method should escape non-ASCII characters in URI attribute values using the method recommended in Section B.2.1 of the HTML 4.0 Recommendation.

    The html output method may output a character using a character entity reference, if one is defined for it in the version of HTML that the output method is using.

    The html output method should terminate processing instructions with > rather than ?>.

    The html output method should output boolean attributes (that is attributes with only a single allowed value that is equal to the name of the attribute) in minimized form. For example, a start-tag written in the stylesheet as

    ]]>

    should be output as

    ]]>

    The html output method should not escape a & character occurring in an attribute value immediately followed by a { character (see Section B.7.1 of the HTML 4.0 Recommendation). For example, a start-tag written in the stylesheet as

    ]]>

    should be output as

    ]]>

    The encoding attribute specifies the preferred encoding to be used. If there is a HEAD element, then the html output method should add a META element immediately after the start-tag of the HEAD element specifying the character encoding actually used. For example,

    ...]]>

    It is possible that the result tree will contain a character that cannot be represented in the encoding that the XSLT processor is using for output. In this case, if the character occurs in a context where HTML recognizes character references, then the character should be output as a character entity reference or decimal numeric character reference; otherwise (for example, in a script or style element or in a comment), the XSLT processor should signal an error.

    If the doctype-public or doctype-system attributes are specified, then the html output method should output a document type declaration immediately before the first element. The name following <!DOCTYPE should be HTML or html. If the doctype-public attribute is specified, then the output method should output PUBLIC followed by the specified public identifier; if the doctype-system attribute is also specified, it should also output the specified system identifier following the public identifier. If the doctype-system attribute is specified but the doctype-public attribute is not specified, then the output method should output SYSTEM followed by the specified system identifier.

    The media-type attribute is applicable for the html output method. The default value is text/html.

    Text Output Method

    The text output method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping.

    The media-type attribute is applicable for the text output method. The default value for the media-type attribute is text/plain.

    The encoding attribute identifies the encoding that the text output method should use to convert sequences of characters to sequences of bytes. The default is system-dependent. If the result tree contains a character that cannot be represented in the encoding that the XSLT processor is using for output, the XSLT processor should signal an error.

    Disabling Output Escaping

    Normally, the xml output method escapes & and < (and possibly other characters) when outputting text nodes. This ensures that the output is well-formed XML. However, it is sometimes convenient to be able to produce output that is almost, but not quite well-formed XML; for example, the output may include ill-formed sections which are intended to be transformed into well-formed XML by a subsequent non-XML aware process. For this reason, XSLT provides a mechanism for disabling output escaping. An xsl:value-of or xsl:text element may have a disable-output-escaping attribute; the allowed values are yes or no; the default is no; if the value is yes, then a text node generated by instantiating the xsl:value-of or xsl:text element should be output without any escaping. For example,

    <]]>

    should generate the single character <.

    It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree. Thus, it is an error to disable output escaping for an xsl:value-of or xsl:text element that is used to generate the string-value of a comment, processing instruction or attribute node; it is also an error to convert a result tree fragment to a number or a string if the result tree fragment contains a text node for which escaping was disabled. In both cases, an XSLT processor may signal the error; if it does not signal the error, it must recover by ignoring the disable-output-escaping attribute.

    The disable-output-escaping attribute may be used with the html output method as well as with the xml output method. The text output method ignores the disable-output-escaping attribute, since it does not perform any output escaping.

    An XSLT processor will only be able to disable output escaping if it controls how the result tree is output. This may not always be the case. For example, the result tree may be used as the source tree for another XSLT transformation instead of being output. An XSLT processor is not required to support disabling output escaping. If an xsl:value-of or xsl:text specifies that output escaping should be disabled and the XSLT processor does not support this, the XSLT processor may signal an error; if it does not signal an error, it must recover by not disabling output escaping.

    If output escaping is disabled for a character that is not representable in the encoding that the XSLT processor is using for output, then the XSLT processor may signal an error; if it does not signal an error, it must recover by not disabling output escaping.

    Since disabling output escaping may not work with all XSLT processors and can result in XML that is not well-formed, it should be used only when there is no alternative.

    Conformance

    A conforming XSLT processor must be able to use a stylesheet to transform a source tree into a result tree as specified in this document. A conforming XSLT processor need not be able to output the result in XML or in any other form.

    Vendors of XSLT processors are strongly encouraged to provide a way to verify that their processor is behaving conformingly by allowing the result tree to be output as XML or by providing access to the result tree through a standard API such as the DOM or SAX.

    A conforming XSLT processor must signal any errors except for those that this document specifically allows an XSLT processor not to signal. A conforming XSLT processor may but need not recover from any errors that it signals.

    A conforming XSLT processor may impose limits on the processing resources consumed by the processing of a stylesheet.

    Notation

    The specification of each XSLT-defined element type is preceded by a summary of its syntax in the form of a model for elements of that element type. The meaning of syntax summary notation is as follows:

    An attribute is required if and only if its name is in bold.

    The string that occurs in the place of an attribute value specifies the allowed values of the attribute. If this is surrounded by curly braces, then the attribute value is treated as an attribute value template, and the string occurring within curly braces specifies the allowed values of the result of instantiating the attribute value template. Alternative allowed values are separated by |. A quoted string indicates a value equal to that specific string. An unquoted, italicized name specifies a particular type of value.

    If the element is allowed not to be empty, then the element contains a comment specifying the allowed content. The allowed content is specified in a similar way to an element type declaration in XML; template means that any mixture of text nodes, literal result elements, extension elements, and XSLT elements from the instruction category is allowed; top-level-elements means that any mixture of XSLT elements from the top-level-element category is allowed.

    The element is prefaced by comments indicating if it belongs to the instruction category or top-level-element category or both. The category of an element just affects whether it is allowed in the content of elements that allow a template or top-level-elements.

    References Normative References World Wide Web Consortium. Extensible Markup Language (XML) 1.0. W3C Recommendation. See http://www.w3.org/TR/1998/REC-xml-19980210 World Wide Web Consortium. Namespaces in XML. W3C Recommendation. See http://www.w3.org/TR/REC-xml-names World Wide Web Consortium. XML Path Language. W3C Recommendation. See http://www.w3.org/TR/xpath Other References World Wide Web Consortium. Cascading Style Sheets, level 2 (CSS2). W3C Recommendation. See http://www.w3.org/TR/1998/REC-CSS2-19980512 International Organization for Standardization, International Electrotechnical Commission. ISO/IEC 10179:1996. Document Style Semantics and Specification Language (DSSSL). International Standard. World Wide Web Consortium. HTML 4.0 specification. W3C Recommendation. See http://www.w3.org/TR/REC-html40 Internet Assigned Numbers Authority. Character Sets. See ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets. N. Freed, J. Postel. IANA Charset Registration Procedures. IETF RFC 2278. See http://www.ietf.org/rfc/rfc2278.txt. E. Whitehead, M. Murata. XML Media Types. IETF RFC 2376. See http://www.ietf.org/rfc/rfc2376.txt. T. Berners-Lee, R. Fielding, and L. Masinter. Uniform Resource Identifiers (URI): Generic Syntax. IETF RFC 2396. See http://www.ietf.org/rfc/rfc2396.txt. Unicode Consortium. Unicode Technical Report #10. Unicode Collation Algorithm. Unicode Technical Report. See http://www.unicode.org/unicode/reports/tr10/index.html. World Wide Web Consortium. XHTML 1.0: The Extensible HyperText Markup Language. W3C Proposed Recommendation. See http://www.w3.org/TR/xhtml1 World Wide Web Consortium. XML Pointer Language (XPointer). W3C Working Draft. See http://www.w3.org/TR/xptr World Wide Web Consortium. Associating stylesheets with XML documents. W3C Recommendation. See http://www.w3.org/TR/xml-stylesheet World Wide Web Consortium. Extensible Stylesheet Language (XSL). W3C Working Draft. See http://www.w3.org/TR/WD-xsl Element Syntax Summary DTD Fragment for XSLT Stylesheets

    This DTD Fragment is not normative because XML 1.0 DTDs do not support XML Namespaces and thus cannot correctly describe the allowed structure of an XSLT stylesheet.

    The following entity can be used to construct a DTD for XSLT stylesheets that create instances of a particular result DTD. Before referencing the entity, the stylesheet DTD must define a result-elements parameter entity listing the allowed result element types. For example:

    ]]>

    Such result elements should be declared to have xsl:use-attribute-sets and xsl:extension-element-prefixes attributes. The following entity declares the result-element-atts parameter for this purpose. The content that XSLT allows for result elements is the same as it allows for the XSLT elements that are declared in the following entity with a content model of %template;. The DTD may use a more restrictive content model than %template; to reflect the constraints of the result DTD.

    The DTD may define the non-xsl-top-level parameter entity to allow additional top-level elements from namespaces other than the XSLT namespace.

    The use of the xsl: prefix in this DTD does not imply that XSLT stylesheets are required to use this prefix. Any of the elements declared in this DTD may have attributes whose name starts with xmlns: or is equal to xmlns in addition to the attributes declared in this DTD.

    &XSLT.ns; ]]>
    Examples Document Example

    This example is a stylesheet for transforming documents that conform to a simple DTD into XHTML . The DTD is:

    ]]>

    The stylesheet is:

    <xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" xmlns="&XHTML.ns;"> <xsl:value-of select="title"/>

    NOTE:

    ]]>

    With the following input document

    Document Title Chapter Title
    Section Title This is a test. This is a note.
    Another Section Title This is another test. This is another note.
    ]]>

    it would produce the following result

    <?xml version="1.0" encoding="iso-8859-1"?> <html xmlns="&XHTML.ns;"> Document Title

    Document Title

    Chapter Title

    Section Title

    This is a test.

    NOTE: This is a note.

    Another Section Title

    This is another test.

    NOTE: This is another note.

    ]]>
    Data Example

    This is an example of transforming some data represented in XML using three different XSLT stylesheets to produce three different representations of the data, HTML, SVG and VRML.

    The input data is:

    10 9 7 4 3 4 6 -1.5 2 ]]>

    The following stylesheet, which uses the simplified syntax described in , transforms the data into HTML:

    <html xsl:version="1.0" xmlns:xsl="&XSLT.ns;" Sales Results By Division
    Division Revenue Growth Bonus
    color:red
    ]]>

    The HTML output is:

    Sales Results By Division
    DivisionRevenueGrowthBonus
    North1097
    West6-1.52
    South434
    ]]>

    The following stylesheet transforms the data into SVG:

    <xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;" Revenue Division ]]>

    The SVG output is:

    Revenue Division North 10 South 4 West 6 ]]>

    The following stylesheet transforms the data into VRML:

    <xsl:stylesheet version="1.0" xmlns:xsl="&XSLT.ns;"> #VRML V2.0 utf8 # externproto definition of a single bar element EXTERNPROTO bar [ field SFInt32 x field SFInt32 y field SFInt32 z field SFString name ] "http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl" # inline containing the graph axes Inline { url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl" } bar { x y z name "" } ]]>

    The VRML output is:

    Acknowledgements

    The following have contributed to authoring this draft:

    Daniel Lipkin, Saba Jonathan Marsh, Microsoft Henry Thompson, University of Edinburgh Norman Walsh, Arbortext Steve Zilles, Adobe

    This specification was developed and approved for publication by the W3C XSL Working Group (WG). WG approval of this specification does not necessarily imply that all WG members voted for its approval. The current members of the XSL WG are:

    Sharon Adler IBM Co-Chair Anders Berglund IBM Perin Blanchard Novell Scott Boag Lotus Larry Cable Sun Jeff Caruso Bitstream James Clark Peter Danielsen Bell Labs Don Day IBM Stephen Deach Adobe Dwayne Dicks SoftQuad Andrew Greene Bitstream Paul Grosso Arbortext Eduardo Gutentag Sun Juliane Harbarth Software AG Mickey Kimchi Enigma Chris Lilley W3C Chris Maden Exemplary Technologies Jonathan Marsh Microsoft Alex Milowski Lexica Steve Muench Oracle Scott Parnell Xerox Vincent Quint W3C Dan Rapp Novell Gregg Reynolds Datalogics Jonathan Robie Software AG Mark Scardina Oracle Henry Thompson University of Edinburgh Philip Wadler Bell Labs Norman Walsh Arbortext Sanjiva Weerawarana IBM Steve Zilles Adobe Co-Chair
    Changes from Proposed Recommendation

    The following are the changes since the Proposed Recommendation:

    The xsl:version attribute is required on a literal result element used as a stylesheet (see ).

    The data-type attribute on xsl:sort can use a prefixed name to specify a data-type not defined by XSLT (see ).

    Features under Consideration for Future Versions of XSLT

    The following features are under consideration for versions of XSLT after XSLT 1.0:

    a conditional expression;

    support for XML Schema datatypes and archetypes;

    support for something like style rules in the original XSL submission;

    an attribute to control the default namespace for names occurring in XSLT attributes;

    support for entity references;

    support for DTDs in the data model;

    support for notations in the data model;

    a way to get back from an element to the elements that reference it (e.g. by IDREF attributes);

    an easier way to get an ID or key in another document;

    support for regular expressions for matching against any or all of text nodes, attribute values, attribute names, element type names;

    case-insensitive comparisons;

    normalization of strings before comparison, for example for compatibility characters;

    a function string resolve(node-set) function that treats the value of the argument as a relative URI and turns it into an absolute URI using the base URI of the node;

    multiple result documents;

    defaulting the select attribute on xsl:value-of to the current node;

    an attribute on xsl:attribute to control how the attribute value is normalized;

    additional attributes on xsl:sort to provide further control over sorting, such as relative order of scripts;

    a way to put the text of a resource identified by a URI into the result tree;

    allow unions in steps (e.g. foo/(bar|baz));

    allow for result tree fragments all operations that are allowed for node-sets;

    a way to group together consecutive nodes having duplicate subelements or attributes;

    features to make handling of the HTML style attribute more convenient.

    tdom-0.9.1/tests/data/PaxHeaders.9215/domCmd1.dtd0000644000175000001440000000013213325450307017465 xustar000000000000000030 mtime=1532383431.441385797 30 atime=1532383431.499385624 30 ctime=1532383431.441385797 tdom-0.9.1/tests/data/domCmd1.dtd0000644000175000001440000000005413325450307016702 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/domCmd2.dtd0000644000175000001440000000013213325450307017466 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/domCmd2.dtd0000644000175000001440000000005413325450307016703 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/i18n_2.xml0000644000175000001440000000013213325450307017226 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.500385621 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/i18n_2.xml0000644000175000001440000000027713325450307016452 0ustar00rolfusers00000000000000 german umlauts: äöüß tdom-0.9.1/tests/data/PaxHeaders.9215/books.xml0000644000175000001440000000013213325450307017343 xustar000000000000000030 mtime=1532383431.441385797 30 atime=1532383431.499385624 30 ctime=1532383431.441385797 tdom-0.9.1/tests/data/books.xml0000644000175000001440000000361613325450307016567 0ustar00rolfusers00000000000000 Seven Years in Trenton Joe Bob Trenton Literary Review Honorable Mention 12 History of Trenton Mary Bob Selected Short Stories of Mary Bob 55 Tracking Trenton 2.50 Trenton Today, Trenton Tomorrow Toni Bob B.A. Ph.D. Pulizer Still in Trenton Trenton Forever 6.50

    It was a dark and stormy night.

    But then all nights in Trenton seem dark and stormy to someone who has gone through what I have.

    Trenton misery
    Who's Who in Trenton Robert Bob
    tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.4.dtd0000644000175000001440000000013213325450307017261 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.4.dtd0000644000175000001440000000015213325450307016475 0ustar00rolfusers00000000000000 ]]> ]]> tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-5.2.dtd0000644000175000001440000000013213325450307017256 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-5.2.dtd0000644000175000001440000000007213325450307016473 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.6.dtd0000644000175000001440000000013213325450307017263 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.500385621 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.6.dtd0000644000175000001440000000014413325450307016500 0ustar00rolfusers00000000000000 ]]> tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.1.dtd0000644000175000001440000000013213325450307017256 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.1.dtd0000644000175000001440000000005213325450307016471 0ustar00rolfusers00000000000000 ]]> tdom-0.9.1/tests/data/PaxHeaders.9215/dtd-6.2.dtd0000644000175000001440000000013213325450307017257 xustar000000000000000030 mtime=1532383431.442385794 30 atime=1532383431.499385624 30 ctime=1532383431.442385794 tdom-0.9.1/tests/data/dtd-6.2.dtd0000644000175000001440000000001713325450307016473 0ustar00rolfusers00000000000000 tdom-0.9.1/tests/PaxHeaders.9215/domNode.test0000644000175000001440000000013213325450307017061 xustar000000000000000030 mtime=1532383431.445385785 30 atime=1532383431.501385618 30 ctime=1532383431.445385785 tdom-0.9.1/tests/domNode.test0000644000175000001440000031173113325450307016305 0ustar00rolfusers00000000000000# Features covered: domNode command and nodeObj commands # # This file contains a collection of tests for the two interfaces to # DOM nodes, the token interface (the domNode command) and the tcl # command interface ([$nodeObj method ...]). # # domNode-1.*: domNode command syntax # domNode-2.*: selectNodes # domNode-3.*: documentElement # domNode-4.*: setAttributeNS # domNode-5.*: removeChild # domNode-6.*: appendChild # domNode-7.*: getElementsByTagName # domNode-8.*: getElementsByTagNameNS # domNode-9.*: nodeValue # domNode-10.*: setAttribute, again setAttributeNS # domNode-11.*: disableOutputEscaping # domNode-12.*: cloneNode # domNode-13.*: appendFromScript # domNode-14.*: appendFromList # domNode-15.*: delete # domNode-16.*: getAttribute # domNode-17.*: nodeType # domNode-18.*: attributes, attributeNames # domNode-19.*: removeAttribute, removeAttributeNS # domNode-20.*: parentNode # domNode-21.*: hasChildNodes # domNode-22.*: localName, prefix # domNode-23.*: replaceChild # domNode-24.*: getLine, getColumn # domNode-25.*: hasAttribute, hasAttributeNS # domNode-26.*: appendXML # domNode-27.*: target, data # domNode-28.*: getAttributeNS # domNode-29.*: ownerDocument # domNode-30.*: precedes # domNode-31.*: insertBefore # domNode-32.*: asText # domNode-33.*: insertBeforeFromScript # domNode-34.*: getBaseURI # domNode-35.*: objCmd traces # domNode-36.*: nodeName # domNode-37.*: baseURI # domNode-38.*: toXPath # domNode-39.*: text # domNode-999.* Misc Tests # # Copyright (c) 2002 - 2005 Rolf Ade. # # RCS: @(#) $Id$ source [file join [file dir [info script]] loadtdom.tcl] testConstraint threaded [info exists tcl_platform(threaded)] test domNode-1.1 {too less arguments to nodecmd} { set doc [dom createDocument "root"] set root [$doc documentElement] set result [catch {$root}] $doc delete set result } {1} test domNode-1.2 {too less arguments to domNode token} { set doc [dom createDocument "root"] set root [$doc documentElement] set result [catch {domNode $root}] $doc delete set result } {1} test domNode-1.3 {too less arguments to domNode command} { catch {domNode} } {1} test domNode-1.4 {rename of domNodeObj cmd} {knownBug} { set doc [dom createDocument "root"] set root [$doc documentElement] rename $root my_domNode set result [llength [info commands my_domNode]] $doc delete lappend result [llength [info commands my_domNode]] catch {my_domNode nodeName} errMsg lappend result $errMsg } {1 0} test domNode-1.5 {domNode command: invalid token} { set xml {12} set doc [dom parse $xml] set root [domDoc $doc documentElement] set invalidToken [domNode $root firstChild] lappend invalidToken foo set result [catch {domNode $invalidToken selectNodes string(.)}] $doc delete set result } {1} test domNode-1.6 {domNode command: invalid token} { set xml {12} set doc [dom parse $xml] set root [domDoc $doc documentElement] set invalidToken [domNode $root firstChild] append invalidToken "\n" set result [catch {domNode $invalidToken selectNodes string(.)}] $doc delete set result } {1} proc domNode-1.7-traceproc {args} { error "error in nodeObjVar trace" } test domNode-1.7 {error in trace on nodeObjVar} { set xml {12} set doc [dom parse $xml] set root [$doc documentElement] trace add variable resultVar write domNode-1.7-traceproc set result [catch {$root firstChild resultVar} errMsg] lappend result $errMsg trace remove variable resultVar write domNode-1.7-traceproc $doc delete set result } {1 {can't set "resultVar": error in nodeObjVar trace}} set doc [dom parse { }] set root [$doc documentElement] test domNode-2.1 {selectNodes - -namespace option: syntax} { set result [catch {$root selectNodes -namespaces elem1ns:elem1} errMsg] lappend result $errMsg } {1 {The "-namespaces" option requires a 'prefix namespace' pairs list as argument}} test domNode-2.2 {selectNodes - -namespace option} { set result [$root selectNodes -namespaces {} elem1] } {} test domNode-2.3 {selectNodes - -namespaces option} { set node [$root selectNodes -namespaces {my elem1NS} my:elem1] set result [list] lappend result [$node localName] [$node namespaceURI] } {elem1 elem1NS} test domNode-2.4 {selectNodes - -namespaces option} { set node [$root selectNodes -namespaces {my elem1NS my elem2NS} my:*] set result [list] lappend result [$node localName] [$node namespaceURI] } {elem1 elem1NS} test domNode-2.5 {selectNodes - -namespaces option} { set nsDef [list this elem2NS same elem2NS] set node [$root selectNodes -namespaces $nsDef {this:*|same:*}] set result [llength $node] lappend result [$node localName] [$node namespaceURI] } {1 elem2 elem2NS} test domNode-2.6 {selectNodes - -namespaces option} { set nsDef1 [list foo elem2NS bar elem2NS] set nsDef2 [list this elem2NS same elem2NS] set node [$root selectNodes -namespaces $nsDef1 \ -namespaces $nsDef2 {this:*|same:*}] set result [llength $node] lappend result [$node localName] [$node namespaceURI] } {1 elem2 elem2NS} test domNode-2.7 {selectNodes - -namespaces option} { set result [catch {$root selectNodes -namespaces elem1ns:elem1 typevar} errMsg] lappend result $errMsg } {1 {The "-namespaces" option requires a 'prefix namespace' pairs list as argument}} test domNode-2.8 {selectNodes - -namespaces option} { set nsDef1 [list foo elem2NS bar elem2NS] set nsDef2 [list this elem2NS same elem2NS] set node [$root selectNodes -namespaces $nsDef1 \ -namespaces $nsDef2 {this:*|same:*} typevar] set result [llength $node] lappend result [$node localName] [$node namespaceURI] $typevar } {1 elem2 elem2NS nodes} $doc delete set doc [dom parse { }] $doc documentElement root test domNode-2.9 {selectNodes - -cache option} { set result [catch {$root selectNodes -cache child} errMsg] lappend result $errMsg } {1 {expected boolean value but got "child"}} test domNode-2.10 {selectNodes - -cache option} { for {set x 0} {$x < 5} {incr x} { set nodes [$root selectNodes -cache 1 {child[2]}] } for {set x 0} {$x < 5} {incr x} { set otherNodes [$root selectNodes -cache 0 {child[2]}] } string equal $nodes $otherNodes } {1} test domNode-2.11 {selectNodes - -cache option} { set r1 [catch {$root selectNodes}] set r2 [catch {$root selectNodes -cache 1}] set r3 [catch {$root selectNodes -cache 0}] set r4 [catch {$root selectNodes ""}] set r5 [catch {$root selectNodes -cache 1 ""}] set r6 [catch {$root selectNodes -cache 0 ""}] list $r1 $r2 $r3 $r4 $r5 $r6 } {1 1 1 1 1 1} test domNode-2.12 {selectNodes - -cache option} { # Second usage of an invalid XPath expr with -cache 1 # See 97c0994ae4 catch {$root selectNodes -cache 1 "/foo bar"} catch {$root selectNodes -cache 1 "/foo bar"} } 1 $doc delete test domNode-3.1 {repetitived documentElement with objVar, then delete} { dom createDocument "root" doc $doc documentElement root $doc delete dom createDocument "\u00c4\u00d4\u00dc" doc $doc documentElement root set result [$root nodeName] $doc delete set result } "\u00c4\u00d4\u00dc" test domNode-3.2 {repetitived documentElement, then delete} { set doc [dom createDocument "root"] $doc documentElement root $doc delete set doc [dom createDocument "\u00c4\u00d4\u00dc"] $doc documentElement root set result [$root nodeName] $doc delete set result } "\u00c4\u00d4\u00dc" test domNode-3.3 {repetitived documentElement, then delete} { set doc [dom createDocument "root"] set root [$doc documentElement] $doc delete set doc [dom createDocument "\u00c4\u00d4\u00dc"] set root [$doc documentElement] set result [$root nodeName] $doc delete set result } "\u00c4\u00d4\u00dc" test domNode-4.1 {create nodes with same prefix, different uri's} { dom createDocumentNS "uri1" "p:a" doc set root [$doc documentElement] set node1 [$doc createElementNS "uri2" "p:b"] $root appendChild $node1 set node2 [$doc createElementNS "uri1" "p:c"] $node1 appendChild $node2 set result [$root asXML] $doc delete set result } { } test domNode-4.3 {setAttribute} { dom createDocumentNS "uri1" "p:root" doc set root [$doc documentElement] $root setAttribute attr1 attr1Value set result [$root asXML] $doc delete set result } { } test domNode-4.5 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS "" xmlns:p uri $root setAttributeNS uri p:attr attrValue set result [$root asXML] $doc delete set result } { } test domNode-4.6 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS uri p:attr attrValue $root setAttributeNS "" xmlns:p uri set result [$root asXML] $doc delete set result } { } test domNode-4.7 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS uri p:attr1 attrValue set result [$root getAttributeNS uri attr1] $doc delete set result } {attrValue} test domNode-4.8 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS "" xmlns:p uri $root setAttributeNS uri p:attr1 attrValue set result [$root getAttributeNS uri attr1] $doc delete set result } {attrValue} test domNode-4.9 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS uri p:attr1 attrValue set result [$root attributes *] $doc delete set result } {{attr1 p uri}} test domNode-4.10 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] set result [catch {$root setAttributeNS {} p:attr1 attrValue}] $doc delete set result } {1} test domNode-4.11 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] set result [catch {$root setAttributeNS uri attr1 attrValue}] $doc delete set result } {1} test domNode-4.12 {setAttributeNS - special prefix "xml"} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS "" xml:attr1 attrValue set result [$root attributes *] $doc delete set result } {{attr1 xml http://www.w3.org/XML/1998/namespace}} test domNode-4.13 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS uri p:attr1 attrValue $root setAttributeNS uri o:attr1 newValue set result [$root attributes *] $doc delete set result } {{attr1 p uri}} test domNode-4.14 {setAttributeNS} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS uri p:attr1 attrValue $root setAttributeNS uri o:attr1 newValue set result [$root getAttributeNS uri attr1] $doc delete set result } {newValue} test domNode-4.15 {setAttributeNS - use as setAttribute} { dom createDocument "root" doc set root [$doc documentElement] $root setAttributeNS "" attr1 attrValue set result [$root attributes *] $doc delete set result } {attr1} test domNode-4.16 {setAttributeNS - set multiple Attributes at once} { set doc [dom createDocumentNS uri1 "p1:root"] set root [$doc documentElement] $root setAttributeNS "" xmlns:p2 uri2 $root setAttributeNS uri1 p1:a1 1 uri1 p1:a2 2 uri2 p2:a3 3 "" a4 4 set result [$root asXML] $doc delete set result } { } test domNode-4.17 {setAttributeNS - set multiple Attribute with NS atts undermixed at once} { set doc [dom createDocumentNS uri1 "p1:root"] set root [$doc documentElement] $root setAttributeNS "" xmlns:p2 uri2 $root setAttributeNS uri1 p1:a1 1 "" xmlns uri3 uri1 p1:a2 2 "" xmlns:p4 uri4 uri4 p4:a1 a1 uri2 p2:a3 3 "" a4 4 set result [$root asXML] $doc delete set result } { } test domNode-4.18 {setAttributeNS - prefixed attribute name with empty namespace} { set doc [dom createDocument "root"] set root [$doc documentElement] catch {$root setAttributeNS "" ns:att attvalue} errMsg $doc delete set errMsg } {For all prefixed attributes with prefixes other than 'xml' or 'xmlns' you have to provide a namespace URI} test domNode-5.1 {removeChild} { dom parse {} doc $doc documentElement root $root removeChild [$root firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-5.2 {removeChild - child to remove is not a child of node} { dom parse {} doc $doc documentElement root set one [$root firstChild] set two [$root lastChild] set result [catch {$one removeChild $two} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} test domNode-5.3 {removeChild - child to remove is not a child of node} { dom parse {} doc $doc documentElement root set newNode [$doc createElement new] set result [catch {$root removeChild $newNode} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} test domNode-6.1 {appendChild insert FQ Element} { set doc [dom parse {}] set root [$doc documentElement] set newNode [$doc createElementNS uri2 p:foo] $root appendChild $newNode set result [$root asXML] $doc delete set result } { } test domNode-6.2 {appendChild} { set doc [dom createDocument XMI] set root [$doc documentElement] set A1tag [$doc createElement "A1"] set A2subtag [$doc createElement "A2sub"] set A2tag [$doc createElement "A2"] $A2tag appendChild $A2subtag set Atag [$doc createElement "A"] $Atag appendChild $A1tag $Atag appendChild $A2tag set Btag [$doc createElement "B"] $Btag appendChild $Atag set Ctag [$doc createElement "C"] set result 0 if {$root == "[$doc documentElement]"} {set result 1} $doc delete set result } {1} test domNode-6.3 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [$root firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-6.4 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [$root lastChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-6.5 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [lindex [$root childNodes] 1] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-6.6 {appendChild} { dom parse {} doc $doc documentElement root set node [$root appendChild [$root firstChild]] catch {unset result} lappend result [[$node parentNode] nodeName] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {root one three two} test domNode-6.7 {appendChild} { dom parse {} doc $doc documentElement root set node [$root appendChild [$root lastChild]] catch {unset result} lappend result [[$node parentNode] nodeName] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {root three two one} test domNode-6.8 {appendChild} { dom parse {} doc $doc documentElement root set node [$root appendChild [lindex [$root childNodes] 1]] catch {unset result} lappend result [[$node parentNode] nodeName] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {root two three one} test domNode-6.9 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [$root firstChild] catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {two three one} test domNode-6.10 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [$root lastChild] catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {one two three} test domNode-6.11 {appendChild} { dom parse {} doc $doc documentElement root $root appendChild [lindex [$root childNodes] 1] catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {one three two} test domNode-6.12 {appendChild} { dom parse {} doc $doc documentElement root set one [$root firstChild] $one appendChild [$root lastChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-6.13 {appendChild} { dom parse {} doc $doc documentElement root set one [$root firstChild] set result [catch {$one appendChild $root} errMsg] lappend result $errMsg $doc delete set result } {1 HIERARCHY_REQUEST_ERR} test domNode-6.14 {appendChild} { dom parse {} doc $doc documentElement root set one [$root firstChild] set result [catch {$one appendChild $one} errMsg] lappend result $errMsg $doc delete set result } {1 HIERARCHY_REQUEST_ERR} test domNode-6.15 {appendChild} -setup { set fileList {} foreach {name content} { a "..." b "..." } { lappend fileList [makeFile $content $name] } } -body { set docs {} foreach rf $fileList { set doc [dom parse -baseurl [tdom::baseURL $rf] \ -externalentitycommand ::tdom::extRefHandler \ -keepEmpties \ [tdom::xmlReadFile $rf] ] lappend docs $doc } set resultDoc [dom createDocument new_report] set root [$resultDoc documentElement] foreach doc $docs { $root appendChild [$doc documentElement] } set result [$resultDoc asXML -indent none] foreach doc $docs { $doc delete } $resultDoc delete set result } -cleanup { removeFile a removeFile b } -result {......} test domNode-6.16 {appendChild} -setup { dom parse {} doc1 $doc1 documentElement root1 dom parse {} doc2 $doc2 documentElement root2 } -body { $root1 appendChild [$root2 cloneNode -deep] $root1 asXML -indent none } -cleanup { $doc1 delete $doc2 delete } -result {} test domNode-6.17 {appendChild} -setup { dom parse {} doc1 $doc1 documentElement root1 dom parse {} doc2 $doc2 documentElement root2 } -body { $root1 appendChild [$root2 cloneNode -deep] $root1 asXML -indent none } -cleanup { $doc1 delete $doc2 delete } -result {} set doc [dom parse {}] set root [$doc documentElement] test domNode-7.1 {getElementsByTagName - doc method} { llength [$doc getElementsByTagName a] } {2} test domNode-7.2 {getElementsByTagName - doc method} { llength [$doc getElementsByTagName c] } {1} test domNode-7.3 {getElementsByTagName - doc method} { llength [$doc getElementsByTagName foo] } {0} test domNode-7.4 {getElementsByTagName - node method} { llength [$root getElementsByTagName a] } {2} test domNode-7.5 {getElementsByTagName - node method} { llength [$root getElementsByTagName c] } {1} test domNode-7.6 {getElementsByTagName - node method} { llength [$root getElementsByTagName foo] } {0} test domNode-7.7 {getElementsByTagName - node method '*' wildcard} { llength [$root getElementsByTagName *] } {7} test domNode-7.8 {getElementsByTagName - doc method '*' wildcard} { llength [$doc getElementsByTagName *] } {8} test domNode-7.9 {getElementsByTagName - node method tcl glob style} { llength [$root getElementsByTagName foo*] } {2} test domNode-7.9 {getElementsByTagName - node method tcl glob style} { llength [$root getElementsByTagName *oo*] } {3} test domNode-7.10 {getElementsByTagName - doc method tcl glob style} { llength [$doc getElementsByTagName foo*] } {2} test domNode-7.11 {getElementsByTagName - doc method tcl glob style} { llength [$doc getElementsByTagName *oo*] } {4} test domNode-7.12 {getElementsByTagName - doc method empty result} { $doc getElementsByTagName noSuchANodeName } {} test domNode-7.13 {getElementsByTagName - node method empty result} { $root getElementsByTagName noSuchANodeName } {} test domNode-7.14 {getElementsByTagName - doc method: doc order of result} { set nodes [$doc getElementsByTagName *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {root foobar barfoo foobaz a b a c } test domNode-7.15 {getElementsByTagName - node method: doc order of result} { set nodes [$root getElementsByTagName *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {foobar barfoo foobaz a b a c } $doc delete set doc [dom parse { mixed content important more content again important }] set root [$doc documentElement] test domNode-7.16 {getElementsByTagName - node method mixed content} { llength [$doc getElementsByTagName elem] } {1} test domNode-7.17 {getElementsByTagName - node method mixed content} { llength [$root getElementsByTagName elem] } {1} test domNode-7.18 {getElementsByTagName - doc method mixed content} { llength [$doc getElementsByTagName b] } {3} test domNode-7.19 {getElementsByTagName - node method mixed content} { llength [$root getElementsByTagName b] } {3} test domNode-7.20 {getElementsByTagName - not a element node} { set textnode [$root selectNodes {descendant::text()[1]}] catch {$textnode getElementsByTagName b} errMsg set errMsg } {Node must be an element node.} $doc delete set doc [dom parse { IBM }] set root [$doc documentElement] test domNode-8.1 {getElementsByTagNameNS - root method} { [$root getElementsByTagNameNS "http://www.stock.org/stock" GetStockPrice] nodeName } {m:GetStockPrice} test domNode-8.2 {getElementsByTagNameNS - root method} { [$root getElementsByTagNameNS "*" GetStockPrice] nodeName } {m:GetStockPrice} test domNode-8.3 {getElementsByTagNameNS - root method} { llength [$root getElementsByTagNameNS "http://www.stock.org/stock" *] } {2} test domNode-8.4 {getElementsByTagNameNS - doc method} { [$doc getElementsByTagNameNS "http://www.stock.org/stock" GetStockPrice] nodeName } {m:GetStockPrice} test domNode-8.5 {getElementsByTagNameNS - doc method} { [$doc getElementsByTagNameNS "*" GetStockPrice] nodeName } {m:GetStockPrice} test domNode-8.6 {getElementsByTagNameNS - doc method} { llength [$doc getElementsByTagNameNS "http://www.stock.org/stock" *] } {2} $doc delete set doc [dom parse { mixed content important more content again important }] set root [$doc documentElement] test domNode-8.7 {getElementsByTagNameNS - doc method pathologic XML} { llength [$doc getElementsByTagNameNS "firstp" pathologic] } {2} test domNode-8.8 {getElementsByTagNameNS - doc method pathologic XML} { llength [$doc getElementsByTagNameNS "secondp" pathologic] } {1} test domNode-8.9 {getElementsByTagNameNS - doc method pathologic XML} { llength [$doc getElementsByTagNameNS "*" pathologic] } {3} test domNode-8.10 {getElementsByTagNameNS - node method pathologic XML} { llength [$root getElementsByTagNameNS "firstp" pathologic] } {2} test domNode-8.11 {getElementsByTagNameNS - node method pathologic XML} { llength [$root getElementsByTagNameNS "secondp" pathologic] } {1} test domNode-8.12 {getElementsByTagNameNS - node method pathologic XML} { llength [$root getElementsByTagNameNS "*" pathologic] } {3} test domNode-8.13 {getElementsByTagNameNS - doc method} { llength [$doc getElementsByTagNameNS "NS1" elem] } {1} test domNode-8.14 {getElementsByTagNameNS - doc method} { llength [$doc getElementsByTagNameNS "NS2" elem] } {1} test domNode-8.15 {getElementsByTagNameNS - doc method} { llength [$doc getElementsByTagNameNS "*" elem] } {3} test domNode-8.16 {getElementsByTagNameNS - node method} { llength [$root getElementsByTagNameNS "NS1" elem] } {1} test domNode-8.17 {getElementsByTagNameNS - node method} { llength [$root getElementsByTagNameNS "NS2" elem] } {1} test domNode-8.18 {getElementsByTagNameNS - node method} { llength [$root getElementsByTagNameNS "*" elem] } {3} test domNode-8.19 {getElementsByTagNameNS - doc method empty namespace} { set nodes [$doc getElementsByTagNameNS "" *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {root elem b b } test domNode-8.19 {getElementsByTagNameNS - node method empty namespace} { set nodes [$root getElementsByTagNameNS "" *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem b b } test domNode-8.20 {getElementsByTagNameNS - not a element node} { set textnode [$root selectNodes {descendant::text()[1]}] catch {$textnode getElementsByTagName b} errMsg set errMsg } {Node must be an element node.} $doc delete set doc [dom parse { }] set root [$doc documentElement] test domNode-8.21 {getElementsByTagNameNS - unset default NS} { set nodes [$root getElementsByTagNameNS "" *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem1 elem3 } test domNode-8.22 {getElementsByTagName - unset default NS} { set nodes [$root getElementsByTagName *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem1 elem2 elem3 } test domNode-8.23 {getElementsByTagNameNS - unset default NS} { set nodes [$root getElementsByTagNameNS * *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem1 elem2 elem3 } test domNode-8.24 {getElementsByTagNameNS - unset default NS} { set nodes [$doc getElementsByTagNameNS * *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {root elem1 elem2 elem3 } test domNode-8.25 {getElementsByTagNameNS - unset default NS} { set nodes [$root getElementsByTagNameNS "" *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem1 elem3 } test domNode-8.26 {getElementsByTagNameNS - unset default NS} { set nodes [$doc getElementsByTagNameNS "" *] set result "" foreach node $nodes { append result "[$node nodeName] " } set result } {elem1 elem3 } $doc delete set doc [dom parse { text node}] set root [$doc documentElement] test domNode-9.1 {nodeValue - TEXT_NODE} { [$root firstChild] nodeValue } {text node} test domNode-9.2 {nodeValue - COMMENT_NODE} { set firstChild [$root firstChild] set commentNode [$firstChild nextSibling] $commentNode nodeValue } {comment node} test domNode-9.3 {nodeValue - PROCESSING_INSTRUCTION_NODE} { [$root lastChild] nodeValue } {PI node} test domNode-9.4 {nodeValue - CDATA_SECTION_NODE} { set cdNode [$doc createCDATASection "cdata section node"] $root appendChild $cdNode [$root lastChild] nodeValue } {cdata section node} test domNode-9.5 {nodeValue with set - TEXT_NODE} { set result [[$root firstChild] nodeValue "new text value"] append result "/" [[$root firstChild] nodeValue] } {text node/new text value} test domNode-9.6 {nodeValue with set - COMMENT_NODE} { set textNode [$root firstChild] set node [$textNode nextSibling] set result [$node nodeValue "new comment text"] append result "/" [$commentNode nodeValue] } {comment node/new comment text} test domNode-9.7 {nodeValue - PROCESSING_INSTRUCTION_NODE does not allow setting} { set piNode [$root selectNodes processing-instruction('mytarget')] catch {$piNode nodeValue "new pi value"} } {1} test domNode-9.8 {nodeValue - CDATA_SECTION_NODE} { set result [[$root lastChild] nodeValue "new text"] append result "/" [[$root lastChild] nodeValue] } {cdata section node/new text} $doc delete test domNode-9.9 {nodeValue - invalid new value} { set doc [dom parse text] $doc documentElement root set result [catch {[$root firstChild] nodeValue "ab\u0003\u0003cd"} \ errMsg] $doc delete lappend result $errMsg } [list 1 "Invalid text value 'ab\u0003\u0003cd'"] set doc [dom parse ] set root [$doc documentElement] test domNode-10.1 {setAttribute - set multiple attributes at once} { $root setAttribute a1 1 a2 2 a3 3 a4 4 a5 5 a6 6 a7 7 a8 8 $root asXML -indent none } {} $doc delete set doc [dom parse {&}] set root [$doc documentElement] set textnode [$root firstChild] test domNode-11.1 {disableOutputEscaping} { $textnode disableOutputEscaping } {0} test domNode-11.2 {disableOutputEscaping} { $textnode disableOutputEscaping 1 } {0} test domNode-11.3 {disableOutputEscaping} { $textnode disableOutputEscaping } {1} test domNode-11.4 {disableOutputEscaping} { $root asXML -indent none } {&} $doc delete test domNode-11.5 {disableOutputEscaping} { set doc [dom createDocument root] set textnode [$doc createTextNode "

    some important text

    "] $textnode disableOutputEscaping 1 set root [$doc documentElement] $root appendChild $textnode set result [$root asXML -indent none] $doc delete set result } {

    some important text

    } test domNode-11.6 {disableOutputEscaping} { set doc [dom createDocument root] set textnode [$doc createTextNode "

    some important text

    "] $textnode disableOutputEscaping 1 set root [$doc documentElement] $root appendChild $textnode set textnode [$doc createTextNode "&"] $root appendChild $textnode set result [$root asXML -indent none] $doc delete set result } {

    some important text

    &
    } test domNode-11.7 {disableOutputEscaping} { set doc [dom createDocument root] set root [$doc documentElement] set textnode [$doc createTextNode "&"] $root appendChild $textnode set textnode [$doc createTextNode "

    some important text

    "] $textnode disableOutputEscaping 1 $root appendChild $textnode set result [$root asXML -indent none] $doc delete set result } {&

    some important text

    } test domNode-12.1 {cloneNode} { set doc [dom parse {}] set root [$doc documentElement] set newNode [$root cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {} test domNode-12.2 {cloneNode} { set doc [dom parse {text}] set root [$doc documentElement] set newNode [$root cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {text} test domNode-12.3 {cloneNode} { set doc [dom parse {text}] set root [$doc documentElement] set newNode [[$root firstChild] cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {text} test domNode-12.4 {cloneNode} { set doc [dom parse {text}] set root [$doc documentElement] set newNode [[$root selectNodes {node()[2]}] cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {texttext} test domNode-12.5 {cloneNode} { set doc [dom parse {text}] set root [$doc documentElement] set newNode [[$root selectNodes {node()[3]}] cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {text} test domNode-12.5 {cloneNode} { set doc [dom parse {text}] set root [$doc documentElement] set newNode [[$root lastChild] cloneNode] $root appendChild $newNode set result [$root asXML -indent none] $doc delete set result } {text} test domNode-12.6 {cloneNode -deep} { set doc [dom parse {
    text}] set root [$doc documentElement] set result [[[$root firstChild] cloneNode -deep] asXML -indent none] $doc delete set result } {text} test domNode-12.7 {cloneNode -deep} { set doc [dom parse {text}] set root [$doc documentElement] $root appendChild [[$root firstChild] cloneNode -deep] set result [$root asXML -indent none] $doc delete set result } {texttext} test domNode-12.8 {cloneNode -deep} { set doc [dom parse {text}] set root [$doc documentElement] set removedNode [$root removeChild [$root firstChild]] $root appendChild [[$root firstChild] cloneNode -deep] set result [$root asXML -indent none] $doc delete set result } {texttext} test domNode-12.9 {cloneNode -deep} { set doc [dom parse {text}] set root [$doc documentElement] set removedNode [$root removeChild [$root firstChild]] $root appendChild [[$root firstChild] cloneNode -deep] unset result lappend result [$removedNode nextSibling] lappend result [$removedNode previousSibling] $doc delete set result } {{} {}} test domNode-12.10 {cloneNode -deep} { set doc [dom parse {text}] set root [$doc documentElement] $root removeChild [$root firstChild] set removedNode [$root removeChild [$root firstChild]] $root appendChild [[$root firstChild] cloneNode -deep] unset result lappend result [[$removedNode nextSibling] nodeName] lappend result [$removedNode previousSibling] $doc delete set result } {y {}} namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } test domNode-13.1 {appendFromScript - elementNode} { set doc [dom createDocument root] set root [$doc documentElement] $root appendFromScript nodeCmds::e1 set result [$root asXML -indent none] $doc delete set result } {} test domNode-13.2 {appendFromScript - elementNode} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { e1 e2 } } set result [$root asXML -indent none] $doc delete set result } {} test domNode-13.3 {appendFromScript - elementNode} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { e1 { e2 { e1 } } e2 } } set result [$root asXML -indent none] $doc delete set result } {} test domNode-13.4 {appendFromScript - elementNode with attributes as options} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { e1 -attr1 attr1Value -attr2 "attr 2 Value" } } set result [$root asXML -indent none] $doc delete set result } {} test domNode-13.5 {appendFromScript - elementNode with attributes as list} { set doc [dom createDocument root] set root [$doc documentElement] set attlist [list -a1 "some & value" -a2 "another attvalue"] namespace eval nodeCmds { $::root appendFromScript { e1 $::attlist {} } } set result [$root asXML -indent none] $doc delete set result } {} test domNode-13.6 {appendFromScript - textnode, commentnode, cdatanode, pinode} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { t foo c "my comment" cdata {&"<>;} ;# emacs: " pi mypi "some pi data" } } set result [$root asXML -indent none] $doc delete set result } {foo;]]>} # emacs: " test domNode-13.7 {appendFromScript - textnode} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { t "

    Some important stuff

    " } } set result [$root asXML -indent none] $doc delete set result } {<p>Some <b>important</b> stuff</p>} test domNode-13.8 {appendFromScript - textnode with -disableOutputEscaping} { set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { t -disableOutputEscaping "

    Some important stuff

    " } } set result [$root asXML -indent none] $doc delete set result } {

    Some important stuff

    } test domNode-13.9 {appendFromScript while fragment list isn't empty} { set doc [dom parse text] set root [$doc documentElement] $root removeChild [$root firstChild] $root appendFromScript { nodeCmds::t "another text" } set result [llength [$root childNodes]] $doc delete set result } {1} test domNode-13.10 {appendFromScript - tcl error inside the script} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch {$root appendFromScript { nodeCmds::e1 nodeCmds::e1 { # This is intentionally wrong set foo 1 + 1 } }}] lappend result [$doc asXML -indent none] $doc delete set result } {1 } test domNode-13.11 {appendFromScript - tcl error inside the script} { set doc [dom parse ] set root [$doc documentElement] set result [catch {$root appendFromScript { nodeCmds::e1 { nodeCmds::e2 { t foo } nodeCmds::e2 -attr attrvalue { nodeCmds::e2 -attr1 attrvalue attr2 attrvalue { t bar } } } nodeCmds::e1 { # This is intentionally wrong set foo 1 + 1 } }}] lappend result [$doc asXML -indent none] $doc delete set result } {1 } test domNode-13.12 {appendFromScript - node isn't ELEMENT_NODE} { dom parse text doc $doc documentElement root $root firstChild textNode set result [catch {$textNode appendFromScript { nodeCmds::e1 }} errMsg] lappend result $errMsg lappend result [$doc asXML -indent none] $doc delete set result } {1 {NOT_AN_ELEMENT : can't append nodes} text} test domNode-13.13 {createNodeCmd elementNode with invalide tag name} { set result [catch {dom createNodeCmd elementNode \ [list invalid name]} errMsg] lappend result $errMsg } {1 {Invalid tag name 'invalid name'}} namespace eval nodeCmds::thisCmds { } test domNode-13.14 {qualified nodeCmd name} { namespace eval nodeCmds { dom createNodeCmd elementNode thisCmds::thisE } set result [llength [info commands nodeCmds::thisE]] lappend result [llength [info commands nodeCmds::thisCmds::thisE]] set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { thisCmds::thisE } } lappend result [$doc asXML -indent none] $doc delete set result } {0 1 } set nsname "tricky nsname" namespace eval nodeCmds::$nsname { } test domNode-13.15 {qualified nodeCmds name} { namespace eval nodeCmds { dom createNodeCmd elementNode ${::nsname}::thisE } set result [llength [info commands nodeCmds::thisE]] lappend result [llength [info commands nodeCmds::${nsname}::thisE]] set doc [dom createDocument root] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { ${::nsname}::thisE } } lappend result [$doc asXML -indent none] $doc delete set result } {0 1 } test domNode-13.16 {Invalid attribute name} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { e1 att1 att1Value "invalid attname" value {} } } } errMsg] lappend result $errMsg $doc delete set result } {1 {Invalid attribute name 'invalid attname'}} test domNode-13.17 {Invalid attribute value} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { e1 att1 att1Value att2 "invalid \u0003 value" {} } } } errMsg] lappend result $errMsg $doc delete set result } [list 1 "Invalid attribute value 'invalid \u0003 value'"] dom setNameCheck 0 namespace eval nodeCmds { dom createNodeCmd elementNode e1 } dom setNameCheck 1 test domNode-13.18 {Invalid attribute name - check disabled} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { e1 att1 att1Value "invalid attname" value {} } } }] $doc delete set result } {0} dom setTextCheck 0 namespace eval nodeCmds { dom createNodeCmd elementNode e1 } dom setTextCheck 1 test domNode-13.19 {Invalid attribute value - check disabled} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { e1 att1 att1Value att2 "invalid \u0003 value" {} } } }] $doc delete set result } 0 dom setTextCheck 0 dom setNameCheck 0 namespace eval nodeCmds { dom createNodeCmd elementNode e1 } dom setTextCheck 1 dom setNameCheck 1 test domNode-13.20 {Invalid att name, invalid att value, checks disabled} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { e1 att1 att1Value "invalid attName" "invalid \u0003 value" {} } } }] $doc delete set result } 0 namespace eval nodeCmds { dom createNodeCmd elementNode e1 } test domNode-13.21 {Invalid comment value} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { c "invalid -- comment" } } } errMsg] lappend result $errMsg $doc delete set result } {1 {Invalid comment value 'invalid -- comment'}} test domNode-13.22 {Invalid CDATA section value} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { cdata "invalid comment ]]>" } } } errMsg] lappend result $errMsg $doc delete set result } {1 {Invalid CDATA section value 'invalid comment ]]>'}} test domNode-13.23 {Invalid text node} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { t "invalid text \u0004" } } } errMsg] lappend result $errMsg $doc delete set result } [list 1 "Invalid text value 'invalid text \u0004'"] test domNode-13.24 {Invalid processing instruction} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { pi Xml "data" } } } errMsg] lappend result $errMsg $doc delete set result } [list 1 "Invalid processing instruction name 'Xml'"] test domNode-13.25 {Invalid processing instruction} { set doc [dom createDocument root] set root [$doc documentElement] set result [catch { namespace eval nodeCmds { $::root appendFromScript { pi Xmll "data ?>" } } } errMsg] lappend result $errMsg $doc delete set result } [list 1 "Invalid processing instruction value 'data ?>'"] test domNode-13.26 {appendFromScript with default namespace in scope} { set doc [dom parse {}] set root [$doc documentElement] namespace eval nodeCmds { $::root appendFromScript { e1 } } set result [$doc asXML -indent none] $doc delete set result } {} test domNode-14.1 {appendFromList} { set doc [dom createDocument root] set root [$doc documentElement] set errMsg "" set result [catch {$root appendFromList {a b}} errMsg] lappend result $errMsg $doc delete set result } {1 {invalid element node list format!}} test domNode-14.2 {appendFromList} { set doc [dom createDocument root] set root [$doc documentElement] set errMsg "" set result [catch {$root appendFromList {a b c}} errMsg] lappend result $errMsg $doc delete set result } {1 {invalid attributes list format!}} test domNode-14.3 {appendFromList} { set doc [dom createDocument root] set root [$doc documentElement] $root appendFromList {a {} {}} set result [$root asXML -indent none] $doc delete set result } {
    } test domNode-14.4 {appendFromList} { set doc [dom createDocument root] set root [$doc documentElement] $root appendFromList {#text "foo bar"} set result [$root asXML -indent none] $doc delete set result } {foo bar} test domNode-14.5 {appendFromList} { set doc [dom parse {texttext}] set elm [$doc documentElement] set elmList [$elm asList] $doc delete set doc [dom createDocument root] set root [$doc documentElement] $root appendFromList $elmList set result [$root asXML -indent none] $doc delete set result } {texttext
    } set doc [dom parse {text}] set docElem [$doc documentElement] test domNode-14.6 {asList of tree with comment nodes} { $docElem asList } [list elem {} [list [list \#comment " comment "] [list \#text text] [list child [list a v] [list [list \#comment comment]]]]] test domNode-14.7 {asList on a comment} { set commentNode [$docElem firstChild] $commentNode asList } [list \#comment " comment "] test domNode-14.8 {asList on a comment} { set commentNode [$docElem selectNodes {(//comment())[2]}] $commentNode asList } [list \#comment comment] test domNode-14.9 {appendFromList with comment nodes in the list} { set list [$docElem asList] set newDoc [dom createDocument newDoc] set newDocRoot [$newDoc documentElement] $newDocRoot appendFromList $list set result [$newDoc asXML -indent none] $newDoc delete set result } {text} $doc delete set doc [dom parse {text}] set docElem [$doc documentElement] test domNode->14.10 {asList of tree with PI nodes} { $docElem asList } [list elem {} [list [list \#pi myPI value] [list \#text text] [list child [list a v] [list [list \#pi myPI1 "the value"]]]]] test domNode->14.11 {asList on a PI} { set piNode [$docElem firstChild] $piNode asList } [list \#pi myPI value] test domNode->14.12 {asList on a PI} { set piNode [$docElem selectNodes {(//processing-instruction())[2]}] $piNode asList } [list \#pi myPI1 "the value"] test domNode-14.13 {appendFromList with comment node in the list} { set list [$docElem asList] set newDoc [dom createDocument newDoc] set newDocRoot [$newDoc documentElement] $newDocRoot appendFromList $list set result [$newDoc asXML -indent none] $newDoc delete set result } {text} $doc delete test domNode-14.14 {appendFromList - invalid tagname} { set doc [dom createDocument root] set root [$doc documentElement] set errMsg "" set result [catch {$root appendFromList {{invalid tagname} {} {}}} errMsg] lappend result $errMsg $doc delete set result } {1 {Invalid tag name 'invalid tagname'}} test domNode-14.15 {appendFromList - invalid processing instruction name} { set doc [dom createDocument root] set root [$doc documentElement] set errMsg "" set result [catch {$root appendFromList {\#pi "invalid pi name" piValue}} errMsg] lappend result $errMsg $doc delete set result } {1 {Invalid processing instruction name 'invalid pi name'}} set xml { text node text text text text } test domNode-15.1 {delete - text nodes} { set doc [dom parse $xml] set root [$doc documentElement] foreach node [$root selectNodes text()] { $node delete } set result [llength [$root childNodes]] $doc delete set result } {5} test domNode-15.2 {delete - comment nodes} { set doc [dom parse -keepEmpties $xml] set root [$doc documentElement] foreach node [$root selectNodes comment()] { $node delete } set result [llength [$root childNodes]] $doc delete set result } {6} test domNode-15.3 {delete - pi nodes} { set doc [dom parse -keepEmpties $xml] set root [$doc documentElement] foreach node [$root selectNodes processing-instruction()] { $node delete } set result [llength [$root childNodes]] $doc delete set result } {7} test domNode-15.4 {delete - pi nodes} { set doc [dom parse -keepEmpties $xml] set root [$doc documentElement] foreach node [$root selectNodes node()] { $node delete } set result [llength [$root childNodes]] $doc delete set result } {0} test domNode-15.5 {delete - threaded} -constraints { threaded } -setup { set xml { one two three } set doc [dom parse $xml] dom attachDocument $doc doc_ $doc documentElement root } -body { foreach node [$root selectNodes {//attr1 | //attr2}] { [$node firstChild] delete } set result "" } -cleanup { dom detachDocument $doc dom detachDocument $doc_ } -result "" test domNode-15.6 {delete - threaded} -constraints { threaded } -setup { set xml {
    } set doc [dom parse $xml] dom attachDocument $doc doc_ $doc documentElement root } -body { foreach node [$root selectNodes a] { $node delete } set result "" } -cleanup { dom detachDocument $doc dom detachDocument $doc_ } -result "" set doc [dom parse {}] set root [$doc documentElement] test domNode-16.1 {getAttribute} { $root getAttribute attr1 } {bingbaz} test domNode-16.2 {getAttribute} { $root getAttribute attr2 } {ab & zu} test domNode-16.3 {getAttribute} { $root getAttribute attr3 } {} test domNode-16.4 {getAttribute with default} { $root getAttribute attr1 "default not needed, because attr1 exists" } {bingbaz} test domNode-16.5 {getAttribute with default} { $root getAttribute notPresent "expect this given default value" } {expect this given default value} test domNode-16.6 {getAttribute - attr dosen't exists and no default} { catch {$root getAttribute notPresent} } {1} test domNode-16.7 {getAttribute shortcut} { $root @attr1 } {bingbaz} test domNode-16.8 {getAttribute shortcut} { $root @attr2 } {ab & zu} test domNode-16.9 {getAttribute shortcut} { $root @attr3 } {} test domNode-16.10 {getAttribute shortcut with default} { $root @attr1 "default not needed, because attr1 exists" } {bingbaz} test domNode-16.11 {getAttribute shortcut with default} { $root @notPresent "expect this given default value" } {expect this given default value} test domNode-16.12 {getAttribute shortcut - attr dosen't exists and no default} { catch {$root @notPresent} } {1} $doc delete set doc [dom parse {}] set root [$doc documentElement] test domNode-16.13 {getAttribute} { $root getAttribute xmlns } {uri2} test domNode-16.14 {getAttribute} { $root getAttribute xmlns:foo } {http://tdom.org/ns1} $doc delete set xml { text node text text text text } set doc [dom parse -keepEmpties $xml] set root [$doc documentElement] test domNode-17.1 {nodeType} { unset result foreach node [$root childNodes] { lappend result [$node nodeType] } set result } {TEXT_NODE ELEMENT_NODE COMMENT_NODE TEXT_NODE ELEMENT_NODE COMMENT_NODE PROCESSING_INSTRUCTION_NODE TEXT_NODE} test domNode-17.2 {nodeType} { set CDATAnode [$doc createCDATASection "a CDATA section"] $root insertBefore $CDATAnode [$root firstChild] [$root firstChild] nodeType } {CDATA_SECTION_NODE} $doc delete set doc [dom parse { text child}] set root [$doc documentElement] test domNode-18.1 {attributes} { $root attributes } {{foo foo {}} attr1 attr2 attr3 {attr1 foo http://tdom.org/ns} worble2} test domNode-18.2 {attributes} { $root attributes * } {{foo foo {}} attr1 attr2 attr3 {attr1 foo http://tdom.org/ns} worble2} test domNode-18.3 {attributes} { $root attributes attr* } {attr1 attr2 attr3} test domNode-18.4 {attributes} { $root attributes *2* } {attr2 worble2} test domNode-18.5 {attributes} { $root attributes worble2 } {worble2} test domNode-18.6 {attributes} { $root attributes *brab* } {} test domNode-18.7 {attributes} { [$root firstChild] attributes } {} test domNode-18.1.1 {attributeNames} { $root attributeNames } {xmlns:foo attr1 attr2 attr3 foo:attr1 worble2} test domNode-18.2.1 {attributeNames} { $root attributeNames * } {xmlns:foo attr1 attr2 attr3 foo:attr1 worble2} test domNode-18.3.1 {attributeNames} { $root attributeNames attr* } {attr1 attr2 attr3} test domNode-18.4.1 {attributeNames} { $root attributeNames *2* } {attr2 worble2} test domNode-18.5.1 {attributeNames} { $root attributeNames worble2 } {worble2} test domNode-18.6.1 {attributeNames} { $root attributeNames *brab* } {} test domNode-18.7.1 {attributeNames} { [$root firstChild] attributeNames } {} # Hmmm. This two following tests are mostly there to document the # behavior of the method, as it is. It may debatable if they should # behave this way. The optional attribute name pattern is a tDOM # DOM extension there is nothing in the rec, which could help to argue. # Therefore, it's the way, it is. test domNode-18.8 {attributes} { $root attributes *tdom* } {} test domNode-18.9 {attributes} { $root attributes foo* } {{attr1 foo http://tdom.org/ns}} test domNode-18.9.1 {attributeNames} { $root attributeNames foo:* } {foo:attr1} $doc delete set doc [dom parse {}] set root [$doc documentElement] test domNode-18.10 {attributes} { $root attributes } {{foo foo {}} {xmlns {} {}} attr1 {attr1 foo http://tdom.org/ns1} worble2} $doc delete set doc [dom parse { text child}] set root [$doc documentElement] test domNode-19.1 {removeAttribute} { $root removeAttribute attr1 $root attributes attr1 } {} $doc delete set doc [dom parse { text child}] set root [$doc documentElement] test domNode-19.2 {removeAttribute} { catch {$root removeAttribute attr1} errMsg set errMsg } {can't remove attribute 'attr1'} test domNode-19.3 {removeAttribute} { catch {$root removeAttribute} } {1} test domNode-19.4 {removeAttribute} { catch {$root removeAttribute attr2 attr3} } {1} test domNode-19.5 {removeAttributeNS} { $root removeAttributeNS http://tdom.org/ns attr1 $root hasAttributeNS http://tdom.org/ns attr1 } {0} test domNode-19.6 {removeAttributeNS} { catch {$root removeAttributeNS http://tdom.org attr1} } {1} test domNode-19.7 {removeAttributeNS} { catch {$root removeAttributeNS http://tdom.org/bar thisatt} } {0} $doc delete set doc [dom parse ] set root [$doc documentElement] test domNode-20.1 {parentNode} { $root parentNode } {} test domNode-20.2 {parentNode} { $root parentNode var set var } {} test domNode-20.3 {parentNode} { set child [$root firstChild] [$child parentNode] nodeName } {root} test domNode-20.4 {parentNode} { set child [$root firstChild] $root removeChild $child $child parentNode } {} $doc delete set doc [dom parse {text}] set root [$doc documentElement] test domNode-21.1 {hasChildNodes} { $root hasChildNodes } {1} test domNode-21.2 {hasChildNodes} { set node [$root firstChild] $node hasChildNodes } {0} test domNode-21.3 {hasChildNodes} { set node [$root lastChild] $node hasChildNodes } {1} $doc delete set doc [dom parse { text}] set root [$doc documentElement] test domNode-22.1 {localName} { $root localName } {} test domNode-22.2 {localName} { [$root firstChild] localName } {e1} test domNode-22.3 {localName} { set node [$root firstChild] [$node firstChild] localName } {e2} test domNode-22.4 {localName} { catch {[$root lastChild] localName} errMsg set errMsg } {} test domNode-22.5 {prefix} { [$root firstChild] prefix } {p1} test domNode-22.6 {prefix} { set node [$root firstChild] [$node firstChild] prefix } {} test domNode-22.7 {prefix} { $root prefix } {} $doc delete test domNode-23.1 {replaceChild} { set doc [dom parse {text}] set root [$doc documentElement] set removedNode [$root removeChild [$root firstChild]] $root replaceChild $removedNode [$root firstChild] set result [$root asXML -indent none] $doc delete set result } {} test domNode-23.2 {replaceChild} { set doc [dom parse {text}] set root [$doc documentElement] $root replaceChild [$root lastChild] [$root firstChild] set result [$root asXML -indent none] $doc delete set result } {text} test domNode-23.3 {replaceChild} { set doc [dom parse {text}] set root [$doc documentElement] set e1 [$root firstChild] set e2 [$root lastChild] $e2 replaceChild $e1 [$e2 firstChild] set result [$root asXML -indent none] $doc delete set result } {} test domNode-23.4 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root childNodes] for {set i 1} {$i < 4} {incr i} { $root removeChild [lindex $childNodes $i] } $root replaceChild [lindex $childNodes 1] [$root firstChild] set result [$root asXML -indent none] $doc delete set result } {} test domNode-23.5 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root childNodes] for {set i 1} {$i < 4} {incr i} { $root removeChild [lindex $childNodes $i] } $root replaceChild [lindex $childNodes 2] [$root firstChild] set result [$root asXML -indent none] $doc delete set result } {} test domNode-23.6 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root childNodes] for {set i 1} {$i < 4} {incr i} { $root removeChild [lindex $childNodes $i] } $root replaceChild [lindex $childNodes 3] [$root firstChild] set result [$root asXML -indent none] $doc delete set result } {} test domNode-23.7 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set childNodes [$root childNodes] for {set i 1} {$i < 4} {incr i} { $root removeChild [lindex $childNodes $i] } foreach child $childNodes { $root replaceChild $child [$root firstChild] } set result [$root asXML -indent none] $doc delete set result } {} test domNode-24.1 {getLine} { set doc [dom parse ] set root [$doc documentElement] set result [catch {$root getLine}] $doc delete set result } {1} dom setStoreLineColumn 1 set doc [dom parse { }] set root [$doc documentElement] dom setStoreLineColumn 0 test domNode-24.2 {getLine} { $root getLine } {1} test domNode-24.3 {getColumn} { $root getColumn } {0} test domNode-24.4 {getLine} { [$root firstChild] getLine } {2} test domNode-24.5 {getLine getColumn} { set node [$root selectNodes //e2] set result [$node getLine].[$node getColumn] } {2.4} $doc delete set doc [dom parse { text child}] set root [$doc documentElement] test domNode-25.1 {hasAttribute} { $root hasAttribute attr3 } 1 test domNode-25.2 {hasAttribute} { $root hasAttribute attr4 } 0 test domNode-25.3 {hasAttributeNS} { $root hasAttributeNS http://tdom.org/ns attr1 } 1 test domNode-25.4 {hasAttributeNS} { $root hasAttributeNS http://tdom.org attr1 } 0 $doc delete test domNode-26.1 {appendXML} { set doc [dom createDocument root] set root [$doc documentElement] $root appendXML "text" set result [$root asXML -indent none] $doc delete set result } {text} test domNode-26.2 {appendXML} { set doc [dom parse ] set root [$doc documentElement] $root appendXML "text" set result [$root asXML -indent none] $doc delete set result } {text} set doc [dom parse { }] set root [$doc documentElement] test domNode-27.1 {target, data} { set piNode [$root selectNodes /processing-instruction()] set result [$piNode target].[$piNode data] } {piBeforeRoot.do this} test domNode-27.2 {target, data} { set piNodes [$root selectNodes processing-instruction()] set result "" foreach piNode $piNodes { set result "$result [$piNode target].[$piNode data]" } set result } { pi1.my & data pi2.data} $doc delete test domNode-28.1 {getAttributeNS} { set doc [dom parse { }] set root [$doc documentElement] set result [$root getAttributeNS "ns1" attr1] $doc delete set result } {p:attr1Value} proc domAppendChild {parent name} { $parent ownerDocument doc $doc createElement $name node $parent appendChild $node } test domNode-29.1 {ownerDocument} { dom createDocument document doc set root [$doc documentElement] domAppendChild $root foo1 domAppendChild $root foo2 set result [$doc asXML -indent none] $doc delete set result } {} set doc [dom parse {text}] set root [$doc documentElement] test domNode-30.1 {precedes} { catch {$root precedes} } {1} test domNode-30.2 {precedes} { set firstChild [$root firstChild] catch {$root start $firstChild foo} } {1} test domNode-30.3 {precedes} { set result [catch {$root precedes notaNode} errMsg] lappend result $errMsg } {1 {Parameter "notaNode" is not a domNode.}} test domNode-30.4 {precedes} { set firstChild [$root firstChild] $root precedes $firstChild } {1} test domNode-30.5 {precedes} { set firstChild [$root firstChild] $root precedes $firstChild } {1} test domNode-30.6 {precedes} { set firstChild [$root firstChild] $firstChild precedes $root } {0} test domNode-30.7 {precedes} { set firstChild [$root firstChild] $firstChild precedes $firstChild } {0} test domNode-30.8 {precedes} { set doc1 [dom parse ] set root1 [$doc1 documentElement] set result [catch {$root precedes $root1} errMsg] lappend result $errMsg $doc1 delete set result } {1 {Cannot compare the relative order of nodes out of different documents.}} test domNode-30.9 {precedes} { set firstChild [$root firstChild] set newNode [$doc createElement newNode] $root insertBefore $newNode $firstChild $newNode precedes $firstChild } {1} test domNode-30.10 {precedes} { set newNode [$doc createTextNode "new text node"] set result [catch {$root precedes $newNode} errMsg] lappend result $errMsg } {1 {Cannot compare the relative order of a node with a node out of the fragment list.}} $doc delete dom parse {} doc $doc documentElement root set e [$root selectNodes //e] set eee [$root selectNodes //eee] test domNode-30.11 {precedes} { $e precedes $eee } {1} test domNode-30.12 {precedes} { $eee precedes $e } {0} $doc delete test domNode-31.1 {insertBefore - syntax check} { set doc [dom parse ] set root [$doc documentElement] set result [catch {$root insertBefore}] $doc delete set result } {1} test domNode-31.2 {insertBefore - syntax check} { set doc [dom parse
    ] set root [$doc documentElement] set result [catch {$root insertBefore [$root firstChild]}] $doc delete set result } {1} test domNode-31.3 {insertBefore - tries to insert node as child of node} { set doc [dom parse ] set root [$doc documentElement] catch {$root insertBefore $root [$root lastChild]} errMsg $doc delete set errMsg } {HIERARCHY_REQUEST_ERR} test domNode-31.4 {insertBefore - refnode invalide} { set doc [dom parse ] set root [$doc documentElement] set newElement [$doc createElement new] catch {$root insertBefore $newElement $root} errMsg $doc delete set errMsg } {NOT_FOUND_ERR} # Prior to dom.c r1.63 insertBefore leaks the node to insert, if the refnode # isn't valid. test domNode-31.5 {insertBefore - refnode invalide} { set doc [dom parse ] set root [$doc documentElement] set oneChild [$root firstChild] set twoChild [$root lastChild] catch {$oneChild insertBefore [$oneChild firstChild] $root} errMsg set result [list $errMsg [llength [$oneChild childNodes]]] $doc delete set result } {NOT_FOUND_ERR 1} test domNode-31.6 {insertBefore - refnode and new node to insert are the same} { dom parse doc $doc documentElement root $root firstChild firstChild $root insertBefore $firstChild $firstChild set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.7 {insertBefore - insert a sibling of node} { dom parse {} doc set root [$doc documentElement] $root firstChild a $root lastChild b $a insertBefore $b [$a firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.8 {insertBefore - new node is node} { dom parse doc $doc documentElement root $root firstChild firstChild catch {$root insertBefore $root $firstChild} errMsg $doc delete set errMsg } {HIERARCHY_REQUEST_ERR} test domNode-31.9 {insertBefore tries to insert a parent of node as child} { set doc [dom parse ] set root [$doc documentElement] $root firstChild a catch {$a insertBefore $root [$a firstChild]} errMsg $doc delete set errMsg } {HIERARCHY_REQUEST_ERR} test domNode-31.10 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a lastChild] [$a firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.11 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a lastChild] [$a firstChild] catch {unset result} set node [$a firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {two one} test domNode-31.12 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a lastChild] [$a firstChild] catch {unset result} set node [$a lastChild] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {one two} test domNode-31.13 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a firstChild] [$a lastChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.14 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a firstChild] [$a lastChild] catch {unset result} set node [$a firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {one two} test domNode-31.15 {insertBefore - node to insert is a sibling of ref node} { set doc [dom parse ] $doc documentElement root $root firstChild a $a insertBefore [$a firstChild] [$a lastChild] catch {unset result} set node [$a lastChild] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {two one} test domNode-31.16 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $doc createElement new newNode $root insertBefore $newNode "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.17 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $doc createElement new newNode $root insertBefore $newNode "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.18 {insertBefore - try to insert the root node of the doc} { dom parse doc $doc documentElement root catch {$root insertBefore [$root selectNodes /] [$root firstChild]} errMsg $doc delete set errMsg } {HIERARCHY_REQUEST_ERR} test domNode-31.19 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root firstChild] "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.20 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root firstChild] "" catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {b c a} test domNode-31.21 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root firstChild] "" catch {unset result} set node [$root lastChild] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {a c b} test domNode-31.22 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root lastChild] "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.23 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root lastChild] "" catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {a b c} test domNode-31.24 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root lastChild] "" catch {unset result} set node [$root lastChild] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {c b a} test domNode-31.25 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root selectNodes {*[2]}] "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.26 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root selectNodes {*[2]}] "" catch {unset result} set node [$root firstChild] while {$node != ""} { lappend result [$node nodeName] set node [$node nextSibling] } $doc delete set result } {a c b} test domNode-31.27 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root insertBefore [$root selectNodes {*[2]}] "" catch {unset result} set node [$root lastChild] while {$node != ""} { lappend result [$node nodeName] set node [$node previousSibling] } $doc delete set result } {b c a} test domNode-31.28 {insertBefore - empty ref node} { dom parse doc $doc documentElement root $root firstChild a $root lastChild b $a insertBefore $b "" set result [$doc asXML -indent none] $doc delete set result } {} test domNode-31.29 {insertBefore - ref node is a node out of the fragment list} { dom parse {} doc $doc documentElement root set newNode [$doc createElement new] set result [catch {$root insertBefore [$root lastChild] $newNode} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} test domNode-31.30 {insertBefore - ref node not a node child, equal to new node} { dom parse {} doc $doc documentElement root set newNode [$doc createElement new] set result [catch {$root insertBefore $newNode $newNode} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} test domNode-32.1 {asText - syntax check} { dom parse doc $doc documentElement root set result [catch {$root asText foo}] $doc delete set result } {1} test domNode-32.2 {asText} { dom parse { pcdata foo bar grill } doc $doc documentElement root set result [$root asText] $doc delete set result } {pcdata foo bar grill} test domNode-32.3 {asText} { dom parse -keepEmpties \ {pcdata Hello, world!]]> more pcdata} doc $doc documentElement root set result [$root asText] $doc delete set result } {pcdata Hello, world! more pcdata} test domNode-32.4 {asText} { dom parse {pcdata} doc $doc documentElement root set newCDATAnode \ [$doc createCDATASection "Hello, world!"] $root appendChild $newCDATAnode set result [$root asText] $doc delete set result } {pcdata} set xml { some text } dom parse $xml doc $doc documentElement root test domNode-32.5 {asText} { $root asText } {some text} test domNode-32.6 {asText} { set result {} foreach child [$root childNodes] { lappend result [$child asText] } set result } {{some text} { A comment } {this is the testPI data }} $doc delete dom parse -keepEmpties $xml doc $doc documentElement root test domNode-32.7 {asText} { $root asText } { some text } $doc delete # The tests in domNode-33.* also uses the nodeCmds created for the # domNode-13.* tests. test domNode-33.1 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root $root insertBeforeFromScript { nodeCmds::e1 } [$root firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domNode-33.2 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root $root insertBeforeFromScript { nodeCmds::e1 } {} set result [$doc asXML -indent none] $doc delete set result } {} test domNode-33.3 {insertBeforeFromScript - error in the script} { set doc [dom parse {}] $doc documentElement root set result [catch {$root insertBeforeFromScript { nodeCmds::e1 nodeCmds::e1 { # This is intentionally wrong set foo 1 + 1 } } [$root firstChild]}] lappend result [$doc asXML -indent none] $doc delete set result } {1 } test domNode-33.4 {insertBeforeFromScript - insert more then one node} { set doc [dom parse {}] $doc documentElement root namespace eval nodeCmds { $::root insertBeforeFromScript { e1 e2 { t new } e1 } [lindex [$::root childNodes] 1] } set result [$doc asXML -indent none] $doc delete set result } {new} test domNode-33.5 {insertBeforeFromScript - insert more then one node} { set doc [dom parse {}] $doc documentElement root namespace eval nodeCmds { $::root insertBeforeFromScript { e1 e2 { t new } e1 } [lindex [$::root childNodes] 1] } set result "" foreach node [$root childNodes] { append result "[$node nodeName] " } $doc delete set result } {foo e1 e2 e1 bar grill } test domNode-33.6 {insertBeforeFromScript - insert more then one node} { set doc [dom parse {}] $doc documentElement root namespace eval nodeCmds { $::root insertBeforeFromScript { e1 e2 { t new } e1 } [lindex [$::root childNodes] 1] } set result "" set node [$root lastChild] while {$node != ""} { append result "[$node nodeName] " set node [$node previousSibling] } $doc delete set result } {grill bar e1 e2 e1 foo } test domNode-33.7 {insertBeforeFromScript - error in script} { set doc [dom parse {}] $doc documentElement root catch {namespace eval nodeCmds { $::root insertBeforeFromScript { e1 e2 { t new } e1 this is wrong } [lindex [$::root childNodes] 2] }} set result [$doc asXML -indent none] $doc delete set result } {} test domNode-33.8 {insertBeforeFromScript - wrong reference node} { set doc [dom parse {}] $doc documentElement root set result [catch {$root insertBeforeFromScript { nodeCmds::e1 } $root} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} test domNode-34.1 {getBaseURI} {need_uri} { makeFile domNode-34.1-e1.xml [file join [file dir [info script]] data] makeFile domNode-34.1-e2.xml [file join [file dir [info script]] data] set baseURI [tdom::baseURL [file join [pwd] [file dir [info script]] dom.test]] set doc [dom parse \ -baseurl $baseURI \ -externalentitycommand ::tdom::extRefHandler { ]> &a; &b; }] $doc documentElement root set result 1 foreach child [$root childNodes] { lappend baseURIs [$child getBaseURI] } if {([lindex $baseURIs 0] == [lindex $baseURIs 1]) || ([lindex $baseURIs 0] == [lindex $baseURIs 2]) || ([lindex $baseURIs 1] == [lindex $baseURIs 2]) || ([lindex $baseURIs 2] != [$root getBaseURI])} { set result 0 } $doc delete set result } {1} test domNode-34.2 {getBaseURI} {need_uri} { makeFile domNode-34.1-e1.xml [file join [file dir [info script]] data] makeFile domNode-34.1-e2.xml [file join [file dir [info script]] data] set baseURI [tdom::baseURL [file join [pwd] [file dir [info script]] dom.test]] set doc [dom parse \ -baseurl $baseURI \ -externalentitycommand ::tdom::extRefHandler { ]> &a; &b; }] $doc delete set doc [dom parse \ -baseurl $baseURI \ -externalentitycommand ::tdom::extRefHandler { ]> &a; &b; }] $doc documentElement root set result 1 foreach child [$root childNodes] { lappend baseURIs [$child getBaseURI] } if {([lindex $baseURIs 0] == [lindex $baseURIs 1]) || ([lindex $baseURIs 0] == [lindex $baseURIs 2]) || ([lindex $baseURIs 1] == [lindex $baseURIs 2]) || ([lindex $baseURIs 2] != [$root getBaseURI])} { set result 0 } $doc delete set result } {1} proc 35.1 {doc} { $doc documentElement root } test domNode-35.1 {objCmd traces} { for {set x 0} {$x < 1} {incr x} { set doc [dom parse {}] $doc documentElement root 35.1 $doc $doc delete } } {} proc 35.2.2 {doc} { $doc documentElement root } proc 35.2.1 {doc} { $doc documentElement root 35.2.2 $doc return $root } # test domNode-35.2 {objCmd traces} { # set doc [dom parse {}] # set rootCmdName [35.2.1 $doc] # set result [info commands $rootCmdName] # $doc delete # set result # } {} proc 35.3.2 {doc} { $doc documentElement root $doc delete } proc 35.3.1 {doc} { $doc documentElement root 35.3.2 $doc return $root } test domNode-35.3 {objCmd traces} { set doc [dom parse {}] set rootCmdName [35.3.1 $doc] set result [info commands $rootCmdName] set result } {} test domNode-36.1 {nodeName} { set doc [dom parse ] set cdataNode [$doc createCDATASection foo] set result [$cdataNode nodeName] $doc delete set result } \#cdata-section test domNode-36.2 {nodeName} { set doc [dom parse ] set commentNode [$doc createComment foo] set result [$commentNode nodeName] $doc delete set result } \#comment test domNode-36.3 {nodeName} { set doc [dom parse ] set piNode [$doc createProcessingInstruction p "p value"] set result [$piNode nodeName] $doc delete set result } p proc 37.1 {base system public} { return [list string file://this/that \ "External general parsed entity. Text and elements at\ toplevel mixed and so on"] } test domNode-37.1 {baseURI} { set doc [dom parse \ -baseurl "file://foo" \ -externalentitycommand 37.1 -keepEmpties { ]> &a;}] set root [$doc documentElement] set result [$root baseURI] foreach node [$root childNodes] { lappend result [expr {"file://this/that" == [$node baseURI]}] } $doc delete set result } {file://foo 0 1 1 1 1 0} test domNode-37.2 {baseURI} { set doc [dom parse \ -baseurl "file://foo" \ -externalentitycommand 37.1 -keepEmpties { ]> &a;}] set root [$doc documentElement] $root insertBefore [$root lastChild] [$root firstChild] set result {} foreach node [$root childNodes] { lappend result [$node baseURI] } $doc delete set result } {file://foo file://this/that file://this/that file://this/that} test domNode-37.3 {baseURI} { set doc [dom parse \ -baseurl "file://foo" \ -externalentitycommand 37.1 -keepEmpties { ]> &a;}] set root [$doc documentElement] $root appendChild [$root firstChild] set result {} foreach node [$root childNodes] { lappend result [$node baseURI] } $doc delete set result } {file://this/that file://this/that file://this/that file://foo} proc 37.4 {base systemId publicId} { switch $systemId { "a.xml" { return [list string file://base/2 "&b;"] } "b.xml" { return [list string file://base/3 ""] } default { error "error in text script" } } } test domNode-37.4 {baseURI} { set doc [dom parse \ -baseurl "file://base/1" \ -externalentitycommand 37.4 { ]> &a;}] set root [$doc documentElement] set result [$root baseURI] set rootchild [$root firstChild] lappend result [$rootchild baseURI] set rootchildchild [$rootchild firstChild] lappend result [$rootchildchild baseURI] lappend result [[$rootchildchild firstChild] baseURI] lappend result [[$rootchildchild nextSibling] baseURI] lappend result [[$rootchild nextSibling] baseURI] $doc delete set result } {file://base/1 file://base/2 file://base/3 file://base/3 file://base/2 file://base/1} proc 37.5 {base systemId publicId} { switch $systemId { "a.xml" { return [list string file://base/2 "&b;"] } "b.xml" { return [list string file://base/3 ""] } default { error "error in text script" } } } test domNode-37.5 {baseURI} { set doc [dom parse \ -baseurl "file://base/1" \ -externalentitycommand 37.5 { ]> &a;}] set result {} set node [$doc documentElement] while {$node != ""} { lappend result [$node baseURI] set node [$node firstChild] } $doc delete set result } {file://base/1 file://base/1 file://base/1 file://base/2 file://base/2 file://base/3 file://base/3 file://base/3} proc 37.6 {base systemId publicId} { switch $systemId { "a.xml" { return [list string file://base/2 "text"] } default { error "error in text script" } } } test domNode-37.6 {baseURI} { set doc [dom parse \ -baseurl "file://base/1" \ -externalentitycommand 37.6 { ]> &a;}] set result {} set root [$doc documentElement] foreach child [$root childNodes] { lappend result [$child baseURI] } $doc delete set result } {file://base/2 file://base/2 file://base/2 file://base/1} proc 37.7 {base systemId publicId} { switch $systemId { "a.xml" { return [list string file://base/2 "text - base2"] } default { error "error in text script" } } } test domNode-37.7 {baseURI} { set doc [dom parse \ -baseurl "file://base/1" \ -externalentitycommand 37.7 { ]> &a;text - base 1}] set result {} set root [$doc documentElement] foreach child [$root childNodes] { lappend result [$child baseURI] } $doc delete set result } {file://base/2 file://base/2 file://base/2 file://base/1 file://base/1} test domNode-38.1 {toXPath - comment node} { set doc [dom parse { foo}] set root [$doc documentElement] set result {} foreach comment [$root selectNodes comment()] { lappend result [$comment toXPath] } $doc delete set result } {/root/comment()} test domNode-38.2 {toXPath - top level comment} { set doc [dom parse { foo}] set result {} foreach toplevelcomment [$doc selectNodes /comment()] { lappend result [$toplevelcomment toXPath] } $doc delete set result } [list {/comment()[1]} {/comment()[2]} {/comment()[3]}] test domNode-38.3 {toXPath - syntax} -setup { set doc [dom parse ] set root [$doc documentElement] } -body { catch {$root toXPath foo bar} errMsg set errMsg } -cleanup { $doc delete } -match regexp -result {wrong # args: should be "domNode(0x)?[[:xdigit:]]+ toXPath \?-legacy\?"} test domNode-38.4 {toXPath - default xml namespace} -setup { set doc [dom parse {}] $doc selectNodesNamespaces {foo foo} set root [$doc documentElement] set foo1 [$root selectNodes foo:foo] set xfo1 [$foo1 toXPath] } -body { expr {$foo1 == [[$foo1 ownerDocument] selectNodes [$foo1 toXPath]]} } -cleanup { $doc delete } -result 1 test domNode-38.5 {toXPath - default xml namespace} -setup { set doc [dom parse { some text }] set root [$doc documentElement] $doc selectNodesNamespaces {foo foo} set foo2 [$root selectNodes {foo:foo[2]}] } -body { expr {$foo2 == [[$foo2 ownerDocument] selectNodes [$foo2 toXPath]]} } -cleanup { $doc delete } -result 1 test domNode-38.6 {toXPath - xml namespace} -setup { set doc [dom parse { some text }] set root [$doc documentElement] $doc selectNodesNamespaces {foo foo} set foo2 [$root selectNodes {foo:foo[2]}] } -body { expr {$foo2 == [[$foo2 ownerDocument] selectNodes [$foo2 toXPath]]} } -cleanup { $doc delete } -result 1 test domNode-38.7 {toXPath - pathological xml namespace} -setup { set doc [dom parse { some text }] set root [$doc documentElement] $doc selectNodesNamespaces {foo foo} set foo2 [$root selectNodes {foo:foo[2]}] } -body { expr {$foo2 == [[$foo2 ownerDocument] selectNodes [$foo2 toXPath]]} } -cleanup { $doc delete } -result 1 test domNode-38.8 {toXPath - pathological xml namespace} -setup { set doc [dom parse { text some text text }] } -body { set result "" foreach node [$doc selectNodes //node()] { if {$node != [[$node ownerDocument] selectNodes [$node toXPath]]} { set result [$node toXPath] break } } set result } -cleanup { $doc delete } -result "" test domNode-38.9 {toXPath - really long element name} -constraints { knownBug } -setup { set doc [dom parse "<[string repeat abc 100]/>"] set root [$doc documentElement] set firstChild [$root firstChild] } -body { $firstChild toXPath } -cleanup { $doc delete } -result "/doc/[string repeat abc 100]" test domNode-39.1 {text} { set doc [dom parse {text bold more text}] $doc documentElement root set result [$root text] $doc delete set result } {text more text} test domNode-999.1 {move nodes from one doc to another} { set doc1 [dom parse {}] set doc2 [dom parse {text}] set root1 [$doc1 documentElement] set root2 [$doc2 documentElement] $root1 appendChild [$root2 firstChild] set textNode [[$root1 firstChild] firstChild] if {[$textNode ownerDocument] == $doc1} {set result 1} else {set result 0} $doc1 delete $doc2 delete set result } {1} test domNode-999.2 {node references should not change even after renumbering} { dom parse {} doc set root [$doc documentElement] set oldNode [lindex [$root childNodes] 1] dom parse {} tempDoc set tempNode [$tempDoc documentElement] $oldNode appendChild $tempNode set childList1 [$root childNodes] $root selectNodes {//child[@name='a']} set childList2 [$root childNodes] if {$childList1 == $childList2} { set result 1 } else { set result 0 } $doc delete $tempDoc delete set result } {1} # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/domNode.bench0000644000175000001440000000013213325450307017161 xustar000000000000000030 mtime=1532383431.445385785 30 atime=1532383431.501385618 30 ctime=1532383431.445385785 tdom-0.9.1/tests/domNode.bench0000644000175000001440000001657613325450307016416 0ustar00rolfusers00000000000000# -*- tcl -*- # Tcl Benchmark File # # This file contains a number of benchmarks for the domNode methods. # This allow developers to monitor/gauge/track package performance. # # (c) 2006 Rolf Ade # # $Id$ # ### ### ### ######### ######### ######### ########################### ## Setting up the environment ... package require tdom # ### ### ### ######### ######### ######### ########################### ## Benchmarks. dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } bench -desc "appendFromScript-10-elements" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { e1 e2 e1 e2 e1 e2 e1 e2 e1 e2 } } -post { $doc delete } bench -desc "appendFromScript-10-elements2" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { e1 e1 e1 e1 e1 e1 e1 e1 e1 e1 } } -post { $doc delete } foreach nrOf {10 100 1000} { bench -desc "appendFromScript-nonamespace-element-$nrOf" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { for {set i 0} {$i < $nrOf} {incr i} { e1 } } } -post { $doc delete } bench -desc "appendFromScript-namespace-element-$nrOf" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { for {set i 0} {$i < $nrOf} {incr i} { nodeCmds::e1 } } } -post { $doc delete } bench -desc "appendFromScript-nonamespace-elementandtext-$nrOf" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { for {set i 0} {$i < $nrOf} {incr i} { e1 { t "This is text node $i" } } } } -post { $doc delete } bench -desc "appendFromScript-namespace-elementandtext-$nrOf" -pre { set doc [dom parse ] set root [$doc documentElement] } -body { $root appendFromScript { for {set i 0} {$i < $nrOf} {incr i} { nodeCmds::e1 { nodeCmds::t "This is text node $i" } } } } -post { $doc delete } } foreach nrOf {10 100 1000} { bench -desc "Create childs with dom methods $nrOf" -pre { dom createDocument root doc $doc documentElement root } -body { for {set x 0} {$x < $nrOf} {incr x} { $doc createElement e1 newNode $root appendChild $newNode } } -post { $doc delete } } foreach nrOf {10 100 1000} { bench -desc "Count returned domNode commands $nrOf" -pre { dom createDocument root doc $doc documentElement root $root appendFromScript { for {set x 0} {$x < $nrOf} {incr x} { e1 } } } -body { llength [$doc selectNodes -cache 1 /root/e1] } -post { $doc delete } } foreach nrOf {1 10 100 1000} { bench -desc "Count returned domNode tokens $nrOf" -pre { dom createDocument root doc $doc documentElement root $root appendFromScript { for {set x 0} {$x < $nrOf} {incr x} { e1 } } } -body { llength [domNode $root selectNodes -cache 1 /root/e1] } -post { $doc delete } } foreach nrOf {1 10 100 1000} { bench -desc "Use XPath to count returned nodes $nrOf" -pre { dom createDocument root doc $doc documentElement root $root appendFromScript { for {set x 0} {$x < $nrOf} {incr x} { e1 } } } -body { $doc selectNodes -cache 1 count(/root/e1) } -post { $doc delete } } foreach nrOf {1 10 100 1000} { bench -desc "getElementsByTagName: $nrOf returned nodes" -pre { dom createDocument root doc $doc documentElement root $root appendFromScript { for {set x 0} {$x < $nrOf} {incr x} { e1 } } } -body { $doc getElementsByTagName e1 } -post { $doc delete } } foreach nrOf {1 10 100 1000} { bench -desc "getElementsByTagName: $nrOf returned node tokens" -pre { dom createDocument root doc $doc documentElement root $root appendFromScript { for {set x 0} {$x < $nrOf} {incr x} { e1 } } dom setObjectCommands token } -body { $doc getElementsByTagName e1 } -post { dom setObjectCommands automatic $doc delete } } bench -desc "firstChild node cmd" -pre { dom parse doc $doc documentElement root } -body { $root firstChild } -post { $doc delete } bench -desc "firstChild node token" -pre { dom parse doc $doc documentElement root dom setObjectCommands token } -body { $root firstChild } -post { $doc delete dom setObjectCommands automatic } bench -desc "firstChild node token from node token" -pre { dom parse doc dom setObjectCommands token $doc documentElement root } -body { domNode $root firstChild } -post { $doc delete dom setObjectCommands automatic } dom parse doc $doc documentElement root bench -desc "Check for text-only element - xpath - empty" -body { for {set x 0} {$x < 100} {incr x} { $doc selectNodes -cache 1 {count(node()) = 1 and node() = text()} } } bench -desc "Check for text-only element - xpath(uncached) - empty" -body { for {set x 0} {$x < 100} {incr x} { $doc selectNodes {count(node()) = 1 and node() = text()} } } bench -desc "Check for text-only element - tcl - empty" -body { for {set x 0} {$x < 100} {incr x} { expr {[llength [$root childNodes]] == 1 && [[$root firstChild] nodeType] == "TEXT_NODE"} } } $doc delete dom parse foo doc $doc documentElement root bench -desc "Check for text-only element - xpath - text-only" -body { for {set x 0} {$x < 100} {incr x} { $doc selectNodes -cache 1 {count(node()) = 1 and node() = text()} } } bench -desc "Check for text-only element - xpath(uncached) - text-only" -body { for {set x 0} {$x < 100} {incr x} { $doc selectNodes {count(node()) = 1 and node() = text()} } } bench -desc "Check for text-only element - tcl - text-only" -body { for {set x 0} {$x < 100} {incr x} { expr {[llength [$root childNodes]] == 1 && [[$root firstChild] nodeType] == "TEXT_NODE"} } } $doc delete tdom-0.9.1/tests/PaxHeaders.9215/decls.test0000644000175000001440000000013213325450307016566 xustar000000000000000030 mtime=1532383431.444385788 30 atime=1532383431.501385618 30 ctime=1532383431.444385788 tdom-0.9.1/tests/decls.test0000644000175000001440000002346413325450307016015 0ustar00rolfusers00000000000000# Features covered: Declarations # # This file tests the parser's performance on markup declarations. # Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright (c) 2000 Zveno Pty Ltd. # # $Id$ source [file join [file dir [info script]] loadtdom.tcl] set baseURI file://[file join [pwd] [file dir [info script]] decls.test] catch {unset elements} proc elementDecl {name cmodel} { set ::elements($name) $cmodel } catch {unset attrs} proc attlistDecl {name attName type dfltValue isrequired} { lappend ::attrs($name/$attName) $type $isrequired $dfltValue } catch {unset entities} proc entityDecl {name is_param value base systemId publicId notationName} { set ::entities($name) [list $is_param $value $base $systemId $publicId $notationName] } catch {unset cdata} proc CData data { append ::cdata [string trim $data] } proc extRefH {base systemId publicId} { if {![regexp {^[a-zA-Z]+://} $systemId]} { regsub {^[a-zA-Z]+://} $base {} base set basedir [file dirname $base] set systemId "[set basedir]/[set systemId]" } else { regsub {^[a-zA-Z]+://} $systemId systemId } if {[catch {set fd [open $systemId]}]} { return -code error \ -errorinfo "Failed to open external entity $systemId" } return [list channel $systemId $fd] } proc extRefHstr {base systemId publicId} { if {![regexp {^[a-zA-Z]+://} $systemId]} { regsub {^[a-zA-Z]+://} $base {} base set basedir [file dirname $base] set systemId "[set basedir]/[set systemId]" } else { regsub {^[a-zA-Z]+://} $systemId systemId } if {[catch {set fd [open $systemId]}]} { return -code error \ -errorinfo "Failed to open external entity $systemId" } return [list string $systemId [read $fd [file size $systemId]]] } # Internal DTD subset test decls-1.1 {element declaration} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-1.1 {}} set parser [xml::parser decls-1.1 \ -elementdeclcommand elementDecl] $parser parse { ]> } array get ::elements } {Test {MIXED {} {} {}}} test decls-2.1 {attribute list declaration, implied} { catch {unset ::attrs} array set ::attrs {} catch {rename xml::decls-2.1 {}} set parser [xml::parser decls-2.1 \ -attlistdeclcommand attlistDecl] $parser parse { ]> } array get ::attrs } {Test/test {CDATA 0 {}}} test decls-2.2 {attribute list declaration, enum} { catch {unset ::attrs} array set ::attrs {} catch {rename xml::decls-2.2 {}} set parser [xml::parser decls-2.2 \ -attlistdeclcommand attlistDecl] $parser parse { ]> } array get ::attrs } {Test/test {(LGL|OTH) 0 LGL}} test decls-3.1 {entity declarations} { catch {unset ::entities} array set ::entities {} catch {rename xml::decls-3.1 {}} set parser [xml::parser decls-3.1 \ -entitydeclcommand entityDecl] $parser parse { ]> } array get ::entities } {testEnt {0 {replacement text} {} {} {} {}}} test decls-4.1 {parameter entity declarations} { catch {unset ::entities} array set ::entities {} catch {unset ::elements} array set ::elements {} catch {rename xml::decls-4.1 {}} set parser [xml::parser decls-4.1 \ -paramentityparsing notstandalone \ -elementdeclcommand elementDecl] $parser parse { %PEnt; ]> } array get ::elements } {Test {MIXED {} {} {}}} # NB. entity.test tests entity replacement as well # External entities test decls-5.1 {external entity} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-5.1 {}} set parser [xml::parser decls-5.1 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {Test {MIXED {} {} {}}} test decls-5.2 {external DTD subset} { catch {unset ::elements} array set ::elements {} catch {unset ::entities} array set ::entities {} catch {rename xml::decls-5.2 {}} set parser [xml::parser decls-5.2 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {Test {MIXED {} {} {}}} test decls-5.3 {external entity} { catch {unset ::elements} array set ::elements {} catch {unset ::entities} array set ::entities {} catch {unset ::externals} array set ::externals {} catch {rename xml::decls-5.3 {}} set parser [xml::parser decls-5.3 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { %module; ]> } array get ::elements } {Test {MIXED {} {} {}}} test decls-5.4 {external entity} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-5.4 {}} set parser [xml::parser decls-5.4 \ -paramentityparsing notstandalone \ -externalentitycommand extRefHstr \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {Test {MIXED {} {} {}}} test decls-5.5 {external DTD subset} { catch {unset ::elements} array set ::elements {} catch {unset ::entities} array set ::entities {} catch {rename xml::decls-5.5 {}} set parser [xml::parser decls-5.5 \ -paramentityparsing notstandalone \ -externalentitycommand extRefHstr \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {Test {MIXED {} {} {}}} test decls-5.6 {external entity} { catch {unset ::elements} array set ::elements {} catch {unset ::entities} array set ::entities {} catch {unset ::externals} array set ::externals {} catch {rename xml::decls-5.6 {}} set parser [xml::parser decls-5.6 \ -paramentityparsing notstandalone \ -externalentitycommand extRefHstr \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { %module; ]> } array get ::elements } {Test {MIXED {} {} {}}} # Conditional Sections test decls-6.1 {conditional section: include} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-6.1 {}} set parser [xml::parser decls-6.1 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {Test {MIXED {} {} {}}} test decls-6.2 {conditional section: include, empty} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-6.2 {}} set parser [xml::parser decls-6.2 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {} test decls-6.3 {conditional section: include, empty} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-6.3 {}} set parser [xml::parser decls-6.3 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array get ::elements } {} test decls-6.4 {conditional section: include, nested} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-6.4 {}} set parser [xml::parser decls-6.4 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array size ::elements } 3 test decls-6.6 {conditional section/PE combo} { catch {unset ::elements} array set ::elements {} catch {rename xml::decls-6.6 {}} set parser [xml::parser decls-6.6 \ -paramentityparsing notstandalone \ -externalentitycommand extRefH \ -elementdeclcommand elementDecl \ -baseurl $baseURI] $parser parse { } array size ::elements } 2 foreach parser [info commands decls-*] { $parser free } # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/domDoc.test0000644000175000001440000000013213325450307016701 xustar000000000000000030 mtime=1532383431.445385785 30 atime=1532383431.501385618 30 ctime=1532383431.445385785 tdom-0.9.1/tests/domDoc.test0000644000175000001440000013420513325450307016124 0ustar00rolfusers00000000000000# Features covered: domDoc and docObj command # # This file contains a collection of tests for the two interfaces to # DOM docs, the token interface (the domDoc command) and the tcl # command interface ([$docObj method ...]). # # domDoc-1.*: asXML, asHTML # domDoc-2.*: publicId, systemId # domDoc-3.*: toXSLTcmd # domDoc-4.*: asText # domDoc-5.*: normalize # domDoc-6.*: nodetype # domDoc-7.*: insertBefore # domDoc-8.*: insertBeforeFromScript # domDoc-9.*: replaceChild # domDoc-10.*: getElementById # domDoc-11.*: firstChild # domDoc-12.*: lastChild # domDoc-13.*: appendChild # domDoc-14.*: removeChild # domDoc-15.*: hasChildNodes # domDoc-16.*: childNodes # domDoc-17.*: ownerDocument # domDoc-18.*: appendFromList # domDoc-19.*: appendXML # domDoc-20.*: selectNodes # domDoc-21.*: baseURI # domDoc-22.*: appendFromScript # domDoc-23.*: getElementsByTagNameNS # domDoc-24.*: cdataSectionElements # domDoc-25.*: selectNodesNamespaces # domDoc-26.*: fragments list # domDoc-27.*: deleteXPathCache # domDoc-28.*: createElementNS # # Copyright (c) 2004 - 2007 Rolf Ade. source [file join [file dir [info script]] loadtdom.tcl] test domDoc-1.1 {asXML -escapeNonASCII} {need_i18n} { set doc [dom parse [tdom::xmlReadFile \ [file join [file dir [info script]] data/i18n_1.xml]]] set result [$doc asXML -escapeNonASCII] $doc delete set result } {абвгдежзий } test domDoc-1.2 {asXML -escapeNonASCII; comments and PI's are not altered} {need_i18n} { set doc [dom parse [tdom::xmlReadFile \ [file join [file dir [info script]] data/i18n_2.xml]]] set result [$doc asXML -indent none -escapeNonASCII] $doc delete set result } " german umlauts: äöüß " test domDoc-1.3 {asHTML -escapeNonASCII -htmlEntities} {need_i18n} { set doc [dom parse {äü„‟†}] set result [$doc asHTML -escapeNonASCII -htmlEntities] $doc delete set result } {äü„‟†} set doc [dom parse ] test domDoc-1.4 {asXML -doctypeDeclaration} { $doc asXML -doctypeDeclaration 1 } { } test domDoc-1.5 {asXML -doctypeDeclaration without boolean value (error)} { set errMsg "" catch {$doc asXML -doctypeDeclaration} errMsg set errMsg } {-doctypeDeclaration must have a boolean value as argument} test domDoc-1.6 {asXML -doctypeDeclaration 0} { $doc asXML -doctypeDeclaration 0 } { } $doc delete test domDoc-1.7 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.8 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.9 {asXML -doctypeDeclaration} { set doc [dom parse {}] set result [$doc asXML -doctypeDeclaration true] $doc delete set result } { } test domDoc-1.10 {asXML - unknown option} { set doc [dom parse {}] set errMsg "" catch {$doc asXML -fooOption 1} errMsg $doc delete set errMsg } {bad option "-fooOption": must be -indent, -channel, -escapeNonASCII, -doctypeDeclaration, -xmlDeclaration, -encString, -escapeAllQuot, -indentAttrs, -nogtescape, or -noEmptyElementTag} test domDoc-1.11 {asXML - non boolean value to -doctypeDeclaration} { set doc [dom parse {}] set errMsg "" catch {$doc asXML -doctypeDeclaration foo} errMsg $doc delete set errMsg } {expected boolean value but got "foo"} test domDoc-1.12 {asXML - shortened option} { set doc [dom parse {}] set result [$doc asXML -doctype 1] $doc delete set result } { } test domDoc-1.13 {asHTML -doctypeDeclaration} { set doc [dom createDocument HTML] set result [$doc asHTML -doctypeDeclaration 1] $doc delete set result } { } test domDoc-1.14 {asHTML -doctypeDeclaration} { set doc [dom parse {

    boo

    }] set result [$doc asHTML -doctypeDeclaration 1] $doc delete set result } {

    boo

    } test domDoc-1.15 {asXML - processing-instruction without pi value} { set doc [dom parse {}] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-1.16 {asXML - processing-instruction without pi value} { set doc [dom parse {}] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-1.17 {asHTML - content of script/style tags} { set doc [dom parse { }] set result [$doc asHTML] $doc delete set result } { } test domDoc-1.18 {asXML -escapeAllQuot} { set doc [dom parse {This is "strange"}] set result [$doc asXML -escapeAllQuot] $doc delete set result } {This is "strange" } test domDoc-1.19 {asXML -escapeAllQuot} { set doc [dom parse {This is "strange"}] set result [$doc asXML] $doc delete set result } {This is "strange" } test domDoc-1.20 {asXML - indentation of comments} { set doc [dom parse { }] set result [$doc asXML -indent 4] $doc delete set result } { } test domDoc-1.21 {asXML -indentAttrs} { set doc [dom parse {}] set result [$doc asXML -indentAttrs 4] $doc delete set result } { } test domDoc-1.22 {asXML} { set doc [dom createDocument doc] set result [$doc asXML] $doc delete set result } { } test domDoc-1.23 {asXML -xmlDeclaration} { set doc [dom createDocument doc] set result [$doc asXML -xmlDeclaration 1] $doc delete set result } { } test domDoc-1.23 {asXML -xmlDeclaration} { set doc [dom createDocument doc] set result [$doc asXML -xmlDeclaration 1] $doc delete set result } { } test domDoc-1.24 {asXML just -encString without -xmlDeclaration} { set doc [dom createDocument doc] set result [$doc asXML -encString foo] $doc delete set result } { } test domDoc-1.25 {asXML -xmlDeclaration -encString} { set doc [dom createDocument doc] set result [$doc asXML -xmlDeclaration 1 -encString foo] $doc delete set result } { } test domDoc-1.26 {asXML -xmlDeclaration, encoding set by encoding method} { set doc [dom createDocument doc] $doc encoding "foo" set result [$doc asXML -xmlDeclaration 1] $doc delete set result } { } test domDoc-1.27 {asXML -xmlDeclaration -encString} { set doc [dom createDocument doc] set result [catch { [$doc asXML -xmlDeclaration 1 -encString foo \ -encString bar -wrongOption] }] $doc delete set result } 1 test domDoc-1.28 {asXML -xmlDeclaration not xml compliant -encString} { set doc [dom createDocument doc] set result [$doc asXML -xmlDeclaration 1 -encString 1\u2345] $doc delete set result } [subst -nocommands -novariables { }] test domDoc-1.29 {asXML -nogtescape} { set doc [dom parse {>}] set result [$doc asXML -nogtescape -indent none] $doc delete set result } {>} test domDoc-1.30 {asXML -noEmptyElementTag} { set doc [dom parse {}] set result [$doc asXML -noEmptyElementTag -indent none] $doc delete set result } {} test domDoc-1.31 {asXML '"' in attribute value} { # emacs: " set doc [dom createDocument doc] set root [$doc documentElement] $root setAttribute attr "foo\"bar" set result [$doc asXML -indent none] $doc delete set result } {} set doc [dom parse ] test domDoc-2.1 {publicId - no publicId there} { $doc publicId } {} test domDoc-2.2 {systemId - no systemId there} { $doc systemId } {} $doc delete set doc [dom parse {}] test domDoc-2.3 {publicId from parsed document} { $doc publicId } {-//foo//DTD bar x.y//EN} test domDoc-2.4 {systemId from parsed document} { $doc systemId } {file:///boo.baz} $doc delete set doc [dom parse {}] test domDoc-2.5 {publicId but document has only SYSTEM} { $doc publicId } {} test domDoc-2.6 {systemId, document has only SYSTEM} { $doc systemId } {file:///boo.baz} test domDoc-2.7 {publicId - set public identifier} { set result [$doc publicId "file:///woo.hoo"] append result " [$doc publicId]" } { file:///woo.hoo} test domDoc-2.8 {publicId - set public identifier} { $doc publicId "http://www.tdom.org" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.9 {systemId - set system identifier} { set result [$doc systemId "file:///woo.hoo"] append result " [$doc systemId]" } {file:///boo.baz file:///woo.hoo} test domDoc-2.10 {systemId - set system identifier} { $doc systemId "file:///whooze.moo" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.11 {publicId - set to empty string} { $doc publicId "" $doc asXML -indent no -doctypeDeclaration 1 } { } test domDoc-2.12 {systemId - set to empty string} { $doc systemId "" $doc asXML -indent no -doctypeDeclaration 1 } { } $doc delete set doc [dom parse ] set xslt1 { } test domDoc-3.1 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] $xsltCmd -parameters {param2 newValue param3 "this Value"} $doc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd -parameters {param1 "that Value"} $doc resultDoc append result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd -parameters {param3 "another" param1 "and this"} $doc resultDoc append result [$resultDoc asXML -indent none] $resultDoc delete rename $xsltCmd {} set result } {param1Default newValue this Value that Value param2Default param3Default and this param2Default another } set xslt2 { dummy result This is from xsl:message } proc msgCmd1 {msg terminate} { global result append result "msgCmd1: $msg " } proc msgCmd2 {msg terminate} { global result append result "msgCmd2: $msg" } test domDoc-3.2 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt2] set xsltCmd [$xslt toXSLTcmd] set result "" $xsltCmd -xsltmessagecmd msgCmd1 $doc resultDoc $resultDoc delete $xsltCmd -xsltmessagecmd msgCmd2 $doc resultDoc $resultDoc delete rename $xsltCmd {} set result } {msgCmd1: This is from xsl:message msgCmd2: This is from xsl:message} test domDoc-3.3 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -bogusOption foo $doc resultDoc} errMsg] lappend result $errMsg lappend result [catch {$xsltCmd $doc resultDoc}] lappend result [$resultDoc asXML -indent none] $resultDoc delete rename $xsltCmd {} set result } {1 {bad option "-bogusOption": must be -parameters, -ignoreUndeclaredParameters, -maxApplyDepth, or -xsltmessagecmd} 0 {param1Default param2Default param3Default }} test domDoc-3.4 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -xsltmessagecmd msgCmd1} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {wrong # args: should be "?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-maxApplyDepth int? ?-xsltmessagecmd cmd? ?objVar?"}} test domDoc-3.5 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd $doc resultDoc bogus} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {wrong # args: should be "?-parameters parameterList? ?-ignoreUndeclaredParameters? ?-maxApplyDepth int? ?-xsltmessagecmd cmd? ?objVar?"}} test domDoc-3.6 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd -parameters {param1 foo} -parameters {param2 foo} $doc resultDoc} errMsg] rename $xsltCmd {} lappend result $errMsg } {1 {only one -parameters option allowed}} test domDoc-3.7 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd}] $xsltCmd delete set result } {1} test domDoc-3.8 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd delete bogus}] $xsltCmd delete set result } {1} test domDoc-3.9 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] set result [catch {$xsltCmd transform} errMsg] $xsltCmd delete set result } {1} test domDoc-3.10 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt1] set xsltCmd [$xslt toXSLTcmd] $xsltCmd transform $doc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xsltCmd delete set result } {param1Default param2Default param3Default } set xslt3 { mixed element this is more text } test domDoc-3.11 {toXSLTcmd} { set xslt [dom parse -keepEmpties $xslt3] set xsltCmd [$xslt toXSLTcmd] set result [list] for {set x 0} {$x < 2} {incr x} { $xsltCmd $doc resultDoc lappend result [lsort [$resultDoc cdataSectionElements *]] lappend result [$resultDoc asXML -indent none] $resultDoc delete } $xsltCmd delete set result } {{b bar doc foo} {} {b bar doc foo} {}} $doc delete test domDoc-4.1 {asText - syntax check} { dom parse doc set result [catch {$doc asText foo}] $doc delete set result } {1} test domDoc-4.2 {asText} { dom parse {pcdata foo bar grill} doc set result [$doc asText] $doc delete set result } {pcdata foo bar grill} test domDoc-4.3 {asText} { dom parse {pcdata Hello, world!]]> more pcdata} doc set result [$doc asText] $doc delete set result } {pcdata Hello, world! more pcdata} test domDoc-4.4 {asText} { dom parse {pcdata} doc $doc documentElement root set newCDATAnode \ [$doc createCDATASection "Hello, world!"] $root appendChild $newCDATAnode set result [$doc asText] $doc delete set result } {pcdata} test domDoc-4.5 {asText} { dom parse {encoded chars: > < & " '} doc set result [$doc asText] $doc delete set result } {encoded chars: > < & " '} # emacs: " test domDoc-5.1 {normalize} { set doc [dom parse text] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {2 text} test domDoc-5.2 {normalize} { set doc [dom parse text] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize -forXPath set result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {1 {textcdata section text}} test domDoc-5.3 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set textNode [$doc createTextNode text] set child [$root firstChild] $child appendChild $cdataNode $child appendChild $textNode set result [llength [$child childNodes]] $doc normalize -forXPath lappend result [llength [$child childNodes]] lappend result [[$child firstChild] data] $doc delete set result } {2 1 {cdata section texttext}} test domDoc-5.4 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection "cdata section text"] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [$cdataNode nodeType] $doc normalize -forXPath lappend result [$cdataNode nodeType] $doc delete set result } {CDATA_SECTION_NODE TEXT_NODE} test domDoc-5.5 {normalize} { set doc [dom parse ] $doc documentElement root set textNode [$doc createTextNode ""] set child [$root firstChild] $child appendChild $textNode set result [llength [$child childNodes]] $doc normalize lappend result [llength [$child childNodes]] $doc delete set result } {1 0} test domDoc-5.6 {normalize} { set doc [dom parse ] $doc documentElement root set cdataNode [$doc createCDATASection ""] set child [$root firstChild] $child appendChild $cdataNode $doc normalize set result [llength [$child childNodes]] $doc normalize -forXPath lappend result [llength [$child childNodes]] $doc delete set result } {1 0} test domDoc-6.1 {nodeType} { set doc [dom parse ] set result [$doc nodeType] $doc delete set result } {DOCUMENT_NODE} test domDoc-6.2 {nodeType} { set doc [dom parse ] set result [catch {$doc nodeType foo}] $doc delete set result } {1} test domDoc-7.1 {insertBefore} { set doc [dom parse {}] set root [$doc documentElement] set newPI [$doc createProcessingInstruction myPI pivalue] $doc insertBefore $newPI $root set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-7.2 {insertBefore} { set doc [dom parse {}] set newPI [$doc createProcessingInstruction myPI pivalue] $doc insertBefore $newPI "" set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-7.3 {insertBefore} { set doc [dom parse {}] set newPI [$doc createProcessingInstruction myPI pivalue] set root [$doc documentElement] set child [$root firstChild] set result [catch {$doc insertBefore $newPI $child} errMsg] lappend result $errMsg $doc delete set result } {1 NOT_FOUND_ERR} namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } test domDoc-8.1 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root $doc insertBeforeFromScript { nodeCmds::e1 } $root set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-8.2 {insertBeforeFromScript} { set doc [dom parse {}] $doc insertBeforeFromScript { nodeCmds::e1 } "" set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-8.3 {insertBeforeFromScript} { set doc [dom parse {}] $doc documentElement root set result [catch {$root insertBeforeFromScript { nodeCmds::e1 nodeCmds::e1 { # This is intentionally wrong set foo 1 + 1 } } $root}] lappend result [$doc asXML -indent none] $doc delete set result } {1 } test domDoc-9.1 {replaceChild} { set doc [dom parse {}] set root [$doc documentElement] set newNode [$doc createElement newNode] $doc replaceChild $newNode $root set result [$doc asXML -indent none] lappend result [[$doc documentElement] nodeName] $doc delete set result } { newNode} set getElementByIdSetup { set doc [dom parse { ]> }] } test domDoc-10.1 {getElementById} -setup $getElementByIdSetup -body { set result [[$doc getElementById "4a"] @name] lappend result [$doc getElementById "dontexists"] } -cleanup { $doc delete } -result {that {}} test domDoc-10.2 {getElementById - only IDs at parsing time will be found} \ -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[3]}] if {[$elemNode hasAttribute id]} { error "error in the test code" } $elemNode setAttribute id "new" $doc getElementById "new" } -cleanup { $doc delete } -result {} test domDoc-10.3 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $elemNode setAttribute id "new" [$doc getElementById "new"] getAttribute name } -cleanup { $doc delete } -result that test domDoc-10.4 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $root removeChild $elemNode [$doc getElementById "4a"] getAttribute name } -cleanup { $doc delete } -result that test domDoc-10.5 {getElementById} -setup $getElementByIdSetup -body { set root [$doc documentElement] set elemNode [$root selectNodes {elem[2]}] if {![$elemNode hasAttribute id]} { error "error in the test code" } $elemNode removeAttribute id $doc getElementById "4a" } -cleanup { $doc delete } -result {} test domDoc-11.1 {firstChild} { set doc [dom createDocumentNode] set result [$doc firstChild] $doc delete set result } {} test domDoc-11.2 {firstChild} { set doc [dom parse ] set result [[$doc firstChild] nodeName] $doc delete set result } {root} test domDoc-11.3 {firstChild} { set doc [dom parse {}] set result [[$doc firstChild] nodeName] $doc delete set result } {beforeRoot} test domDoc-11.4 {firstChild} { set doc [dom parse {}] set node [$doc firstChild] set newNode [$doc createElement newNode] $doc insertBefore $newNode $node set result [[$doc firstChild] nodeName] $doc delete set result } {newNode} test domDoc-11.5 {Delete top level node} { set doc [dom parse {}] [$doc firstChild] delete set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-11.6 {Delete top level node} { set doc [dom parse {}] [$doc documentElement] delete set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-12.1 {lastChild} { set doc [dom createDocumentNode] set result [$doc lastChild] $doc delete set result } {} test domDoc-12.2 {lastChild} { set doc [dom parse ] set result [[$doc lastChild] nodeName] $doc delete set result } {root} test domDoc-12.3 {lastChild} { set doc [dom parse {}] set result [[$doc lastChild] nodeName] $doc delete set result } {afterRoot} test domDoc-12.4 {lastChild} { set doc [dom parse {}] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc lastChild] nodeName] lappend result [[$doc lastChild] parentNode] $doc delete set result } {newNode {}} test domDoc-13.1 {appendChild} { set doc [dom parse {}] set newNode [$doc createElement newNode] $doc appendChild $newNode set newNode [$doc createComment "a comment"] $doc appendChild $newNode set newNode [$doc createProcessingInstruction this that] $doc appendChild $newNode set newNode [$doc createTextNode "text"] $doc appendChild $newNode set result [$doc asXML -indent none] $doc delete set result } {text} test domDoc-13.2 {appendChild} { set doc [dom createDocumentNode] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc documentElement] nodeName] $doc delete set result } {newNode} test domDoc-13.3 {appendChild} { set doc [dom createDocumentNode] set newNode [$doc createElement newNode] $doc appendChild $newNode set result [[$doc documentElement] parentNode] $doc delete set result } {} test domDoc-14.1 {removeChild} { set doc [dom parse {}] $doc removeChild [$doc firstChild] set result [$doc documentElement] $doc delete set result } {} test domDoc-14.2 {removeChild} { set doc [dom parse {}] $doc removeChild [$doc firstChild] set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-14.3 {removeChild} { set doc [dom createDocumentNode] set result [catch {$doc removeChild [$doc firstChild]}] $doc delete set result } {1} test domDoc-15.1 {hasChildNodes} { set doc [dom createDocumentNode] set result [$doc hasChildNodes] set newNode [$doc createElement newNode] $doc appendChild $newNode lappend result [$doc hasChildNodes] $doc delete set result } {0 1} test domDoc-16.1 {childNodes} { set doc [dom parse {}] set result {} foreach node [$doc childNodes] { lappend result [$node nodeName] } $doc delete set result } {beforeRoot root afterRoot} test domDoc-17.1 {ownerDocument} { set doc [dom parse ] set result [expr {$doc == [$doc ownerDocument]}] $doc delete set result } {1} test domDoc-18.1 {appendFromList} { set doc [dom createDocumentNode] $doc appendFromList {elem {} {}} set node [$doc documentElement] set result [list [$node nodeName] [$node parentNode]] $doc delete set result } {elem {}} test domDoc-19.1 {appendXML} { set doc [dom createDocumentNode] $doc appendXML footext set result [$doc asXML -indent none] $doc delete set result } {footext} test domDoc-19.2 {appendXML} { set doc [dom createDocumentNode] $doc appendXML footext set result [[$doc documentElement] nodeName] lappend result [[$doc documentElement] parentNode] lappend result [expr {$doc == [[$doc documentElement] ownerDocument]}] $doc delete set result } {test {} 1} test domDoc-19.3 {appendXML} { set doc [dom createDocument foo] $doc appendXML footext set result [[$doc documentElement] nodeName] set result [$doc asXML -indent none] $doc delete set result } {footext} test domDoc-20.1 {selectNodes} { set doc [dom parse {}] set result [[$doc selectNodes {root/child[2]}] getAttribute id] $doc delete set result } {2} test domDoc-20.2 {selectNodes} { set doc [dom parse {}] set result [[$doc selectNodes {/root/child[2]}] getAttribute id] $doc delete set result } {2} test domDoc-20.3 {selectNodes} { set doc [dom parse {}] set result [list] foreach node [$doc selectNodes *] { lappend result [$node nodeName] } set result } {root} test domDoc-20.4 {selectNodes} { set doc [dom parse {}] set result [list] foreach node [$doc selectNodes node()] { lappend result [$node nodeType] } set result } {COMMENT_NODE ELEMENT_NODE PROCESSING_INSTRUCTION_NODE} test domDoc-20.5 {selectNodes with -namespaces option} { set doc [dom createDocumentNS "http://tdom.org" tdom:doc] set node [$doc selectNodes \ -namespaces {tdom http://tdom.org} \ tdom:doc] set result [$node nodeName] set node [$doc selectNodes \ -namespaces {myPrefix http://tdom.org} \ myPrefix:doc] lappend result [$node nodeName] lappend result [$doc selectNodes -namespaces {} doc typeVar] lappend result $typeVar $doc delete set result } [list tdom:doc tdom:doc "" empty] test domDoc-20.6 {selectNodes with -namespaces option} { set doc [dom createDocumentNS "http://tdom.org" tdom:doc] set node [$doc selectNodes \ -namespaces {foo bar} \ -namespaces {a b c d} \ -namespaces {tdom http://tdom.org} \ tdom:doc] set result [$node nodeName] set node [$doc selectNodes \ -namespaces {myPrefix http://tdom.org} \ myPrefix:doc] lappend result [$node nodeName] lappend result [$doc selectNodes -namespaces {} doc typeVar] lappend result $typeVar $doc delete set result } [list tdom:doc tdom:doc "" empty] test domDoc-20.7 {selectNodes with -namespaces option} { set doc [dom createDocumentNS "http://tdom.org" tdom:doc] catch {set node [$doc selectNodes \ -namespaces {foo bar} \ -namespaces {a b c d} \ -namespaces {wrong_not_pair} \ tdom:doc]} errMsg $doc delete set errMsg } {The "-namespaces" option requires a 'prefix namespace' pairs list as argument} test domDoc-21.1 {baseURI} { set doc [dom createDocumentNode] set result [$doc baseURI] $doc delete set result } {} test domDoc-21.2 {baseURI} { set doc [dom parse -baseurl file://foo ] set result [$doc baseURI] $doc baseURI http://that.this lappend result [$doc baseURI] $doc delete set result } {file://foo http://that.this} namespace eval nodeCmds { dom createNodeCmd elementNode e1 dom createNodeCmd elementNode e2 dom createNodeCmd commentNode c dom createNodeCmd textNode t dom createNodeCmd cdataNode cdata dom createNodeCmd piNode pi dom createNodeCmd parserNode parser } test domDoc-22.1 {appendFromScript} { set doc [dom createDocumentNode] $doc appendFromScript nodeCmds::e1 set result [$doc asXML -indent none] lappend result [[$doc documentElement] nodeName] $doc delete set result } { e1} test domDoc-22.2 {appendFromScript} { set doc [dom parse ] $doc appendFromScript { nodeCmds::e1 nodeCmds::e2 } # namespace eval nodeCmds { # $doc appendFromScript { # e1 # e2 # } # } set result [$doc asXML -indent none] foreach node [$doc selectNodes *] { lappend result [$node parentNode] lappend result [expr {$doc == [$node ownerDocument]}] } $doc delete set result } { {} 1 {} 1 {} 1} test domDoc-22.3 {appendFromScript} { set doc [dom createDocumentNode] set nrOfNodeCmdsBefore [info commands domNode*] $doc appendFromScript { nodeCmds::e1 } $doc delete set nrOfNodeCmdsAfter [info commands domNode*] expr {$nrOfNodeCmdsBefore == $nrOfNodeCmdsAfter} } {1} test domDoc-23.1 {getElementsByTagNameNS} { dom createNodeCmd elementNode child set doc [dom createDocument root] $doc documentElement root $root appendFromScript { for {set x 0} {$x < 250} {incr x} { child [list xmlns ns$x] {} } } set xml [$doc asXML] $doc delete set doc [dom parse $xml] set result 1 for {set x 0} {$x < 250} {incr x} { set nodes [$doc getElementsByTagNameNS ns$x *] if {[llength $nodes] != 1} { set result 0 } } $doc delete set result } {1} test domDoc-24.1 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements} errMsg] lappend result $errMsg $doc delete set result } {1 {wrong # args: should be " cdataSectionElements ?URI:?localname ?boolean?"}} test domDoc-24.2 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements foo bar grill} errMsg] lappend result $errMsg $doc delete set result } {1 {wrong # args: should be " cdataSectionElements ?URI:?localname ?boolean?"}} test domDoc-24.3 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [catch {$doc cdataSectionElements root foo} errMsg] lappend result $errMsg $doc delete set result } {1 {expected boolean value but got "foo"}} test domDoc-24.4 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root] $doc delete set result } {0} test domDoc-24.5 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root 0] lappend result [$doc cdataSectionElements root 1] lappend result [$doc cdataSectionElements root 0] $doc delete set result } {0 1 0} test domDoc-24.6 {cdataSectionElements} { set doc [dom parse {Some Text}] set result [$doc cdataSectionElements root 1] lappend result [$doc asXML -indent none] $doc delete set result } {1 {}} test domDoc-24.7 {cdataSectionElements} { set doc [dom parse {<foo>}] foreach element {foo root bar grill} { $doc cdataSectionElements $element 1 } set result [$doc asXML -indent none] $doc delete set result } {]]>} test domDoc-24.8 {cdataSectionElements} { set doc [dom parse {text ]}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.9 {cdataSectionElements} { set doc [dom parse {text ]]}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.10 {cdataSectionElements} { set doc [dom parse {text ]]>}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } {]]>} test domDoc-24.11 {cdataSectionElements} { set doc [dom parse {text ]]> text]]>text}] $doc cdataSectionElements root 1 set result [$doc asXML -indent none] $doc delete set result } { text]]]]>text]]>} test domDoc-24.12 {cdataSectionElements} { set doc [dom parse {text}] $doc cdataSectionElements http://foo.bar:root 1 set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-24.13 {cdataSectionElements} { set doc [dom parse {text}] set result [$doc cdataSectionElements ""] $doc delete set result } {0} test domDoc-24.14 {cdataSectionElements} { set doc [dom parse {text}] set result [$doc cdataSectionElements *] $doc delete set result } {} test domDoc-24.15 {cdataSectionElements} { set doc [dom parse {text}] foreach elem {foo bar grill root http://www.foo.org:baz} { $doc cdataSectionElements $elem 1 } foreach elem {foo grill} { $doc cdataSectionElements $elem 0 } set result [lsort [$doc cdataSectionElements *]] $doc delete set result } {bar http://www.foo.org:baz root} test domDoc-24.16 {cdataSectionElements} { set doc [dom parse {some text}] $doc documentElement root set node [$root firstChild] $doc cdataSectionElements child 1 set result [$node asXML -indent none] $doc delete set result } {} test domDoc-24.17 {cdataSectionElements} { set doc [dom parse {some text more text text again}] $doc cdataSectionElements child 1 set result [$doc asXML -indent none] $doc delete set result } {more text} test domDoc-25.1 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [$doc selectNodesNamespaces] $doc delete set result } {} test domDoc-25.2 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [list [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {}] \ [$doc selectNodesNamespaces]] $doc delete set result } {{} {} {}} test domDoc-25.3 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [list [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {prefix http://foo.org/uri}] \ [$doc selectNodesNamespaces] \ [$doc selectNodesNamespaces {}]] $doc delete set result } {{} {prefix http://foo.org/uri} {prefix http://foo.org/uri} {}} test domDoc-25.4 {selectNodesNamespaces} { set doc [dom createDocument foo] set result [catch {$doc selectNodesNamespaces wrong} errMsg] lappend result $errMsg $doc delete set result } {1 {The optional argument to the selectNodesNamespaces method must be a 'prefix namespace' pairs list}} test domDoc-25.5 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default1 rootdefaultNS} set node [$doc selectNodes default1:root] set result [list [$node prefix] [$node localName]] $doc delete set result } {{} root} test domDoc-25.6 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes default1:root/default2:elem1/default2:elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 elem1NS} test domDoc-25.7 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes default1:root/default2:elem1/elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 {}} test domDoc-25.7.1 {selectNodesNamespaces} { set doc [dom parse { }] $doc documentElement root $root firstChild elem1 $doc createElement elem11 elem11 $elem1 appendChild $elem11 $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes default1:root/default2:elem1/elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 {}} test domDoc-25.8 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set result [catch {set node [$doc selectNodes \ -namespaces { dflt1 elem1NS dflt2 rootdefaultNS } \ default1:root/dflt1:elem1/elem11]} errMsg] lappend result $errMsg $doc delete set result } {1 {Prefix doesn't resolve}} test domDoc-25.9 {selectNodesNamespaces} { set doc [dom parse { }] $doc selectNodesNamespaces {default2 elem1NS default1 rootdefaultNS} set node [$doc selectNodes default1:root/default2:elem1] set result [list [$node prefix] [$node localName]] set node [$doc selectNodes \ -namespaces {dflt1 elem1NS dflt2 rootdefaultNS} \ dflt2:root/dflt1:elem1/elem11] lappend result [$node nodeName] [$node namespaceURI] $doc delete set result } {{} elem1 elem11 {}} test domDoc-26.1 {Fragment list} { set doc [dom parse { text1text2text3}] $doc removeChild [$doc firstChild] $doc documentElement root for {set i 1} {$i < 4} {incr i} { set removedNode$i [$root removeChild [$root firstChild]] } $removedNode2 delete $root appendChild $removedNode3 $root appendChild $removedNode1 set result [$doc asXML -indent none] $doc delete set result } {text3text1} test domDoc-27.1 {deleteXPathCache} { set doc [dom createDocument doc] set result [list] lappend result [$doc deleteXPathCache foo/bar] $doc selectNodes -cache 1 2+2 lappend result [$doc deleteXPathCache foo/bar] lappend result [$doc deleteXPathCache 2+2] lappend result [$doc deleteXPathCache] $doc selectNodes -cache 1 2+2 $doc delete set result } {{} {} {} {}} test domDoc-28.1 {createElementNS} { set doc [dom createDocument doc] set newElem [$doc createElementNS uri ns:e] $doc documentElement root $root appendChild $newElem set result [$doc asXML -indent none] $doc delete set result } {} test domDoc-28.2 {createElementNS} { set doc [dom createDocument doc] set newElem [$doc createElementNS uri ns:e] $newElem setAttributeNS uri ns:att value $doc documentElement root $root appendChild $newElem set result [$doc selectNodes -namespaces {ns uri} string(/doc/ns:e/@ns:att)] $doc delete set result } {value} test domDoc-28.3 {createElementNS} { set doc [dom createDocument doc] catch {$doc createElementNS "" e} errMsg $doc delete set errMsg } {Missing URI in Namespace declaration} # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/xslt.test0000644000175000001440000000013213325450307016466 xustar000000000000000030 mtime=1532383431.448385776 30 atime=1532383431.502385615 30 ctime=1532383431.448385776 tdom-0.9.1/tests/xslt.test0000644000175000001440000013061413325450307015711 0ustar00rolfusers00000000000000# Features covered: XSLT transformation # # This file contains a collection of tests for the XSLT engine of # tDOM. It is focused mainly on the tcl interface of the engine and on # verification, that the created result tree behaves as if it would # have been parsed from an according XML source; the vaste majority of # xslt compliance tests are done outside the tcltest framework. # # Tested commands and object commands: # xslt-1.*: xpath Lexer/parser tests # xslt-2.*: xslt method command variants, -parameters option # xslt-3.*: xslt vars, scope, parameters # xslt-4.*: xslt transformations on modified/created from the scratch docs # xslt-5.*: External documents: document(), xsl:import, xsl:include # xslt-6.*: xsl:output # xslt-7.*: tests related to the created result doc # xslt-8.*: Additional xslt rec compliance tests (details not covered by # by the external xslt compliance test suite). # xslt-9.*: xslt transformations that are using scripted xpath functions # # Copyright (c) 2002 - 2005, 2013 Rolf Ade. # # RCS: @(#) $Id$ source [file join [file dir [info script]] loadtdom.tcl] test xslt-1.1 {unicode chars outside of US-ASCII in var name} {need_i18n} { set xml [dom parse {}] set xslt [dom parse [tdom::xmlReadFile [file join [pwd] [file dir [info script]] data/xslt_1.xsl]]] set xmlroot [$xml documentElement] $xmlroot xslt $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {foo} test xslt-1.2 {xpath parse real number} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {0.12345} test xslt-1.3 {xpath parse real number} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {-0.12345} test xslt-1.4 {pattern IsFQElement with FillNodeList} { set xml [dom parse {}] set xslt [dom parse { }] $xml xslt $xslt resultDoc set result [$resultDoc asXML -indent none] $xslt delete $xml delete $resultDoc delete set result } {m:elem} test xslt-1.5 {space between \$ and varname} { set xml [dom parse {}] set xslt [dom parse { }] set xsltCmd [$xslt toXSLTcmd] set result [catch {set resultDoc [$xsltCmd transform $xml]} errMsg] $xsltCmd delete $xml delete lappend result $errMsg } {1 {Expected variable name}} test xslt-1.6 {space in nodetest node( )} { set xml [dom parse {text}] set xslt [dom parse { }] set xsltCmd [$xslt toXSLTcmd] set resultDoc [$xsltCmd transform $xml] $xsltCmd delete $xml delete set result [$resultDoc asText] $resultDoc delete set result } {3} test xslt-2.1 {xslt top level parameter: use default value} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {parameter1Value} test xslt-2.2 {xslt top level parameter: overwrite default value with -parameters} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {parameter1 startValue} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {startValue} test xslt-2.3 {xslt top level parameter: overwrite default value with -parameters} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {parameter1 startValue} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {startValue parameter2Value} test xslt-2.4 {xslt top level parameter: overwrite default value with -parameters} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {parameter1 startValue1 parameter2 startValue2} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {startValue1 startValue2} test xslt-2.5 {xslt top level parameter: try to set nonexisted param} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt -parameters {nonExistend foo} $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {There isn't a parameter named "nonExistend" defined at top level in the stylesheet.} test xslt-2.6 {xslt top level parameter: try to set variable} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt -parameters {variable1 foo} $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {"variable1" is defined as variable, not as parameter.} test xslt-2.7 {xslt top level parameter} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt -parameters {parameter2 foo} $xslt resultDoc} errMsg set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {variable1Value foo} test xslt-2.8 {xslt top level parameter: wrong usage of -parameters option} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt -parameters $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {parameter value missing: the -parameters option needs a list of parameter name and parameter value pairs} test xslt-2.9 {xslt top level parameter: wrong usage of -parameters option} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt -parameters {foo bar baz} $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {parameter value missing: the -parameters option needs a list of parameter name and parameter value pairs} test xslt-2.10 {no resultDoc variable name} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] set resultDoc [$xmlroot xslt $xslt] set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {parameter1Value} test xslt-2.11 {xslt top level parameter: set with 'strange' value} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {parameter1 foo\"'<>bar} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {foo"'<>bar} # emacs: " test xslt-2.12 {xslt top level parameter: set FQ top-level param} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {foo:parameter1 setValue} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {setValue} test xslt-2.13 {xslt top level parameter: set FQ top-level param} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {foo:parameter1 setValue} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {setValue} test xslt-2.14 {xslt top level parameter: set FQ top-level param} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] $xmlroot xslt -parameters {foo:parameter1 setValue} $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot asXML] $xml delete $xslt delete $resultDoc delete set result } {setValue} test xslt-2.15 {xslt top level parameter:\ try to set nonexisted param with ignore} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] set result [catch {$xmlroot xslt -ignoreUndeclaredParameters\ -parameters {nonExistend foo}\ $xslt resultDoc} errMsg] $resultDoc delete $xml delete $xslt delete set result } {0} test xslt-2.16 {xslt top level parameter: try to set nonexisted param with ignore} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] set xmlroot [$xml documentElement] $xmlroot xslt -ignoreUndeclaredParameters \ -parameters {nonExistend foo parameter2 givenValue} \ $xslt resultDoc set resultroot [$resultDoc documentElement] set result [$resultroot nodeValue] $resultDoc delete $xml delete $xslt delete set result } {parameter1Value givenValue} proc xsltmessagecmd {msg terminate} { global xsltMsgs global terminatingMsg append xsltMsgs "$msg terminate: $terminate " if {$terminate} { set terminatingMsg 1 } else { set terminatingMsg 0 } } test xslt-2.17 {xslt - to less arguments to the method} { set xml [dom parse {}] set result [catch {$xml xslt}] $xml delete set result } {1} test xslt-2.18 {xslt -xsltmessagecmd} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { some text 1. call 2. call 3. call }] set xmlroot [$xml documentElement] set ::xsltMsgs "" $xmlroot xslt -xsltmessagecmd xsltmessagecmd $xslt resultDoc $resultDoc delete $xml delete $xslt delete set ::xsltMsgs } {1. call terminate: 0 2. call terminate: 0 3. call terminate: 0 } test xslt-2.19 {xslt -xsltmessagecmd} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { some text 1. call 2. call 3. call }] set xmlroot [$xml documentElement] set ::xsltMsgs "" catch {$xmlroot xslt -xsltmessagecmd xsltmessagecmd $xslt resultDoc} $xml delete $xslt delete set ::terminatingMsg } {1} test xslt-2.20 {xslt top level parameter: use top level param to set a top level var} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] $xml xslt -parameters {sortentity "the parameter value"} $xslt resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xml delete $xslt delete set result } {the parameter value} proc xslt-2.21-xsltmsgcmd {msg terminate} { global result if {$msg eq "3"} { return -code break } append result $msg } test xslt-2.21 {xslt -xsltmessagecmd return code break} { set result "" set xml [dom parse {}] set xslt [dom parse { }] catch {$xml xslt -xsltmessagecmd xslt-2.21-xsltmsgcmd $xslt resultDoc} errMsg append result $resultDoc $errMsg $xml delete $xslt delete set result } {12} test xslt-2.22 {xslt -xsltmessagecmd return code break} { set result "" set xml [dom parse {}] set xslt [dom parse { }] set resultDoc "untouched" catch {$xml xslt -ignoreUndeclaredParameters -xsltmessagecmd xslt-2.21-xsltmsgcmd $xslt resultDoc} errMsg append result $resultDoc $xml delete $xslt delete set result } {12} test xslt-2.23 {xslt outputVar} { set result "" set xml [dom parse {}] set xslt [dom parse { }] set resultDoc "untouched" catch {$xml xslt -foo $xslt resultDoc} errMsg append result $resultDoc $xml delete $xslt delete set result } {untouched} test xslt-2.24 {xslt outputVar} { set xml [dom parse {}] set xslt [dom parse { }] set result [catch {$xml xslt -foo $xslt }] $xml delete $xslt delete set result } {1} test xslt-2.25 {xslt outputVar} { set xml [dom parse {}] set xslt [dom parse { Here }] $xml xslt $xslt resultDoc $xml delete $xslt delete set result [$resultDoc asXML -indent none] $resultDoc delete set result } {} test xslt-2.26 {xslt -maxApplyDepth option} { set xml [dom parse {}] set xslt [dom parse { e }] catch {$xml xslt -maxApplyDepth 3 $xslt} errMsg $xml delete $xslt delete set errMsg } "Maximum nested apply templates reached (potential infinite template recursion?)." test xslt-3.1 {xslt variable scope} { set xml [dom parse {}] set xslt [dom parse { }] set xmlroot [$xml documentElement] catch {$xmlroot xslt $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {Variable "main" has not been declared.} test xslt-3.2 {xslt error msg of variable redeclaration in one template} { set xml [dom parse {}] set xslt [dom parse { }] catch {$xml xslt $xslt resultDoc} errMsg $xml delete $xslt delete set errMsg } {Variable 'var' is already declared in this template} test xslt-3.3 {use top level var to set a top level var} { set xml [dom parse -keepEmpties {}] set xslt [dom parse -keepEmpties { }] $xml xslt $xslt resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xml delete $xslt delete set result } {var1Value} test xslt-4.1 {xslt transformation of a source which was modifed after parsing} { dom parse -baseurl file:///tmp/abc.xml {} doc $doc documentElement root $root appendXML dom parse { } xslDoc $root xslt $xslDoc newDoc set result [$newDoc asXML -indent none] $doc delete $xslDoc delete $newDoc delete set result } {} set xslt { Data stored in the stylesheet } proc 5.1-extref {baseURI systemId publicId} { if {$baseURI != ""} { error "baseURI not empty" } if {$systemId != ""} { error "systemId not empty" } return [list string "" $::xslt] } test xslt-5.1 {xslt document('') with empty baseURI} { dom parse xmldoc dom parse -externalentitycommand 5.1-extref $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xsltdoc delete $xmldoc delete set result } {Data stored in the stylesheet} proc xslt-5.2 {args} { error "script error in xslt-5.2 external enitity resolver" } set xslt { } test xslt-5.2 {xslt document() with script error in -externalentitycommand} { dom parse xmldoc dom parse -externalentitycommand xslt-5.2 $xslt xsltdoc set result [catch {$xmldoc xslt $xsltdoc resultDoc} errMsg] $xmldoc delete $xsltdoc delete lappend result $errMsg } {1 {script error in xslt-5.2 external enitity resolver}} proc xslt-5.3 {args} { return [list string file://some/base " xmldoc dom parse -externalentitycommand xslt-5.3 $xslt xsltdoc set result [catch {$xmldoc xslt $xsltdoc resultDoc} errMsg] $xmldoc delete $xsltdoc delete lappend result $errMsg } {1 {Error while processing external entity "foo": At line 1 character 15: not well-formed (invalid token)}} proc xslt-5.4 {base systemId publicId} { switch $systemId { "firstlevel" { return [list string file://some/base/first { }] } "secondlevel" { return [list string file://some/base/second " foo } test xslt-5.4 {xslt document() with script error in -externalentitycommand} { dom parse xmldoc dom parse -externalentitycommand xslt-5.4 $xslt xsltdoc set result [catch {$xmldoc xslt $xsltdoc resultDoc} errMsg] $xmldoc delete $xsltdoc delete lappend result $errMsg } {1 {Error while processing external entity "secondlevel": At line 1 character 15: not well-formed (invalid token)}} set xslt { foo } test xslt-5.5 {xsl:import href == ""} { dom parse xmldoc dom parse -externalentitycommand xslt-5.4 $xslt xsltdoc set result [catch {$xmldoc xslt $xsltdoc resultDoc} errMsg] $xmldoc delete $xsltdoc delete lappend result $errMsg } {1 {Recursive import/include: stylesheet tries to access itself.}} set xslt { } test xslt-6.1 {xsl:output} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc indent] lappend result [$resultDoc omit-xml-declaration] lappend result [$resultDoc encoding] lappend result [$resultDoc mediaType] lappend result [$resultDoc standalone] lappend result [$resultDoc getDefaultOutputMethod] $resultDoc delete $xsltdoc delete $xmldoc delete set result } {1 0 ISO-8859-1 text/foo 1 text} set xslt { } test xslt-7.1 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set nodes [$resultDoc getElementsByTagNameNS "http://my.uri" element] set result "" foreach node $nodes { lappend result [$node nodeName] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } {my:element} test xslt-7.2 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $resultDoc delete $xmldoc delete $xsltdoc delete set result } {} test xslt-7.3 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc $resultDoc documentElement root set my:element [$root firstChild] set result [${my:element} namespaceURI] $resultDoc delete $xmldoc delete $xsltdoc delete set result } {http://my.uri} set xslt { } test xslt-7.4 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set nodes [$resultDoc getElementsByTagNameNS "" element] set result "" foreach node $nodes { lappend result [$node nodeName] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } {element} test xslt-7.5 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set nodes [$resultDoc getElementsByTagName element] set result "" foreach node $nodes { lappend result [$node nodeName] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } {element} set xslt { } test xslt-7.6 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set nodes [$resultDoc getElementsByTagNameNS "element.uri" *] set result "" foreach node $nodes { lappend result [$node nodeName] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } {element} test xslt-7.7 {parent of the result doc documentElement} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set resultRoot [$resultDoc documentElement] set result [$resultRoot parentNode] $resultDoc delete $xmldoc delete $xsltdoc delete set result } {} set xslt { } test xslt-7.8 {namespaces in the result doc} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set nodes [$resultDoc getElementsByTagNameNS "http://my.uri" *] set result "" foreach node $nodes { lappend result [$node nodeName] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } {my:element my:foo} set xslt { } test xslt-7.9 {parent of the result doc documentElement} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set resultRoot [$resultDoc documentElement] set result [list [$resultDoc asXML -indent none] [$resultRoot parentNode]] $resultDoc delete $xmldoc delete $xsltdoc delete set result } { {}} set xslt { } test xslt-7.10 {parent of the result doc documentElement} { dom parse xmldoc dom parse $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [list [$resultDoc asXML -indent none]] foreach toplevelNode [$resultDoc childNodes] { lappend result [$toplevelNode parentNode] } $resultDoc delete $xmldoc delete $xsltdoc delete set result } { {} {}} set xslt { } set xml {} test xslt-8.1 {current() not allowed in pattern} { dom parse $xml xmldoc dom parse $xslt xsltdoc catch {$xmldoc xslt $xsltdoc resultDoc} errMsg $xmldoc delete $xsltdoc delete set errMsg } {The 'current' function is not allowed in Pattern. for '*[current() != 'notthis']' Parsed symbols: 0 WCARDNAME 0 00000.000 0 * 1 LBRACKET 0 00000.000 1 2 FUNCTION 0 00000.000 8 current 3 LPAR 0 00000.000 9 4 RPAR 0 00000.000 10 5 NOTEQ 0 00000.000 13 6 LITERAL 0 00000.000 23 notthis 7 RBRACKET 0 00000.000 24 } set xslt-8.2.xml {
    } set xslt-8.2.xsl { } set xslt-8.2.output {
    } test xslt-8.2 {namespace handling of copy-of} { dom parse -keepEmpties ${xslt-8.2.xml} xmldoc dom parse -keepEmpties ${xslt-8.2.xsl} xsltdoc $xmldoc xslt $xsltdoc resultDoc $xmldoc delete $xsltdoc delete set result [$resultDoc asXML -indent none] $resultDoc delete set result } ${xslt-8.2.output} test xslt-8.3 {format-number() runding} { set xml { 1.999 1.998 1.997 1.996 1.995 1.994 1.99 1.9 1. } set xslt { } dom parse -keepEmpties $xml xmldoc dom parse -keepEmpties $xslt xsltdoc $xmldoc xslt $xsltdoc resultDoc $xmldoc delete $xsltdoc delete set result [$resultDoc asXML -indent none] $resultDoc delete set result } {2.00 2.00 2.00 2.00 2.00 1.99 1.99 1.90 1.00 } test xslt-8.4 {Erroneous XPath expr as match attribute of a template} { set xmlDoc [dom parse {}] set xslt { } set xsltDoc [dom parse $xslt] set result [catch {$xmlDoc xslt $xsltDoc} errMsg] $xmlDoc delete $xsltDoc delete set result } {1} test xslt-8.5 {Minimal xslt 1.0 stylesheet} { set xmlDoc {} set xsltDoc {} dom parse -keepEmpties $xmlDoc xmldoc dom parse -keepEmpties $xsltDoc xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $xmldoc delete $xsltdoc delete $resultDoc delete set result } {} test xslt-8.6 {Almost minimal xslt 1.0 stylesheet} { set xmlDoc {} set xsltDoc { } dom parse -keepEmpties $xmlDoc xmldoc dom parse -keepEmpties $xsltDoc xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $xmldoc delete $xsltdoc delete $resultDoc delete set result } {} test xslt-8.7 {Minimal xslt 1.0 stylesheet returns text content of doc by default} { set xmlDoc {text} set xsltDoc {} dom parse -keepEmpties $xmlDoc xmldoc dom parse -keepEmpties $xsltDoc xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $xmldoc delete $xsltdoc delete $resultDoc delete set result } {text} test xslt-8.8 {Almost minimal xslt 1.0 stylesheet} { set xmlDoc {text} set xsltDoc { } dom parse -keepEmpties $xmlDoc xmldoc dom parse -keepEmpties $xsltDoc xsltdoc $xmldoc xslt $xsltdoc resultDoc set result [$resultDoc asXML -indent none] $xmldoc delete $xsltdoc delete $resultDoc delete set result } {} test xslt-8.9 {format-number} {knownBug} { set xmlDoc [dom parse ] set xsltDoc [dom parse { }] $xmlDoc xslt $xsltDoc resultDoc set result [$resultDoc asXML -indent none] $xmlDoc delete $xsltDoc delete $resultDoc delete set result 001 } {001} proc ::dom::xpathFunc::xslt-9.1 {ctxNode pos nodeListType nodeList args} { if {[llength $ctxNode] != 2} { error "::dom::xpathFunc::xslt-9.1: expected parent node / attribute \ name list as first argument." } return {string "bar"} } test xslt-9.1 {xslt using scripted xpath function} -setup { set xml {} set xsl { } set xsltDoc [dom parse -keepEmpties $xsl] set xmlDoc [dom parse $xml] } -body { $xmlDoc xslt $xsltDoc resultDoc $resultDoc asXML -indent none } -cleanup { $xsltDoc delete $xmlDoc delete $resultDoc delete } -result {} # Below is code, which replaces the dom cmd with a version, which parses # the xml into a dom tree, then transformations this dom tree with the # xslt identity transformation and returns the result tree of that # transformation. This is used to test, that the result tree of an xslt # transformation could be used as any 'ordinary' tree created with # [dom parse]. It is here, because I didn't want to hold it separated. # It is commented out, because some of the tests in the sourced test files # need line/column or baseURI information, to work correctly, and this # information is not preserved by an xslt identity transformation and # I was up to now too lazy, to trick around this few tests with some # test constraints. # # set identityTransformation [dom parse { # # # # # # }] # rename dom _dom # proc dom {args} { # global identityTransformation # switch [lindex $args 0] { # "parse" { # set resultdoc [uplevel 1 [linsert $args 0 _dom]] # return [$resultdoc xslt $identityTransformation] # } # default { # return [uplevel 1 [linsert $args 0 _dom]] # } # } # } # source [file join [file dir [info script]] i18n.test] # source [file join [file dir [info script]] dom.test] # rename dom {} # rename _dom dom # cleanup ::tcltest::cleanupTests return tdom-0.9.1/tests/PaxHeaders.9215/htmlreader.test0000644000175000001440000000013213325450307017623 xustar000000000000000030 mtime=1532383431.446385782 30 atime=1532383431.501385618 30 ctime=1532383431.446385782 tdom-0.9.1/tests/htmlreader.test0000644000175000001440000001543113325450307017045 0ustar00rolfusers00000000000000# Features covered: HTML parser # # This file contains a collection of tests for the HTML parser. # Tested functionalities: # html-1.*: Character encoding # html-2.*: Parsing tests # html-3.*: Bad data # html-4.*: DOM building # # Copyright (c) 2002-2007 Rolf Ade. # # RCS: @(#) $Id$ source [file join [file dir [info script]] loadtdom.tcl] test html-1.1 {HTML character entities} {need_i18n} { set doc [dom parse -html { ¡Äü}] set root [$doc documentElement] set body [$root firstChild] set result [$body text] $doc delete set result } "\u00A0\u00A1\u00c4\u00fc" test html-1.2 {character entities} {need_i18n} { set doc [dom parse -html {ÖÄÄ}] set root [$doc documentElement] set body [$root firstChild] set result [$body text] $doc delete set result } "\u00d6\u00c4\u00c4" test html-1.3 {character entities} {need_i18n} { set doc [dom parse -html {€∋}] set root [$doc documentElement] set result [$root text] $doc delete set result } "\u20ac\u220b" test html-1.4 {Invalid numeric character entity} { set doc [dom parse -html {'xyz}] set root [$doc documentElement] set result [$root text] $doc delete set result } "'xyz" test html-1.5 {Numeric character entity} { set doc [dom parse -html {�}] set root [$doc documentElement] set result [$root text] $doc delete set result } "�" test html-1.6 {Numeric character entity} { set doc [dom parse -html {�}] set root [$doc documentElement] set result [$root text] $doc delete set result } "�" test html-2.1 {not closed p tags} { set doc [dom parse -html {

    Para 1

    Para 2

    Para 3 }] set result [$doc asXML -indent none] $doc delete set result } {

    Para 1

    Para 2

    Para 3

    } test html-2.2 {HTML parsing} { set doc [dom parse -html {

    HTML

    }] set result [$doc asXML -indent none] $doc delete set result } {

    HTML

    } test html-2.3 {HTML parsing} { set doc [dom parse -html {

    HTML

    }] set result [$doc asXML -indent none] $doc delete set result } {

    HTML

    } test html-2.4 {HTML parsing} { set doc [dom parse -html {

    HTML

    }] $doc documentElement root set result [$root nodeName] $doc delete set result } {html} test html-2.5 {HTML parsing} { set doc [dom parse -html {
    }] $doc asHTML } {
    } test html-2.6 {HTML parsing} { set doc [dom parse -html {
    }] $doc asHTML } {
    } test html-2.7 {HTML parsing} { set doc [dom parse -html {
    }] $doc asHTML } {
    } test html-2.8 {HTML parsing} { set doc [dom parse -html {
    }] $doc asHTML } {
    } test html-3.1 {Bad data} { set data {line 6 column 17 - Warning: