Add the expat libtool file to the LT_LDFLAGS variable to avoid placing a libtool file path onto LDFLAGS (pkg-config --libs apr-util-1). apr-util uses apr_rules.mk (from apr) which places the LT_LDFLAGS on the libtool link command (confirm it by looking at apr's configure.in). Current behavior is broken because it will place a .la file path on the LDFLAGS for non-libtool compiles, as APRUTIL_EXPORT_LIBS is also used when in the apr-util.pc.in file. e.g.: /Users/davi/svn/apr-util $ pkg-config --libs apr-util-1 /Users/davi/svn/apr-util/xml/expat/lib/libexpat.la -L/tmp/apu/lib -L/opt/local/lib -laprutil-1 -lsqlite3 -liconv -lapr-1 -lpthread
Created attachment 19271 [details] Add the expat libtool file to the LT_LDFLAGS variable
The -lexpat should get added to the set of exported libs though, otherwise everything will break if you do an all-static build. So it should really be adding "-L$libdir -lexpat" to _EXPORT_LIBS for the bundled-expat case, I guess.
Sounds right Joe. Care to rework this patch Davi?