[mythtv] [mythtv-commits] Ticket #9442: configure libxml2 with pkg-config

Lawrence Rust lvr at softsystem.co.uk
Wed Jan 5 13:56:26 UTC 2011


On Tue, 2011-01-04 at 17:49 -0500, Michael T. Dean wrote:
> On 01/04/2011 04:14 PM, MythTV wrote:
> > #9442: configure libxml2 with pkg-config
> >
> > Comment (by Lawrence Rust<lvr@…>):
> >
> >   Just found a minor problem.  The output of pkg-config has a trailing space
> >   which is passed onto gcc as an include path and so gcc fails to find the
> >   xml headers.  Need to massage the output to remove the trailing space:
> >
> >   +        libxml2_path=`pkg-config --cflags-only-I libxml-2.0|sed -n
> >   "s/-I\([^ ]*\) *$/\1/p"`
> 
> Any chance you could send a patch to upstream libxml to remove 
> the--obviously, as you've found--incorrect end-of-line space at the end 
> of the "Cflags: -I${includedir}/libxml2 " line (as well as the 
> Libs.private line, while you're at it--just for prettiness) in 
> libxml-2.0.pc (no idea where that lives in Windows).

OK, I'll file a bug report on libxml2.

>   Having a hack in 
> our code to deal with a bug in the libxml2 make/install tools, where the 
> hack is only required for Windows, just sounds like a mess when it 
> should be possible to fix upstream.

The hack isn't that ugly.  The pipe to sed is necessary to remove the -I
prefix so stripping the trailing space at the same time is
insignificant.

> If having the script patch, or packaging a patched version and hosting 
> it on our Google Code prereqs download site, or making sure the script 
> gets the upstream version with the fix, or even having our script 
> actually fix the already-installed-by-the-broken-libxml2-installer 
> libxml-2.0.pc file isn't an option, then if nothing else, it will allow 
> us to remove the hack in the future.

IMHO having this patch, i.e. using pkg-config to get include paths, is a
'good thing' in that it makes configure more robust.  It's not a fudge
for Windows or cross compiling.  Most of the libraries that myth depends
on use pkg-config in their configure scripts.

NB the libxml2 bug affects all platforms that install libxml2-2.7.8.  If
you build mythtv and its dependent libraries on Linux from sources then
you hit this bug too.

I would recommend building everything from sources to all developers
because this way you can test specific library versions and enable build
options like extra debugging that you don't get when you use the system
default packages.  Linking and running with a full debug build of Qt and
mysql is highly desirable.

-- Lawrence




More information about the mythtv-dev mailing list