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

Using TEA with in another (existing) autoconf build...

84 views
Skip to first unread message

Georgios Petasis

unread,
Jul 5, 2017, 7:29:21 AM7/5/17
to
Hi all,

I am trying to add tcl support to the redland-bindings package. Language
bindings are generated by SWIG, so adding tcl is as simple as calling
swig and compiling the generated c file.

Redland-bindings already has a build system based on automake/autoconf,
and I am trying to integrate TEA from the sample extension.

What I have done is the following:

* In the existing configure.ac, I have added:
AC_CONFIG_MACRO_DIR([tcl/tclconfig]) #This directory contains tcl.m4
TEA_INIT([3.10])

* I have written some code to handle --with-tcl (I know that TEA defines
it, but in redland-bindings --with-tcl means enable tcl, so I did some
changes so as TEA sees it as not specified if no value has been given.)

* If tcl is enabled, I call inside configure.ac:
TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG
TEA_PUBLIC_TCL_HEADERS
TEA_ENABLE_THREADS
TEA_ENABLE_SHARED
TEA_CONFIG_CFLAGS
TEA_MAKE_LIB
TEA_PROG_TCLSH

The problem is, that I see no variable that contains the use
USE_TCL_STUBS definition.
Variable SHLIB_LD_LIBS contains "-L/usr/lib64 -ltclstub8.6".

What variable do I have to use to get -DUSE_TCL_STUBS=1?

George

EL

unread,
Jul 10, 2017, 2:22:06 PM7/10/17
to
Am 05.07.2017 um 13:29 schrieb Georgios Petasis:

> The problem is, that I see no variable that contains the use
> USE_TCL_STUBS definition.
> Variable SHLIB_LD_LIBS contains "-L/usr/lib64 -ltclstub8.6".
>
> What variable do I have to use to get -DUSE_TCL_STUBS=1?

Is that on macOS? I had a similar problem there and reported a bug recently:

https://core.tcl.tk/sampleextension/info/28cea38a2f9f5cf9

It is possible to work around it by appending -DUSE_TCL_STUBS in
Makefile.in, where the CPPFLAGS are defined.

On Linux it works apparently, the USE_TCL_STUBS define is magically set...

--
EL

Matthew Hiles

unread,
Jul 10, 2017, 4:59:28 PM7/10/17
to
Should be able to do make CPPFLAGS+=-DUSE_TCL_STUBS, rather than having to edit any files.

Georgios Petasis

unread,
Jul 11, 2017, 4:08:12 AM7/11/17
to
The problem is the whole tcl.m4 does not contain at all USE_TCL_STUBS.
There is a single usage in a section that deals with OSX, but apart from
that, nothing else.

So, the fact that I don't get it defined anywhere, is the logical outcome.

I think that either this is a bug in the current fossil head, or it is
handled in the makefile.

(I am testing it under linux)

George

EL

unread,
Jul 11, 2017, 3:22:05 PM7/11/17
to
Am 11.07.2017 um 10:07 schrieb Georgios Petasis:

> The problem is the whole tcl.m4 does not contain at all USE_TCL_STUBS.

I remember, when I checked out the sample extension recently to start
working on a project, the whole tclconfig/ directory was missing,
including tcl.m4. It was not possible to call autoconf because of that.
I then copied the directory from another extension, which solved the
problem... But well, this should be reported too.

The directory tclconfig/ is definitely missing in the fossil trunk.


--
EL

Don Porter

unread,
Jul 11, 2017, 3:44:15 PM7/11/17
to
The fossil sources for tclconfig/TEA are found here:

https://core.tcl.tk/tclconfig

There is one source for this module of build support code, which is
in turn used by a large number of "TEA compliant" packages. They
should all continue to draw from a common source, and should avoid
making the mistake you suggest of forking their own copy.\

Here are some typical instructions for the Itcl package illustrating
how to pull all the pieces together:

http://core.tcl.tk/itcl/wiki?name=Tracking+Itcl+Sources

--
| Don Porter Applied and Computational Mathematics Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Georgios Petasis

unread,
Jul 12, 2017, 5:08:58 AM7/12/17
to
Στις 11/7/2017 22:44, ο Don Porter έγραψε:
> On 07/11/2017 03:13 PM, EL wrote:
>> Am 11.07.2017 um 10:07 schrieb Georgios Petasis:
>>
>>> The problem is the whole tcl.m4 does not contain at all USE_TCL_STUBS.
>>
>> I remember, when I checked out the sample extension recently to start
>> working on a project, the whole tclconfig/ directory was missing,
>> including tcl.m4. It was not possible to call autoconf because of that.
>> I then copied the directory from another extension, which solved the
>> problem... But well, this should be reported too.
>>
>> The directory tclconfig/ is definitely missing in the fossil trunk.
>
> The fossil sources for tclconfig/TEA are found here:
>
> https://core.tcl.tk/tclconfig
>
> There is one source for this module of build support code, which is
> in turn used by a large number of "TEA compliant" packages. They
> should all continue to draw from a common source, and should avoid
> making the mistake you suggest of forking their own copy.\
>
> Here are some typical instructions for the Itcl package illustrating
> how to pull all the pieces together:
>
> http://core.tcl.tk/itcl/wiki?name=Tracking+Itcl+Sources
>

Is there a reason that "-DUSE_TCL_STUBS=1" is only defined in the case
of aqua in tcl.m4? How is this definition achieved for the rest of the
operating systems?

George

EL

unread,
Jul 13, 2017, 5:02:06 PM7/13/17
to
Am 11.07.17 um 10:07 schrieb Georgios Petasis:

> The problem is the whole tcl.m4 does not contain at all USE_TCL_STUBS.
> There is a single usage in a section that deals with OSX, but apart from
> that, nothing else.
>
> So, the fact that I don't get it defined anywhere, is the logical outcome.

