Subject: Re: libxml2 vs. XML2_CONFIG
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Johnny Lam <jlam@c35.jgrind.org>
List: tech-pkg
Date: 08/17/2001 21:50:31
On Sat, Aug 18, 2001 at 06:12:03AM +0200, Hubert Feyrer wrote:
> On Fri, 17 Aug 2001, Johnny Lam wrote:
> > > it seems that configure scripts look for the xml-config program in
> > > XML_CONFIG, not XML2_CONFIG. Can that be adjusted?
> > 
> > Yes, the buildlink.mk file should define what configure scripts want.
> > I don't think any packages will want both libxml and libxml2, so there
> > is little worry about the two buildlink.mk files conflicting with each
> > other.  To be extra sure that the two buildlink.mk files can't be
> > included together, just change the guard definition to prevent multiple
> > inclusion to match in both files.
> 
> Yeah, and that's exactly the problem I'm running into after the propsed
> change: the pkg in question ("paranormal" xmms plugin) wants libxml2, and
> some other depends (xmms or one of it's depends) wants libxml. now we'd
> have XML_CONFIG set once to xml-config and once to xml2-config on the same
> command line, which doesn't compute. I got around to patch the configure
> script to s/XML_CONFIG/XML2_CONFIG/ for now.

Ergh...I'll try to take a look and see what can be done buildlink-wise.

> Something different: shouldn't the libxml2/buildlink file make sure that
> the right -Is are added to CPPFLAGS to find the libxml2 headers:
> 
> CPPFLAGS+=      -I${BUILDLINK_DIR}/include/libxml2
> CPPFLAGS+=      -I${BUILDLINK_DIR}/include/libxml2/libxml
> 
> Again, that's only speaking for the above pkg, I don't claim to have an
> overview of other pkgs using xml(2).

Well, assuming that no package would want _both_ libxml and libxml2, we can
cause the libxml2/buildlink.mk file to link:

       ${LOCALBASE}/include/libxml2/*.h --> ${BUILDLINK_DIR}/include/*.h
${LOCALBASE}/include/libxml2/libxml/*.h --> ${BUILDLINK_DIR}/include/libxml/*.h

using something like:

	BUILDLINK_TRANSFORM.libxml2=  -e "s|/include/libxml2/|/include/|g"

in libxml2/buildlink.mk.  However, if packages _do_ want both libxml and
libxml2, then your proposal seems quite sensible.  Feel free to make either
change.  The number of packages in pkgsrc that use libxml2 is very low, so
the impact of either change is minimal and can quite comprehensively be tested.

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>