Aaron.Sloman.XX@cs.bham.ac.uk (Aaron Sloman See text for reply address) writes:
> However, in $popsrc/termcap.p I found this:
>
> exload termcap
> #_IF DEF OSF1 or DEFV IRIX >= 6.0 or DEF AIX
> ['-lcurses']
> #_ELSEIF DEFV IRIX >= 5.0
> ;;; names in the curses library clash with names defined in the
> ;;; graphics library libgl; since we don't use those names, linking
> ;;; statically will pull in just the names we want and minimise the
> ;;; problem
> ['-B static -lcurses -B dynamic']
> #_ELSE
> ['-ltermcap']
> #_ENDIF
> lconstant exload_dummy; ;;; anything will do
> endexload;
My guess (and it is just a guess) as to what is really going on here
is this. On modern linux distributions a library is set up using
following set of files: (using ncurses as an example)
/usr/lib/libncurses.a This is the version used for static
linking and irrelevant to the discussion.
/usr/lib/libncurses.so.5.0 This is the dynamically linkable object
code itself.
/usr/lib/libncurses.so.5 This is a symlink to the above file and
this is what programs are linked to (allowing the minor version number
to change without having to relink the program.)
/usr/lib/libncurses.so This is a symlink to the latest version
of the library, in this case to /usr/lib/libncurses.so.5. It exists so
that programs are always compiled against the latest version.
(Just to confuse the issue even further, in the case of ncurses the
library actually lives in /lib but that again it is not relevant.)
Now, here comes the guessing. Since the termcap library has been
obsoleted by curses or ncurses long ago, it is no longer maintained or
distributed with Linux distros. Instead, /usr/lib/libtermcap.so is a
symlink to /usr/lib/libncurses.so (at least this is the case with
debian, but I guess it applies to Suse too.) However, there is no
/usr/lib/libtermcap.so.2 since termcap itself doesn't exist. I guess
the symlinks are there in case someone tries to compile a program on
the system itself. In that case ld would follow the symlink and link
the program against libncurses. But whoever thought this up didn't
allow for users installing precompiled binaries linked against
libtermcap.so.2. The reason we have this problem is that the system
that was used to compile poplog was different to the above (I am
guessing it was redhat) and had a real termcap library and that is
what the linker is expecting to find but doesn't.
The solution that I think should work is to add the following clause
to the $popsrc/termcap.p file:
#_ELSEIF DEF LINUX
['-lncurses']
That should fix things so that they work on all modern linux
distributions. Of course things will break on systems without ncurses
but there are few of those around and there is nothing that can be
done about it.
NOTE: most of the above is based on observations and I don't know
anything about how ld really works. :)
-- Peter
|