On Mon, Jan 06, 2003 at 01:54:05PM -0800, Jeff Hobbs wrote:
> > Has anyone successfully built and used Tcl 8.4.1 (or any flavor of 8.4
> > for that matter) with AOLserver 3.3+ad13, or a similar AOLserver
> > version (aka, pre-3.5)?  If you have, could you tell me how you built
> > it?

> I don't have that version of AOLServer to compare against, but Tcl 8.4.1
> should not require any core patching to work with AOLServer now.  I'm
> not sure if that also accompanied changes to AOLServer code ...

Yes, that's what I don't know either, whether Tcl 8.4.1 can be used
stock with ALL versions of AOLserver, or whether AOLserver was changed
c. versions 3.5 and 4.0 to be able to use the stock Tcl.  Who knows
for sure?

I did try to hack up Tcl 8.4.1 the way 8.3.2 was hacked for AOLserver
3.3 (+ad13, although I doubt that matters in this context).  I failed
miserably.  For your amusement, I've attached my README.AOLSERVER with
all my notes on what I did on how it broke.

On the other hand a completley stock 8.4.1 w/ 3.3+ad13 DID build
libtcl8.4g.a and nsd8x successfully, but a brief test showed that it
DEFINITELY wasn't working right - crashing with bus errors, bad stuff
like that.

Back in July, Roberto Mello reported that his AOLserver 3.3+ad13 w/
Tcl 8.4b1 crashed several times while testing, but I don't know how he
built it.

I'll probably try AOLserver 3.5 next, but it would be nice to know if
and how older versions of AOLserver can be made to work with Tcl 8.4.

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com
Tcl8.4.1 for AOLserver
----------------------

I tried building Tcl 8.4.1 with AOLserver 3.3+ad13 two different ways.
One, stock Tcl with basically no changes.  Two, with my attempts to
hack Tcl 8.4.1 in the same ways Tcl 8.3.2 was hacked for AOLserver.

In both cases, the following changes apply:

../include/Makefile.global :

  8.4.1: You have to change the following lines like so:
  [EMAIL PROTECTED], 2003/01/06 18:17 EST

    #TCL8X_DIR=tcl8.3.2
    TCL8X_DIR=tcl8.4.1
    #TCL8X_LIB=libtcl8.3g.a
    TCL8X_LIB=libtcl8.4g.a

[EMAIL PROTECTED], 2003/01/06 15:08 EST


Tcl8.4.1, stock, for AOLserver
------------------------------

Stock Tcl 8.4.1, aolserver/tcl8.4.1/Makefile copied identically from
3.3+ad13 aolserver/tcl8.2.2/Makefile:

Note that I did NOT use "--enable-threads".

aolserver/tcl8.4.1/unix/libtcl8.4g.a - Built successfully, but with
the following weird warnings:

  In file included from ./../generic/regcomp.c:33:
  ../generic/regguts.h:58: warning: `NDEBUG' redefined
  *Initialization*:1: warning: this is the location of the previous definition
  
  ./../generic/tclIOUtil.c: In function `Tcl_Stat':
  ./../generic/tclIOUtil.c:110: warning: integer overflow in expression

aolserver/nsd/nsd8x - Built successfully!

TODO: Does it work?  I have not tested.  [EMAIL PROTECTED],
2003/01/06 19:12 EST


Tcl8.3.2 for AOLserver
----------------------

This directory contains a subset of the Tcl8.3.2 files required to build
the nsd8x AOLserver.  The following directories where removed:

        mac tests tools library doc unix/dltest

  8.4.1:

  I did the same, except I left unix/dltest as for some reason Tcl
  wouldn't build without it, even though the Makefile has
  "--disable-shared".  [EMAIL PROTECTED], 2003/01/06 15:08 EST


Otherwise, the files are unchanged except for the following:

