Index: trunk/psconfig/psconfig.csh.in
===================================================================
--- trunk/psconfig/psconfig.csh.in	(revision 16217)
+++ trunk/psconfig/psconfig.csh.in	(revision 16287)
@@ -296,4 +296,62 @@
 endif 
 
+# supplement CPATH, LIBRARY_PATH and LD_LIBRARY_PATH with a few extra common locations
+# we probably can drop the system libraries here
+set xtralibs = ( "/lib" "/usr/lib" "/usr/X11R6/lib" "/usr/local/lib" )
+set xtrapath = ( "/usr/include" "/usr/local/include" "/usr/X11R6/include" )
+
+# add architecture-dependent paths
+switch ($ARCH)
+   breaksw;
+
+ case sol:
+ case sun4:
+   set xtralibs = ( $xtralibs "/usr/openwin/lib" )
+   set xtrapath = ( $xtrapath "/usr/openwin/include")
+   breaksw;
+
+ case linux:
+ case linrh:
+   breaksw;
+
+ case lin64:
+ case linrh64:
+   set xtralibs = ( $xtralibs "/lib64" "/usr/lib64" "/usr/X11R6/lib64" )
+   breaksw;
+
+ case darwin:
+ case darwin_x86:
+   set xtralibs = ( $xtralibs "/sw/lib" )
+   set xtrapath = ( $xtrapath "/sw/include" "/usr/include/sys")
+   breaksw;
+
+ case sid:
+ case hp:
+ case irix:
+
+ default:
+   echo "unknown architecture";
+   breaksw;
+endsw
+
+# add to LD_LIBRARY_PATH if not found
+foreach name ($xtralibs)
+  echo $LD_LIBRARY_PATH | grep $name> /dev/null
+  if ($status == 0) continue
+  setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}{$name}:
+end
+# add to LIBRARY_PATH if not found
+foreach name ($xtralibs)
+  echo $LIBRARY_PATH | grep $name > /dev/null
+  if ($status == 0) continue
+  setenv LIBRARY_PATH {$LIBRARY_PATH}{$name}:
+end
+# add to CPATH if not found
+foreach name ($xtrapath)
+  echo $CPATH | grep $name > /dev/null
+  if ($status == 0) continue
+  setenv CPATH {$CPATH}{$name}:
+end
+
 # Build wants to put things in prefix/*, MakeMaker wants to put them in prefix/perl5/*
 set plibdir  = {$PSCONFDIR}/{$PSCONFIG}/lib
