libpgtcl should be linked against the tcl stub library

Massimo Dal Zotto dz at
Fri Jun 3 14:45:56 UTC 2005

Package: libpgtcl
Version: 7.4.7-2ubuntu2.1
Severity: wishlist

The libpgtcl library should be linked against the (static) libtclstub8.x.a
library instead of so that it doesn't depend on a specific
version of Tcl/Tk but can be used indifferently with any version >= 8.1.
The same should be done also for the tcl pl language.

Use of libtclstub is described in
and basically consists in adding a call to Tcl_InitStubs() in the
Pgtcl_Init() function and linking against -ltclstub8.4 instead
of -ltcl8.4:

--- src/interfaces/libpgtcl/pgtcl.orig.c	2004-02-02 02:00:58.000000000 +0100
+++ src/interfaces/libpgtcl/pgtcl.c	2005-06-03 16:34:02.400879760 +0200
@@ -31,6 +31,12 @@
 	double		tclversion;
+	if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
+	    return TCL_ERROR;
+	}
 	 * finish off the ChannelType struct.  Much easier to do it here then
 	 * to guess where it might be by position in the struct.  This is

and in libpgtcl/Makefile something like this:

    TCL_LIB_SPEC = -L/usr/lib -ltclstub8.4
    TCL_LIBS     =

The Makefile changes should probably be done using the configure script.

I have succesfully built by hand a stub-enabled It works fine
for me and it doesn't depend on a specific tcl library:

$ ldd => /usr/lib/ (0xb7fcb000) => /usr/lib/i686/cmov/ (0xb7f9c000) => /usr/lib/i686/cmov/ (0xb7ea5000) => /usr/lib/ (0xb7e3f000) => /lib/tls/i686/cmov/ (0xb7e12000) => /lib/tls/i686/cmov/ (0xb7e02000) => /lib/tls/i686/cmov/ (0xb7cd5000) => /lib/tls/i686/cmov/ (0xb7cc4000) => /lib/tls/i686/cmov/ (0xb7caf000) => /lib/tls/i686/cmov/ (0xb7cac000) => /usr/lib/ (0xb7c8b000) => /lib/ (0xb7c88000)
        /lib/ => /lib/ (0x80000000)

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.10-5-686
Locale: LANG=C, LC_CTYPE=it_IT (charmap=ISO-8859-1)

Versions of packages libpgtcl depends on:
ii  libc6               2.3.2.ds1-20ubuntu13 GNU C Library: Shared libraries an
ii  libkrb53            1.3.6-1              MIT Kerberos runtime libraries
ii  libpam0g            0.76-22              Pluggable Authentication Modules l
ii  libpq3              7.4.7-2ubuntu2.1     PostgreSQL C client library
ii  libreadline4        4.3-15               GNU readline and history libraries
ii  libssl0.9.7         0.9.7e-3             SSL shared libraries
ii  libx11-6            6.8.2-10             X Window System protocol client li
ii  tcl8.4              8.4.7-1ubuntu1       Tcl (the Tool Command Language) v8
ii  tk8.3 [wish]        8.3.5-4              Tk toolkit for Tcl and X11, v8.3 -
ii  tk8.4 [wish]        8.4.9-1              Tk toolkit for Tcl and X11, v8.4 -
ii  xlibs               6.8.2-10             X Window System client libraries m
ii  zlib1g              1:1.2.2-4ubuntu1     compression library - runtime

Massimo Dal Zotto

More information about the ubuntu-users mailing list