summaryrefslogtreecommitdiff
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
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
-rwxr-xr-xBuild/source/configure192
-rwxr-xr-xBuild/source/libs/configure19
-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
-rw-r--r--Build/source/m4/kpse-libpng-flags.m423
-rwxr-xr-xBuild/source/texk/configure19
-rw-r--r--Build/source/texk/dvipdfmx/Makefile.in1
-rwxr-xr-xBuild/source/texk/dvipdfmx/configure123
-rw-r--r--Build/source/texk/dvipdfmx/data/Makefile.in1
-rw-r--r--Build/source/texk/dvipdfmx/src/Makefile.in1
-rw-r--r--Build/source/texk/dvipng/Makefile.in1
-rwxr-xr-xBuild/source/texk/dvipng/configure123
-rw-r--r--Build/source/texk/dvipng/doc/Makefile.in1
-rw-r--r--Build/source/texk/dvipng/help/Makefile.in1
-rwxr-xr-xBuild/source/texk/web2c/configure30
-rwxr-xr-xBuild/source/texk/xdvipdfmx/configure216
-rwxr-xr-xBuild/source/utils/configure19
18 files changed, 527 insertions, 368 deletions
diff --git a/Build/source/configure b/Build/source/configure
index 7c66e45cf28..e9c3cbef7be 100755
--- a/Build/source/configure
+++ b/Build/source/configure
@@ -620,8 +620,8 @@ LIBOBJS
cross_compiling_FALSE
cross_compiling_TRUE
ICU_CONFIG
-PKG_CONFIG
FT2_CONFIG
+PKG_CONFIG
DIST_TEXLIBS
TEXLIBS
subdirs
@@ -872,8 +872,6 @@ with_system_t1lib
with_t1lib_includes
with_t1lib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_zlib
with_zlib_includes
with_zlib_libdir
@@ -1720,11 +1718,8 @@ Optional Packages:
--with-t1lib-includes=DIR
t1lib headers installed in DIR
--with-t1lib-libdir=DIR t1lib 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-zlib use installed zlib headers and library
--with-zlib-includes=DIR
zlib headers installed in DIR
@@ -5549,16 +5544,6 @@ fi
if test "${with_system_libpng+set}" = set; then :
withval=$with_system_libpng;
fi
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
-fi
-
-# 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" = x; then
if test -f $srcdir/libs/libpng/configure; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`libpng' headers and library from TL tree" >&5
@@ -19569,40 +19554,16 @@ if test "x$with_zlib_libdir" != x && test "x$with_zlib_libdir" != xyes; then
ZLIB_LIBS="-L$with_zlib_libdir $ZLIB_LIBS"
fi
-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"
-fi
-
-if test "x$with_t1lib_includes" != x && test "x$with_t1lib_includes" != xyes; then
- T1LIB_INCLUDES="-I$with_t1lib_includes"
-fi
-T1LIB_LIBS="-lt1"
-if test "x$with_t1lib_libdir" != x && test "x$with_t1lib_libdir" != xyes; then
- T1LIB_LIBS="-L$with_t1lib_libdir $T1LIB_LIBS"
-fi
-
-if test "x$with_freetype_includes" != x && test "x$with_freetype_includes" != xyes; then
- FREETYPE_INCLUDES="-I$with_freetype_includes"
-fi
-FREETYPE_LIBS="-lttf"
-if test "x$with_freetype_libdir" != x && test "x$with_freetype_libdir" != xyes; then
- FREETYPE_LIBS="-L$with_freetype_libdir $FREETYPE_LIBS"
-fi
-
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}freetype-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}freetype-config; ac_word=$2
+ # 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_FT2_CONFIG+:} false; then :
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$FT2_CONFIG"; then
- ac_cv_prog_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test.
+ 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
@@ -19611,7 +19572,7 @@ do
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_FT2_CONFIG="${ac_tool_prefix}freetype-config"
+ 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
@@ -19621,10 +19582,10 @@ IFS=$as_save_IFS
fi
fi
-FT2_CONFIG=$ac_cv_prog_FT2_CONFIG
-if test -n "$FT2_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FT2_CONFIG" >&5
-$as_echo "$FT2_CONFIG" >&6; }
+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; }
@@ -19632,17 +19593,17 @@ fi
fi
-if test -z "$ac_cv_prog_FT2_CONFIG"; then
- ac_ct_FT2_CONFIG=$FT2_CONFIG
- # Extract the first word of "freetype-config", so it can be a program name with args.
-set dummy freetype-config; ac_word=$2
+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_FT2_CONFIG+:} false; then :
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_FT2_CONFIG"; then
- ac_cv_prog_ac_ct_FT2_CONFIG="$ac_ct_FT2_CONFIG" # Let the user override the test.
+ 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
@@ -19651,7 +19612,7 @@ do
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_FT2_CONFIG="freetype-config"
+ 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
@@ -19661,17 +19622,17 @@ IFS=$as_save_IFS
fi
fi
-ac_ct_FT2_CONFIG=$ac_cv_prog_ac_ct_FT2_CONFIG
-if test -n "$ac_ct_FT2_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FT2_CONFIG" >&5
-$as_echo "$ac_ct_FT2_CONFIG" >&6; }
+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_FT2_CONFIG" = x; then
- FT2_CONFIG="false"
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
@@ -19679,37 +19640,45 @@ yes:)
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- FT2_CONFIG=$ac_ct_FT2_CONFIG
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
fi
else
- FT2_CONFIG="$ac_cv_prog_FT2_CONFIG"
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
fi
-if $FT2_CONFIG --ftversion >/dev/null 2>&1; then
- FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
- FREETYPE2_LIBS=`$FT2_CONFIG --libs`
-elif test "x$need_freetype2:$with_system_freetype2" = xyes:yes; then
- as_fn_error $? "did not find freetype-config required for system freetype2 library" "$LINENO" 5
+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
-if test "x$with_gd_includes" != x && test "x$with_gd_includes" != xyes; then
- GD_INCLUDES="-I$with_gd_includes"
+if test "x$with_t1lib_includes" != x && test "x$with_t1lib_includes" != xyes; then
+ T1LIB_INCLUDES="-I$with_t1lib_includes"
fi
-GD_LIBS="-lgd"
-if test "x$with_gd_libdir" != x && test "x$with_gd_libdir" != xyes; then
- GD_LIBS="-L$with_gd_libdir $GD_LIBS"
+T1LIB_LIBS="-lt1"
+if test "x$with_t1lib_libdir" != x && test "x$with_t1lib_libdir" != xyes; then
+ T1LIB_LIBS="-L$with_t1lib_libdir $T1LIB_LIBS"
+fi
+
+if test "x$with_freetype_includes" != x && test "x$with_freetype_includes" != xyes; then
+ FREETYPE_INCLUDES="-I$with_freetype_includes"
+fi
+FREETYPE_LIBS="-lttf"
+if test "x$with_freetype_libdir" != x && test "x$with_freetype_libdir" != xyes; then
+ FREETYPE_LIBS="-L$with_freetype_libdir $FREETYPE_LIBS"
fi
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
+ # Extract the first word of "${ac_tool_prefix}freetype-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}freetype-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 :
+if ${ac_cv_prog_FT2_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.
+ if test -n "$FT2_CONFIG"; then
+ ac_cv_prog_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -19718,7 +19687,7 @@ do
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"
+ ac_cv_prog_FT2_CONFIG="${ac_tool_prefix}freetype-config"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -19728,10 +19697,10 @@ IFS=$as_save_IFS
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; }
+FT2_CONFIG=$ac_cv_prog_FT2_CONFIG
+if test -n "$FT2_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FT2_CONFIG" >&5
+$as_echo "$FT2_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
@@ -19739,17 +19708,17 @@ fi
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
+if test -z "$ac_cv_prog_FT2_CONFIG"; then
+ ac_ct_FT2_CONFIG=$FT2_CONFIG
+ # Extract the first word of "freetype-config", so it can be a program name with args.
+set dummy freetype-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 :
+if ${ac_cv_prog_ac_ct_FT2_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.
+ if test -n "$ac_ct_FT2_CONFIG"; then
+ ac_cv_prog_ac_ct_FT2_CONFIG="$ac_ct_FT2_CONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -19758,7 +19727,7 @@ do
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"
+ ac_cv_prog_ac_ct_FT2_CONFIG="freetype-config"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -19768,17 +19737,17 @@ IFS=$as_save_IFS
fi
fi
-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; }
+ac_ct_FT2_CONFIG=$ac_cv_prog_ac_ct_FT2_CONFIG
+if test -n "$ac_ct_FT2_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FT2_CONFIG" >&5
+$as_echo "$ac_ct_FT2_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"
+ if test "x$ac_ct_FT2_CONFIG" = x; then
+ FT2_CONFIG="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
@@ -19786,10 +19755,25 @@ yes:)
$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
+ FT2_CONFIG=$ac_ct_FT2_CONFIG
fi
else
- PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
+ FT2_CONFIG="$ac_cv_prog_FT2_CONFIG"
+fi
+
+if $FT2_CONFIG --ftversion >/dev/null 2>&1; then
+ FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
+ FREETYPE2_LIBS=`$FT2_CONFIG --libs`
+elif test "x$need_freetype2:$with_system_freetype2" = xyes:yes; then
+ as_fn_error $? "did not find freetype-config required for system freetype2 library" "$LINENO" 5
+fi
+
+if test "x$with_gd_includes" != x && test "x$with_gd_includes" != xyes; then
+ GD_INCLUDES="-I$with_gd_includes"
+fi
+GD_LIBS="-lgd"
+if test "x$with_gd_libdir" != x && test "x$with_gd_libdir" != xyes; then
+ GD_LIBS="-L$with_gd_libdir $GD_LIBS"
fi
if $PKG_CONFIG poppler --atleast-version=0.10; then
diff --git a/Build/source/libs/configure b/Build/source/libs/configure
index 756fce2e9b1..6c59c5001b1 100755
--- a/Build/source/libs/configure
+++ b/Build/source/libs/configure
@@ -783,8 +783,6 @@ with_system_t1lib
with_t1lib_includes
with_t1lib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_zlib
with_zlib_includes
with_zlib_libdir
@@ -1604,11 +1602,8 @@ Optional Packages:
--with-t1lib-includes=DIR
t1lib headers installed in DIR
--with-t1lib-libdir=DIR t1lib 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-zlib use installed zlib headers and library
--with-zlib-includes=DIR
zlib headers installed in DIR
@@ -4785,16 +4780,6 @@ fi
if test "${with_system_libpng+set}" = set; then :
withval=$with_system_libpng;
fi
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
-fi
-
-# 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" = x; then
if test -f $srcdir/../libs/libpng/configure; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`libpng' headers and library from TL tree" >&5
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@
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
diff --git a/Build/source/texk/configure b/Build/source/texk/configure
index 5ebb43725ce..3b11090d9bd 100755
--- a/Build/source/texk/configure
+++ b/Build/source/texk/configure
@@ -783,8 +783,6 @@ with_system_t1lib
with_t1lib_includes
with_t1lib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_zlib
with_zlib_includes
with_zlib_libdir
@@ -1625,11 +1623,8 @@ Optional Packages:
--with-t1lib-includes=DIR
t1lib headers installed in DIR
--with-t1lib-libdir=DIR t1lib 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-zlib use installed zlib headers and library
--with-zlib-includes=DIR
zlib headers installed in DIR
@@ -4806,16 +4801,6 @@ fi
if test "${with_system_libpng+set}" = set; then :
withval=$with_system_libpng;
fi
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
-fi
-
-# 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" = x; then
if test -f $srcdir/../libs/libpng/configure; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`libpng' headers and library from TL tree" >&5
diff --git a/Build/source/texk/dvipdfmx/Makefile.in b/Build/source/texk/dvipdfmx/Makefile.in
index f739e8fb676..f3ff9f8f833 100644
--- a/Build/source/texk/dvipdfmx/Makefile.in
+++ b/Build/source/texk/dvipdfmx/Makefile.in
@@ -185,6 +185,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/texk/dvipdfmx/configure b/Build/source/texk/dvipdfmx/configure
index 6beb0f5156f..536133af119 100755
--- a/Build/source/texk/dvipdfmx/configure
+++ b/Build/source/texk/dvipdfmx/configure
@@ -621,6 +621,7 @@ LIBPNG_RULE
LIBPNG_DEPEND
LIBPNG_LIBS
LIBPNG_INCLUDES
+PKG_CONFIG
ZLIB_RULE
ZLIB_DEPEND
ZLIB_LIBS
@@ -763,8 +764,6 @@ with_system_zlib
with_zlib_includes
with_zlib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_paper
'
ac_precious_vars='build_alias
@@ -1428,11 +1427,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-paper=DIR use paper include/library files from DIR
Some influential environment variables:
@@ -15042,29 +15038,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/texk/dvipdfmx/data/Makefile.in b/Build/source/texk/dvipdfmx/data/Makefile.in
index b4a201c5f10..bfb75185ab5 100644
--- a/Build/source/texk/dvipdfmx/data/Makefile.in
+++ b/Build/source/texk/dvipdfmx/data/Makefile.in
@@ -150,6 +150,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/texk/dvipdfmx/src/Makefile.in b/Build/source/texk/dvipdfmx/src/Makefile.in
index 64f8c07dce1..59e3fbc62a1 100644
--- a/Build/source/texk/dvipdfmx/src/Makefile.in
+++ b/Build/source/texk/dvipdfmx/src/Makefile.in
@@ -191,6 +191,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/texk/dvipng/Makefile.in b/Build/source/texk/dvipng/Makefile.in
index 7a02b5bf7db..e1053a24715 100644
--- a/Build/source/texk/dvipng/Makefile.in
+++ b/Build/source/texk/dvipng/Makefile.in
@@ -246,6 +246,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
diff --git a/Build/source/texk/dvipng/configure b/Build/source/texk/dvipng/configure
index 5c9821e518c..4f2357350f4 100755
--- a/Build/source/texk/dvipng/configure
+++ b/Build/source/texk/dvipng/configure
@@ -642,6 +642,7 @@ LIBPNG_RULE
LIBPNG_DEPEND
LIBPNG_LIBS
LIBPNG_INCLUDES
+PKG_CONFIG
ZLIB_RULE
ZLIB_DEPEND
ZLIB_LIBS
@@ -794,8 +795,6 @@ with_system_zlib
with_zlib_includes
with_zlib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_t1lib
with_t1lib_includes
with_t1lib_libdir
@@ -1468,11 +1467,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-t1lib use installed t1lib headers and library
--with-t1lib-includes=DIR
t1lib headers installed in DIR
@@ -15900,29 +15896,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/texk/dvipng/doc/Makefile.in b/Build/source/texk/dvipng/doc/Makefile.in
index 1594ba9498b..9d0947ba42b 100644
--- a/Build/source/texk/dvipng/doc/Makefile.in
+++ b/Build/source/texk/dvipng/doc/Makefile.in
@@ -177,6 +177,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
diff --git a/Build/source/texk/dvipng/help/Makefile.in b/Build/source/texk/dvipng/help/Makefile.in
index 377e4050dc4..33aec474c67 100644
--- a/Build/source/texk/dvipng/help/Makefile.in
+++ b/Build/source/texk/dvipng/help/Makefile.in
@@ -136,6 +136,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure
index 14fb7d5e0b7..7ddb26275b9 100755
--- a/Build/source/texk/web2c/configure
+++ b/Build/source/texk/web2c/configure
@@ -927,8 +927,6 @@ with_system_zlib
with_zlib_includes
with_zlib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_xpdf
with_system_zziplib
with_system_graphite
@@ -1660,11 +1658,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-xpdf use installed poppler headers and library instead of
xpdf (requires pkg-config)
--with-system-zziplib use installed zziplib headers and library (requires
@@ -21981,23 +21976,12 @@ fi
if test "${with_system_libpng+set}" = set; then :
withval=$with_system_libpng;
fi
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
-fi
-
-# 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"
+ 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/texk/xdvipdfmx/configure b/Build/source/texk/xdvipdfmx/configure
index 345bc0b8d7a..abf354e85f3 100755
--- a/Build/source/texk/xdvipdfmx/configure
+++ b/Build/source/texk/xdvipdfmx/configure
@@ -621,7 +621,6 @@ build_FALSE
build_TRUE
FONTCONFIG_LIBS
FONTCONFIG_INCLUDES
-PKG_CONFIG
FREETYPE2_RULE
FREETYPE2_DEPEND
FREETYPE2_LIBS
@@ -631,6 +630,7 @@ LIBPNG_RULE
LIBPNG_DEPEND
LIBPNG_LIBS
LIBPNG_INCLUDES
+PKG_CONFIG
ZLIB_RULE
ZLIB_DEPEND
ZLIB_LIBS
@@ -774,8 +774,6 @@ with_system_zlib
with_zlib_includes
with_zlib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_freetype2
with_paper
with_fontconfig_includes
@@ -1443,11 +1441,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)
--with-paper=DIR use paper include/library files from DIR
@@ -15083,29 +15078,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 \
@@ -15550,98 +15626,6 @@ $as_echo "#define HAVE_APPLICATIONSERVICES 1" >>confdefs.h
fi
-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
-
-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
-
-
-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
-
-fi
-fi
-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
-
# Check whether --with-fontconfig-includes was given.
if test "${with_fontconfig_includes+set}" = set; then :
diff --git a/Build/source/utils/configure b/Build/source/utils/configure
index c8cc0719bf4..ceae900cd6d 100755
--- a/Build/source/utils/configure
+++ b/Build/source/utils/configure
@@ -783,8 +783,6 @@ with_system_t1lib
with_t1lib_includes
with_t1lib_libdir
with_system_libpng
-with_libpng_includes
-with_libpng_libdir
with_system_zlib
with_zlib_includes
with_zlib_libdir
@@ -1601,11 +1599,8 @@ Optional Packages:
--with-t1lib-includes=DIR
t1lib headers installed in DIR
--with-t1lib-libdir=DIR t1lib 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-zlib use installed zlib headers and library
--with-zlib-includes=DIR
zlib headers installed in DIR
@@ -4782,16 +4777,6 @@ fi
if test "${with_system_libpng+set}" = set; then :
withval=$with_system_libpng;
fi
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
- withval=$with_libpng_includes;
-fi
-
-# 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" = x; then
if test -f $srcdir/../libs/libpng/configure; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`libpng' headers and library from TL tree" >&5