about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-12-25 17:15:24 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-12-25 17:15:24 +0000
commit71d78ffb6efd2d6531d40c11c14f842553d6d290 (patch)
treebe683ffedc3b42443c9b7bab6e9532ea3bdd54ab /buildtools
parent67f1d42ebf38c32ff7932b6ab5b5e4f1a36cd1a3 (diff)
downloadnetpbm-mirror-71d78ffb6efd2d6531d40c11c14f842553d6d290.tar.gz
netpbm-mirror-71d78ffb6efd2d6531d40c11c14f842553d6d290.tar.xz
netpbm-mirror-71d78ffb6efd2d6531d40c11c14f842553d6d290.zip
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
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/configure.pl20
1 files changed, 15 insertions, 5 deletions
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;