diff -r -u poppler-0.12.3-old/goo/Makefile.am poppler-0.12.3-new/goo/Makefile.am --- poppler-0.12.3-old/goo/Makefile.am 2009-09-09 21:22:31 +0000 +++ poppler-0.12.3-new/goo/Makefile.am 2010-02-04 13:48:34 +0000 @@ -20,7 +20,7 @@ endif INCLUDES = \ - -I$(top_srcdir) + -I$(top_srcdir) $(LIBPNG_INCS) libgoo_la_SOURCES = \ gfile.cc \ diff -r -u poppler-0.12.3-old/m4/libpng.m4 poppler-0.12.3-new/m4/libpng.m4 --- poppler-0.12.3-old/m4/libpng.m4 2009-09-09 21:22:31 +0000 +++ poppler-0.12.3-new/m4/libpng.m4 2010-02-04 13:56:58 +0000 @@ -1,99 +1,63 @@ -dnl Based on Xpdf configure.in and evince configure.ac -dnl Based on kde acinclude.m4.in, LGPL Licensed - -AC_DEFUN([AC_FIND_FILE], +AC_DEFUN([POPPLER_FIND_PNG], [ -$3=NO -for i in $2; -do - for j in $1; - do - echo "configure: __oline__: $i/$j" >&AC_FD_CC - if test -r "$i/$j"; then - echo "taking that" >&AC_FD_CC - $3=$i - break 2 - fi - done -done -]) -AC_DEFUN([FIND_PNG_HELPER], -[ -AC_MSG_CHECKING([for libpng]) -AC_CACHE_VAL(ac_cv_lib_png, -[ -ac_save_LIBS="$LIBS" -LIBS="$all_libraries $USER_LDFLAGS -lpng -lm" -ac_save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" -AC_TRY_LINK( -[ -#ifdef __cplusplus -extern "C" { -#endif -void png_access_version_number(); -#ifdef __cplusplus -} -#endif -], -[png_access_version_number();], - eval "ac_cv_lib_png=-lpng", - eval "ac_cv_lib_png=no") -LIBS="$ac_save_LIBS" -CFLAGS="$ac_save_CFLAGS" -]) +dnl Check if libpng-config exists in the path -if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then - enable_libpng=yes - LIBPNG_LIBS="$ac_cv_lib_png" - AC_MSG_RESULT($ac_cv_lib_png) -else - AC_MSG_RESULT(no) - $1 +AC_PATH_PROG(LIBPNG_CONFIG,libpng-config) + +if test -n "$LIBPNG_CONFIG"; then + LIBPNG_INCS=`$LIBPNG_CONFIG --cflags` + LIBPNG_LIBS=`$LIBPNG_CONFIG --libs` + LIBPNG_LDIR="-L`$LIBPNG_CONFIG --libdir`" fi -]) -AC_DEFUN([POPPLER_FIND_PNG], -[ -dnl first look for libraries -FIND_PNG_HELPER( - FIND_PNG_HELPER(normal, [], - [ - LIBPNG_LIBS= - ] - ) -) - -dnl then search the headers (can't use simply AC_TRY_xxx, as png.h -dnl requires system dependent includes loaded before it) -png_incdirs="`eval echo $includedir` /usr/include /usr/local/include " -AC_FIND_FILE(png.h, $png_incdirs, png_incdir) -test "x$png_incdir" = xNO && png_incdir= - -dnl if headers _and_ libraries are missing, this is no error, and we -dnl continue with a warning (the user will get no png support) -dnl if only one is missing, it means a configuration error, but we still -dnl only warn -if test -n "$png_incdir" && test -n "$LIBPNG_LIBS" ; then - AC_DEFINE_UNQUOTED(ENABLE_LIBPNG, 1, [Define if you have libpng]) +dnl chance to override previous results + +AC_ARG_WITH(png-includes, + [ --with-png-includes=DIR use PNG includes from DIR], + [LIBPNG_INCS="-I$withval"]) + +AC_ARG_WITH(png-libs, + [ --with-png-libs=LIB use PNG library name], + [LIBPNG_LIBS="-l$withval"]) + +AC_ARG_WITH(png-libdir, + [ --with-png-libdir=DIR use PNG libraries from DIR], + [LIBPNG_LIBS="-L$withval"]) + +AC_SUBST(LIBPNG_INCS) +AC_SUBST(LIBPNG_LIBS) +AC_SUBST(LIBPNG_LDIR) + +__libpng_save_CFLAGS="$CFLAGS" +__libpng_save_LDFLAGS="$LDFLAGS" +__libpng_save_LIBS="$LIBS" + +CFLAGS="$CFLAGS $LIBPNG_INCS" +LDFLAGS="$LDFLAGS $LIBPNG_LDIR" +LIBS="$LIBS $LIBPNG_LIBS" + +AC_MSG_CHECKING([if libpng works]) + +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [png_access_version_number();]) + ], + [enable_libpng=yes], + [enable_libpng=no]) + +AC_MSG_RESULT($enable_libpng) + +if test "$enable_libpng" = "no" ; then + AC_MSG_WARN([libpng not found. disable PNG support.]) else - if test -n "$png_incdir" || test -n "$LIBPNG_LIBS" ; then - AC_MSG_WARN([ -There is an installation error in png support. You seem to have only one of -either the headers _or_ the libraries installed. You may need to either provide -correct --with-extra-... options, or the development package of libpng. You -can get a source package of libpng from http://www.libpng.org/pub/png/libpng.html -Disabling PNG support. -]) - else - AC_MSG_WARN([libpng not found. disable PNG support.]) - fi - png_incdir= - enable_libpng=no - LIBPNG_LIBS= + AC_DEFINE_UNQUOTED(ENABLE_LIBPNG, 1, [Define if you have libpng]) fi -AC_SUBST(LIBPNG_LIBS) +CFLAGS="$__libpng_save_CFLAGS" +LDFLAGS="$__libpng_save_LDFLAGS" +LIBS="$__libpng_save_LIBS" + ]) diff -r -u poppler-0.12.3-old/poppler/Makefile.am poppler-0.12.3-new/poppler/Makefile.am --- poppler-0.12.3-old/poppler/Makefile.am 2009-09-09 21:22:31 +0000 +++ poppler-0.12.3-new/poppler/Makefile.am 2010-02-04 13:50:18 +0000 @@ -151,7 +151,7 @@ $(PTHREAD_LIBS) \ $(win32_libs) -libpoppler_la_LDFLAGS = -version-info 5:0:0 @create_shared_lib@ +libpoppler_la_LDFLAGS = -version-info 5:0:0 @create_shared_lib@ $(LIBPNG_LDIR) if ENABLE_XPDF_HEADERS