Re: [PATCH] Add pkg-config support

"Dan Nicholson" <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
On 7/10/07, Karl Waclawek <[email protected]> wrote:
> Enrico Weigelt wrote:
> > Aehm, what happend to my pkg-conf patch from Oct'06 ?
>
> I am not familiar with this tool, so I didn't respond.
> Maybe you attach your solution to the recent bug as well, and discuss
> with the others which is best.
> Let's see what you guys come up with.

I never found any old patch, so I just generated a new one. It's
pretty simple, but I'd be interested in seeing what you came up with.

Karl, just as an example of why people use pkg-config is that it has
very good integration with autoconf. Linking to libexpat while
checking the version would be simple:

PKG_CHECK_MODULES(EXPAT, expat >= 2.0.1, have_expat=true, have_expat=false)

This macro is shipped with pkg-config. The results are stored in
EXPAT_LIBS and EXPAT_CFLAGS. That would make linking with expat in
non-standard locations trivial.

Currently, you have to do something like this (from dbus):

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

That works, but it doesn't check versions or store any info about
directory prefixes in -I or -L. Anything like that is custom shell and
prone to errors.

--
Dan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.