bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xterm fails to link against local ncurses


From: Thomas Dickey
Subject: Re: xterm fails to link against local ncurses
Date: Thu, 25 Nov 2010 16:39:59 -0500 (EST)

On Thu, 25 Nov 2010, Christian Ebert wrote:

* Thomas Dickey on Thursday, November 25, 2010 at 15:57:12 -0500
On Thu, 25 Nov 2010, Christian Ebert wrote:
* Thomas Dickey on Thursday, November 25, 2010 at 12:43:42 -0500
What does the link command for xterm look like?  It's more likely on
that end, than in ncurses.

Sorry to be a noob; what exactly do you mean by "link command"?

something like

gcc -o xterm main.o charproc.o ... -L /usr/local/lib/ -lncurses

In xterm's makefile, it's done at the end of plink.sh

You mean what becomes of
xterm$x : $(OBJS1)
        $(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS1) $(LIBS) 
$(EXTRA_LOADFLAGS)

?

/bin/sh ./plink.sh gcc -g -O2 -I/usr/local/include -I/sw/include  
-L/usr/local/lib -L/sw/lib -o xterm button.o cachedGCs
..o charproc.o charsets.o cursor.o data.o doublechr.o fontutils.o input.o 
linedata.o main.o menu.o misc.o print.o ptydata
..o scrollback.o screen.o scrollbar.o tabs.o util.o xstrings.o xtermcap.o 
VTPrsTbl.o TekPrsTbl.o Tekproc.o charclass.o pr
ecompose.o wcwidth.o -L/sw/lib -L/usr/X11/lib -lXft -lXrender -lfontconfig 
-lfreetype -lX11 -L/usr/X11/lib -lXaw8 -lXmu
-lXt -lX11 -lSM -lICE -lXau -L/usr/X11/lib -lXt -lX11 -lSM -lICE -ltermcap

and at the end of "plink.sh", _it_ does an

eval $LINKIT

For debugging the script, I sometimes add an echo command, e.g.,

echo "$LINKIT"

The text above seems to have the -L's in the right order, but a potential
problem is in omitting some library just because the linker doesn't report
an error.

I see "-ltermcap" above.  Perhaps that's a symbolic link to the copy of
ncurses that you don't want.  xterm tries to find a termcap library unless
you give this option (see INSTALL):

  --disable-full-tgetent  disable check for termcap library

and that might be the problem (it's not using "-lncurses", so the linker
skips over your /usr/local/lib.  This chunk in aclocal.m4 hints at the
possible matches, depending on that option:

if test "$cf_full_tgetent" = yes ; then
    cf_TERMLIB="termcap termlib ncurses curses"
    cf_TERMTST="buffer[[0]] == 0"
else
    cf_TERMLIB="termlib ncurses curses"
    cf_TERMTST="0"
fi

(if you also have a "termlib" in the "wrong" place, then that's an additional problem)


plink.sh tries to remove as many -l's as it can, to make the binaries
less sensitive to changes in the libraries.  (It also has some special
case to handle the PCRE library).

On some systems, it's hard to mix static and shared libraries (but I
seem to recall you're building shared libraries).

xterm has an additional complication, using plink.sh to filter out
unnecessary libraries.  I made that feature optional in another
configure script (though I'm thinking the problem is more along the
lines of not giving the right type of -L or rpath option).

Could it be that because freetype is under /sw it gets the upper
hand?

It might be - referring to ncurses' shlib script - something in the
list of directories given in the DYLD_LIBRARY_PATH environment
variable.

Normally you do not set this environment variable on MacOS X.

c
--
\black\trash movie         _SAME  TIME  SAME  PLACE_
--->> http://www.blacktrash.org/underdogma/stsp.php
\black\trash audio   _ANOTHER  TIME  ANOTHER  PLACE_
--->> http://www.blacktrash.org/underdogma/atap.html

_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]