I think I know where the trouble comes from.
Former versions of configure.ac contained this section:

...
#--------------------------------------------------------------------
# Everyone should be linking against the Tcl stub library. If you
# can't for some reason, remove this definition. If you aren't using
# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
# link against the non-stubbed Tcl library. Add Tk too if necessary.
#--------------------------------------------------------------------

AC_DEFINE(USE_TCL_STUBS)
#AC_DEFINE(USE_TK_STUBS)
...

This is missing now in the sampleextension. When I added it to my
project (copied from another extension) and run autoconf, the
./configure has the option --enable-stubs and it is enabled by default.
The build now works on macOS... and I think on Linux too.

I wonder why this section was removed from configure.ac, though.


--
EL

Eric

unread,
Jul 14, 2017, 6:10:05 AM7/14/17
to
It would appear that it was removed on 2016-06-11 - accompanied by
changes to the separate tclconfig on the same day, the total effect
being to replace the need to mention stubs in configure.ac with changes
in tcl.m4 so that --enable-stubs can be used.

Judging by the previous posts in the thread the real problem comes from
using a non-matching tclconfig, which will never be a good idea!

Eric
--
ms fnd in a lbry

Georgios Petasis

unread,
Jul 15, 2017, 3:32:25 AM7/15/17
to
The problem I observe is that I get USE_TCL_STUBS (with value 1) as a
variable in the makefile. What I do not get, is -DUSE_TCL_STUBS in any
of the compiler flags.

So, anything build, does not use flags. Putting -DUSE_TCL_FLAGS=1 in the
makefile solves this, but not the correct approach.

George

Eric

unread,
Jul 15, 2017, 6:40:06 AM7/15/17
to
I have just fetched the latest TEA sample and tclconfig from the Fossil
repositories at core.tcl.tk, put the tclconfig in place, and run
configure (no options), and I _do_ get a Makefile with -DUSE_TCL_STUBS=1
in it.

So what do you have, or what are you doing, that is different?

EL

unread,
Jul 15, 2017, 12:44:07 PM7/15/17
to
Am 15.07.2017 um 12:20 schrieb Eric:

> I have just fetched the latest TEA sample and tclconfig from the Fossil
> repositories at core.tcl.tk, put the tclconfig in place, and run
> configure (no options), and I _do_ get a Makefile with -DUSE_TCL_STUBS=1
> in it.
>
> So what do you have, or what are you doing, that is different?

I fetched the latest trunk commit from tclconfig as well, and it still
didn't work for me.
What I do differently, maybe, is that I tried to build it on macOS
(sierra), with the toolchain that comes with xcode. It works for me on
Linux, though.

The README in core.tcl.tk/sampleextension still mentions the tclconfig/
directory as part of it, and I don't see a hint somewhere that this
directory is now managed in a separate repository. Obviously I couldn't
know this... the last time I actively used the sample extension was
about a decade ago, back then it contained everything and was hosted on
sourceforge.


--
EL

Eric

unread,
Jul 16, 2017, 8:10:06 AM7/16/17
to
On 2017-07-15, EL <elehm...@gmail.com> wrote:
> Am 15.07.2017 um 12:20 schrieb Eric:
>
>> I have just fetched the latest TEA sample and tclconfig from the Fossil
>> repositories at core.tcl.tk, put the tclconfig in place, and run
>> configure (no options), and I _do_ get a Makefile with -DUSE_TCL_STUBS=1
>> in it.
>>
>> So what do you have, or what are you doing, that is different?
>
> I fetched the latest trunk commit from tclconfig as well, and it still
> didn't work for me.

Do you have the latest from sampleextension as well?

Did you run configure without editing configure.ac or Makefile.in and
without running autoconf?

If both answers are yes, then it seems that the same configure script
behaves differently on macOS to how it behaves on Linux.

> What I do differently, maybe, is that I tried to build it on macOS
> (sierra), with the toolchain that comes with xcode. It works for me on
> Linux, though.

The version of autoconf in that toolchain may also be a factor.

>
> The README in core.tcl.tk/sampleextension still mentions the tclconfig/
> directory as part of it, and I don't see a hint somewhere that this
> directory is now managed in a separate repository. Obviously I couldn't
> know this... the last time I actively used the sample extension was
> about a decade ago, back then it contained everything and was hosted on
> sourceforge.

The README definitely needs updating, as does the documentation in the
tea subdirectory of sampleextension. There is a tclconfig page in the
wiki which points out the separate repository (http://wiki.tcl.tk/8511)
and it's mentioned in other places in the wiki.

(BTW the Changelog in sampleextension is also out of date.)

EL

unread,
Jul 20, 2017, 4:44:05 PM7/20/17
to
Am 16.07.17 um 14:03 schrieb Eric:

> The version of autoconf in that toolchain may also be a factor.

autoconf is from MacPorts on my system. I just realized that there is no
autoconf shipped with recent xcode versions anymore.

> The README definitely needs updating, as does the documentation in the
> tea subdirectory of sampleextension. There is a tclconfig page in the
> wiki which points out the separate repository (http://wiki.tcl.tk/8511)
> and it's mentioned in other places in the wiki.
>
> (BTW the Changelog in sampleextension is also out of date.)

I just checked out a fresh directory from core.tcl.tk/sampleextension
and fresh core.tcl.tk/tclconfig, copied the latter into the first and
tried it again. This time it worked and ./configure does also have the
--enable-stubs option.
No idea what went wrong before, maybe too much of a mess between old and
new m4 macros, caches - or my general dislike of the autotools maybe,
too ;). Whatever it was, it seems to be my fault (apart from the missing
documentation and change notice).


--
EL
0 new messages