Index: /trunk/psconfig/ckperlmods
===================================================================
--- /trunk/psconfig/ckperlmods	(revision 12132)
+++ /trunk/psconfig/ckperlmods	(revision 12133)
@@ -39,9 +39,9 @@
 
 $prefix = `csh -f psconfig.sh --prefix $version`; chomp $prefix;
-$perl5lib = `csh -f psconfig.sh --perl5lib $version`; chomp $perl5lib;
+$perldir = `csh -f psconfig.sh --perldir $version`; chomp $perldir;
 $homedir = `pwd`; chomp $homedir;
 
 print "prefix: $prefix\n";
-print "perl5lib: $perl5lib\n";
+print "perldir: $perldir\n";
 print "PERL5LIB: $ENV{'PERL5LIB'}\n";
 
@@ -73,8 +73,8 @@
     chdir $tardir;
 
-    # vsystem ("perl Makefile.PL LIB=$perl5lib");
+    # build the MakeMaker makefile, setting the output directories
     if ($prompts) {
 	@answers = split (",", $prompts);
-	open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perl5lib");
+	open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir");
 	foreach $answer (@answers) {
 	    print PIPE "$answer\n";
@@ -82,5 +82,5 @@
 	close (PIPE);
     } else {
-	vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perl5lib");
+	vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir");
     }
     
Index: /trunk/psconfig/mkbuild
===================================================================
--- /trunk/psconfig/mkbuild	(revision 12132)
+++ /trunk/psconfig/mkbuild	(revision 12133)
@@ -84,4 +84,12 @@
     print "psautogen: $psautogen\n";
     print "psperlbuild: $psperlbuild\n";
+
+    # set build environment variables
+    ps_setenv ("PATH", 		  "--show_path");
+    ps_setenv ("ARCH", 		  "--show_arch");
+    ps_setenv ("LD_LIBRARY_PATH", "--show_ld_library_path");
+    ps_setenv ("PKG_CONFIG_PATH", "--show_pkg_config_path");
+    ps_setenv ("ACLOCAL_FLAGS",   "--show_aclocal_flags");
+    ps_setenv ("PERL5LIB",        "--show_perl5lib");
 
     $psopts = "";
@@ -240,2 +248,13 @@
 }
 
+sub ps_setenv {
+
+    my $var = $_[0];
+    my $flag = $_[1];
+
+    my $answer = `csh psconfig.sh $flag`;
+    chomp $answer;
+
+    $ENV{$var} = $answer;
+}
+
Index: /trunk/psconfig/psconfig.sh
===================================================================
--- /trunk/psconfig/psconfig.sh	(revision 12132)
+++ /trunk/psconfig/psconfig.sh	(revision 12133)
@@ -3,11 +3,19 @@
 
 # list the defined psconfig versions
+set show_prefix = 0
+set show_libs = 0
+set show_bin = 0
+set show_arch = 0
+set show_path = 0
 set show_configure = 0
 set show_autogen = 0
 set show_perlbuild = 0
+set show_perdldir = 0
 set show_perl5lib = 0
-set show_prefix = 0
-set show_libs = 0
-set show_bin = 0
+set show_psversion = 0
+set show_psconfdir = 0
+set show_ld_library_path = 0
+set show_pkg_config_path = 0
+set show_aclocal_flags = 0
 set args = ""
 while ($#argv) 
@@ -36,6 +44,30 @@
       set show_perlbuild = 1
       breaksw;
+    case --perldir:
+      set show_perldir = 1
+      breaksw;
     case --perl5lib:
       set show_perl5lib = 1
+      breaksw;
+    case --psversion
+      set show_psversion = 1
+      breaksw;
+    case --psconfdir
+      set show_psconfdir = 1
+      breaksw;
+    case --ld_library_path
+      set show_ld_library_path = 1
+      breaksw;
+    case --pkg_config_path
+      set show_pkg_config_path = 1
+      breaksw;
+    case --arch
+      set show_arch = 1
+      breaksw;
+    case --path
+      set show_path = 1
+      breaksw;
+    case --aclocal_flags
+      set show_aclocal_flags = 1
       breaksw;
     case -*:
@@ -293,8 +325,50 @@
 endif
 
+if ($show_perldir) then
+  echo $plibdir
+  exit 0
+endif
+
 if ($show_perl5lib) then
-  echo $plibdir
-  exit 0
-endif
+  echo $PERL5LIB
+  exit 0
+endif
+
+if ($show_psversion) then
+  echo $PSVERSION
+  exit 0
+endif
+
+if ($show_psconfdir) then
+  echo $PSCONFDIR
+  exit 0
+endif
+
+if ($show_ld_library_path) then
+  echo $LD_LIBRARY_PATH
+  exit 0
+endif
+
+if ($show_pkg_config_path) then
+  echo $PKG_CONFIG_PATH
+  exit 0
+endif
+
+if ($show_arch) then
+  echo $ARCH
+  exit 0
+endif
+
+if ($show_path) then
+  echo $PATH
+  exit 0
+endif
+
+if ($show_aclocal_flags) then
+  echo $ACLOCAL_FLAGS
+  exit 0
+endif
+
+
 
 exit 0