Makefile:

        New file in this directory which will execute unix/configure
        with the correct flags and then make libtcl8.3.a with
        a CFLAGS used to build AOLserver.

  8.4.1:

  Initially I copied the Makefile verbatim, had "No rule to make
  target `libtcl8.4g.a'" build problems, added "--enable-threads".

generic/tclIO.c:

        Changed channel translation mode to binary by default.

  8.4.1:

  Made same changes as in 8.3.2.  Code is a little different though -
  8.4.1 seems to have taken some code from the AOLserver version, a
  few other differences, e.g. this was added in 8.4.1:
  [EMAIL PROTECTED], 2003/01/06 17:31 EST

    Tcl_EventuallyFree((ClientData) chanPtr, TCL_DYNAMIC);

generic/tclObj.c:
generic/tclInt.h:

        Changed the Tcl_Obj allocate and free to called ckalloc/ckfree
        directly instead of maintaining the object "cache".  The idea
        is that the AOLserver's -z allocator, utilized by ckalloc/ckfree,
        is faster than the object cache with required mutex lock.

  8.4.1:

  I got tired and didn't make any changes at all.  Plus I think this
  stuff may already be handling it the way AOLserver wants.
  [EMAIL PROTECTED], 2003/01/06 17:44 EST

generic/nsthreads.c:

  8.4.1:

  This wasn't mentioned in the 8.3.2 notes, but 8.3.2/AOLserver added
  this file.  I simply copied the file verbatim.  [EMAIL PROTECTED],
  2003/01/06 18:14 EST

unix/Makefile.in:

        Removed tclUnixThrd.o and tclAlloc.o objects.  The required
        functions are included in thread/tcl8x.c for compatibility
        with nsthreads.

  8.4.1:

  Made same changes as in 8.3.2.  [EMAIL PROTECTED], 2003/01/06
  16:53 EST

unix/tcl.m4:
unix/configure:

        Commented out the checks for enabling threads and detecting
        the required libraries.  The library dependencies are taken
        care of in the standard AOLserver build environment.  Autoconf
        was used to re-create the configure script with the modified
        tcl.m4.

  8.4.1:

  For unix/tcl.m4, put in same change as 8.3.2, plus also added
  "AC_DEFINE(USE_THREAD_ALLOC)" which I'm guessing 8.4.1 should have.

  Notes:
  - The stock 8.3.2 from CVS doesn't HAVE unix/configure, just
    configure.in, whle the stock 8.4.1 does have unix/configure.
  - The stock and AOLserver versions of 8.3.2 configure.in are
    identical.
  - The stock 8.4.1 configure is very different from the
    8.3.2/AOLserver configure.

  I also tried regenerating the configure script with autoconf
  (version 2.13), I got the following warnings:

    tcl.m4:500: /opt/sfw/bin/gm4: Warning: Excess arguments to built-in `define' 
ignored
    configure.in:85: warning: AC_TRY_RUN called without default to allow cross 
compiling
    configure.in:363: warning: AC_TRY_RUN called without default to allow cross 
compiling

  However, I could not build successfully with the generated configure
  script.  I couldn't build successfully with the stock one either,
  but the errors were different!  See below for more info.

  [EMAIL PROTECTED], 2003/01/06 20:17 EST

unix/tclUnixPort.h:

        Modified the definition of TclpMutex to be a void * instead
        of a pthead_mutex for compatibility with Ns_Mutex.

  8.4.1:

  Very simple change, made the same change as in 8.3.2, it's these
  lines: [EMAIL PROTECTED], 2003/01/06 16:43 EST

    #if 0
    #include <pthread.h>
    typedef pthread_mutex_t TclpMutex;
    #else
    typedef void *TclpMutex;
    #endif

For comparison, copies of the orginal files before modifications
are save as ".orig".

  8.4.1:

  No, they weren't.  Not in the distribution I had anyway.
  [EMAIL PROTECTED], 2003/01/06 16:38 EST
  TODO:  Make a patch or something.


Tcl8.4.1, hacked, for AOLserver
------------------------------

Tcl 8.4.1, hacked in ways similar to the Tcl 8.3.2 distributed with
AOLserver 3.3+ad13, as noted below under "Tcl8.3.2 for AOLserver".

aolserver/tcl8.4.1/unix/libtcl8.4g.a - Built successfully, but with
the following weird warnings:

    gmake[1]: Entering directory `/web/aol3-src/aolserver/tcl8.4.1/unix'
    gmake[1]: *** No rule to make target `libtcl8.4g.a'.  Stop.


With: NO --enable-threads, unix/configure created with autoconf :
With:    --enable-threads, unix/configure created with autoconf :

Same in both cases, fails immediately with error:

  gmake[1]: Entering directory `/web/aol3-src/aolserver/tcl8.4.1/unix'
  gmake[1]: *** No rule to make target `libtcl8.4g.a'.  Stop.


With: NO --enable-threads, original 8.4.1 unix/configure :

