[PATCH 1/1] configure: check for libpng

Eugeni Dodonov eugeni.dodonov at intel.com
Tue Feb 7 07:14:50 PST 2012


Add an explicit check for libpng to prevent:

/usr/bin/ld: libtoytoolkit.a(cairo-util.o): undefined reference to symbol
'png_get_valid@@PNG15_0'
/usr/bin/ld: note: 'png_get_valid@@PNG15_0' is defined in DSO
/usr/lib/libpng15.so.15 so try adding it to the linker command line
/usr/lib/libpng15.so.15: could not read symbols: Invalid operation

Or similar errors.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
---
 configure.ac |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7bc9881..d943cbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,13 @@ if test x$enable_clients == xyes; then
         [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
         [AC_MSG_WARN([Cairo-EGL not found - clients will use cairo image])])
 
+  AC_CHECK_LIB([png], [png_create_read_struct], have_libpng=yes)
+  if test x$have_libpng == xyes; then
+    CLIENT_LIBS="$CLIENT_LIBS -lpng"
+  else
+    AC_ERROR([libpng not found])
+  fi
+
   AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
   if test x$have_jpeglib == xyes; then
     CLIENT_LIBS="$CLIENT_LIBS -ljpeg"
-- 
1.7.9



More information about the wayland-devel mailing list