Version-specific Expat presence checks for Autoconf

Sebastian Pipping <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Hello!


I was wondering if there is some place collecting
version-specific Expat presence checks for Autoconf,
if there is need in making a list or something.
(I have not looked into pkgconfig yet in case that
can do it as well or even better.)


## 1.95.8 or later
EXPAT_MISSING="Please install libexpat 1.95.8 or later.
   On Ubuntu enter 'sudo apt-get install libexpat-dev'."
AC_CHECK_LIB(expat, XML_ResumeParser,, AC_MSG_ERROR(${EXPAT_MISSING}))
AC_CHECK_HEADER(expat.h,, AC_MSG_ERROR(${EXPAT_MISSING}))


## 1.2 or later
EXPAT_MISSING="Please install libexpat 1.2 or later.
   On Ubuntu enter 'sudo apt-get install libexpat-dev'."
AC_CHECK_LIB(expat, XML_SetDoctypeDeclHandler,, AC_MSG_ERROR($EXPAT_MISSING))
AC_CHECK_HEADER(xmlparse.h,[
  ## xmlparse.h found
  CPPFLAGS="${CPPFLAGS} -DEXPAT_H=\<xmlparse.h\>"
], [
  AC_CHECK_HEADER(expat.h,[
    ## expat.h found
    CPPFLAGS="${CPPFLAGS} -DEXPAT_H=\<expat.h\>"
  ], [
    ## both headers missing
    AC_MSG_ERROR($EXPAT_MISSING)
  ])
])


Sebastian
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.