[Pixman] [PATCH] Only link with -lpng when libpng is actually available
Søren Sandmann
sandmann at cs.au.dk
Sun Sep 11 13:09:07 PDT 2011
From: Søren Sandmann Pedersen <ssp at redhat.com>
Fixes build on systems that don't have libpng
---
configure.ac | 1 +
test/Makefile.am | 5 ++++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 21613e1..fdb2521 100644
--- a/configure.ac
+++ b/configure.ac
@@ -811,6 +811,7 @@ if test x$have_libpng = xyes; then
fi
AC_SUBST(HAVE_LIBPNG)
+AM_CONDITIONAL(HAVE_LIBPNG, test $have_libpng = yes)
AC_OUTPUT([pixman-1.pc
pixman-1-uninstalled.pc
diff --git a/test/Makefile.am b/test/Makefile.am
index 52ef8ad..7bd826e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,9 @@
AM_CFLAGS = @OPENMP_CFLAGS@
AM_LDFLAGS = @OPENMP_CFLAGS@ @TESTPROGS_EXTRA_LDFLAGS@
-LDADD = $(top_builddir)/pixman/libpixman-1.la -lm -lpng
+LDADD = $(top_builddir)/pixman/libpixman-1.la -lm
+if HAVE_LIBPNG
+LDADD += -lpng
+endif
INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman
TESTPROGRAMS = \
--
1.6.0.6
More information about the Pixman
mailing list