summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-03-27 22:53:22 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-03-27 22:53:22 +0000
commit4a40933b1b58af0c0bc02f5c663df848130b4b94 (patch)
treeb82916fa3b6e35d270e76b5513af62e7e853df4b /configure.in
parentec35e8112aa2f8255e4ba1ccf7d77ad275b91a95 (diff)
downloadgtk+-4a40933b1b58af0c0bc02f5c663df848130b4b94.tar.gz
Try to find libpng via pkg-config first, since libpng-1.2.2 will come with
* configure.in: Try to find libpng via pkg-config first, since libpng-1.2.2 will come with a .pc file.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in43
1 files changed, 26 insertions, 17 deletions
diff --git a/configure.in b/configure.in
index 6af38c1c4a..db2c09f26c 100644
--- a/configure.in
+++ b/configure.in
@@ -697,25 +697,34 @@ dnl Test for libjpeg
dnl Test for libpng
if test x$with_libpng != xno && test -z "$LIBPNG"; then
- AC_CHECK_LIB(png, png_read_info,
- [AC_CHECK_HEADER(png.h,
- png_ok=yes,
- png_ok=no)],
- AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
- if test "$png_ok" = yes; then
- AC_MSG_CHECKING([for png_structp in png.h])
- AC_TRY_COMPILE([#include <png.h>],
- [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
- png_ok=yes,
- png_ok=no)
- AC_MSG_RESULT($png_ok)
+ AC_MSG_CHECKING(for libpng12)
+ if $PKG_CONFIG --exists libpng12 ; then
+ AC_MSG_RESULT(yes)
+ PNG='png'
+ PNG_DEP_CFLAGS_PACKAGES=libpng12
+ LIBPNG=`$PKG_CONFIG --libs libpng12`
+ else
+ AC_MSG_RESULT(no)
+ AC_CHECK_LIB(png, png_read_info,
+ [AC_CHECK_HEADER(png.h,
+ png_ok=yes,
+ png_ok=no)],
+ AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
if test "$png_ok" = yes; then
- PNG='png'; LIBPNG='-lpng -lz'
+ AC_MSG_CHECKING([for png_structp in png.h])
+ AC_TRY_COMPILE([#include <png.h>],
+ [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
+ png_ok=yes,
+ png_ok=no)
+ AC_MSG_RESULT($png_ok)
+ if test "$png_ok" = yes; then
+ PNG='png'; LIBPNG='-lpng -lz'
+ else
+ AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
+ fi
else
- AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
+ AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
fi
- else
- AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
fi
fi
@@ -846,7 +855,7 @@ GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
GDK_PIXBUF_EXTRA_CFLAGS=
GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
-GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
+GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $PNG_DEP_CFLAGS_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
AC_SUBST(GDK_PIXBUF_PACKAGES)
AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)