Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updated TEA for tdom core. tcldomsh seg fault makes that retarded.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tea-update
Files: files | file ages | folders
SHA1: f5d136bd2fe656636f6e965268180f4671ac4c81
User & Date: rolf 2013-06-06 01:49:01
Context
2013-06-08
12:15
Started tea update of extensions. check-in: d0ce231bf9 user: rolf tags: tea-update
2013-06-06
01:49
Updated TEA for tdom core. tcldomsh seg fault makes that retarded. check-in: f5d136bd2f user: rolf tags: tea-update
2013-05-16
00:03
Update to expat 2.1.0. check-in: 90dd28722d user: rolf tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

     7      7   #	replaced in the actual Makefile.
     8      8   #
     9      9   # Copyright (c) 1999 Scriptics Corporation.
    10     10   # Copyright (c) 2002-2005 ActiveState Corporation.
    11     11   #
    12     12   # See the file "license.terms" for information on usage and redistribution
    13     13   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14         -#
    15         -# RCS: @(#) $Id$
    16     14   
    17     15   #========================================================================
    18     16   # Add additional lines to handle any additional AC_SUBST cases that
    19     17   # have been added in a customized configure script.
    20     18   #========================================================================
    21     19   
    22     20   AOL_DIR		= @AOL_DIR@
................................................................................
    68     66   # "PKG_LIB_FILE" refers to the library (dynamic or static as per
    69     67   # configuration options) composed of the named objects.
    70     68   #========================================================================
    71     69   
    72     70   PKG_LIB_FILE	= @PKG_LIB_FILE@
    73     71   PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
    74     72   
    75         -lib_BINARIES	= $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE)
           73  +lib_BINARIES	= $(PKG_LIB_FILE)
    76     74   BINARIES	= $(lib_BINARIES)
    77     75   
    78     76   SHELL		= @SHELL@
    79     77   
    80     78   srcdir		= @srcdir@
    81     79   prefix		= @prefix@
    82     80   exec_prefix	= @exec_prefix@
    83     81   
    84     82   bindir		= @bindir@
    85     83   libdir		= @libdir@
           84  +includedir	= @includedir@
           85  +datarootdir	= @datarootdir@
    86     86   datadir		= @datadir@
    87     87   mandir		= @mandir@
    88         -includedir	= @includedir@
    89     88   
    90     89   DESTDIR		=
    91     90   
    92     91   PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
    93     92   pkgdatadir	= $(datadir)/$(PKG_DIR)
    94     93   pkglibdir	= $(libdir)/$(PKG_DIR)
    95     94   pkgincludedir	= $(includedir)/$(PKG_DIR)
    96     95   
    97     96   top_builddir	= .
    98     97   
    99         -INSTALL		= @INSTALL@
   100         -INSTALL_PROGRAM	= @INSTALL_PROGRAM@
   101         -INSTALL_DATA	= @INSTALL_DATA@
   102         -INSTALL_SCRIPT	= @INSTALL_SCRIPT@
           98  +INSTALL_OPTIONS =
           99  +INSTALL		= $(SHELL) $(srcdir)/tclconfig/install-sh -c ${INSTALL_OPTIONS}
          100  +INSTALL_DATA_DIR = ${INSTALL} -d -m 755
          101  +INSTALL_PROGRAM	= ${INSTALL} -m 555
          102  +INSTALL_DATA	= ${INSTALL} -m 444
          103  +INSTALL_SCRIPT	= ${INSTALL_PROGRAM}
          104  +INSTALL_LIBRARY	= ${INSTALL_DATA}
   103    105   
   104    106   PACKAGE_NAME	= @PACKAGE_NAME@
   105    107   PACKAGE_VERSION	= @PACKAGE_VERSION@
   106    108   CC		= @CC@
   107    109   CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
   108    110   CFLAGS_WARNING	= @CFLAGS_WARNING@
   109         -CLEANFILES	= @CLEANFILES@
   110    111   EXEEXT		= @EXEEXT@
   111    112   LDFLAGS_DEFAULT	= @LDFLAGS_DEFAULT@
   112    113   MAKE_LIB	= @MAKE_LIB@
   113    114   MAKE_SHARED_LIB	= @MAKE_SHARED_LIB@
   114    115   MAKE_STATIC_LIB	= @MAKE_STATIC_LIB@
   115    116   MAKE_STUB_LIB	= @MAKE_STUB_LIB@
   116    117   OBJEXT		= @OBJEXT@
................................................................................
   121    122   SHLIB_LD_LIBS	= @SHLIB_LD_LIBS@
   122    123   STLIB_LD	= @STLIB_LD@
   123    124   #TCL_DEFS	= @TCL_DEFS@
   124    125   TCL_BIN_DIR	= @TCL_BIN_DIR@
   125    126   TCL_SRC_DIR	= @TCL_SRC_DIR@
   126    127   #TK_BIN_DIR	= @TK_BIN_DIR@
   127    128   #TK_SRC_DIR	= @TK_SRC_DIR@
          129  +
          130  +MATH_LIBS	= @MATH_LIBS@
   128    131   
   129    132   # Not used, but retained for reference of what libs Tcl required
   130    133   #TCL_LIBS	= @TCL_LIBS@
          134  +
          135  +TDOMSHELL_LIBS = @TCL_LIBS@ @SHLIB_LD_LIBS@
   131    136   
   132    137   #========================================================================
   133    138   # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
   134    139   # package without installing.  The other environment variables allow us
   135    140   # to test against an uninstalled Tcl.  Add special env vars that you
   136    141   # require for testing here (like TCLX_LIBRARY).
   137    142   #========================================================================
   138    143   
   139    144   EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR)
   140    145   #EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
   141    146   TCLLIBPATH	= $(top_builddir)
   142         -TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
   143         -		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
          147  +TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library`
          148  +PKG_ENV		= @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
   144    149   		  PATH="$(EXTRA_PATH):$(PATH)" \
   145    150   		  TCLLIBPATH="$(TCLLIBPATH)"
   146         -#		  TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library`
   147    151   
   148    152   TCLSH_PROG	= @TCLSH_PROG@
   149         -TCLSH   	= $(TCLSH_ENV) $(TCLSH_PROG)
          153  +TCLSH		= $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG)
   150    154   
          155  +#WISH_ENV	= TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library`
   151    156   #WISH_PROG	= @WISH_PROG@
   152         -#WISH   	= $(TCLSH_ENV) $(WISH_PROG)
   153         -
          157  +#WISH		= $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG)
   154    158   
   155    159   SHARED_BUILD	= @SHARED_BUILD@
   156    160   
   157    161   INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@
   158    162   #INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
   159    163   
   160    164   PKG_CFLAGS	= @PKG_CFLAGS@
................................................................................
   163    167   # must make sure that configure.in checks for the necessary components
   164    168   # that your library may use.  TCL_DEFS can actually be a problem if
   165    169   # you do not compile with a similar machine setup as the Tcl core was
   166    170   # compiled with.
   167    171   #DEFS		= $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
   168    172   DEFS		= @DEFS@ $(PKG_CFLAGS)
   169    173   
   170         -CONFIG_CLEAN_FILES = Makefile tdomConfig.sh tdom.tcl
          174  +# Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile
          175  +CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl
          176  +CLEANFILES	= @CLEANFILES@
   171    177   
   172    178   CPPFLAGS	= @CPPFLAGS@
   173    179   LIBS		= @PKG_LIBS@ @LIBS@
   174    180   AR		= @AR@
   175    181   CFLAGS		= @CFLAGS@
   176    182   COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
          183  +
          184  +.SUFFIXES: .c .$(OBJEXT)
   177    185   
   178    186   #========================================================================
   179    187   # Start of user-definable TARGETS section
   180    188   #========================================================================
   181    189   
   182    190   #========================================================================
   183    191   # TEA TARGETS.  Please note that the "libraries:" target refers to platform
   184         -# independent files, and the "binaries:" target inclues executable programs and
          192  +# independent files, and the "binaries:" target includes executable programs and
   185    193   # platform-dependent libraries.  Modify these targets so that they install
   186    194   # the various pieces of your package.  The make and install rules
   187    195   # for the BINARIES that you specified above have already been done.
   188    196   #========================================================================
   189    197   
   190    198   all: binaries libraries doc
   191    199   
   192    200   #========================================================================
   193    201   # TDOM enabled shell is build as an extra directive, since non TEA. 
   194    202   #========================================================================
   195    203   
   196         -$(TDOMSHELL): $(PKG_OBJECTS)
          204  +$(TDOMSHELL): $(PKG_OBJECTS) $(srcdir)/unix/tclAppInit.c
   197    205   	$(COMPILE) -c `@CYGPATH@ $(srcdir)/unix/tclAppInit.c`
   198    206   	$(CC) @LDFLAGS@ -o $@ tclAppInit.$(OBJEXT) $(PKG_OBJECTS) \
   199         -	  $(TCL_LIBS) $(TCL_LIB_SPEC) $(LIBS) $(TDOM_LD_SEARCH_FLAGS)
          207  +	  $(TCL_LIB_SPEC) $(TDOMSHELL_LIBS) $(TDOM_LD_SEARCH_FLAGS)
   200    208   
   201    209   #========================================================================
   202    210   # The binaries target builds executable programs, Windows .dll's, unix
   203    211   # shared/static libraries, and any other platform-dependent files.
   204    212   # The list of targets to build for "binaries:" is specified at the top
   205    213   # of the Makefile, in the "BINARIES" variable.
   206    214   #========================================================================
   207    215   
   208    216   binaries: $(BINARIES) pkgIndex.tcl-hand
   209    217   
   210    218   libraries:
   211         -
   212    219   
   213    220   #========================================================================
   214    221   # Your doc target should differentiate from doc builds (by the developer)
   215    222   # and doc installs (see install-doc), which just install the docs on the
   216    223   # end user machine when building from source.
   217    224   #========================================================================
   218    225   
