Number: 93
Title: check for png misses zlib.h
Submitter: Bob Lied
Date: Tue Feb 26 13:01:49 2002
Subsys: Build/Installation
Version: 1.8.0
System: Sparc-Solaris-5.8
Severity: minor
Problem:
When configure checks for png.h, it doesn't have the
include path for zlib.h, which png.h includes. Therefore
it concludes that png.h isn't present, even though it is.
This occurs when the libraries/includes are in different
directories (the case for the ExpTools installation).
Fix:
In configure.in, add the Z_INCLUDES and Z_LIBS locations
to the test for png:
dnl -----------------------------------
dnl INCLUDES and LIBS for PNG
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
AC_ARG_WITH(pngincludedir,
[ --with-pngincludedir=DIR use PNG includes from DIR],
[PNG_INCLUDES="-I$withval"
+ CPPFLAGS="$CPPFLAGS -I$withval $Z_INCLUDES"])
AC_ARG_WITH(pnglibdir,
[ --with-pnglibdir=DIR use PNG libraries from DIR],
[PNG_LIBS="-L$withval"
+ LDFLAGS="$LDFLAGS -L$withval $Z_LIBS"])
AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png,main,
[PNG_LIBS="$PNG_LIBS -lpng"
AC_DEFINE_UNQUOTED(HAVE_LIBPNG,1,[Define if you have the PNG library])],
AC_MSG_WARN(Optional png library not available)),
AC_MSG_WARN(Optional png library not available - no png.h))
LDFLAGS=$save_LDFLAGS
CPPFLAGS=$save_CPPFLAGS
AC_SUBST(PNG_INCLUDES)
Owner: ellson
Status: Fixed (26 Feb 2002)