Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TEA && sampleextension updates (also [incr Tcl] and TclX 8.4)

0 views
Skip to first unread message

Jeff Hobbs

unread,
Apr 4, 2002, 3:47:31 AM4/4/02
to
I've spent the last couple of weeks pondering the icky bits of
configure and make across systems, and the many difficult nuances
of TEA that have made it not so easy to use (and thus not popular).

I'm not completely finished with all my changes, but I have made
quite a few changes that people might be interested in testing.
The projects that I have so far updated to use the new spec are:

[incr Tcl/Tk]
TclX (experimental 8.4 head)
Thread
sampleextension
Tktable

While this is not a vast array of extensions, it does represent a
wide array of build needs. [incr Tcl] builds its own stubs library
and [incr Tk] has to use it. Thread adds constraints to how it can
be built, TclX has to do extra configure checks, and sampleextension
and Tktable represent standard Tcl and Tk extensions respectively.

Some of the notable changes I have made to simplify not just
building, but install and maintenance are:

* Packages install executable libraries and runtime Tcl sources into
the exec_prefix. Most C-based extensions have comparatively small
runtime Tcl components, and keeping them together improves the
ability to keep things in sync and helps users grok everything in
a package much easier.

* Black-boxed a lot more configure voodoo into the tcl.m4 file.
As an example, the sample extension's configure.in sets about
a dozen vars (5 of those just related to the version), calls a
dozen TEA_* macros and a few more AC_* macros and that's all.

* The Makefile.in is also cleaned up. The base one is actually
larger than before, but mostly with comments and a few more
features. Less changing is required by the TEA extension builder,
and default targets like 'shell' and 'gdb' have been added. It is
also designed to allow building and testing of extensions based on
built, but not installed, Tcl and Tk binaries.

* The ability to create your own stubs library has been abstracted
into the tcl.m4 voodoo.

* The tcl.m4 has grown quite a bit, but it should still be clear for
those that feel like wandering in there. It consolidates all the
extra bits that each extension needs, and has added features.
Changes to the tclconfig/tcl.m4 now can be simply propagated to a
TEA extension by copying over the updated tcl.m4 and running
autoconf again. This means updating platform info is much easier.

* TEA modules now pick up 'prefix' and 'exec_prefix' info directly
from the Tcl's tclConfig.sh that they are building against by
default (if no --prefix and/or --exec-prefix was given).

Other things of note:

* All SC_* macros were changed to TEA_*. Sorry John, Scriptics is no
longer, and there is no need to have the cryptic prefix.

* Several platforms have been updated, all the TEA modules now have
Win64 target info, as well as (beta) mingw gcc build support.

* Modules now print out better warning info when compiling with mixed
threads-support in extensions (versus base Tcl). I haven't
propagated this change to all modules yet, but I have tested it in
Thread and sample. It prints out warnings. I'm thinking about
adding more sanity checks like this.

There are likely corner cases in various modules that still need
fixing, but I pounded hard on what I felt was the common case: users
building dynamicly loadable extensions.

People can test this stuff out by checking out one of the above modules
from SF CVS, or picking up a snapshot at:
ftp://ftp.tcl.tk/pub/tcl/nightly-cvs/

Comments welcome, but keep them on the newsgroup or tcl-core instead of
right to my inbox (hey, that's only my extended inbox anyway :) ).

Any serious problems with the TEA stuff should be registered as a bug
against the sampleextension (part of SF Tcl project), but bugs in code
for the other modules should still be directed straight to their
respective bug dbs.

--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions
Join us in Sept. for Tcl'2002: http://www.tcl.tk/community/tcl2002/

Marco Maggi

unread,
Apr 27, 2002, 6:56:22 AM4/27/02
to

"Jeff Hobbs" wrote:
>Comments welcome

Only minor observations, here we go.

[1] Makefile "dist" target

a) no need to include "configure.in" with 0775
permissions;

