summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-01-11 17:34:27 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-01-11 17:34:27 +0000
commitcccf458bc431d5acf57051e42292f42ea20ebb7e (patch)
treee029956c061897544f69d9baad97338ce7849d23 /Build/source/m4
parentb66972550a98f8260ff627d68e9b120ab3e960d1 (diff)
build system: use pkg-config to detect installed libpng
git-svn-id: svn://tug.org/texlive/trunk@21029 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/kpse-libpng-flags.m423
1 files changed, 18 insertions, 5 deletions
diff --git a/Build/source/m4/kpse-libpng-flags.m4 b/Build/source/m4/kpse-libpng-flags.m4
index a9283884b0f..433100c0c98 100644
--- a/Build/source/m4/kpse-libpng-flags.m4
+++ b/Build/source/m4/kpse-libpng-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009, 2011 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -9,8 +9,7 @@
# KPSE_LIBPNG_FLAGS
# -----------------
-# Provide the configure options '--with-system-libpng' (if in the TL tree),
-# '--with-libpng-includes', and '--with-libpng-libdir'.
+# Provide the configure options '--with-system-libpng' (if in the TL tree).
#
# Set the make variables LIBPNG_INCLUDES and LIBPNG_LIBS to the CPPFLAGS and
# LIBS required for the `-lpng' library in libs/libpng/ of the TL tree.
@@ -23,8 +22,22 @@ _KPSE_LIB_FLAGS([libpng], [png], [],
# KPSE_LIBPNG_OPTIONS([WITH-SYSTEM])
# ----------------------------------
-AC_DEFUN([KPSE_LIBPNG_OPTIONS], [_KPSE_LIB_OPTIONS([libpng], [$1])])
+AC_DEFUN([KPSE_LIBPNG_OPTIONS],
+[m4_ifval([$1],
+ [AC_ARG_WITH([system-libpng],
+ AS_HELP_STRING([--with-system-libpng],
+ [use installed libpng headers and library
+ (requires pkg-config)]))])[]dnl
+]) # KPSE_LIBPNG_OPTIONS
# KPSE_LIBPNG_SYSTEM_FLAGS
# ------------------------
-AC_DEFUN([KPSE_LIBPNG_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([libpng], [png])])
+AC_DEFUN([KPSE_LIBPNG_SYSTEM_FLAGS],
+[AC_REQUIRE([_KPSE_CHECK_PKG_CONFIG])[]dnl
+if $PKG_CONFIG libpng; then
+ LIBPNG_INCLUDES=`$PKG_CONFIG libpng --cflags`
+ LIBPNG_LIBS=`$PKG_CONFIG libpng --libs`
+elif test "x$need_libpng:$with_system_libpng" = xyes:yes; then
+ AC_MSG_ERROR([did not find libpng])
+fi
+]) # KPSE_LIBPNG_SYSTEM_FLAGS