From 71d78ffb6efd2d6531d40c11c14f842553d6d290 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 25 Dec 2016 17:15:24 +0000 Subject: Set dummy names for PNGLIB, PNGHDR_DIR, X11LIB, X11HDR_DIR when pkgconfig files exist git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2853 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- buildtools/configure.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'buildtools') diff --git a/buildtools/configure.pl b/buildtools/configure.pl index 332113d5..93045b77 100755 --- a/buildtools/configure.pl +++ b/buildtools/configure.pl @@ -1164,14 +1164,18 @@ sub getPngLibrary($@) { my ($pnglib, $pnghdr_dir); - if (commandExists('libpng-config')) { - # We don't need to ask where Libpng is; there's a 'libpng-config' - # That tells exactly how to access it, and the make files will use - # that. + if (system('pkg-config libpng --exists') == 0) { + # We don't need to ask where Libpng is; the Pkg-config database knows + # and the make files will use that. # # To limit the confusion when someone tries to use our result in # spite of the fact that 'libpng-config' exists, we assign suggestive - # dummy values. + # dummy values (just for use in human debugging). + $pnglib = 'USE_PKG_CONFIG.a'; + $pnghdr_dir = 'USE_PKG_CONFIG.a'; + } elsif (commandExists('libpng-config')) { + # As with Pkg-config above, we can find out how to access the + # library by invoking a 'libpng-config' command. $pnglib = 'USE_LIBPNG-CONFIG.a'; $pnghdr_dir = 'USE_LIBPNG-CONFIG.a'; } else { @@ -1258,6 +1262,12 @@ sub getX11Library($@) { if (system('pkg-config x11 --exists') == 0) { # We don't need to ask where X libraries are; pkg-config knows and the # make files will use that. + # + # To limit the confusion when someone tries to use our result in + # spite of the fact that 'libpng-config' exists, we assign suggestive + # dummy values (just for use in human debugging). + $x11lib = 'USE_PKGCONFIG.a'; + $x11hdr_dir = 'USE_PKGCONFIG.a'; } else { { my $default; -- cgit 1.4.1