[Expat-bugs] Little bug fix in expat-1.95.6

Christian Ferrari christian.ferrari at primeur.com
Fri May 9 18:28:30 EDT 2003


The supplied "conftools/expat.m4" sets

EXPAT_CFLAGS="-I$with_expat/include"
CFLAGS="$CFLAGS $EXPAT_CFLAGS"

before
AC_CHECK_HEADERS(expat.h, , expat_found=no)

on some systems (for example "i686-pc-linux-gnu", "gcc 2.96") it may be 
broken (the bug exploits during "checking expat.h presence" where 
preprocessor is used and CFLAGS {-I/mypath/expat} are not passed to 
command).

The attached version addresses this little bug.

Regards
Christian

-- 
______________________________________

Christian Ferrari
c/o PRIMEUR ITALIA
Via E. Mattei, 1/106 A
30020 Marcon (VE) - ITALY

Tel.:    +39 041 5950998
Fax:     +39 041 5951024
Mobile:  +39 348 8960572
E-mail:  Christian.Ferrari at primeur.com
Web:     http://www.primeur.com/
-------------- next part --------------
dnl Check if --with-expat[=PREFIX] is specified and
dnl Expat >= 1.95.0 is installed in the system.
dnl If yes, substitute EXPAT_CPPFLAGS, EXPAT_LIBS with regard to
dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX
dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined.
dnl If --with-expat has not been specified, set with_expat to 'no'.
dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly.
dnl This is necessary to adapt a whole lot of packages that have expat
dnl bundled as a static library.
AC_DEFUN(AM_WITH_EXPAT,
[ AC_ARG_WITH(expat,
	      [  --with-expat=PREFIX     Use system Expat library],
	      , with_expat=no)

  AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)

  EXPAT_CPPFLAGS=
  EXPAT_LIBS=
  if test $with_expat != no; then
	if test $with_expat != yes; then
		EXPAT_CPPFLAGS="-I$with_expat/include"
		EXPAT_LIBS="-L$with_expat/lib"
	fi
	AC_CHECK_LIB(expat, XML_ParserCreate,
		     [ EXPAT_LIBS="$EXPAT_LIBS -lexpat"
		       expat_found=yes ],
		     [ expat_found=no ],
		     "$EXPAT_LIBS")
	if test $expat_found = no; then
		AC_MSG_ERROR([Could not find the Expat library])
	fi
	expat_save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="$CPPFLAGS $EXPAT_CPPFLAGS"
	AC_CHECK_HEADERS(expat.h, , expat_found=no)
	if test $expat_found = no; then
		AC_MSG_ERROR([Could not find expat.h])
	fi
	CPPFLAGS="$expat_save_CPPFLAGS"
  fi

  AC_SUBST(EXPAT_CPPFLAGS)
  AC_SUBST(EXPAT_LIBS)
])


More information about the Expat-bugs mailing list