From: glennrp Date: Wed, 24 Aug 2011 14:01:52 +0000 (+0000) Subject: Use a loop to detect libpng15, libpng14, libpng12, and libpng in that order. X-Git-Tag: 7.0.1-0~7155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84cc1bd9045652af68169a15c6ca4709c5038100;p=imagemagick Use a loop to detect libpng15, libpng14, libpng12, and libpng in that order. --- diff --git a/configure.ac b/configure.ac index 61e6e8438..2fe9c1e19 100755 --- a/configure.ac +++ b/configure.ac @@ -2398,6 +2398,7 @@ AC_SUBST(OPENEXR_LIBS) dnl =========================================================================== +if test "$have_zlib" == 'yes'; then # # Check for PNG delegate library. # @@ -2414,13 +2415,15 @@ fi have_png='no' PNG_LIBS='' -if test "$with_png" != 'no'; then +if test "$with_png" != 'no' +then AC_MSG_RESULT([-------------------------------------------------------------]) AC_MSG_CHECKING(for PNG support ) AC_MSG_RESULT() failed=0 passed=0 - AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`, failed=`expr $failed + 1`,) + AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`, + failed=`expr $failed + 1`,) if test $passed -gt 0; then for var in 5 4 2 '' ; do @@ -2466,7 +2469,8 @@ return 0; fi fi - if test $passed -gt 0 -a $failed -le 0; then + if test $passed -gt 0 -a $failed -le 0 + then if test "1${var}" = '15' ; then AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`, failed=`expr $failed + 1`,) @@ -2491,14 +2495,14 @@ return 0; AC_MSG_CHECKING(if ${pnglib} package is complete) if test $passed -gt 0 ; then if test $failed -gt 0 ; then - AC_MSG_RESULT(no -- some components failed test) - have_png='no (failed tests)' + AC_MSG_RESULT(no -- some components failed test) + have_png='no (failed tests)' else - PNG_LIBS="-l${pnglib}" - LIBS="$PNG_LIBS $LIBS" - AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library) - AC_MSG_RESULT(yes) - have_png='yes' + PNG_LIBS="-l${pnglib}" + LIBS="$PNG_LIBS $LIBS" + AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library) + AC_MSG_RESULT(yes) + have_png='yes' fi fi fi @@ -2510,6 +2514,9 @@ fi AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes') AC_SUBST(PNG_LIBS) +else + AC_MSG_RESULT(PNG requires zlib support) +fi dnl =========================================================================== @@ -2687,57 +2694,32 @@ fi have_wmf='no' WMF_LIBS='' -WMF_LIBS_DEPS='' -OLIBS="$LIBS" if test "$with_wmf" != 'no'; then - AC_MSG_RESULT([-------------------------------------------------------------]) - AC_MSG_CHECKING([for WMF]) - AC_MSG_RESULT([]) - have_libwmf='no' - have_libwmflite='no' - have_libwmf_ipa_h='no' - AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H]) - if test "$have_libwmf_ipa_h" = 'yes'; then - - AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,) - if test "$have_libwmflite" = 'yes'; then - AC_DEFINE(HasWMFlite,1,Define if you have wmflite library) - WMF_LIBS='-lwmflite' - LIBS="$WMF_LIBS $LIBS" - have_wmf='yes' + AC_MSG_RESULT([-------------------------------------------------------------]) + AC_MSG_CHECKING([for WMF]) + AC_MSG_RESULT([]) + failed=0 + passed=0 + AC_CHECK_HEADER(libwmf/eps.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) + AC_CHECK_LIB(wmf,wmf_eps_function,passed=`expr $passed + 1`,failed=`expr $failed + 1`,"-lwmflite") + AC_MSG_CHECKING([if WMF package is complete]) + if test $passed -gt 0; then + if test $failed -gt 0; then + AC_MSG_RESULT([no -- some components failed test]) + have_wmf='no (failed tests)' + else + WMF_LIBS='-lwmf -lwmflite' + LIBS="$WMF_LIBS $LIBS" + AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library) + AC_MSG_RESULT([yes]) + have_wmf='yes' + fi else - WMF_LIBS_DEPS='' - WMF_CONFIG_LIBS=`libwmf-config --libs` - for lib in xml2 expat freetype jpeg png z - do - testlib="-l${lib}" - echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib" - done - AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS) - if test "$have_libwmf" = 'yes'; then - AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library) - WMF_LIBS='-lwmf' - LIBS="$WMF_LIBS $LIBS" - have_wmf='yes' - else - AC_MSG_RESULT(no -- some components failed test) - have_wmf='no (failed tests)' - have_wmflite='no (failed tests)' - LIBS="$OLIBS" - WMF_LIBS='' - fi + AC_MSG_RESULT([no]) fi - fi -fi -AC_MSG_CHECKING(if WMF package is complete) -if test "$have_wmf" = 'yes'; then - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) fi -AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes') +AM_CONDITIONAL(WMF_DELEGATE,test "$have_wmf" = 'yes') AC_SUBST(WMF_LIBS) -AC_SUBST(WMF_LIBS_DEPS) dnl ===========================================================================