0

I am trying to compile, libgphoto2 with libxml2 support followint the guidelines here. Everything is ok until I try to run ./configure:

./configure --prefix=/tmp/gphoto2/local --with-libxml2=yes

That appears to me as a correct syntax, however I got an output:

LIBXML2 to support Olympus ..: no

I have checked this in 2 different systems (LinuxMint 11 x64 and Ubuntu 13.04), and I have found the same problem.

  • Can anyone give me a clue or solution?
  • Is there any problem with the syntax?
  • Is there a common problem with the configure --with-PACKAGE[=yes] option?
  • Is there a common problem with LIBXML2 used in compilation?

Thanks for any help!

Jack Kelly
  • 18,264
  • 2
  • 56
  • 81
viridis
  • 177
  • 10

3 Answers3

3

This problem as appears on Debian Wheezy (Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux) and the latest libgphoto2 release 2.5.2

libxml2-dev package is installed :-
Package: libxml2-dev
State: installed
Automatically installed: no
Multi-Arch: same
Version: 2.8.0+dfsg1-7+nmu1

Not totally familiar with configure scripts but configure.ac file has line:-
AC_CHECK_HEADER(libxml/parser.h,[
which I assume looks for libmxl/parser.h

the libxml2-dev package delivers the file
/usr/include/libxml2/libxml/parser.h

It looks like libgphoto2 is designed for libxml2 library in a different place
Tried various solutions but only the following worked

as root I sym linked libxml2 to the place libgphoto2 was looking

ln -s /usr/include/libxml2/libxml /usr/include/libxml

After compiling libgphoto2 and gphoto2 this enabled gphoto2 to talk to my Olympus E-510

Bug raised on gphoto sourceforge site (https://sourceforge.net/p/gphoto/bugs/953/) and a patch fix has been provided

Andrew
  • 8,198
  • 2
  • 15
  • 35
2

Just found another way. Thanks for your help.

After digging in the config.log file created after the ./configure tool, I found the libxml2 error (that I wrongly supposed to stop the configure script):

conftest.c:75:27: fatal error: libxml/parser.h: No such file or directory

But I knew it was there but can't find it! So I checked it and found it under

/usr/lib

And found somewhere else that libxml2 package comes with a script (xml2-config) to give library linking information and more so:

$ xml2-config --cflags
-I/usr/include/libxml2

And the just needed to add the output to the CFLAGS environment variable when configuring:

$ CFLAGS="-I/usr/include/libxml2" ./configure --prefix=/tmp/gphoto2/local --with-libxml2=yes

And everything else was just ok!

viridis
  • 177
  • 10
1

Usually, a --with-some-package=yes option checks for the existence of header files for some-package on your system. If it doesn't find the required header files, then it still outputs "no" to the terminal. Have you installed your distribution's libxml2-devel (or similarly named) package?

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • Yes, I already have everything ok, I mean the libxml2-dev package, etc. See below for the solution I found! – viridis May 12 '13 at 07:04