................................................................................
   224    231   
   225    232   #========================================================================
   226    233   # This rule installs platform-independent files, such as header files.
   227    234   # The list=...; for p in $$list handles the empty list case x-platform.
   228    235   #========================================================================
   229    236   
   230    237   install-libraries: libraries
   231         -	@mkdir -p $(DESTDIR)$(includedir)
          238  +	@$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir)
   232    239   	@echo "Installing header files in $(DESTDIR)$(includedir)"
   233    240   	@list='$(PKG_HEADERS)'; for i in $$list; do \
   234    241   	    echo "Installing $(srcdir)/$$i" ; \
   235    242   	    $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
   236    243   	done;
   237    244   
   238    245   #========================================================================
   239    246   # Install documentation.  Unix manpages should go in the $(mandir)
   240    247   # directory.
   241    248   #========================================================================
   242    249   
   243    250   install-doc: doc
   244         -	@mkdir -p $(DESTDIR)$(mandir)/mann
          251  +	@$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann
   245    252   	@echo "Installing documentation in $(DESTDIR)$(mandir)"
   246    253   	@list='$(srcdir)/doc/*.n'; for i in $$list; do \
   247    254   	    echo "Installing $$i"; \
   248         -	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
   249    255   	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
   250    256   	done
   251    257   
   252    258   test: binaries libraries
   253    259   	@cp $(srcdir)/lib/tdom.tcl .
   254    260   	$(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
   255    261   
   256    262   shell: binaries libraries
   257    263   	@$(TCLSH) $(SCRIPT)
   258    264   
   259    265   gdb:
   260    266   	$(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
          267  +
          268  +VALGRINDARGS =	--tool=memcheck --num-callers=8 --leak-resolution=high \
          269  +		--leak-check=yes --show-reachable=yes -v
          270  +
          271  +valgrind: binaries libraries
          272  +	$(TCLSH_ENV) valgrind $(VALGRINDARGS) $(TCLSH_PROG) \
          273  +		`@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
          274  +
          275  +valgrindshell: binaries libraries
          276  +	$(TCLSH_ENV) valgrind $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT)
   261    277   
   262    278   depend:
   263    279   
   264    280   #========================================================================
   265    281   # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
   266    282   # mentioned above.  That will ensure that this target is built when you
   267    283   # run "make binaries".
................................................................................
   292    308   # 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
   293    309   #
   294    310   # Setting the VPATH variable to a list of paths will cause the makefile
   295    311   # to look into these paths when resolving .c to .obj dependencies.
   296    312   # As necessary, add $(srcdir):$(srcdir)/compat:....
   297    313   #========================================================================
   298    314   
   299         -VPATH = $(srcdir):$(srcdir)/expat:$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win
          315  +VPATH = $(srcdir):$(srcdir)/expat:$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx
   300    316   
   301    317   .c.@OBJEXT@:
   302    318   	$(COMPILE) -c `@CYGPATH@ $<` -o $@
   303    319   
   304    320   #========================================================================
   305    321   # Create the pkgIndex.tcl file.
   306    322   #========================================================================
................................................................................
   313    329   
   314    330   #========================================================================
   315    331   # Distribution creation
   316    332   # You may need to tweak this target to make it work correctly.
   317    333   #========================================================================
   318    334   
   319    335   #COMPRESS	= tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
   320         -COMPRESS	= gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
          336  +COMPRESS	= tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
   321    337   DIST_ROOT	= /tmp/dist
   322    338   DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)
   323    339   
   324    340   dist-clean:
   325    341   	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
   326    342   
   327    343   dist: dist-clean
................................................................................
   359    375   #========================================================================
   360    376   
   361    377   #========================================================================
   362    378   # Don't modify the file to clean here.  Instead, set the "CLEANFILES"
   363    379   # variable in configure.in
   364    380   #========================================================================
   365    381   
   366         -clean:  
          382  +clean:
   367    383   	-test -z "$(BINARIES)" || rm -f $(BINARIES)
   368    384   	-rm -f *.$(OBJEXT) core *.core
   369    385   	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
   370    386   
   371    387   distclean: clean
   372    388   	-rm -f *.tab.c
   373    389   	-rm -f $(CONFIG_CLEAN_FILES)
................................................................................
   381    397   # In addition, this will generate the pkgIndex.tcl
   382    398   # file in the install location (assuming it can find a usable tclsh shell)
   383    399   #
   384    400   # You should not have to modify this target.
   385    401   #========================================================================
   386    402   
   387    403   install-lib-binaries: binaries
   388         -	@mkdir -p $(DESTDIR)$(pkglibdir)
          404  +	@$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir)
   389    405   	@list='$(lib_BINARIES)'; for p in $$list; do \
   390    406   	  if test -f $$p; then \
   391         -	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
   392         -	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
          407  +	    echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
          408  +	    $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \
   393    409   	    stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
   394    410   	    if test "x$$stub" = "xstub"; then \
   395    411   		echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
   396    412   		$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
   397    413   	    else \
   398    414   		echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
   399    415   		$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
................................................................................
   415    431   	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
   416    432   	  fi; \
   417    433   	done
   418    434   	@if test "x$(SHARED_BUILD)" = "x1"; then \
   419    435   	    echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
   420    436   	    $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \
   421    437   	fi
   422         -	$(INSTALL_DATA) tdomConfig.sh $(DESTDIR)$(libdir)
   423    438   
   424    439   #========================================================================
   425    440   # Install binary executables (e.g. .exe files and dependent .dll files)
   426    441   # This is for files that must go in the bin directory (located next to
   427    442   # wish and tclsh), like dependent .dll files on Windows.
   428    443   #
   429    444   # You should not have to modify this target, except to define bin_BINARIES
   430    445   # above if necessary.
   431    446   #========================================================================
   432    447   
   433    448   install-bin-binaries: binaries
   434         -	@mkdir -p $(DESTDIR)$(bindir)
          449  +	@$(INSTALL_DATA_DIR) $(DESTDIR)$(bindir)
   435    450   	@list='$(bin_BINARIES)'; for p in $$list; do \
   436    451   	  if test -f $$p; then \
   437    452   	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
   438    453   	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
   439    454   	  fi; \
   440    455   	done
   441    456   
   442         -.SUFFIXES: .c .$(OBJEXT)
   443         -
   444    457   Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
   445    458   	cd $(top_builddir) \
   446    459   	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
   447    460   
   448    461   uninstall-binaries:
   449    462   	list='$(lib_BINARIES)'; for p in $$list; do \
   450    463   	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \

Changes to README.

    57     57           make 
    58     58           make test
    59     59           make install
    60     60   
    61     61       Alternatively, you can build the tDOM package in just about any
    62     62       directory elsewhere on the fileystem (since TEA-compatible).
    63     63       
    64         -    NOTE: Be sure to have the CC=gcc defined if you're using GCC.
    65         -
    66     64       You might also want to do "../configure --help" to get list of all
    67     65       supported options of the configure script. In the "unix" directory
    68     66       there is a "CONFIG" file containing some examples on how to invoke
    69     67       the "configure" script for some common cases. You can peek
    70     68       there. This file also includes a short description of the tDOM
    71     69       specific configure options.
    72     70   
    73     71       Since tDOM is TEA-compatible you should be able to build it using
    74     72       the MinGW build environment for Windows. There is also the MSVC
    75     73       nmake file so you can compile the package with Microsoft tools.
    76     74   
    77     75       The compile process will build the tDOM shared library suitable for
    78     76       loading into the Tcl shell using standard "package require" mechanism.
    79         -    Optionally the make process can also generate the "tcldomsh" 
    80         -    executable shell with tDOM functionality built-in. You can use this
    81         -    shell as any other Tcl shell. To do this, you have to:
    82         -
    83         -        make tcldomsh
    84         -
    85         -    Note, however, that this step is optional.
    86         -
    87         -
    88         -    Note for Tcl 8.0.5 users:
    89         -    -------------------------
    90         -
    91         -    Per default, this release of tDOM links against Tcl stubs
    92         -    library. To build it against Tcl8.0.5, use the configure-tcl8.0.5
    93         -    script to generate the Makefile.
    94         -
    95         -    If you want to recreate the configure script for building against
    96         -    Tcl8.0.5 please edit the "configure.in" file in this directory,
    97         -    comment-out the AC_DEFINE(USE_TCL_STUBS) directive and run
    98         -    autoconf. Please be sure to use autoconf with version 2.59.
    99         -
   100         -
   101         -PLATFORMS
   102         -    HP-UX-10.20                  (both ansi cc and gcc)
   103         -    HP-UX-9.x
   104         -    Linux 2.2.5                  (egcs 2.91.66, SuSE 6.1)
   105         -    Solaris 2.5.1+               (both gcc and SunWorks compilers)
   106         -    W2K                          (VC++ 6.0)
   107         -    Mac OS X 10.2.6              (Apple's gcc)
   108         -
   109         -    Other machines and OS's are not tested but should work too. 
   110     77   
   111     78   Have fun! 
   112     79   
   113     80   - EOF -

Changes to configure.

more than 10,000 changes

Changes to configure.in.

     1      1   #!/bin/bash -norc
     2      2   dnl	This file is an input file used by the GNU "autoconf" program to
     3      3   dnl	generate the file "configure", which is run during Tcl installation
     4      4   dnl	to configure the system for the local environment.
     5         -#
     6         -# RCS: @(#) $Id$
     7      5   
     8      6   #-----------------------------------------------------------------------
     9      7   # Sample configure.in for Tcl Extensions.  The only places you should
    10      8   # need to modify this file are marked by the string __CHANGE__
    11      9   #-----------------------------------------------------------------------
    12     10   
    13     11   #-----------------------------------------------------------------------
    14     12   # __CHANGE__
    15     13   # Set your package name and version numbers here.
    16     14   #
    17     15   # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
    18     16   # set as provided.  These will also be added as -D defs in your Makefile
    19     17   # so you can encode the package version directly into the source files.
           18  +# This will also define a special symbol for Windows (BUILD_sample in
           19  +# this case) so that we create the export library with the dll.
    20     20   #-----------------------------------------------------------------------
    21     21   
    22     22   AC_INIT([tdom], [0.8.3])
    23     23   
    24     24   #--------------------------------------------------------------------
    25     25   # Call TEA_INIT as the first TEA_ macro to set up initial vars.
    26     26   # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
    27     27   # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
    28     28   #--------------------------------------------------------------------
    29     29   
    30         -TEA_INIT([3.6])
           30  +TEA_INIT([3.9])
    31     31   
    32     32   AC_CONFIG_AUX_DIR(tclconfig)
    33     33   
    34     34   #--------------------------------------------------------------------
    35     35   # Load the tclConfig.sh file
    36     36   #--------------------------------------------------------------------
    37     37   
................................................................................
    51     51   #-----------------------------------------------------------------------
    52     52   
    53     53   TEA_PREFIX
    54     54   
    55     55   #-----------------------------------------------------------------------
    56     56   # Standard compiler checks.
    57     57   # This sets up CC by using the CC env var, or looks for gcc otherwise.
    58         -# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
    59         -# the basic setup necessary to compile executables.
           58  +# This also calls AC_PROG_CC and a few others to create the basic setup
           59  +# necessary to compile executables.
    60     60   #-----------------------------------------------------------------------
    61     61   
    62     62   TEA_SETUP_COMPILER
    63     63   
    64     64   #-----------------------------------------------------------------------
    65     65   # Those two are needed for compiling expat.
    66     66   #-----------------------------------------------------------------------
................................................................................
   103    103   TEA_ADD_LIBS([${AOL_LIBS}])
   104    104   TEA_ADD_CFLAGS([])
   105    105   TEA_ADD_STUB_SOURCES([generic/tdomStubLib.c])
   106    106   TEA_ADD_TCL_SOURCES([lib/tdom.tcl])
   107    107   
   108    108   #--------------------------------------------------------------------
   109    109   # __CHANGE__
   110         -# A few miscellaneous platform-specific items:
   111    110   #
   112         -# Define a special symbol for Windows (BUILD_sample in this case) so
   113         -# that we create the export library with the dll.
          111  +# You can add more files to clean if your extension creates any extra
          112  +# files by extending CLEANFILES.
          113  +# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
          114  +# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
   114    115   #
   115         -# Windows creates a few extra files that need to be cleaned up.
   116         -# You can add more files to clean if your extension creates any extra
   117         -# files.
   118         -#
          116  +# A few miscellaneous platform-specific items:
   119    117   # TEA_ADD_* any platform specific compiler/build info here.
   120    118   #--------------------------------------------------------------------
   121    119   
   122    120   if test "${TEA_PLATFORM}" = "windows" ; then
   123    121       AC_DEFINE(BUILD_tdom)
   124    122       CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
   125    123       #TEA_ADD_SOURCES([win/winFile.c])
   126    124       #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
   127    125   else
   128         -    CLEANFILES="pkgIndex.tcl tcldomsh"
          126  +    CLEANFILES="pkgIndex.tcl tdomConfig.sh tdom.tcl tcldomsh"
   129    127       #TEA_ADD_SOURCES([unix/unixFile.c])
   130    128       #TEA_ADD_LIBS([-lsuperfly])
   131    129   fi
   132    130   AC_SUBST(CLEANFILES)
   133    131   
   134    132   #--------------------------------------------------------------------
   135    133   # __CHANGE__
................................................................................
   181    179   #--------------------------------------------------------------------
   182    180   # Everyone should be linking against the Tcl stub library.  If you
   183    181   # can't for some reason, remove this definition.  If you aren't using
   184    182   # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
   185    183   # link against the non-stubbed Tcl library.  Add Tk too if necessary.
   186    184   #--------------------------------------------------------------------
   187    185   
   188         -AC_DEFINE(USE_TCL_STUBS)
   189         -#AC_DEFINE(USE_TK_STUBS)
          186  +AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
          187  +#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
   190    188   
   191    189   #--------------------------------------------------------------------
   192    190   # This macro generates a line to use when building a library.  It
   193    191   # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
   194    192   # and TEA_LOAD_TCLCONFIG macros above.
   195    193   #--------------------------------------------------------------------
   196    194   
   197    195   TEA_MAKE_LIB
   198    196   
   199    197   #--------------------------------------------------------------------
   200         -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
   201         -# file during the install process.  Don't run the TCLSH_PROG through
   202         -# ${CYGPATH} because it's being used directly by make.
   203         -# Require that we use a tclsh shell version 8.2 or later since earlier
   204         -# versions have bugs in the pkg_mkIndex routine.
   205         -# Add WISH as well if this is a Tk extension.
          198  +# Determine the name of the tclsh and/or wish executables in the
          199  +# Tcl and Tk build directories or the location they were installed
          200  +# into. These paths are used to support running test cases only,
          201  +# the Makefile should not be making use of these paths to generate
          202  +# a pkgIndex.tcl file or anything else at extension build time.
   206    203   #--------------------------------------------------------------------
   207    204   
   208    205   TEA_PROG_TCLSH
   209    206   #TEA_PROG_WISH
   210    207   
   211    208   #--------------------------------------------------------------------
   212    209   # Add some private preprocessor options

Changes to extensions/tnc/configure.in.

   108    108   
   109    109   if test "${TEA_PLATFORM}" = "windows" ; then
   110    110       AC_DEFINE(BUILD_tnc, 1, [Build windows export dll])
   111    111       CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
   112    112       #TEA_ADD_SOURCES([win/winFile.c])
   113    113       #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
   114    114   else
   115         -    CLEANFILES="pkgIndex.tcl"
          115  +    CLEANFILES="pkgIndex.tcl tdom.tcl"
   116    116       #TEA_ADD_SOURCES([unix/unixFile.c])
   117    117       #TEA_ADD_LIBS([-lsuperfly])
   118    118   fi
   119    119   AC_SUBST(CLEANFILES)
   120    120   
   121    121   #--------------------------------------------------------------------
   122    122   # __CHANGE__

Changes to tclconfig/README.txt.

     1         -The other files in this directory are the functional core of the Tcl
     2         -Extension Architecture (TEA). For more information on TEA see:
            1  +These files comprise the basic building blocks for a Tcl Extension
            2  +Architecture (TEA) extension.  For more information on TEA see:
     3      3   
     4      4   	http://www.tcl.tk/doc/tea/
     5      5   
     6         -The other files in this directory are out of the tclconfig directory
     7         -of:
            6  +This package is part of the Tcl project at SourceForge, and latest
            7  +sources should be available there:
            8  +
            9  +	http://tcl.sourceforge.net/
           10  +
           11  +This package is a freely available open source package.  You can do
           12  +virtually anything you like with it, such as modifying it, redistributing
           13  +it, and selling it either in whole or in part.
           14  +
           15  +CONTENTS
           16  +========
           17  +The following is a short description of the files you will find in
           18  +the sample extension.
           19  +
           20  +README.txt	This file
     8     21   
     9         -http://cvs.sourceforge.net/viewcvs.py/tcl/sampleextension/
           22  +install-sh	Program used for copying binaries and script files
           23  +		to their install locations.
    10     24   
    11         -from 2007-07-26 (TEA 3.6).
           25  +tcl.m4		Collection of Tcl autoconf macros.  Included by a package's
           26  +		aclocal.m4 to define TEA_* macros.

Changes to tclconfig/install-sh.

     1      1   #!/bin/sh
     2         -
     3         -#
     4      2   # install - install a program, script, or datafile
     5         -# This comes from X11R5; it is not part of GNU.
            3  +
            4  +scriptversion=2011-04-20.01; # UTC
            5  +
            6  +# This originates from X11R5 (mit/util/scripts/install.sh), which was
            7  +# later released in X11R6 (xc/config/util/install.sh) with the
            8  +# following copyright and license.
            9  +#
           10  +# Copyright (C) 1994 X Consortium
           11  +#
           12  +# Permission is hereby granted, free of charge, to any person obtaining a copy
           13  +# of this software and associated documentation files (the "Software"), to
           14  +# deal in the Software without restriction, including without limitation the
           15  +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
           16  +# sell copies of the Software, and to permit persons to whom the Software is
           17  +# furnished to do so, subject to the following conditions:
           18  +#
           19  +# The above copyright notice and this permission notice shall be included in
           20  +# all copies or substantial portions of the Software.
           21  +#
           22  +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
           23  +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
           24  +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
           25  +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
           26  +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
           27  +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
           28  +#
           29  +# Except as contained in this notice, the name of the X Consortium shall not
           30  +# be used in advertising or otherwise to promote the sale, use or other deal-
           31  +# ings in this Software without prior written authorization from the X Consor-
           32  +# tium.
           33  +#
           34  +#
           35  +# FSF changes to this file are in the public domain.
     6     36   #
     7         -# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
           37  +# Calling this script install-sh is preferred over install.sh, to prevent
           38  +# `make' implicit rules from creating a file called install from it
           39  +# when there is no Makefile.
     8     40   #
     9     41   # This script is compatible with the BSD install script, but was written
    10     42   # from scratch.
    11         -#
    12     43   
           44  +nl='
           45  +'
           46  +IFS=" ""	$nl"
    13     47   
    14     48   # set DOITPROG to echo to test this script
    15     49   
    16     50   # Don't use :- since 4.3BSD and earlier shells don't like it.
    17         -doit="${DOITPROG-}"
    18         -
    19         -
    20         -# put in absolute paths if you don't have them in your path; or use env. vars.
    21         -
    22         -mvprog="${MVPROG-mv}"
    23         -cpprog="${CPPROG-cp}"
    24         -chmodprog="${CHMODPROG-chmod}"
    25         -chownprog="${CHOWNPROG-chown}"
    26         -chgrpprog="${CHGRPPROG-chgrp}"
    27         -stripprog="${STRIPPROG-strip}"
    28         -rmprog="${RMPROG-rm}"
    29         -
    30         -instcmd="$mvprog"
    31         -chmodcmd=""
    32         -chowncmd=""
    33         -chgrpcmd=""
    34         -stripcmd=""
           51  +doit=${DOITPROG-}
           52  +if test -z "$doit"; then
           53  +  doit_exec=exec
           54  +else
           55  +  doit_exec=$doit
           56  +fi
           57  +
           58  +# Put in absolute file names if you don't have them in your path;
           59  +# or use environment vars.
           60  +
           61  +chgrpprog=${CHGRPPROG-chgrp}
           62  +chmodprog=${CHMODPROG-chmod}
           63  +chownprog=${CHOWNPROG-chown}
           64  +cmpprog=${CMPPROG-cmp}
           65  +cpprog=${CPPROG-cp}
           66  +mkdirprog=${MKDIRPROG-mkdir}
           67  +mvprog=${MVPROG-mv}
           68  +rmprog=${RMPROG-rm}
           69  +stripprog=${STRIPPROG-strip}
           70  +
           71  +posix_glob='?'
           72  +initialize_posix_glob='
           73  +  test "$posix_glob" != "?" || {
           74  +    if (set -f) 2>/dev/null; then
           75  +      posix_glob=
           76  +    else
           77  +      posix_glob=:
           78  +    fi
           79  +  }
           80  +'
           81  +
           82  +posix_mkdir=
           83  +
           84  +# Desired mode of installed file.
           85  +mode=0755
           86  +
           87  +chgrpcmd=
           88  +chmodcmd=$chmodprog
           89  +chowncmd=
           90  +mvcmd=$mvprog
    35     91   rmcmd="$rmprog -f"
    36         -mvcmd="$mvprog"
    37         -src=""
    38         -dst=""
    39         -
    40         -while [ x"$1" != x ]; do
    41         -    case $1 in
    42         -	-c) instcmd="$cpprog"
    43         -	    shift
    44         -	    continue;;
    45         -
    46         -	-m) chmodcmd="$chmodprog $2"
    47         -	    shift
    48         -	    shift
    49         -	    continue;;
    50         -
    51         -	-o) chowncmd="$chownprog $2"
    52         -	    shift
    53         -	    shift
    54         -	    continue;;
    55         -
    56         -	-g) chgrpcmd="$chgrpprog $2"
    57         -	    shift
    58         -	    shift
    59         -	    continue;;
    60         -
    61         -	-s) stripcmd="$stripprog"
    62         -	    shift
    63         -	    continue;;
    64         -
    65         -	*)  if [ x"$src" = x ]
    66         -	    then
    67         -		src=$1
    68         -	    else
    69         -		dst=$1
    70         -	    fi
    71         -	    shift
    72         -	    continue;;
    73         -    esac
           92  +stripcmd=
           93  +
           94  +src=
           95  +dst=
           96  +dir_arg=
           97  +dst_arg=
           98  +
           99  +copy_on_change=false
          100  +no_target_directory=
          101  +
          102  +usage="\
          103  +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
          104  +   or: $0 [OPTION]... SRCFILES... DIRECTORY
          105  +   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
          106  +   or: $0 [OPTION]... -d DIRECTORIES...
          107  +
          108  +In the 1st form, copy SRCFILE to DSTFILE.
          109  +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
          110  +In the 4th, create DIRECTORIES.
          111  +
          112  +Options:
          113  +     --help     display this help and exit.
          114  +     --version  display version info and exit.
          115  +
          116  +  -c            (ignored)
          117  +  -C            install only if different (preserve the last data modification time)
          118  +  -d            create directories instead of installing files.
          119  +  -g GROUP      $chgrpprog installed files to GROUP.
          120  +  -m MODE       $chmodprog installed files to MODE.
          121  +  -o USER       $chownprog installed files to USER.
          122  +  -s            $stripprog installed files.
          123  +  -S            $stripprog installed files.
          124  +  -t DIRECTORY  install into DIRECTORY.
          125  +  -T            report an error if DSTFILE is a directory.
          126  +
          127  +Environment variables override the default commands:
          128  +  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
          129  +  RMPROG STRIPPROG
          130  +"
          131  +
          132  +while test $# -ne 0; do
          133  +  case $1 in
          134  +    -c) ;;
          135  +
          136  +    -C) copy_on_change=true;;
          137  +
          138  +    -d) dir_arg=true;;
          139  +
          140  +    -g) chgrpcmd="$chgrpprog $2"
          141  +	shift;;
          142  +
          143  +    --help) echo "$usage"; exit $?;;
          144  +
          145  +    -m) mode=$2
          146  +	case $mode in
          147  +	  *' '* | *'	'* | *'
          148  +'*	  | *'*'* | *'?'* | *'['*)
          149  +	    echo "$0: invalid mode: $mode" >&2
          150  +	    exit 1;;
          151  +	esac
          152  +	shift;;
          153  +
          154  +    -o) chowncmd="$chownprog $2"
          155  +	shift;;
          156  +
          157  +    -s) stripcmd=$stripprog;;
          158  +
          159  +    -S) stripcmd="$stripprog $2"
          160  +	shift;;
          161  +
          162  +    -t) dst_arg=$2
          163  +	shift;;
          164  +
          165  +    -T) no_target_directory=true;;
          166  +
          167  +    --version) echo "$0 $scriptversion"; exit $?;;
          168  +
          169  +    --)	shift
          170  +	break;;
          171  +
          172  +    -*)	echo "$0: invalid option: $1" >&2
          173  +	exit 1;;
          174  +
          175  +    *)  break;;
          176  +  esac
          177  +  shift
    74    178   done
    75    179   
    76         -if [ x"$src" = x ]
    77         -then
    78         -	echo "install:  no input file specified"
    79         -	exit 1
          180  +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
          181  +  # When -d is used, all remaining arguments are directories to create.
          182  +  # When -t is used, the destination is already specified.
          183  +  # Otherwise, the last argument is the destination.  Remove it from $@.
          184  +  for arg
          185  +  do
          186  +    if test -n "$dst_arg"; then
          187  +      # $@ is not empty: it contains at least $arg.
          188  +      set fnord "$@" "$dst_arg"
          189  +      shift # fnord
          190  +    fi
          191  +    shift # arg
          192  +    dst_arg=$arg
          193  +  done
          194  +fi
          195  +
          196  +if test $# -eq 0; then
          197  +  if test -z "$dir_arg"; then
          198  +    echo "$0: no input file specified." >&2
          199  +    exit 1
          200  +  fi
          201  +  # It's OK to call `install-sh -d' without argument.
          202  +  # This can happen when creating conditional directories.
          203  +  exit 0
          204  +fi
          205  +
          206  +if test -z "$dir_arg"; then
          207  +  do_exit='(exit $ret); exit $ret'
          208  +  trap "ret=129; $do_exit" 1
          209  +  trap "ret=130; $do_exit" 2
          210  +  trap "ret=141; $do_exit" 13
          211  +  trap "ret=143; $do_exit" 15
          212  +
          213  +  # Set umask so as not to create temps with too-generous modes.
          214  +  # However, 'strip' requires both read and write access to temps.
          215  +  case $mode in
          216  +    # Optimize common cases.
          217  +    *644) cp_umask=133;;
          218  +    *755) cp_umask=22;;
          219  +
          220  +    *[0-7])
          221  +      if test -z "$stripcmd"; then
          222  +	u_plus_rw=
          223  +      else
          224  +	u_plus_rw='% 200'
          225  +      fi
          226  +      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
          227  +    *)
          228  +      if test -z "$stripcmd"; then
          229  +	u_plus_rw=
          230  +      else
          231  +	u_plus_rw=,u+rw
          232  +      fi
          233  +      cp_umask=$mode$u_plus_rw;;
          234  +  esac
    80    235   fi
    81    236   
    82         -if [ x"$dst" = x ]
    83         -then
    84         -	echo "install:  no destination specified"
          237  +for src
          238  +do
          239  +  # Protect names starting with `-'.
          240  +  case $src in
          241  +    -*) src=./$src;;
          242  +  esac
          243  +
          244  +  if test -n "$dir_arg"; then
          245  +    dst=$src
          246  +    dstdir=$dst
          247  +    test -d "$dstdir"
          248  +    dstdir_status=$?
          249  +  else
          250  +
          251  +    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
          252  +    # might cause directories to be created, which would be especially bad
          253  +    # if $src (and thus $dsttmp) contains '*'.
          254  +    if test ! -f "$src" && test ! -d "$src"; then
          255  +      echo "$0: $src does not exist." >&2
          256  +      exit 1
          257  +    fi
          258  +
          259  +    if test -z "$dst_arg"; then
          260  +      echo "$0: no destination specified." >&2
          261  +      exit 1
          262  +    fi
          263  +
          264  +    dst=$dst_arg
          265  +    # Protect names starting with `-'.
          266  +    case $dst in
          267  +      -*) dst=./$dst;;
          268  +    esac
          269  +
          270  +    # If destination is a directory, append the input filename; won't work
          271  +    # if double slashes aren't ignored.
          272  +    if test -d "$dst"; then
          273  +      if test -n "$no_target_directory"; then
          274  +	echo "$0: $dst_arg: Is a directory" >&2
    85    275   	exit 1
    86         -fi
          276  +      fi
          277  +      dstdir=$dst
          278  +      dst=$dstdir/`basename "$src"`
          279  +      dstdir_status=0
          280  +    else
          281  +      # Prefer dirname, but fall back on a substitute if dirname fails.
          282  +      dstdir=`
          283  +	(dirname "$dst") 2>/dev/null ||
          284  +	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
          285  +	     X"$dst" : 'X\(//\)[^/]' \| \
          286  +	     X"$dst" : 'X\(//\)$' \| \
          287  +	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
          288  +	echo X"$dst" |
          289  +	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
          290  +		   s//\1/
          291  +		   q
          292  +		 }
          293  +		 /^X\(\/\/\)[^/].*/{
          294  +		   s//\1/
          295  +		   q
          296  +		 }
          297  +		 /^X\(\/\/\)$/{
          298  +		   s//\1/
          299  +		   q
          300  +		 }
          301  +		 /^X\(\/\).*/{
          302  +		   s//\1/
          303  +		   q
          304  +		 }
          305  +		 s/.*/./; q'
          306  +      `
          307  +
          308  +      test -d "$dstdir"
          309  +      dstdir_status=$?
          310  +    fi
          311  +  fi
          312  +
          313  +  obsolete_mkdir_used=false
          314  +
          315  +  if test $dstdir_status != 0; then
          316  +    case $posix_mkdir in
          317  +      '')
          318  +	# Create intermediate dirs using mode 755 as modified by the umask.
          319  +	# This is like FreeBSD 'install' as of 1997-10-28.
          320  +	umask=`umask`
          321  +	case $stripcmd.$umask in
          322  +	  # Optimize common cases.
          323  +	  *[2367][2367]) mkdir_umask=$umask;;
          324  +	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
          325  +
          326  +	  *[0-7])
          327  +	    mkdir_umask=`expr $umask + 22 \
          328  +	      - $umask % 100 % 40 + $umask % 20 \
          329  +	      - $umask % 10 % 4 + $umask % 2
          330  +	    `;;
          331  +	  *) mkdir_umask=$umask,go-w;;
          332  +	esac
          333  +
          334  +	# With -d, create the new directory with the user-specified mode.
          335  +	# Otherwise, rely on $mkdir_umask.
          336  +	if test -n "$dir_arg"; then
          337  +	  mkdir_mode=-m$mode
          338  +	else
          339  +	  mkdir_mode=
          340  +	fi
          341  +
          342  +	posix_mkdir=false
          343  +	case $umask in
          344  +	  *[123567][0-7][0-7])
          345  +	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
          346  +	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
          347  +	    ;;
          348  +	  *)
          349  +	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
          350  +	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
          351  +
          352  +	    if (umask $mkdir_umask &&
          353  +		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
          354  +	    then
          355  +	      if test -z "$dir_arg" || {
          356  +		   # Check for POSIX incompatibilities with -m.
          357  +		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
          358  +		   # other-writeable bit of parent directory when it shouldn't.
          359  +		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
          360  +		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
          361  +		   case $ls_ld_tmpdir in
          362  +		     d????-?r-*) different_mode=700;;
          363  +		     d????-?--*) different_mode=755;;
          364  +		     *) false;;
          365  +		   esac &&
          366  +		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
          367  +		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
          368  +		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
          369  +		   }
          370  +		 }
          371  +	      then posix_mkdir=:
          372  +	      fi
          373  +	      rmdir "$tmpdir/d" "$tmpdir"
          374  +	    else
          375  +	      # Remove any dirs left behind by ancient mkdir implementations.
          376  +	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
          377  +	    fi
          378  +	    trap '' 0;;
          379  +	esac;;
          380  +    esac
          381  +
          382  +    if
          383  +      $posix_mkdir && (
          384  +	umask $mkdir_umask &&
          385  +	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
          386  +      )
          387  +    then :
          388  +    else
          389  +
          390  +      # The umask is ridiculous, or mkdir does not conform to POSIX,
          391  +      # or it failed possibly due to a race condition.  Create the
          392  +      # directory the slow way, step by step, checking for races as we go.
          393  +
          394  +      case $dstdir in
          395  +	/*) prefix='/';;
          396  +	-*) prefix='./';;
          397  +	*)  prefix='';;
          398  +      esac
          399  +
          400  +      eval "$initialize_posix_glob"
          401  +
          402  +      oIFS=$IFS
          403  +      IFS=/
          404  +      $posix_glob set -f
          405  +      set fnord $dstdir
          406  +      shift
          407  +      $posix_glob set +f
          408  +      IFS=$oIFS
          409  +
          410  +      prefixes=
          411  +
          412  +      for d
          413  +      do
          414  +	test -z "$d" && continue
          415  +
          416  +	prefix=$prefix$d
          417  +	if test -d "$prefix"; then
          418  +	  prefixes=
          419  +	else
          420  +	  if $posix_mkdir; then
          421  +	    (umask=$mkdir_umask &&
          422  +	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
          423  +	    # Don't fail if two instances are running concurrently.
          424  +	    test -d "$prefix" || exit 1
          425  +	  else
          426  +	    case $prefix in
          427  +	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
          428  +	      *) qprefix=$prefix;;
          429  +	    esac
          430  +	    prefixes="$prefixes '$qprefix'"
          431  +	  fi
          432  +	fi
          433  +	prefix=$prefix/
          434  +      done
          435  +
          436  +      if test -n "$prefixes"; then
          437  +	# Don't fail if two instances are running concurrently.
          438  +	(umask $mkdir_umask &&
          439  +	 eval "\$doit_exec \$mkdirprog $prefixes") ||
          440  +	  test -d "$dstdir" || exit 1
          441  +	obsolete_mkdir_used=true
          442  +      fi
          443  +    fi
          444  +  fi
          445  +
          446  +  if test -n "$dir_arg"; then
          447  +    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
          448  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
          449  +    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
          450  +      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
          451  +  else
          452  +
          453  +    # Make a couple of temp file names in the proper directory.
          454  +    dsttmp=$dstdir/_inst.$$_
          455  +    rmtmp=$dstdir/_rm.$$_
          456  +
          457  +    # Trap to clean up those temp files at exit.
          458  +    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
          459  +
          460  +    # Copy the file name to the temp name.
          461  +    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
          462  +
          463  +    # and set any options; do chmod last to preserve setuid bits.
          464  +    #
          465  +    # If any of these fail, we abort the whole thing.  If we want to
          466  +    # ignore errors from any of these, just make sure not to ignore
          467  +    # errors from the above "$doit $cpprog $src $dsttmp" command.
          468  +    #
          469  +    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
          470  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
          471  +    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
          472  +    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
          473  +
          474  +    # If -C, don't bother to copy if it wouldn't change the file.
          475  +    if $copy_on_change &&
          476  +       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
          477  +       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
          478  +
          479  +       eval "$initialize_posix_glob" &&
          480  +       $posix_glob set -f &&
          481  +       set X $old && old=:$2:$4:$5:$6 &&
          482  +       set X $new && new=:$2:$4:$5:$6 &&
          483  +       $posix_glob set +f &&
    87    484   
          485  +       test "$old" = "$new" &&
          486  +       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
          487  +    then
          488  +      rm -f "$dsttmp"
          489  +    else
          490  +      # Rename the file to the real destination.
          491  +      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
    88    492   
    89         -# If destination is a directory, append the input filename; if your system
    90         -# does not like double slashes in filenames, you may need to add some logic
          493  +      # The rename failed, perhaps because mv can't rename something else
          494  +      # to itself, or perhaps because mv is so ancient that it does not
          495  +      # support -f.
          496  +      {
          497  +	# Now remove or move aside any old file at destination location.
          498  +	# We try this two ways since rm can't unlink itself on some
          499  +	# systems and the destination file might be busy for other
          500  +	# reasons.  In this case, the final cleanup might fail but the new
          501  +	# file should still install successfully.
          502  +	{
          503  +	  test ! -f "$dst" ||
          504  +	  $doit $rmcmd -f "$dst" 2>/dev/null ||
          505  +	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
          506  +	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          507  +	  } ||
          508  +	  { echo "$0: cannot unlink or rename $dst" >&2
          509  +	    (exit 1); exit 1
          510  +	  }
          511  +	} &&
    91    512   
    92         -if [ -d $dst ]
    93         -then
    94         -	dst="$dst"/`basename $src`
    95         -fi
          513  +	# Now rename the file to the real destination.
          514  +	$doit $mvcmd "$dsttmp" "$dst"
          515  +      }
          516  +    fi || exit 1
    96    517   
    97         -# Make a temp file name in the proper directory.
    98         -
    99         -dstdir=`dirname $dst`
   100         -dsttmp=$dstdir/#inst.$$#
   101         -
   102         -# Move or copy the file name to the temp name
          518  +    trap '' 0
          519  +  fi
          520  +done
   103    521   
   104         -$doit $instcmd $src $dsttmp
   105         -
   106         -# and set any options; do chmod last to preserve setuid bits
   107         -
   108         -if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
   109         -if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
   110         -if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
   111         -if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
   112         -
   113         -# Now rename the file to the real destination.
   114         -
   115         -$doit $rmcmd $dst
   116         -$doit $mvcmd $dsttmp $dst
   117         -
   118         -
   119         -exit 0
          522  +# Local variables:
          523  +# eval: (add-hook 'write-file-hooks 'time-stamp)
          524  +# time-stamp-start: "scriptversion="
          525  +# time-stamp-format: "%:y-%02m-%02d.%02H"
          526  +# time-stamp-time-zone: "UTC"
          527  +# time-stamp-end: "; # UTC"
          528  +# End:

Changes to tclconfig/tcl.m4.

     4      4   #	a Tcl extension.
     5      5   #
     6      6   # Copyright (c) 1999-2000 Ajuba Solutions.
     7      7   # Copyright (c) 2002-2005 ActiveState Corporation.
     8      8   #
     9      9   # See the file "license.terms" for information on usage and redistribution
    10     10   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    11         -#
    12         -# RCS: @(#) $Id$
    13     11   
    14     12   AC_PREREQ(2.57)
    15     13   
    16     14   dnl TEA extensions pass us the version of TEA they think they
    17     15   dnl are compatible with (must be set in TEA_INIT below)
    18         -dnl TEA_VERSION="3.6"
           16  +dnl TEA_VERSION="3.9"
    19     17   
    20     18   # Possible values for key variables defined:
    21     19   #
    22     20   # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
    23     21   # TEA_PLATFORM        - windows unix
    24     22   #
    25     23   
................................................................................
    39     37   #
    40     38   #	Defines the following vars:
    41     39   #		TCL_BIN_DIR	Full path to the directory containing
    42     40   #				the tclConfig.sh file
    43     41   #------------------------------------------------------------------------
    44     42   
    45     43   AC_DEFUN([TEA_PATH_TCLCONFIG], [
    46         -    dnl Make sure we are initialized
           44  +    dnl TEA specific: Make sure we are initialized
    47     45       AC_REQUIRE([TEA_INIT])
    48     46       #
    49     47       # Ok, lets find the tcl configuration
    50     48       # First, look for one uninstalled.
    51     49       # the alternative search directory is invoked by --with-tcl
    52     50       #
    53     51   
    54     52       if test x"${no_tcl}" = x ; then
    55     53   	# we reset no_tcl in case something fails here
    56     54   	no_tcl=true
    57     55   	AC_ARG_WITH(tcl,
    58     56   	    AC_HELP_STRING([--with-tcl],
    59     57   		[directory containing tcl configuration (tclConfig.sh)]),
    60         -	    with_tclconfig=${withval})
           58  +	    with_tclconfig="${withval}")
    61     59   	AC_MSG_CHECKING([for Tcl configuration])
    62     60   	AC_CACHE_VAL(ac_cv_c_tclconfig,[
    63     61   
    64     62   	    # First check to see if --with-tcl was specified.
    65     63   	    if test x"${with_tclconfig}" != x ; then
    66         -		case ${with_tclconfig} in
           64  +		case "${with_tclconfig}" in
    67     65   		    */tclConfig.sh )
    68         -			if test -f ${with_tclconfig}; then
           66  +			if test -f "${with_tclconfig}"; then
    69     67   			    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$!!'`
           68  +			    with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
    71     69   			fi ;;
    72     70   		esac
    73     71   		if test -f "${with_tclconfig}/tclConfig.sh" ; then
    74         -		    ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
           72  +		    ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
    75     73   		else
    76     74   		    AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
    77     75   		fi
    78     76   	    fi
    79     77   
    80     78   	    # then check for a private Tcl installation
    81     79   	    if test x"${ac_cv_c_tclconfig}" = x ; then
