about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-06-26 21:54:57 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-06-26 21:54:57 +0000
commite91046e523112cff2cf737bfb0841eb0040e4246 (patch)
treefea60927c3c927005c4c5aa4ff81ae0d75a6db25 /buildtools
parent807b2912512e4a5b69b3583a67f0eb1ee0f9ece7 (diff)
downloadnetpbm-mirror-e91046e523112cff2cf737bfb0841eb0040e4246.tar.gz
netpbm-mirror-e91046e523112cff2cf737bfb0841eb0040e4246.tar.xz
netpbm-mirror-e91046e523112cff2cf737bfb0841eb0040e4246.zip
Use pkg-config for X libraries
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1498 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/configure.pl72
1 files changed, 39 insertions, 33 deletions
diff --git a/buildtools/configure.pl b/buildtools/configure.pl
index e532e9af..1b65bec8 100755
--- a/buildtools/configure.pl
+++ b/buildtools/configure.pl
@@ -1167,43 +1167,49 @@ sub getX11Library($@) {
     my ($platform, @suggestedHdrDir) = @_;
 
     my $x11lib;
-    {
-        my $default;
-
-        if (-d('/usr/link/X11')) {
-            $default = '/usr/link/X11/libX11' . libSuffix($platform);
-        } elsif (-d('/usr/X11R6/lib')) {
-            $default = '/usr/X11R6/lib/libX11' . libSuffix($platform);
-        } else {
-            $default = "libX11" . libSuffix($platform);
-        }
-        print("What is your X11 (X client) library?\n");
-        
-        my $response = prompt("library filename or 'none'", $default);
-        
-        if ($response ne "none") {
-            $x11lib = $response;
-        }
-    }
     my $x11hdr_dir;
-    if (defined($x11lib)) {
-        my $default;
 
-        $default = "default";
+    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.
+    } else {
+        {
+            my $default;
 
-        print("Where are the interface headers for it?\n");
-        
-        my $response = prompt("X11 header directory", $default);
-        
-        if ($response ne "default") {
-            $x11hdr_dir = $response;
+            if (-d('/usr/link/X11')) {
+                $default = '/usr/link/X11/libX11' . libSuffix($platform);
+            } elsif (-d('/usr/X11R6/lib')) {
+                $default = '/usr/X11R6/lib/libX11' . libSuffix($platform);
+            } else {
+                $default = "libX11" . libSuffix($platform);
+            }
+            print("What is your X11 (X client) library?\n");
+            
+            my $response = prompt("library filename or 'none'", $default);
+            
+            if ($response ne "none") {
+                $x11lib = $response;
+            }
         }
-        if (defined($x11hdr_dir)) {
-            if (!-d($x11hdr_dir)) {
-                warnUser("No directory named '$x11hdr_dir' exists.");
-            } elsif (!-d("$x11hdr_dir/X11")) {
-                warnUser("Directory '$x11hdr_dir' does not contain " .
-                         "the requisite 'X11' subdirectory");
+        if (defined($x11lib)) {
+            my $default;
+
+            $default = "default";
+
+            print("Where are the interface headers for it?\n");
+            
+            my $response = prompt("X11 header directory", $default);
+            
+            if ($response ne "default") {
+                $x11hdr_dir = $response;
+            }
+            if (defined($x11hdr_dir)) {
+                if (!-d($x11hdr_dir)) {
+                    warnUser("No directory named '$x11hdr_dir' exists.");
+                } elsif (!-d("$x11hdr_dir/X11")) {
+                    warnUser("Directory '$x11hdr_dir' does not contain " .
+                             "the requisite 'X11' subdirectory");
+                }
             }
         }
     }