Re: [PATCH] Add pkg-config support
Karl Waclawek <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
Dan Nicholson wrote: > 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. Any idea if this patch will work on all the environments where Expat builds now? Karl