Index: trunk/psconfig/psbuild
===================================================================
--- trunk/psconfig/psbuild	(revision 16092)
+++ trunk/psconfig/psbuild	(revision 16124)
@@ -54,4 +54,7 @@
     if ($ARGV[0] eq "-list") {
 	&list_distributions ();
+    }
+    if ($ARGV[0] eq "-bootstrap") {
+	&bootstrap ();
     }
     if ($ARGV[0] eq "-env") {
@@ -254,4 +257,40 @@
     }
     exit 2;
+}
+
+sub bootstrap {
+
+    if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir)\n"; }
+    $psconfdir = $ARGV[1];
+
+    # copy psconfig.csh and psconfig.bash to psconfdir
+    vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");
+    vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");
+
+    vsystem ("mkdir -p $psconfdir");
+
+    vsystem ("cp psconfig.csh $psconfdir/psconfig.csh");
+    vsystem ("cp psconfig.bash $psconfdir/psconfig.bash");
+    print STDOUT "\n";
+    
+    print STDOUT "** if you use csh, tcsh or equivalent as your shell, add the following to your .cshrc\n";
+    print STDOUT "    if (-e $psconfdir/psconfig.csh) then\n";
+    print STDOUT "      alias  psconfig        \"source $psconfdir/psconfig.csh\"\n";
+    print STDOUT "    else\n";
+    print STDOUT "      alias  psconfig        \"echo psconfig not available\"\n";
+    print STDOUT "    endif\n";
+    print STDOUT "    psconfig default\n";
+    print STDOUT "\n";
+
+    print STDOUT "** if you use sh, bash or equivalent as your shell, add the following to your .bashrc\n";
+    print STDOUT "    if [ -f $psconfdir/psconfig.csh ]; then\n";
+    print STDOUT "      alias psconfig='source $psconfdir/psconfig.bash'\n";
+    print STDOUT "    else\n";
+    print STDOUT "      alias psconfig='echo psconfig not available'\n";
+    print STDOUT "    fi\n";
+    print STDOUT "    psconfig default\n";
+    print STDOUT "\n";
+
+    exit 0;
 }
 
