Index: trunk/psconfig/ckperlmods
===================================================================
--- trunk/psconfig/ckperlmods	(revision 11938)
+++ trunk/psconfig/ckperlmods	(revision 11940)
@@ -1,6 +1,27 @@
 #!/usr/bin/env perl
 
+$version = "";
+$check = 0;
+@tARGV = ();
+for (; @ARGV > 0; ) {
+    if ($ARGV[0] eq "-version") {
+	$version = $ARGV[1];
+        shift; shift; next;
+    }
+    if ($ARGV[0] eq "-check") {
+	$check = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-h")     { &usage (); }
+    if ($ARGV[0] eq "-help")  { &usage (); }
+    if ($ARGV[0] eq "--help") { &usage (); }
+    @tARGV = (@tARGV, $ARGV[0]);
+    shift;
+}
+@ARGV = @tARGV;
+if ( @ARGV != 0) { &usage (); }
+
+# load the perl module list
 $file = "tagsets/ipp-extperl.dst";
-
 open (FILE, $file) || die "ERROR: can't open perl module list: $file\n";
 @list = <FILE>;
@@ -15,7 +36,11 @@
 }
 
-$prefix = `csh psconfig.sh --prefix $version`;
-$perl5lib = `csh psconfig.sh --perl5lib $version`;
-$homedir = `pwd`;
+print "version: $version\n";
+
+$prefix = `csh -f psconfig.sh --prefix $version`; chomp $prefix;
+$perl5lib = `csh -f psconfig.sh --perl5lib $version`; chomp $perl5lib;
+$homedir = `pwd`; chomp $homedir;
+
+print "prefix: $prefix\n";
 
 foreach $line (@list) {
@@ -24,5 +49,5 @@
     if ($line =~ m|^\s*\#|) { next; }
 
-    ($N, $module, $tarball) = split (" ", $line);
+    ($N, $module, $tarball, $prompts) = split (" ", $line);
     
     if (eval "use $module; 1") { 
@@ -31,10 +56,12 @@
     }
 
-    # print "$module: missing\n";
+    print "$module: missing\n";
+    if ($check) { next; }
+
     # try to build the module from ../../extperl/Module.*.tar.gz
     chdir "../../extperl";
 
     print "extract $module from $tarball\n";
-    system ("tar xvzf $tarball");
+    vsystem ("tar xvzf $tarball");
     
     ($tardir) = $tarball =~ m|(\S*).tar.gz|;
@@ -42,11 +69,31 @@
 
     chdir $tardir;
-    # system ("perl Makefile.PL LIB=$perl5lib");
-    system ("perl Makefile.PL PREFIX=$prefix");
-    system ("make");
-    system ("make install");
 
-    # system ("ls $tarball");
+    # vsystem ("perl Makefile.PL LIB=$perl5lib");
+    if ($prompts) {
+	@answers = split (",", $prompts);
+	open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perl5lib");
+	foreach $answer (@answers) {
+	    print PIPE "$answer\n";
+	}
+	close (PIPE);
+    } else {
+	vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perl5lib");
+    }
+    
+    vsystem ("make < /dev/null");
+    vsystem ("make install");
 
     chdir $homedir;
 }
+
+sub usage {
+    print STDERR "USAGE: ckperlmods [-version] [-check]\n";
+    exit 2;
+}
+
+sub vsystem {
+    print STDERR "@_\n";
+    $status = system ("@_");
+    $status;
+}
