Changeset 527 for trunk


Ignore:
Timestamp:
Sep 21, 2006, 8:27:40 AM (18 years ago)
Author:
nkissebe
Message:

TEA configuration support added (Windows support)

Location:
trunk/src/tcl
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/tcl/Makefile.in

    r399 r527  
    11# Makefile.in --
    22#
    3 #       This file is a Makefile for the Rappture GUI library.  If it has
    4 #       the name "Makefile.in" then it is a template for a Makefile.
    5 #       To generate the actual Makefile, run "./configure", which is a
    6 #       configuration script generated by the "autoconf" program
    7 #       (constructs like "@foo@" will get replaced in the actual Makefile.
    8 #
    9 #========================================================================
    10 # This is the parameterized name of the library that we are building.
    11 #========================================================================
    12 
    13 lib_BINARIES=$(Rappture_LIB_FILE)
    14 BINARIES=$(lib_BINARIES)
    15 
    16 #========================================================================
    17 # Enumerate the names of the source files included in this package.
     3#       This file is a Makefile for Sample TEA Extension.  If it has the name
     4#       "Makefile.in" then it is a template for a Makefile;  to generate the
     5#       actual Makefile, run "./configure", which is a configuration script
     6#       generated by the "autoconf" program (constructs like "@foo@" will get
     7#       replaced in the actual Makefile.
     8#
     9# Copyright (c) 1999 Scriptics Corporation.
     10# Copyright (c) 2002-2005 ActiveState Corporation.
     11#
     12# See the file "license.terms" for information on usage and redistribution
     13# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
     14#
     15# RCS: @(#) $Id: Makefile.in,v 1.60 2005/09/13 22:06:37 hobbs Exp $
     16
     17#========================================================================
     18# Add additional lines to handle any additional AC_SUBST cases that
     19# have been added in a customized configure script.
     20#========================================================================
     21
     22#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@
     23BLT_SRC_DIR = @BLT_SRC_DIR@
     24ALT_DIR = @ALT_DIR@
     25RAPPTURE_DIR = @RAPPTURE_DIR@
     26
     27
     28#========================================================================
     29# Nothing of the variables below this line should need to be changed.
     30# Please check the TARGETS section below to make sure the make targets
     31# are correct.
     32#========================================================================
     33
     34#========================================================================
     35# The names of the source files is defined in the configure script.
     36# The object files are used for linking into the final library.
    1837# This will be used when a dist target is added to the Makefile.
    19 #========================================================================
    20 
    21 Rappture_SOURCES = \
    22   src/Rappture_Init.cc \
    23   src/RpLibraryTclInterface.cc \
    24   src/RpUnitsTclInterface.cc
    25 SOURCES = $(Rappture_SOURCES)
    26 
    27 #========================================================================
    28 # Enumerate the names of the object files included in this package.
    29 # These objects are created and linked into the final library.  In
    30 # most cases these object files will correspond to the source files
    31 # above.
    32 #========================================================================
    33 
    34 Rappture_OBJECTS = \
    35   Rappture_Init.$(OBJEXT) \
    36   RpLibraryTclInterface.$(OBJEXT) \
    37   RpUnitsTclInterface.$(OBJEXT)
    38 OBJECTS = $(Rappture_OBJECTS)
    39 
    40 #========================================================================
    41 # The substitution of "Rappture_LIB_FILE" into the variable name below
    42 # let's us refer to the objects for the library without knowing the name
    43 # of the library in advance.  It also lets us use the "$@" variable in
    44 # the rule for building the library, so we can refer to both the list of
    45 # objects and the library itself in a platform-independent manner.
    46 #========================================================================
    47 
    48 Rappture_LIB_FILE = @Rappture_LIB_FILE@
    49 $(Rappture_LIB_FILE)_OBJECTS = $(Rappture_OBJECTS)
    50 
    51 #========================================================================
    52 # This is a list of header files to be installed
    53 #========================================================================
    54 
    55 GENERIC_HDRS=
    56 
    57 #========================================================================
    58 # Nothing of the variables below this line need to be changed.  Please
    59 # check the TARGETS section below to make sure the make targets are
    60 # correct.
    61 #========================================================================
    62 
    63 SHELL = @SHELL@
    64 
    65 srcdir = @srcdir@
    66 top_srcdir = @top_srcdir@
    67 prefix = @prefix@
    68 exec_prefix = @exec_prefix@
    69 
    70 bindir = @bindir@
    71 sbindir = @sbindir@
    72 libexecdir = @libexecdir@
    73 datadir = @datadir@
    74 sysconfdir = @sysconfdir@
    75 sharedstatedir = @sharedstatedir@
    76 localstatedir = @localstatedir@
    77 libdir = @libdir@
    78 infodir = @infodir@
    79 mandir = @mandir@
    80 includedir = @includedir@
    81 oldincludedir = /usr/include
    82 
    83 DESTDIR =
    84 
    85 pkgdatadir = $(datadir)/@PACKAGE@@VERSION@
    86 pkglibdir = $(libdir)/@PACKAGE@@VERSION@
    87 pkgincludedir = $(includedir)/@PACKAGE@@VERSION@
    88 
    89 top_builddir = .
    90 
    91 INSTALL = @INSTALL@
    92 INSTALL_PROGRAM = @INSTALL_PROGRAM@
    93 INSTALL_DATA = @INSTALL_DATA@
    94 INSTALL_SCRIPT = @INSTALL_SCRIPT@
    95 INSTALL_STRIP_FLAG =
    96 transform = @program_transform_name@
    97 
    98 NORMAL_INSTALL = :
    99 PRE_INSTALL = :
    100 POST_INSTALL = :
    101 NORMAL_UNINSTALL = :
    102 PRE_UNINSTALL = :
    103 POST_UNINSTALL = :
    104 
    105 PACKAGE = @PACKAGE@
    106 VERSION = @VERSION@
    107 CC = @CC@
    108 CXX = @CXX@
    109 CFLAGS_DEBUG = @CFLAGS_DEBUG@ -Wall
    110 CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -Wall
    111 CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ -Wall
    112 CLEANFILES = @CLEANFILES@
    113 EXEEXT = @EXEEXT@
    114 LDFLAGS_DEBUG = @LDFLAGS_DEBUG@
    115 LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
    116 LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
    117 MAKE_LIB = @MAKE_LIB@
    118 MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
    119 MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
    120 OBJEXT = @OBJEXT@
    121 RANLIB = @RANLIB@
    122 SHLIB_CFLAGS = @SHLIB_CFLAGS@
    123 SHLIB_LD = @SHLIB_LD@
    124 SHLIB_LDFLAGS = @SHLIB_LDFLAGS@
    125 SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
    126 STLIB_LD = @STLIB_LD@
    127 TCL_BIN_DIR = @TCL_BIN_DIR@
    128 TCL_DEFS = @TCL_DEFS@
    129 TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@
    130 TCL_LD_FLAGS = @TCL_LD_FLAGS@
    131 TCL_LIBS = @TCL_LIBS@
    132 TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@
    133 TCL_SRC_DIR = @TCL_SRC_DIR@
    134 TCL_DBGX = @TCL_DBGX@
    135 TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
    136 TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
    137 TCLSH_PROG = @TCLSH_PROG@
    138 
    139 BLT_SRC_DIR = @BLT_SRC_DIR@
    140 
    141 AUTOCONF = autoconf
    142 
    143 LDFLAGS = $(LDFLAGS_DEFAULT)
    144 
    145 INCLUDES = @TCL_INCLUDES@ -I$(BLT_SRC_DIR)
    146 
    147 EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS)
    148 
    149 DEFS = @DEFS@ $(EXTRA_CFLAGS)
    150 
    151 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    152 mkinstalldirs = $(SHELL) $(top_srcdir)/cf/mkinstalldirs
    153 CONFIG_CLEAN_FILES = pkgIndex.tcl init.tcl
    154 
    155 CPPFLAGS = @CPPFLAGS@
    156 LIBS = @LIBS@
    157 AR = ar
    158 CFLAGS = @CFLAGS@
    159 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    160 COMPILEXX = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    161 CCLD = $(CC)
    162 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
     38# It is not important to specify the directory, as long as it is the
     39# $(srcdir) or in the generic, win or unix subdirectory.
     40#========================================================================
     41
     42PKG_SOURCES     = @PKG_SOURCES@
     43PKG_OBJECTS     = @PKG_OBJECTS@
     44
     45PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
     46PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
     47
     48#========================================================================
     49# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
     50# this package that need to be installed, if any.
     51#========================================================================
     52
     53PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
     54
     55#========================================================================
     56# This is a list of public header files to be installed, if any.
     57#========================================================================
     58
     59PKG_HEADERS     = @PKG_HEADERS@
     60
     61#========================================================================
     62# "PKG_LIB_FILE" refers to the library (dynamic or static as per
     63# configuration options) composed of the named objects.
     64#========================================================================
     65
     66PKG_LIB_FILE    = @PKG_LIB_FILE@
     67PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
     68
     69lib_BINARIES    = $(PKG_LIB_FILE)
     70BINARIES        = $(lib_BINARIES)
     71
     72SHELL           = @SHELL@
     73
     74srcdir          = @srcdir@
     75prefix          = @prefix@
     76exec_prefix     = @exec_prefix@
     77
     78bindir          = @bindir@
     79libdir          = @libdir@
     80datadir         = @datadir@
     81mandir          = @mandir@
     82includedir      = @includedir@
     83
     84DESTDIR         =
     85
     86PKG_DIR         = $(PACKAGE_NAME)$(PACKAGE_VERSION)
     87pkgdatadir      = $(datadir)/$(PKG_DIR)
     88pkglibdir       = $(libdir)/$(PKG_DIR)
     89pkgincludedir   = $(includedir)/$(PKG_DIR)
     90
     91top_builddir    = .
     92
     93INSTALL         = @INSTALL@
     94INSTALL_PROGRAM = @INSTALL_PROGRAM@
     95INSTALL_DATA    = @INSTALL_DATA@
     96INSTALL_SCRIPT  = @INSTALL_SCRIPT@
     97
     98PACKAGE_NAME    = @PACKAGE_NAME@
     99PACKAGE_VERSION = @PACKAGE_VERSION@
     100CC              = @CC@
     101CXX             = @CXX@
     102CFLAGS_DEFAULT  = @CFLAGS_DEFAULT@
     103CFLAGS_WARNING  = @CFLAGS_WARNING@
     104CLEANFILES      = @CLEANFILES@
     105EXEEXT          = @EXEEXT@
     106LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
     107MAKE_LIB        = @MAKE_LIB@
     108MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
     109MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
     110MAKE_STUB_LIB   = @MAKE_STUB_LIB@
     111OBJEXT          = @OBJEXT@
     112RANLIB          = @RANLIB@
     113RANLIB_STUB     = @RANLIB_STUB@
     114SHLIB_CFLAGS    = @SHLIB_CFLAGS@
     115SHLIB_LD        = @SHLIB_LD@
     116SHLIB_LD_LIBS   = @SHLIB_LD_LIBS@
     117STLIB_LD        = @STLIB_LD@
     118#TCL_DEFS       = @TCL_DEFS@
     119TCL_BIN_DIR     = @TCL_BIN_DIR@
     120TCL_SRC_DIR     = @TCL_SRC_DIR@
     121#TK_BIN_DIR     = @TK_BIN_DIR@
     122#TK_SRC_DIR     = @TK_SRC_DIR@
     123
     124# Not used, but retained for reference of what libs Tcl required
     125#TCL_LIBS       = @TCL_LIBS@
     126
     127#========================================================================
     128# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
     129# package without installing.  The other environment variables allow us
     130# to test against an uninstalled Tcl.  Add special env vars that you
     131# require for testing here (like TCLX_LIBRARY).
     132#========================================================================
     133
     134EXTRA_PATH      = $(top_builddir):$(TCL_BIN_DIR)
     135#EXTRA_PATH     = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
     136TCLLIBPATH      = $(top_builddir)
     137TCLSH_ENV       = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
     138                  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
     139                  PATH="$(EXTRA_PATH):$(PATH)" \
     140                  TCLLIBPATH="$(TCLLIBPATH)"
     141#                 TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library`
     142
     143TCLSH_PROG      = @TCLSH_PROG@
     144TCLSH   = $(TCLSH_ENV) $(TCLSH_PROG)
     145
     146#WISH_PROG      = @WISH_PROG@
     147#WISH   = $(TCLSH_ENV) $(WISH_PROG)
     148
     149
     150SHARED_BUILD    = @SHARED_BUILD@
     151
     152INCLUDES        = @PKG_INCLUDES@ @TCL_INCLUDES@ -I$(BLT_SRC_DIR) -I$(ALT_DIR)/include -I$(RAPPTURE_DIR)/include  -EHsc
     153#INCLUDES       = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
     154
     155PKG_CFLAGS      = @PKG_CFLAGS@
     156
     157# TCL_DEFS is not strictly need here, but if you remove it, then you
     158# must make sure that configure.in checks for the necessary components
     159# that your library may use.  TCL_DEFS can actually be a problem if
     160# you do not compile with a similar machine setup as the Tcl core was
     161# compiled with.
     162#DEFS           = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
     163DEFS            = @DEFS@ $(PKG_CFLAGS)
     164
     165CONFIG_CLEAN_FILES = Makefile
     166
     167CPPFLAGS        = @CPPFLAGS@
     168LIBS            = @PKG_LIBS@ @LIBS@
     169AR              = @AR@
     170CFLAGS          = @CFLAGS@
     171COMPILE         = $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    163172
    164173#========================================================================
     
    187196libraries:
    188197
     198
     199#========================================================================
     200# Your doc target should differentiate from doc builds (by the developer)
     201# and doc installs (see install-doc), which just install the docs on the
     202# end user machine when building from source.
     203#========================================================================
     204
    189205doc:
    190 
    191 install: all install-binaries install-libraries
     206#       @echo "If you have documentation to create, place the commands to"
     207#       @echo "build the docs in the 'doc:' target.  For example:"
     208#       @echo "        xml2nroff sample.xml > sample.n"
     209#       @echo "        xml2html sample.xml > sample.html"
     210
     211install: all install-binaries install-libraries install-doc
    192212
    193213install-binaries: binaries install-lib-binaries install-bin-binaries
     
    195215#========================================================================
    196216# This rule installs platform-independent files, such as header files.
     217# The list=...; for p in $$list handles the empty list case x-platform.
    197218#========================================================================
    198219
    199220install-libraries: libraries
    200         $(mkinstalldirs) $(includedir)
    201         echo "Installing header files in $(includedir)"
    202         @for i in $(GENERIC_HDRS) ; do \
    203             echo "Installing $$i" ; \
    204             $(INSTALL_DATA) $$i $(includedir) ; \
     221        @mkdir -p $(DESTDIR)$(includedir)
     222        @echo "Installing header files in $(DESTDIR)$(includedir)"
     223        @list='$(PKG_HEADERS)'; for i in $$list; do \
     224            echo "Installing $(srcdir)/$$i" ; \
     225            $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
    205226        done;
    206227
     
    211232
    212233install-doc: doc
    213         $(mkinstalldirs) $(mandir)/man1
    214         $(mkinstalldirs) $(mandir)/man3
    215         $(mkinstalldirs) $(mandir)/mann
    216         @for i in $(srcdir)/*.n; \
    217             do \
    218             echo "Installing $$i"; \
    219             rm -f $(mandir)/mann/$$i; \
    220             $(INSTALL_DATA) $$i $(mandir)/mann/$$i ; \
    221             chmod 444 $(mandir)/mann/$$i; \
    222             done
    223 
    224 test:
     234#       @mkdir -p $(DESTDIR)$(mandir)/mann
     235#       @echo "Installing documentation in $(DESTDIR)$(mandir)"
     236#       @list='$(srcdir)/doc/*.n'; for i in $$list; do \
     237#           echo "Installing $$i"; \
     238#           rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
     239#           $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
     240#       done
     241
     242test: binaries libraries
     243        $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
     244
     245shell: binaries libraries
     246        @$(TCLSH) $(SCRIPT)
     247
     248gdb:
     249        $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
    225250
    226251depend:
    227252
    228253#========================================================================
    229 # Enumerate the names of the object files included in this package.
    230 # These objects are created and linked into the final library.  In
    231 # most cases these object files will correspond to the source files
    232 # above.
    233 #
    234 # $(Rappture_LIB_FILE) should be listed as part of the BINARIES variable
    235 # at the top of the Makefile.  That will ensure that this target is built
    236 # when you run "make binaries".
    237 #
    238 # You shouldn't need to modify this target, except to change the package
    239 # name from "Rappture" to your package's name.
    240 #========================================================================
    241 
    242 $(Rappture_LIB_FILE): $(Rappture_OBJECTS)
    243         -rm -f $(Rappture_LIB_FILE)
    244         @MAKE_LIB@  -lrappture
    245         $(RANLIB) $(Rappture_LIB_FILE) -lrappture
     254# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
     255# mentioned above.  That will ensure that this target is built when you
     256# run "make binaries".
     257#
     258# The $(PKG_OBJECTS) objects are created and linked into the final
     259# library.  In most cases these object files will correspond to the
     260# source files above.
     261#========================================================================
     262
     263$(PKG_LIB_FILE): $(PKG_OBJECTS)
     264        -rm -f $(PKG_LIB_FILE)
     265        ${MAKE_LIB}
     266        $(RANLIB) $(PKG_LIB_FILE)
     267
     268$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
     269        -rm -f $(PKG_STUB_LIB_FILE)
     270        ${MAKE_STUB_LIB}
     271        $(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
    246272
    247273#========================================================================
    248274# We need to enumerate the list of .c to .o lines here.
    249 # Unfortunately, there does not seem to be any other way to do this
    250 # in a Makefile-independent way.  We can't use VPATH because it picks up
    251 # object files that may be located in the source directory.
    252275#
    253276# In the following lines, $(srcdir) refers to the toplevel directory
     
    255278# you will have to modify the paths to reflect this:
    256279#
    257 # exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c
    258 #       $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@
    259 #========================================================================
    260 
    261 #RpRusage.$(OBJEXT): $(srcdir)/src/RpRusage.c
    262 #       $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/RpRusage.c` -o $@
    263 
    264 Rappture_Init.$(OBJEXT): $(srcdir)/src/Rappture_Init.cc
    265         $(COMPILEXX) -c `@CYGPATH@ $(srcdir)/src/Rappture_Init.cc` -o $@
    266 
    267 RpLibraryTclInterface.$(OBJEXT): $(srcdir)/src/RpLibraryTclInterface.cc
    268         $(COMPILEXX) -c `@CYGPATH@ $(srcdir)/src/RpLibraryTclInterface.cc` -o $@
    269 
    270 RpUnitsTclInterface.$(OBJEXT): $(srcdir)/src/RpUnitsTclInterface.cc
    271         $(COMPILEXX) -c `@CYGPATH@ $(srcdir)/src/RpUnitsTclInterface.cc` -o $@
    272 
     280# sample.$(OBJEXT): $(srcdir)/generic/sample.c
     281#       $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
     282#
     283# Setting the VPATH variable to a list of paths will cause the makefile
     284# to look into these paths when resolving .c to .obj dependencies.
     285# As necessary, add $(srcdir):$(srcdir)/compat:....
     286#========================================================================
     287
     288VPATH = $(srcdir):$(srcdir)/src:$(srcdir)/unix:$(srcdir)/win
     289
     290.c.@OBJEXT@:
     291        $(CC) $(COMPILE) -c `@CYGPATH@ $<` -o $@
     292.cc.@OBJEXT@:
     293        $(CXX) $(COMPILE) -c `@CYGPATH@ $<` -o $@
     294.cpp.@OBJEXT@:
     295        $(CXX) $(COMPILE) -c `@CYGPATH@ $<` -o $@
     296
     297#========================================================================
     298# Distribution creation
     299# You may need to tweak this target to make it work correctly.
     300#========================================================================
     301
     302#COMPRESS       = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
     303COMPRESS        = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
     304DIST_ROOT       = /tmp/dist
     305DIST_DIR        = $(DIST_ROOT)/$(PKG_DIR)
     306
     307dist-clean:
     308        rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
     309
     310dist: dist-clean
     311        mkdir -p $(DIST_DIR)
     312        cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \
     313                $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
     314                $(DIST_DIR)/
     315        chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
     316        chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
     317
     318        for i in $(srcdir)/*.[ch]; do \
     319            if [ -f $$i ]; then \
     320                cp -p $$i $(DIST_DIR)/ ; \
     321            fi; \
     322        done;
     323
     324        mkdir $(DIST_DIR)/tclconfig
     325        cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
     326                $(DIST_DIR)/tclconfig/
     327        chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
     328        chmod +x $(DIST_DIR)/tclconfig/install-sh
     329
     330        list='demos doc generic library mac tests unix win'; \
     331        for p in $$list; do \
     332            if test -d $(srcdir)/$$p ; then \
     333                mkdir $(DIST_DIR)/$$p; \
     334                cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
     335            fi; \
     336        done
     337
     338        (cd $(DIST_ROOT); $(COMPRESS);)
    273339
    274340#========================================================================
     
    283349clean: 
    284350        -test -z "$(BINARIES)" || rm -f $(BINARIES)
    285         -rm -f *.o core *.core
    286         -rm -f *.$(OBJEXT)
     351        -rm -f *.$(OBJEXT) core *.core
    287352        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
    288 :
     353
    289354distclean: clean
    290355        -rm -f *.tab.c
    291         -rm -f Makefile $(CONFIG_CLEAN_FILES)
    292         -rm -f config.cache config.log stamp-h stamp-h[0-9]*
    293         -rm -f config.status
    294         -rm -rf autom4te.cache
     356        -rm -f $(CONFIG_CLEAN_FILES)
     357        -rm -f config.cache config.log config.status
    295358
    296359#========================================================================
     
    298361# .lib files.  Because the .lib files are not explicitly listed anywhere,
    299362# we need to deduce their existence from the .dll file of the same name.
    300 # Additionally, the .dll files go into the bin directory, but the .lib
    301 # files go into the lib directory.  On Unix platforms, all library files
    302 # go into the lib directory.  In addition, this will generate the pkgIndex.tcl
    303 # file in the install location (assuming it can find a usable tclsh8.2 shell)
     363# Library files go into the lib directory.
     364# In addition, this will generate the pkgIndex.tcl
     365# file in the install location (assuming it can find a usable tclsh shell)
    304366#
    305367# You should not have to modify this target.
    306368#========================================================================
    307369
    308 install-lib-binaries: installdirs
     370install-lib-binaries: binaries
     371        @mkdir -p $(DESTDIR)$(pkglibdir)
    309372        @list='$(lib_BINARIES)'; for p in $$list; do \
    310373          if test -f $$p; then \
     374            echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
     375            $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
     376            stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
     377            if test "x$$stub" = "xstub"; then \
     378                echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
     379                $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
     380            else \
     381                echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
     382                $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
     383            fi; \
    311384            ext=`echo $$p|sed -e "s/.*\.//"`; \
    312385            if test "x$$ext" = "xdll"; then \
    313                 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
    314                 $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
    315386                lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
    316387                if test -f $$lib; then \
    317                     echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \
    318                     $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \
     388                    echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
     389                    $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
    319390                fi; \
    320             else \
    321                 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
    322                 $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
    323391            fi; \
    324           else :; fi; \
    325         done
    326         @list='$(lib_BINARIES)'; for p in $$list; do \
    327           if test -f $$p; then \
    328             echo " $(RANLIB) $(DESTDIR)$(bindir)/$$p"; \
    329             $(RANLIB) $(DESTDIR)$(bindir)/$$p; \
    330           else :; fi; \
    331         done
    332         $(mkinstalldirs) $(pkglibdir)/scripts
    333         @for i in $(srcdir)/scripts/*.tcl; do \
    334             echo "Installing $$i" ; \
    335             $(INSTALL_DATA) $$i $(DESTDIR)$(pkglibdir)/scripts ; \
    336         done;
    337         $(TCLSH_PROG) $(srcdir)/cf/mkindex.tcl $(DESTDIR)$(pkglibdir)/scripts
    338         $(mkinstalldirs) $(pkglibdir)/lib
    339         @for i in $(srcdir)/../../lib/*; do \
    340             echo "Installing $$i" ; \
    341             $(INSTALL_DATA) $$i $(DESTDIR)$(pkglibdir)/lib ; \
    342         done;
    343         $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)/pkgIndex.tcl
    344         $(INSTALL_DATA) init.tcl $(DESTDIR)$(pkglibdir)/init.tcl
    345 
    346 #========================================================================
    347 # Install binary executables (e.g. .exe files)
    348 #
    349 # You should not have to modify this target.
    350 #========================================================================
    351 
    352 install-bin-binaries: installdirs
     392          fi; \
     393        done
     394        @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
     395          if test -f $(srcdir)/$$p; then \
     396            destp=`basename $$p`; \
     397            echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
     398            $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
     399          fi; \
     400        done
     401        @if test "x$(SHARED_BUILD)" = "x1"; then \
     402            echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
     403            $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \
     404        fi
     405
     406#========================================================================
     407# Install binary executables (e.g. .exe files and dependent .dll files)
     408# This is for files that must go in the bin directory (located next to
     409# wish and tclsh), like dependent .dll files on Windows.
     410#
     411# You should not have to modify this target, except to define bin_BINARIES
     412# above if necessary.
     413#========================================================================
     414
     415install-bin-binaries: binaries
     416        @mkdir -p $(DESTDIR)$(bindir)
    353417        @list='$(bin_BINARIES)'; for p in $$list; do \
    354418          if test -f $$p; then \
    355             echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
    356             $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
    357           else :; fi; \
    358         done
    359 
    360 .SUFFIXES: .c .o .obj
     419            echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
     420            $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
     421          fi; \
     422        done
     423
     424.SUFFIXES: .c .$(OBJEXT)
    361425
    362426Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
     
    364428          && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
    365429
    366 config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
    367         $(SHELL) ./config.status --recheck
    368 $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
    369         cd $(srcdir) && $(AUTOCONF)
    370 
    371 
    372430uninstall-binaries:
    373         @$(NORMAL_UNINSTALL)
    374         list='$(BINARIES)'; for p in $$list; do \
    375           rm -f $(DESTDIR)$(libdir)/$$p; \
    376         done
    377 
    378 installdirs:
    379         $(mkinstalldirs)  $(DESTDIR)$(libdir)
    380         $(mkinstalldirs)  $(DESTDIR)$(bindir)
    381         $(mkinstalldirs)  $(DESTDIR)$(pkglibdir)
    382 
    383 .PHONY: all binaries clean depend distclean doc install installdirs \
    384 libraries test
     431        list='$(lib_BINARIES)'; for p in $$list; do \
     432          rm -f $(DESTDIR)$(pkglibdir)/$$p; \
     433        done
     434        list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
     435          p=`basename $$p`; \
     436          rm -f $(DESTDIR)$(pkglibdir)/$$p; \
     437        done
     438        list='$(bin_BINARIES)'; for p in $$list; do \
     439          rm -f $(DESTDIR)$(bindir)/$$p; \
     440        done
     441
     442.PHONY: all binaries clean depend distclean doc install libraries test
    385443
    386444# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • trunk/src/tcl/aclocal.m4

    r207 r527  
    1 builtin(include,tcl.m4)
     1#
     2# Include the TEA standard macro set
     3#
     4
     5builtin(include,tclconfig/tcl.m4)
     6
     7#
     8# Add here whatever m4 macros you want to define for your package
     9#
  • trunk/src/tcl/configure

    r225 r527  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.59.
     3# Generated by GNU Autoconf 2.59 for Rappture 1.1.
    44#
    55# Copyright (C) 2003 Free Software Foundation, Inc.
     
    266266
    267267# Identity of this package.
    268 PACKAGE_NAME=
    269 PACKAGE_TARNAME=
    270 PACKAGE_VERSION=
    271 PACKAGE_STRING=
    272 PACKAGE_BUGREPORT=
    273 
    274 ac_unique_file="src/RpLibraryTclInterface.cc"
    275 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os CYGPATH TCL_INCLUDES TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIBS TCL_DEFS TCL_SHLIB_LD_LIBS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_BUILD_LIB_SPEC TCL_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_SPEC BLT_SRC_DIR CLEANFILES CC CFLAGS ac_ct_CC CFLAGS_DEBUG CFLAGS_OPTIMIZE STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LDFLAGS TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB Rappture_LIB_FILE SHLIB_LD_LIBS TCLSH_PROG PACKAGE VERSION PATCHLEVEL EXACT_VERSION NODOT_VERSION LIBOBJS LTLIBOBJS'
     268PACKAGE_NAME='Rappture'
     269PACKAGE_TARNAME='rappture'
     270PACKAGE_VERSION='1.1'
     271PACKAGE_STRING='Rappture 1.1'
     272PACKAGE_BUGREPORT=''
     273
     274# Factoring default headers for most tests.
     275ac_includes_default="\
     276#include <stdio.h>
     277#if HAVE_SYS_TYPES_H
     278# include <sys/types.h>
     279#endif
     280#if HAVE_SYS_STAT_H
     281# include <sys/stat.h>
     282#endif
     283#if STDC_HEADERS
     284# include <stdlib.h>
     285# include <stddef.h>
     286#else
     287# if HAVE_STDLIB_H
     288#  include <stdlib.h>
     289# endif
     290#endif
     291#if HAVE_STRING_H
     292# if !STDC_HEADERS && HAVE_MEMORY_H
     293#  include <memory.h>
     294# endif
     295# include <string.h>
     296#endif
     297#if HAVE_STRINGS_H
     298# include <strings.h>
     299#endif
     300#if HAVE_INTTYPES_H
     301# include <inttypes.h>
     302#else
     303# if HAVE_STDINT_H
     304#  include <stdint.h>
     305# endif
     306#endif
     307#if HAVE_UNISTD_H
     308# include <unistd.h>
     309#endif"
     310
     311ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG BLT_SRC_DIR RAPPTURE_DIR ALT_DIR PATCHLEVEL EXACT_VERSION NODOT_VERSION LTLIBOBJS'
    276312ac_subst_files=''
    277313
     
    714750ac_cv_env_target_alias_set=${target_alias+set}
    715751ac_cv_env_target_alias_value=$target_alias
     752ac_env_CC_set=${CC+set}
     753ac_env_CC_value=$CC
     754ac_cv_env_CC_set=${CC+set}
     755ac_cv_env_CC_value=$CC
     756ac_env_CFLAGS_set=${CFLAGS+set}
     757ac_env_CFLAGS_value=$CFLAGS
     758ac_cv_env_CFLAGS_set=${CFLAGS+set}
     759ac_cv_env_CFLAGS_value=$CFLAGS
     760ac_env_LDFLAGS_set=${LDFLAGS+set}
     761ac_env_LDFLAGS_value=$LDFLAGS
     762ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
     763ac_cv_env_LDFLAGS_value=$LDFLAGS
     764ac_env_CPPFLAGS_set=${CPPFLAGS+set}
     765ac_env_CPPFLAGS_value=$CPPFLAGS
     766ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
     767ac_cv_env_CPPFLAGS_value=$CPPFLAGS
    716768ac_env_CXX_set=${CXX+set}
    717769ac_env_CXX_value=$CXX
     
    722774ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
    723775ac_cv_env_CXXFLAGS_value=$CXXFLAGS
    724 ac_env_LDFLAGS_set=${LDFLAGS+set}
    725 ac_env_LDFLAGS_value=$LDFLAGS
    726 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
    727 ac_cv_env_LDFLAGS_value=$LDFLAGS
    728 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
    729 ac_env_CPPFLAGS_value=$CPPFLAGS
    730 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
    731 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
    732 ac_env_CC_set=${CC+set}
    733 ac_env_CC_value=$CC
    734 ac_cv_env_CC_set=${CC+set}
    735 ac_cv_env_CC_value=$CC
    736 ac_env_CFLAGS_set=${CFLAGS+set}
    737 ac_env_CFLAGS_value=$CFLAGS
    738 ac_cv_env_CFLAGS_set=${CFLAGS+set}
    739 ac_cv_env_CFLAGS_value=$CFLAGS
     776ac_env_CPP_set=${CPP+set}
     777ac_env_CPP_value=$CPP
     778ac_cv_env_CPP_set=${CPP+set}
     779ac_cv_env_CPP_value=$CPP
    740780
    741781#
     
    746786  # This message is too long to be a string in the A/UX 3.1 sh.
    747787  cat <<_ACEOF
    748 \`configure' configures this package to adapt to many kinds of systems.
     788\`configure' configures Rappture 1.1 to adapt to many kinds of systems.
    749789
    750790Usage: $0 [OPTION]... [VAR=VALUE]...
     
    798838
    799839  cat <<\_ACEOF
    800 
    801 System types:
    802   --build=BUILD     configure for building on BUILD [guessed]
    803   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
    804840_ACEOF
    805841fi
    806842
    807843if test -n "$ac_init_help"; then
    808 
     844  case $ac_init_help in
     845     short | recursive ) echo "Configuration of Rappture 1.1:";;
     846   esac
    809847  cat <<\_ACEOF
    810848
     
    813851  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    814852  --enable-threads        build with threads
    815   --enable-shared         build and link with shared libraries --enable-shared
    816   --enable-symbols        build with debugging symbols --disable-symbols
     853  --enable-shared         build and link with shared libraries (default: on)
     854  --enable-64bit          enable 64bit support (default: off)
     855  --enable-64bit-vis      enable 64bit Sparc VIS support (default: off)
     856  --enable-wince          enable Win/CE support (where applicable)
     857  --disable-load          disallow dynamic loading and "load" command
     858                          (default: enabled)
     859  --enable-symbols        build with debugging symbols (default: off)
    817860
    818861Optional Packages:
    819862  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    820863  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    821  --with-tclinclude      directory containing the public Tcl header files.
    822   --with-tcl              directory containing tcl configuration (tclConfig.sh)
     864  --with-blt=DIR          Find bltInt.h in DIR
     865  --with-rappture=DIR          Find include/core/rappture.h in DIR
     866  --with-altpath=DIR          Alternate path to search for required packages
     867  --with-tcl              directory containing tcl configuration
     868                          (tclConfig.sh)
     869  --with-tclinclude       directory containing the public Tcl header files
     870  --with-celib=DIR        use Windows/CE support library from DIR
    823871
    824872Some influential environment variables:
    825   CXX         C++ compiler command
    826   CXXFLAGS    C++ compiler flags
     873  CC          C compiler command
     874  CFLAGS      C compiler flags
    827875  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
    828876              nonstandard directory <lib dir>
    829877  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
    830878              headers in a nonstandard directory <include dir>
    831   CC          C compiler command
    832   CFLAGS      C compiler flags
     879  CXX         C++ compiler command
     880  CXXFLAGS    C++ compiler flags
     881  CPP         C preprocessor
    833882
    834883Use these variables to override the choices made by `configure' or to help
     
    923972      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    924973    fi
    925     cd "$ac_popdir"
     974    cd $ac_popdir
    926975  done
    927976fi
     
    930979if $ac_init_version; then
    931980  cat <<\_ACEOF
     981Rappture configure 1.1
     982generated by GNU Autoconf 2.59
    932983
    933984Copyright (C) 2003 Free Software Foundation, Inc.
     
    942993running configure, to aid debugging if configure makes a mistake.
    943994
    944 It was created by $as_me, which was
     995It was created by Rappture $as_me 1.1, which was
    945996generated by GNU Autoconf 2.59.  Invocation command line was
    946997
     
    12701321
    12711322
     1323
     1324
     1325
     1326
     1327
     1328
     1329
     1330
     1331
     1332#--------------------------------------------------------------------
     1333# Call TEA_INIT as the first TEA_ macro to set up initial vars.
     1334# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
     1335# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
     1336#--------------------------------------------------------------------
     1337
     1338
     1339    # TEA extensions pass this us the version of TEA they think they
     1340    # are compatible with.
     1341    TEA_VERSION="3.5"
     1342
     1343    echo "$as_me:$LINENO: checking for correct TEA configuration" >&5
     1344echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6
     1345    if test x"${PACKAGE_NAME}" = x ; then
     1346        { { echo "$as_me:$LINENO: error:
     1347The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5
     1348echo "$as_me: error:
     1349The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;}
     1350   { (exit 1); exit 1; }; }
     1351    fi
     1352    if test x"3.5" = x ; then
     1353        { { echo "$as_me:$LINENO: error:
     1354TEA version not specified." >&5
     1355echo "$as_me: error:
     1356TEA version not specified." >&2;}
     1357   { (exit 1); exit 1; }; }
     1358    elif test "3.5" != "${TEA_VERSION}" ; then
     1359        echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5
     1360echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6
     1361    else
     1362        echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5
     1363echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6
     1364    fi
     1365    case "`uname -s`" in
     1366        *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
     1367            # Extract the first word of "cygpath", so it can be a program name with args.
     1368set dummy cygpath; ac_word=$2
     1369echo "$as_me:$LINENO: checking for $ac_word" >&5
     1370echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     1371if test "${ac_cv_prog_CYGPATH+set}" = set; then
     1372  echo $ECHO_N "(cached) $ECHO_C" >&6
     1373else
     1374  if test -n "$CYGPATH"; then
     1375  ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
     1376else
     1377as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1378for as_dir in $PATH
     1379do
     1380  IFS=$as_save_IFS
     1381  test -z "$as_dir" && as_dir=.
     1382  for ac_exec_ext in '' $ac_executable_extensions; do
     1383  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     1384    ac_cv_prog_CYGPATH="cygpath -w"
     1385    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     1386    break 2
     1387  fi
     1388done
     1389done
     1390
     1391  test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
     1392fi
     1393fi
     1394CYGPATH=$ac_cv_prog_CYGPATH
     1395if test -n "$CYGPATH"; then
     1396  echo "$as_me:$LINENO: result: $CYGPATH" >&5
     1397echo "${ECHO_T}$CYGPATH" >&6
     1398else
     1399  echo "$as_me:$LINENO: result: no" >&5
     1400echo "${ECHO_T}no" >&6
     1401fi
     1402
     1403            EXEEXT=".exe"
     1404            TEA_PLATFORM="windows"
     1405            ;;
     1406        *)
     1407            CYGPATH=echo
     1408            EXEEXT=""
     1409            TEA_PLATFORM="unix"
     1410            ;;
     1411    esac
     1412
     1413    # Check if exec_prefix is set. If not use fall back to prefix.
     1414    # Note when adjusted, so that TEA_PREFIX can correct for this.
     1415    # This is needed for recursive configures, since autoconf propagates
     1416    # $prefix, but not $exec_prefix (doh!).
     1417    if test x$exec_prefix = xNONE ; then
     1418        exec_prefix_default=yes
     1419        exec_prefix=$prefix
     1420    fi
     1421
     1422
     1423
     1424
     1425    # This package name must be replaced statically for AC_SUBST to work
     1426
     1427    # Substitute STUB_LIB_FILE in case package creates a stub library too.
     1428
     1429
     1430    # We AC_SUBST these here to ensure they are subst'ed,
     1431    # in case the user doesn't call TEA_ADD_...
     1432
     1433
     1434
     1435
     1436
     1437
     1438
     1439
     1440
    12721441ac_aux_dir=
    1273 for ac_dir in cf $srcdir/cf; do
     1442for ac_dir in tclconfig $srcdir/tclconfig; do
    12741443  if test -f $ac_dir/install-sh; then
    12751444    ac_aux_dir=$ac_dir
     
    12871456done
    12881457if test -z "$ac_aux_dir"; then
    1289   { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in cf $srcdir/cf" >&5
    1290 echo "$as_me: error: cannot find install-sh or install.sh in cf $srcdir/cf" >&2;}
     1458  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&5
     1459echo "$as_me: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&2;}
    12911460   { (exit 1); exit 1; }; }
    12921461fi
     
    12971466
    12981467#--------------------------------------------------------------------
    1299 # __CHANGE__
    1300 # Set your package name and version numbers here.  The NODOT_VERSION is
    1301 # required for constructing the library name on systems that don't like
    1302 # dots in library names (Windows).  The VERSION variable is used on the
    1303 # other systems.
    1304 #--------------------------------------------------------------------
    1305 
    1306 PACKAGE=Rappture
    1307 
    1308 MAJOR_VERSION=1
    1309 MINOR_VERSION=1
    1310 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}
    1311 
    1312 #--------------------------------------------------------------------
    13131468# Extra build options
    13141469#--------------------------------------------------------------------
    1315 #AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
    1316 #  blt_source_dir=$withval)
     1470
     1471# Check whether --with-blt or --without-blt was given.
     1472if test "${with_blt+set}" = set; then
     1473  withval="$with_blt"
     1474  blt_source_dir=$withval
     1475fi;
     1476
     1477
     1478# Check whether --with-rappture or --without-rappture was given.
     1479if test "${with_rappture+set}" = set; then
     1480  withval="$with_rappture"
     1481  rappture_dir=$withval
     1482fi;
     1483
     1484
     1485# Check whether --with-altpath or --without-altpath was given.
     1486if test "${with_altpath+set}" = set; then
     1487  withval="$with_altpath"
     1488  alt_dir=$withval
     1489fi;
    13171490
    13181491#--------------------------------------------------------------------
    1319 # We put this here so that you can compile with -DVERSION="1.2" to
    1320 # encode the package version directly into the source files.
     1492# Load the tclConfig.sh file
    13211493#--------------------------------------------------------------------
    13221494
    1323 eval cat >>confdefs.h <<_ACEOF
    1324 #define VERSION "${VERSION}"
    1325 _ACEOF
     1495
     1496
     1497    #
     1498    # Ok, lets find the tcl configuration
     1499    # First, look for one uninstalled.
     1500    # the alternative search directory is invoked by --with-tcl
     1501    #
     1502
     1503    if test x"${no_tcl}" = x ; then
     1504        # we reset no_tcl in case something fails here
     1505        no_tcl=true
     1506
     1507# Check whether --with-tcl or --without-tcl was given.
     1508if test "${with_tcl+set}" = set; then
     1509  withval="$with_tcl"
     1510  with_tclconfig=${withval}
     1511fi;
     1512        echo "$as_me:$LINENO: checking for Tcl configuration" >&5
     1513echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
     1514        if test "${ac_cv_c_tclconfig+set}" = set; then
     1515  echo $ECHO_N "(cached) $ECHO_C" >&6
     1516else
     1517
     1518
     1519            # First check to see if --with-tcl was specified.
     1520            if test x"${with_tclconfig}" != x ; then
     1521                case ${with_tclconfig} in
     1522                    */tclConfig.sh )
     1523                        if test -f ${with_tclconfig}; then
     1524                            { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
     1525echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
     1526                            with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
     1527                        fi ;;
     1528                esac
     1529                if test -f "${with_tclconfig}/tclConfig.sh" ; then
     1530                    ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
     1531                else
     1532                    { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
     1533echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
     1534   { (exit 1); exit 1; }; }
     1535                fi
     1536            fi
     1537
     1538            # then check for a private Tcl installation
     1539            if test x"${ac_cv_c_tclconfig}" = x ; then
     1540                for i in \
     1541                        ../tcl \
     1542                        `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
     1543                        `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
     1544                        `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
     1545                        ../../tcl \
     1546                        `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
     1547                        `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
     1548                        `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
     1549                        ../../../tcl \
     1550                        `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
     1551                        `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
     1552                        `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
     1553                    if test -f "$i/unix/tclConfig.sh" ; then
     1554                        ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
     1555                        break
     1556                    fi
     1557                done
     1558            fi
     1559
     1560            # on Darwin, check in Framework installation locations
     1561            if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
     1562                for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
     1563                        `ls -d /Library/Frameworks 2>/dev/null` \
     1564                        `ls -d /Network/Library/Frameworks 2>/dev/null` \
     1565                        `ls -d /System/Library/Frameworks 2>/dev/null` \
     1566                        ; do
     1567                    if test -f "$i/Tcl.framework/tclConfig.sh" ; then
     1568                        ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
     1569                        break
     1570                    fi
     1571                done
     1572            fi
     1573
     1574            # on Windows, check in common installation locations
     1575            if test "${TEA_PLATFORM}" = "windows" \
     1576                -a x"${ac_cv_c_tclconfig}" = x ; then
     1577                for i in `ls -d C:/Tcl/lib 2>/dev/null` \
     1578                        `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
     1579                        ; do
     1580                    if test -f "$i/tclConfig.sh" ; then
     1581                        ac_cv_c_tclconfig=`(cd $i; pwd)`
     1582                        break
     1583                    fi
     1584                done
     1585            fi
     1586
     1587            # check in a few common install locations
     1588            if test x"${ac_cv_c_tclconfig}" = x ; then
     1589                for i in `ls -d ${libdir} 2>/dev/null` \
     1590                        `ls -d ${exec_prefix}/lib 2>/dev/null` \
     1591                        `ls -d ${prefix}/lib 2>/dev/null` \
     1592                        `ls -d /usr/local/lib 2>/dev/null` \
     1593                        `ls -d /usr/contrib/lib 2>/dev/null` \
     1594                        `ls -d /usr/lib 2>/dev/null` \
     1595                        ; do
     1596                    if test -f "$i/tclConfig.sh" ; then
     1597                        ac_cv_c_tclconfig=`(cd $i; pwd)`
     1598                        break
     1599                    fi
     1600                done
     1601            fi
     1602
     1603            # check in a few other private locations
     1604            if test x"${ac_cv_c_tclconfig}" = x ; then
     1605                for i in \
     1606                        ${srcdir}/../tcl \
     1607                        `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
     1608                        `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
     1609                        `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
     1610                    if test -f "$i/unix/tclConfig.sh" ; then
     1611                    ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
     1612                    break
     1613                fi
     1614                done
     1615            fi
     1616
     1617fi
     1618
     1619
     1620        if test x"${ac_cv_c_tclconfig}" = x ; then
     1621            TCL_BIN_DIR="# no Tcl configs found"
     1622            { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
     1623echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
     1624            exit 0
     1625        else
     1626            no_tcl=
     1627            TCL_BIN_DIR=${ac_cv_c_tclconfig}
     1628            echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
     1629echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6
     1630        fi
     1631    fi
     1632
     1633
     1634    echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
     1635echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6
     1636
     1637    if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
     1638        echo "$as_me:$LINENO: result: loading" >&5
     1639echo "${ECHO_T}loading" >&6
     1640        . ${TCL_BIN_DIR}/tclConfig.sh
     1641    else
     1642        echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
     1643echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
     1644    fi
     1645
     1646    # eval is required to do the TCL_DBGX substitution
     1647    eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
     1648    eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
     1649
     1650    # If the TCL_BIN_DIR is the build directory (not the install directory),
     1651    # then set the common variable name to the value of the build variables.
     1652    # For example, the variable TCL_LIB_SPEC will be set to the value
     1653    # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
     1654    # instead of TCL_BUILD_LIB_SPEC since it will work with both an
     1655    # installed and uninstalled version of Tcl.
     1656    if test -f ${TCL_BIN_DIR}/Makefile ; then
     1657        TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
     1658        TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
     1659        TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
     1660    elif test "`uname -s`" = "Darwin"; then
     1661        # If Tcl was built as a framework, attempt to use the libraries
     1662        # from the framework at the given location so that linking works
     1663        # against Tcl.framework installed in an arbitary location.
     1664        case ${TCL_DEFS} in
     1665            *TCL_FRAMEWORK*)
     1666                if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
     1667                    for i in "`cd ${TCL_BIN_DIR}; pwd`" \
     1668                             "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
     1669                        if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
     1670                            TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
     1671                            break
     1672                        fi
     1673                    done
     1674                fi
     1675                if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
     1676                    TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
     1677                    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
     1678                fi
     1679                ;;
     1680        esac
     1681    fi
     1682
     1683    # eval is required to do the TCL_DBGX substitution
     1684    eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
     1685    eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
     1686    eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
     1687    eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
     1688
     1689
     1690
     1691
     1692
     1693
     1694
     1695
     1696
     1697
     1698
     1699
     1700
     1701
     1702
     1703
     1704
     1705
    13261706
    13271707
    13281708#--------------------------------------------------------------------
    1329 # Check whether --enable-gcc or --disable-gcc was given.  Do this
    1330 # before AC_CYGWIN is called so the compiler can
    1331 # be fully tested by built-in autoconf tools.
    1332 # This macro also calls AC_PROG_CC to set the compiler if --enable-gcc
    1333 # was not used.
     1709# Load the tkConfig.sh file if necessary (Tk extension)
    13341710#--------------------------------------------------------------------
    13351711
    1336 #SC_ENABLE_GCC
    1337 ac_ext=cc
    1338 ac_cpp='$CXXCPP $CPPFLAGS'
    1339 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    1340 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    1341 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     1712#TEA_PATH_TKCONFIG
     1713#TEA_LOAD_TKCONFIG
     1714
     1715#-----------------------------------------------------------------------
     1716# Handle the --prefix=... option by defaulting to what Tcl gave.
     1717# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
     1718#-----------------------------------------------------------------------
     1719
     1720
     1721    if test "${prefix}" = "NONE"; then
     1722        prefix_default=yes
     1723        if test x"${TCL_PREFIX}" != x; then
     1724            { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
     1725echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
     1726            prefix=${TCL_PREFIX}
     1727        else
     1728            { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5
     1729echo "$as_me: --prefix defaulting to /usr/local" >&6;}
     1730            prefix=/usr/local
     1731        fi
     1732    fi
     1733    if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
     1734        -o x"${exec_prefix_default}" = x"yes" ; then
     1735        if test x"${TCL_EXEC_PREFIX}" != x; then
     1736            { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
     1737echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
     1738            exec_prefix=${TCL_EXEC_PREFIX}
     1739        else
     1740            { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5
     1741echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
     1742            exec_prefix=$prefix
     1743        fi
     1744    fi
     1745
     1746
     1747#-----------------------------------------------------------------------
     1748# Standard compiler checks.
     1749# This sets up CC by using the CC env var, or looks for gcc otherwise.
     1750# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
     1751# the basic setup necessary to compile executables.
     1752#-----------------------------------------------------------------------
     1753
     1754
     1755    # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
     1756    # in this macro, they need to go into TEA_SETUP_COMPILER instead.
     1757
     1758    # If the user did not set CFLAGS, set it now to keep
     1759    # the AC_PROG_CC macro from adding "-g -O2".
     1760    if test "${CFLAGS+set}" != "set" ; then
     1761        CFLAGS=""
     1762    fi
     1763
     1764    ac_ext=c
     1765ac_cpp='$CPP $CPPFLAGS'
     1766ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     1767ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     1768ac_compiler_gnu=$ac_cv_c_compiler_gnu
    13421769if test -n "$ac_tool_prefix"; then
    1343   for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
    1344   do
    1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
     1770  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
     1771set dummy ${ac_tool_prefix}gcc; ac_word=$2
    13471772echo "$as_me:$LINENO: checking for $ac_word" >&5
    13481773echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1349 if test "${ac_cv_prog_CXX+set}" = set; then
     1774if test "${ac_cv_prog_CC+set}" = set; then
    13501775  echo $ECHO_N "(cached) $ECHO_C" >&6
    13511776else
    1352   if test -n "$CXX"; then
    1353   ac_cv_prog_CXX="$CXX" # Let the user override the test.
     1777  if test -n "$CC"; then
     1778  ac_cv_prog_CC="$CC" # Let the user override the test.
    13541779else
    13551780as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    13601785  for ac_exec_ext in '' $ac_executable_extensions; do
    13611786  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1362     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     1787    ac_cv_prog_CC="${ac_tool_prefix}gcc"
    13631788    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    13641789    break 2
     
    13691794fi
    13701795fi
    1371 CXX=$ac_cv_prog_CXX
    1372 if test -n "$CXX"; then
    1373   echo "$as_me:$LINENO: result: $CXX" >&5
    1374 echo "${ECHO_T}$CXX" >&6
     1796CC=$ac_cv_prog_CC
     1797if test -n "$CC"; then
     1798  echo "$as_me:$LINENO: result: $CC" >&5
     1799echo "${ECHO_T}$CC" >&6
    13751800else
    13761801  echo "$as_me:$LINENO: result: no" >&5
     
    13781803fi
    13791804
    1380     test -n "$CXX" && break
    1381   done
    1382 fi
    1383 if test -z "$CXX"; then
    1384   ac_ct_CXX=$CXX
    1385   for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
    1386 do
    1387   # Extract the first word of "$ac_prog", so it can be a program name with args.
    1388 set dummy $ac_prog; ac_word=$2
     1805fi
     1806if test -z "$ac_cv_prog_CC"; then
     1807  ac_ct_CC=$CC
     1808  # Extract the first word of "gcc", so it can be a program name with args.
     1809set dummy gcc; ac_word=$2
    13891810echo "$as_me:$LINENO: checking for $ac_word" >&5
    13901811echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1391 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
     1812if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    13921813  echo $ECHO_N "(cached) $ECHO_C" >&6
    13931814else
    1394   if test -n "$ac_ct_CXX"; then
    1395   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
     1815  if test -n "$ac_ct_CC"; then
     1816  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    13961817else
    13971818as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    14021823  for ac_exec_ext in '' $ac_executable_extensions; do
    14031824  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1404     ac_cv_prog_ac_ct_CXX="$ac_prog"
     1825    ac_cv_prog_ac_ct_CC="gcc"
    14051826    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    14061827    break 2
     
    14111832fi
    14121833fi
    1413 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
    1414 if test -n "$ac_ct_CXX"; then
    1415   echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
    1416 echo "${ECHO_T}$ac_ct_CXX" >&6
     1834ac_ct_CC=$ac_cv_prog_ac_ct_CC
     1835if test -n "$ac_ct_CC"; then
     1836  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
     1837echo "${ECHO_T}$ac_ct_CC" >&6
    14171838else
    14181839  echo "$as_me:$LINENO: result: no" >&5
     
    14201841fi
    14211842
    1422   test -n "$ac_ct_CXX" && break
     1843  CC=$ac_ct_CC
     1844else
     1845  CC="$ac_cv_prog_CC"
     1846fi
     1847
     1848if test -z "$CC"; then
     1849  if test -n "$ac_tool_prefix"; then
     1850  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
     1851set dummy ${ac_tool_prefix}cc; ac_word=$2
     1852echo "$as_me:$LINENO: checking for $ac_word" >&5
     1853echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     1854if test "${ac_cv_prog_CC+set}" = set; then
     1855  echo $ECHO_N "(cached) $ECHO_C" >&6
     1856else
     1857  if test -n "$CC"; then
     1858  ac_cv_prog_CC="$CC" # Let the user override the test.
     1859else
     1860as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1861for as_dir in $PATH
     1862do
     1863  IFS=$as_save_IFS
     1864  test -z "$as_dir" && as_dir=.
     1865  for ac_exec_ext in '' $ac_executable_extensions; do
     1866  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     1867    ac_cv_prog_CC="${ac_tool_prefix}cc"
     1868    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     1869    break 2
     1870  fi
    14231871done
    1424 test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
    1425 
    1426   CXX=$ac_ct_CXX
    1427 fi
    1428 
     1872done
     1873
     1874fi
     1875fi
     1876CC=$ac_cv_prog_CC
     1877if test -n "$CC"; then
     1878  echo "$as_me:$LINENO: result: $CC" >&5
     1879echo "${ECHO_T}$CC" >&6
     1880else
     1881  echo "$as_me:$LINENO: result: no" >&5
     1882echo "${ECHO_T}no" >&6
     1883fi
     1884
     1885fi
     1886if test -z "$ac_cv_prog_CC"; then
     1887  ac_ct_CC=$CC
     1888  # Extract the first word of "cc", so it can be a program name with args.
     1889set dummy cc; ac_word=$2
     1890echo "$as_me:$LINENO: checking for $ac_word" >&5
     1891echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     1892if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
     1893  echo $ECHO_N "(cached) $ECHO_C" >&6
     1894else
     1895  if test -n "$ac_ct_CC"; then
     1896  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
     1897else
     1898as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1899for as_dir in $PATH
     1900do
     1901  IFS=$as_save_IFS
     1902  test -z "$as_dir" && as_dir=.
     1903  for ac_exec_ext in '' $ac_executable_extensions; do
     1904  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     1905    ac_cv_prog_ac_ct_CC="cc"
     1906    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     1907    break 2
     1908  fi
     1909done
     1910done
     1911
     1912fi
     1913fi
     1914ac_ct_CC=$ac_cv_prog_ac_ct_CC
     1915if test -n "$ac_ct_CC"; then
     1916  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
     1917echo "${ECHO_T}$ac_ct_CC" >&6
     1918else
     1919  echo "$as_me:$LINENO: result: no" >&5
     1920echo "${ECHO_T}no" >&6
     1921fi
     1922
     1923  CC=$ac_ct_CC
     1924else
     1925  CC="$ac_cv_prog_CC"
     1926fi
     1927
     1928fi
     1929if test -z "$CC"; then
     1930  # Extract the first word of "cc", so it can be a program name with args.
     1931set dummy cc; ac_word=$2
     1932echo "$as_me:$LINENO: checking for $ac_word" >&5
     1933echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     1934if test "${ac_cv_prog_CC+set}" = set; then
     1935  echo $ECHO_N "(cached) $ECHO_C" >&6
     1936else
     1937  if test -n "$CC"; then
     1938  ac_cv_prog_CC="$CC" # Let the user override the test.
     1939else
     1940  ac_prog_rejected=no
     1941as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1942for as_dir in $PATH
     1943do
     1944  IFS=$as_save_IFS
     1945  test -z "$as_dir" && as_dir=.
     1946  for ac_exec_ext in '' $ac_executable_extensions; do
     1947  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     1948    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
     1949       ac_prog_rejected=yes
     1950       continue
     1951     fi
     1952    ac_cv_prog_CC="cc"
     1953    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     1954    break 2
     1955  fi
     1956done
     1957done
     1958
     1959if test $ac_prog_rejected = yes; then
     1960  # We found a bogon in the path, so make sure we never use it.
     1961  set dummy $ac_cv_prog_CC
     1962  shift
     1963  if test $# != 0; then
     1964    # We chose a different compiler from the bogus one.
     1965    # However, it has the same basename, so the bogon will be chosen
     1966    # first if we set CC to just the basename; use the full file name.
     1967    shift
     1968    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
     1969  fi
     1970fi
     1971fi
     1972fi
     1973CC=$ac_cv_prog_CC
     1974if test -n "$CC"; then
     1975  echo "$as_me:$LINENO: result: $CC" >&5
     1976echo "${ECHO_T}$CC" >&6
     1977else
     1978  echo "$as_me:$LINENO: result: no" >&5
     1979echo "${ECHO_T}no" >&6
     1980fi
     1981
     1982fi
     1983if test -z "$CC"; then
     1984  if test -n "$ac_tool_prefix"; then
     1985  for ac_prog in cl
     1986  do
     1987    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
     1988set dummy $ac_tool_prefix$ac_prog; ac_word=$2
     1989echo "$as_me:$LINENO: checking for $ac_word" >&5
     1990echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     1991if test "${ac_cv_prog_CC+set}" = set; then
     1992  echo $ECHO_N "(cached) $ECHO_C" >&6
     1993else
     1994  if test -n "$CC"; then
     1995  ac_cv_prog_CC="$CC" # Let the user override the test.
     1996else
     1997as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1998for as_dir in $PATH
     1999do
     2000  IFS=$as_save_IFS
     2001  test -z "$as_dir" && as_dir=.
     2002  for ac_exec_ext in '' $ac_executable_extensions; do
     2003  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2004    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     2005    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2006    break 2
     2007  fi
     2008done
     2009done
     2010
     2011fi
     2012fi
     2013CC=$ac_cv_prog_CC
     2014if test -n "$CC"; then
     2015  echo "$as_me:$LINENO: result: $CC" >&5
     2016echo "${ECHO_T}$CC" >&6
     2017else
     2018  echo "$as_me:$LINENO: result: no" >&5
     2019echo "${ECHO_T}no" >&6
     2020fi
     2021
     2022    test -n "$CC" && break
     2023  done
     2024fi
     2025if test -z "$CC"; then
     2026  ac_ct_CC=$CC
     2027  for ac_prog in cl
     2028do
     2029  # Extract the first word of "$ac_prog", so it can be a program name with args.
     2030set dummy $ac_prog; ac_word=$2
     2031echo "$as_me:$LINENO: checking for $ac_word" >&5
     2032echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2033if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
     2034  echo $ECHO_N "(cached) $ECHO_C" >&6
     2035else
     2036  if test -n "$ac_ct_CC"; then
     2037  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
     2038else
     2039as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2040for as_dir in $PATH
     2041do
     2042  IFS=$as_save_IFS
     2043  test -z "$as_dir" && as_dir=.
     2044  for ac_exec_ext in '' $ac_executable_extensions; do
     2045  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2046    ac_cv_prog_ac_ct_CC="$ac_prog"
     2047    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2048    break 2
     2049  fi
     2050done
     2051done
     2052
     2053fi
     2054fi
     2055ac_ct_CC=$ac_cv_prog_ac_ct_CC
     2056if test -n "$ac_ct_CC"; then
     2057  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
     2058echo "${ECHO_T}$ac_ct_CC" >&6
     2059else
     2060  echo "$as_me:$LINENO: result: no" >&5
     2061echo "${ECHO_T}no" >&6
     2062fi
     2063
     2064  test -n "$ac_ct_CC" && break
     2065done
     2066
     2067  CC=$ac_ct_CC
     2068fi
     2069
     2070fi
     2071
     2072
     2073test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
     2074See \`config.log' for more details." >&5
     2075echo "$as_me: error: no acceptable C compiler found in \$PATH
     2076See \`config.log' for more details." >&2;}
     2077   { (exit 1); exit 1; }; }
    14292078
    14302079# Provide some information about the compiler.
    14312080echo "$as_me:$LINENO:" \
    1432      "checking for C++ compiler version" >&5
     2081     "checking for C compiler version" >&5
    14332082ac_compiler=`set X $ac_compile; echo $2`
    14342083{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
     
    14682117# It will help us diagnose broken compilers, and finding out an intuition
    14692118# of exeext.
    1470 echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5
    1471 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6
     2119echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
     2120echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
    14722121ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
    14732122if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
     
    15122161sed 's/^/| /' conftest.$ac_ext >&5
    15132162
    1514 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables
     2163{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
    15152164See \`config.log' for more details." >&5
    1516 echo "$as_me: error: C++ compiler cannot create executables
     2165echo "$as_me: error: C compiler cannot create executables
    15172166See \`config.log' for more details." >&2;}
    15182167   { (exit 77); exit 77; }; }
     
    15252174# Check the compiler produces executables we can run.  If not, either
    15262175# the compiler is broken, or we cross compile.
    1527 echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5
    1528 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6
     2176echo "$as_me:$LINENO: checking whether the C compiler works" >&5
     2177echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
    15292178# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
    15302179# If not cross compiling, check that we can run a simple program.
     
    15412190        cross_compiling=yes
    15422191    else
    1543         { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs.
     2192        { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
    15442193If you meant to cross compile, use \`--host'.
    15452194See \`config.log' for more details." >&5
    1546 echo "$as_me: error: cannot run C++ compiled programs.
     2195echo "$as_me: error: cannot run C compiled programs.
    15472196If you meant to cross compile, use \`--host'.
    15482197See \`config.log' for more details." >&2;}
     
    16492298OBJEXT=$ac_cv_objext
    16502299ac_objext=$OBJEXT
    1651 echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
    1652 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
    1653 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
     2300echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
     2301echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
     2302if test "${ac_cv_c_compiler_gnu+set}" = set; then
    16542303  echo $ECHO_N "(cached) $ECHO_C" >&6
    16552304else
     
    16812330  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    16822331  (exit $ac_status); } &&
    1683          { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
     2332         { ac_try='test -z "$ac_c_werror_flag"
     2333                         || test ! -s conftest.err'
    16842334  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    16852335  (eval $ac_try) 2>&5
     
    17012351fi
    17022352rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    1703 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
    1704 
    1705 fi
    1706 echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
    1707 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
    1708 GXX=`test $ac_compiler_gnu = yes && echo yes`
    1709 ac_test_CXXFLAGS=${CXXFLAGS+set}
    1710 ac_save_CXXFLAGS=$CXXFLAGS
    1711 CXXFLAGS="-g"
    1712 echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
    1713 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
    1714 if test "${ac_cv_prog_cxx_g+set}" = set; then
     2353ac_cv_c_compiler_gnu=$ac_compiler_gnu
     2354
     2355fi
     2356echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
     2357echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
     2358GCC=`test $ac_compiler_gnu = yes && echo yes`
     2359ac_test_CFLAGS=${CFLAGS+set}
     2360ac_save_CFLAGS=$CFLAGS
     2361CFLAGS="-g"
     2362echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
     2363echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
     2364if test "${ac_cv_prog_cc_g+set}" = set; then
    17152365  echo $ECHO_N "(cached) $ECHO_C" >&6
    17162366else
     
    17392389  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    17402390  (exit $ac_status); } &&
    1741          { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
     2391         { ac_try='test -z "$ac_c_werror_flag"
     2392                         || test ! -s conftest.err'
    17422393  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    17432394  (eval $ac_try) 2>&5
     
    17512402  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    17522403  (exit $ac_status); }; }; then
    1753   ac_cv_prog_cxx_g=yes
     2404  ac_cv_prog_cc_g=yes
    17542405else
    17552406  echo "$as_me: failed program was:" >&5
    17562407sed 's/^/| /' conftest.$ac_ext >&5
    17572408
    1758 ac_cv_prog_cxx_g=no
     2409ac_cv_prog_cc_g=no
    17592410fi
    17602411rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    17612412fi
    1762 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
    1763 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
    1764 if test "$ac_test_CXXFLAGS" = set; then
    1765   CXXFLAGS=$ac_save_CXXFLAGS
    1766 elif test $ac_cv_prog_cxx_g = yes; then
    1767   if test "$GXX" = yes; then
    1768     CXXFLAGS="-g -O2"
     2413echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
     2414echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
     2415if test "$ac_test_CFLAGS" = set; then
     2416  CFLAGS=$ac_save_CFLAGS
     2417elif test $ac_cv_prog_cc_g = yes; then
     2418  if test "$GCC" = yes; then
     2419    CFLAGS="-g -O2"
    17692420  else
    1770     CXXFLAGS="-g"
     2421    CFLAGS="-g"
    17712422  fi
    17722423else
    1773   if test "$GXX" = yes; then
    1774     CXXFLAGS="-O2"
     2424  if test "$GCC" = yes; then
     2425    CFLAGS="-O2"
    17752426  else
    1776     CXXFLAGS=
     2427    CFLAGS=
    17772428  fi
    17782429fi
    1779 for ac_declaration in \
     2430echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
     2431echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
     2432if test "${ac_cv_prog_cc_stdc+set}" = set; then
     2433  echo $ECHO_N "(cached) $ECHO_C" >&6
     2434else
     2435  ac_cv_prog_cc_stdc=no
     2436ac_save_CC=$CC
     2437cat >conftest.$ac_ext <<_ACEOF
     2438/* confdefs.h.  */
     2439_ACEOF
     2440cat confdefs.h >>conftest.$ac_ext
     2441cat >>conftest.$ac_ext <<_ACEOF
     2442/* end confdefs.h.  */
     2443#include <stdarg.h>
     2444#include <stdio.h>
     2445#include <sys/types.h>
     2446#include <sys/stat.h>
     2447/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
     2448struct buf { int x; };
     2449FILE * (*rcsopen) (struct buf *, struct stat *, int);
     2450static char *e (p, i)
     2451     char **p;
     2452     int i;
     2453{
     2454  return p[i];
     2455}
     2456static char *f (char * (*g) (char **, int), char **p, ...)
     2457{
     2458  char *s;
     2459  va_list v;
     2460  va_start (v,p);
     2461  s = g (p, va_arg (v,int));
     2462  va_end (v);
     2463  return s;
     2464}
     2465
     2466/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
     2467   function prototypes and stuff, but not '\xHH' hex character constants.
     2468   These don't provoke an error unfortunately, instead are silently treated
     2469   as 'x'.  The following induces an error, until -std1 is added to get
     2470   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
     2471   array size at least.  It's necessary to write '\x00'==0 to get something
     2472   that's true only with -std1.  */
     2473int osf4_cc_array ['\x00' == 0 ? 1 : -1];
     2474
     2475int test (int i, double x);
     2476struct s1 {int (*f) (int a);};
     2477struct s2 {int (*f) (double a);};
     2478int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
     2479int argc;
     2480char **argv;
     2481int
     2482main ()
     2483{
     2484return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
     2485  ;
     2486  return 0;
     2487}
     2488_ACEOF
     2489# Don't try gcc -ansi; that turns off useful extensions and
     2490# breaks some systems' header files.
     2491# AIX                   -qlanglvl=ansi
     2492# Ultrix and OSF/1      -std1
     2493# HP-UX 10.20 and later -Ae
     2494# HP-UX older versions  -Aa -D_HPUX_SOURCE
     2495# SVR4                  -Xc -D__EXTENSIONS__
     2496for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
     2497do
     2498  CC="$ac_save_CC $ac_arg"
     2499  rm -f conftest.$ac_objext
     2500if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2501  (eval $ac_compile) 2>conftest.er1
     2502  ac_status=$?
     2503  grep -v '^ *+' conftest.er1 >conftest.err
     2504  rm -f conftest.er1
     2505  cat conftest.err >&5
     2506  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2507  (exit $ac_status); } &&
     2508         { ac_try='test -z "$ac_c_werror_flag"
     2509                         || test ! -s conftest.err'
     2510  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2511  (eval $ac_try) 2>&5
     2512  ac_status=$?
     2513  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2514  (exit $ac_status); }; } &&
     2515         { ac_try='test -s conftest.$ac_objext'
     2516  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2517  (eval $ac_try) 2>&5
     2518  ac_status=$?
     2519  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2520  (exit $ac_status); }; }; then
     2521  ac_cv_prog_cc_stdc=$ac_arg
     2522break
     2523else
     2524  echo "$as_me: failed program was:" >&5
     2525sed 's/^/| /' conftest.$ac_ext >&5
     2526
     2527fi
     2528rm -f conftest.err conftest.$ac_objext
     2529done
     2530rm -f conftest.$ac_ext conftest.$ac_objext
     2531CC=$ac_save_CC
     2532
     2533fi
     2534
     2535case "x$ac_cv_prog_cc_stdc" in
     2536  x|xno)
     2537    echo "$as_me:$LINENO: result: none needed" >&5
     2538echo "${ECHO_T}none needed" >&6 ;;
     2539  *)
     2540    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
     2541echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     2542    CC="$CC $ac_cv_prog_cc_stdc" ;;
     2543esac
     2544
     2545# Some people use a C++ compiler to compile C.  Since we use `exit',
     2546# in C++ we need to declare it.  In case someone uses the same compiler
     2547# for both compiling C and C++ we need to have the C++ compiler decide
     2548# the declaration of exit, since it's the most demanding environment.
     2549cat >conftest.$ac_ext <<_ACEOF
     2550#ifndef __cplusplus
     2551  choke me
     2552#endif
     2553_ACEOF
     2554rm -f conftest.$ac_objext
     2555if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2556  (eval $ac_compile) 2>conftest.er1
     2557  ac_status=$?
     2558  grep -v '^ *+' conftest.er1 >conftest.err
     2559  rm -f conftest.er1
     2560  cat conftest.err >&5
     2561  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2562  (exit $ac_status); } &&
     2563         { ac_try='test -z "$ac_c_werror_flag"
     2564                         || test ! -s conftest.err'
     2565  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2566  (eval $ac_try) 2>&5
     2567  ac_status=$?
     2568  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2569  (exit $ac_status); }; } &&
     2570         { ac_try='test -s conftest.$ac_objext'
     2571  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2572  (eval $ac_try) 2>&5
     2573  ac_status=$?
     2574  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2575  (exit $ac_status); }; }; then
     2576  for ac_declaration in \
    17802577   '' \
    17812578   'extern "C" void std::exit (int) throw (); using std::exit;' \
     
    18102607  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    18112608  (exit $ac_status); } &&
    1812          { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
     2609         { ac_try='test -z "$ac_c_werror_flag"
     2610                         || test ! -s conftest.err'
    18132611  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    18142612  (eval $ac_try) 2>&5
     
    18542652  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    18552653  (exit $ac_status); } &&
    1856          { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
     2654         { ac_try='test -z "$ac_c_werror_flag"
     2655                         || test ! -s conftest.err'
    18572656  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    18582657  (eval $ac_try) 2>&5
     
    18812680fi
    18822681
     2682else
     2683  echo "$as_me: failed program was:" >&5
     2684sed 's/^/| /' conftest.$ac_ext >&5
     2685
     2686fi
     2687rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    18832688ac_ext=c
    18842689ac_cpp='$CPP $CPPFLAGS'
     
    18872692ac_compiler_gnu=$ac_cv_c_compiler_gnu
    18882693
    1889 # Find a good install program.  We prefer a C program (faster),
     2694    ac_ext=cc
     2695ac_cpp='$CXXCPP $CPPFLAGS'
     2696ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     2697ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     2698ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     2699if test -n "$ac_tool_prefix"; then
     2700  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
     2701  do
     2702    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
     2703set dummy $ac_tool_prefix$ac_prog; ac_word=$2
     2704echo "$as_me:$LINENO: checking for $ac_word" >&5
     2705echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2706if test "${ac_cv_prog_CXX+set}" = set; then
     2707  echo $ECHO_N "(cached) $ECHO_C" >&6
     2708else
     2709  if test -n "$CXX"; then
     2710  ac_cv_prog_CXX="$CXX" # Let the user override the test.
     2711else
     2712as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2713for as_dir in $PATH
     2714do
     2715  IFS=$as_save_IFS
     2716  test -z "$as_dir" && as_dir=.
     2717  for ac_exec_ext in '' $ac_executable_extensions; do
     2718  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2719    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     2720    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2721    break 2
     2722  fi
     2723done
     2724done
     2725
     2726fi
     2727fi
     2728CXX=$ac_cv_prog_CXX
     2729if test -n "$CXX"; then
     2730  echo "$as_me:$LINENO: result: $CXX" >&5
     2731echo "${ECHO_T}$CXX" >&6
     2732else
     2733  echo "$as_me:$LINENO: result: no" >&5
     2734echo "${ECHO_T}no" >&6
     2735fi
     2736
     2737    test -n "$CXX" && break
     2738  done
     2739fi
     2740if test -z "$CXX"; then
     2741  ac_ct_CXX=$CXX
     2742  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
     2743do
     2744  # Extract the first word of "$ac_prog", so it can be a program name with args.
     2745set dummy $ac_prog; ac_word=$2
     2746echo "$as_me:$LINENO: checking for $ac_word" >&5
     2747echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2748if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
     2749  echo $ECHO_N "(cached) $ECHO_C" >&6
     2750else
     2751  if test -n "$ac_ct_CXX"; then
     2752  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
     2753else
     2754as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2755for as_dir in $PATH
     2756do
     2757  IFS=$as_save_IFS
     2758  test -z "$as_dir" && as_dir=.
     2759  for ac_exec_ext in '' $ac_executable_extensions; do
     2760  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2761    ac_cv_prog_ac_ct_CXX="$ac_prog"
     2762    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2763    break 2
     2764  fi
     2765done
     2766done
     2767
     2768fi
     2769fi
     2770ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
     2771if test -n "$ac_ct_CXX"; then
     2772  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
     2773echo "${ECHO_T}$ac_ct_CXX" >&6
     2774else
     2775  echo "$as_me:$LINENO: result: no" >&5
     2776echo "${ECHO_T}no" >&6
     2777fi
     2778
     2779  test -n "$ac_ct_CXX" && break
     2780done
     2781test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
     2782
     2783  CXX=$ac_ct_CXX
     2784fi
     2785
     2786
     2787# Provide some information about the compiler.
     2788echo "$as_me:$LINENO:" \
     2789     "checking for C++ compiler version" >&5
     2790ac_compiler=`set X $ac_compile; echo $2`
     2791{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
     2792  (eval $ac_compiler --version </dev/null >&5) 2>&5
     2793  ac_status=$?
     2794  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2795  (exit $ac_status); }
     2796{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
     2797  (eval $ac_compiler -v </dev/null >&5) 2>&5
     2798  ac_status=$?
     2799  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2800  (exit $ac_status); }
     2801{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
     2802  (eval $ac_compiler -V </dev/null >&5) 2>&5
     2803  ac_status=$?
     2804  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2805  (exit $ac_status); }
     2806
     2807echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
     2808echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
     2809if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
     2810  echo $ECHO_N "(cached) $ECHO_C" >&6
     2811else
     2812  cat >conftest.$ac_ext <<_ACEOF
     2813/* confdefs.h.  */
     2814_ACEOF
     2815cat confdefs.h >>conftest.$ac_ext
     2816cat >>conftest.$ac_ext <<_ACEOF
     2817/* end confdefs.h.  */
     2818
     2819int
     2820main ()
     2821{
     2822#ifndef __GNUC__
     2823       choke me
     2824#endif
     2825
     2826  ;
     2827  return 0;
     2828}
     2829_ACEOF
     2830rm -f conftest.$ac_objext
     2831if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2832  (eval $ac_compile) 2>conftest.er1
     2833  ac_status=$?
     2834  grep -v '^ *+' conftest.er1 >conftest.err
     2835  rm -f conftest.er1
     2836  cat conftest.err >&5
     2837  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2838  (exit $ac_status); } &&
     2839         { ac_try='test -z "$ac_cxx_werror_flag"
     2840                         || test ! -s conftest.err'
     2841  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2842  (eval $ac_try) 2>&5
     2843  ac_status=$?
     2844  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2845  (exit $ac_status); }; } &&
     2846         { ac_try='test -s conftest.$ac_objext'
     2847  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2848  (eval $ac_try) 2>&5
     2849  ac_status=$?
     2850  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2851  (exit $ac_status); }; }; then
     2852  ac_compiler_gnu=yes
     2853else
     2854  echo "$as_me: failed program was:" >&5
     2855sed 's/^/| /' conftest.$ac_ext >&5
     2856
     2857ac_compiler_gnu=no
     2858fi
     2859rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     2860ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
     2861
     2862fi
     2863echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
     2864echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
     2865GXX=`test $ac_compiler_gnu = yes && echo yes`
     2866ac_test_CXXFLAGS=${CXXFLAGS+set}
     2867ac_save_CXXFLAGS=$CXXFLAGS
     2868CXXFLAGS="-g"
     2869echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
     2870echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
     2871if test "${ac_cv_prog_cxx_g+set}" = set; then
     2872  echo $ECHO_N "(cached) $ECHO_C" >&6
     2873else
     2874  cat >conftest.$ac_ext <<_ACEOF
     2875/* confdefs.h.  */
     2876_ACEOF
     2877cat confdefs.h >>conftest.$ac_ext
     2878cat >>conftest.$ac_ext <<_ACEOF
     2879/* end confdefs.h.  */
     2880
     2881int
     2882main ()
     2883{
     2884
     2885  ;
     2886  return 0;
     2887}
     2888_ACEOF
     2889rm -f conftest.$ac_objext
     2890if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2891  (eval $ac_compile) 2>conftest.er1
     2892  ac_status=$?
     2893  grep -v '^ *+' conftest.er1 >conftest.err
     2894  rm -f conftest.er1
     2895  cat conftest.err >&5
     2896  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2897  (exit $ac_status); } &&
     2898         { ac_try='test -z "$ac_cxx_werror_flag"
     2899                         || test ! -s conftest.err'
     2900  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2901  (eval $ac_try) 2>&5
     2902  ac_status=$?
     2903  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2904  (exit $ac_status); }; } &&
     2905         { ac_try='test -s conftest.$ac_objext'
     2906  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2907  (eval $ac_try) 2>&5
     2908  ac_status=$?
     2909  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2910  (exit $ac_status); }; }; then
     2911  ac_cv_prog_cxx_g=yes
     2912else
     2913  echo "$as_me: failed program was:" >&5
     2914sed 's/^/| /' conftest.$ac_ext >&5
     2915
     2916ac_cv_prog_cxx_g=no
     2917fi
     2918rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     2919fi
     2920echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
     2921echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
     2922if test "$ac_test_CXXFLAGS" = set; then
     2923  CXXFLAGS=$ac_save_CXXFLAGS
     2924elif test $ac_cv_prog_cxx_g = yes; then
     2925  if test "$GXX" = yes; then
     2926    CXXFLAGS="-g -O2"
     2927  else
     2928    CXXFLAGS="-g"
     2929  fi
     2930else
     2931  if test "$GXX" = yes; then
     2932    CXXFLAGS="-O2"
     2933  else
     2934    CXXFLAGS=
     2935  fi
     2936fi
     2937for ac_declaration in \
     2938   '' \
     2939   'extern "C" void std::exit (int) throw (); using std::exit;' \
     2940   'extern "C" void std::exit (int); using std::exit;' \
     2941   'extern "C" void exit (int) throw ();' \
     2942   'extern "C" void exit (int);' \
     2943   'void exit (int);'
     2944do
     2945  cat >conftest.$ac_ext <<_ACEOF
     2946/* confdefs.h.  */
     2947_ACEOF
     2948cat confdefs.h >>conftest.$ac_ext
     2949cat >>conftest.$ac_ext <<_ACEOF
     2950/* end confdefs.h.  */
     2951$ac_declaration
     2952#include <stdlib.h>
     2953int
     2954main ()
     2955{
     2956exit (42);
     2957  ;
     2958  return 0;
     2959}
     2960_ACEOF
     2961rm -f conftest.$ac_objext
     2962if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2963  (eval $ac_compile) 2>conftest.er1
     2964  ac_status=$?
     2965  grep -v '^ *+' conftest.er1 >conftest.err
     2966  rm -f conftest.er1
     2967  cat conftest.err >&5
     2968  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2969  (exit $ac_status); } &&
     2970         { ac_try='test -z "$ac_cxx_werror_flag"
     2971                         || test ! -s conftest.err'
     2972  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2973  (eval $ac_try) 2>&5
     2974  ac_status=$?
     2975  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2976  (exit $ac_status); }; } &&
     2977         { ac_try='test -s conftest.$ac_objext'
     2978  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2979  (eval $ac_try) 2>&5
     2980  ac_status=$?
     2981  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2982  (exit $ac_status); }; }; then
     2983  :
     2984else
     2985  echo "$as_me: failed program was:" >&5
     2986sed 's/^/| /' conftest.$ac_ext >&5
     2987
     2988continue
     2989fi
     2990rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     2991  cat >conftest.$ac_ext <<_ACEOF
     2992/* confdefs.h.  */
     2993_ACEOF
     2994cat confdefs.h >>conftest.$ac_ext
     2995cat >>conftest.$ac_ext <<_ACEOF
     2996/* end confdefs.h.  */
     2997$ac_declaration
     2998int
     2999main ()
     3000{
     3001exit (42);
     3002  ;
     3003  return 0;
     3004}
     3005_ACEOF
     3006rm -f conftest.$ac_objext
     3007if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3008  (eval $ac_compile) 2>conftest.er1
     3009  ac_status=$?
     3010  grep -v '^ *+' conftest.er1 >conftest.err
     3011  rm -f conftest.er1
     3012  cat conftest.err >&5
     3013  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3014  (exit $ac_status); } &&
     3015         { ac_try='test -z "$ac_cxx_werror_flag"
     3016                         || test ! -s conftest.err'
     3017  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3018  (eval $ac_try) 2>&5
     3019  ac_status=$?
     3020  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3021  (exit $ac_status); }; } &&
     3022         { ac_try='test -s conftest.$ac_objext'
     3023  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3024  (eval $ac_try) 2>&5
     3025  ac_status=$?
     3026  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3027  (exit $ac_status); }; }; then
     3028  break
     3029else
     3030  echo "$as_me: failed program was:" >&5
     3031sed 's/^/| /' conftest.$ac_ext >&5
     3032
     3033fi
     3034rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3035done
     3036rm -f conftest*
     3037if test -n "$ac_declaration"; then
     3038  echo '#ifdef __cplusplus' >>confdefs.h
     3039  echo $ac_declaration      >>confdefs.h
     3040  echo '#endif'             >>confdefs.h
     3041fi
     3042
     3043ac_ext=c
     3044ac_cpp='$CPP $CPPFLAGS'
     3045ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     3046ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3047ac_compiler_gnu=$ac_cv_c_compiler_gnu
     3048
     3049    ac_ext=c
     3050ac_cpp='$CPP $CPPFLAGS'
     3051ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     3052ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3053ac_compiler_gnu=$ac_cv_c_compiler_gnu
     3054echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
     3055echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
     3056# On Suns, sometimes $CPP names a directory.
     3057if test -n "$CPP" && test -d "$CPP"; then
     3058  CPP=
     3059fi
     3060if test -z "$CPP"; then
     3061  if test "${ac_cv_prog_CPP+set}" = set; then
     3062  echo $ECHO_N "(cached) $ECHO_C" >&6
     3063else
     3064      # Double quotes because CPP needs to be expanded
     3065    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
     3066    do
     3067      ac_preproc_ok=false
     3068for ac_c_preproc_warn_flag in '' yes
     3069do
     3070  # Use a header file that comes with gcc, so configuring glibc
     3071  # with a fresh cross-compiler works.
     3072  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     3073  # <limits.h> exists even on freestanding compilers.
     3074  # On the NeXT, cc -E runs the code through the compiler's parser,
     3075  # not just through cpp. "Syntax error" is here to catch this case.
     3076  cat >conftest.$ac_ext <<_ACEOF
     3077/* confdefs.h.  */
     3078_ACEOF
     3079cat confdefs.h >>conftest.$ac_ext
     3080cat >>conftest.$ac_ext <<_ACEOF
     3081/* end confdefs.h.  */
     3082#ifdef __STDC__
     3083# include <limits.h>
     3084#else
     3085# include <assert.h>
     3086#endif
     3087                     Syntax error
     3088_ACEOF
     3089if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     3090  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     3091  ac_status=$?
     3092  grep -v '^ *+' conftest.er1 >conftest.err
     3093  rm -f conftest.er1
     3094  cat conftest.err >&5
     3095  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3096  (exit $ac_status); } >/dev/null; then
     3097  if test -s conftest.err; then
     3098    ac_cpp_err=$ac_c_preproc_warn_flag
     3099    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     3100  else
     3101    ac_cpp_err=
     3102  fi
     3103else
     3104  ac_cpp_err=yes
     3105fi
     3106if test -z "$ac_cpp_err"; then
     3107  :
     3108else
     3109  echo "$as_me: failed program was:" >&5
     3110sed 's/^/| /' conftest.$ac_ext >&5
     3111
     3112  # Broken: fails on valid input.
     3113continue
     3114fi
     3115rm -f conftest.err conftest.$ac_ext
     3116
     3117  # OK, works on sane cases.  Now check whether non-existent headers
     3118  # can be detected and how.
     3119  cat >conftest.$ac_ext <<_ACEOF
     3120/* confdefs.h.  */
     3121_ACEOF
     3122cat confdefs.h >>conftest.$ac_ext
     3123cat >>conftest.$ac_ext <<_ACEOF
     3124/* end confdefs.h.  */
     3125#include <ac_nonexistent.h>
     3126_ACEOF
     3127if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     3128  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     3129  ac_status=$?
     3130  grep -v '^ *+' conftest.er1 >conftest.err
     3131  rm -f conftest.er1
     3132  cat conftest.err >&5
     3133  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3134  (exit $ac_status); } >/dev/null; then
     3135  if test -s conftest.err; then
     3136    ac_cpp_err=$ac_c_preproc_warn_flag
     3137    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     3138  else
     3139    ac_cpp_err=
     3140  fi
     3141else
     3142  ac_cpp_err=yes
     3143fi
     3144if test -z "$ac_cpp_err"; then
     3145  # Broken: success on invalid input.
     3146continue
     3147else
     3148  echo "$as_me: failed program was:" >&5
     3149sed 's/^/| /' conftest.$ac_ext >&5
     3150
     3151  # Passes both tests.
     3152ac_preproc_ok=:
     3153break
     3154fi
     3155rm -f conftest.err conftest.$ac_ext
     3156
     3157done
     3158# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
     3159rm -f conftest.err conftest.$ac_ext
     3160if $ac_preproc_ok; then
     3161  break
     3162fi
     3163
     3164    done
     3165    ac_cv_prog_CPP=$CPP
     3166
     3167fi
     3168  CPP=$ac_cv_prog_CPP
     3169else
     3170  ac_cv_prog_CPP=$CPP
     3171fi
     3172echo "$as_me:$LINENO: result: $CPP" >&5
     3173echo "${ECHO_T}$CPP" >&6
     3174ac_preproc_ok=false
     3175for ac_c_preproc_warn_flag in '' yes
     3176do
     3177  # Use a header file that comes with gcc, so configuring glibc
     3178  # with a fresh cross-compiler works.
     3179  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     3180  # <limits.h> exists even on freestanding compilers.
     3181  # On the NeXT, cc -E runs the code through the compiler's parser,
     3182  # not just through cpp. "Syntax error" is here to catch this case.
     3183  cat >conftest.$ac_ext <<_ACEOF
     3184/* confdefs.h.  */
     3185_ACEOF
     3186cat confdefs.h >>conftest.$ac_ext
     3187cat >>conftest.$ac_ext <<_ACEOF
     3188/* end confdefs.h.  */
     3189#ifdef __STDC__
     3190# include <limits.h>
     3191#else
     3192# include <assert.h>
     3193#endif
     3194                     Syntax error
     3195_ACEOF
     3196if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     3197  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     3198  ac_status=$?
     3199  grep -v '^ *+' conftest.er1 >conftest.err
     3200  rm -f conftest.er1
     3201  cat conftest.err >&5
     3202  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3203  (exit $ac_status); } >/dev/null; then
     3204  if test -s conftest.err; then
     3205    ac_cpp_err=$ac_c_preproc_warn_flag
     3206    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     3207  else
     3208    ac_cpp_err=
     3209  fi
     3210else
     3211  ac_cpp_err=yes
     3212fi
     3213if test -z "$ac_cpp_err"; then
     3214  :
     3215else
     3216  echo "$as_me: failed program was:" >&5
     3217sed 's/^/| /' conftest.$ac_ext >&5
     3218
     3219  # Broken: fails on valid input.
     3220continue
     3221fi
     3222rm -f conftest.err conftest.$ac_ext
     3223
     3224  # OK, works on sane cases.  Now check whether non-existent headers
     3225  # can be detected and how.
     3226  cat >conftest.$ac_ext <<_ACEOF
     3227/* confdefs.h.  */
     3228_ACEOF
     3229cat confdefs.h >>conftest.$ac_ext
     3230cat >>conftest.$ac_ext <<_ACEOF
     3231/* end confdefs.h.  */
     3232#include <ac_nonexistent.h>
     3233_ACEOF
     3234if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     3235  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     3236  ac_status=$?
     3237  grep -v '^ *+' conftest.er1 >conftest.err
     3238  rm -f conftest.er1
     3239  cat conftest.err >&5
     3240  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3241  (exit $ac_status); } >/dev/null; then
     3242  if test -s conftest.err; then
     3243    ac_cpp_err=$ac_c_preproc_warn_flag
     3244    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     3245  else
     3246    ac_cpp_err=
     3247  fi
     3248else
     3249  ac_cpp_err=yes
     3250fi
     3251if test -z "$ac_cpp_err"; then
     3252  # Broken: success on invalid input.
     3253continue
     3254else
     3255  echo "$as_me: failed program was:" >&5
     3256sed 's/^/| /' conftest.$ac_ext >&5
     3257
     3258  # Passes both tests.
     3259ac_preproc_ok=:
     3260break
     3261fi
     3262rm -f conftest.err conftest.$ac_ext
     3263
     3264done
     3265# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
     3266rm -f conftest.err conftest.$ac_ext
     3267if $ac_preproc_ok; then
     3268  :
     3269else
     3270  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
     3271See \`config.log' for more details." >&5
     3272echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
     3273See \`config.log' for more details." >&2;}
     3274   { (exit 1); exit 1; }; }
     3275fi
     3276
     3277ac_ext=c
     3278ac_cpp='$CPP $CPPFLAGS'
     3279ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     3280ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3281ac_compiler_gnu=$ac_cv_c_compiler_gnu
     3282
     3283
     3284    # Find a good install program.  We prefer a C program (faster),
    18903285# so one script is as good as another.  But avoid the broken or
    18913286# incompatible versions:
     
    19673362
    19683363
    1969 #--------------------------------------------------------------------
    1970 # Checks to see if the make program sets the $MAKE variable.
    1971 #--------------------------------------------------------------------
    1972 
    1973 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
     3364    #--------------------------------------------------------------------
     3365    # Checks to see if the make program sets the $MAKE variable.
     3366    #--------------------------------------------------------------------
     3367
     3368    echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
    19743369echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
    19753370set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
     
    20013396
    20023397
    2003 #--------------------------------------------------------------------
    2004 # Find ranlib
    2005 #--------------------------------------------------------------------
    2006 
    2007 if test -n "$ac_tool_prefix"; then
     3398    #--------------------------------------------------------------------
     3399    # Find ranlib
     3400    #--------------------------------------------------------------------
     3401
     3402    if test -n "$ac_tool_prefix"; then
    20083403  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
    20093404set dummy ${ac_tool_prefix}ranlib; ac_word=$2
     
    20863481
    20873482
    2088 #--------------------------------------------------------------------
    2089 # This macro performs additional compiler tests.
    2090 #--------------------------------------------------------------------
    2091 
    2092 # Make sure we can run config.sub.
    2093 $ac_config_sub sun4 >/dev/null 2>&1 ||
    2094   { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
    2095 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    2096    { (exit 1); exit 1; }; }
    2097 
    2098 echo "$as_me:$LINENO: checking build system type" >&5
    2099 echo $ECHO_N "checking build system type... $ECHO_C" >&6
    2100 if test "${ac_cv_build+set}" = set; then
     3483    #--------------------------------------------------------------------
     3484    # Determines the correct binary file extension (.o, .obj, .exe etc.)
     3485    #--------------------------------------------------------------------
     3486
     3487
     3488
     3489
     3490
     3491
     3492echo "$as_me:$LINENO: checking for egrep" >&5
     3493echo $ECHO_N "checking for egrep... $ECHO_C" >&6
     3494if test "${ac_cv_prog_egrep+set}" = set; then
    21013495  echo $ECHO_N "(cached) $ECHO_C" >&6
    21023496else
    2103   ac_cv_build_alias=$build_alias
    2104 test -z "$ac_cv_build_alias" &&
    2105   ac_cv_build_alias=`$ac_config_guess`
    2106 test -z "$ac_cv_build_alias" &&
    2107   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
    2108 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    2109    { (exit 1); exit 1; }; }
    2110 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
    2111   { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
    2112 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
    2113    { (exit 1); exit 1; }; }
    2114 
    2115 fi
    2116 echo "$as_me:$LINENO: result: $ac_cv_build" >&5
    2117 echo "${ECHO_T}$ac_cv_build" >&6
    2118 build=$ac_cv_build
    2119 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
    2120 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
    2121 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
    2122 
    2123 
    2124 echo "$as_me:$LINENO: checking host system type" >&5
    2125 echo $ECHO_N "checking host system type... $ECHO_C" >&6
    2126 if test "${ac_cv_host+set}" = set; then
     3497  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
     3498    then ac_cv_prog_egrep='grep -E'
     3499    else ac_cv_prog_egrep='egrep'
     3500    fi
     3501fi
     3502echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
     3503echo "${ECHO_T}$ac_cv_prog_egrep" >&6
     3504 EGREP=$ac_cv_prog_egrep
     3505
     3506
     3507echo "$as_me:$LINENO: checking for ANSI C header files" >&5
     3508echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
     3509if test "${ac_cv_header_stdc+set}" = set; then
    21273510  echo $ECHO_N "(cached) $ECHO_C" >&6
    21283511else
    2129   ac_cv_host_alias=$host_alias
    2130 test -z "$ac_cv_host_alias" &&
    2131   ac_cv_host_alias=$ac_cv_build_alias
    2132 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
    2133   { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
    2134 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    2135    { (exit 1); exit 1; }; }
    2136 
    2137 fi
    2138 echo "$as_me:$LINENO: result: $ac_cv_host" >&5
    2139 echo "${ECHO_T}$ac_cv_host" >&6
    2140 host=$ac_cv_host
    2141 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
    2142 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
    2143 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
    2144 
    2145 
    2146 case $host_os in
    2147   *cygwin* ) CYGWIN=yes;;
    2148          * ) CYGWIN=no;;
     3512  cat >conftest.$ac_ext <<_ACEOF
     3513/* confdefs.h.  */
     3514_ACEOF
     3515cat confdefs.h >>conftest.$ac_ext
     3516cat >>conftest.$ac_ext <<_ACEOF
     3517/* end confdefs.h.  */
     3518#include <stdlib.h>
     3519#include <stdarg.h>
     3520#include <string.h>
     3521#include <float.h>
     3522
     3523int
     3524main ()
     3525{
     3526
     3527  ;
     3528  return 0;
     3529}
     3530_ACEOF
     3531rm -f conftest.$ac_objext
     3532if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3533  (eval $ac_compile) 2>conftest.er1
     3534  ac_status=$?
     3535  grep -v '^ *+' conftest.er1 >conftest.err
     3536  rm -f conftest.er1
     3537  cat conftest.err >&5
     3538  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3539  (exit $ac_status); } &&
     3540         { ac_try='test -z "$ac_c_werror_flag"
     3541                         || test ! -s conftest.err'
     3542  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3543  (eval $ac_try) 2>&5
     3544  ac_status=$?
     3545  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3546  (exit $ac_status); }; } &&
     3547         { ac_try='test -s conftest.$ac_objext'
     3548  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3549  (eval $ac_try) 2>&5
     3550  ac_status=$?
     3551  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3552  (exit $ac_status); }; }; then
     3553  ac_cv_header_stdc=yes
     3554else
     3555  echo "$as_me: failed program was:" >&5
     3556sed 's/^/| /' conftest.$ac_ext >&5
     3557
     3558ac_cv_header_stdc=no
     3559fi
     3560rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3561
     3562if test $ac_cv_header_stdc = yes; then
     3563  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
     3564  cat >conftest.$ac_ext <<_ACEOF
     3565/* confdefs.h.  */
     3566_ACEOF
     3567cat confdefs.h >>conftest.$ac_ext
     3568cat >>conftest.$ac_ext <<_ACEOF
     3569/* end confdefs.h.  */
     3570#include <string.h>
     3571
     3572_ACEOF
     3573if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     3574  $EGREP "memchr" >/dev/null 2>&1; then
     3575  :
     3576else
     3577  ac_cv_header_stdc=no
     3578fi
     3579rm -f conftest*
     3580
     3581fi
     3582
     3583if test $ac_cv_header_stdc = yes; then
     3584  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
     3585  cat >conftest.$ac_ext <<_ACEOF
     3586/* confdefs.h.  */
     3587_ACEOF
     3588cat confdefs.h >>conftest.$ac_ext
     3589cat >>conftest.$ac_ext <<_ACEOF
     3590/* end confdefs.h.  */
     3591#include <stdlib.h>
     3592
     3593_ACEOF
     3594if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     3595  $EGREP "free" >/dev/null 2>&1; then
     3596  :
     3597else
     3598  ac_cv_header_stdc=no
     3599fi
     3600rm -f conftest*
     3601
     3602fi
     3603
     3604if test $ac_cv_header_stdc = yes; then
     3605  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
     3606  if test "$cross_compiling" = yes; then
     3607  :
     3608else
     3609  cat >conftest.$ac_ext <<_ACEOF
     3610/* confdefs.h.  */
     3611_ACEOF
     3612cat confdefs.h >>conftest.$ac_ext
     3613cat >>conftest.$ac_ext <<_ACEOF
     3614/* end confdefs.h.  */
     3615#include <ctype.h>
     3616#if ((' ' & 0x0FF) == 0x020)
     3617# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
     3618# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
     3619#else
     3620# define ISLOWER(c) \
     3621                   (('a' <= (c) && (c) <= 'i') \
     3622                     || ('j' <= (c) && (c) <= 'r') \
     3623                     || ('s' <= (c) && (c) <= 'z'))
     3624# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
     3625#endif
     3626
     3627#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
     3628int
     3629main ()
     3630{
     3631  int i;
     3632  for (i = 0; i < 256; i++)
     3633    if (XOR (islower (i), ISLOWER (i))
     3634        || toupper (i) != TOUPPER (i))
     3635      exit(2);
     3636  exit (0);
     3637}
     3638_ACEOF
     3639rm -f conftest$ac_exeext
     3640if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3641  (eval $ac_link) 2>&5
     3642  ac_status=$?
     3643  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3644  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     3645  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3646  (eval $ac_try) 2>&5
     3647  ac_status=$?
     3648  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3649  (exit $ac_status); }; }; then
     3650  :
     3651else
     3652  echo "$as_me: program exited with status $ac_status" >&5
     3653echo "$as_me: failed program was:" >&5
     3654sed 's/^/| /' conftest.$ac_ext >&5
     3655
     3656( exit $ac_status )
     3657ac_cv_header_stdc=no
     3658fi
     3659rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     3660fi
     3661fi
     3662fi
     3663echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
     3664echo "${ECHO_T}$ac_cv_header_stdc" >&6
     3665if test $ac_cv_header_stdc = yes; then
     3666
     3667cat >>confdefs.h <<\_ACEOF
     3668#define STDC_HEADERS 1
     3669_ACEOF
     3670
     3671fi
     3672
     3673# On IRIX 5.3, sys/types and inttypes.h are conflicting.
     3674
     3675
     3676
     3677
     3678
     3679
     3680
     3681
     3682
     3683for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
     3684                  inttypes.h stdint.h unistd.h
     3685do
     3686as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     3687echo "$as_me:$LINENO: checking for $ac_header" >&5
     3688echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     3689if eval "test \"\${$as_ac_Header+set}\" = set"; then
     3690  echo $ECHO_N "(cached) $ECHO_C" >&6
     3691else
     3692  cat >conftest.$ac_ext <<_ACEOF
     3693/* confdefs.h.  */
     3694_ACEOF
     3695cat confdefs.h >>conftest.$ac_ext
     3696cat >>conftest.$ac_ext <<_ACEOF
     3697/* end confdefs.h.  */
     3698$ac_includes_default
     3699
     3700#include <$ac_header>
     3701_ACEOF
     3702rm -f conftest.$ac_objext
     3703if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3704  (eval $ac_compile) 2>conftest.er1
     3705  ac_status=$?
     3706  grep -v '^ *+' conftest.er1 >conftest.err
     3707  rm -f conftest.er1
     3708  cat conftest.err >&5
     3709  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3710  (exit $ac_status); } &&
     3711         { ac_try='test -z "$ac_c_werror_flag"
     3712                         || test ! -s conftest.err'
     3713  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3714  (eval $ac_try) 2>&5
     3715  ac_status=$?
     3716  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3717  (exit $ac_status); }; } &&
     3718         { ac_try='test -s conftest.$ac_objext'
     3719  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3720  (eval $ac_try) 2>&5
     3721  ac_status=$?
     3722  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3723  (exit $ac_status); }; }; then
     3724  eval "$as_ac_Header=yes"
     3725else
     3726  echo "$as_me: failed program was:" >&5
     3727sed 's/^/| /' conftest.$ac_ext >&5
     3728
     3729eval "$as_ac_Header=no"
     3730fi
     3731rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3732fi
     3733echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     3734echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     3735if test `eval echo '${'$as_ac_Header'}'` = yes; then
     3736  cat >>confdefs.h <<_ACEOF
     3737#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     3738_ACEOF
     3739
     3740fi
     3741
     3742done
     3743
     3744
     3745
     3746    # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
     3747
     3748
     3749    #------------------------------------------------------------------------
     3750    # If we're using GCC, see if the compiler understands -pipe. If so, use it.
     3751    # It makes compiling go faster.  (This is only a performance feature.)
     3752    #------------------------------------------------------------------------
     3753
     3754    if test -z "$no_pipe" -a -n "$GCC"; then
     3755        echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
     3756echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6
     3757        OLDCC="$CC"
     3758        CC="$CC -pipe"
     3759        cat >conftest.$ac_ext <<_ACEOF
     3760/* confdefs.h.  */
     3761_ACEOF
     3762cat confdefs.h >>conftest.$ac_ext
     3763cat >>conftest.$ac_ext <<_ACEOF
     3764/* end confdefs.h.  */
     3765
     3766int
     3767main ()
     3768{
     3769
     3770  ;
     3771  return 0;
     3772}
     3773_ACEOF
     3774rm -f conftest.$ac_objext
     3775if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3776  (eval $ac_compile) 2>conftest.er1
     3777  ac_status=$?
     3778  grep -v '^ *+' conftest.er1 >conftest.err
     3779  rm -f conftest.er1
     3780  cat conftest.err >&5
     3781  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3782  (exit $ac_status); } &&
     3783         { ac_try='test -z "$ac_c_werror_flag"
     3784                         || test ! -s conftest.err'
     3785  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3786  (eval $ac_try) 2>&5
     3787  ac_status=$?
     3788  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3789  (exit $ac_status); }; } &&
     3790         { ac_try='test -s conftest.$ac_objext'
     3791  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3792  (eval $ac_try) 2>&5
     3793  ac_status=$?
     3794  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3795  (exit $ac_status); }; }; then
     3796  echo "$as_me:$LINENO: result: yes" >&5
     3797echo "${ECHO_T}yes" >&6
     3798else
     3799  echo "$as_me: failed program was:" >&5
     3800sed 's/^/| /' conftest.$ac_ext >&5
     3801
     3802CC="$OLDCC"
     3803            echo "$as_me:$LINENO: result: no" >&5
     3804echo "${ECHO_T}no" >&6
     3805fi
     3806rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3807    fi
     3808
     3809    #--------------------------------------------------------------------
     3810    # Common compiler flag setup
     3811    #--------------------------------------------------------------------
     3812
     3813    echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
     3814echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
     3815if test "${ac_cv_c_bigendian+set}" = set; then
     3816  echo $ECHO_N "(cached) $ECHO_C" >&6
     3817else
     3818  # See if sys/param.h defines the BYTE_ORDER macro.
     3819cat >conftest.$ac_ext <<_ACEOF
     3820/* confdefs.h.  */
     3821_ACEOF
     3822cat confdefs.h >>conftest.$ac_ext
     3823cat >>conftest.$ac_ext <<_ACEOF
     3824/* end confdefs.h.  */
     3825#include <sys/types.h>
     3826#include <sys/param.h>
     3827
     3828int
     3829main ()
     3830{
     3831#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
     3832 bogus endian macros
     3833#endif
     3834
     3835  ;
     3836  return 0;
     3837}
     3838_ACEOF
     3839rm -f conftest.$ac_objext
     3840if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3841  (eval $ac_compile) 2>conftest.er1
     3842  ac_status=$?
     3843  grep -v '^ *+' conftest.er1 >conftest.err
     3844  rm -f conftest.er1
     3845  cat conftest.err >&5
     3846  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3847  (exit $ac_status); } &&
     3848         { ac_try='test -z "$ac_c_werror_flag"
     3849                         || test ! -s conftest.err'
     3850  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3851  (eval $ac_try) 2>&5
     3852  ac_status=$?
     3853  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3854  (exit $ac_status); }; } &&
     3855         { ac_try='test -s conftest.$ac_objext'
     3856  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3857  (eval $ac_try) 2>&5
     3858  ac_status=$?
     3859  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3860  (exit $ac_status); }; }; then
     3861  # It does; now see whether it defined to BIG_ENDIAN or not.
     3862cat >conftest.$ac_ext <<_ACEOF
     3863/* confdefs.h.  */
     3864_ACEOF
     3865cat confdefs.h >>conftest.$ac_ext
     3866cat >>conftest.$ac_ext <<_ACEOF
     3867/* end confdefs.h.  */
     3868#include <sys/types.h>
     3869#include <sys/param.h>
     3870
     3871int
     3872main ()
     3873{
     3874#if BYTE_ORDER != BIG_ENDIAN
     3875 not big endian
     3876#endif
     3877
     3878  ;
     3879  return 0;
     3880}
     3881_ACEOF
     3882rm -f conftest.$ac_objext
     3883if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3884  (eval $ac_compile) 2>conftest.er1
     3885  ac_status=$?
     3886  grep -v '^ *+' conftest.er1 >conftest.err
     3887  rm -f conftest.er1
     3888  cat conftest.err >&5
     3889  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3890  (exit $ac_status); } &&
     3891         { ac_try='test -z "$ac_c_werror_flag"
     3892                         || test ! -s conftest.err'
     3893  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3894  (eval $ac_try) 2>&5
     3895  ac_status=$?
     3896  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3897  (exit $ac_status); }; } &&
     3898         { ac_try='test -s conftest.$ac_objext'
     3899  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3900  (eval $ac_try) 2>&5
     3901  ac_status=$?
     3902  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3903  (exit $ac_status); }; }; then
     3904  ac_cv_c_bigendian=yes
     3905else
     3906  echo "$as_me: failed program was:" >&5
     3907sed 's/^/| /' conftest.$ac_ext >&5
     3908
     3909ac_cv_c_bigendian=no
     3910fi
     3911rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3912else
     3913  echo "$as_me: failed program was:" >&5
     3914sed 's/^/| /' conftest.$ac_ext >&5
     3915
     3916# It does not; compile a test program.
     3917if test "$cross_compiling" = yes; then
     3918  # try to guess the endianness by grepping values into an object file
     3919  ac_cv_c_bigendian=unknown
     3920  cat >conftest.$ac_ext <<_ACEOF
     3921/* confdefs.h.  */
     3922_ACEOF
     3923cat confdefs.h >>conftest.$ac_ext
     3924cat >>conftest.$ac_ext <<_ACEOF
     3925/* end confdefs.h.  */
     3926short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
     3927short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
     3928void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
     3929short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
     3930short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
     3931void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
     3932int
     3933main ()
     3934{
     3935 _ascii (); _ebcdic ();
     3936  ;
     3937  return 0;
     3938}
     3939_ACEOF
     3940rm -f conftest.$ac_objext
     3941if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     3942  (eval $ac_compile) 2>conftest.er1
     3943  ac_status=$?
     3944  grep -v '^ *+' conftest.er1 >conftest.err
     3945  rm -f conftest.er1
     3946  cat conftest.err >&5
     3947  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3948  (exit $ac_status); } &&
     3949         { ac_try='test -z "$ac_c_werror_flag"
     3950                         || test ! -s conftest.err'
     3951  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3952  (eval $ac_try) 2>&5
     3953  ac_status=$?
     3954  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3955  (exit $ac_status); }; } &&
     3956         { ac_try='test -s conftest.$ac_objext'
     3957  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3958  (eval $ac_try) 2>&5
     3959  ac_status=$?
     3960  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3961  (exit $ac_status); }; }; then
     3962  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
     3963  ac_cv_c_bigendian=yes
     3964fi
     3965if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
     3966  if test "$ac_cv_c_bigendian" = unknown; then
     3967    ac_cv_c_bigendian=no
     3968  else
     3969    # finding both strings is unlikely to happen, but who knows?
     3970    ac_cv_c_bigendian=unknown
     3971  fi
     3972fi
     3973else
     3974  echo "$as_me: failed program was:" >&5
     3975sed 's/^/| /' conftest.$ac_ext >&5
     3976
     3977fi
     3978rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     3979else
     3980  cat >conftest.$ac_ext <<_ACEOF
     3981/* confdefs.h.  */
     3982_ACEOF
     3983cat confdefs.h >>conftest.$ac_ext
     3984cat >>conftest.$ac_ext <<_ACEOF
     3985/* end confdefs.h.  */
     3986int
     3987main ()
     3988{
     3989  /* Are we little or big endian?  From Harbison&Steele.  */
     3990  union
     3991  {
     3992    long l;
     3993    char c[sizeof (long)];
     3994  } u;
     3995  u.l = 1;
     3996  exit (u.c[sizeof (long) - 1] == 1);
     3997}
     3998_ACEOF
     3999rm -f conftest$ac_exeext
     4000if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4001  (eval $ac_link) 2>&5
     4002  ac_status=$?
     4003  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4004  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     4005  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4006  (eval $ac_try) 2>&5
     4007  ac_status=$?
     4008  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4009  (exit $ac_status); }; }; then
     4010  ac_cv_c_bigendian=no
     4011else
     4012  echo "$as_me: program exited with status $ac_status" >&5
     4013echo "$as_me: failed program was:" >&5
     4014sed 's/^/| /' conftest.$ac_ext >&5
     4015
     4016( exit $ac_status )
     4017ac_cv_c_bigendian=yes
     4018fi
     4019rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     4020fi
     4021fi
     4022rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     4023fi
     4024echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
     4025echo "${ECHO_T}$ac_cv_c_bigendian" >&6
     4026case $ac_cv_c_bigendian in
     4027  yes)
     4028
     4029cat >>confdefs.h <<\_ACEOF
     4030#define WORDS_BIGENDIAN 1
     4031_ACEOF
     4032 ;;
     4033  no)
     4034     ;;
     4035  *)
     4036    { { echo "$as_me:$LINENO: error: unknown endianness
     4037presetting ac_cv_c_bigendian=no (or yes) will help" >&5
     4038echo "$as_me: error: unknown endianness
     4039presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
     4040   { (exit 1); exit 1; }; } ;;
    21494041esac
    21504042
    2151 
    2152 #--------------------------------------------------------------------
    2153 # Determines the correct binary file extension (.o, .obj, .exe etc.)
    2154 #--------------------------------------------------------------------
    2155 
    2156 
    2157 
    2158 
    2159 #--------------------------------------------------------------------
    2160 # "cygpath" is used on windows to generate native path names for include
    2161 # files.
    2162 # These variables should only be used with the compiler and linker since
    2163 # they generate native path names.
    2164 #
    2165 # Unix tclConfig.sh points SRC_DIR at the top-level directory of
    2166 # the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at
    2167 # the win subdirectory.  Hence the different usages of SRC_DIR below.
    2168 #
    2169 # This must be done before calling SC_PUBLIC_TCL_HEADERS
    2170 #--------------------------------------------------------------------
    2171 
    2172 case "`uname -s`" in
    2173     *win32* | *WIN32* | *CYGWIN_NT*)
    2174         CYGPATH="cygpath -w"
     4043    if test "${TEA_PLATFORM}" = "unix" ; then
     4044
     4045    #--------------------------------------------------------------------
     4046    # On a few very rare systems, all of the libm.a stuff is
     4047    # already in libc.a.  Set compiler flags accordingly.
     4048    # Also, Linux requires the "ieee" library for math to work
     4049    # right (and it must appear before "-lm").
     4050    #--------------------------------------------------------------------
     4051
     4052    echo "$as_me:$LINENO: checking for sin" >&5
     4053echo $ECHO_N "checking for sin... $ECHO_C" >&6
     4054if test "${ac_cv_func_sin+set}" = set; then
     4055  echo $ECHO_N "(cached) $ECHO_C" >&6
     4056else
     4057  cat >conftest.$ac_ext <<_ACEOF
     4058/* confdefs.h.  */
     4059_ACEOF
     4060cat confdefs.h >>conftest.$ac_ext
     4061cat >>conftest.$ac_ext <<_ACEOF
     4062/* end confdefs.h.  */
     4063/* Define sin to an innocuous variant, in case <limits.h> declares sin.
     4064   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     4065#define sin innocuous_sin
     4066
     4067/* System header to define __stub macros and hopefully few prototypes,
     4068    which can conflict with char sin (); below.
     4069    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     4070    <limits.h> exists even on freestanding compilers.  */
     4071
     4072#ifdef __STDC__
     4073# include <limits.h>
     4074#else
     4075# include <assert.h>
     4076#endif
     4077
     4078#undef sin
     4079
     4080/* Override any gcc2 internal prototype to avoid an error.  */
     4081#ifdef __cplusplus
     4082extern "C"
     4083{
     4084#endif
     4085/* We use char because int might match the return type of a gcc2
     4086   builtin and then its argument prototype would still apply.  */
     4087char sin ();
     4088/* The GNU C library defines this for functions which it implements
     4089    to always fail with ENOSYS.  Some functions are actually named
     4090    something starting with __ and the normal name is an alias.  */
     4091#if defined (__stub_sin) || defined (__stub___sin)
     4092choke me
     4093#else
     4094char (*f) () = sin;
     4095#endif
     4096#ifdef __cplusplus
     4097}
     4098#endif
     4099
     4100int
     4101main ()
     4102{
     4103return f != sin;
     4104  ;
     4105  return 0;
     4106}
     4107_ACEOF
     4108rm -f conftest.$ac_objext conftest$ac_exeext
     4109if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4110  (eval $ac_link) 2>conftest.er1
     4111  ac_status=$?
     4112  grep -v '^ *+' conftest.er1 >conftest.err
     4113  rm -f conftest.er1
     4114  cat conftest.err >&5
     4115  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4116  (exit $ac_status); } &&
     4117         { ac_try='test -z "$ac_c_werror_flag"
     4118                         || test ! -s conftest.err'
     4119  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4120  (eval $ac_try) 2>&5
     4121  ac_status=$?
     4122  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4123  (exit $ac_status); }; } &&
     4124         { ac_try='test -s conftest$ac_exeext'
     4125  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4126  (eval $ac_try) 2>&5
     4127  ac_status=$?
     4128  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4129  (exit $ac_status); }; }; then
     4130  ac_cv_func_sin=yes
     4131else
     4132  echo "$as_me: failed program was:" >&5
     4133sed 's/^/| /' conftest.$ac_ext >&5
     4134
     4135ac_cv_func_sin=no
     4136fi
     4137rm -f conftest.err conftest.$ac_objext \
     4138      conftest$ac_exeext conftest.$ac_ext
     4139fi
     4140echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5
     4141echo "${ECHO_T}$ac_cv_func_sin" >&6
     4142if test $ac_cv_func_sin = yes; then
     4143  MATH_LIBS=""
     4144else
     4145  MATH_LIBS="-lm"
     4146fi
     4147
     4148    echo "$as_me:$LINENO: checking for main in -lieee" >&5
     4149echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6
     4150if test "${ac_cv_lib_ieee_main+set}" = set; then
     4151  echo $ECHO_N "(cached) $ECHO_C" >&6
     4152else
     4153  ac_check_lib_save_LIBS=$LIBS
     4154LIBS="-lieee  $LIBS"
     4155cat >conftest.$ac_ext <<_ACEOF
     4156/* confdefs.h.  */
     4157_ACEOF
     4158cat confdefs.h >>conftest.$ac_ext
     4159cat >>conftest.$ac_ext <<_ACEOF
     4160/* end confdefs.h.  */
     4161
     4162
     4163int
     4164main ()
     4165{
     4166main ();
     4167  ;
     4168  return 0;
     4169}
     4170_ACEOF
     4171rm -f conftest.$ac_objext conftest$ac_exeext
     4172if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4173  (eval $ac_link) 2>conftest.er1
     4174  ac_status=$?
     4175  grep -v '^ *+' conftest.er1 >conftest.err
     4176  rm -f conftest.er1
     4177  cat conftest.err >&5
     4178  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4179  (exit $ac_status); } &&
     4180         { ac_try='test -z "$ac_c_werror_flag"
     4181                         || test ! -s conftest.err'
     4182  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4183  (eval $ac_try) 2>&5
     4184  ac_status=$?
     4185  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4186  (exit $ac_status); }; } &&
     4187         { ac_try='test -s conftest$ac_exeext'
     4188  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4189  (eval $ac_try) 2>&5
     4190  ac_status=$?
     4191  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4192  (exit $ac_status); }; }; then
     4193  ac_cv_lib_ieee_main=yes
     4194else
     4195  echo "$as_me: failed program was:" >&5
     4196sed 's/^/| /' conftest.$ac_ext >&5
     4197
     4198ac_cv_lib_ieee_main=no
     4199fi
     4200rm -f conftest.err conftest.$ac_objext \
     4201      conftest$ac_exeext conftest.$ac_ext
     4202LIBS=$ac_check_lib_save_LIBS
     4203fi
     4204echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5
     4205echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6
     4206if test $ac_cv_lib_ieee_main = yes; then
     4207  MATH_LIBS="-lieee $MATH_LIBS"
     4208fi
     4209
     4210
     4211    #--------------------------------------------------------------------
     4212    # Interactive UNIX requires -linet instead of -lsocket, plus it
     4213    # needs net/errno.h to define the socket-related error codes.
     4214    #--------------------------------------------------------------------
     4215
     4216    echo "$as_me:$LINENO: checking for main in -linet" >&5
     4217echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6
     4218if test "${ac_cv_lib_inet_main+set}" = set; then
     4219  echo $ECHO_N "(cached) $ECHO_C" >&6
     4220else
     4221  ac_check_lib_save_LIBS=$LIBS
     4222LIBS="-linet  $LIBS"
     4223cat >conftest.$ac_ext <<_ACEOF
     4224/* confdefs.h.  */
     4225_ACEOF
     4226cat confdefs.h >>conftest.$ac_ext
     4227cat >>conftest.$ac_ext <<_ACEOF
     4228/* end confdefs.h.  */
     4229
     4230
     4231int
     4232main ()
     4233{
     4234main ();
     4235  ;
     4236  return 0;
     4237}
     4238_ACEOF
     4239rm -f conftest.$ac_objext conftest$ac_exeext
     4240if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4241  (eval $ac_link) 2>conftest.er1
     4242  ac_status=$?
     4243  grep -v '^ *+' conftest.er1 >conftest.err
     4244  rm -f conftest.er1
     4245  cat conftest.err >&5
     4246  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4247  (exit $ac_status); } &&
     4248         { ac_try='test -z "$ac_c_werror_flag"
     4249                         || test ! -s conftest.err'
     4250  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4251  (eval $ac_try) 2>&5
     4252  ac_status=$?
     4253  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4254  (exit $ac_status); }; } &&
     4255         { ac_try='test -s conftest$ac_exeext'
     4256  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4257  (eval $ac_try) 2>&5
     4258  ac_status=$?
     4259  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4260  (exit $ac_status); }; }; then
     4261  ac_cv_lib_inet_main=yes
     4262else
     4263  echo "$as_me: failed program was:" >&5
     4264sed 's/^/| /' conftest.$ac_ext >&5
     4265
     4266ac_cv_lib_inet_main=no
     4267fi
     4268rm -f conftest.err conftest.$ac_objext \
     4269      conftest$ac_exeext conftest.$ac_ext
     4270LIBS=$ac_check_lib_save_LIBS
     4271fi
     4272echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5
     4273echo "${ECHO_T}$ac_cv_lib_inet_main" >&6
     4274if test $ac_cv_lib_inet_main = yes; then
     4275  LIBS="$LIBS -linet"
     4276fi
     4277
     4278    if test "${ac_cv_header_net_errno_h+set}" = set; then
     4279  echo "$as_me:$LINENO: checking for net/errno.h" >&5
     4280echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6
     4281if test "${ac_cv_header_net_errno_h+set}" = set; then
     4282  echo $ECHO_N "(cached) $ECHO_C" >&6
     4283fi
     4284echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
     4285echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6
     4286else
     4287  # Is the header compilable?
     4288echo "$as_me:$LINENO: checking net/errno.h usability" >&5
     4289echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6
     4290cat >conftest.$ac_ext <<_ACEOF
     4291/* confdefs.h.  */
     4292_ACEOF
     4293cat confdefs.h >>conftest.$ac_ext
     4294cat >>conftest.$ac_ext <<_ACEOF
     4295/* end confdefs.h.  */
     4296$ac_includes_default
     4297#include <net/errno.h>
     4298_ACEOF
     4299rm -f conftest.$ac_objext
     4300if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     4301  (eval $ac_compile) 2>conftest.er1
     4302  ac_status=$?
     4303  grep -v '^ *+' conftest.er1 >conftest.err
     4304  rm -f conftest.er1
     4305  cat conftest.err >&5
     4306  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4307  (exit $ac_status); } &&
     4308         { ac_try='test -z "$ac_c_werror_flag"
     4309                         || test ! -s conftest.err'
     4310  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4311  (eval $ac_try) 2>&5
     4312  ac_status=$?
     4313  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4314  (exit $ac_status); }; } &&
     4315         { ac_try='test -s conftest.$ac_objext'
     4316  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4317  (eval $ac_try) 2>&5
     4318  ac_status=$?
     4319  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4320  (exit $ac_status); }; }; then
     4321  ac_header_compiler=yes
     4322else
     4323  echo "$as_me: failed program was:" >&5
     4324sed 's/^/| /' conftest.$ac_ext >&5
     4325
     4326ac_header_compiler=no
     4327fi
     4328rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     4329echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     4330echo "${ECHO_T}$ac_header_compiler" >&6
     4331
     4332# Is the header present?
     4333echo "$as_me:$LINENO: checking net/errno.h presence" >&5
     4334echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6
     4335cat >conftest.$ac_ext <<_ACEOF
     4336/* confdefs.h.  */
     4337_ACEOF
     4338cat confdefs.h >>conftest.$ac_ext
     4339cat >>conftest.$ac_ext <<_ACEOF
     4340/* end confdefs.h.  */
     4341#include <net/errno.h>
     4342_ACEOF
     4343if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     4344  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     4345  ac_status=$?
     4346  grep -v '^ *+' conftest.er1 >conftest.err
     4347  rm -f conftest.er1
     4348  cat conftest.err >&5
     4349  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4350  (exit $ac_status); } >/dev/null; then
     4351  if test -s conftest.err; then
     4352    ac_cpp_err=$ac_c_preproc_warn_flag
     4353    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     4354  else
     4355    ac_cpp_err=
     4356  fi
     4357else
     4358  ac_cpp_err=yes
     4359fi
     4360if test -z "$ac_cpp_err"; then
     4361  ac_header_preproc=yes
     4362else
     4363  echo "$as_me: failed program was:" >&5
     4364sed 's/^/| /' conftest.$ac_ext >&5
     4365
     4366  ac_header_preproc=no
     4367fi
     4368rm -f conftest.err conftest.$ac_ext
     4369echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     4370echo "${ECHO_T}$ac_header_preproc" >&6
     4371
     4372# So?  What about this header?
     4373case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     4374  yes:no: )
     4375    { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
     4376echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     4377    { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5
     4378echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;}
     4379    ac_header_preproc=yes
    21754380    ;;
    2176     *)
    2177         CYGPATH=echo
     4381  no:yes:* )
     4382    { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5
     4383echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;}
     4384    { echo "$as_me:$LINENO: WARNING: net/errno.h:     check for missing prerequisite headers?" >&5
     4385echo "$as_me: WARNING: net/errno.h:     check for missing prerequisite headers?" >&2;}
     4386    { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5
     4387echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;}
     4388    { echo "$as_me:$LINENO: WARNING: net/errno.h:     section \"Present But Cannot Be Compiled\"" >&5
     4389echo "$as_me: WARNING: net/errno.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     4390    { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5
     4391echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;}
     4392    { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5
     4393echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;}
     4394    (
     4395      cat <<\_ASBOX
     4396## ----------------------------------- ##
     4397## Report this to the Rappture lists.  ##
     4398## ----------------------------------- ##
     4399_ASBOX
     4400    ) |
     4401      sed "s/^/$as_me: WARNING:     /" >&2
    21784402    ;;
    21794403esac
    2180 
     4404echo "$as_me:$LINENO: checking for net/errno.h" >&5
     4405echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6
     4406if test "${ac_cv_header_net_errno_h+set}" = set; then
     4407  echo $ECHO_N "(cached) $ECHO_C" >&6
     4408else
     4409  ac_cv_header_net_errno_h=$ac_header_preproc
     4410fi
     4411echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
     4412echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6
     4413
     4414fi
     4415if test $ac_cv_header_net_errno_h = yes; then
     4416
     4417
     4418cat >>confdefs.h <<\_ACEOF
     4419#define HAVE_NET_ERRNO_H 1
     4420_ACEOF
     4421
     4422fi
     4423
     4424
     4425
     4426    #--------------------------------------------------------------------
     4427    #   Check for the existence of the -lsocket and -lnsl libraries.
     4428    #   The order here is important, so that they end up in the right
     4429    #   order in the command line generated by make.  Here are some
     4430    #   special considerations:
     4431    #   1. Use "connect" and "accept" to check for -lsocket, and
     4432    #      "gethostbyname" to check for -lnsl.
     4433    #   2. Use each function name only once:  can't redo a check because
     4434    #      autoconf caches the results of the last check and won't redo it.
     4435    #   3. Use -lnsl and -lsocket only if they supply procedures that
     4436    #      aren't already present in the normal libraries.  This is because
     4437    #      IRIX 5.2 has libraries, but they aren't needed and they're
     4438    #      bogus:  they goof up name resolution if used.
     4439    #   4. On some SVR4 systems, can't use -lsocket without -lnsl too.
     4440    #      To get around this problem, check for both libraries together
     4441    #      if -lsocket doesn't work by itself.
     4442    #--------------------------------------------------------------------
     4443
     4444    tcl_checkBoth=0
     4445    echo "$as_me:$LINENO: checking for connect" >&5
     4446echo $ECHO_N "checking for connect... $ECHO_C" >&6
     4447if test "${ac_cv_func_connect+set}" = set; then
     4448  echo $ECHO_N "(cached) $ECHO_C" >&6
     4449else
     4450  cat >conftest.$ac_ext <<_ACEOF
     4451/* confdefs.h.  */
     4452_ACEOF
     4453cat confdefs.h >>conftest.$ac_ext
     4454cat >>conftest.$ac_ext <<_ACEOF
     4455/* end confdefs.h.  */
     4456/* Define connect to an innocuous variant, in case <limits.h> declares connect.
     4457   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     4458#define connect innocuous_connect
     4459
     4460/* System header to define __stub macros and hopefully few prototypes,
     4461    which can conflict with char connect (); below.
     4462    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     4463    <limits.h> exists even on freestanding compilers.  */
     4464
     4465#ifdef __STDC__
     4466# include <limits.h>
     4467#else
     4468# include <assert.h>
     4469#endif
     4470
     4471#undef connect
     4472
     4473/* Override any gcc2 internal prototype to avoid an error.  */
     4474#ifdef __cplusplus
     4475extern "C"
     4476{
     4477#endif
     4478/* We use char because int might match the return type of a gcc2
     4479   builtin and then its argument prototype would still apply.  */
     4480char connect ();
     4481/* The GNU C library defines this for functions which it implements
     4482    to always fail with ENOSYS.  Some functions are actually named
     4483    something starting with __ and the normal name is an alias.  */
     4484#if defined (__stub_connect) || defined (__stub___connect)
     4485choke me
     4486#else
     4487char (*f) () = connect;
     4488#endif
     4489#ifdef __cplusplus
     4490}
     4491#endif
     4492
     4493int
     4494main ()
     4495{
     4496return f != connect;
     4497  ;
     4498  return 0;
     4499}
     4500_ACEOF
     4501rm -f conftest.$ac_objext conftest$ac_exeext
     4502if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4503  (eval $ac_link) 2>conftest.er1
     4504  ac_status=$?
     4505  grep -v '^ *+' conftest.er1 >conftest.err
     4506  rm -f conftest.er1
     4507  cat conftest.err >&5
     4508  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4509  (exit $ac_status); } &&
     4510         { ac_try='test -z "$ac_c_werror_flag"
     4511                         || test ! -s conftest.err'
     4512  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4513  (eval $ac_try) 2>&5
     4514  ac_status=$?
     4515  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4516  (exit $ac_status); }; } &&
     4517         { ac_try='test -s conftest$ac_exeext'
     4518  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4519  (eval $ac_try) 2>&5
     4520  ac_status=$?
     4521  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4522  (exit $ac_status); }; }; then
     4523  ac_cv_func_connect=yes
     4524else
     4525  echo "$as_me: failed program was:" >&5
     4526sed 's/^/| /' conftest.$ac_ext >&5
     4527
     4528ac_cv_func_connect=no
     4529fi
     4530rm -f conftest.err conftest.$ac_objext \
     4531      conftest$ac_exeext conftest.$ac_ext
     4532fi
     4533echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
     4534echo "${ECHO_T}$ac_cv_func_connect" >&6
     4535if test $ac_cv_func_connect = yes; then
     4536  tcl_checkSocket=0
     4537else
     4538  tcl_checkSocket=1
     4539fi
     4540
     4541    if test "$tcl_checkSocket" = 1; then
     4542        echo "$as_me:$LINENO: checking for setsockopt" >&5
     4543echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6
     4544if test "${ac_cv_func_setsockopt+set}" = set; then
     4545  echo $ECHO_N "(cached) $ECHO_C" >&6
     4546else
     4547  cat >conftest.$ac_ext <<_ACEOF
     4548/* confdefs.h.  */
     4549_ACEOF
     4550cat confdefs.h >>conftest.$ac_ext
     4551cat >>conftest.$ac_ext <<_ACEOF
     4552/* end confdefs.h.  */
     4553/* Define setsockopt to an innocuous variant, in case <limits.h> declares setsockopt.
     4554   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     4555#define setsockopt innocuous_setsockopt
     4556
     4557/* System header to define __stub macros and hopefully few prototypes,
     4558    which can conflict with char setsockopt (); below.
     4559    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     4560    <limits.h> exists even on freestanding compilers.  */
     4561
     4562#ifdef __STDC__
     4563# include <limits.h>
     4564#else
     4565# include <assert.h>
     4566#endif
     4567
     4568#undef setsockopt
     4569
     4570/* Override any gcc2 internal prototype to avoid an error.  */
     4571#ifdef __cplusplus
     4572extern "C"
     4573{
     4574#endif
     4575/* We use char because int might match the return type of a gcc2
     4576   builtin and then its argument prototype would still apply.  */
     4577char setsockopt ();
     4578/* The GNU C library defines this for functions which it implements
     4579    to always fail with ENOSYS.  Some functions are actually named
     4580    something starting with __ and the normal name is an alias.  */
     4581#if defined (__stub_setsockopt) || defined (__stub___setsockopt)
     4582choke me
     4583#else
     4584char (*f) () = setsockopt;
     4585#endif
     4586#ifdef __cplusplus
     4587}
     4588#endif
     4589
     4590int
     4591main ()
     4592{
     4593return f != setsockopt;
     4594  ;
     4595  return 0;
     4596}
     4597_ACEOF
     4598rm -f conftest.$ac_objext conftest$ac_exeext
     4599if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4600  (eval $ac_link) 2>conftest.er1
     4601  ac_status=$?
     4602  grep -v '^ *+' conftest.er1 >conftest.err
     4603  rm -f conftest.er1
     4604  cat conftest.err >&5
     4605  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4606  (exit $ac_status); } &&
     4607         { ac_try='test -z "$ac_c_werror_flag"
     4608                         || test ! -s conftest.err'
     4609  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4610  (eval $ac_try) 2>&5
     4611  ac_status=$?
     4612  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4613  (exit $ac_status); }; } &&
     4614         { ac_try='test -s conftest$ac_exeext'
     4615  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4616  (eval $ac_try) 2>&5
     4617  ac_status=$?
     4618  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4619  (exit $ac_status); }; }; then
     4620  ac_cv_func_setsockopt=yes
     4621else
     4622  echo "$as_me: failed program was:" >&5
     4623sed 's/^/| /' conftest.$ac_ext >&5
     4624
     4625ac_cv_func_setsockopt=no
     4626fi
     4627rm -f conftest.err conftest.$ac_objext \
     4628      conftest$ac_exeext conftest.$ac_ext
     4629fi
     4630echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5
     4631echo "${ECHO_T}$ac_cv_func_setsockopt" >&6
     4632if test $ac_cv_func_setsockopt = yes; then
     4633  :
     4634else
     4635  echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5
     4636echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6
     4637if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
     4638  echo $ECHO_N "(cached) $ECHO_C" >&6
     4639else
     4640  ac_check_lib_save_LIBS=$LIBS
     4641LIBS="-lsocket  $LIBS"
     4642cat >conftest.$ac_ext <<_ACEOF
     4643/* confdefs.h.  */
     4644_ACEOF
     4645cat confdefs.h >>conftest.$ac_ext
     4646cat >>conftest.$ac_ext <<_ACEOF
     4647/* end confdefs.h.  */
     4648
     4649/* Override any gcc2 internal prototype to avoid an error.  */
     4650#ifdef __cplusplus
     4651extern "C"
     4652#endif
     4653/* We use char because int might match the return type of a gcc2
     4654   builtin and then its argument prototype would still apply.  */
     4655char setsockopt ();
     4656int
     4657main ()
     4658{
     4659setsockopt ();
     4660  ;
     4661  return 0;
     4662}
     4663_ACEOF
     4664rm -f conftest.$ac_objext conftest$ac_exeext
     4665if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4666  (eval $ac_link) 2>conftest.er1
     4667  ac_status=$?
     4668  grep -v '^ *+' conftest.er1 >conftest.err
     4669  rm -f conftest.er1
     4670  cat conftest.err >&5
     4671  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4672  (exit $ac_status); } &&
     4673         { ac_try='test -z "$ac_c_werror_flag"
     4674                         || test ! -s conftest.err'
     4675  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4676  (eval $ac_try) 2>&5
     4677  ac_status=$?
     4678  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4679  (exit $ac_status); }; } &&
     4680         { ac_try='test -s conftest$ac_exeext'
     4681  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4682  (eval $ac_try) 2>&5
     4683  ac_status=$?
     4684  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4685  (exit $ac_status); }; }; then
     4686  ac_cv_lib_socket_setsockopt=yes
     4687else
     4688  echo "$as_me: failed program was:" >&5
     4689sed 's/^/| /' conftest.$ac_ext >&5
     4690
     4691ac_cv_lib_socket_setsockopt=no
     4692fi
     4693rm -f conftest.err conftest.$ac_objext \
     4694      conftest$ac_exeext conftest.$ac_ext
     4695LIBS=$ac_check_lib_save_LIBS
     4696fi
     4697echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5
     4698echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6
     4699if test $ac_cv_lib_socket_setsockopt = yes; then
     4700  LIBS="$LIBS -lsocket"
     4701else
     4702  tcl_checkBoth=1
     4703fi
     4704
     4705fi
     4706
     4707    fi
     4708    if test "$tcl_checkBoth" = 1; then
     4709        tk_oldLibs=$LIBS
     4710        LIBS="$LIBS -lsocket -lnsl"
     4711        echo "$as_me:$LINENO: checking for accept" >&5
     4712echo $ECHO_N "checking for accept... $ECHO_C" >&6
     4713if test "${ac_cv_func_accept+set}" = set; then
     4714  echo $ECHO_N "(cached) $ECHO_C" >&6
     4715else
     4716  cat >conftest.$ac_ext <<_ACEOF
     4717/* confdefs.h.  */
     4718_ACEOF
     4719cat confdefs.h >>conftest.$ac_ext
     4720cat >>conftest.$ac_ext <<_ACEOF
     4721/* end confdefs.h.  */
     4722/* Define accept to an innocuous variant, in case <limits.h> declares accept.
     4723   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     4724#define accept innocuous_accept
     4725
     4726/* System header to define __stub macros and hopefully few prototypes,
     4727    which can conflict with char accept (); below.
     4728    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     4729    <limits.h> exists even on freestanding compilers.  */
     4730
     4731#ifdef __STDC__
     4732# include <limits.h>
     4733#else
     4734# include <assert.h>
     4735#endif
     4736
     4737#undef accept
     4738
     4739/* Override any gcc2 internal prototype to avoid an error.  */
     4740#ifdef __cplusplus
     4741extern "C"
     4742{
     4743#endif
     4744/* We use char because int might match the return type of a gcc2
     4745   builtin and then its argument prototype would still apply.  */
     4746char accept ();
     4747/* The GNU C library defines this for functions which it implements
     4748    to always fail with ENOSYS.  Some functions are actually named
     4749    something starting with __ and the normal name is an alias.  */
     4750#if defined (__stub_accept) || defined (__stub___accept)
     4751choke me
     4752#else
     4753char (*f) () = accept;
     4754#endif
     4755#ifdef __cplusplus
     4756}
     4757#endif
     4758
     4759int
     4760main ()
     4761{
     4762return f != accept;
     4763  ;
     4764  return 0;
     4765}
     4766_ACEOF
     4767rm -f conftest.$ac_objext conftest$ac_exeext
     4768if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4769  (eval $ac_link) 2>conftest.er1
     4770  ac_status=$?
     4771  grep -v '^ *+' conftest.er1 >conftest.err
     4772  rm -f conftest.er1
     4773  cat conftest.err >&5
     4774  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4775  (exit $ac_status); } &&
     4776         { ac_try='test -z "$ac_c_werror_flag"
     4777                         || test ! -s conftest.err'
     4778  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4779  (eval $ac_try) 2>&5
     4780  ac_status=$?
     4781  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4782  (exit $ac_status); }; } &&
     4783         { ac_try='test -s conftest$ac_exeext'
     4784  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4785  (eval $ac_try) 2>&5
     4786  ac_status=$?
     4787  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4788  (exit $ac_status); }; }; then
     4789  ac_cv_func_accept=yes
     4790else
     4791  echo "$as_me: failed program was:" >&5
     4792sed 's/^/| /' conftest.$ac_ext >&5
     4793
     4794ac_cv_func_accept=no
     4795fi
     4796rm -f conftest.err conftest.$ac_objext \
     4797      conftest$ac_exeext conftest.$ac_ext
     4798fi
     4799echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5
     4800echo "${ECHO_T}$ac_cv_func_accept" >&6
     4801if test $ac_cv_func_accept = yes; then
     4802  tcl_checkNsl=0
     4803else
     4804  LIBS=$tk_oldLibs
     4805fi
     4806
     4807    fi
     4808    echo "$as_me:$LINENO: checking for gethostbyname" >&5
     4809echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
     4810if test "${ac_cv_func_gethostbyname+set}" = set; then
     4811  echo $ECHO_N "(cached) $ECHO_C" >&6
     4812else
     4813  cat >conftest.$ac_ext <<_ACEOF
     4814/* confdefs.h.  */
     4815_ACEOF
     4816cat confdefs.h >>conftest.$ac_ext
     4817cat >>conftest.$ac_ext <<_ACEOF
     4818/* end confdefs.h.  */
     4819/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
     4820   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     4821#define gethostbyname innocuous_gethostbyname
     4822
     4823/* System header to define __stub macros and hopefully few prototypes,
     4824    which can conflict with char gethostbyname (); below.
     4825    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     4826    <limits.h> exists even on freestanding compilers.  */
     4827
     4828#ifdef __STDC__
     4829# include <limits.h>
     4830#else
     4831# include <assert.h>
     4832#endif
     4833
     4834#undef gethostbyname
     4835
     4836/* Override any gcc2 internal prototype to avoid an error.  */
     4837#ifdef __cplusplus
     4838extern "C"
     4839{
     4840#endif
     4841/* We use char because int might match the return type of a gcc2
     4842   builtin and then its argument prototype would still apply.  */
     4843char gethostbyname ();
     4844/* The GNU C library defines this for functions which it implements
     4845    to always fail with ENOSYS.  Some functions are actually named
     4846    something starting with __ and the normal name is an alias.  */
     4847#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
     4848choke me
     4849#else
     4850char (*f) () = gethostbyname;
     4851#endif
     4852#ifdef __cplusplus
     4853}
     4854#endif
     4855
     4856int
     4857main ()
     4858{
     4859return f != gethostbyname;
     4860  ;
     4861  return 0;
     4862}
     4863_ACEOF
     4864rm -f conftest.$ac_objext conftest$ac_exeext
     4865if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4866  (eval $ac_link) 2>conftest.er1
     4867  ac_status=$?
     4868  grep -v '^ *+' conftest.er1 >conftest.err
     4869  rm -f conftest.er1
     4870  cat conftest.err >&5
     4871  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4872  (exit $ac_status); } &&
     4873         { ac_try='test -z "$ac_c_werror_flag"
     4874                         || test ! -s conftest.err'
     4875  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4876  (eval $ac_try) 2>&5
     4877  ac_status=$?
     4878  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4879  (exit $ac_status); }; } &&
     4880         { ac_try='test -s conftest$ac_exeext'
     4881  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4882  (eval $ac_try) 2>&5
     4883  ac_status=$?
     4884  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4885  (exit $ac_status); }; }; then
     4886  ac_cv_func_gethostbyname=yes
     4887else
     4888  echo "$as_me: failed program was:" >&5
     4889sed 's/^/| /' conftest.$ac_ext >&5
     4890
     4891ac_cv_func_gethostbyname=no
     4892fi
     4893rm -f conftest.err conftest.$ac_objext \
     4894      conftest$ac_exeext conftest.$ac_ext
     4895fi
     4896echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
     4897echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
     4898if test $ac_cv_func_gethostbyname = yes; then
     4899  :
     4900else
     4901  echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
     4902echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
     4903if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
     4904  echo $ECHO_N "(cached) $ECHO_C" >&6
     4905else
     4906  ac_check_lib_save_LIBS=$LIBS
     4907LIBS="-lnsl  $LIBS"
     4908cat >conftest.$ac_ext <<_ACEOF
     4909/* confdefs.h.  */
     4910_ACEOF
     4911cat confdefs.h >>conftest.$ac_ext
     4912cat >>conftest.$ac_ext <<_ACEOF
     4913/* end confdefs.h.  */
     4914
     4915/* Override any gcc2 internal prototype to avoid an error.  */
     4916#ifdef __cplusplus
     4917extern "C"
     4918#endif
     4919/* We use char because int might match the return type of a gcc2
     4920   builtin and then its argument prototype would still apply.  */
     4921char gethostbyname ();
     4922int
     4923main ()
     4924{
     4925gethostbyname ();
     4926  ;
     4927  return 0;
     4928}
     4929_ACEOF
     4930rm -f conftest.$ac_objext conftest$ac_exeext
     4931if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4932  (eval $ac_link) 2>conftest.er1
     4933  ac_status=$?
     4934  grep -v '^ *+' conftest.er1 >conftest.err
     4935  rm -f conftest.er1
     4936  cat conftest.err >&5
     4937  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4938  (exit $ac_status); } &&
     4939         { ac_try='test -z "$ac_c_werror_flag"
     4940                         || test ! -s conftest.err'
     4941  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4942  (eval $ac_try) 2>&5
     4943  ac_status=$?
     4944  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4945  (exit $ac_status); }; } &&
     4946         { ac_try='test -s conftest$ac_exeext'
     4947  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4948  (eval $ac_try) 2>&5
     4949  ac_status=$?
     4950  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4951  (exit $ac_status); }; }; then
     4952  ac_cv_lib_nsl_gethostbyname=yes
     4953else
     4954  echo "$as_me: failed program was:" >&5
     4955sed 's/^/| /' conftest.$ac_ext >&5
     4956
     4957ac_cv_lib_nsl_gethostbyname=no
     4958fi
     4959rm -f conftest.err conftest.$ac_objext \
     4960      conftest$ac_exeext conftest.$ac_ext
     4961LIBS=$ac_check_lib_save_LIBS
     4962fi
     4963echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
     4964echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
     4965if test $ac_cv_lib_nsl_gethostbyname = yes; then
     4966  LIBS="$LIBS -lnsl"
     4967fi
     4968
     4969fi
     4970
     4971
     4972    # Don't perform the eval of the libraries here because DL_LIBS
     4973    # won't be set until we call TEA_CONFIG_CFLAGS
     4974
     4975    TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
     4976
     4977
     4978
     4979
     4980    echo "$as_me:$LINENO: checking dirent.h" >&5
     4981echo $ECHO_N "checking dirent.h... $ECHO_C" >&6
     4982if test "${tcl_cv_dirent_h+set}" = set; then
     4983  echo $ECHO_N "(cached) $ECHO_C" >&6
     4984else
     4985  cat >conftest.$ac_ext <<_ACEOF
     4986/* confdefs.h.  */
     4987_ACEOF
     4988cat confdefs.h >>conftest.$ac_ext
     4989cat >>conftest.$ac_ext <<_ACEOF
     4990/* end confdefs.h.  */
     4991#include <sys/types.h>
     4992#include <dirent.h>
     4993int
     4994main ()
     4995{
     4996
     4997#ifndef _POSIX_SOURCE
     4998#   ifdef __Lynx__
     4999        /*
     5000         * Generate compilation error to make the test fail:  Lynx headers
     5001         * are only valid if really in the POSIX environment.
     5002         */
     5003
     5004        missing_procedure();
     5005#   endif
     5006#endif
     5007DIR *d;
     5008struct dirent *entryPtr;
     5009char *p;
     5010d = opendir("foobar");
     5011entryPtr = readdir(d);
     5012p = entryPtr->d_name;
     5013closedir(d);
     5014
     5015  ;
     5016  return 0;
     5017}
     5018_ACEOF
     5019rm -f conftest.$ac_objext conftest$ac_exeext
     5020if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     5021  (eval $ac_link) 2>conftest.er1
     5022  ac_status=$?
     5023  grep -v '^ *+' conftest.er1 >conftest.err
     5024  rm -f conftest.er1
     5025  cat conftest.err >&5
     5026  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5027  (exit $ac_status); } &&
     5028         { ac_try='test -z "$ac_c_werror_flag"
     5029                         || test ! -s conftest.err'
     5030  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5031  (eval $ac_try) 2>&5
     5032  ac_status=$?
     5033  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5034  (exit $ac_status); }; } &&
     5035         { ac_try='test -s conftest$ac_exeext'
     5036  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5037  (eval $ac_try) 2>&5
     5038  ac_status=$?
     5039  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5040  (exit $ac_status); }; }; then
     5041  tcl_cv_dirent_h=yes
     5042else
     5043  echo "$as_me: failed program was:" >&5
     5044sed 's/^/| /' conftest.$ac_ext >&5
     5045
     5046tcl_cv_dirent_h=no
     5047fi
     5048rm -f conftest.err conftest.$ac_objext \
     5049      conftest$ac_exeext conftest.$ac_ext
     5050fi
     5051echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5
     5052echo "${ECHO_T}$tcl_cv_dirent_h" >&6
     5053
     5054    if test $tcl_cv_dirent_h = no; then
     5055
     5056cat >>confdefs.h <<\_ACEOF
     5057#define NO_DIRENT_H 1
     5058_ACEOF
     5059
     5060    fi
     5061
     5062    if test "${ac_cv_header_errno_h+set}" = set; then
     5063  echo "$as_me:$LINENO: checking for errno.h" >&5
     5064echo $ECHO_N "checking for errno.h... $ECHO_C" >&6
     5065if test "${ac_cv_header_errno_h+set}" = set; then
     5066  echo $ECHO_N "(cached) $ECHO_C" >&6
     5067fi
     5068echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
     5069echo "${ECHO_T}$ac_cv_header_errno_h" >&6
     5070else
     5071  # Is the header compilable?
     5072echo "$as_me:$LINENO: checking errno.h usability" >&5
     5073echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6
     5074cat >conftest.$ac_ext <<_ACEOF
     5075/* confdefs.h.  */
     5076_ACEOF
     5077cat confdefs.h >>conftest.$ac_ext
     5078cat >>conftest.$ac_ext <<_ACEOF
     5079/* end confdefs.h.  */
     5080$ac_includes_default
     5081#include <errno.h>
     5082_ACEOF
     5083rm -f conftest.$ac_objext
     5084if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5085  (eval $ac_compile) 2>conftest.er1
     5086  ac_status=$?
     5087  grep -v '^ *+' conftest.er1 >conftest.err
     5088  rm -f conftest.er1
     5089  cat conftest.err >&5
     5090  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5091  (exit $ac_status); } &&
     5092         { ac_try='test -z "$ac_c_werror_flag"
     5093                         || test ! -s conftest.err'
     5094  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5095  (eval $ac_try) 2>&5
     5096  ac_status=$?
     5097  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5098  (exit $ac_status); }; } &&
     5099         { ac_try='test -s conftest.$ac_objext'
     5100  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5101  (eval $ac_try) 2>&5
     5102  ac_status=$?
     5103  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5104  (exit $ac_status); }; }; then
     5105  ac_header_compiler=yes
     5106else
     5107  echo "$as_me: failed program was:" >&5
     5108sed 's/^/| /' conftest.$ac_ext >&5
     5109
     5110ac_header_compiler=no
     5111fi
     5112rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5113echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5114echo "${ECHO_T}$ac_header_compiler" >&6
     5115
     5116# Is the header present?
     5117echo "$as_me:$LINENO: checking errno.h presence" >&5
     5118echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6
     5119cat >conftest.$ac_ext <<_ACEOF
     5120/* confdefs.h.  */
     5121_ACEOF
     5122cat confdefs.h >>conftest.$ac_ext
     5123cat >>conftest.$ac_ext <<_ACEOF
     5124/* end confdefs.h.  */
     5125#include <errno.h>
     5126_ACEOF
     5127if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5128  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5129  ac_status=$?
     5130  grep -v '^ *+' conftest.er1 >conftest.err
     5131  rm -f conftest.er1
     5132  cat conftest.err >&5
     5133  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5134  (exit $ac_status); } >/dev/null; then
     5135  if test -s conftest.err; then
     5136    ac_cpp_err=$ac_c_preproc_warn_flag
     5137    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5138  else
     5139    ac_cpp_err=
     5140  fi
     5141else
     5142  ac_cpp_err=yes
     5143fi
     5144if test -z "$ac_cpp_err"; then
     5145  ac_header_preproc=yes
     5146else
     5147  echo "$as_me: failed program was:" >&5
     5148sed 's/^/| /' conftest.$ac_ext >&5
     5149
     5150  ac_header_preproc=no
     5151fi
     5152rm -f conftest.err conftest.$ac_ext
     5153echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5154echo "${ECHO_T}$ac_header_preproc" >&6
     5155
     5156# So?  What about this header?
     5157case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5158  yes:no: )
     5159    { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5160echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5161    { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5
     5162echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;}
     5163    ac_header_preproc=yes
     5164    ;;
     5165  no:yes:* )
     5166    { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5
     5167echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;}
     5168    { echo "$as_me:$LINENO: WARNING: errno.h:     check for missing prerequisite headers?" >&5
     5169echo "$as_me: WARNING: errno.h:     check for missing prerequisite headers?" >&2;}
     5170    { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5
     5171echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;}
     5172    { echo "$as_me:$LINENO: WARNING: errno.h:     section \"Present But Cannot Be Compiled\"" >&5
     5173echo "$as_me: WARNING: errno.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5174    { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
     5175echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
     5176    { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5
     5177echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;}
     5178    (
     5179      cat <<\_ASBOX
     5180## ----------------------------------- ##
     5181## Report this to the Rappture lists.  ##
     5182## ----------------------------------- ##
     5183_ASBOX
     5184    ) |
     5185      sed "s/^/$as_me: WARNING:     /" >&2
     5186    ;;
     5187esac
     5188echo "$as_me:$LINENO: checking for errno.h" >&5
     5189echo $ECHO_N "checking for errno.h... $ECHO_C" >&6
     5190if test "${ac_cv_header_errno_h+set}" = set; then
     5191  echo $ECHO_N "(cached) $ECHO_C" >&6
     5192else
     5193  ac_cv_header_errno_h=$ac_header_preproc
     5194fi
     5195echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
     5196echo "${ECHO_T}$ac_cv_header_errno_h" >&6
     5197
     5198fi
     5199if test $ac_cv_header_errno_h = yes; then
     5200  :
     5201else
     5202
     5203cat >>confdefs.h <<\_ACEOF
     5204#define NO_ERRNO_H 1
     5205_ACEOF
     5206
     5207fi
     5208
     5209
     5210    if test "${ac_cv_header_float_h+set}" = set; then
     5211  echo "$as_me:$LINENO: checking for float.h" >&5
     5212echo $ECHO_N "checking for float.h... $ECHO_C" >&6
     5213if test "${ac_cv_header_float_h+set}" = set; then
     5214  echo $ECHO_N "(cached) $ECHO_C" >&6
     5215fi
     5216echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
     5217echo "${ECHO_T}$ac_cv_header_float_h" >&6
     5218else
     5219  # Is the header compilable?
     5220echo "$as_me:$LINENO: checking float.h usability" >&5
     5221echo $ECHO_N "checking float.h usability... $ECHO_C" >&6
     5222cat >conftest.$ac_ext <<_ACEOF
     5223/* confdefs.h.  */
     5224_ACEOF
     5225cat confdefs.h >>conftest.$ac_ext
     5226cat >>conftest.$ac_ext <<_ACEOF
     5227/* end confdefs.h.  */
     5228$ac_includes_default
     5229#include <float.h>
     5230_ACEOF
     5231rm -f conftest.$ac_objext
     5232if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5233  (eval $ac_compile) 2>conftest.er1
     5234  ac_status=$?
     5235  grep -v '^ *+' conftest.er1 >conftest.err
     5236  rm -f conftest.er1
     5237  cat conftest.err >&5
     5238  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5239  (exit $ac_status); } &&
     5240         { ac_try='test -z "$ac_c_werror_flag"
     5241                         || test ! -s conftest.err'
     5242  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5243  (eval $ac_try) 2>&5
     5244  ac_status=$?
     5245  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5246  (exit $ac_status); }; } &&
     5247         { ac_try='test -s conftest.$ac_objext'
     5248  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5249  (eval $ac_try) 2>&5
     5250  ac_status=$?
     5251  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5252  (exit $ac_status); }; }; then
     5253  ac_header_compiler=yes
     5254else
     5255  echo "$as_me: failed program was:" >&5
     5256sed 's/^/| /' conftest.$ac_ext >&5
     5257
     5258ac_header_compiler=no
     5259fi
     5260rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5261echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5262echo "${ECHO_T}$ac_header_compiler" >&6
     5263
     5264# Is the header present?
     5265echo "$as_me:$LINENO: checking float.h presence" >&5
     5266echo $ECHO_N "checking float.h presence... $ECHO_C" >&6
     5267cat >conftest.$ac_ext <<_ACEOF
     5268/* confdefs.h.  */
     5269_ACEOF
     5270cat confdefs.h >>conftest.$ac_ext
     5271cat >>conftest.$ac_ext <<_ACEOF
     5272/* end confdefs.h.  */
     5273#include <float.h>
     5274_ACEOF
     5275if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5276  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5277  ac_status=$?
     5278  grep -v '^ *+' conftest.er1 >conftest.err
     5279  rm -f conftest.er1
     5280  cat conftest.err >&5
     5281  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5282  (exit $ac_status); } >/dev/null; then
     5283  if test -s conftest.err; then
     5284    ac_cpp_err=$ac_c_preproc_warn_flag
     5285    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5286  else
     5287    ac_cpp_err=
     5288  fi
     5289else
     5290  ac_cpp_err=yes
     5291fi
     5292if test -z "$ac_cpp_err"; then
     5293  ac_header_preproc=yes
     5294else
     5295  echo "$as_me: failed program was:" >&5
     5296sed 's/^/| /' conftest.$ac_ext >&5
     5297
     5298  ac_header_preproc=no
     5299fi
     5300rm -f conftest.err conftest.$ac_ext
     5301echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5302echo "${ECHO_T}$ac_header_preproc" >&6
     5303
     5304# So?  What about this header?
     5305case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5306  yes:no: )
     5307    { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5308echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5309    { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5
     5310echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;}
     5311    ac_header_preproc=yes
     5312    ;;
     5313  no:yes:* )
     5314    { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5
     5315echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;}
     5316    { echo "$as_me:$LINENO: WARNING: float.h:     check for missing prerequisite headers?" >&5
     5317echo "$as_me: WARNING: float.h:     check for missing prerequisite headers?" >&2;}
     5318    { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5
     5319echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;}
     5320    { echo "$as_me:$LINENO: WARNING: float.h:     section \"Present But Cannot Be Compiled\"" >&5
     5321echo "$as_me: WARNING: float.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5322    { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5
     5323echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;}
     5324    { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5
     5325echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;}
     5326    (
     5327      cat <<\_ASBOX
     5328## ----------------------------------- ##
     5329## Report this to the Rappture lists.  ##
     5330## ----------------------------------- ##
     5331_ASBOX
     5332    ) |
     5333      sed "s/^/$as_me: WARNING:     /" >&2
     5334    ;;
     5335esac
     5336echo "$as_me:$LINENO: checking for float.h" >&5
     5337echo $ECHO_N "checking for float.h... $ECHO_C" >&6
     5338if test "${ac_cv_header_float_h+set}" = set; then
     5339  echo $ECHO_N "(cached) $ECHO_C" >&6
     5340else
     5341  ac_cv_header_float_h=$ac_header_preproc
     5342fi
     5343echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
     5344echo "${ECHO_T}$ac_cv_header_float_h" >&6
     5345
     5346fi
     5347if test $ac_cv_header_float_h = yes; then
     5348  :
     5349else
     5350
     5351cat >>confdefs.h <<\_ACEOF
     5352#define NO_FLOAT_H 1
     5353_ACEOF
     5354
     5355fi
     5356
     5357
     5358    if test "${ac_cv_header_values_h+set}" = set; then
     5359  echo "$as_me:$LINENO: checking for values.h" >&5
     5360echo $ECHO_N "checking for values.h... $ECHO_C" >&6
     5361if test "${ac_cv_header_values_h+set}" = set; then
     5362  echo $ECHO_N "(cached) $ECHO_C" >&6
     5363fi
     5364echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
     5365echo "${ECHO_T}$ac_cv_header_values_h" >&6
     5366else
     5367  # Is the header compilable?
     5368echo "$as_me:$LINENO: checking values.h usability" >&5
     5369echo $ECHO_N "checking values.h usability... $ECHO_C" >&6
     5370cat >conftest.$ac_ext <<_ACEOF
     5371/* confdefs.h.  */
     5372_ACEOF
     5373cat confdefs.h >>conftest.$ac_ext
     5374cat >>conftest.$ac_ext <<_ACEOF
     5375/* end confdefs.h.  */
     5376$ac_includes_default
     5377#include <values.h>
     5378_ACEOF
     5379rm -f conftest.$ac_objext
     5380if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5381  (eval $ac_compile) 2>conftest.er1
     5382  ac_status=$?
     5383  grep -v '^ *+' conftest.er1 >conftest.err
     5384  rm -f conftest.er1
     5385  cat conftest.err >&5
     5386  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5387  (exit $ac_status); } &&
     5388         { ac_try='test -z "$ac_c_werror_flag"
     5389                         || test ! -s conftest.err'
     5390  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5391  (eval $ac_try) 2>&5
     5392  ac_status=$?
     5393  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5394  (exit $ac_status); }; } &&
     5395         { ac_try='test -s conftest.$ac_objext'
     5396  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5397  (eval $ac_try) 2>&5
     5398  ac_status=$?
     5399  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5400  (exit $ac_status); }; }; then
     5401  ac_header_compiler=yes
     5402else
     5403  echo "$as_me: failed program was:" >&5
     5404sed 's/^/| /' conftest.$ac_ext >&5
     5405
     5406ac_header_compiler=no
     5407fi
     5408rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5409echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5410echo "${ECHO_T}$ac_header_compiler" >&6
     5411
     5412# Is the header present?
     5413echo "$as_me:$LINENO: checking values.h presence" >&5
     5414echo $ECHO_N "checking values.h presence... $ECHO_C" >&6
     5415cat >conftest.$ac_ext <<_ACEOF
     5416/* confdefs.h.  */
     5417_ACEOF
     5418cat confdefs.h >>conftest.$ac_ext
     5419cat >>conftest.$ac_ext <<_ACEOF
     5420/* end confdefs.h.  */
     5421#include <values.h>
     5422_ACEOF
     5423if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5424  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5425  ac_status=$?
     5426  grep -v '^ *+' conftest.er1 >conftest.err
     5427  rm -f conftest.er1
     5428  cat conftest.err >&5
     5429  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5430  (exit $ac_status); } >/dev/null; then
     5431  if test -s conftest.err; then
     5432    ac_cpp_err=$ac_c_preproc_warn_flag
     5433    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5434  else
     5435    ac_cpp_err=
     5436  fi
     5437else
     5438  ac_cpp_err=yes
     5439fi
     5440if test -z "$ac_cpp_err"; then
     5441  ac_header_preproc=yes
     5442else
     5443  echo "$as_me: failed program was:" >&5
     5444sed 's/^/| /' conftest.$ac_ext >&5
     5445
     5446  ac_header_preproc=no
     5447fi
     5448rm -f conftest.err conftest.$ac_ext
     5449echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5450echo "${ECHO_T}$ac_header_preproc" >&6
     5451
     5452# So?  What about this header?
     5453case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5454  yes:no: )
     5455    { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5456echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5457    { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5
     5458echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;}
     5459    ac_header_preproc=yes
     5460    ;;
     5461  no:yes:* )
     5462    { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5
     5463echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;}
     5464    { echo "$as_me:$LINENO: WARNING: values.h:     check for missing prerequisite headers?" >&5
     5465echo "$as_me: WARNING: values.h:     check for missing prerequisite headers?" >&2;}
     5466    { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5
     5467echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;}
     5468    { echo "$as_me:$LINENO: WARNING: values.h:     section \"Present But Cannot Be Compiled\"" >&5
     5469echo "$as_me: WARNING: values.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5470    { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5
     5471echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;}
     5472    { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5
     5473echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;}
     5474    (
     5475      cat <<\_ASBOX
     5476## ----------------------------------- ##
     5477## Report this to the Rappture lists.  ##
     5478## ----------------------------------- ##
     5479_ASBOX
     5480    ) |
     5481      sed "s/^/$as_me: WARNING:     /" >&2
     5482    ;;
     5483esac
     5484echo "$as_me:$LINENO: checking for values.h" >&5
     5485echo $ECHO_N "checking for values.h... $ECHO_C" >&6
     5486if test "${ac_cv_header_values_h+set}" = set; then
     5487  echo $ECHO_N "(cached) $ECHO_C" >&6
     5488else
     5489  ac_cv_header_values_h=$ac_header_preproc
     5490fi
     5491echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
     5492echo "${ECHO_T}$ac_cv_header_values_h" >&6
     5493
     5494fi
     5495if test $ac_cv_header_values_h = yes; then
     5496  :
     5497else
     5498
     5499cat >>confdefs.h <<\_ACEOF
     5500#define NO_VALUES_H 1
     5501_ACEOF
     5502
     5503fi
     5504
     5505
     5506    if test "${ac_cv_header_limits_h+set}" = set; then
     5507  echo "$as_me:$LINENO: checking for limits.h" >&5
     5508echo $ECHO_N "checking for limits.h... $ECHO_C" >&6
     5509if test "${ac_cv_header_limits_h+set}" = set; then
     5510  echo $ECHO_N "(cached) $ECHO_C" >&6
     5511fi
     5512echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
     5513echo "${ECHO_T}$ac_cv_header_limits_h" >&6
     5514else
     5515  # Is the header compilable?
     5516echo "$as_me:$LINENO: checking limits.h usability" >&5
     5517echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6
     5518cat >conftest.$ac_ext <<_ACEOF
     5519/* confdefs.h.  */
     5520_ACEOF
     5521cat confdefs.h >>conftest.$ac_ext
     5522cat >>conftest.$ac_ext <<_ACEOF
     5523/* end confdefs.h.  */
     5524$ac_includes_default
     5525#include <limits.h>
     5526_ACEOF
     5527rm -f conftest.$ac_objext
     5528if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5529  (eval $ac_compile) 2>conftest.er1
     5530  ac_status=$?
     5531  grep -v '^ *+' conftest.er1 >conftest.err
     5532  rm -f conftest.er1
     5533  cat conftest.err >&5
     5534  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5535  (exit $ac_status); } &&
     5536         { ac_try='test -z "$ac_c_werror_flag"
     5537                         || test ! -s conftest.err'
     5538  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5539  (eval $ac_try) 2>&5
     5540  ac_status=$?
     5541  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5542  (exit $ac_status); }; } &&
     5543         { ac_try='test -s conftest.$ac_objext'
     5544  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5545  (eval $ac_try) 2>&5
     5546  ac_status=$?
     5547  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5548  (exit $ac_status); }; }; then
     5549  ac_header_compiler=yes
     5550else
     5551  echo "$as_me: failed program was:" >&5
     5552sed 's/^/| /' conftest.$ac_ext >&5
     5553
     5554ac_header_compiler=no
     5555fi
     5556rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5557echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5558echo "${ECHO_T}$ac_header_compiler" >&6
     5559
     5560# Is the header present?
     5561echo "$as_me:$LINENO: checking limits.h presence" >&5
     5562echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6
     5563cat >conftest.$ac_ext <<_ACEOF
     5564/* confdefs.h.  */
     5565_ACEOF
     5566cat confdefs.h >>conftest.$ac_ext
     5567cat >>conftest.$ac_ext <<_ACEOF
     5568/* end confdefs.h.  */
     5569#include <limits.h>
     5570_ACEOF
     5571if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5572  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5573  ac_status=$?
     5574  grep -v '^ *+' conftest.er1 >conftest.err
     5575  rm -f conftest.er1
     5576  cat conftest.err >&5
     5577  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5578  (exit $ac_status); } >/dev/null; then
     5579  if test -s conftest.err; then
     5580    ac_cpp_err=$ac_c_preproc_warn_flag
     5581    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5582  else
     5583    ac_cpp_err=
     5584  fi
     5585else
     5586  ac_cpp_err=yes
     5587fi
     5588if test -z "$ac_cpp_err"; then
     5589  ac_header_preproc=yes
     5590else
     5591  echo "$as_me: failed program was:" >&5
     5592sed 's/^/| /' conftest.$ac_ext >&5
     5593
     5594  ac_header_preproc=no
     5595fi
     5596rm -f conftest.err conftest.$ac_ext
     5597echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5598echo "${ECHO_T}$ac_header_preproc" >&6
     5599
     5600# So?  What about this header?
     5601case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5602  yes:no: )
     5603    { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5604echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5605    { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5
     5606echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;}
     5607    ac_header_preproc=yes
     5608    ;;
     5609  no:yes:* )
     5610    { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5
     5611echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;}
     5612    { echo "$as_me:$LINENO: WARNING: limits.h:     check for missing prerequisite headers?" >&5
     5613echo "$as_me: WARNING: limits.h:     check for missing prerequisite headers?" >&2;}
     5614    { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5
     5615echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;}
     5616    { echo "$as_me:$LINENO: WARNING: limits.h:     section \"Present But Cannot Be Compiled\"" >&5
     5617echo "$as_me: WARNING: limits.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5618    { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5
     5619echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;}
     5620    { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5
     5621echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;}
     5622    (
     5623      cat <<\_ASBOX
     5624## ----------------------------------- ##
     5625## Report this to the Rappture lists.  ##
     5626## ----------------------------------- ##
     5627_ASBOX
     5628    ) |
     5629      sed "s/^/$as_me: WARNING:     /" >&2
     5630    ;;
     5631esac
     5632echo "$as_me:$LINENO: checking for limits.h" >&5
     5633echo $ECHO_N "checking for limits.h... $ECHO_C" >&6
     5634if test "${ac_cv_header_limits_h+set}" = set; then
     5635  echo $ECHO_N "(cached) $ECHO_C" >&6
     5636else
     5637  ac_cv_header_limits_h=$ac_header_preproc
     5638fi
     5639echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
     5640echo "${ECHO_T}$ac_cv_header_limits_h" >&6
     5641
     5642fi
     5643if test $ac_cv_header_limits_h = yes; then
     5644
     5645cat >>confdefs.h <<\_ACEOF
     5646#define HAVE_LIMITS_H 1
     5647_ACEOF
     5648
     5649else
     5650
     5651cat >>confdefs.h <<\_ACEOF
     5652#define NO_LIMITS_H 1
     5653_ACEOF
     5654
     5655fi
     5656
     5657
     5658    if test "${ac_cv_header_stdlib_h+set}" = set; then
     5659  echo "$as_me:$LINENO: checking for stdlib.h" >&5
     5660echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
     5661if test "${ac_cv_header_stdlib_h+set}" = set; then
     5662  echo $ECHO_N "(cached) $ECHO_C" >&6
     5663fi
     5664echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
     5665echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
     5666else
     5667  # Is the header compilable?
     5668echo "$as_me:$LINENO: checking stdlib.h usability" >&5
     5669echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6
     5670cat >conftest.$ac_ext <<_ACEOF
     5671/* confdefs.h.  */
     5672_ACEOF
     5673cat confdefs.h >>conftest.$ac_ext
     5674cat >>conftest.$ac_ext <<_ACEOF
     5675/* end confdefs.h.  */
     5676$ac_includes_default
     5677#include <stdlib.h>
     5678_ACEOF
     5679rm -f conftest.$ac_objext
     5680if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5681  (eval $ac_compile) 2>conftest.er1
     5682  ac_status=$?
     5683  grep -v '^ *+' conftest.er1 >conftest.err
     5684  rm -f conftest.er1
     5685  cat conftest.err >&5
     5686  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5687  (exit $ac_status); } &&
     5688         { ac_try='test -z "$ac_c_werror_flag"
     5689                         || test ! -s conftest.err'
     5690  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5691  (eval $ac_try) 2>&5
     5692  ac_status=$?
     5693  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5694  (exit $ac_status); }; } &&
     5695         { ac_try='test -s conftest.$ac_objext'
     5696  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5697  (eval $ac_try) 2>&5
     5698  ac_status=$?
     5699  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5700  (exit $ac_status); }; }; then
     5701  ac_header_compiler=yes
     5702else
     5703  echo "$as_me: failed program was:" >&5
     5704sed 's/^/| /' conftest.$ac_ext >&5
     5705
     5706ac_header_compiler=no
     5707fi
     5708rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5709echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5710echo "${ECHO_T}$ac_header_compiler" >&6
     5711
     5712# Is the header present?
     5713echo "$as_me:$LINENO: checking stdlib.h presence" >&5
     5714echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6
     5715cat >conftest.$ac_ext <<_ACEOF
     5716/* confdefs.h.  */
     5717_ACEOF
     5718cat confdefs.h >>conftest.$ac_ext
     5719cat >>conftest.$ac_ext <<_ACEOF
     5720/* end confdefs.h.  */
     5721#include <stdlib.h>
     5722_ACEOF
     5723if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5724  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5725  ac_status=$?
     5726  grep -v '^ *+' conftest.er1 >conftest.err
     5727  rm -f conftest.er1
     5728  cat conftest.err >&5
     5729  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5730  (exit $ac_status); } >/dev/null; then
     5731  if test -s conftest.err; then
     5732    ac_cpp_err=$ac_c_preproc_warn_flag
     5733    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5734  else
     5735    ac_cpp_err=
     5736  fi
     5737else
     5738  ac_cpp_err=yes
     5739fi
     5740if test -z "$ac_cpp_err"; then
     5741  ac_header_preproc=yes
     5742else
     5743  echo "$as_me: failed program was:" >&5
     5744sed 's/^/| /' conftest.$ac_ext >&5
     5745
     5746  ac_header_preproc=no
     5747fi
     5748rm -f conftest.err conftest.$ac_ext
     5749echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5750echo "${ECHO_T}$ac_header_preproc" >&6
     5751
     5752# So?  What about this header?
     5753case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5754  yes:no: )
     5755    { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5756echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5757    { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5
     5758echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;}
     5759    ac_header_preproc=yes
     5760    ;;
     5761  no:yes:* )
     5762    { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5
     5763echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;}
     5764    { echo "$as_me:$LINENO: WARNING: stdlib.h:     check for missing prerequisite headers?" >&5
     5765echo "$as_me: WARNING: stdlib.h:     check for missing prerequisite headers?" >&2;}
     5766    { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5
     5767echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;}
     5768    { echo "$as_me:$LINENO: WARNING: stdlib.h:     section \"Present But Cannot Be Compiled\"" >&5
     5769echo "$as_me: WARNING: stdlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5770    { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5
     5771echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;}
     5772    { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5
     5773echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;}
     5774    (
     5775      cat <<\_ASBOX
     5776## ----------------------------------- ##
     5777## Report this to the Rappture lists.  ##
     5778## ----------------------------------- ##
     5779_ASBOX
     5780    ) |
     5781      sed "s/^/$as_me: WARNING:     /" >&2
     5782    ;;
     5783esac
     5784echo "$as_me:$LINENO: checking for stdlib.h" >&5
     5785echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
     5786if test "${ac_cv_header_stdlib_h+set}" = set; then
     5787  echo $ECHO_N "(cached) $ECHO_C" >&6
     5788else
     5789  ac_cv_header_stdlib_h=$ac_header_preproc
     5790fi
     5791echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
     5792echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
     5793
     5794fi
     5795if test $ac_cv_header_stdlib_h = yes; then
     5796  tcl_ok=1
     5797else
     5798  tcl_ok=0
     5799fi
     5800
     5801
     5802    cat >conftest.$ac_ext <<_ACEOF
     5803/* confdefs.h.  */
     5804_ACEOF
     5805cat confdefs.h >>conftest.$ac_ext
     5806cat >>conftest.$ac_ext <<_ACEOF
     5807/* end confdefs.h.  */
     5808#include <stdlib.h>
     5809
     5810_ACEOF
     5811if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     5812  $EGREP "strtol" >/dev/null 2>&1; then
     5813  :
     5814else
     5815  tcl_ok=0
     5816fi
     5817rm -f conftest*
     5818
     5819    cat >conftest.$ac_ext <<_ACEOF
     5820/* confdefs.h.  */
     5821_ACEOF
     5822cat confdefs.h >>conftest.$ac_ext
     5823cat >>conftest.$ac_ext <<_ACEOF
     5824/* end confdefs.h.  */
     5825#include <stdlib.h>
     5826
     5827_ACEOF
     5828if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     5829  $EGREP "strtoul" >/dev/null 2>&1; then
     5830  :
     5831else
     5832  tcl_ok=0
     5833fi
     5834rm -f conftest*
     5835
     5836    cat >conftest.$ac_ext <<_ACEOF
     5837/* confdefs.h.  */
     5838_ACEOF
     5839cat confdefs.h >>conftest.$ac_ext
     5840cat >>conftest.$ac_ext <<_ACEOF
     5841/* end confdefs.h.  */
     5842#include <stdlib.h>
     5843
     5844_ACEOF
     5845if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     5846  $EGREP "strtod" >/dev/null 2>&1; then
     5847  :
     5848else
     5849  tcl_ok=0
     5850fi
     5851rm -f conftest*
     5852
     5853    if test $tcl_ok = 0; then
     5854
     5855cat >>confdefs.h <<\_ACEOF
     5856#define NO_STDLIB_H 1
     5857_ACEOF
     5858
     5859    fi
     5860    if test "${ac_cv_header_string_h+set}" = set; then
     5861  echo "$as_me:$LINENO: checking for string.h" >&5
     5862echo $ECHO_N "checking for string.h... $ECHO_C" >&6
     5863if test "${ac_cv_header_string_h+set}" = set; then
     5864  echo $ECHO_N "(cached) $ECHO_C" >&6
     5865fi
     5866echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
     5867echo "${ECHO_T}$ac_cv_header_string_h" >&6
     5868else
     5869  # Is the header compilable?
     5870echo "$as_me:$LINENO: checking string.h usability" >&5
     5871echo $ECHO_N "checking string.h usability... $ECHO_C" >&6
     5872cat >conftest.$ac_ext <<_ACEOF
     5873/* confdefs.h.  */
     5874_ACEOF
     5875cat confdefs.h >>conftest.$ac_ext
     5876cat >>conftest.$ac_ext <<_ACEOF
     5877/* end confdefs.h.  */
     5878$ac_includes_default
     5879#include <string.h>
     5880_ACEOF
     5881rm -f conftest.$ac_objext
     5882if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     5883  (eval $ac_compile) 2>conftest.er1
     5884  ac_status=$?
     5885  grep -v '^ *+' conftest.er1 >conftest.err
     5886  rm -f conftest.er1
     5887  cat conftest.err >&5
     5888  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5889  (exit $ac_status); } &&
     5890         { ac_try='test -z "$ac_c_werror_flag"
     5891                         || test ! -s conftest.err'
     5892  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5893  (eval $ac_try) 2>&5
     5894  ac_status=$?
     5895  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5896  (exit $ac_status); }; } &&
     5897         { ac_try='test -s conftest.$ac_objext'
     5898  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     5899  (eval $ac_try) 2>&5
     5900  ac_status=$?
     5901  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5902  (exit $ac_status); }; }; then
     5903  ac_header_compiler=yes
     5904else
     5905  echo "$as_me: failed program was:" >&5
     5906sed 's/^/| /' conftest.$ac_ext >&5
     5907
     5908ac_header_compiler=no
     5909fi
     5910rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     5911echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     5912echo "${ECHO_T}$ac_header_compiler" >&6
     5913
     5914# Is the header present?
     5915echo "$as_me:$LINENO: checking string.h presence" >&5
     5916echo $ECHO_N "checking string.h presence... $ECHO_C" >&6
     5917cat >conftest.$ac_ext <<_ACEOF
     5918/* confdefs.h.  */
     5919_ACEOF
     5920cat confdefs.h >>conftest.$ac_ext
     5921cat >>conftest.$ac_ext <<_ACEOF
     5922/* end confdefs.h.  */
     5923#include <string.h>
     5924_ACEOF
     5925if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     5926  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     5927  ac_status=$?
     5928  grep -v '^ *+' conftest.er1 >conftest.err
     5929  rm -f conftest.er1
     5930  cat conftest.err >&5
     5931  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     5932  (exit $ac_status); } >/dev/null; then
     5933  if test -s conftest.err; then
     5934    ac_cpp_err=$ac_c_preproc_warn_flag
     5935    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     5936  else
     5937    ac_cpp_err=
     5938  fi
     5939else
     5940  ac_cpp_err=yes
     5941fi
     5942if test -z "$ac_cpp_err"; then
     5943  ac_header_preproc=yes
     5944else
     5945  echo "$as_me: failed program was:" >&5
     5946sed 's/^/| /' conftest.$ac_ext >&5
     5947
     5948  ac_header_preproc=no
     5949fi
     5950rm -f conftest.err conftest.$ac_ext
     5951echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     5952echo "${ECHO_T}$ac_header_preproc" >&6
     5953
     5954# So?  What about this header?
     5955case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     5956  yes:no: )
     5957    { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5
     5958echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     5959    { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5
     5960echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;}
     5961    ac_header_preproc=yes
     5962    ;;
     5963  no:yes:* )
     5964    { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5
     5965echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;}
     5966    { echo "$as_me:$LINENO: WARNING: string.h:     check for missing prerequisite headers?" >&5
     5967echo "$as_me: WARNING: string.h:     check for missing prerequisite headers?" >&2;}
     5968    { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5
     5969echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;}
     5970    { echo "$as_me:$LINENO: WARNING: string.h:     section \"Present But Cannot Be Compiled\"" >&5
     5971echo "$as_me: WARNING: string.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     5972    { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5
     5973echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;}
     5974    { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5
     5975echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;}
     5976    (
     5977      cat <<\_ASBOX
     5978## ----------------------------------- ##
     5979## Report this to the Rappture lists.  ##
     5980## ----------------------------------- ##
     5981_ASBOX
     5982    ) |
     5983      sed "s/^/$as_me: WARNING:     /" >&2
     5984    ;;
     5985esac
     5986echo "$as_me:$LINENO: checking for string.h" >&5
     5987echo $ECHO_N "checking for string.h... $ECHO_C" >&6
     5988if test "${ac_cv_header_string_h+set}" = set; then
     5989  echo $ECHO_N "(cached) $ECHO_C" >&6
     5990else
     5991  ac_cv_header_string_h=$ac_header_preproc
     5992fi
     5993echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
     5994echo "${ECHO_T}$ac_cv_header_string_h" >&6
     5995
     5996fi
     5997if test $ac_cv_header_string_h = yes; then
     5998  tcl_ok=1
     5999else
     6000  tcl_ok=0
     6001fi
     6002
     6003
     6004    cat >conftest.$ac_ext <<_ACEOF
     6005/* confdefs.h.  */
     6006_ACEOF
     6007cat confdefs.h >>conftest.$ac_ext
     6008cat >>conftest.$ac_ext <<_ACEOF
     6009/* end confdefs.h.  */
     6010#include <string.h>
     6011
     6012_ACEOF
     6013if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     6014  $EGREP "strstr" >/dev/null 2>&1; then
     6015  :
     6016else
     6017  tcl_ok=0
     6018fi
     6019rm -f conftest*
     6020
     6021    cat >conftest.$ac_ext <<_ACEOF
     6022/* confdefs.h.  */
     6023_ACEOF
     6024cat confdefs.h >>conftest.$ac_ext
     6025cat >>conftest.$ac_ext <<_ACEOF
     6026/* end confdefs.h.  */
     6027#include <string.h>
     6028
     6029_ACEOF
     6030if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     6031  $EGREP "strerror" >/dev/null 2>&1; then
     6032  :
     6033else
     6034  tcl_ok=0
     6035fi
     6036rm -f conftest*
     6037
     6038
     6039    # See also memmove check below for a place where NO_STRING_H can be
     6040    # set and why.
     6041
     6042    if test $tcl_ok = 0; then
     6043
     6044cat >>confdefs.h <<\_ACEOF
     6045#define NO_STRING_H 1
     6046_ACEOF
     6047
     6048    fi
     6049
     6050    if test "${ac_cv_header_sys_wait_h+set}" = set; then
     6051  echo "$as_me:$LINENO: checking for sys/wait.h" >&5
     6052echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6
     6053if test "${ac_cv_header_sys_wait_h+set}" = set; then
     6054  echo $ECHO_N "(cached) $ECHO_C" >&6
     6055fi
     6056echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
     6057echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
     6058else
     6059  # Is the header compilable?
     6060echo "$as_me:$LINENO: checking sys/wait.h usability" >&5
     6061echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6
     6062cat >conftest.$ac_ext <<_ACEOF
     6063/* confdefs.h.  */
     6064_ACEOF
     6065cat confdefs.h >>conftest.$ac_ext
     6066cat >>conftest.$ac_ext <<_ACEOF
     6067/* end confdefs.h.  */
     6068$ac_includes_default
     6069#include <sys/wait.h>
     6070_ACEOF
     6071rm -f conftest.$ac_objext
     6072if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6073  (eval $ac_compile) 2>conftest.er1
     6074  ac_status=$?
     6075  grep -v '^ *+' conftest.er1 >conftest.err
     6076  rm -f conftest.er1
     6077  cat conftest.err >&5
     6078  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6079  (exit $ac_status); } &&
     6080         { ac_try='test -z "$ac_c_werror_flag"
     6081                         || test ! -s conftest.err'
     6082  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6083  (eval $ac_try) 2>&5
     6084  ac_status=$?
     6085  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6086  (exit $ac_status); }; } &&
     6087         { ac_try='test -s conftest.$ac_objext'
     6088  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6089  (eval $ac_try) 2>&5
     6090  ac_status=$?
     6091  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6092  (exit $ac_status); }; }; then
     6093  ac_header_compiler=yes
     6094else
     6095  echo "$as_me: failed program was:" >&5
     6096sed 's/^/| /' conftest.$ac_ext >&5
     6097
     6098ac_header_compiler=no
     6099fi
     6100rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6101echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6102echo "${ECHO_T}$ac_header_compiler" >&6
     6103
     6104# Is the header present?
     6105echo "$as_me:$LINENO: checking sys/wait.h presence" >&5
     6106echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6
     6107cat >conftest.$ac_ext <<_ACEOF
     6108/* confdefs.h.  */
     6109_ACEOF
     6110cat confdefs.h >>conftest.$ac_ext
     6111cat >>conftest.$ac_ext <<_ACEOF
     6112/* end confdefs.h.  */
     6113#include <sys/wait.h>
     6114_ACEOF
     6115if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6116  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6117  ac_status=$?
     6118  grep -v '^ *+' conftest.er1 >conftest.err
     6119  rm -f conftest.er1
     6120  cat conftest.err >&5
     6121  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6122  (exit $ac_status); } >/dev/null; then
     6123  if test -s conftest.err; then
     6124    ac_cpp_err=$ac_c_preproc_warn_flag
     6125    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6126  else
     6127    ac_cpp_err=
     6128  fi
     6129else
     6130  ac_cpp_err=yes
     6131fi
     6132if test -z "$ac_cpp_err"; then
     6133  ac_header_preproc=yes
     6134else
     6135  echo "$as_me: failed program was:" >&5
     6136sed 's/^/| /' conftest.$ac_ext >&5
     6137
     6138  ac_header_preproc=no
     6139fi
     6140rm -f conftest.err conftest.$ac_ext
     6141echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6142echo "${ECHO_T}$ac_header_preproc" >&6
     6143
     6144# So?  What about this header?
     6145case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6146  yes:no: )
     6147    { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5
     6148echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6149    { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5
     6150echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;}
     6151    ac_header_preproc=yes
     6152    ;;
     6153  no:yes:* )
     6154    { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5
     6155echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;}
     6156    { echo "$as_me:$LINENO: WARNING: sys/wait.h:     check for missing prerequisite headers?" >&5
     6157echo "$as_me: WARNING: sys/wait.h:     check for missing prerequisite headers?" >&2;}
     6158    { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5
     6159echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;}
     6160    { echo "$as_me:$LINENO: WARNING: sys/wait.h:     section \"Present But Cannot Be Compiled\"" >&5
     6161echo "$as_me: WARNING: sys/wait.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     6162    { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5
     6163echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;}
     6164    { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5
     6165echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;}
     6166    (
     6167      cat <<\_ASBOX
     6168## ----------------------------------- ##
     6169## Report this to the Rappture lists.  ##
     6170## ----------------------------------- ##
     6171_ASBOX
     6172    ) |
     6173      sed "s/^/$as_me: WARNING:     /" >&2
     6174    ;;
     6175esac
     6176echo "$as_me:$LINENO: checking for sys/wait.h" >&5
     6177echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6
     6178if test "${ac_cv_header_sys_wait_h+set}" = set; then
     6179  echo $ECHO_N "(cached) $ECHO_C" >&6
     6180else
     6181  ac_cv_header_sys_wait_h=$ac_header_preproc
     6182fi
     6183echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
     6184echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
     6185
     6186fi
     6187if test $ac_cv_header_sys_wait_h = yes; then
     6188  :
     6189else
     6190
     6191cat >>confdefs.h <<\_ACEOF
     6192#define NO_SYS_WAIT_H 1
     6193_ACEOF
     6194
     6195fi
     6196
     6197
     6198    if test "${ac_cv_header_dlfcn_h+set}" = set; then
     6199  echo "$as_me:$LINENO: checking for dlfcn.h" >&5
     6200echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
     6201if test "${ac_cv_header_dlfcn_h+set}" = set; then
     6202  echo $ECHO_N "(cached) $ECHO_C" >&6
     6203fi
     6204echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
     6205echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
     6206else
     6207  # Is the header compilable?
     6208echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
     6209echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6
     6210cat >conftest.$ac_ext <<_ACEOF
     6211/* confdefs.h.  */
     6212_ACEOF
     6213cat confdefs.h >>conftest.$ac_ext
     6214cat >>conftest.$ac_ext <<_ACEOF
     6215/* end confdefs.h.  */
     6216$ac_includes_default
     6217#include <dlfcn.h>
     6218_ACEOF
     6219rm -f conftest.$ac_objext
     6220if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6221  (eval $ac_compile) 2>conftest.er1
     6222  ac_status=$?
     6223  grep -v '^ *+' conftest.er1 >conftest.err
     6224  rm -f conftest.er1
     6225  cat conftest.err >&5
     6226  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6227  (exit $ac_status); } &&
     6228         { ac_try='test -z "$ac_c_werror_flag"
     6229                         || test ! -s conftest.err'
     6230  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6231  (eval $ac_try) 2>&5
     6232  ac_status=$?
     6233  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6234  (exit $ac_status); }; } &&
     6235         { ac_try='test -s conftest.$ac_objext'
     6236  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6237  (eval $ac_try) 2>&5
     6238  ac_status=$?
     6239  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6240  (exit $ac_status); }; }; then
     6241  ac_header_compiler=yes
     6242else
     6243  echo "$as_me: failed program was:" >&5
     6244sed 's/^/| /' conftest.$ac_ext >&5
     6245
     6246ac_header_compiler=no
     6247fi
     6248rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6249echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6250echo "${ECHO_T}$ac_header_compiler" >&6
     6251
     6252# Is the header present?
     6253echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
     6254echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6
     6255cat >conftest.$ac_ext <<_ACEOF
     6256/* confdefs.h.  */
     6257_ACEOF
     6258cat confdefs.h >>conftest.$ac_ext
     6259cat >>conftest.$ac_ext <<_ACEOF
     6260/* end confdefs.h.  */
     6261#include <dlfcn.h>
     6262_ACEOF
     6263if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6264  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6265  ac_status=$?
     6266  grep -v '^ *+' conftest.er1 >conftest.err
     6267  rm -f conftest.er1
     6268  cat conftest.err >&5
     6269  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6270  (exit $ac_status); } >/dev/null; then
     6271  if test -s conftest.err; then
     6272    ac_cpp_err=$ac_c_preproc_warn_flag
     6273    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6274  else
     6275    ac_cpp_err=
     6276  fi
     6277else
     6278  ac_cpp_err=yes
     6279fi
     6280if test -z "$ac_cpp_err"; then
     6281  ac_header_preproc=yes
     6282else
     6283  echo "$as_me: failed program was:" >&5
     6284sed 's/^/| /' conftest.$ac_ext >&5
     6285
     6286  ac_header_preproc=no
     6287fi
     6288rm -f conftest.err conftest.$ac_ext
     6289echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6290echo "${ECHO_T}$ac_header_preproc" >&6
     6291
     6292# So?  What about this header?
     6293case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6294  yes:no: )
     6295    { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
     6296echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6297    { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
     6298echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
     6299    ac_header_preproc=yes
     6300    ;;
     6301  no:yes:* )
     6302    { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
     6303echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
     6304    { echo "$as_me:$LINENO: WARNING: dlfcn.h:     check for missing prerequisite headers?" >&5
     6305echo "$as_me: WARNING: dlfcn.h:     check for missing prerequisite headers?" >&2;}
     6306    { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
     6307echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
     6308    { echo "$as_me:$LINENO: WARNING: dlfcn.h:     section \"Present But Cannot Be Compiled\"" >&5
     6309echo "$as_me: WARNING: dlfcn.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     6310    { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
     6311echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
     6312    { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
     6313echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
     6314    (
     6315      cat <<\_ASBOX
     6316## ----------------------------------- ##
     6317## Report this to the Rappture lists.  ##
     6318## ----------------------------------- ##
     6319_ASBOX
     6320    ) |
     6321      sed "s/^/$as_me: WARNING:     /" >&2
     6322    ;;
     6323esac
     6324echo "$as_me:$LINENO: checking for dlfcn.h" >&5
     6325echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
     6326if test "${ac_cv_header_dlfcn_h+set}" = set; then
     6327  echo $ECHO_N "(cached) $ECHO_C" >&6
     6328else
     6329  ac_cv_header_dlfcn_h=$ac_header_preproc
     6330fi
     6331echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
     6332echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
     6333
     6334fi
     6335if test $ac_cv_header_dlfcn_h = yes; then
     6336  :
     6337else
     6338
     6339cat >>confdefs.h <<\_ACEOF
     6340#define NO_DLFCN_H 1
     6341_ACEOF
     6342
     6343fi
     6344
     6345
     6346
     6347    # OS/390 lacks sys/param.h (and doesn't need it, by chance).
     6348
     6349for ac_header in sys/param.h
     6350do
     6351as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6352if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6353  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6354echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6355if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6356  echo $ECHO_N "(cached) $ECHO_C" >&6
     6357fi
     6358echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6359echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6360else
     6361  # Is the header compilable?
     6362echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6363echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6364cat >conftest.$ac_ext <<_ACEOF
     6365/* confdefs.h.  */
     6366_ACEOF
     6367cat confdefs.h >>conftest.$ac_ext
     6368cat >>conftest.$ac_ext <<_ACEOF
     6369/* end confdefs.h.  */
     6370$ac_includes_default
     6371#include <$ac_header>
     6372_ACEOF
     6373rm -f conftest.$ac_objext
     6374if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6375  (eval $ac_compile) 2>conftest.er1
     6376  ac_status=$?
     6377  grep -v '^ *+' conftest.er1 >conftest.err
     6378  rm -f conftest.er1
     6379  cat conftest.err >&5
     6380  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6381  (exit $ac_status); } &&
     6382         { ac_try='test -z "$ac_c_werror_flag"
     6383                         || test ! -s conftest.err'
     6384  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6385  (eval $ac_try) 2>&5
     6386  ac_status=$?
     6387  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6388  (exit $ac_status); }; } &&
     6389         { ac_try='test -s conftest.$ac_objext'
     6390  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6391  (eval $ac_try) 2>&5
     6392  ac_status=$?
     6393  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6394  (exit $ac_status); }; }; then
     6395  ac_header_compiler=yes
     6396else
     6397  echo "$as_me: failed program was:" >&5
     6398sed 's/^/| /' conftest.$ac_ext >&5
     6399
     6400ac_header_compiler=no
     6401fi
     6402rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6403echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6404echo "${ECHO_T}$ac_header_compiler" >&6
     6405
     6406# Is the header present?
     6407echo "$as_me:$LINENO: checking $ac_header presence" >&5
     6408echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     6409cat >conftest.$ac_ext <<_ACEOF
     6410/* confdefs.h.  */
     6411_ACEOF
     6412cat confdefs.h >>conftest.$ac_ext
     6413cat >>conftest.$ac_ext <<_ACEOF
     6414/* end confdefs.h.  */
     6415#include <$ac_header>
     6416_ACEOF
     6417if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6418  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6419  ac_status=$?
     6420  grep -v '^ *+' conftest.er1 >conftest.err
     6421  rm -f conftest.er1
     6422  cat conftest.err >&5
     6423  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6424  (exit $ac_status); } >/dev/null; then
     6425  if test -s conftest.err; then
     6426    ac_cpp_err=$ac_c_preproc_warn_flag
     6427    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6428  else
     6429    ac_cpp_err=
     6430  fi
     6431else
     6432  ac_cpp_err=yes
     6433fi
     6434if test -z "$ac_cpp_err"; then
     6435  ac_header_preproc=yes
     6436else
     6437  echo "$as_me: failed program was:" >&5
     6438sed 's/^/| /' conftest.$ac_ext >&5
     6439
     6440  ac_header_preproc=no
     6441fi
     6442rm -f conftest.err conftest.$ac_ext
     6443echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6444echo "${ECHO_T}$ac_header_preproc" >&6
     6445
     6446# So?  What about this header?
     6447case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6448  yes:no: )
     6449    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     6450echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6451    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     6452echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     6453    ac_header_preproc=yes
     6454    ;;
     6455  no:yes:* )
     6456    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     6457echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     6458    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     6459echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     6460    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     6461echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     6462    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     6463echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     6464    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     6465echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     6466    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     6467echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     6468    (
     6469      cat <<\_ASBOX
     6470## ----------------------------------- ##
     6471## Report this to the Rappture lists.  ##
     6472## ----------------------------------- ##
     6473_ASBOX
     6474    ) |
     6475      sed "s/^/$as_me: WARNING:     /" >&2
     6476    ;;
     6477esac
     6478echo "$as_me:$LINENO: checking for $ac_header" >&5
     6479echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6480if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6481  echo $ECHO_N "(cached) $ECHO_C" >&6
     6482else
     6483  eval "$as_ac_Header=\$ac_header_preproc"
     6484fi
     6485echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6486echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6487
     6488fi
     6489if test `eval echo '${'$as_ac_Header'}'` = yes; then
     6490  cat >>confdefs.h <<_ACEOF
     6491#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     6492_ACEOF
     6493
     6494fi
     6495
     6496done
     6497
     6498
     6499        # Let the user call this, because if it triggers, they will
     6500        # need a compat/strtod.c that is correct.  Users can also
     6501        # use Tcl_GetDouble(FromObj) instead.
     6502        #TEA_BUGGY_STRTOD
     6503    fi
     6504
     6505
     6506#-----------------------------------------------------------------------
     6507# __CHANGE__
     6508# Specify the C source files to compile in TEA_ADD_SOURCES,
     6509# public headers that need to be installed in TEA_ADD_HEADERS,
     6510# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
     6511# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
     6512# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
     6513# and PKG_TCL_SOURCES.
     6514#-----------------------------------------------------------------------
     6515
     6516
     6517    vars="Rappture_Init.cc RpLibraryTclInterface.cc RpUnitsTclInterface.cc "
     6518    for i in $vars; do
     6519        case $i in
     6520            \$*)
     6521                # allow $-var names
     6522                PKG_SOURCES="$PKG_SOURCES $i"
     6523                PKG_OBJECTS="$PKG_OBJECTS $i"
     6524                ;;
     6525            *)
     6526                # check for existence - allows for generic/win/unix VPATH
     6527                if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/src/$i" \
     6528                    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
     6529                    ; then
     6530                    { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5
     6531echo "$as_me: error: could not find source file '$i'" >&2;}
     6532   { (exit 1); exit 1; }; }
     6533                fi
     6534                PKG_SOURCES="$PKG_SOURCES $i"
     6535                # this assumes it is in a VPATH dir
     6536                i=`basename $i`
     6537                # handle user calling this before or after TEA_SETUP_COMPILER
     6538                if test x"${OBJEXT}" != x ; then
     6539                    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
     6540                else
     6541                    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
     6542                fi
     6543                PKG_OBJECTS="$PKG_OBJECTS $j"
     6544                ;;
     6545        esac
     6546    done
     6547
     6548
     6549
     6550
     6551    vars=""
     6552    for i in $vars; do
     6553        # check for existence, be strict because it is installed
     6554        if test ! -f "${srcdir}/$i" ; then
     6555            { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5
     6556echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;}
     6557   { (exit 1); exit 1; }; }
     6558        fi
     6559        PKG_HEADERS="$PKG_HEADERS $i"
     6560    done
     6561
     6562
     6563
     6564    vars=""
     6565    for i in $vars; do
     6566        PKG_INCLUDES="$PKG_INCLUDES $i"
     6567    done
     6568
     6569
     6570
     6571    vars="BLT24.lib libexpat.lib ../librappture.lib"
     6572    for i in $vars; do
     6573        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
     6574            # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
     6575            i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
     6576        fi
     6577        PKG_LIBS="$PKG_LIBS $i"
     6578    done
     6579
     6580
     6581
     6582    PKG_CFLAGS="$PKG_CFLAGS "
     6583
     6584
     6585
     6586    vars=""
     6587    for i in $vars; do
     6588        # check for existence - allows for generic/win/unix VPATH
     6589        if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
     6590            -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
     6591            ; then
     6592            { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5
     6593echo "$as_me: error: could not find stub source file '$i'" >&2;}
     6594   { (exit 1); exit 1; }; }
     6595        fi
     6596        PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
     6597        # this assumes it is in a VPATH dir
     6598        i=`basename $i`
     6599        # handle user calling this before or after TEA_SETUP_COMPILER
     6600        if test x"${OBJEXT}" != x ; then
     6601            j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
     6602        else
     6603            j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
     6604        fi
     6605        PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
     6606    done
     6607
     6608
     6609
     6610
     6611    vars="scripts/exec.tcl scripts/value.tcl init.tcl ../../tcl/scripts/library.tcl ../../tcl/scripts/result.tcl"
     6612    for i in $vars; do
     6613        # check for existence, be strict because it is installed
     6614        if test ! -f "${srcdir}/$i" ; then
     6615            { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5
     6616echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;}
     6617   { (exit 1); exit 1; }; }
     6618        fi
     6619        PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
     6620    done
     6621
     6622
     6623
     6624#--------------------------------------------------------------------
     6625# __CHANGE__
     6626# A few miscellaneous platform-specific items:
     6627#
     6628# Define a special symbol for Windows (BUILD_sample in this case) so
     6629# that we create the export library with the dll.
     6630#
     6631# Windows creates a few extra files that need to be cleaned up.
     6632# You can add more files to clean if your extension creates any extra
     6633# files.
     6634#
     6635# TEA_ADD_* any platform specific compiler/build info here.
     6636#--------------------------------------------------------------------
     6637
     6638if test "${TEA_PLATFORM}" = "windows" ; then
     6639
     6640cat >>confdefs.h <<\_ACEOF
     6641#define BUILD_rappture 1
     6642_ACEOF
     6643
     6644    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
     6645
     6646    vars="/LIBPATH:C:/opt/lib /LIBPATH:C:/Tcl/lib scew_s.lib"
     6647    for i in $vars; do
     6648        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
     6649            # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
     6650            i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
     6651        fi
     6652        PKG_LIBS="$PKG_LIBS $i"
     6653    done
     6654
     6655
     6656    #TEA_ADD_SOURCES([win/winFile.c])
     6657    #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
     6658else
     6659    CLEANFILES=""
     6660    #TEA_ADD_SOURCES([unix/unixFile.c])
     6661
     6662    vars="scew.lib"
     6663    for i in $vars; do
     6664        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
     6665            # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
     6666            i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
     6667        fi
     6668        PKG_LIBS="$PKG_LIBS $i"
     6669    done
     6670
     6671
     6672fi
    21816673
    21826674
     
    21876679# contain private data structures and are subject to change without
    21886680# notice.
    2189 # This MUST be called before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG
     6681# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
    21906682#--------------------------------------------------------------------
    21916683
     
    22016693fi;
    22026694
    2203     if test x"${with_tclinclude}" != x ; then
    2204         if test -f "${with_tclinclude}/tcl.h" ; then
    2205             ac_cv_c_tclh=${with_tclinclude}
    2206         else
    2207             { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain Tcl public header file tcl.h" >&5
    2208 echo "$as_me: error: ${with_tclinclude} directory does not contain Tcl public header file tcl.h" >&2;}
    2209    { (exit 1); exit 1; }; }
    2210         fi
    2211     else
    2212         if test "${ac_cv_c_tclh+set}" = set; then
     6695    if test "${ac_cv_c_tclh+set}" = set; then
    22136696  echo $ECHO_N "(cached) $ECHO_C" >&6
    22146697else
    22156698
    2216             # Use the value from --with-tclinclude, if it was given
    2217 
    2218             if test x"${with_tclinclude}" != x ; then
     6699        # Use the value from --with-tclinclude, if it was given
     6700
     6701        if test x"${with_tclinclude}" != x ; then
     6702            if test -f "${with_tclinclude}/tcl.h" ; then
    22196703                ac_cv_c_tclh=${with_tclinclude}
    22206704            else
    2221                 # Check in the includedir, if --prefix was specified
    2222 
    2223                 eval "temp_includedir=${includedir}"
    2224                 for i in \
    2225                         `ls -d ${temp_includedir} 2>/dev/null` \
    2226                         /usr/local/include /usr/include ; do
    2227                     if test -f "$i/tcl.h" ; then
    2228                         ac_cv_c_tclh=$i
    2229                         break
    2230                     fi
    2231                 done
     6705                { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5
     6706echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;}
     6707   { (exit 1); exit 1; }; }
    22326708            fi
    2233 
    2234 fi
    2235 
    2236     fi
     6709        else
     6710            if test "`uname -s`" = "Darwin"; then
     6711                # If Tcl was built as a framework, attempt to use
     6712                # the framework's Headers directory
     6713                case ${TCL_DEFS} in
     6714                    *TCL_FRAMEWORK*)
     6715                        list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
     6716                        ;;
     6717                esac
     6718            fi
     6719
     6720            # Look in the source dir only if Tcl is not installed,
     6721            # and in that situation, look there before installed locations.
     6722            if test -f "${TCL_BIN_DIR}/Makefile" ; then
     6723                list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
     6724            fi
     6725
     6726            # Check order: pkg --prefix location, Tcl's --prefix location,
     6727            # relative to directory of tclConfig.sh.
     6728
     6729            eval "temp_includedir=${includedir}"
     6730            list="$list \
     6731                `ls -d ${temp_includedir}        2>/dev/null` \
     6732                `ls -d ${TCL_PREFIX}/include     2>/dev/null` \
     6733                `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
     6734            if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
     6735                list="$list /usr/local/include /usr/include"
     6736                if test x"${TCL_INCLUDE_SPEC}" != x ; then
     6737                    d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
     6738                    list="$list `ls -d ${d} 2>/dev/null`"
     6739                fi
     6740            fi
     6741            for i in $list ; do
     6742                if test -f "$i/tcl.h" ; then
     6743                    ac_cv_c_tclh=$i
     6744                    break
     6745                fi
     6746            done
     6747        fi
     6748
     6749fi
     6750
    22376751
    22386752    # Print a message based on how we determined the include path
     
    22556769
    22566770
    2257 #SC_PRIVATE_TCL_HEADERS
     6771#TEA_PRIVATE_TCL_HEADERS
     6772
     6773#TEA_PUBLIC_TK_HEADERS
     6774#TEA_PRIVATE_TK_HEADERS
     6775#TEA_PATH_X
    22586776
    22596777#--------------------------------------------------------------------
    2260 # Load the tclConfig.sh file
     6778# Check whether --enable-threads or --disable-threads was given.
     6779# This auto-enables if Tcl was compiled threaded.
    22616780#--------------------------------------------------------------------
    22626781
    22636782
    2264     #
    2265     # Ok, lets find the tcl configuration
     6783    # Check whether --enable-threads or --disable-threads was given.
     6784if test "${enable_threads+set}" = set; then
     6785  enableval="$enable_threads"
     6786  tcl_ok=$enableval
     6787else
     6788  tcl_ok=yes
     6789fi;
     6790
     6791    if test "${enable_threads+set}" = set; then
     6792        enableval="$enable_threads"
     6793        tcl_ok=$enableval
     6794    else
     6795        tcl_ok=yes
     6796    fi
     6797
     6798    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
     6799        TCL_THREADS=1
     6800
     6801        if test "${TEA_PLATFORM}" != "windows" ; then
     6802            # We are always OK on Windows, so check what this platform wants:
     6803
     6804            # USE_THREAD_ALLOC tells us to try the special thread-based
     6805            # allocator that significantly reduces lock contention
     6806
     6807cat >>confdefs.h <<\_ACEOF
     6808#define USE_THREAD_ALLOC 1
     6809_ACEOF
     6810
     6811
     6812cat >>confdefs.h <<\_ACEOF
     6813#define _REENTRANT 1
     6814_ACEOF
     6815
     6816            if test "`uname -s`" = "SunOS" ; then
     6817
     6818cat >>confdefs.h <<\_ACEOF
     6819#define _POSIX_PTHREAD_SEMANTICS 1
     6820_ACEOF
     6821
     6822            fi
     6823
     6824cat >>confdefs.h <<\_ACEOF
     6825#define _THREAD_SAFE 1
     6826_ACEOF
     6827
     6828            echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
     6829echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6
     6830if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
     6831  echo $ECHO_N "(cached) $ECHO_C" >&6
     6832else
     6833  ac_check_lib_save_LIBS=$LIBS
     6834LIBS="-lpthread  $LIBS"
     6835cat >conftest.$ac_ext <<_ACEOF
     6836/* confdefs.h.  */
     6837_ACEOF
     6838cat confdefs.h >>conftest.$ac_ext
     6839cat >>conftest.$ac_ext <<_ACEOF
     6840/* end confdefs.h.  */
     6841
     6842/* Override any gcc2 internal prototype to avoid an error.  */
     6843#ifdef __cplusplus
     6844extern "C"
     6845#endif
     6846/* We use char because int might match the return type of a gcc2
     6847   builtin and then its argument prototype would still apply.  */
     6848char pthread_mutex_init ();
     6849int
     6850main ()
     6851{
     6852pthread_mutex_init ();
     6853  ;
     6854  return 0;
     6855}
     6856_ACEOF
     6857rm -f conftest.$ac_objext conftest$ac_exeext
     6858if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6859  (eval $ac_link) 2>conftest.er1
     6860  ac_status=$?
     6861  grep -v '^ *+' conftest.er1 >conftest.err
     6862  rm -f conftest.er1
     6863  cat conftest.err >&5
     6864  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6865  (exit $ac_status); } &&
     6866         { ac_try='test -z "$ac_c_werror_flag"
     6867                         || test ! -s conftest.err'
     6868  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6869  (eval $ac_try) 2>&5
     6870  ac_status=$?
     6871  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6872  (exit $ac_status); }; } &&
     6873         { ac_try='test -s conftest$ac_exeext'
     6874  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6875  (eval $ac_try) 2>&5
     6876  ac_status=$?
     6877  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6878  (exit $ac_status); }; }; then
     6879  ac_cv_lib_pthread_pthread_mutex_init=yes
     6880else
     6881  echo "$as_me: failed program was:" >&5
     6882sed 's/^/| /' conftest.$ac_ext >&5
     6883
     6884ac_cv_lib_pthread_pthread_mutex_init=no
     6885fi
     6886rm -f conftest.err conftest.$ac_objext \
     6887      conftest$ac_exeext conftest.$ac_ext
     6888LIBS=$ac_check_lib_save_LIBS
     6889fi
     6890echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
     6891echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6
     6892if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
     6893  tcl_ok=yes
     6894else
     6895  tcl_ok=no
     6896fi
     6897
     6898            if test "$tcl_ok" = "no"; then
     6899                # Check a little harder for __pthread_mutex_init in the same
     6900                # library, as some systems hide it there until pthread.h is
     6901                # defined.  We could alternatively do an AC_TRY_COMPILE with
     6902                # pthread.h, but that will work with libpthread really doesn't
     6903                # exist, like AIX 4.2.  [Bug: 4359]
     6904                echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5
     6905echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6
     6906if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then
     6907  echo $ECHO_N "(cached) $ECHO_C" >&6
     6908else
     6909  ac_check_lib_save_LIBS=$LIBS
     6910LIBS="-lpthread  $LIBS"
     6911cat >conftest.$ac_ext <<_ACEOF
     6912/* confdefs.h.  */
     6913_ACEOF
     6914cat confdefs.h >>conftest.$ac_ext
     6915cat >>conftest.$ac_ext <<_ACEOF
     6916/* end confdefs.h.  */
     6917
     6918/* Override any gcc2 internal prototype to avoid an error.  */
     6919#ifdef __cplusplus
     6920extern "C"
     6921#endif
     6922/* We use char because int might match the return type of a gcc2
     6923   builtin and then its argument prototype would still apply.  */
     6924char __pthread_mutex_init ();
     6925int
     6926main ()
     6927{
     6928__pthread_mutex_init ();
     6929  ;
     6930  return 0;
     6931}
     6932_ACEOF
     6933rm -f conftest.$ac_objext conftest$ac_exeext
     6934if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6935  (eval $ac_link) 2>conftest.er1
     6936  ac_status=$?
     6937  grep -v '^ *+' conftest.er1 >conftest.err
     6938  rm -f conftest.er1
     6939  cat conftest.err >&5
     6940  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6941  (exit $ac_status); } &&
     6942         { ac_try='test -z "$ac_c_werror_flag"
     6943                         || test ! -s conftest.err'
     6944  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6945  (eval $ac_try) 2>&5
     6946  ac_status=$?
     6947  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6948  (exit $ac_status); }; } &&
     6949         { ac_try='test -s conftest$ac_exeext'
     6950  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6951  (eval $ac_try) 2>&5
     6952  ac_status=$?
     6953  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6954  (exit $ac_status); }; }; then
     6955  ac_cv_lib_pthread___pthread_mutex_init=yes
     6956else
     6957  echo "$as_me: failed program was:" >&5
     6958sed 's/^/| /' conftest.$ac_ext >&5
     6959
     6960ac_cv_lib_pthread___pthread_mutex_init=no
     6961fi
     6962rm -f conftest.err conftest.$ac_objext \
     6963      conftest$ac_exeext conftest.$ac_ext
     6964LIBS=$ac_check_lib_save_LIBS
     6965fi
     6966echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
     6967echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6
     6968if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then
     6969  tcl_ok=yes
     6970else
     6971  tcl_ok=no
     6972fi
     6973
     6974            fi
     6975
     6976            if test "$tcl_ok" = "yes"; then
     6977                # The space is needed
     6978                THREADS_LIBS=" -lpthread"
     6979            else
     6980                echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5
     6981echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6
     6982if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then
     6983  echo $ECHO_N "(cached) $ECHO_C" >&6
     6984else
     6985  ac_check_lib_save_LIBS=$LIBS
     6986LIBS="-lpthreads  $LIBS"
     6987cat >conftest.$ac_ext <<_ACEOF
     6988/* confdefs.h.  */
     6989_ACEOF
     6990cat confdefs.h >>conftest.$ac_ext
     6991cat >>conftest.$ac_ext <<_ACEOF
     6992/* end confdefs.h.  */
     6993
     6994/* Override any gcc2 internal prototype to avoid an error.  */
     6995#ifdef __cplusplus
     6996extern "C"
     6997#endif
     6998/* We use char because int might match the return type of a gcc2
     6999   builtin and then its argument prototype would still apply.  */
     7000char pthread_mutex_init ();
     7001int
     7002main ()
     7003{
     7004pthread_mutex_init ();
     7005  ;
     7006  return 0;
     7007}
     7008_ACEOF
     7009rm -f conftest.$ac_objext conftest$ac_exeext
     7010if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7011  (eval $ac_link) 2>conftest.er1
     7012  ac_status=$?
     7013  grep -v '^ *+' conftest.er1 >conftest.err
     7014  rm -f conftest.er1
     7015  cat conftest.err >&5
     7016  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7017  (exit $ac_status); } &&
     7018         { ac_try='test -z "$ac_c_werror_flag"
     7019                         || test ! -s conftest.err'
     7020  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7021  (eval $ac_try) 2>&5
     7022  ac_status=$?
     7023  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7024  (exit $ac_status); }; } &&
     7025         { ac_try='test -s conftest$ac_exeext'
     7026  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7027  (eval $ac_try) 2>&5
     7028  ac_status=$?
     7029  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7030  (exit $ac_status); }; }; then
     7031  ac_cv_lib_pthreads_pthread_mutex_init=yes
     7032else
     7033  echo "$as_me: failed program was:" >&5
     7034sed 's/^/| /' conftest.$ac_ext >&5
     7035
     7036ac_cv_lib_pthreads_pthread_mutex_init=no
     7037fi
     7038rm -f conftest.err conftest.$ac_objext \
     7039      conftest$ac_exeext conftest.$ac_ext
     7040LIBS=$ac_check_lib_save_LIBS
     7041fi
     7042echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
     7043echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6
     7044if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then
     7045  tcl_ok=yes
     7046else
     7047  tcl_ok=no
     7048fi
     7049
     7050                if test "$tcl_ok" = "yes"; then
     7051                    # The space is needed
     7052                    THREADS_LIBS=" -lpthreads"
     7053                else
     7054                    echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5
     7055echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6
     7056if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then
     7057  echo $ECHO_N "(cached) $ECHO_C" >&6
     7058else
     7059  ac_check_lib_save_LIBS=$LIBS
     7060LIBS="-lc  $LIBS"
     7061cat >conftest.$ac_ext <<_ACEOF
     7062/* confdefs.h.  */
     7063_ACEOF
     7064cat confdefs.h >>conftest.$ac_ext
     7065cat >>conftest.$ac_ext <<_ACEOF
     7066/* end confdefs.h.  */
     7067
     7068/* Override any gcc2 internal prototype to avoid an error.  */
     7069#ifdef __cplusplus
     7070extern "C"
     7071#endif
     7072/* We use char because int might match the return type of a gcc2
     7073   builtin and then its argument prototype would still apply.  */
     7074char pthread_mutex_init ();
     7075int
     7076main ()
     7077{
     7078pthread_mutex_init ();
     7079  ;
     7080  return 0;
     7081}
     7082_ACEOF
     7083rm -f conftest.$ac_objext conftest$ac_exeext
     7084if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7085  (eval $ac_link) 2>conftest.er1
     7086  ac_status=$?
     7087  grep -v '^ *+' conftest.er1 >conftest.err
     7088  rm -f conftest.er1
     7089  cat conftest.err >&5
     7090  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7091  (exit $ac_status); } &&
     7092         { ac_try='test -z "$ac_c_werror_flag"
     7093                         || test ! -s conftest.err'
     7094  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7095  (eval $ac_try) 2>&5
     7096  ac_status=$?
     7097  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7098  (exit $ac_status); }; } &&
     7099         { ac_try='test -s conftest$ac_exeext'
     7100  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7101  (eval $ac_try) 2>&5
     7102  ac_status=$?
     7103  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7104  (exit $ac_status); }; }; then
     7105  ac_cv_lib_c_pthread_mutex_init=yes
     7106else
     7107  echo "$as_me: failed program was:" >&5
     7108sed 's/^/| /' conftest.$ac_ext >&5
     7109
     7110ac_cv_lib_c_pthread_mutex_init=no
     7111fi
     7112rm -f conftest.err conftest.$ac_objext \
     7113      conftest$ac_exeext conftest.$ac_ext
     7114LIBS=$ac_check_lib_save_LIBS
     7115fi
     7116echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5
     7117echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6
     7118if test $ac_cv_lib_c_pthread_mutex_init = yes; then
     7119  tcl_ok=yes
     7120else
     7121  tcl_ok=no
     7122fi
     7123
     7124                    if test "$tcl_ok" = "no"; then
     7125                        echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5
     7126echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6
     7127if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then
     7128  echo $ECHO_N "(cached) $ECHO_C" >&6
     7129else
     7130  ac_check_lib_save_LIBS=$LIBS
     7131LIBS="-lc_r  $LIBS"
     7132cat >conftest.$ac_ext <<_ACEOF
     7133/* confdefs.h.  */
     7134_ACEOF
     7135cat confdefs.h >>conftest.$ac_ext
     7136cat >>conftest.$ac_ext <<_ACEOF
     7137/* end confdefs.h.  */
     7138
     7139/* Override any gcc2 internal prototype to avoid an error.  */
     7140#ifdef __cplusplus
     7141extern "C"
     7142#endif
     7143/* We use char because int might match the return type of a gcc2
     7144   builtin and then its argument prototype would still apply.  */
     7145char pthread_mutex_init ();
     7146int
     7147main ()
     7148{
     7149pthread_mutex_init ();
     7150  ;
     7151  return 0;
     7152}
     7153_ACEOF
     7154rm -f conftest.$ac_objext conftest$ac_exeext
     7155if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7156  (eval $ac_link) 2>conftest.er1
     7157  ac_status=$?
     7158  grep -v '^ *+' conftest.er1 >conftest.err
     7159  rm -f conftest.er1
     7160  cat conftest.err >&5
     7161  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7162  (exit $ac_status); } &&
     7163         { ac_try='test -z "$ac_c_werror_flag"
     7164                         || test ! -s conftest.err'
     7165  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7166  (eval $ac_try) 2>&5
     7167  ac_status=$?
     7168  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7169  (exit $ac_status); }; } &&
     7170         { ac_try='test -s conftest$ac_exeext'
     7171  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7172  (eval $ac_try) 2>&5
     7173  ac_status=$?
     7174  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7175  (exit $ac_status); }; }; then
     7176  ac_cv_lib_c_r_pthread_mutex_init=yes
     7177else
     7178  echo "$as_me: failed program was:" >&5
     7179sed 's/^/| /' conftest.$ac_ext >&5
     7180
     7181ac_cv_lib_c_r_pthread_mutex_init=no
     7182fi
     7183rm -f conftest.err conftest.$ac_objext \
     7184      conftest$ac_exeext conftest.$ac_ext
     7185LIBS=$ac_check_lib_save_LIBS
     7186fi
     7187echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
     7188echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6
     7189if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then
     7190  tcl_ok=yes
     7191else
     7192  tcl_ok=no
     7193fi
     7194
     7195                        if test "$tcl_ok" = "yes"; then
     7196                            # The space is needed
     7197                            THREADS_LIBS=" -pthread"
     7198                        else
     7199                            TCL_THREADS=0
     7200                            { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5
     7201echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;}
     7202                        fi
     7203                    fi
     7204                fi
     7205            fi
     7206        fi
     7207    else
     7208        TCL_THREADS=0
     7209    fi
     7210    # Do checking message here to not mess up interleaved configure output
     7211    echo "$as_me:$LINENO: checking for building with threads" >&5
     7212echo $ECHO_N "checking for building with threads... $ECHO_C" >&6
     7213    if test "${TCL_THREADS}" = 1; then
     7214
     7215cat >>confdefs.h <<\_ACEOF
     7216#define TCL_THREADS 1
     7217_ACEOF
     7218
     7219        echo "$as_me:$LINENO: result: yes (default)" >&5
     7220echo "${ECHO_T}yes (default)" >&6
     7221    else
     7222        echo "$as_me:$LINENO: result: no" >&5
     7223echo "${ECHO_T}no" >&6
     7224    fi
     7225    # TCL_THREADS sanity checking.  See if our request for building with
     7226    # threads is the same as the way Tcl was built.  If not, warn the user.
     7227    case ${TCL_DEFS} in
     7228        *THREADS=1*)
     7229            if test "${TCL_THREADS}" = "0"; then
     7230                { echo "$as_me:$LINENO: WARNING:
     7231    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
     7232    that IS thread-enabled.  It is recommended to use --enable-threads." >&5
     7233echo "$as_me: WARNING:
     7234    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
     7235    that IS thread-enabled.  It is recommended to use --enable-threads." >&2;}
     7236            fi
     7237            ;;
     7238        *)
     7239            if test "${TCL_THREADS}" = "1"; then
     7240                { echo "$as_me:$LINENO: WARNING:
     7241    --enable-threads requested, but building against a Tcl that is NOT
     7242    thread-enabled.  This is an OK configuration that will also run in
     7243    a thread-enabled core." >&5
     7244echo "$as_me: WARNING:
     7245    --enable-threads requested, but building against a Tcl that is NOT
     7246    thread-enabled.  This is an OK configuration that will also run in
     7247    a thread-enabled core." >&2;}
     7248            fi
     7249            ;;
     7250    esac
     7251
     7252
     7253
     7254#--------------------------------------------------------------------
     7255# The statement below defines a collection of symbols related to
     7256# building as a shared library instead of a static library.
     7257#--------------------------------------------------------------------
     7258
     7259
     7260    echo "$as_me:$LINENO: checking how to build libraries" >&5
     7261echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6
     7262    # Check whether --enable-shared or --disable-shared was given.
     7263if test "${enable_shared+set}" = set; then
     7264  enableval="$enable_shared"
     7265  tcl_ok=$enableval
     7266else
     7267  tcl_ok=yes
     7268fi;
     7269
     7270    if test "${enable_shared+set}" = set; then
     7271        enableval="$enable_shared"
     7272        tcl_ok=$enableval
     7273    else
     7274        tcl_ok=yes
     7275    fi
     7276
     7277    if test "$tcl_ok" = "yes" ; then
     7278        echo "$as_me:$LINENO: result: shared" >&5
     7279echo "${ECHO_T}shared" >&6
     7280        SHARED_BUILD=1
     7281    else
     7282        echo "$as_me:$LINENO: result: static" >&5
     7283echo "${ECHO_T}static" >&6
     7284        SHARED_BUILD=0
     7285
     7286cat >>confdefs.h <<\_ACEOF
     7287#define STATIC_BUILD 1
     7288_ACEOF
     7289
     7290    fi
     7291
     7292
     7293
     7294#--------------------------------------------------------------------
     7295# This macro figures out what flags to use with the compiler/linker
     7296# when building shared/static debug/optimized objects.  This information
     7297# can be taken from the tclConfig.sh file, but this figures it all out.
     7298#--------------------------------------------------------------------
     7299
     7300
     7301
     7302
     7303    # Step 0.a: Enable 64 bit support?
     7304
     7305    echo "$as_me:$LINENO: checking if 64bit support is requested" >&5
     7306echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6
     7307    # Check whether --enable-64bit or --disable-64bit was given.
     7308if test "${enable_64bit+set}" = set; then
     7309  enableval="$enable_64bit"
     7310  do64bit=$enableval
     7311else
     7312  do64bit=no
     7313fi;
     7314    echo "$as_me:$LINENO: result: $do64bit" >&5
     7315echo "${ECHO_T}$do64bit" >&6
     7316
     7317    # Step 0.b: Enable Solaris 64 bit VIS support?
     7318
     7319    echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5
     7320echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6
     7321    # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
     7322if test "${enable_64bit_vis+set}" = set; then
     7323  enableval="$enable_64bit_vis"
     7324  do64bitVIS=$enableval
     7325else
     7326  do64bitVIS=no
     7327fi;
     7328    echo "$as_me:$LINENO: result: $do64bitVIS" >&5
     7329echo "${ECHO_T}$do64bitVIS" >&6
     7330
     7331    if test "$do64bitVIS" = "yes"; then
     7332        # Force 64bit on with VIS
     7333        do64bit=yes
     7334    fi
     7335
     7336    # Step 0.c: Cross-compiling options for Windows/CE builds?
     7337
     7338    if test "${TEA_PLATFORM}" = "windows" ; then
     7339        echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5
     7340echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6
     7341        # Check whether --enable-wince or --disable-wince was given.
     7342if test "${enable_wince+set}" = set; then
     7343  enableval="$enable_wince"
     7344  doWince=$enableval
     7345else
     7346  doWince=no
     7347fi;
     7348        echo "$as_me:$LINENO: result: $doWince" >&5
     7349echo "${ECHO_T}$doWince" >&6
     7350    fi
     7351
     7352    # Step 1: set the variable "system" to hold the name and version number
     7353    # for the system.
     7354
     7355
     7356    echo "$as_me:$LINENO: checking system version" >&5
     7357echo $ECHO_N "checking system version... $ECHO_C" >&6
     7358if test "${tcl_cv_sys_version+set}" = set; then
     7359  echo $ECHO_N "(cached) $ECHO_C" >&6
     7360else
     7361
     7362        if test "${TEA_PLATFORM}" = "windows" ; then
     7363            tcl_cv_sys_version=windows
     7364        elif test -f /usr/lib/NextStep/software_version; then
     7365            tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
     7366        else
     7367            tcl_cv_sys_version=`uname -s`-`uname -r`
     7368            if test "$?" -ne 0 ; then
     7369                { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5
     7370echo "$as_me: WARNING: can't find uname command" >&2;}
     7371                tcl_cv_sys_version=unknown
     7372            else
     7373                # Special check for weird MP-RAS system (uname returns weird
     7374                # results, and the version is kept in special file).
     7375
     7376                if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
     7377                    tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
     7378                fi
     7379                if test "`uname -s`" = "AIX" ; then
     7380                    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
     7381                fi
     7382            fi
     7383        fi
     7384
     7385fi
     7386echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5
     7387echo "${ECHO_T}$tcl_cv_sys_version" >&6
     7388    system=$tcl_cv_sys_version
     7389
     7390
     7391    # Step 2: check for existence of -ldl library.  This is needed because
     7392    # Linux can use either -ldl or -ldld for dynamic loading.
     7393
     7394    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
     7395echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
     7396if test "${ac_cv_lib_dl_dlopen+set}" = set; then
     7397  echo $ECHO_N "(cached) $ECHO_C" >&6
     7398else
     7399  ac_check_lib_save_LIBS=$LIBS
     7400LIBS="-ldl  $LIBS"
     7401cat >conftest.$ac_ext <<_ACEOF
     7402/* confdefs.h.  */
     7403_ACEOF
     7404cat confdefs.h >>conftest.$ac_ext
     7405cat >>conftest.$ac_ext <<_ACEOF
     7406/* end confdefs.h.  */
     7407
     7408/* Override any gcc2 internal prototype to avoid an error.  */
     7409#ifdef __cplusplus
     7410extern "C"
     7411#endif
     7412/* We use char because int might match the return type of a gcc2
     7413   builtin and then its argument prototype would still apply.  */
     7414char dlopen ();
     7415int
     7416main ()
     7417{
     7418dlopen ();
     7419  ;
     7420  return 0;
     7421}
     7422_ACEOF
     7423rm -f conftest.$ac_objext conftest$ac_exeext
     7424if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7425  (eval $ac_link) 2>conftest.er1
     7426  ac_status=$?
     7427  grep -v '^ *+' conftest.er1 >conftest.err
     7428  rm -f conftest.er1
     7429  cat conftest.err >&5
     7430  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7431  (exit $ac_status); } &&
     7432         { ac_try='test -z "$ac_c_werror_flag"
     7433                         || test ! -s conftest.err'
     7434  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7435  (eval $ac_try) 2>&5
     7436  ac_status=$?
     7437  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7438  (exit $ac_status); }; } &&
     7439         { ac_try='test -s conftest$ac_exeext'
     7440  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7441  (eval $ac_try) 2>&5
     7442  ac_status=$?
     7443  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7444  (exit $ac_status); }; }; then
     7445  ac_cv_lib_dl_dlopen=yes
     7446else
     7447  echo "$as_me: failed program was:" >&5
     7448sed 's/^/| /' conftest.$ac_ext >&5
     7449
     7450ac_cv_lib_dl_dlopen=no
     7451fi
     7452rm -f conftest.err conftest.$ac_objext \
     7453      conftest$ac_exeext conftest.$ac_ext
     7454LIBS=$ac_check_lib_save_LIBS
     7455fi
     7456echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
     7457echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
     7458if test $ac_cv_lib_dl_dlopen = yes; then
     7459  have_dl=yes
     7460else
     7461  have_dl=no
     7462fi
     7463
     7464
     7465    # Require ranlib early so we can override it in special cases below.
     7466
     7467
     7468
     7469    # Step 3: set configuration options based on system name and version.
     7470    # This is similar to Tcl's unix/tcl.m4 except that we've added a
     7471    # "windows" case.
     7472
     7473    do64bit_ok=no
     7474    LDFLAGS_ORIG="$LDFLAGS"
     7475    # When ld needs options to work in 64-bit mode, put them in
     7476    # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
     7477    # is disabled by the user. [Bug 1016796]
     7478    LDFLAGS_ARCH=""
     7479    TCL_EXPORT_FILE_SUFFIX=""
     7480    UNSHARED_LIB_SUFFIX=""
     7481    TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
     7482    ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
     7483    TCL_LIB_VERSIONS_OK=ok
     7484    CFLAGS_DEBUG=-g
     7485    CFLAGS_OPTIMIZE=-O
     7486    if test "$GCC" = "yes" ; then
     7487        CFLAGS_OPTIMIZE=-O2
     7488        CFLAGS_WARNING="-Wall -Wno-implicit-int"
     7489    else
     7490        CFLAGS_WARNING=""
     7491    fi
     7492    TCL_NEEDS_EXP_FILE=0
     7493    TCL_BUILD_EXP_FILE=""
     7494    TCL_EXP_FILE=""
     7495    # Extract the first word of "ar", so it can be a program name with args.
     7496set dummy ar; ac_word=$2
     7497echo "$as_me:$LINENO: checking for $ac_word" >&5
     7498echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     7499if test "${ac_cv_prog_AR+set}" = set; then
     7500  echo $ECHO_N "(cached) $ECHO_C" >&6
     7501else
     7502  if test -n "$AR"; then
     7503  ac_cv_prog_AR="$AR" # Let the user override the test.
     7504else
     7505as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     7506for as_dir in $PATH
     7507do
     7508  IFS=$as_save_IFS
     7509  test -z "$as_dir" && as_dir=.
     7510  for ac_exec_ext in '' $ac_executable_extensions; do
     7511  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     7512    ac_cv_prog_AR="ar"
     7513    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     7514    break 2
     7515  fi
     7516done
     7517done
     7518
     7519fi
     7520fi
     7521AR=$ac_cv_prog_AR
     7522if test -n "$AR"; then
     7523  echo "$as_me:$LINENO: result: $AR" >&5
     7524echo "${ECHO_T}$AR" >&6
     7525else
     7526  echo "$as_me:$LINENO: result: no" >&5
     7527echo "${ECHO_T}no" >&6
     7528fi
     7529
     7530    STLIB_LD='${AR} cr'
     7531    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
     7532    case $system in
     7533        windows)
     7534            # This is a 2-stage check to make sure we have the 64-bit SDK
     7535            # We have to know where the SDK is installed.
     7536            # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
     7537            # MACHINE is IX86 for LINK, but this is used by the manifest,
     7538            # which requires x86|amd64|ia64.
     7539            MACHINE="X86"
     7540            if test "$do64bit" != "no" ; then
     7541                if test "x${MSSDK}x" = "xx" ; then
     7542                    MSSDK="C:/Progra~1/Microsoft Platform SDK"
     7543                fi
     7544                MSSDK=`echo "$MSSDK" | sed -e  's!\\\!/!g'`
     7545                PATH64=""
     7546                case "$do64bit" in
     7547                    amd64|x64|yes)
     7548                        MACHINE="AMD64" ; # default to AMD64 64-bit build
     7549                        PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
     7550                        ;;
     7551                    ia64)
     7552                        MACHINE="IA64"
     7553                        PATH64="${MSSDK}/Bin/Win64"
     7554                        ;;
     7555                esac
     7556                if test ! -d "${PATH64}" ; then
     7557                    { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
     7558echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
     7559                    { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5
     7560echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
     7561                    do64bit="no"
     7562                else
     7563                    echo "$as_me:$LINENO: result:    Using 64-bit $MACHINE mode" >&5
     7564echo "${ECHO_T}   Using 64-bit $MACHINE mode" >&6
     7565                    do64bit_ok="yes"
     7566                fi
     7567            fi
     7568
     7569            if test "$doWince" != "no" ; then
     7570                if test "$do64bit" != "no" ; then
     7571                    { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5
     7572echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;}
     7573   { (exit 1); exit 1; }; }
     7574                fi
     7575                if test "$GCC" = "yes" ; then
     7576                    { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5
     7577echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;}
     7578   { (exit 1); exit 1; }; }
     7579                fi
     7580
    22667581    # First, look for one uninstalled.
    2267     # the alternative search directory is invoked by --with-tcl
    2268     #
    2269 
    2270     if test x"${no_tcl}" = x ; then
    2271         # we reset no_tcl in case something fails here
    2272         no_tcl=true
    2273 
    2274 # Check whether --with-tcl or --without-tcl was given.
    2275 if test "${with_tcl+set}" = set; then
    2276   withval="$with_tcl"
    2277   with_tclconfig=${withval}
     7582    # the alternative search directory is invoked by --with-celib
     7583
     7584    if test x"${no_celib}" = x ; then
     7585        # we reset no_celib in case something fails here
     7586        no_celib=true
     7587
     7588# Check whether --with-celib or --without-celib was given.
     7589if test "${with_celib+set}" = set; then
     7590  withval="$with_celib"
     7591  with_celibconfig=${withval}
    22787592fi;
    2279         echo "$as_me:$LINENO: checking for Tcl configuration" >&5
    2280 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
    2281         if test "${ac_cv_c_tclconfig+set}" = set; then
     7593        echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5
     7594echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6
     7595        if test "${ac_cv_c_celibconfig+set}" = set; then
    22827596  echo $ECHO_N "(cached) $ECHO_C" >&6
    22837597else
    22847598
    2285 
    2286             # First check to see if --with-tcl was specified.
    2287             if test x"${with_tclconfig}" != x ; then
    2288                 if test -f "${with_tclconfig}/tclConfig.sh" ; then
    2289                     ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
     7599            # First check to see if --with-celibconfig was specified.
     7600            if test x"${with_celibconfig}" != x ; then
     7601                if test -d "${with_celibconfig}/inc" ; then
     7602                    ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
    22907603                else
    2291                     { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
    2292 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
     7604                    { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5
     7605echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;}
    22937606   { (exit 1); exit 1; }; }
    22947607                fi
    22957608            fi
    22967609
    2297             # then check for a private Tcl installation
    2298             if test x"${ac_cv_c_tclconfig}" = x ; then
     7610            # then check for a celib library
     7611            if test x"${ac_cv_c_celibconfig}" = x ; then
    22997612                for i in \
    2300                         ../tcl \
    2301                         `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
    2302                         ../../tcl \
    2303                         `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
    2304                         ../../../tcl \
    2305                         `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
    2306                     if test -f "$i/unix/tclConfig.sh" ; then
    2307                         ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
     7613                        ../celib-palm-3.0 \
     7614                        ../celib \
     7615                        ../../celib-palm-3.0 \
     7616                        ../../celib \
     7617                        `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
     7618                        ${srcdir}/../celib-palm-3.0 \
     7619                        ${srcdir}/../celib \
     7620                        `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
     7621                        ; do
     7622                    if test -d "$i/inc" ; then
     7623                        ac_cv_c_celibconfig=`(cd $i; pwd)`
    23087624                        break
    23097625                    fi
     
    23117627            fi
    23127628
    2313             # check in a few common install locations
    2314             if test x"${ac_cv_c_tclconfig}" = x ; then
    2315                 for i in `ls -d ${prefix}/lib 2>/dev/null` \
    2316                         `ls -d /usr/local/lib 2>/dev/null` ; do
    2317                     if test -f "$i/tclConfig.sh" ; then
    2318                         ac_cv_c_tclconfig=`(cd $i; pwd)`
    2319                         break
    2320                     fi
    2321                 done
    2322             fi
    2323 
    2324             # check in a few other private locations
    2325             if test x"${ac_cv_c_tclconfig}" = x ; then
    2326                 for i in \
    2327                         ${srcdir}/../tcl \
    2328                         `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
    2329                     if test -f "$i/unix/tclConfig.sh" ; then
    2330                     ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
    2331                     break
    2332                 fi
    2333                 done
    2334             fi
    2335 
    2336 fi
    2337 
    2338 
    2339         if test x"${ac_cv_c_tclconfig}" = x ; then
    2340             TCL_BIN_DIR="# no Tcl configs found"
    2341             { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
    2342 echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
    2343             exit 0
     7629fi
     7630
     7631        if test x"${ac_cv_c_celibconfig}" = x ; then
     7632            { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5
     7633echo "$as_me: error: Cannot find celib support library directory" >&2;}
     7634   { (exit 1); exit 1; }; }
    23447635        else
    2345             no_tcl=
    2346             TCL_BIN_DIR=${ac_cv_c_tclconfig}
    2347             echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5
    2348 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6
     7636            no_celib=
     7637            CELIB_DIR=${ac_cv_c_celibconfig}
     7638            CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
     7639            echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5
     7640echo "${ECHO_T}found $CELIB_DIR" >&6
    23497641        fi
    23507642    fi
    23517643
    2352 
    2353     echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
    2354 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6
    2355 
    2356     if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
    2357         echo "$as_me:$LINENO: result: loading" >&5
    2358 echo "${ECHO_T}loading" >&6
    2359         . $TCL_BIN_DIR/tclConfig.sh
     7644                # Set defaults for common evc4/PPC2003 setup
     7645                # Currently Tcl requires 300+, possibly 420+ for sockets
     7646                CEVERSION=420;          # could be 211 300 301 400 420 ...
     7647                TARGETCPU=ARMV4;        # could be ARMV4 ARM MIPS SH3 X86 ...
     7648                ARCH=ARM;               # could be ARM MIPS X86EM ...
     7649                PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
     7650                if test "$doWince" != "yes"; then
     7651                    # If !yes then the user specified something
     7652                    # Reset ARCH to allow user to skip specifying it
     7653                    ARCH=
     7654                    eval `echo $doWince | awk -F, '{ \
     7655            if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
     7656            if ($1 < 400)   { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
     7657            if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
     7658            if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
     7659            if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
     7660                    }'`
     7661                    if test "x${ARCH}" = "x" ; then
     7662                        ARCH=$TARGETCPU;
     7663                    fi
     7664                fi
     7665                OSVERSION=WCE$CEVERSION;
     7666                if test "x${WCEROOT}" = "x" ; then
     7667                        WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
     7668                    if test ! -d "${WCEROOT}" ; then
     7669                        WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
     7670                    fi
     7671                fi
     7672                if test "x${SDKROOT}" = "x" ; then
     7673                    SDKROOT="C:/Program Files/Windows CE Tools"
     7674                    if test ! -d "${SDKROOT}" ; then
     7675                        SDKROOT="C:/Windows CE Tools"
     7676                    fi
     7677                fi
     7678                WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
     7679                SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
     7680                if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
     7681                    -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
     7682                    { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5
     7683echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;}
     7684   { (exit 1); exit 1; }; }
     7685                    doWince="no"
     7686                else
     7687                    # We could PATH_NOSPACE these, but that's not important,
     7688                    # as long as we quote them when used.
     7689                    CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
     7690                    if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
     7691                        CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
     7692                    fi
     7693                    CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
     7694                fi
     7695            fi
     7696
     7697            if test "$GCC" != "yes" ; then
     7698                if test "${SHARED_BUILD}" = "0" ; then
     7699                    runtime=-MT
     7700                else
     7701                    runtime=-MD
     7702                fi
     7703
     7704                if test "$do64bit" != "no" ; then
     7705                    # All this magic is necessary for the Win64 SDK RC1 - hobbs
     7706                    CC="\"${PATH64}/cl.exe\""
     7707                    CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
     7708                    RC="\"${MSSDK}/bin/rc.exe\""
     7709                    lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
     7710                    LINKBIN="\"${PATH64}/link.exe\""
     7711                    CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
     7712                    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
     7713                    # Avoid 'unresolved external symbol __security_cookie'
     7714                    # errors, c.f. http://support.microsoft.com/?id=894573
     7715
     7716    vars="bufferoverflowU.lib"
     7717    for i in $vars; do
     7718        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
     7719            # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
     7720            i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
     7721        fi
     7722        PKG_LIBS="$PKG_LIBS $i"
     7723    done
     7724
     7725
     7726                elif test "$doWince" != "no" ; then
     7727                    CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
     7728                    if test "${TARGETCPU}" = "X86"; then
     7729                        CC="\"${CEBINROOT}/cl.exe\""
     7730                    else
     7731                        CC="\"${CEBINROOT}/cl${ARCH}.exe\""
     7732                    fi
     7733                    CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
     7734                    RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
     7735                    arch=`echo ${ARCH} | awk '{print tolower($0)}'`
     7736                    defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
     7737                    if test "${SHARED_BUILD}" = "1" ; then
     7738                        # Static CE builds require static celib as well
     7739                        defs="${defs} _DLL"
     7740                    fi
     7741                    for i in $defs ; do
     7742
     7743cat >>confdefs.h <<_ACEOF
     7744#define $i 1
     7745_ACEOF
     7746
     7747                    done
     7748
     7749cat >>confdefs.h <<_ACEOF
     7750#define _WIN32_WCE $CEVERSION
     7751_ACEOF
     7752
     7753
     7754cat >>confdefs.h <<_ACEOF
     7755#define UNDER_CE $CEVERSION
     7756_ACEOF
     7757
     7758                    CFLAGS_DEBUG="-nologo -Zi -Od"
     7759                    CFLAGS_OPTIMIZE="-nologo -Ox"
     7760                    lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
     7761                    lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
     7762                    LINKBIN="\"${CEBINROOT}/link.exe\""
     7763
     7764                else
     7765                    RC="rc"
     7766                    lflags="-nologo"
     7767                    LINKBIN="link"
     7768                    CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
     7769                    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
     7770                fi
     7771            fi
     7772
     7773            if test "$GCC" = "yes"; then
     7774                # mingw gcc mode
     7775                RC="windres"
     7776                CFLAGS_DEBUG="-g"
     7777                CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
     7778                SHLIB_LD="$CC -shared"
     7779                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     7780                LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
     7781                LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
     7782            else
     7783                SHLIB_LD="${LINKBIN} -dll ${lflags}"
     7784                # link -lib only works when -lib is the first arg
     7785                STLIB_LD="${LINKBIN} -lib ${lflags}"
     7786                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
     7787                PATHTYPE=-w
     7788                # For information on what debugtype is most useful, see:
     7789                # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
     7790                # This essentially turns it all on.
     7791                LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
     7792                LDFLAGS_OPTIMIZE="-release"
     7793                if test "$doWince" != "no" ; then
     7794                    LDFLAGS_CONSOLE="-link ${lflags}"
     7795                    LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
     7796                else
     7797                    LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
     7798                    LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
     7799                fi
     7800            fi
     7801
     7802            SHLIB_LD_LIBS='${LIBS}'
     7803            SHLIB_SUFFIX=".dll"
     7804            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
     7805
     7806            TCL_LIB_VERSIONS_OK=nodots
     7807            # Bogus to avoid getting this turned off
     7808            DL_OBJS="tclLoadNone.obj"
     7809            ;;
     7810        AIX-*)
     7811            if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
     7812                # AIX requires the _r compiler when gcc isn't being used
     7813                case "${CC}" in
     7814                    *_r)
     7815                        # ok ...
     7816                        ;;
     7817                    *)
     7818                        CC=${CC}_r
     7819                        ;;
     7820                esac
     7821                echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5
     7822echo "${ECHO_T}Using $CC for compiling with threads" >&6
     7823            fi
     7824            LIBS="$LIBS -lc"
     7825            SHLIB_CFLAGS=""
     7826            SHLIB_LD_LIBS='${LIBS}'
     7827            SHLIB_SUFFIX=".so"
     7828
     7829            DL_OBJS="tclLoadDl.o"
     7830            LD_LIBRARY_PATH_VAR="LIBPATH"
     7831
     7832            # Check to enable 64-bit flags for compiler/linker on AIX 4+
     7833            if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
     7834                if test "$GCC" = "yes" ; then
     7835                    { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
     7836echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
     7837                else
     7838                    do64bit_ok=yes
     7839                    CFLAGS="$CFLAGS -q64"
     7840                    LDFLAGS_ARCH="-q64"
     7841                    RANLIB="${RANLIB} -X64"
     7842                    AR="${AR} -X64"
     7843                    SHLIB_LD_FLAGS="-b64"
     7844                fi
     7845            fi
     7846
     7847            if test "`uname -m`" = "ia64" ; then
     7848                # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
     7849                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     7850                # AIX-5 has dl* in libc.so
     7851                DL_LIBS=""
     7852                if test "$GCC" = "yes" ; then
     7853                    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     7854                else
     7855                    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
     7856                fi
     7857                LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
     7858            else
     7859                if test "$GCC" = "yes" ; then
     7860                    SHLIB_LD="gcc -shared"
     7861                else
     7862                    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
     7863                fi
     7864                SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
     7865                DL_LIBS="-ldl"
     7866                CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     7867                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     7868                TCL_NEEDS_EXP_FILE=1
     7869                TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
     7870            fi
     7871
     7872            # AIX v<=4.1 has some different flags than 4.2+
     7873            if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
     7874                case $LIBOBJS in
     7875    "tclLoadAix.$ac_objext"   | \
     7876  *" tclLoadAix.$ac_objext"   | \
     7877    "tclLoadAix.$ac_objext "* | \
     7878  *" tclLoadAix.$ac_objext "* ) ;;
     7879  *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;;
     7880esac
     7881
     7882                DL_LIBS="-lld"
     7883            fi
     7884
     7885            # On AIX <=v4 systems, libbsd.a has to be linked in to support
     7886            # non-blocking file IO.  This library has to be linked in after
     7887            # the MATH_LIBS or it breaks the pow() function.  The way to
     7888            # insure proper sequencing, is to add it to the tail of MATH_LIBS.
     7889            # This library also supplies gettimeofday.
     7890            #
     7891            # AIX does not have a timezone field in struct tm. When the AIX
     7892            # bsd library is used, the timezone global and the gettimeofday
     7893            # methods are to be avoided for timezone deduction instead, we
     7894            # deduce the timezone by comparing the localtime result on a
     7895            # known GMT value.
     7896
     7897            echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5
     7898echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
     7899if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
     7900  echo $ECHO_N "(cached) $ECHO_C" >&6
     7901else
     7902  ac_check_lib_save_LIBS=$LIBS
     7903LIBS="-lbsd  $LIBS"
     7904cat >conftest.$ac_ext <<_ACEOF
     7905/* confdefs.h.  */
     7906_ACEOF
     7907cat confdefs.h >>conftest.$ac_ext
     7908cat >>conftest.$ac_ext <<_ACEOF
     7909/* end confdefs.h.  */
     7910
     7911/* Override any gcc2 internal prototype to avoid an error.  */
     7912#ifdef __cplusplus
     7913extern "C"
     7914#endif
     7915/* We use char because int might match the return type of a gcc2
     7916   builtin and then its argument prototype would still apply.  */
     7917char gettimeofday ();
     7918int
     7919main ()
     7920{
     7921gettimeofday ();
     7922  ;
     7923  return 0;
     7924}
     7925_ACEOF
     7926rm -f conftest.$ac_objext conftest$ac_exeext
     7927if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7928  (eval $ac_link) 2>conftest.er1
     7929  ac_status=$?
     7930  grep -v '^ *+' conftest.er1 >conftest.err
     7931  rm -f conftest.er1
     7932  cat conftest.err >&5
     7933  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7934  (exit $ac_status); } &&
     7935         { ac_try='test -z "$ac_c_werror_flag"
     7936                         || test ! -s conftest.err'
     7937  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7938  (eval $ac_try) 2>&5
     7939  ac_status=$?
     7940  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7941  (exit $ac_status); }; } &&
     7942         { ac_try='test -s conftest$ac_exeext'
     7943  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7944  (eval $ac_try) 2>&5
     7945  ac_status=$?
     7946  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7947  (exit $ac_status); }; }; then
     7948  ac_cv_lib_bsd_gettimeofday=yes
     7949else
     7950  echo "$as_me: failed program was:" >&5
     7951sed 's/^/| /' conftest.$ac_ext >&5
     7952
     7953ac_cv_lib_bsd_gettimeofday=no
     7954fi
     7955rm -f conftest.err conftest.$ac_objext \
     7956      conftest$ac_exeext conftest.$ac_ext
     7957LIBS=$ac_check_lib_save_LIBS
     7958fi
     7959echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5
     7960echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
     7961if test $ac_cv_lib_bsd_gettimeofday = yes; then
     7962  libbsd=yes
     7963else
     7964  libbsd=no
     7965fi
     7966
     7967            if test $libbsd = yes; then
     7968                MATH_LIBS="$MATH_LIBS -lbsd"
     7969
     7970cat >>confdefs.h <<\_ACEOF
     7971#define USE_DELTA_FOR_TZ 1
     7972_ACEOF
     7973
     7974            fi
     7975            ;;
     7976        BeOS*)
     7977            SHLIB_CFLAGS="-fPIC"
     7978            SHLIB_LD="${CC} -nostart"
     7979            SHLIB_LD_LIBS='${LIBS}'
     7980            SHLIB_SUFFIX=".so"
     7981            DL_OBJS="tclLoadDl.o"
     7982            DL_LIBS="-ldl"
     7983
     7984            #-----------------------------------------------------------
     7985            # Check for inet_ntoa in -lbind, for BeOS (which also needs
     7986            # -lsocket, even if the network functions are in -lnet which
     7987            # is always linked to, for compatibility.
     7988            #-----------------------------------------------------------
     7989            echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5
     7990echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6
     7991if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then
     7992  echo $ECHO_N "(cached) $ECHO_C" >&6
     7993else
     7994  ac_check_lib_save_LIBS=$LIBS
     7995LIBS="-lbind  $LIBS"
     7996cat >conftest.$ac_ext <<_ACEOF
     7997/* confdefs.h.  */
     7998_ACEOF
     7999cat confdefs.h >>conftest.$ac_ext
     8000cat >>conftest.$ac_ext <<_ACEOF
     8001/* end confdefs.h.  */
     8002
     8003/* Override any gcc2 internal prototype to avoid an error.  */
     8004#ifdef __cplusplus
     8005extern "C"
     8006#endif
     8007/* We use char because int might match the return type of a gcc2
     8008   builtin and then its argument prototype would still apply.  */
     8009char inet_ntoa ();
     8010int
     8011main ()
     8012{
     8013inet_ntoa ();
     8014  ;
     8015  return 0;
     8016}
     8017_ACEOF
     8018rm -f conftest.$ac_objext conftest$ac_exeext
     8019if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     8020  (eval $ac_link) 2>conftest.er1
     8021  ac_status=$?
     8022  grep -v '^ *+' conftest.er1 >conftest.err
     8023  rm -f conftest.er1
     8024  cat conftest.err >&5
     8025  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8026  (exit $ac_status); } &&
     8027         { ac_try='test -z "$ac_c_werror_flag"
     8028                         || test ! -s conftest.err'
     8029  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8030  (eval $ac_try) 2>&5
     8031  ac_status=$?
     8032  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8033  (exit $ac_status); }; } &&
     8034         { ac_try='test -s conftest$ac_exeext'
     8035  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8036  (eval $ac_try) 2>&5
     8037  ac_status=$?
     8038  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8039  (exit $ac_status); }; }; then
     8040  ac_cv_lib_bind_inet_ntoa=yes
     8041else
     8042  echo "$as_me: failed program was:" >&5
     8043sed 's/^/| /' conftest.$ac_ext >&5
     8044
     8045ac_cv_lib_bind_inet_ntoa=no
     8046fi
     8047rm -f conftest.err conftest.$ac_objext \
     8048      conftest$ac_exeext conftest.$ac_ext
     8049LIBS=$ac_check_lib_save_LIBS
     8050fi
     8051echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5
     8052echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6
     8053if test $ac_cv_lib_bind_inet_ntoa = yes; then
     8054  LIBS="$LIBS -lbind -lsocket"
     8055fi
     8056
     8057            ;;
     8058        BSD/OS-2.1*|BSD/OS-3*)
     8059            SHLIB_CFLAGS=""
     8060            SHLIB_LD="shlicc -r"
     8061            SHLIB_LD_LIBS='${LIBS}'
     8062            SHLIB_SUFFIX=".so"
     8063            DL_OBJS="tclLoadDl.o"
     8064            DL_LIBS="-ldl"
     8065            CC_SEARCH_FLAGS=""
     8066            LD_SEARCH_FLAGS=""
     8067            ;;
     8068        BSD/OS-4.*)
     8069            SHLIB_CFLAGS="-export-dynamic -fPIC"
     8070            SHLIB_LD="cc -shared"
     8071            SHLIB_LD_LIBS='${LIBS}'
     8072            SHLIB_SUFFIX=".so"
     8073            DL_OBJS="tclLoadDl.o"
     8074            DL_LIBS="-ldl"
     8075            LDFLAGS="$LDFLAGS -export-dynamic"
     8076            CC_SEARCH_FLAGS=""
     8077            LD_SEARCH_FLAGS=""
     8078            ;;
     8079        dgux*)
     8080            SHLIB_CFLAGS="-K PIC"
     8081            SHLIB_LD="cc -G"
     8082            SHLIB_LD_LIBS=""
     8083            SHLIB_SUFFIX=".so"
     8084            DL_OBJS="tclLoadDl.o"
     8085            DL_LIBS="-ldl"
     8086            CC_SEARCH_FLAGS=""
     8087            LD_SEARCH_FLAGS=""
     8088            ;;
     8089        HP-UX-*.11.*)
     8090            # Use updated header definitions where possible
     8091
     8092cat >>confdefs.h <<\_ACEOF
     8093#define _XOPEN_SOURCE_EXTENDED 1
     8094_ACEOF
     8095
     8096            # Needed by Tcl, but not most extensions
     8097            #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
     8098            #LIBS="$LIBS -lxnet"               # Use the XOPEN network library
     8099
     8100            SHLIB_SUFFIX=".sl"
     8101            echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
     8102echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
     8103if test "${ac_cv_lib_dld_shl_load+set}" = set; then
     8104  echo $ECHO_N "(cached) $ECHO_C" >&6
     8105else
     8106  ac_check_lib_save_LIBS=$LIBS
     8107LIBS="-ldld  $LIBS"
     8108cat >conftest.$ac_ext <<_ACEOF
     8109/* confdefs.h.  */
     8110_ACEOF
     8111cat confdefs.h >>conftest.$ac_ext
     8112cat >>conftest.$ac_ext <<_ACEOF
     8113/* end confdefs.h.  */
     8114
     8115/* Override any gcc2 internal prototype to avoid an error.  */
     8116#ifdef __cplusplus
     8117extern "C"
     8118#endif
     8119/* We use char because int might match the return type of a gcc2
     8120   builtin and then its argument prototype would still apply.  */
     8121char shl_load ();
     8122int
     8123main ()
     8124{
     8125shl_load ();
     8126  ;
     8127  return 0;
     8128}
     8129_ACEOF
     8130rm -f conftest.$ac_objext conftest$ac_exeext
     8131if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     8132  (eval $ac_link) 2>conftest.er1
     8133  ac_status=$?
     8134  grep -v '^ *+' conftest.er1 >conftest.err
     8135  rm -f conftest.er1
     8136  cat conftest.err >&5
     8137  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8138  (exit $ac_status); } &&
     8139         { ac_try='test -z "$ac_c_werror_flag"
     8140                         || test ! -s conftest.err'
     8141  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8142  (eval $ac_try) 2>&5
     8143  ac_status=$?
     8144  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8145  (exit $ac_status); }; } &&
     8146         { ac_try='test -s conftest$ac_exeext'
     8147  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8148  (eval $ac_try) 2>&5
     8149  ac_status=$?
     8150  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8151  (exit $ac_status); }; }; then
     8152  ac_cv_lib_dld_shl_load=yes
     8153else
     8154  echo "$as_me: failed program was:" >&5
     8155sed 's/^/| /' conftest.$ac_ext >&5
     8156
     8157ac_cv_lib_dld_shl_load=no
     8158fi
     8159rm -f conftest.err conftest.$ac_objext \
     8160      conftest$ac_exeext conftest.$ac_ext
     8161LIBS=$ac_check_lib_save_LIBS
     8162fi
     8163echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
     8164echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
     8165if test $ac_cv_lib_dld_shl_load = yes; then
     8166  tcl_ok=yes
     8167else
     8168  tcl_ok=no
     8169fi
     8170
     8171            if test "$tcl_ok" = yes; then
     8172                SHLIB_CFLAGS="+z"
     8173                SHLIB_LD="ld -b"
     8174                SHLIB_LD_LIBS='${LIBS}'
     8175                DL_OBJS="tclLoadShl.o"
     8176                DL_LIBS="-ldld"
     8177                LDFLAGS="$LDFLAGS -Wl,-E"
     8178                CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
     8179                LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
     8180                LD_LIBRARY_PATH_VAR="SHLIB_PATH"
     8181            fi
     8182            if test "$GCC" = "yes" ; then
     8183                SHLIB_LD="gcc -shared"
     8184                SHLIB_LD_LIBS='${LIBS}'
     8185                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8186            fi
     8187
     8188            # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
     8189            #CFLAGS="$CFLAGS +DAportable"
     8190
     8191            # Check to enable 64-bit flags for compiler/linker
     8192            if test "$do64bit" = "yes" ; then
     8193                if test "$GCC" = "yes" ; then
     8194                    hpux_arch=`${CC} -dumpmachine`
     8195                    case $hpux_arch in
     8196                        hppa64*)
     8197                            # 64-bit gcc in use.  Fix flags for GNU ld.
     8198                            do64bit_ok=yes
     8199                            SHLIB_LD="${CC} -shared"
     8200                            SHLIB_LD_LIBS='${LIBS}'
     8201                            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8202                            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8203                            ;;
     8204                        *)
     8205                            { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
     8206echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
     8207                            ;;
     8208                    esac
     8209                else
     8210                    do64bit_ok=yes
     8211                    CFLAGS="$CFLAGS +DD64"
     8212                    LDFLAGS_ARCH="+DD64"
     8213                fi
     8214            fi
     8215            ;;
     8216        HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
     8217            SHLIB_SUFFIX=".sl"
     8218            echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
     8219echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
     8220if test "${ac_cv_lib_dld_shl_load+set}" = set; then
     8221  echo $ECHO_N "(cached) $ECHO_C" >&6
     8222else
     8223  ac_check_lib_save_LIBS=$LIBS
     8224LIBS="-ldld  $LIBS"
     8225cat >conftest.$ac_ext <<_ACEOF
     8226/* confdefs.h.  */
     8227_ACEOF
     8228cat confdefs.h >>conftest.$ac_ext
     8229cat >>conftest.$ac_ext <<_ACEOF
     8230/* end confdefs.h.  */
     8231
     8232/* Override any gcc2 internal prototype to avoid an error.  */
     8233#ifdef __cplusplus
     8234extern "C"
     8235#endif
     8236/* We use char because int might match the return type of a gcc2
     8237   builtin and then its argument prototype would still apply.  */
     8238char shl_load ();
     8239int
     8240main ()
     8241{
     8242shl_load ();
     8243  ;
     8244  return 0;
     8245}
     8246_ACEOF
     8247rm -f conftest.$ac_objext conftest$ac_exeext
     8248if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     8249  (eval $ac_link) 2>conftest.er1
     8250  ac_status=$?
     8251  grep -v '^ *+' conftest.er1 >conftest.err
     8252  rm -f conftest.er1
     8253  cat conftest.err >&5
     8254  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8255  (exit $ac_status); } &&
     8256         { ac_try='test -z "$ac_c_werror_flag"
     8257                         || test ! -s conftest.err'
     8258  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8259  (eval $ac_try) 2>&5
     8260  ac_status=$?
     8261  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8262  (exit $ac_status); }; } &&
     8263         { ac_try='test -s conftest$ac_exeext'
     8264  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8265  (eval $ac_try) 2>&5
     8266  ac_status=$?
     8267  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8268  (exit $ac_status); }; }; then
     8269  ac_cv_lib_dld_shl_load=yes
     8270else
     8271  echo "$as_me: failed program was:" >&5
     8272sed 's/^/| /' conftest.$ac_ext >&5
     8273
     8274ac_cv_lib_dld_shl_load=no
     8275fi
     8276rm -f conftest.err conftest.$ac_objext \
     8277      conftest$ac_exeext conftest.$ac_ext
     8278LIBS=$ac_check_lib_save_LIBS
     8279fi
     8280echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
     8281echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
     8282if test $ac_cv_lib_dld_shl_load = yes; then
     8283  tcl_ok=yes
     8284else
     8285  tcl_ok=no
     8286fi
     8287
     8288            if test "$tcl_ok" = yes; then
     8289                SHLIB_CFLAGS="+z"
     8290                SHLIB_LD="ld -b"
     8291                SHLIB_LD_LIBS=""
     8292                DL_OBJS="tclLoadShl.o"
     8293                DL_LIBS="-ldld"
     8294                LDFLAGS="$LDFLAGS -Wl,-E"
     8295                CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
     8296                LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
     8297                LD_LIBRARY_PATH_VAR="SHLIB_PATH"
     8298            fi
     8299            ;;
     8300        IRIX-5.*)
     8301            SHLIB_CFLAGS=""
     8302            SHLIB_LD="ld -shared -rdata_shared"
     8303            SHLIB_LD_LIBS='${LIBS}'
     8304            SHLIB_SUFFIX=".so"
     8305            DL_OBJS="tclLoadDl.o"
     8306            DL_LIBS=""
     8307            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8308            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8309            ;;
     8310        IRIX-6.*)
     8311            SHLIB_CFLAGS=""
     8312            SHLIB_LD="ld -n32 -shared -rdata_shared"
     8313            SHLIB_LD_LIBS='${LIBS}'
     8314            SHLIB_SUFFIX=".so"
     8315            DL_OBJS="tclLoadDl.o"
     8316            DL_LIBS=""
     8317            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8318            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8319            if test "$GCC" = "yes" ; then
     8320                CFLAGS="$CFLAGS -mabi=n32"
     8321                LDFLAGS="$LDFLAGS -mabi=n32"
     8322            else
     8323                case $system in
     8324                    IRIX-6.3)
     8325                        # Use to build 6.2 compatible binaries on 6.3.
     8326                        CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
     8327                        ;;
     8328                    *)
     8329                        CFLAGS="$CFLAGS -n32"
     8330                        ;;
     8331                esac
     8332                LDFLAGS="$LDFLAGS -n32"
     8333            fi
     8334            ;;
     8335        IRIX64-6.*)
     8336            SHLIB_CFLAGS=""
     8337            SHLIB_LD="ld -n32 -shared -rdata_shared"
     8338            SHLIB_LD_LIBS='${LIBS}'
     8339            SHLIB_SUFFIX=".so"
     8340            DL_OBJS="tclLoadDl.o"
     8341            DL_LIBS=""
     8342            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8343            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8344
     8345            # Check to enable 64-bit flags for compiler/linker
     8346
     8347            if test "$do64bit" = "yes" ; then
     8348                if test "$GCC" = "yes" ; then
     8349                    { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5
     8350echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
     8351                else
     8352                    do64bit_ok=yes
     8353                    SHLIB_LD="ld -64 -shared -rdata_shared"
     8354                    CFLAGS="$CFLAGS -64"
     8355                    LDFLAGS_ARCH="-64"
     8356                fi
     8357            fi
     8358            ;;
     8359        Linux*)
     8360            SHLIB_CFLAGS="-fPIC"
     8361            SHLIB_LD_LIBS='${LIBS}'
     8362            SHLIB_SUFFIX=".so"
     8363
     8364            CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
     8365            # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
     8366            # when you inline the string and math operations.  Turn this off to
     8367            # get rid of the warnings.
     8368            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
     8369
     8370            SHLIB_LD="${CC} -shared"
     8371            DL_OBJS="tclLoadDl.o"
     8372            DL_LIBS="-ldl"
     8373            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
     8374            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8375            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8376            if test "`uname -m`" = "alpha" ; then
     8377                CFLAGS="$CFLAGS -mieee"
     8378            fi
     8379
     8380            # The combo of gcc + glibc has a bug related
     8381            # to inlining of functions like strtod(). The
     8382            # -fno-builtin flag should address this problem
     8383            # but it does not work. The -fno-inline flag
     8384            # is kind of overkill but it works.
     8385            # Disable inlining only when one of the
     8386            # files in compat/*.c is being linked in.
     8387            if test x"${USE_COMPAT}" != x ; then
     8388                CFLAGS="$CFLAGS -fno-inline"
     8389            fi
     8390
     8391            ;;
     8392        GNU*)
     8393            SHLIB_CFLAGS="-fPIC"
     8394            SHLIB_LD_LIBS='${LIBS}'
     8395            SHLIB_SUFFIX=".so"
     8396
     8397            SHLIB_LD="${CC} -shared"
     8398            DL_OBJS=""
     8399            DL_LIBS="-ldl"
     8400            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
     8401            CC_SEARCH_FLAGS=""
     8402            LD_SEARCH_FLAGS=""
     8403            if test "`uname -m`" = "alpha" ; then
     8404                CFLAGS="$CFLAGS -mieee"
     8405            fi
     8406            ;;
     8407        Lynx*)
     8408            SHLIB_CFLAGS="-fPIC"
     8409            SHLIB_LD_LIBS='${LIBS}'
     8410            SHLIB_SUFFIX=".so"
     8411            CFLAGS_OPTIMIZE=-02
     8412            SHLIB_LD="${CC} -shared "
     8413            DL_OBJS="tclLoadDl.o"
     8414            DL_LIBS="-mshared -ldl"
     8415            LD_FLAGS="-Wl,--export-dynamic"
     8416            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8417            LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8418            ;;
     8419        MP-RAS-02*)
     8420            SHLIB_CFLAGS="-K PIC"
     8421            SHLIB_LD="cc -G"
     8422            SHLIB_LD_LIBS=""
     8423            SHLIB_SUFFIX=".so"
     8424            DL_OBJS="tclLoadDl.o"
     8425            DL_LIBS="-ldl"
     8426            CC_SEARCH_FLAGS=""
     8427            LD_SEARCH_FLAGS=""
     8428            ;;
     8429        MP-RAS-*)
     8430            SHLIB_CFLAGS="-K PIC"
     8431            SHLIB_LD="cc -G"
     8432            SHLIB_LD_LIBS=""
     8433            SHLIB_SUFFIX=".so"
     8434            DL_OBJS="tclLoadDl.o"
     8435            DL_LIBS="-ldl"
     8436            LDFLAGS="$LDFLAGS -Wl,-Bexport"
     8437            CC_SEARCH_FLAGS=""
     8438            LD_SEARCH_FLAGS=""
     8439            ;;
     8440        NetBSD-*|FreeBSD-[1-2].*)
     8441            # NetBSD/SPARC needs -fPIC, -fpic will not do.
     8442            SHLIB_CFLAGS="-fPIC"
     8443            SHLIB_LD="ld -Bshareable -x"
     8444            SHLIB_LD_LIBS='${LIBS}'
     8445            SHLIB_SUFFIX=".so"
     8446            DL_OBJS="tclLoadDl.o"
     8447            DL_LIBS=""
     8448            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8449            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8450            echo "$as_me:$LINENO: checking for ELF" >&5
     8451echo $ECHO_N "checking for ELF... $ECHO_C" >&6
     8452if test "${tcl_cv_ld_elf+set}" = set; then
     8453  echo $ECHO_N "(cached) $ECHO_C" >&6
     8454else
     8455
     8456                cat >conftest.$ac_ext <<_ACEOF
     8457/* confdefs.h.  */
     8458_ACEOF
     8459cat confdefs.h >>conftest.$ac_ext
     8460cat >>conftest.$ac_ext <<_ACEOF
     8461/* end confdefs.h.  */
     8462
     8463#ifdef __ELF__
     8464        yes
     8465#endif
     8466
     8467_ACEOF
     8468if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     8469  $EGREP "yes" >/dev/null 2>&1; then
     8470  tcl_cv_ld_elf=yes
     8471else
     8472  tcl_cv_ld_elf=no
     8473fi
     8474rm -f conftest*
     8475
     8476fi
     8477echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5
     8478echo "${ECHO_T}$tcl_cv_ld_elf" >&6
     8479            if test $tcl_cv_ld_elf = yes; then
     8480                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
     8481            else
     8482                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     8483            fi
     8484
     8485            # Ancient FreeBSD doesn't handle version numbers with dots.
     8486
     8487            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     8488            TCL_LIB_VERSIONS_OK=nodots
     8489            ;;
     8490        OpenBSD-*)
     8491            # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
     8492            case `machine` in
     8493            sparc|sparc64)
     8494                SHLIB_CFLAGS="-fPIC";;
     8495            *)
     8496                SHLIB_CFLAGS="-fpic";;
     8497            esac
     8498            SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
     8499            SHLIB_LD_LIBS='${LIBS}'
     8500            SHLIB_SUFFIX=".so"
     8501            DL_OBJS="tclLoadDl.o"
     8502            DL_LIBS=""
     8503            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8504            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8505            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     8506            echo "$as_me:$LINENO: checking for ELF" >&5
     8507echo $ECHO_N "checking for ELF... $ECHO_C" >&6
     8508if test "${tcl_cv_ld_elf+set}" = set; then
     8509  echo $ECHO_N "(cached) $ECHO_C" >&6
     8510else
     8511
     8512                cat >conftest.$ac_ext <<_ACEOF
     8513/* confdefs.h.  */
     8514_ACEOF
     8515cat confdefs.h >>conftest.$ac_ext
     8516cat >>conftest.$ac_ext <<_ACEOF
     8517/* end confdefs.h.  */
     8518
     8519#ifdef __ELF__
     8520        yes
     8521#endif
     8522
     8523_ACEOF
     8524if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     8525  $EGREP "yes" >/dev/null 2>&1; then
     8526  tcl_cv_ld_elf=yes
     8527else
     8528  tcl_cv_ld_elf=no
     8529fi
     8530rm -f conftest*
     8531
     8532fi
     8533echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5
     8534echo "${ECHO_T}$tcl_cv_ld_elf" >&6
     8535            if test $tcl_cv_ld_elf = yes; then
     8536                LDFLAGS=-Wl,-export-dynamic
     8537            else
     8538                LDFLAGS=""
     8539            fi
     8540
     8541            # OpenBSD doesn't do version numbers with dots.
     8542            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     8543            TCL_LIB_VERSIONS_OK=nodots
     8544            ;;
     8545        FreeBSD-*)
     8546            # FreeBSD 3.* and greater have ELF.
     8547            SHLIB_CFLAGS="-fPIC"
     8548            SHLIB_LD="ld -Bshareable -x"
     8549            SHLIB_LD_LIBS='${LIBS}'
     8550            SHLIB_SUFFIX=".so"
     8551            DL_OBJS="tclLoadDl.o"
     8552            DL_LIBS=""
     8553            LDFLAGS="$LDFLAGS -export-dynamic"
     8554            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8555            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8556            if test "${TCL_THREADS}" = "1" ; then
     8557                # The -pthread needs to go in the CFLAGS, not LIBS
     8558                LIBS=`echo $LIBS | sed s/-pthread//`
     8559                CFLAGS="$CFLAGS -pthread"
     8560                LDFLAGS="$LDFLAGS -pthread"
     8561            fi
     8562            case $system in
     8563            FreeBSD-3.*)
     8564                # FreeBSD-3 doesn't handle version numbers with dots.
     8565                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     8566                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
     8567                TCL_LIB_VERSIONS_OK=nodots
     8568                ;;
     8569            esac
     8570            ;;
     8571        Darwin-*)
     8572            CFLAGS_OPTIMIZE="-Os"
     8573            SHLIB_CFLAGS="-fno-common"
     8574            if test $do64bit = yes; then
     8575                do64bit_ok=yes
     8576                CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
     8577            fi
     8578            # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
     8579            SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
     8580            echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5
     8581echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6
     8582if test "${tcl_cv_ld_single_module+set}" = set; then
     8583  echo $ECHO_N "(cached) $ECHO_C" >&6
     8584else
     8585
     8586                hold_ldflags=$LDFLAGS
     8587                LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
     8588                cat >conftest.$ac_ext <<_ACEOF
     8589/* confdefs.h.  */
     8590_ACEOF
     8591cat confdefs.h >>conftest.$ac_ext
     8592cat >>conftest.$ac_ext <<_ACEOF
     8593/* end confdefs.h.  */
     8594
     8595int
     8596main ()
     8597{
     8598int i;
     8599  ;
     8600  return 0;
     8601}
     8602_ACEOF
     8603rm -f conftest.$ac_objext conftest$ac_exeext
     8604if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     8605  (eval $ac_link) 2>conftest.er1
     8606  ac_status=$?
     8607  grep -v '^ *+' conftest.er1 >conftest.err
     8608  rm -f conftest.er1
     8609  cat conftest.err >&5
     8610  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8611  (exit $ac_status); } &&
     8612         { ac_try='test -z "$ac_c_werror_flag"
     8613                         || test ! -s conftest.err'
     8614  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8615  (eval $ac_try) 2>&5
     8616  ac_status=$?
     8617  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8618  (exit $ac_status); }; } &&
     8619         { ac_try='test -s conftest$ac_exeext'
     8620  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8621  (eval $ac_try) 2>&5
     8622  ac_status=$?
     8623  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8624  (exit $ac_status); }; }; then
     8625  tcl_cv_ld_single_module=yes
     8626else
     8627  echo "$as_me: failed program was:" >&5
     8628sed 's/^/| /' conftest.$ac_ext >&5
     8629
     8630tcl_cv_ld_single_module=no
     8631fi
     8632rm -f conftest.err conftest.$ac_objext \
     8633      conftest$ac_exeext conftest.$ac_ext
     8634                LDFLAGS=$hold_ldflags
     8635fi
     8636echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5
     8637echo "${ECHO_T}$tcl_cv_ld_single_module" >&6
     8638            if test $tcl_cv_ld_single_module = yes; then
     8639                SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
     8640            fi
     8641            SHLIB_LD_LIBS='${LIBS}'
     8642            SHLIB_SUFFIX=".dylib"
     8643            DL_OBJS="tclLoadDyld.o"
     8644            DL_LIBS=""
     8645            # Don't use -prebind when building for Mac OS X 10.4 or later only:
     8646            test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
     8647                test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \
     8648                LDFLAGS="$LDFLAGS -prebind"
     8649            LDFLAGS="$LDFLAGS -headerpad_max_install_names"
     8650            echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5
     8651echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6
     8652if test "${tcl_cv_ld_search_paths_first+set}" = set; then
     8653  echo $ECHO_N "(cached) $ECHO_C" >&6
     8654else
     8655
     8656                hold_ldflags=$LDFLAGS
     8657                LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
     8658                cat >conftest.$ac_ext <<_ACEOF
     8659/* confdefs.h.  */
     8660_ACEOF
     8661cat confdefs.h >>conftest.$ac_ext
     8662cat >>conftest.$ac_ext <<_ACEOF
     8663/* end confdefs.h.  */
     8664
     8665int
     8666main ()
     8667{
     8668int i;
     8669  ;
     8670  return 0;
     8671}
     8672_ACEOF
     8673rm -f conftest.$ac_objext conftest$ac_exeext
     8674if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     8675  (eval $ac_link) 2>conftest.er1
     8676  ac_status=$?
     8677  grep -v '^ *+' conftest.er1 >conftest.err
     8678  rm -f conftest.er1
     8679  cat conftest.err >&5
     8680  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8681  (exit $ac_status); } &&
     8682         { ac_try='test -z "$ac_c_werror_flag"
     8683                         || test ! -s conftest.err'
     8684  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8685  (eval $ac_try) 2>&5
     8686  ac_status=$?
     8687  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8688  (exit $ac_status); }; } &&
     8689         { ac_try='test -s conftest$ac_exeext'
     8690  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     8691  (eval $ac_try) 2>&5
     8692  ac_status=$?
     8693  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     8694  (exit $ac_status); }; }; then
     8695  tcl_cv_ld_search_paths_first=yes
     8696else
     8697  echo "$as_me: failed program was:" >&5
     8698sed 's/^/| /' conftest.$ac_ext >&5
     8699
     8700tcl_cv_ld_search_paths_first=no
     8701fi
     8702rm -f conftest.err conftest.$ac_objext \
     8703      conftest$ac_exeext conftest.$ac_ext
     8704                LDFLAGS=$hold_ldflags
     8705fi
     8706echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5
     8707echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6
     8708            if test $tcl_cv_ld_search_paths_first = yes; then
     8709                LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
     8710            fi
     8711            CC_SEARCH_FLAGS=""
     8712            LD_SEARCH_FLAGS=""
     8713            LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
     8714
     8715            # TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
     8716            # for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
     8717            # at present (no 64bit GUI libraries).
     8718            test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
     8719                CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
     8720            ;;
     8721        NEXTSTEP-*)
     8722            SHLIB_CFLAGS=""
     8723            SHLIB_LD="cc -nostdlib -r"
     8724            SHLIB_LD_LIBS=""
     8725            SHLIB_SUFFIX=".so"
     8726            DL_OBJS="tclLoadNext.o"
     8727            DL_LIBS=""
     8728            CC_SEARCH_FLAGS=""
     8729            LD_SEARCH_FLAGS=""
     8730            ;;
     8731        OS/390-*)
     8732            CFLAGS_OPTIMIZE=""          # Optimizer is buggy
     8733
     8734cat >>confdefs.h <<\_ACEOF
     8735#define _OE_SOCKETS 1
     8736_ACEOF
     8737
     8738            ;;
     8739        OSF1-1.0|OSF1-1.1|OSF1-1.2)
     8740            # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
     8741            SHLIB_CFLAGS=""
     8742            # Hack: make package name same as library name
     8743            SHLIB_LD='ld -R -export :'
     8744            SHLIB_LD_LIBS=""
     8745            SHLIB_SUFFIX=".so"
     8746            DL_OBJS="tclLoadOSF.o"
     8747            DL_LIBS=""
     8748            CC_SEARCH_FLAGS=""
     8749            LD_SEARCH_FLAGS=""
     8750            ;;
     8751        OSF1-1.*)
     8752            # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
     8753            SHLIB_CFLAGS="-fPIC"
     8754            if test "$SHARED_BUILD" = "1" ; then
     8755                SHLIB_LD="ld -shared"
     8756            else
     8757                SHLIB_LD="ld -non_shared"
     8758            fi
     8759            SHLIB_LD_LIBS=""
     8760            SHLIB_SUFFIX=".so"
     8761            DL_OBJS="tclLoadDl.o"
     8762            DL_LIBS=""
     8763            CC_SEARCH_FLAGS=""
     8764            LD_SEARCH_FLAGS=""
     8765            ;;
     8766        OSF1-V*)
     8767            # Digital OSF/1
     8768            SHLIB_CFLAGS=""
     8769            if test "$SHARED_BUILD" = "1" ; then
     8770                SHLIB_LD='ld -shared -expect_unresolved "*"'
     8771            else
     8772                SHLIB_LD='ld -non_shared -expect_unresolved "*"'
     8773            fi
     8774            SHLIB_LD_LIBS=""
     8775            SHLIB_SUFFIX=".so"
     8776            DL_OBJS="tclLoadDl.o"
     8777            DL_LIBS=""
     8778            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     8779            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     8780            if test "$GCC" = "yes" ; then
     8781                CFLAGS="$CFLAGS -mieee"
     8782            else
     8783                CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
     8784            fi
     8785            # see pthread_intro(3) for pthread support on osf1, k.furukawa
     8786            if test "${TCL_THREADS}" = "1" ; then
     8787                CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
     8788                CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
     8789                LIBS=`echo $LIBS | sed s/-lpthreads//`
     8790                if test "$GCC" = "yes" ; then
     8791                    LIBS="$LIBS -lpthread -lmach -lexc"
     8792                else
     8793                    CFLAGS="$CFLAGS -pthread"
     8794                    LDFLAGS="$LDFLAGS -pthread"
     8795                fi
     8796            fi
     8797
     8798            ;;
     8799        QNX-6*)
     8800            # QNX RTP
     8801            # This may work for all QNX, but it was only reported for v6.
     8802            SHLIB_CFLAGS="-fPIC"
     8803            SHLIB_LD="ld -Bshareable -x"
     8804            SHLIB_LD_LIBS=""
     8805            SHLIB_SUFFIX=".so"
     8806            DL_OBJS="tclLoadDl.o"
     8807            # dlopen is in -lc on QNX
     8808            DL_LIBS=""
     8809            CC_SEARCH_FLAGS=""
     8810            LD_SEARCH_FLAGS=""
     8811            ;;
     8812        SCO_SV-3.2*)
     8813            # Note, dlopen is available only on SCO 3.2.5 and greater. However,
     8814            # this test works, since "uname -s" was non-standard in 3.2.4 and
     8815            # below.
     8816            if test "$GCC" = "yes" ; then
     8817                SHLIB_CFLAGS="-fPIC -melf"
     8818                LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
     8819            else
     8820                SHLIB_CFLAGS="-Kpic -belf"
     8821                LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
     8822            fi
     8823            SHLIB_LD="ld -G"
     8824            SHLIB_LD_LIBS=""
     8825            SHLIB_SUFFIX=".so"
     8826            DL_OBJS="tclLoadDl.o"
     8827            DL_LIBS=""
     8828            CC_SEARCH_FLAGS=""
     8829            LD_SEARCH_FLAGS=""
     8830            ;;
     8831        SINIX*5.4*)
     8832            SHLIB_CFLAGS="-K PIC"
     8833            SHLIB_LD="cc -G"
     8834            SHLIB_LD_LIBS=""
     8835            SHLIB_SUFFIX=".so"
     8836            DL_OBJS="tclLoadDl.o"
     8837            DL_LIBS="-ldl"
     8838            CC_SEARCH_FLAGS=""
     8839            LD_SEARCH_FLAGS=""
     8840            ;;
     8841        SunOS-4*)
     8842            SHLIB_CFLAGS="-PIC"
     8843            SHLIB_LD="ld"
     8844            SHLIB_LD_LIBS=""
     8845            SHLIB_SUFFIX=".so"
     8846            DL_OBJS="tclLoadDl.o"
     8847            DL_LIBS="-ldl"
     8848            CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     8849            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8850
     8851            # SunOS can't handle version numbers with dots in them in library
     8852            # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
     8853            # requires an extra version number at the end of .so file names.
     8854            # So, the library has to have a name like libtcl75.so.1.0
     8855
     8856            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     8857            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     8858            TCL_LIB_VERSIONS_OK=nodots
     8859            ;;
     8860        SunOS-5.[0-6])
     8861            # Careful to not let 5.10+ fall into this case
     8862
     8863            # Note: If _REENTRANT isn't defined, then Solaris
     8864            # won't define thread-safe library routines.
     8865
     8866
     8867cat >>confdefs.h <<\_ACEOF
     8868#define _REENTRANT 1
     8869_ACEOF
     8870
     8871
     8872cat >>confdefs.h <<\_ACEOF
     8873#define _POSIX_PTHREAD_SEMANTICS 1
     8874_ACEOF
     8875
     8876
     8877            SHLIB_CFLAGS="-KPIC"
     8878
     8879            # Note: need the LIBS below, otherwise Tk won't find Tcl's
     8880            # symbols when dynamically loaded into tclsh.
     8881
     8882            SHLIB_LD_LIBS='${LIBS}'
     8883            SHLIB_SUFFIX=".so"
     8884            DL_OBJS="tclLoadDl.o"
     8885            DL_LIBS="-ldl"
     8886            if test "$GCC" = "yes" ; then
     8887                SHLIB_LD="$CC -shared"
     8888                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     8889                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8890            else
     8891                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     8892                CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
     8893                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8894            fi
     8895            ;;
     8896        SunOS-5*)
     8897            # Note: If _REENTRANT isn't defined, then Solaris
     8898            # won't define thread-safe library routines.
     8899
     8900
     8901cat >>confdefs.h <<\_ACEOF
     8902#define _REENTRANT 1
     8903_ACEOF
     8904
     8905
     8906cat >>confdefs.h <<\_ACEOF
     8907#define _POSIX_PTHREAD_SEMANTICS 1
     8908_ACEOF
     8909
     8910
     8911            SHLIB_CFLAGS="-KPIC"
     8912
     8913            # Check to enable 64-bit flags for compiler/linker
     8914            if test "$do64bit" = "yes" ; then
     8915                arch=`isainfo`
     8916                if test "$arch" = "sparcv9 sparc" ; then
     8917                        if test "$GCC" = "yes" ; then
     8918                            if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then
     8919                                { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
     8920echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
     8921                            else
     8922                                do64bit_ok=yes
     8923                                CFLAGS="$CFLAGS -m64 -mcpu=v9"
     8924                                LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
     8925                                SHLIB_CFLAGS="-fPIC"
     8926                            fi
     8927                        else
     8928                            do64bit_ok=yes
     8929                            if test "$do64bitVIS" = "yes" ; then
     8930                                CFLAGS="$CFLAGS -xarch=v9a"
     8931                                LDFLAGS_ARCH="-xarch=v9a"
     8932                            else
     8933                                CFLAGS="$CFLAGS -xarch=v9"
     8934                                LDFLAGS_ARCH="-xarch=v9"
     8935                            fi
     8936                            # Solaris 64 uses this as well
     8937                            #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
     8938                        fi
     8939                elif test "$arch" = "amd64 i386" ; then
     8940                    if test "$GCC" = "yes" ; then
     8941                        { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
     8942echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
     8943                    else
     8944                        do64bit_ok=yes
     8945                        CFLAGS="$CFLAGS -xarch=amd64"
     8946                        LDFLAGS="$LDFLAGS -xarch=amd64"
     8947                    fi
     8948                else
     8949                    { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5
     8950echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
     8951                fi
     8952            fi
     8953
     8954            # Note: need the LIBS below, otherwise Tk won't find Tcl's
     8955            # symbols when dynamically loaded into tclsh.
     8956
     8957            SHLIB_LD_LIBS='${LIBS}'
     8958            SHLIB_SUFFIX=".so"
     8959            DL_OBJS="tclLoadDl.o"
     8960            DL_LIBS="-ldl"
     8961            if test "$GCC" = "yes" ; then
     8962                SHLIB_LD="$CC -shared"
     8963                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     8964                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     8965                if test "$do64bit_ok" = "yes" ; then
     8966                    # We need to specify -static-libgcc or we need to
     8967                    # add the path to the sparv9 libgcc.
     8968                    # JH: static-libgcc is necessary for core Tcl, but may
     8969                    # not be necessary for extensions.
     8970                    SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
     8971                    # for finding sparcv9 libgcc, get the regular libgcc
     8972                    # path, remove so name and append 'sparcv9'
     8973                    #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
     8974                    #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
     8975                fi
     8976            else
     8977                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     8978                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     8979                LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
     8980            fi
     8981            ;;
     8982        UNIX_SV* | UnixWare-5*)
     8983            SHLIB_CFLAGS="-KPIC"
     8984            SHLIB_LD="cc -G"
     8985            SHLIB_LD_LIBS=""
     8986            SHLIB_SUFFIX=".so"
     8987            DL_OBJS="tclLoadDl.o"
     8988            DL_LIBS="-ldl"
     8989            # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
     8990            # that don't grok the -Bexport option.  Test that it does.
     8991            echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5
     8992echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6
     8993if test "${tcl_cv_ld_Bexport+set}" = set; then
     8994  echo $ECHO_N "(cached) $ECHO_C" >&6
     8995else
     8996
     8997                hold_ldflags=$LDFLAGS
     8998                LDFLAGS="$LDFLAGS -Wl,-Bexport"
     8999                cat >conftest.$ac_ext <<_ACEOF
     9000/* confdefs.h.  */
     9001_ACEOF
     9002cat confdefs.h >>conftest.$ac_ext
     9003cat >>conftest.$ac_ext <<_ACEOF
     9004/* end confdefs.h.  */
     9005
     9006int
     9007main ()
     9008{
     9009int i;
     9010  ;
     9011  return 0;
     9012}
     9013_ACEOF
     9014rm -f conftest.$ac_objext conftest$ac_exeext
     9015if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     9016  (eval $ac_link) 2>conftest.er1
     9017  ac_status=$?
     9018  grep -v '^ *+' conftest.er1 >conftest.err
     9019  rm -f conftest.er1
     9020  cat conftest.err >&5
     9021  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9022  (exit $ac_status); } &&
     9023         { ac_try='test -z "$ac_c_werror_flag"
     9024                         || test ! -s conftest.err'
     9025  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9026  (eval $ac_try) 2>&5
     9027  ac_status=$?
     9028  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9029  (exit $ac_status); }; } &&
     9030         { ac_try='test -s conftest$ac_exeext'
     9031  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9032  (eval $ac_try) 2>&5
     9033  ac_status=$?
     9034  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9035  (exit $ac_status); }; }; then
     9036  tcl_cv_ld_Bexport=yes
     9037else
     9038  echo "$as_me: failed program was:" >&5
     9039sed 's/^/| /' conftest.$ac_ext >&5
     9040
     9041tcl_cv_ld_Bexport=no
     9042fi
     9043rm -f conftest.err conftest.$ac_objext \
     9044      conftest$ac_exeext conftest.$ac_ext
     9045                LDFLAGS=$hold_ldflags
     9046fi
     9047echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5
     9048echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6
     9049            if test $tcl_cv_ld_Bexport = yes; then
     9050                LDFLAGS="$LDFLAGS -Wl,-Bexport"
     9051            fi
     9052            CC_SEARCH_FLAGS=""
     9053            LD_SEARCH_FLAGS=""
     9054            ;;
     9055    esac
     9056
     9057    if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
     9058        { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
     9059echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
     9060    fi
     9061
     9062    # Step 4: disable dynamic loading if requested via a command-line switch.
     9063
     9064    # Check whether --enable-load or --disable-load was given.
     9065if test "${enable_load+set}" = set; then
     9066  enableval="$enable_load"
     9067  tcl_ok=$enableval
     9068else
     9069  tcl_ok=yes
     9070fi;
     9071    if test "$tcl_ok" = "no"; then
     9072        DL_OBJS=""
     9073    fi
     9074
     9075    if test "x$DL_OBJS" != "x" ; then
     9076        BUILD_DLTEST="\$(DLTEST_TARGETS)"
    23609077    else
    2361         echo "$as_me:$LINENO: result: file not found" >&5
    2362 echo "${ECHO_T}file not found" >&6
     9078        echo "Can't figure out how to do dynamic loading or shared libraries"
     9079        echo "on this system."
     9080        SHLIB_CFLAGS=""
     9081        SHLIB_LD=""
     9082        SHLIB_SUFFIX=""
     9083        DL_OBJS="tclLoadNone.o"
     9084        DL_LIBS=""
     9085        LDFLAGS="$LDFLAGS_ORIG"
     9086        CC_SEARCH_FLAGS=""
     9087        LD_SEARCH_FLAGS=""
     9088        BUILD_DLTEST=""
    23639089    fi
    2364 
    2365     #
    2366     # The eval is required to do the TCL_DBGX substitution in the
    2367     # TCL_LIB_FILE variable
    2368     #
    2369 
    2370     eval TCL_LIB_FILE=${TCL_LIB_FILE}
    2371     eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
    2372 
    2373 
    2374 
    2375 
    2376 
    2377 
    2378 
    2379 
    2380 
    2381 
    2382 
    2383 
    2384 
    2385 
    2386 
     9090    LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
     9091
     9092    # If we're running gcc, then change the C flags for compiling shared
     9093    # libraries to the right flags for gcc, instead of those for the
     9094    # standard manufacturer compiler.
     9095
     9096    if test "$DL_OBJS" != "tclLoadNone.o" ; then
     9097        if test "$GCC" = "yes" ; then
     9098            case $system in
     9099                AIX-*)
     9100                    ;;
     9101                BSD/OS*)
     9102                    ;;
     9103                IRIX*)
     9104                    ;;
     9105                NetBSD-*|FreeBSD-*)
     9106                    ;;
     9107                Darwin-*)
     9108                    ;;
     9109                SCO_SV-3.2*)
     9110                    ;;
     9111                windows)
     9112                    ;;
     9113                *)
     9114                    SHLIB_CFLAGS="-fPIC"
     9115                    ;;
     9116            esac
     9117        fi
     9118    fi
     9119
     9120    if test "$SHARED_LIB_SUFFIX" = "" ; then
     9121        SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
     9122    fi
     9123    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
     9124        UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
     9125    fi
     9126
     9127
     9128
     9129
     9130
     9131
     9132
     9133
     9134
     9135
     9136
     9137
     9138
     9139
     9140
     9141    # These must be called after we do the basic CFLAGS checks and
     9142    # verify any possible 64-bit or similar switches are necessary
     9143
     9144    echo "$as_me:$LINENO: checking for required early compiler flags" >&5
     9145echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6
     9146    tcl_flags=""
     9147
     9148    if test "${tcl_cv_flag__isoc99_source+set}" = set; then
     9149  echo $ECHO_N "(cached) $ECHO_C" >&6
     9150else
     9151  cat >conftest.$ac_ext <<_ACEOF
     9152/* confdefs.h.  */
     9153_ACEOF
     9154cat confdefs.h >>conftest.$ac_ext
     9155cat >>conftest.$ac_ext <<_ACEOF
     9156/* end confdefs.h.  */
     9157#include <stdlib.h>
     9158int
     9159main ()
     9160{
     9161char *p = (char *)strtoll; char *q = (char *)strtoull;
     9162  ;
     9163  return 0;
     9164}
     9165_ACEOF
     9166rm -f conftest.$ac_objext
     9167if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9168  (eval $ac_compile) 2>conftest.er1
     9169  ac_status=$?
     9170  grep -v '^ *+' conftest.er1 >conftest.err
     9171  rm -f conftest.er1
     9172  cat conftest.err >&5
     9173  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9174  (exit $ac_status); } &&
     9175         { ac_try='test -z "$ac_c_werror_flag"
     9176                         || test ! -s conftest.err'
     9177  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9178  (eval $ac_try) 2>&5
     9179  ac_status=$?
     9180  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9181  (exit $ac_status); }; } &&
     9182         { ac_try='test -s conftest.$ac_objext'
     9183  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9184  (eval $ac_try) 2>&5
     9185  ac_status=$?
     9186  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9187  (exit $ac_status); }; }; then
     9188  tcl_cv_flag__isoc99_source=no
     9189else
     9190  echo "$as_me: failed program was:" >&5
     9191sed 's/^/| /' conftest.$ac_ext >&5
     9192
     9193cat >conftest.$ac_ext <<_ACEOF
     9194/* confdefs.h.  */
     9195_ACEOF
     9196cat confdefs.h >>conftest.$ac_ext
     9197cat >>conftest.$ac_ext <<_ACEOF
     9198/* end confdefs.h.  */
     9199#define _ISOC99_SOURCE 1
     9200#include <stdlib.h>
     9201int
     9202main ()
     9203{
     9204char *p = (char *)strtoll; char *q = (char *)strtoull;
     9205  ;
     9206  return 0;
     9207}
     9208_ACEOF
     9209rm -f conftest.$ac_objext
     9210if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9211  (eval $ac_compile) 2>conftest.er1
     9212  ac_status=$?
     9213  grep -v '^ *+' conftest.er1 >conftest.err
     9214  rm -f conftest.er1
     9215  cat conftest.err >&5
     9216  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9217  (exit $ac_status); } &&
     9218         { ac_try='test -z "$ac_c_werror_flag"
     9219                         || test ! -s conftest.err'
     9220  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9221  (eval $ac_try) 2>&5
     9222  ac_status=$?
     9223  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9224  (exit $ac_status); }; } &&
     9225         { ac_try='test -s conftest.$ac_objext'
     9226  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9227  (eval $ac_try) 2>&5
     9228  ac_status=$?
     9229  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9230  (exit $ac_status); }; }; then
     9231  tcl_cv_flag__isoc99_source=yes
     9232else
     9233  echo "$as_me: failed program was:" >&5
     9234sed 's/^/| /' conftest.$ac_ext >&5
     9235
     9236tcl_cv_flag__isoc99_source=no
     9237fi
     9238rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9239fi
     9240rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9241fi
     9242
     9243    if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
     9244
     9245cat >>confdefs.h <<\_ACEOF
     9246#define _ISOC99_SOURCE 1
     9247_ACEOF
     9248
     9249        tcl_flags="$tcl_flags _ISOC99_SOURCE"
     9250    fi
     9251
     9252
     9253    if test "${tcl_cv_flag__largefile64_source+set}" = set; then
     9254  echo $ECHO_N "(cached) $ECHO_C" >&6
     9255else
     9256  cat >conftest.$ac_ext <<_ACEOF
     9257/* confdefs.h.  */
     9258_ACEOF
     9259cat confdefs.h >>conftest.$ac_ext
     9260cat >>conftest.$ac_ext <<_ACEOF
     9261/* end confdefs.h.  */
     9262#include <sys/stat.h>
     9263int
     9264main ()
     9265{
     9266struct stat64 buf; int i = stat64("/", &buf);
     9267  ;
     9268  return 0;
     9269}
     9270_ACEOF
     9271rm -f conftest.$ac_objext
     9272if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9273  (eval $ac_compile) 2>conftest.er1
     9274  ac_status=$?
     9275  grep -v '^ *+' conftest.er1 >conftest.err
     9276  rm -f conftest.er1
     9277  cat conftest.err >&5
     9278  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9279  (exit $ac_status); } &&
     9280         { ac_try='test -z "$ac_c_werror_flag"
     9281                         || test ! -s conftest.err'
     9282  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9283  (eval $ac_try) 2>&5
     9284  ac_status=$?
     9285  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9286  (exit $ac_status); }; } &&
     9287         { ac_try='test -s conftest.$ac_objext'
     9288  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9289  (eval $ac_try) 2>&5
     9290  ac_status=$?
     9291  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9292  (exit $ac_status); }; }; then
     9293  tcl_cv_flag__largefile64_source=no
     9294else
     9295  echo "$as_me: failed program was:" >&5
     9296sed 's/^/| /' conftest.$ac_ext >&5
     9297
     9298cat >conftest.$ac_ext <<_ACEOF
     9299/* confdefs.h.  */
     9300_ACEOF
     9301cat confdefs.h >>conftest.$ac_ext
     9302cat >>conftest.$ac_ext <<_ACEOF
     9303/* end confdefs.h.  */
     9304#define _LARGEFILE64_SOURCE 1
     9305#include <sys/stat.h>
     9306int
     9307main ()
     9308{
     9309struct stat64 buf; int i = stat64("/", &buf);
     9310  ;
     9311  return 0;
     9312}
     9313_ACEOF
     9314rm -f conftest.$ac_objext
     9315if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9316  (eval $ac_compile) 2>conftest.er1
     9317  ac_status=$?
     9318  grep -v '^ *+' conftest.er1 >conftest.err
     9319  rm -f conftest.er1
     9320  cat conftest.err >&5
     9321  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9322  (exit $ac_status); } &&
     9323         { ac_try='test -z "$ac_c_werror_flag"
     9324                         || test ! -s conftest.err'
     9325  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9326  (eval $ac_try) 2>&5
     9327  ac_status=$?
     9328  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9329  (exit $ac_status); }; } &&
     9330         { ac_try='test -s conftest.$ac_objext'
     9331  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9332  (eval $ac_try) 2>&5
     9333  ac_status=$?
     9334  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9335  (exit $ac_status); }; }; then
     9336  tcl_cv_flag__largefile64_source=yes
     9337else
     9338  echo "$as_me: failed program was:" >&5
     9339sed 's/^/| /' conftest.$ac_ext >&5
     9340
     9341tcl_cv_flag__largefile64_source=no
     9342fi
     9343rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9344fi
     9345rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9346fi
     9347
     9348    if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
     9349
     9350cat >>confdefs.h <<\_ACEOF
     9351#define _LARGEFILE64_SOURCE 1
     9352_ACEOF
     9353
     9354        tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
     9355    fi
     9356
     9357
     9358    if test "${tcl_cv_flag__largefile_source64+set}" = set; then
     9359  echo $ECHO_N "(cached) $ECHO_C" >&6
     9360else
     9361  cat >conftest.$ac_ext <<_ACEOF
     9362/* confdefs.h.  */
     9363_ACEOF
     9364cat confdefs.h >>conftest.$ac_ext
     9365cat >>conftest.$ac_ext <<_ACEOF
     9366/* end confdefs.h.  */
     9367#include <sys/stat.h>
     9368int
     9369main ()
     9370{
     9371char *p = (char *)open64;
     9372  ;
     9373  return 0;
     9374}
     9375_ACEOF
     9376rm -f conftest.$ac_objext
     9377if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9378  (eval $ac_compile) 2>conftest.er1
     9379  ac_status=$?
     9380  grep -v '^ *+' conftest.er1 >conftest.err
     9381  rm -f conftest.er1
     9382  cat conftest.err >&5
     9383  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9384  (exit $ac_status); } &&
     9385         { ac_try='test -z "$ac_c_werror_flag"
     9386                         || test ! -s conftest.err'
     9387  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9388  (eval $ac_try) 2>&5
     9389  ac_status=$?
     9390  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9391  (exit $ac_status); }; } &&
     9392         { ac_try='test -s conftest.$ac_objext'
     9393  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9394  (eval $ac_try) 2>&5
     9395  ac_status=$?
     9396  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9397  (exit $ac_status); }; }; then
     9398  tcl_cv_flag__largefile_source64=no
     9399else
     9400  echo "$as_me: failed program was:" >&5
     9401sed 's/^/| /' conftest.$ac_ext >&5
     9402
     9403cat >conftest.$ac_ext <<_ACEOF
     9404/* confdefs.h.  */
     9405_ACEOF
     9406cat confdefs.h >>conftest.$ac_ext
     9407cat >>conftest.$ac_ext <<_ACEOF
     9408/* end confdefs.h.  */
     9409#define _LARGEFILE_SOURCE64 1
     9410#include <sys/stat.h>
     9411int
     9412main ()
     9413{
     9414char *p = (char *)open64;
     9415  ;
     9416  return 0;
     9417}
     9418_ACEOF
     9419rm -f conftest.$ac_objext
     9420if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9421  (eval $ac_compile) 2>conftest.er1
     9422  ac_status=$?
     9423  grep -v '^ *+' conftest.er1 >conftest.err
     9424  rm -f conftest.er1
     9425  cat conftest.err >&5
     9426  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9427  (exit $ac_status); } &&
     9428         { ac_try='test -z "$ac_c_werror_flag"
     9429                         || test ! -s conftest.err'
     9430  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9431  (eval $ac_try) 2>&5
     9432  ac_status=$?
     9433  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9434  (exit $ac_status); }; } &&
     9435         { ac_try='test -s conftest.$ac_objext'
     9436  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9437  (eval $ac_try) 2>&5
     9438  ac_status=$?
     9439  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9440  (exit $ac_status); }; }; then
     9441  tcl_cv_flag__largefile_source64=yes
     9442else
     9443  echo "$as_me: failed program was:" >&5
     9444sed 's/^/| /' conftest.$ac_ext >&5
     9445
     9446tcl_cv_flag__largefile_source64=no
     9447fi
     9448rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9449fi
     9450rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9451fi
     9452
     9453    if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
     9454
     9455cat >>confdefs.h <<\_ACEOF
     9456#define _LARGEFILE_SOURCE64 1
     9457_ACEOF
     9458
     9459        tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
     9460    fi
     9461
     9462    if test "x${tcl_flags}" = "x" ; then
     9463        echo "$as_me:$LINENO: result: none" >&5
     9464echo "${ECHO_T}none" >&6
     9465    else
     9466        echo "$as_me:$LINENO: result: ${tcl_flags}" >&5
     9467echo "${ECHO_T}${tcl_flags}" >&6
     9468    fi
     9469
     9470
     9471    echo "$as_me:$LINENO: checking for 64-bit integer type" >&5
     9472echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6
     9473    if test "${tcl_cv_type_64bit+set}" = set; then
     9474  echo $ECHO_N "(cached) $ECHO_C" >&6
     9475else
     9476
     9477        tcl_cv_type_64bit=none
     9478        # See if the compiler knows natively about __int64
     9479        cat >conftest.$ac_ext <<_ACEOF
     9480/* confdefs.h.  */
     9481_ACEOF
     9482cat confdefs.h >>conftest.$ac_ext
     9483cat >>conftest.$ac_ext <<_ACEOF
     9484/* end confdefs.h.  */
     9485
     9486int
     9487main ()
     9488{
     9489__int64 value = (__int64) 0;
     9490  ;
     9491  return 0;
     9492}
     9493_ACEOF
     9494rm -f conftest.$ac_objext
     9495if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9496  (eval $ac_compile) 2>conftest.er1
     9497  ac_status=$?
     9498  grep -v '^ *+' conftest.er1 >conftest.err
     9499  rm -f conftest.er1
     9500  cat conftest.err >&5
     9501  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9502  (exit $ac_status); } &&
     9503         { ac_try='test -z "$ac_c_werror_flag"
     9504                         || test ! -s conftest.err'
     9505  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9506  (eval $ac_try) 2>&5
     9507  ac_status=$?
     9508  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9509  (exit $ac_status); }; } &&
     9510         { ac_try='test -s conftest.$ac_objext'
     9511  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9512  (eval $ac_try) 2>&5
     9513  ac_status=$?
     9514  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9515  (exit $ac_status); }; }; then
     9516  tcl_type_64bit=__int64
     9517else
     9518  echo "$as_me: failed program was:" >&5
     9519sed 's/^/| /' conftest.$ac_ext >&5
     9520
     9521tcl_type_64bit="long long"
     9522fi
     9523rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9524        # See if we should use long anyway  Note that we substitute in the
     9525        # type that is our current guess for a 64-bit type inside this check
     9526        # program, so it should be modified only carefully...
     9527        cat >conftest.$ac_ext <<_ACEOF
     9528/* confdefs.h.  */
     9529_ACEOF
     9530cat confdefs.h >>conftest.$ac_ext
     9531cat >>conftest.$ac_ext <<_ACEOF
     9532/* end confdefs.h.  */
     9533
     9534int
     9535main ()
     9536{
     9537switch (0) {
     9538            case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
     9539        }
     9540  ;
     9541  return 0;
     9542}
     9543_ACEOF
     9544rm -f conftest.$ac_objext
     9545if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9546  (eval $ac_compile) 2>conftest.er1
     9547  ac_status=$?
     9548  grep -v '^ *+' conftest.er1 >conftest.err
     9549  rm -f conftest.er1
     9550  cat conftest.err >&5
     9551  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9552  (exit $ac_status); } &&
     9553         { ac_try='test -z "$ac_c_werror_flag"
     9554                         || test ! -s conftest.err'
     9555  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9556  (eval $ac_try) 2>&5
     9557  ac_status=$?
     9558  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9559  (exit $ac_status); }; } &&
     9560         { ac_try='test -s conftest.$ac_objext'
     9561  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9562  (eval $ac_try) 2>&5
     9563  ac_status=$?
     9564  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9565  (exit $ac_status); }; }; then
     9566  tcl_cv_type_64bit=${tcl_type_64bit}
     9567else
     9568  echo "$as_me: failed program was:" >&5
     9569sed 's/^/| /' conftest.$ac_ext >&5
     9570
     9571fi
     9572rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9573fi
     9574
     9575    if test "${tcl_cv_type_64bit}" = none ; then
     9576
     9577cat >>confdefs.h <<\_ACEOF
     9578#define TCL_WIDE_INT_IS_LONG 1
     9579_ACEOF
     9580
     9581        echo "$as_me:$LINENO: result: using long" >&5
     9582echo "${ECHO_T}using long" >&6
     9583    elif test "${tcl_cv_type_64bit}" = "__int64" \
     9584                -a "${TEA_PLATFORM}" = "windows" ; then
     9585        # We actually want to use the default tcl.h checks in this
     9586        # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
     9587        echo "$as_me:$LINENO: result: using Tcl header defaults" >&5
     9588echo "${ECHO_T}using Tcl header defaults" >&6
     9589    else
     9590
     9591cat >>confdefs.h <<_ACEOF
     9592#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
     9593_ACEOF
     9594
     9595        echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5
     9596echo "${ECHO_T}${tcl_cv_type_64bit}" >&6
     9597
     9598        # Now check for auxiliary declarations
     9599        echo "$as_me:$LINENO: checking for struct dirent64" >&5
     9600echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6
     9601if test "${tcl_cv_struct_dirent64+set}" = set; then
     9602  echo $ECHO_N "(cached) $ECHO_C" >&6
     9603else
     9604
     9605            cat >conftest.$ac_ext <<_ACEOF
     9606/* confdefs.h.  */
     9607_ACEOF
     9608cat confdefs.h >>conftest.$ac_ext
     9609cat >>conftest.$ac_ext <<_ACEOF
     9610/* end confdefs.h.  */
     9611#include <sys/types.h>
     9612#include <sys/dirent.h>
     9613int
     9614main ()
     9615{
     9616struct dirent64 p;
     9617  ;
     9618  return 0;
     9619}
     9620_ACEOF
     9621rm -f conftest.$ac_objext
     9622if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9623  (eval $ac_compile) 2>conftest.er1
     9624  ac_status=$?
     9625  grep -v '^ *+' conftest.er1 >conftest.err
     9626  rm -f conftest.er1
     9627  cat conftest.err >&5
     9628  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9629  (exit $ac_status); } &&
     9630         { ac_try='test -z "$ac_c_werror_flag"
     9631                         || test ! -s conftest.err'
     9632  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9633  (eval $ac_try) 2>&5
     9634  ac_status=$?
     9635  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9636  (exit $ac_status); }; } &&
     9637         { ac_try='test -s conftest.$ac_objext'
     9638  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9639  (eval $ac_try) 2>&5
     9640  ac_status=$?
     9641  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9642  (exit $ac_status); }; }; then
     9643  tcl_cv_struct_dirent64=yes
     9644else
     9645  echo "$as_me: failed program was:" >&5
     9646sed 's/^/| /' conftest.$ac_ext >&5
     9647
     9648tcl_cv_struct_dirent64=no
     9649fi
     9650rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9651fi
     9652echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5
     9653echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6
     9654        if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
     9655
     9656cat >>confdefs.h <<\_ACEOF
     9657#define HAVE_STRUCT_DIRENT64 1
     9658_ACEOF
     9659
     9660        fi
     9661
     9662        echo "$as_me:$LINENO: checking for struct stat64" >&5
     9663echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6
     9664if test "${tcl_cv_struct_stat64+set}" = set; then
     9665  echo $ECHO_N "(cached) $ECHO_C" >&6
     9666else
     9667
     9668            cat >conftest.$ac_ext <<_ACEOF
     9669/* confdefs.h.  */
     9670_ACEOF
     9671cat confdefs.h >>conftest.$ac_ext
     9672cat >>conftest.$ac_ext <<_ACEOF
     9673/* end confdefs.h.  */
     9674#include <sys/stat.h>
     9675int
     9676main ()
     9677{
     9678struct stat64 p;
     9679
     9680  ;
     9681  return 0;
     9682}
     9683_ACEOF
     9684rm -f conftest.$ac_objext
     9685if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9686  (eval $ac_compile) 2>conftest.er1
     9687  ac_status=$?
     9688  grep -v '^ *+' conftest.er1 >conftest.err
     9689  rm -f conftest.er1
     9690  cat conftest.err >&5
     9691  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9692  (exit $ac_status); } &&
     9693         { ac_try='test -z "$ac_c_werror_flag"
     9694                         || test ! -s conftest.err'
     9695  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9696  (eval $ac_try) 2>&5
     9697  ac_status=$?
     9698  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9699  (exit $ac_status); }; } &&
     9700         { ac_try='test -s conftest.$ac_objext'
     9701  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9702  (eval $ac_try) 2>&5
     9703  ac_status=$?
     9704  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9705  (exit $ac_status); }; }; then
     9706  tcl_cv_struct_stat64=yes
     9707else
     9708  echo "$as_me: failed program was:" >&5
     9709sed 's/^/| /' conftest.$ac_ext >&5
     9710
     9711tcl_cv_struct_stat64=no
     9712fi
     9713rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9714fi
     9715echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5
     9716echo "${ECHO_T}$tcl_cv_struct_stat64" >&6
     9717        if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
     9718
     9719cat >>confdefs.h <<\_ACEOF
     9720#define HAVE_STRUCT_STAT64 1
     9721_ACEOF
     9722
     9723        fi
     9724
     9725
     9726
     9727for ac_func in open64 lseek64
     9728do
     9729as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
     9730echo "$as_me:$LINENO: checking for $ac_func" >&5
     9731echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
     9732if eval "test \"\${$as_ac_var+set}\" = set"; then
     9733  echo $ECHO_N "(cached) $ECHO_C" >&6
     9734else
     9735  cat >conftest.$ac_ext <<_ACEOF
     9736/* confdefs.h.  */
     9737_ACEOF
     9738cat confdefs.h >>conftest.$ac_ext
     9739cat >>conftest.$ac_ext <<_ACEOF
     9740/* end confdefs.h.  */
     9741/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
     9742   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
     9743#define $ac_func innocuous_$ac_func
     9744
     9745/* System header to define __stub macros and hopefully few prototypes,
     9746    which can conflict with char $ac_func (); below.
     9747    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     9748    <limits.h> exists even on freestanding compilers.  */
     9749
     9750#ifdef __STDC__
     9751# include <limits.h>
     9752#else
     9753# include <assert.h>
     9754#endif
     9755
     9756#undef $ac_func
     9757
     9758/* Override any gcc2 internal prototype to avoid an error.  */
     9759#ifdef __cplusplus
     9760extern "C"
     9761{
     9762#endif
     9763/* We use char because int might match the return type of a gcc2
     9764   builtin and then its argument prototype would still apply.  */
     9765char $ac_func ();
     9766/* The GNU C library defines this for functions which it implements
     9767    to always fail with ENOSYS.  Some functions are actually named
     9768    something starting with __ and the normal name is an alias.  */
     9769#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
     9770choke me
     9771#else
     9772char (*f) () = $ac_func;
     9773#endif
     9774#ifdef __cplusplus
     9775}
     9776#endif
     9777
     9778int
     9779main ()
     9780{
     9781return f != $ac_func;
     9782  ;
     9783  return 0;
     9784}
     9785_ACEOF
     9786rm -f conftest.$ac_objext conftest$ac_exeext
     9787if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     9788  (eval $ac_link) 2>conftest.er1
     9789  ac_status=$?
     9790  grep -v '^ *+' conftest.er1 >conftest.err
     9791  rm -f conftest.er1
     9792  cat conftest.err >&5
     9793  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9794  (exit $ac_status); } &&
     9795         { ac_try='test -z "$ac_c_werror_flag"
     9796                         || test ! -s conftest.err'
     9797  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9798  (eval $ac_try) 2>&5
     9799  ac_status=$?
     9800  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9801  (exit $ac_status); }; } &&
     9802         { ac_try='test -s conftest$ac_exeext'
     9803  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9804  (eval $ac_try) 2>&5
     9805  ac_status=$?
     9806  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9807  (exit $ac_status); }; }; then
     9808  eval "$as_ac_var=yes"
     9809else
     9810  echo "$as_me: failed program was:" >&5
     9811sed 's/^/| /' conftest.$ac_ext >&5
     9812
     9813eval "$as_ac_var=no"
     9814fi
     9815rm -f conftest.err conftest.$ac_objext \
     9816      conftest$ac_exeext conftest.$ac_ext
     9817fi
     9818echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
     9819echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
     9820if test `eval echo '${'$as_ac_var'}'` = yes; then
     9821  cat >>confdefs.h <<_ACEOF
     9822#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
     9823_ACEOF
     9824
     9825fi
     9826done
     9827
     9828        echo "$as_me:$LINENO: checking for off64_t" >&5
     9829echo $ECHO_N "checking for off64_t... $ECHO_C" >&6
     9830        if test "${tcl_cv_type_off64_t+set}" = set; then
     9831  echo $ECHO_N "(cached) $ECHO_C" >&6
     9832else
     9833
     9834            cat >conftest.$ac_ext <<_ACEOF
     9835/* confdefs.h.  */
     9836_ACEOF
     9837cat confdefs.h >>conftest.$ac_ext
     9838cat >>conftest.$ac_ext <<_ACEOF
     9839/* end confdefs.h.  */
     9840#include <sys/types.h>
     9841int
     9842main ()
     9843{
     9844off64_t offset;
     9845
     9846  ;
     9847  return 0;
     9848}
     9849_ACEOF
     9850rm -f conftest.$ac_objext
     9851if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     9852  (eval $ac_compile) 2>conftest.er1
     9853  ac_status=$?
     9854  grep -v '^ *+' conftest.er1 >conftest.err
     9855  rm -f conftest.er1
     9856  cat conftest.err >&5
     9857  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9858  (exit $ac_status); } &&
     9859         { ac_try='test -z "$ac_c_werror_flag"
     9860                         || test ! -s conftest.err'
     9861  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9862  (eval $ac_try) 2>&5
     9863  ac_status=$?
     9864  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9865  (exit $ac_status); }; } &&
     9866         { ac_try='test -s conftest.$ac_objext'
     9867  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     9868  (eval $ac_try) 2>&5
     9869  ac_status=$?
     9870  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9871  (exit $ac_status); }; }; then
     9872  tcl_cv_type_off64_t=yes
     9873else
     9874  echo "$as_me: failed program was:" >&5
     9875sed 's/^/| /' conftest.$ac_ext >&5
     9876
     9877tcl_cv_type_off64_t=no
     9878fi
     9879rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     9880fi
     9881
     9882                        if test "x${tcl_cv_type_off64_t}" = "xyes" && \
     9883                test "x${ac_cv_func_lseek64}" = "xyes" && \
     9884                test "x${ac_cv_func_open64}" = "xyes" ; then
     9885
     9886cat >>confdefs.h <<\_ACEOF
     9887#define HAVE_TYPE_OFF64_T 1
     9888_ACEOF
     9889
     9890            echo "$as_me:$LINENO: result: yes" >&5
     9891echo "${ECHO_T}yes" >&6
     9892        else
     9893            echo "$as_me:$LINENO: result: no" >&5
     9894echo "${ECHO_T}no" >&6
     9895        fi
     9896    fi
     9897
     9898
     9899
     9900#--------------------------------------------------------------------
     9901# Set the default compiler switches based on the --enable-symbols option.
     9902#--------------------------------------------------------------------
     9903
     9904
     9905
     9906    echo "$as_me:$LINENO: checking for build with symbols" >&5
     9907echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6
     9908    # Check whether --enable-symbols or --disable-symbols was given.
     9909if test "${enable_symbols+set}" = set; then
     9910  enableval="$enable_symbols"
     9911  tcl_ok=$enableval
     9912else
     9913  tcl_ok=no
     9914fi;
     9915    DBGX=""
     9916    if test "$tcl_ok" = "no"; then
     9917        CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
     9918        LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
     9919        echo "$as_me:$LINENO: result: no" >&5
     9920echo "${ECHO_T}no" >&6
     9921    else
     9922        CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
     9923        LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
     9924        if test "$tcl_ok" = "yes"; then
     9925            echo "$as_me:$LINENO: result: yes (standard debugging)" >&5
     9926echo "${ECHO_T}yes (standard debugging)" >&6
     9927        fi
     9928    fi
     9929    if test "${TEA_PLATFORM}" != "windows" ; then
     9930        LDFLAGS_DEFAULT="${LDFLAGS}"
     9931    fi
     9932
     9933
     9934
     9935
     9936
     9937    if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
     9938
     9939cat >>confdefs.h <<\_ACEOF
     9940#define TCL_MEM_DEBUG 1
     9941_ACEOF
     9942
     9943    fi
     9944
     9945    if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
     9946        if test "$tcl_ok" = "all"; then
     9947            echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5
     9948echo "${ECHO_T}enabled symbols mem debugging" >&6
     9949        else
     9950            echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5
     9951echo "${ECHO_T}enabled $tcl_ok debugging" >&6
     9952        fi
     9953    fi
     9954
     9955
     9956#--------------------------------------------------------------------
     9957# Everyone should be linking against the Tcl stub library.  If you
     9958# can't for some reason, remove this definition.  If you aren't using
     9959# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
     9960# link against the non-stubbed Tcl library.  Add Tk too if necessary.
     9961#--------------------------------------------------------------------
     9962
     9963
     9964cat >>confdefs.h <<\_ACEOF
     9965#define USE_TCL_STUBS 1
     9966_ACEOF
     9967
     9968#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
     9969
     9970#--------------------------------------------------------------------
     9971# This macro generates a line to use when building a library.  It
     9972# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
     9973# and TEA_LOAD_TCLCONFIG macros above.
     9974#--------------------------------------------------------------------
     9975
     9976
     9977    if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
     9978        MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
     9979        MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
     9980        MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
     9981    else
     9982        MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
     9983        MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
     9984        MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
     9985    fi
     9986
     9987    if test "${SHARED_BUILD}" = "1" ; then
     9988        MAKE_LIB="${MAKE_SHARED_LIB} "
     9989    else
     9990        MAKE_LIB="${MAKE_STATIC_LIB} "
     9991    fi
     9992
     9993    #--------------------------------------------------------------------
     9994    # Shared libraries and static libraries have different names.
     9995    # Use the double eval to make sure any variables in the suffix is
     9996    # substituted. (@@@ Might not be necessary anymore)
     9997    #--------------------------------------------------------------------
     9998
     9999    if test "${TEA_PLATFORM}" = "windows" ; then
     10000        if test "${SHARED_BUILD}" = "1" ; then
     10001            # We force the unresolved linking of symbols that are really in
     10002            # the private libraries of Tcl and Tk.
     10003            SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
     10004            if test x"${TK_BIN_DIR}" != x ; then
     10005                SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
     10006            fi
     10007            eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
     10008        else
     10009            eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
     10010        fi
     10011        # Some packages build their own stubs libraries
     10012        eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
     10013        if test "$GCC" = "yes"; then
     10014            PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
     10015        fi
     10016        # These aren't needed on Windows (either MSVC or gcc)
     10017        RANLIB="mt -manifest ${PKG_LIB_FILE}.manifest -outputresource:${PKG_LIB_FILE}\;2 ; test -f"
     10018        RANLIB_STUB=:
     10019    else
     10020        RANLIB_STUB="${RANLIB}"
     10021        if test "${SHARED_BUILD}" = "1" ; then
     10022            SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
     10023            if test x"${TK_BIN_DIR}" != x ; then
     10024                SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
     10025            fi
     10026            eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
     10027            RANLIB=:
     10028        else
     10029            eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
     10030        fi
     10031        # Some packages build their own stubs libraries
     10032        eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
     10033    fi
     10034
     10035    # These are escaped so that only CFLAGS is picked up at configure time.
     10036    # The other values will be substituted at make time.
     10037    CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
     10038    if test "${SHARED_BUILD}" = "1" ; then
     10039        CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
     10040    fi
     10041
     10042
     10043
     10044
     10045
     10046
     10047
     10048
     10049
     10050#--------------------------------------------------------------------
     10051# Determine the name of the tclsh and/or wish executables in the
     10052# Tcl and Tk build directories or the location they were installed
     10053# into. These paths are used to support running test cases only,
     10054# the Makefile should not be making use of these paths to generate
     10055# a pkgIndex.tcl file or anything else at extension build time.
     10056#--------------------------------------------------------------------
     10057
     10058
     10059    echo "$as_me:$LINENO: checking for tclsh" >&5
     10060echo $ECHO_N "checking for tclsh... $ECHO_C" >&6
     10061    if test -f "${TCL_BIN_DIR}/Makefile" ; then
     10062        # tclConfig.sh is in Tcl build directory
     10063        if test "${TEA_PLATFORM}" = "windows"; then
     10064            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
     10065        else
     10066            TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
     10067        fi
     10068    else
     10069        # tclConfig.sh is in install location
     10070        if test "${TEA_PLATFORM}" = "windows"; then
     10071            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
     10072        else
     10073            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
     10074        fi
     10075        list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
     10076              `ls -d ${TCL_BIN_DIR}/..     2>/dev/null` \
     10077              `ls -d ${TCL_PREFIX}/bin     2>/dev/null`"
     10078        for i in $list ; do
     10079            if test -f "$i/${TCLSH_PROG}" ; then
     10080                REAL_TCL_BIN_DIR="`cd "$i"; pwd`"
     10081                break
     10082            fi
     10083        done
     10084        TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}"
     10085    fi
     10086    echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5
     10087echo "${ECHO_T}${TCLSH_PROG}" >&6
     10088
     10089
     10090#TEA_PROG_WISH
    238710091
    238810092
     
    241710121      break
    241810122    elif test -r "$dir/include/bltInt.h" ; then
    2419       BLT_SRC_DIR="$dir/lib"
     10123      BLT_SRC_DIR="$dir/include"
    242010124      break
    242110125    fi
     
    243110135     ../../blt \
    243210136     `ls -dr ../../../blt[2-3].[0-9]* 2>/dev/null` \
    2433      ../../../blt
     10137     ../../../blt \
     10138     `ls -dr c:/opt/blt[2-3].[0-9]* 2>/dev/null` \
     10139     c\:/opt/blt
    243410140    do
    2435       if test -r "$dir/bltInt.h" ; then
    2436         tclConfigFile="$dir/bltInt.h"
    2437         break
     10141      if test -r "$dir/src/bltInt.h" ; then
     10142        BLT_SRC_DIR="$dir/src"
     10143        break
    243810144      fi
    243910145    done
    244010146  fi
    244110147fi
    2442 
    244310148echo "$as_me:$LINENO: result: ${BLT_SRC_DIR}" >&5
    244410149echo "${ECHO_T}${BLT_SRC_DIR}" >&6
     
    245110156
    245210157
    2453 
    245410158#--------------------------------------------------------------------
    2455 # __CHANGE__
    2456 # A few miscellaneous platform-specific items:
    2457 #
    2458 # Define a special symbol for Windows (BUILD_exampleA in this case) so
    2459 # that we create the export library with the dll.  See sha1.h on how
    2460 # to use this.
    2461 #
    2462 # Windows creates a few extra files that need to be cleaned up.
    2463 # You can add more files to clean if your extension creates any extra
    2464 # files.
    2465 #
    2466 # Define any extra compiler flags in the PACKAGE_CFLAGS variable.
    2467 # These will be appended to the current set of compiler flags for
    2468 # your system.
     10159# Look for rappture.h on the normal include path.  If not found, look
     10160# for it in the --with-rappture directory.
    246910161#--------------------------------------------------------------------
    2470 
    2471 case "`uname -s`" in
    2472     *win32* | *WIN32* | *CYGWIN_NT*)
    2473         cat >>confdefs.h <<\_ACEOF
    2474 #define BUILD_Rappture 1
    2475 _ACEOF
    2476 
    2477         CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch"
    2478 
    2479     ;;
    2480     *)
    2481         CLEANFILES=
    2482     ;;
    2483 esac
     10162echo "$as_me:$LINENO: checking for rappture.h" >&5
     10163echo $ECHO_N "checking for rappture.h... $ECHO_C" >&6
     10164RAPPTURE_DIR=""
     10165if test "x$rappture_source_dir" != "x" ; then
     10166  #
     10167  # Verify that a rappture.h file exists in the directory specified
     10168  # by --with-rappture.
     10169  #
     10170  if test -r "$rappture_dir/include/core/rappture.h" ; then
     10171    RAPPTURE_DIR="$rappture_dir"
     10172  fi
     10173else
     10174  #
     10175  # Otherwise, search for the rappture.h include file...
     10176  # 1. Search previously named locations.
     10177  #
     10178  for dir in \
     10179   $prefix \
     10180   $exec_prefix
     10181  do
     10182    if test -r "$dir/include/core/rappture.h" ; then
     10183      RAPPTURE_DIR="$dir"
     10184      break
     10185    fi
     10186  done
     10187  #
     10188  #  2. Search source directories.
     10189  #
     10190  if test "x$RAPPTURE_DIR" = "x" ; then
     10191    for dir in \
     10192     `ls -dr ../rappture 2>/dev/null` \
     10193     `ls -dr ../../rappture 2>/dev/null` \
     10194     `ls -dr ../../../rappture 2>/dev/null` \
     10195     `ls -dr C\:/opt/rappture 2>/dev/null` \
     10196     `ls -dr /opt/rappture 2>/dev/null`
     10197    do
     10198      if test -r "$dir/include/core/rappture.h" ; then
     10199        RAPPTURE_DIR="$dir"
     10200        break
     10201      fi
     10202    done
     10203  fi
     10204fi
     10205echo "$as_me:$LINENO: result: ${RAPPTURE_DIR}" >&5
     10206echo "${ECHO_T}${RAPPTURE_DIR}" >&6
     10207
     10208if test "x$RAPPTURE_DIR" = "x" ; then
     10209  echo "can't find RAPPTURE include file \"rappture.h\""
     10210  echo "use --with-rappture=DIR to specify the location of rappture"
     10211  exit 1
     10212fi
     10213
     10214
    248410215
    248510216#--------------------------------------------------------------------
    2486 # Check whether --enable-threads or --disable-threads was given.
    2487 # So far only Tcl responds to this one.
     10217# Look for scew.h on the normal include path.  If not found, look
     10218# for it in the --with-scew directory.
    248810219#--------------------------------------------------------------------
    2489 
    2490 ac_ext=c
    2491 ac_cpp='$CPP $CPPFLAGS'
    2492 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    2493 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    2494 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    2495 if test -n "$ac_tool_prefix"; then
    2496   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
    2497 set dummy ${ac_tool_prefix}gcc; ac_word=$2
    2498 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2499 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2500 if test "${ac_cv_prog_CC+set}" = set; then
    2501   echo $ECHO_N "(cached) $ECHO_C" >&6
    2502 else
    2503   if test -n "$CC"; then
    2504   ac_cv_prog_CC="$CC" # Let the user override the test.
    2505 else
    2506 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2507 for as_dir in $PATH
    2508 do
    2509   IFS=$as_save_IFS
    2510   test -z "$as_dir" && as_dir=.
    2511   for ac_exec_ext in '' $ac_executable_extensions; do
    2512   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2513     ac_cv_prog_CC="${ac_tool_prefix}gcc"
    2514     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2515     break 2
     10220echo "$as_me:$LINENO: checking for alternate paths" >&5
     10221echo $ECHO_N "checking for alternate paths... $ECHO_C" >&6
     10222ALT_DIR=""
     10223if test "x$alt_dir" != "x" ; then
     10224  #
     10225  # Verify that a include and lib directories exist in the directory specified
     10226  # by --with-altpath.
     10227  #
     10228  if test -d "$alt_dir/include" -a -d "$alt_dir/lib" ; then
     10229    ALT_DIR="$rappture_dir"
    251610230  fi
    2517 done
    2518 done
    2519 
    2520 fi
    2521 fi
    2522 CC=$ac_cv_prog_CC
    2523 if test -n "$CC"; then
    2524   echo "$as_me:$LINENO: result: $CC" >&5
    2525 echo "${ECHO_T}$CC" >&6
    2526 else
    2527   echo "$as_me:$LINENO: result: no" >&5
    2528 echo "${ECHO_T}no" >&6
    2529 fi
    2530 
    2531 fi
    2532 if test -z "$ac_cv_prog_CC"; then
    2533   ac_ct_CC=$CC
    2534   # Extract the first word of "gcc", so it can be a program name with args.
    2535 set dummy gcc; ac_word=$2
    2536 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2537 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2538 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    2539   echo $ECHO_N "(cached) $ECHO_C" >&6
    2540 else
    2541   if test -n "$ac_ct_CC"; then
    2542   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    2543 else
    2544 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2545 for as_dir in $PATH
    2546 do
    2547   IFS=$as_save_IFS
    2548   test -z "$as_dir" && as_dir=.
    2549   for ac_exec_ext in '' $ac_executable_extensions; do
    2550   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2551     ac_cv_prog_ac_ct_CC="gcc"
    2552     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2553     break 2
     10231else
     10232  if test "x$ALT_DIR" = "x" ; then
     10233    for dir in \
     10234     C\:/opt /opt
     10235    do
     10236      if test -r "$dir/include" -a -d "$dir/lib" ; then
     10237        ALT_DIR="$dir"
     10238        break
     10239      fi
     10240    done
    255410241  fi
    2555 done
    2556 done
    2557 
    2558 fi
    2559 fi
    2560 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    2561 if test -n "$ac_ct_CC"; then
    2562   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    2563 echo "${ECHO_T}$ac_ct_CC" >&6
    2564 else
    2565   echo "$as_me:$LINENO: result: no" >&5
    2566 echo "${ECHO_T}no" >&6
    2567 fi
    2568 
    2569   CC=$ac_ct_CC
    2570 else
    2571   CC="$ac_cv_prog_CC"
    2572 fi
    2573 
    2574 if test -z "$CC"; then
    2575   if test -n "$ac_tool_prefix"; then
    2576   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
    2577 set dummy ${ac_tool_prefix}cc; ac_word=$2
    2578 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2579 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2580 if test "${ac_cv_prog_CC+set}" = set; then
    2581   echo $ECHO_N "(cached) $ECHO_C" >&6
    2582 else
    2583   if test -n "$CC"; then
    2584   ac_cv_prog_CC="$CC" # Let the user override the test.
    2585 else
    2586 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2587 for as_dir in $PATH
    2588 do
    2589   IFS=$as_save_IFS
    2590   test -z "$as_dir" && as_dir=.
    2591   for ac_exec_ext in '' $ac_executable_extensions; do
    2592   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2593     ac_cv_prog_CC="${ac_tool_prefix}cc"
    2594     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2595     break 2
    2596   fi
    2597 done
    2598 done
    2599 
    2600 fi
    2601 fi
    2602 CC=$ac_cv_prog_CC
    2603 if test -n "$CC"; then
    2604   echo "$as_me:$LINENO: result: $CC" >&5
    2605 echo "${ECHO_T}$CC" >&6
    2606 else
    2607   echo "$as_me:$LINENO: result: no" >&5
    2608 echo "${ECHO_T}no" >&6
    2609 fi
    2610 
    2611 fi
    2612 if test -z "$ac_cv_prog_CC"; then
    2613   ac_ct_CC=$CC
    2614   # Extract the first word of "cc", so it can be a program name with args.
    2615 set dummy cc; ac_word=$2
    2616 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2617 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2618 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    2619   echo $ECHO_N "(cached) $ECHO_C" >&6
    2620 else
    2621   if test -n "$ac_ct_CC"; then
    2622   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    2623 else
    2624 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2625 for as_dir in $PATH
    2626 do
    2627   IFS=$as_save_IFS
    2628   test -z "$as_dir" && as_dir=.
    2629   for ac_exec_ext in '' $ac_executable_extensions; do
    2630   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2631     ac_cv_prog_ac_ct_CC="cc"
    2632     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2633     break 2
    2634   fi
    2635 done
    2636 done
    2637 
    2638 fi
    2639 fi
    2640 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    2641 if test -n "$ac_ct_CC"; then
    2642   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    2643 echo "${ECHO_T}$ac_ct_CC" >&6
    2644 else
    2645   echo "$as_me:$LINENO: result: no" >&5
    2646 echo "${ECHO_T}no" >&6
    2647 fi
    2648 
    2649   CC=$ac_ct_CC
    2650 else
    2651   CC="$ac_cv_prog_CC"
    2652 fi
    2653 
    2654 fi
    2655 if test -z "$CC"; then
    2656   # Extract the first word of "cc", so it can be a program name with args.
    2657 set dummy cc; ac_word=$2
    2658 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2659 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2660 if test "${ac_cv_prog_CC+set}" = set; then
    2661   echo $ECHO_N "(cached) $ECHO_C" >&6
    2662 else
    2663   if test -n "$CC"; then
    2664   ac_cv_prog_CC="$CC" # Let the user override the test.
    2665 else
    2666   ac_prog_rejected=no
    2667 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2668 for as_dir in $PATH
    2669 do
    2670   IFS=$as_save_IFS
    2671   test -z "$as_dir" && as_dir=.
    2672   for ac_exec_ext in '' $ac_executable_extensions; do
    2673   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2674     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
    2675        ac_prog_rejected=yes
    2676        continue
    2677      fi
    2678     ac_cv_prog_CC="cc"
    2679     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2680     break 2
    2681   fi
    2682 done
    2683 done
    2684 
    2685 if test $ac_prog_rejected = yes; then
    2686   # We found a bogon in the path, so make sure we never use it.
    2687   set dummy $ac_cv_prog_CC
    2688   shift
    2689   if test $# != 0; then
    2690     # We chose a different compiler from the bogus one.
    2691     # However, it has the same basename, so the bogon will be chosen
    2692     # first if we set CC to just the basename; use the full file name.
    2693     shift
    2694     ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
    2695   fi
    2696 fi
    2697 fi
    2698 fi
    2699 CC=$ac_cv_prog_CC
    2700 if test -n "$CC"; then
    2701   echo "$as_me:$LINENO: result: $CC" >&5
    2702 echo "${ECHO_T}$CC" >&6
    2703 else
    2704   echo "$as_me:$LINENO: result: no" >&5
    2705 echo "${ECHO_T}no" >&6
    2706 fi
    2707 
    2708 fi
    2709 if test -z "$CC"; then
    2710   if test -n "$ac_tool_prefix"; then
    2711   for ac_prog in cl
    2712   do
    2713     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    2714 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    2715 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2716 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2717 if test "${ac_cv_prog_CC+set}" = set; then
    2718   echo $ECHO_N "(cached) $ECHO_C" >&6
    2719 else
    2720   if test -n "$CC"; then
    2721   ac_cv_prog_CC="$CC" # Let the user override the test.
    2722 else
    2723 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2724 for as_dir in $PATH
    2725 do
    2726   IFS=$as_save_IFS
    2727   test -z "$as_dir" && as_dir=.
    2728   for ac_exec_ext in '' $ac_executable_extensions; do
    2729   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2730     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    2731     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2732     break 2
    2733   fi
    2734 done
    2735 done
    2736 
    2737 fi
    2738 fi
    2739 CC=$ac_cv_prog_CC
    2740 if test -n "$CC"; then
    2741   echo "$as_me:$LINENO: result: $CC" >&5
    2742 echo "${ECHO_T}$CC" >&6
    2743 else
    2744   echo "$as_me:$LINENO: result: no" >&5
    2745 echo "${ECHO_T}no" >&6
    2746 fi
    2747 
    2748     test -n "$CC" && break
    2749   done
    2750 fi
    2751 if test -z "$CC"; then
    2752   ac_ct_CC=$CC
    2753   for ac_prog in cl
    2754 do
    2755   # Extract the first word of "$ac_prog", so it can be a program name with args.
    2756 set dummy $ac_prog; ac_word=$2
    2757 echo "$as_me:$LINENO: checking for $ac_word" >&5
    2758 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2759 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    2760   echo $ECHO_N "(cached) $ECHO_C" >&6
    2761 else
    2762   if test -n "$ac_ct_CC"; then
    2763   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    2764 else
    2765 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    2766 for as_dir in $PATH
    2767 do
    2768   IFS=$as_save_IFS
    2769   test -z "$as_dir" && as_dir=.
    2770   for ac_exec_ext in '' $ac_executable_extensions; do
    2771   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2772     ac_cv_prog_ac_ct_CC="$ac_prog"
    2773     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    2774     break 2
    2775   fi
    2776 done
    2777 done
    2778 
    2779 fi
    2780 fi
    2781 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    2782 if test -n "$ac_ct_CC"; then
    2783   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    2784 echo "${ECHO_T}$ac_ct_CC" >&6
    2785 else
    2786   echo "$as_me:$LINENO: result: no" >&5
    2787 echo "${ECHO_T}no" >&6
    2788 fi
    2789 
    2790   test -n "$ac_ct_CC" && break
    2791 done
    2792 
    2793   CC=$ac_ct_CC
    2794 fi
    2795 
    2796 fi
    2797 
    2798 
    2799 test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
    2800 See \`config.log' for more details." >&5
    2801 echo "$as_me: error: no acceptable C compiler found in \$PATH
    2802 See \`config.log' for more details." >&2;}
    2803    { (exit 1); exit 1; }; }
    2804 
    2805 # Provide some information about the compiler.
    2806 echo "$as_me:$LINENO:" \
    2807      "checking for C compiler version" >&5
    2808 ac_compiler=`set X $ac_compile; echo $2`
    2809 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
    2810   (eval $ac_compiler --version </dev/null >&5) 2>&5
    2811   ac_status=$?
    2812   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2813   (exit $ac_status); }
    2814 { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
    2815   (eval $ac_compiler -v </dev/null >&5) 2>&5
    2816   ac_status=$?
    2817   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2818   (exit $ac_status); }
    2819 { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
    2820   (eval $ac_compiler -V </dev/null >&5) 2>&5
    2821   ac_status=$?
    2822   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2823   (exit $ac_status); }
    2824 
    2825 echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
    2826 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
    2827 if test "${ac_cv_c_compiler_gnu+set}" = set; then
    2828   echo $ECHO_N "(cached) $ECHO_C" >&6
    2829 else
    2830   cat >conftest.$ac_ext <<_ACEOF
    2831 /* confdefs.h.  */
    2832 _ACEOF
    2833 cat confdefs.h >>conftest.$ac_ext
    2834 cat >>conftest.$ac_ext <<_ACEOF
    2835 /* end confdefs.h.  */
    2836 
    2837 int
    2838 main ()
    2839 {
    2840 #ifndef __GNUC__
    2841        choke me
    2842 #endif
    2843 
    2844   ;
    2845   return 0;
    2846 }
    2847 _ACEOF
    2848 rm -f conftest.$ac_objext
    2849 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    2850   (eval $ac_compile) 2>conftest.er1
    2851   ac_status=$?
    2852   grep -v '^ *+' conftest.er1 >conftest.err
    2853   rm -f conftest.er1
    2854   cat conftest.err >&5
    2855   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2856   (exit $ac_status); } &&
    2857          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    2858   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2859   (eval $ac_try) 2>&5
    2860   ac_status=$?
    2861   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2862   (exit $ac_status); }; } &&
    2863          { ac_try='test -s conftest.$ac_objext'
    2864   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2865   (eval $ac_try) 2>&5
    2866   ac_status=$?
    2867   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2868   (exit $ac_status); }; }; then
    2869   ac_compiler_gnu=yes
    2870 else
    2871   echo "$as_me: failed program was:" >&5
    2872 sed 's/^/| /' conftest.$ac_ext >&5
    2873 
    2874 ac_compiler_gnu=no
    2875 fi
    2876 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    2877 ac_cv_c_compiler_gnu=$ac_compiler_gnu
    2878 
    2879 fi
    2880 echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
    2881 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
    2882 GCC=`test $ac_compiler_gnu = yes && echo yes`
    2883 ac_test_CFLAGS=${CFLAGS+set}
    2884 ac_save_CFLAGS=$CFLAGS
    2885 CFLAGS="-g"
    2886 echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
    2887 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
    2888 if test "${ac_cv_prog_cc_g+set}" = set; then
    2889   echo $ECHO_N "(cached) $ECHO_C" >&6
    2890 else
    2891   cat >conftest.$ac_ext <<_ACEOF
    2892 /* confdefs.h.  */
    2893 _ACEOF
    2894 cat confdefs.h >>conftest.$ac_ext
    2895 cat >>conftest.$ac_ext <<_ACEOF
    2896 /* end confdefs.h.  */
    2897 
    2898 int
    2899 main ()
    2900 {
    2901 
    2902   ;
    2903   return 0;
    2904 }
    2905 _ACEOF
    2906 rm -f conftest.$ac_objext
    2907 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    2908   (eval $ac_compile) 2>conftest.er1
    2909   ac_status=$?
    2910   grep -v '^ *+' conftest.er1 >conftest.err
    2911   rm -f conftest.er1
    2912   cat conftest.err >&5
    2913   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2914   (exit $ac_status); } &&
    2915          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    2916   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2917   (eval $ac_try) 2>&5
    2918   ac_status=$?
    2919   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2920   (exit $ac_status); }; } &&
    2921          { ac_try='test -s conftest.$ac_objext'
    2922   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2923   (eval $ac_try) 2>&5
    2924   ac_status=$?
    2925   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2926   (exit $ac_status); }; }; then
    2927   ac_cv_prog_cc_g=yes
    2928 else
    2929   echo "$as_me: failed program was:" >&5
    2930 sed 's/^/| /' conftest.$ac_ext >&5
    2931 
    2932 ac_cv_prog_cc_g=no
    2933 fi
    2934 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    2935 fi
    2936 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
    2937 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
    2938 if test "$ac_test_CFLAGS" = set; then
    2939   CFLAGS=$ac_save_CFLAGS
    2940 elif test $ac_cv_prog_cc_g = yes; then
    2941   if test "$GCC" = yes; then
    2942     CFLAGS="-g -O2"
     10242fi
     10243if test "x$ALT_DIR" = "x" ; then
     10244    echo "$as_me:$LINENO: result: none" >&5
     10245echo "${ECHO_T}none" >&6
    294310246  else
    2944     CFLAGS="-g"
    2945   fi
    2946 else
    2947   if test "$GCC" = yes; then
    2948     CFLAGS="-O2"
    2949   else
    2950     CFLAGS=
    2951   fi
    2952 fi
    2953 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
    2954 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
    2955 if test "${ac_cv_prog_cc_stdc+set}" = set; then
    2956   echo $ECHO_N "(cached) $ECHO_C" >&6
    2957 else
    2958   ac_cv_prog_cc_stdc=no
    2959 ac_save_CC=$CC
    2960 cat >conftest.$ac_ext <<_ACEOF
    2961 /* confdefs.h.  */
    2962 _ACEOF
    2963 cat confdefs.h >>conftest.$ac_ext
    2964 cat >>conftest.$ac_ext <<_ACEOF
    2965 /* end confdefs.h.  */
    2966 #include <stdarg.h>
    2967 #include <stdio.h>
    2968 #include <sys/types.h>
    2969 #include <sys/stat.h>
    2970 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
    2971 struct buf { int x; };
    2972 FILE * (*rcsopen) (struct buf *, struct stat *, int);
    2973 static char *e (p, i)
    2974      char **p;
    2975      int i;
    2976 {
    2977   return p[i];
    2978 }
    2979 static char *f (char * (*g) (char **, int), char **p, ...)
    2980 {
    2981   char *s;
    2982   va_list v;
    2983   va_start (v,p);
    2984   s = g (p, va_arg (v,int));
    2985   va_end (v);
    2986   return s;
    2987 }
    2988 
    2989 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    2990    function prototypes and stuff, but not '\xHH' hex character constants.
    2991    These don't provoke an error unfortunately, instead are silently treated
    2992    as 'x'.  The following induces an error, until -std1 is added to get
    2993    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    2994    array size at least.  It's necessary to write '\x00'==0 to get something
    2995    that's true only with -std1.  */
    2996 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
    2997 
    2998 int test (int i, double x);
    2999 struct s1 {int (*f) (int a);};
    3000 struct s2 {int (*f) (double a);};
    3001 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
    3002 int argc;
    3003 char **argv;
    3004 int
    3005 main ()
    3006 {
    3007 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
    3008   ;
    3009   return 0;
    3010 }
    3011 _ACEOF
    3012 # Don't try gcc -ansi; that turns off useful extensions and
    3013 # breaks some systems' header files.
    3014 # AIX                   -qlanglvl=ansi
    3015 # Ultrix and OSF/1      -std1
    3016 # HP-UX 10.20 and later -Ae
    3017 # HP-UX older versions  -Aa -D_HPUX_SOURCE
    3018 # SVR4                  -Xc -D__EXTENSIONS__
    3019 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
    3020 do
    3021   CC="$ac_save_CC $ac_arg"
    3022   rm -f conftest.$ac_objext
    3023 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    3024   (eval $ac_compile) 2>conftest.er1
    3025   ac_status=$?
    3026   grep -v '^ *+' conftest.er1 >conftest.err
    3027   rm -f conftest.er1
    3028   cat conftest.err >&5
    3029   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3030   (exit $ac_status); } &&
    3031          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    3032   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3033   (eval $ac_try) 2>&5
    3034   ac_status=$?
    3035   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3036   (exit $ac_status); }; } &&
    3037          { ac_try='test -s conftest.$ac_objext'
    3038   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3039   (eval $ac_try) 2>&5
    3040   ac_status=$?
    3041   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3042   (exit $ac_status); }; }; then
    3043   ac_cv_prog_cc_stdc=$ac_arg
    3044 break
    3045 else
    3046   echo "$as_me: failed program was:" >&5
    3047 sed 's/^/| /' conftest.$ac_ext >&5
    3048 
    3049 fi
    3050 rm -f conftest.err conftest.$ac_objext
    3051 done
    3052 rm -f conftest.$ac_ext conftest.$ac_objext
    3053 CC=$ac_save_CC
    3054 
    3055 fi
    3056 
    3057 case "x$ac_cv_prog_cc_stdc" in
    3058   x|xno)
    3059     echo "$as_me:$LINENO: result: none needed" >&5
    3060 echo "${ECHO_T}none needed" >&6 ;;
    3061   *)
    3062     echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
    3063 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
    3064     CC="$CC $ac_cv_prog_cc_stdc" ;;
    3065 esac
    3066 
    3067 # Some people use a C++ compiler to compile C.  Since we use `exit',
    3068 # in C++ we need to declare it.  In case someone uses the same compiler
    3069 # for both compiling C and C++ we need to have the C++ compiler decide
    3070 # the declaration of exit, since it's the most demanding environment.
    3071 cat >conftest.$ac_ext <<_ACEOF
    3072 #ifndef __cplusplus
    3073   choke me
    3074 #endif
    3075 _ACEOF
    3076 rm -f conftest.$ac_objext
    3077 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    3078   (eval $ac_compile) 2>conftest.er1
    3079   ac_status=$?
    3080   grep -v '^ *+' conftest.er1 >conftest.err
    3081   rm -f conftest.er1
    3082   cat conftest.err >&5
    3083   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3084   (exit $ac_status); } &&
    3085          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    3086   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3087   (eval $ac_try) 2>&5
    3088   ac_status=$?
    3089   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3090   (exit $ac_status); }; } &&
    3091          { ac_try='test -s conftest.$ac_objext'
    3092   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3093   (eval $ac_try) 2>&5
    3094   ac_status=$?
    3095   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3096   (exit $ac_status); }; }; then
    3097   for ac_declaration in \
    3098    '' \
    3099    'extern "C" void std::exit (int) throw (); using std::exit;' \
    3100    'extern "C" void std::exit (int); using std::exit;' \
    3101    'extern "C" void exit (int) throw ();' \
    3102    'extern "C" void exit (int);' \
    3103    'void exit (int);'
    3104 do
    3105   cat >conftest.$ac_ext <<_ACEOF
    3106 /* confdefs.h.  */
    3107 _ACEOF
    3108 cat confdefs.h >>conftest.$ac_ext
    3109 cat >>conftest.$ac_ext <<_ACEOF
    3110 /* end confdefs.h.  */
    3111 $ac_declaration
    3112 #include <stdlib.h>
    3113 int
    3114 main ()
    3115 {
    3116 exit (42);
    3117   ;
    3118   return 0;
    3119 }
    3120 _ACEOF
    3121 rm -f conftest.$ac_objext
    3122 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    3123   (eval $ac_compile) 2>conftest.er1
    3124   ac_status=$?
    3125   grep -v '^ *+' conftest.er1 >conftest.err
    3126   rm -f conftest.er1
    3127   cat conftest.err >&5
    3128   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3129   (exit $ac_status); } &&
    3130          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    3131   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3132   (eval $ac_try) 2>&5
    3133   ac_status=$?
    3134   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3135   (exit $ac_status); }; } &&
    3136          { ac_try='test -s conftest.$ac_objext'
    3137   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3138   (eval $ac_try) 2>&5
    3139   ac_status=$?
    3140   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3141   (exit $ac_status); }; }; then
    3142   :
    3143 else
    3144   echo "$as_me: failed program was:" >&5
    3145 sed 's/^/| /' conftest.$ac_ext >&5
    3146 
    3147 continue
    3148 fi
    3149 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    3150   cat >conftest.$ac_ext <<_ACEOF
    3151 /* confdefs.h.  */
    3152 _ACEOF
    3153 cat confdefs.h >>conftest.$ac_ext
    3154 cat >>conftest.$ac_ext <<_ACEOF
    3155 /* end confdefs.h.  */
    3156 $ac_declaration
    3157 int
    3158 main ()
    3159 {
    3160 exit (42);
    3161   ;
    3162   return 0;
    3163 }
    3164 _ACEOF
    3165 rm -f conftest.$ac_objext
    3166 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    3167   (eval $ac_compile) 2>conftest.er1
    3168   ac_status=$?
    3169   grep -v '^ *+' conftest.er1 >conftest.err
    3170   rm -f conftest.er1
    3171   cat conftest.err >&5
    3172   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3173   (exit $ac_status); } &&
    3174          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    3175   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3176   (eval $ac_try) 2>&5
    3177   ac_status=$?
    3178   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3179   (exit $ac_status); }; } &&
    3180          { ac_try='test -s conftest.$ac_objext'
    3181   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3182   (eval $ac_try) 2>&5
    3183   ac_status=$?
    3184   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3185   (exit $ac_status); }; }; then
    3186   break
    3187 else
    3188   echo "$as_me: failed program was:" >&5
    3189 sed 's/^/| /' conftest.$ac_ext >&5
    3190 
    3191 fi
    3192 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    3193 done
    3194 rm -f conftest*
    3195 if test -n "$ac_declaration"; then
    3196   echo '#ifdef __cplusplus' >>confdefs.h
    3197   echo $ac_declaration      >>confdefs.h
    3198   echo '#endif'             >>confdefs.h
    3199 fi
    3200 
    3201 else
    3202   echo "$as_me: failed program was:" >&5
    3203 sed 's/^/| /' conftest.$ac_ext >&5
    3204 
    3205 fi
    3206 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    3207 ac_ext=c
    3208 ac_cpp='$CPP $CPPFLAGS'
    3209 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    3210 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    3211 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    3212 
    3213 
    3214 
    3215     echo "$as_me:$LINENO: checking for building with threads" >&5
    3216 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6
    3217     # Check whether --enable-threads or --disable-threads was given.
    3218 if test "${enable_threads+set}" = set; then
    3219   enableval="$enable_threads"
    3220   tcl_ok=$enableval
    3221 else
    3222   tcl_ok=no
    3223 fi;
    3224 
    3225     if test "$tcl_ok" = "yes"; then
    3226         echo "$as_me:$LINENO: result: yes" >&5
    3227 echo "${ECHO_T}yes" >&6
    3228         TCL_THREADS=1
    3229         cat >>confdefs.h <<\_ACEOF
    3230 #define TCL_THREADS 1
    3231 _ACEOF
    3232 
    3233         cat >>confdefs.h <<\_ACEOF
    3234 #define _REENTRANT 1
    3235 _ACEOF
    3236 
    3237 
    3238         echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
    3239 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6
    3240 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
    3241   echo $ECHO_N "(cached) $ECHO_C" >&6
    3242 else
    3243   ac_check_lib_save_LIBS=$LIBS
    3244 LIBS="-lpthread  $LIBS"
    3245 cat >conftest.$ac_ext <<_ACEOF
    3246 /* confdefs.h.  */
    3247 _ACEOF
    3248 cat confdefs.h >>conftest.$ac_ext
    3249 cat >>conftest.$ac_ext <<_ACEOF
    3250 /* end confdefs.h.  */
    3251 
    3252 /* Override any gcc2 internal prototype to avoid an error.  */
    3253 #ifdef __cplusplus
    3254 extern "C"
    3255 #endif
    3256 /* We use char because int might match the return type of a gcc2
    3257    builtin and then its argument prototype would still apply.  */
    3258 char pthread_mutex_init ();
    3259 int
    3260 main ()
    3261 {
    3262 pthread_mutex_init ();
    3263   ;
    3264   return 0;
    3265 }
    3266 _ACEOF
    3267 rm -f conftest.$ac_objext conftest$ac_exeext
    3268 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    3269   (eval $ac_link) 2>conftest.er1
    3270   ac_status=$?
    3271   grep -v '^ *+' conftest.er1 >conftest.err
    3272   rm -f conftest.er1
    3273   cat conftest.err >&5
    3274   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3275   (exit $ac_status); } &&
    3276          { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
    3277   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3278   (eval $ac_try) 2>&5
    3279   ac_status=$?
    3280   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3281   (exit $ac_status); }; } &&
    3282          { ac_try='test -s conftest$ac_exeext'
    3283   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    3284   (eval $ac_try) 2>&5
    3285   ac_status=$?
    3286   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    3287   (exit $ac_status); }; }; then
    3288   ac_cv_lib_pthread_pthread_mutex_init=yes
    3289 else
    3290   echo "$as_me: failed program was:" >&5
    3291 sed 's/^/| /' conftest.$ac_ext >&5
    3292 
    3293 ac_cv_lib_pthread_pthread_mutex_init=no
    3294 fi
    3295 rm -f conftest.err conftest.$ac_objext \
    3296       conftest$ac_exeext conftest.$ac_ext
    3297 LIBS=$ac_check_lib_save_LIBS
    3298 fi
    3299 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
    3300 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6
    3301 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
    3302   tcl_ok=yes
    3303 else
    3304   tcl_ok=no
    3305 fi
    3306 
    3307         if test "$tcl_ok" = "yes"; then
    3308             # The space is needed
    3309             THREADS_LIBS=" -lpthread"
    3310         else
    3311             TCL_THREADS=0
    3312             { echo "$as_me:$LINENO: WARNING: \"Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...\"" >&5
    3313 echo "$as_me: WARNING: \"Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...\"" >&2;}
    3314         fi
    3315     else
    3316         TCL_THREADS=0
    3317         echo "$as_me:$LINENO: result: no (default)" >&5
    3318 echo "${ECHO_T}no (default)" >&6
    3319     fi
    3320 
    3321 
    3322 
    3323 #--------------------------------------------------------------------
    3324 # The statement below defines a collection of symbols related to
    3325 # building as a shared library instead of a static library.
    3326 #--------------------------------------------------------------------
    3327 
    3328 
    3329     echo "$as_me:$LINENO: checking how to build libraries" >&5
    3330 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6
    3331     # Check whether --enable-shared or --disable-shared was given.
    3332 if test "${enable_shared+set}" = set; then
    3333   enableval="$enable_shared"
    3334   tcl_ok=$enableval
    3335 else
    3336   tcl_ok=yes
    3337 fi;
    3338 
    3339     if test "${enable_shared+set}" = set; then
    3340         enableval="$enable_shared"
    3341         tcl_ok=$enableval
    3342     else
    3343         tcl_ok=yes
    3344     fi
    3345 
    3346     if test "$tcl_ok" = "yes" ; then
    3347         echo "$as_me:$LINENO: result: shared" >&5
    3348 echo "${ECHO_T}shared" >&6
    3349         SHARED_BUILD=1
    3350     else
    3351         echo "$as_me:$LINENO: result: static" >&5
    3352 echo "${ECHO_T}static" >&6
    3353         SHARED_BUILD=0
    3354         cat >>confdefs.h <<\_ACEOF
    3355 #define STATIC_BUILD 1
    3356 _ACEOF
    3357 
    3358     fi
    3359 
    3360 
    3361 #--------------------------------------------------------------------
    3362 # This macro figures out what flags to use with the compiler/linker
    3363 # when building shared/static debug/optimized objects.  This information
    3364 # is all taken from the tclConfig.sh file.
    3365 #--------------------------------------------------------------------
    3366 
    3367 CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
    3368 CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
    3369 LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
    3370 LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
    3371 SHLIB_LD=${TCL_SHLIB_LD}
    3372 STLIB_LD=${TCL_STLIB_LD}
    3373 SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
    3374 
    3375 
    3376 
    3377 
    3378 
    3379 
    3380 
    3381 
    3382 #--------------------------------------------------------------------
    3383 # Set the default compiler switches based on the --enable-symbols
    3384 # option.
    3385 #--------------------------------------------------------------------
    3386 
    3387 
    3388     case "`uname -s`" in
    3389         *win32* | *WIN32* | *CYGWIN_NT*)
    3390             tcl_dbgx=d
    3391         ;;
    3392         *)
    3393             tcl_dbgx=g
    3394         ;;
    3395     esac
    3396 
    3397     echo "$as_me:$LINENO: checking for build with symbols" >&5
    3398 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6
    3399     # Check whether --enable-symbols or --disable-symbols was given.
    3400 if test "${enable_symbols+set}" = set; then
    3401   enableval="$enable_symbols"
    3402   tcl_ok=$enableval
    3403 else
    3404   tcl_ok=no
    3405 fi;
    3406     if test "$tcl_ok" = "yes"; then
    3407         CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
    3408         LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
    3409         DBGX=${tcl_dbgx}
    3410         TCL_DBGX=${tcl_dbgx}
    3411         echo "$as_me:$LINENO: result: yes" >&5
    3412 echo "${ECHO_T}yes" >&6
    3413     else
    3414         CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
    3415         LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
    3416         DBGX=""
    3417         TCL_DBGX=""
    3418         echo "$as_me:$LINENO: result: no" >&5
    3419 echo "${ECHO_T}no" >&6
    3420     fi
    3421 
    3422 
    3423 
    3424 
    3425 
    3426 
    3427 if test "${SHARED_BUILD}" = "1" ; then
    3428     CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
    3429 else
    3430     CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
    3431 fi
    3432 
    3433 #--------------------------------------------------------------------
    3434 # Everyone should be linking against the Tcl stub library.  If you
    3435 # can't for some reason, remove this definition.  If you aren't using
    3436 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
    3437 # link against the non-stubbed Tcl library.
    3438 #--------------------------------------------------------------------
    3439 
    3440 cat >>confdefs.h <<\_ACEOF
    3441 #define USE_TCL_STUBS 1
    3442 _ACEOF
    3443 
    3444 
    3445 #--------------------------------------------------------------------
    3446 # This macro generates a line to use when building a library.  It
    3447 # depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS,
    3448 # and SC_LOAD_TCLCONFIG macros above.
    3449 #--------------------------------------------------------------------
    3450 
    3451 
    3452     case "`uname -s`" in
    3453         *win32* | *WIN32* | *CYGWIN_NT*)
    3454             if test "${CC-cc}" = "cl"; then
    3455                 MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(\$@_OBJECTS) "
    3456                 MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\$@ \$(\$@_OBJECTS) "
    3457             fi
    3458             ;;
    3459         *)
    3460             MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(\$@_OBJECTS)"
    3461             MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(\$@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}"
    3462             ;;
    3463     esac
    3464 
    3465     if test "${SHARED_BUILD}" = "1" ; then
    3466         MAKE_LIB=${MAKE_SHARED_LIB}
    3467     else
    3468         MAKE_LIB=${MAKE_STATIC_LIB}
    3469     fi
    3470 
    3471 
    3472 
    3473 
    3474 
    3475 
    3476 #--------------------------------------------------------------------
    3477 # eval these two values to dereference the ${DBGX} variable.
    3478 #--------------------------------------------------------------------
    3479 
    3480 eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}"
    3481 eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
    3482 
    3483 #--------------------------------------------------------------------
    3484 # Shared libraries and static libraries have different names.
    3485 #--------------------------------------------------------------------
    3486 
    3487 case "`uname -s`" in
    3488     *win32* | *WIN32* | *CYGWIN_NT*)
    3489         if test "${SHARED_BUILD}" = "1" ; then
    3490             SHLIB_LD_LIBS="\"`cygpath -w ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\" ${TCL_SHLIB_LD_LIBS}"
    3491             eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}"
    3492             RANLIB=:
    3493         else
    3494             eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}"
    3495         fi
    3496         ;;
    3497     *)
    3498         if test "${SHARED_BUILD}" = "1" ; then
    3499             SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC}"
    3500             eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}"
    3501             RANLIB=:
    3502         else
    3503             eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}"
    3504         fi
    3505         ;;
    3506 esac
    3507 
    3508 #--------------------------------------------------------------------
    3509 # __CHANGE__
    3510 # Change the name from exampeA_LIB_FILE to match your package name.
    3511 #--------------------------------------------------------------------
    3512 
    3513 
    3514 
    3515 
    3516 #--------------------------------------------------------------------
    3517 # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
    3518 # file during the install process.  Don't run the TCLSH_PROG through
    3519 # ${CYGPATH} because it's being used directly by make.
    3520 # Require that we use a tclsh shell version 8.2 or later since earlier
    3521 # versions have bugs in the pkg_mkIndex routine.
    3522 #--------------------------------------------------------------------
    3523 
    3524 for ac_prog in tclsh8.4${EXEEXT} tclsh84${EXEEXT} tclsh${EXEEXT}
    3525 do
    3526   # Extract the first word of "$ac_prog", so it can be a program name with args.
    3527 set dummy $ac_prog; ac_word=$2
    3528 echo "$as_me:$LINENO: checking for $ac_word" >&5
    3529 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    3530 if test "${ac_cv_path_TCLSH_PROG+set}" = set; then
    3531   echo $ECHO_N "(cached) $ECHO_C" >&6
    3532 else
    3533   case $TCLSH_PROG in
    3534   [\\/]* | ?:[\\/]*)
    3535   ac_cv_path_TCLSH_PROG="$TCLSH_PROG" # Let the user override the test with a path.
    3536   ;;
    3537   *)
    3538   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    3539 as_dummy="${exec_prefix}:${PATH}"
    3540 for as_dir in $as_dummy
    3541 do
    3542   IFS=$as_save_IFS
    3543   test -z "$as_dir" && as_dir=.
    3544   for ac_exec_ext in '' $ac_executable_extensions; do
    3545   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    3546     ac_cv_path_TCLSH_PROG="$as_dir/$ac_word$ac_exec_ext"
    3547     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    3548     break 2
    3549   fi
    3550 done
    3551 done
    3552 
    3553   ;;
    3554 esac
    3555 fi
    3556 TCLSH_PROG=$ac_cv_path_TCLSH_PROG
    3557 
    3558 if test -n "$TCLSH_PROG"; then
    3559   echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5
    3560 echo "${ECHO_T}$TCLSH_PROG" >&6
    3561 else
    3562   echo "$as_me:$LINENO: result: no" >&5
    3563 echo "${ECHO_T}no" >&6
    3564 fi
    3565 
    3566   test -n "$TCLSH_PROG" && break
    3567 done
    3568 test -n "$TCLSH_PROG" || TCLSH_PROG=":"
    3569 
    3570 
    3571 if test "x${TCLSH_PROG}" = "x:" ; then
    3572     { echo "$as_me:$LINENO: WARNING: No tclsh executable found.  You will have to build the pkgIndex.tcl file manually." >&5
    3573 echo "$as_me: WARNING: No tclsh executable found.  You will have to build the pkgIndex.tcl file manually." >&2;}
    3574 fi
    3575 
    3576 
    3577 #--------------------------------------------------------------------
    3578 # Finalize patchlevel and version info
    3579 #--------------------------------------------------------------------
     10247    echo "$as_me:$LINENO: result: ${ALT_DIR}" >&5
     10248echo "${ECHO_T}${ALT_DIR}" >&6
     10249fi
     10250
     10251
     10252
    358010253PATCHLEVEL=`${TCLSH_PROG} cf/patchlevel.tcl`
    358110254EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL}
     
    358610259
    358710260
    3588 
    3589 
    3590 
    359110261#--------------------------------------------------------------------
    359210262# Finally, substitute all of the various values into the Makefile.
     10263# You may alternatively have a special pkgIndex.tcl.in or other files
     10264# which require substituting th AC variables in.  Include these here.
    359310265#--------------------------------------------------------------------
    359410266
     
    398710659cat >&5 <<_CSEOF
    398810660
    3989 This file was extended by $as_me, which was
     10661This file was extended by Rappture $as_me 1.1, which was
    399010662generated by GNU Autoconf 2.59.  Invocation command line was
    399110663
     
    404210714cat >>$CONFIG_STATUS <<_ACEOF
    404310715ac_cs_version="\\
    4044 config.status
     10716Rappture config.status 1.1
    404510717configured by $0, generated by GNU Autoconf 2.59,
    404610718  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
     
    423110903s,@ECHO_T@,$ECHO_T,;t t
    423210904s,@LIBS@,$LIBS,;t t
     10905s,@CYGPATH@,$CYGPATH,;t t
     10906s,@EXEEXT@,$EXEEXT,;t t
     10907s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t
     10908s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t
     10909s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t
     10910s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t
     10911s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t
     10912s,@PKG_HEADERS@,$PKG_HEADERS,;t t
     10913s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t
     10914s,@PKG_LIBS@,$PKG_LIBS,;t t
     10915s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t
     10916s,@TCL_VERSION@,$TCL_VERSION,;t t
     10917s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
     10918s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
     10919s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
     10920s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
     10921s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
     10922s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
     10923s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
     10924s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
     10925s,@TCL_LIBS@,$TCL_LIBS,;t t
     10926s,@TCL_DEFS@,$TCL_DEFS,;t t
     10927s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t
     10928s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t
     10929s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t
     10930s,@CC@,$CC,;t t
     10931s,@CFLAGS@,$CFLAGS,;t t
     10932s,@LDFLAGS@,$LDFLAGS,;t t
     10933s,@CPPFLAGS@,$CPPFLAGS,;t t
     10934s,@ac_ct_CC@,$ac_ct_CC,;t t
     10935s,@OBJEXT@,$OBJEXT,;t t
    423310936s,@CXX@,$CXX,;t t
    423410937s,@CXXFLAGS@,$CXXFLAGS,;t t
    4235 s,@LDFLAGS@,$LDFLAGS,;t t
    4236 s,@CPPFLAGS@,$CPPFLAGS,;t t
    423710938s,@ac_ct_CXX@,$ac_ct_CXX,;t t
    4238 s,@EXEEXT@,$EXEEXT,;t t
    4239 s,@OBJEXT@,$OBJEXT,;t t
     10939s,@CPP@,$CPP,;t t
    424010940s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
    424110941s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
     
    424410944s,@RANLIB@,$RANLIB,;t t
    424510945s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
    4246 s,@build@,$build,;t t
    4247 s,@build_cpu@,$build_cpu,;t t
    4248 s,@build_vendor@,$build_vendor,;t t
    4249 s,@build_os@,$build_os,;t t
    4250 s,@host@,$host,;t t
    4251 s,@host_cpu@,$host_cpu,;t t
    4252 s,@host_vendor@,$host_vendor,;t t
    4253 s,@host_os@,$host_os,;t t
    4254 s,@CYGPATH@,$CYGPATH,;t t
     10946s,@EGREP@,$EGREP,;t t
     10947s,@MATH_LIBS@,$MATH_LIBS,;t t
     10948s,@PKG_SOURCES@,$PKG_SOURCES,;t t
     10949s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t
     10950s,@CLEANFILES@,$CLEANFILES,;t t
    425510951s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t
    4256 s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
    4257 s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
    4258 s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
    4259 s,@TCL_LIBS@,$TCL_LIBS,;t t
    4260 s,@TCL_DEFS@,$TCL_DEFS,;t t
    4261 s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t
    4262 s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t
    4263 s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t
    4264 s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
    4265 s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
    4266 s,@TCL_BUILD_LIB_SPEC@,$TCL_BUILD_LIB_SPEC,;t t
    4267 s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
    4268 s,@TCL_BUILD_STUB_LIB_SPEC@,$TCL_BUILD_STUB_LIB_SPEC,;t t
    4269 s,@BLT_SRC_DIR@,$BLT_SRC_DIR,;t t
    4270 s,@CLEANFILES@,$CLEANFILES,;t t
    4271 s,@CC@,$CC,;t t
    4272 s,@CFLAGS@,$CFLAGS,;t t
    4273 s,@ac_ct_CC@,$ac_ct_CC,;t t
     10952s,@TCL_THREADS@,$TCL_THREADS,;t t
     10953s,@SHARED_BUILD@,$SHARED_BUILD,;t t
     10954s,@AR@,$AR,;t t
     10955s,@CELIB_DIR@,$CELIB_DIR,;t t
     10956s,@LIBOBJS@,$LIBOBJS,;t t
     10957s,@DL_LIBS@,$DL_LIBS,;t t
    427410958s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t
    427510959s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t
     10960s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t
    427610961s,@STLIB_LD@,$STLIB_LD,;t t
    427710962s,@SHLIB_LD@,$SHLIB_LD,;t t
     10963s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t
    427810964s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
    4279 s,@SHLIB_LDFLAGS@,$SHLIB_LDFLAGS,;t t
     10965s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t
    428010966s,@TCL_DBGX@,$TCL_DBGX,;t t
    428110967s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t
     
    428410970s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t
    428510971s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t
    4286 s,@Rappture_LIB_FILE@,$Rappture_LIB_FILE,;t t
    4287 s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t
     10972s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t
     10973s,@RANLIB_STUB@,$RANLIB_STUB,;t t
    428810974s,@TCLSH_PROG@,$TCLSH_PROG,;t t
    4289 s,@PACKAGE@,$PACKAGE,;t t
    4290 s,@VERSION@,$VERSION,;t t
     10975s,@BLT_SRC_DIR@,$BLT_SRC_DIR,;t t
     10976s,@RAPPTURE_DIR@,$RAPPTURE_DIR,;t t
     10977s,@ALT_DIR@,$ALT_DIR,;t t
    429110978s,@PATCHLEVEL@,$PATCHLEVEL,;t t
    429210979s,@EXACT_VERSION@,$EXACT_VERSION,;t t
    429310980s,@NODOT_VERSION@,$NODOT_VERSION,;t t
    4294 s,@LIBOBJS@,$LIBOBJS,;t t
    429510981s,@LTLIBOBJS@,$LTLIBOBJS,;t t
    429610982CEOF
     
    446011146  esac
    446111147
     11148  if test x"$ac_file" != x-; then
     11149    { echo "$as_me:$LINENO: creating $ac_file" >&5
     11150echo "$as_me: creating $ac_file" >&6;}
     11151    rm -f "$ac_file"
     11152  fi
    446211153  # Let's still pretend it is `configure' which instantiates (i.e., don't
    446311154  # use $as_me), people would be surprised to read:
     
    449811189      esac
    449911190    done` || { (exit 1); exit 1; }
    4500 
    4501   if test x"$ac_file" != x-; then
    4502     { echo "$as_me:$LINENO: creating $ac_file" >&5
    4503 echo "$as_me: creating $ac_file" >&6;}
    4504     rm -f "$ac_file"
    4505   fi
    450611191_ACEOF
    450711192cat >>$CONFIG_STATUS <<_ACEOF
     
    456311248fi
    456411249
     11250
     11251
  • trunk/src/tcl/configure.in

    r225 r527  
    1 #--------------------------------------------------------------------
     1#!/bin/bash -norc
     2dnl     This file is an input file used by the GNU "autoconf" program to
     3dnl     generate the file "configure", which is run during Tcl installation
     4dnl     to configure the system for the local environment.
     5#
     6# RCS: @(#) $Id: configure.in,v 1.46 2006/01/23 19:18:55 hobbs Exp $
     7
     8#-----------------------------------------------------------------------
    29# Sample configure.in for Tcl Extensions.  The only places you should
    310# need to modify this file are marked by the string __CHANGE__
    4 #--------------------------------------------------------------------
    5 
    6 #--------------------------------------------------------------------
     11#-----------------------------------------------------------------------
     12
     13#-----------------------------------------------------------------------
    714# __CHANGE__
    8 # This very first macro is used to verify that the configure script can
    9 # find the sources.  The argument to AC_INIT should be a unique filename
    10 # for this package, and can be a relative path, such as:
    11 #
    12 # AC_INIT(../generic/tcl.h)
    13 #--------------------------------------------------------------------
    14 
    15 AC_INIT(src/RpLibraryTclInterface.cc)
    16 AC_CONFIG_AUX_DIR(cf)
    17 
    18 #--------------------------------------------------------------------
     15# Set your package name and version numbers here.
     16#
     17# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
     18# set as provided.  These will also be added as -D defs in your Makefile
     19# so you can encode the package version directly into the source files.
     20#-----------------------------------------------------------------------
     21
     22AC_INIT([Rappture], [1.1])
     23
     24#--------------------------------------------------------------------
     25# Call TEA_INIT as the first TEA_ macro to set up initial vars.
     26# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
     27# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
     28#--------------------------------------------------------------------
     29
     30TEA_INIT([3.5])
     31
     32AC_CONFIG_AUX_DIR(tclconfig)
     33
     34#--------------------------------------------------------------------
     35# Extra build options
     36#--------------------------------------------------------------------
     37AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
     38  blt_source_dir=$withval)
     39
     40AC_ARG_WITH(rappture, [  --with-rappture=DIR          Find include/core/rappture.h in DIR],
     41  rappture_dir=$withval)
     42
     43AC_ARG_WITH(altpath, [  --with-altpath=DIR          Alternate path to search for required packages],
     44  alt_dir=$withval)
     45
     46#--------------------------------------------------------------------
     47# Load the tclConfig.sh file
     48#--------------------------------------------------------------------
     49
     50TEA_PATH_TCLCONFIG
     51TEA_LOAD_TCLCONFIG
     52
     53#--------------------------------------------------------------------
     54# Load the tkConfig.sh file if necessary (Tk extension)
     55#--------------------------------------------------------------------
     56
     57#TEA_PATH_TKCONFIG
     58#TEA_LOAD_TKCONFIG
     59
     60#-----------------------------------------------------------------------
     61# Handle the --prefix=... option by defaulting to what Tcl gave.
     62# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
     63#-----------------------------------------------------------------------
     64
     65TEA_PREFIX
     66
     67#-----------------------------------------------------------------------
     68# Standard compiler checks.
     69# This sets up CC by using the CC env var, or looks for gcc otherwise.
     70# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
     71# the basic setup necessary to compile executables.
     72#-----------------------------------------------------------------------
     73
     74TEA_SETUP_COMPILER
     75
     76#-----------------------------------------------------------------------
    1977# __CHANGE__
    20 # Set your package name and version numbers here.  The NODOT_VERSION is
    21 # required for constructing the library name on systems that don't like
    22 # dots in library names (Windows).  The VERSION variable is used on the
    23 # other systems.
    24 #--------------------------------------------------------------------
    25 
    26 PACKAGE=Rappture
    27 
    28 MAJOR_VERSION=1
    29 MINOR_VERSION=1
    30 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}
    31 
    32 #--------------------------------------------------------------------
    33 # Extra build options
    34 #--------------------------------------------------------------------
    35 #AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
    36 #  blt_source_dir=$withval)
    37 
    38 #--------------------------------------------------------------------
    39 # We put this here so that you can compile with -DVERSION="1.2" to
    40 # encode the package version directly into the source files.
    41 #--------------------------------------------------------------------
    42 
    43 eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")
    44 
    45 #--------------------------------------------------------------------
    46 # Check whether --enable-gcc or --disable-gcc was given.  Do this
    47 # before AC_CYGWIN is called so the compiler can
    48 # be fully tested by built-in autoconf tools.
    49 # This macro also calls AC_PROG_CC to set the compiler if --enable-gcc
    50 # was not used.
    51 #--------------------------------------------------------------------
    52 
    53 #SC_ENABLE_GCC
    54 AC_PROG_CXX
    55 AC_PROG_INSTALL
    56 
    57 #--------------------------------------------------------------------
    58 # Checks to see if the make program sets the $MAKE variable.
    59 #--------------------------------------------------------------------
    60 
    61 AC_PROG_MAKE_SET
    62 
    63 #--------------------------------------------------------------------
    64 # Find ranlib
    65 #--------------------------------------------------------------------
    66 
    67 AC_PROG_RANLIB
    68 
    69 #--------------------------------------------------------------------
    70 # This macro performs additional compiler tests.
    71 #--------------------------------------------------------------------
    72 
    73 AC_CYGWIN
    74 
    75 #--------------------------------------------------------------------
    76 # Determines the correct binary file extension (.o, .obj, .exe etc.)
    77 #--------------------------------------------------------------------
    78 
    79 AC_OBJEXT
    80 AC_EXEEXT
    81 
    82 #--------------------------------------------------------------------
    83 # "cygpath" is used on windows to generate native path names for include
     78# Specify the C source files to compile in TEA_ADD_SOURCES,
     79# public headers that need to be installed in TEA_ADD_HEADERS,
     80# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
     81# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
     82# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
     83# and PKG_TCL_SOURCES.
     84#-----------------------------------------------------------------------
     85
     86TEA_ADD_SOURCES([Rappture_Init.cc RpLibraryTclInterface.cc RpUnitsTclInterface.cc ])
     87TEA_ADD_HEADERS([])
     88TEA_ADD_INCLUDES([])
     89TEA_ADD_LIBS(BLT24.lib libexpat.lib ../librappture.lib)
     90TEA_ADD_CFLAGS([])
     91TEA_ADD_STUB_SOURCES([])
     92TEA_ADD_TCL_SOURCES([scripts/exec.tcl scripts/value.tcl init.tcl ../../tcl/scripts/library.tcl ../../tcl/scripts/result.tcl])
     93
     94#--------------------------------------------------------------------
     95# __CHANGE__
     96# A few miscellaneous platform-specific items:
     97#
     98# Define a special symbol for Windows (BUILD_sample in this case) so
     99# that we create the export library with the dll.
     100#
     101# Windows creates a few extra files that need to be cleaned up.
     102# You can add more files to clean if your extension creates any extra
    84103# files.
    85 # These variables should only be used with the compiler and linker since
    86 # they generate native path names.
    87 #
    88 # Unix tclConfig.sh points SRC_DIR at the top-level directory of
    89 # the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at
    90 # the win subdirectory.  Hence the different usages of SRC_DIR below.
    91 #
    92 # This must be done before calling SC_PUBLIC_TCL_HEADERS
    93 #--------------------------------------------------------------------
    94 
    95 case "`uname -s`" in
    96     *win32* | *WIN32* | *CYGWIN_NT*)
    97         CYGPATH="cygpath -w"
    98     ;;
    99     *)
    100         CYGPATH=echo
    101     ;;
    102 esac
    103 
    104 AC_SUBST(CYGPATH)
     104#
     105# TEA_ADD_* any platform specific compiler/build info here.
     106#--------------------------------------------------------------------
     107
     108if test "${TEA_PLATFORM}" = "windows" ; then
     109    AC_DEFINE(BUILD_rappture, 1, [Build windows export dll])
     110    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
     111    TEA_ADD_LIBS(/LIBPATH:C:/opt/lib /LIBPATH:C:/Tcl/lib scew_s.lib)
     112    #TEA_ADD_SOURCES([win/winFile.c])
     113    #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
     114else
     115    CLEANFILES=""
     116    #TEA_ADD_SOURCES([unix/unixFile.c])
     117    TEA_ADD_LIBS([scew.lib])
     118fi
     119AC_SUBST(CLEANFILES)
    105120
    106121#--------------------------------------------------------------------
     
    110125# contain private data structures and are subject to change without
    111126# notice.
    112 # This MUST be called before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG
    113 #--------------------------------------------------------------------
    114 
    115 SC_PUBLIC_TCL_HEADERS
    116 #SC_PRIVATE_TCL_HEADERS
    117 
    118 #--------------------------------------------------------------------
    119 # Load the tclConfig.sh file
    120 #--------------------------------------------------------------------
    121 
    122 SC_PATH_TCLCONFIG
    123 SC_LOAD_TCLCONFIG
     127# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
     128#--------------------------------------------------------------------
     129
     130TEA_PUBLIC_TCL_HEADERS
     131#TEA_PRIVATE_TCL_HEADERS
     132
     133#TEA_PUBLIC_TK_HEADERS
     134#TEA_PRIVATE_TK_HEADERS
     135#TEA_PATH_X
     136
     137#--------------------------------------------------------------------
     138# Check whether --enable-threads or --disable-threads was given.
     139# This auto-enables if Tcl was compiled threaded.
     140#--------------------------------------------------------------------
     141
     142TEA_ENABLE_THREADS
     143
     144#--------------------------------------------------------------------
     145# The statement below defines a collection of symbols related to
     146# building as a shared library instead of a static library.
     147#--------------------------------------------------------------------
     148
     149TEA_ENABLE_SHARED
     150
     151#--------------------------------------------------------------------
     152# This macro figures out what flags to use with the compiler/linker
     153# when building shared/static debug/optimized objects.  This information
     154# can be taken from the tclConfig.sh file, but this figures it all out.
     155#--------------------------------------------------------------------
     156
     157TEA_CONFIG_CFLAGS
     158
     159#--------------------------------------------------------------------
     160# Set the default compiler switches based on the --enable-symbols option.
     161#--------------------------------------------------------------------
     162
     163TEA_ENABLE_SYMBOLS
     164
     165#--------------------------------------------------------------------
     166# Everyone should be linking against the Tcl stub library.  If you
     167# can't for some reason, remove this definition.  If you aren't using
     168# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
     169# link against the non-stubbed Tcl library.  Add Tk too if necessary.
     170#--------------------------------------------------------------------
     171
     172AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
     173#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
     174
     175#--------------------------------------------------------------------
     176# This macro generates a line to use when building a library.  It
     177# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
     178# and TEA_LOAD_TCLCONFIG macros above.
     179#--------------------------------------------------------------------
     180
     181TEA_MAKE_LIB
     182
     183#--------------------------------------------------------------------
     184# Determine the name of the tclsh and/or wish executables in the
     185# Tcl and Tk build directories or the location they were installed
     186# into. These paths are used to support running test cases only,
     187# the Makefile should not be making use of these paths to generate
     188# a pkgIndex.tcl file or anything else at extension build time.
     189#--------------------------------------------------------------------
     190
     191TEA_PROG_TCLSH
     192#TEA_PROG_WISH
     193
    124194
    125195#--------------------------------------------------------------------
     
    131201if test "x$blt_source_dir" != "x" ; then
    132202  #
    133   # Verify that a tclConfig.sh file exists in the directory specified 
    134   # by --with-blt. 
     203  # Verify that a tclConfig.sh file exists in the directory specified
     204  # by --with-blt.
    135205  #
    136206  if test -r "$blt_source_dir/bltInt.h" ; then
     
    139209    BLT_SRC_DIR="$blt_source_dir/src"
    140210  fi
    141 else 
     211else
    142212  #
    143213  # Otherwise, search for the bltInt.h include file...
    144214  # 1. Search previously named locations.
    145   # 
     215  #
    146216  for dir in \
    147217   $prefix \
     
    152222      break
    153223    elif test -r "$dir/include/bltInt.h" ; then
    154       BLT_SRC_DIR="$dir/lib"
     224      BLT_SRC_DIR="$dir/include"
    155225      break
    156226    fi
     
    158228  #
    159229  #  2. Search source directories.
    160   # 
     230  #
    161231  if test "x$BLT_SRC_DIR" = "x" ; then
    162232    for dir in \
     
    166236     ../../blt \
    167237     `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
    168      ../../../blt
     238     ../../../blt \
     239     `ls -dr c:/opt/blt[[2-3]].[[0-9]]* 2>/dev/null` \
     240     c\:/opt/blt
    169241    do
    170       if test -r "$dir/bltInt.h" ; then
    171         tclConfigFile="$dir/bltInt.h"
    172         break
     242      if test -r "$dir/src/bltInt.h" ; then
     243        BLT_SRC_DIR="$dir/src"
     244        break
    173245      fi
    174246    done
    175247  fi
    176248fi
    177 
    178249AC_MSG_RESULT([${BLT_SRC_DIR}])
    179250
     
    185256
    186257AC_SUBST(BLT_SRC_DIR)
    187 
    188 #--------------------------------------------------------------------
    189 # __CHANGE__
    190 # A few miscellaneous platform-specific items:
    191 #
    192 # Define a special symbol for Windows (BUILD_exampleA in this case) so
    193 # that we create the export library with the dll.  See sha1.h on how
    194 # to use this.
    195 #
    196 # Windows creates a few extra files that need to be cleaned up.
    197 # You can add more files to clean if your extension creates any extra
    198 # files.
    199 #
    200 # Define any extra compiler flags in the PACKAGE_CFLAGS variable.
    201 # These will be appended to the current set of compiler flags for
    202 # your system.
    203 #--------------------------------------------------------------------
    204 
    205 case "`uname -s`" in
    206     *win32* | *WIN32* | *CYGWIN_NT*)
    207         AC_DEFINE(BUILD_Rappture)
    208         CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch"
    209         AC_SUBST(CLEANFILES)
    210     ;;
    211     *)
    212         CLEANFILES=
    213     ;;
    214 esac
    215 
    216 #--------------------------------------------------------------------
    217 # Check whether --enable-threads or --disable-threads was given.
    218 # So far only Tcl responds to this one.
    219 #--------------------------------------------------------------------
    220 
    221 SC_ENABLE_THREADS
    222 
    223 #--------------------------------------------------------------------
    224 # The statement below defines a collection of symbols related to
    225 # building as a shared library instead of a static library.
    226 #--------------------------------------------------------------------
    227 
    228 SC_ENABLE_SHARED
    229 
    230 #--------------------------------------------------------------------
    231 # This macro figures out what flags to use with the compiler/linker
    232 # when building shared/static debug/optimized objects.  This information
    233 # is all taken from the tclConfig.sh file.
    234 #--------------------------------------------------------------------
    235 
    236 CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
    237 CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
    238 LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
    239 LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
    240 SHLIB_LD=${TCL_SHLIB_LD}
    241 STLIB_LD=${TCL_STLIB_LD}
    242 SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
    243 
    244 AC_SUBST(CFLAGS_DEBUG)
    245 AC_SUBST(CFLAGS_OPTIMIZE)
    246 AC_SUBST(STLIB_LD)
    247 AC_SUBST(SHLIB_LD)
    248 AC_SUBST(SHLIB_CFLAGS)
    249 AC_SUBST(SHLIB_LDFLAGS)
    250 
    251 #--------------------------------------------------------------------
    252 # Set the default compiler switches based on the --enable-symbols
    253 # option.
    254 #--------------------------------------------------------------------
    255 
    256 SC_ENABLE_SYMBOLS
    257 
    258 if test "${SHARED_BUILD}" = "1" ; then
    259     CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
     258#--------------------------------------------------------------------
     259# Look for rappture.h on the normal include path.  If not found, look
     260# for it in the --with-rappture directory.
     261#--------------------------------------------------------------------
     262AC_MSG_CHECKING([for rappture.h])
     263RAPPTURE_DIR=""
     264if test "x$rappture_source_dir" != "x" ; then
     265  #
     266  # Verify that a rappture.h file exists in the directory specified
     267  # by --with-rappture.
     268  #
     269  if test -r "$rappture_dir/include/core/rappture.h" ; then
     270    RAPPTURE_DIR="$rappture_dir"
     271  fi
    260272else
    261     CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
    262 fi
    263 
    264 #--------------------------------------------------------------------
    265 # Everyone should be linking against the Tcl stub library.  If you
    266 # can't for some reason, remove this definition.  If you aren't using
    267 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
    268 # link against the non-stubbed Tcl library.
    269 #--------------------------------------------------------------------
    270 
    271 AC_DEFINE(USE_TCL_STUBS)
    272 
    273 #--------------------------------------------------------------------
    274 # This macro generates a line to use when building a library.  It
    275 # depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS,
    276 # and SC_LOAD_TCLCONFIG macros above.
    277 #--------------------------------------------------------------------
    278 
    279 SC_MAKE_LIB
    280 
    281 #--------------------------------------------------------------------
    282 # eval these two values to dereference the ${DBGX} variable.
    283 #--------------------------------------------------------------------
    284 
    285 eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}"
    286 eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
    287 
    288 #--------------------------------------------------------------------
    289 # Shared libraries and static libraries have different names.
    290 #--------------------------------------------------------------------
    291 
    292 case "`uname -s`" in
    293     *win32* | *WIN32* | *CYGWIN_NT*)
    294         if test "${SHARED_BUILD}" = "1" ; then
    295             SHLIB_LD_LIBS="\"`cygpath -w ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\" ${TCL_SHLIB_LD_LIBS}"
    296             eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}"
    297             RANLIB=:
    298         else
    299             eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}"
    300         fi
    301         ;;
    302     *)
    303         if test "${SHARED_BUILD}" = "1" ; then
    304             SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC}"
    305             eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}"
    306             RANLIB=:
    307         else
    308             eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}"
    309         fi
    310         ;;
    311 esac
    312 
    313 #--------------------------------------------------------------------
    314 # __CHANGE__
    315 # Change the name from exampeA_LIB_FILE to match your package name.
    316 #--------------------------------------------------------------------
    317 
    318 AC_SUBST(Rappture_LIB_FILE)
    319 AC_SUBST(SHLIB_LD_LIBS)
    320 
    321 #--------------------------------------------------------------------
    322 # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
    323 # file during the install process.  Don't run the TCLSH_PROG through
    324 # ${CYGPATH} because it's being used directly by make.
    325 # Require that we use a tclsh shell version 8.2 or later since earlier
    326 # versions have bugs in the pkg_mkIndex routine.
    327 #--------------------------------------------------------------------
    328 
    329 AC_PATH_PROGS(TCLSH_PROG, tclsh8.4${EXEEXT} tclsh84${EXEEXT} tclsh${EXEEXT}, :, ${exec_prefix}:${PATH})
    330 
    331 if test "x${TCLSH_PROG}" = "x:" ; then
    332     AC_MSG_WARN(No tclsh executable found.  You will have to build the pkgIndex.tcl file manually.)
    333 fi
    334 AC_SUBST(TCLSH_PROG)
    335 
    336 #--------------------------------------------------------------------
    337 # Finalize patchlevel and version info
    338 #--------------------------------------------------------------------
     273  #
     274  # Otherwise, search for the rappture.h include file...
     275  # 1. Search previously named locations.
     276  #
     277  for dir in \
     278   $prefix \
     279   $exec_prefix
     280  do
     281    if test -r "$dir/include/core/rappture.h" ; then
     282      RAPPTURE_DIR="$dir"
     283      break
     284    fi
     285  done
     286  #
     287  #  2. Search source directories.
     288  #
     289  if test "x$RAPPTURE_DIR" = "x" ; then
     290    for dir in \
     291     `ls -dr ../rappture 2>/dev/null` \
     292     `ls -dr ../../rappture 2>/dev/null` \
     293     `ls -dr ../../../rappture 2>/dev/null` \
     294     `ls -dr C\:/opt/rappture 2>/dev/null` \
     295     `ls -dr /opt/rappture 2>/dev/null`
     296    do
     297      if test -r "$dir/include/core/rappture.h" ; then
     298        RAPPTURE_DIR="$dir"
     299        break
     300      fi
     301    done
     302  fi
     303fi
     304AC_MSG_RESULT([${RAPPTURE_DIR}])
     305
     306if test "x$RAPPTURE_DIR" = "x" ; then
     307  echo "can't find RAPPTURE include file \"rappture.h\""
     308  echo "use --with-rappture=DIR to specify the location of rappture"
     309  exit 1
     310fi
     311
     312AC_SUBST(RAPPTURE_DIR)
     313
     314#--------------------------------------------------------------------
     315# Look for scew.h on the normal include path.  If not found, look
     316# for it in the --with-scew directory.
     317#--------------------------------------------------------------------
     318AC_MSG_CHECKING([for alternate paths])
     319ALT_DIR=""
     320if test "x$alt_dir" != "x" ; then
     321  #
     322  # Verify that a include and lib directories exist in the directory specified
     323  # by --with-altpath.
     324  #
     325  if test -d "$alt_dir/include" -a -d "$alt_dir/lib" ; then
     326    ALT_DIR="$rappture_dir"
     327  fi
     328else
     329  if test "x$ALT_DIR" = "x" ; then
     330    for dir in \
     331     C\:/opt /opt
     332    do
     333      if test -r "$dir/include" -a -d "$dir/lib" ; then
     334        ALT_DIR="$dir"
     335        break
     336      fi
     337    done
     338  fi
     339fi
     340if test "x$ALT_DIR" = "x" ; then
     341    AC_MSG_RESULT(none)
     342  else
     343    AC_MSG_RESULT([${ALT_DIR}])
     344fi
     345
     346AC_SUBST(ALT_DIR)
     347
    339348PATCHLEVEL=`${TCLSH_PROG} cf/patchlevel.tcl`
    340349EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL}
    341350NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
    342351
    343 AC_SUBST(PACKAGE)
    344 AC_SUBST(VERSION)
    345352AC_SUBST(PATCHLEVEL)
    346353AC_SUBST(EXACT_VERSION)
    347354AC_SUBST(NODOT_VERSION)
    348355
    349 
    350356#--------------------------------------------------------------------
    351357# Finally, substitute all of the various values into the Makefile.
     358# You may alternatively have a special pkgIndex.tcl.in or other files
     359# which require substituting th AC variables in.  Include these here.
    352360#--------------------------------------------------------------------
    353361
    354362AC_OUTPUT([Makefile pkgIndex.tcl init.tcl])
     363
     364
  • trunk/src/tcl/init.tcl.in

    r394 r527  
    2424
    2525    set suffix [info sharedlibextension]
    26     set library [file join $dir .. libRappture@VERSION@${suffix}]
    27     load $library
     26    set library [file join $dir @PKG_LIB_FILE@]
     27    load $library @PACKAGE_NAME@
    2828
    2929    namespace eval Rappture {
     
    3434    namespace eval Rappture::LibraryObj {}
    3535
    36     package provide Rappture @VERSION@
     36    package provide Rappture @PACKAGE_VERSION@
    3737    rename Rappture_init ""
    3838}
  • trunk/src/tcl/pkgIndex.tcl.in

    r399 r527  
    11# this file identifies Rappture as a Tcl package
    2 package ifneeded Rappture @VERSION@ [list source [file join $dir init.tcl]]
     2package ifneeded Rappture @PACKAGE_VERSION@ [list source [file join $dir init.tcl]]
    33namespace eval Rappture {}
    44set Rappture::installdir [file join $dir]
  • trunk/src/tcl/src/Rappture_Init.cc

    r225 r527  
    1919#endif
    2020
    21 int Rappture_Init _ANSI_ARGS_((Tcl_Interp *interp));
     21#ifdef BUILD_rappture
     22#undef TCL_STORAGE_CLASS
     23#define TCL_STORAGE_CLASS DLLEXPORT
     24#endif
     25
     26EXTERN int Rappture_Init _ANSI_ARGS_((Tcl_Interp *interp));
    2227
    2328#include "RpLibraryTclInterface.h"
     
    3136Rappture_Init( Tcl_Interp * interp)
    3237{
     38    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
     39        return TCL_ERROR;
     40    }
     41
     42    if (Tcl_PkgProvide(interp, "Rappture", PACKAGE_VERSION) != TCL_OK) {
     43        return TCL_ERROR;
     44    }
     45
    3346    if (Rappturelibrary_Init(interp) != TCL_OK) {
    3447        return TCL_ERROR;
  • trunk/src/tcl/src/RpLibraryTclInterface.cc

    r424 r527  
    6666
    6767
    68 static std::string rpLib2command _ANSI_ARGS_(( Tcl_Interp *interp,
    69                                                RpLibrary* newRpLibObj   ));
    7068void appendExpectErr    _ANSI_ARGS_((   Tcl_Interp *interp,
    7169                                        const char* errTxt,
     
    9896}
    9997#endif
     98static std::string rpLib2command _ANSI_ARGS_(( Tcl_Interp *interp,
     99                                               RpLibrary* newRpLibObj   ));
    100100
    101101/*
  • trunk/src/tcl/tclconfig/tcl.m4

    r521 r527  
    44#       a Tcl extension.
    55#
    6 # Copyright (c) 1999 Scriptics Corporation.
     6# Copyright (c) 1999-2000 Ajuba Solutions.
     7# Copyright (c) 2002-2005 ActiveState Corporation.
    78#
    89# See the file "license.terms" for information on usage and redistribution
    910# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    10 
    11 #------------------------------------------------------------------------
    12 # SC_PATH_TCLCONFIG --
     11#
     12# RCS: @(#) $Id: tcl.m4,v 1.92 2006/05/26 19:15:38 das Exp $
     13
     14AC_PREREQ(2.50)
     15
     16dnl TEA extensions pass this us the version of TEA they think they
     17dnl are compatible with (must be set in TEA_INIT below)
     18dnl TEA_VERSION="3.5"
     19
     20# Possible values for key variables defined:
     21#
     22# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
     23# TEA_PLATFORM        - windows unix
     24#
     25
     26#------------------------------------------------------------------------
     27# TEA_PATH_TCLCONFIG --
    1328#
    1429#       Locate the tclConfig.sh file and perform a sanity check on
     
    2843#------------------------------------------------------------------------
    2944
    30 AC_DEFUN(SC_PATH_TCLCONFIG, [
     45AC_DEFUN([TEA_PATH_TCLCONFIG], [
     46    dnl Make sure we are initialized
     47    AC_REQUIRE([TEA_INIT])
    3148    #
    3249    # Ok, lets find the tcl configuration
     
    3855        # we reset no_tcl in case something fails here
    3956        no_tcl=true
    40         AC_ARG_WITH(tcl, [  --with-tcl              directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
     57        AC_ARG_WITH(tcl,
     58            AC_HELP_STRING([--with-tcl],
     59                [directory containing tcl configuration (tclConfig.sh)]),
     60            with_tclconfig=${withval})
    4161        AC_MSG_CHECKING([for Tcl configuration])
    4262        AC_CACHE_VAL(ac_cv_c_tclconfig,[
     
    4464            # First check to see if --with-tcl was specified.
    4565            if test x"${with_tclconfig}" != x ; then
     66                case ${with_tclconfig} in
     67                    */tclConfig.sh )
     68                        if test -f ${with_tclconfig}; then
     69                            AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
     70                            with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
     71                        fi ;;
     72                esac
    4673                if test -f "${with_tclconfig}/tclConfig.sh" ; then
    4774                    ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
     
    5582                for i in \
    5683                        ../tcl \
     84                        `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     85                        `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    5786                        `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
    5887                        ../../tcl \
     88                        `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     89                        `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    5990                        `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
    6091                        ../../../tcl \
     92                        `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     93                        `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    6194                        `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
    6295                    if test -f "$i/unix/tclConfig.sh" ; then
     
    67100            fi
    68101
    69             # check in a few common install locations
    70             if test x"${ac_cv_c_tclconfig}" = x ; then
    71                 for i in `ls -d ${prefix}/lib 2>/dev/null` \
    72                         `ls -d /usr/local/lib 2>/dev/null` ; do
     102            # on Darwin, check in Framework installation locations
     103            if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
     104                for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
     105                        `ls -d /Library/Frameworks 2>/dev/null` \
     106                        `ls -d /Network/Library/Frameworks 2>/dev/null` \
     107                        `ls -d /System/Library/Frameworks 2>/dev/null` \
     108                        ; do
     109                    if test -f "$i/Tcl.framework/tclConfig.sh" ; then
     110                        ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
     111                        break
     112                    fi
     113                done
     114            fi
     115
     116            # on Windows, check in common installation locations
     117            if test "${TEA_PLATFORM}" = "windows" \
     118                -a x"${ac_cv_c_tclconfig}" = x ; then
     119                for i in `ls -d C:/Tcl/lib 2>/dev/null` \
     120                        `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
     121                        ; do
    73122                    if test -f "$i/tclConfig.sh" ; then
    74123                        ac_cv_c_tclconfig=`(cd $i; pwd)`
     
    78127            fi
    79128
     129            # check in a few common install locations
     130            if test x"${ac_cv_c_tclconfig}" = x ; then
     131                for i in `ls -d ${libdir} 2>/dev/null` \
     132                        `ls -d ${exec_prefix}/lib 2>/dev/null` \
     133                        `ls -d ${prefix}/lib 2>/dev/null` \
     134                        `ls -d /usr/local/lib 2>/dev/null` \
     135                        `ls -d /usr/contrib/lib 2>/dev/null` \
     136                        `ls -d /usr/lib 2>/dev/null` \
     137                        ; do
     138                    if test -f "$i/tclConfig.sh" ; then
     139                        ac_cv_c_tclconfig=`(cd $i; pwd)`
     140                        break
     141                    fi
     142                done
     143            fi
     144
    80145            # check in a few other private locations
    81146            if test x"${ac_cv_c_tclconfig}" = x ; then
    82147                for i in \
    83148                        ${srcdir}/../tcl \
     149                        `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     150                        `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    84151                        `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
    85152                    if test -f "$i/unix/tclConfig.sh" ; then
     
    93160        if test x"${ac_cv_c_tclconfig}" = x ; then
    94161            TCL_BIN_DIR="# no Tcl configs found"
    95             AC_MSG_WARN(Can't find Tcl configuration definitions)
     162            AC_MSG_WARN([Can't find Tcl configuration definitions])
    96163            exit 0
    97164        else
    98165            no_tcl=
    99166            TCL_BIN_DIR=${ac_cv_c_tclconfig}
    100             AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
     167            AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
    101168        fi
    102169    fi
     
    104171
    105172#------------------------------------------------------------------------
    106 # SC_PATH_TKCONFIG --
     173# TEA_PATH_TKCONFIG --
    107174#
    108175#       Locate the tkConfig.sh file
     
    121188#------------------------------------------------------------------------
    122189
    123 AC_DEFUN(SC_PATH_TKCONFIG, [
     190AC_DEFUN([TEA_PATH_TKCONFIG], [
    124191    #
    125192    # Ok, lets find the tk configuration
     
    131198        # we reset no_tk in case something fails here
    132199        no_tk=true
    133         AC_ARG_WITH(tk, [  --with-tk               directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval})
     200        AC_ARG_WITH(tk,
     201            AC_HELP_STRING([--with-tk],
     202                [directory containing tk configuration (tkConfig.sh)]),
     203            with_tkconfig=${withval})
    134204        AC_MSG_CHECKING([for Tk configuration])
    135205        AC_CACHE_VAL(ac_cv_c_tkconfig,[
     
    137207            # First check to see if --with-tkconfig was specified.
    138208            if test x"${with_tkconfig}" != x ; then
     209                case ${with_tkconfig} in
     210                    */tkConfig.sh )
     211                        if test -f ${with_tkconfig}; then
     212                            AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
     213                            with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'`
     214                        fi ;;
     215                esac
    139216                if test -f "${with_tkconfig}/tkConfig.sh" ; then
    140217                    ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
     
    148225                for i in \
    149226                        ../tk \
     227                        `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     228                        `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
    150229                        `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
    151230                        ../../tk \
     231                        `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     232                        `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
    152233                        `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
    153234                        ../../../tk \
     235                        `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     236                        `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
    154237                        `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
    155238                    if test -f "$i/unix/tkConfig.sh" ; then
     
    159242                done
    160243            fi
     244
     245            # on Darwin, check in Framework installation locations
     246            if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
     247                for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
     248                        `ls -d /Library/Frameworks 2>/dev/null` \
     249                        `ls -d /Network/Library/Frameworks 2>/dev/null` \
     250                        `ls -d /System/Library/Frameworks 2>/dev/null` \
     251                        ; do
     252                    if test -f "$i/Tk.framework/tkConfig.sh" ; then
     253                        ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
     254                        break
     255                    fi
     256                done
     257            fi
     258
    161259            # check in a few common install locations
    162260            if test x"${ac_cv_c_tkconfig}" = x ; then
    163                 for i in `ls -d ${prefix}/lib 2>/dev/null` \
    164                         `ls -d /usr/local/lib 2>/dev/null` ; do
     261                for i in `ls -d ${libdir} 2>/dev/null` \
     262                        `ls -d ${exec_prefix}/lib 2>/dev/null` \
     263                        `ls -d ${prefix}/lib 2>/dev/null` \
     264                        `ls -d /usr/local/lib 2>/dev/null` \
     265                        `ls -d /usr/contrib/lib 2>/dev/null` \
     266                        `ls -d /usr/lib 2>/dev/null` \
     267                        ; do
    165268                    if test -f "$i/tkConfig.sh" ; then
    166269                        ac_cv_c_tkconfig=`(cd $i; pwd)`
     
    169272                done
    170273            fi
     274
     275            # on Windows, check in common installation locations
     276            if test "${TEA_PLATFORM}" = "windows" \
     277                -a x"${ac_cv_c_tkconfig}" = x ; then
     278                for i in `ls -d C:/Tcl/lib 2>/dev/null` \
     279                        `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
     280                        ; do
     281                    if test -f "$i/tkConfig.sh" ; then
     282                        ac_cv_c_tkconfig=`(cd $i; pwd)`
     283                        break
     284                    fi
     285                done
     286            fi
     287
    171288            # check in a few other private locations
    172289            if test x"${ac_cv_c_tkconfig}" = x ; then
    173290                for i in \
    174291                        ${srcdir}/../tk \
     292                        `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
     293                        `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
    175294                        `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
    176295                    if test -f "$i/unix/tkConfig.sh" ; then
     
    181300            fi
    182301        ])
     302
    183303        if test x"${ac_cv_c_tkconfig}" = x ; then
    184304            TK_BIN_DIR="# no Tk configs found"
    185             AC_MSG_WARN(Can't find Tk configuration definitions)
     305            AC_MSG_WARN([Can't find Tk configuration definitions])
    186306            exit 0
    187307        else
    188308            no_tk=
    189309            TK_BIN_DIR=${ac_cv_c_tkconfig}
    190             AC_MSG_RESULT(found $TK_BIN_DIR/tkConfig.sh)
     310            AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
    191311        fi
    192312    fi
    193 
    194 ])
    195 
    196 #------------------------------------------------------------------------
    197 # SC_LOAD_TCLCONFIG --
     313])
     314
     315#------------------------------------------------------------------------
     316# TEA_LOAD_TCLCONFIG --
    198317#
    199318#       Load the tclConfig.sh file
     
    213332#------------------------------------------------------------------------
    214333
    215 AC_DEFUN(SC_LOAD_TCLCONFIG, [
    216     AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
    217 
    218     if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
     334AC_DEFUN([TEA_LOAD_TCLCONFIG], [
     335    AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
     336
     337    if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
    219338        AC_MSG_RESULT([loading])
    220         . $TCL_BIN_DIR/tclConfig.sh
     339        . ${TCL_BIN_DIR}/tclConfig.sh
    221340    else
    222         AC_MSG_RESULT([file not found])
    223     fi
    224 
    225     #
    226     # The eval is required to do the TCL_DBGX substitution in the
    227     # TCL_LIB_FILE variable
    228     #
    229 
    230     eval TCL_LIB_FILE=${TCL_LIB_FILE}
    231     eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
    232 
     341        AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
     342    fi
     343
     344    # eval is required to do the TCL_DBGX substitution
     345    eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
     346    eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
     347
     348    # If the TCL_BIN_DIR is the build directory (not the install directory),
     349    # then set the common variable name to the value of the build variables.
     350    # For example, the variable TCL_LIB_SPEC will be set to the value
     351    # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
     352    # instead of TCL_BUILD_LIB_SPEC since it will work with both an
     353    # installed and uninstalled version of Tcl.
     354    if test -f ${TCL_BIN_DIR}/Makefile ; then
     355        TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
     356        TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
     357        TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
     358    elif test "`uname -s`" = "Darwin"; then
     359        # If Tcl was built as a framework, attempt to use the libraries
     360        # from the framework at the given location so that linking works
     361        # against Tcl.framework installed in an arbitary location.
     362        case ${TCL_DEFS} in
     363            *TCL_FRAMEWORK*)
     364                if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
     365                    for i in "`cd ${TCL_BIN_DIR}; pwd`" \
     366                             "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
     367                        if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
     368                            TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
     369                            break
     370                        fi
     371                    done
     372                fi
     373                if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
     374                    TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
     375                    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
     376                fi
     377                ;;
     378        esac
     379    fi
     380
     381    # eval is required to do the TCL_DBGX substitution
     382    eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
     383    eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
     384    eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
     385    eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
     386
     387    AC_SUBST(TCL_VERSION)
    233388    AC_SUBST(TCL_BIN_DIR)
    234389    AC_SUBST(TCL_SRC_DIR)
     390
    235391    AC_SUBST(TCL_LIB_FILE)
     392    AC_SUBST(TCL_LIB_FLAG)
     393    AC_SUBST(TCL_LIB_SPEC)
     394
     395    AC_SUBST(TCL_STUB_LIB_FILE)
     396    AC_SUBST(TCL_STUB_LIB_FLAG)
     397    AC_SUBST(TCL_STUB_LIB_SPEC)
     398
    236399    AC_SUBST(TCL_LIBS)
    237400    AC_SUBST(TCL_DEFS)
    238     AC_SUBST(TCL_SHLIB_LD_LIBS)
    239401    AC_SUBST(TCL_EXTRA_CFLAGS)
    240402    AC_SUBST(TCL_LD_FLAGS)
    241     AC_SUBST(TCL_LIB_FILE)
    242     AC_SUBST(TCL_STUB_LIB_FILE)
    243     AC_SUBST(TCL_LIB_SPEC)
    244     AC_SUBST(TCL_BUILD_LIB_SPEC)
    245     AC_SUBST(TCL_STUB_LIB_SPEC)
    246     AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
    247 ])
    248 
    249 #------------------------------------------------------------------------
    250 # SC_LOAD_TKCONFIG --
     403    AC_SUBST(TCL_SHLIB_LD_LIBS)
     404])
     405
     406#------------------------------------------------------------------------
     407# TEA_LOAD_TKCONFIG --
    251408#
    252409#       Load the tkConfig.sh file
     
    263420#------------------------------------------------------------------------
    264421
    265 AC_DEFUN(SC_LOAD_TKCONFIG, [
    266     AC_MSG_CHECKING([for existence of $TCLCONFIG])
    267 
    268     if test -f "$TK_BIN_DIR/tkConfig.sh" ; then
    269         AC_MSG_CHECKING([loading $TK_BIN_DIR/tkConfig.sh])
    270         . $TK_BIN_DIR/tkConfig.sh
     422AC_DEFUN([TEA_LOAD_TKCONFIG], [
     423    AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
     424
     425    if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
     426        AC_MSG_RESULT([loading])
     427        . ${TK_BIN_DIR}/tkConfig.sh
    271428    else
    272         AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh])
    273     fi
    274 
     429        AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
     430    fi
     431
     432    # eval is required to do the TK_DBGX substitution
     433    eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
     434    eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
     435
     436    # If the TK_BIN_DIR is the build directory (not the install directory),
     437    # then set the common variable name to the value of the build variables.
     438    # For example, the variable TK_LIB_SPEC will be set to the value
     439    # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
     440    # instead of TK_BUILD_LIB_SPEC since it will work with both an
     441    # installed and uninstalled version of Tcl.
     442    if test -f ${TK_BIN_DIR}/Makefile ; then
     443        TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
     444        TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
     445        TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
     446    elif test "`uname -s`" = "Darwin"; then
     447        # If Tk was built as a framework, attempt to use the libraries
     448        # from the framework at the given location so that linking works
     449        # against Tk.framework installed in an arbitary location.
     450        case ${TK_DEFS} in
     451            *TK_FRAMEWORK*)
     452                if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
     453                    for i in "`cd ${TK_BIN_DIR}; pwd`" \
     454                             "`cd ${TK_BIN_DIR}/../..; pwd`"; do
     455                        if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
     456                            TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
     457                            break
     458                        fi
     459                    done
     460                fi
     461                if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
     462                    TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
     463                    TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
     464                fi
     465                ;;
     466        esac
     467    fi
     468
     469    # eval is required to do the TK_DBGX substitution
     470    eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
     471    eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
     472    eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
     473    eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
     474
     475    # Ensure windowingsystem is defined
     476    if test "${TEA_PLATFORM}" = "unix" ; then
     477        case ${TK_DEFS} in
     478            *MAC_OSX_TK*)
     479                AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
     480                TEA_WINDOWINGSYSTEM="aqua"
     481                ;;
     482            *)
     483                TEA_WINDOWINGSYSTEM="x11"
     484                ;;
     485        esac
     486    elif test "${TEA_PLATFORM}" = "windows" ; then
     487        TEA_WINDOWINGSYSTEM="win32"
     488    fi
     489
     490    AC_SUBST(TK_VERSION)
    275491    AC_SUBST(TK_BIN_DIR)
    276492    AC_SUBST(TK_SRC_DIR)
     493
    277494    AC_SUBST(TK_LIB_FILE)
    278 ])
    279 
    280 #------------------------------------------------------------------------
    281 # SC_ENABLE_GCC --
    282 #
    283 #       Allows the use of GCC if available
     495    AC_SUBST(TK_LIB_FLAG)
     496    AC_SUBST(TK_LIB_SPEC)
     497
     498    AC_SUBST(TK_STUB_LIB_FILE)
     499    AC_SUBST(TK_STUB_LIB_FLAG)
     500    AC_SUBST(TK_STUB_LIB_SPEC)
     501
     502    AC_SUBST(TK_LIBS)
     503    AC_SUBST(TK_XINCLUDES)
     504])
     505
     506#------------------------------------------------------------------------
     507# TEA_ENABLE_SHARED --
     508#
     509#       Allows the building of shared libraries
    284510#
    285511# Arguments:
     
    289515#
    290516#       Adds the following arguments to configure:
    291 #               --enable-gcc
    292 #
    293 #       Sets the following vars:
    294 #               CC      Command to use for the compiler
    295 #------------------------------------------------------------------------
    296 
    297 AC_DEFUN(SC_ENABLE_GCC, [
    298     AC_ARG_ENABLE(gcc, [  --enable-gcc            allow use of gcc if available [--disable-gcc]],
    299         [ok=$enableval], [ok=no])
    300     if test "$ok" = "yes"; then
    301         CC=gcc
    302     else
    303         case "`uname -s`" in
    304             *win32* | *WIN32* | *CYGWIN_NT*)
    305                 CC=cl
    306             ;;
    307             *)
    308                 CC=${CC-cc}
    309             ;;
    310         esac
    311     fi
    312     AC_PROG_CC
    313 ])
    314 
    315 #------------------------------------------------------------------------
    316 # SC_ENABLE_SHARED --
    317 #
    318 #       Allows the building of shared libraries
    319 #
    320 # Arguments:
    321 #       none
    322 #       
    323 # Results:
    324 #
    325 #       Adds the following arguments to configure:
    326517#               --enable-shared=yes|no
    327518#
     
    334525#------------------------------------------------------------------------
    335526
    336 AC_DEFUN(SC_ENABLE_SHARED, [
     527AC_DEFUN([TEA_ENABLE_SHARED], [
    337528    AC_MSG_CHECKING([how to build libraries])
    338529    AC_ARG_ENABLE(shared,
    339         [  --enable-shared         build and link with shared libraries [--enable-shared]],
     530        AC_HELP_STRING([--enable-shared],
     531            [build and link with shared libraries (default: on)]),
    340532        [tcl_ok=$enableval], [tcl_ok=yes])
    341533
     
    353545        AC_MSG_RESULT([static])
    354546        SHARED_BUILD=0
    355         AC_DEFINE(STATIC_BUILD)
    356     fi
    357 ])
    358 
    359 #------------------------------------------------------------------------
    360 # SC_ENABLE_THREADS --
    361 #
    362 #       Specify if thread support should be enabled
     547        AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
     548    fi
     549    AC_SUBST(SHARED_BUILD)
     550])
     551
     552#------------------------------------------------------------------------
     553# TEA_ENABLE_THREADS --
     554#
     555#       Specify if thread support should be enabled.  If "yes" is specified
     556#       as an arg (optional), threads are enabled by default, "no" means
     557#       threads are disabled.  "yes" is the default.
     558#
     559#       TCL_THREADS is checked so that if you are compiling an extension
     560#       against a threaded core, your extension must be compiled threaded
     561#       as well.
     562#
     563#       Note that it is legal to have a thread enabled extension run in a
     564#       threaded or non-threaded Tcl core, but a non-threaded extension may
     565#       only run in a non-threaded Tcl core.
    363566#
    364567# Arguments:
     
    376579#               TCL_THREADS
    377580#               _REENTRANT
    378 #
    379 #------------------------------------------------------------------------
    380 
    381 AC_DEFUN(SC_ENABLE_THREADS, [
    382     AC_MSG_CHECKING(for building with threads)
    383     AC_ARG_ENABLE(threads, [  --enable-threads        build with threads],
    384         [tcl_ok=$enableval], [tcl_ok=no])
    385 
    386     if test "$tcl_ok" = "yes"; then
    387         AC_MSG_RESULT(yes)
     581#               _THREAD_SAFE
     582#
     583#------------------------------------------------------------------------
     584
     585AC_DEFUN([TEA_ENABLE_THREADS], [
     586    AC_ARG_ENABLE(threads,
     587        AC_HELP_STRING([--enable-threads],
     588            [build with threads]),
     589        [tcl_ok=$enableval], [tcl_ok=yes])
     590
     591    if test "${enable_threads+set}" = set; then
     592        enableval="$enable_threads"
     593        tcl_ok=$enableval
     594    else
     595        tcl_ok=yes
     596    fi
     597
     598    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
    388599        TCL_THREADS=1
    389         AC_DEFINE(TCL_THREADS)
    390         AC_DEFINE(_REENTRANT)
    391 
    392         AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
    393         if test "$tcl_ok" = "yes"; then
    394             # The space is needed
    395             THREADS_LIBS=" -lpthread"
    396         else
    397             TCL_THREADS=0
    398             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...")
     600
     601        if test "${TEA_PLATFORM}" != "windows" ; then
     602            # We are always OK on Windows, so check what this platform wants:
     603   
     604            # USE_THREAD_ALLOC tells us to try the special thread-based
     605            # allocator that significantly reduces lock contention
     606            AC_DEFINE(USE_THREAD_ALLOC, 1,
     607                [Do we want to use the threaded memory allocator?])
     608            AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
     609            if test "`uname -s`" = "SunOS" ; then
     610                AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
     611                        [Do we really want to follow the standard? Yes we do!])
     612            fi
     613            AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
     614            AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
     615            if test "$tcl_ok" = "no"; then
     616                # Check a little harder for __pthread_mutex_init in the same
     617                # library, as some systems hide it there until pthread.h is
     618                # defined.  We could alternatively do an AC_TRY_COMPILE with
     619                # pthread.h, but that will work with libpthread really doesn't
     620                # exist, like AIX 4.2.  [Bug: 4359]
     621                AC_CHECK_LIB(pthread, __pthread_mutex_init,
     622                    tcl_ok=yes, tcl_ok=no)
     623            fi
     624
     625            if test "$tcl_ok" = "yes"; then
     626                # The space is needed
     627                THREADS_LIBS=" -lpthread"
     628            else
     629                AC_CHECK_LIB(pthreads, pthread_mutex_init,
     630                    tcl_ok=yes, tcl_ok=no)
     631                if test "$tcl_ok" = "yes"; then
     632                    # The space is needed
     633                    THREADS_LIBS=" -lpthreads"
     634                else
     635                    AC_CHECK_LIB(c, pthread_mutex_init,
     636                        tcl_ok=yes, tcl_ok=no)
     637                    if test "$tcl_ok" = "no"; then
     638                        AC_CHECK_LIB(c_r, pthread_mutex_init,
     639                            tcl_ok=yes, tcl_ok=no)
     640                        if test "$tcl_ok" = "yes"; then
     641                            # The space is needed
     642                            THREADS_LIBS=" -pthread"
     643                        else
     644                            TCL_THREADS=0
     645                            AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
     646                        fi
     647                    fi
     648                fi
     649            fi
    399650        fi
    400651    else
    401652        TCL_THREADS=0
    402         AC_MSG_RESULT(no (default))
    403     fi
    404 
    405 ])
    406 
    407 #------------------------------------------------------------------------
    408 # SC_ENABLE_SYMBOLS --
    409 #
    410 #       Specify if debugging symbols should be used
     653    fi
     654    # Do checking message here to not mess up interleaved configure output
     655    AC_MSG_CHECKING([for building with threads])
     656    if test "${TCL_THREADS}" = 1; then
     657        AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
     658        AC_MSG_RESULT([yes (default)])
     659    else
     660        AC_MSG_RESULT([no])
     661    fi
     662    # TCL_THREADS sanity checking.  See if our request for building with
     663    # threads is the same as the way Tcl was built.  If not, warn the user.
     664    case ${TCL_DEFS} in
     665        *THREADS=1*)
     666            if test "${TCL_THREADS}" = "0"; then
     667                AC_MSG_WARN([
     668    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
     669    that IS thread-enabled.  It is recommended to use --enable-threads.])
     670            fi
     671            ;;
     672        *)
     673            if test "${TCL_THREADS}" = "1"; then
     674                AC_MSG_WARN([
     675    --enable-threads requested, but building against a Tcl that is NOT
     676    thread-enabled.  This is an OK configuration that will also run in
     677    a thread-enabled core.])
     678            fi
     679            ;;
     680    esac
     681    AC_SUBST(TCL_THREADS)
     682])
     683
     684#------------------------------------------------------------------------
     685# TEA_ENABLE_SYMBOLS --
     686#
     687#       Specify if debugging symbols should be used.
     688#       Memory (TCL_MEM_DEBUG) debugging can also be enabled.
    411689#
    412690# Arguments:
    413691#       none
    414692#       
    415 #       Requires the following vars to be set:
    416 #               CFLAGS_DEBUG
    417 #               CFLAGS_OPTIMIZE
    418 #               LDFLAGS_DEBUG
    419 #               LDFLAGS_OPTIMIZE
     693#       TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
     694#       the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
     695#       Requires the following vars to be set in the Makefile:
     696#               CFLAGS_DEFAULT
     697#               LDFLAGS_DEFAULT
    420698#       
    421699# Results:
     
    425703#
    426704#       Defines the following vars:
    427 #               CFLAGS_DEFAULT  Sets to CFLAGS_DEBUG if true
    428 #                               Sets to CFLAGS_OPTIMIZE if false
    429 #               LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true
    430 #                               Sets to LDFLAGS_OPTIMIZE if false
    431 #               DBGX            Debug library extension
    432 #
    433 #------------------------------------------------------------------------
    434 
    435 AC_DEFUN(SC_ENABLE_SYMBOLS, [
    436     case "`uname -s`" in
    437         *win32* | *WIN32* | *CYGWIN_NT*)
    438             tcl_dbgx=d
    439         ;;
    440         *)
    441             tcl_dbgx=g
    442         ;;
    443     esac
    444 
     705#               CFLAGS_DEFAULT  Sets to $(CFLAGS_DEBUG) if true
     706#                               Sets to $(CFLAGS_OPTIMIZE) if false
     707#               LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
     708#                               Sets to $(LDFLAGS_OPTIMIZE) if false
     709#               DBGX            Formerly used as debug library extension;
     710#                               always blank now.
     711#
     712#------------------------------------------------------------------------
     713
     714AC_DEFUN([TEA_ENABLE_SYMBOLS], [
     715    dnl Make sure we are initialized
     716    AC_REQUIRE([TEA_CONFIG_CFLAGS])
    445717    AC_MSG_CHECKING([for build with symbols])
    446     AC_ARG_ENABLE(symbols, [  --enable-symbols        build with debugging symbols [--disable-symbols]],    [tcl_ok=$enableval], [tcl_ok=no])
    447     if test "$tcl_ok" = "yes"; then
     718    AC_ARG_ENABLE(symbols,
     719        AC_HELP_STRING([--enable-symbols],
     720            [build with debugging symbols (default: off)]),
     721        [tcl_ok=$enableval], [tcl_ok=no])
     722    DBGX=""
     723    if test "$tcl_ok" = "no"; then
     724        CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
     725        LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
     726        AC_MSG_RESULT([no])
     727    else
    448728        CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
    449729        LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
    450         DBGX=${tcl_dbgx}
    451         TCL_DBGX=${tcl_dbgx}
    452         AC_MSG_RESULT([yes])
    453     else
    454         CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
    455         LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
    456         DBGX=""
    457         TCL_DBGX=""
    458         AC_MSG_RESULT([no])
     730        if test "$tcl_ok" = "yes"; then
     731            AC_MSG_RESULT([yes (standard debugging)])
     732        fi
     733    fi
     734    if test "${TEA_PLATFORM}" != "windows" ; then
     735        LDFLAGS_DEFAULT="${LDFLAGS}"
    459736    fi
    460737
     
    462739    AC_SUBST(CFLAGS_DEFAULT)
    463740    AC_SUBST(LDFLAGS_DEFAULT)
     741
     742    if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
     743        AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
     744    fi
     745
     746    if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
     747        if test "$tcl_ok" = "all"; then
     748            AC_MSG_RESULT([enabled symbols mem debugging])
     749        else
     750            AC_MSG_RESULT([enabled $tcl_ok debugging])
     751        fi
     752    fi
     753])
     754
     755#------------------------------------------------------------------------
     756# TEA_ENABLE_LANGINFO --
     757#
     758#       Allows use of modern nl_langinfo check for better l10n.
     759#       This is only relevant for Unix.
     760#
     761# Arguments:
     762#       none
     763#       
     764# Results:
     765#
     766#       Adds the following arguments to configure:
     767#               --enable-langinfo=yes|no (default is yes)
     768#
     769#       Defines the following vars:
     770#               HAVE_LANGINFO   Triggers use of nl_langinfo if defined.
     771#
     772#------------------------------------------------------------------------
     773
     774AC_DEFUN([TEA_ENABLE_LANGINFO], [
     775    AC_ARG_ENABLE(langinfo,
     776        AC_HELP_STRING([--enable-langinfo],
     777            [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
     778        [langinfo_ok=$enableval], [langinfo_ok=yes])
     779
     780    HAVE_LANGINFO=0
     781    if test "$langinfo_ok" = "yes"; then
     782        AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
     783    fi
     784    AC_MSG_CHECKING([whether to use nl_langinfo])
     785    if test "$langinfo_ok" = "yes"; then
     786        AC_CACHE_VAL(tcl_cv_langinfo_h,
     787            AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
     788                    [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no]))
     789        AC_MSG_RESULT([$tcl_cv_langinfo_h])
     790        if test $tcl_cv_langinfo_h = yes; then
     791            AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
     792        fi
     793    else
     794        AC_MSG_RESULT([$langinfo_ok])
     795    fi
    464796])
    465797
    466798#--------------------------------------------------------------------
    467 # SC_CONFIG_CFLAGS
     799# TEA_CONFIG_SYSTEM
     800#
     801#       Determine what the system is (some things cannot be easily checked
     802#       on a feature-driven basis, alas). This can usually be done via the
     803#       "uname" command, but there are a few systems, like Next, where
     804#       this doesn't work.
     805#
     806# Arguments:
     807#       none
     808#
     809# Results:
     810#       Defines the following var:
     811#
     812#       system -        System/platform/version identification code.
     813#
     814#--------------------------------------------------------------------
     815
     816AC_DEFUN([TEA_CONFIG_SYSTEM], [
     817    AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
     818        if test "${TEA_PLATFORM}" = "windows" ; then
     819            tcl_cv_sys_version=windows
     820        elif test -f /usr/lib/NextStep/software_version; then
     821            tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
     822        else
     823            tcl_cv_sys_version=`uname -s`-`uname -r`
     824            if test "$?" -ne 0 ; then
     825                AC_MSG_WARN([can't find uname command])
     826                tcl_cv_sys_version=unknown
     827            else
     828                # Special check for weird MP-RAS system (uname returns weird
     829                # results, and the version is kept in special file).
     830
     831                if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
     832                    tcl_cv_sys_version=MP-RAS-`awk '{print [$]3}' /etc/.relid`
     833                fi
     834                if test "`uname -s`" = "AIX" ; then
     835                    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
     836                fi
     837            fi
     838        fi
     839    ])
     840    system=$tcl_cv_sys_version
     841])
     842
     843#--------------------------------------------------------------------
     844# TEA_CONFIG_CFLAGS
    468845#
    469846#       Try to determine the proper flags to pass to the compiler
     
    475852# Results:
    476853#
    477 #       Defines the following vars:
     854#       Defines and substitutes the following vars:
    478855#
    479856#       DL_OBJS -       Name of the object file that implements dynamic
     
    487864#                       that tell the run-time dynamic linker where to look
    488865#                       for shared libraries such as libtcl.so.  Depends on
     866#                       the variable LIB_RUNTIME_DIR in the Makefile. Could
     867#                       be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
     868#       CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
     869#                       that tell the run-time dynamic linker where to look
     870#                       for shared libraries such as libtcl.so.  Depends on
    489871#                       the variable LIB_RUNTIME_DIR in the Makefile.
    490 #       MAKE_LIB -      Command to execute to build the Tcl library;
    491 #                       differs depending on whether or not Tcl is being
    492 #                       compiled as a shared library.
    493872#       SHLIB_CFLAGS -  Flags to pass to cc when compiling the components
    494873#                       of a shared library (may request position-independent
     
    510889#                       extensions.  An empty string means we don't know how
    511890#                       to use shared libraries on this platform.
    512 #       TCL_LIB_FILE -  Name of the file that contains the Tcl library, such
    513 #                       as libtcl7.8.so or libtcl7.8.a.
    514 #       TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
    515 #                       in the shared library name, using the $VERSION variable
     891#       LIB_SUFFIX -    Specifies everything that comes after the "libfoo"
     892#                       in a static or shared library name, using the $VERSION variable
    516893#                       to put the version in the right place.  This is used
    517894#                       by platforms that need non-standard library names.
    518895#                       Examples:  ${VERSION}.so.1.1 on NetBSD, since it needs
    519896#                       to have a version after the .so, and ${VERSION}.a
    520 #                       on AIX, since the Tcl shared library needs to have
     897#                       on AIX, since a shared library needs to have
    521898#                       a .a extension whereas shared objects for loadable
    522899#                       extensions have a .so extension.  Defaults to
     
    536913#       CFLAGS_OPTIMIZE -
    537914#                       Flags used when running the compiler in optimize mode
    538 #
    539 #       EXTRA_CFLAGS
    540 #
    541 #       Subst's the following vars:
    542 #               DL_LIBS
    543 #               CFLAGS_DEBUG
    544 #               CFLAGS_OPTIMIZE
     915#       CFLAGS -        Additional CFLAGS added as necessary (usually 64-bit)
     916#
    545917#--------------------------------------------------------------------
    546918
    547 AC_DEFUN(SC_CONFIG_CFLAGS, [
    548 
    549     # Step 0: Enable 64 bit support?
    550 
    551     AC_MSG_CHECKING([if 64bit support is enabled])
    552     AC_ARG_ENABLE(64bit,[  --enable-64bit          enable 64bit support],,enableval="no")
    553 
    554     if test "$enableval" = "yes"; then
    555         AC_MSG_RESULT(Will compile with 64bit support)
     919AC_DEFUN([TEA_CONFIG_CFLAGS], [
     920    dnl Make sure we are initialized
     921    AC_REQUIRE([TEA_INIT])
     922
     923    # Step 0.a: Enable 64 bit support?
     924
     925    AC_MSG_CHECKING([if 64bit support is requested])
     926    AC_ARG_ENABLE(64bit,
     927        AC_HELP_STRING([--enable-64bit],
     928            [enable 64bit support (default: off)]),
     929        [do64bit=$enableval], [do64bit=no])
     930    AC_MSG_RESULT([$do64bit])
     931
     932    # Step 0.b: Enable Solaris 64 bit VIS support?
     933
     934    AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
     935    AC_ARG_ENABLE(64bit-vis,
     936        AC_HELP_STRING([--enable-64bit-vis],
     937            [enable 64bit Sparc VIS support (default: off)]),
     938        [do64bitVIS=$enableval], [do64bitVIS=no])
     939    AC_MSG_RESULT([$do64bitVIS])
     940
     941    if test "$do64bitVIS" = "yes"; then
     942        # Force 64bit on with VIS
    556943        do64bit=yes
    557     else
    558         do64bit=no
    559     fi
    560     AC_MSG_RESULT($do64bit)
    561  
     944    fi
     945
     946    # Step 0.c: Cross-compiling options for Windows/CE builds?
     947
     948    if test "${TEA_PLATFORM}" = "windows" ; then
     949        AC_MSG_CHECKING([if Windows/CE build is requested])
     950        AC_ARG_ENABLE(wince,[  --enable-wince          enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no])
     951        AC_MSG_RESULT([$doWince])
     952    fi
     953
    562954    # Step 1: set the variable "system" to hold the name and version number
    563     # for the system.  This can usually be done via the "uname" command, but
    564     # there are a few systems, like Next, where this doesn't work.
    565 
    566     AC_MSG_CHECKING([system version (for dynamic loading)])
    567     if test -f /usr/lib/NextStep/software_version; then
    568         system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
    569     else
    570         system=`uname -s`-`uname -r`
    571         if test "$?" -ne 0 ; then
    572             AC_MSG_RESULT([unknown (can't find uname command)])
    573             system=unknown
    574         else
    575             # Special check for weird MP-RAS system (uname returns weird
    576             # results, and the version is kept in special file).
    577        
    578             if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
    579                 system=MP-RAS-`awk '{print $3}' /etc/.relid'`
    580             fi
    581             if test "`uname -s`" = "AIX" ; then
    582                 system=AIX-`uname -v`.`uname -r`
    583             fi
    584             AC_MSG_RESULT($system)
    585         fi
    586     fi
     955    # for the system.
     956
     957    TEA_CONFIG_SYSTEM
    587958
    588959    # Step 2: check for existence of -ldl library.  This is needed because
     
    591962    AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
    592963
     964    # Require ranlib early so we can override it in special cases below.
     965
     966    AC_REQUIRE([AC_PROG_RANLIB])
     967
    593968    # Step 3: set configuration options based on system name and version.
     969    # This is similar to Tcl's unix/tcl.m4 except that we've added a
     970    # "windows" case.
    594971
    595972    do64bit_ok=no
    596     fullSrcDir=`cd $srcdir; pwd`
    597     EXTRA_CFLAGS=""
     973    LDFLAGS_ORIG="$LDFLAGS"
     974    # When ld needs options to work in 64-bit mode, put them in
     975    # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
     976    # is disabled by the user. [Bug 1016796]
     977    LDFLAGS_ARCH=""
    598978    TCL_EXPORT_FILE_SUFFIX=""
    599979    UNSHARED_LIB_SUFFIX=""
    600     TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
    601     ECHO_VERSION='`echo ${VERSION}`'
     980    TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
     981    ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
    602982    TCL_LIB_VERSIONS_OK=ok
    603983    CFLAGS_DEBUG=-g
    604984    CFLAGS_OPTIMIZE=-O
     985    if test "$GCC" = "yes" ; then
     986        CFLAGS_OPTIMIZE=-O2
     987        CFLAGS_WARNING="-Wall -Wno-implicit-int"
     988    else
     989        CFLAGS_WARNING=""
     990    fi
    605991    TCL_NEEDS_EXP_FILE=0
    606992    TCL_BUILD_EXP_FILE=""
    607993    TCL_EXP_FILE=""
    608     STLIB_LD="ar cr"
     994dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
     995dnl AC_CHECK_TOOL(AR, ar)
     996    AC_CHECK_PROG(AR, ar, ar)
     997    STLIB_LD='${AR} cr'
     998    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
    609999    case $system in
    610         AIX-4.[[2-9]])
     1000        windows)
     1001            # This is a 2-stage check to make sure we have the 64-bit SDK
     1002            # We have to know where the SDK is installed.
     1003            # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
     1004            # MACHINE is IX86 for LINK, but this is used by the manifest,
     1005            # which requires x86|amd64|ia64.
     1006            MACHINE="X86"
     1007            if test "$do64bit" != "no" ; then
     1008                if test "x${MSSDK}x" = "xx" ; then
     1009                    MSSDK="C:/Progra~1/Microsoft Platform SDK"
     1010                fi
     1011                MSSDK=`echo "$MSSDK" | sed -e  's!\\\!/!g'`
     1012                PATH64=""
     1013                case "$do64bit" in
     1014                    amd64|x64|yes)
     1015                        MACHINE="AMD64" ; # default to AMD64 64-bit build
     1016                        PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
     1017                        ;;
     1018                    ia64)
     1019                        MACHINE="IA64"
     1020                        PATH64="${MSSDK}/Bin/Win64"
     1021                        ;;
     1022                esac
     1023                if test ! -d "${PATH64}" ; then
     1024                    AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
     1025                    AC_MSG_WARN([Ensure latest Platform SDK is installed])
     1026                    do64bit="no"
     1027                else
     1028                    AC_MSG_RESULT([   Using 64-bit $MACHINE mode])
     1029                    do64bit_ok="yes"
     1030                fi
     1031            fi
     1032
     1033            if test "$doWince" != "no" ; then
     1034                if test "$do64bit" != "no" ; then
     1035                    AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
     1036                fi
     1037                if test "$GCC" = "yes" ; then
     1038                    AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
     1039                fi
     1040                TEA_PATH_CELIB
     1041                # Set defaults for common evc4/PPC2003 setup
     1042                # Currently Tcl requires 300+, possibly 420+ for sockets
     1043                CEVERSION=420;          # could be 211 300 301 400 420 ...
     1044                TARGETCPU=ARMV4;        # could be ARMV4 ARM MIPS SH3 X86 ...
     1045                ARCH=ARM;               # could be ARM MIPS X86EM ...
     1046                PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
     1047                if test "$doWince" != "yes"; then
     1048                    # If !yes then the user specified something
     1049                    # Reset ARCH to allow user to skip specifying it
     1050                    ARCH=
     1051                    eval `echo $doWince | awk -F, '{ \
     1052            if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
     1053            if ([$]1 < 400)   { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
     1054            if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
     1055            if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
     1056            if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
     1057                    }'`
     1058                    if test "x${ARCH}" = "x" ; then
     1059                        ARCH=$TARGETCPU;
     1060                    fi
     1061                fi
     1062                OSVERSION=WCE$CEVERSION;
     1063                if test "x${WCEROOT}" = "x" ; then
     1064                        WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
     1065                    if test ! -d "${WCEROOT}" ; then
     1066                        WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
     1067                    fi
     1068                fi
     1069                if test "x${SDKROOT}" = "x" ; then
     1070                    SDKROOT="C:/Program Files/Windows CE Tools"
     1071                    if test ! -d "${SDKROOT}" ; then
     1072                        SDKROOT="C:/Windows CE Tools"
     1073                    fi
     1074                fi
     1075                WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
     1076                SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
     1077                if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
     1078                    -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
     1079                    AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
     1080                    doWince="no"
     1081                else
     1082                    # We could PATH_NOSPACE these, but that's not important,
     1083                    # as long as we quote them when used.
     1084                    CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
     1085                    if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
     1086                        CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
     1087                    fi
     1088                    CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
     1089                fi
     1090            fi
     1091
     1092            if test "$GCC" != "yes" ; then
     1093                if test "${SHARED_BUILD}" = "0" ; then
     1094                    runtime=-MT
     1095                else
     1096                    runtime=-MD
     1097                fi
     1098
     1099                if test "$do64bit" != "no" ; then
     1100                    # All this magic is necessary for the Win64 SDK RC1 - hobbs
     1101                    CC="\"${PATH64}/cl.exe\""
     1102                    CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
     1103                    RC="\"${MSSDK}/bin/rc.exe\""
     1104                    lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
     1105                    LINKBIN="\"${PATH64}/link.exe\""
     1106                    CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
     1107                    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
     1108                    # Avoid 'unresolved external symbol __security_cookie'
     1109                    # errors, c.f. http://support.microsoft.com/?id=894573
     1110                    TEA_ADD_LIBS([bufferoverflowU.lib])
     1111                elif test "$doWince" != "no" ; then
     1112                    CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
     1113                    if test "${TARGETCPU}" = "X86"; then
     1114                        CC="\"${CEBINROOT}/cl.exe\""
     1115                    else
     1116                        CC="\"${CEBINROOT}/cl${ARCH}.exe\""
     1117                    fi
     1118                    CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
     1119                    RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
     1120                    arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
     1121                    defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
     1122                    if test "${SHARED_BUILD}" = "1" ; then
     1123                        # Static CE builds require static celib as well
     1124                        defs="${defs} _DLL"
     1125                    fi
     1126                    for i in $defs ; do
     1127                        AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
     1128                    done
     1129                    AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
     1130                    AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
     1131                    CFLAGS_DEBUG="-nologo -Zi -Od"
     1132                    CFLAGS_OPTIMIZE="-nologo -Ox"
     1133                    lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
     1134                    lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
     1135                    LINKBIN="\"${CEBINROOT}/link.exe\""
     1136                    AC_SUBST(CELIB_DIR)
     1137                else
     1138                    RC="rc"
     1139                    lflags="-nologo"
     1140                    LINKBIN="link"
     1141                    CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
     1142                    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
     1143                fi
     1144            fi
     1145
     1146            if test "$GCC" = "yes"; then
     1147                # mingw gcc mode
     1148                RC="windres"
     1149                CFLAGS_DEBUG="-g"
     1150                CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
     1151                SHLIB_LD="$CC -shared"
     1152                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     1153                LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
     1154                LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
     1155            else
     1156                SHLIB_LD="${LINKBIN} -dll ${lflags}"
     1157                # link -lib only works when -lib is the first arg
     1158                STLIB_LD="${LINKBIN} -lib ${lflags}"
     1159                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
     1160                PATHTYPE=-w
     1161                # For information on what debugtype is most useful, see:
     1162                # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
     1163                # This essentially turns it all on.
     1164                LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
     1165                LDFLAGS_OPTIMIZE="-release"
     1166                if test "$doWince" != "no" ; then
     1167                    LDFLAGS_CONSOLE="-link ${lflags}"
     1168                    LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
     1169                else
     1170                    LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
     1171                    LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
     1172                fi
     1173            fi
     1174
     1175            SHLIB_LD_LIBS='${LIBS}'
     1176            SHLIB_SUFFIX=".dll"
     1177            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
     1178
     1179            TCL_LIB_VERSIONS_OK=nodots
     1180            # Bogus to avoid getting this turned off
     1181            DL_OBJS="tclLoadNone.obj"
     1182            ;;
     1183        AIX-*)
     1184            if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
     1185                # AIX requires the _r compiler when gcc isn't being used
     1186                case "${CC}" in
     1187                    *_r)
     1188                        # ok ...
     1189                        ;;
     1190                    *)
     1191                        CC=${CC}_r
     1192                        ;;
     1193                esac
     1194                AC_MSG_RESULT([Using $CC for compiling with threads])
     1195            fi
     1196            LIBS="$LIBS -lc"
    6111197            SHLIB_CFLAGS=""
    612             SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
     1198            SHLIB_LD_LIBS='${LIBS}'
     1199            SHLIB_SUFFIX=".so"
     1200
     1201            DL_OBJS="tclLoadDl.o"
     1202            LD_LIBRARY_PATH_VAR="LIBPATH"
     1203
     1204            # Check to enable 64-bit flags for compiler/linker on AIX 4+
     1205            if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
     1206                if test "$GCC" = "yes" ; then
     1207                    AC_MSG_WARN([64bit mode not supported with GCC on $system])
     1208                else
     1209                    do64bit_ok=yes
     1210                    CFLAGS="$CFLAGS -q64"
     1211                    LDFLAGS_ARCH="-q64"
     1212                    RANLIB="${RANLIB} -X64"
     1213                    AR="${AR} -X64"
     1214                    SHLIB_LD_FLAGS="-b64"
     1215                fi
     1216            fi
     1217
     1218            if test "`uname -m`" = "ia64" ; then
     1219                # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
     1220                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     1221                # AIX-5 has dl* in libc.so
     1222                DL_LIBS=""
     1223                if test "$GCC" = "yes" ; then
     1224                    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     1225                else
     1226                    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
     1227                fi
     1228                LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
     1229            else
     1230                if test "$GCC" = "yes" ; then
     1231                    SHLIB_LD="gcc -shared"
     1232                else
     1233                    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
     1234                fi
     1235                SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
     1236                DL_LIBS="-ldl"
     1237                CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     1238                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1239                TCL_NEEDS_EXP_FILE=1
     1240                TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
     1241            fi
     1242
     1243            # AIX v<=4.1 has some different flags than 4.2+
     1244            if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
     1245                AC_LIBOBJ([tclLoadAix])
     1246                DL_LIBS="-lld"
     1247            fi
     1248
     1249            # On AIX <=v4 systems, libbsd.a has to be linked in to support
     1250            # non-blocking file IO.  This library has to be linked in after
     1251            # the MATH_LIBS or it breaks the pow() function.  The way to
     1252            # insure proper sequencing, is to add it to the tail of MATH_LIBS.
     1253            # This library also supplies gettimeofday.
     1254            #
     1255            # AIX does not have a timezone field in struct tm. When the AIX
     1256            # bsd library is used, the timezone global and the gettimeofday
     1257            # methods are to be avoided for timezone deduction instead, we
     1258            # deduce the timezone by comparing the localtime result on a
     1259            # known GMT value.
     1260
     1261            AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
     1262            if test $libbsd = yes; then
     1263                MATH_LIBS="$MATH_LIBS -lbsd"
     1264                AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?])
     1265            fi
     1266            ;;
     1267        BeOS*)
     1268            SHLIB_CFLAGS="-fPIC"
     1269            SHLIB_LD="${CC} -nostart"
    6131270            SHLIB_LD_LIBS='${LIBS}'
    6141271            SHLIB_SUFFIX=".so"
    6151272            DL_OBJS="tclLoadDl.o"
    6161273            DL_LIBS="-ldl"
    617             LDFLAGS=""
    618             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    619             TCL_NEEDS_EXP_FILE=1
    620             TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
    621             ;;
    622         AIX-*)
    623             SHLIB_CFLAGS=""
    624             SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512"
    625             SHLIB_LD_LIBS='${LIBS}'
    626             SHLIB_SUFFIX=".so"
    627             DL_OBJS="tclLoadDl.o"
    628             LIBOBJS="$LIBOBJS tclLoadAix.o"
    629             DL_LIBS="-lld"
    630             LDFLAGS=""
    631             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    632             TCL_NEEDS_EXP_FILE=1
    633             TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
     1274
     1275            #-----------------------------------------------------------
     1276            # Check for inet_ntoa in -lbind, for BeOS (which also needs
     1277            # -lsocket, even if the network functions are in -lnet which
     1278            # is always linked to, for compatibility.
     1279            #-----------------------------------------------------------
     1280            AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
    6341281            ;;
    6351282        BSD/OS-2.1*|BSD/OS-3*)
     
    6401287            DL_OBJS="tclLoadDl.o"
    6411288            DL_LIBS="-ldl"
    642             LDFLAGS=""
     1289            CC_SEARCH_FLAGS=""
    6431290            LD_SEARCH_FLAGS=""
    6441291            ;;
     
    6501297            DL_OBJS="tclLoadDl.o"
    6511298            DL_LIBS="-ldl"
    652             LDFLAGS="-export-dynamic"
     1299            LDFLAGS="$LDFLAGS -export-dynamic"
     1300            CC_SEARCH_FLAGS=""
    6531301            LD_SEARCH_FLAGS=""
    654             ;;
    655         *win32*|*WIN32*|CYGWIN_NT*|cygwin_nt*)
    656             CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
    657             CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
    658             LDFLAGS_CONSOLE="-subsystem:console"
    659             LDFLAGS_WINDOW="-subsystem:windows"
    660             LDFLAGS_DEBUG="-debug:full -debugtype:cv"
    661             LDFLAGS_OPTIMIZE="-release"
    662             EXTRA_CFLAGS="-YX"
    663             PATHTYPE=-w
    664             STLIB_LD="lib -nologo"
    665             SHLIB_LD="link -dll -nologo"
    666             SHLIB_LD_LIBS="user32.lib advapi32.lib"
    667             RC="rc"
    6681302            ;;
    6691303        dgux*)
     
    6741308            DL_OBJS="tclLoadDl.o"
    6751309            DL_LIBS="-ldl"
    676             LDFLAGS=""
     1310            CC_SEARCH_FLAGS=""
    6771311            LD_SEARCH_FLAGS=""
    6781312            ;;
    679         HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*)
     1313        HP-UX-*.11.*)
     1314            # Use updated header definitions where possible
     1315            AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
     1316            # Needed by Tcl, but not most extensions
     1317            #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
     1318            #LIBS="$LIBS -lxnet"               # Use the XOPEN network library
     1319
     1320            SHLIB_SUFFIX=".sl"
     1321            AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
     1322            if test "$tcl_ok" = yes; then
     1323                SHLIB_CFLAGS="+z"
     1324                SHLIB_LD="ld -b"
     1325                SHLIB_LD_LIBS='${LIBS}'
     1326                DL_OBJS="tclLoadShl.o"
     1327                DL_LIBS="-ldld"
     1328                LDFLAGS="$LDFLAGS -Wl,-E"
     1329                CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
     1330                LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
     1331                LD_LIBRARY_PATH_VAR="SHLIB_PATH"
     1332            fi
     1333            if test "$GCC" = "yes" ; then
     1334                SHLIB_LD="gcc -shared"
     1335                SHLIB_LD_LIBS='${LIBS}'
     1336                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1337            fi
     1338
     1339            # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
     1340            #CFLAGS="$CFLAGS +DAportable"
     1341
     1342            # Check to enable 64-bit flags for compiler/linker
     1343            if test "$do64bit" = "yes" ; then
     1344                if test "$GCC" = "yes" ; then
     1345                    hpux_arch=`${CC} -dumpmachine`
     1346                    case $hpux_arch in
     1347                        hppa64*)
     1348                            # 64-bit gcc in use.  Fix flags for GNU ld.
     1349                            do64bit_ok=yes
     1350                            SHLIB_LD="${CC} -shared"
     1351                            SHLIB_LD_LIBS='${LIBS}'
     1352                            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1353                            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1354                            ;;
     1355                        *)
     1356                            AC_MSG_WARN([64bit mode not supported with GCC on $system])
     1357                            ;;
     1358                    esac
     1359                else
     1360                    do64bit_ok=yes
     1361                    CFLAGS="$CFLAGS +DD64"
     1362                    LDFLAGS_ARCH="+DD64"
     1363                fi
     1364            fi
     1365            ;;
     1366        HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
    6801367            SHLIB_SUFFIX=".sl"
    6811368            AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
     
    6861373                DL_OBJS="tclLoadShl.o"
    6871374                DL_LIBS="-ldld"
    688                 LDFLAGS="-Wl,-E"
    689                 LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
     1375                LDFLAGS="$LDFLAGS -Wl,-E"
     1376                CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
     1377                LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
     1378                LD_LIBRARY_PATH_VAR="SHLIB_PATH"
    6901379            fi
    6911380            ;;
    692         IRIX-4.*)
    693             SHLIB_CFLAGS="-G 0"
    694             SHLIB_SUFFIX=".a"
    695             SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
     1381        IRIX-5.*)
     1382            SHLIB_CFLAGS=""
     1383            SHLIB_LD="ld -shared -rdata_shared"
    6961384            SHLIB_LD_LIBS='${LIBS}'
    697             DL_OBJS="tclLoadAout.o"
    698             DL_LIBS=""
    699             LDFLAGS="-Wl,-D,08000000"
    700             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    701             SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
    702             ;;
    703         IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
    704             SHLIB_CFLAGS=""
    705             SHLIB_LD="ld -n32 -shared -rdata_shared"
    706             SHLIB_LD_LIBS=""
    7071385            SHLIB_SUFFIX=".so"
    7081386            DL_OBJS="tclLoadDl.o"
    7091387            DL_LIBS=""
    710             LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    711             if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
    712                 EXTRA_CFLAGS="-mabi=n32"
    713                 LDFLAGS="-mabi=n32"
     1388            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1389            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1390            ;;
     1391        IRIX-6.*)
     1392            SHLIB_CFLAGS=""
     1393            SHLIB_LD="ld -n32 -shared -rdata_shared"
     1394            SHLIB_LD_LIBS='${LIBS}'
     1395            SHLIB_SUFFIX=".so"
     1396            DL_OBJS="tclLoadDl.o"
     1397            DL_LIBS=""
     1398            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1399            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1400            if test "$GCC" = "yes" ; then
     1401                CFLAGS="$CFLAGS -mabi=n32"
     1402                LDFLAGS="$LDFLAGS -mabi=n32"
    7141403            else
    7151404                case $system in
    7161405                    IRIX-6.3)
    7171406                        # Use to build 6.2 compatible binaries on 6.3.
    718                         EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
     1407                        CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
    7191408                        ;;
    7201409                    *)
    721                         EXTRA_CFLAGS="-n32"
     1410                        CFLAGS="$CFLAGS -n32"
    7221411                        ;;
    7231412                esac
    724                 LDFLAGS="-n32"
     1413                LDFLAGS="$LDFLAGS -n32"
    7251414            fi
    7261415            ;;
    7271416        IRIX64-6.*)
    7281417            SHLIB_CFLAGS=""
    729             SHLIB_LD="ld -32 -shared -rdata_shared"
     1418            SHLIB_LD="ld -n32 -shared -rdata_shared"
    7301419            SHLIB_LD_LIBS='${LIBS}'
    7311420            SHLIB_SUFFIX=".so"
    7321421            DL_OBJS="tclLoadDl.o"
    7331422            DL_LIBS=""
    734             LDFLAGS=""
    735             LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1423            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1424            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1425
     1426            # Check to enable 64-bit flags for compiler/linker
     1427
     1428            if test "$do64bit" = "yes" ; then
     1429                if test "$GCC" = "yes" ; then
     1430                    AC_MSG_WARN([64bit mode not supported by gcc])
     1431                else
     1432                    do64bit_ok=yes
     1433                    SHLIB_LD="ld -64 -shared -rdata_shared"
     1434                    CFLAGS="$CFLAGS -64"
     1435                    LDFLAGS_ARCH="-64"
     1436                fi
     1437            fi
    7361438            ;;
    7371439        Linux*)
     
    7401442            SHLIB_SUFFIX=".so"
    7411443
     1444            CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
    7421445            # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
    7431446            # when you inline the string and math operations.  Turn this off to
    7441447            # get rid of the warnings.
    745 
    746             CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
    747 
    748             if test "$have_dl" = yes; then
    749                 SHLIB_LD="${CC} -shared"
    750                 DL_OBJS="tclLoadDl.o"
    751                 DL_LIBS="-ldl"
    752                 LDFLAGS="-rdynamic"
    753                 LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    754             else
    755                 AC_CHECK_HEADER(dld.h, [
    756                     SHLIB_LD="ld -shared"
    757                     DL_OBJS="tclLoadDld.o"
    758                     DL_LIBS="-ldld"
    759                     LDFLAGS=""
    760                     LD_SEARCH_FLAGS=""])
    761             fi
     1448            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
     1449
     1450            SHLIB_LD="${CC} -shared"
     1451            DL_OBJS="tclLoadDl.o"
     1452            DL_LIBS="-ldl"
     1453            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
     1454            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1455            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
    7621456            if test "`uname -m`" = "alpha" ; then
    763                 EXTRA_CFLAGS="-mieee"
    764             fi
     1457                CFLAGS="$CFLAGS -mieee"
     1458            fi
     1459
     1460            # The combo of gcc + glibc has a bug related
     1461            # to inlining of functions like strtod(). The
     1462            # -fno-builtin flag should address this problem
     1463            # but it does not work. The -fno-inline flag
     1464            # is kind of overkill but it works.
     1465            # Disable inlining only when one of the
     1466            # files in compat/*.c is being linked in.
     1467            if test x"${USE_COMPAT}" != x ; then
     1468                CFLAGS="$CFLAGS -fno-inline"
     1469            fi
     1470
     1471            ;;
     1472        GNU*)
     1473            SHLIB_CFLAGS="-fPIC"
     1474            SHLIB_LD_LIBS='${LIBS}'
     1475            SHLIB_SUFFIX=".so"
     1476
     1477            SHLIB_LD="${CC} -shared"
     1478            DL_OBJS=""
     1479            DL_LIBS="-ldl"
     1480            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
     1481            CC_SEARCH_FLAGS=""
     1482            LD_SEARCH_FLAGS=""
     1483            if test "`uname -m`" = "alpha" ; then
     1484                CFLAGS="$CFLAGS -mieee"
     1485            fi
     1486            ;;
     1487        Lynx*)
     1488            SHLIB_CFLAGS="-fPIC"
     1489            SHLIB_LD_LIBS='${LIBS}'
     1490            SHLIB_SUFFIX=".so"
     1491            CFLAGS_OPTIMIZE=-02
     1492            SHLIB_LD="${CC} -shared "
     1493            DL_OBJS="tclLoadDl.o"
     1494            DL_LIBS="-mshared -ldl"
     1495            LD_FLAGS="-Wl,--export-dynamic"
     1496            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1497            LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    7651498            ;;
    7661499        MP-RAS-02*)
     
    7711504            DL_OBJS="tclLoadDl.o"
    7721505            DL_LIBS="-ldl"
    773             LDFLAGS=""
     1506            CC_SEARCH_FLAGS=""
    7741507            LD_SEARCH_FLAGS=""
    7751508            ;;
     
    7811514            DL_OBJS="tclLoadDl.o"
    7821515            DL_LIBS="-ldl"
    783             LDFLAGS="-Wl,-Bexport"
     1516            LDFLAGS="$LDFLAGS -Wl,-Bexport"
     1517            CC_SEARCH_FLAGS=""
    7841518            LD_SEARCH_FLAGS=""
    7851519            ;;
    786         NetBSD-*|FreeBSD-[[12]].*|OpenBSD-*)
    787             # Not available on all versions:  check for include file.
    788             AC_CHECK_HEADER(dlfcn.h, [
    789                 SHLIB_CFLAGS="-fpic"
    790                 SHLIB_LD="ld -Bshareable -x"
    791                 SHLIB_LD_LIBS=""
    792                 SHLIB_SUFFIX=".so"
    793                 DL_OBJS="tclLoadDl.o"
    794                 DL_LIBS=""
     1520        NetBSD-*|FreeBSD-[[1-2]].*)
     1521            # NetBSD/SPARC needs -fPIC, -fpic will not do.
     1522            SHLIB_CFLAGS="-fPIC"
     1523            SHLIB_LD="ld -Bshareable -x"
     1524            SHLIB_LD_LIBS='${LIBS}'
     1525            SHLIB_SUFFIX=".so"
     1526            DL_OBJS="tclLoadDl.o"
     1527            DL_LIBS=""
     1528            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1529            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1530            AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
     1531                AC_EGREP_CPP(yes, [
     1532#ifdef __ELF__
     1533        yes
     1534#endif
     1535                ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
     1536            if test $tcl_cv_ld_elf = yes; then
     1537                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
     1538            else
     1539                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     1540            fi
     1541
     1542            # Ancient FreeBSD doesn't handle version numbers with dots.
     1543
     1544            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     1545            TCL_LIB_VERSIONS_OK=nodots
     1546            ;;
     1547        OpenBSD-*)
     1548            # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
     1549            case `machine` in
     1550            sparc|sparc64)
     1551                SHLIB_CFLAGS="-fPIC";;
     1552            *)
     1553                SHLIB_CFLAGS="-fpic";;
     1554            esac
     1555            SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
     1556            SHLIB_LD_LIBS='${LIBS}'
     1557            SHLIB_SUFFIX=".so"
     1558            DL_OBJS="tclLoadDl.o"
     1559            DL_LIBS=""
     1560            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1561            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1562            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     1563            AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
     1564                AC_EGREP_CPP(yes, [
     1565#ifdef __ELF__
     1566        yes
     1567#endif
     1568                ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
     1569            if test $tcl_cv_ld_elf = yes; then
     1570                LDFLAGS=-Wl,-export-dynamic
     1571            else
    7951572                LDFLAGS=""
    796                 LD_SEARCH_FLAGS=""
    797                 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
    798             ], [
    799                 SHLIB_CFLAGS=""
    800                 SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
    801                 SHLIB_LD_LIBS='${LIBS}'
    802                 SHLIB_SUFFIX=".a"
    803                 DL_OBJS="tclLoadAout.o"
    804                 DL_LIBS=""
    805                 LDFLAGS=""
    806                 LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    807                 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
    808             ])
    809 
    810             # FreeBSD doesn't handle version numbers with dots.
    811 
    812             UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
     1573            fi
     1574
     1575            # OpenBSD doesn't do version numbers with dots.
     1576            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
    8131577            TCL_LIB_VERSIONS_OK=nodots
    8141578            ;;
    8151579        FreeBSD-*)
    8161580            # FreeBSD 3.* and greater have ELF.
    817             SHLIB_CFLAGS="-fpic"
     1581            SHLIB_CFLAGS="-fPIC"
    8181582            SHLIB_LD="ld -Bshareable -x"
    819             SHLIB_LD_LIBS=""
     1583            SHLIB_LD_LIBS='${LIBS}'
    8201584            SHLIB_SUFFIX=".so"
    8211585            DL_OBJS="tclLoadDl.o"
    8221586            DL_LIBS=""
    823             LDFLAGS=""
     1587            LDFLAGS="$LDFLAGS -export-dynamic"
     1588            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1589            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1590            if test "${TCL_THREADS}" = "1" ; then
     1591                # The -pthread needs to go in the CFLAGS, not LIBS
     1592                LIBS=`echo $LIBS | sed s/-pthread//`
     1593                CFLAGS="$CFLAGS -pthread"
     1594                LDFLAGS="$LDFLAGS -pthread"
     1595            fi
     1596            case $system in
     1597            FreeBSD-3.*)
     1598                # FreeBSD-3 doesn't handle version numbers with dots.
     1599                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
     1600                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
     1601                TCL_LIB_VERSIONS_OK=nodots
     1602                ;;
     1603            esac
     1604            ;;
     1605        Darwin-*)
     1606            CFLAGS_OPTIMIZE="-Os"
     1607            SHLIB_CFLAGS="-fno-common"
     1608            if test $do64bit = yes; then
     1609                do64bit_ok=yes
     1610                CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
     1611            fi
     1612            # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
     1613            SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
     1614            AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
     1615                hold_ldflags=$LDFLAGS
     1616                LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
     1617                AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
     1618                LDFLAGS=$hold_ldflags])
     1619            if test $tcl_cv_ld_single_module = yes; then
     1620                SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
     1621            fi
     1622            SHLIB_LD_LIBS='${LIBS}'
     1623            SHLIB_SUFFIX=".dylib"
     1624            DL_OBJS="tclLoadDyld.o"
     1625            DL_LIBS=""
     1626            # Don't use -prebind when building for Mac OS X 10.4 or later only:
     1627            test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
     1628                test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'`" -lt 4 && \
     1629                LDFLAGS="$LDFLAGS -prebind"
     1630            LDFLAGS="$LDFLAGS -headerpad_max_install_names"
     1631            AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
     1632                hold_ldflags=$LDFLAGS
     1633                LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
     1634                AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
     1635                LDFLAGS=$hold_ldflags])
     1636            if test $tcl_cv_ld_search_paths_first = yes; then
     1637                LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
     1638            fi
     1639            CC_SEARCH_FLAGS=""
    8241640            LD_SEARCH_FLAGS=""
     1641            LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
     1642
     1643            # TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
     1644            # for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
     1645            # at present (no 64bit GUI libraries).
     1646            test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
     1647                CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
    8251648            ;;
    8261649        NEXTSTEP-*)
     
    8311654            DL_OBJS="tclLoadNext.o"
    8321655            DL_LIBS=""
    833             LDFLAGS=""
     1656            CC_SEARCH_FLAGS=""
    8341657            LD_SEARCH_FLAGS=""
    8351658            ;;
    8361659        OS/390-*)
    837             CFLAGS_OPTIMIZE=""      # Optimizer is buggy
    838             AC_DEFINE(_OE_SOCKETS)  # needed in sys/socket.h
     1660            CFLAGS_OPTIMIZE=""          # Optimizer is buggy
     1661            AC_DEFINE(_OE_SOCKETS, 1,   # needed in sys/socket.h
     1662                [Should OS/390 do the right thing with sockets?])
    8391663            ;;     
    8401664        OSF1-1.0|OSF1-1.1|OSF1-1.2)
     
    8471671            DL_OBJS="tclLoadOSF.o"
    8481672            DL_LIBS=""
    849             LDFLAGS=""
     1673            CC_SEARCH_FLAGS=""
    8501674            LD_SEARCH_FLAGS=""
    8511675            ;;
    8521676        OSF1-1.*)
    8531677            # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
    854             SHLIB_CFLAGS="-fpic"
    855             SHLIB_LD="ld -shared"
     1678            SHLIB_CFLAGS="-fPIC"
     1679            if test "$SHARED_BUILD" = "1" ; then
     1680                SHLIB_LD="ld -shared"
     1681            else
     1682                SHLIB_LD="ld -non_shared"
     1683            fi
    8561684            SHLIB_LD_LIBS=""
    8571685            SHLIB_SUFFIX=".so"
    8581686            DL_OBJS="tclLoadDl.o"
    8591687            DL_LIBS=""
    860             LDFLAGS=""
     1688            CC_SEARCH_FLAGS=""
    8611689            LD_SEARCH_FLAGS=""
    8621690            ;;
     
    8641692            # Digital OSF/1
    8651693            SHLIB_CFLAGS=""
    866             SHLIB_LD='ld -shared -expect_unresolved "*"'
     1694            if test "$SHARED_BUILD" = "1" ; then
     1695                SHLIB_LD='ld -shared -expect_unresolved "*"'
     1696            else
     1697                SHLIB_LD='ld -non_shared -expect_unresolved "*"'
     1698            fi
    8671699            SHLIB_LD_LIBS=""
    8681700            SHLIB_SUFFIX=".so"
    8691701            DL_OBJS="tclLoadDl.o"
    8701702            DL_LIBS=""
    871             LDFLAGS=""
    872             LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1703            CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
     1704            LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
     1705            if test "$GCC" = "yes" ; then
     1706                CFLAGS="$CFLAGS -mieee"
     1707            else
     1708                CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
     1709            fi
     1710            # see pthread_intro(3) for pthread support on osf1, k.furukawa
     1711            if test "${TCL_THREADS}" = "1" ; then
     1712                CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
     1713                CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
     1714                LIBS=`echo $LIBS | sed s/-lpthreads//`
     1715                if test "$GCC" = "yes" ; then
     1716                    LIBS="$LIBS -lpthread -lmach -lexc"
     1717                else
     1718                    CFLAGS="$CFLAGS -pthread"
     1719                    LDFLAGS="$LDFLAGS -pthread"
     1720                fi
     1721            fi
     1722
    8731723            ;;
    874         RISCos-*)
    875             SHLIB_CFLAGS="-G 0"
    876             SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
    877             SHLIB_LD_LIBS='${LIBS}'
    878             SHLIB_SUFFIX=".a"
    879             DL_OBJS="tclLoadAout.o"
     1724        QNX-6*)
     1725            # QNX RTP
     1726            # This may work for all QNX, but it was only reported for v6.
     1727            SHLIB_CFLAGS="-fPIC"
     1728            SHLIB_LD="ld -Bshareable -x"
     1729            SHLIB_LD_LIBS=""
     1730            SHLIB_SUFFIX=".so"
     1731            DL_OBJS="tclLoadDl.o"
     1732            # dlopen is in -lc on QNX
    8801733            DL_LIBS=""
    881             LDFLAGS="-Wl,-D,08000000"
    882             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     1734            CC_SEARCH_FLAGS=""
     1735            LD_SEARCH_FLAGS=""
    8831736            ;;
    8841737        SCO_SV-3.2*)
    885             # Note, dlopen is available only on SCO 3.2.5 and greater.  However,
     1738            # Note, dlopen is available only on SCO 3.2.5 and greater. However,
    8861739            # this test works, since "uname -s" was non-standard in 3.2.4 and
    8871740            # below.
    888             SHLIB_CFLAGS="-Kpic -belf"
     1741            if test "$GCC" = "yes" ; then
     1742                SHLIB_CFLAGS="-fPIC -melf"
     1743                LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
     1744            else
     1745                SHLIB_CFLAGS="-Kpic -belf"
     1746                LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
     1747            fi
    8891748            SHLIB_LD="ld -G"
    8901749            SHLIB_LD_LIBS=""
     
    8921751            DL_OBJS="tclLoadDl.o"
    8931752            DL_LIBS=""
    894             LDFLAGS="-belf -Wl,-Bexport"
     1753            CC_SEARCH_FLAGS=""
    8951754            LD_SEARCH_FLAGS=""
    8961755            ;;
     
    9021761            DL_OBJS="tclLoadDl.o"
    9031762            DL_LIBS="-ldl"
    904             LDFLAGS=""
     1763            CC_SEARCH_FLAGS=""
    9051764            LD_SEARCH_FLAGS=""
    9061765            ;;
     
    9121771            DL_OBJS="tclLoadDl.o"
    9131772            DL_LIBS="-ldl"
    914             LDFLAGS=""
    915             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     1773            CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
     1774            LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
    9161775
    9171776            # SunOS can't handle version numbers with dots in them in library
     
    9201779            # So, the library has to have a name like libtcl75.so.1.0
    9211780
    922             SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
    923             UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
     1781            SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
     1782            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
    9241783            TCL_LIB_VERSIONS_OK=nodots
    9251784            ;;
    926         SunOS-5.[[0-6]]*)
     1785        SunOS-5.[[0-6]])
     1786            # Careful to not let 5.10+ fall into this case
     1787
     1788            # Note: If _REENTRANT isn't defined, then Solaris
     1789            # won't define thread-safe library routines.
     1790
     1791            AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
     1792            AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
     1793                [Do we really want to follow the standard? Yes we do!])
     1794
    9271795            SHLIB_CFLAGS="-KPIC"
    928             SHLIB_LD="/usr/ccs/bin/ld -G -z text"
    9291796
    9301797            # Note: need the LIBS below, otherwise Tk won't find Tcl's
     
    9351802            DL_OBJS="tclLoadDl.o"
    9361803            DL_LIBS="-ldl"
    937             LDFLAGS=""
    938             LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     1804            if test "$GCC" = "yes" ; then
     1805                SHLIB_LD="$CC -shared"
     1806                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     1807                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1808            else
     1809                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     1810                CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
     1811                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1812            fi
    9391813            ;;
    9401814        SunOS-5*)
     1815            # Note: If _REENTRANT isn't defined, then Solaris
     1816            # won't define thread-safe library routines.
     1817
     1818            AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
     1819            AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
     1820                [Do we really want to follow the standard? Yes we do!])
     1821
    9411822            SHLIB_CFLAGS="-KPIC"
    942             SHLIB_LD="/usr/ccs/bin/ld -G -z text"
    943             LDFLAGS=""
    944    
    945             do64bit_ok=no
     1823
     1824            # Check to enable 64-bit flags for compiler/linker
    9461825            if test "$do64bit" = "yes" ; then
    947             arch=`isainfo`
    948             if test "$arch" = "sparcv9 sparc" ; then
    949                 if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then
    950                 do64bit_ok=yes
    951                 EXTRA_CFLAGS="-xarch=v9"
    952                 LDFLAGS="-xarch=v9"
    953                 else
    954                 AC_MSG_WARN("64bit mode not supported using GCC on $system")
     1826                arch=`isainfo`
     1827                if test "$arch" = "sparcv9 sparc" ; then
     1828                        if test "$GCC" = "yes" ; then
     1829                            if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then
     1830                                AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
     1831                            else
     1832                                do64bit_ok=yes
     1833                                CFLAGS="$CFLAGS -m64 -mcpu=v9"
     1834                                LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
     1835                                SHLIB_CFLAGS="-fPIC"
     1836                            fi
     1837                        else
     1838                            do64bit_ok=yes
     1839                            if test "$do64bitVIS" = "yes" ; then
     1840                                CFLAGS="$CFLAGS -xarch=v9a"
     1841                                LDFLAGS_ARCH="-xarch=v9a"
     1842                            else
     1843                                CFLAGS="$CFLAGS -xarch=v9"
     1844                                LDFLAGS_ARCH="-xarch=v9"
     1845                            fi
     1846                            # Solaris 64 uses this as well
     1847                            #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
     1848                        fi
     1849                elif test "$arch" = "amd64 i386" ; then
     1850                    if test "$GCC" = "yes" ; then
     1851                        AC_MSG_WARN([64bit mode not supported with GCC on $system])
     1852                    else
     1853                        do64bit_ok=yes
     1854                        CFLAGS="$CFLAGS -xarch=amd64"
     1855                        LDFLAGS="$LDFLAGS -xarch=amd64"
     1856                    fi
     1857                else
     1858                    AC_MSG_WARN([64bit mode not supported for $arch])
    9551859                fi
    956             else
    957                 AC_MSG_WARN("64bit mode only supported sparcv9 system")
    958             fi
    9591860            fi
    9601861           
     
    9661867            DL_OBJS="tclLoadDl.o"
    9671868            DL_LIBS="-ldl"
    968             if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
    969                 LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     1869            if test "$GCC" = "yes" ; then
     1870                SHLIB_LD="$CC -shared"
     1871                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
     1872                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
     1873                if test "$do64bit_ok" = "yes" ; then
     1874                    # We need to specify -static-libgcc or we need to
     1875                    # add the path to the sparv9 libgcc.
     1876                    # JH: static-libgcc is necessary for core Tcl, but may
     1877                    # not be necessary for extensions.
     1878                    SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
     1879                    # for finding sparcv9 libgcc, get the regular libgcc
     1880                    # path, remove so name and append 'sparcv9'
     1881                    #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
     1882                    #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
     1883                fi
    9701884            else
     1885                SHLIB_LD="/usr/ccs/bin/ld -G -z text"
     1886                CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
    9711887                LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
    9721888            fi
    973             ;;
    974         ULTRIX-4.*)
    975             SHLIB_CFLAGS="-G 0"
    976             SHLIB_SUFFIX=".a"
    977             SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
    978             SHLIB_LD_LIBS='${LIBS}'
    979             DL_OBJS="tclLoadAout.o"
    980             DL_LIBS=""
    981             LDFLAGS="-Wl,-D,08000000"
    982             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
    9831889            ;;
    9841890        UNIX_SV* | UnixWare-5*)
     
    9911897            # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
    9921898            # that don't grok the -Bexport option.  Test that it does.
    993             hold_ldflags=$LDFLAGS
    994             AC_MSG_CHECKING(for ld accepts -Bexport flag)
    995             LDFLAGS="${LDFLAGS} -Wl,-Bexport"
    996             AC_TRY_LINK(, [int i;], found=yes, found=no)
    997             LDFLAGS=$hold_ldflags
    998             AC_MSG_RESULT($found)
    999             if test $found = yes; then
    1000             LDFLAGS="-Wl,-Bexport"
    1001             else
    1002             LDFLAGS=""
    1003             fi
     1899            AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
     1900                hold_ldflags=$LDFLAGS
     1901                LDFLAGS="$LDFLAGS -Wl,-Bexport"
     1902                AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
     1903                LDFLAGS=$hold_ldflags])
     1904            if test $tcl_cv_ld_Bexport = yes; then
     1905                LDFLAGS="$LDFLAGS -Wl,-Bexport"
     1906            fi
     1907            CC_SEARCH_FLAGS=""
    10041908            LD_SEARCH_FLAGS=""
    10051909            ;;
     
    10071911
    10081912    if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
    1009     AC_MSG_WARN("64bit support being disabled -- not supported on this platform")
    1010     fi
    1011 
    1012     # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
    1013     # Loading for Tcl -- What Became of It?".  Proc. 2nd Tcl/Tk Workshop,
    1014     # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
    1015     # to determine which of several header files defines the a.out file
    1016     # format (a.out.h, sys/exec.h, or sys/exec_aout.h).  At present, we
    1017     # support only a file format that is more or less version-7-compatible.
    1018     # In particular,
    1019     #   - a.out files must begin with `struct exec'.
    1020     #   - the N_TXTOFF on the `struct exec' must compute the seek address
    1021     #     of the text segment
    1022     #   - The `struct exec' must contain a_magic, a_text, a_data, a_bss
    1023     #     and a_entry fields.
    1024     # The following compilation should succeed if and only if either sys/exec.h
    1025     # or a.out.h is usable for the purpose.
    1026     #
    1027     # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
    1028     # `struct exec' includes a second header that contains information that
    1029     # duplicates the v7 fields that are needed.
    1030 
    1031     if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
    1032         AC_MSG_CHECKING(sys/exec.h)
    1033         AC_TRY_COMPILE([#include <sys/exec.h>],[
    1034             struct exec foo;
    1035             unsigned long seek;
    1036             int flag;
    1037 #if defined(__mips) || defined(mips)
    1038             seek = N_TXTOFF (foo.ex_f, foo.ex_o);
    1039 #else
    1040             seek = N_TXTOFF (foo);
    1041 #endif
    1042             flag = (foo.a_magic == OMAGIC);
    1043             return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
    1044     ], tcl_ok=usable, tcl_ok=unusable)
    1045         AC_MSG_RESULT($tcl_ok)
    1046         if test $tcl_ok = usable; then
    1047             AC_DEFINE(USE_SYS_EXEC_H)
    1048         else
    1049             AC_MSG_CHECKING(a.out.h)
    1050             AC_TRY_COMPILE([#include <a.out.h>],[
    1051                 struct exec foo;
    1052                 unsigned long seek;
    1053                 int flag;
    1054 #if defined(__mips) || defined(mips)
    1055                 seek = N_TXTOFF (foo.ex_f, foo.ex_o);
    1056 #else
    1057                 seek = N_TXTOFF (foo);
    1058 #endif
    1059                 flag = (foo.a_magic == OMAGIC);
    1060                 return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
    1061             ], tcl_ok=usable, tcl_ok=unusable)
    1062             AC_MSG_RESULT($tcl_ok)
    1063             if test $tcl_ok = usable; then
    1064                 AC_DEFINE(USE_A_OUT_H)
    1065             else
    1066                 AC_MSG_CHECKING(sys/exec_aout.h)
    1067                 AC_TRY_COMPILE([#include <sys/exec_aout.h>],[
    1068                     struct exec foo;
    1069                     unsigned long seek;
    1070                     int flag;
    1071 #if defined(__mips) || defined(mips)
    1072                     seek = N_TXTOFF (foo.ex_f, foo.ex_o);
    1073 #else
    1074                     seek = N_TXTOFF (foo);
    1075 #endif
    1076                     flag = (foo.a_midmag == OMAGIC);
    1077                     return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
    1078                 ], tcl_ok=usable, tcl_ok=unusable)
    1079                 AC_MSG_RESULT($tcl_ok)
    1080                 if test $tcl_ok = usable; then
    1081                     AC_DEFINE(USE_SYS_EXEC_AOUT_H)
    1082                 else
    1083                     DL_OBJS=""
    1084                 fi
    1085             fi
    1086         fi
    1087     fi
    1088 
    1089     # Step 5: disable dynamic loading if requested via a command-line switch.
    1090 
    1091     AC_ARG_ENABLE(load, [  --disable-load          disallow dynamic loading and "load" command],
     1913        AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
     1914    fi
     1915
     1916    # Step 4: disable dynamic loading if requested via a command-line switch.
     1917
     1918    AC_ARG_ENABLE(load,
     1919        AC_HELP_STRING([--disable-load],
     1920            [disallow dynamic loading and "load" command (default: enabled)]),
    10921921        [tcl_ok=$enableval], [tcl_ok=yes])
    10931922    if test "$tcl_ok" = "no"; then
     
    11051934        DL_OBJS="tclLoadNone.o"
    11061935        DL_LIBS=""
    1107         LDFLAGS=""
     1936        LDFLAGS="$LDFLAGS_ORIG"
     1937        CC_SEARCH_FLAGS=""
    11081938        LD_SEARCH_FLAGS=""
    11091939        BUILD_DLTEST=""
    11101940    fi
     1941    LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
    11111942
    11121943    # If we're running gcc, then change the C flags for compiling shared
     
    11151946
    11161947    if test "$DL_OBJS" != "tclLoadNone.o" ; then
    1117         if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
     1948        if test "$GCC" = "yes" ; then
    11181949            case $system in
    11191950                AIX-*)
     
    11231954                IRIX*)
    11241955                    ;;
    1125                 NetBSD-*|FreeBSD-*|OpenBSD-*)
     1956                NetBSD-*|FreeBSD-*)
    11261957                    ;;
    1127                 RISCos-*)
     1958                Darwin-*)
    11281959                    ;;
    1129                 ULTRIX-4.*)
     1960                SCO_SV-3.2*)
     1961                    ;;
     1962                windows)
    11301963                    ;;
    11311964                *)
     
    11371970
    11381971    if test "$SHARED_LIB_SUFFIX" = "" ; then
    1139         SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
     1972        SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
    11401973    fi
    11411974    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
    1142         UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
    1143     fi
     1975        UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
     1976    fi
     1977
     1978    AC_SUBST(DL_LIBS)
     1979
     1980    AC_SUBST(CFLAGS_DEBUG)
     1981    AC_SUBST(CFLAGS_OPTIMIZE)
     1982    AC_SUBST(CFLAGS_WARNING)
    11441983
    11451984    AC_SUBST(STLIB_LD)
    11461985    AC_SUBST(SHLIB_LD)
     1986
     1987    AC_SUBST(SHLIB_LD_LIBS)
    11471988    AC_SUBST(SHLIB_CFLAGS)
    1148     AC_SUBST(SHLIB_LDFLAGS)
    1149     AC_SUBST(DL_LIBS)
    1150     AC_SUBST(CFLAGS_DEBUG)
    1151     AC_SUBST(CFLAGS_OPTIMIZE)
    1152     AC_SUBST(LDFLAGS_DEBUG)
    1153     AC_SUBST(LDFLAGS_OPTIMIZE)
     1989
     1990    AC_SUBST(LD_LIBRARY_PATH_VAR)
     1991
     1992    # These must be called after we do the basic CFLAGS checks and
     1993    # verify any possible 64-bit or similar switches are necessary
     1994    TEA_TCL_EARLY_FLAGS
     1995    TEA_TCL_64BIT_FLAGS
    11541996])
    11551997
    11561998#--------------------------------------------------------------------
    1157 # SC_SERIAL_PORT
     1999# TEA_SERIAL_PORT
    11582000#
    11592001#       Determine which interface to use to talk to the serial port.
    11602002#       Note that #include lines must begin in leftmost column for
    1161 #       some compilers to recognize them as preprocessor directives.
     2003#       some compilers to recognize them as preprocessor directives,
     2004#       and some build environments have stdin not pointing at a
     2005#       pseudo-terminal (usually /dev/null instead.)
    11622006#
    11632007# Arguments:
     
    11672011#
    11682012#       Defines only one of the following vars:
     2013#               HAVE_SYS_MODEM_H
    11692014#               USE_TERMIOS
    11702015#               USE_TERMIO
     
    11732018#--------------------------------------------------------------------
    11742019
    1175 AC_DEFUN(SC_SERIAL_PORT, [
    1176     AC_MSG_CHECKING([termios vs. termio vs. sgtty])
    1177 
     2020AC_DEFUN([TEA_SERIAL_PORT], [
     2021    AC_CHECK_HEADERS(sys/modem.h)
     2022    AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
    11782023    AC_TRY_RUN([
    11792024#include <termios.h>
    11802025
    1181 main()
    1182 {
     2026int main() {
    11832027    struct termios t;
    11842028    if (tcgetattr(0, &t) == 0) {
     
    11882032    }
    11892033    return 1;
    1190 }], tk_ok=termios, tk_ok=no, tk_ok=no)
    1191 
    1192     if test $tk_ok = termios; then
    1193         AC_DEFINE(USE_TERMIOS)
    1194     else
     2034}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
     2035    if test $tcl_cv_api_serial = no ; then
    11952036        AC_TRY_RUN([
    11962037#include <termio.h>
    11972038
    1198 main()
    1199 {
     2039int main() {
    12002040    struct termio t;
    12012041    if (ioctl(0, TCGETA, &t) == 0) {
     
    12042044    }
    12052045    return 1;
    1206     }], tk_ok=termio, tk_ok=no, tk_ok=no)
    1207 
    1208     if test $tk_ok = termio; then
    1209         AC_DEFINE(USE_TERMIO)
    1210     else
     2046}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
     2047    fi
     2048    if test $tcl_cv_api_serial = no ; then
    12112049        AC_TRY_RUN([
    12122050#include <sgtty.h>
    12132051
    1214 main()
    1215 {
     2052int main() {
    12162053    struct sgttyb t;
    12172054    if (ioctl(0, TIOCGETP, &t) == 0) {
     
    12212058    }
    12222059    return 1;
    1223 }], tk_ok=sgtty, tk_ok=none, tk_ok=none)
    1224     if test $tk_ok = sgtty; then
    1225         AC_DEFINE(USE_SGTTY)
    1226     fi
    1227     fi
    1228     fi
    1229     AC_MSG_RESULT($tk_ok)
     2060}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
     2061    fi
     2062    if test $tcl_cv_api_serial = no ; then
     2063        AC_TRY_RUN([
     2064#include <termios.h>
     2065#include <errno.h>
     2066
     2067int main() {
     2068    struct termios t;
     2069    if (tcgetattr(0, &t) == 0
     2070        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
     2071        cfsetospeed(&t, 0);
     2072        t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
     2073        return 0;
     2074    }
     2075    return 1;
     2076}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
     2077    fi
     2078    if test $tcl_cv_api_serial = no; then
     2079        AC_TRY_RUN([
     2080#include <termio.h>
     2081#include <errno.h>
     2082
     2083int main() {
     2084    struct termio t;
     2085    if (ioctl(0, TCGETA, &t) == 0
     2086        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
     2087        t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
     2088        return 0;
     2089    }
     2090    return 1;
     2091    }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
     2092    fi
     2093    if test $tcl_cv_api_serial = no; then
     2094        AC_TRY_RUN([
     2095#include <sgtty.h>
     2096#include <errno.h>
     2097
     2098int main() {
     2099    struct sgttyb t;
     2100    if (ioctl(0, TIOCGETP, &t) == 0
     2101        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
     2102        t.sg_ospeed = 0;
     2103        t.sg_flags |= ODDP | EVENP | RAW;
     2104        return 0;
     2105    }
     2106    return 1;
     2107}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
     2108    fi])
     2109    case $tcl_cv_api_serial in
     2110        termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
     2111        termio)  AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
     2112        sgtty)   AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
     2113    esac
    12302114])
    12312115
    12322116#--------------------------------------------------------------------
    1233 # SC_MISSING_POSIX_HEADERS
     2117# TEA_MISSING_POSIX_HEADERS
    12342118#
    12352119#       Supply substitutes for missing POSIX header files.  Special
     
    12492133#               NO_ERRNO_H
    12502134#               NO_VALUES_H
    1251 #               NO_LIMITS_H
     2135#               HAVE_LIMITS_H or NO_LIMITS_H
    12522136#               NO_STDLIB_H
    12532137#               NO_STRING_H
    12542138#               NO_SYS_WAIT_H
    12552139#               NO_DLFCN_H
    1256 #               HAVE_UNISTD_H
    12572140#               HAVE_SYS_PARAM_H
    12582141#
    12592142#               HAVE_STRING_H ?
    12602143#
     2144# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
     2145# CHECK on limits.h
    12612146#--------------------------------------------------------------------
    12622147
    1263 AC_DEFUN(SC_MISSING_POSIX_HEADERS, [
    1264 
    1265     AC_MSG_CHECKING(dirent.h)
     2148AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
     2149    AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h,
    12662150    AC_TRY_LINK([#include <sys/types.h>
    12672151#include <dirent.h>], [
     
    12832167p = entryPtr->d_name;
    12842168closedir(d);
    1285 ], tcl_ok=yes, tcl_ok=no)
    1286 
    1287     if test $tcl_ok = no; then
    1288         AC_DEFINE(NO_DIRENT_H)
    1289     fi
    1290 
    1291     AC_MSG_RESULT($tcl_ok)
    1292     AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H))
    1293     AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H))
    1294     AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H))
    1295     AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H))
     2169], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no))
     2170
     2171    if test $tcl_cv_dirent_h = no; then
     2172        AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
     2173    fi
     2174
     2175    AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
     2176    AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
     2177    AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
     2178    AC_CHECK_HEADER(limits.h,
     2179        [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
     2180        [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
    12962181    AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
    12972182    AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
     
    12992184    AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
    13002185    if test $tcl_ok = 0; then
    1301         AC_DEFINE(NO_STDLIB_H)
     2186        AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
    13022187    fi
    13032188    AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
     
    13092194
    13102195    if test $tcl_ok = 0; then
    1311         AC_DEFINE(NO_STRING_H)
    1312     fi
    1313 
    1314     AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H))
    1315     AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H))
     2196        AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
     2197    fi
     2198
     2199    AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
     2200    AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
    13162201
    13172202    # OS/390 lacks sys/param.h (and doesn't need it, by chance).
    1318 
    1319     AC_HAVE_HEADERS(unistd.h sys/param.h)
    1320 
     2203    AC_HAVE_HEADERS(sys/param.h)
    13212204])
    13222205
    13232206#--------------------------------------------------------------------
    1324 # SC_PATH_X
     2207# TEA_PATH_X
    13252208#
    13262209#       Locate the X11 header files and the X11 library archive.  Try
     
    13312214#       no include files, so double-check its result just to be safe.
    13322215#
     2216#       This should be called after TEA_CONFIG_CFLAGS as setting the
     2217#       LIBS line can confuse some configure macro magic.
     2218#
    13332219# Arguments:
    13342220#       none
     
    13362222# Results:
    13372223#
    1338 #       Sets the the following vars:
     2224#       Sets the following vars:
    13392225#               XINCLUDES
    13402226#               XLIBSW
     2227#               PKG_LIBS (appends to)
    13412228#
    13422229#--------------------------------------------------------------------
    13432230
    1344 AC_DEFUN(SC_PATH_X, [
     2231AC_DEFUN([TEA_PATH_X], [
     2232    if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
     2233        TEA_PATH_UNIX_X
     2234    fi
     2235])
     2236
     2237AC_DEFUN([TEA_PATH_UNIX_X], [
    13452238    AC_PATH_X
    13462239    not_really_there=""
     
    13552248    fi
    13562249    if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
    1357         AC_MSG_CHECKING(for X11 header files)
    1358         XINCLUDES="# no special path needed"
    1359         AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
    1360         if test "$XINCLUDES" = nope; then
     2250        AC_MSG_CHECKING([for X11 header files])
     2251        found_xincludes="no"
     2252        AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
     2253        if test "$found_xincludes" = "no"; then
    13612254            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"
    13622255            for i in $dirs ; do
    13632256                if test -r $i/X11/Intrinsic.h; then
    1364                     AC_MSG_RESULT($i)
     2257                    AC_MSG_RESULT([$i])
    13652258                    XINCLUDES=" -I$i"
     2259                    found_xincludes="yes"
    13662260                    break
    13672261                fi
     
    13702264    else
    13712265        if test "$x_includes" != ""; then
    1372             XINCLUDES=-I$x_includes
    1373         else
    1374             XINCLUDES="# no special path needed"
     2266            XINCLUDES="-I$x_includes"
     2267            found_xincludes="yes"
    13752268        fi
    13762269    fi
    1377     if test "$XINCLUDES" = nope; then
    1378         AC_MSG_RESULT(couldn't find any!)
    1379         XINCLUDES="# no include files found"
     2270    if test found_xincludes = "no"; then
     2271        AC_MSG_RESULT([couldn't find any!])
    13802272    fi
    13812273
    13822274    if test "$no_x" = yes; then
    1383         AC_MSG_CHECKING(for X11 libraries)
     2275        AC_MSG_CHECKING([for X11 libraries])
    13842276        XLIBSW=nope
    13852277        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"
    13862278        for i in $dirs ; do
    13872279            if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
    1388                 AC_MSG_RESULT($i)
     2280                AC_MSG_RESULT([$i])
    13892281                XLIBSW="-L$i -lX11"
    13902282                x_libraries="$i"
     
    14032295    fi
    14042296    if test "$XLIBSW" = nope ; then
    1405         AC_MSG_RESULT(couldn't find any!  Using -lX11.)
     2297        AC_MSG_RESULT([could not find any!  Using -lX11.])
    14062298        XLIBSW=-lX11
    14072299    fi
    1408 ])
     2300    if test x"${XLIBSW}" != x ; then
     2301        PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
     2302    fi
     2303])
     2304
    14092305#--------------------------------------------------------------------
    1410 # SC_BLOCKING_STYLE
     2306# TEA_BLOCKING_STYLE
    14112307#
    14122308#       The statements below check for systems where POSIX-style
     
    14282324#--------------------------------------------------------------------
    14292325
    1430 AC_DEFUN(SC_BLOCKING_STYLE, [
     2326AC_DEFUN([TEA_BLOCKING_STYLE], [
    14312327    AC_CHECK_HEADERS(sys/ioctl.h)
    14322328    AC_CHECK_HEADERS(sys/filio.h)
     2329    TEA_CONFIG_SYSTEM
    14332330    AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
    1434     if test -f /usr/lib/NextStep/software_version; then
    1435         system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
    1436     else
    1437         system=`uname -s`-`uname -r`
    1438         if test "$?" -ne 0 ; then
    1439             system=unknown
    1440         else
    1441             # Special check for weird MP-RAS system (uname returns weird
    1442             # results, and the version is kept in special file).
    1443        
    1444             if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
    1445                 system=MP-RAS-`awk '{print $3}' /etc/.relid'`
    1446             fi
    1447             if test "`uname -s`" = "AIX" ; then
    1448                 system=AIX-`uname -v`.`uname -r`
    1449             fi
    1450         fi
    1451     fi
    14522331    case $system in
    14532332        # There used to be code here to use FIONBIO under AIX.  However, it
     
    14572336
    14582337        OSF*)
    1459             AC_DEFINE(USE_FIONBIO)
    1460             AC_MSG_RESULT(FIONBIO)
     2338            AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
     2339            AC_MSG_RESULT([FIONBIO])
    14612340            ;;
    14622341        SunOS-4*)
    1463             AC_DEFINE(USE_FIONBIO)
    1464             AC_MSG_RESULT(FIONBIO)
    1465             ;;
    1466         ULTRIX-4.*)
    1467             AC_DEFINE(USE_FIONBIO)
    1468             AC_MSG_RESULT(FIONBIO)
     2342            AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
     2343            AC_MSG_RESULT([FIONBIO])
    14692344            ;;
    14702345        *)
    1471             AC_MSG_RESULT(O_NONBLOCK)
     2346            AC_MSG_RESULT([O_NONBLOCK])
    14722347            ;;
    14732348    esac
     
    14752350
    14762351#--------------------------------------------------------------------
    1477 # SC_HAVE_VFORK
    1478 #
    1479 #       Check to see whether the system provides a vfork kernel call.
    1480 #       If not, then use fork instead.  Also, check for a problem with
    1481 #       vforks and signals that can cause core dumps if a vforked child
    1482 #       resets a signal handler.  If the problem exists, then use fork
    1483 #       instead of vfork.
    1484 #
    1485 # Arguments:
    1486 #       none
    1487 #       
    1488 # Results:
    1489 #
    1490 #       Defines some of the following vars:
    1491 #               vfork (=fork)
    1492 #
    1493 #--------------------------------------------------------------------
    1494 
    1495 AC_DEFUN(SC_HAVE_VFORK, [
    1496     AC_TYPE_SIGNAL()
    1497     AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0)
    1498     if test "$tcl_ok" = 1; then
    1499         AC_MSG_CHECKING([vfork/signal bug]);
    1500         AC_TRY_RUN([
    1501 #include <stdio.h>
    1502 #include <signal.h>
    1503 #include <sys/wait.h>
    1504 int gotSignal = 0;
    1505 sigProc(sig)
    1506     int sig;
    1507 {
    1508     gotSignal = 1;
    1509 }
    1510 main()
    1511 {
    1512     int pid, sts;
    1513     (void) signal(SIGCHLD, sigProc);
    1514     pid = vfork();
    1515     if (pid <  0) {
    1516         exit(1);
    1517     } else if (pid == 0) {
    1518         (void) signal(SIGCHLD, SIG_DFL);
    1519         _exit(0);
    1520     } else {
    1521         (void) wait(&sts);
    1522     }
    1523     exit((gotSignal) ? 0 : 1);
    1524 }], tcl_ok=1, tcl_ok=0, tcl_ok=0)
    1525 
    1526         if test "$tcl_ok" = 1; then
    1527             AC_MSG_RESULT(ok)
    1528         else
    1529             AC_MSG_RESULT([buggy, using fork instead])
    1530         fi
    1531     fi
    1532     rm -f core
    1533     if test "$tcl_ok" = 0; then
    1534         AC_DEFINE(vfork, fork)
    1535     fi
    1536 ])
    1537 
    1538 #--------------------------------------------------------------------
    1539 # SC_TIME_HANLDER
     2352# TEA_TIME_HANLDER
    15402353#
    15412354#       Checks how the system deals with time.h, what time structures
     
    15552368#--------------------------------------------------------------------
    15562369
    1557 AC_DEFUN(SC_TIME_HANDLER, [
     2370AC_DEFUN([TEA_TIME_HANDLER], [
    15582371    AC_CHECK_HEADERS(sys/time.h)
    15592372    AC_HEADER_TIME
    15602373    AC_STRUCT_TIMEZONE
    15612374
    1562     AC_MSG_CHECKING([tm_tzadj in struct tm])
    1563     AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
    1564             [AC_DEFINE(HAVE_TM_TZADJ)
    1565             AC_MSG_RESULT(yes)],
    1566             AC_MSG_RESULT(no))
    1567 
    1568     AC_MSG_CHECKING([tm_gmtoff in struct tm])
    1569     AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
    1570             [AC_DEFINE(HAVE_TM_GMTOFF)
    1571             AC_MSG_RESULT(yes)],
    1572             AC_MSG_RESULT(no))
     2375    AC_CHECK_FUNCS(gmtime_r localtime_r)
     2376
     2377    AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj,
     2378        AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
     2379            tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no))
     2380    if test $tcl_cv_member_tm_tzadj = yes ; then
     2381        AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
     2382    fi
     2383
     2384    AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff,
     2385        AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
     2386            tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no))
     2387    if test $tcl_cv_member_tm_gmtoff = yes ; then
     2388        AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
     2389    fi
    15732390
    15742391    #
     
    15762393    # (like convex) have timezone functions, etc.
    15772394    #
    1578     have_timezone=no
    1579     AC_MSG_CHECKING([long timezone variable])
    1580     AC_TRY_COMPILE([#include <time.h>],
     2395    AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long,
     2396        AC_TRY_COMPILE([#include <time.h>],
    15812397            [extern long timezone;
    15822398            timezone += 1;
    15832399            exit (0);],
    1584             [have_timezone=yes
    1585             AC_DEFINE(HAVE_TIMEZONE_VAR)
    1586             AC_MSG_RESULT(yes)],
    1587             AC_MSG_RESULT(no))
    1588 
    1589     #
    1590     # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
    1591     #
    1592     if test "$have_timezone" = no; then
    1593     AC_MSG_CHECKING([time_t timezone variable])
    1594     AC_TRY_COMPILE([#include <time.h>],
    1595             [extern time_t timezone;
    1596             timezone += 1;
    1597             exit (0);],
    1598             [AC_DEFINE(HAVE_TIMEZONE_VAR)
    1599             AC_MSG_RESULT(yes)],
    1600             AC_MSG_RESULT(no))
    1601     fi
    1602 
    1603     #
    1604     # AIX does not have a timezone field in struct tm. When the AIX bsd
    1605     # library is used, the timezone global and the gettimeofday methods are
    1606     # to be avoided for timezone deduction instead, we deduce the timezone
    1607     # by comparing the localtime result on a known GMT value.
    1608     #
    1609 
    1610     if test "`uname -s`" = "AIX" ; then
    1611         AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes)
    1612         if test $libbsd = yes; then
    1613             AC_DEFINE(USE_DELTA_FOR_TZ)
     2400            tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no))
     2401    if test $tcl_cv_timezone_long = yes ; then
     2402        AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
     2403    else
     2404        #
     2405        # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
     2406        #
     2407        AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time,
     2408            AC_TRY_COMPILE([#include <time.h>],
     2409                [extern time_t timezone;
     2410                timezone += 1;
     2411                exit (0);],
     2412                tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no))
     2413        if test $tcl_cv_timezone_time = yes ; then
     2414            AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
    16142415        fi
    16152416    fi
     
    16172418
    16182419#--------------------------------------------------------------------
    1619 # SC_BUGGY_STRTOD
     2420# TEA_BUGGY_STRTOD
    16202421#
    16212422#       Under Solaris 2.4, strtod returns the wrong value for the
     
    16232424#       and if the problem exists use a substitute procedure
    16242425#       "fixstrtod" (provided by Tcl) that corrects the error.
     2426#       Also, on Compaq's Tru64 Unix 5.0,
     2427#       strtod(" ") returns 0.0 instead of a failure to convert.
    16252428#
    16262429# Arguments:
     
    16342437#--------------------------------------------------------------------
    16352438
    1636 AC_DEFUN(SC_BUGGY_STRTOD, [
    1637     AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0)
    1638     if test "$tk_strtod" = 1; then
    1639         AC_MSG_CHECKING([for Solaris 2.4 strtod bug])
    1640         AC_TRY_RUN([
    1641             extern double strtod();
    1642             int main()
    1643             {
    1644                 char *string = "NaN";
    1645                 char *term;
    1646                 strtod(string, &term);
    1647                 if ((term != string) && (term[-1] == 0)) {
    1648                     exit(1);
    1649                 }
    1650                 exit(0);
    1651             }], tk_ok=1, tk_ok=0, tk_ok=0)
    1652         if test "$tk_ok" = 1; then
    1653             AC_MSG_RESULT(ok)
    1654         else
    1655             AC_MSG_RESULT(buggy)
    1656             AC_DEFINE(strtod, fixstrtod)
     2439AC_DEFUN([TEA_BUGGY_STRTOD], [
     2440    AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
     2441    if test "$tcl_strtod" = 1; then
     2442        AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
     2443            AC_TRY_RUN([
     2444                extern double strtod();
     2445                int main() {
     2446                    char *infString="Inf", *nanString="NaN", *spaceString=" ";
     2447                    char *term;
     2448                    double value;
     2449                    value = strtod(infString, &term);
     2450                    if ((term != infString) && (term[-1] == 0)) {
     2451                        exit(1);
     2452                    }
     2453                    value = strtod(nanString, &term);
     2454                    if ((term != nanString) && (term[-1] == 0)) {
     2455                        exit(1);
     2456                    }
     2457                    value = strtod(spaceString, &term);
     2458                    if (term == (spaceString+1)) {
     2459                        exit(1);
     2460                    }
     2461                    exit(0);
     2462                }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
     2463                    tcl_cv_strtod_buggy=buggy)])
     2464        if test "$tcl_cv_strtod_buggy" = buggy; then
     2465            AC_LIBOBJ([fixstrtod])
     2466            USE_COMPAT=1
     2467            AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
    16572468        fi
    16582469    fi
     
    16602471
    16612472#--------------------------------------------------------------------
    1662 # SC_TCL_LINK_LIBS
     2473# TEA_TCL_LINK_LIBS
    16632474#
    16642475#       Search for the libraries needed to link the Tcl shell.
     
    16862497#--------------------------------------------------------------------
    16872498
    1688 AC_DEFUN(SC_TCL_LINK_LIBS, [
     2499AC_DEFUN([TEA_TCL_LINK_LIBS], [
    16892500    #--------------------------------------------------------------------
    16902501    # On a few very rare systems, all of the libm.a stuff is
     
    16982509
    16992510    #--------------------------------------------------------------------
    1700     # On AIX systems, libbsd.a has to be linked in to support
    1701     # non-blocking file IO.  This library has to be linked in after
    1702     # the MATH_LIBS or it breaks the pow() function.  The way to
    1703     # insure proper sequencing, is to add it to the tail of MATH_LIBS.
    1704     # This library also supplies gettimeofday.
    1705     #--------------------------------------------------------------------
    1706 
    1707     libbsd=no
    1708     if test "`uname -s`" = "AIX" ; then
    1709         AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes)
    1710         if test $libbsd = yes; then
    1711             MATH_LIBS="$MATH_LIBS -lbsd"
    1712         fi
    1713     fi
    1714 
    1715 
    1716     #--------------------------------------------------------------------
    17172511    # Interactive UNIX requires -linet instead of -lsocket, plus it
    17182512    # needs net/errno.h to define the socket-related error codes.
     
    17202514
    17212515    AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
    1722     AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H))
     2516    AC_CHECK_HEADER(net/errno.h, [
     2517        AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
    17232518
    17242519    #--------------------------------------------------------------------
     
    17432538    AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
    17442539    if test "$tcl_checkSocket" = 1; then
    1745         AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tcl_checkBoth=1)
     2540        AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
     2541            LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
    17462542    fi
    17472543    if test "$tcl_checkBoth" = 1; then
     
    17502546        AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
    17512547    fi
    1752     AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main,
    1753             [LIBS="$LIBS -lnsl"]))
     2548    AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
     2549            [LIBS="$LIBS -lnsl"])])
    17542550   
    17552551    # Don't perform the eval of the libraries here because DL_LIBS
    1756     # won't be set until we call SC_CONFIG_CFLAGS
     2552    # won't be set until we call TEA_CONFIG_CFLAGS
    17572553
    17582554    TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
     
    17612557])
    17622558
    1763 #------------------------------------------------------------------------
    1764 # SC_MAKE_LIB --
     2559#--------------------------------------------------------------------
     2560# TEA_TCL_EARLY_FLAGS
     2561#
     2562#       Check for what flags are needed to be passed so the correct OS
     2563#       features are available.
     2564#
     2565# Arguments:
     2566#       None
     2567#       
     2568# Results:
     2569#
     2570#       Might define the following vars:
     2571#               _ISOC99_SOURCE
     2572#               _LARGEFILE64_SOURCE
     2573#               _LARGEFILE_SOURCE64
     2574#
     2575#--------------------------------------------------------------------
     2576
     2577AC_DEFUN([TEA_TCL_EARLY_FLAG],[
     2578    AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
     2579        AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
     2580            AC_TRY_COMPILE([[#define ]$1[ 1
     2581]$2], $3,
     2582                [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
     2583                [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
     2584    if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
     2585        AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
     2586        tcl_flags="$tcl_flags $1"
     2587    fi
     2588])
     2589
     2590AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
     2591    AC_MSG_CHECKING([for required early compiler flags])
     2592    tcl_flags=""
     2593    TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
     2594        [char *p = (char *)strtoll; char *q = (char *)strtoull;])
     2595    TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
     2596        [struct stat64 buf; int i = stat64("/", &buf);])
     2597    TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
     2598        [char *p = (char *)open64;])
     2599    if test "x${tcl_flags}" = "x" ; then
     2600        AC_MSG_RESULT([none])
     2601    else
     2602        AC_MSG_RESULT([${tcl_flags}])
     2603    fi
     2604])
     2605
     2606#--------------------------------------------------------------------
     2607# TEA_TCL_64BIT_FLAGS
     2608#
     2609#       Check for what is defined in the way of 64-bit features.
     2610#
     2611# Arguments:
     2612#       None
     2613#       
     2614# Results:
     2615#
     2616#       Might define the following vars:
     2617#               TCL_WIDE_INT_IS_LONG
     2618#               TCL_WIDE_INT_TYPE
     2619#               HAVE_STRUCT_DIRENT64
     2620#               HAVE_STRUCT_STAT64
     2621#               HAVE_TYPE_OFF64_T
     2622#
     2623#--------------------------------------------------------------------
     2624
     2625AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
     2626    AC_MSG_CHECKING([for 64-bit integer type])
     2627    AC_CACHE_VAL(tcl_cv_type_64bit,[
     2628        tcl_cv_type_64bit=none
     2629        # See if the compiler knows natively about __int64
     2630        AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
     2631            tcl_type_64bit=__int64, tcl_type_64bit="long long")
     2632        # See if we should use long anyway  Note that we substitute in the
     2633        # type that is our current guess for a 64-bit type inside this check
     2634        # program, so it should be modified only carefully...
     2635        AC_TRY_COMPILE(,[switch (0) {
     2636            case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
     2637        }],tcl_cv_type_64bit=${tcl_type_64bit})])
     2638    if test "${tcl_cv_type_64bit}" = none ; then
     2639        AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
     2640        AC_MSG_RESULT([using long])
     2641    elif test "${tcl_cv_type_64bit}" = "__int64" \
     2642                -a "${TEA_PLATFORM}" = "windows" ; then
     2643        # We actually want to use the default tcl.h checks in this
     2644        # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
     2645        AC_MSG_RESULT([using Tcl header defaults])
     2646    else
     2647        AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
     2648            [What type should be used to define wide integers?])
     2649        AC_MSG_RESULT([${tcl_cv_type_64bit}])
     2650
     2651        # Now check for auxiliary declarations
     2652        AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
     2653            AC_TRY_COMPILE([#include <sys/types.h>
     2654#include <sys/dirent.h>],[struct dirent64 p;],
     2655                tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
     2656        if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
     2657            AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
     2658        fi
     2659
     2660        AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
     2661            AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
     2662],
     2663                tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
     2664        if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
     2665            AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
     2666        fi
     2667
     2668        AC_CHECK_FUNCS(open64 lseek64)
     2669        AC_MSG_CHECKING([for off64_t])
     2670        AC_CACHE_VAL(tcl_cv_type_off64_t,[
     2671            AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
     2672],
     2673                tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
     2674        dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
     2675        dnl functions lseek64 and open64 are defined.
     2676        if test "x${tcl_cv_type_off64_t}" = "xyes" && \
     2677                test "x${ac_cv_func_lseek64}" = "xyes" && \
     2678                test "x${ac_cv_func_open64}" = "xyes" ; then
     2679            AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
     2680            AC_MSG_RESULT([yes])
     2681        else
     2682            AC_MSG_RESULT([no])
     2683        fi
     2684    fi
     2685])
     2686
     2687##
     2688## Here ends the standard Tcl configuration bits and starts the
     2689## TEA specific functions
     2690##
     2691
     2692#------------------------------------------------------------------------
     2693# TEA_INIT --
     2694#
     2695#       Init various Tcl Extension Architecture (TEA) variables.
     2696#       This should be the first called TEA_* macro.
     2697#
     2698# Arguments:
     2699#       none
     2700#
     2701# Results:
     2702#
     2703#       Defines and substs the following vars:
     2704#               CYGPATH
     2705#               EXEEXT
     2706#       Defines only:
     2707#               TEA_VERSION
     2708#               TEA_INITED
     2709#               TEA_PLATFORM (windows or unix)
     2710#
     2711# "cygpath" is used on windows to generate native path names for include
     2712# files. These variables should only be used with the compiler and linker
     2713# since they generate native path names.
     2714#
     2715# EXEEXT
     2716#       Select the executable extension based on the host type.  This
     2717#       is a lightweight replacement for AC_EXEEXT that doesn't require
     2718#       a compiler.
     2719#------------------------------------------------------------------------
     2720
     2721AC_DEFUN([TEA_INIT], [
     2722    # TEA extensions pass this us the version of TEA they think they
     2723    # are compatible with.
     2724    TEA_VERSION="3.5"
     2725
     2726    AC_MSG_CHECKING([for correct TEA configuration])
     2727    if test x"${PACKAGE_NAME}" = x ; then
     2728        AC_MSG_ERROR([
     2729The PACKAGE_NAME variable must be defined by your TEA configure.in])
     2730    fi
     2731    if test x"$1" = x ; then
     2732        AC_MSG_ERROR([
     2733TEA version not specified.])
     2734    elif test "$1" != "${TEA_VERSION}" ; then
     2735        AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
     2736    else
     2737        AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
     2738    fi
     2739    case "`uname -s`" in
     2740        *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
     2741            AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
     2742            EXEEXT=".exe"
     2743            TEA_PLATFORM="windows"
     2744            ;;
     2745        *)
     2746            CYGPATH=echo
     2747            EXEEXT=""
     2748            TEA_PLATFORM="unix"
     2749            ;;
     2750    esac
     2751
     2752    # Check if exec_prefix is set. If not use fall back to prefix.
     2753    # Note when adjusted, so that TEA_PREFIX can correct for this.
     2754    # This is needed for recursive configures, since autoconf propagates
     2755    # $prefix, but not $exec_prefix (doh!).
     2756    if test x$exec_prefix = xNONE ; then
     2757        exec_prefix_default=yes
     2758        exec_prefix=$prefix
     2759    fi
     2760
     2761    AC_SUBST(EXEEXT)
     2762    AC_SUBST(CYGPATH)
     2763
     2764    # This package name must be replaced statically for AC_SUBST to work
     2765    AC_SUBST(PKG_LIB_FILE)
     2766    # Substitute STUB_LIB_FILE in case package creates a stub library too.
     2767    AC_SUBST(PKG_STUB_LIB_FILE)
     2768
     2769    # We AC_SUBST these here to ensure they are subst'ed,
     2770    # in case the user doesn't call TEA_ADD_...
     2771    AC_SUBST(PKG_STUB_SOURCES)
     2772    AC_SUBST(PKG_STUB_OBJECTS)
     2773    AC_SUBST(PKG_TCL_SOURCES)
     2774    AC_SUBST(PKG_HEADERS)
     2775    AC_SUBST(PKG_INCLUDES)
     2776    AC_SUBST(PKG_LIBS)
     2777    AC_SUBST(PKG_CFLAGS)
     2778])
     2779
     2780#------------------------------------------------------------------------
     2781# TEA_ADD_SOURCES --
     2782#
     2783#       Specify one or more source files.  Users should check for
     2784#       the right platform before adding to their list.
     2785#       It is not important to specify the directory, as long as it is
     2786#       in the generic, win or unix subdirectory of $(srcdir).
     2787#
     2788# Arguments:
     2789#       one or more file names
     2790#
     2791# Results:
     2792#
     2793#       Defines and substs the following vars:
     2794#               PKG_SOURCES
     2795#               PKG_OBJECTS
     2796#------------------------------------------------------------------------
     2797AC_DEFUN([TEA_ADD_SOURCES], [
     2798    vars="$@"
     2799    for i in $vars; do
     2800        case $i in
     2801            [\$]*)
     2802                # allow $-var names
     2803                PKG_SOURCES="$PKG_SOURCES $i"
     2804                PKG_OBJECTS="$PKG_OBJECTS $i"
     2805                ;;
     2806            *)
     2807                # check for existence - allows for generic/win/unix VPATH
     2808                if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/src/$i" \
     2809                    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
     2810                    ; then
     2811                    AC_MSG_ERROR([could not find source file '$i'])
     2812                fi
     2813                PKG_SOURCES="$PKG_SOURCES $i"
     2814                # this assumes it is in a VPATH dir
     2815                i=`basename $i`
     2816                # handle user calling this before or after TEA_SETUP_COMPILER
     2817                if test x"${OBJEXT}" != x ; then
     2818                    j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
     2819                else
     2820                    j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
     2821                fi
     2822                PKG_OBJECTS="$PKG_OBJECTS $j"
     2823                ;;
     2824        esac
     2825    done
     2826    AC_SUBST(PKG_SOURCES)
     2827    AC_SUBST(PKG_OBJECTS)
     2828])
     2829
     2830#------------------------------------------------------------------------
     2831# TEA_ADD_STUB_SOURCES --
     2832#
     2833#       Specify one or more source files.  Users should check for
     2834#       the right platform before adding to their list.
     2835#       It is not important to specify the directory, as long as it is
     2836#       in the generic, win or unix subdirectory of $(srcdir).
     2837#
     2838# Arguments:
     2839#       one or more file names
     2840#
     2841# Results:
     2842#
     2843#       Defines and substs the following vars:
     2844#               PKG_STUB_SOURCES
     2845#               PKG_STUB_OBJECTS
     2846#------------------------------------------------------------------------
     2847AC_DEFUN([TEA_ADD_STUB_SOURCES], [
     2848    vars="$@"
     2849    for i in $vars; do
     2850        # check for existence - allows for generic/win/unix VPATH
     2851        if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
     2852            -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
     2853            ; then
     2854            AC_MSG_ERROR([could not find stub source file '$i'])
     2855        fi
     2856        PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
     2857        # this assumes it is in a VPATH dir
     2858        i=`basename $i`
     2859        # handle user calling this before or after TEA_SETUP_COMPILER
     2860        if test x"${OBJEXT}" != x ; then
     2861            j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
     2862        else
     2863            j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
     2864        fi
     2865        PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
     2866    done
     2867    AC_SUBST(PKG_STUB_SOURCES)
     2868    AC_SUBST(PKG_STUB_OBJECTS)
     2869])
     2870
     2871#------------------------------------------------------------------------
     2872# TEA_ADD_TCL_SOURCES --
     2873#
     2874#       Specify one or more Tcl source files.  These should be platform
     2875#       independent runtime files.
     2876#
     2877# Arguments:
     2878#       one or more file names
     2879#
     2880# Results:
     2881#
     2882#       Defines and substs the following vars:
     2883#               PKG_TCL_SOURCES
     2884#------------------------------------------------------------------------
     2885AC_DEFUN([TEA_ADD_TCL_SOURCES], [
     2886    vars="$@"
     2887    for i in $vars; do
     2888        # check for existence, be strict because it is installed
     2889        if test ! -f "${srcdir}/$i" ; then
     2890            AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
     2891        fi
     2892        PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
     2893    done
     2894    AC_SUBST(PKG_TCL_SOURCES)
     2895])
     2896
     2897#------------------------------------------------------------------------
     2898# TEA_ADD_HEADERS --
     2899#
     2900#       Specify one or more source headers.  Users should check for
     2901#       the right platform before adding to their list.
     2902#
     2903# Arguments:
     2904#       one or more file names
     2905#
     2906# Results:
     2907#
     2908#       Defines and substs the following vars:
     2909#               PKG_HEADERS
     2910#------------------------------------------------------------------------
     2911AC_DEFUN([TEA_ADD_HEADERS], [
     2912    vars="$@"
     2913    for i in $vars; do
     2914        # check for existence, be strict because it is installed
     2915        if test ! -f "${srcdir}/$i" ; then
     2916            AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
     2917        fi
     2918        PKG_HEADERS="$PKG_HEADERS $i"
     2919    done
     2920    AC_SUBST(PKG_HEADERS)
     2921])
     2922
     2923#------------------------------------------------------------------------
     2924# TEA_ADD_INCLUDES --
     2925#
     2926#       Specify one or more include dirs.  Users should check for
     2927#       the right platform before adding to their list.
     2928#
     2929# Arguments:
     2930#       one or more file names
     2931#
     2932# Results:
     2933#
     2934#       Defines and substs the following vars:
     2935#               PKG_INCLUDES
     2936#------------------------------------------------------------------------
     2937AC_DEFUN([TEA_ADD_INCLUDES], [
     2938    vars="$@"
     2939    for i in $vars; do
     2940        PKG_INCLUDES="$PKG_INCLUDES $i"
     2941    done
     2942    AC_SUBST(PKG_INCLUDES)
     2943])
     2944
     2945#------------------------------------------------------------------------
     2946# TEA_ADD_LIBS --
     2947#
     2948#       Specify one or more libraries.  Users should check for
     2949#       the right platform before adding to their list.  For Windows,
     2950#       libraries provided in "foo.lib" format will be converted to
     2951#       "-lfoo" when using GCC (mingw).
     2952#
     2953# Arguments:
     2954#       one or more file names
     2955#
     2956# Results:
     2957#
     2958#       Defines and substs the following vars:
     2959#               PKG_LIBS
     2960#------------------------------------------------------------------------
     2961AC_DEFUN([TEA_ADD_LIBS], [
     2962    vars="$@"
     2963    for i in $vars; do
     2964        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
     2965            # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
     2966            i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
     2967        fi
     2968        PKG_LIBS="$PKG_LIBS $i"
     2969    done
     2970    AC_SUBST(PKG_LIBS)
     2971])
     2972
     2973#------------------------------------------------------------------------
     2974# TEA_ADD_CFLAGS --
     2975#
     2976#       Specify one or more CFLAGS.  Users should check for
     2977#       the right platform before adding to their list.
     2978#
     2979# Arguments:
     2980#       one or more file names
     2981#
     2982# Results:
     2983#
     2984#       Defines and substs the following vars:
     2985#               PKG_CFLAGS
     2986#------------------------------------------------------------------------
     2987AC_DEFUN([TEA_ADD_CFLAGS], [
     2988    PKG_CFLAGS="$PKG_CFLAGS $@"
     2989    AC_SUBST(PKG_CFLAGS)
     2990])
     2991
     2992#------------------------------------------------------------------------
     2993# TEA_PREFIX --
     2994#
     2995#       Handle the --prefix=... option by defaulting to what Tcl gave
     2996#
     2997# Arguments:
     2998#       none
     2999#
     3000# Results:
     3001#
     3002#       If --prefix or --exec-prefix was not specified, $prefix and
     3003#       $exec_prefix will be set to the values given to Tcl when it was
     3004#       configured.
     3005#------------------------------------------------------------------------
     3006AC_DEFUN([TEA_PREFIX], [
     3007    if test "${prefix}" = "NONE"; then
     3008        prefix_default=yes
     3009        if test x"${TCL_PREFIX}" != x; then
     3010            AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
     3011            prefix=${TCL_PREFIX}
     3012        else
     3013            AC_MSG_NOTICE([--prefix defaulting to /usr/local])
     3014            prefix=/usr/local
     3015        fi
     3016    fi
     3017    if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
     3018        -o x"${exec_prefix_default}" = x"yes" ; then
     3019        if test x"${TCL_EXEC_PREFIX}" != x; then
     3020            AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
     3021            exec_prefix=${TCL_EXEC_PREFIX}
     3022        else
     3023            AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
     3024            exec_prefix=$prefix
     3025        fi
     3026    fi
     3027])
     3028
     3029#------------------------------------------------------------------------
     3030# TEA_SETUP_COMPILER_CC --
     3031#
     3032#       Do compiler checks the way we want.  This is just a replacement
     3033#       for AC_PROG_CC in TEA configure.in files to make them cleaner.
     3034#
     3035# Arguments:
     3036#       none
     3037#
     3038# Results:
     3039#
     3040#       Sets up CC var and other standard bits we need to make executables.
     3041#------------------------------------------------------------------------
     3042AC_DEFUN([TEA_SETUP_COMPILER_CC], [
     3043    # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
     3044    # in this macro, they need to go into TEA_SETUP_COMPILER instead.
     3045
     3046    # If the user did not set CFLAGS, set it now to keep
     3047    # the AC_PROG_CC macro from adding "-g -O2".
     3048    if test "${CFLAGS+set}" != "set" ; then
     3049        CFLAGS=""
     3050    fi
     3051
     3052    AC_PROG_CC
     3053    AC_PROG_CXX
     3054    AC_PROG_CPP
     3055
     3056    AC_PROG_INSTALL
     3057
     3058    #--------------------------------------------------------------------
     3059    # Checks to see if the make program sets the $MAKE variable.
     3060    #--------------------------------------------------------------------
     3061
     3062    AC_PROG_MAKE_SET
     3063
     3064    #--------------------------------------------------------------------
     3065    # Find ranlib
     3066    #--------------------------------------------------------------------
     3067
     3068    AC_PROG_RANLIB
     3069
     3070    #--------------------------------------------------------------------
     3071    # Determines the correct binary file extension (.o, .obj, .exe etc.)
     3072    #--------------------------------------------------------------------
     3073
     3074    AC_OBJEXT
     3075    AC_EXEEXT
     3076])
     3077
     3078#------------------------------------------------------------------------
     3079# TEA_SETUP_COMPILER --
     3080#
     3081#       Do compiler checks that use the compiler.  This must go after
     3082#       TEA_SETUP_COMPILER_CC, which does the actual compiler check.
     3083#
     3084# Arguments:
     3085#       none
     3086#
     3087# Results:
     3088#
     3089#       Sets up CC var and other standard bits we need to make executables.
     3090#------------------------------------------------------------------------
     3091AC_DEFUN([TEA_SETUP_COMPILER], [
     3092    # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
     3093    AC_REQUIRE([TEA_SETUP_COMPILER_CC])
     3094
     3095    #------------------------------------------------------------------------
     3096    # If we're using GCC, see if the compiler understands -pipe. If so, use it.
     3097    # It makes compiling go faster.  (This is only a performance feature.)
     3098    #------------------------------------------------------------------------
     3099
     3100    if test -z "$no_pipe" -a -n "$GCC"; then
     3101        AC_MSG_CHECKING([if the compiler understands -pipe])
     3102        OLDCC="$CC"
     3103        CC="$CC -pipe"
     3104        AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC"
     3105            AC_MSG_RESULT([no]))
     3106    fi
     3107
     3108    #--------------------------------------------------------------------
     3109    # Common compiler flag setup
     3110    #--------------------------------------------------------------------
     3111
     3112    AC_C_BIGENDIAN
     3113    if test "${TEA_PLATFORM}" = "unix" ; then
     3114        TEA_TCL_LINK_LIBS
     3115        TEA_MISSING_POSIX_HEADERS
     3116        # Let the user call this, because if it triggers, they will
     3117        # need a compat/strtod.c that is correct.  Users can also
     3118        # use Tcl_GetDouble(FromObj) instead.
     3119        #TEA_BUGGY_STRTOD
     3120    fi
     3121])
     3122
     3123#------------------------------------------------------------------------
     3124# TEA_MAKE_LIB --
    17653125#
    17663126#       Generate a line that can be used to build a shared/unshared library
     
    17753135#
    17763136#       Defines the following vars:
    1777 #               MAKE_LIB        Makefile rule for building a library
    1778 #               MAKE_SHARED_LIB Makefile rule for building a shared library
    1779 #               MAKE_UNSHARED_LIB       Makefile rule for building a static
    1780 #                               library
    1781 #------------------------------------------------------------------------
    1782 
    1783 AC_DEFUN(SC_MAKE_LIB, [
    1784     case "`uname -s`" in
    1785         *win32* | *WIN32* | *CYGWIN_NT*)
    1786             if test "${CC-cc}" = "cl"; then
    1787                 MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$]@_OBJECTS) "
    1788                 MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$]@_OBJECTS) "
    1789             fi
    1790             ;;
    1791         *)
    1792             MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$]@_OBJECTS)"
    1793             MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$]@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}"
    1794             ;;
    1795     esac
     3137#       CFLAGS -        Done late here to note disturb other AC macros
     3138#       MAKE_LIB -      Command to execute to build the Tcl library;
     3139#                       differs depending on whether or not Tcl is being
     3140#                       compiled as a shared library.
     3141#       MAKE_SHARED_LIB Makefile rule for building a shared library
     3142#       MAKE_STATIC_LIB Makefile rule for building a static library
     3143#       MAKE_STUB_LIB   Makefile rule for building a stub library
     3144#------------------------------------------------------------------------
     3145
     3146AC_DEFUN([TEA_MAKE_LIB], [
     3147    if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
     3148        MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
     3149        MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
     3150        MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
     3151    else
     3152        MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
     3153        MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
     3154        MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
     3155    fi
    17963156
    17973157    if test "${SHARED_BUILD}" = "1" ; then
    1798         MAKE_LIB=${MAKE_SHARED_LIB}
     3158        MAKE_LIB="${MAKE_SHARED_LIB} "
    17993159    else
    1800         MAKE_LIB=${MAKE_STATIC_LIB}
     3160        MAKE_LIB="${MAKE_STATIC_LIB} "
     3161    fi
     3162
     3163    #--------------------------------------------------------------------
     3164    # Shared libraries and static libraries have different names.
     3165    # Use the double eval to make sure any variables in the suffix is
     3166    # substituted. (@@@ Might not be necessary anymore)
     3167    #--------------------------------------------------------------------
     3168
     3169    if test "${TEA_PLATFORM}" = "windows" ; then
     3170        if test "${SHARED_BUILD}" = "1" ; then
     3171            # We force the unresolved linking of symbols that are really in
     3172            # the private libraries of Tcl and Tk.
     3173            SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
     3174            if test x"${TK_BIN_DIR}" != x ; then
     3175                SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
     3176            fi
     3177            eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
     3178        else
     3179            eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
     3180        fi
     3181        # Some packages build their own stubs libraries
     3182        eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
     3183        if test "$GCC" = "yes"; then
     3184            PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
     3185        fi
     3186        # These aren't needed on Windows (either MSVC or gcc)
     3187        RANLIB="mt -manifest ${PKG_LIB_FILE}.manifest -outputresource:${PKG_LIB_FILE}\;2 ; test -f"
     3188        RANLIB_STUB=:
     3189    else
     3190        RANLIB_STUB="${RANLIB}"
     3191        if test "${SHARED_BUILD}" = "1" ; then
     3192            SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
     3193            if test x"${TK_BIN_DIR}" != x ; then
     3194                SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
     3195            fi
     3196            eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
     3197            RANLIB=:
     3198        else
     3199            eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
     3200        fi
     3201        # Some packages build their own stubs libraries
     3202        eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
     3203    fi
     3204
     3205    # These are escaped so that only CFLAGS is picked up at configure time.
     3206    # The other values will be substituted at make time.
     3207    CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
     3208    if test "${SHARED_BUILD}" = "1" ; then
     3209        CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
    18013210    fi
    18023211
     
    18043213    AC_SUBST(MAKE_SHARED_LIB)
    18053214    AC_SUBST(MAKE_STATIC_LIB)
    1806 ])
    1807 
    1808 #------------------------------------------------------------------------
    1809 # SC_LIB_SPEC --
     3215    AC_SUBST(MAKE_STUB_LIB)
     3216    AC_SUBST(RANLIB_STUB)
     3217    AC_SUBST(RANLIB)
     3218])
     3219
     3220#------------------------------------------------------------------------
     3221# TEA_LIB_SPEC --
    18103222#
    18113223#       Compute the name of an existing object library located in libdir
     
    18153227#       basename        The base name of the library without version
    18163228#                       numbers, extensions, or "lib" prefixes.
    1817 #
    1818 #       Requires:
     3229#       extra_dir       Extra directory in which to search for the
     3230#                       library.  This location is used first, then
     3231#                       $prefix/$exec-prefix, then some defaults.
     3232#
     3233# Requires:
     3234#       TEA_INIT and TEA_PREFIX must be called first.
    18193235#
    18203236# Results:
     
    18253241#------------------------------------------------------------------------
    18263242
    1827 AC_DEFUN(SC_LIB_SPEC, [
    1828     AC_MSG_CHECKING(for $1 library)
    1829     eval "sc_lib_name_dir=${libdir}"
     3243AC_DEFUN([TEA_LIB_SPEC], [
     3244    AC_MSG_CHECKING([for $1 library])
     3245
     3246    # Look in exec-prefix for the library (defined by TEA_PREFIX).
     3247
     3248    tea_lib_name_dir="${exec_prefix}/lib"
     3249
     3250    # Or in a user-specified location.
     3251
     3252    if test x"$2" != x ; then
     3253        tea_extra_lib_dir=$2
     3254    else
     3255        tea_extra_lib_dir=NONE
     3256    fi
     3257
    18303258    for i in \
    1831             `ls -dr ${sc_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
    1832             `ls -dr ${sc_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
     3259            `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
     3260            `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
     3261            `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
     3262            `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
    18333263            `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
    18343264            `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
     
    18363266            `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
    18373267        if test -f "$i" ; then
    1838 
    1839             sc_lib_name_dir=`dirname $i`
     3268            tea_lib_name_dir=`dirname $i`
    18403269            $1_LIB_NAME=`basename $i`
     3270            $1_LIB_PATH_NAME=$i
    18413271            break
    18423272        fi
    18433273    done
    18443274
    1845     case "`uname -s`" in
    1846         *win32* | *WIN32* | *CYGWIN_NT*)
    1847             $1_LIB_SPEC=${$1_LIB_NAME}
    1848             ;;
    1849         *)
    1850             # Strip off the leading "lib" and trailing ".a" or ".so"
    1851 
    1852             sc_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//'`
    1853             $1_LIB_SPEC="-L${sc_lib_name_dir} -l${sc_lib_name_lib}"
    1854             ;;
    1855     esac
    1856     if test "x$1_LIB_NAME" = x ; then
    1857         AC_MSG_ERROR(not found)
     3275    if test "${TEA_PLATFORM}" = "windows"; then
     3276        $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
    18583277    else
    1859         AC_MSG_RESULT(${$1_LIB_SPEC})
    1860     fi
    1861 ])
    1862 
    1863 #------------------------------------------------------------------------
    1864 # SC_PRIVATE_TCL_INCLUDE --
     3278        # Strip off the leading "lib" and trailing ".a" or ".so"
     3279
     3280        tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
     3281        $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
     3282    fi
     3283
     3284    if test "x${$1_LIB_NAME}" = x ; then
     3285        AC_MSG_ERROR([not found])
     3286    else
     3287        AC_MSG_RESULT([${$1_LIB_SPEC}])
     3288    fi
     3289])
     3290
     3291#------------------------------------------------------------------------
     3292# TEA_PRIVATE_TCL_HEADERS --
    18653293#
    18663294#       Locate the private Tcl include files
     
    18693297#
    18703298#       Requires:
    1871 #               TCL_SRC_DIR     Assumes that SC_LOAD_TCLCONFIG has
     3299#               TCL_SRC_DIR     Assumes that TEA_LOAD_TCLCONFIG has
    18723300#                                already been called.
    18733301#
     
    18863314#------------------------------------------------------------------------
    18873315
    1888 AC_DEFUN(SC_PRIVATE_TCL_HEADERS, [
    1889     AC_MSG_CHECKING(for Tcl private include files)
    1890 
    1891     case "`uname -s`" in
    1892         *win32* | *WIN32* | *CYGWIN_NT*)
    1893             TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/..`\"
    1894             TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../generic`\"
    1895             TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../unix`\"
    1896             TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../win`\"
    1897             TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../bitmaps`\"
    1898             TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../tools`\"
    1899             TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/../compat`\"
    1900             TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
    1901         ;;
    1902         *)
    1903             TCL_TOP_DIR_NATIVE=${TCL_SRC_DIR}
    1904             TCL_GENERIC_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/generic'
    1905             TCL_UNIX_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/unix'
    1906             TCL_WIN_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/win'
    1907             TCL_BMAP_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/bitmaps'
    1908             TCL_TOOL_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/tools'
    1909             TCL_COMPAT_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/compat'
    1910             TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
    1911         ;;
    1912     esac
     3316AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
     3317    AC_MSG_CHECKING([for Tcl private include files])
     3318
     3319    TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
     3320    TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
     3321    TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
     3322    TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
     3323    TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
     3324    TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\"
     3325    TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\"
     3326    TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\"
     3327
     3328    if test "${TEA_PLATFORM}" = "windows"; then
     3329        TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
     3330    else
     3331        TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
     3332    fi
     3333    # We want to ensure these are substituted so as not to require
     3334    # any *_NATIVE vars be defined in the Makefile
     3335    TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
     3336    if test "`uname -s`" = "Darwin"; then
     3337        # If Tcl was built as a framework, attempt to use
     3338        # the framework's Headers and PrivateHeaders directories
     3339        case ${TCL_DEFS} in
     3340            *TCL_FRAMEWORK*)
     3341                if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then
     3342                TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else
     3343                TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi
     3344                ;;
     3345        esac
     3346    fi
    19133347
    19143348    AC_SUBST(TCL_TOP_DIR_NATIVE)
     
    19203354    AC_SUBST(TCL_PLATFORM_DIR_NATIVE)
    19213355
    1922     TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
    19233356    AC_SUBST(TCL_INCLUDES)
    1924     AC_MSG_RESULT(Using srcdir found in tclConfig.sh)
    1925 ])
    1926 
    1927 #------------------------------------------------------------------------
    1928 # SC_PUBLIC_TCL_HEADERS --
     3357    AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}])
     3358])
     3359
     3360#------------------------------------------------------------------------
     3361# TEA_PUBLIC_TCL_HEADERS --
    19293362#
    19303363#       Locate the installed public Tcl header files
     
    19453378#------------------------------------------------------------------------
    19463379
    1947 AC_DEFUN(SC_PUBLIC_TCL_HEADERS, [
    1948     AC_MSG_CHECKING(for Tcl public headers)
    1949 
    1950     AC_ARG_WITH(tclinclude, [ --with-tclinclude      directory containing the public Tcl header files.], with_tclinclude=${withval})
    1951 
    1952     if test x"${with_tclinclude}" != x ; then
    1953         if test -f "${with_tclinclude}/tcl.h" ; then
    1954             ac_cv_c_tclh=${with_tclinclude}
    1955         else
    1956             AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl public header file tcl.h])
    1957         fi
    1958     else
    1959         AC_CACHE_VAL(ac_cv_c_tclh, [
    1960             # Use the value from --with-tclinclude, if it was given
    1961 
    1962             if test x"${with_tclinclude}" != x ; then
     3380AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
     3381    AC_MSG_CHECKING([for Tcl public headers])
     3382
     3383    AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory containing the public Tcl header files], with_tclinclude=${withval})
     3384
     3385    AC_CACHE_VAL(ac_cv_c_tclh, [
     3386        # Use the value from --with-tclinclude, if it was given
     3387
     3388        if test x"${with_tclinclude}" != x ; then
     3389            if test -f "${with_tclinclude}/tcl.h" ; then
    19633390                ac_cv_c_tclh=${with_tclinclude}
    19643391            else
    1965                 # Check in the includedir, if --prefix was specified
    1966 
    1967                 eval "temp_includedir=${includedir}"
     3392                AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
     3393            fi
     3394        else
     3395            if test "`uname -s`" = "Darwin"; then
     3396                # If Tcl was built as a framework, attempt to use
     3397                # the framework's Headers directory
     3398                case ${TCL_DEFS} in
     3399                    *TCL_FRAMEWORK*)
     3400                        list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
     3401                        ;;
     3402                esac
     3403            fi
     3404
     3405            # Look in the source dir only if Tcl is not installed,
     3406            # and in that situation, look there before installed locations.
     3407            if test -f "${TCL_BIN_DIR}/Makefile" ; then
     3408                list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
     3409            fi
     3410
     3411            # Check order: pkg --prefix location, Tcl's --prefix location,
     3412            # relative to directory of tclConfig.sh.
     3413
     3414            eval "temp_includedir=${includedir}"
     3415            list="$list \
     3416                `ls -d ${temp_includedir}        2>/dev/null` \
     3417                `ls -d ${TCL_PREFIX}/include     2>/dev/null` \
     3418                `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
     3419            if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
     3420                list="$list /usr/local/include /usr/include"
     3421                if test x"${TCL_INCLUDE_SPEC}" != x ; then
     3422                    d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
     3423                    list="$list `ls -d ${d} 2>/dev/null`"
     3424                fi
     3425            fi
     3426            for i in $list ; do
     3427                if test -f "$i/tcl.h" ; then
     3428                    ac_cv_c_tclh=$i
     3429                    break
     3430                fi
     3431            done
     3432        fi
     3433    ])
     3434
     3435    # Print a message based on how we determined the include path
     3436
     3437    if test x"${ac_cv_c_tclh}" = x ; then
     3438        AC_MSG_ERROR([tcl.h not found.  Please specify its location with --with-tclinclude])
     3439    else
     3440        AC_MSG_RESULT([${ac_cv_c_tclh}])
     3441    fi
     3442
     3443    # Convert to a native path and substitute into the output files.
     3444
     3445    INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
     3446
     3447    TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
     3448
     3449    AC_SUBST(TCL_INCLUDES)
     3450])
     3451
     3452#------------------------------------------------------------------------
     3453# TEA_PRIVATE_TK_HEADERS --
     3454#
     3455#       Locate the private Tk include files
     3456#
     3457# Arguments:
     3458#
     3459#       Requires:
     3460#               TK_SRC_DIR      Assumes that TEA_LOAD_TKCONFIG has
     3461#                                already been called.
     3462#
     3463# Results:
     3464#
     3465#       Substs the following vars:
     3466#               TK_INCLUDES
     3467#------------------------------------------------------------------------
     3468
     3469AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
     3470    AC_MSG_CHECKING([for Tk private include files])
     3471
     3472    TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
     3473    TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
     3474    TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
     3475    TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
     3476    TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
     3477    TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
     3478    if test "${TEA_PLATFORM}" = "windows"; then
     3479        TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
     3480    else
     3481        TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
     3482    fi
     3483    # We want to ensure these are substituted so as not to require
     3484    # any *_NATIVE vars be defined in the Makefile
     3485    TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
     3486    if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
     3487        -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
     3488        TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}"
     3489    fi
     3490    if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
     3491        TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx"
     3492    fi
     3493    if test "`uname -s`" = "Darwin"; then
     3494        # If Tk was built as a framework, attempt to use
     3495        # the framework's Headers and PrivateHeaders directories
     3496        case ${TK_DEFS} in
     3497            *TK_FRAMEWORK*)
     3498                if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then
     3499                TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi
     3500                ;;
     3501        esac
     3502    fi
     3503
     3504    AC_SUBST(TK_TOP_DIR_NATIVE)
     3505    AC_SUBST(TK_UNIX_DIR_NATIVE)
     3506    AC_SUBST(TK_WIN_DIR_NATIVE)
     3507    AC_SUBST(TK_GENERIC_DIR_NATIVE)
     3508    AC_SUBST(TK_XLIB_DIR_NATIVE)
     3509    AC_SUBST(TK_PLATFORM_DIR_NATIVE)
     3510
     3511    AC_SUBST(TK_INCLUDES)
     3512    AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}])
     3513])
     3514
     3515#------------------------------------------------------------------------
     3516# TEA_PUBLIC_TK_HEADERS --
     3517#
     3518#       Locate the installed public Tk header files
     3519#
     3520# Arguments:
     3521#       None.
     3522#
     3523# Requires:
     3524#       CYGPATH must be set
     3525#
     3526# Results:
     3527#
     3528#       Adds a --with-tkinclude switch to configure.
     3529#       Result is cached.
     3530#
     3531#       Substs the following vars:
     3532#               TK_INCLUDES
     3533#------------------------------------------------------------------------
     3534
     3535AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
     3536    AC_MSG_CHECKING([for Tk public headers])
     3537
     3538    AC_ARG_WITH(tkinclude, [  --with-tkinclude      directory containing the public Tk header files.], with_tkinclude=${withval})
     3539
     3540    AC_CACHE_VAL(ac_cv_c_tkh, [
     3541        # Use the value from --with-tkinclude, if it was given
     3542
     3543        if test x"${with_tkinclude}" != x ; then
     3544            if test -f "${with_tkinclude}/tk.h" ; then
     3545                ac_cv_c_tkh=${with_tkinclude}
     3546            else
     3547                AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
     3548            fi
     3549        else
     3550            if test "`uname -s`" = "Darwin"; then
     3551                # If Tk was built as a framework, attempt to use
     3552                # the framework's Headers directory.
     3553                case ${TK_DEFS} in
     3554                    *TK_FRAMEWORK*)
     3555                        list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
     3556                        ;;
     3557                esac
     3558            fi
     3559
     3560            # Look in the source dir only if Tk is not installed,
     3561            # and in that situation, look there before installed locations.
     3562            if test -f "${TK_BIN_DIR}/Makefile" ; then
     3563                list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
     3564            fi
     3565
     3566            # Check order: pkg --prefix location, Tk's --prefix location,
     3567            # relative to directory of tkConfig.sh, Tcl's --prefix location,
     3568            # relative to directory of tclConfig.sh.
     3569
     3570            eval "temp_includedir=${includedir}"
     3571            list="$list \
     3572                `ls -d ${temp_includedir}        2>/dev/null` \
     3573                `ls -d ${TK_PREFIX}/include      2>/dev/null` \
     3574                `ls -d ${TK_BIN_DIR}/../include  2>/dev/null` \
     3575                `ls -d ${TCL_PREFIX}/include     2>/dev/null` \
     3576                `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
     3577            if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
     3578                list="$list /usr/local/include /usr/include"
     3579            fi
     3580            for i in $list ; do
     3581                if test -f "$i/tk.h" ; then
     3582                    ac_cv_c_tkh=$i
     3583                    break
     3584                fi
     3585            done
     3586        fi
     3587    ])
     3588
     3589    # Print a message based on how we determined the include path
     3590
     3591    if test x"${ac_cv_c_tkh}" = x ; then
     3592        AC_MSG_ERROR([tk.h not found.  Please specify its location with --with-tkinclude])
     3593    else
     3594        AC_MSG_RESULT([${ac_cv_c_tkh}])
     3595    fi
     3596
     3597    # Convert to a native path and substitute into the output files.
     3598
     3599    INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
     3600
     3601    TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
     3602
     3603    AC_SUBST(TK_INCLUDES)
     3604
     3605    if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
     3606        -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
     3607        # On Windows and Aqua, we need the X compat headers
     3608        AC_MSG_CHECKING([for X11 header files])
     3609        if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
     3610            INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
     3611            TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
     3612            AC_SUBST(TK_XINCLUDES)
     3613        fi
     3614        AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
     3615    fi
     3616])
     3617
     3618#------------------------------------------------------------------------
     3619# TEA_PROG_TCLSH
     3620#       Determine the fully qualified path name of the tclsh executable
     3621#       in the Tcl build directory or the tclsh installed in a bin
     3622#       directory. This macro will correctly determine the name
     3623#       of the tclsh executable even if tclsh has not yet been
     3624#       built in the build directory. The tclsh found is always
     3625#       associated with a tclConfig.sh file. This tclsh should be used
     3626#       only for running extension test cases. It should never be
     3627#       or generation of files (like pkgIndex.tcl) at build time.
     3628#
     3629# Arguments
     3630#       none
     3631#
     3632# Results
     3633#       Subst's the following values:
     3634#               TCLSH_PROG
     3635#------------------------------------------------------------------------
     3636
     3637AC_DEFUN([TEA_PROG_TCLSH], [
     3638    AC_MSG_CHECKING([for tclsh])
     3639    if test -f "${TCL_BIN_DIR}/Makefile" ; then
     3640        # tclConfig.sh is in Tcl build directory
     3641        if test "${TEA_PLATFORM}" = "windows"; then
     3642            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
     3643        else
     3644            TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
     3645        fi
     3646    else
     3647        # tclConfig.sh is in install location
     3648        if test "${TEA_PLATFORM}" = "windows"; then
     3649            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
     3650        else
     3651            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
     3652        fi
     3653        list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
     3654              `ls -d ${TCL_BIN_DIR}/..     2>/dev/null` \
     3655              `ls -d ${TCL_PREFIX}/bin     2>/dev/null`"
     3656        for i in $list ; do
     3657            if test -f "$i/${TCLSH_PROG}" ; then
     3658                REAL_TCL_BIN_DIR="`cd "$i"; pwd`"
     3659                break
     3660            fi
     3661        done
     3662        TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}"
     3663    fi
     3664    AC_MSG_RESULT([${TCLSH_PROG}])
     3665    AC_SUBST(TCLSH_PROG)
     3666])
     3667
     3668#------------------------------------------------------------------------
     3669# TEA_PROG_WISH
     3670#       Determine the fully qualified path name of the wish executable
     3671#       in the Tk build directory or the wish installed in a bin
     3672#       directory. This macro will correctly determine the name
     3673#       of the wish executable even if wish has not yet been
     3674#       built in the build directory. The wish found is always
     3675#       associated with a tkConfig.sh file. This wish should be used
     3676#       only for running extension test cases. It should never be
     3677#       or generation of files (like pkgIndex.tcl) at build time.
     3678#
     3679# Arguments
     3680#       none
     3681#
     3682# Results
     3683#       Subst's the following values:
     3684#               WISH_PROG
     3685#------------------------------------------------------------------------
     3686
     3687AC_DEFUN([TEA_PROG_WISH], [
     3688    AC_MSG_CHECKING([for wish])
     3689    if test -f "${TK_BIN_DIR}/Makefile" ; then
     3690        # tkConfig.sh is in Tk build directory
     3691        if test "${TEA_PLATFORM}" = "windows"; then
     3692            WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
     3693        else
     3694            WISH_PROG="${TK_BIN_DIR}/wish"
     3695        fi
     3696    else
     3697        # tkConfig.sh is in install location
     3698        if test "${TEA_PLATFORM}" = "windows"; then
     3699            WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
     3700        else
     3701            WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
     3702        fi
     3703        list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
     3704              `ls -d ${TK_BIN_DIR}/..     2>/dev/null` \
     3705              `ls -d ${TK_PREFIX}/bin     2>/dev/null`"
     3706        for i in $list ; do
     3707            if test -f "$i/${WISH_PROG}" ; then
     3708                REAL_TK_BIN_DIR="`cd "$i"; pwd`"
     3709                break
     3710            fi
     3711        done
     3712        WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}"
     3713    fi
     3714    AC_MSG_RESULT([${WISH_PROG}])
     3715    AC_SUBST(WISH_PROG)
     3716])
     3717
     3718#------------------------------------------------------------------------
     3719# TEA_PATH_CONFIG --
     3720#
     3721#       Locate the ${1}Config.sh file and perform a sanity check on
     3722#       the ${1} compile flags.  These are used by packages like
     3723#       [incr Tk] that load *Config.sh files from more than Tcl and Tk.
     3724#
     3725# Arguments:
     3726#       none
     3727#
     3728# Results:
     3729#
     3730#       Adds the following arguments to configure:
     3731#               --with-$1=...
     3732#
     3733#       Defines the following vars:
     3734#               $1_BIN_DIR      Full path to the directory containing
     3735#                               the $1Config.sh file
     3736#------------------------------------------------------------------------
     3737
     3738AC_DEFUN([TEA_PATH_CONFIG], [
     3739    #
     3740    # Ok, lets find the $1 configuration
     3741    # First, look for one uninstalled.
     3742    # the alternative search directory is invoked by --with-$1
     3743    #
     3744
     3745    if test x"${no_$1}" = x ; then
     3746        # we reset no_$1 in case something fails here
     3747        no_$1=true
     3748        AC_ARG_WITH($1, [  --with-$1              directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
     3749        AC_MSG_CHECKING([for $1 configuration])
     3750        AC_CACHE_VAL(ac_cv_c_$1config,[
     3751
     3752            # First check to see if --with-$1 was specified.
     3753            if test x"${with_$1config}" != x ; then
     3754                case ${with_$1config} in
     3755                    */$1Config.sh )
     3756                        if test -f ${with_$1config}; then
     3757                            AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
     3758                            with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
     3759                        fi;;
     3760                esac
     3761                if test -f "${with_$1config}/$1Config.sh" ; then
     3762                    ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
     3763                else
     3764                    AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
     3765                fi
     3766            fi
     3767
     3768            # then check for a private $1 installation
     3769            if test x"${ac_cv_c_$1config}" = x ; then
    19683770                for i in \
    1969                         `ls -d ${temp_includedir} 2>/dev/null` \
    1970                         /usr/local/include /usr/include ; do
    1971                     if test -f "$i/tcl.h" ; then
    1972                         ac_cv_c_tclh=$i
     3771                        ../$1 \
     3772                        `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
     3773                        `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
     3774                        `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
     3775                        `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
     3776                        ../../$1 \
     3777                        `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
     3778                        `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
     3779                        `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
     3780                        `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
     3781                        ../../../$1 \
     3782                        `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
     3783                        `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
     3784                        `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
     3785                        `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
     3786                        ${srcdir}/../$1 \
     3787                        `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
     3788                        `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
     3789                        `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
     3790                        `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
     3791                        ; do
     3792                    if test -f "$i/$1Config.sh" ; then
     3793                        ac_cv_c_$1config=`(cd $i; pwd)`
     3794                        break
     3795                    fi
     3796                    if test -f "$i/unix/$1Config.sh" ; then
     3797                        ac_cv_c_$1config=`(cd $i/unix; pwd)`
    19733798                        break
    19743799                    fi
    19753800                done
    19763801            fi
     3802
     3803            # check in a few common install locations
     3804            if test x"${ac_cv_c_$1config}" = x ; then
     3805                for i in `ls -d ${libdir} 2>/dev/null` \
     3806                        `ls -d ${exec_prefix}/lib 2>/dev/null` \
     3807                        `ls -d ${prefix}/lib 2>/dev/null` \
     3808                        `ls -d /usr/local/lib 2>/dev/null` \
     3809                        `ls -d /usr/contrib/lib 2>/dev/null` \
     3810                        `ls -d /usr/lib 2>/dev/null` \
     3811                        ; do
     3812                    if test -f "$i/$1Config.sh" ; then
     3813                        ac_cv_c_$1config=`(cd $i; pwd)`
     3814                        break
     3815                    fi
     3816                done
     3817            fi
    19773818        ])
    1978     fi
    1979 
    1980     # Print a message based on how we determined the include path
    1981 
    1982     if test x"${ac_cv_c_tclh}" = x ; then
    1983         AC_MSG_ERROR(tcl.h not found.  Please specify its location with --with-tclinclude)
     3819
     3820        if test x"${ac_cv_c_$1config}" = x ; then
     3821            $1_BIN_DIR="# no $1 configs found"
     3822            AC_MSG_WARN([Cannot find $1 configuration definitions])
     3823            exit 0
     3824        else
     3825            no_$1=
     3826            $1_BIN_DIR=${ac_cv_c_$1config}
     3827            AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
     3828        fi
     3829    fi
     3830])
     3831
     3832#------------------------------------------------------------------------
     3833# TEA_LOAD_CONFIG --
     3834#
     3835#       Load the $1Config.sh file
     3836#
     3837# Arguments:
     3838#       
     3839#       Requires the following vars to be set:
     3840#               $1_BIN_DIR
     3841#
     3842# Results:
     3843#
     3844#       Subst the following vars:
     3845#               $1_SRC_DIR
     3846#               $1_LIB_FILE
     3847#               $1_LIB_SPEC
     3848#
     3849#------------------------------------------------------------------------
     3850
     3851AC_DEFUN([TEA_LOAD_CONFIG], [
     3852    AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
     3853
     3854    if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
     3855        AC_MSG_RESULT([loading])
     3856        . ${$1_BIN_DIR}/$1Config.sh
    19843857    else
    1985         AC_MSG_RESULT(${ac_cv_c_tclh})
    1986     fi
    1987 
    1988     # Convert to a native path and substitute into the output files.
    1989 
    1990     INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
    1991 
    1992     TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
    1993 
    1994     AC_SUBST(TCL_INCLUDES)
    1995 ])
     3858        AC_MSG_RESULT([file not found])
     3859    fi
     3860
     3861    #
     3862    # If the $1_BIN_DIR is the build directory (not the install directory),
     3863    # then set the common variable name to the value of the build variables.
     3864    # For example, the variable $1_LIB_SPEC will be set to the value
     3865    # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
     3866    # instead of $1_BUILD_LIB_SPEC since it will work with both an
     3867    # installed and uninstalled version of Tcl.
     3868    #
     3869
     3870    if test -f ${$1_BIN_DIR}/Makefile ; then
     3871        AC_MSG_WARN([Found Makefile - using build library specs for $1])
     3872        $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
     3873        $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
     3874        $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
     3875    fi
     3876
     3877    AC_SUBST($1_VERSION)
     3878    AC_SUBST($1_BIN_DIR)
     3879    AC_SUBST($1_SRC_DIR)
     3880
     3881    AC_SUBST($1_LIB_FILE)
     3882    AC_SUBST($1_LIB_SPEC)
     3883
     3884    AC_SUBST($1_STUB_LIB_FILE)
     3885    AC_SUBST($1_STUB_LIB_SPEC)
     3886    AC_SUBST($1_STUB_LIB_PATH)
     3887])
     3888
     3889#------------------------------------------------------------------------
     3890# TEA_PATH_CELIB --
     3891#
     3892#       Locate Keuchel's celib emulation layer for targeting Win/CE
     3893#
     3894# Arguments:
     3895#       none
     3896#
     3897# Results:
     3898#
     3899#       Adds the following arguments to configure:
     3900#               --with-celib=...
     3901#
     3902#       Defines the following vars:
     3903#               CELIB_DIR       Full path to the directory containing
     3904#                               the include and platform lib files
     3905#------------------------------------------------------------------------
     3906
     3907AC_DEFUN([TEA_PATH_CELIB], [
     3908    # First, look for one uninstalled.
     3909    # the alternative search directory is invoked by --with-celib
     3910
     3911    if test x"${no_celib}" = x ; then
     3912        # we reset no_celib in case something fails here
     3913        no_celib=true
     3914        AC_ARG_WITH(celib,[  --with-celib=DIR        use Windows/CE support library from DIR], with_celibconfig=${withval})
     3915        AC_MSG_CHECKING([for Windows/CE celib directory])
     3916        AC_CACHE_VAL(ac_cv_c_celibconfig,[
     3917            # First check to see if --with-celibconfig was specified.
     3918            if test x"${with_celibconfig}" != x ; then
     3919                if test -d "${with_celibconfig}/inc" ; then
     3920                    ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
     3921                else
     3922                    AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
     3923                fi
     3924            fi
     3925
     3926            # then check for a celib library
     3927            if test x"${ac_cv_c_celibconfig}" = x ; then
     3928                for i in \
     3929                        ../celib-palm-3.0 \
     3930                        ../celib \
     3931                        ../../celib-palm-3.0 \
     3932                        ../../celib \
     3933                        `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
     3934                        ${srcdir}/../celib-palm-3.0 \
     3935                        ${srcdir}/../celib \
     3936                        `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
     3937                        ; do
     3938                    if test -d "$i/inc" ; then
     3939                        ac_cv_c_celibconfig=`(cd $i; pwd)`
     3940                        break
     3941                    fi
     3942                done
     3943            fi
     3944        ])
     3945        if test x"${ac_cv_c_celibconfig}" = x ; then
     3946            AC_MSG_ERROR([Cannot find celib support library directory])
     3947        else
     3948            no_celib=
     3949            CELIB_DIR=${ac_cv_c_celibconfig}
     3950            CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
     3951            AC_MSG_RESULT([found $CELIB_DIR])
     3952        fi
     3953    fi
     3954])
     3955
     3956
     3957# Local Variables:
     3958# mode: autoconf
     3959# End:
Note: See TracChangeset for help on using the changeset viewer.