Debugging libtool


While debugging Apache this week, I wanted to get verbose output from libtool. After digging around on the web, I found that setting LTFLAGS to “–debug” will cause libtool to display numerous useful pieces of information:

$ export LTFLAGS="--debug"

$ apxs -c mod_dtrace.c

Link command: /tmp/apache/build/libtool --debug --mode=link gcc -o
mod_dtrace.la -rpath /tmp/apache/modules -module -avoid-version
mod_dtrace.lo
/tmp/apache/build/libtool --debug --mode=compile gcc -prefer-pic
-DAP_HAVE_DESIGNATED_INITIALIZER -DSOLARIS2=10
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -g -O2 -I/tmp/apache/include
-I/tmp/apache/include -I/tmp/apache/include -c -o mod_dtrace.lo
mod_dtrace.c && touch mod_dtrace.slo
libtool: enabling shell trace mode
+ preserve_args=' --debug'
+ test 16 -gt 0
+ arg=--mode=compile
+ shift
+ case $arg in
++ echo X--mode=compile
++ /bin/sed -e '1s/^X//' -e 's/[-_a-zA-Z0-9]*=//'
+ optarg=compile
[ ... ]

If you are trying to figure out how things are built with libtool, this will definitely helpful!

This article was posted by Matty on 2005-11-20 18:34:00 -0400 -0400