................................................................................
    88     86   			`ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
    89     87   			`ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    90     88   			`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
    91     89   			../../../tcl \
    92     90   			`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
    93     91   			`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
    94     92   			`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
           93  +		    if test "${TEA_PLATFORM}" = "windows" \
           94  +			    -a -f "$i/win/tclConfig.sh" ; then
           95  +			ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
           96  +			break
           97  +		    fi
    95     98   		    if test -f "$i/unix/tclConfig.sh" ; then
    96         -			ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
           99  +			ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
    97    100   			break
    98    101   		    fi
    99    102   		done
   100    103   	    fi
   101    104   
   102    105   	    # on Darwin, check in Framework installation locations
   103    106   	    if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
   104    107   		for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
   105    108   			`ls -d /Library/Frameworks 2>/dev/null` \
   106    109   			`ls -d /Network/Library/Frameworks 2>/dev/null` \
   107    110   			`ls -d /System/Library/Frameworks 2>/dev/null` \
   108    111   			; do
   109    112   		    if test -f "$i/Tcl.framework/tclConfig.sh" ; then
   110         -			ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
          113  +			ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
   111    114   			break
   112    115   		    fi
   113    116   		done
   114    117   	    fi
   115    118   
   116         -	    # on Windows, check in common installation locations
          119  +	    # TEA specific: on Windows, check in common installation locations
   117    120   	    if test "${TEA_PLATFORM}" = "windows" \
   118    121   		-a x"${ac_cv_c_tclconfig}" = x ; then
   119    122   		for i in `ls -d C:/Tcl/lib 2>/dev/null` \
   120    123   			`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
   121    124   			; do
   122    125   		    if test -f "$i/tclConfig.sh" ; then
   123         -			ac_cv_c_tclconfig=`(cd $i; pwd)`
          126  +			ac_cv_c_tclconfig="`(cd $i; pwd)`"
   124    127   			break
   125    128   		    fi
   126    129   		done
   127    130   	    fi
   128    131   
   129    132   	    # check in a few common install locations
   130    133   	    if test x"${ac_cv_c_tclconfig}" = x ; then
   131    134   		for i in `ls -d ${libdir} 2>/dev/null` \
   132    135   			`ls -d ${exec_prefix}/lib 2>/dev/null` \
   133    136   			`ls -d ${prefix}/lib 2>/dev/null` \
   134    137   			`ls -d /usr/local/lib 2>/dev/null` \
   135    138   			`ls -d /usr/contrib/lib 2>/dev/null` \
   136    139   			`ls -d /usr/lib 2>/dev/null` \
          140  +			`ls -d /usr/lib64 2>/dev/null` \
   137    141   			; do
   138    142   		    if test -f "$i/tclConfig.sh" ; then
   139         -			ac_cv_c_tclconfig=`(cd $i; pwd)`
          143  +			ac_cv_c_tclconfig="`(cd $i; pwd)`"
   140    144   			break
   141    145   		    fi
   142    146   		done
   143    147   	    fi
   144    148   
   145    149   	    # check in a few other private locations
   146    150   	    if test x"${ac_cv_c_tclconfig}" = x ; then
   147    151   		for i in \
   148    152   			${srcdir}/../tcl \
   149    153   			`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
   150    154   			`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
   151    155   			`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
          156  +		    if test "${TEA_PLATFORM}" = "windows" \
          157  +			    -a -f "$i/win/tclConfig.sh" ; then
          158  +			ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
          159  +			break
          160  +		    fi
   152    161   		    if test -f "$i/unix/tclConfig.sh" ; then
   153         -		    ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
   154         -		    break
   155         -		fi
          162  +			ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
          163  +			break
          164  +		    fi
   156    165   		done
   157    166   	    fi
   158    167   	])
   159    168   
   160    169   	if test x"${ac_cv_c_tclconfig}" = x ; then
   161    170   	    TCL_BIN_DIR="# no Tcl configs found"
   162         -	    AC_MSG_WARN([Can't find Tcl configuration definitions])
   163         -	    exit 0
          171  +	    AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
   164    172   	else
   165    173   	    no_tcl=
   166         -	    TCL_BIN_DIR=${ac_cv_c_tclconfig}
          174  +	    TCL_BIN_DIR="${ac_cv_c_tclconfig}"
   167    175   	    AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
   168    176   	fi
   169    177       fi
   170    178   ])
   171    179   
   172    180   #------------------------------------------------------------------------
   173    181   # TEA_PATH_TKCONFIG --
................................................................................
   196    204   
   197    205       if test x"${no_tk}" = x ; then
   198    206   	# we reset no_tk in case something fails here
   199    207   	no_tk=true
   200    208   	AC_ARG_WITH(tk,
   201    209   	    AC_HELP_STRING([--with-tk],
   202    210   		[directory containing tk configuration (tkConfig.sh)]),
   203         -	    with_tkconfig=${withval})
          211  +	    with_tkconfig="${withval}")
   204    212   	AC_MSG_CHECKING([for Tk configuration])
   205    213   	AC_CACHE_VAL(ac_cv_c_tkconfig,[
   206    214   
   207    215   	    # First check to see if --with-tkconfig was specified.
   208    216   	    if test x"${with_tkconfig}" != x ; then
   209         -		case ${with_tkconfig} in
          217  +		case "${with_tkconfig}" in
   210    218   		    */tkConfig.sh )
   211         -			if test -f ${with_tkconfig}; then
          219  +			if test -f "${with_tkconfig}"; then
   212    220   			    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$!!'`
          221  +			    with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
   214    222   			fi ;;
   215    223   		esac
   216    224   		if test -f "${with_tkconfig}/tkConfig.sh" ; then
   217         -		    ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
          225  +		    ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
   218    226   		else
   219    227   		    AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
   220    228   		fi
   221    229   	    fi
   222    230   
   223    231   	    # then check for a private Tk library
   224    232   	    if test x"${ac_cv_c_tkconfig}" = x ; then
................................................................................
   231    239   			`ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
   232    240   			`ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
   233    241   			`ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
   234    242   			../../../tk \
   235    243   			`ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
   236    244   			`ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
   237    245   			`ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
          246  +		    if test "${TEA_PLATFORM}" = "windows" \
          247  +			    -a -f "$i/win/tkConfig.sh" ; then
          248  +			ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
          249  +			break
          250  +		    fi
   238    251   		    if test -f "$i/unix/tkConfig.sh" ; then
   239         -			ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
          252  +			ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
   240    253   			break
   241    254   		    fi
   242    255   		done
   243    256   	    fi
   244    257   
   245    258   	    # on Darwin, check in Framework installation locations
   246    259   	    if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
   247    260   		for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
   248    261   			`ls -d /Library/Frameworks 2>/dev/null` \
   249    262   			`ls -d /Network/Library/Frameworks 2>/dev/null` \
   250    263   			`ls -d /System/Library/Frameworks 2>/dev/null` \
   251    264   			; do
   252    265   		    if test -f "$i/Tk.framework/tkConfig.sh" ; then
   253         -			ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
          266  +			ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
   254    267   			break
   255    268   		    fi
   256    269   		done
   257    270   	    fi
   258    271   
   259    272   	    # check in a few common install locations
   260    273   	    if test x"${ac_cv_c_tkconfig}" = x ; then
   261    274   		for i in `ls -d ${libdir} 2>/dev/null` \
   262    275   			`ls -d ${exec_prefix}/lib 2>/dev/null` \
   263    276   			`ls -d ${prefix}/lib 2>/dev/null` \
   264    277   			`ls -d /usr/local/lib 2>/dev/null` \
   265    278   			`ls -d /usr/contrib/lib 2>/dev/null` \
   266    279   			`ls -d /usr/lib 2>/dev/null` \
          280  +			`ls -d /usr/lib64 2>/dev/null` \
   267    281   			; do
   268    282   		    if test -f "$i/tkConfig.sh" ; then
   269         -			ac_cv_c_tkconfig=`(cd $i; pwd)`
          283  +			ac_cv_c_tkconfig="`(cd $i; pwd)`"
   270    284   			break
   271    285   		    fi
   272    286   		done
   273    287   	    fi
   274    288   
   275         -	    # on Windows, check in common installation locations
          289  +	    # TEA specific: on Windows, check in common installation locations
   276    290   	    if test "${TEA_PLATFORM}" = "windows" \
   277    291   		-a x"${ac_cv_c_tkconfig}" = x ; then
   278    292   		for i in `ls -d C:/Tcl/lib 2>/dev/null` \
   279    293   			`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
   280    294   			; do
   281    295   		    if test -f "$i/tkConfig.sh" ; then
   282         -			ac_cv_c_tkconfig=`(cd $i; pwd)`
          296  +			ac_cv_c_tkconfig="`(cd $i; pwd)`"
   283    297   			break
   284    298   		    fi
   285    299   		done
   286    300   	    fi
   287    301   
   288    302   	    # check in a few other private locations
   289    303   	    if test x"${ac_cv_c_tkconfig}" = x ; then
   290    304   		for i in \
   291    305   			${srcdir}/../tk \
   292    306   			`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
   293    307   			`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
   294    308   			`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
          309  +		    if test "${TEA_PLATFORM}" = "windows" \
          310  +			    -a -f "$i/win/tkConfig.sh" ; then
          311  +			ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
          312  +			break
          313  +		    fi
   295    314   		    if test -f "$i/unix/tkConfig.sh" ; then
   296         -			ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
          315  +			ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
   297    316   			break
   298    317   		    fi
   299    318   		done
   300    319   	    fi
   301    320   	])
   302    321   
   303    322   	if test x"${ac_cv_c_tkconfig}" = x ; then
   304    323   	    TK_BIN_DIR="# no Tk configs found"
   305         -	    AC_MSG_WARN([Can't find Tk configuration definitions])
   306         -	    exit 0
          324  +	    AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
   307    325   	else
   308    326   	    no_tk=
   309         -	    TK_BIN_DIR=${ac_cv_c_tkconfig}
          327  +	    TK_BIN_DIR="${ac_cv_c_tkconfig}"
   310    328   	    AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
   311    329   	fi
   312    330       fi
   313    331   ])
   314    332   
   315    333   #------------------------------------------------------------------------
   316    334   # TEA_LOAD_TCLCONFIG --
   317    335   #
   318    336   #	Load the tclConfig.sh file
   319    337   #
   320    338   # Arguments:
   321         -#	
          339  +#
   322    340   #	Requires the following vars to be set:
   323    341   #		TCL_BIN_DIR
   324    342   #
   325    343   # Results:
   326    344   #
   327         -#	Subst the following vars:
          345  +#	Substitutes the following vars:
   328    346   #		TCL_BIN_DIR
   329    347   #		TCL_SRC_DIR
   330    348   #		TCL_LIB_FILE
   331         -#
   332    349   #------------------------------------------------------------------------
   333    350   
   334    351   AC_DEFUN([TEA_LOAD_TCLCONFIG], [
   335    352       AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
   336    353   
   337    354       if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
   338    355           AC_MSG_RESULT([loading])
................................................................................
   348    365       # If the TCL_BIN_DIR is the build directory (not the install directory),
   349    366       # then set the common variable name to the value of the build variables.
   350    367       # For example, the variable TCL_LIB_SPEC will be set to the value
   351    368       # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
   352    369       # instead of TCL_BUILD_LIB_SPEC since it will work with both an
   353    370       # installed and uninstalled version of Tcl.
   354    371       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}
          372  +        TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
          373  +        TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
          374  +        TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
   358    375       elif test "`uname -s`" = "Darwin"; then
   359    376   	# If Tcl was built as a framework, attempt to use the libraries
   360    377   	# from the framework at the given location so that linking works
   361         -	# against Tcl.framework installed in an arbitary location.
          378  +	# against Tcl.framework installed in an arbitrary location.
   362    379   	case ${TCL_DEFS} in
   363    380   	    *TCL_FRAMEWORK*)
   364    381   		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
          382  +		    for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
          383  +			     "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
   367    384   			if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
   368         -			    TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
          385  +			    TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
   369    386   			    break
   370    387   			fi
   371    388   		    done
   372    389   		fi
   373    390   		if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
   374         -		    TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
          391  +		    TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}"  | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
   375    392   		    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
   376    393   		fi
   377    394   		;;
   378    395   	esac
   379    396       fi
   380    397   
   381    398       # eval is required to do the TCL_DBGX substitution
   382    399       eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
   383    400       eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
   384    401       eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
   385    402       eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
   386    403   
   387    404       AC_SUBST(TCL_VERSION)
          405  +    AC_SUBST(TCL_PATCH_LEVEL)
   388    406       AC_SUBST(TCL_BIN_DIR)
   389    407       AC_SUBST(TCL_SRC_DIR)
   390    408   
   391    409       AC_SUBST(TCL_LIB_FILE)
   392    410       AC_SUBST(TCL_LIB_FLAG)
   393    411       AC_SUBST(TCL_LIB_SPEC)
   394    412   
   395    413       AC_SUBST(TCL_STUB_LIB_FILE)
   396    414       AC_SUBST(TCL_STUB_LIB_FLAG)
   397    415       AC_SUBST(TCL_STUB_LIB_SPEC)
   398    416   
          417  +    AC_MSG_CHECKING([platform])
          418  +    hold_cc=$CC; CC="$TCL_CC"
          419  +    AC_TRY_COMPILE(,[
          420  +	    #ifdef _WIN32
          421  +		#error win32
          422  +	    #endif
          423  +    ], TEA_PLATFORM="unix",
          424  +	    TEA_PLATFORM="windows"
          425  +    )
          426  +    CC=$hold_cc
          427  +    AC_MSG_RESULT($TEA_PLATFORM)
          428  +
          429  +    # The BUILD_$pkg is to define the correct extern storage class
          430  +    # handling when making this package
          431  +    AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [],
          432  +	    [Building extension source?])
          433  +    # Do this here as we have fully defined TEA_PLATFORM now
          434  +    if test "${TEA_PLATFORM}" = "windows" ; then
          435  +	EXEEXT=".exe"
          436  +	CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
          437  +    fi
          438  +
          439  +    # TEA specific:
          440  +    AC_SUBST(CLEANFILES)
   399    441       AC_SUBST(TCL_LIBS)
   400    442       AC_SUBST(TCL_DEFS)
   401    443       AC_SUBST(TCL_EXTRA_CFLAGS)
   402    444       AC_SUBST(TCL_LD_FLAGS)
   403    445       AC_SUBST(TCL_SHLIB_LD_LIBS)
   404    446   ])
   405    447   
   406    448   #------------------------------------------------------------------------
   407    449   # TEA_LOAD_TKCONFIG --
   408    450   #
   409    451   #	Load the tkConfig.sh file
   410    452   #
   411    453   # Arguments:
   412         -#	
          454  +#
   413    455   #	Requires the following vars to be set:
   414    456   #		TK_BIN_DIR
   415    457   #
   416    458   # Results:
   417    459   #
   418    460   #	Sets the following vars that should be in tkConfig.sh:
   419    461   #		TK_BIN_DIR
................................................................................
   436    478       # If the TK_BIN_DIR is the build directory (not the install directory),
   437    479       # then set the common variable name to the value of the build variables.
   438    480       # For example, the variable TK_LIB_SPEC will be set to the value
   439    481       # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
   440    482       # instead of TK_BUILD_LIB_SPEC since it will work with both an
   441    483       # installed and uninstalled version of Tcl.
   442    484       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}
          485  +        TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
          486  +        TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
          487  +        TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
   446    488       elif test "`uname -s`" = "Darwin"; then
   447    489   	# If Tk was built as a framework, attempt to use the libraries
   448    490   	# from the framework at the given location so that linking works
   449         -	# against Tk.framework installed in an arbitary location.
          491  +	# against Tk.framework installed in an arbitrary location.
   450    492   	case ${TK_DEFS} in
   451    493   	    *TK_FRAMEWORK*)
   452    494   		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
          495  +		    for i in "`cd "${TK_BIN_DIR}"; pwd`" \
          496  +			     "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
   455    497   			if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
   456         -			    TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
          498  +			    TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
   457    499   			    break
   458    500   			fi
   459    501   		    done
   460    502   		fi
   461    503   		if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
   462         -		    TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
          504  +		    TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}"  | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
   463    505   		    TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
   464    506   		fi
   465    507   		;;
   466    508   	esac
   467    509       fi
   468    510   
   469    511       # eval is required to do the TK_DBGX substitution
   470    512       eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
   471    513       eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
   472    514       eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
   473    515       eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
   474    516   
   475         -    # Ensure windowingsystem is defined
          517  +    # TEA specific: Ensure windowingsystem is defined
   476    518       if test "${TEA_PLATFORM}" = "unix" ; then
   477    519   	case ${TK_DEFS} in
   478    520   	    *MAC_OSX_TK*)
   479    521   		AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
   480    522   		TEA_WINDOWINGSYSTEM="aqua"
   481    523   		;;
   482    524   	    *)
................................................................................
   495    537       AC_SUBST(TK_LIB_FLAG)
   496    538       AC_SUBST(TK_LIB_SPEC)
   497    539   
   498    540       AC_SUBST(TK_STUB_LIB_FILE)
   499    541       AC_SUBST(TK_STUB_LIB_FLAG)
   500    542       AC_SUBST(TK_STUB_LIB_SPEC)
   501    543   
          544  +    # TEA specific:
   502    545       AC_SUBST(TK_LIBS)
   503    546       AC_SUBST(TK_XINCLUDES)
   504    547   ])
          548  +
          549  +#------------------------------------------------------------------------
          550  +# TEA_PROG_TCLSH
          551  +#	Determine the fully qualified path name of the tclsh executable
          552  +#	in the Tcl build directory or the tclsh installed in a bin
          553  +#	directory. This macro will correctly determine the name
          554  +#	of the tclsh executable even if tclsh has not yet been
          555  +#	built in the build directory. The tclsh found is always
          556  +#	associated with a tclConfig.sh file. This tclsh should be used
          557  +#	only for running extension test cases. It should never be
          558  +#	or generation of files (like pkgIndex.tcl) at build time.
          559  +#
          560  +# Arguments:
          561  +#	none
          562  +#
          563  +# Results:
          564  +#	Substitutes the following vars:
          565  +#		TCLSH_PROG
          566  +#------------------------------------------------------------------------
          567  +
          568  +AC_DEFUN([TEA_PROG_TCLSH], [
          569  +    AC_MSG_CHECKING([for tclsh])
          570  +    if test -f "${TCL_BIN_DIR}/Makefile" ; then
          571  +        # tclConfig.sh is in Tcl build directory
          572  +        if test "${TEA_PLATFORM}" = "windows"; then
          573  +            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
          574  +        else
          575  +            TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
          576  +        fi
          577  +    else
          578  +        # tclConfig.sh is in install location
          579  +        if test "${TEA_PLATFORM}" = "windows"; then
          580  +            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
          581  +        else
          582  +            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
          583  +        fi
          584  +        list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
          585  +              `ls -d ${TCL_BIN_DIR}/..     2>/dev/null` \
          586  +              `ls -d ${TCL_PREFIX}/bin     2>/dev/null`"
          587  +        for i in $list ; do
          588  +            if test -f "$i/${TCLSH_PROG}" ; then
          589  +                REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
          590  +                break
          591  +            fi
          592  +        done
          593  +        TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
          594  +    fi
          595  +    AC_MSG_RESULT([${TCLSH_PROG}])
          596  +    AC_SUBST(TCLSH_PROG)
          597  +])
          598  +
          599  +#------------------------------------------------------------------------
          600  +# TEA_PROG_WISH
          601  +#	Determine the fully qualified path name of the wish executable
          602  +#	in the Tk build directory or the wish installed in a bin
          603  +#	directory. This macro will correctly determine the name
          604  +#	of the wish executable even if wish has not yet been
          605  +#	built in the build directory. The wish found is always
          606  +#	associated with a tkConfig.sh file. This wish should be used
          607  +#	only for running extension test cases. It should never be
          608  +#	or generation of files (like pkgIndex.tcl) at build time.
          609  +#
          610  +# Arguments:
          611  +#	none
          612  +#
          613  +# Results:
          614  +#	Substitutes the following vars:
          615  +#		WISH_PROG
          616  +#------------------------------------------------------------------------
          617  +
          618  +AC_DEFUN([TEA_PROG_WISH], [
          619  +    AC_MSG_CHECKING([for wish])
          620  +    if test -f "${TK_BIN_DIR}/Makefile" ; then
          621  +        # tkConfig.sh is in Tk build directory
          622  +        if test "${TEA_PLATFORM}" = "windows"; then
          623  +            WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
          624  +        else
          625  +            WISH_PROG="${TK_BIN_DIR}/wish"
          626  +        fi
          627  +    else
          628  +        # tkConfig.sh is in install location
          629  +        if test "${TEA_PLATFORM}" = "windows"; then
          630  +            WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
          631  +        else
          632  +            WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
          633  +        fi
          634  +        list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
          635  +              `ls -d ${TK_BIN_DIR}/..     2>/dev/null` \
          636  +              `ls -d ${TK_PREFIX}/bin     2>/dev/null`"
          637  +        for i in $list ; do
          638  +            if test -f "$i/${WISH_PROG}" ; then
          639  +                REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
          640  +                break
          641  +            fi
          642  +        done
          643  +        WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
          644  +    fi
          645  +    AC_MSG_RESULT([${WISH_PROG}])
          646  +    AC_SUBST(WISH_PROG)
          647  +])
   505    648   
   506    649   #------------------------------------------------------------------------
   507    650   # TEA_ENABLE_SHARED --
   508    651   #
   509    652   #	Allows the building of shared libraries
   510    653   #
   511    654   # Arguments:
   512    655   #	none
   513         -#	
          656  +#
   514    657   # Results:
   515    658   #
   516    659   #	Adds the following arguments to configure:
   517    660   #		--enable-shared=yes|no
   518    661   #
   519    662   #	Defines the following vars:
   520    663   #		STATIC_BUILD	Used for building import/export libraries
