Index: trunk/psconfig/psbuild
===================================================================
--- trunk/psconfig/psbuild	(revision 31466)
+++ 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";