b) the line: "cp -p $(srcdir)/*.[ch] $(DIST_DIR)/" is
here to collect what? I guess "config.h" or something
like that, but this file is created from "config.h.in"
by "configure" so... In any case I would prepend a "-"
to it, so the "cp ./*.[ch]: No such file or directory"
error is ignored.

[2] configure.in

AC_CHECK_PROG(TAR, gtar, gtar)

if test "x${TAR}" = x ; then
AC_CHECK_PROG(TAR, tar, tar, echo)
if test "${TAR}" = "echo" ; then
AC_MSG_WARN([[cannot find tar nor gtar, "make dist" will fail]])
fi
fi

AC_CHECK_PROG(ZIP, gzip, gzip, echo)

if test "${ZIP}" = "echo" ; then
AC_MSG_WARN([[cannot find gzip, "make dist" will fail]])
fi

COMPRESS="${TAR} zcvf \$(PKG_DIR).tar.gz \$(PKG_DIR)"

and the obvious references in the Makefile. Better:
provide an "--enable-zip" option that will check for and
use "zip" or "pkzip" (or whatever) instead of tar+gzip.

AC_ARG_ENABLE(zip,
[--enable-zip try to use "zip" or "pkzip" instead of "tar"+"gzip"],
ZIP=zip,
ZIP=gzip)

if test "${ZIP}" = "gzip"; then
# the snipped above without the final AC_SUBST
else
AC_CHECK_PROG(ZIP, pkzip, pkzip)

if test "x${ZIP}" = x ; then
AC_CHECK_PROG(ZIP, zip, zip, echo)
if test "${ZIP}" = "echo" ; then
AC_MSG_WARN([[cannot find "zip" nor "pkzip", "make dist" will fail]])
fi
fi

COMPRESS="${ZIP} \$(PKG_DIR).zip \$(PKG_DIR)"
fi

AC_SUBST(COMPRESS)

on my Debian it worked with both "zip" and "tar"+"gzip".

[3] If there are no GENERIC_HDRS an error is raised.

[4] Makefile.in

bindist: dist-clean
$(MAKE) prefix=$(DIST_DIR) install
(cd $(DIST_ROOT); $(COMPRESS);)

Oh, stop it! No recursive "make"s around here? I guess
that the "DESTDIR" variable on line 133 of "Makefile.in"
was added for this purpose...

[5] Makefile.in, generic shell programming style: isn't:

(cd $(DIST_ROOT) && $(COMPRESS);)

better than:

(cd $(DIST_ROOT); $(COMPRESS);)

?

[6] While we are at it we could add a "DESCRIPTION.txt"
template.

[Whine]
Are there "make"s that do not support the "$(foreach
...)" macro? It would simplify the Makefile a lot.
I've tried to add a "show-layout" target to echo a list
of files in their install destination, but it's a mess
to extract the informations.

This is it,
Marco


--
"... but you may have guessed that already, you smart & handsome
devil!" -- Lars Magne Ingebrigtsen, "Gnus 5.7 manual"

Steve Cassidy

unread,
Apr 28, 2002, 7:54:23 AM4/28/02
to
Marco Maggi wrote:

>
> [6]  While we  are at  it we  could add  a "DESCRIPTION.txt"
> template.

Ok, here's one...(also submitted to sf patches)


Identifier: sampleextension
Version: 0.4
Title: A sample extension illustrating the Tcl Extension Architecture
Creator: Steve Reid <st...@edmweb.com>
Creator: Dave Dykstra <d...@bell-labs.com>
Maintainer: Jeff Hobbs <je...@ActiveState.com>
Description: This is a sample extension showing an implementation of
the Tcl Extension Architecture (TEA). It contains sample
C-code, documentation and configure/build scripts along
with documentation on TEA itself.
Rights: BSD
Architecture: <include architecture field for each binary arch built>


A useful makefile target would be 'package' to put together a TIP55 package
from the source. I'll try to put one together when a minute or two pops into
my schedule...


--
Steve Cassidy............SHLRC, Macquarie University, Sydney, Australia
...............<URL: http://www.shlrc.mq.edu.au/~steve>................

0 new messages