Index: branches/tap_branches/psconfig/pscheckperl
===================================================================
--- branches/tap_branches/psconfig/pscheckperl	(revision 25900)
+++ branches/tap_branches/psconfig/pscheckperl	(revision 27838)
@@ -53,4 +53,11 @@
 }
 
+# generate new psconfig.csh if needed
+if (! -e "psconfig.csh" || ! -e "psconfig.bash") {
+    $psconfdir = $ENV{'PSCONFDIR'};
+    if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; }
+    vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");
+    vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");
+}
 
 $prefix  = `csh -f psconfig.csh --prefix $version`; chomp $prefix;
@@ -78,7 +85,14 @@
     if ($line =~ m|^\s*\#|) { next; }
 
-    ($N, $module, $tarball, $modver, $prompts) = split (" ", $line);
+    $Nvalue = ($N, $module, $tarball, $modver, $buildopts, $prompts) = split (" ", $line);
+    if ($Nvalue < 6) {
+        print "Error in perl module config line $line\n";
+        exit 1;
+    }
+    # print "N: $N, module: $module, tarball: $tarball, modver: $modver, buildopts: $buildopts, prompts: $prompts\n";
 
-    if ($modver eq "") { $modver = 0; }
+    # we require the number of fields to be fixed, so this test is now invalid:
+    # if ($modver eq "") { $modver = 0; }
+
     system ("pscheckmods $module $modver");
     if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) {
@@ -109,7 +123,11 @@
     chdir $tardir;
 
-    if (-e "Build.PL") {
+    # we use NONE as the empty word
+    if ($buildopts eq "NONE") { $buildopts = ""; }
+    if ($prompts eq "NONE") { $prompts = ""; }
+
+    if (-e "Build.PL" and $module ne "Params::Validate" and $module ne "DateTime::TimeZone") {
         # vsystem("perl Build.PL --install_path lib=$perldir ");
-        vsystem("perl Build.PL --install_base $prefix");
+        vsystem("perl Build.PL --install_base $prefix $buildopts");
         vsystem("Build");
         vsystem("Build install");
@@ -118,5 +136,5 @@
         if ($prompts) {
             @answers = split (",", $prompts);
-            open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir");
+            open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir $buildopts");
             foreach $answer (@answers) {
                 print PIPE "$answer\n";
@@ -124,7 +142,6 @@
             close (PIPE);
         } else {
-            vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir");
+            vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir $buildopts");
         }
-
         vsystem ("make < /dev/null");
         vsystem ("make install");
