Index: /trunk/psconfig/psbuild
===================================================================
--- /trunk/psconfig/psbuild	(revision 34086)
+++ /trunk/psconfig/psbuild	(revision 34087)
@@ -9,4 +9,6 @@
 $optimize = 0;
 $profile = 0;
+$no_as_needed = 0;
+$debug_build = 0;
 $developer = 0;
 $magic = 0;
@@ -72,4 +74,12 @@
     if ($ARGV[0] eq "-profile") {
         $profile = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-no-as-needed") {
+        $no_as_needed = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-debug-build") {
+        $debug_build = 1;
         shift; next;
     }
@@ -262,4 +272,6 @@
     if ($optimize) { $psopts = "$psopts --enable-optimize"; }
     if ($profile)  { $psopts = "$psopts --enable-profile --disable-shared --enable-static"; }
+    if ($debug_build)  { $psopts = "$psopts --enable-debug-build"; }
+    if ($no_as_needed)  { $psopts = "$psopts --enable-no-as-needed"; }
     $psopts .= " --disable-version" if $offline;
 
@@ -383,7 +395,11 @@
 
 sub bootstrap {
-
-    if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir)\n"; }
+    if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir | current)\n"; }
     $psconfdir = $ARGV[1];
+
+    if ($psconfdir eq "current") {
+	$psconfdir = $ENV{'PSCONFDIR'};
+	if (! $psconfdir) { die "no env variable PSCONFDIR found for psbuild -bootstrap current\n"; }
+    }
     die "Target directory must be absolute, not relative: $psconfdir\n" unless $psconfdir =~ m|^/|;
 
@@ -479,4 +495,6 @@
     print STDERR "     : -optimize          : set flags for optimized code\n";
     print STDERR "     : -profile           : set flags for profiling\n";
+    print STDERR "     : -debug-build       : set flags for debug build (Wall, but not Werror; use to find and fix warnings from Wall)\n";
+    print STDERR "     : -no-as-needed      : add --no-as-needed flag to gcc (to disable default --as-needed flags from Ubuntu, etc)\n";
     print STDERR "     : -only (module)     : only build the specified module\n";
     print STDERR "     : -start (module)    : begin build at specified module\n";
Index: /trunk/psconfig/pschecklibs
===================================================================
--- /trunk/psconfig/pschecklibs	(revision 34086)
+++ /trunk/psconfig/pschecklibs	(revision 34087)
@@ -142,8 +142,15 @@
 unshift @incpath, $incdir;
 
+# get a list of implicit paths from cpp directly
+&checkpreprocessor ();
+
+# get a list of implicit paths from the linker directly
+&checklinker ();
+
 # add the system paths specified for each architecture
 &checkarch ();
 print "setting architecture to: $arch\n";
 print "searching for libraries in: @libpath\n";
+print "searching for headers in: @incpath\n";
 print "searching for programs in: @binpath\n";
 print "\n";
@@ -404,5 +411,4 @@
                 $path = "$topdir/$subdir";
             }
-            # print "trying $path\n";
             if (! -e $path) { next; }
             $binname = "$path/$name";
@@ -441,4 +447,75 @@
 }
 
