Version 4 of OpenBSD

Updated 2001-10-20 20:52:44

GPS: Fri Oct 19 2001

There are some peculiar things that occur in OpenBSD when building Tcl/Tk extensions.

For some reason when building Tcl using configure without any options it builds libraries with names like this:

   libtcl83.so.1.0
   libtcl83.a

Most extensions seem to think that the name should be libtcl8.3, so I constantly have to change the -l usage in the Makefile, or use a symbolic link (which I think is messy). This may be related to /bin/sh being pdksh instead of bash like in Linux, or something with sed. I don't know enough about the Tcl/Autoconf build system to tell. There is also a recent version (8.3) of Tcl in the 2.9 ports tree, but I'm still using 2.6, so I can't comment much on it.

Has anybody else run into this problem, and how did you solve it?


LV I don't think it has to do with the shell you are using - instead, it has to do with the way the OS writers want their dynamic libraries written. On SPARC Solaris, the dynamic libraries are normally named /lib/ld.so.1, etc. with SOMETIMES someone creating a symlink of /lib/ld.so to whatever is the latest.

However, there is a problem doing that - if the dynamic library changes an API, and people are linked against the plain .so, their apps break.

In the above case, I'd say the extensions written to look for libtcl.so are wrong and should be fixed...

AK There is actually information in tclConfig.sh which tells the extension writer how library names are composed:

 # Indicates whether a version numbers should be used in -l switches
 # ("ok" means it's safe to use switches like -ltcl7.5;  "nodots" means
 # use switches like -ltcl75).  SunOS and FreeBSD require "nodots", for
 # example.
 TCL_LIB_VERSIONS_OK='ok'

GPS That makes sense however my tclConfig.sh has this:

  TCL_LIB_VERSIONS_OK='nodots'

I also checked the TCL_LIB_* -l flags, and they all use -ltcl83, not -ltcl8.3

Now that I'm pointing this out, I really think that extensions to Tcl shouldn't use Autoconf. In several of my software projects I've used a Tcl script for configuration. So the user can do something like tclsh8.3 configure to build a Makefile. I manually check with glob for libtcl8.3 or libtcl83 in the configure file, and I parse arguments such as --prefix, --disable-stubs, and --help. It really makes things much easier than using Autoconf.