................................................................................
   562    705   #
   563    706   #	Note that it is legal to have a thread enabled extension run in a
   564    707   #	threaded or non-threaded Tcl core, but a non-threaded extension may
   565    708   #	only run in a non-threaded Tcl core.
   566    709   #
   567    710   # Arguments:
   568    711   #	none
   569         -#	
          712  +#
   570    713   # Results:
   571    714   #
   572    715   #	Adds the following arguments to configure:
   573    716   #		--enable-threads
   574    717   #
   575    718   #	Sets the following vars:
   576    719   #		THREADS_LIBS	Thread library(s)
   577    720   #
   578    721   #	Defines the following vars:
   579    722   #		TCL_THREADS
   580    723   #		_REENTRANT
   581    724   #		_THREAD_SAFE
   582         -#
   583    725   #------------------------------------------------------------------------
   584    726   
   585    727   AC_DEFUN([TEA_ENABLE_THREADS], [
   586    728       AC_ARG_ENABLE(threads,
   587    729   	AC_HELP_STRING([--enable-threads],
   588    730   	    [build with threads]),
   589    731   	[tcl_ok=$enableval], [tcl_ok=yes])
................................................................................
   596    738       fi
   597    739   
   598    740       if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
   599    741   	TCL_THREADS=1
   600    742   
   601    743   	if test "${TEA_PLATFORM}" != "windows" ; then
   602    744   	    # We are always OK on Windows, so check what this platform wants:
   603         -    
          745  +
   604    746   	    # USE_THREAD_ALLOC tells us to try the special thread-based
   605    747   	    # allocator that significantly reduces lock contention
   606    748   	    AC_DEFINE(USE_THREAD_ALLOC, 1,
   607    749   		[Do we want to use the threaded memory allocator?])
   608    750   	    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
   609    751   	    if test "`uname -s`" = "SunOS" ; then
   610    752   		AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
................................................................................
   685    827   # TEA_ENABLE_SYMBOLS --
   686    828   #
   687    829   #	Specify if debugging symbols should be used.
   688    830   #	Memory (TCL_MEM_DEBUG) debugging can also be enabled.
   689    831   #
   690    832   # Arguments:
   691    833   #	none
   692         -#	
          834  +#
   693    835   #	TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
   694    836   #	the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
   695    837   #	Requires the following vars to be set in the Makefile:
   696    838   #		CFLAGS_DEFAULT
   697    839   #		LDFLAGS_DEFAULT
   698         -#	
          840  +#
   699    841   # Results:
   700    842   #
   701    843   #	Adds the following arguments to configure:
   702    844   #		--enable-symbols
   703    845   #
   704    846   #	Defines the following vars:
   705    847   #		CFLAGS_DEFAULT	Sets to $(CFLAGS_DEBUG) if true
   706         -#				Sets to $(CFLAGS_OPTIMIZE) if false
          848  +#				Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false
   707    849   #		LDFLAGS_DEFAULT	Sets to $(LDFLAGS_DEBUG) if true
   708    850   #				Sets to $(LDFLAGS_OPTIMIZE) if false
   709    851   #		DBGX		Formerly used as debug library extension;
   710    852   #				always blank now.
   711         -#
   712    853   #------------------------------------------------------------------------
   713    854   
   714    855   AC_DEFUN([TEA_ENABLE_SYMBOLS], [
   715         -    dnl Make sure we are initialized
          856  +    dnl TEA specific: Make sure we are initialized
   716    857       AC_REQUIRE([TEA_CONFIG_CFLAGS])
   717    858       AC_MSG_CHECKING([for build with symbols])
   718    859       AC_ARG_ENABLE(symbols,
   719    860   	AC_HELP_STRING([--enable-symbols],
   720    861   	    [build with debugging symbols (default: off)]),
   721    862   	[tcl_ok=$enableval], [tcl_ok=no])
   722    863       DBGX=""
   723    864       if test "$tcl_ok" = "no"; then
   724         -	CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
          865  +	CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
   725    866   	LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
   726    867   	AC_MSG_RESULT([no])
   727    868       else
   728    869   	CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
   729    870   	LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
   730    871   	if test "$tcl_ok" = "yes"; then
   731    872   	    AC_MSG_RESULT([yes (standard debugging)])
   732    873   	fi
   733    874       fi
          875  +    # TEA specific:
   734    876       if test "${TEA_PLATFORM}" != "windows" ; then
   735    877   	LDFLAGS_DEFAULT="${LDFLAGS}"
   736    878       fi
   737         -
   738         -    AC_SUBST(TCL_DBGX)
   739    879       AC_SUBST(CFLAGS_DEFAULT)
   740    880       AC_SUBST(LDFLAGS_DEFAULT)
          881  +    AC_SUBST(TCL_DBGX)
   741    882   
   742    883       if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
   743    884   	AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
   744    885       fi
   745    886   
   746    887       if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
   747    888   	if test "$tcl_ok" = "all"; then
................................................................................
   756    897   # TEA_ENABLE_LANGINFO --
   757    898   #
   758    899   #	Allows use of modern nl_langinfo check for better l10n.
   759    900   #	This is only relevant for Unix.
   760    901   #
   761    902   # Arguments:
   762    903   #	none
   763         -#	
          904  +#
   764    905   # Results:
   765    906   #
   766    907   #	Adds the following arguments to configure:
   767    908   #		--enable-langinfo=yes|no (default is yes)
   768    909   #
   769    910   #	Defines the following vars:
   770    911   #		HAVE_LANGINFO	Triggers use of nl_langinfo if defined.
   771         -#
   772    912   #------------------------------------------------------------------------
   773    913   
   774    914   AC_DEFUN([TEA_ENABLE_LANGINFO], [
   775    915       AC_ARG_ENABLE(langinfo,
   776    916   	AC_HELP_STRING([--enable-langinfo],
   777    917   	    [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
   778    918   	[langinfo_ok=$enableval], [langinfo_ok=yes])
................................................................................
   786    926   	AC_CACHE_VAL(tcl_cv_langinfo_h, [
   787    927   	    AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
   788    928   		    [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
   789    929   	AC_MSG_RESULT([$tcl_cv_langinfo_h])
   790    930   	if test $tcl_cv_langinfo_h = yes; then
   791    931   	    AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
   792    932   	fi
   793         -    else 
          933  +    else
   794    934   	AC_MSG_RESULT([$langinfo_ok])
   795    935       fi
   796    936   ])
   797    937   
   798    938   #--------------------------------------------------------------------
   799    939   # TEA_CONFIG_SYSTEM
   800    940   #
   801    941   #	Determine what the system is (some things cannot be easily checked
   802    942   #	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.
          943  +#	"uname" command.
   805    944   #
   806    945   # Arguments:
   807    946   #	none
   808    947   #
   809    948   # Results:
   810    949   #	Defines the following var:
   811    950   #
   812    951   #	system -	System/platform/version identification code.
   813         -#
   814    952   #--------------------------------------------------------------------
   815    953   
   816    954   AC_DEFUN([TEA_CONFIG_SYSTEM], [
   817    955       AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
          956  +	# TEA specific:
   818    957   	if test "${TEA_PLATFORM}" = "windows" ; then
   819    958   	    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    959   	else
   823    960   	    tcl_cv_sys_version=`uname -s`-`uname -r`
   824    961   	    if test "$?" -ne 0 ; then
   825    962   		AC_MSG_WARN([can't find uname command])
   826    963   		tcl_cv_sys_version=unknown
   827    964   	    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    965   		if test "`uname -s`" = "AIX" ; then
   835    966   		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
   836    967   		fi
   837    968   	    fi
   838    969   	fi
   839    970       ])
   840    971       system=$tcl_cv_sys_version
................................................................................
   849    980   # Arguments:
   850    981   #	none
   851    982   #
   852    983   # Results:
   853    984   #
   854    985   #	Defines and substitutes the following vars:
   855    986   #
   856         -#       DL_OBJS -       Name of the object file that implements dynamic
   857         -#                       loading for Tcl on this system.
   858         -#       DL_LIBS -       Library file(s) to include in tclsh and other base
   859         -#                       applications in order for the "load" command to work.
          987  +#	DL_OBJS, DL_LIBS - removed for TEA, only needed by core.
   860    988   #       LDFLAGS -      Flags to pass to the compiler when linking object
   861    989   #                       files into an executable application binary such
   862    990   #                       as tclsh.
   863    991   #       LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
   864    992   #                       that tell the run-time dynamic linker where to look
   865    993   #                       for shared libraries such as libtcl.so.  Depends on
   866    994   #                       the variable LIB_RUNTIME_DIR in the Makefile. Could
................................................................................
   873   1001   #                       of a shared library (may request position-independent
   874   1002   #                       code, among other things).
   875   1003   #       SHLIB_LD -      Base command to use for combining object files
   876   1004   #                       into a shared library.
   877   1005   #       SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
   878   1006   #                       creating shared libraries.  This symbol typically
   879   1007   #                       goes at the end of the "ld" commands that build
   880         -#                       shared libraries. The value of the symbol is
         1008  +#                       shared libraries. The value of the symbol defaults to
   881   1009   #                       "${LIBS}" if all of the dependent libraries should
   882   1010   #                       be specified when creating a shared library.  If
   883   1011   #                       dependent libraries should not be specified (as on
   884   1012   #                       SunOS 4.x, where they cause the link to fail, or in
   885   1013   #                       general if Tcl and Tk aren't themselves shared
   886   1014   #                       libraries), then this symbol has an empty string
   887   1015   #                       as its value.
................................................................................
   894   1022   #                       by platforms that need non-standard library names.
   895   1023   #                       Examples:  ${VERSION}.so.1.1 on NetBSD, since it needs
   896   1024   #                       to have a version after the .so, and ${VERSION}.a
   897   1025   #                       on AIX, since a shared library needs to have
   898   1026   #                       a .a extension whereas shared objects for loadable
   899   1027   #                       extensions have a .so extension.  Defaults to
   900   1028   #                       ${VERSION}${SHLIB_SUFFIX}.
   901         -#       TCL_NEEDS_EXP_FILE -
   902         -#                       1 means that an export file is needed to link to a
   903         -#                       shared library.
   904         -#       TCL_EXP_FILE -  The name of the installed export / import file which
   905         -#                       should be used to link to the Tcl shared library.
   906         -#                       Empty if Tcl is unshared.
   907         -#       TCL_BUILD_EXP_FILE -
   908         -#                       The name of the built export / import file which
   909         -#                       should be used to link to the Tcl shared library.
   910         -#                       Empty if Tcl is unshared.
   911   1029   #	CFLAGS_DEBUG -
   912   1030   #			Flags used when running the compiler in debug mode
   913   1031   #	CFLAGS_OPTIMIZE -
   914   1032   #			Flags used when running the compiler in optimize mode
   915   1033   #	CFLAGS -	Additional CFLAGS added as necessary (usually 64-bit)
   916         -#
   917   1034   #--------------------------------------------------------------------
   918   1035   
   919   1036   AC_DEFUN([TEA_CONFIG_CFLAGS], [
   920         -    dnl Make sure we are initialized
         1037  +    dnl TEA specific: Make sure we are initialized
   921   1038       AC_REQUIRE([TEA_INIT])
   922   1039   
   923   1040       # Step 0.a: Enable 64 bit support?
   924   1041   
   925   1042       AC_MSG_CHECKING([if 64bit support is requested])
   926   1043       AC_ARG_ENABLE(64bit,
   927   1044   	AC_HELP_STRING([--enable-64bit],
................................................................................
   933   1050   
   934   1051       AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
   935   1052       AC_ARG_ENABLE(64bit-vis,
   936   1053   	AC_HELP_STRING([--enable-64bit-vis],
   937   1054   	    [enable 64bit Sparc VIS support (default: off)]),
   938   1055   	[do64bitVIS=$enableval], [do64bitVIS=no])
   939   1056       AC_MSG_RESULT([$do64bitVIS])
         1057  +    # Force 64bit on with VIS
         1058  +    AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
   940   1059   
   941         -    if test "$do64bitVIS" = "yes"; then
   942         -	# Force 64bit on with VIS
   943         -	do64bit=yes
   944         -    fi
         1060  +    # Step 0.c: Check if visibility support is available. Do this here so
         1061  +    # that platform specific alternatives can be used below if this fails.
   945   1062   
   946         -    # Step 0.c: Cross-compiling options for Windows/CE builds?
         1063  +    AC_CACHE_CHECK([if compiler supports visibility "hidden"],
         1064  +	tcl_cv_cc_visibility_hidden, [
         1065  +	hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
         1066  +	AC_TRY_LINK([
         1067  +	    extern __attribute__((__visibility__("hidden"))) void f(void);
         1068  +	    void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
         1069  +	    tcl_cv_cc_visibility_hidden=no)
         1070  +	CFLAGS=$hold_cflags])
         1071  +    AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
         1072  +	AC_DEFINE(MODULE_SCOPE,
         1073  +	    [extern __attribute__((__visibility__("hidden")))],
         1074  +	    [Compiler support for module scope symbols])
         1075  +    ])
   947   1076   
   948         -    if test "${TEA_PLATFORM}" = "windows" ; then
         1077  +    # Step 0.d: Disable -rpath support?
         1078  +
         1079  +    AC_MSG_CHECKING([if rpath support is requested])
         1080  +    AC_ARG_ENABLE(rpath,
         1081  +	AC_HELP_STRING([--disable-rpath],
         1082  +	    [disable rpath support (default: on)]),
         1083  +	[doRpath=$enableval], [doRpath=yes])
         1084  +    AC_MSG_RESULT([$doRpath])
         1085  +
         1086  +    # TEA specific: Cross-compiling options for Windows/CE builds?
         1087  +
         1088  +    AS_IF([test "${TEA_PLATFORM}" = windows], [
   949   1089   	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])
         1090  +	AC_ARG_ENABLE(wince,
         1091  +	    AC_HELP_STRING([--enable-wince],
         1092  +		[enable Win/CE support (where applicable)]),
         1093  +	    [doWince=$enableval], [doWince=no])
   951   1094   	AC_MSG_RESULT([$doWince])
   952         -    fi
         1095  +    ])
   953   1096   
   954         -    # Step 1: set the variable "system" to hold the name and version number
         1097  +    # Set the variable "system" to hold the name and version number
   955   1098       # for the system.
   956   1099   
   957   1100       TEA_CONFIG_SYSTEM
   958   1101   
   959         -    # Step 2: check for existence of -ldl library.  This is needed because
   960         -    # Linux can use either -ldl or -ldld for dynamic loading.
   961         -
   962         -    AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
   963         -
   964   1102       # Require ranlib early so we can override it in special cases below.
   965   1103   
   966   1104       AC_REQUIRE([AC_PROG_RANLIB])
   967   1105   
   968         -    # Step 3: set configuration options based on system name and version.
         1106  +    # Set configuration options based on system name and version.
   969   1107       # This is similar to Tcl's unix/tcl.m4 except that we've added a
   970         -    # "windows" case.
         1108  +    # "windows" case and removed some core-only vars.
   971   1109   
   972   1110       do64bit_ok=no
   973         -    LDFLAGS_ORIG="$LDFLAGS"
         1111  +    # default to '{$LIBS}' and set to "" on per-platform necessary basis
         1112  +    SHLIB_LD_LIBS='${LIBS}'
   974   1113       # When ld needs options to work in 64-bit mode, put them in
   975   1114       # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
   976   1115       # is disabled by the user. [Bug 1016796]
   977   1116       LDFLAGS_ARCH=""
   978         -    TCL_EXPORT_FILE_SUFFIX=""
   979   1117       UNSHARED_LIB_SUFFIX=""
         1118  +    # TEA specific: use PACKAGE_VERSION instead of VERSION
   980   1119       TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
   981   1120       ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
   982   1121       TCL_LIB_VERSIONS_OK=ok
   983   1122       CFLAGS_DEBUG=-g
   984         -    CFLAGS_OPTIMIZE=-O
   985         -    if test "$GCC" = "yes" ; then
         1123  +    AS_IF([test "$GCC" = yes], [
   986   1124   	CFLAGS_OPTIMIZE=-O2
   987         -	CFLAGS_WARNING="-Wall -Wno-implicit-int"
   988         -    else
         1125  +	CFLAGS_WARNING="-Wall"
         1126  +    ], [
         1127  +	CFLAGS_OPTIMIZE=-O
   989   1128   	CFLAGS_WARNING=""
   990         -    fi
   991         -    TCL_NEEDS_EXP_FILE=0
   992         -    TCL_BUILD_EXP_FILE=""
   993         -    TCL_EXP_FILE=""
   994         -dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
   995         -dnl AC_CHECK_TOOL(AR, ar)
   996         -    AC_CHECK_PROG(AR, ar, ar)
         1129  +    ])
         1130  +    AC_CHECK_TOOL(AR, ar)
   997   1131       STLIB_LD='${AR} cr'
   998   1132       LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
         1133  +    AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION="1.0"])
   999   1134       case $system in
         1135  +	# TEA specific:
  1000   1136   	windows)
  1001   1137   	    # This is a 2-stage check to make sure we have the 64-bit SDK
  1002   1138   	    # We have to know where the SDK is installed.
  1003   1139   	    # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
  1004   1140   	    # MACHINE is IX86 for LINK, but this is used by the manifest,
  1005   1141   	    # which requires x86|amd64|ia64.
  1006   1142   	    MACHINE="X86"
................................................................................
  1016   1152   			PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
  1017   1153   			;;
  1018   1154   		    ia64)
  1019   1155   			MACHINE="IA64"
  1020   1156   			PATH64="${MSSDK}/Bin/Win64"
  1021   1157   			;;
  1022   1158   		esac
  1023         -		if test ! -d "${PATH64}" ; then
         1159  +		if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
  1024   1160   		    AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
  1025   1161   		    AC_MSG_WARN([Ensure latest Platform SDK is installed])
  1026   1162   		    do64bit="no"
  1027   1163   		else
  1028   1164   		    AC_MSG_RESULT([   Using 64-bit $MACHINE mode])
  1029   1165   		    do64bit_ok="yes"
  1030   1166   		fi
................................................................................
  1141   1277   		    CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
  1142   1278   		    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
  1143   1279   		fi
  1144   1280   	    fi
  1145   1281   
  1146   1282   	    if test "$GCC" = "yes"; then
  1147   1283   		# mingw gcc mode
  1148         -		RC="windres"
         1284  +		AC_CHECK_TOOL(RC, windres)
  1149   1285   		CFLAGS_DEBUG="-g"
  1150   1286   		CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
  1151         -		SHLIB_LD="$CC -shared"
         1287  +		SHLIB_LD='${CC} -shared'
  1152   1288   		UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
  1153   1289   		LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
  1154   1290   		LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
         1291  +
         1292  +		AC_CACHE_CHECK(for cross-compile version of gcc,
         1293  +			ac_cv_cross,
         1294  +			AC_TRY_COMPILE([
         1295  +			    #ifdef __WIN32__
         1296  +				#error cross-compiler
         1297  +			    #endif
         1298  +			], [],
         1299  +			ac_cv_cross=yes,
         1300  +			ac_cv_cross=no)
         1301  +		      )
         1302  +		      if test "$ac_cv_cross" = "yes"; then
         1303  +			case "$do64bit" in
         1304  +			    amd64|x64|yes)
         1305  +				CC="x86_64-w64-mingw32-gcc"
         1306  +				LD="x86_64-w64-mingw32-ld"
         1307  +				AR="x86_64-w64-mingw32-ar"
         1308  +				RANLIB="x86_64-w64-mingw32-ranlib"
         1309  +				RC="x86_64-w64-mingw32-windres"
         1310  +			    ;;
         1311  +			    *)
         1312  +				CC="i686-w64-mingw32-gcc"
         1313  +				LD="i686-w64-mingw32-ld"
         1314  +				AR="i686-w64-mingw32-ar"
         1315  +				RANLIB="i686-w64-mingw32-ranlib"
         1316  +				RC="i686-w64-mingw32-windres"
         1317  +			    ;;
         1318  +			esac
         1319  +		fi
         1320  +
  1155   1321   	    else
  1156   1322   		SHLIB_LD="${LINKBIN} -dll ${lflags}"
  1157   1323   		# link -lib only works when -lib is the first arg
  1158   1324   		STLIB_LD="${LINKBIN} -lib ${lflags}"
  1159   1325   		UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
  1160   1326   		PATHTYPE=-w
  1161   1327   		# For information on what debugtype is most useful, see:
  1162   1328   		# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
         1329  +		# and also
         1330  +		# http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
  1163   1331   		# This essentially turns it all on.
  1164         -		LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
         1332  +		LDFLAGS_DEBUG="-debug -debugtype:cv"
  1165   1333   		LDFLAGS_OPTIMIZE="-release"
  1166   1334   		if test "$doWince" != "no" ; then
  1167   1335   		    LDFLAGS_CONSOLE="-link ${lflags}"
  1168   1336   		    LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
  1169   1337   		else
  1170   1338   		    LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
  1171   1339   		    LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
  1172   1340   		fi
  1173   1341   	    fi
  1174   1342   
  1175         -	    SHLIB_LD_LIBS='${LIBS}'
  1176   1343   	    SHLIB_SUFFIX=".dll"
  1177   1344   	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
  1178   1345   
  1179   1346   	    TCL_LIB_VERSIONS_OK=nodots
  1180         -	    # Bogus to avoid getting this turned off
  1181         -	    DL_OBJS="tclLoadNone.obj"
  1182   1347       	    ;;
  1183   1348   	AIX-*)
  1184         -	    if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
         1349  +	    AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
  1185   1350   		# AIX requires the _r compiler when gcc isn't being used
  1186   1351   		case "${CC}" in
  1187         -		    *_r)
         1352  +		    *_r|*_r\ *)
  1188   1353   			# ok ...
  1189   1354   			;;
  1190   1355   		    *)
  1191         -			CC=${CC}_r
         1356  +			# Make sure only first arg gets _r
         1357  +		    	CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
  1192   1358   			;;
  1193   1359   		esac
  1194   1360   		AC_MSG_RESULT([Using $CC for compiling with threads])
  1195         -	    fi
         1361  +	    ])
  1196   1362   	    LIBS="$LIBS -lc"
  1197   1363   	    SHLIB_CFLAGS=""
  1198         -	    SHLIB_LD_LIBS='${LIBS}'
  1199   1364   	    SHLIB_SUFFIX=".so"
  1200   1365   
  1201         -	    DL_OBJS="tclLoadDl.o"
  1202   1366   	    LD_LIBRARY_PATH_VAR="LIBPATH"
  1203   1367   
  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
         1368  +	    # Check to enable 64-bit flags for compiler/linker
         1369  +	    AS_IF([test "$do64bit" = yes], [
         1370  +		AS_IF([test "$GCC" = yes], [
  1207   1371   		    AC_MSG_WARN([64bit mode not supported with GCC on $system])
  1208         -		else 
         1372  +		], [
  1209   1373   		    do64bit_ok=yes
  1210   1374   		    CFLAGS="$CFLAGS -q64"
  1211   1375   		    LDFLAGS_ARCH="-q64"
  1212   1376   		    RANLIB="${RANLIB} -X64"
  1213   1377   		    AR="${AR} -X64"
  1214   1378   		    SHLIB_LD_FLAGS="-b64"
  1215         -		fi
  1216         -	    fi
         1379  +		])
         1380  +	    ])
  1217   1381   
  1218         -	    if test "`uname -m`" = "ia64" ; then
         1382  +	    AS_IF([test "`uname -m`" = ia64], [
  1219   1383   		# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
  1220   1384   		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
         1385  +		AS_IF([test "$GCC" = yes], [
  1224   1386   		    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  1225         -		else
         1387  +		], [
  1226   1388   		    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
  1227         -		fi
         1389  +		])
  1228   1390   		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"
         1391  +	    ], [
         1392  +		AS_IF([test "$GCC" = yes], [
         1393  +		    SHLIB_LD='${CC} -shared -Wl,-bexpall'
         1394  +		], [
         1395  +		    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
         1396  +		    LDFLAGS="$LDFLAGS -brtl"
         1397  +		])
         1398  +		SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
  1237   1399   		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  1238   1400   		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
         1401  +	    ])
  1266   1402   	    ;;
  1267   1403   	BeOS*)
  1268   1404   	    SHLIB_CFLAGS="-fPIC"
  1269         -	    SHLIB_LD="${CC} -nostart"
  1270         -	    SHLIB_LD_LIBS='${LIBS}'
         1405  +	    SHLIB_LD='${CC} -nostart'
  1271   1406   	    SHLIB_SUFFIX=".so"
  1272         -	    DL_OBJS="tclLoadDl.o"
  1273         -	    DL_LIBS="-ldl"
  1274   1407   
  1275   1408   	    #-----------------------------------------------------------
  1276   1409   	    # Check for inet_ntoa in -lbind, for BeOS (which also needs
  1277   1410   	    # -lsocket, even if the network functions are in -lnet which
  1278   1411   	    # is always linked to, for compatibility.
  1279   1412   	    #-----------------------------------------------------------
  1280   1413   	    AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
  1281   1414   	    ;;
  1282         -	BSD/OS-2.1*|BSD/OS-3*)
  1283         -	    SHLIB_CFLAGS=""
  1284         -	    SHLIB_LD="shlicc -r"
  1285         -	    SHLIB_LD_LIBS='${LIBS}'
  1286         -	    SHLIB_SUFFIX=".so"
  1287         -	    DL_OBJS="tclLoadDl.o"
  1288         -	    DL_LIBS="-ldl"
  1289         -	    CC_SEARCH_FLAGS=""
  1290         -	    LD_SEARCH_FLAGS=""
  1291         -	    ;;
  1292   1415   	BSD/OS-4.*)
  1293   1416   	    SHLIB_CFLAGS="-export-dynamic -fPIC"
  1294         -	    SHLIB_LD="cc -shared"
  1295         -	    SHLIB_LD_LIBS='${LIBS}'
         1417  +	    SHLIB_LD='${CC} -shared'
  1296   1418   	    SHLIB_SUFFIX=".so"
  1297         -	    DL_OBJS="tclLoadDl.o"
  1298         -	    DL_LIBS="-ldl"
  1299   1419   	    LDFLAGS="$LDFLAGS -export-dynamic"
  1300   1420   	    CC_SEARCH_FLAGS=""
  1301   1421   	    LD_SEARCH_FLAGS=""
  1302   1422   	    ;;
  1303         -	dgux*)
  1304         -	    SHLIB_CFLAGS="-K PIC"
  1305         -	    SHLIB_LD="cc -G"
  1306         -	    SHLIB_LD_LIBS=""
  1307         -	    SHLIB_SUFFIX=".so"
  1308         -	    DL_OBJS="tclLoadDl.o"
  1309         -	    DL_LIBS="-ldl"
         1423  +	CYGWIN_*)
         1424  +	    SHLIB_CFLAGS=""
         1425  +	    SHLIB_LD='${CC} -shared'
         1426  +	    SHLIB_SUFFIX=".dll"
         1427  +	    EXEEXT=".exe"
  1310   1428   	    CC_SEARCH_FLAGS=""
  1311   1429   	    LD_SEARCH_FLAGS=""
  1312   1430   	    ;;
         1431  +	Haiku*)
         1432  +	    LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
         1433  +	    SHLIB_CFLAGS="-fPIC"
         1434  +	    SHLIB_SUFFIX=".so"
         1435  +	    SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
         1436  +	    AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
         1437  +	    ;;
  1313   1438   	HP-UX-*.11.*)
  1314   1439   	    # Use updated header definitions where possible
  1315   1440   	    AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
  1316         -	    # Needed by Tcl, but not most extensions
         1441  +	    # TEA specific: Needed by Tcl, but not most extensions
  1317   1442   	    #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
  1318   1443   	    #LIBS="$LIBS -lxnet"               # Use the XOPEN network library
  1319   1444   
  1320         -	    if test "`uname -m`" = "ia64" ; then
         1445  +	    AS_IF([test "`uname -m`" = ia64], [
  1321   1446   		SHLIB_SUFFIX=".so"
  1322         -	    else
         1447  +		# Use newer C++ library for C++ extensions
         1448  +		#if test "$GCC" != "yes" ; then
         1449  +		#   CPPFLAGS="-AA"
         1450  +		#fi
         1451  +	    ], [
  1323   1452   		SHLIB_SUFFIX=".sl"
  1324         -	    fi
         1453  +	    ])
  1325   1454   	    AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
  1326         -	    if test "$tcl_ok" = yes; then
  1327         -		SHLIB_CFLAGS="+z"
  1328         -		SHLIB_LD="ld -b"
  1329         -		SHLIB_LD_LIBS='${LIBS}'
  1330         -		DL_OBJS="tclLoadShl.o"
  1331         -		DL_LIBS="-ldld"
         1455  +	    AS_IF([test "$tcl_ok" = yes], [
  1332   1456   		LDFLAGS="$LDFLAGS -Wl,-E"
  1333   1457   		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
  1334   1458   		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
  1335   1459   		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
  1336         -	    fi
  1337         -	    if test "$GCC" = "yes" ; then
  1338         -		SHLIB_LD="gcc -shared"
  1339         -		SHLIB_LD_LIBS='${LIBS}'
         1460  +	    ])
         1461  +	    AS_IF([test "$GCC" = yes], [
         1462  +		SHLIB_LD='${CC} -shared'
  1340   1463   		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1341         -	    fi
  1342         -
  1343         -	    # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
  1344         -	    #CFLAGS="$CFLAGS +DAportable"
         1464  +	    ], [
         1465  +		CFLAGS="$CFLAGS -z"
         1466  +		# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
         1467  +		#CFLAGS="$CFLAGS +DAportable"
         1468  +		SHLIB_CFLAGS="+z"
         1469  +		SHLIB_LD="ld -b"
         1470  +	    ])
  1345   1471   
  1346   1472   	    # Check to enable 64-bit flags for compiler/linker
  1347         -	    if test "$do64bit" = "yes" ; then
  1348         -		if test "$GCC" = "yes" ; then
  1349         -		    hpux_arch=`${CC} -dumpmachine`
  1350         -		    case $hpux_arch in
         1473  +	    AS_IF([test "$do64bit" = "yes"], [
         1474  +		AS_IF([test "$GCC" = yes], [
         1475  +		    case `${CC} -dumpmachine` in
  1351   1476   			hppa64*)
  1352   1477   			    # 64-bit gcc in use.  Fix flags for GNU ld.
  1353   1478   			    do64bit_ok=yes
  1354         -			    SHLIB_LD="${CC} -shared"
  1355         -			    SHLIB_LD_LIBS='${LIBS}'
  1356         -			    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1479  +			    SHLIB_LD='${CC} -shared'
         1480  +			    AS_IF([test $doRpath = yes], [
         1481  +				CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
  1357   1482   			    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1358   1483   			    ;;
  1359   1484   			*)
  1360   1485   			    AC_MSG_WARN([64bit mode not supported with GCC on $system])
  1361   1486   			    ;;
  1362   1487   		    esac
  1363         -		else
         1488  +		], [
  1364   1489   		    do64bit_ok=yes
  1365   1490   		    CFLAGS="$CFLAGS +DD64"
  1366   1491   		    LDFLAGS_ARCH="+DD64"
  1367         -		fi
  1368         -	    fi
  1369         -	    ;;
  1370         -	HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
  1371         -	    SHLIB_SUFFIX=".sl"
  1372         -	    AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
  1373         -	    if test "$tcl_ok" = yes; then
  1374         -		SHLIB_CFLAGS="+z"
  1375         -		SHLIB_LD="ld -b"
  1376         -		SHLIB_LD_LIBS=""
  1377         -		DL_OBJS="tclLoadShl.o"
  1378         -		DL_LIBS="-ldld"
  1379         -		LDFLAGS="$LDFLAGS -Wl,-E"
  1380         -		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
  1381         -		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
  1382         -		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
  1383         -	    fi
  1384         -	    ;;
  1385         -	IRIX-5.*)
  1386         -	    SHLIB_CFLAGS=""
  1387         -	    SHLIB_LD="ld -shared -rdata_shared"
  1388         -	    SHLIB_LD_LIBS='${LIBS}'
  1389         -	    SHLIB_SUFFIX=".so"
  1390         -	    DL_OBJS="tclLoadDl.o"
  1391         -	    DL_LIBS=""
  1392         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1393         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
  1394         -	    ;;
         1492  +		])
         1493  +	    ]) ;;
  1395   1494   	IRIX-6.*)
  1396   1495   	    SHLIB_CFLAGS=""
  1397   1496   	    SHLIB_LD="ld -n32 -shared -rdata_shared"
  1398         -	    SHLIB_LD_LIBS='${LIBS}'
  1399   1497   	    SHLIB_SUFFIX=".so"
  1400         -	    DL_OBJS="tclLoadDl.o"
  1401         -	    DL_LIBS=""
  1402         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1403         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
  1404         -	    if test "$GCC" = "yes" ; then
         1498  +	    AS_IF([test $doRpath = yes], [
         1499  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1500  +		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
         1501  +	    AS_IF([test "$GCC" = yes], [
  1405   1502   		CFLAGS="$CFLAGS -mabi=n32"
  1406   1503   		LDFLAGS="$LDFLAGS -mabi=n32"
  1407         -	    else
         1504  +	    ], [
  1408   1505   		case $system in
  1409   1506   		    IRIX-6.3)
  1410   1507   			# Use to build 6.2 compatible binaries on 6.3.
  1411   1508   			CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
  1412   1509   			;;
  1413   1510   		    *)
  1414   1511   			CFLAGS="$CFLAGS -n32"
  1415   1512   			;;
  1416   1513   		esac
  1417   1514   		LDFLAGS="$LDFLAGS -n32"
  1418         -	    fi
         1515  +	    ])
  1419   1516   	    ;;
  1420   1517   	IRIX64-6.*)
  1421   1518   	    SHLIB_CFLAGS=""
  1422   1519   	    SHLIB_LD="ld -n32 -shared -rdata_shared"
  1423         -	    SHLIB_LD_LIBS='${LIBS}'
  1424   1520   	    SHLIB_SUFFIX=".so"
  1425         -	    DL_OBJS="tclLoadDl.o"
  1426         -	    DL_LIBS=""
  1427         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1428         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
         1521  +	    AS_IF([test $doRpath = yes], [
         1522  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1523  +		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
  1429   1524   
  1430   1525   	    # Check to enable 64-bit flags for compiler/linker
  1431   1526   
  1432         -	    if test "$do64bit" = "yes" ; then
  1433         -	        if test "$GCC" = "yes" ; then
         1527  +	    AS_IF([test "$do64bit" = yes], [
         1528  +	        AS_IF([test "$GCC" = yes], [
  1434   1529   	            AC_MSG_WARN([64bit mode not supported by gcc])
  1435         -	        else
         1530  +	        ], [
  1436   1531   	            do64bit_ok=yes
  1437   1532   	            SHLIB_LD="ld -64 -shared -rdata_shared"
  1438   1533   	            CFLAGS="$CFLAGS -64"
  1439   1534   	            LDFLAGS_ARCH="-64"
  1440         -	        fi
  1441         -	    fi
         1535  +	        ])
         1536  +	    ])
  1442   1537   	    ;;
  1443         -	Linux*)
         1538  +	Linux*|GNU*|NetBSD-Debian)
  1444   1539   	    SHLIB_CFLAGS="-fPIC"
  1445         -	    SHLIB_LD_LIBS='${LIBS}'
  1446   1540   	    SHLIB_SUFFIX=".so"
  1447   1541   
         1542  +	    # TEA specific:
  1448   1543   	    CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
  1449         -	    # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings 
  1450         -	    # when you inline the string and math operations.  Turn this off to
  1451         -	    # get rid of the warnings.
  1452         -	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
  1453   1544   
  1454         -	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
         1545  +	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
  1455   1546   	    SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
  1456         -	    DL_OBJS="tclLoadDl.o"
  1457         -	    DL_LIBS="-ldl"
  1458   1547   	    LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
  1459         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1548  +	    AS_IF([test $doRpath = yes], [
         1549  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
  1460   1550   	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1461         -	    if test "`uname -m`" = "alpha" ; then
  1462         -		CFLAGS="$CFLAGS -mieee"
  1463         -	    fi
  1464         -	    if test $do64bit = yes; then
         1551  +	    AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
         1552  +	    AS_IF([test $do64bit = yes], [
  1465   1553   		AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
  1466   1554   		    hold_cflags=$CFLAGS
  1467   1555   		    CFLAGS="$CFLAGS -m64"
  1468   1556   		    AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
  1469   1557   		    CFLAGS=$hold_cflags])
  1470         -		if test $tcl_cv_cc_m64 = yes; then
         1558  +		AS_IF([test $tcl_cv_cc_m64 = yes], [
  1471   1559   		    CFLAGS="$CFLAGS -m64"
  1472   1560   		    do64bit_ok=yes
  1473         -		fi
  1474         -	    fi
         1561  +		])
         1562  +	   ])
  1475   1563   
  1476         -	    # The combo of gcc + glibc has a bug related
  1477         -	    # to inlining of functions like strtod(). The
  1478         -	    # -fno-builtin flag should address this problem
  1479         -	    # but it does not work. The -fno-inline flag
  1480         -	    # is kind of overkill but it works.
  1481         -	    # Disable inlining only when one of the
         1564  +	    # The combo of gcc + glibc has a bug related to inlining of
         1565  +	    # functions like strtod(). The -fno-builtin flag should address
         1566  +	    # this problem but it does not work. The -fno-inline flag is kind
         1567  +	    # of overkill but it works. Disable inlining only when one of the
  1482   1568   	    # files in compat/*.c is being linked in.
  1483         -	    if test x"${USE_COMPAT}" != x ; then
  1484         -	        CFLAGS="$CFLAGS -fno-inline"
  1485         -	    fi
  1486   1569   
  1487         -	    ;;
  1488         -	GNU*)
  1489         -	    SHLIB_CFLAGS="-fPIC"
  1490         -	    SHLIB_LD_LIBS='${LIBS}'
  1491         -	    SHLIB_SUFFIX=".so"
  1492         -
  1493         -	    SHLIB_LD="${CC} -shared"
  1494         -	    DL_OBJS=""
  1495         -	    DL_LIBS="-ldl"
  1496         -	    LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
  1497         -	    CC_SEARCH_FLAGS=""
  1498         -	    LD_SEARCH_FLAGS=""
  1499         -	    if test "`uname -m`" = "alpha" ; then
  1500         -		CFLAGS="$CFLAGS -mieee"
  1501         -	    fi
         1570  +	    AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
  1502   1571   	    ;;
  1503   1572   	Lynx*)
  1504   1573   	    SHLIB_CFLAGS="-fPIC"
  1505         -	    SHLIB_LD_LIBS='${LIBS}'
  1506   1574   	    SHLIB_SUFFIX=".so"
  1507   1575   	    CFLAGS_OPTIMIZE=-02
  1508         -	    SHLIB_LD="${CC} -shared "
  1509         -	    DL_OBJS="tclLoadDl.o"
  1510         -	    DL_LIBS="-mshared -ldl"
         1576  +	    SHLIB_LD='${CC} -shared'
  1511   1577   	    LD_FLAGS="-Wl,--export-dynamic"
  1512         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1513         -	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1514         -	    ;;
  1515         -	MP-RAS-02*)
  1516         -	    SHLIB_CFLAGS="-K PIC"
  1517         -	    SHLIB_LD="cc -G"
  1518         -	    SHLIB_LD_LIBS=""
  1519         -	    SHLIB_SUFFIX=".so"
  1520         -	    DL_OBJS="tclLoadDl.o"
  1521         -	    DL_LIBS="-ldl"
  1522         -	    CC_SEARCH_FLAGS=""
  1523         -	    LD_SEARCH_FLAGS=""
  1524         -	    ;;
  1525         -	MP-RAS-*)
  1526         -	    SHLIB_CFLAGS="-K PIC"
  1527         -	    SHLIB_LD="cc -G"
  1528         -	    SHLIB_LD_LIBS=""
  1529         -	    SHLIB_SUFFIX=".so"
  1530         -	    DL_OBJS="tclLoadDl.o"
  1531         -	    DL_LIBS="-ldl"
  1532         -	    LDFLAGS="$LDFLAGS -Wl,-Bexport"
  1533         -	    CC_SEARCH_FLAGS=""
  1534         -	    LD_SEARCH_FLAGS=""
  1535         -	    ;;
  1536         -	NetBSD-*|FreeBSD-[[1-2]].*)
  1537         -	    # NetBSD/SPARC needs -fPIC, -fpic will not do.
  1538         -	    SHLIB_CFLAGS="-fPIC"
  1539         -	    SHLIB_LD="ld -Bshareable -x"
  1540         -	    SHLIB_LD_LIBS='${LIBS}'
  1541         -	    SHLIB_SUFFIX=".so"
  1542         -	    DL_OBJS="tclLoadDl.o"
  1543         -	    DL_LIBS=""
  1544         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1545         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
         1578  +	    AS_IF([test $doRpath = yes], [
         1579  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1580  +		LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
         1581  +	    ;;
         1582  +	OpenBSD-*)
         1583  +	    arch=`arch -s`
         1584  +	    case "$arch" in
         1585  +	    m88k|vax)
         1586  +		SHLIB_SUFFIX=""
         1587  +		SHARED_LIB_SUFFIX=""
         1588  +		;;
         1589  +	    *)
         1590  +		SHLIB_CFLAGS="-fPIC"
         1591  +		SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
         1592  +		SHLIB_SUFFIX=".so"
         1593  +		AS_IF([test $doRpath = yes], [
         1594  +		    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
         1595  +		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
         1596  +		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
         1597  +		;;
         1598  +	    esac
         1599  +	    case "$arch" in
         1600  +	    m88k|vax)
         1601  +		CFLAGS_OPTIMIZE="-O1"
         1602  +		;;
         1603  +	    *)
         1604  +		CFLAGS_OPTIMIZE="-O2"
         1605  +		;;
         1606  +	    esac
  1546   1607   	    AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
  1547   1608   		AC_EGREP_CPP(yes, [
  1548   1609   #ifdef __ELF__
  1549   1610   	yes
  1550   1611   #endif
  1551   1612   		], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
  1552         -	    if test $tcl_cv_ld_elf = yes; then
  1553         -		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
  1554         -	    else
  1555         -		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
  1556         -	    fi
  1557         -
  1558         -	    # Ancient FreeBSD doesn't handle version numbers with dots.
  1559         -
  1560         -	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
  1561         -	    TCL_LIB_VERSIONS_OK=nodots
  1562         -	    ;;
  1563         -	OpenBSD-*)
  1564         -	    # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
  1565         -	    case `machine` in
  1566         -	    sparc|sparc64)
  1567         -		SHLIB_CFLAGS="-fPIC";;
  1568         -	    *)
  1569         -		SHLIB_CFLAGS="-fpic";;
  1570         -	    esac
  1571         -	    SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
  1572         -	    SHLIB_LD_LIBS='${LIBS}'
  1573         -	    SHLIB_SUFFIX=".so"
  1574         -	    DL_OBJS="tclLoadDl.o"
  1575         -	    DL_LIBS=""
  1576         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1577         -	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1578         -	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
  1579         -	    AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
  1580         -		AC_EGREP_CPP(yes, [
  1581         -#ifdef __ELF__
  1582         -	yes
  1583         -#endif
  1584         -		], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
  1585         -	    if test $tcl_cv_ld_elf = yes; then
         1613  +	    AS_IF([test $tcl_cv_ld_elf = yes], [
  1586   1614   		LDFLAGS=-Wl,-export-dynamic
  1587         -	    else
  1588         -		LDFLAGS=""
  1589         -	    fi
  1590         -
         1615  +	    ], [LDFLAGS=""])
         1616  +	    AS_IF([test "${TCL_THREADS}" = "1"], [
         1617  +		# On OpenBSD:	Compile with -pthread
         1618  +		#		Don't link with -lpthread
         1619  +		LIBS=`echo $LIBS | sed s/-lpthread//`
         1620  +		CFLAGS="$CFLAGS -pthread"
         1621  +	    ])
  1591   1622   	    # OpenBSD doesn't do version numbers with dots.
  1592   1623   	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
  1593   1624   	    TCL_LIB_VERSIONS_OK=nodots
  1594   1625   	    ;;
  1595         -	FreeBSD-*)
  1596         -	    # FreeBSD 3.* and greater have ELF.
         1626  +	NetBSD-*)
         1627  +	    # NetBSD has ELF and can use 'cc -shared' to build shared libs
  1597   1628   	    SHLIB_CFLAGS="-fPIC"
  1598         -	    SHLIB_LD="ld -Bshareable -x"
  1599         -	    SHLIB_LD_LIBS='${LIBS}'
         1629  +	    SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
  1600   1630   	    SHLIB_SUFFIX=".so"
  1601         -	    DL_OBJS="tclLoadDl.o"
  1602         -	    DL_LIBS=""
  1603   1631   	    LDFLAGS="$LDFLAGS -export-dynamic"
  1604         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1605         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
  1606         -	    if test "${TCL_THREADS}" = "1" ; then
         1632  +	    AS_IF([test $doRpath = yes], [
         1633  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
         1634  +	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
         1635  +	    AS_IF([test "${TCL_THREADS}" = "1"], [
  1607   1636   		# The -pthread needs to go in the CFLAGS, not LIBS
  1608   1637   		LIBS=`echo $LIBS | sed s/-pthread//`
  1609   1638   		CFLAGS="$CFLAGS -pthread"
  1610   1639   	    	LDFLAGS="$LDFLAGS -pthread"
  1611         -	    fi
  1612         -	    case $system in
  1613         -	    FreeBSD-3.*)
  1614         -	    	# FreeBSD-3 doesn't handle version numbers with dots.
  1615         -	    	UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
  1616         -	    	SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
  1617         -	    	TCL_LIB_VERSIONS_OK=nodots
  1618         -		;;
  1619         -	    esac
         1640  +	    ])
         1641  +	    ;;
         1642  +	FreeBSD-*)
         1643  +	    # This configuration from FreeBSD Ports.
         1644  +	    SHLIB_CFLAGS="-fPIC"
         1645  +	    SHLIB_LD="${CC} -shared"
         1646  +	    TCL_SHLIB_LD_EXTRAS="-Wl,-soname \$[@]"
         1647  +	    SHLIB_SUFFIX=".so"
         1648  +	    LDFLAGS=""
         1649  +	    AS_IF([test $doRpath = yes], [
         1650  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1651  +		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
         1652  +	    AS_IF([test "${TCL_THREADS}" = "1"], [
         1653  +		# The -pthread needs to go in the LDFLAGS, not LIBS
         1654  +		LIBS=`echo $LIBS | sed s/-pthread//`
         1655  +		CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
         1656  +		LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
         1657  +	    # Version numbers are dot-stripped by system policy.
         1658  +	    TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
         1659  +	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
         1660  +	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
         1661  +	    TCL_LIB_VERSIONS_OK=nodots
  1620   1662   	    ;;
  1621   1663   	Darwin-*)
  1622   1664   	    CFLAGS_OPTIMIZE="-Os"
  1623   1665   	    SHLIB_CFLAGS="-fno-common"
  1624   1666   	    # To avoid discrepancies between what headers configure sees during
  1625   1667   	    # preprocessing tests and compiling tests, move any -isysroot and
  1626   1668   	    # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
  1627   1669   	    CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
  1628   1670   		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
  1629   1671   		if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
  1630   1672   	    CFLAGS="`echo " ${CFLAGS}" | \
  1631   1673   		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
  1632   1674   		if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
  1633         -	    if test $do64bit = yes; then
         1675  +	    AS_IF([test $do64bit = yes], [
  1634   1676   		case `arch` in
  1635   1677   		    ppc)
  1636   1678   			AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
  1637   1679   				tcl_cv_cc_arch_ppc64, [
  1638   1680   			    hold_cflags=$CFLAGS
  1639   1681   			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
  1640   1682   			    AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
  1641   1683   				    tcl_cv_cc_arch_ppc64=no)
  1642   1684   			    CFLAGS=$hold_cflags])
  1643         -			if test $tcl_cv_cc_arch_ppc64 = yes; then
         1685  +			AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
  1644   1686   			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
  1645   1687   			    do64bit_ok=yes
  1646         -			fi;;
         1688  +			]);;
  1647   1689   		    i386)
  1648   1690   			AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
  1649   1691   				tcl_cv_cc_arch_x86_64, [
  1650   1692   			    hold_cflags=$CFLAGS
  1651   1693   			    CFLAGS="$CFLAGS -arch x86_64"
  1652   1694   			    AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
  1653   1695   				    tcl_cv_cc_arch_x86_64=no)
  1654   1696   			    CFLAGS=$hold_cflags])
  1655         -			if test $tcl_cv_cc_arch_x86_64 = yes; then
         1697  +			AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
  1656   1698   			    CFLAGS="$CFLAGS -arch x86_64"
  1657   1699   			    do64bit_ok=yes
  1658         -			fi;;
         1700  +			]);;
  1659   1701   		    *)
  1660   1702   			AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
  1661   1703   		esac
  1662         -	    else
         1704  +	    ], [
  1663   1705   		# Check for combined 32-bit and 64-bit fat build
  1664         -		echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
  1665         -		    echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
  1666         -		    fat_32_64=yes
  1667         -	    fi
  1668         -	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
         1706  +		AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
         1707  +		    && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
         1708  +		    fat_32_64=yes])
         1709  +	    ])
         1710  +	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
  1669   1711   	    SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
  1670   1712   	    AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
  1671   1713   		hold_ldflags=$LDFLAGS
  1672   1714   		LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
  1673   1715   		AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
  1674   1716   		LDFLAGS=$hold_ldflags])
  1675         -	    if test $tcl_cv_ld_single_module = yes; then
         1717  +	    AS_IF([test $tcl_cv_ld_single_module = yes], [
  1676   1718   		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
  1677         -	    fi
  1678         -	    SHLIB_LD_LIBS='${LIBS}'
         1719  +	    ])
         1720  +	    # TEA specific: link shlib with current and compatibility version flags
         1721  +	    vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
         1722  +	    SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
  1679   1723   	    SHLIB_SUFFIX=".dylib"
  1680         -	    DL_OBJS="tclLoadDyld.o"
  1681         -	    DL_LIBS=""
  1682   1724   	    # Don't use -prebind when building for Mac OS X 10.4 or later only:
  1683         -	    test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
  1684         -		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \
  1685         -		LDFLAGS="$LDFLAGS -prebind"
         1725  +	    AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
         1726  +		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
         1727  +		LDFLAGS="$LDFLAGS -prebind"])
  1686   1728   	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
  1687         -	    AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
         1729  +	    AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
         1730  +		    tcl_cv_ld_search_paths_first, [
  1688   1731   		hold_ldflags=$LDFLAGS
  1689   1732   		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
  1690         -		AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
         1733  +		AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
         1734  +			tcl_cv_ld_search_paths_first=no)
  1691   1735   		LDFLAGS=$hold_ldflags])
  1692         -	    if test $tcl_cv_ld_search_paths_first = yes; then
         1736  +	    AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
  1693   1737   		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
  1694         -	    fi
         1738  +	    ])
         1739  +	    AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
         1740  +		AC_DEFINE(MODULE_SCOPE, [__private_extern__],
         1741  +		    [Compiler support for module scope symbols])
         1742  +		tcl_cv_cc_visibility_hidden=yes
         1743  +	    ])
  1695   1744   	    CC_SEARCH_FLAGS=""
  1696   1745   	    LD_SEARCH_FLAGS=""
  1697   1746   	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
  1698         -
  1699         -	    # TEA specific: for Tk extensions, remove 64-bit arch flags from
  1700         -	    # CFLAGS et al. for combined 32 & 64 bit fat builds as neither
  1701         -	    # TkAqua nor TkX11 can be built for 64-bit at present.
  1702         -	    test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do
  1703         -		eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done
  1704         -	    ;;
  1705         -	NEXTSTEP-*)
  1706         -	    SHLIB_CFLAGS=""
  1707         -	    SHLIB_LD="cc -nostdlib -r"
  1708         -	    SHLIB_LD_LIBS=""
  1709         -	    SHLIB_SUFFIX=".so"
  1710         -	    DL_OBJS="tclLoadNext.o"
  1711         -	    DL_LIBS=""
  1712         -	    CC_SEARCH_FLAGS=""
  1713         -	    LD_SEARCH_FLAGS=""
         1747  +	    # TEA specific: for combined 32 & 64 bit fat builds of Tk
         1748  +	    # extensions, verify that 64-bit build is possible.
         1749  +	    AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
         1750  +		AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
         1751  +		    AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
         1752  +			for v in CFLAGS CPPFLAGS LDFLAGS; do
         1753  +			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
         1754  +			done
         1755  +			CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
         1756  +			LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
         1757  +			AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
         1758  +			    tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
         1759  +			for v in CFLAGS CPPFLAGS LDFLAGS; do
         1760  +			    eval $v'="$hold_'$v'"'
         1761  +			done])
         1762  +		])
         1763  +		AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [
         1764  +		    AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [
         1765  +			for v in CFLAGS CPPFLAGS LDFLAGS; do
         1766  +			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
         1767  +			done
         1768  +			CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
         1769  +			LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
         1770  +			AC_TRY_LINK([#include <tk.h>], [Tk_InitStubs(NULL, "", 0);],
         1771  +			    tcl_cv_lib_tk_64=yes, tcl_cv_lib_tk_64=no)
         1772  +			for v in CFLAGS CPPFLAGS LDFLAGS; do
         1773  +			    eval $v'="$hold_'$v'"'
         1774  +			done])
         1775  +		])
         1776  +		# remove 64-bit arch flags from CFLAGS et al. if configuration
         1777  +		# does not support 64-bit.
         1778  +		AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [
         1779  +		    AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
         1780  +		    for v in CFLAGS CPPFLAGS LDFLAGS; do
         1781  +			eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
         1782  +		    done])
         1783  +	    ])
  1714   1784   	    ;;
  1715   1785   	OS/390-*)
  1716   1786   	    CFLAGS_OPTIMIZE=""		# Optimizer is buggy
  1717   1787   	    AC_DEFINE(_OE_SOCKETS, 1,	# needed in sys/socket.h
  1718   1788   		[Should OS/390 do the right thing with sockets?])
  1719         -	    ;;      
  1720         -	OSF1-1.0|OSF1-1.1|OSF1-1.2)
  1721         -	    # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
  1722         -	    SHLIB_CFLAGS=""
  1723         -	    # Hack: make package name same as library name
  1724         -	    SHLIB_LD='ld -R -export $@:'
  1725         -	    SHLIB_LD_LIBS=""
  1726         -	    SHLIB_SUFFIX=".so"
  1727         -	    DL_OBJS="tclLoadOSF.o"
  1728         -	    DL_LIBS=""
  1729         -	    CC_SEARCH_FLAGS=""
  1730         -	    LD_SEARCH_FLAGS=""
  1731         -	    ;;
  1732         -	OSF1-1.*)
  1733         -	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
  1734         -	    SHLIB_CFLAGS="-fPIC"
  1735         -	    if test "$SHARED_BUILD" = "1" ; then
  1736         -	        SHLIB_LD="ld -shared"
  1737         -	    else
  1738         -	        SHLIB_LD="ld -non_shared"
  1739         -	    fi
  1740         -	    SHLIB_LD_LIBS=""
  1741         -	    SHLIB_SUFFIX=".so"
  1742         -	    DL_OBJS="tclLoadDl.o"
  1743         -	    DL_LIBS=""
  1744         -	    CC_SEARCH_FLAGS=""
  1745         -	    LD_SEARCH_FLAGS=""
  1746   1789   	    ;;
  1747   1790   	OSF1-V*)
  1748   1791   	    # Digital OSF/1
  1749   1792   	    SHLIB_CFLAGS=""
  1750         -	    if test "$SHARED_BUILD" = "1" ; then
         1793  +	    AS_IF([test "$SHARED_BUILD" = 1], [
  1751   1794   	        SHLIB_LD='ld -shared -expect_unresolved "*"'
  1752         -	    else
         1795  +	    ], [
  1753   1796   	        SHLIB_LD='ld -non_shared -expect_unresolved "*"'
  1754         -	    fi
  1755         -	    SHLIB_LD_LIBS=""
         1797  +	    ])
  1756   1798   	    SHLIB_SUFFIX=".so"
  1757         -	    DL_OBJS="tclLoadDl.o"
  1758         -	    DL_LIBS=""
  1759         -	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  1760         -	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
  1761         -	    if test "$GCC" = "yes" ; then
  1762         -		CFLAGS="$CFLAGS -mieee"
  1763         -            else
  1764         -		CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
  1765         -	    fi
         1799  +	    AS_IF([test $doRpath = yes], [
         1800  +		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
         1801  +		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
         1802  +	    AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
         1803  +		CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
  1766   1804   	    # see pthread_intro(3) for pthread support on osf1, k.furukawa
  1767         -	    if test "${TCL_THREADS}" = "1" ; then
         1805  +	    AS_IF([test "${TCL_THREADS}" = 1], [
  1768   1806   		CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
  1769   1807   		CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
  1770   1808   		LIBS=`echo $LIBS | sed s/-lpthreads//`
  1771         -		if test "$GCC" = "yes" ; then
         1809  +		AS_IF([test "$GCC" = yes], [
  1772   1810   		    LIBS="$LIBS -lpthread -lmach -lexc"
  1773         -		else
         1811  +		], [
  1774   1812   		    CFLAGS="$CFLAGS -pthread"
  1775   1813   		    LDFLAGS="$LDFLAGS -pthread"
  1776         -		fi
  1777         -	    fi
  1778         -
         1814  +		])
         1815  +	    ])
  1779   1816   	    ;;
  1780   1817   	QNX-6*)
  1781   1818   	    # QNX RTP
  1782   1819   	    # This may work for all QNX, but it was only reported for v6.
  1783   1820   	    SHLIB_CFLAGS="-fPIC"
  1784   1821   	    SHLIB_LD="ld -Bshareable -x"
  1785   1822   	    SHLIB_LD_LIBS=""
  1786   1823   	    SHLIB_SUFFIX=".so"
  1787         -	    DL_OBJS="tclLoadDl.o"
  1788         -	    # dlopen is in -lc on QNX
  1789         -	    DL_LIBS=""
  1790   1824   	    CC_SEARCH_FLAGS=""
  1791   1825   	    LD_SEARCH_FLAGS=""
  1792   1826   	    ;;
  1793   1827   	SCO_SV-3.2*)
  1794         -	    # Note, dlopen is available only on SCO 3.2.5 and greater. However,
  1795         -	    # this test works, since "uname -s" was non-standard in 3.2.4 and
  1796         -	    # below.
  1797         -	    if test "$GCC" = "yes" ; then
  1798         -	    	SHLIB_CFLAGS="-fPIC -melf"
  1799         -	    	LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
  1800         -	    else
  1801         -	    	SHLIB_CFLAGS="-Kpic -belf"
  1802         -	    	LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
  1803         -	    fi
         1828  +	    AS_IF([test "$GCC" = yes], [
         1829  +		SHLIB_CFLAGS="-fPIC -melf"
         1830  +		LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
         1831  +	    ], [
         1832  +	       SHLIB_CFLAGS="-Kpic -belf"
         1833  +	       LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
         1834  +	    ])
  1804   1835   	    SHLIB_LD="ld -G"
  1805   1836   	    SHLIB_LD_LIBS=""
  1806   1837   	    SHLIB_SUFFIX=".so"
  1807         -	    DL_OBJS="tclLoadDl.o"
  1808         -	    DL_LIBS=""
  1809   1838   	    CC_SEARCH_FLAGS=""
  1810   1839   	    LD_SEARCH_FLAGS=""
  1811   1840   	    ;;
  1812         -	SINIX*5.4*)
  1813         -	    SHLIB_CFLAGS="-K PIC"
  1814         -	    SHLIB_LD="cc -G"
  1815         -	    SHLIB_LD_LIBS=""
  1816         -	    SHLIB_SUFFIX=".so"
  1817         -	    DL_OBJS="tclLoadDl.o"
  1818         -	    DL_LIBS="-ldl"
  1819         -	    CC_SEARCH_FLAGS=""
  1820         -	    LD_SEARCH_FLAGS=""
  1821         -	    ;;
  1822         -	SunOS-4*)
  1823         -	    SHLIB_CFLAGS="-PIC"
  1824         -	    SHLIB_LD="ld"
  1825         -	    SHLIB_LD_LIBS=""
  1826         -	    SHLIB_SUFFIX=".so"
  1827         -	    DL_OBJS="tclLoadDl.o"
  1828         -	    DL_LIBS="-ldl"
  1829         -	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  1830         -	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1831         -
  1832         -	    # SunOS can't handle version numbers with dots in them in library
  1833         -	    # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
  1834         -	    # requires an extra version number at the end of .so file names.
  1835         -	    # So, the library has to have a name like libtcl75.so.1.0
  1836         -
  1837         -	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
  1838         -	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
  1839         -	    TCL_LIB_VERSIONS_OK=nodots
  1840         -	    ;;
  1841   1841   	SunOS-5.[[0-6]])
  1842   1842   	    # Careful to not let 5.10+ fall into this case
  1843   1843   
  1844   1844   	    # Note: If _REENTRANT isn't defined, then Solaris
  1845   1845   	    # won't define thread-safe library routines.
  1846   1846   
  1847   1847   	    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
  1848   1848   	    AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
  1849   1849   		[Do we really want to follow the standard? Yes we do!])
  1850   1850   
  1851   1851   	    SHLIB_CFLAGS="-KPIC"
  1852         -
  1853         -	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
  1854         -	    # symbols when dynamically loaded into tclsh.
  1855         -
  1856         -	    SHLIB_LD_LIBS='${LIBS}'
  1857   1852   	    SHLIB_SUFFIX=".so"
  1858         -	    DL_OBJS="tclLoadDl.o"
  1859         -	    DL_LIBS="-ldl"
  1860         -	    if test "$GCC" = "yes" ; then
  1861         -		SHLIB_LD="$CC -shared"
         1853  +	    AS_IF([test "$GCC" = yes], [
         1854  +		SHLIB_LD='${CC} -shared'
  1862   1855   		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  1863   1856   		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1864         -	    else
         1857  +	    ], [
  1865   1858   		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
  1866   1859   		CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
  1867   1860   		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1868         -	    fi
         1861  +	    ])
  1869   1862   	    ;;
  1870   1863   	SunOS-5*)
  1871   1864   	    # Note: If _REENTRANT isn't defined, then Solaris
  1872   1865   	    # won't define thread-safe library routines.
  1873   1866   
  1874   1867   	    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
  1875   1868   	    AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
  1876   1869   		[Do we really want to follow the standard? Yes we do!])
  1877   1870   
  1878   1871   	    SHLIB_CFLAGS="-KPIC"
  1879   1872   
  1880   1873   	    # Check to enable 64-bit flags for compiler/linker
  1881         -	    if test "$do64bit" = "yes" ; then
         1874  +	    AS_IF([test "$do64bit" = yes], [
  1882   1875   		arch=`isainfo`
  1883         -		if test "$arch" = "sparcv9 sparc" ; then
  1884         -			if test "$GCC" = "yes" ; then
  1885         -			    if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then
  1886         -				AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
  1887         -			    else
  1888         -				do64bit_ok=yes
  1889         -				CFLAGS="$CFLAGS -m64 -mcpu=v9"
  1890         -				LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
  1891         -				SHLIB_CFLAGS="-fPIC"
  1892         -			    fi
  1893         -			else
         1876  +		AS_IF([test "$arch" = "sparcv9 sparc"], [
         1877  +		    AS_IF([test "$GCC" = yes], [
         1878  +			AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
         1879  +			    AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
         1880  +			], [
  1894   1881   			    do64bit_ok=yes
  1895         -			    if test "$do64bitVIS" = "yes" ; then
  1896         -				CFLAGS="$CFLAGS -xarch=v9a"
  1897         -			    	LDFLAGS_ARCH="-xarch=v9a"
  1898         -			    else
  1899         -				CFLAGS="$CFLAGS -xarch=v9"
  1900         -			    	LDFLAGS_ARCH="-xarch=v9"
  1901         -			    fi
  1902         -			    # Solaris 64 uses this as well
  1903         -			    #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
  1904         -			fi
  1905         -		elif test "$arch" = "amd64 i386" ; then
  1906         -		    if test "$GCC" = "yes" ; then
  1907         -			AC_MSG_WARN([64bit mode not supported with GCC on $system])
  1908         -		    else
         1882  +			    CFLAGS="$CFLAGS -m64 -mcpu=v9"
         1883  +			    LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
         1884  +			    SHLIB_CFLAGS="-fPIC"
         1885  +			])
         1886  +		    ], [
         1887  +			do64bit_ok=yes
         1888  +			AS_IF([test "$do64bitVIS" = yes], [
         1889  +			    CFLAGS="$CFLAGS -xarch=v9a"
         1890  +			    LDFLAGS_ARCH="-xarch=v9a"
         1891  +			], [
         1892  +			    CFLAGS="$CFLAGS -xarch=v9"
         1893  +			    LDFLAGS_ARCH="-xarch=v9"
         1894  +			])
         1895  +			# Solaris 64 uses this as well
         1896  +			#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
         1897  +		    ])
         1898  +		], [AS_IF([test "$arch" = "amd64 i386"], [
         1899  +		    AS_IF([test "$GCC" = yes], [
         1900  +			case $system in
         1901  +			    SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
         1902  +				do64bit_ok=yes
         1903  +				CFLAGS="$CFLAGS -m64"
         1904  +				LDFLAGS="$LDFLAGS -m64";;
         1905  +			    *)
         1906  +				AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
         1907  +			esac
         1908  +		    ], [
  1909   1909   			do64bit_ok=yes
  1910         -			CFLAGS="$CFLAGS -xarch=amd64"
  1911         -			LDFLAGS="$LDFLAGS -xarch=amd64"
  1912         -		    fi
  1913         -		else
  1914         -		    AC_MSG_WARN([64bit mode not supported for $arch])
  1915         -		fi
  1916         -	    fi
  1917         -	    
  1918         -	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
  1919         -	    # symbols when dynamically loaded into tclsh.
         1910  +			case $system in
         1911  +			    SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
         1912  +				CFLAGS="$CFLAGS -m64"
         1913  +				LDFLAGS="$LDFLAGS -m64";;
         1914  +			    *)
         1915  +				CFLAGS="$CFLAGS -xarch=amd64"
         1916  +				LDFLAGS="$LDFLAGS -xarch=amd64";;
         1917  +			esac
         1918  +		    ])
         1919  +		], [AC_MSG_WARN([64bit mode not supported for $arch])])])
         1920  +	    ])
  1920   1921   
  1921         -	    SHLIB_LD_LIBS='${LIBS}'
  1922   1922   	    SHLIB_SUFFIX=".so"
  1923         -	    DL_OBJS="tclLoadDl.o"
  1924         -	    DL_LIBS="-ldl"
  1925         -	    if test "$GCC" = "yes" ; then
  1926         -		SHLIB_LD="$CC -shared"
         1923  +	    AS_IF([test "$GCC" = yes], [
         1924  +		SHLIB_LD='${CC} -shared'
  1927   1925   		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  1928   1926   		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
  1929         -		if test "$do64bit_ok" = "yes" ; then
  1930         -		    # We need to specify -static-libgcc or we need to
  1931         -		    # add the path to the sparv9 libgcc.
  1932         -		    # JH: static-libgcc is necessary for core Tcl, but may
  1933         -		    # not be necessary for extensions.
  1934         -		    SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
  1935         -		    # for finding sparcv9 libgcc, get the regular libgcc
  1936         -		    # path, remove so name and append 'sparcv9'
  1937         -		    #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
  1938         -		    #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
  1939         -		fi
  1940         -	    else
  1941         -		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
         1927  +		AS_IF([test "$do64bit_ok" = yes], [
         1928  +		    AS_IF([test "$arch" = "sparcv9 sparc"], [
         1929  +			# We need to specify -static-libgcc or we need to
         1930  +			# add the path to the sparv9 libgcc.
         1931  +			# JH: static-libgcc is necessary for core Tcl, but may
         1932  +			# not be necessary for extensions.
         1933  +			SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
         1934  +			# for finding sparcv9 libgcc, get the regular libgcc
         1935  +			# path, remove so name and append 'sparcv9'
         1936  +			#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
         1937  +			#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
         1938  +		    ], [AS_IF([test "$arch" = "amd64 i386"], [
         1939  +			# JH: static-libgcc is necessary for core Tcl, but may
         1940  +			# not be necessary for extensions.
         1941  +			SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
         1942  +		    ])])
         1943  +		])
         1944  +	    ], [
         1945  +		case $system in
         1946  +		    SunOS-5.[[1-9]][[0-9]]*)
         1947  +			# TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
         1948  +			SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
         1949  +		    *)
         1950  +			SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
         1951  +		esac
  1942   1952   		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  1943   1953   		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
  1944         -	    fi
         1954  +	    ])
  1945   1955   	    ;;
  1946   1956   	UNIX_SV* | UnixWare-5*)
  1947   1957   	    SHLIB_CFLAGS="-KPIC"
  1948         -	    SHLIB_LD="cc -G"
         1958  +	    SHLIB_LD='${CC} -G'
  1949   1959   	    SHLIB_LD_LIBS=""
  1950   1960   	    SHLIB_SUFFIX=".so"
  1951         -	    DL_OBJS="tclLoadDl.o"
  1952         -	    DL_LIBS="-ldl"
  1953   1961   	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
  1954   1962   	    # that don't grok the -Bexport option.  Test that it does.
  1955   1963   	    AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
  1956   1964   		hold_ldflags=$LDFLAGS
  1957   1965   		LDFLAGS="$LDFLAGS -Wl,-Bexport"
  1958   1966   		AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
  1959   1967   	        LDFLAGS=$hold_ldflags])
  1960         -	    if test $tcl_cv_ld_Bexport = yes; then
         1968  +	    AS_IF([test $tcl_cv_ld_Bexport = yes], [
  1961   1969   		LDFLAGS="$LDFLAGS -Wl,-Bexport"
  1962         -	    fi
         1970  +	    ])
  1963   1971   	    CC_SEARCH_FLAGS=""
  1964   1972   	    LD_SEARCH_FLAGS=""
  1965   1973   	    ;;
  1966   1974       esac
  1967   1975   
  1968         -    if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
         1976  +    AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
  1969   1977   	AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
  1970         -    fi
         1978  +    ])
  1971   1979   
  1972   1980   dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
  1973   1981   dnl # until the end of configure, as configure's compile and link tests use
  1974   1982   dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
  1975   1983   dnl # preprocessing tests use only CPPFLAGS.
  1976   1984       AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
  1977   1985   
  1978         -    # Step 4: disable dynamic loading if requested via a command-line switch.
  1979         -
  1980         -    AC_ARG_ENABLE(load,
  1981         -	AC_HELP_STRING([--enable-load],
  1982         -	    [allow dynamic loading and "load" command (default: on)]),
  1983         -	[tcl_ok=$enableval], [tcl_ok=yes])
  1984         -    if test "$tcl_ok" = "no"; then
  1985         -	DL_OBJS=""
  1986         -    fi
  1987         -
  1988         -    if test "x$DL_OBJS" != "x" ; then
  1989         -	BUILD_DLTEST="\$(DLTEST_TARGETS)"
  1990         -    else
  1991         -	echo "Can't figure out how to do dynamic loading or shared libraries"
  1992         -	echo "on this system."
  1993         -	SHLIB_CFLAGS=""
  1994         -	SHLIB_LD=""
  1995         -	SHLIB_SUFFIX=""
  1996         -	DL_OBJS="tclLoadNone.o"
  1997         -	DL_LIBS=""
  1998         -	LDFLAGS="$LDFLAGS_ORIG"
  1999         -	CC_SEARCH_FLAGS=""
  2000         -	LD_SEARCH_FLAGS=""
  2001         -	BUILD_DLTEST=""
  2002         -    fi
         1986  +    # Add in the arch flags late to ensure it wasn't removed.
         1987  +    # Not necessary in TEA, but this is aligned with core
  2003   1988       LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
  2004   1989   
  2005   1990       # If we're running gcc, then change the C flags for compiling shared
  2006   1991       # libraries to the right flags for gcc, instead of those for the
  2007   1992       # standard manufacturer compiler.
  2008   1993   
  2009         -    if test "$DL_OBJS" != "tclLoadNone.o" ; then
  2010         -	if test "$GCC" = "yes" ; then
  2011         -	    case $system in
  2012         -		AIX-*)
  2013         -		    ;;
  2014         -		BSD/OS*)
  2015         -		    ;;
  2016         -		IRIX*)
  2017         -		    ;;
  2018         -		NetBSD-*|FreeBSD-*)
  2019         -		    ;;
  2020         -		Darwin-*)
  2021         -		    ;;
  2022         -		SCO_SV-3.2*)
  2023         -		    ;;
  2024         -		windows)
  2025         -		    ;;
  2026         -		*)
  2027         -		    SHLIB_CFLAGS="-fPIC"
  2028         -		    ;;
  2029         -	    esac
  2030         -	fi
  2031         -    fi
  2032         -
  2033         -    if test "$SHARED_LIB_SUFFIX" = "" ; then
  2034         -	SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
  2035         -    fi
  2036         -    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
  2037         -	UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
  2038         -    fi
  2039         -
  2040         -    AC_SUBST(DL_LIBS)
         1994  +    AS_IF([test "$GCC" = yes], [
         1995  +	case $system in
         1996  +	    AIX-*) ;;
         1997  +	    BSD/OS*) ;;
         1998  +	    CYGWIN_*|MINGW32_*) ;;
         1999  +	    IRIX*) ;;
         2000  +	    NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
         2001  +	    Darwin-*) ;;
         2002  +	    SCO_SV-3.2*) ;;
         2003  +	    windows) ;;
         2004  +	    *) SHLIB_CFLAGS="-fPIC" ;;
         2005  +	esac])
         2006  +
         2007  +    AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
         2008  +	AC_DEFINE(MODULE_SCOPE, [extern],
         2009  +	    [No Compiler support for module scope symbols])
         2010  +	AC_DEFINE(NO_VIZ, [], [No visibility hidden passed to zlib?])
         2011  +    ])
         2012  +
         2013  +    AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
         2014  +    # TEA specific: use PACKAGE_VERSION instead of VERSION
         2015  +    SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
         2016  +    AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
         2017  +    # TEA specific: use PACKAGE_VERSION instead of VERSION
         2018  +    UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
         2019  +
         2020  +    if test "${GCC}" = "yes" ; then
         2021  +	AC_CACHE_CHECK(for SEH support in compiler,
         2022  +	    tcl_cv_seh,
         2023  +	AC_TRY_RUN([
         2024  +	    #define WIN32_LEAN_AND_MEAN
         2025  +	    #include <windows.h>
         2026  +	    #undef WIN32_LEAN_AND_MEAN
         2027  +
         2028  +	    int main(int argc, char** argv) {
         2029  +		int a, b = 0;
         2030  +		__try {
         2031  +		    a = 666 / b;
         2032  +		}
         2033  +		__except (EXCEPTION_EXECUTE_HANDLER) {
         2034  +		    return 0;
         2035  +		}
         2036  +		return 1;
         2037  +	    }
         2038  +	],
         2039  +	    tcl_cv_seh=yes,
         2040  +	    tcl_cv_seh=no,
         2041  +	    tcl_cv_seh=no)
         2042  +	)
         2043  +	if test "$tcl_cv_seh" = "no" ; then
         2044  +	    AC_DEFINE(HAVE_NO_SEH, 1,
         2045  +		    [Defined when mingw does not support SEH])
         2046  +	fi
         2047  +
         2048  +	#
         2049  +	# Check to see if the excpt.h include file provided contains the
         2050  +	# definition for EXCEPTION_DISPOSITION; if not, which is the case
         2051  +	# with Cygwin's version as of 2002-04-10, define it to be int,
         2052  +	# sufficient for getting the current code to work.
         2053  +	#
         2054  +	AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
         2055  +	    tcl_cv_eh_disposition,
         2056  +	    AC_TRY_COMPILE([
         2057  +#	    define WIN32_LEAN_AND_MEAN
         2058  +#	    include <windows.h>
         2059  +#	    undef WIN32_LEAN_AND_MEAN
         2060  +	    ],[
         2061  +		EXCEPTION_DISPOSITION x;
         2062  +	    ],
         2063  +		tcl_cv_eh_disposition=yes,
         2064  +		tcl_cv_eh_disposition=no)
         2065  +	)
         2066  +	if test "$tcl_cv_eh_disposition" = "no" ; then
         2067  +	AC_DEFINE(EXCEPTION_DISPOSITION, int,
         2068  +		[Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
         2069  +	fi
         2070  +
         2071  +	# Check to see if winnt.h defines CHAR, SHORT, and LONG
         2072  +	# even if VOID has already been #defined. The win32api
         2073  +	# used by mingw and cygwin is known to do this.
         2074  +
         2075  +	AC_CACHE_CHECK(for winnt.h that ignores VOID define,
         2076  +	    tcl_cv_winnt_ignore_void,
         2077  +	    AC_TRY_COMPILE([
         2078  +		#define VOID void
         2079  +		#define WIN32_LEAN_AND_MEAN
         2080  +		#include <windows.h>
         2081  +		#undef WIN32_LEAN_AND_MEAN
         2082  +	    ], [
         2083  +		CHAR c;
         2084  +		SHORT s;
         2085  +		LONG l;
         2086  +	    ],
         2087  +        tcl_cv_winnt_ignore_void=yes,
         2088  +        tcl_cv_winnt_ignore_void=no)
         2089  +	)
         2090  +	if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
         2091  +	    AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
         2092  +		    [Defined when cygwin/mingw ignores VOID define in winnt.h])
         2093  +	fi
         2094  +
         2095  +	# See if the compiler supports casting to a union type.
         2096  +	# This is used to stop gcc from printing a compiler
         2097  +	# warning when initializing a union member.
         2098  +
         2099  +	AC_CACHE_CHECK(for cast to union support,
         2100  +	    tcl_cv_cast_to_union,
         2101  +	    AC_TRY_COMPILE([],
         2102  +	    [
         2103  +		  union foo { int i; double d; };
         2104  +		  union foo f = (union foo) (int) 0;
         2105  +	    ],
         2106  +	    tcl_cv_cast_to_union=yes,
         2107  +	    tcl_cv_cast_to_union=no)
         2108  +	)
         2109  +	if test "$tcl_cv_cast_to_union" = "yes"; then
         2110  +	    AC_DEFINE(HAVE_CAST_TO_UNION, 1,
         2111  +		    [Defined when compiler supports casting to union type.])
         2112  +	fi
         2113  +    fi
  2041   2114   
  2042   2115       AC_SUBST(CFLAGS_DEBUG)
  2043   2116       AC_SUBST(CFLAGS_OPTIMIZE)
  2044   2117       AC_SUBST(CFLAGS_WARNING)
  2045   2118   
  2046   2119       AC_SUBST(STLIB_LD)
  2047   2120       AC_SUBST(SHLIB_LD)
................................................................................
  2064   2137   #	Note that #include lines must begin in leftmost column for
  2065   2138   #	some compilers to recognize them as preprocessor directives,
  2066   2139   #	and some build environments have stdin not pointing at a
  2067   2140   #	pseudo-terminal (usually /dev/null instead.)
  2068   2141   #
  2069   2142   # Arguments:
  2070   2143   #	none
  2071         -#	
         2144  +#
  2072   2145   # Results:
  2073   2146   #
  2074   2147   #	Defines only one of the following vars:
  2075   2148   #		HAVE_SYS_MODEM_H
  2076   2149   #		USE_TERMIOS
  2077   2150   #		USE_TERMIO
  2078   2151   #		USE_SGTTY
  2079         -#
  2080   2152   #--------------------------------------------------------------------
  2081   2153   
  2082   2154   AC_DEFUN([TEA_SERIAL_PORT], [
  2083   2155       AC_CHECK_HEADERS(sys/modem.h)
  2084   2156       AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
  2085   2157       AC_TRY_RUN([
  2086   2158   #include <termios.h>
................................................................................
  2177   2249   
  2178   2250   #--------------------------------------------------------------------
  2179   2251   # TEA_MISSING_POSIX_HEADERS
  2180   2252   #
  2181   2253   #	Supply substitutes for missing POSIX header files.  Special
  2182   2254   #	notes:
  2183   2255   #	    - stdlib.h doesn't define strtol, strtoul, or
  2184         -#	      strtod insome versions of SunOS
         2256  +#	      strtod in some versions of SunOS
  2185   2257   #	    - some versions of string.h don't declare procedures such
  2186   2258   #	      as strstr
  2187   2259   #
  2188   2260   # Arguments:
  2189   2261   #	none
  2190         -#	
         2262  +#
  2191   2263   # Results:
  2192   2264   #
  2193   2265   #	Defines some of the following vars:
  2194   2266   #		NO_DIRENT_H
  2195   2267   #		NO_ERRNO_H
  2196   2268   #		NO_VALUES_H
  2197   2269   #		HAVE_LIMITS_H or NO_LIMITS_H
................................................................................
  2230   2302   closedir(d);
  2231   2303   ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
  2232   2304   
  2233   2305       if test $tcl_cv_dirent_h = no; then
  2234   2306   	AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
  2235   2307       fi
  2236   2308   
         2309  +    # TEA specific:
  2237   2310       AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
  2238   2311       AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
  2239   2312       AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
  2240   2313       AC_CHECK_HEADER(limits.h,
  2241   2314   	[AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
  2242   2315   	[AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
  2243   2316       AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
................................................................................
  2276   2349   #	no include files, so double-check its result just to be safe.
  2277   2350   #
  2278   2351   #	This should be called after TEA_CONFIG_CFLAGS as setting the
  2279   2352   #	LIBS line can confuse some configure macro magic.
  2280   2353   #
  2281   2354   # Arguments:
  2282   2355   #	none
  2283         -#	
         2356  +#
  2284   2357   # Results:
  2285   2358   #
  2286   2359   #	Sets the following vars:
  2287   2360   #		XINCLUDES
  2288   2361   #		XLIBSW
  2289   2362   #		PKG_LIBS (appends to)
  2290         -#
  2291   2363   #--------------------------------------------------------------------
  2292   2364   
  2293   2365   AC_DEFUN([TEA_PATH_X], [
  2294   2366       if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
  2295   2367   	TEA_PATH_UNIX_X
  2296   2368       fi
  2297   2369   ])
................................................................................
  2325   2397   	fi
  2326   2398       else
  2327   2399   	if test "$x_includes" != ""; then
  2328   2400   	    XINCLUDES="-I$x_includes"
  2329   2401   	    found_xincludes="yes"
  2330   2402   	fi
  2331   2403       fi
  2332         -    if test found_xincludes = "no"; then
         2404  +    if test "$found_xincludes" = "no"; then
  2333   2405   	AC_MSG_RESULT([couldn't find any!])
  2334   2406       fi
  2335   2407   
  2336   2408       if test "$no_x" = yes; then
  2337   2409   	AC_MSG_CHECKING([for X11 libraries])
  2338   2410   	XLIBSW=nope
  2339   2411   	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"
  2340   2412   	for i in $dirs ; do
  2341         -	    if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
         2413  +	    if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
  2342   2414   		AC_MSG_RESULT([$i])
  2343   2415   		XLIBSW="-L$i -lX11"
  2344   2416   		x_libraries="$i"
  2345   2417   		break
  2346   2418   	    fi
  2347   2419   	done
  2348   2420       else
................................................................................
  2355   2427       if test "$XLIBSW" = nope ; then
  2356   2428   	AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
  2357   2429       fi
  2358   2430       if test "$XLIBSW" = nope ; then
  2359   2431   	AC_MSG_RESULT([could not find any!  Using -lX11.])
  2360   2432   	XLIBSW=-lX11
  2361   2433       fi
         2434  +    # TEA specific:
  2362   2435       if test x"${XLIBSW}" != x ; then
  2363   2436   	PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
  2364   2437       fi
  2365   2438   ])
  2366   2439   
  2367   2440   #--------------------------------------------------------------------
  2368   2441   # TEA_BLOCKING_STYLE
  2369   2442   #
  2370   2443   #	The statements below check for systems where POSIX-style
  2371         -#	non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. 
         2444  +#	non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
  2372   2445   #	On these systems (mostly older ones), use the old BSD-style
  2373   2446   #	FIONBIO approach instead.
  2374   2447   #
  2375   2448   # Arguments:
  2376   2449   #	none
  2377         -#	
         2450  +#
  2378   2451   # Results:
  2379   2452   #
  2380   2453   #	Defines some of the following vars:
  2381   2454   #		HAVE_SYS_IOCTL_H
  2382   2455   #		HAVE_SYS_FILIO_H
  2383   2456   #		USE_FIONBIO
  2384   2457   #		O_NONBLOCK
  2385         -#
  2386   2458   #--------------------------------------------------------------------
  2387   2459   
  2388   2460   AC_DEFUN([TEA_BLOCKING_STYLE], [
  2389   2461       AC_CHECK_HEADERS(sys/ioctl.h)
  2390   2462       AC_CHECK_HEADERS(sys/filio.h)
  2391   2463       TEA_CONFIG_SYSTEM
  2392   2464       AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
  2393   2465       case $system in
  2394         -	# There used to be code here to use FIONBIO under AIX.  However, it
  2395         -	# was reported that FIONBIO doesn't work under AIX 3.2.5.  Since
  2396         -	# using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
  2397         -	# code (JO, 5/31/97).
  2398         -
  2399   2466   	OSF*)
  2400         -	    AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
  2401         -	    AC_MSG_RESULT([FIONBIO])
  2402         -	    ;;
  2403         -	SunOS-4*)
  2404   2467   	    AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
  2405   2468   	    AC_MSG_RESULT([FIONBIO])
  2406   2469   	    ;;
  2407   2470   	*)
  2408   2471   	    AC_MSG_RESULT([O_NONBLOCK])
  2409   2472   	    ;;
  2410   2473       esac
  2411   2474   ])
  2412   2475   
  2413   2476   #--------------------------------------------------------------------
  2414         -# TEA_TIME_HANLDER
         2477  +# TEA_TIME_HANDLER
  2415   2478   #
  2416   2479   #	Checks how the system deals with time.h, what time structures
  2417   2480   #	are used on the system, and what fields the structures have.
  2418   2481   #
  2419   2482   # Arguments:
  2420   2483   #	none
  2421         -#	
         2484  +#
  2422   2485   # Results:
  2423   2486   #
  2424   2487   #	Defines some of the following vars:
  2425   2488   #		USE_DELTA_FOR_TZ
  2426   2489   #		HAVE_TM_GMTOFF
  2427   2490   #		HAVE_TM_TZADJ
  2428   2491   #		HAVE_TIMEZONE_VAR
  2429         -#
  2430   2492   #--------------------------------------------------------------------
  2431   2493   
  2432   2494   AC_DEFUN([TEA_TIME_HANDLER], [
  2433   2495       AC_CHECK_HEADERS(sys/time.h)
  2434   2496       AC_HEADER_TIME
  2435   2497       AC_STRUCT_TIMEZONE
  2436   2498   
................................................................................
  2486   2548   #	and if the problem exists use a substitute procedure
  2487   2549   #	"fixstrtod" (provided by Tcl) that corrects the error.
  2488   2550   #	Also, on Compaq's Tru64 Unix 5.0,
  2489   2551   #	strtod(" ") returns 0.0 instead of a failure to convert.
  2490   2552   #
  2491   2553   # Arguments:
  2492   2554   #	none
  2493         -#	
         2555  +#
  2494   2556   # Results:
  2495   2557   #
  2496   2558   #	Might defines some of the following vars:
  2497   2559   #		strtod (=fixstrtod)
  2498         -#
  2499   2560   #--------------------------------------------------------------------
  2500   2561   
  2501   2562   AC_DEFUN([TEA_BUGGY_STRTOD], [
  2502   2563       AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
  2503   2564       if test "$tcl_strtod" = 1; then
  2504   2565   	AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
  2505   2566   	    AC_TRY_RUN([
................................................................................
  2536   2597   #
  2537   2598   #	Search for the libraries needed to link the Tcl shell.
  2538   2599   #	Things like the math library (-lm) and socket stuff (-lsocket vs.
  2539   2600   #	-lnsl) are dealt with here.
  2540   2601   #
  2541   2602   # Arguments:
  2542   2603   #	Requires the following vars to be set in the Makefile:
  2543         -#		DL_LIBS
         2604  +#		DL_LIBS (not in TEA, only needed in core)
  2544   2605   #		LIBS
  2545   2606   #		MATH_LIBS
  2546         -#	
         2607  +#
  2547   2608   # Results:
  2548   2609   #
  2549         -#	Subst's the following var:
         2610  +#	Substitutes the following vars:
  2550   2611   #		TCL_LIBS
  2551   2612   #		MATH_LIBS
  2552   2613   #
  2553   2614   #	Might append to the following vars:
  2554   2615   #		LIBS
  2555   2616   #
  2556   2617   #	Might define the following vars:
  2557   2618   #		HAVE_NET_ERRNO_H
  2558         -#
  2559   2619   #--------------------------------------------------------------------
  2560   2620   
  2561   2621   AC_DEFUN([TEA_TCL_LINK_LIBS], [
  2562   2622       #--------------------------------------------------------------------
  2563   2623       # On a few very rare systems, all of the libm.a stuff is
  2564   2624       # already in libc.a.  Set compiler flags accordingly.
  2565   2625       # Also, Linux requires the "ieee" library for math to work
................................................................................
  2605   2665       if test "$tcl_checkBoth" = 1; then
  2606   2666   	tk_oldLibs=$LIBS
  2607   2667   	LIBS="$LIBS -lsocket -lnsl"
  2608   2668   	AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
  2609   2669       fi
  2610   2670       AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
  2611   2671   	    [LIBS="$LIBS -lnsl"])])
  2612         -    
  2613         -    # Don't perform the eval of the libraries here because DL_LIBS
  2614         -    # won't be set until we call TEA_CONFIG_CFLAGS
         2672  +
         2673  +    # TEA specific: Don't perform the eval of the libraries here because
         2674  +    # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
  2615   2675   
  2616   2676       TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
  2617   2677       AC_SUBST(TCL_LIBS)
  2618   2678       AC_SUBST(MATH_LIBS)
  2619   2679   ])
  2620   2680   
  2621   2681   #--------------------------------------------------------------------
................................................................................
  2622   2682   # TEA_TCL_EARLY_FLAGS
  2623   2683   #
  2624   2684   #	Check for what flags are needed to be passed so the correct OS
  2625   2685   #	features are available.
  2626   2686   #
  2627   2687   # Arguments:
  2628   2688   #	None
  2629         -#	
         2689  +#
  2630   2690   # Results:
  2631   2691   #
  2632   2692   #	Might define the following vars:
  2633   2693   #		_ISOC99_SOURCE
  2634   2694   #		_LARGEFILE64_SOURCE
  2635   2695   #		_LARGEFILE_SOURCE64
  2636         -#
  2637   2696   #--------------------------------------------------------------------
  2638   2697   
  2639   2698   AC_DEFUN([TEA_TCL_EARLY_FLAG],[
  2640   2699       AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
  2641   2700   	AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
  2642   2701   	    AC_TRY_COMPILE([[#define ]$1[ 1
  2643   2702   ]$2], $3,
................................................................................
  2668   2727   #--------------------------------------------------------------------
  2669   2728   # TEA_TCL_64BIT_FLAGS
  2670   2729   #
  2671   2730   #	Check for what is defined in the way of 64-bit features.
  2672   2731   #
  2673   2732   # Arguments:
  2674   2733   #	None
  2675         -#	
         2734  +#
  2676   2735   # Results:
  2677   2736   #
  2678   2737   #	Might define the following vars:
  2679   2738   #		TCL_WIDE_INT_IS_LONG
  2680   2739   #		TCL_WIDE_INT_TYPE
  2681   2740   #		HAVE_STRUCT_DIRENT64
  2682   2741   #		HAVE_STRUCT_STAT64
  2683   2742   #		HAVE_TYPE_OFF64_T
  2684         -#
  2685   2743   #--------------------------------------------------------------------
  2686   2744   
  2687   2745   AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
  2688   2746       AC_MSG_CHECKING([for 64-bit integer type])
  2689   2747       AC_CACHE_VAL(tcl_cv_type_64bit,[
  2690   2748   	tcl_cv_type_64bit=none
  2691   2749   	# See if the compiler knows natively about __int64
  2692   2750   	AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
  2693   2751   	    tcl_type_64bit=__int64, tcl_type_64bit="long long")
  2694   2752   	# See if we should use long anyway  Note that we substitute in the
  2695   2753   	# type that is our current guess for a 64-bit type inside this check
  2696   2754   	# program, so it should be modified only carefully...
  2697         -        AC_TRY_COMPILE(,[switch (0) { 
  2698         -            case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; 
         2755  +        AC_TRY_COMPILE(,[switch (0) {
         2756  +            case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
  2699   2757           }],tcl_cv_type_64bit=${tcl_type_64bit})])
  2700   2758       if test "${tcl_cv_type_64bit}" = none ; then
  2701   2759   	AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
  2702   2760   	AC_MSG_RESULT([using long])
  2703   2761       elif test "${tcl_cv_type_64bit}" = "__int64" \
  2704   2762   		-a "${TEA_PLATFORM}" = "windows" ; then
  2705         -	# We actually want to use the default tcl.h checks in this
  2706         -	# case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
         2763  +	# TEA specific: We actually want to use the default tcl.h checks in
         2764  +	# this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
  2707   2765   	AC_MSG_RESULT([using Tcl header defaults])
  2708   2766       else
  2709   2767   	AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
  2710   2768   	    [What type should be used to define wide integers?])
  2711   2769   	AC_MSG_RESULT([${tcl_cv_type_64bit}])
  2712   2770   
  2713   2771   	# Now check for auxiliary declarations
................................................................................
  2779   2837   #	is a lightweight replacement for AC_EXEEXT that doesn't require
  2780   2838   #	a compiler.
  2781   2839   #------------------------------------------------------------------------
  2782   2840   
  2783   2841   AC_DEFUN([TEA_INIT], [
  2784   2842       # TEA extensions pass this us the version of TEA they think they
  2785   2843       # are compatible with.
  2786         -    TEA_VERSION="3.6"
         2844  +    TEA_VERSION="3.9"
  2787   2845   
  2788   2846       AC_MSG_CHECKING([for correct TEA configuration])
  2789   2847       if test x"${PACKAGE_NAME}" = x ; then
  2790   2848   	AC_MSG_ERROR([
  2791   2849   The PACKAGE_NAME variable must be defined by your TEA configure.in])
  2792   2850       fi
  2793   2851       if test x"$1" = x ; then
................................................................................
  2794   2852   	AC_MSG_ERROR([
  2795   2853   TEA version not specified.])
  2796   2854       elif test "$1" != "${TEA_VERSION}" ; then
  2797   2855   	AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
  2798   2856       else
  2799   2857   	AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
  2800   2858       fi
         2859  +
         2860  +    # If the user did not set CFLAGS, set it now to keep macros
         2861  +    # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
         2862  +    if test "${CFLAGS+set}" != "set" ; then
         2863  +	CFLAGS=""
         2864  +    fi
         2865  +
  2801   2866       case "`uname -s`" in
  2802         -	*win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
         2867  +	*win32*|*WIN32*|*MINGW32_*)
  2803   2868   	    AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
  2804   2869   	    EXEEXT=".exe"
  2805   2870   	    TEA_PLATFORM="windows"
  2806   2871   	    ;;
         2872  +	*CYGWIN_*)
         2873  +	    CYGPATH=echo
         2874  +	    EXEEXT=".exe"
         2875  +	    # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
         2876  +	    ;;
  2807   2877   	*)
  2808   2878   	    CYGPATH=echo
  2809         -	    EXEEXT=""
  2810         -	    TEA_PLATFORM="unix"
         2879  +	    # Maybe we are cross-compiling....
         2880  +	    case ${host_alias} in
         2881  +		*mingw32*)
         2882  +		EXEEXT=".exe"
         2883  +		TEA_PLATFORM="windows"
         2884  +		;;
         2885  +	    *)
         2886  +		EXEEXT=""
         2887  +		TEA_PLATFORM="unix"
         2888  +		;;
         2889  +	    esac
  2811   2890   	    ;;
  2812   2891       esac
  2813   2892   
  2814   2893       # Check if exec_prefix is set. If not use fall back to prefix.
  2815   2894       # Note when adjusted, so that TEA_PREFIX can correct for this.
  2816   2895       # This is needed for recursive configures, since autoconf propagates
  2817   2896       # $prefix, but not $exec_prefix (doh!).
  2818   2897       if test x$exec_prefix = xNONE ; then
  2819   2898   	exec_prefix_default=yes
  2820   2899   	exec_prefix=$prefix
  2821   2900       fi
         2901  +
         2902  +    AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}])
  2822   2903   
  2823   2904       AC_SUBST(EXEEXT)
  2824   2905       AC_SUBST(CYGPATH)
  2825   2906   
  2826   2907       # This package name must be replaced statically for AC_SUBST to work
  2827   2908       AC_SUBST(PKG_LIB_FILE)
  2828   2909       # Substitute STUB_LIB_FILE in case package creates a stub library too.
................................................................................
  2863   2944   	    [\$]*)
  2864   2945   		# allow $-var names
  2865   2946   		PKG_SOURCES="$PKG_SOURCES $i"
  2866   2947   		PKG_OBJECTS="$PKG_OBJECTS $i"
  2867   2948   		;;
  2868   2949   	    *)
  2869   2950   		# check for existence - allows for generic/win/unix VPATH
         2951  +		# To add more dirs here (like 'src'), you have to update VPATH
         2952  +		# in Makefile.in as well
  2870   2953   		if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
  2871   2954   		    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
         2955  +		    -a ! -f "${srcdir}/macosx/$i" \
  2872   2956   		    ; then
  2873   2957   		    AC_MSG_ERROR([could not find source file '$i'])
  2874   2958   		fi
  2875   2959   		PKG_SOURCES="$PKG_SOURCES $i"
  2876   2960   		# this assumes it is in a VPATH dir
  2877   2961   		i=`basename $i`
  2878   2962   		# handle user calling this before or after TEA_SETUP_COMPILER
................................................................................
  2908   2992   #------------------------------------------------------------------------
  2909   2993   AC_DEFUN([TEA_ADD_STUB_SOURCES], [
  2910   2994       vars="$@"
  2911   2995       for i in $vars; do
  2912   2996   	# check for existence - allows for generic/win/unix VPATH
  2913   2997   	if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
  2914   2998   	    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
         2999  +	    -a ! -f "${srcdir}/macosx/$i" \
  2915   3000   	    ; then
  2916   3001   	    AC_MSG_ERROR([could not find stub source file '$i'])
  2917   3002   	fi
  2918   3003   	PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
  2919   3004   	# this assumes it is in a VPATH dir
  2920   3005   	i=`basename $i`
  2921   3006   	# handle user calling this before or after TEA_SETUP_COMPILER
................................................................................
  3046   3131   #	Defines and substs the following vars:
  3047   3132   #		PKG_CFLAGS
  3048   3133   #------------------------------------------------------------------------
  3049   3134   AC_DEFUN([TEA_ADD_CFLAGS], [
  3050   3135       PKG_CFLAGS="$PKG_CFLAGS $@"
  3051   3136       AC_SUBST(PKG_CFLAGS)
  3052   3137   ])
         3138  +
         3139  +#------------------------------------------------------------------------
         3140  +# TEA_ADD_CLEANFILES --
         3141  +#
         3142  +#	Specify one or more CLEANFILES.
         3143  +#
         3144  +# Arguments:
         3145  +#	one or more file names to clean target
         3146  +#
         3147  +# Results:
         3148  +#
         3149  +#	Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG
         3150  +#------------------------------------------------------------------------
         3151  +AC_DEFUN([TEA_ADD_CLEANFILES], [
         3152  +    CLEANFILES="$CLEANFILES $@"
         3153  +])
  3053   3154   
  3054   3155   #------------------------------------------------------------------------
  3055   3156   # TEA_PREFIX --
  3056   3157   #
  3057   3158   #	Handle the --prefix=... option by defaulting to what Tcl gave
  3058   3159   #
  3059   3160   # Arguments:
................................................................................
  3101   3202   #
  3102   3203   #	Sets up CC var and other standard bits we need to make executables.
  3103   3204   #------------------------------------------------------------------------
  3104   3205   AC_DEFUN([TEA_SETUP_COMPILER_CC], [
  3105   3206       # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
  3106   3207       # in this macro, they need to go into TEA_SETUP_COMPILER instead.
  3107   3208   
  3108         -    # If the user did not set CFLAGS, set it now to keep
  3109         -    # the AC_PROG_CC macro from adding "-g -O2".
  3110         -    if test "${CFLAGS+set}" != "set" ; then
  3111         -	CFLAGS=""
  3112         -    fi
  3113         -
  3114   3209       AC_PROG_CC
  3115   3210       AC_PROG_CPP
  3116   3211   
  3117         -    AC_PROG_INSTALL
  3118         -
  3119   3212       #--------------------------------------------------------------------
  3120   3213       # Checks to see if the make program sets the $MAKE variable.
  3121   3214       #--------------------------------------------------------------------
  3122   3215   
  3123   3216       AC_PROG_MAKE_SET
  3124   3217   
  3125   3218       #--------------------------------------------------------------------
  3126   3219       # Find ranlib
  3127   3220       #--------------------------------------------------------------------
  3128   3221   
  3129         -    AC_PROG_RANLIB
         3222  +    AC_CHECK_TOOL(RANLIB, ranlib)
  3130   3223   
  3131   3224       #--------------------------------------------------------------------
  3132   3225       # Determines the correct binary file extension (.o, .obj, .exe etc.)
  3133   3226       #--------------------------------------------------------------------
  3134   3227   
  3135   3228       AC_OBJEXT
  3136   3229       AC_EXEEXT
................................................................................
  3201   3294   #	CFLAGS -	Done late here to note disturb other AC macros
  3202   3295   #       MAKE_LIB -      Command to execute to build the Tcl library;
  3203   3296   #                       differs depending on whether or not Tcl is being
  3204   3297   #                       compiled as a shared library.
  3205   3298   #	MAKE_SHARED_LIB	Makefile rule for building a shared library
  3206   3299   #	MAKE_STATIC_LIB	Makefile rule for building a static library
  3207   3300   #	MAKE_STUB_LIB	Makefile rule for building a stub library
         3301  +#	VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL
         3302  +#	VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE
  3208   3303   #------------------------------------------------------------------------
  3209   3304   
  3210   3305   AC_DEFUN([TEA_MAKE_LIB], [
  3211   3306       if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
  3212   3307   	MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
  3213   3308   	MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
         3309  +	AC_EGREP_CPP([manifest needed], [
         3310  +#if defined(_MSC_VER) && _MSC_VER >= 1400
         3311  +print("manifest needed")
         3312  +#endif
         3313  +	], [
         3314  +	# Could do a CHECK_PROG for mt, but should always be with MSVC8+
         3315  +	VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi"
         3316  +	VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi"
         3317  +	MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
         3318  +	TEA_ADD_CLEANFILES([*.manifest])
         3319  +	])
  3214   3320   	MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
  3215   3321       else
  3216   3322   	MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
  3217   3323   	MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
  3218   3324   	MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
  3219   3325       fi
  3220   3326   
................................................................................
  3274   3380       fi
  3275   3381   
  3276   3382       AC_SUBST(MAKE_LIB)
  3277   3383       AC_SUBST(MAKE_SHARED_LIB)
  3278   3384       AC_SUBST(MAKE_STATIC_LIB)
  3279   3385       AC_SUBST(MAKE_STUB_LIB)
  3280   3386       AC_SUBST(RANLIB_STUB)
         3387  +    AC_SUBST(VC_MANIFEST_EMBED_DLL)
         3388  +    AC_SUBST(VC_MANIFEST_EMBED_EXE)
  3281   3389   ])
  3282   3390   
  3283   3391   #------------------------------------------------------------------------
  3284   3392   # TEA_LIB_SPEC --
  3285   3393   #
  3286   3394   #	Compute the name of an existing object library located in libdir
  3287   3395   #	from the given base name and produce the appropriate linker flags.
................................................................................
  3321   3429       for i in \
  3322   3430   	    `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
  3323   3431   	    `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
  3324   3432   	    `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
  3325   3433   	    `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
  3326   3434   	    `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
  3327   3435   	    `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
         3436  +	    `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \
         3437  +	    `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \
  3328   3438   	    `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
  3329   3439   	    `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
  3330   3440   	if test -f "$i" ; then
  3331   3441   	    tea_lib_name_dir=`dirname $i`
  3332   3442   	    $1_LIB_NAME=`basename $i`
  3333   3443   	    $1_LIB_PATH_NAME=$i
  3334   3444   	    break
................................................................................
  3356   3466   #
  3357   3467   #	Locate the private Tcl include files
  3358   3468   #
  3359   3469   # Arguments:
  3360   3470   #
  3361   3471   #	Requires:
  3362   3472   #		TCL_SRC_DIR	Assumes that TEA_LOAD_TCLCONFIG has
  3363         -#				 already been called.
         3473  +#				already been called.
  3364   3474   #
  3365   3475   # Results:
  3366   3476   #
  3367         -#	Substs the following vars:
         3477  +#	Substitutes the following vars:
  3368   3478   #		TCL_TOP_DIR_NATIVE
  3369         -#		TCL_GENERIC_DIR_NATIVE
  3370         -#		TCL_UNIX_DIR_NATIVE
  3371         -#		TCL_WIN_DIR_NATIVE
  3372         -#		TCL_BMAP_DIR_NATIVE
  3373         -#		TCL_TOOL_DIR_NATIVE
  3374         -#		TCL_PLATFORM_DIR_NATIVE
  3375         -#		TCL_BIN_DIR_NATIVE
  3376   3479   #		TCL_INCLUDES
  3377   3480   #------------------------------------------------------------------------
  3378   3481   
  3379   3482   AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
         3483  +    # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh}
         3484  +    AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS])
  3380   3485       AC_MSG_CHECKING([for Tcl private include files])
  3381   3486   
  3382   3487       TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
  3383   3488       TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
  3384         -    TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
  3385         -    TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
  3386         -    TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
  3387         -    TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\"
  3388         -    TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\"
  3389         -    TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\"
  3390   3489   
  3391         -    if test "${TEA_PLATFORM}" = "windows"; then
  3392         -	TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
         3490  +    # Check to see if tcl<Plat>Port.h isn't already with the public headers
         3491  +    # Don't look for tclInt.h because that resides with tcl.h in the core
         3492  +    # sources, but the <plat>Port headers are in a different directory
         3493  +    if test "${TEA_PLATFORM}" = "windows" -a \
         3494  +	-f "${ac_cv_c_tclh}/tclWinPort.h"; then
         3495  +	result="private headers found with public headers"
         3496  +    elif test "${TEA_PLATFORM}" = "unix" -a \
         3497  +	-f "${ac_cv_c_tclh}/tclUnixPort.h"; then
         3498  +	result="private headers found with public headers"
  3393   3499       else
  3394         -	TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
  3395         -    fi
  3396         -    # We want to ensure these are substituted so as not to require
  3397         -    # any *_NATIVE vars be defined in the Makefile
  3398         -    TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
  3399         -    if test "`uname -s`" = "Darwin"; then
  3400         -        # If Tcl was built as a framework, attempt to use
  3401         -        # the framework's Headers and PrivateHeaders directories
  3402         -        case ${TCL_DEFS} in
  3403         -	    *TCL_FRAMEWORK*)
  3404         -	        if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then
  3405         -	        TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else
  3406         -	        TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi
  3407         -	        ;;
  3408         -	esac
  3409         -    else
  3410         -	if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
  3411         -	    AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
         3500  +	TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
         3501  +	if test "${TEA_PLATFORM}" = "windows"; then
         3502  +	    TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
         3503  +	else
         3504  +	    TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
         3505  +	fi
         3506  +	# Overwrite the previous TCL_INCLUDES as this should capture both
         3507  +	# public and private headers in the same set.
         3508  +	# We want to ensure these are substituted so as not to require
         3509  +	# any *_NATIVE vars be defined in the Makefile
         3510  +	TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
         3511  +	if test "`uname -s`" = "Darwin"; then
         3512  +            # If Tcl was built as a framework, attempt to use
         3513  +            # the framework's Headers and PrivateHeaders directories
         3514  +            case ${TCL_DEFS} in
         3515  +	    	*TCL_FRAMEWORK*)
         3516  +		    if test -d "${TCL_BIN_DIR}/Headers" -a \
         3517  +			    -d "${TCL_BIN_DIR}/PrivateHeaders"; then
         3518  +			TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"
         3519  +		    else
         3520  +			TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
         3521  +		    fi
         3522  +	            ;;
         3523  +	    esac
         3524  +	    result="Using ${TCL_INCLUDES}"
         3525  +	else
         3526  +	    if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
         3527  +		AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
         3528  +	    fi
         3529  +	    result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
  3412   3530   	fi
  3413   3531       fi
  3414   3532   
  3415         -
  3416   3533       AC_SUBST(TCL_TOP_DIR_NATIVE)
  3417         -    AC_SUBST(TCL_GENERIC_DIR_NATIVE)
  3418         -    AC_SUBST(TCL_UNIX_DIR_NATIVE)
  3419         -    AC_SUBST(TCL_WIN_DIR_NATIVE)
  3420         -    AC_SUBST(TCL_BMAP_DIR_NATIVE)
  3421         -    AC_SUBST(TCL_TOOL_DIR_NATIVE)
  3422         -    AC_SUBST(TCL_PLATFORM_DIR_NATIVE)
  3423   3534   
  3424   3535       AC_SUBST(TCL_INCLUDES)
  3425         -    AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}])
         3536  +    AC_MSG_RESULT([${result}])
  3426   3537   ])
  3427   3538   
  3428   3539   #------------------------------------------------------------------------
  3429   3540   # TEA_PUBLIC_TCL_HEADERS --
  3430   3541   #
  3431   3542   #	Locate the installed public Tcl header files
  3432   3543   #