+sub checklinker {
+    # we are going to supplement the libpath with entries reported by
+    # the linker (this depends on ld --verbose 
+
+    my $line, @lines;
+    my $item, @items;
+
+    @lines = `ld --verbose | grep SEARCH_DIR`;
+    foreach $line (@lines) {
+	# we expect items of the form SEARCH_DIR("path");
+	# or SEARCH_DIR("=path") -- in that case we should prepend sysroo
+	next unless ($line =~ m|SEARCH_DIR|);
+	@items = split (";", $line);
+	foreach $item (@items) {
+	    next unless ($item);
+	    ($p1) = $item =~ m|SEARCH_DIR\050"=(\S*)"|;
+	    ($p2) = $item =~ m|SEARCH_DIR\050"(\S*)"|;
+	    next if (!$p1 && !$p2);
+	    if (!$p1 && $p2) {
+		push @libpath, $p2;
+	    }
+	    if ($p1 && $p2) {
+		push @libpath, $p1;
+	    }
+	    if ($p1 && !$p2) {
+		print "programming error!\n";
+		exit 4;
+	    }
+	}
+    }
+    return 0;
+}
+
+sub checkpreprocessor {
+    # we are going to supplement the libpath with entries reported by
+    # the linker (this depends on ld --verbose 
+
+### #include <...> search starts here:
+###  /home/eugene/src/psconfig/ipp-dev.linux/include
+###  .
+###  /usr/lib/gcc/i686-linux-gnu/4.6/include
+###  /usr/local/include
+###  /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
+###  /usr/include/i386-linux-gnu
+###  /usr/include
+### End of search list.
+
+    my $line, @lines;
+    my $found_start;
+
+    @lines = `cpp --verbose < /dev/null 2>&1`;
+    $found_start = 0;
+    foreach $line (@lines) {
+	if (!$found_start) {
+	    if ($line =~ m|include \<...\> search starts here|) {
+		$found_start = 1;
+		next;
+	    } else {
+		next;
+	    }
+	}
+	chomp $line;
+	if ($line =~ m|End of search list|) {
+	    return 1;
+	}
+	($cleanline) = $line =~ m|\s*(\S*)|;
+	push @incpath, $cleanline;
+    }
+    return 0;
+}
+
 sub checkarch {
     # we are going to supplement the global libpath supplied
Index: /trunk/psconfig/pscheckmods
===================================================================
--- /trunk/psconfig/pscheckmods	(revision 34086)
+++ /trunk/psconfig/pscheckmods	(revision 34087)
@@ -1,4 +1,5 @@
 #!/usr/bin/env perl
 
+$DEBUG = 0;
 $VERBOSE = 0;
 if (@ARGV > 2 && $ARGV[0] eq "-v") {
@@ -10,5 +11,5 @@
 if ($VERBOSE) { print STDERR "checking in @INC\n"; }
 
-# &detailed_require ($ARGV[0]);
+if ($DEBUG) { &detailed_require ($ARGV[0]);}
 
 $x = eval "require $ARGV[0]; 1";
@@ -18,5 +19,5 @@
     &detailed_require ($ARGV[0]);
 }
-if ($VERBOSE) { print "x: $x\n"; }
+if ($VERBOSE) { print "result of require: $x\n"; }
 
 $version = eval "\$$ARGV[0]::VERSION";
@@ -34,8 +35,7 @@
     $filename =~ s|::|/|g;
     $filename = "$filename.pm";
-    print "$filename\n";
+    print "\ntesting : $filename\n" if $DEBUG;
     if (exists $INC{$filename}) {
 	return 1 if $INC{$filename};
-	die "Compilation failed in require";
     }
     my ($realfilename,$result);
@@ -43,8 +43,10 @@
       foreach $prefix (@INC) {
 	  $realfilename = "$prefix/$filename";
-	  print "$realfilename\n";
+	  print "real: $realfilename\n" if $DEBUG;
 	  if (-f $realfilename) {
 	      $INC{$filename} = $realfilename;
+	      print "calling 'do' on $realfilename\n" if $DEBUG;
 	      $result = do $realfilename;
+	      print "result: $result\n" if $DEBUG;
 	      last ITER;
 	  }
@@ -53,10 +55,13 @@
     }
     if ($@) {
+	print "$@" if $DEBUG;
 	$INC{$filename} = undef;
 	die $@;
     } elsif (!$result) {
+	print "no result\n" if $DEBUG;
 	delete $INC{$filename};
 	die "$filename did not return true value";
     } else {
+	print "done with detailed_require\n" if $DEBUG;
 	return $result;
     }
Index: /trunk/psconfig/pscheckperl
===================================================================
--- /trunk/psconfig/pscheckperl	(revision 34086)
+++ /trunk/psconfig/pscheckperl	(revision 34087)
@@ -5,4 +5,5 @@
 $version = "";
 $build = 0;
+$clean = 0;
 my %force;   # Names of module to force build
 @tARGV = ();
@@ -14,4 +15,8 @@
     if ($ARGV[0] eq "-build") {
         $build = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-clean") {
+        $clean = 1;
         shift; next;
     }
@@ -32,4 +37,6 @@
 if ( @ARGV > 1) { &usage(); }
 
+if ($build && $clean) {die "-build and -clean are incompatible\n";}
+
 if ( @ARGV == 0) {
     @list = <$tagsets/*.perl>;
@@ -95,4 +102,14 @@
     # if ($modver eq "") { $modver = 0; }
 
+    if ($clean) {
+	($tardir) = $tarball =~ m|(\S*).tar.gz|;
+	$tardir = "../extperl/$tardir";
+	if (-d $tardir) {
+	    print "remove tardir: $tardir\n";
+	    vsystem ("rm -rf $tardir");
+	}
+	next;
+    }
+    
     system ("pscheckmods $module $modver");
     if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) {
@@ -127,5 +144,5 @@
     if ($prompts eq "NONE") { $prompts = ""; }
 
-    if (-e "Build.PL" and $module ne "Params::Validate" and $module ne "DateTime::TimeZone") {
+    if (-e "Build.PL" and $module ne "DateTime::TimeZone") {
         # vsystem("perl Build.PL --install_path lib=$perldir ");
         vsystem("perl Build.PL --install_base $prefix $buildopts");
Index: /trunk/psconfig/psconfig.csh.in
===================================================================
--- /trunk/psconfig/psconfig.csh.in	(revision 34086)
+++ /trunk/psconfig/psconfig.csh.in	(revision 34087)
@@ -125,4 +125,5 @@
 if ($?PERL5LIB == 0) setenv PERL5LIB
 if ($?MANPATH == 0) setenv MANPATH
+if ($?LDFLAGS == 0) setenv LDFLAGS
 
 # identify system architecture
@@ -318,8 +319,24 @@
  case linux:
  case linrh:
+   gcc --version | grep 4.6.3 | grep Ubuntu >& /dev/null
+   if ($status == 0) then
+    set xtraflags = "-Wl,--no-as-needed"
+    echo $LDFLAGS | grep -- $xtraflags >& /dev/null
+    if ($status) then
+      setenv LDFLAGS "$LDFLAGS $xtraflags"
+    endif
+   endif  
    breaksw;
 
  case lin64:
  case linrh64:
+   gcc --version | grep 4.6.3 | grep Ubuntu >& /dev/null
+   if ($status == 0) then
+    set xtraflags = "-Wl,--no-as-needed"
+    echo $LDFLAGS | grep -- $xtraflags >& /dev/null
+    if ($status) then
+      setenv LDFLAGS "$LDFLAGS $xtraflags"
+    endif
+   endif  
    set xtralibs = ( $xtralibs "/usr/lib64" "/usr/X11R6/lib64" "/lib64" )
    breaksw;
Index: /trunk/psconfig/tagsets/ipp-3.0.perl
===================================================================
--- /trunk/psconfig/tagsets/ipp-3.0.perl	(revision 34086)
+++ /trunk/psconfig/tagsets/ipp-3.0.perl	(revision 34087)
@@ -6,8 +6,10 @@
 # a Version of 0 is required if no specific version is desired                                 options   responses
   00    Getopt::Long                   Getopt-Long-2.36.tar.gz                  2.3            NONE      n
-  00    Module::Build                  Module-Build-0.2806.tar.gz               0.2806         NONE      NONE # special comment here
+# 00    Module::Build                  Module-Build-0.40.tar.gz                 0.38           NONE      NONE # special comment here
+  00    Module::Build                  Module-Build-0.3601.tar.gz               0.3601         NONE      NONE # special comment here
   01    ExtUtils::MakeMaker            ExtUtils-MakeMaker-6.54.tar.gz           0              NONE      NONE
   02a   Attribute::Handlers            Attribute-Handlers-0.87.tar.gz           0.79           NONE      NONE
-  02    Params::Validate               Params-Validate-0.92.tar.gz              0.92           NONE      NONE
+# Params::Validate 0.92 breaks with Perl >= 5.14 (and probably earlier) because 'ref' added RegExp as a type
+  02    Params::Validate               Params-Validate-0.96.tar.gz              0.96           NONE      NONE
 # 02    Apache::Test                   Apache-Test-1.29.tar.gz                  1.29           NONE      NONE
   03a   Class::Singleton               Class-Singleton-1.4.tar.gz               0              NONE      NONE
@@ -81,6 +83,9 @@
   70    Config::YAML                   Config-YAML-1.42.tar.gz                  0              NONE      NONE
 # 72    File::ExtAttr                  File-ExtAttr-1.07.tar.gz                 0              NONE      NONE
-  73    DBI                            DBI-1.601.tar.gz                         0              NONE      NONE
-  71    DBD::mysql                     DBD-mysql-4.006.tar.gz                   0              NONE      NONE
+# version 1.622 updates sv_undef and related to new namespace (PL_*) (needed as of Perl 5.13.XX)
+  73    DBI                            DBI-1.622.tar.gz                         1.622          NONE      NONE
+# version 4.021 updates sv_undef and related to new namespace (PL_*) (needed as of Perl 5.13.XX)
+  71    DBD::mysql                     DBD-mysql-4.021.tar.gz                   4.021          NONE      NONE
+
 # 74    Net::Server::Daemonize         Net-Server-0.97.tar.gz                   0.05           NONE      NONE
   75    File::Path                      File-Path-2.04.tar.gz                   0              NONE      NONE
