summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd
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/libs/gd
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/libs/gd')
-rw-r--r--Build/source/libs/gd/Makefile.in1
-rwxr-xr-xBuild/source/libs/gd/configure123
-rw-r--r--Build/source/libs/gd/include/Makefile.in1
3 files changed, 102 insertions, 23 deletions
diff --git a/Build/source/libs/gd/Makefile.in b/Build/source/libs/gd/Makefile.in
index f95bc471576..def67031430 100644
--- a/Build/source/libs/gd/Makefile.in
+++ b/Build/source/libs/gd/Makefile.in
@@ -212,6 +212,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
diff --git a/Build/source/libs/gd/configure b/Build/source/libs/gd/configure
index ce34d63f715..23b3745a23f 100755
--- a/Build/source/libs/gd/configure
+++ b/Build/source/libs/gd/configure
@@ -628,6 +628,7 @@ LIBPNG_RULE
LIBPNG_DEPEND
LIBPNG_LIBS
LIBPNG_INCLUDES
+PKG_CONFIG
ZLIB_RULE
ZLIB_DEPEND
ZLIB_LIBS
@@ -758,8 +759,6 @@ with_system_zlib
with_zlib_includes
with_zlib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_freetype2
'
ac_precious_vars='build_alias
@@ -1414,11 +1413,8 @@ Optional Packages:
--with-zlib-includes=DIR
zlib headers installed in DIR
--with-zlib-libdir=DIR zlib library installed in DIR
- --with-system-libpng use installed libpng headers and library
- --with-libpng-includes=DIR
- libpng headers installed in DIR
- --with-libpng-libdir=DIR
- libpng library installed in DIR
+ --with-system-libpng use installed libpng headers and library (requires
+ pkg-config)
--with-system-freetype2 use installed freetype2 headers and library
(requires freetype-config)
@@ -11768,29 +11764,110 @@ ${top_builddir}/../../libs/zlib/include/zconf.h:
cd ${top_builddir}/../../libs/zlib && $(MAKE) $(AM_MAKEFLAGS) rebuild'
fi
-## _KPSE_LIB_FLAGS: Setup libpng (-lpng) flags
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKG_CONFIG"; then
+ ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# Check whether --with-system-libpng was given.
-if test "${with_system_libpng+set}" = set; then :
- withval=$with_system_libpng;
fi
+fi
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+ ac_ct_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_PKG_CONFIG"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-# Check whether --with-libpng-libdir was given.
-if test "${with_libpng_libdir+set}" = set; then :
- withval=$with_libpng_libdir;
fi
-if test "x$with_system_libpng" = xyes; then
- if test "x$with_libpng_includes" != x && test "x$with_libpng_includes" != xyes; then
- LIBPNG_INCLUDES="-I$with_libpng_includes"
fi
-LIBPNG_LIBS="-lpng"
-if test "x$with_libpng_libdir" != x && test "x$with_libpng_libdir" != xyes; then
- LIBPNG_LIBS="-L$with_libpng_libdir $LIBPNG_LIBS"
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
+fi
+
+## _KPSE_LIB_FLAGS: Setup libpng (-lpng) flags
+
+# Check whether --with-system-libpng was given.
+if test "${with_system_libpng+set}" = set; then :
+ withval=$with_system_libpng;
+fi
+if test "x$with_system_libpng" = xyes; then
+ 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
+ as_fn_error $? "did not find libpng" "$LINENO" 5
fi
else
LIBPNG_INCLUDES=`echo '-IBLD/libs/libpng/include' | sed \
diff --git a/Build/source/libs/gd/include/Makefile.in b/Build/source/libs/gd/include/Makefile.in
index 06b6cc59682..f9d3aada112 100644
--- a/Build/source/libs/gd/include/Makefile.in
+++ b/Build/source/libs/gd/include/Makefile.in
@@ -119,6 +119,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@