Index: trunk/psconfig/pschecklibs
===================================================================
--- trunk/psconfig/pschecklibs	(revision 17598)
+++ trunk/psconfig/pschecklibs	(revision 18707)
@@ -5,6 +5,6 @@
 # default system library locations
 @binpath = ( );
-@libpath = ( "/lib", "/usr/lib", "/usr/X11R6/lib", "/usr/local/lib" );
-@incpath = ( "/usr/include", "/usr/local/include", "/usr/X11R6/include" );
+@libpath = ( "/usr/local/lib", "/usr/lib", "/usr/X11R6/lib", "/lib" );
+@incpath = ( "/usr/local/include", "/usr/include", "/usr/X11R6/include" );
 
 $version = "";
@@ -14,14 +14,14 @@
 for (; @ARGV > 0; ) {
     if ($ARGV[0] eq "-version") {
-	$version = $ARGV[1];
+        $version = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-build") {
-	$build = 1;
+        $build = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-force") {
-	if (@ARGV < 2) { die "-force must be coupled to a library name\n"; }
-	$force = $ARGV[1];
+        if (@ARGV < 2) { die "-force must be coupled to a library name\n"; }
+        $force = $ARGV[1];
         shift; shift; next;
     }
@@ -37,5 +37,5 @@
 if ( @ARGV > 1) { &usage(); }
 
-if ( @ARGV == 0) { 
+if ( @ARGV == 0) {
     @list = <$tagsets/*.libs>;
     $file = $list[-1];
@@ -110,5 +110,5 @@
 # add the system paths specified for each architecture
 &checkarch ();
-print "setting architecture to: $arch\n"; 
+print "setting architecture to: $arch\n";
 print "searching for libraries in: @libpath\n";
 print "searching for programs in: @binpath\n";
@@ -131,34 +131,34 @@
 
     if ($force ne "") {
-	if ($force eq $name or (lc($force) eq "all" and lc($tarball) ne "none")) {
-	    &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);
-#	    exit 0;
-	}
-	next;
+        if ($force eq $name or (lc($force) eq "all" and lc($tarball) ne "none")) {
+            &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);
+#           exit 0;
+        }
+        next;
     }
 
     ## check for the C library
-    if ($type eq "lib") { 
-	$found = &checklib ($name, $altnames, $altpaths);
-    } 
-    if ($type eq "bin") { 
-	$found = &checkbin ($name, $altnames, $altpaths);
-    }	
-    if ($type eq "inc") { 
-	$found = &checkinc ($name, $altnames, $altpaths);
-    }	
+    if ($type eq "lib") {
+        $found = &checklib ($name, $altnames, $altpaths);
+    }
+    if ($type eq "bin") {
+        $found = &checkbin ($name, $altnames, $altpaths);
+    }
+    if ($type eq "inc") {
+        $found = &checkinc ($name, $altnames, $altpaths);
+    }
 
     if ($found) {
-	print "pass $name ($found)\n";
-	next;
+        print "pass $name ($found)\n";
+        next;
     } else {
-	print "fail $name\n";
-	push @faillibs, "$name";
-    }	
+        print "fail $name\n";
+        push @faillibs, "$name";
+    }
 
     if (! $build) { next; }
     if ($type eq "inc") {
-	print "ERROR: missing header file from library which is supposedly installed\n";
-	# Will attempt to install library.
+        print "ERROR: missing header file from library which is supposedly installed\n";
+        # Will attempt to install library.
     }
     &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);
@@ -170,5 +170,5 @@
     print "The following C libraries are missing from your system\n";
     foreach $name (@faillibs) {
-	print "  $name\n";
+        print "  $name\n";
     }
     print "\n";
@@ -184,13 +184,13 @@
 
     if ($tarball eq "NONE") {
-	print "No tarball available for $name.  You'll have to build it yourself.\n";
-	exit 1;
+        print "No tarball available for $name.  You'll have to build it yourself.\n";
+        exit 1;
     }
 
     if ($name eq "libz") {
-	# zlib doesn't like the full list of arguments to configure
-	$psconfigure = "./configure --prefix=$prefix";
+        # zlib doesn't like the full list of arguments to configure
+        $psconfigure = "./configure --prefix=$prefix";
     } else {
-	$psconfigure = `csh psconfig.csh --psconfigure $version`; chomp $psconfigure;
+        $psconfigure = `csh psconfig.csh --psconfigure $version`; chomp $psconfigure;
     }
 
@@ -204,5 +204,5 @@
     print "extract $name from $tarball\n";
     vsystem ("tar xvzf $tarball");
-    
+
     print "tardir: $tardir\n";
 
@@ -211,25 +211,25 @@
 
     # build the library using psconfigure, make, make install
-    if ($configure_opts eq "NONE") { 
-	vsystem ("$psconfigure");
+    if ($configure_opts eq "NONE") {
+        vsystem ("$psconfigure");
     } else {
-	$configure_opts = join (' ', split (',', $configure_opts));
-	vsystem ("$psconfigure $configure_opts");
+        $configure_opts = join (' ', split (',', $configure_opts));
+        vsystem ("$psconfigure $configure_opts");
     }
     if ($?) { &failure($name, "failure in configure"); }
-    
-    if ($make_opts eq "NONE") { 
-	vsystem ("make");
+
+    if ($make_opts eq "NONE") {
+        vsystem ("make");
     } else {
-	$make_opts = join (' ', split (',', $make_opts));
-	vsystem ("make $make_opts");
+        $make_opts = join (' ', split (',', $make_opts));
+        vsystem ("make $make_opts");
     }
     if ($?) { &failure($name, "failure in make"); }
 
     if ($install_opts eq "NONE") {
-	vsystem ("make install");
+        vsystem ("make install");
     } else {
-	$install_opts = join (' ', split (',', $install_opts));
-	vsystem ("make install $install_opts");
+        $install_opts = join (' ', split (',', $install_opts));
+        vsystem ("make install $install_opts");
     }
     if ($?) { &failure($name, "failure in make install"); }
@@ -243,60 +243,60 @@
     my $altnames = $_[1];
     my $altpaths = $_[2];
-    
+
     @subdirs = ".";
     if ($altpaths ne "NONE") {
-	@altpaths = split (',', $altpaths);
-	push @subdirs, @altpaths;
-    }
-    
+        @altpaths = split (',', $altpaths);
+        push @subdirs, @altpaths;
+    }
+
     @trynames = ($name);
     if ($altnames ne "NONE") {
-	@altnames = split (',', $altnames);
-	push @trynames, @altnames;
+        @altnames = split (',', $altnames);
+        push @trynames, @altnames;
     }
 
     # try each of the possible library names
-    foreach $tryname (@trynames) { 
-	# try each of the library paths, with the default as well as each altpath
-	foreach $topdir ( @libpath ) {
-	    foreach $subdir ( @subdirs ) {
-		if ($subdir eq ".") {
-		    $path = $topdir;
-		} else {
-		    $path = "$topdir/$subdir";
-		}
-		# print "trying $path\n";
-		if (! -e $path) { next; }
-		$libname = "$path/$tryname.a";
-		if (-e $libname) { return $libname; }
-		# print "no $libname\n";
-		$libname = "$path/$tryname.$dlltype";
-		if (-e $libname) { return $libname; }
-		# print "no $libname\n";
-	    }
-	}
-
-	# if we failed to find the basic named library files, try the
-	# versions libraries if we find only a .so.N without a matching
-	# .so, we link this in the installed libdir
-	foreach $topdir ( @libpath ) {
-	    foreach $subdir ( @subdirs ) {
-		if ($subdir eq ".") {
-		    $path = $topdir;
-		} else {
-		    $path = "$topdir/$subdir";
-		}
-		if (! -e $path) { next; }
-		@libnames = <$path/$tryname.$dlltype*>;
-		if (@libnames > 0) { 
-		    $libname = @libnames[-1];
-		    # print "making link to numbered .$dlltype library $libdir/$f.$dlltype\n";
-		    symlink $libname, "$libdir/$f.$dlltype";
-		    if ($?) { exit 1; }
-		    return $libname; 
-		}
-		# print "no $path/$tryname.$dlltype*\n";
-	    }
-	}
+    foreach $tryname (@trynames) {
+        # try each of the library paths, with the default as well as each altpath
+        foreach $topdir ( @libpath ) {
+            foreach $subdir ( @subdirs ) {
+                if ($subdir eq ".") {
+                    $path = $topdir;
+                } else {
+                    $path = "$topdir/$subdir";
+                }
+                # print "trying $path\n";
+                if (! -e $path) { next; }
+                $libname = "$path/$tryname.a";
+                if (-e $libname) { return $libname; }
+                # print "no $libname\n";
+                $libname = "$path/$tryname.$dlltype";
+                if (-e $libname) { return $libname; }
+                # print "no $libname\n";
+            }
+        }
+
+        # if we failed to find the basic named library files, try the
+        # versions libraries if we find only a .so.N without a matching
+        # .so, we link this in the installed libdir
+        foreach $topdir ( @libpath ) {
+            foreach $subdir ( @subdirs ) {
+                if ($subdir eq ".") {
+                    $path = $topdir;
+                } else {
+                    $path = "$topdir/$subdir";
+                }
+                if (! -e $path) { next; }
+                @libnames = <$path/$tryname.$dlltype*>;
+                if (@libnames > 0) {
+                    $libname = @libnames[-1];
+                    # print "making link to numbered .$dlltype library $libdir/$f.$dlltype\n";
+                    symlink $libname, "$libdir/$f.$dlltype";
+                    if ($?) { exit 1; }
+                    return $libname;
+                }
+                # print "no $path/$tryname.$dlltype*\n";
+            }
+        }
     }
     return 0;
@@ -307,25 +307,25 @@
     my $altnames = $_[1];
     my $altpaths = $_[2];
-    
+
     # XXX drop this for bin?
     @subdirs = ".";
     if ($altpaths ne "NONE") {
-	@altpaths = split (',', $altpaths);
-	push @subdirs, @altpaths;
-    }
-    
+        @altpaths = split (',', $altpaths);
+        push @subdirs, @altpaths;
+    }
+
     # try each of the library paths, with the default as well as each altpath
     foreach $topdir ( @binpath ) {
-	foreach $subdir ( @subdirs ) {
-	    if ($subdir eq ".") {
-		$path = $topdir;
-	    } else {
-		$path = "$topdir/$subdir";
-	    }
-	    # print "trying $path\n";
-	    if (! -e $path) { next; }
-	    $binname = "$path/$name";
-	    if (-e $binname) { return $binname; }
-	}
+        foreach $subdir ( @subdirs ) {
+            if ($subdir eq ".") {
+                $path = $topdir;
+            } else {
+                $path = "$topdir/$subdir";
+            }
+            # print "trying $path\n";
+            if (! -e $path) { next; }
+            $binname = "$path/$name";
+            if (-e $binname) { return $binname; }
+        }
     }
     return 0;
@@ -336,23 +336,23 @@
     my $altnames = $_[1];
     my $altpaths = $_[2];
-    
+
     @subdirs = ".";
     if ($altpaths ne "NONE") {
-	@altpaths = split (',', $altpaths);
-	push @subdirs, @altpaths;
-    }
-    
+        @altpaths = split (',', $altpaths);
+        push @subdirs, @altpaths;
+    }
+
     # try each of the library paths, with the default as well as each altpath
     foreach $topdir ( @incpath ) {
-	foreach $subdir ( @subdirs ) {
-	    if ($subdir eq ".") {
-		$path = $topdir;
-	    } else {
-		$path = "$topdir/$subdir";
-	    }
-	    if (! -e $path) { next; }
-	    $incname = "$path/$name";
-	    if (-e $incname) { return $incname; }
-	}
+        foreach $subdir ( @subdirs ) {
+            if ($subdir eq ".") {
+                $path = $topdir;
+            } else {
+                $path = "$topdir/$subdir";
+            }
+            if (! -e $path) { next; }
+            $incname = "$path/$name";
+            if (-e $incname) { return $incname; }
+        }
     }
 
@@ -362,5 +362,5 @@
 sub checkarch {
     # we are going to supplement the global libpath supplied
-    
+
     # check the hardware architecture:
     $sys=`uname -s`; chomp $sys;
@@ -371,46 +371,46 @@
 
     if ($sys eq "IRIX64") {
-	$arch = "irix";
-	return;
+        $arch = "irix";
+        return;
     }
 
     if ($sys eq "SunOS") {
-	$ver=`uname -r | awk '{print substr($1,1,1)}'`;
-	if ($ver == 5) {
-	    $arch = "sol";
-	} else {
-	    $arch="sun4";
-	}
-
-	# sun (at least) seems to need the socket library (linux does not)
-	push @libpath, "/usr/openwin/lib";
-	push @incpath, "/usr/openwin/include";
-
-	# XXX this is a problem
-	print STDERR "need to add system dependent libraries (eg, libsocket, libnsl)\n";
-	exit 1;
-	$needlibs = "$needlibs libsocket libnsl";
-	$ranlib = "touch";
-	return;
+        $ver=`uname -r | awk '{print substr($1,1,1)}'`;
+        if ($ver == 5) {
+            $arch = "sol";
+        } else {
+            $arch="sun4";
+        }
+
+        # sun (at least) seems to need the socket library (linux does not)
+        push @libpath, "/usr/openwin/lib";
+        push @incpath, "/usr/openwin/include";
+
+        # XXX this is a problem
+        print STDERR "need to add system dependent libraries (eg, libsocket, libnsl)\n";
+        exit 1;
+        $needlibs = "$needlibs libsocket libnsl";
+        $ranlib = "touch";
+        return;
     }
 
     if ($sys eq "Linux") {
-	$arch = "linux";
-
-	if (-e "/etc/sidious.config") { 
-	    $arch = "sid";
-	    return;
-	}
-
-	$mach = `uname -m`; chomp $mach;
-
-	if ($mach eq "x86_64") {
-	    $arch = "lin64";
-	    unshift @libpath, "/lib64";
-	    unshift @libpath, "/usr/lib64";
-	    unshift @libpath, "/usr/X11R6/lib64";
-	    return;
-	}
-	return;
+        $arch = "linux";
+
+        if (-e "/etc/sidious.config") {
+            $arch = "sid";
+            return;
+        }
+
+        $mach = `uname -m`; chomp $mach;
+
+        if ($mach eq "x86_64") {
+            $arch = "lin64";
+            unshift @libpath, "/lib64";
+            unshift @libpath, "/usr/lib64";
+            unshift @libpath, "/usr/X11R6/lib64";
+            return;
+        }
+        return;
     }
 
@@ -430,8 +430,8 @@
 
     if ($sys eq "HP-UX") {
-	$arch = "hpux";
-	return;
-    }
-    
+        $arch = "hpux";
+        return;
+    }
+
     print "unknown architecture";
     exit 1;
@@ -452,7 +452,7 @@
     @list = <$tagsets/*.perl>;
     foreach $line (@list) {
-	chomp $line;
-	($dist) = $line =~ m|$tagsets/(\S*).perl|;
-	print STDERR "$dist\n";
+        chomp $line;
+        ($dist) = $line =~ m|$tagsets/(\S*).perl|;
+        print STDERR "$dist\n";
     }
     exit 2;
