Configuring for using libexpat fails

I’m new to the OBS and would appreciate some help in patching the build files for this package:
https://build.opensuse.org/package/show?package=sflphone&project=home%3Arenekrell

During building I get on all platforms and repositories the following error:


...
installing libexpat1-2.0.1-88.15
...
installing libexpat-devel-2.0.1-88.15
...
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: You need the eXpat xml parser
http://expat.sourceforge.net/
error: Bad exit status from /var/tmp/rpm-tmp.25610 (%build)

As you can see the expat libraries are installed, and the symbol XML_ParserCreate_MM can be found in /usr/lib/libexpat.so on my local system using OpenSUSE 11.2 Factory (latest updates):

rkrell@rkrell:~> strings /usr/lib/libexpat.so |grep XML_ParserCreate_MM
XML_ParserCreate_MM

Furthermore, if I put the files from the build system to my local system (usr/src/packages/*) and launch

rpmbuild -ba sflphone.spec

this error doesn’t occur at all.

The expat check itself comes from this file from the original sources tarball:
sflphone-0.9.6/sflphone-common/configure.ac:

AC_CHECK_LIB([expat], XML_ParserCreate_MM,
		[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
		have_expat=false)

if ! $have_expat; then
AC_MSG_ERROR([You need the eXpat xml parser]
		[http://expat.sourceforge.net/])
fi

What’s the difference between my local 11.2 and the OBS here?
What can I do?

Hi
On your test machine do you have libxml2-devel installed? If so, remove
it and see if it builds. If it doesn’t then add to your build requires.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 21:07, 2 users, load average: 2.36, 2.21, 2.26
GPU GeForce 8600 GTS Silent - Driver Version: 190.18

I haven’t been on the local system I mentioned, but explicitely adding libxml2-devel to BuildRequires in OBS didn’t help, unfortunately.

In this kind of cases what you should do is build locally (osc build) and check the config.log in the build chroot (/var/tmp/build).

In this case the problem is the lack of a C++ compiler to compile the test program to see if expat provides XML_ParserCreate_MM. A BuildRequires: gcc-c++ will fix the problem.

Yes, this one fixed it. Thank you. :good: