I think tcl is hosed on cygwin for our purposes, see below. If I am right
than I recommend just disabling it, i.e.,
./configure --prefix=/usr/local/plplot1 --disable-dyndrivers \
--disable-shared --disable-tcl >& configure.output
Once you have sorted out the configure errors you were getting with your
script, then I think you can use the above configure to move on to
other problems, if any.
On 2003-09-27 17:34+0530 Ullal Devappa Kini wrote:
> ./configure --prefix=/usr/local/plplot1 --disable-dyndrivers --disable-shared >& configure.output
> make >& mkplplot1
Here is the relevant section from that file that is documenting the error for
the plserver link:
/bin/sh ../../libtool --mode=link gcc -g -O2 -mieee-fp -o plserver.exe -rpath /usr/local/plplot1/lib -no-undefined plserver.o ../tcl/libplplottcltkd.la
gcc -g -O2 -mieee-fp -o plserver.exe plserver.o ../tcl/.libs/libplplottcltkd.a /usr/src/plplot-5.2.1.cvs.20030926/src/.libs/libplplotd.a -L/usr/local/lib /usr/src/plplot-5.2.1.cvs.20030926/lib/csa/.libs/libcsirocsa.a -ldl -lcd -lgd -lpng /usr/local/lib/libjpeg.a -lz -ltk -litcl -litk /usr/local/lib/libfreetype.a -L/usr/X11R6/lib -lX11 /usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/.libs/libtclmatrixd.a -ltcl -Wl,--rpath -Wl,/usr/local/plplot1/lib
../tcl/.libs/libplplottcltkd.a(tkMain.o)(.text+0x639): In function `pltkMain':
/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/tkMain.c:351: undefined reference to `_Tcl_CreateFileHandler'
../tcl/.libs/libplplottcltkd.a(tkMain.o)(.text+0x8b4): In function `StdinProc':
/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/tkMain.c:452: undefined reference to `_Tcl_CreateFileHandler'
../tcl/.libs/libplplottcltkd.a(tkMain.o)(.text+0x8f3):/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/tkMain.c:454: undefined reference to `_Tcl_CreateFileHandler'
../tcl/.libs/libplplottcltkd.a(tkMain.o)(.text+0x95b):/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/tkMain.c:424: undefined reference to `_Tcl_DeleteFileHandler'
../tcl/.libs/libplplottcltkd.a(plframe.o)(.text+0x370c): In function `Openlink':
/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/plframe.c:2355: undefined reference to `_Tcl_GetOpenFile'
../tcl/.libs/libplplottcltkd.a(plframe.o)(.text+0x376a):/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/plframe.c:2377: undefined reference to `_Tcl_CreateFileHandler'
../tcl/.libs/libplplottcltkd.a(plframe.o)(.text+0x38c4): In function `Closelink':
/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/plframe.c:2412: undefined reference to `_Tcl_DeleteFileHandler'
../tcl/.libs/libplplottcltkd.a(tcpip.o)(.text+0x47a): In function `pl_PacketReceive':
/usr/src/plplot-5.2.1.cvs.20030926/bindings/tcl/../tk/tcpip.c:535: undefined reference to `_Tcl_DeleteFileHandler'
/usr/src/plplot-5.2.1.cvs.20030926/src/.libs/libplplotd.a(tk.o)(.text+0x3021): In function `link_init':
/usr/src/plplot-5.2.1.cvs.20030926/drivers/tk.c:1465: undefined reference to `_Tcl_GetOpenFile'
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libitk.a(itk_archetype.o)(.text+0x4ed2): undefined reference to `_Tk_NameToWindow'
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libitk.a(itk_archetype.o)(.text+0x5035): undefined reference to `_Tk_GetOption'
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libitk.a(itk_archetype.o)(.text+0x55a4): undefined reference to `_Tk_GetOption'
collect2: ld returned 1 exit status
If you look at the initial libtool command, you will note it mentions
../tcl/libplplottcltkd.la. According to the autotools book section 10.4.1
"Inter-library Dependencies" if you specify a libtool-generated library like
this with suffix .la, then libtool is supposed to handle all the
inter-library dependencies properly, that is anything
../tcl/libplplottcltkd.la is linked with should appear in the real linking
line that follows the libtool invocation. If we look at that line we note
that libtool is doing its job properly on cygwin. For example, the library
reference to libplplottcltkd.a is followed (a lot later) by -ltcl. So that
means all tcl symbols that appear in libplplottcltkd.a, _should be_ resolved
However, they are not. For example, Tcl_CreateFileHandler and
Tcl_DeleteFileHandle are libtcl functions that are referred to in
bindings/tk/tkMain.c. The corresponding compiled object TkMain.o is part of
libplplottcltkd.a, but the -ltcl link option is not resolving those two
symbols for some reason. If you grep in tkMain.c for the string Tcl_ there
are lots of calls to libtcl functions that *are* resolved, but for some
reason those 2 symbols are not. When I look at the man pages for
Tcl_CreateFileHandler and Tcl_DeleteFileHandler on my system, they specify
Unix only, while the man page for Tcl_FindExecutable (one of the many
symbols from tclMain.c that your libtcl.a is resolving just fine) does not
say Unix only. So I am making the educated guess that cygwin has dropped
all the Unix-only part of tcl. I have no clue why the cygwin packager of
tcl/tk would do that since cygwin purports to be a unix-like platform, but I
think that is what has happened from the above evidence and the man pages I
have looked at.
Vince, do you agree with this educated guess?
Ullal, anticipating that Vince confirms what I have said, then I think
plplot tcl/tk is hosed on cygwin unless it is possible to go through all our
code and replace the Unix-only parts of the tcl API that we have used by the
subset of tcl/tk that works on all platforms. But my guess is we would lose
too much functionality that way for platforms that do support the Unix version
of tcl so we won't want to make those changes.
So subject to Vince's confirmation, I think the best thing to do is simply
disable tcl as I have suggested above and move on.
One other thing of interest from the link command above is that libitk.a
symbols are not being resolved. In this case, there may be a library
ordering problem on cygwin since -ltk comes before -litk in the list we have
made in the appropriate Makefile.am file. Maurice, for best cross-platform
linking qualities should we be ordering our libraries as -litk -ltk -litcl
-ltcl ? That's my best guess of which libraries resolve symbols from the
others, and if I am interpreting the old cf/sysloc.in correctly, that is the
order used there as well, but I would like some fresh confirmation before I
make the change. Note, this tcl/tk/itcl/itk library ordering problem is
moot on cygwin because of the other libtcl problem there, but it might make
a difference on other platforms.
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the PLplot scientific plotting software
package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the
Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project