Build fails right at beginning in truly strange fashion:

  gmake[1]: Entering directory `/web/aol3-src/aolserver/tcl8.4.1/unix'
  gcc -pipe -c -I../../include -I../include -D_REENTRANT=1 -DNDEBUG=1 -g -O2 -fPIC 
-Wall -Wno-unused -mcpu=ultrasparc -D_POSIX_PTHREAD_SEMANTICS=1 
-DUSE_PTHREAD_SYSSCOPE=1 -DUSE_PTHREAD_PSHARED=1 -DHAVE_ETIME_BUG=1 -DUSE_DUPHIGH=1 
-DHAVE_FORK1=1 -DUSE_TCL8X -Dfork=ns_fork -Dreaddir=ns_readdir -Dgmtime=ns_gmtime 
-Dsignal=ns_signal -Dlocaltime=ns_localtime -Wall -Wconversion -Wno-implicit-int -fPIC 
-I./../generic -I. -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_WIDE_INT_TYPE=long\ long 
-DHAVE_STRUCT_DIRENT64=1 -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 
-DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 
-DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 
-DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 
-DHAVE_TZNAME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TIMEZONE_VAR=1 
-DHAVE_ST_BLKSIZE=1 -Dstrtod=fixstrtod -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 
-DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DSTATIC_BUILD=1 -D_REENTRANT=1 
-D_POSIX_PTHREAD_SEMANTICS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1         
-DTCL_SHLIB_EXT=\".so\" -DUSE_TCLALLOC=0 ./../generic/nsthreads.c
  ./../generic/nsthreads.c:426: parse error before `*'
  ./../generic/nsthreads.c:426: warning: data definition has no type or storage class
  ./../generic/nsthreads.c:427: parse error before `{'
  ./../generic/nsthreads.c:451: parse error before `*'
  ./../generic/nsthreads.c:451: warning: data definition has no type or storage class
  ./../generic/nsthreads.c:452: parse error before `{'
  ./../generic/nsthreads.c:645: parse error before `*'
  ./../generic/nsthreads.c:645: warning: data definition has no type or storage class
  ./../generic/nsthreads.c:646: conflicting types for `mutexPtr'

Line 426 does rather strange to me, it's the "Tcl_Mutex *mutexPtr"
here:

  NS_EXPORT void
  Tcl_MutexLock(mutexPtr)
      Tcl_Mutex *mutexPtr;      /* Really (Ns_Mutex **) */
  {
      Ns_MutexLock((Ns_Mutex *) mutexPtr);
  }


With: --enable-threads, original 8.4.1 unix/configure :

I got LOTS of the following weird warnings, but after a libtcl8.4g.a
and libtclstub8.4g.a did build:

  In file included from ./../generic/regcomp.c:33:
  ../generic/regguts.h:58: warning: `NDEBUG' redefined
  *Initialization*:1: warning: this is the location of the previous definition
  
  In file included from ../generic/tclPort.h:27,
                   from ./../generic/tclAsync.c:19:
  ../generic/../unix/tclUnixPort.h:564: warning: `readdir' redefined
  *Initialization*:1: warning: this is the location of the previous definition
  *Initialization*:1: warning: this is the location of the previous definition
  ../generic/../unix/tclUnixPort.h:565: warning: `localtime' redefined
  *Initialization*:1: warning: this is the location of the previous definition
  ../generic/../unix/tclUnixPort.h:566: warning: `gmtime' redefined
  *Initialization*:1: warning: this is the location of the previous definition


TODO: Oddity:  At one point, I DID get this hacked up version to build
libtcl8.4g.a successfully, but I don't remember how I did it, and
can't seem to replicate it.  And anyway, nsd8x failed to build against
that libtcl8.4g.a - it had these link errors:

  ld: fatal: symbol `TclpFree' is multiply-defined:
          (file ../tcl8.4.1/unix/libtcl8.4g.a(tclThreadAlloc.o) and file 
../tcl8.4.1/unix/libtcl8.4g.a(nsthreads.o));
  ld: fatal: symbol `TclpAlloc' is multiply-defined:
          (file ../tcl8.4.1/unix/libtcl8.4g.a(tclThreadAlloc.o) and file 
../tcl8.4.1/unix/libtcl8.4g.a(nsthreads.o));
  ld: fatal: symbol `TclpRealloc' is multiply-defined:
          (file ../tcl8.4.1/unix/libtcl8.4g.a(tclThreadAlloc.o) and file 
../tcl8.4.1/unix/libtcl8.4g.a(nsthreads.o));
  ld: warning: symbol `binfo' has differing sizes:
          (file ../tcl8.4.1/unix/libtcl8.4g.a(tclThreadAlloc.o) value=0xb0; file 
../thread/libnsthread.a(pool.o) value=0x4);
          ../tcl8.4.1/unix/libtcl8.4g.a(tclThreadAlloc.o) definition taken
  ld: fatal: File processing errors. No output written to nsd8x

[EMAIL PROTECTED], 2003/01/06 20:24 EST

Reply via email to