Index: trunk/psconfig/pschecklibs
===================================================================
--- trunk/psconfig/pschecklibs	(revision 26266)
+++ trunk/psconfig/pschecklibs	(revision 26271)
@@ -11,4 +11,6 @@
 $version = "";
 $build = 0;
+$list_modules = 0;
+my $only = "";
 my %force;
 my %done;                       # Tarballs that have been processed
@@ -35,4 +37,9 @@
         shift; shift; next;
     }
+    if ($ARGV[0] eq "-only") {
+        if (@ARGV < 2) { die "-only must be coupled to a library name\n"; }
+	$only = lc($ARGV[1]);
+        shift; shift; next;
+    }
     if ($ARGV[0] eq "-h")     { &usage (); }
     if ($ARGV[0] eq "help")   { &usage (); }
@@ -40,4 +47,5 @@
     if ($ARGV[0] eq "--help") { &usage (); }
     if ($ARGV[0] eq "-list")  { &list_distributions(); }
+    if ($ARGV[0] eq "-modules") { $list_modules = 1; shift; next; }
     @tARGV = (@tARGV, $ARGV[0]);
     shift;
@@ -58,4 +66,6 @@
 @list = <FILE>;
 close (FILE);
+
+if ($list_modules) { &list_modules(); }
 
 # set the psconfig version:
@@ -146,4 +156,5 @@
     if (($auto_force ne "Y") && ($auto_force ne "N")) { die "invalid value for auto_force field\n"; }
 
+    if ($only && ($only ne lc($name))) { next; }
 
     if ((defined $force{lc($name)} or defined $force{'all'}) and
@@ -501,5 +512,8 @@
 
 sub usage {
-    print STDERR "USAGE: pschecklibs [-version] [-build]\n";
+    print STDERR "USAGE: pschecklibs [-version] [-build] [-only module] [-force module] [-force all]\n";
+    print STDERR "  multiple [-force (module)] options may be specified\n";
+    print STDERR "USAGE: pschecklibs [-list] : show C libraries file\n";
+    print STDERR "USAGE: pschecklibs [-modules] : list available C modules\n";
     exit 2;
 }
@@ -521,4 +535,22 @@
 }
 
+sub list_modules {
+
+    foreach $line (@list) {
+	chop $line;
+	if ($line =~ m|^\s*$|) { next; }
+	if ($line =~ m|^\s*\#|) { next; }
+
+	($type, $name, $altnames, $altpaths, $tarball, $tardir, $auto_force, $configure_opts, $make_opts, $install_opts) = split (" ", $line);
+	if ($type eq "bin") {
+	    print STDERR "bin: $name\n";
+	}
+	if ($type eq "lib") {
+	    print STDERR "lib: $name\n";
+	}
+    }
+    exit 0;
+}
+
 sub failure {
     system ("ls");
