Detect libpng

This commit is contained in:
Kornel Lesiński
2014-08-14 22:09:12 +01:00
parent d11fc3c7c8
commit ad67be3b36
2 changed files with 12 additions and 1 deletions

View File

@@ -108,13 +108,19 @@ endif
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \ cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
rdppm.c rdswitch.c rdtarga.c rdjpeg.c rdpng.c rdppm.c rdswitch.c rdtarga.c rdjpeg.c
cjpeg_LDADD = libjpeg.la cjpeg_LDADD = libjpeg.la
cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \ cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
-DTARGA_SUPPORTED -DTARGA_SUPPORTED
if HAVE_LIBPNG
cjpeg_CFLAGS += -DPNG_SUPPORTED $(libpng_CFLAGS)
cjpeg_LDADD += $(libpng_LIBS)
cjpeg_SOURCES += rdpng.c
endif
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \ djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
wrbmp.c wrgif.c wrppm.c wrtarga.c wrbmp.c wrgif.c wrppm.c wrtarga.c

View File

@@ -95,6 +95,11 @@ fi
# Checks for libraries. # Checks for libraries.
AC_CHECK_LIB([m],[pow]) AC_CHECK_LIB([m],[pow])
PKG_CHECK_MODULES([libpng], [libpng], [HAVE_LIBPNG=1], [
PKG_CHECK_MODULES([libpng], [libpng12], [HAVE_LIBPNG=1], [HAVE_LIBPNG=0])
])
AM_CONDITIONAL([HAVE_LIBPNG], [test "$HAVE_LIBPNG" -eq 1])
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) AC_CHECK_HEADERS([stddef.h stdlib.h string.h])