Bugzilla – Bug 210
Cannot configure 4.1-fixes on Ubuntu
Last modified: 2012-12-07 19:02:36 MST
You need to log in before you can comment on or make changes to this bug.
When you try and configure 4.1-fixes on Ubuntu 12.04 it fails, saying: checking for xmlGetProp in -l/usr/lib/x86_64-linux-gnu -lxml2... no configure: error: TORQUE needs libxml2-devel in order to build But the error in the logs is: configure:14048: checking for xmlGetProp in -l/usr/lib/x86_64-linux-gnu -lxml2 configure:14073: gcc -o conftest -g -O2 -D_LARGEFILE64_SOURCE conftest.c -l/usr/lib/x86_64-linux-gnu -lxml2 -lcrypto -lssl -lpthread -lrt >&5 /usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu Not sure where that came from.. The libxml2-dev package is installed: samuel@eris:/tmp/4.1-fixes$ apt-cache policy libxml2-dev libxml2-dev: Installed: 2.7.8.dfsg-5.1ubuntu4.1 Candidate: 2.7.8.dfsg-5.1ubuntu4.1
Patch to fix this: Index: configure.ac =================================================================== --- configure.ac (revision 6611) +++ configure.ac (working copy) @@ -702,10 +702,10 @@ dnl dnl we need libxml2 dnl -xmlLib=`xml2-config --libs` +xmlLib=`xml2-config --libs | sed 's/-L[^[:space:]]* //g;s/-l//'` dnl skip the first two chars because its -l<libname> -AC_CHECK_LIB(${xmlLib:2}, xmlGetProp, +AC_CHECK_LIB(${xmlLib}, xmlGetProp, [], [AC_MSG_ERROR([TORQUE needs libxml2-devel in order to build]) ]) The problem is that xml2-config --libs may output link paths in addition to the library link directive. The above fix eliminates all linker paths as well as removing the "-l" from the library name.
I applied the patch to a pristine copy of 4.1-fixes and reran autogen.sh but it still fails. I checked and the configure script doesn't quite match what your patch says, so my guess is that some meta-characters are getting expanded unintentionally during generation: samuel@eris:/tmp/4.1-fixes$ grep xml2-config configure xmlLib=`xml2-config --libs | sed 's/-L^[:space:]* //g;s/-l//'` So we've lost the [ and ] around the ^[:space:]. Running that command by hand shows: samuel@eris:/tmp/4.1-fixes$ xml2-config --libs | sed 's/-L^[:space:]* //g;s/-l//' -L/usr/lib/x86_64inux-gnu -lxml2 Escaping the lost [ and ] doesn't help, I go from: +xmlLib=`xml2-config --libs | sed 's/-L\[^[:space:]\]* //g;s/-l//'` to: xmlLib=`xml2-config --libs | sed 's/-L\^[:space:]\* //g;s/-l//'`
Oops, sorry. Fixed patch: Index: configure.ac =================================================================== --- configure.ac (revision 6611) +++ configure.ac (working copy) @@ -702,10 +702,10 @@ dnl dnl we need libxml2 dnl -xmlLib=`xml2-config --libs` +xmlLib=`xml2-config --libs | sed 's/-L@<:@^@<:@:space:@:>@@:>@* //g;s/-l//'` dnl skip the first two chars because its -l<libname> -AC_CHECK_LIB(${xmlLib:2}, xmlGetProp, +AC_CHECK_LIB(${xmlLib}, xmlGetProp, [], [AC_MSG_ERROR([TORQUE needs libxml2-devel in order to build]) ]) Darn autoSPLATisms. >:I
Thanks Michael, that works! Oh well, at least it's not cmake or scons.. ;-)
Looks like bdaw applied my patch from comment #3 to trunk r7195 (or master commit 3684842 if you prefer), but the same bug exists in 4.1-dev. Might want to apply it there too since that's where this was originally reported.