................................................................................
  3437   3548   #	CYGPATH must be set
  3438   3549   #
  3439   3550   # Results:
  3440   3551   #
  3441   3552   #	Adds a --with-tclinclude switch to configure.
  3442   3553   #	Result is cached.
  3443   3554   #
  3444         -#	Substs the following vars:
         3555  +#	Substitutes the following vars:
  3445   3556   #		TCL_INCLUDES
  3446   3557   #------------------------------------------------------------------------
  3447   3558   
  3448   3559   AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
  3449   3560       AC_MSG_CHECKING([for Tcl public headers])
  3450   3561   
  3451   3562       AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory containing the public Tcl header files], with_tclinclude=${withval})
................................................................................
  3456   3567   	if test x"${with_tclinclude}" != x ; then
  3457   3568   	    if test -f "${with_tclinclude}/tcl.h" ; then
  3458   3569   		ac_cv_c_tclh=${with_tclinclude}
  3459   3570   	    else
  3460   3571   		AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
  3461   3572   	    fi
  3462   3573   	else
         3574  +	    list=""
  3463   3575   	    if test "`uname -s`" = "Darwin"; then
  3464   3576   		# If Tcl was built as a framework, attempt to use
  3465   3577   		# the framework's Headers directory
  3466   3578   		case ${TCL_DEFS} in
  3467   3579   		    *TCL_FRAMEWORK*)
  3468   3580   			list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
  3469   3581   			;;
