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

wrapper Makefile - libtool problem



Friedrich Lobenstock made a few nice wrapper Makefiles around 
automake/autoconf projects like Dropbear and Busybox.

I've tried to do the same for some of my own automake/autoconf projects, cause 
it would save me all the hassle of creating an extra set of manually made 
makefiles when I want to cross-compile for the Etrax.

Now everything works like expected, I can link against standard libararies 
like libpthread and libm, without a problem.
Problems arise when I try to link with any non-standard library, installed by 
myself (into the target/lib dir).

This is what libtool tries to do, in the final link step:

../libtool --mode=link --tag=CXX g++-cris -isystem 
/home/pieter/devboard_82/target/cris-axis-linux-gnu/include -mlinux  
-Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith 
-Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE 
-Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new   
-L/home/pieter/devboard_82/target/cris-axis-linux-gnu/lib -o paycon   
editobject.o menuconfigoption.o menuconfigblock.o configblock.o 
configoption.o products.o service.o source.o casherclient.o wrappers.o 
socketclient.o threadobject.o casher.o main.o -ltc -lpthread

So the -L option is there, pointing to the correct lib dir, libtc.so is the 
library I need to link with, it is in 
/home/pieter/devboard_82/target/cris-axis-linux-gnu/lib/
Now this is what libtool does:

g++-cris -isystem /home/pieter/devboard_82/target/cris-axis-linux-gnu/include 
-mlinux -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W 
-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi 
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 
-fno-exceptions -fno-check-new -o paycon editobject.o menuconfigoption.o 
menuconfigblock.o configblock.o configoption.o products.o service.o source.o 
casherclient.o wrappers.o socketclient.o threadobject.o casher.o main.o  
-L/home/pieter/devboard_82/target/cris-axis-linux-gnu/lib /usr/lib/libtc.so 
-lpthread
/usr/lib/libtc.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

So libtool replaced -ltc with /usr/lib/libtc.so, which is an absolute path to 
the libtc lib on my build system.
When I call g++-cris directly, with all the arguments above, but 
/usr/lib/libtc.so replaced by -ltc, it works, and I get a working binary.

Does anyone know what makes libtool want to replace -ltc, and not -lpthread, 
(and also not -lm like I discovered with another project)?

Has anyone succeeded in linking against a nonstandard library, using 
automake/autoconf/libtool?

Anything else I could try?

Best regards,

Pieter Grimmerink