[Expat-discuss] Version-specific Expat presence checks for Autoconf

Sebastian Pipping webmaster at hartwork.org
Fri Sep 14 21:11:17 CEST 2007


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




More information about the Expat-discuss mailing list