................................................................................
  3526   3638   #
  3527   3639   #	Requires:
  3528   3640   #		TK_SRC_DIR	Assumes that TEA_LOAD_TKCONFIG has
  3529   3641   #				 already been called.
  3530   3642   #
  3531   3643   # Results:
  3532   3644   #
  3533         -#	Substs the following vars:
         3645  +#	Substitutes the following vars:
  3534   3646   #		TK_INCLUDES
  3535   3647   #------------------------------------------------------------------------
  3536   3648   
  3537   3649   AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
         3650  +    # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}
         3651  +    AC_REQUIRE([TEA_PUBLIC_TK_HEADERS])
  3538   3652       AC_MSG_CHECKING([for Tk private include files])
  3539   3653   
  3540   3654       TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
  3541   3655       TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
  3542         -    TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
  3543         -    TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
  3544         -    TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
  3545         -    TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
  3546         -    if test "${TEA_PLATFORM}" = "windows"; then
  3547         -	TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
         3656  +
         3657  +    # Check to see if tk<Plat>Port.h isn't already with the public headers
         3658  +    # Don't look for tkInt.h because that resides with tk.h in the core
         3659  +    # sources, but the <plat>Port headers are in a different directory
         3660  +    if test "${TEA_PLATFORM}" = "windows" -a \
         3661  +	-f "${ac_cv_c_tkh}/tkWinPort.h"; then
         3662  +	result="private headers found with public headers"
         3663  +    elif test "${TEA_PLATFORM}" = "unix" -a \
         3664  +	-f "${ac_cv_c_tkh}/tkUnixPort.h"; then
         3665  +	result="private headers found with public headers"
  3548   3666       else
  3549         -	TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
  3550         -    fi
  3551         -    # We want to ensure these are substituted so as not to require
  3552         -    # any *_NATIVE vars be defined in the Makefile
  3553         -    TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
  3554         -    if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
  3555         -	-o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
  3556         -	TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}"
  3557         -    fi
  3558         -    if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
  3559         -	TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx"
  3560         -    fi
  3561         -    if test "`uname -s`" = "Darwin"; then
  3562         -        # If Tk was built as a framework, attempt to use
  3563         -        # the framework's Headers and PrivateHeaders directories
  3564         -        case ${TK_DEFS} in
  3565         -	    *TK_FRAMEWORK*)
  3566         -	        if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then
  3567         -	        TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi
  3568         -	        ;;
  3569         -	esac
  3570         -    else
  3571         -	if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
  3572         -	    AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
         3667  +	TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
         3668  +	TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
         3669  +	if test "${TEA_PLATFORM}" = "windows"; then
         3670  +	    TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
         3671  +	else
         3672  +	    TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
         3673  +	fi
         3674  +	# Overwrite the previous TK_INCLUDES as this should capture both
         3675  +	# public and private headers in the same set.
         3676  +	# We want to ensure these are substituted so as not to require
         3677  +	# any *_NATIVE vars be defined in the Makefile
         3678  +	TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
         3679  +	# Detect and add ttk subdir
         3680  +	if test -d "${TK_SRC_DIR}/generic/ttk"; then
         3681  +	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
         3682  +	fi
         3683  +	if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
         3684  +	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
         3685  +	fi
         3686  +	if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
         3687  +	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
         3688  +	fi
         3689  +	if test "`uname -s`" = "Darwin"; then
         3690  +	    # If Tk was built as a framework, attempt to use
         3691  +	    # the framework's Headers and PrivateHeaders directories
         3692  +	    case ${TK_DEFS} in
         3693  +		*TK_FRAMEWORK*)
         3694  +			if test -d "${TK_BIN_DIR}/Headers" -a \
         3695  +				-d "${TK_BIN_DIR}/PrivateHeaders"; then
         3696  +			    TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
         3697  +			else
         3698  +			    TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
         3699  +			fi
         3700  +			;;
         3701  +	    esac
         3702  +	    result="Using ${TK_INCLUDES}"
         3703  +	else
         3704  +	    if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
         3705  +	       AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
         3706  +	    fi
         3707  +	    result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
  3573   3708   	fi
  3574   3709       fi
  3575   3710   
  3576   3711       AC_SUBST(TK_TOP_DIR_NATIVE)
  3577         -    AC_SUBST(TK_UNIX_DIR_NATIVE)
  3578         -    AC_SUBST(TK_WIN_DIR_NATIVE)
  3579         -    AC_SUBST(TK_GENERIC_DIR_NATIVE)
  3580   3712       AC_SUBST(TK_XLIB_DIR_NATIVE)
  3581         -    AC_SUBST(TK_PLATFORM_DIR_NATIVE)
  3582   3713   
  3583   3714       AC_SUBST(TK_INCLUDES)
  3584         -    AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}])
         3715  +    AC_MSG_RESULT([${result}])
  3585   3716   ])
  3586   3717   
  3587   3718   #------------------------------------------------------------------------
  3588   3719   # TEA_PUBLIC_TK_HEADERS --
  3589   3720   #
  3590   3721   #	Locate the installed public Tk header files
  3591   3722   #
