[1.5] Add zlib check when checking libpng

This commit is contained in:
Vincent Torri 2012-01-28 10:46:42 +00:00
parent 6a03e3a438
commit 02b906f6ad
2 changed files with 23 additions and 8 deletions

View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed ! : changed
+ : added + : added
January 28, 2012
+ [vincent] Add zlib check when checking libpng
January 25, 2012 January 25, 2012
* [vincent] fix libopenjpip link on Windows * [vincent] fix libopenjpip link on Windows
* [vincent] follow latest JPIP changes in the autotools side (pthread dependency, conditional compilation of JPIP server and client) * [vincent] follow latest JPIP changes in the autotools side (pthread dependency, conditional compilation of JPIP server and client)

View File

@ -197,16 +197,16 @@ AC_MSG_RESULT([${want_png}])
if test "x${want_png}" = "xyes" ; then if test "x${want_png}" = "xyes" ; then
PKG_CHECK_MODULES([PNG], [libpng15], PKG_CHECK_MODULES([PNG], [libpng15 zlib],
[have_libpng="yes"], [have_libpng="yes"],
[ [
PKG_CHECK_MODULES([PNG], [libpng14], PKG_CHECK_MODULES([PNG], [libpng14 zlib],
[have_libpng="yes"], [have_libpng="yes"],
[ [
PKG_CHECK_MODULES([PNG], [libpng12], PKG_CHECK_MODULES([PNG], [libpng12 zlib],
[have_libpng="yes"], [have_libpng="yes"],
[ [
PKG_CHECK_MODULES([PNG], [libpng], PKG_CHECK_MODULES([PNG], [libpng zlib],
[have_libpng="yes"], [have_libpng="yes"],
[have_libpng="no"]) [have_libpng="no"])
]) ])
@ -214,11 +214,23 @@ if test "x${want_png}" = "xyes" ; then
]) ])
if ! test "x${have_libpng}" = "xyes" ; then if ! test "x${have_libpng}" = "xyes" ; then
OPJ_CHECK_LIB([png.h],
[png], OPJ_CHECK_LIB([zlib.h],
[png_create_write_struct], [z],
[have_libpng="yes"], [zlibVersion],
[
OPJ_CHECK_LIB([png.h],
[png],
[png_access_version_number],
[
have_libpng="yes"
PNG_CFLAGS="${PNG_CFLAGS} ${Z_CFLAGS}"
PNG_LIBS="${PNG_LIBS} ${Z_LIBS}"
],
[have_libpng="no"])
],
[have_libpng="no"]) [have_libpng="no"])
fi fi
if test "x${have_libpng}" = "xno" ; then if test "x${have_libpng}" = "xno" ; then