................................................................................
  3596   3727   #	CYGPATH must be set
  3597   3728   #
  3598   3729   # Results:
  3599   3730   #
  3600   3731   #	Adds a --with-tkinclude switch to configure.
  3601   3732   #	Result is cached.
  3602   3733   #
  3603         -#	Substs the following vars:
         3734  +#	Substitutes the following vars:
  3604   3735   #		TK_INCLUDES
  3605   3736   #------------------------------------------------------------------------
  3606   3737   
  3607   3738   AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
  3608   3739       AC_MSG_CHECKING([for Tk public headers])
  3609   3740   
  3610   3741       AC_ARG_WITH(tkinclude, [  --with-tkinclude        directory containing the public Tk header files], with_tkinclude=${withval})
................................................................................
  3615   3746   	if test x"${with_tkinclude}" != x ; then
  3616   3747   	    if test -f "${with_tkinclude}/tk.h" ; then
  3617   3748   		ac_cv_c_tkh=${with_tkinclude}
  3618   3749   	    else
  3619   3750   		AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
  3620   3751   	    fi
  3621   3752   	else
         3753  +	    list=""
  3622   3754   	    if test "`uname -s`" = "Darwin"; then
  3623   3755   		# If Tk was built as a framework, attempt to use
  3624   3756   		# the framework's Headers directory.
  3625   3757   		case ${TK_DEFS} in
  3626   3758   		    *TK_FRAMEWORK*)
  3627   3759   			list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
  3628   3760   			;;
................................................................................
  3632   3764   	    # Look in the source dir only if Tk is not installed,
  3633   3765   	    # and in that situation, look there before installed locations.
  3634   3766   	    if test -f "${TK_BIN_DIR}/Makefile" ; then
  3635   3767   		list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
  3636   3768   	    fi
  3637   3769   
  3638   3770   	    # Check order: pkg --prefix location, Tk's --prefix location,
  3639         -	    # relative to directory of tkConfig.sh, Tcl's --prefix location, 
         3771  +	    # relative to directory of tkConfig.sh, Tcl's --prefix location,
  3640   3772   	    # relative to directory of tclConfig.sh.
  3641   3773   
  3642   3774   	    eval "temp_includedir=${includedir}"
  3643   3775   	    list="$list \
  3644   3776   		`ls -d ${temp_includedir}        2>/dev/null` \
  3645   3777   		`ls -d ${TK_PREFIX}/include      2>/dev/null` \
  3646   3778   		`ls -d ${TK_BIN_DIR}/../include  2>/dev/null` \
  3647   3779   		`ls -d ${TCL_PREFIX}/include     2>/dev/null` \
  3648   3780   		`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
  3649   3781   	    if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
  3650   3782   		list="$list /usr/local/include /usr/include"
         3783  +		if test x"${TK_INCLUDE_SPEC}" != x ; then
         3784  +		    d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
         3785  +		    list="$list `ls -d ${d} 2>/dev/null`"
         3786  +		fi
  3651   3787   	    fi
  3652   3788   	    for i in $list ; do
  3653   3789   		if test -f "$i/tk.h" ; then
  3654   3790   		    ac_cv_c_tkh=$i
  3655   3791   		    break
  3656   3792   		fi
  3657   3793   	    done
................................................................................
  3670   3806   
  3671   3807       INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
  3672   3808   
  3673   3809       TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
  3674   3810   
  3675   3811       AC_SUBST(TK_INCLUDES)
  3676   3812   
  3677         -    if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
  3678         -	-o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
         3813  +    if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
  3679   3814   	# On Windows and Aqua, we need the X compat headers
  3680   3815   	AC_MSG_CHECKING([for X11 header files])
  3681   3816   	if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
  3682   3817   	    INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
  3683   3818   	    TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
  3684   3819   	    AC_SUBST(TK_XINCLUDES)
  3685   3820   	fi
  3686   3821   	AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
  3687   3822       fi
  3688   3823   ])
  3689   3824   
  3690         -#------------------------------------------------------------------------
  3691         -# TEA_PROG_TCLSH
  3692         -#	Determine the fully qualified path name of the tclsh executable
  3693         -#	in the Tcl build directory or the tclsh installed in a bin
  3694         -#	directory. This macro will correctly determine the name
  3695         -#	of the tclsh executable even if tclsh has not yet been
  3696         -#	built in the build directory. The tclsh found is always
  3697         -#	associated with a tclConfig.sh file. This tclsh should be used
  3698         -#	only for running extension test cases. It should never be
  3699         -#	or generation of files (like pkgIndex.tcl) at build time.
  3700         -#
  3701         -# Arguments
  3702         -#	none
  3703         -#
  3704         -# Results
  3705         -#	Subst's the following values:
  3706         -#		TCLSH_PROG
  3707         -#------------------------------------------------------------------------
  3708         -
  3709         -AC_DEFUN([TEA_PROG_TCLSH], [
  3710         -    AC_MSG_CHECKING([for tclsh])
  3711         -    if test -f "${TCL_BIN_DIR}/Makefile" ; then
  3712         -        # tclConfig.sh is in Tcl build directory
  3713         -        if test "${TEA_PLATFORM}" = "windows"; then
  3714         -            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
  3715         -        else
  3716         -            TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
  3717         -        fi
  3718         -    else
  3719         -        # tclConfig.sh is in install location
  3720         -        if test "${TEA_PLATFORM}" = "windows"; then
  3721         -            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
  3722         -        else
  3723         -            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
  3724         -        fi
  3725         -        list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
  3726         -              `ls -d ${TCL_BIN_DIR}/..     2>/dev/null` \
  3727         -              `ls -d ${TCL_PREFIX}/bin     2>/dev/null`"
  3728         -        for i in $list ; do
  3729         -            if test -f "$i/${TCLSH_PROG}" ; then
  3730         -                REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
  3731         -                break
  3732         -            fi
  3733         -        done
  3734         -        TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
  3735         -    fi
  3736         -    AC_MSG_RESULT([${TCLSH_PROG}])
  3737         -    AC_SUBST(TCLSH_PROG)
  3738         -])
  3739         -
  3740         -#------------------------------------------------------------------------
  3741         -# TEA_PROG_WISH
  3742         -#	Determine the fully qualified path name of the wish executable
  3743         -#	in the Tk build directory or the wish installed in a bin
  3744         -#	directory. This macro will correctly determine the name
  3745         -#	of the wish executable even if wish has not yet been
  3746         -#	built in the build directory. The wish found is always
  3747         -#	associated with a tkConfig.sh file. This wish should be used
  3748         -#	only for running extension test cases. It should never be
  3749         -#	or generation of files (like pkgIndex.tcl) at build time.
  3750         -#
  3751         -# Arguments
  3752         -#	none
  3753         -#
  3754         -# Results
  3755         -#	Subst's the following values:
  3756         -#		WISH_PROG
  3757         -#------------------------------------------------------------------------
  3758         -
  3759         -AC_DEFUN([TEA_PROG_WISH], [
  3760         -    AC_MSG_CHECKING([for wish])
  3761         -    if test -f "${TK_BIN_DIR}/Makefile" ; then
  3762         -        # tkConfig.sh is in Tk build directory
  3763         -        if test "${TEA_PLATFORM}" = "windows"; then
  3764         -            WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
  3765         -        else
  3766         -            WISH_PROG="${TK_BIN_DIR}/wish"
  3767         -        fi
  3768         -    else
  3769         -        # tkConfig.sh is in install location
  3770         -        if test "${TEA_PLATFORM}" = "windows"; then
  3771         -            WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
  3772         -        else
  3773         -            WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
  3774         -        fi
  3775         -        list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
  3776         -              `ls -d ${TK_BIN_DIR}/..     2>/dev/null` \
  3777         -              `ls -d ${TK_PREFIX}/bin     2>/dev/null`"
  3778         -        for i in $list ; do
  3779         -            if test -f "$i/${WISH_PROG}" ; then
  3780         -                REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
  3781         -                break
  3782         -            fi
  3783         -        done
  3784         -        WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
  3785         -    fi
  3786         -    AC_MSG_RESULT([${WISH_PROG}])
  3787         -    AC_SUBST(WISH_PROG)
  3788         -])
  3789         -
  3790   3825   #------------------------------------------------------------------------
  3791   3826   # TEA_PATH_CONFIG --
  3792   3827   #
  3793   3828   #	Locate the ${1}Config.sh file and perform a sanity check on
  3794   3829   #	the ${1} compile flags.  These are used by packages like
  3795   3830   #	[incr Tk] that load *Config.sh files from more than Tcl and Tk.
  3796   3831   #
................................................................................
  3876   3911   	    if test x"${ac_cv_c_$1config}" = x ; then
  3877   3912   		for i in `ls -d ${libdir} 2>/dev/null` \
  3878   3913   			`ls -d ${exec_prefix}/lib 2>/dev/null` \
  3879   3914   			`ls -d ${prefix}/lib 2>/dev/null` \
  3880   3915   			`ls -d /usr/local/lib 2>/dev/null` \
  3881   3916   			`ls -d /usr/contrib/lib 2>/dev/null` \
  3882   3917   			`ls -d /usr/lib 2>/dev/null` \
         3918  +			`ls -d /usr/lib64 2>/dev/null` \
  3883   3919   			; do
  3884   3920   		    if test -f "$i/$1Config.sh" ; then
  3885   3921   			ac_cv_c_$1config=`(cd $i; pwd)`
  3886   3922   			break
  3887   3923   		    fi
  3888   3924   		done
  3889   3925   	    fi
................................................................................
  3903   3939   
  3904   3940   #------------------------------------------------------------------------
  3905   3941   # TEA_LOAD_CONFIG --
  3906   3942   #
  3907   3943   #	Load the $1Config.sh file
  3908   3944   #
  3909   3945   # Arguments:
  3910         -#	
         3946  +#
  3911   3947   #	Requires the following vars to be set:
  3912   3948   #		$1_BIN_DIR
  3913   3949   #
  3914   3950   # Results:
  3915   3951   #
  3916         -#	Subst the following vars:
         3952  +#	Substitutes the following vars:
  3917   3953   #		$1_SRC_DIR
  3918   3954   #		$1_LIB_FILE
  3919   3955   #		$1_LIB_SPEC
  3920         -#
  3921   3956   #------------------------------------------------------------------------
  3922   3957   
  3923   3958   AC_DEFUN([TEA_LOAD_CONFIG], [
  3924   3959       AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
  3925   3960   
  3926   3961       if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
  3927   3962           AC_MSG_RESULT([loading])
................................................................................
  3940   3975       #
  3941   3976   
  3942   3977       if test -f "${$1_BIN_DIR}/Makefile" ; then
  3943   3978   	AC_MSG_WARN([Found Makefile - using build library specs for $1])
  3944   3979           $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
  3945   3980           $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
  3946   3981           $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
         3982  +        $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
         3983  +        $1_LIBRARY_PATH=${$1_LIBRARY_PATH}
  3947   3984       fi
  3948   3985   
  3949   3986       AC_SUBST($1_VERSION)
  3950   3987       AC_SUBST($1_BIN_DIR)
  3951   3988       AC_SUBST($1_SRC_DIR)
  3952   3989   
  3953   3990       AC_SUBST($1_LIB_FILE)
  3954   3991       AC_SUBST($1_LIB_SPEC)
  3955   3992   
  3956   3993       AC_SUBST($1_STUB_LIB_FILE)
  3957   3994       AC_SUBST($1_STUB_LIB_SPEC)
  3958   3995       AC_SUBST($1_STUB_LIB_PATH)
         3996  +
         3997  +    # Allow the caller to prevent this auto-check by specifying any 2nd arg
         3998  +    AS_IF([test "x$2" = x], [
         3999  +	# Check both upper and lower-case variants
         4000  +	# If a dev wanted non-stubs libs, this function could take an option
         4001  +	# to not use _STUB in the paths below
         4002  +	AS_IF([test "x${$1_STUB_LIB_SPEC}" = x],
         4003  +	    [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)],
         4004  +	    [TEA_LOAD_CONFIG_LIB($1_STUB)])
         4005  +    ])
         4006  +])
         4007  +
         4008  +#------------------------------------------------------------------------
         4009  +# TEA_LOAD_CONFIG_LIB --
         4010  +#
         4011  +#	Helper function to load correct library from another extension's
         4012  +#	${PACKAGE}Config.sh.
         4013  +#
         4014  +# Results:
         4015  +#	Adds to LIBS the appropriate extension library
         4016  +#------------------------------------------------------------------------
         4017  +AC_DEFUN([TEA_LOAD_CONFIG_LIB], [
         4018  +    AC_MSG_CHECKING([For $1 library for LIBS])
         4019  +    # This simplifies the use of stub libraries by automatically adding
         4020  +    # the stub lib to your path.  Normally this would add to SHLIB_LD_LIBS,
         4021  +    # but this is called before CONFIG_CFLAGS.  More importantly, this adds
         4022  +    # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
         4023  +    if test "x${$1_LIB_SPEC}" != "x" ; then
         4024  +	if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
         4025  +	    TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"])
         4026  +	    AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}])
         4027  +	else
         4028  +	    TEA_ADD_LIBS([${$1_LIB_SPEC}])
         4029  +	    AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}])
         4030  +	fi
         4031  +    else
         4032  +	AC_MSG_RESULT([file not found])
         4033  +    fi
         4034  +])
         4035  +
         4036  +#------------------------------------------------------------------------
         4037  +# TEA_EXPORT_CONFIG --
         4038  +#
         4039  +#	Define the data to insert into the ${PACKAGE}Config.sh file
         4040  +#
         4041  +# Arguments:
         4042  +#
         4043  +#	Requires the following vars to be set:
         4044  +#		$1
         4045  +#
         4046  +# Results:
         4047  +#	Substitutes the following vars:
         4048  +#------------------------------------------------------------------------
         4049  +
         4050  +AC_DEFUN([TEA_EXPORT_CONFIG], [
         4051  +    #--------------------------------------------------------------------
         4052  +    # These are for $1Config.sh
         4053  +    #--------------------------------------------------------------------
         4054  +
         4055  +    # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
         4056  +    eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}"
         4057  +    if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
         4058  +	eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}${DBGX}"
         4059  +	eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}"
         4060  +    else
         4061  +	eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
         4062  +	eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
         4063  +    fi
         4064  +    $1_BUILD_LIB_SPEC="-L`pwd` ${$1_LIB_FLAG}"
         4065  +    $1_LIB_SPEC="-L${pkglibdir} ${$1_LIB_FLAG}"
         4066  +    $1_BUILD_STUB_LIB_SPEC="-L`pwd` [$]{$1_STUB_LIB_FLAG}"
         4067  +    $1_STUB_LIB_SPEC="-L${pkglibdir} [$]{$1_STUB_LIB_FLAG}"
         4068  +    $1_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}"
         4069  +    $1_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}"
         4070  +
         4071  +    AC_SUBST($1_BUILD_LIB_SPEC)
         4072  +    AC_SUBST($1_LIB_SPEC)
         4073  +    AC_SUBST($1_BUILD_STUB_LIB_SPEC)
         4074  +    AC_SUBST($1_STUB_LIB_SPEC)
         4075  +    AC_SUBST($1_BUILD_STUB_LIB_PATH)
         4076  +    AC_SUBST($1_STUB_LIB_PATH)
         4077  +
         4078  +    AC_SUBST(MAJOR_VERSION)
         4079  +    AC_SUBST(MINOR_VERSION)
         4080  +    AC_SUBST(PATCHLEVEL)
  3959   4081   ])
         4082  +
  3960   4083   
  3961   4084   #------------------------------------------------------------------------
  3962   4085   # TEA_PATH_CELIB --
  3963   4086   #
  3964   4087   #	Locate Keuchel's celib emulation layer for targeting Win/CE
  3965   4088   #
  3966   4089   # Arguments:

Changes to unix/tclAppInit.c.

    28     28   |
    29     29   |   written by Rolf Ade
    30     30   |   August, 2007
    31     31   |
    32     32   \---------------------------------------------------------------------------*/
    33     33   
    34     34   #include "tcl.h"
           35  +
           36  +#ifndef MODULE_SCOPE
           37  +#   define MODULE_SCOPE extern
           38  +#endif
           39  +MODULE_SCOPE int Tcl_AppInit(Tcl_Interp *);
           40  +MODULE_SCOPE int main(int, char **);
    35     41    
    36     42   extern int Tdom_Init _ANSI_ARGS_((Tcl_Interp *interp));
    37     43   extern int Tdom_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
    38     44   
    39     45   /*----------------------------------------------------------------------------
    40     46   |   main
    41     47   |