From 9fd162bf679a710b09434c9fa394a81159e1c00b Mon Sep 17 00:00:00 2001
From: Mehdi Dogguy <mehdi@debian.org>
Date: Mon, 8 Sep 2014 21:30:42 +0200
Subject: [PATCH] Imported Upstream version 1.2.19

---
 BUILD.NOTES                                   |   17 +-
 META                                          |    4 +-
 Makefile.in                                   |    1 +
 NEWS                                          |   50 +-
 aclocal.m4                                    |  500 +++++---
 auxdir/Makefile.in                            |    1 +
 auxdir/config.guess                           |   32 +-
 auxdir/config.sub                             |   16 +-
 auxdir/ltmain.sh                              |  233 ++--
 config.h.in                                   |    3 +
 configure                                     | 1009 +++++++++++------
 configure.ac                                  |   23 +-
 contribs/Makefile.am                          |    1 +
 contribs/Makefile.in                          |    2 +
 contribs/README                               |    7 +
 contribs/env_cache_builder.c                  |  359 ++++++
 contribs/perlapi/Makefile.am                  |   19 +
 contribs/perlapi/Makefile.in                  |   31 +-
 contribs/perlapi/libslurm-perl/Slurm.xs       |  130 +--
 contribs/time_login.c                         |   17 +-
 contribs/torque/Makefile.in                   |    1 +
 contribs/torque/mpiexec.pl                    |    6 +-
 contribs/torque/qstat.pl                      |  365 +++---
 doc/Makefile.in                               |    1 +
 doc/html/Makefile.in                          |    1 +
 doc/html/bluegene.shtml                       |    8 +-
 doc/html/configurator.html.in                 |    2 +-
 doc/man/Makefile.in                           |    1 +
 doc/man/man1/salloc.1                         |   12 +-
 doc/man/man1/sbatch.1                         |   15 +-
 doc/man/man1/squeue.1                         |    3 +
 doc/man/man1/srun.1                           |   29 +-
 doc/man/man5/bluegene.conf.5                  |    8 +-
 etc/bluegene.conf.example                     |    8 +-
 slurm.spec                                    |  226 ++--
 src/Makefile.in                               |    1 +
 src/api/Makefile.in                           |    1 +
 src/common/Makefile.in                        |    1 +
 src/common/bitstring.h                        |    4 +-
 src/common/env.c                              |   82 +-
 src/common/env.h                              |    3 +-
 src/common/hostlist.c                         |  197 ++--
 src/common/read_config.c                      |   57 +-
 src/common/slurm_protocol_api.c               |   15 +
 src/common/slurm_protocol_api.h               |    6 +
 src/common/slurm_protocol_pack.c              |    8 +-
 src/plugins/Makefile.in                       |    1 +
 src/plugins/auth/Makefile.in                  |    1 +
 src/plugins/auth/authd/Makefile.in            |    1 +
 src/plugins/auth/munge/Makefile.in            |    1 +
 src/plugins/auth/none/Makefile.in             |    1 +
 src/plugins/checkpoint/Makefile.in            |    1 +
 src/plugins/checkpoint/aix/Makefile.in        |    1 +
 src/plugins/checkpoint/none/Makefile.in       |    1 +
 src/plugins/checkpoint/ompi/Makefile.in       |    1 +
 src/plugins/jobacct/Makefile.in               |    1 +
 src/plugins/jobacct/aix/Makefile.in           |    1 +
 src/plugins/jobacct/linux/Makefile.in         |    1 +
 src/plugins/jobacct/none/Makefile.in          |    1 +
 src/plugins/jobcomp/Makefile.in               |    1 +
 src/plugins/jobcomp/filetxt/Makefile.in       |    1 +
 src/plugins/jobcomp/none/Makefile.in          |    1 +
 src/plugins/jobcomp/script/Makefile.in        |    1 +
 src/plugins/mpi/Makefile.in                   |    1 +
 src/plugins/mpi/lam/Makefile.in               |    1 +
 src/plugins/mpi/mpich1_p4/Makefile.in         |    1 +
 src/plugins/mpi/mpich1_shmem/Makefile.in      |    1 +
 src/plugins/mpi/mpichgm/Makefile.in           |    1 +
 src/plugins/mpi/mpichmx/Makefile.in           |    1 +
 src/plugins/mpi/mvapich/Makefile.in           |    1 +
 src/plugins/mpi/none/Makefile.in              |    1 +
 src/plugins/mpi/openmpi/Makefile.in           |    1 +
 src/plugins/proctrack/Makefile.in             |    1 +
 src/plugins/proctrack/aix/Makefile.in         |    1 +
 src/plugins/proctrack/linuxproc/Makefile.in   |    1 +
 src/plugins/proctrack/pgid/Makefile.in        |    1 +
 src/plugins/proctrack/rms/Makefile.in         |    1 +
 src/plugins/proctrack/sgi_job/Makefile.in     |    1 +
 src/plugins/sched/Makefile.in                 |    1 +
 src/plugins/sched/backfill/Makefile.in        |    1 +
 src/plugins/sched/builtin/Makefile.in         |    1 +
 src/plugins/sched/gang/Makefile.in            |    1 +
 src/plugins/sched/hold/Makefile.in            |    1 +
 src/plugins/sched/wiki/Makefile.in            |    1 +
 src/plugins/sched/wiki/get_jobs.c             |   13 +-
 src/plugins/sched/wiki2/Makefile.in           |    1 +
 src/plugins/sched/wiki2/get_jobs.c            |   13 +-
 src/plugins/sched/wiki2/start_job.c           |   44 +-
 src/plugins/select/Makefile.in                |    1 +
 src/plugins/select/bluegene/Makefile.in       |    1 +
 .../bluegene/block_allocator/Makefile.in      |    1 +
 .../block_allocator/block_allocator.c         |   17 +-
 .../select/bluegene/plugin/Makefile.in        |    1 +
 .../select/bluegene/plugin/bg_job_place.c     |  245 ++--
 src/plugins/select/cons_res/Makefile.in       |    1 +
 src/plugins/select/linear/Makefile.in         |    1 +
 src/plugins/switch/Makefile.in                |    1 +
 src/plugins/switch/elan/Makefile.in           |    1 +
 src/plugins/switch/federation/Makefile.in     |    1 +
 src/plugins/switch/none/Makefile.in           |    1 +
 src/plugins/task/Makefile.in                  |    1 +
 src/plugins/task/affinity/Makefile.in         |    1 +
 src/plugins/task/none/Makefile.in             |    1 +
 src/sacct/Makefile.in                         |    1 +
 src/salloc/Makefile.in                        |    1 +
 src/salloc/opt.c                              |   47 +
 src/salloc/opt.h                              |    9 +-
 src/salloc/salloc.c                           |   10 +-
 src/sattach/Makefile.in                       |    1 +
 src/sattach/sattach.wrapper.c                 |    3 +-
 src/sbatch/Makefile.in                        |    1 +
 src/sbatch/opt.c                              |   58 +-
 src/sbatch/opt.h                              |   12 +-
 src/sbatch/sbatch.c                           |    7 +-
 src/sbcast/Makefile.in                        |    1 +
 src/scancel/Makefile.in                       |    1 +
 src/scontrol/Makefile.in                      |    1 +
 src/sinfo/Makefile.in                         |    1 +
 src/slaunch/Makefile.in                       |    1 +
 src/slurmctld/Makefile.in                     |    1 +
 src/slurmd/Makefile.in                        |    1 +
 src/slurmd/slurmd/Makefile.in                 |    1 +
 src/slurmd/slurmstepd/Makefile.in             |    1 +
 src/slurmd/slurmstepd/mgr.c                   |    9 +-
 src/slurmd/slurmstepd/multi_prog.c            |   16 +-
 src/slurmd/slurmstepd/slurmstepd_job.c        |    3 +-
 src/slurmd/slurmstepd/task.c                  |    8 +-
 src/smap/Makefile.in                          |    1 +
 src/smap/partition_functions.c                |    6 +-
 src/squeue/Makefile.in                        |    1 +
 src/squeue/opts.c                             |    7 +-
 src/squeue/print.c                            |   34 +-
 src/squeue/print.h                            |    4 +
 src/srun/Makefile.in                          |    1 +
 src/srun/allocate.c                           |    7 +-
 src/srun/msg.c                                |   14 +-
 src/srun/multi_prog.c                         |  160 ++-
 src/srun/multi_prog.h                         |    8 +
 src/srun/opt.c                                |   34 +-
 src/srun/opt.h                                |    4 +-
 src/srun/srun.c                               |    6 +-
 src/srun/srun.wrapper.c                       |    3 +-
 src/srun/srun_job.c                           |    4 +-
 src/strigger/Makefile.in                      |    1 +
 src/sview/Makefile.in                         |    1 +
 src/sview/job_info.c                          |    6 +-
 testsuite/Makefile.in                         |    1 +
 testsuite/expect/Makefile.in                  |    1 +
 testsuite/expect/README                       |    4 +-
 testsuite/expect/globals                      |   40 +
 testsuite/expect/test1.21                     |   45 +-
 testsuite/expect/test1.54                     |   33 +
 testsuite/expect/test1.89                     |    3 +
 testsuite/expect/test1.90                     |    4 +
 testsuite/expect/test11.5                     |   10 +-
 testsuite/expect/test18.36                    |    3 +
 testsuite/expect/test18.37                    |    3 +
 testsuite/expect/test6.7                      |    3 +-
 testsuite/slurm_unit/Makefile.in              |    1 +
 testsuite/slurm_unit/api/Makefile.in          |    1 +
 testsuite/slurm_unit/api/manual/Makefile.in   |    1 +
 testsuite/slurm_unit/common/Makefile.in       |    1 +
 testsuite/slurm_unit/slurmctld/Makefile.in    |    1 +
 testsuite/slurm_unit/slurmd/Makefile.in       |    1 +
 164 files changed, 3158 insertions(+), 1395 deletions(-)
 create mode 100644 contribs/env_cache_builder.c

diff --git a/BUILD.NOTES b/BUILD.NOTES
index 2958181f1..8e0a08d2d 100644
--- a/BUILD.NOTES
+++ b/BUILD.NOTES
@@ -36,7 +36,9 @@ Linux cluster (See BlueGene and AIX specific notes below for some differences).
 3. Use the rpm make target to create the new RPMs. This requires a .rpmmacros 
    (.rpmrc for newer versions of rpmbuild) file containing:
 	%_slurm_sysconfdir      /etc/slurm
-	%_enable_debug    "--enable-debug"
+	%_with_debug            1
+	%_with_elan		1   (ONLY ON SYSTEMS WITH ELAN SWITCH)
+	%_with_sgijob		1   (ON SYSTEMS WITHOUT ELAN SWITCH)
    I usually build with using the following syntax:
    build  -s https://eris.llnl.gov/svn/slurm/tags/slurm-1-2-0-0-pre3
    NOTE: For v1.0 and earlier add: --pre-exec='./autogen.sh'
@@ -58,13 +60,12 @@ BlueGene build notes:
 3. Use the rpm make target to create the new RPMs. This requires a .rpmmacros
    (.rpmrc for newer versions of rpmbuild) file containing:
 	%_slurm_sysconfdir      /etc/slurm
-	%_enable_debug         "--enable-debug"
+	%_with_debug            1
+	%_with_bluegene         1
 	%with_cflags		CFLAGS=-m64
    Build on Service Node with using the following syntax
    build -s https://eris.llnl.gov/svn/slurm/tags/slurm-1-2-0-0-pre3
  4. Copy RPMs to /usr/admin/sles/llnl/RPMS-SLES9
-    Do _not_ copy the switch-elan, authd-authd,
-    aix-federation or auth-none RPMs
 
 To build and run on AIX:
 0. svn co https://eris.llnl.gov/svn/slurm/trunk slurm
@@ -97,7 +98,7 @@ To build and run on AIX:
 	%_prefix                /opt/freeware
 	%_slurm_sysconfdir      %{_prefix}/etc/slurm
         %_defaultdocdir         %{_prefix}/doc
-	%_enable_debug          "--enable-debug"
+	%_with_debug            1
 	%with_ssl               "--with-ssl=/opt/freeware"
 	%with_munge             "--with-munge=/opt/freeware"
 	%with_proctrack         "--with-proctrack=/admin/llnl/include"
@@ -113,10 +114,8 @@ To build and run on AIX:
    There will be a log file create named /tmp/mplog.<jobid>.<taskid>
 7. If you update proctrack, be sure to run "slibclean" to clear cached
    version.
-8. Install the rpms slurm-*.ppc.rpm, slurm-aix-federation-*.ppc.rpm,
-   slurm-auth-munge-*.ppc.rpm and slurm-devel-*.ppc.rpm in 
-   /usr/admin/inst.images/slurm/aix5.3 on an OCF AIX machine 
-   (pdev is a good choice).
+8. Install the rpms int /usr/admin/inst.images/slurm/aix5.3 on an OCF AIX 
+   machine (pdev is a good choice).
 
 AIX/Federation switch window problems
 To clean switch windows:     ntblclean =w 8 -a sni0
diff --git a/META b/META
index 9a761e08a..51846978e 100644
--- a/META
+++ b/META
@@ -3,8 +3,8 @@
   Api_revision:  0
   Major:         1
   Meta:          1
-  Micro:         18
+  Micro:         19
   Minor:         2
   Name:          slurm
   Release:       1
-  Version:       1.2.18
+  Version:       1.2.19
diff --git a/Makefile.in b/Makefile.in
index 9290a4d6e..010f7d2a8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -184,6 +184,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/NEWS b/NEWS
index dfbe5cc40..113cb3f80 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,54 @@
 This file describes changes in recent versions of SLURM. It primarily
 documents those changes that are of interest to users and admins.
 
+* Changes in SLURM 1.2.19
+=========================
+*** NOTE IMPORTANT CHANGE IN RPM BUILD BELOW ****
+ -- slurm.spec file (used to build RPMs) was updated in order to support Mock, a
+    chroot build environment. See https://hosted.fedoraproject.org/projects/mock/
+    for more information. The following RPMs are no longer build by default:
+    aix-federation, auth_none, authd, bluegene, sgijob, and switch-elan. Change 
+    the RPMs built using the following options in ~/rpmmacros: "%_with_authd 1", 
+    "%_without_munge 1", etc. See the slurm.spec file for more details.
+ -- Print warning if non-privileged user requests negative "--nice" value on
+    job submission (srun, salloc, and sbatch commands).
+ -- In sched/wiki and sched/wiki2, add support for srun's --ntasks-per-node 
+    option.
+ -- In select/bluegene with Groups defined for Images, fix possible memory 
+    corruption. Other configurations are not affected. 
+ -- BLUEGENE - Fix bug that prevented user specification of linux-image, 
+    mloader-image, and ramdisk-image on job submission.
+ -- BLUEGENE - filter Groups specified for image not just by submitting 
+    user's current group, but all groups the user has access to.
+ -- BLUEGENE - Add salloc options to specify images to be loaded (--blrts-image, 
+    --linux-image, --mloader-image, and --ramdisk-image).
+ -- BLUEGENE - In bluegene.conf, permit Groups to be comma separated in addition 
+    to colon separators previously supported.
+ -- sbatch will accept batch script containing "#SLURM" options and advise
+    changed to "#SBATCH".
+ -- If srun --output or --error specification contains a task number rather 
+    than a file name, send stdout/err from specified task to srun's stdout/err
+    rather than to a file by the same name as the task's number.
+ -- For srun --multi-prog option, verify configuration file before attempting 
+    to launch tasks, report clear explanation of any configuration file errors.
+ -- For sched/wiki2, add optional timeout option to srun's --get-user-env
+    parameter, change default timeout for "su - <user> env" from 3 to 8 seconds.
+    On timeout, attempt to load env from file at StateSaveLocation/env_cache/<user>.
+    The format of this file is the same as output of "env" command. If there
+    is no env cache file, then abort the request.
+ -- squeue modified for completing job to remove nodes that have already 
+    completed the job before applying node filter logic.
+ -- squeue formatted output option added for job comment, "%q" (the obvious 
+    choices for letters are already in use).
+ -- Added configure option --enable-load-env-no-login for use with Moab. If
+    set then the user job runs with the environment built without a login
+    ("su <user> env" rather than "su - <user> env").
+ -- Fix output of "srun -o %C" (allocated CPU count) for running jobs. This was
+    broken in 1.2.18 for handling requeue of Moab jobs.
+ -- Added logic to mpiexec wrapper to read in the MPIEXEC_TIMEOUT var
+ -- Updated qstat wrapper to display information for partitions (-Q) option
+ -- NOTE: SLURM should now work directly with Globus using the PBS GRAM.
+
 * Changes in SLURM 1.2.18
 =========================
  -- BLUEGENE - bug fix for smap stating passthroughs are used when they aren't
@@ -2659,4 +2707,4 @@ documents those changes that are of interest to users and admins.
  -- Change directory to /tmp in slurmd if daemonizing.
  -- Logfiles are reopened on reconfigure.
  
-$Id: NEWS 12462 2007-10-08 17:42:47Z jette $
+$Id: NEWS 12599 2007-11-01 21:19:34Z jette $
diff --git a/aclocal.m4 b/aclocal.m4
index 04f307d16..595115a0c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -18,7 +18,7 @@ you should regenerate the build system entirely.], [63])])
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
+# serial 51 Debian 1.5.24-1ubuntu1 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -181,7 +181,7 @@ test -z "$STRIP" && STRIP=:
 test -z "$ac_objext" && ac_objext=o
 
 # Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
 old_postinstall_cmds='chmod 644 $oldlib'
 old_postuninstall_cmds=
 
@@ -268,8 +268,9 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 # Check for compiler boilerplate output or warnings with
 # the simple compiler test code.
 AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -281,8 +282,9 @@ $rm conftest*
 # Check for linker boilerplate output or warnings with
 # the simple link test code.
 AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -298,12 +300,20 @@ $rm conftest*
 # If we don't find anything, use the default library path according
 # to the aix ld manual.
 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 ])# _LT_AC_SYS_LIBPATH_AIX
 
@@ -534,13 +544,17 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
+        x86_64-*kfreebsd*-gnu)
+          LD="${LD-ld} -m elf_i386_fbsd"
+          ;;
         x86_64-*linux*)
           LD="${LD-ld} -m elf_i386"
           ;;
@@ -557,6 +571,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
       ;;
     *64-bit*)
       case $host in
+        x86_64-*kfreebsd*-gnu)
+          LD="${LD-ld} -m elf_x86_64_fbsd"
+          ;;
         x86_64-*linux*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
@@ -628,7 +645,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$3"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -669,11 +686,12 @@ fi
 # ------------------------------------------------------------
 # Check whether the given compiler option works
 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
   [$2=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $3"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
      # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -787,24 +805,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     fi
     ;;
   *)
-    # If test is not a shell built-in, we'll probably end up computing a
-    # maximum length that is only half of the actual maximum length, but
-    # we can't tell.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
 	       = "XX$teststring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	    lt_cv_sys_max_cmd_len=$new_result &&
-	    test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    teststring=
-    # Add a significant safety factor because C++ compilers can tack on massive
-    # amounts of additional arguments before passing them to the linker.
-    # It appears as though 1/2 is a usable value.
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	      lt_cv_sys_max_cmd_len=$new_result &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on massive
+      # amounts of additional arguments before passing them to the linker.
+      # It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
     ;;
   esac
 ])
@@ -1031,7 +1052,8 @@ fi
 # ---------------------------------
 # Check to see if options -c and -o are simultaneously supported by compiler
 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
@@ -1039,7 +1061,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    mkdir conftest
    cd conftest
    mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    lt_compiler_flag="-o out/conftest2.$ac_objext"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -1179,6 +1201,7 @@ else
    darwin*)
        if test -n "$STRIP" ; then
          striplib="$STRIP -x"
+         old_striplib="$STRIP -S"
          AC_MSG_RESULT([yes])
        else
   AC_MSG_RESULT([no])
@@ -1196,7 +1219,8 @@ fi
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -1210,20 +1234,58 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
+m4_if($1,[],[
 if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
   else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
   fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`echo $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+fi])
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -1380,12 +1442,8 @@ darwin* | rhapsody*)
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+  m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -1439,7 +1497,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -1502,7 +1560,7 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix[[3-9]]*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -1573,7 +1631,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -1679,6 +1737,10 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -1784,7 +1846,8 @@ fi
 # _LT_AC_TAGCONFIG
 # ----------------
 AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_ARG_WITH([tags],
     [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
         [include additional configurations @<:@automatic@:>@])],
     [tagnames="$withval"])
@@ -2045,7 +2108,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
 
 # AC_PATH_TOOL_PREFIX
 # -------------------
-# find a file program which can recognise shared library
+# find a file program which can recognize shared library
 AC_DEFUN([AC_PATH_TOOL_PREFIX],
 [AC_REQUIRE([AC_PROG_EGREP])dnl
 AC_MSG_CHECKING([for $1])
@@ -2108,7 +2171,7 @@ fi
 
 # AC_PATH_MAGIC
 # -------------
-# find a file program which can recognise a shared library
+# find a file program which can recognize a shared library
 AC_DEFUN([AC_PATH_MAGIC],
 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -2255,7 +2318,7 @@ esac
 # how to check for library dependencies
 #  -- PORTME fill in with the dynamic library characteristics
 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
+[AC_CACHE_CHECK([how to recognize dependent libraries],
 lt_cv_deplibs_check_method,
 [lt_cv_file_magic_cmd='$MAGIC_CMD'
 lt_cv_file_magic_test_file=
@@ -2294,9 +2357,15 @@ cygwin*)
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
   ;;
 
 darwin* | rhapsody*)
@@ -2341,7 +2410,7 @@ hpux10.20* | hpux11*)
   esac
   ;;
 
-interix3*)
+interix[[3-9]]*)
   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
   lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
   ;;
@@ -2391,6 +2460,10 @@ osf3* | osf4* | osf5*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -2443,7 +2516,7 @@ AC_DEFUN([AC_PROG_NM],
   lt_cv_path_NM="$NM"
 else
   lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
@@ -2659,10 +2732,10 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
 
 _LT_AC_SYS_COMPILER
 
@@ -2764,10 +2837,10 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
@@ -2913,7 +2986,7 @@ case $host_os in
 	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	then
 	  # We have reworked collect2
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  :
 	else
 	  # We have old collect2
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -3072,10 +3145,10 @@ case $host_os in
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
           _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -3158,9 +3231,7 @@ case $host_os in
       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
       case $host_cpu in
-      hppa*64*|ia64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-        ;;
+      hppa*64*|ia64*) ;;
       *)
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         ;;
@@ -3228,7 +3299,7 @@ case $host_os in
 	;;
     esac
     ;;
-  interix3*)
+  interix[[3-9]]*)
     _LT_AC_TAGVAR(hardcode_direct, $1)=no
     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -3348,6 +3419,29 @@ case $host_os in
 	# dependencies.
 	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C++ 5.9
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+	  # Not sure whether something based on
+	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	  # would be better.
+	  output_verbose_link_cmd='echo'
+
+	  # Archives containing C++ object files must be created using
+	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	  # necessary to make sure instantiated templates are included
+	  # in the archive.
+	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	  ;;
+	esac
+	;;
     esac
     ;;
   lynxos*)
@@ -3386,16 +3480,20 @@ case $host_os in
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
   openbsd*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    if test -f /usr/libexec/ld.so; then
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      fi
+      output_verbose_link_cmd='echo'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
-    output_verbose_link_cmd='echo'
     ;;
   osf3*)
     case $cc_basename in
@@ -3557,15 +3655,10 @@ case $host_os in
 	case $host_os in
 	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	  *)
-	    # The C++ compiler is used as linker so we must use $wl
-	    # flag to pass the commands to the underlying system
-	    # linker. We must also pass each convience library through
-	    # to the system linker between allextract/defaultextract.
-	    # The C++ compiler will combine linker options so we
-	    # cannot just pass the convience library names through
-	    # without $wl.
+	    # The compiler driver will combine and reorder linker options,
+	    # but understands `-z linker_flag'.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	    ;;
 	esac
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3612,6 +3705,12 @@ case $host_os in
 	  fi
 
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	  case $host_os in
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	  *)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	  esac
 	fi
 	;;
     esac
@@ -3855,7 +3954,7 @@ $rm -f confest.$objext
 # PORTME: override above test on systems where it is broken
 ifelse([$1],[CXX],
 [case $host_os in
-interix3*)
+interix[[3-9]]*)
   # Interix 3.5 installs completely hosed .la files for C++, so rather than
   # hack all around it, let's just trust "g++" to DTRT.
   _LT_AC_TAGVAR(predep_objects,$1)=
@@ -3863,13 +3962,46 @@ interix3*)
   _LT_AC_TAGVAR(postdeps,$1)=
   ;;
 
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+    #
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
 solaris*)
   case $cc_basename in
   CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
     # Adding this requires a known-good setup of shared libraries for
     # Sun compiler versions before 5.6, else PIC objects from an old
     # archive will be linked into the output, leading to subtle bugs.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
     ;;
   esac
   ;;
@@ -3918,10 +4050,17 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
+lt_simple_link_test_code="\
+      program t
+      end
+"
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
@@ -4000,10 +4139,10 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
@@ -4056,7 +4195,7 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
 lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -4145,6 +4284,7 @@ if test -f "$ltmain"; then
     _LT_AC_TAGVAR(module_cmds, $1) \
     _LT_AC_TAGVAR(module_expsym_cmds, $1) \
     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
     _LT_AC_TAGVAR(exclude_expsyms, $1) \
     _LT_AC_TAGVAR(include_expsyms, $1); do
 
@@ -4191,7 +4331,7 @@ ifelse([$1], [],
 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 # Free Software Foundation, Inc.
 #
 # This file is part of GNU Libtool:
@@ -4516,7 +4656,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
@@ -4599,6 +4739,7 @@ fi
 # ---------------------------------
 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
 [AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([LT_AC_PROG_SED])
 AC_REQUIRE([AC_PROG_NM])
 AC_REQUIRE([AC_OBJEXT])
 # Check for command to grab the raw symbol name followed by C symbol from nm.
@@ -4825,12 +4966,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       # like `-m68040'.
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
       ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
-    mingw* | os2* | pw32*)
+    mingw* | cygwin* | os2* | pw32*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
       ;;
     darwin* | rhapsody*)
@@ -4842,7 +4985,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       # DJGPP does not support shared libraries at all
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
-    interix3*)
+    interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -4978,6 +5121,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    ;;
 	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
 	    ;;
 	esac
 	;;
@@ -5098,13 +5249,15 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
       ;;
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
       ;;
 
@@ -5114,7 +5267,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
-    interix3*)
+    interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -5172,7 +5325,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        esac
        ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
@@ -5224,6 +5377,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
         # All Alpha code is PIC.
         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
+      *)
+        case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	esac
+	;;
       esac
       ;;
 
@@ -5233,6 +5402,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
+    rdos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
     solaris*)
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5327,7 +5500,8 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
 # ------------------------------------
 # See if the linker supports building shared libraries.
 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 ifelse([$1],[CXX],[
   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   case $host_os in
@@ -5344,7 +5518,7 @@ ifelse([$1],[CXX],[
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
   ;;
   linux* | k*bsd*-gnu)
     _LT_AC_TAGVAR(link_all_deplibs, $1)=no
@@ -5486,7 +5660,7 @@ EOF
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_AC_TAGVAR(always_export_symbols, $1)=no
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5504,7 +5678,7 @@ EOF
       fi
       ;;
 
-    interix3*)
+    interix[[3-9]]*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -5519,7 +5693,7 @@ EOF
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    linux* | k*bsd*-gnu)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
@@ -5537,13 +5711,22 @@ EOF
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
 	esac
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	*)
+	  tmp_sharedflag='-shared' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
 	if test $supports_anon_versioning = yes; then
 	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
   $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
       else
@@ -5584,7 +5767,7 @@ EOF
 
     sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
       case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -5703,7 +5886,7 @@ _LT_EOF
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	  then
   	  # We have reworked collect2
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+  	  :
 	  else
   	  # We have old collect2
   	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5796,7 +5979,7 @@ _LT_EOF
       # The linker will automatically build a .lib file if we build a DLL.
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
       # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
       _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
@@ -5838,10 +6021,10 @@ _LT_EOF
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -6003,24 +6186,28 @@ _LT_EOF
       ;;
 
     openbsd*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      if test -f /usr/libexec/ld.so; then
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+        fi
       else
-       case $host_os in
-	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	   ;;
-	 *)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	   ;;
-       esac
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
@@ -6079,17 +6266,16 @@ _LT_EOF
       case $host_os in
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+	if test "$GCC" = yes; then
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
       esac
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
@@ -6146,7 +6332,7 @@ _LT_EOF
       fi
       ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6221,7 +6407,7 @@ x|xyes)
       # to ld, don't add -lc before -lgcc.
       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
       $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
         soname=conftest
@@ -6324,6 +6510,30 @@ AC_DEFUN([LT_AC_PROG_RC],
 [AC_CHECK_TOOL(RC, windres, no)
 ])
 
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# ----------------
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / >/dev/null 2>&1; then
+  as_executable_p='test -x'
+else
+  as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---------------
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
 # NOTE: This macro has been submitted for inclusion into   #
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
 #  a released version of Autoconf we should remove this    #
@@ -6344,12 +6554,13 @@ do
   test -z "$as_dir" && as_dir=.
   for lt_ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
       fi
     done
   done
 done
+IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6382,6 +6593,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
 done
 ])
 SED=$lt_cv_path_SED
+AC_SUBST([SED])
 AC_MSG_RESULT([$SED])
 ])
 
diff --git a/auxdir/Makefile.in b/auxdir/Makefile.in
index 1c0a2f38c..a3675c3e4 100644
--- a/auxdir/Makefile.in
+++ b/auxdir/Makefile.in
@@ -144,6 +144,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/auxdir/config.guess b/auxdir/config.guess
index 396482d6c..0f0fe712a 100755
--- a/auxdir/config.guess
+++ b/auxdir/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2006-07-02'
+timestamp='2007-03-06'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
@@ -780,7 +781,7 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
-    i*:MINGW*:*)
+    *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
     i*:windows32*:*)
@@ -790,12 +791,15 @@ EOF
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
-    x86:Interix*:[3456]*)
-	echo i586-pc-interix${UNAME_RELEASE}
-	exit ;;
-    EM64T:Interix*:[3456]*)
-	echo x86_64-unknown-interix${UNAME_RELEASE}
-	exit ;;
+    *:Interix*:[3456]*)
+    	case ${UNAME_MACHINE} in
+	    x86) 
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    EM64T | authenticamd)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
 	exit ;;
@@ -950,6 +954,9 @@ EOF
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-gnu
 	exit ;;
+    xtensa:Linux:*:*)
+    	echo xtensa-unknown-linux-gnu
+	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
@@ -1208,6 +1215,15 @@ EOF
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
 	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
 	exit ;;
diff --git a/auxdir/config.sub b/auxdir/config.sub
index fab0aa355..5defff65a 100755
--- a/auxdir/config.sub
+++ b/auxdir/config.sub
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 #   Inc.
 
-timestamp='2006-09-20'
+timestamp='2007-01-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -245,12 +245,12 @@ case $basic_machine in
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| fr30 | frv \
+	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore \
+	| maxq | mb | microblaze | mcore | mep \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -324,7 +324,7 @@ case $basic_machine in
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
@@ -925,6 +925,9 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
@@ -1219,7 +1222,7 @@ case $os in
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1414,6 +1417,9 @@ case $basic_machine in
 	m68*-cisco)
 		os=-aout
 		;;
+        mep-*)
+		os=-elf
+		;;
 	mips*-cisco)
 		os=-elf
 		;;
diff --git a/auxdir/ltmain.sh b/auxdir/ltmain.sh
index c715b5941..2160ef7b9 100644
--- a/auxdir/ltmain.sh
+++ b/auxdir/ltmain.sh
@@ -1,8 +1,8 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007  Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
 # This program is free software; you can redistribute it and/or modify
@@ -43,14 +43,22 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="1.5.22 Debian 1.5.22-4"
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
+VERSION="1.5.24 Debian 1.5.24-1ubuntu1"
+TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
@@ -105,12 +113,14 @@ esac
 # These must not be set unconditionally because not all systems understand
 # e.g. LANG=C (notably SCO).
 # We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
-  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
-  save_LANG="$LANG"; LANG=C; export LANG
-fi
+for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+	  save_$lt_var=\$$lt_var
+	  $lt_var=C
+	  export $lt_var
+	fi"
+done
 
 # Make sure IFS has a sensible default
 lt_nl='
@@ -136,6 +146,8 @@ duplicate_deps=no
 preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
 
 #####################################
 # Shell function definitions:
@@ -196,7 +208,13 @@ func_win32_libid ()
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+	$SED -n -e '1,100{
+		/ I /{
+			s,.*,import,
+			p
+			q
+			}
+		}'`
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -327,7 +345,17 @@ func_extract_archives ()
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xdir="$my_gentop/$my_xlib"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  extracted_serial=`expr $extracted_serial + 1`
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
 
       $show "${rm}r $my_xdir"
       $run ${rm}r "$my_xdir"
@@ -454,11 +482,12 @@ do
     ;;
 
   --version)
-    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-    $echo
-    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
-    $echo "This is free software; see the source for copying conditions.  There is NO"
-    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2007  Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     exit $?
     ;;
 
@@ -755,9 +784,10 @@ if test -z "$show_help"; then
     *.class) xform=class ;;
     *.cpp) xform=cpp ;;
     *.cxx) xform=cxx ;;
-    *.f90) xform=f90 ;;
+    *.[fF][09]?) xform=[fF][09]. ;;
     *.for) xform=for ;;
     *.java) xform=java ;;
+    *.obj) xform=obj ;;
     esac
 
     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -1138,8 +1168,9 @@ EOF
     for arg
     do
       case $arg in
-      -all-static | -static)
-	if test "X$arg" = "X-all-static"; then
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
 	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
 	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
 	  fi
@@ -1147,12 +1178,20 @@ EOF
 	    dlopen_self=$dlopen_self_static
 	  fi
 	  prefer_static_libs=yes
-	else
+	  ;;
+	-static)
 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
 	  prefer_static_libs=built
-	fi
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
 	build_libtool_libs=no
 	build_old_libs=yes
 	break
@@ -1600,7 +1639,7 @@ EOF
 	continue
 	;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 	compiler_flags="$compiler_flags $arg"
 	compile_command="$compile_command $arg"
 	finalize_command="$finalize_command $arg"
@@ -1620,10 +1659,11 @@ EOF
       # -m* pass through architecture-specific compiler args for GCC
       # -m*, -t[45]*, -txscale* pass through architecture-specific
       # compiler args for GCC
-      # -pg pass through profiling flag for GCC
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
       # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
-      -t[45]*|-txscale*|@*)
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
@@ -1651,9 +1691,9 @@ EOF
 
       -no-install)
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
 	  # The PATH hackery in wrapper scripts is required on Windows
-	  # in order for the loader to find any dlls it needs.
+	  # and Darwin in order for the loader to find any dlls it needs.
 	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
 	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
 	  fast_install=no
@@ -1712,7 +1752,7 @@ EOF
 	continue
 	;;
 
-      -static)
+      -static | -static-libtool-libs)
 	# The effects of -static are defined in a previous loop.
 	# We used to do the same as -all-static on platforms that
 	# didn't have a PIC flag, but the assumption that the effects
@@ -2097,7 +2137,7 @@ EOF
 	lib=
 	found=no
 	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
@@ -2493,7 +2533,9 @@ EOF
 
 	if test "$linkmode,$pass" = "prog,link"; then
 	  if test -n "$library_names" &&
-	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	     { { test "$prefer_static_libs" = no ||
+		 test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
 	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
@@ -3189,7 +3231,7 @@ EOF
 	  # which has an extra 1 added just for fun
 	  #
 	  case $version_type in
-	  darwin|linux|osf|windows)
+	  darwin|linux|osf|windows|none)
 	    current=`expr $number_major + $number_minor`
 	    age="$number_minor"
 	    revision="$number_revision"
@@ -3200,9 +3242,10 @@ EOF
 	    age="0"
 	    ;;
 	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor - 1`
+	    current=`expr $number_major + $number_minor`
 	    age="$number_minor"
 	    revision="$number_minor"
+	    lt_irix_increment=no
 	    ;;
 	  *)
 	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
@@ -3266,7 +3309,8 @@ EOF
 	  versuffix="$major.$age.$revision"
 	  # Darwin ld doesn't like 0 for these options...
 	  minor_current=`expr $current + 1`
-	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 	  ;;
 
 	freebsd-aout)
@@ -3280,8 +3324,11 @@ EOF
 	  ;;
 
 	irix | nonstopux)
-	  major=`expr $current - $age + 1`
-
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    major=`expr $current - $age`
+	  else
+	    major=`expr $current - $age + 1`
+	  fi
 	  case $version_type in
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
@@ -3418,11 +3465,11 @@ EOF
       fi
 
       # Eliminate all temporary directories.
-      for path in $notinst_path; do
-	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
-      done
+      #for path in $notinst_path; do
+      #	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+      #	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+      #	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+      #done
 
       if test -n "$xrpath"; then
 	# If the user specified any rpath flags, then add them.
@@ -3523,13 +3570,12 @@ EOF
 	  int main() { return 0; }
 EOF
 	  $rm conftest
-	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
-	  if test "$?" -eq 0 ; then
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
 	      name=`expr $i : '-l\(.*\)'`
 	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" -ne "0"; then
+              if test "$name" != "" && test "$name" != "0"; then
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
@@ -3568,9 +3614,7 @@ EOF
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
 		$rm conftest
-		$LTCC $LTCFLAGS -o conftest conftest.c $i
-		# Did it work?
-		if test "$?" -eq 0 ; then
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		    case " $predeps $postdeps " in
@@ -3602,7 +3646,7 @@ EOF
 		  droppeddeps=yes
 		  $echo
 		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** make it link in!  You will probably need to install it or some"
 		  $echo "*** library that it depends on before this library will be fully"
 		  $echo "*** functional.  Installing it before continuing would be even better."
 		fi
@@ -3888,7 +3932,10 @@ EOF
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	      case $archive_cmds in
+	      *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+	      *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+	      esac
 	    else
 	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
 	    fi
@@ -4247,12 +4294,14 @@ EOF
       reload_conv_objs=
       gentop=
       # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
       wl=
 
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
-	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 	else
 	  gentop="$output_objdir/${obj}x"
 	  generated="$generated $gentop"
@@ -4700,16 +4749,16 @@ static const void *lt_preloaded_setup() {
           case $host in
           *cygwin* | *mingw* )
             if test -f "$output_objdir/${outputname}.def" ; then
-              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
-              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
             else
-              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
              fi
             ;;
           * )
-            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
             ;;
           esac
 	  ;;
@@ -4724,13 +4773,13 @@ static const void *lt_preloaded_setup() {
 	# really was required.
 
 	# Nullify the symbol file.
-	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
       fi
 
       if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
 	# Replace the output file specification.
-	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
 	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
@@ -4817,7 +4866,7 @@ static const void *lt_preloaded_setup() {
 	if test "$fast_install" != no; then
 	  link_command="$finalize_var$compile_command$finalize_rpath"
 	  if test "$fast_install" = yes; then
-	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
 	  else
 	    # fast_install is set to needless
 	    relink_command=
@@ -4854,7 +4903,7 @@ static const void *lt_preloaded_setup() {
 	  fi
 	done
 	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
       fi
 
       # Quote $echo for shipping.
@@ -5261,6 +5310,20 @@ EOF
 Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
@@ -5403,7 +5466,7 @@ else
 	  ;;
 	esac
 	$echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      \$echo \"\$0: cannot exec \$program \$*\"
       exit $EXIT_FAILURE
     fi
   else
@@ -5589,7 +5652,7 @@ fi\
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
       if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
@@ -5934,9 +5997,9 @@ relink_command=\"$relink_command\""
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
 	  else
-	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
 	  fi
 
 	  $echo "$modename: warning: relinking \`$file'" 1>&2
@@ -6145,7 +6208,7 @@ relink_command=\"$relink_command\""
 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
-	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
 
 	      $show "$relink_command"
 	      if $run eval "$relink_command"; then :
@@ -6356,8 +6419,10 @@ relink_command=\"$relink_command\""
 	if test -f "$dir/$objdir/$dlname"; then
 	  dir="$dir/$objdir"
 	else
-	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	  exit $EXIT_FAILURE
+	  if test ! -f "$dir/$dlname"; then
+	    $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
 	fi
 	;;
 
@@ -6421,12 +6486,12 @@ relink_command=\"$relink_command\""
       fi
 
       # Restore saved environment variables
-      if test "${save_LC_ALL+set}" = set; then
-	LC_ALL="$save_LC_ALL"; export LC_ALL
-      fi
-      if test "${save_LANG+set}" = set; then
-	LANG="$save_LANG"; export LANG
-      fi
+      for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+		$lt_var=\$save_$lt_var; export $lt_var
+	      fi"
+      done
 
       # Now prepare to actually exec the command.
       exec_cmd="\$cmd$args"
@@ -6783,9 +6848,9 @@ The following components of LINK-COMMAND are treated specially:
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
-		    try to export only the symbols listed in SYMFILE
+                    try to export only the symbols listed in SYMFILE
   -export-symbols-regex REGEX
-		    try to export only the symbols matching REGEX
+                    try to export only the symbols matching REGEX
   -LLIBDIR          search LIBDIR for required installed libraries
   -lNAME            OUTPUT-FILE requires the installed library libNAME
   -module           build a library that can dlopened
@@ -6799,9 +6864,11 @@ The following components of LINK-COMMAND are treated specially:
   -release RELEASE  specify package release information
   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -static           do not do any dynamic linking of libtool libraries
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
   -version-info CURRENT[:REVISION[:AGE]]
-		    specify library version info [each variable defaults to 0]
+                    specify library version info [each variable defaults to 0]
 
 All other options (arguments beginning with \`-') are ignored.
 
diff --git a/config.h.in b/config.h.in
index f470066df..52e9ee1ba 100644
--- a/config.h.in
+++ b/config.h.in
@@ -246,6 +246,9 @@
    member named physmem. */
 #undef HAVE__SYSTEM_CONFIGURATION
 
+/* Define to 1 for --get-user-env to load user environment without login. */
+#undef LOAD_ENV_NO_LOGIN
+
 /* Define to 1 for memory leak debugging. */
 #undef MEMORY_LEAK_DEBUG
 
diff --git a/configure b/configure
index cdfe3dea8..005f7614f 100755
--- a/configure
+++ b/configure
@@ -886,6 +886,7 @@ ac_ct_CXX
 CXXDEPMODE
 am__fastdepCXX_TRUE
 am__fastdepCXX_FALSE
+SED
 LN_S
 ECHO
 AR
@@ -1563,6 +1564,9 @@ Optional Features:
   --enable-debug          enable debugging code for development
   --enable-memory-leak-debug
                           enable memory leak debugging code for development
+  --enable-load-env-no-login
+                          enable --get-user-env option to load user
+                          environment without login
   --enable-multiple-slurmd
                           enable multiple-slurmd support
 
@@ -6621,12 +6625,13 @@ do
   test -z "$as_dir" && as_dir=.
   for lt_ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+      if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
       fi
     done
   done
 done
+IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6661,6 +6666,7 @@ done
 fi
 
 SED=$lt_cv_path_SED
+
 { echo "$as_me:$LINENO: result: $SED" >&5
 echo "${ECHO_T}$SED" >&6; }
 
@@ -6860,8 +6866,8 @@ else
 echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
 if test "${lt_cv_deplibs_check_method+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6902,9 +6908,15 @@ cygwin*)
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
   ;;
 
 darwin* | rhapsody*)
@@ -6949,7 +6961,7 @@ hpux10.20* | hpux11*)
   esac
   ;;
 
-interix3*)
+interix[3-9]*)
   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
   lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
   ;;
@@ -6999,6 +7011,10 @@ osf3* | osf4* | osf5*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -7085,7 +7101,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 7088 "configure"' > conftest.$ac_ext
+  echo '#line 7104 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7120,7 +7136,8 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -7131,6 +7148,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
     case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
+        x86_64-*kfreebsd*-gnu)
+          LD="${LD-ld} -m elf_i386_fbsd"
+          ;;
         x86_64-*linux*)
           LD="${LD-ld} -m elf_i386"
           ;;
@@ -7147,6 +7167,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
       ;;
     *64-bit*)
       case $host in
+        x86_64-*kfreebsd*-gnu)
+          LD="${LD-ld} -m elf_x86_64_fbsd"
+          ;;
         x86_64-*linux*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
@@ -7988,24 +8011,27 @@ else
     fi
     ;;
   *)
-    # If test is not a shell built-in, we'll probably end up computing a
-    # maximum length that is only half of the actual maximum length, but
-    # we can't tell.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
 	       = "XX$teststring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	    lt_cv_sys_max_cmd_len=$new_result &&
-	    test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    teststring=
-    # Add a significant safety factor because C++ compilers can tack on massive
-    # amounts of additional arguments before passing them to the linker.
-    # It appears as though 1/2 is a usable value.
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	      lt_cv_sys_max_cmd_len=$new_result &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on massive
+      # amounts of additional arguments before passing them to the linker.
+      # It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
     ;;
   esac
 
@@ -8022,6 +8048,7 @@ fi
 
 
 
+
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
@@ -8610,7 +8637,7 @@ test -z "$STRIP" && STRIP=:
 test -z "$ac_objext" && ac_objext=o
 
 # Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
 old_postinstall_cmds='chmod 644 $oldlib'
 old_postuninstall_cmds=
 
@@ -8810,10 +8837,10 @@ objext=o
 objext=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
 
 
 # If no C compiler was specified, use CC.
@@ -8828,13 +8855,13 @@ compiler=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -8854,7 +8881,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
 else
   lt_cv_prog_compiler_rtti_exceptions=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="-fno-rtti -fno-exceptions"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -8865,11 +8892,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8868: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8895: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8872: \$? = $ac_status" >&5
+   echo "$as_me:8899: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8920,13 +8947,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
       ;;
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
       ;;
 
@@ -8936,7 +8965,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic='-fno-common'
       ;;
 
-    interix3*)
+    interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -8994,7 +9023,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
        esac
        ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -9046,6 +9075,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static='-non_shared'
         ;;
+      *)
+        case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	esac
+	;;
       esac
       ;;
 
@@ -9055,6 +9100,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
     solaris*)
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
@@ -9122,7 +9171,7 @@ if test "${lt_prog_compiler_pic_works+set}" = set; then
 else
   lt_prog_compiler_pic_works=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -9133,11 +9182,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9136: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9185: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9140: \$? = $ac_status" >&5
+   echo "$as_me:9189: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9186,7 +9235,7 @@ else
   lt_prog_compiler_static_works=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
      # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -9226,7 +9275,7 @@ else
    mkdir conftest
    cd conftest
    mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    lt_compiler_flag="-o out/conftest2.$ac_objext"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -9237,11 +9286,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9240: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9289: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9244: \$? = $ac_status" >&5
+   echo "$as_me:9293: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9433,7 +9482,7 @@ EOF
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -9451,7 +9500,7 @@ EOF
       fi
       ;;
 
-    interix3*)
+    interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -9466,7 +9515,7 @@ EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    linux* | k*bsd*-gnu)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
@@ -9484,13 +9533,22 @@ EOF
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
 	esac
-	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	*)
+	  tmp_sharedflag='-shared' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
 	if test $supports_anon_versioning = yes; then
 	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
   $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
 	link_all_deplibs=no
       else
@@ -9650,7 +9708,7 @@ _LT_EOF
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	  then
   	  # We have reworked collect2
-  	  hardcode_direct=yes
+  	  :
 	  else
   	  # We have old collect2
   	  hardcode_direct=unsupported
@@ -9724,11 +9782,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -9783,11 +9848,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -9841,7 +9913,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # The linker will automatically build a .lib file if we build a DLL.
       old_archive_From_new_cmds='true'
       # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
       fix_srcfile_path='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes=yes
       ;;
@@ -9883,10 +9955,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
          module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -10048,24 +10120,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     openbsd*)
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec='${wl}-E'
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+        fi
       else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	   ;;
-       esac
+	ld_shlibs=no
       fi
       ;;
 
@@ -10124,17 +10200,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
       esac
       link_all_deplibs=yes
       ;;
@@ -10191,7 +10266,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
       no_undefined_flag='${wl}-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
@@ -10268,7 +10343,7 @@ x|xyes)
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -10326,17 +10401,55 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
 if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
   else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
   fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`echo $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
@@ -10496,12 +10609,8 @@ darwin* | rhapsody*)
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -10555,7 +10664,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -10618,7 +10727,7 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix[3-9]*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -10689,7 +10798,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -10795,6 +10904,10 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -10948,6 +11061,7 @@ else
    darwin*)
        if test -n "$STRIP" ; then
          striplib="$STRIP -x"
+         old_striplib="$STRIP -S"
          { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
        else
@@ -11534,7 +11648,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11537 "configure"
+#line 11651 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11634,7 +11748,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11637 "configure"
+#line 11751 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11832,6 +11946,7 @@ if test -f "$ltmain"; then
     module_cmds \
     module_expsym_cmds \
     lt_cv_prog_compiler_c_o \
+    fix_srcfile_path \
     exclude_expsyms \
     include_expsyms; do
 
@@ -11876,7 +11991,7 @@ echo "$as_me: creating $ofile" >&6;}
 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 # Free Software Foundation, Inc.
 #
 # This file is part of GNU Libtool:
@@ -12200,7 +12315,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$always_export_symbols
@@ -12369,10 +12484,10 @@ objext=o
 objext_CXX=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -12388,13 +12503,13 @@ compiler=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -12653,7 +12768,7 @@ case $host_os in
 	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	then
 	  # We have reworked collect2
-	  hardcode_direct_CXX=yes
+	  :
 	else
 	  # We have old collect2
 	  hardcode_direct_CXX=unsupported
@@ -12727,11 +12842,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -12787,11 +12909,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -12910,10 +13039,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
           module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -12996,9 +13125,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_libdir_separator_CXX=:
 
       case $host_cpu in
-      hppa*64*|ia64*)
-	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
-        ;;
+      hppa*64*|ia64*) ;;
       *)
 	export_dynamic_flag_spec_CXX='${wl}-E'
         ;;
@@ -13066,7 +13193,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	;;
     esac
     ;;
-  interix3*)
+  interix[3-9]*)
     hardcode_direct_CXX=no
     hardcode_shlibpath_var_CXX=no
     hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
@@ -13186,6 +13313,29 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# dependencies.
 	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C++ 5.9
+	  no_undefined_flag_CXX=' -zdefs'
+	  archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+	  # Not sure whether something based on
+	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	  # would be better.
+	  output_verbose_link_cmd='echo'
+
+	  # Archives containing C++ object files must be created using
+	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	  # necessary to make sure instantiated templates are included
+	  # in the archive.
+	  old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	  ;;
+	esac
+	;;
     esac
     ;;
   lynxos*)
@@ -13224,16 +13374,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     ld_shlibs_CXX=no
     ;;
   openbsd*)
-    hardcode_direct_CXX=yes
-    hardcode_shlibpath_var_CXX=no
-    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      export_dynamic_flag_spec_CXX='${wl}-E'
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    if test -f /usr/libexec/ld.so; then
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	export_dynamic_flag_spec_CXX='${wl}-E'
+	whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      fi
+      output_verbose_link_cmd='echo'
+    else
+      ld_shlibs_CXX=no
     fi
-    output_verbose_link_cmd='echo'
     ;;
   osf3*)
     case $cc_basename in
@@ -13395,15 +13549,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	case $host_os in
 	  solaris2.[0-5] | solaris2.[0-5].*) ;;
 	  *)
-	    # The C++ compiler is used as linker so we must use $wl
-	    # flag to pass the commands to the underlying system
-	    # linker. We must also pass each convience library through
-	    # to the system linker between allextract/defaultextract.
-	    # The C++ compiler will combine linker options so we
-	    # cannot just pass the convience library names through
-	    # without $wl.
+	    # The compiler driver will combine and reorder linker options,
+	    # but understands `-z linker_flag'.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
 	    ;;
 	esac
 	link_all_deplibs_CXX=yes
@@ -13450,6 +13599,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  fi
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	  case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	  esac
 	fi
 	;;
     esac
@@ -13641,7 +13796,7 @@ $rm -f confest.$objext
 
 # PORTME: override above test on systems where it is broken
 case $host_os in
-interix3*)
+interix[3-9]*)
   # Interix 3.5 installs completely hosed .la files for C++, so rather than
   # hack all around it, let's just trust "g++" to DTRT.
   predep_objects_CXX=
@@ -13649,13 +13804,46 @@ interix3*)
   postdeps_CXX=
   ;;
 
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+    #
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
 solaris*)
   case $cc_basename in
   CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
     # Adding this requires a known-good setup of shared libraries for
     # Sun compiler versions before 5.6, else PIC objects from an old
     # archive will be linked into the output, leading to subtle bugs.
-    postdeps_CXX='-lCstd -lCrun'
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
     ;;
   esac
   ;;
@@ -13692,12 +13880,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       # like `-m68040'.
       lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
       ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
-    mingw* | os2* | pw32*)
+    mingw* | cygwin* | os2* | pw32*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
       ;;
     darwin* | rhapsody*)
@@ -13709,7 +13899,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       # DJGPP does not support shared libraries at all
       lt_prog_compiler_pic_CXX=
       ;;
-    interix3*)
+    interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -13845,6 +14035,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    ;;
 	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
 	    ;;
 	esac
 	;;
@@ -13959,7 +14157,7 @@ if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
 else
   lt_prog_compiler_pic_works_CXX=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -13970,11 +14168,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13973: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14171: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13977: \$? = $ac_status" >&5
+   echo "$as_me:14175: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14023,7 +14221,7 @@ else
   lt_prog_compiler_static_works_CXX=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
      # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -14063,7 +14261,7 @@ else
    mkdir conftest
    cd conftest
    mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    lt_compiler_flag="-o out/conftest2.$ac_objext"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -14074,11 +14272,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14077: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14275: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14081: \$? = $ac_status" >&5
+   echo "$as_me:14279: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14144,7 +14342,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
   ;;
   linux* | k*bsd*-gnu)
     link_all_deplibs_CXX=no
@@ -14178,7 +14376,7 @@ x|xyes)
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -14236,20 +14434,7 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -14406,12 +14591,7 @@ darwin* | rhapsody*)
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -14465,7 +14645,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -14528,7 +14708,7 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix[3-9]*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -14599,7 +14779,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -14705,6 +14885,10 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -14899,6 +15083,7 @@ if test -f "$ltmain"; then
     module_cmds_CXX \
     module_expsym_cmds_CXX \
     lt_cv_prog_compiler_c_o_CXX \
+    fix_srcfile_path_CXX \
     exclude_expsyms_CXX \
     include_expsyms_CXX; do
 
@@ -15219,7 +15404,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$always_export_symbols_CXX
@@ -15310,10 +15495,17 @@ objext=o
 objext_F77=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
+lt_simple_link_test_code="\
+      program t
+      end
+"
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -15329,13 +15521,13 @@ compiler=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -15422,13 +15614,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
       ;;
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       lt_prog_compiler_pic_F77='-DDLL_EXPORT'
       ;;
 
@@ -15438,7 +15632,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic_F77='-fno-common'
       ;;
 
-    interix3*)
+    interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -15496,7 +15690,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
        esac
        ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic_F77='-DDLL_EXPORT'
@@ -15548,6 +15742,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static_F77='-non_shared'
         ;;
+      *)
+        case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77=''
+	  ;;
+	esac
+	;;
       esac
       ;;
 
@@ -15557,6 +15767,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_static_F77='-non_shared'
       ;;
 
+    rdos*)
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
     solaris*)
       lt_prog_compiler_pic_F77='-KPIC'
       lt_prog_compiler_static_F77='-Bstatic'
@@ -15624,7 +15838,7 @@ if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
 else
   lt_prog_compiler_pic_works_F77=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic_F77"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -15635,11 +15849,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15638: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15852: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15642: \$? = $ac_status" >&5
+   echo "$as_me:15856: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15688,7 +15902,7 @@ else
   lt_prog_compiler_static_works_F77=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
      # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15728,7 +15942,7 @@ else
    mkdir conftest
    cd conftest
    mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    lt_compiler_flag="-o out/conftest2.$ac_objext"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -15739,11 +15953,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15742: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15956: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15746: \$? = $ac_status" >&5
+   echo "$as_me:15960: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15935,7 +16149,7 @@ EOF
       allow_undefined_flag_F77=unsupported
       always_export_symbols_F77=no
       enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -15953,7 +16167,7 @@ EOF
       fi
       ;;
 
-    interix3*)
+    interix[3-9]*)
       hardcode_direct_F77=no
       hardcode_shlibpath_var_F77=no
       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
@@ -15968,7 +16182,7 @@ EOF
       archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    linux* | k*bsd*-gnu)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
@@ -15986,13 +16200,22 @@ EOF
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
 	esac
-	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	*)
+	  tmp_sharedflag='-shared' ;;
+	esac
+	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
 	if test $supports_anon_versioning = yes; then
 	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
   $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
 	link_all_deplibs_F77=no
       else
@@ -16152,7 +16375,7 @@ _LT_EOF
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	  then
   	  # We have reworked collect2
-  	  hardcode_direct_F77=yes
+  	  :
 	  else
   	  # We have old collect2
   	  hardcode_direct_F77=unsupported
@@ -16216,11 +16439,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -16265,11 +16495,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -16323,7 +16560,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # The linker will automatically build a .lib file if we build a DLL.
       old_archive_From_new_cmds_F77='true'
       # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
       fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_F77=yes
       ;;
@@ -16365,10 +16602,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
          module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -16530,24 +16767,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     openbsd*)
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_F77='${wl}-E'
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_F77=yes
+	hardcode_shlibpath_var_F77=no
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec_F77='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec_F77='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+        fi
       else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec_F77='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	   ;;
-       esac
+	ld_shlibs_F77=no
       fi
       ;;
 
@@ -16606,17 +16847,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+	fi
+	;;
       esac
       link_all_deplibs_F77=yes
       ;;
@@ -16673,7 +16913,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
       no_undefined_flag_F77='${wl}-z,text'
       archive_cmds_need_lc_F77=no
       hardcode_shlibpath_var_F77=no
@@ -16750,7 +16990,7 @@ x|xyes)
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -16808,20 +17048,7 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -16978,12 +17205,7 @@ darwin* | rhapsody*)
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -17037,7 +17259,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -17100,7 +17322,7 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix[3-9]*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -17171,7 +17393,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -17277,6 +17499,10 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -17471,6 +17697,7 @@ if test -f "$ltmain"; then
     module_cmds_F77 \
     module_expsym_cmds_F77 \
     lt_cv_prog_compiler_c_o_F77 \
+    fix_srcfile_path_F77 \
     exclude_expsyms_F77 \
     include_expsyms_F77; do
 
@@ -17791,7 +18018,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$always_export_symbols_F77
@@ -17849,10 +18076,10 @@ objext=o
 objext_GCJ=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -17868,13 +18095,13 @@ compiler=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -17915,7 +18142,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
 else
   lt_cv_prog_compiler_rtti_exceptions=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="-fno-rtti -fno-exceptions"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -17926,11 +18153,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17929: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18156: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17933: \$? = $ac_status" >&5
+   echo "$as_me:18160: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17981,13 +18208,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
       ;;
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
       lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
       ;;
 
@@ -17997,7 +18226,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic_GCJ='-fno-common'
       ;;
 
-    interix3*)
+    interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -18055,7 +18284,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
        esac
        ;;
 
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
@@ -18107,6 +18336,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static_GCJ='-non_shared'
         ;;
+      *)
+        case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_GCJ='-KPIC'
+	  lt_prog_compiler_static_GCJ='-Bstatic'
+	  lt_prog_compiler_wl_GCJ='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_GCJ='-KPIC'
+	  lt_prog_compiler_static_GCJ='-Bstatic'
+	  lt_prog_compiler_wl_GCJ=''
+	  ;;
+	esac
+	;;
       esac
       ;;
 
@@ -18116,6 +18361,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_static_GCJ='-non_shared'
       ;;
 
+    rdos*)
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
     solaris*)
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -18183,7 +18432,7 @@ if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
 else
   lt_prog_compiler_pic_works_GCJ=no
   ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
@@ -18194,11 +18443,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18197: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18446: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18201: \$? = $ac_status" >&5
+   echo "$as_me:18450: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18247,7 +18496,7 @@ else
   lt_prog_compiler_static_works_GCJ=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
      # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -18287,7 +18536,7 @@ else
    mkdir conftest
    cd conftest
    mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    lt_compiler_flag="-o out/conftest2.$ac_objext"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -18298,11 +18547,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18301: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18550: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18305: \$? = $ac_status" >&5
+   echo "$as_me:18554: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18494,7 +18743,7 @@ EOF
       allow_undefined_flag_GCJ=unsupported
       always_export_symbols_GCJ=no
       enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -18512,7 +18761,7 @@ EOF
       fi
       ;;
 
-    interix3*)
+    interix[3-9]*)
       hardcode_direct_GCJ=no
       hardcode_shlibpath_var_GCJ=no
       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
@@ -18527,7 +18776,7 @@ EOF
       archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    linux* | k*bsd*-gnu)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
@@ -18545,13 +18794,22 @@ EOF
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
 	esac
-	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	*)
+	  tmp_sharedflag='-shared' ;;
+	esac
+	archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
 	if test $supports_anon_versioning = yes; then
 	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
   $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	fi
 	link_all_deplibs_GCJ=no
       else
@@ -18711,7 +18969,7 @@ _LT_EOF
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
 	  then
   	  # We have reworked collect2
-  	  hardcode_direct_GCJ=yes
+  	  :
 	  else
   	  # We have old collect2
   	  hardcode_direct_GCJ=unsupported
@@ -18785,11 +19043,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -18844,11 +19109,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -18902,7 +19174,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # The linker will automatically build a .lib file if we build a DLL.
       old_archive_From_new_cmds_GCJ='true'
       # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
       fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
@@ -18944,10 +19216,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $cc_basename in
         xlc*)
          output_verbose_link_cmd='echo'
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
          module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
        *)
@@ -19109,24 +19381,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     openbsd*)
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_GCJ='${wl}-E'
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_GCJ=yes
+	hardcode_shlibpath_var_GCJ=no
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+        fi
       else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	   ;;
-       esac
+	ld_shlibs_GCJ=no
       fi
       ;;
 
@@ -19185,17 +19461,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
+	fi
+	;;
       esac
       link_all_deplibs_GCJ=yes
       ;;
@@ -19252,7 +19527,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
       no_undefined_flag_GCJ='${wl}-z,text'
       archive_cmds_need_lc_GCJ=no
       hardcode_shlibpath_var_GCJ=no
@@ -19329,7 +19604,7 @@ x|xyes)
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
@@ -19387,20 +19662,7 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -19557,12 +19819,7 @@ darwin* | rhapsody*)
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -19616,7 +19873,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -19679,7 +19936,7 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix[3-9]*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -19750,7 +20007,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -19856,6 +20113,10 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -20050,6 +20311,7 @@ if test -f "$ltmain"; then
     module_cmds_GCJ \
     module_expsym_cmds_GCJ \
     lt_cv_prog_compiler_c_o_GCJ \
+    fix_srcfile_path_GCJ \
     exclude_expsyms_GCJ \
     include_expsyms_GCJ; do
 
@@ -20370,7 +20632,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$always_export_symbols_GCJ
@@ -20427,7 +20689,7 @@ objext=o
 objext_RC=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
 lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -20446,13 +20708,13 @@ compiler=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 
 ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
@@ -20530,6 +20792,7 @@ if test -f "$ltmain"; then
     module_cmds_RC \
     module_expsym_cmds_RC \
     lt_cv_prog_compiler_c_o_RC \
+    fix_srcfile_path_RC \
     exclude_expsyms_RC \
     include_expsyms_RC; do
 
@@ -20850,7 +21113,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
+fix_srcfile_path=$lt_fix_srcfile_path
 
 # Set to yes if exported symbols are required.
 always_export_symbols=$always_export_symbols_RC
@@ -25765,6 +26028,31 @@ fi
 
 
 
+{ echo "$as_me:$LINENO: checking if user env vars should be based upon login" >&5
+echo $ECHO_N "checking if user env vars should be based upon login... $ECHO_C" >&6; }
+# Check whether --enable-load-env-no-login was given.
+if test "${enable_load_env_no_login+set}" = set; then
+  enableval=$enable_load_env_no_login;  case "$enableval" in
+     yes) x_ac_load_env_no_login=yes ;;
+      no) x_ac_load_env_no_login=no ;;
+       *) { echo "$as_me:$LINENO: result: doh!" >&5
+echo "${ECHO_T}doh!" >&6; }
+          { { echo "$as_me:$LINENO: error: bad value \"$enableval\" for --enable-load-env-no-login" >&5
+echo "$as_me: error: bad value \"$enableval\" for --enable-load-env-no-login" >&2;}
+   { (exit 1); exit 1; }; } ;;
+   esac
+
+
+fi
+
+if test "$x_ac_load_env_no_login" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LOAD_ENV_NO_LOGIN 1
+_ACEOF
+
+fi
+
 { echo "$as_me:$LINENO: checking whether to enable multiple-slurmd support" >&5
 echo $ECHO_N "checking whether to enable multiple-slurmd support... $ECHO_C" >&6; }
 # Check whether --enable-multiple-slurmd was given.
@@ -26913,6 +27201,7 @@ ac_ct_CXX!$ac_ct_CXX$ac_delim
 CXXDEPMODE!$CXXDEPMODE$ac_delim
 am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
 am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+SED!$SED$ac_delim
 LN_S!$LN_S$ac_delim
 ECHO!$ECHO$ac_delim
 AR!$AR$ac_delim
@@ -26981,7 +27270,7 @@ WITH_AUTHD_FALSE!$WITH_AUTHD_FALSE$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index 78b32f936..0ab97b818 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac 12088 2007-08-22 18:02:24Z jette $
+# $Id: configure.ac 12592 2007-10-31 21:12:49Z jette $
 # This file is to be processed with autoconf to generate a configure script
 
 dnl Prologue
@@ -194,6 +194,27 @@ dnl Check for compilation of SLURM auth modules:
 dnl
 X_AC_MUNGE
 
+dnl Check if srun --get-user-env (for Moab) should load user's environment 
+dnl based upon a login. This may be temporary.
+dnl
+AC_MSG_CHECKING([if user env vars should be based upon login])
+AC_ARG_ENABLE(
+  [load-env-no-login],
+  AS_HELP_STRING(--enable-load-env-no-login,
+                 [enable --get-user-env option to load user environment without login]),
+  [ case "$enableval" in
+     yes) x_ac_load_env_no_login=yes ;;
+      no) x_ac_load_env_no_login=no ;;
+       *) AC_MSG_RESULT([doh!])
+          AC_MSG_ERROR([bad value "$enableval" for --enable-load-env-no-login]) ;;
+   esac
+  ]
+)
+if test "$x_ac_load_env_no_login" = yes; then
+  AC_DEFINE(LOAD_ENV_NO_LOGIN, 1, 
+            [Define to 1 for --get-user-env to load user environment without login.])
+fi
+
 dnl
 dnl Check if multiple-slurmd support is requested and define MULTIPLE_SLURMD
 dnl if it is.
diff --git a/contribs/Makefile.am b/contribs/Makefile.am
index 7e6b666ba..bd2f2097f 100644
--- a/contribs/Makefile.am
+++ b/contribs/Makefile.am
@@ -1,6 +1,7 @@
 SUBDIRS = perlapi torque
 
 EXTRA_DIST = \
+	env_cache_builder.c	\
 	make.slurm.patch	\
 	mpich1.slurm.patch	\
 	ptrace.patch		\
diff --git a/contribs/Makefile.in b/contribs/Makefile.in
index 88e882fad..60186dd79 100644
--- a/contribs/Makefile.in
+++ b/contribs/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
@@ -233,6 +234,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = perlapi torque
 EXTRA_DIST = \
+	env_cache_builder.c	\
 	make.slurm.patch	\
 	mpich1.slurm.patch	\
 	ptrace.patch		\
diff --git a/contribs/README b/contribs/README
index ad9792738..c9792f45d 100644
--- a/contribs/README
+++ b/contribs/README
@@ -7,6 +7,13 @@ Subdirectories contain the source-code for the various contributations for
 SLURM as their documentation. A quick description of the subdirectories
 of the SLURM contribs distribution follows:
 
+  env_cache_builder.c [C program]
+     This program will build an environment variable cache file for specific 
+     users or all users on the system. This can be used to prevent the aborting 
+     of jobs submitted by Moab using the srun/sbatch --get-user-env option.
+     Build with "make -f /dev/null env_cache_builder" and execute as user root
+     on the node where the moab daemon runs.
+
   perlapi/           [ Perl API to SLURM source ]
      API to SLURM using perl.  Making available all SLURM command that exist
      in the SLURM proper API.
diff --git a/contribs/env_cache_builder.c b/contribs/env_cache_builder.c
new file mode 100644
index 000000000..5bcd9149c
--- /dev/null
+++ b/contribs/env_cache_builder.c
@@ -0,0 +1,359 @@
+/*****************************************************************************\
+ *  This program is used to build an environment variable cache file for use
+ *  with the srun/sbatch --get-user-env option, which is used by Moab to launch
+ *  user jobs. srun/sbatch will first attempt to load the user's current 
+ *  environment by executing "su - <user> -c env". If that fails to complete
+ *  in a relatively short period of time (currently 8 seconds), srun/sbatch
+ *  will attempt to load the user's environment from a cache file located 
+ *  in the directory StateSaveLocation with a name of the sort "env_<user>".
+ *  If that fails, then abort the job request.
+ *
+ *  This program can accept a space delimited list of individual users to have
+ *  cache files created (e.g. "cache_build alice bob chuck"). If no argument
+ *  is given, cache files will be created for all users.
+ *
+ *  This program must execute as user root. 
+ *****************************************************************************
+ *  Copyright (C) 2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Morris Jette <jette1@llnl.gov>.
+ *  UCRL-CODE-226842.
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+#include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define DEBUG 0
+#define SU_WAIT_MSEC 8000
+
+static long int	_build_cache(char *user_name, char *cache_dir);
+static int	_get_cache_dir(char *buffer, int buf_size);
+static void	_parse_line(char *in_line, char **user_name, int *user_id);
+
+main (int argc, char **argv)
+{
+	FILE *passwd_fd;
+	char cache_dir[256], in_line[256], *user_name;
+	int i, user_id;
+	long int delta_t;
+
+	if (geteuid() != (uid_t)0) {
+		printf("Need to run as user root\n");
+		exit(1);
+	}
+
+	if (_get_cache_dir(cache_dir, sizeof(cache_dir)))
+		exit(1);
+	strncat(cache_dir, "/env_cache", sizeof(cache_dir));
+	if (mkdir(cache_dir, 0500) && (errno != EEXIST)) {
+		printf("Could not create cache directory %s: %s", cache_dir,
+			strerror(errno));
+		exit(1);
+	}
+#if DEBUG
+	printf("cache_dir=%s\n", cache_dir);
+#endif
+
+	for (i=1; i<argc; i++) {
+		delta_t = _build_cache(argv[i], cache_dir);
+#if DEBUG
+		printf("user %-8s time %ld usec\n", argv[i], delta_t);
+#endif
+	}
+	if (i > 1)
+		exit(0);
+
+	passwd_fd = fopen("/etc/passwd", "r");
+	if (!passwd_fd) {
+		perror("fopen(/etc/passwd)");
+		exit(1);
+	}
+
+	while (fgets(in_line, sizeof(in_line), passwd_fd)) {
+		_parse_line(in_line, &user_name, &user_id);
+		if (user_id <= 100)
+			continue;
+		delta_t = _build_cache(user_name, cache_dir);
+#if DEBUG
+		if (delta_t < ((SU_WAIT_MSEC * 0.8) * 1000))
+			continue;
+		printf("user %-8s time %ld usec\n", user_name, delta_t);
+#endif
+	}
+	fclose(passwd_fd);
+}
+
+/* Given a line from /etc/passwd, return the user_name and user_id */
+static void _parse_line(char *in_line, char **user_name, int *user_id)
+{
+	char *tok;
+
+	*user_name = strtok(in_line, ":");
+	(void) strtok(NULL, ":");
+	tok = strtok(NULL, ":");
+	if (tok)
+		*user_id = atoi(tok);
+	else {
+		printf("error parsing /etc/passwd: %s\n", in_line);
+		*user_id = 0;
+	}
+}
+
+/* For a given user_name, get his environment variable by executing
+ * "su - <user_name> -c env" and store the result in 
+ * cache_dir/env_<user_name>
+ * Returns time to perform the operation in usec
+ */
+static long int _build_cache(char *user_name, char *cache_dir)
+{
+	FILE *su, *cache;
+	char line[BUFSIZ], name[BUFSIZ], value[BUFSIZ], out_file[BUFSIZ];
+	char *starttoken = "XXXXSLURMSTARTPARSINGHEREXXXX";
+	char *stoptoken  = "XXXXSLURMSTOPPARSINGHEREXXXXX";
+	int fildes[2], found, fval, len, rc, timeleft;
+	pid_t child;
+	struct timeval begin, now;
+	struct pollfd ufds;
+	long int delta_t;
+
+	if (pipe(fildes) < 0) {
+		perror("pipe");
+		return -1;
+	}
+
+	child = fork();
+	if (child == -1) {
+		perror("fork");
+		return -1;
+	}
+	if (child == 0) {
+		close(0);
+		open("/dev/null", O_RDONLY);
+		dup2(fildes[1], 1);
+		close(2);
+		open("/dev/null", O_WRONLY);
+		snprintf(line, sizeof(line),
+			 "echo; echo; echo; echo %s; env; echo %s",
+			 starttoken, stoptoken);
+#ifdef LOAD_ENV_NO_LOGIN
+		execl("/bin/su", "su", user_name, "-c", line, NULL);
+#else
+		execl("/bin/su", "su", "-", user_name, "-c", line, NULL);
+#endif
+		exit(1);
+	}
+
+	close(fildes[1]);
+	if ((fval = fcntl(fildes[0], F_GETFL, 0)) >= 0)
+		fcntl(fildes[0], F_SETFL, fval | O_NONBLOCK);
+	su = fdopen(fildes[0], "r");
+
+	gettimeofday(&begin, NULL);
+	ufds.fd = fildes[0];
+	ufds.events = POLLIN;
+
+	/* First look for the start token in the output */
+	len = strlen(starttoken);
+	found = 0;
+	while (!found) {
+		gettimeofday(&now, NULL);
+		timeleft = SU_WAIT_MSEC * 10;
+		timeleft -= (now.tv_sec -  begin.tv_sec)  * 1000;
+		timeleft -= (now.tv_usec - begin.tv_usec) / 1000;
+		if (timeleft <= 0) {
+#if DEBUG
+			printf("timeout1\n");
+#endif
+			break;
+		}
+		if ((rc = poll(&ufds, 1, timeleft)) <= 0) {
+			if (rc == 0) {
+#if DEBUG
+				printf("timeout2\n");
+#endif
+				break;
+			}
+			if ((errno == EINTR) || (errno == EAGAIN))
+				continue;
+			perror("poll");
+			break;
+		}
+		if (!(ufds.revents & POLLIN)) {
+			perror("POLLERR|POLLHUP");
+			break;
+		}
+		while (fgets(line, BUFSIZ, su)) {
+			if (!strncmp(line, starttoken, len)) {
+				found = 1;
+				break;
+			}
+		}
+	}
+	if (!found) {
+		printf("Failed to get current user environment variables "
+			"for %s\n", user_name);
+		close(fildes[0]);
+		gettimeofday(&now, NULL);
+		delta_t  = now.tv_sec -  begin.tv_sec * 1000000;
+		delta_t += now.tv_usec - begin.tv_usec;
+		if (delta_t < (SU_WAIT_MSEC * 1000))
+			return (SU_WAIT_MSEC * 1000);
+		return delta_t;
+	}
+
+	snprintf(out_file, sizeof(out_file), "%s/%s", cache_dir, user_name);
+	cache = fopen(out_file, "w");
+	if (!cache) {
+		printf("Could not create cache file %s: %s\n", out_file, 
+			strerror(errno));
+	}
+
+	len = strlen(stoptoken);
+	found = 0;
+	while (!found && cache) {
+		gettimeofday(&now, NULL);
+		timeleft = SU_WAIT_MSEC * 10;
+		timeleft -= (now.tv_sec -  begin.tv_sec)  * 1000;
+		timeleft -= (now.tv_usec - begin.tv_usec) / 1000;
+		if (timeleft <= 0) {
+#if DEBUG
+			printf("timeout3\n");
+#endif
+			break;
+		}
+		if ((rc = poll(&ufds, 1, timeleft)) <= 0) {
+			if (rc == 0) {
+#if DEBUG
+				printf("timeout4\n");
+#endif
+				break;
+			}
+			if ((errno == EINTR) || (errno == EAGAIN))
+				continue;
+			perror("poll");
+			break;
+		}
+		if (!(ufds.revents & POLLIN)) {
+			perror("POLLERR|POLLHUP");
+			break;
+		}
+		/* stop at the line containing the stoptoken string */
+		if ((fgets(line, BUFSIZ, su) == 0) ||
+		    (!strncmp(line, stoptoken, len))) {
+			found = 1;
+			break;
+		}
+
+		if (fputs(line, cache) == EOF) {
+			printf("Could not write cache file %s: %s\n", 
+				out_file, strerror(errno));
+			found = 1;	/* quit now */
+		}
+	}
+	close(fildes[0]);
+	if (cache)
+		fclose(cache);
+	waitpid(-1, NULL, WNOHANG);
+
+	gettimeofday(&now, NULL);
+	delta_t  = (now.tv_sec  - begin.tv_sec)  * 1000000;
+	delta_t +=  now.tv_usec - begin.tv_usec;
+	if (!found) {
+		printf("Failed to get current user environment variables "
+			"for %s\n", user_name);
+		if (delta_t < (SU_WAIT_MSEC * 1000))
+			return (SU_WAIT_MSEC * 1000);
+	}
+	return delta_t;
+}
+
+/* Get configured StateSaveLocation. 
+ * User environment variable caches get created there.
+ * Returns 0 on success, -1 on error. */
+static int _get_cache_dir(char *buffer, int buf_size)
+{
+	FILE *scontrol;
+	int fildes[2];
+	pid_t child, fval;
+	char line[BUFSIZ], *fname;
+
+	if (pipe(fildes) < 0) {
+		perror("pipe");
+		return -1;
+	}
+
+	child = fork();
+	if (child == -1) {
+		perror("fork");
+		return -1;
+	}
+	if (child == 0) {
+		close(0);
+		open("/dev/null", O_RDONLY);
+		dup2(fildes[1], 1);
+		close(2);
+		open("/dev/null", O_WRONLY);
+		execlp("scontrol", "scontrol", "show", "config", NULL);
+		perror("execl(scontrol)");
+		return -1;
+	}
+
+	close(fildes[1]);
+	scontrol = fdopen(fildes[0], "r");
+
+	buffer[0] = '\0';
+	while (fgets(line, BUFSIZ, scontrol)) {
+		if (strncmp(line, "StateSaveLocation", 17))
+			continue;
+		fname = strchr(line, '\n');
+		if (fname)
+			fname[0] = '\0';
+		fname = strchr(line, '/');
+		if (fname)
+			strncpy(buffer, fname, buf_size);
+		break;
+	}
+	close(fildes[0]);
+	if (!buffer[0]) {
+		printf("Failed to get StateSaveLocation\n");
+		close(fildes[0]);
+		return -1;
+	}
+
+	waitpid(-1, NULL, WNOHANG);
+	return 0;
+}
diff --git a/contribs/perlapi/Makefile.am b/contribs/perlapi/Makefile.am
index 58685cbe4..00939f2da 100644
--- a/contribs/perlapi/Makefile.am
+++ b/contribs/perlapi/Makefile.am
@@ -26,7 +26,25 @@ $(perl_dir)/Makefile:	$(perl_dir)/Makefile.PL
 	fi
 	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}
 
+#
+# Note on linking logic below
+#
+# AIX needs to use LD to link. It can not use gcc.
+# Suse Linux compiles with gcc, but picks some other compiler to use for linking.
+#   Since some CFLAGS may be incompatable with this other compiler, the build
+#   may fail, as seen on BlueGene platforms.
+# Other Linux implementations sems to work fine with the LD specified as below
+#
 all-local: $(perl_dir)/Makefile #libslurm
+if HAVE_AIX
+	@cd $(perl_dir) && \
+	if [ ! -f Makefile ]; then \
+		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+	fi && \
+	($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
+	 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
+	cd ..;
+else
 	@cd $(perl_dir) && \
 	if [ ! -f Makefile ]; then \
 		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
@@ -34,6 +52,7 @@ all-local: $(perl_dir)/Makefile #libslurm
 	($(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 	 $(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
 	cd ..;
+endif
 
 install-exec-local:
 	@cd $(perl_dir) && \
diff --git a/contribs/perlapi/Makefile.in b/contribs/perlapi/Makefile.in
index 30296bef7..c11e027f8 100644
--- a/contribs/perlapi/Makefile.in
+++ b/contribs/perlapi/Makefile.in
@@ -143,6 +143,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
@@ -417,14 +418,30 @@ $(perl_dir)/Makefile:	$(perl_dir)/Makefile.PL
 	fi
 	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}
 
+#
+# Note on linking logic below
+#
+# AIX needs to use LD to link. It can not use gcc.
+# Suse Linux compiles with gcc, but picks some other compiler to use for linking.
+#   Since some CFLAGS may be incompatable with this other compiler, the build
+#   may fail, as seen on BlueGene platforms.
+# Other Linux implementations sems to work fine with the LD specified as below
+#
 all-local: $(perl_dir)/Makefile #libslurm
-	@cd $(perl_dir) && \
-	if [ ! -f Makefile ]; then \
-		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
-	fi && \
-	($(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
-	 $(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
-	cd ..;
+@HAVE_AIX_TRUE@	@cd $(perl_dir) && \
+@HAVE_AIX_TRUE@	if [ ! -f Makefile ]; then \
+@HAVE_AIX_TRUE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+@HAVE_AIX_TRUE@	fi && \
+@HAVE_AIX_TRUE@	($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
+@HAVE_AIX_TRUE@	 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
+@HAVE_AIX_TRUE@	cd ..;
+@HAVE_AIX_FALSE@	@cd $(perl_dir) && \
+@HAVE_AIX_FALSE@	if [ ! -f Makefile ]; then \
+@HAVE_AIX_FALSE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+@HAVE_AIX_FALSE@	fi && \
+@HAVE_AIX_FALSE@	($(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
+@HAVE_AIX_FALSE@	 $(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
+@HAVE_AIX_FALSE@	cd ..;
 
 install-exec-local:
 	@cd $(perl_dir) && \
diff --git a/contribs/perlapi/libslurm-perl/Slurm.xs b/contribs/perlapi/libslurm-perl/Slurm.xs
index 96a66b093..3f7a91f52 100644
--- a/contribs/perlapi/libslurm-perl/Slurm.xs
+++ b/contribs/perlapi/libslurm-perl/Slurm.xs
@@ -61,7 +61,6 @@ free_slurm(void)
 }
 
 typedef uint16_t signo_t;
-/* This function doesn't appear to be used commenting out just to make sure
 static signo_t
 signame_to_no(char* signame)
 {
@@ -85,7 +84,7 @@ signame_to_no(char* signame)
 	}
 	return 0;
 }
-*/
+
 
 static SV* sarb_cb_sv = NULL;
 static void
@@ -138,10 +137,8 @@ PROTOTYPES: ENABLE
 # 	MISC FUNCTIONS
 ######################################################################
 slurm_t 
-get_slurm(self, char *conf_file=NULL)
+get_slurm(slurm_t self = NULL, char *conf_file=NULL)
 		slurm_t	RETVAL = NULL;
-		slurm_t	self = NULL;
-
 	CODE:
 		if(conf_file) {
 			slurm_api_set_conf_file(conf_file);
@@ -182,8 +179,7 @@ slurm_strerror(slurm_t self, int errnum = 0)
 # 	RESOURCE ALLOCATION FUNCTIONS
 ######################################################################
 HV*
-slurm_allocate_resources(slurm_t self, job_req)
-		HV* job_req = NULL;
+slurm_allocate_resources(slurm_t self, HV* job_req = NULL)
 	PREINIT:
 		job_desc_msg_t job_desc_msg;
 		resource_allocation_response_msg_t* resp_msg = NULL;
@@ -206,8 +202,7 @@ slurm_allocate_resources(slurm_t self, job_req)
 		RETVAL
 
 HV*
-slurm_allocate_resources_blocking(slurm_t self, job_req, time_t timeout = 0, SV* callback = NULL)
-		HV* job_req = NULL;
+slurm_allocate_resources_blocking(slurm_t self, HV* job_req = NULL, time_t timeout = 0, SV* callback = NULL)
 	PREINIT:
 		job_desc_msg_t job_desc_msg;
 		resource_allocation_response_msg_t *resp_msg = NULL;
@@ -285,8 +280,7 @@ slurm_read_hostfile(slurm_t self, char* filename, int n)
 		RETVAL
 
 HV*
-slurm_submit_batch_job(slurm_t self, job_req)
-		HV* job_req = NULL;
+slurm_submit_batch_job(slurm_t self, HV* job_req = NULL)
 	PREINIT:
 		job_desc_msg_t job_desc_msg;
 		submit_response_msg_t* resp_msg = NULL;
@@ -309,8 +303,7 @@ slurm_submit_batch_job(slurm_t self, job_req)
 		RETVAL
 	
 int
-slurm_job_will_run(slurm_t self, job_req)
-		HV* job_req = NULL;
+slurm_job_will_run(slurm_t self, HV* job_req = NULL)
 	PREINIT:
 		job_desc_msg_t job_desc_msg;
 	CODE:
@@ -326,26 +319,22 @@ slurm_job_will_run(slurm_t self, job_req)
 #	JOB/STEP SIGNALING FUNCTIONS
 ######################################################################
 int
-slurm_kill_job(slurm_t self, U32 jobid, signal, U16 batch_flag = 0)
-		signo_t signal = 0;
+slurm_kill_job(slurm_t self, U32 jobid, signo_t signal = 0, U16 batch_flag = 0)
 	C_ARGS:
 		jobid, signal, batch_flag
 
 int
-slurm_kill_job_step(slurm_t self, U32 jobid, U32 stepid, signal)
-		signo_t signal = 0;
+slurm_kill_job_step(slurm_t self, U32 jobid, U32 stepid, signo_t signal = 0)
 	C_ARGS:
 		jobid, stepid, signal
 
 int
-slurm_signal_job(slurm_t self, U32 jobid, signal)
-		signo_t signal = 0;
+slurm_signal_job(slurm_t self, U32 jobid, signo_t signal = 0)
 	C_ARGS:
 		jobid, signal
 		
 int
-slurm_signal_job_step(slurm_t self, U32 jobid, U32 stepid, signal)
-		signo_t signal = 0;
+slurm_signal_job_step(slurm_t self, U32 jobid, U32 stepid, signo_t signal = 0)
 	C_ARGS:
 		jobid, stepid, signal
 
@@ -384,8 +373,7 @@ slurm_api_version(slurm_t self, OUTLIST int major, OUTLIST int minor, OUTLIST in
 		micro = SLURM_VERSION_MICRO(version);
 
 HV*
-slurm_load_ctl_conf(self)
-		slurm_t self = NULL;
+slurm_load_ctl_conf(slurm_t self = NULL)
 	PREINIT:
 		slurm_ctl_conf_t *new_ctl_conf;
 		int rc;
@@ -413,8 +401,7 @@ slurm_load_ctl_conf(self)
 #	SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 ######################################################################
 HV*
-slurm_load_jobs(self, U16 show_flags = 0)
-		slurm_t self = NULL;
+slurm_load_jobs(slurm_t self = NULL, U16 show_flags = 0)
 	PREINIT:
 		job_info_msg_t* new_job_info_msg = NULL;
 		int rc;
@@ -473,8 +460,7 @@ slurm_pid2jobid(slurm_t self, U32 pid)
 		RETVAL
 
 int
-slurm_update_job(slurm_t self, job_info)
-		HV* job_info = NULL;
+slurm_update_job(slurm_t self, HV* job_info = NULL)
 	PREINIT:
 		job_desc_msg_t job_msg;
 	CODE:
@@ -494,8 +480,7 @@ slurm_update_job(slurm_t self, job_info)
 #	SLURM JOB STEP CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 ######################################################################
 HV*
-slurm_get_job_steps(self, U16 show_flags = 0, U32 jobid = 0, U32 stepid = 0)
-		slurm_t self = NULL;
+slurm_get_job_steps(slurm_t self = NULL, U16 show_flags = 0, U32 jobid = 0, U32 stepid = 0)
 	PREINIT:
 		int rc;
 		job_step_info_response_msg_t* resp_msg;
@@ -543,8 +528,7 @@ slurm_job_step_layout_get(slurm_t self, U32 jobid, U32 stepid)
 #	SLURM NODE CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 ######################################################################
 HV*
-slurm_load_node(self, U16 show_flags = 0)
-		slurm_t self = NULL;
+slurm_load_node(slurm_t self = NULL, U16 show_flags = 0)
 	PREINIT:
 		node_info_msg_t* new_node_info_msg = NULL;
 		int rc;
@@ -570,8 +554,7 @@ slurm_load_node(self, U16 show_flags = 0)
 # slurm_sprint_node_table
 
 int
-slurm_update_node(slurm_t self, update_req)
-		HV* update_req = NULL;
+slurm_update_node(slurm_t self, HV* update_req = NULL)
 	PREINIT:
 		update_node_msg_t node_msg;
 	INIT:
@@ -585,8 +568,7 @@ slurm_update_node(slurm_t self, update_req)
 #	SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 ######################################################################
 HV*
-slurm_load_partitions(self, U16 show_flags = 0)
-		slurm_t self = NULL;
+slurm_load_partitions(slurm_t self = NULL, U16 show_flags = 0)
 	PREINIT:
 		partition_info_msg_t* new_part_info_msg;
 		int rc;
@@ -612,8 +594,7 @@ slurm_load_partitions(self, U16 show_flags = 0)
 # slurm_sprint_partition_info
 
 int
-slurm_update_partition(slurm_t self, part_info)
-		HV* part_info = NULL;
+slurm_update_partition(slurm_t self, HV* part_info = NULL)
 	PREINIT:
 		update_part_msg_t update_msg;
 	INIT:
@@ -726,8 +707,7 @@ slurm_checkpoint_error(slurm_t self, U32 jobid, U32 stepid, OUTLIST U32 error_co
 ######################################################################
 #	SLURM TRIGGER FUNCTIONS
 ######################################################################
-int slurm_set_trigger(slurm_t self, trigger_info)
-		HV* trigger_info = NULL;
+int slurm_set_trigger(slurm_t self, HV* trigger_info = NULL)
 	PREINIT:
 		trigger_info_t trigger_set;
 	INIT:
@@ -737,8 +717,7 @@ int slurm_set_trigger(slurm_t self, trigger_info)
 	C_ARGS:
 		&trigger_set
 
-int slurm_clear_trigger(slurm_t self, trigger_info)
-		HV* trigger_info = NULL;
+int slurm_clear_trigger(slurm_t self, HV* trigger_info = NULL)
 	PREINIT:
 		trigger_info_t trigger_clear;
 	INIT:
@@ -775,32 +754,27 @@ hostlist_t
 slurm_hostlist_create(char* hostlist)
 
 int
-slurm_hostlist_count(hl)
-		hostlist_t hl=NULL;
+slurm_hostlist_count(hostlist_t hl = NULL)
 	OUTPUT:
 		RETVAL
 	
 int
-slurm_hostlist_push(hl, char* hosts)
-		hostlist_t hl=NULL;
+slurm_hostlist_push(hostlist_t hl = NULL, char* hosts)
 	OUTPUT:
 		RETVAL
 
 int
-slurm_hostlist_push_host(hl, char* host)
-		hostlist_t hl=NULL;
+slurm_hostlist_push_host(hostlist_t hl = NULL, char* host)
 	OUTPUT:
 		RETVAL
 
 int
-slurm_hostlist_find(hl, char* hostname)
-		hostlist_t hl=NULL;
+slurm_hostlist_find(hostlist_t hl = NULL, char* hostname)
 	OUTPUT:
 		RETVAL
 
 char*
-slurm_hostlist_shift(hl)
-		hostlist_t hl=NULL;
+slurm_hostlist_shift(hostlist_t hl = NULL)		
 	PREINIT:
 		char *host = NULL;
 	CODE:
@@ -815,8 +789,7 @@ slurm_hostlist_shift(hl)
 		RETVAL
 
 char*
-slurm_hostlist_ranged_string(hl)
-		hostlist_t hl=NULL;
+slurm_hostlist_ranged_string(hostlist_t hl = NULL)
 	PREINIT:
 		size_t size = 1024;
 		int rc = 0;
@@ -845,8 +818,7 @@ DESTROY(hl)
 MODULE=Slurm PACKAGE=Slurm::Stepctx PREFIX=slurm_step_ctx_
 
 slurm_step_ctx
-slurm_step_ctx_create(slurm_step_ctx ctx = NO_INIT, req)
-		HV* req = NULL;
+slurm_step_ctx_create(slurm_step_ctx ctx = NO_INIT, HV* req = NULL)
 	PREINIT:
 		slurm_step_ctx_params_t params;
 	CODE:
@@ -862,8 +834,7 @@ slurm_step_ctx_create(slurm_step_ctx ctx = NO_INIT, req)
 
 # XXX: slurm_step_ctx_get is divided into the following methods
 U32
-slurm_step_ctx_get_jobid(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_jobid(slurm_step_ctx ctx = NULL)
 	CODE:
 		if(slurm_step_ctx_get(ctx, SLURM_STEP_CTX_JOBID, &RETVAL) != SLURM_SUCCESS) {
 			XSRETURN_UNDEF;
@@ -872,8 +843,7 @@ slurm_step_ctx_get_jobid(ctx)
 		RETVAL
 
 U32
-slurm_step_ctx_get_stepid(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_stepid(slurm_step_ctx ctx = NULL)
 	CODE:
 		if(slurm_step_ctx_get(ctx, SLURM_STEP_CTX_STEPID, &RETVAL) != SLURM_SUCCESS) {
 			XSRETURN_UNDEF;
@@ -882,8 +852,7 @@ slurm_step_ctx_get_stepid(ctx)
 		RETVAL
 
 U32
-slurm_step_ctx_get_num_hosts(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_num_hosts(slurm_step_ctx ctx = NULL)
 	PREINIT:
 		uint32_t num_hosts;
 	CODE:
@@ -895,8 +864,7 @@ slurm_step_ctx_get_num_hosts(ctx)
 		RETVAL
 
 AV*
-slurm_step_ctx_get_tasks(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_tasks(slurm_step_ctx ctx = NULL)
 	PREINIT:
 		int i;
 		uint32_t num_hosts;
@@ -919,8 +887,7 @@ slurm_step_ctx_get_tasks(ctx)
 		RETVAL
 
 AV*
-slurm_step_ctx_get_tid(ctx, U32 index)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_tid(slurm_step_ctx ctx = NULL, U32 index)
 	PREINIT:
 		int i;
 		uint16_t *tasks;
@@ -947,8 +914,7 @@ slurm_step_ctx_get_tid(ctx, U32 index)
 
 # XXX: the returned value is no longer valid if ctx goes away
 slurm_cred_t
-slurm_step_ctx_get_cred(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_cred(slurm_step_ctx ctx = NULL)
 	CODE:
 		if(slurm_step_ctx_get(ctx, SLURM_STEP_CTX_CRED, &RETVAL) != SLURM_SUCCESS) {
 			XSRETURN_UNDEF;
@@ -958,8 +924,7 @@ slurm_step_ctx_get_cred(ctx)
 
 # XXX: the returned value is no longer valid if ctx goes away
 switch_jobinfo_t
-slurm_step_ctx_get_switch_job(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_switch_job(slurm_step_ctx ctx = NULL)
 	CODE:
 		if(slurm_step_ctx_get(ctx, SLURM_STEP_CTX_SWITCH_JOB, &RETVAL) != SLURM_SUCCESS) {
 			XSRETURN_UNDEF;
@@ -968,8 +933,7 @@ slurm_step_ctx_get_switch_job(ctx)
 		RETVAL
 
 char*
-slurm_step_ctx_get_host(ctx, U32 index)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_host(slurm_step_ctx ctx = NULL, U32 index)
 	CODE:
 		if(slurm_step_ctx_get(ctx, SLURM_STEP_CTX_HOST, index, &RETVAL) != SLURM_SUCCESS) {
 			XSRETURN_UNDEF;
@@ -978,8 +942,7 @@ slurm_step_ctx_get_host(ctx, U32 index)
 		RETVAL
 
 AV*
-slurm_step_ctx_get_user_managed_sockets(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_get_user_managed_sockets(slurm_step_ctx ctx = NULL)
 	PREINIT:
 		int i;
 		int tasks_requested;
@@ -1000,8 +963,7 @@ slurm_step_ctx_get_user_managed_sockets(ctx)
 
 
 int
-slurm_step_ctx_daemon_per_node_hack(ctx);
-		slurm_step_ctx ctx = NULL;
+slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx ctx = NULL)
 	C_ARGS:
 		ctx
 
@@ -1012,8 +974,7 @@ slurm_step_ctx_daemon_per_node_hack(ctx);
 #		job_info, data_type, data
 
 void
-DESTROY(ctx)
-		slurm_step_ctx ctx = NULL;
+DESTROY(slurm_step_ctx ctx = NULL)
 	CODE:
 		if(slurm_step_ctx_destroy(ctx) != SLURM_SUCCESS) {
 			Perl_croak(aTHX_ "Failed to destory slurm_step_ctx");
@@ -1022,9 +983,7 @@ DESTROY(ctx)
 
 MODULE=Slurm PACKAGE=Slurm::Stepctx PREFIX=slurm_step_
 int
-slurm_step_launch(ctx, hv, SV* start_cb = NULL, SV* finish_cb = NULL)
-		HV* hv = NULL;
-		slurm_step_ctx ctx = NULL;
+slurm_step_launch(slurm_step_ctx ctx = NULL, HV* hv = NULL, SV* start_cb = NULL, SV* finish_cb = NULL)
 	PREINIT:
 		slurm_step_launch_callbacks_t callbacks = {NULL, NULL};
 		slurm_step_launch_params_t params;
@@ -1047,22 +1006,17 @@ slurm_step_launch(ctx, hv, SV* start_cb = NULL, SV* finish_cb = NULL)
 
 
 int
-slurm_step_launch_wait_start(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_launch_wait_start(slurm_step_ctx ctx = NULL)
 	C_ARGS:
 		ctx
 
 
 void
-slurm_step_launch_wait_finish(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_launch_wait_finish(slurm_step_ctx ctx = NULL)
 	C_ARGS:
 		ctx
 
 void
-slurm_step_launch_abort(ctx)
-		slurm_step_ctx ctx = NULL;
+slurm_step_launch_abort(slurm_step_ctx ctx = NULL)
 	C_ARGS:
 		ctx
-
-
diff --git a/contribs/time_login.c b/contribs/time_login.c
index 529188627..27261599b 100644
--- a/contribs/time_login.c
+++ b/contribs/time_login.c
@@ -54,7 +54,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#define SU_WAIT_MSEC 3000
+#define SU_WAIT_MSEC 8000
 static void _parse_line(char *in_line, char **user_name, int *user_id);
 static long int  _time_login(char *user_name);
 
@@ -138,12 +138,10 @@ static long int _time_login(char *user_name)
 		dup2(fildes[1], 1);
 		close(2);
 		open("/dev/null", O_WRONLY);
-#if 0
-		/* execute .profile only */
-		execl("/bin/su", "su", user_name, "-c", 
+#ifdef LOAD_ENV_NO_LOGIN
+		execl("/bin/su", "su", user_name, "-c",
 			"echo; echo; echo HELLO", NULL);
 #else
-		/* execute .login plus .profile */
 		execl("/bin/su", "su", "-", user_name, "-c", 
 			"echo; echo; echo HELLO", NULL);
 #endif
@@ -174,8 +172,10 @@ static long int _time_login(char *user_name)
 			perror("poll");
 			break;
 		}
-		if ((ufds.revents & POLLERR) || (ufds.revents & POLLHUP))
+		if (!(ufds.revents & POLLIN)) {
+			perror("POLLERR|POLLHUP");
 			break;
+		}
 		while (fgets(line, BUFSIZ, su)) {
 			if (!strncmp(line, "HELLO", 5)) {
 				found = 1;
@@ -186,10 +186,9 @@ static long int _time_login(char *user_name)
 	close(fildes[0]);
 	waitpid(-1, NULL, WNOHANG);
 
-	if (!found)
-		return (SU_WAIT_MSEC * 1000);
-
 	delta_t  = (now.tv_sec  - begin.tv_sec)  * 1000000;
 	delta_t +=  now.tv_usec - begin.tv_usec;
+	if (!found && (delta_t < (SU_WAIT_MSEC * 1000)))
+		return (SU_WAIT_MSEC * 1000);
 	return delta_t;
 }
diff --git a/contribs/torque/Makefile.in b/contribs/torque/Makefile.in
index 0b837b20b..8446e6f0e 100644
--- a/contribs/torque/Makefile.in
+++ b/contribs/torque/Makefile.in
@@ -150,6 +150,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/contribs/torque/mpiexec.pl b/contribs/torque/mpiexec.pl
index f468966e7..622a1a496 100755
--- a/contribs/torque/mpiexec.pl
+++ b/contribs/torque/mpiexec.pl
@@ -45,13 +45,13 @@ use FindBin;
 use Getopt::Long 2.24 qw(:config no_ignore_case require_order);
 use lib "${FindBin::Bin}/../lib/perl";
 use autouse 'Pod::Usage' => qw(pod2usage);
-use Slurm ':all';
 use Switch;
 
 my $srun = "${FindBin::Bin}/srun";
 
 my ($nprocs, $hostname, $verbose, $nostdin, $allstdin, $nostdout, $pernode,
-    $perif, $no_shem, $gige, $kill_it, $tv, $config_file, $help, $man);
+    $perif, $no_shem, $gige, $kill_it, $tv, $config_file, $timeout,
+    $help, $man);
 
 sub get_new_config() {
 
@@ -143,6 +143,8 @@ $command .= " -inone" if $nostdin;
 $command .= " -i0" if !$allstdin; #default only send stdin to first node
 $command .= " -n$nprocs" if $nprocs; # number of tasks
 $command .= " -w$hostname" if $hostname; # Hostlist provided
+$command .= " -t '" . $ENV{"MPIEXEC_TIMEOUT"} . "'" if $ENV{"MPIEXEC_TIMEOUT"};
+
 if($verbose) {
 	$command .= " -"; # verbose
 	for(my $i=0; $i<$verbose; $i++) {
diff --git a/contribs/torque/qstat.pl b/contribs/torque/qstat.pl
index 997543956..5a8ae0fd7 100755
--- a/contribs/torque/qstat.pl
+++ b/contribs/torque/qstat.pl
@@ -54,51 +54,53 @@ use Switch;
 my (
     $all,              $diskReservation, $executable,   $full,
     $giga,             $help,            $idle,         $mega,
-    $man,              $nodes,           $one,          $queueStatus,
-    $queueDestination, $running,         $serverStatus, $siteSpecific,
-    $userList,         $hostname
+    $man,              $nodes,           $one,          $queueList,
+    $queueStatus,      $running,         $serverStatus, $siteSpecific,
+    $userList,         $hostname,        $rc
 );
+
 GetOptions(
-    'a'      => \$all,
-    'B=s'    => \$serverStatus,
-    'e'      => \$executable,
-    'f'      => \$full,
-    'help|?' => \$help,
-    'i'      => \$idle,
-    'G'      => \$giga,
-    'man'    => \$man,
-    'M'      => \$mega,
-    'n'      => \$nodes,
-    '1'      => \$one,
-    'r'      => \$running,
-    'R'      => \$diskReservation,
-    'q'      => \$queueStatus,
-    'Q=s'    => \$queueDestination,
-    'u=s'    => \$userList,
-    'W=s'    => \$siteSpecific,
-) or pod2usage(2);
+	'a'      => \$all,
+	'B=s'    => \$serverStatus,
+	'e'      => \$executable,
+	'f'      => \$full,
+	'help|?' => \$help,
+	'i'      => \$idle,
+	'G'      => \$giga,
+	'man'    => \$man,
+	'M'      => \$mega,
+	'n'      => \$nodes,
+	'1'      => \$one,
+	'r'      => \$running,
+	'R'      => \$diskReservation,
+	'q'      => \$queueStatus,
+	'Q:s'    => \$queueList,
+	'u=s'    => \$userList,
+	'W=s'    => \$siteSpecific,
+	) or pod2usage(2);
+
+$rc = 153; # if we don't find what we are looking for return this.
 
 # Display usage if necessary
 pod2usage(0) if $help;
 if ($man)
 {
-    if ($< == 0)    # Cannot invoke perldoc as root
-    {
-        my $id = eval { getpwnam("nobody") };
-        $id = eval { getpwnam("nouser") } unless defined $id;
-        $id = -2                          unless defined $id;
-        $<  = $id;
-    }
-    $> = $<;                         # Disengage setuid
-    $ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
-    delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
-    if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
-    else { die "Illegal characters were found in \$0 ($0)\n"; }
-    pod2usage(-exitstatus => 0, -verbose => 2);
+	if ($< == 0)    # Cannot invoke perldoc as root
+	{
+		my $id = eval { getpwnam("nobody") };
+		$id = eval { getpwnam("nouser") } unless defined $id;
+		$id = -2                          unless defined $id;
+		$<  = $id;
+	}
+	$> = $<;                         # Disengage setuid
+	$ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
+	delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+	if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
+	else { die "Illegal characters were found in \$0 ($0)\n"; }
+	pod2usage(-exitstatus => 0, -verbose => 2);
 }
 
 # Use sole remaining argument as jobIds
-my @jobIds = @ARGV;
 
 $hostname = `hostname -f`;
 chomp $hostname;
@@ -112,10 +114,6 @@ chomp $hostname;
 #unsupportedOption("-B", DIE) if $serverStatus;
 
 # Build command
-my $resp = Slurm->load_jobs(1);
-if(!$resp) {
-	die "Problem loading jobs.\n";
-}
 
 # foreach my $job (@{$resp->{job_array}}) {
 # 	while(my ($key, $value) = each(%$job)) {
@@ -124,67 +122,84 @@ if(!$resp) {
 # }
 my $now_time = time();
 
-my @userIds = split /,/, $userList || '';
-
-foreach my $job (@{$resp->{job_array}}) {
-	my $use_time      = $now_time;
-	my $state = $job->{'job_state'};
-	if($job->{'end_time'} && $job->{'end_time'} < $now_time) {
-		$use_time = $job->{'end_time'};
-	} 	
-	$job->{'statPSUtl'} =
-		$use_time - $job->{'start_time'} - $job->{'suspend_time'};
-	$job->{'aWDuration'} =
-		$use_time - $job->{'start_time'} - $job->{'suspend_time'};
-
-	$job->{'allocNodeList'} = $job->{'nodes'} || "--";
-	$job->{'stateCode'} = stateCode($job->{'job_state'});
-	$job->{'user_name'} = getpwuid($job->{'user_id'});
-	if(!$job->{'name'}) {
-		$job->{'name'} = "Allocation";	       
+if(defined($queueList)) {
+	my @queueIds = split(/,/, $queueList) if $queueList;
+
+	my $resp = Slurm->load_partitions(1);
+	if(!$resp) {
+		die "Problem loading jobs.\n";
 	}
-	       
-	switch($job->{'job_state'}) {
-		case [JOB_COMPLETE, 
-		      JOB_CANCELLED,
-		      JOB_TIMEOUT,
-		      JOB_FAILED]    { $job->{'stateCode'} = 'C' }
-		case [JOB_RUNNING]   { $job->{'stateCode'} = 'R' }
-		case [JOB_PENDING]   { $job->{'stateCode'} = 'Q' }
-		case [JOB_SUSPENDED] { $job->{'stateCode'} = 'S' }
-		else                 { $job->{'stateCode'} = 'U' }   # Unknown
+	
+	my $line = 0;
+	foreach my $part (@{$resp->{partition_array}}) {
+		if (@queueIds) {
+			next unless grep /^$part->{'name'}/, @queueIds;
+		} 
+		
+		if ($full) { # Full
+			print_part_full($part);
+		} else { # Brief
+			print_part_brief($part, $line);
+			$line++;
+		}	
+		$rc = 0;
 	}
+} else {
+	my @jobIds = @ARGV;
+	my @userIds = split(/,/, $userList) if $userList;
 
+	my $resp = Slurm->load_jobs(1);
+	if(!$resp) {
+		die "Problem loading jobs.\n";
+	}
 
-	# Filter jobs according to options and arguments
-	if (@jobIds) {
-		next unless grep /^$job->{'job_id'}/, @jobIds;
-	} else {
-		if ($running) {
-			next unless ($job->{'stateCode'} eq 'R'
-				     || $job->{'stateCode'} eq 'S');
-		}
-		if ($idle) {
-			next unless ($job->{'stateCode'} eq 'Q');
+	my $line = 0;
+	foreach my $job (@{$resp->{job_array}}) {
+		my $use_time      = $now_time;
+		my $state = $job->{'job_state'};
+		if($job->{'end_time'} && $job->{'end_time'} < $now_time) {
+			$use_time = $job->{'end_time'};
+		} 	
+		$job->{'statPSUtl'} = job_time_used($job);
+		$job->{'aWDuration'} = $job->{'statPSUtl'};
+
+		$job->{'allocNodeList'} = $job->{'nodes'} || "--";
+		$job->{'stateCode'} = stateCode($job->{'job_state'});
+		$job->{'user_name'} = getpwuid($job->{'user_id'});
+		$job->{'name'} = "Allocation" if !$job->{'name'};	       
+		
+		# Filter jobs according to options and arguments
+		if (@jobIds) {
+			next unless grep /^$job->{'job_id'}/, @jobIds;
+		} else {
+			if ($running) {
+				next unless ($job->{'stateCode'} eq 'R'
+					     || $job->{'stateCode'} eq 'S');
+			}
+			if ($idle) {
+				next unless ($job->{'stateCode'} eq 'Q');
+			}
+			if (@userIds) {
+				next unless 
+					grep /^$job->{'user_name'}$/, @userIds;
+			}
 		}
-		if (@userIds) {
-			next unless grep /^$job->{'user_name'}$/, @userIds;
+		
+		if ($all || $idle || $nodes || $running
+		    || $giga || $mega || $userList) { # Normal
+			print_job_select($job);
+		} elsif ($full) { # Full
+			print_job_full($job);
+		} else { # Brief
+			print_job_brief($job, $line);
+			$line++;
 		}
+		$rc = 0;
 	}
-	
-	if ($all || $idle || $nodes || $running
-	    || $giga || $mega || $userList) { # Normal
-		print_select($job);
-	} elsif ($full) { # Full
-		print_full($job);
-	} else { # Brief
-		print_brief($job);
-	}	
 }
 
-
 # Exit with status code
-exit 0;
+exit $rc;
 
 ################################################################################
 # $stateCode = stateCode($state)
@@ -315,6 +330,36 @@ sub hRTime
 	return scalar localtime $epochTime;
 }
 
+sub job_time_used
+{
+	my ($job) = @_;
+
+	my $end_time;
+
+	return 0 if ($job->{'start_time'} == 0)
+		|| ($job->{'job_state'} == JOB_PENDING);
+
+	return $job->{'pre_sus_time'} if $job->{'job_state'} == JOB_SUSPENDED;
+
+	if (($job->{'job_state'} == JOB_RUNNING)
+	    ||  ($job->{'end_time'} == 0)) {
+		$end_time = localtime;
+	} else {
+		$end_time = $job->{'end_time'};
+	}
+	
+	return ($end_time - $job->{'suspend_time'} + $job->{'pre_sus_time'}) 
+		if $job->{'suspend_time'};
+	return ($end_time - $job->{'start_time'});
+}
+
+sub yes_no
+{
+	my ($query) = @_;
+	return "yes" if $query;
+	return "no";
+}
+
 sub get_exec_host 
 {
 	my ($job) = @_;
@@ -340,23 +385,28 @@ sub get_exec_host
 	return $execHost;
 }
 
-sub print_brief 
+###############################################################################
+# Job Functions
+###############################################################################
+sub print_job_brief 
 {
-	my ($job) = @_;
+	my ($job, $line_num) = @_;
 
-	printf("%-19s %-16s %-15s %-8s %-1s %-15s\n",
-	       "Job ID", "Jobname", "Username", "Time",  "S", "Queue");
+	if(!$line_num) {
+		printf("%-19s %-16s %-15s %-8s %-1s %-15s\n",
+		       "Job ID", "Jobname", "Username", "Time",  "S", "Queue");
+	}
 	printf("%-19.19s %-16.16s %-15.15s %-8.8s %-1.1s %-15.15s\n",
 	       $job->{'job_id'}, $job->{'name'}, $job->{'user_name'},
 	       ddhhmm($job->{'statPSUtil'}), $job->{'stateCode'},
 	       $job->{'partition'});
 }
 
-sub print_select
+sub print_job_select
 {
 	my ($job) = @_;
 
-	my $sessID = "??????";
+	my $sessID = "--";
 	my $execHost;
 
 	print "\n${hostname}:\n";
@@ -374,14 +424,8 @@ sub print_select
 	       '-' x 3,  '-' x 6, '-' x 5, '-',      '-' x 5
 	       );
 
-	if ($nodes) {
-		$execHost = get_exec_host($job);
+	$execHost = get_exec_host($job) if $nodes;
 		
-		if ($one) {
-			$sessID = "--";
-		}
-	} 
-	
 	printf("%-20.20s %-8.8s %-8.8s %-10.10s " .
 	       "%-6.6s %5.5s %3.3s %6.6s %-5.5s %-1s %-5.5s",
 	       $job->{'job_id'}, 
@@ -406,74 +450,89 @@ sub print_select
 	}
 }
 
-sub print_full
+sub print_job_full
 {
 	my ($job) = @_;
 	# Print the job attributes
 	printf("Job Id:\t%s\n", $job->{'job_id'});
-	if($job->{'start_time'}) {
-		printf("\tExecution_Time = %s\n",
-		       hRTime($job->{'start_time'}));
-		}
-	if(!$job->{'batch_flag'}) {
-		printf "\tinteractive = True\n"; 
-	}
-	if($job->{'name'}) {
-		printf("\tJob_Name = %s\n", $job->{'name'}); 
-	}
+	printf("\tJob_Name = %s\n", $job->{'name'}) if $job->{'name'};
 	printf("\tJob_Owner = %s@%s\n", 
 	       $job->{'user_name'}, $job->{'alloc_node'});
-
-	if($job->{'statPSUtl'}) {
-		printf("\tresources_used.cput = %s\n",
-		       hhmmss($job->{'statPSUtl'}));
-	}
-
-	if($job->{'aWDuration'}) {
-		printf("\tresources_used.walltime = %s\n",
-		       hhmmss($job->{'aWDuration'}));
-	}
-		
-	printf("\tjob_state = %s\n", $job->{'stateCode'});
-	printf("\tqueue = %s\n", $job->{'partition'});
 	
-	if($job->{'account'}) {				       
-		printf("\tAccount_Name = %s\n", $job->{'account'});
-	}
-
-	my $execHost = get_exec_host($job);
-	if($execHost ne '--') { 
-		printf("\texec_host = %s\n", $execHost);
-	}
+	printf "\tinteractive = True\n" if !$job->{'batch_flag'};
 	
-	printf("\tPriority = %s\n", $job->{'priority'});
+	printf("\tjob_state = %s\n", $job->{'stateCode'});
+	printf("\tqueue = %s\n", $job->{'partition'});
 	
 	printf("\tqtime = %s\n", hRTime($job->{'submit_time'}));
+	printf("\tmtime = %s\n", hRTime($job->{'start_time'})) 
+		if $job->{'start_time'};
+	printf("\tctime = %s\n", hRTime($job->{'end_time'}))
+		if $job->{'end_time'};
 	
-	if($job->{'num_nodes'}) {
-		printf("\tResource_List.nodect = %d\n", $job->{'num_nodes'});
-	}
+	printf("\tAccount_Name = %s\n", $job->{'account'}) if $job->{'account'};
+	
+	my $execHost = get_exec_host($job);
+	printf("\texec_host = %s\n", $execHost) if $execHost ne '--';
+		
+	printf("\tPriority = %u\n", $job->{'priority'});
+	printf("\teuser = %s(%d)\n", $job->{'user_name'}, $job->{'user_id'});
+
+	# can't run getgrgid inside printf it appears the input gets set to
+	# x if ran there.
+	my $user_group = getgrgid($job->{'group_id'});
+	printf("\tegroup = %s(%d)\n", $user_group, $job->{'group_id'});
+
+	printf("\tResource_List.walltime = %s\n", hhmmss($job->{'aWDuration'}));
+	printf("\tResource_List.nodect = %d\n", $job->{'num_nodes'})
+		if $job->{'num_nodes'};
+	printf("\tResource_List.ncpus = %s\n", $job->{'num_procs'}) 
+		if $job->{'num_procs'}; 
 	
 	if ($job->{'reqNodes'}) {
 		my $nodeExpr = $job->{'reqNodes'};
-		if($job->{'ntasks_per_node'}) {
-			$nodeExpr .= ":ppn=" . $job->{'ntasks_per_node'}; 
-		}
+		$nodeExpr .= ":ppn=" . $job->{'ntasks_per_node'} 
+		        if $job->{'ntasks_per_node'}; 
+		
 		printf("\tResource_List.nodes = %s\n", $nodeExpr);
 	}
-	if($job->{'num_procs'}) {
-		printf("\tResource_List.ncpus = %s\n", $job->{'num_procs'}); 
-	} 
+		
+	print "\n";
+}
 
-	
-	if($job->{'reqAWDuration'}) {
-		printf("\tResource_List.walltime = %s\n",
-		       hhmmss($job->{'reqAWDuration'}));
+###############################################################################
+# Partition Functions
+###############################################################################
+sub print_part_brief 
+{
+	my ($part, $line_num) = @_;
+
+	if(!$line_num) {
+		printf("%-16s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %1s\n\n",
+		       "Queue", "Max", "Tot", "Ena",  "Str", "Que", "Run",
+		       "Hld", "Wat", "Trn", "Ext", "T");
+		printf("%-16s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %1s\n\n",
+		       "----------------", "---", "---", "---",  "---", "---", 
+		       "---", "---", "---", "---", "---", "-");
 	}
+	printf("%-16.16s %5.5s %5.5s %5.5s %5.5s %5.5s %5.5s %5.5s " .
+	       "%5.5s %5.5s %5.5s %1.1s\n",
+	       $part->{'name'}, '?', '?', yes_no($part->{'state_up'}),
+	       yes_no($part->{'state_up'}), '?', '?', '?', '?', '?', '?', 'E');
+}
 
-	printf("\teuser = %s\n", $job->{'user_name'});
-	printf("\tegroup = %s\n", getgrgid($job->{'group_id'}));
-
+sub print_part_full
+{
+	my ($part) = @_;
+	# Print the part attributes
+	printf("Queue:\t%s\n", $part->{'name'});
+	printf("\tqueue_type = Execution\n");
+	printf("\tresources_default.nodes = %d\n", $part->{'total_nodes'});
+	
+	printf("\tenabled = %s\n", yes_no($part->{'state_up'}));
+	
+	printf("\tstarted = %s\n", yes_no($part->{'state_up'}));
+	
 	print "\n";
 }
 
@@ -483,7 +542,7 @@ __END__
 
 =head1 NAME
 
-B<qstat> - display job information in a familiar pbs format
+B<qstat> - display job/partition information in a familiar pbs format
 
 =head1 SYNOPSIS
 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index baad13686..cb6d6cca8 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in
index 221726440..14562fb45 100644
--- a/doc/html/Makefile.in
+++ b/doc/html/Makefile.in
@@ -154,6 +154,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/doc/html/bluegene.shtml b/doc/html/bluegene.shtml
index f8fd58101..9121d3ce1 100644
--- a/doc/html/bluegene.shtml
+++ b/doc/html/bluegene.shtml
@@ -465,10 +465,10 @@ AltRamDiskImage=/bgl/BlueLight/ppcfloor/bglsys/bin/ramdisk3.elf
 
 # Another option for images would be a "You can use anything you like image" *
 # This allows the user to use any image entered with no security checking
-AltBlrtsImage=* Groups=da:adamb
-AltLinuxImage=* Groups=da:adamb
-AltMloaderImage=* Groups=da:adamb
-AltRamDiskImage=*  Groups=da:adamb
+AltBlrtsImage=* Groups=da,adamb
+AltLinuxImage=* Groups=da,adamb
+AltMloaderImage=* Groups=da,adamb
+AltRamDiskImage=*  Groups=da,adamb
 
 LayoutMode=STATIC
 BasePartitionNodeCnt=512
diff --git a/doc/html/configurator.html.in b/doc/html/configurator.html.in
index ad09222fe..8b0faed7b 100644
--- a/doc/html/configurator.html.in
+++ b/doc/html/configurator.html.in
@@ -184,7 +184,7 @@ function displayfile()
    "# <br>" +
    "# COMPUTE NODES <br>" +
    "NodeName=" + document.config.node_name.value +
-   get_field2("NodeAddr",document.config.node_addr) +
+   get_field2(" NodeAddr",document.config.node_addr) +
    get_field2(" Procs",document.config.procs) +
    get_field2(" Memory",document.config.memory) +
    get_field2(" Sockets",document.config.sockets) +
diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in
index 764f460d1..abc5e9977 100644
--- a/doc/man/Makefile.in
+++ b/doc/man/Makefile.in
@@ -151,6 +151,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1
index c4a6925ad..490c9c252 100644
--- a/doc/man/man1/salloc.1
+++ b/doc/man/man1/salloc.1
@@ -219,11 +219,13 @@ allocation.
 
 .TP 
 \fB\-\-nice\fR[=]<\fIadjustment\fR>
-Run the job with an adjusted scheduling priority.  With no adjustment
-value the scheduling priority is decreased by 100.  The adjustment range
-is from \-10000 (highest priority) to 10000 (lowest priority). Only
-privileged users can specify a negative adjustment.  NOTE: This option
-is presently ignored if SchedulerType=sched/maui.
+Run the job with an adjusted scheduling priority within SLURM.
+With no adjustment value the scheduling priority is decreased
+by 100. The adjustment range is from \-10000 (highest priority)
+to 10000 (lowest priority). Only privileged users can specify
+a negative adjustment. NOTE: This option is presently
+ignored if \fISchedulerType=sched/wiki\fR or 
+\fISchedulerType=sched/wiki2\fR.
 
 .TP 
 \fB\-\-no\-bell\fR
diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index 86d736f8c..532d4d8e6 100644
--- a/doc/man/man1/sbatch.1
+++ b/doc/man/man1/sbatch.1
@@ -120,13 +120,14 @@ The order of the node names in the list is not important; the node names
 will be sorted my SLURM.
 
 .TP
-\fB\-\-get\-user\-env\fR
+\fB\-\-get\-user\-env\fR[=\fItimeout\fR]
 This option will tell sbatch to retrieve the
 login environment variables for the user specified in the \-\-uid option.
 The environment variables are retrieved by running "su - <username> -c
 /usr/bin/env" and parsing the output.  Be aware that any environment
 variables already set in sbatch's environment will take precedence over any
 environment variables in the user's login environment.
+Optional timeout value is in seconds. Default value is 8 seconds.
 NOTE: This option only works if the caller has an effective uid of "root".
 This option was originally created for use by Moab.
 
@@ -260,11 +261,13 @@ allocation.
 
 .TP 
 \fB\-\-nice\fR[=]<\fIadjustment\fR>
-Run the job with an adjusted scheduling priority.  With no adjustment
-value the scheduling priority is decreased by 100.  The adjustment range
-is from \-10000 (highest priority) to 10000 (lowest priority). Only
-privileged users can specify a negative adjustment.  NOTE: This option
-is presently ignored if SchedulerType=sched/maui.
+Run the job with an adjusted scheduling priority within SLURM.
+With no adjustment value the scheduling priority is decreased
+by 100. The adjustment range is from \-10000 (highest priority)
+to 10000 (lowest priority). Only privileged users can specify
+a negative adjustment. NOTE: This option is presently
+ignored if \fISchedulerType=sched/wiki\fR or 
+\fISchedulerType=sched/wiki2\fR.
 
 .TP
 \fB\-\-no\-requeue\fR
diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1
index 12b8cd4d8..405bd1c36 100644
--- a/doc/man/man1/squeue.1
+++ b/doc/man/man1/squeue.1
@@ -181,6 +181,9 @@ Priority of the job (converted to a floating point number between 0.0 and 1.0
 \fB%P\fR 
 Partition of the job or job step
 .TP
+\fB%q\fR 
+Comment associated with the job
+.TP
 \fB%r\fR
 The reason a job is in its current state.
 See the \fBJOB REASON CODES\fR section below for more information.
diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index 603547e25..bcbc3cb43 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -1,4 +1,4 @@
-\." $Id: srun.1 12445 2007-10-03 22:24:35Z jette $
+\." $Id: srun.1 12574 2007-10-26 17:00:52Z jette $
 .\"
 .TH SRUN "1" "July 2007" "srun 1.2" "slurm components"
 
@@ -282,13 +282,14 @@ even if consumable resources are enabled
 (e.g. \fBSelectType=select/cons_res\fR).
 
 .TP
-\fB\-\-get\-user\-env\fR
+\fB\-\-get\-user\-env\fR[=\fItimeout\fR]
 For a batch script submission, this option will tell srun to retrieve the
 login environment variables for the user specified in the \-\-uid option.
 The environment variables are retrieved by running "su - <username> -c
 /usr/bin/env" and parsing the output.  Be aware that any environment
 variables already set in srun's environment will take precedence over any
 environment variables in the user's login environment.
+Optional timeout value is in seconds. Default value is 8 seconds.
 NOTE: This option only works if the caller has an
 effective uid of "root", and only takes effect in batch mode (\-b/\-\-batch).
 This option was originally created for use by Moab.
@@ -618,18 +619,19 @@ The interpretation of \fItype\fR is system dependent.
 For systems with an IBM Federation switch, the following 
 comma\-separated and case insensitive types are recongnized:
 \fBIP\fR (the default is user\-space), \fBSN_ALL\fR, \fBSN_SINGLE\fR, 
-\fBBULK_XFER\fR and adapter names. For more information, on 
-IBM systems see \fIpoe\fR documenation on the environment variables 
-\fBMP_EUIDEVICE\fR and \fBMP_USE_BULK_XFER\fR.
+\fBBULK_XFER\fR and adapter names  (e.g. \fBSNI0\fR and \fBSNI1\fR). 
+For more information, on IBM systems see \fIpoe\fR documenation on 
+the environment variables \fBMP_EUIDEVICE\fR and \fBMP_USE_BULK_XFER\fR.
 
 .TP
 \fB\-\-nice\fR[=\fIadjustment]\fR
-Run the job with an adjusted scheduling priority. 
+Run the job with an adjusted scheduling priority within SLURM. 
 With no adjustment value the scheduling priority is decreased 
 by 100. The adjustment range is from \-10000 (highest priority)
 to 10000 (lowest priority). Only privileged users can specify 
 a negative adjustment. NOTE: This option is presently 
-ignored if \fISchedulerType=sched/maui\fR.
+ignored if \fISchedulerType=sched/wiki\fR or 
+\fISchedulerType=sched/wiki2\fR.
 
 .TP
 \fB\-\-no\-requeue\fR
@@ -1066,9 +1068,10 @@ stdout and/or stderr are redirected from only the task with relative
 id equal to \fItaskid\fR, where 0 <= \fItaskid\fR <= \fIntasks\fR,
 where \fIntasks\fR is the total number of tasks in the current job step.
 stdin is redirected from the stdin of \fBsrun\fR to this same task.
+This file will be written on the node executing the task.
 .TP
 \fIfilename\fR
-fBsrun\fR will redirect stdout and/or stderr to the named file from 
+\fBsrun\fR will redirect stdout and/or stderr to the named file from 
 all tasks.
 stdin will be redirected from the named file and broadcast to all
 tasks in the job.  
@@ -1087,7 +1090,9 @@ described above. The following list of format specifiers may be
 used in the format string to generate a filename that will be
 unique to a given jobid, stepid, node, or task. In each case, 
 the appropriate number of files are opened and associated with
-the corresponding tasks.
+the corresponding tasks. Note that any format string containing 
+%t, %n, and/or %N will be written on the node executing the task 
+rather than the node where \fBsrun\fR executes.
 .RS 10
 .TP
 %J
@@ -1454,9 +1459,13 @@ space:
 Task rank
 One or more task ranks to use this configuration.
 Multiple values may be comma separated.
-Ranges may be indicated with two numbers separated with a '\-'.
+Ranges may be indicated with two numbers separated with a '\-' with 
+the smaller number first (e.g. "0\-4" and not "4\-0").
 To indicate all tasks, specify a rank of '*' (in which case you probably 
 should not be using this option).
+If an attempt is made to initiate a task for which no executable 
+program is defined, the following error message will be produced
+"No executable program specified for this task".
 .TP
 Executable
 The name of the program to execute.
diff --git a/doc/man/man5/bluegene.conf.5 b/doc/man/man5/bluegene.conf.5
index 04355532e..5e0c1df34 100644
--- a/doc/man/man5/bluegene.conf.5
+++ b/doc/man/man5/bluegene.conf.5
@@ -65,7 +65,7 @@ There is no default value and this must be specified.
 \fBAltBlrtsImage\fR
 Alternative BlrtsImage.  This is an optional field only used for 
 mulitple images on a system and should be followed by a Groups= with
-the user groups allowed to use this image (i.e. Groups=da:jette) if 
+the user groups allowed to use this image (i.e. Groups=da,jette) if 
 Groups= is not stated then this image will be able to be used by all
 groups. You can but as many alternative images as you want in the conf file.
 
@@ -73,7 +73,7 @@ groups. You can but as many alternative images as you want in the conf file.
 \fBAltLinuxImage\fR
 Alternative LinuxImage.  This is an optional field only used for 
 mulitple images on a system and should be followed by a Groups= with
-the user groups allowed to use this image (i.e. Groups=da:jette) if 
+the user groups allowed to use this image (i.e. Groups=da,jette) if 
 Groups= is not stated then this image will be able to be used by all
 groups. You can but as many alternative images as you want in the conf file.
 
@@ -81,7 +81,7 @@ groups. You can but as many alternative images as you want in the conf file.
 \fBAltMloaderImage\fR
 Alternative MloaderImage.  This is an optional field only used for 
 mulitple images on a system and should be followed by a Groups= with
-the user groups allowed to use this image (i.e. Groups=da:jette) if 
+the user groups allowed to use this image (i.e. Groups=da,jette) if 
 Groups= is not stated then this image will be able to be used by all
 groups. You can but as many alternative images as you want in the conf file.
 
@@ -89,7 +89,7 @@ groups. You can but as many alternative images as you want in the conf file.
 \fBAltRamDiskImage\fR
 Alternative RamDiskImage.  This is an optional field only used for 
 mulitple images on a system and should be followed by a Groups= with
-the user groups allowed to use this image (i.e. Groups=da:jette) if 
+the user groups allowed to use this image (i.e. Groups=da,jette) if 
 Groups= is not stated then this image will be able to be used by all
 groups. You can but as many alternative images as you want in the conf file.
 
diff --git a/etc/bluegene.conf.example b/etc/bluegene.conf.example
index cc56c650e..a1dfa9fa1 100644
--- a/etc/bluegene.conf.example
+++ b/etc/bluegene.conf.example
@@ -59,10 +59,10 @@ AltRamDiskImage=/bgl/BlueLight/ppcfloor/bglsys/bin/ramdisk3.elf
 
 # Another option for images would be a "You can use anything you like image" *
 # This allows the user to use any image entered with no security checking
-AltBlrtsImage=* Groups=da:adamb
-AltLinuxImage=* Groups=da:adamb
-AltMloaderImage=* Groups=da:adamb
-AltRamDiskImage=*  Groups=da:adamb
+AltBlrtsImage=* Groups=da,adamb
+AltLinuxImage=* Groups=da,adamb
+AltMloaderImage=* Groups=da,adamb
+AltRamDiskImage=*  Groups=da,adamb
 
 LayoutMode=STATIC
 BasePartitionNodeCnt=512
diff --git a/slurm.spec b/slurm.spec
index 858f4eb4e..d3c1fbc89 100644
--- a/slurm.spec
+++ b/slurm.spec
@@ -1,35 +1,96 @@
-# $Id: slurm.spec 12371 2007-09-20 20:45:23Z jette $
-
+# $Id: slurm.spec 12605 2007-11-01 23:12:43Z jette $
+#
 # Note that this package is not relocatable
 
+#
+# build options      .rpmmacros options      change to default action
+# ===============    ====================    ========================
+# --with aix         %_with_aix         1    build aix-federation RPM
+# --with authd       %_with_authd       1    build auth-authd RPM
+# --with auth_none   %_with_auth_none   1    build auth-none RPM
+# --with elan        %_with_elan        1    build switch_elan RPM
+# --without munge    %_without_munge    1    don't build auth-munge RPM
+# --with bluegene    %_with_bluegene    1    build bluegene RPM
+# --with debug       %_with_debug       1    enable extra debugging within SLURM
+# --without pam      %_without_pam      1    don't require pam-devel RPM to be installed
+# --without readline %_without_readline 1    don't require readline-devel RPM to be installed
+# --with sgijob      %_with_sgijob      1    build proctrack-sgi-job RPM
+
+#
+#  Allow defining --with and --without build options or %_with and %without in .rpmmacors
+#    slurm_with    builds option by default unless --without is specified
+#    slurm_without builds option iff --with specified
+#
+%define slurm_with_opt() %{expand:%%{!?_without_%{1}:%%global slurm_with_%{1} 1}}
+%define slurm_without_opt() %{expand:%%{?_with_%{1}:%%global slurm_with_%{1} 1}}
+#
+#  with helper macro to test for slurm_with_*
+#
+%define slurm_with() %{expand:%%{?slurm_with_%{1}:1}%%{!?slurm_with_%{1}:0}}
+
+#  Options that are off by default (enable with --with <opt>)
+%slurm_without_opt elan
+%slurm_without_opt authd
+%slurm_without_opt bluegene
+%slurm_without_opt auth_none
+%slurm_without_opt debug
+%slurm_without_opt sgijob
+
+# Build with munge by default on all platforms (disable with --without munge)
+%slurm_with_opt munge
+
+# Use readline by default on all systems
+%slurm_with_opt readline
+
+# Build with PAM by default on linux
+%ifos linux 
+%slurm_with_opt pam
+%endif
+
+# Define with_aix on AIX systems (for proctrack)
+%ifos aix
+%slurm_with_opt aix
+%endif
+
+
 Name:    slurm
-Version: 1.2.18
+Version: 1.2.19
 Release: 1%{?dist}
 
 Summary: Simple Linux Utility for Resource Management
 
 License: GPL 
 Group: System Environment/Base
-Source: slurm-1.2.18.tar.bz2
+Source: slurm-1.2.19.tar.bz2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
 URL: http://www.llnl.gov/linux/slurm
+BuildRequires: openssl-devel >= 0.9.6 openssl >= 0.9.6
+
+%description 
+SLURM is an open source, fault-tolerant, and highly
+scalable cluster management and job scheduling system for Linux clusters
+containing up to thousands of nodes. Components include machine status,
+partition management, job management, and scheduling modules.
+
+%ifnos aix
+BuildRequires: ncurses-devel
+%endif
 %ifos linux
-BuildRequires: python openssl-devel >= 0.9.6
+BuildRequires: python 
 %endif
-%ifos aix5.3
-Requires: openssl >= 0.9.6 munge-libs proctrack >= 3
-BuildRequires: openssl-devel >= 0.9.6 munge-libs munge-devel proctrack >= 3
+%if %{slurm_with pam}
+BuildRequires: pam-devel
 %endif
-
-#
-# If "--with debug" is set compile with --enable-debug 
-#  and do not strip binaries
-#
-# (See /usr/share/doc/rpm-*/conditionalbuilds)
-#
-%if %{?_with_debug:1}%{!?_with_debug:0}
-  %define _enable_debug --enable-debug
+%if %{slurm_with readline}
+BuildRequires: readline-devel
 %endif
+
+#  Allow override of sysconfdir via _slurm_sysconfdir.
+#  Note 'global' instead of 'define' needed here to work around apparent
+#   bug in rpm macro scoping (or something...)
+%{!?_slurm_sysconfdir: %global _slurm_sysconfdir /etc/slurm}
+%define _sysconfdir %_slurm_sysconfdir
+
 #
 # Never allow rpm to strip binaries as this will break
 #  parallel debugging capability
@@ -45,8 +106,6 @@ BuildRequires: openssl-devel >= 0.9.6 munge-libs munge-devel proctrack >= 3
 # http://slforums.typo3-factory.net/index.php?showtopic=11378
 %define _unpackaged_files_terminate_build      0
 
-%{!?_slurm_sysconfdir: %define _slurm_sysconfdir /etc/slurm}
-%define _sysconfdir %_slurm_sysconfdir
 
 %define _perlarch %(perl -e 'use Config; $T=$Config{installsitearch}; $P=$Config{installprefix}; $T =~ s/$P//; print $T;') 
 
@@ -56,114 +115,110 @@ BuildRequires: openssl-devel >= 0.9.6 munge-libs munge-devel proctrack >= 3
 Summary: Perl API to SLURM.
 Group: Development/System
 Requires: slurm
+%description perlapi
+Perl API package for SLURM.  This package includes the perl API to provide a
+helpful interface to SLURM through Perl.
 
 %package devel
 Summary: Development package for SLURM.
 Group: Development/System
 Requires: slurm
+%description devel
+Development package for SLURM.  This package includes the header files
+and static libraries for the SLURM API.
 
+%if %{slurm_with auth_none}
 %package auth-none
 Summary: SLURM auth NULL implementation (no authentication)
 Group: System Environment/Base
 Requires: slurm
+%description auth-none
+SLURM NULL authentication module
+%endif
 
+%if %{slurm_with authd}
 %package auth-authd
 Summary: SLURM auth implementation using Brent Chun's authd
 Group: System Environment/Base
 Requires: slurm authd
+%description auth-authd
+SLURM authentication module for Brent Chun's authd
+%endif
 
+%if %{slurm_with munge}
 %package auth-munge
 Summary: SLURM auth implementation using Chris Dunlap's Munge
 Group: System Environment/Base
 Requires: slurm munge
+BuildRequires: munge-devel munge-libs
+%description auth-munge
+SLURM authentication module for Chris Dunlap's Munge
+%endif
 
+%if %{slurm_with bluegene}
 %package bluegene
 Summary: SLURM interfaces to IBM Blue Gene system
 Group: System Environment/Base
 Requires: slurm
+%description bluegene
+SLURM plugin interfaces to IBM Blue Gene system
+%endif
 
+%if %{slurm_with elan}
 %package switch-elan
 Summary: SLURM switch plugin for Quadrics Elan3 or Elan4.
 Group: System Environment/Base
 Requires: slurm qsnetlibs
+BuildRequires: qsnetlibs
+%description switch-elan
+SLURM switch plugin for Quadrics Elan3 or Elan4.
+%endif
 
 %package torque
-Summary: Torque wrappers for trasitition from Torque to SLURM.
+Summary: Torque/PBS wrappers for transitition from Torque/PBS to SLURM.
 Group: Development/System
 Requires: slurm
+%description torque
+Torque wrapper scripts used for helping migrate from Torque/PBS to SLURM.
 
+%if %{slurm_with aix}
 %package aix-federation
 Summary: SLURM interfaces to IBM AIX and Federation switch.
 Group: System Environment/Base
 Requires: slurm
+BuildRequires: proctrack >= 3
+%description aix-federation
+SLURM plugins for IBM AIX and Federation switch.
+%endif
 
+%if %{slurm_with sgijob}
 %package proctrack-sgi-job
 Summary: SLURM process tracking plugin for SGI job containers.
 Group: System Environment/Base
 Requires: slurm
-
-%description 
-SLURM is an open source, fault-tolerant, and highly
-scalable cluster management and job scheduling system for Linux clusters
-containing up to thousands of nodes. Components include machine status,
-partition management, job management, and scheduling modules.
-
-%description perlapi
-Perl API package for SLURM.  This package includes the perl API to provide a
-helpful interface to SLURM through Perl.
-
-%description devel
-Development package for SLURM.  This package includes the header files
-and static libraries for the SLURM API.
-
-%description auth-none
-SLURM NULL authentication module
-
-%description auth-authd
-SLURM authentication module for Brent Chun's authd
-
-%description auth-munge
-SLURM authentication module for Chris Dunlap's Munge
-
-%description bluegene
-SLURM plugin interfaces to IBM Blue Gene system
-
-%description switch-elan
-SLURM switch plugin for Quadrics Elan3 or Elan4.
-
-%description aix-federation
-SLURM plugins for IBM AIX and Federation switch.
-
-%description torque
-Torque wrapper scripts used for helping migrate from torque to SLURM.
-
+BuildRequires: job
 %description proctrack-sgi-job
 SLURM process tracking plugin for SGI job containers.
 (See http://oss.sgi.com/projects/pagg).
+%endif
+
+#############################################################################
 
 %prep
-%setup -n slurm-1.2.18
+%setup -n slurm-1.2.19
 
 %build
 %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
-    --sysconfdir=%{_sysconfdir}		\
-    %{?_enable_debug}			\
-    %{?with_proctrack}			\
-    %{?with_ssl}			\
-    %{?with_munge}                      \
+	%{?slurm_with_debug:--enable-debug} \
+    %{?with_proctrack}	\
+    %{?with_ssl}		\
+    %{?with_munge}      \
+	%{!?with_readline:--without-readline} \
     %{?with_cflags}
 
-#
-# The following was stolen from the E17 packages:
-# Build with make -j if SMP is defined in the current environment.
-#
-if [ "x$SMP" != "x" ]; then
-  (make "MAKE=make -k -j $SMP"; exit 0)
-  make
-else
-  make
-fi
-#############################################################################
+make %{?_smp_mflags} 
+
+
 
 %install
 rm -rf "$RPM_BUILD_ROOT"
@@ -180,8 +235,6 @@ if [ -d /etc/init.d ]; then
    install -D -m755 etc/init.d.slurm $RPM_BUILD_ROOT/etc/init.d/slurm
 fi
 install -D -m644 etc/slurm.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.conf.example
-install -D -m644 etc/bluegene.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/bluegene.conf.example
-install -D -m644 etc/federation.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/federation.conf.example
 install -D -m755 etc/slurm.epilog.clean ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.epilog.clean
 
 # Delete unpackaged files:
@@ -211,6 +264,8 @@ test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/switch_elan.so &&
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/proctrack_rms.so &&
   echo %{_libdir}/slurm/proctrack_rms.so          >> $LIST
 
+%if %{slurm_with aix}
+install -D -m644 etc/federation.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/federation.conf.example
 LIST=./aix_federation.files
 touch $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/switch_federation.so &&
@@ -220,6 +275,7 @@ test -f  $RPM_BUILD_ROOT/%{_libdir}/slurm/proctrack_aix.so &&
 test -f  $RPM_BUILD_ROOT/%{_libdir}/slurm/checkpoint_aix.so &&
   echo %{_libdir}/slurm/checkpoint_aix.so         >> $LIST
 echo "%config %{_sysconfdir}/federation.conf.example" >> $LIST
+%endif
 
 LIST=./perlapi.files
 touch $LIST
@@ -239,6 +295,8 @@ echo "%{_bindir}/qsub"                        >> $LIST
 echo "%{_bindir}/mpiexec"                     >> $LIST
 
 
+%if %{slurm_with bluegene}
+install -D -m644 etc/bluegene.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/bluegene.conf.example
 LIST=./bluegene.files
 touch $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/select_bluegene.so &&
@@ -250,11 +308,14 @@ echo "%{_sbindir}/slurm_epilog"                   >> $LIST
 echo "%{_sbindir}/slurm_prolog"                   >> $LIST
 echo "%{_sbindir}/sfree"                          >> $LIST
 echo "%config %{_sysconfdir}/bluegene.conf.example" >> $LIST
+%endif
 
+%if %{slurm_with sgijob}
 LIST=./sgi-job.files
 touch $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/proctrack_sgi_job.so &&
 echo "%{_libdir}/slurm/proctrack_sgi_job.so" >> $LIST
+%endif
 
 #############################################################################
 
@@ -330,41 +391,56 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man3/*
 #############################################################################
 
+%if %{slurm_with auth_none}
 %files auth-none
 %defattr(-,root,root)
 %{_libdir}/slurm/auth_none.so
+%endif
 #############################################################################
 
+%if %{slurm_with munge}
 %files -f auth_munge.files auth-munge
 %defattr(-,root,root)
+%endif
 #############################################################################
 
+%if %{slurm_with authd}
 %files -f auth_authd.files auth-authd
 %defattr(-,root,root)
+%endif
 #############################################################################
 
+%if %{slurm_with bluegene}
 %files -f bluegene.files bluegene
 %defattr(-,root,root)
+%endif
 #############################################################################
 
 %files -f perlapi.files perlapi
 %defattr(-,root,root)
 #############################################################################
 
+%if %{slurm_with elan}
 %files -f switch_elan.files switch-elan
 %defattr(-,root,root)
+%endif
 #############################################################################
 
 %files -f torque.files torque
 %defattr(-,root,root)
 #############################################################################
 
+%if %{slurm_with aix}
 %files -f aix_federation.files aix-federation
 %defattr(-,root,root)
+%endif
 #############################################################################
 
+%if %{slurm_with sgijob}
 %files -f sgi-job.files proctrack-sgi-job
 %defattr(-,root,root)
+%endif
+#############################################################################
 
 %pre
 #if [ -x /etc/init.d/slurm ]; then
diff --git a/src/Makefile.in b/src/Makefile.in
index e2adef7aa..80490da89 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/api/Makefile.in b/src/api/Makefile.in
index bf7c01b6c..4e9f9cfe6 100644
--- a/src/api/Makefile.in
+++ b/src/api/Makefile.in
@@ -195,6 +195,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 0c7f29aff..6f1c3d291 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -222,6 +222,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/common/bitstring.h b/src/common/bitstring.h
index 301d0b21d..01ca9b4c0 100644
--- a/src/common/bitstring.h
+++ b/src/common/bitstring.h
@@ -74,10 +74,10 @@
 #define BITSTR_SHIFT_WORD64	6
 
 #ifdef USE_64BIT_BITSTR
-typedef uint64_t bitstr_t;
+typedef int64_t bitstr_t;
 #define BITSTR_SHIFT 		BITSTR_SHIFT_WORD64
 #else
-typedef uint32_t bitstr_t;
+typedef int32_t bitstr_t;
 #define BITSTR_SHIFT 		BITSTR_SHIFT_WORD32
 #endif
 
diff --git a/src/common/env.c b/src/common/env.c
index a8d139c6f..6502fd56b 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -1,8 +1,8 @@
 /*****************************************************************************\
  *  src/common/env.c - add an environment variable to environment vector
- *  $Id: env.c 12448 2007-10-05 00:45:10Z jette $
+ *  $Id: env.c 12592 2007-10-31 21:12:49Z jette $
  *****************************************************************************
- *  Copyright (C) 2002-2006 The Regents of the University of California.
+ *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Mark Grondona <mgrondona@llnl.gov>, Danny Auble <da@llnl.gov>.
  *  UCRL-CODE-226842.
@@ -75,7 +75,7 @@ strong_alias(env_array_append_fmt,	slurm_env_array_append_fmt);
 strong_alias(env_array_overwrite,	slurm_env_array_overwrite);
 strong_alias(env_array_overwrite_fmt,	slurm_env_array_overwrite_fmt);
 
-#define SU_WAIT_MSEC 3000	/* 3000 msec for /bin/su to return user 
+#define SU_WAIT_MSEC 8000	/* 8000 msec for /bin/su to return user 
 				 * env vars for --get-user-env option */
 /*
  *  Return pointer to `name' entry in environment if found, or
@@ -1218,17 +1218,61 @@ static void _strip_cr_nl(char *line)
 	}
 }
 
+/*
+ * Load user environment from a cache file located in
+ * <state_save_location>/env_username
+ */
+char **_load_env_cache(const char *username)
+{
+	char *state_save_loc, fname[BUFSIZ];
+	char line[BUFSIZ], name[BUFSIZ], value[BUFSIZ];
+	char **env = NULL;
+	FILE *fp;
+	int i;
+
+	state_save_loc = slurm_get_state_save_location();
+	i = snprintf(fname, sizeof(fname), "%s/env_cache/%s", state_save_loc, 
+		     username);
+	xfree(state_save_loc);
+	if (i < 0) {
+		fatal("Environment cache filename overflow");
+		return NULL;
+	}
+	if (!(fp = fopen(fname, "r"))) {
+		fatal("Could not open user environment cache at %s: %m",
+			fname);
+		return NULL;
+	}
+
+	info("Getting cached environment variables at %s", fname);
+	env = env_array_create();
+	while (1) {
+		if (!fgets(line, BUFSIZ, fp))
+			break;
+		_strip_cr_nl(line);
+		_env_array_entry_splitter(line, name, BUFSIZ, value, BUFSIZ);
+		env_array_overwrite(&env, name, value);
+	}
+	fclose(fp);
+	return env;
+}
+
 /*
  * Return an array of strings representing the specified user's default
- * environment variables, as determined by calling (more-or-less)
- * "/bin/su - <username> -c /usr/bin/env".
+ * environment variables following a two-prongged approach. 
+ * 1. Execute (more or less): "/bin/su - <username> -c /usr/bin/env"
+ *    Depending upon the user's login scripts, this may take a very
+ *    long time to complete or possibly never return
+ * 2. Load the user environment from a cache file. This is used
+ *    in the event that option 1 times out.
  *
+ * timeout value is in seconds or zero for default (8 secs) 
  * On error, returns NULL.
  *
  * NOTE: The calling process must have an effective uid of root for
  * this function to succeed.
  */
-char **env_array_user_default(const char *username)
+char **env_array_user_default(const char *username, int timeout)
 {
 	FILE *su;
 	char line[BUFSIZ];
@@ -1249,13 +1293,13 @@ char **env_array_user_default(const char *username)
 	}
 
 	if (pipe(fildes) < 0) {
-		error("pipe: %m");
+		fatal("pipe: %m");
 		return NULL;
 	}
 
 	child = fork();
 	if (child == -1) {
-		error("fork: %m");
+		fatal("fork: %m");
 		return NULL;
 	}
 	if (child == 0) {
@@ -1267,11 +1311,9 @@ char **env_array_user_default(const char *username)
 		snprintf(cmdstr, sizeof(cmdstr),
 			 "echo; echo; echo; echo %s; env; echo %s",
 			 starttoken, stoptoken);
-#if 0
-		/* execute .profile only */
+#ifdef LOAD_ENV_NO_LOGIN
 		execl("/bin/su", "su", username, "-c", cmdstr, NULL);
 #else
-		/* execute .login plus .profile */
 		execl("/bin/su", "su", "-", username, "-c", cmdstr, NULL);
 #endif
 		exit(1);
@@ -1291,7 +1333,10 @@ char **env_array_user_default(const char *username)
 	found = 0;
 	while (!found) {
 		gettimeofday(&now, NULL);
-		timeleft = SU_WAIT_MSEC;
+		if (timeout > 0)
+			timeleft = timeout * 1000;
+		else
+			timeleft = SU_WAIT_MSEC;
 		timeleft -= (now.tv_sec -  begin.tv_sec)  * 1000;
 		timeleft -= (now.tv_usec - begin.tv_usec) / 1000;
 		if (timeleft <= 0)
@@ -1306,7 +1351,7 @@ char **env_array_user_default(const char *username)
 			error("poll: %m");
 			break;
 		}
-		if ((ufds.revents & POLLERR) || (ufds.revents & POLLHUP))
+		if (!(ufds.revents & POLLIN))
 			break;
 		while (fgets(line, BUFSIZ, su)) {
 			if (!strncmp(line, starttoken, len)) {
@@ -1316,9 +1361,9 @@ char **env_array_user_default(const char *username)
 		}
 	}
 	if (!found) {
-		error("Failed to get user environment variables");
+		error("Failed to get current user environment variables");
 		close(fildes[0]);
-		return NULL;
+		return _load_env_cache(username);
 	}
 
 	/* Now read in the environment variable strings. */
@@ -1327,7 +1372,10 @@ char **env_array_user_default(const char *username)
 	found = 0;
 	while (!found) {
 		gettimeofday(&now, NULL);
-		timeleft = SU_WAIT_MSEC;
+		if (timeout > 0)
+			timeleft = timeout * 1000;
+		else
+			timeleft = SU_WAIT_MSEC;
 		timeleft -= (now.tv_sec -  begin.tv_sec)  * 1000;
 		timeleft -= (now.tv_usec - begin.tv_usec) / 1000;
 		if (timeleft <= 0)
@@ -1343,7 +1391,7 @@ char **env_array_user_default(const char *username)
 			break;
 		}
 		/* stop at the line containing the stoptoken string */
-		if ((ufds.revents & POLLERR) || (ufds.revents & POLLHUP))
+		if (!(ufds.revents & POLLIN))
 			break;
 		if ((fgets(line, BUFSIZ, su) == 0) ||
 		    (!strncmp(line, stoptoken, len))) {
diff --git a/src/common/env.h b/src/common/env.h
index 5b829a895..01ed6c770 100644
--- a/src/common/env.h
+++ b/src/common/env.h
@@ -241,11 +241,12 @@ void env_array_set_environment(char **env_array);
  * environment variables, as determined by calling (more-or-less)
  * "/bin/su - <username> -c /usr/bin/env".
  *
+ * timeout value is in seconds or zero for default (8 secs)
  * On error, returns NULL.
  *
  * NOTE: The calling process must have an effective uid of root for
  * this function to succeed.
  */
-char **env_array_user_default(const char *username);
+char **env_array_user_default(const char *username, int timeout);
 
 #endif
diff --git a/src/common/hostlist.c b/src/common/hostlist.c
index 82454eb34..61fee0aba 100644
--- a/src/common/hostlist.c
+++ b/src/common/hostlist.c
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  $Id: hostlist.c 12391 2007-09-22 00:23:04Z da $
+ *  $Id: hostlist.c 12538 2007-10-23 17:11:04Z jette $
  *****************************************************************************
  *  $LSDId: hostlist.c,v 1.14 2003/10/14 20:11:54 grondo Exp $
  *****************************************************************************
@@ -864,9 +864,6 @@ static char *hostrange_pop(hostrange_t hr)
 {
 	size_t size = 0;
 	char *host = NULL;
-#ifdef HAVE_BG
-	int coord[3];
-#endif
 	assert(hr != NULL);
 
 	if (hr->singlehost) {
@@ -877,15 +874,21 @@ static char *hostrange_pop(hostrange_t hr)
 		if (!(host = (char *) malloc(size * sizeof(char))))
 			out_of_memory("hostrange pop");
 #ifdef HAVE_BG
-		coord[0] = hr->hi / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (hr->hi % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (hr->hi % HOSTLIST_BASE);
+		if (hr->width == 3) {
+			int coord[3];
+			coord[0] = hr->hi / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (hr->hi % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (hr->hi % HOSTLIST_BASE);
 		
-		snprintf(host, size, "%s%c%c%c", hr->prefix, 
-			 alpha_num[coord[0]], alpha_num[coord[1]],
-			 alpha_num[coord[2]]);
-		hr->hi--;
+			snprintf(host, size, "%s%c%c%c", hr->prefix, 
+				 alpha_num[coord[0]], alpha_num[coord[1]],
+				 alpha_num[coord[2]]);
+			hr->hi--;
+		} else {
+			snprintf(host, size, "%s%0*lu", hr->prefix, 
+				 hr->width, hr->hi--);
+		}
 #else
 		snprintf(host, size, "%s%0*lu", hr->prefix, 
 			 hr->width, hr->hi--);
@@ -900,9 +903,6 @@ static char *hostrange_shift(hostrange_t hr)
 {
 	size_t size = 0;
 	char *host = NULL;
-#ifdef HAVE_BG
-	int coord[3];
-#endif
 
 	assert(hr != NULL);
 
@@ -915,14 +915,20 @@ static char *hostrange_shift(hostrange_t hr)
 		if (!(host = (char *) malloc(size * sizeof(char))))
 			out_of_memory("hostrange shift");
 #ifdef HAVE_BG
-		coord[0] = hr->lo / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (hr->lo % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (hr->lo % HOSTLIST_BASE);
-		snprintf(host, size, "%s%c%c%c", hr->prefix, 
-			 alpha_num[coord[0]], alpha_num[coord[1]],
-			 alpha_num[coord[2]]);
-		hr->lo++;
+		if (hr->width == 3) {
+			int coord[3];
+			coord[0] = hr->lo / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (hr->lo % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (hr->lo % HOSTLIST_BASE);
+			snprintf(host, size, "%s%c%c%c", hr->prefix, 
+				 alpha_num[coord[0]], alpha_num[coord[1]],
+				 alpha_num[coord[2]]);
+			hr->lo++;
+		} else {
+			snprintf(host, size, "%s%0*lu", hr->prefix,
+				 hr->width, hr->lo++);
+		}
 #else		
 		snprintf(host, size, "%s%0*lu", hr->prefix,
 			hr->width, hr->lo++);
@@ -1049,14 +1055,19 @@ hostrange_to_string(hostrange_t hr, size_t n, char *buf, char *separator)
 		size_t m = (n - len) <= n ? n - len : 0; /* check for < 0 */
 		int ret = 0;
 #ifdef HAVE_BG
-		int coord[3];
-		coord[0] = i / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (i % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (i % HOSTLIST_BASE);
-		ret = snprintf(buf + len, m, "%s%c%c%c", hr->prefix, 
-				alpha_num[coord[0]], alpha_num[coord[1]],
-				alpha_num[coord[2]]);
+		if (hr->width == 3) {
+			int coord[3];
+			coord[0] = i / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (i % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (i % HOSTLIST_BASE);
+			ret = snprintf(buf + len, m, "%s%c%c%c", hr->prefix, 
+					alpha_num[coord[0]], alpha_num[coord[1]],
+					alpha_num[coord[2]]);
+		} else {
+			ret = snprintf(buf + len, m, "%s%0*lu",
+				       hr->prefix, hr->width, i);
+		}
 #else		
 		ret = snprintf(buf + len, m, "%s%0*lu",
 			       hr->prefix, hr->width, i);
@@ -1086,10 +1097,6 @@ hostrange_to_string(hostrange_t hr, size_t n, char *buf, char *separator)
 static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf)
 {
 	int len = 0;
-#ifdef HAVE_BG
-	int coord[3];
-#endif
-
 	assert(buf != NULL);
 	assert(hr != NULL);
 
@@ -1097,12 +1104,17 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf)
 		return 0;
 
 #ifdef HAVE_BG
-	coord[0] = hr->lo / (HOSTLIST_BASE * HOSTLIST_BASE);
-	coord[1] = (hr->lo % (HOSTLIST_BASE * HOSTLIST_BASE)) / HOSTLIST_BASE;
-	coord[2] = (hr->lo % HOSTLIST_BASE);
-	len = snprintf(buf, n, "%c%c%c",  
-		       alpha_num[coord[0]], alpha_num[coord[1]],
-		       alpha_num[coord[2]]);	
+	if (hr->width == 3) {
+		int coord[3];
+		coord[0] = hr->lo / (HOSTLIST_BASE * HOSTLIST_BASE);
+		coord[1] = (hr->lo % (HOSTLIST_BASE * HOSTLIST_BASE)) / HOSTLIST_BASE;
+		coord[2] = (hr->lo % HOSTLIST_BASE);
+		len = snprintf(buf, n, "%c%c%c",  
+			       alpha_num[coord[0]], alpha_num[coord[1]],
+			       alpha_num[coord[2]]);
+	} else {
+		len = snprintf(buf, n, "%0*lu", hr->width, hr->lo);
+	}
 #else		
 	len = snprintf(buf, n, "%0*lu", hr->width, hr->lo);
 #endif
@@ -1110,13 +1122,19 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf)
 	if ((len >= 0) && (len < n) && (hr->lo < hr->hi)) {
 		int len2 = 0;
 #ifdef HAVE_BG
-		coord[0] = hr->hi / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (hr->hi % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (hr->hi % HOSTLIST_BASE);
-		len2 = snprintf(buf+len, n-len, "-%c%c%c",  
-				alpha_num[coord[0]], alpha_num[coord[1]],
-				alpha_num[coord[2]]);	
+		if (hr->width == 3) {
+			int coord[3];
+			coord[0] = hr->hi / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (hr->hi % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (hr->hi % HOSTLIST_BASE);
+			len2 = snprintf(buf+len, n-len, "-%c%c%c",  
+					alpha_num[coord[0]], alpha_num[coord[1]],
+					alpha_num[coord[2]]);
+		} else {
+			len2 = snprintf(buf+len, n-len, "-%0*lu", 
+					hr->width, hr->hi);
+		}
 #else				
 		len2 = snprintf(buf+len, n-len, "-%0*lu", hr->width, hr->hi);
 #endif
@@ -1549,18 +1567,22 @@ static int _parse_box_range(char *str, struct _range *ranges, int len, int *coun
 		return 0;
 
 	for(i = 0; i<3; i++) {
-		a[i] = str[i] - '0';
-		/* Remove the extra chars inbetween the 9 and A */
-		if(a[i] > 9) 
-			a[i] -= 7;
-		if ((a[i] < 0) || (a[i] > 36)) 
+		if ((str[i] >= '0') && (str[i] <= '9'))
+			a[i] = str[i] - '0';
+		else if ((str[i] >= 'a') && (str[i] <= 'z'))
+			a[i] = str[i] - 'a' + 10;
+		else if ((str[i] >= 'A') && (str[i] <= 'Z'))
+			a[i] = str[i] - 'A' + 10;
+		else
 			return 0;
-		
-		b[i] = str[i+4] - '0';
-		/* Remove the extra chars inbetween the 9 and A */
-		if(b[i] > 9) 
-			b[i] -= 7;
-		if ((b[i] < 0) || (b[i] > 36)) 
+
+		if ((str[i+4] >= '0') && (str[i+4] <= '9'))
+			b[i] = str[i+4] - '0';
+		else if ((str[i+4] >= 'a') && (str[i+4] <= 'z'))
+			b[i] = str[i+4] - 'a' + 10;
+		else if ((str[i+4] >= 'A') && (str[i+4] <= 'Z'))
+			b[i] = str[i+4] - 'A' + 10;
+		else
 			return 0;
 	}
 
@@ -1993,15 +2015,20 @@ _hostrange_string(hostrange_t hr, int depth)
 
 	if (!hr->singlehost) {
 #ifdef HAVE_BG
-		int coord[3];
-		int temp = hr->lo+depth;
-		coord[0] = temp / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (temp % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (temp % HOSTLIST_BASE);
-		snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%c%c%c",
-			 alpha_num[coord[0]], alpha_num[coord[1]],
-			 alpha_num[coord[2]]);
+		if (hr->width == 3) {
+			int coord[3];
+			int temp = hr->lo+depth;
+			coord[0] = temp / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (temp % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (temp % HOSTLIST_BASE);
+			snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%c%c%c",
+				 alpha_num[coord[0]], alpha_num[coord[1]],
+				 alpha_num[coord[2]]);
+		} else {
+			snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%0*lu", 
+				 hr->width, hr->lo + depth);
+		}
 #else
 		snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%0*lu", 
 			 hr->width, hr->lo + depth);
@@ -2519,9 +2546,14 @@ size_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf)
 	if (hl->nranges < 1)
 		goto notbox;	/* no data */
 	if (hl->hr[0]->width != 3) {
-		error("This node is not in bluegene format.  "
-		      "The suffix was %d chars in length",
-		      hl->hr[0]->width);	/* not Bluegene format */
+		/* We use this logic to build task list ranges, so
+		 * this does not necessarily contain a BlueGene
+		 * host list. It could just be numeric values */
+		if (hl->hr[0]->prefix[0]) {
+			error("This node is not in bluegene format.  "
+		 	     "The suffix was %d chars in length",
+		  	    hl->hr[0]->width);
+		}
 		goto notbox; 
 	}
 	_clear_grid();
@@ -2695,15 +2727,20 @@ char *hostlist_next(hostlist_iterator_t i)
 	len = snprintf(buf, MAXHOSTNAMELEN + 15, "%s", i->hr->prefix);
 	if (!i->hr->singlehost) {
 #ifdef HAVE_BG
-		int coord[3];
-		int temp = i->hr->lo + i->depth;
-		coord[0] = temp / (HOSTLIST_BASE * HOSTLIST_BASE);
-		coord[1] = (temp % (HOSTLIST_BASE * HOSTLIST_BASE))
-			/ HOSTLIST_BASE;
-		coord[2] = (temp % HOSTLIST_BASE);
-		snprintf(buf + len, MAXHOSTNAMELEN + 15 - len, "%c%c%c",
-			 alpha_num[coord[0]], alpha_num[coord[1]],
-			 alpha_num[coord[2]]);
+		if (i->hr->width == 3) {
+			int coord[3];
+			int temp = i->hr->lo + i->depth;
+			coord[0] = temp / (HOSTLIST_BASE * HOSTLIST_BASE);
+			coord[1] = (temp % (HOSTLIST_BASE * HOSTLIST_BASE))
+				/ HOSTLIST_BASE;
+			coord[2] = (temp % HOSTLIST_BASE);
+			snprintf(buf + len, MAXHOSTNAMELEN + 15 - len, "%c%c%c",
+				 alpha_num[coord[0]], alpha_num[coord[1]],
+				 alpha_num[coord[2]]);
+		} else {
+			snprintf(buf + len, MAXHOSTNAMELEN + 15 - len, "%0*lu",
+				 i->hr->width, i->hr->lo + i->depth);
+		}
 #else
 		snprintf(buf + len, MAXHOSTNAMELEN + 15 - len, "%0*lu",
 			i->hr->width, i->hr->lo + i->depth);
diff --git a/src/common/read_config.c b/src/common/read_config.c
index 6eb76072a..01976c812 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -75,11 +75,6 @@ static s_p_hashtbl_t *conf_hashtbl = NULL;
 static slurm_ctl_conf_t *conf_ptr = &slurmctld_conf;
 static bool conf_initialized = false;
 
-static uint16_t global_slurmd_port = SLURMD_PORT;
-static int parse_slurmd_port(void **dest, slurm_parser_enum_t type,
-			     const char *key, const char *value,
-			     const char *line, char **leftover);
-
 static s_p_hashtbl_t *default_nodename_tbl;
 static s_p_hashtbl_t *default_partition_tbl;
 
@@ -176,7 +171,7 @@ s_p_options_t slurm_conf_options[] = {
 	{"SlurmdDebug", S_P_UINT16},
 	{"SlurmdLogFile", S_P_STRING},
 	{"SlurmdPidFile",  S_P_STRING},
-	{"SlurmdPort", S_P_UINT32, parse_slurmd_port},
+	{"SlurmdPort", S_P_UINT32},
 	{"SlurmdSpoolDir", S_P_STRING},
 	{"SlurmdTimeout", S_P_UINT16},
 	{"SrunEpilog", S_P_STRING},
@@ -202,46 +197,6 @@ s_p_options_t slurm_conf_options[] = {
 };
 
 
-/*
- * This function works almost exactly the same as the
- * default S_P_UINT32 handler, except that it also sets the
- * global variable global_slurmd_port.
- */
-static int parse_slurmd_port(void **dest, slurm_parser_enum_t type,
-			     const char *key, const char *value,
-			     const char *line, char **leftover)
-{
-	char *endptr;
-	unsigned long num;
-	uint32_t *ptr;
-
-	errno = 0;
-	num = strtoul(value, &endptr, 0);
-	if ((num == 0 && errno == EINVAL)
-	    || (*endptr != '\0')) {
-		error("%s value (%s) is not a valid number", key, value);
-		return -1;
-	} else if (errno == ERANGE) {
-		error("%s value (%s) is out of range", key, value);
-		return -1;
-	} else if (num < 0) {
-		error("value %s (%s) is less than zero", key, value);
-		return -1;
-	} else if (num > 0xffffffff) {
-		error("%s value (%s) is greater than 4294967295", 
-			key, value);
-		return -1;
-	}
-
-	global_slurmd_port = (uint16_t) num;
-
-	ptr = (uint32_t *)xmalloc(sizeof(uint32_t));
-	*ptr = (uint32_t)num;
-	*dest = (void *)ptr;
-
-	return 1;
-}
-
 static int defunct_option(void **dest, slurm_parser_enum_t type,
 			  const char *key, const char *value,
 			  const char *line, char **leftover)
@@ -323,7 +278,10 @@ static int parse_nodename(void **dest, slurm_parser_enum_t type,
 
 		if (!s_p_get_uint16(&n->port, "Port", tbl)
 		    && !s_p_get_uint16(&n->port, "Port", dflt)) {
-			n->port = global_slurmd_port;
+			/* This gets resolved in slurm_conf_get_port()
+			 * and slurm_conf_get_addr(). For now just
+			 * leave with a value of zero */
+			n->port = 0;
 		}
 
 		if (!s_p_get_uint16(&n->cpus, "Procs", tbl)
@@ -910,7 +868,8 @@ extern uint16_t slurm_conf_get_port(const char *node_name)
 		if (strcmp(p->alias, node_name) == 0) {
 			uint16_t port = p->port;
 			if (!port)
-				port = global_slurmd_port;
+				p->port = (uint16_t) conf_ptr->slurmd_port;
+			port = p->port;
 			slurm_conf_unlock();
 			return port;
 		}
@@ -937,6 +896,8 @@ extern int slurm_conf_get_addr(const char *node_name, slurm_addr *address)
 	p = node_to_host_hashtbl[idx];
 	while (p) {
 		if (strcmp(p->alias, node_name) == 0) {
+			if (!p->port)
+				p->port = (uint16_t) conf_ptr->slurmd_port;
 			if (!p->addr_initialized) {
 				slurm_set_addr(&p->addr, p->port, p->address);
 				p->addr_initialized = true;
diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c
index bb0eac94b..2da16712c 100644
--- a/src/common/slurm_protocol_api.c
+++ b/src/common/slurm_protocol_api.c
@@ -229,6 +229,21 @@ char *slurm_get_plugin_dir(void)
 	return plugin_dir;
 }
 
+/* slurm_get_state_save_location
+ * get state_save_location from slurmctld_conf object from slurmctld_conf object 
+ * RET char *   - state_save_location directory, MUST be xfreed by caller
+ */
+char *slurm_get_state_save_location(void)
+{
+	char *state_save_loc;
+	slurm_ctl_conf_t *conf;
+
+	conf = slurm_conf_lock();
+	state_save_loc = xstrdup(conf->state_save_location);
+	slurm_conf_unlock();
+	return state_save_loc;
+}
+
 /* slurm_get_auth_type
  * returns the authentication type from slurmctld_conf object
  * RET char *    - auth type, MUST be xfreed by caller
diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h
index fabc62d71..2efb4854c 100644
--- a/src/common/slurm_protocol_api.h
+++ b/src/common/slurm_protocol_api.h
@@ -130,6 +130,12 @@ void inline slurm_api_clear_config(void);
  */
 char *slurm_get_plugin_dir(void);
 
+/* slurm_get_state_save_location
+ * get state_save_location from slurmctld_conf object from slurmctld_conf object 
+ * RET char *   - state_save_location directory, MUST be xfreed by caller
+ */
+char *slurm_get_state_save_location(void);
+
 /* slurm_get_auth_type
  * returns the authentication type from slurmctld_conf object
  * RET char *    - auth type, MUST be xfreed by caller
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index 3309b737c..5f33633d4 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -1,7 +1,7 @@
 /****************************************************************************\
  *  slurm_protocol_pack.c - functions to pack and unpack structures for RPCs
  *
- *  $Id: slurm_protocol_pack.c 12088 2007-08-22 18:02:24Z jette $
+ *  $Id: slurm_protocol_pack.c 12532 2007-10-22 22:52:39Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -2435,15 +2435,15 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer)
 		}
 		if (job_desc_ptr->linuximage)
 			select_g_set_jobinfo(job_desc_ptr->select_jobinfo, 
-					     SELECT_DATA_BLRTS_IMAGE, 
+					     SELECT_DATA_LINUX_IMAGE, 
 					     job_desc_ptr->linuximage);
 		if (job_desc_ptr->mloaderimage)
 			select_g_set_jobinfo(job_desc_ptr->select_jobinfo, 
-					     SELECT_DATA_BLRTS_IMAGE, 
+					     SELECT_DATA_MLOADER_IMAGE, 
 					     job_desc_ptr->mloaderimage);
 		if (job_desc_ptr->ramdiskimage)
 			select_g_set_jobinfo(job_desc_ptr->select_jobinfo, 
-					     SELECT_DATA_BLRTS_IMAGE, 
+					     SELECT_DATA_RAMDISK_IMAGE, 
 					     job_desc_ptr->ramdiskimage);
 		select_g_pack_jobinfo(job_desc_ptr->select_jobinfo, buffer);
 		select_g_free_jobinfo(&job_desc_ptr->select_jobinfo);
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 3b2117495..67192790a 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/auth/Makefile.in b/src/plugins/auth/Makefile.in
index 072efa47d..97f40a1cc 100644
--- a/src/plugins/auth/Makefile.in
+++ b/src/plugins/auth/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/auth/authd/Makefile.in b/src/plugins/auth/authd/Makefile.in
index 81a55196d..388e2677c 100644
--- a/src/plugins/auth/authd/Makefile.in
+++ b/src/plugins/auth/authd/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/auth/munge/Makefile.in b/src/plugins/auth/munge/Makefile.in
index 421fbfe19..a891850ef 100644
--- a/src/plugins/auth/munge/Makefile.in
+++ b/src/plugins/auth/munge/Makefile.in
@@ -177,6 +177,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/auth/none/Makefile.in b/src/plugins/auth/none/Makefile.in
index 271277723..eeaefacd3 100644
--- a/src/plugins/auth/none/Makefile.in
+++ b/src/plugins/auth/none/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/checkpoint/Makefile.in b/src/plugins/checkpoint/Makefile.in
index 76fbb3d01..c195f945d 100644
--- a/src/plugins/checkpoint/Makefile.in
+++ b/src/plugins/checkpoint/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/checkpoint/aix/Makefile.in b/src/plugins/checkpoint/aix/Makefile.in
index eb99367b5..e7c8bbf0d 100644
--- a/src/plugins/checkpoint/aix/Makefile.in
+++ b/src/plugins/checkpoint/aix/Makefile.in
@@ -180,6 +180,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/checkpoint/none/Makefile.in b/src/plugins/checkpoint/none/Makefile.in
index fd29dc4be..3a4305892 100644
--- a/src/plugins/checkpoint/none/Makefile.in
+++ b/src/plugins/checkpoint/none/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/checkpoint/ompi/Makefile.in b/src/plugins/checkpoint/ompi/Makefile.in
index 9a8d725b9..a62dcd895 100644
--- a/src/plugins/checkpoint/ompi/Makefile.in
+++ b/src/plugins/checkpoint/ompi/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobacct/Makefile.in b/src/plugins/jobacct/Makefile.in
index a2a82460e..0df53ec28 100644
--- a/src/plugins/jobacct/Makefile.in
+++ b/src/plugins/jobacct/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobacct/aix/Makefile.in b/src/plugins/jobacct/aix/Makefile.in
index 6ff4b5048..9ddd082c1 100644
--- a/src/plugins/jobacct/aix/Makefile.in
+++ b/src/plugins/jobacct/aix/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobacct/linux/Makefile.in b/src/plugins/jobacct/linux/Makefile.in
index f2ef24897..e14899c36 100644
--- a/src/plugins/jobacct/linux/Makefile.in
+++ b/src/plugins/jobacct/linux/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobacct/none/Makefile.in b/src/plugins/jobacct/none/Makefile.in
index acd2728a6..ad57db32d 100644
--- a/src/plugins/jobacct/none/Makefile.in
+++ b/src/plugins/jobacct/none/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobcomp/Makefile.in b/src/plugins/jobcomp/Makefile.in
index 0d5c5b51f..756a9dcb2 100644
--- a/src/plugins/jobcomp/Makefile.in
+++ b/src/plugins/jobcomp/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobcomp/filetxt/Makefile.in b/src/plugins/jobcomp/filetxt/Makefile.in
index 8ba74cad6..ce8f66b1c 100644
--- a/src/plugins/jobcomp/filetxt/Makefile.in
+++ b/src/plugins/jobcomp/filetxt/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobcomp/none/Makefile.in b/src/plugins/jobcomp/none/Makefile.in
index 2f555f0b9..ef118a378 100644
--- a/src/plugins/jobcomp/none/Makefile.in
+++ b/src/plugins/jobcomp/none/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/jobcomp/script/Makefile.in b/src/plugins/jobcomp/script/Makefile.in
index 8547bcea8..5c262974d 100644
--- a/src/plugins/jobcomp/script/Makefile.in
+++ b/src/plugins/jobcomp/script/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/Makefile.in b/src/plugins/mpi/Makefile.in
index ee6447965..48bf6e365 100644
--- a/src/plugins/mpi/Makefile.in
+++ b/src/plugins/mpi/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/lam/Makefile.in b/src/plugins/mpi/lam/Makefile.in
index 3d347a991..9fc4e0917 100644
--- a/src/plugins/mpi/lam/Makefile.in
+++ b/src/plugins/mpi/lam/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/mpich1_p4/Makefile.in b/src/plugins/mpi/mpich1_p4/Makefile.in
index 705bc6cb2..f30e9f8d1 100644
--- a/src/plugins/mpi/mpich1_p4/Makefile.in
+++ b/src/plugins/mpi/mpich1_p4/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/mpich1_shmem/Makefile.in b/src/plugins/mpi/mpich1_shmem/Makefile.in
index 751920cb5..cbdc0c145 100644
--- a/src/plugins/mpi/mpich1_shmem/Makefile.in
+++ b/src/plugins/mpi/mpich1_shmem/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/mpichgm/Makefile.in b/src/plugins/mpi/mpichgm/Makefile.in
index a91d7bdc3..4d723c0aa 100644
--- a/src/plugins/mpi/mpichgm/Makefile.in
+++ b/src/plugins/mpi/mpichgm/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/mpichmx/Makefile.in b/src/plugins/mpi/mpichmx/Makefile.in
index 4b0feba9c..a59463b8b 100644
--- a/src/plugins/mpi/mpichmx/Makefile.in
+++ b/src/plugins/mpi/mpichmx/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/mvapich/Makefile.in b/src/plugins/mpi/mvapich/Makefile.in
index fb80b75b7..7cf94d7fd 100644
--- a/src/plugins/mpi/mvapich/Makefile.in
+++ b/src/plugins/mpi/mvapich/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/none/Makefile.in b/src/plugins/mpi/none/Makefile.in
index 3c481a339..97d80b08f 100644
--- a/src/plugins/mpi/none/Makefile.in
+++ b/src/plugins/mpi/none/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/mpi/openmpi/Makefile.in b/src/plugins/mpi/openmpi/Makefile.in
index 19640c32e..19e48800d 100644
--- a/src/plugins/mpi/openmpi/Makefile.in
+++ b/src/plugins/mpi/openmpi/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/Makefile.in b/src/plugins/proctrack/Makefile.in
index d3c317f41..936995f07 100644
--- a/src/plugins/proctrack/Makefile.in
+++ b/src/plugins/proctrack/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/aix/Makefile.in b/src/plugins/proctrack/aix/Makefile.in
index 561b0bc62..28d167813 100644
--- a/src/plugins/proctrack/aix/Makefile.in
+++ b/src/plugins/proctrack/aix/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/linuxproc/Makefile.in b/src/plugins/proctrack/linuxproc/Makefile.in
index 92ede117f..1dadf4deb 100644
--- a/src/plugins/proctrack/linuxproc/Makefile.in
+++ b/src/plugins/proctrack/linuxproc/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/pgid/Makefile.in b/src/plugins/proctrack/pgid/Makefile.in
index e60afafeb..fe1a1ba08 100644
--- a/src/plugins/proctrack/pgid/Makefile.in
+++ b/src/plugins/proctrack/pgid/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/rms/Makefile.in b/src/plugins/proctrack/rms/Makefile.in
index bf8f7c191..3ac284288 100644
--- a/src/plugins/proctrack/rms/Makefile.in
+++ b/src/plugins/proctrack/rms/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/proctrack/sgi_job/Makefile.in b/src/plugins/proctrack/sgi_job/Makefile.in
index e957f7657..d74e95537 100644
--- a/src/plugins/proctrack/sgi_job/Makefile.in
+++ b/src/plugins/proctrack/sgi_job/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/Makefile.in b/src/plugins/sched/Makefile.in
index 1be6962ee..f06d022d6 100644
--- a/src/plugins/sched/Makefile.in
+++ b/src/plugins/sched/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/backfill/Makefile.in b/src/plugins/sched/backfill/Makefile.in
index 4fe64da1b..d6855810e 100644
--- a/src/plugins/sched/backfill/Makefile.in
+++ b/src/plugins/sched/backfill/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/builtin/Makefile.in b/src/plugins/sched/builtin/Makefile.in
index 1f449de88..e5153c593 100644
--- a/src/plugins/sched/builtin/Makefile.in
+++ b/src/plugins/sched/builtin/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/gang/Makefile.in b/src/plugins/sched/gang/Makefile.in
index e7afa7d66..c494168ea 100644
--- a/src/plugins/sched/gang/Makefile.in
+++ b/src/plugins/sched/gang/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/hold/Makefile.in b/src/plugins/sched/hold/Makefile.in
index 1e350713e..3100ebc06 100644
--- a/src/plugins/sched/hold/Makefile.in
+++ b/src/plugins/sched/hold/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/wiki/Makefile.in b/src/plugins/sched/wiki/Makefile.in
index a85618713..55320a072 100644
--- a/src/plugins/sched/wiki/Makefile.in
+++ b/src/plugins/sched/wiki/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/wiki/get_jobs.c b/src/plugins/sched/wiki/get_jobs.c
index 8592fcf34..df478987d 100644
--- a/src/plugins/sched/wiki/get_jobs.c
+++ b/src/plugins/sched/wiki/get_jobs.c
@@ -326,9 +326,18 @@ static uint32_t _get_job_submit_time(struct job_record *job_ptr)
 
 static uint32_t _get_job_tasks(struct job_record *job_ptr)
 {
+	uint32_t task_cnt = 1;
+
 	if (job_ptr->num_procs)
-		return job_ptr->num_procs;
-	return (uint32_t) 1;
+		task_cnt = job_ptr->num_procs;
+
+	if (job_ptr->details) {
+		task_cnt = MAX(task_cnt,
+			       (_get_job_min_nodes(job_ptr) * 
+			        job_ptr->details->ntasks_per_node));
+	}
+
+	return task_cnt;
 }
 
 static uint32_t	_get_job_time_limit(struct job_record *job_ptr)
diff --git a/src/plugins/sched/wiki2/Makefile.in b/src/plugins/sched/wiki2/Makefile.in
index 2b980b7c1..62fccc350 100644
--- a/src/plugins/sched/wiki2/Makefile.in
+++ b/src/plugins/sched/wiki2/Makefile.in
@@ -180,6 +180,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c
index 0105748a0..e8688b3d5 100644
--- a/src/plugins/sched/wiki2/get_jobs.c
+++ b/src/plugins/sched/wiki2/get_jobs.c
@@ -429,9 +429,18 @@ static uint32_t _get_job_submit_time(struct job_record *job_ptr)
 
 static uint32_t _get_job_tasks(struct job_record *job_ptr)
 {
+	uint32_t task_cnt = 1;
+
 	if (job_ptr->num_procs)
-		return job_ptr->num_procs;
-	return (uint32_t) 1;
+		task_cnt = job_ptr->num_procs;
+
+	if (job_ptr->details) {
+		task_cnt = MAX(task_cnt,
+			       (_get_job_min_nodes(job_ptr) * 
+			        job_ptr->details->ntasks_per_node));
+	}
+
+	return task_cnt;
 }
 
 static uint32_t	_get_job_time_limit(struct job_record *job_ptr)
diff --git a/src/plugins/sched/wiki2/start_job.c b/src/plugins/sched/wiki2/start_job.c
index 26d7f0e3b..76cf4b31f 100644
--- a/src/plugins/sched/wiki2/start_job.c
+++ b/src/plugins/sched/wiki2/start_job.c
@@ -132,7 +132,7 @@ static int	_start_job(uint32_t jobid, int task_cnt, char *hostlist,
 	/* Write lock on job info, read lock on node info */
 	slurmctld_lock_t job_write_lock = {
 		NO_LOCK, WRITE_LOCK, READ_LOCK, NO_LOCK };
-	char *new_node_list;
+	char *new_node_list = NULL;
 	static char tmp_msg[128];
 	bitstr_t *new_bitmap, *save_req_bitmap = (bitstr_t *) NULL;
 	bitoff_t i, bsize;
@@ -250,20 +250,6 @@ static int	_start_job(uint32_t jobid, int task_cnt, char *hostlist,
 	lock_slurmctld(job_write_lock);
 	if (job_ptr->job_id != jobid)
 		job_ptr = find_job_record(jobid);
-	if (job_ptr && (job_ptr->job_id == jobid) && job_ptr->details &&
-	    (job_ptr->job_state == JOB_RUNNING)) {
-		/* Restore required node list */
-		xfree(job_ptr->details->req_nodes);
-		job_ptr->details->req_nodes = save_req_nodes;
-		FREE_NULL_BITMAP(job_ptr->details->req_node_bitmap);
-		job_ptr->details->req_node_bitmap = save_req_bitmap;
-		FREE_NULL_BITMAP(job_ptr->details->exc_node_bitmap);
-	} else {
-		xfree(save_req_nodes);
-		FREE_NULL_BITMAP(save_req_bitmap);
-		if (job_ptr && (job_ptr->job_id == jobid) && job_ptr->details)
-			FREE_NULL_BITMAP(job_ptr->details->exc_node_bitmap);
-	}
 
 	if (job_ptr && (job_ptr->job_id == jobid) 
 	&&  (job_ptr->job_state != JOB_RUNNING)) {
@@ -289,22 +275,26 @@ static int	_start_job(uint32_t jobid, int task_cnt, char *hostlist,
 		*err_msg = tmp_msg;
 		error("wiki: %s", tmp_msg);
 
-		/* restore job state *after* printing 
-		 * new_node_list (job_ptr->details->req_nodes) */
+		/* restore some of job state */
 		job_ptr->priority = 0;
 		job_ptr->num_procs = old_task_cnt;
-		if (job_ptr->details) {
-			/* Details get cleared on job abort; happens 
-			 * if the request is sufficiently messed up.
-			 * This happens when Moab tries to start a
-			 * a job on invalid nodes (wrong partition). */ 
-			xfree(job_ptr->details->req_nodes);
-			FREE_NULL_BITMAP(job_ptr->details->
-					 req_node_bitmap);
-			xfree(job_ptr->details->req_node_layout);
-		}
 		rc = -1;
 	}
+
+	if (job_ptr && (job_ptr->job_id == jobid) && job_ptr->details) {
+		/* Restore required node list in case job requeued */
+		xfree(job_ptr->details->req_nodes);
+		job_ptr->details->req_nodes = save_req_nodes;
+		FREE_NULL_BITMAP(job_ptr->details->req_node_bitmap);
+		job_ptr->details->req_node_bitmap = save_req_bitmap;
+		FREE_NULL_BITMAP(job_ptr->details->exc_node_bitmap);
+		xfree(job_ptr->details->req_node_layout);
+	} else {
+		error("wiki: start_job(%u) job missing", jobid);
+		xfree(save_req_nodes);
+		FREE_NULL_BITMAP(save_req_bitmap);
+	}
+
 	unlock_slurmctld(job_write_lock);
 	schedule_node_save();	/* provides own locking */
 	schedule_job_save();	/* provides own locking */
diff --git a/src/plugins/select/Makefile.in b/src/plugins/select/Makefile.in
index f950a6649..0d92f90a1 100644
--- a/src/plugins/select/Makefile.in
+++ b/src/plugins/select/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/select/bluegene/Makefile.in b/src/plugins/select/bluegene/Makefile.in
index 6a1f93f37..2c595da00 100644
--- a/src/plugins/select/bluegene/Makefile.in
+++ b/src/plugins/select/bluegene/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/select/bluegene/block_allocator/Makefile.in b/src/plugins/select/bluegene/block_allocator/Makefile.in
index d08331741..e606f1621 100644
--- a/src/plugins/select/bluegene/block_allocator/Makefile.in
+++ b/src/plugins/select/bluegene/block_allocator/Makefile.in
@@ -169,6 +169,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/select/bluegene/block_allocator/block_allocator.c b/src/plugins/select/bluegene/block_allocator/block_allocator.c
index e21260d22..f8cc7dc09 100644
--- a/src/plugins/select/bluegene/block_allocator/block_allocator.c
+++ b/src/plugins/select/bluegene/block_allocator/block_allocator.c
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  block_allocator.c - Assorted functions for layout of bglblocks, 
  *	 wiring, mapping for smap, etc.
- *  $Id: block_allocator.c 12412 2007-09-26 17:16:01Z da $
+ *  $Id: block_allocator.c 12543 2007-10-23 22:19:49Z jette $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -305,8 +305,8 @@ extern int parse_image(void **dest, slurm_parser_enum_t type,
 	s_p_get_string(&tmp, "Groups", tbl);
 	if(tmp) {
 		for(i=0; i<strlen(tmp); i++) {
-			if(tmp[i] == ':') {
-				image_group = xmalloc(sizeof(image_group));
+			if((tmp[i] == ':') || (tmp[i] == ',')) {
+				image_group = xmalloc(sizeof(image_group_t));
 				image_group->name = xmalloc(i-j+2);
 				snprintf(image_group->name,
 					 (i-j)+1, "%s", tmp+j);
@@ -320,12 +320,17 @@ extern int parse_image(void **dest, slurm_parser_enum_t type,
 			} 		
 		}
 		if(j != i) {
-			image_group = xmalloc(sizeof(image_group));
+			image_group = xmalloc(sizeof(image_group_t));
 			image_group->name = xmalloc(i-j+2);
 			snprintf(image_group->name, (i-j)+1, "%s", tmp+j);
 			image_group->gid = gid_from_string(image_group->name);
-			debug3("adding group %s %d", image_group->name,
-			       image_group->gid);
+			if (image_group->gid == (gid_t) -1) {
+				fatal("Invalid bluegene.conf parameter Groups=%s", 
+				      image_group->name);
+			} else {
+				debug3("adding group %s %d", image_group->name,
+				       image_group->gid);
+			}
 			list_append(n->groups, image_group);
 		}
 		xfree(tmp);
diff --git a/src/plugins/select/bluegene/plugin/Makefile.in b/src/plugins/select/bluegene/plugin/Makefile.in
index da1d608c8..2f204dce4 100644
--- a/src/plugins/select/bluegene/plugin/Makefile.in
+++ b/src/plugins/select/bluegene/plugin/Makefile.in
@@ -215,6 +215,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/select/bluegene/plugin/bg_job_place.c b/src/plugins/select/bluegene/plugin/bg_job_place.c
index a134fd813..8fc6c6b8a 100644
--- a/src/plugins/select/bluegene/plugin/bg_job_place.c
+++ b/src/plugins/select/bluegene/plugin/bg_job_place.c
@@ -2,9 +2,9 @@
  *  bg_job_place.c - blue gene job placement (e.g. base block selection)
  *  functions.
  *
- *  $Id: bg_job_place.c 12450 2007-10-05 18:22:36Z da $ 
+ *  $Id: bg_job_place.c 12533 2007-10-22 23:19:23Z jette $ 
  *****************************************************************************
- *  Copyright (C) 2004 The Regents of the University of California.
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Dan Phung <phung4@llnl.gov> and Morris Jette <jette1@llnl.gov>
  *  
@@ -37,11 +37,15 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#include <grp.h>
+#include <pwd.h>
+
 #include "src/common/node_select.h"
 #include "src/slurmctld/trigger_mgr.h"
 #include "bluegene.h"
 
 #define _DEBUG 0
+#define MAX_GROUPS 128
 
 #define SWAP(a,b,t)	\
 _STMT_START {		\
@@ -55,7 +59,11 @@ static int  _find_best_block_match(struct job_record* job_ptr,
 				   uint32_t max_nodes, uint32_t req_nodes,
 				   int spec, bg_record_t** found_bg_record,
 				   bool test_only);
+static int  _get_user_groups(uint32_t user_id, uint32_t group_id, 
+			     gid_t *groups, int max_groups, int *ngroups);
 static void _rotate_geo(uint16_t *req_geometry, int rot_cnt);
+static int  _test_image_perms(char *image_name, List image_list, 
+			      struct job_record* job_ptr);
 
 /* Rotate a 3-D geometry array through its six permutations */
 static void _rotate_geo(uint16_t *req_geometry, int rot_cnt)
@@ -78,6 +86,101 @@ static void _rotate_geo(uint16_t *req_geometry, int rot_cnt)
 
 pthread_mutex_t create_dynamic_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+/*
+ * Get a list of groups associated with a specific user_id
+ * Return 0 on success, -1 on failure
+ */
+static int _get_user_groups(uint32_t user_id, uint32_t group_id, 
+			    gid_t *groups, int max_groups, int *ngroups)
+{
+	struct passwd pwd, *results;
+	char *buffer;
+	static size_t buf_size = 0;
+	int rc;
+
+	if (!buf_size && ((buf_size = sysconf(_SC_GETPW_R_SIZE_MAX)) < 0)) {
+		error("sysconf(_SC_GETPW_R_SIZE_MAX)");
+		return -1;
+	}
+	buffer = xmalloc(buf_size);
+	rc = getpwuid_r((uid_t) user_id, &pwd, buffer, buf_size, &results);
+	if (rc != 0) {
+		error("getpwuid_r(%u): %m", user_id);
+		xfree(buffer);
+		return -1;
+	}
+	*ngroups = max_groups;
+	rc = getgrouplist(pwd.pw_name, (gid_t) group_id, groups, ngroups);
+	xfree(buffer);
+	if (rc < 0) {
+		error("getgrouplist(%s): %m", pwd.pw_name);
+		return -1;
+	}
+	*ngroups = rc;
+
+	return 0;
+}
+
+/*
+ * Determine if the job has permission to use the identified image
+ */
+static int _test_image_perms(char *image_name, List image_list, 
+			     struct job_record* job_ptr)
+{
+	int allow = 0, i, rc;
+	ListIterator itr;
+	ListIterator itr2;
+	image_t *image = NULL;
+	image_group_t *image_group = NULL;
+
+	/* Cache group information for most recently checked user */
+	static gid_t groups[MAX_GROUPS];
+	static int ngroups = -1;
+	static int32_t cache_user = -1;
+
+	itr = list_iterator_create(image_list);
+	while ((image = list_next(itr))) {
+		if (!strcasecmp(image->name, image_name) ||
+		    !strcasecmp(image->name, "*")) {
+			if (image->def) {
+				allow = 1;
+				break;
+			}
+			if (!image->groups ||
+			    !list_count(image->groups)) {
+				allow = 1;
+				break;
+			}
+			if (job_ptr->user_id != cache_user) {
+				rc = _get_user_groups(job_ptr->user_id, 
+						      job_ptr->group_id,
+						      groups, 
+						      MAX_GROUPS, &ngroups);
+				if (rc)		/* Failed to get groups */
+					break;
+				cache_user = job_ptr->user_id;
+			}
+			itr2 = list_iterator_create(image->groups);
+			while ((allow == 0) &&
+			       (image_group = list_next(itr2))) {
+				for (i=0; i<ngroups; i++) {
+					if (image_group->gid
+					    == groups[i]) {
+						allow = 1;
+						break;
+					}
+				}
+			}
+			list_iterator_destroy(itr2);
+			if (allow)
+				break;	
+		}
+	}
+	list_iterator_destroy(itr);
+
+	return allow;
+}
+
 /*
  * finds the best match for a given job request 
  * 
@@ -100,8 +203,6 @@ static int _find_best_block_match(struct job_record* job_ptr,
 	ListIterator itr2;
 	bg_record_t *record = NULL;
 	bg_record_t *found_record = NULL;
-	image_t *image = NULL;
-	image_group_t *image_group = NULL;
 	uint16_t req_geometry[BA_SYSTEM_DIMENSIONS];
 	uint16_t start[BA_SYSTEM_DIMENSIONS];
 	uint16_t conn_type, rotate, target_size = 0;
@@ -207,113 +308,38 @@ static int _find_best_block_match(struct job_record* job_ptr,
 			     SELECT_DATA_ROTATE, &rotate);
 	select_g_get_jobinfo(job_ptr->select_jobinfo,
 			     SELECT_DATA_MAX_PROCS, &max_procs);
+
 	select_g_get_jobinfo(job_ptr->select_jobinfo,
 			     SELECT_DATA_BLRTS_IMAGE, &blrtsimage);
-	if(blrtsimage) {
-		allow = 0;
-		itr = list_iterator_create(bg_blrtsimage_list);
-		while((image = list_next(itr))) {
-			if(!strcasecmp(blrtsimage, image->name)
-			   || !strcasecmp("*", image->name)) {
-				if(image->def) {
-					allow = 1;
-					break;
-				}
-				if(!image->groups ||
-				   !list_count(image->groups)) {
-					allow = 1;
-					break;
-				}				
-				itr2 = list_iterator_create(image->groups);
-				while((image_group = list_next(itr2))) {
-					if(image_group->gid
-					   == job_ptr->group_id) {
-						allow = 1;
-						break;
-					}
-				}
-				list_iterator_destroy(itr2);
-				if(allow)
-					break;	
-			}
-		}
-		list_iterator_destroy(itr);
-		if(!allow) {
+	if (blrtsimage) {
+		allow = _test_image_perms(blrtsimage, bg_blrtsimage_list, 
+					  job_ptr);
+		if (!allow) {
 			error("User %u:%u is not allowed to use BlrtsImage %s",
 			      job_ptr->user_id, job_ptr->group_id, blrtsimage);
 			rc = SLURM_ERROR;
 			goto end_it;
 		}
 	}
+
 	select_g_get_jobinfo(job_ptr->select_jobinfo,
 			     SELECT_DATA_LINUX_IMAGE, &linuximage);
-	if(linuximage) {
-		allow = 0;
-		itr = list_iterator_create(bg_linuximage_list);
-		while((image = list_next(itr))) {
-			if(!strcasecmp(linuximage, image->name)
-			   || !strcasecmp("*", image->name)) {
-				if(image->def) {
-					allow = 1;
-					break;
-				}
-				if(!image->groups
-				   || !list_count(image->groups)) {
-					allow = 1;
-					break;
-				}				
-				itr2 = list_iterator_create(image->groups);
-				while((image_group = list_next(itr2))) {
-					if(image_group->gid
-					   == job_ptr->group_id) {
-						allow = 1;
-						break;
-					}
-				}
-				list_iterator_destroy(itr2);
-				if(allow)
-					break;	
-			}
-		}
-		list_iterator_destroy(itr);
-		if(!allow) {
+	if (linuximage) {
+		allow = _test_image_perms(linuximage, bg_linuximage_list, 
+					  job_ptr);
+		if (!allow) {
 			error("User %u:%u is not allowed to use LinuxImage %s",
 			      job_ptr->user_id, job_ptr->group_id, linuximage);
 			rc = SLURM_ERROR;
 			goto end_it;
 		}
 	}
+
 	select_g_get_jobinfo(job_ptr->select_jobinfo,
 			     SELECT_DATA_MLOADER_IMAGE, &mloaderimage);
-	if(mloaderimage) {
-		allow = 0;
-		itr = list_iterator_create(bg_mloaderimage_list);
-		while((image = list_next(itr))) {
-			if(!strcasecmp(mloaderimage, image->name)
-			   || !strcasecmp("*", image->name)) {
-				if(image->def) {
-					allow = 1;
-					break;
-				}
-				if(!image->groups
-				   || !list_count(image->groups)) {
-					allow = 1;
-					break;
-				}				
-				itr2 = list_iterator_create(image->groups);
-				while((image_group = list_next(itr2))) {
-					if(image_group->gid
-					   == job_ptr->group_id) {
-						allow = 1;
-						break;
-					}
-				}
-				list_iterator_destroy(itr2);
-				if(allow)
-					break;	
-			}
-		}
-		list_iterator_destroy(itr);
+	if (mloaderimage) {
+		allow = _test_image_perms(mloaderimage, bg_mloaderimage_list, 
+					  job_ptr);
 		if(!allow) {
 			error("User %u:%u is not allowed "
 			      "to use MloaderImage %s",
@@ -323,37 +349,12 @@ static int _find_best_block_match(struct job_record* job_ptr,
 			goto end_it;
 		}
 	}
+
 	select_g_get_jobinfo(job_ptr->select_jobinfo,
 			     SELECT_DATA_RAMDISK_IMAGE, &ramdiskimage);
-	if(ramdiskimage) {
-		allow = 0;
-		itr = list_iterator_create(bg_ramdiskimage_list);
-		while((image = list_next(itr))) {
-			if(!strcasecmp(ramdiskimage, image->name)
-			   || !strcasecmp("*", image->name)) {
-				if(image->def) {
-					allow = 1;
-					break;
-				}
-				if(!image->groups
-				   || !list_count(image->groups)) {
-					allow = 1;
-					break;
-				}				
-				itr2 = list_iterator_create(image->groups);
-				while((image_group = list_next(itr2))) {
-					if(image_group->gid
-					   == job_ptr->group_id) {
-						allow = 1;
-						break;
-					}
-				}
-				list_iterator_destroy(itr2);
-				if(allow)
-					break;	
-			}
-		}
-		list_iterator_destroy(itr);
+	if (ramdiskimage) {
+		allow = _test_image_perms(ramdiskimage, bg_ramdiskimage_list, 
+					  job_ptr);
 		if(!allow) {
 			error("User %u:%u is not allowed "
 			      "to use RamDiskImage %s",
diff --git a/src/plugins/select/cons_res/Makefile.in b/src/plugins/select/cons_res/Makefile.in
index 7e9e15b08..29b889301 100644
--- a/src/plugins/select/cons_res/Makefile.in
+++ b/src/plugins/select/cons_res/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/select/linear/Makefile.in b/src/plugins/select/linear/Makefile.in
index e02e9e22a..b18586a04 100644
--- a/src/plugins/select/linear/Makefile.in
+++ b/src/plugins/select/linear/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/switch/Makefile.in b/src/plugins/switch/Makefile.in
index 33e59fac3..ab6e17b4f 100644
--- a/src/plugins/switch/Makefile.in
+++ b/src/plugins/switch/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/switch/elan/Makefile.in b/src/plugins/switch/elan/Makefile.in
index 04b2358e6..5310a895e 100644
--- a/src/plugins/switch/elan/Makefile.in
+++ b/src/plugins/switch/elan/Makefile.in
@@ -181,6 +181,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/switch/federation/Makefile.in b/src/plugins/switch/federation/Makefile.in
index df3f9ea03..bfc93e746 100644
--- a/src/plugins/switch/federation/Makefile.in
+++ b/src/plugins/switch/federation/Makefile.in
@@ -185,6 +185,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/switch/none/Makefile.in b/src/plugins/switch/none/Makefile.in
index 1f39eb4d8..7c080e967 100644
--- a/src/plugins/switch/none/Makefile.in
+++ b/src/plugins/switch/none/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/task/Makefile.in b/src/plugins/task/Makefile.in
index 24758482d..1ed780c15 100644
--- a/src/plugins/task/Makefile.in
+++ b/src/plugins/task/Makefile.in
@@ -157,6 +157,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/task/affinity/Makefile.in b/src/plugins/task/affinity/Makefile.in
index 8b1786c02..e780ed3f8 100644
--- a/src/plugins/task/affinity/Makefile.in
+++ b/src/plugins/task/affinity/Makefile.in
@@ -187,6 +187,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/plugins/task/none/Makefile.in b/src/plugins/task/none/Makefile.in
index a51b03171..74738401d 100644
--- a/src/plugins/task/none/Makefile.in
+++ b/src/plugins/task/none/Makefile.in
@@ -176,6 +176,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sacct/Makefile.in b/src/sacct/Makefile.in
index f84d6fdb2..339e1e9be 100644
--- a/src/sacct/Makefile.in
+++ b/src/sacct/Makefile.in
@@ -174,6 +174,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/salloc/Makefile.in b/src/salloc/Makefile.in
index 202ab6ba3..938fae8b1 100644
--- a/src/salloc/Makefile.in
+++ b/src/salloc/Makefile.in
@@ -170,6 +170,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/salloc/opt.c b/src/salloc/opt.c
index 82e371151..c6d4e8495 100644
--- a/src/salloc/opt.c
+++ b/src/salloc/opt.c
@@ -109,6 +109,10 @@
 #define LONG_OPT_NO_BELL     0x117
 #define LONG_OPT_COMMENT     0x118
 #define LONG_OPT_REBOOT      0x119
+#define LONG_OPT_BLRTS_IMAGE     0x120
+#define LONG_OPT_LINUX_IMAGE     0x121
+#define LONG_OPT_MLOADER_IMAGE   0x122
+#define LONG_OPT_RAMDISK_IMAGE   0x123
 
 /*---- global variables, defined in opt.h ----*/
 opt_t opt;
@@ -699,6 +703,10 @@ void set_options(const int argc, char **argv)
 		{"jobid",         required_argument, 0, LONG_OPT_JOBID},
 		{"comment",       required_argument, 0, LONG_OPT_COMMENT},
 		{"reboot",	  no_argument,       0, LONG_OPT_REBOOT},
+		{"blrts-image",   required_argument, 0, LONG_OPT_BLRTS_IMAGE},
+		{"linux-image",   required_argument, 0, LONG_OPT_LINUX_IMAGE},
+		{"mloader-image", required_argument, 0, LONG_OPT_MLOADER_IMAGE},
+		{"ramdisk-image", required_argument, 0, LONG_OPT_RAMDISK_IMAGE},
 		{NULL,            0,                 0, 0}
 	};
 	char *opt_string = "+a:c:C:d:F:g:hHIJ:kK::n:N:Op:qR:st:uU:vVw:W:x:";
@@ -923,6 +931,15 @@ void set_options(const int argc, char **argv)
 					"-%d and %d", NICE_OFFSET, NICE_OFFSET);
 				exit(1);
 			}
+			if (opt.nice < 0) {
+				uid_t my_uid = getuid();
+				if ((my_uid != 0) &&
+				    (my_uid != slurm_get_slurm_user_id())) {
+					error("Nice value must be non-negative, "
+					      "value ignored");
+					opt.nice = 0;
+				}
+			}
 			break;
 		case LONG_OPT_BELL:
 			opt.bell = BELL_ALWAYS;
@@ -940,6 +957,22 @@ void set_options(const int argc, char **argv)
 		case LONG_OPT_REBOOT:
 			opt.reboot = true;
 			break;
+		case LONG_OPT_BLRTS_IMAGE:
+			xfree(opt.blrtsimage);
+			opt.blrtsimage = xstrdup(optarg);
+			break;
+		case LONG_OPT_LINUX_IMAGE:
+			xfree(opt.linuximage);
+			opt.linuximage = xstrdup(optarg);
+			break;
+		case LONG_OPT_MLOADER_IMAGE:
+			xfree(opt.mloaderimage);
+			opt.mloaderimage = xstrdup(optarg);
+			break;
+		case LONG_OPT_RAMDISK_IMAGE:
+			xfree(opt.ramdiskimage);
+			opt.ramdiskimage = xstrdup(optarg);
+			break;
 		default:
 			fatal("Unrecognized command line parameter %c",
 			      opt_char);
@@ -1281,6 +1314,14 @@ static void _opt_list()
 	xfree(str);
 	info("reboot         : %s", opt.reboot ? "no" : "yes");
 	info("rotate         : %s", opt.no_rotate ? "yes" : "no");
+	if (opt.blrtsimage)
+		info("BlrtsImage     : %s", opt.blrtsimage);
+	if (opt.linuximage)
+		info("LinuxImage     : %s", opt.linuximage);
+	if (opt.mloaderimage)
+		info("MloaderImage   : %s", opt.mloaderimage);
+	if (opt.ramdiskimage)
+		info("RamDiskImage   : %s", opt.ramdiskimage);
 	if (opt.begin) {
 		char time_str[32];
 		slurm_make_time_str(&opt.begin, time_str, sizeof(time_str));
@@ -1307,6 +1348,8 @@ static void _usage(void)
 "              [--account=name] [--dependency=jobid] [--comment=name]\n"
 #ifdef HAVE_BG		/* Blue gene specific options */
 "              [--geometry=XxYxZ] [--conn-type=type] [--no-rotate] [ --reboot]\n"
+"              [--blrts-image=path] [--linux-image=path]\n"
+"              [--mloader-image=path] [--ramdisk-image=path]\n"
 #endif
 "              [--mail-type=type] [--mail-user=user][--nice[=value]]\n"
 "              [--bell] [--no-bell] [--kill-command[=signal]]\n"
@@ -1373,6 +1416,10 @@ static void _help(void)
   "      --reboot                reboot nodes before starting job\n"
   "      --conn-type=type        constraint on type of connection, MESH or TORUS\n"
   "                              if not set, then tries to fit TORUS else MESH\n"
+  "      --blrts-image=path      path to blrts image for bluegene block.  Default if not set\n"
+  "      --linux-image=path      path to linux image for bluegene block.  Default if not set\n"
+  "      --mloader-image=path    path to mloader image for bluegene block.  Default if not set\n"
+  "      --ramdisk-image=path    path to ramdisk image for bluegene block.  Default if not set\n"
   "\n"
 #endif
 "Help options:\n"
diff --git a/src/salloc/opt.h b/src/salloc/opt.h
index b294c0363..62d27b6ae 100644
--- a/src/salloc/opt.h
+++ b/src/salloc/opt.h
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.h - definitions for salloc option processing
- *  $Id: opt.h 12196 2007-08-31 21:28:28Z jette $
+ *  $Id: opt.h 12536 2007-10-22 23:57:53Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -98,10 +98,17 @@ typedef struct salloc_options {
 	char *nodelist;		/* --nodelist=node1,node2,...	*/
 	char *exc_nodes;	/* --exclude=node1,node2,... -x	*/
 
+	/* BLUEGENE SPECIFIC */
 	uint16_t geometry[SYSTEM_DIMENSIONS]; /* --geometry, -g	*/
 	bool reboot;		/* --reboot			*/
 	bool no_rotate;		/* --no_rotate, -R		*/
 	int16_t conn_type;	/* --conn-type 			*/
+	char *blrtsimage;       /* --blrts-image BlrtsImage for block */
+	char *linuximage;       /* --linux-image LinuxImage for block */
+	char *mloaderimage;     /* --mloader-image mloaderImage for block */
+	char *ramdiskimage;     /* --ramdisk-image RamDiskImage for block */
+	/*********************/
+
 	time_t begin;		/* --begin			*/
 	uint16_t mail_type;	/* --mail-type			*/
 	char *mail_user;	/* --mail-user			*/
diff --git a/src/salloc/salloc.c b/src/salloc/salloc.c
index eb881a1a4..6d9aa5a3f 100644
--- a/src/salloc/salloc.c
+++ b/src/salloc/salloc.c
@@ -2,7 +2,7 @@
  *  salloc.c - Request a SLURM job allocation and
  *             launch a user-specified command.
  *
- *  $Id: salloc.c 12196 2007-08-31 21:28:28Z jette $
+ *  $Id: salloc.c 12536 2007-10-22 23:57:53Z jette $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -277,6 +277,14 @@ static int fill_job_desc_from_opts(job_desc_msg_t *desc)
 		desc->reboot = 1;
 	if (opt.no_rotate)
 		desc->rotate = 0;
+	if (opt.blrtsimage)
+		desc->blrtsimage = xstrdup(opt.blrtsimage);
+	if (opt.linuximage)
+		desc->linuximage = xstrdup(opt.linuximage);
+	if (opt.mloaderimage)
+		desc->mloaderimage = xstrdup(opt.mloaderimage);
+	if (opt.ramdiskimage)
+		desc->ramdiskimage = xstrdup(opt.ramdiskimage);
 	if (opt.mincpus > -1)
 		desc->job_min_procs = opt.mincpus;
 	if (opt.minsockets > -1)
diff --git a/src/sattach/Makefile.in b/src/sattach/Makefile.in
index 064f774c6..64e33cbdc 100644
--- a/src/sattach/Makefile.in
+++ b/src/sattach/Makefile.in
@@ -171,6 +171,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sattach/sattach.wrapper.c b/src/sattach/sattach.wrapper.c
index 8ac9ba5de..950504384 100644
--- a/src/sattach/sattach.wrapper.c
+++ b/src/sattach/sattach.wrapper.c
@@ -3,7 +3,8 @@
  *	sattach is a SLURM command that can be used to attach to an 
  *	active parallel job
  *
- * For TotalView, a parallel job debugger from Etnus <http://www.etnus.com>
+ * For TotalView, a parallel job debugger from  
+ * TotalView Technologies, LLC <http://www.TotalViewTech.com>
  *	Type "<ctrl-a>" to specify arguments for sattach
  *	Type "g" to start the program
  *
diff --git a/src/sbatch/Makefile.in b/src/sbatch/Makefile.in
index a13da5355..f30d9b1a6 100644
--- a/src/sbatch/Makefile.in
+++ b/src/sbatch/Makefile.in
@@ -170,6 +170,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index 3b43bf053..24427f8f6 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -446,7 +446,7 @@ static void _opt_default()
 	opt.ifname = xstrdup("/dev/null");
 	opt.ofname = NULL;
 	opt.efname = NULL;
-	opt.get_user_env = false;
+	opt.get_user_env = -1;
 }
 
 /*---[ env var processing ]-----------------------------------------------*/
@@ -467,6 +467,7 @@ struct env_vars {
 	void *set_flag;
 };
 
+
 env_vars_t env_vars[] = {
   {"SBATCH_ACCOUNT",       OPT_STRING,     &opt.account,       NULL           },
   {"SBATCH_BLRTS_IMAGE",   OPT_STRING,     &opt.blrtsimage,    NULL           },
@@ -656,7 +657,7 @@ static struct option long_options[] = {
 	{"tasks-per-node",  required_argument,0,LONG_OPT_TASKSPERNODE},
 	{"ntasks-per-node", required_argument,0,LONG_OPT_TASKSPERNODE}, 
 	{"wrap",          required_argument, 0, LONG_OPT_WRAP},
-	{"get-user-env",  no_argument,       0, LONG_OPT_GET_USER_ENV},
+	{"get-user-env",  optional_argument, 0, LONG_OPT_GET_USER_ENV},
 	{NULL,            0,                 0, 0}
 };
 
@@ -900,31 +901,43 @@ static char *_get_argument(const char *line, int *skipped)
  */
 static void _opt_batch_script(const void *body, int size)
 {
-	char *magic_word = "#SBATCH";
-	int magic_word_len;
+	char *magic_word1 = "#SBATCH";
+	char *magic_word2 = "#SLURM";
+	int magic_word_len1, magic_word_len2;
 	int argc;
 	char **argv;
 	void *state = NULL;
 	char *line;
 	char *option;
 	char *ptr;
-	int skipped = 0;
+	int skipped = 0, warned = 0;
 	int i;
 
-	magic_word_len = strlen(magic_word);
+	magic_word_len1 = strlen(magic_word1);
+	magic_word_len2 = strlen(magic_word2);
+
 	/* getopt_long skips over the first argument, so fill it in */
 	argc = 1;
 	argv = xmalloc(sizeof(char *));
 	argv[0] = "sbatch";
 
 	while((line = _next_line(body, size, &state)) != NULL) {
-		if (strncmp(line, magic_word, magic_word_len) != 0) {
+		if (!strncmp(line, magic_word1, magic_word_len1))
+			ptr = line + magic_word_len1;
+		else if (!strncmp(line, magic_word2, magic_word_len2)) {
+			ptr = line + magic_word_len2;
+			if (!warned) {
+				error("Change from #SLURM to #SBATCH in your "
+				      "script and verify the options are "
+				      "valid in sbatch");
+				warned = 1;
+			}
+		} else {
 			xfree(line);
 			continue;
 		}
 
 		/* this line starts with the magic word */
-		ptr = line + magic_word_len;
 		while ((option = _get_argument(ptr, &skipped)) != NULL) {
 			debug2("Found in script, argument \"%s\"", option);
 			argc += 1;
@@ -1234,6 +1247,15 @@ static void _set_options(int argc, char **argv)
 				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
 				exit(1);
 			}
+			if (opt.nice < 0) {
+				uid_t my_uid = getuid();
+				if ((my_uid != 0) &&
+				    (my_uid != slurm_get_slurm_user_id())) {
+					error("Nice value must be non-negative, "
+					      "value ignored");
+					opt.nice = 0;
+				}
+			}
 			break;
 		case LONG_OPT_NO_REQUEUE:
 			opt.no_requeue = true;
@@ -1268,7 +1290,10 @@ static void _set_options(int argc, char **argv)
 			/* handled in process_options_first_pass() */
 			break;
 		case LONG_OPT_GET_USER_ENV:
-			opt.get_user_env = true;
+			if (optarg)
+				opt.get_user_env = strtol(optarg, NULL, 10);
+			else
+				opt.get_user_env = 0;
 			break;
 		default:
 			fatal("Unrecognized command line parameter %c",
@@ -1784,7 +1809,7 @@ static uint16_t _parse_pbs_mail_type(const char *arg)
 		|| strcasecmp(arg, "ae") == 0)
 		rc = MAIL_JOB_END |  MAIL_JOB_FAIL;
 	else
-		rc = 0;		/* failure */
+		rc = 0;		/* arg="n" or failure */
 
 	return rc;
 }
@@ -1816,17 +1841,16 @@ static List
 _create_path_list(void)
 {
 	List l = list_create(_freeF);
-	char *path = xstrdup(getenv("PATH"));
-	char *c, *lc;
+	char *path, *c, *lc;
 
-	if (!path) {
-		error("Error in PATH environment variable");
-		list_destroy(l);
-		return NULL;
+	c = getenv("PATH");
+	if (!c) {
+		verbose("No PATH environment variable");
+		return l;
 	}
 
+	path = xstrdup(c);
 	c = lc = path;
-
 	while (*c != '\0') {
 		if (*c == ':') {
 			/* nullify and push token onto list */
diff --git a/src/sbatch/opt.h b/src/sbatch/opt.h
index 8ffded1be..a14602553 100644
--- a/src/sbatch/opt.h
+++ b/src/sbatch/opt.h
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.h - definitions for srun option processing
- *  $Id: opt.h 12190 2007-08-31 19:05:18Z jette $
+ *  $Id: opt.h 12574 2007-10-26 17:00:52Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -104,10 +104,10 @@ typedef struct sbatch_options {
 	bool reboot;		/* --reboot			*/
 	bool no_rotate;		/* --no_rotate, -R		*/
 	uint16_t conn_type;	/* --conn-type 			*/
-	char *blrtsimage;       /* --blrtsimage BlrtsImage for block */
-	char *linuximage;       /* --linuximage LinuxImage for block */
-	char *mloaderimage;     /* --mloaderimage mloaderImage for block */
-	char *ramdiskimage;     /* --ramdiskimage RamDiskImage for block */
+	char *blrtsimage;       /* --blrts-image BlrtsImage for block */
+	char *linuximage;       /* --linux-image LinuxImage for block */
+	char *mloaderimage;     /* --mloader-image mloaderImage for block */
+	char *ramdiskimage;     /* --ramdisk-image RamDiskImage for block */
 	/*********************/
 
 	time_t begin;		/* --begin			*/
@@ -116,7 +116,7 @@ typedef struct sbatch_options {
 	char *ifname;		/* input file name		*/
 	char *ofname;		/* output file name		*/
 	char *efname;		/* error file name		*/
-	bool get_user_env;	/* --get-user-env		*/
+	int get_user_env;	/* --get-user-env[=timeout]	*/
 } opt_t;
 
 extern opt_t opt;
diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c
index 4cf25d217..7e2e11049 100644
--- a/src/sbatch/sbatch.c
+++ b/src/sbatch/sbatch.c
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  sbatch.c - Submit a SLURM batch script.
  *
- *  $Id: sbatch.c 12190 2007-08-31 19:05:18Z jette $
+ *  $Id: sbatch.c 12574 2007-10-26 17:00:52Z jette $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -194,11 +194,12 @@ static int fill_job_desc_from_opts(job_desc_msg_t *desc)
 	desc->shared = opt.shared;
 
 	desc->environment = NULL;
-	if (opt.get_user_env) {
+	if (opt.get_user_env >= 0) {
 		struct passwd *pw = NULL;
 		pw = getpwuid(opt.uid);
 		if (pw != NULL) {
-			desc->environment = env_array_user_default(pw->pw_name);
+			desc->environment = env_array_user_default(pw->pw_name,
+						opt.get_user_env);
 			/* FIXME - should we abort if j->environment
 			 * is NULL? */
 		}
diff --git a/src/sbcast/Makefile.in b/src/sbcast/Makefile.in
index 1703fd897..d365b134e 100644
--- a/src/sbcast/Makefile.in
+++ b/src/sbcast/Makefile.in
@@ -174,6 +174,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/scancel/Makefile.in b/src/scancel/Makefile.in
index 9c5d57630..f1825207c 100644
--- a/src/scancel/Makefile.in
+++ b/src/scancel/Makefile.in
@@ -173,6 +173,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/scontrol/Makefile.in b/src/scontrol/Makefile.in
index e15995b77..267cab5a8 100644
--- a/src/scontrol/Makefile.in
+++ b/src/scontrol/Makefile.in
@@ -173,6 +173,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sinfo/Makefile.in b/src/sinfo/Makefile.in
index 9738d03b2..6e9edb758 100644
--- a/src/sinfo/Makefile.in
+++ b/src/sinfo/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slaunch/Makefile.in b/src/slaunch/Makefile.in
index 95e561bca..6e537e164 100644
--- a/src/slaunch/Makefile.in
+++ b/src/slaunch/Makefile.in
@@ -172,6 +172,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in
index 6ff64f5da..071a2d2eb 100644
--- a/src/slurmctld/Makefile.in
+++ b/src/slurmctld/Makefile.in
@@ -178,6 +178,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slurmd/Makefile.in b/src/slurmd/Makefile.in
index 91a856806..4a9b859e7 100644
--- a/src/slurmd/Makefile.in
+++ b/src/slurmd/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slurmd/slurmd/Makefile.in b/src/slurmd/slurmd/Makefile.in
index 44b7d8181..034679356 100644
--- a/src/slurmd/slurmd/Makefile.in
+++ b/src/slurmd/slurmd/Makefile.in
@@ -191,6 +191,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slurmd/slurmstepd/Makefile.in b/src/slurmd/slurmstepd/Makefile.in
index b0b6de5b4..35e2e263b 100644
--- a/src/slurmd/slurmstepd/Makefile.in
+++ b/src/slurmd/slurmstepd/Makefile.in
@@ -182,6 +182,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/slurmd/slurmstepd/mgr.c b/src/slurmd/slurmstepd/mgr.c
index 5faad890f..7d1f3aa16 100644
--- a/src/slurmd/slurmstepd/mgr.c
+++ b/src/slurmd/slurmstepd/mgr.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/mgr.c - job manager functions for slurmstepd
- *  $Id: mgr.c 12244 2007-09-10 21:03:20Z da $
+ *  $Id: mgr.c 12580 2007-10-29 20:17:09Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -301,9 +301,10 @@ cleanup1:
 	error("batch script setup failed for job %u.%u",
 	      msg->job_id, msg->step_id);
 
-	if (msg->step_id == SLURM_BATCH_SCRIPT)
-		_send_complete_batch_script_msg(job, -1, -1);
-	else
+	if (msg->step_id == SLURM_BATCH_SCRIPT) {
+		_send_complete_batch_script_msg(job, 
+			ESLURMD_CREATE_BATCH_DIR_ERROR, -1);
+	} else
 		_send_step_complete_msgs(job);
 
 	return NULL;
diff --git a/src/slurmd/slurmstepd/multi_prog.c b/src/slurmd/slurmstepd/multi_prog.c
index 87e086149..6a1c2e8fd 100644
--- a/src/slurmd/slurmstepd/multi_prog.c
+++ b/src/slurmd/slurmstepd/multi_prog.c
@@ -151,13 +151,15 @@ multi_prog_get_argv(char *file_contents, char **prog_env, int task_rank,
 	char **prog_argv = NULL;
 	char *local_data = NULL;
 
+	prog_argv = (char **)xmalloc(sizeof(char *) * 128);
+
 	if (task_rank < 0) {
-		*argc = 0;
-		*argv = NULL;
+		error("Invalid task rank %d", task_rank);
+		*argc = 1;
+		*argv = prog_argv;
 		return -1;
 	}
 
-	prog_argv = (char **)xmalloc(sizeof(char *) * 128);
 	local_data = xstrdup(file_contents);
 
 	line = strtok_r(local_data, "\n", &ptrptr);
@@ -165,7 +167,7 @@ multi_prog_get_argv(char *file_contents, char **prog_env, int task_rank,
 		if (line_num > 0)
 			line = strtok_r(NULL, "\n", &ptrptr);
 		if (line == NULL) {
-			error("Could not identify executable program for this task");
+			error("No executable program specified for this task");
 			goto fail;
 		}
 		line_num ++;
@@ -272,9 +274,9 @@ multi_prog_get_argv(char *file_contents, char **prog_env, int task_rank,
 
 	error("Program for task rank %d not specified.", task_rank);
 fail:
-	xfree(prog_argv);
 	xfree(local_data);
-	*argc = 0;
-	*argv = NULL;
+	*argc = 1;
+	prog_argv[0] = NULL;
+	*argv = prog_argv;
 	return -1;
 }
diff --git a/src/slurmd/slurmstepd/slurmstepd_job.c b/src/slurmd/slurmstepd/slurmstepd_job.c
index 54123197c..122ac1549 100644
--- a/src/slurmd/slurmstepd/slurmstepd_job.c
+++ b/src/slurmd/slurmstepd/slurmstepd_job.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/slurmstepd_job.c - slurmd_job_t routines
- * $Id: slurmstepd_job.c 10574 2006-12-15 23:38:29Z jette $
+ * $Id: slurmstepd_job.c 12580 2007-10-29 20:17:09Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -317,6 +317,7 @@ job_batch_job_create(batch_job_launch_msg_t *msg)
 	job->batch   = true;
 	job->multi_prog = 0;
 	job->overcommit = (bool) msg->overcommit;
+	job->node_name = xstrdup(conf->node_name);
 
 	job->uid     = (uid_t) msg->uid;
 	job->gid     = (gid_t) msg->gid;
diff --git a/src/slurmd/slurmstepd/task.c b/src/slurmd/slurmstepd/task.c
index 7bc5c7285..f8909617a 100644
--- a/src/slurmd/slurmstepd/task.c
+++ b/src/slurmd/slurmstepd/task.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  slurmd/slurmstepd/task.c - task launching functions for slurmstepd
- *  $Id: task.c 12201 2007-08-31 22:34:26Z jette $
+ *  $Id: task.c 12573 2007-10-26 15:57:01Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -337,7 +337,7 @@ exec_task(slurmd_job_t *job, int i, int waitfd)
 	job->envtp->env = NULL;
 	xfree(job->envtp->task_count);
 
-	if (job->multi_prog) {
+	if (job->multi_prog && task->argv[0]) {
 		/*
 		 * Normally the client (srun/slauch) expands the command name
 		 * to a fully qualified path, but in --multi-prog mode it
@@ -392,6 +392,10 @@ exec_task(slurmd_job_t *job, int i, int waitfd)
 		job->env[0] = (char *)NULL;
 	}
 
+	if (task->argv[0] == NULL) {
+		error("No executable program specified for this task");
+		exit(2);
+	}
 	execve(task->argv[0], task->argv, job->env);
 
 	/* 
diff --git a/src/smap/Makefile.in b/src/smap/Makefile.in
index cfa4ce55d..a4bcfd7d4 100644
--- a/src/smap/Makefile.in
+++ b/src/smap/Makefile.in
@@ -187,6 +187,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/smap/partition_functions.c b/src/smap/partition_functions.c
index 544589408..2a04de9ab 100644
--- a/src/smap/partition_functions.c
+++ b/src/smap/partition_functions.c
@@ -837,9 +837,9 @@ static int _addto_nodelist(List nodelist, int *start, int *end)
 	int *coord = NULL;
 	int x,y,z;
 	
-	if(end[X] < DIM_SIZE[X]
-	   || end[Y] < DIM_SIZE[Y]
-	   || end[Z] < DIM_SIZE[Z]) {
+	if(end[X] >= DIM_SIZE[X]
+	   || end[Y] >= DIM_SIZE[Y]
+	   || end[Z] >= DIM_SIZE[Z]) {
 		fatal("It appears the slurm.conf file has changed since "
 		      "the last restart.\nThings are in an incompatible "
 		      "state, please restart the slurmctld.");
diff --git a/src/squeue/Makefile.in b/src/squeue/Makefile.in
index 5eb2fe4e8..7c71dab52 100644
--- a/src/squeue/Makefile.in
+++ b/src/squeue/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/squeue/opts.c b/src/squeue/opts.c
index 53112f89e..488a3b947 100644
--- a/src/squeue/opts.c
+++ b/src/squeue/opts.c
@@ -1,7 +1,7 @@
 /****************************************************************************\
  *  opts.c - srun command line option parsing
  *
- *  $Id: opts.c 12452 2007-10-05 19:07:07Z da $
+ *  $Id: opts.c 12590 2007-10-31 16:08:11Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -553,6 +553,11 @@ extern int parse_format( char* format )
 				                          field_size, 
 				                          right_justify, 
 				                          suffix );
+			else if (field[0] == 'q')
+				job_format_add_comment( params.format_list, 
+				                        field_size, 
+				                        right_justify, 
+				                        suffix );
 			else if (field[0] == 'r')
 				job_format_add_reason( params.format_list,
 							field_size,
diff --git a/src/squeue/print.c b/src/squeue/print.c
index e95a20c48..e43b17f44 100644
--- a/src/squeue/print.c
+++ b/src/squeue/print.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  print.c - squeue print job functions
- *  $Id: print.c 11734 2007-06-19 16:45:44Z jette $
+ *  $Id: print.c 12594 2007-10-31 22:27:56Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -95,17 +95,12 @@ int print_jobs_array(job_info_t * jobs, int size, List format)
 
 	/* Filter out the jobs of interest */
 	for (; i < size; i++) {
+		_adjust_completing(&jobs[i], &ni);
 		if (_filter_job(&jobs[i]))
 			continue;
 		list_append(l, (void *) &jobs[i]);
 	}
-
-
-	/* 
-	 * Adjust nodelists for any completing jobs
-	 */
 	sort_jobs_by_start_time (l);
-	list_for_each (l, (ListForF) _adjust_completing, (void *) &ni);
 	if (ni) 
 		slurm_free_node_info_msg (ni);
 
@@ -609,7 +604,16 @@ int _print_job_num_procs(job_info_t * job, int width, bool right, char* suffix)
 	if (job == NULL)	/* Print the Header instead */
 		_print_str("CPUS", width, right, true);
 	else {
-		convert_num_unit((float)job->num_procs, tmp_char, UNIT_NONE);
+		if (job->job_state == JOB_RUNNING) {
+			uint32_t cnt = 0, i;
+			for (i=0; i<job->num_cpu_groups; i++) {
+				cnt += job->cpus_per_node[i] * 
+				       job->cpu_count_reps[i];
+			}
+			convert_num_unit((float)cnt, tmp_char, UNIT_NONE);
+		} else {
+			convert_num_unit((float)job->num_procs, tmp_char, UNIT_NONE);
+		}
 		_print_str(tmp_char, width, right, true);
 	}
 	if (suffix)
@@ -985,6 +989,18 @@ int _print_job_account(job_info_t * job, int width, bool right_justify,
 	return SLURM_SUCCESS;
 }
 
+int _print_job_comment(job_info_t * job, int width, bool right_justify,
+			char* suffix)
+{
+	if (job == NULL)	 /* Print the Header instead */
+		_print_str("COMMENT", width, right_justify, true);
+	else
+		_print_str(job->comment, width, right_justify, true);
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
+
 int _print_job_dependency(job_info_t * job, int width, bool right_justify,
 			char* suffix) 
 {
@@ -1168,7 +1184,7 @@ int _print_step_name(job_step_info_t * step, int width, bool right,
 	if (step == NULL)	/* Print the Header instead */
 		_print_str("NAME", width, right, true);
 	else
-		_print_nodes(step->name, width, right, true);
+		_print_str(step->name, width, right, true);
 	if (suffix)
 		printf("%s", suffix);
 	return SLURM_SUCCESS;
diff --git a/src/squeue/print.h b/src/squeue/print.h
index 0834283e6..f596f0a14 100644
--- a/src/squeue/print.h
+++ b/src/squeue/print.h
@@ -163,6 +163,8 @@ int job_format_add_function(List list, int width, bool right_justify,
 	job_format_add_function(list,wid,right,suffix,_print_job_dependency)
 #define job_format_add_select_jobinfo(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_select_jobinfo)
+#define job_format_add_comment(list,wid,right,suffix) \
+	job_format_add_function(list,wid,right,suffix,_print_job_comment)
 
 /*****************************************************************************
  * Job Line Print Functions
@@ -251,6 +253,8 @@ int _print_job_dependency(job_info_t * job, int width, bool right_justify,
 			char* suffix);
 int _print_job_select_jobinfo(job_info_t * job, int width, bool right_justify,
 			char* suffix);
+int _print_job_comment(job_info_t * job, int width, bool right_justify,
+			char* suffix);
 
 /*****************************************************************************
  * Step Print Format Functions
diff --git a/src/srun/Makefile.in b/src/srun/Makefile.in
index 75f78464b..98aa2874a 100644
--- a/src/srun/Makefile.in
+++ b/src/srun/Makefile.in
@@ -174,6 +174,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/srun/allocate.c b/src/srun/allocate.c
index 7b5f97a52..92ea573ee 100644
--- a/src/srun/allocate.c
+++ b/src/srun/allocate.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  * src/srun/allocate.c - srun functions for managing node allocations
- * $Id: allocate.c 11792 2007-07-05 23:56:07Z jette $
+ * $Id: allocate.c 12574 2007-10-26 17:00:52Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -558,12 +558,13 @@ job_desc_msg_create_from_opts (char *script)
 		xassert (opt.batch);
 
 		j->environment = NULL;
-		if (opt.get_user_env) {
+		if (opt.get_user_env >= 0) {
 			struct passwd *pw = NULL;
 			pw = getpwuid(opt.uid);
 			if (pw != NULL) {
 				j->environment =
-					env_array_user_default(pw->pw_name);
+					env_array_user_default(pw->pw_name,
+							opt.get_user_env);
 				/* FIXME - should we abort if j->environment
 				   is NULL? */
 			}
diff --git a/src/srun/msg.c b/src/srun/msg.c
index d4504fcec..735c1ce81 100644
--- a/src/srun/msg.c
+++ b/src/srun/msg.c
@@ -1,6 +1,6 @@
 /****************************************************************************\
  *  msg.c - process message traffic between srun and slurm daemons
- *  $Id: msg.c 12089 2007-08-22 18:23:38Z jette $
+ *  $Id: msg.c 12538 2007-10-23 17:11:04Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -880,11 +880,13 @@ _print_exit_status(srun_job_t *job, hostlist_t hl, char *host, int status)
 		corestr = " (core dumped)";
 #endif
 
-	if (WIFSIGNALED(status))
-		(*print) ("%s: %s: %s%s", host, buf, sigstr(status), corestr); 
-	else
-		error ("%s: %s: Exited with exit code %d", 
+	if (WIFSIGNALED(status)) {
+		(*print) ("%s: task%s: %s%s", host, buf, 
+			  sigstr(status), corestr); 
+	} else {
+		error ("%s: task%s: Exited with exit code %d", 
 		       host, buf, WEXITSTATUS(status));
+	}
 
 	return;
 }
@@ -948,7 +950,7 @@ _exit_handler(srun_job_t *job, slurm_msg_t *exit_msg)
 			continue;
 		}
 
-		snprintf(buf, sizeof(buf), "task%d", taskid);
+		snprintf(buf, sizeof(buf), "%d", taskid);
 		hostlist_push(hl, buf);
 
 		slurm_mutex_lock(&job->task_mutex);
diff --git a/src/srun/multi_prog.c b/src/srun/multi_prog.c
index af36c99f7..364d8a8c0 100644
--- a/src/srun/multi_prog.c
+++ b/src/srun/multi_prog.c
@@ -54,6 +54,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "src/common/bitstring.h"
 #include "src/common/log.h"
 #include "src/common/xassert.h"
 #include "src/common/xmalloc.h"
@@ -132,7 +133,7 @@ _set_exec_names(char *ranks, char *exec_name, int ntasks)
 
 	if (ranks[0] == '*' && ranks[1] == '\0') {
 		low_num = 0;
-		high_num = ntasks -1;
+		high_num = ntasks - 1;
 		_set_range(low_num, high_num, exec_name);
 		return;
 	}
@@ -161,7 +162,8 @@ _set_exec_names(char *ranks, char *exec_name, int ntasks)
 			high_num = MIN((ntasks-1), atoi(upper));
 			_set_range(low_num, high_num, exec_path);
 		} else {
-			error ("Invalid task range specification (%s) ignored.",				range);
+			error ("Invalid task range specification (%s) ignored.",
+				range);
 		}
 	}
 }
@@ -190,8 +192,8 @@ set_multi_name(int ntasks)
 	while (fgets(line, sizeof(line), config_fd)) {
 		line_num ++;
 		if (strlen (line) >= (sizeof(line) - 1)) {
-			error ("Line %d of configuration file too long", 
-				line_num);
+			error ("Line %d of configuration file %s too long", 
+				line_num, config_fname);
 			fclose(config_fd);
 			return -1;
 		} 
@@ -208,7 +210,8 @@ set_multi_name(int ntasks)
 		ranks = strtok_r(p, " \t\n", &ptrptr);
 		exec_name = strtok_r(NULL, " \t\n", &ptrptr);
 		if (!ranks || !exec_name) {
-			error("Line %d is invalid", line_num);
+			error("Line %d of configuration file %s is invalid", 
+				line_num, config_fname);
 			fclose(config_fd);
 			return -1;
 		}
@@ -217,3 +220,150 @@ set_multi_name(int ntasks)
 	fclose(config_fd);
 	return 0;
 }
+
+static int
+_update_task_mask(int low_num, int high_num, int ntasks, bitstr_t *task_mask)
+{
+	int i;
+
+	if (low_num > high_num) {
+		error("Invalid task range, %d-%d", low_num, high_num);
+		return -1;
+	}
+	if (low_num < 0) {
+		error("Invalid task id, %d < 0", low_num);
+		return -1;
+	}
+	if (high_num >= ntasks) {
+		error("Invalid task id, %d >= ntasks", high_num);
+		return -1;
+	}
+	for (i=low_num; i<=high_num; i++) {
+		if (bit_test(task_mask, i)) {
+			error("Duplicate record for task %d", i);
+			return -1;
+		}
+		bit_set(task_mask, i);
+	}
+	return 0;
+}
+
+static int
+_validate_ranks(char *ranks, int ntasks, bitstr_t *task_mask)
+{
+	char *range = NULL, *p = NULL;
+	char *ptrptr = NULL, *upper = NULL;
+	int low_num, high_num;
+
+	if (ranks[0] == '*' && ranks[1] == '\0') {
+		low_num = 0;
+		high_num = ntasks - 1;
+		return _update_task_mask(low_num, high_num, ntasks, task_mask);
+	}
+
+	for (range = strtok_r(ranks, ",", &ptrptr); range != NULL;
+			range = strtok_r(NULL, ",", &ptrptr)) {
+		p = range;
+		while (*p != '\0' && isdigit (*p))
+			p ++;
+
+		if (*p == '\0') { /* single rank */
+			low_num  = atoi(range);
+			high_num = low_num;
+		} else if (*p == '-') { /* lower-upper */
+			upper = ++ p;
+			while (isdigit (*p))
+				p ++;
+			if (*p != '\0') {
+				error ("Invalid task range specification");
+				return -1;
+			}
+			low_num  = atoi(range);
+			high_num = atoi(upper);
+		} else {
+			error ("Invalid task range specification (%s)",
+				range);
+			return -1;
+		}
+
+		if (_update_task_mask(low_num, high_num, ntasks, task_mask))
+			return -1;
+	}
+	return 0;
+}
+
+/*
+ * Verify that we have a valid executable program specified for each task
+ *	when the --multi-prog option is used.
+ *
+ * Return 0 on success, -1 otherwise
+ */
+extern int
+verify_multi_name(char *config_fname, int ntasks)
+{
+	FILE *config_fd;
+	char line[256];
+	char *ranks, *exec_name, *p, *ptrptr;
+	int line_num = 0, i, rc = 0;
+	bitstr_t *task_mask;
+
+	if (ntasks <= 0) {
+		error("Invalid task count %d", ntasks);
+		return -1;
+	}
+
+	config_fd = fopen(config_fname, "r");
+	if (config_fd == NULL) {
+		error("Unable to open configuration file %s", config_fname);
+		return -1;
+	}
+
+	task_mask = bit_alloc(ntasks);
+	while (fgets(line, sizeof(line), config_fd)) {
+		line_num ++;
+		if (strlen (line) >= (sizeof(line) - 1)) {
+			error ("Line %d of configuration file %s too long", 
+				line_num, config_fname);
+			rc = -1;
+			goto fini;
+		} 
+		p = line;
+		while (*p != '\0' && isspace (*p)) /* remove leading spaces */
+			p ++;
+		
+		if (*p == '#') /* only whole-line comments handled */
+			continue;
+
+		if (*p == '\0') /* blank line ignored */
+			continue;
+
+		ranks = strtok_r(p, " \t\n", &ptrptr);
+		exec_name = strtok_r(NULL, " \t\n", &ptrptr);
+		if (!ranks || !exec_name) {
+			error("Line %d of configuration file %s invalid", 
+				line_num, config_fname);
+			rc = -1;
+			goto fini;
+		}
+		if (_validate_ranks(ranks, ntasks, task_mask)) {
+			error("Line %d of configuration file %s invalid", 
+				line_num, config_fname);
+			rc = -1;
+			goto fini;
+		}
+	}
+
+	for (i=0; i<ntasks; i++) {
+		if (!bit_test(task_mask, i)) {
+			error("Configuration file %s invalid, "
+				"no record for task id %d", 
+				config_fname, i);
+			rc = -1;
+			goto fini;
+		}
+	}
+
+fini:	fclose(config_fd);
+	bit_free(task_mask);
+	return rc;
+}
diff --git a/src/srun/multi_prog.h b/src/srun/multi_prog.h
index 196dd2fb4..28c2cc37c 100644
--- a/src/srun/multi_prog.h
+++ b/src/srun/multi_prog.h
@@ -44,5 +44,13 @@
  * configuration file */
 extern int set_multi_name(int ntasks);
 
+/*
+ * Verify that we have a valid executable program specified for each task
+ *	when the --multi-prog option is used.
+ *
+ * Return 0 on success, -1 otherwise
+ */
+extern int verify_multi_name(char *config_fname, int ntasks);
+
 #endif
 
diff --git a/src/srun/opt.c b/src/srun/opt.c
index 69fdc4df4..17a78067d 100644
--- a/src/srun/opt.c
+++ b/src/srun/opt.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.c - options processing for srun
- *  $Id: opt.c 12315 2007-09-13 23:56:02Z jette $
+ *  $Id: opt.c 12583 2007-10-30 17:01:31Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -83,8 +83,9 @@
 #include "src/common/optz.h"
 #include "src/api/pmi_server.h"
 
-#include "src/srun/opt.h"
 #include "src/srun/attach.h"
+#include "src/srun/multi_prog.h"
+#include "src/srun/opt.h"
 #include "src/common/mpi.h"
 
 /* generic OPT_ definitions -- mainly for use with env vars  */
@@ -1044,7 +1045,7 @@ static void _opt_default()
 		opt.msg_timeout     = 15;
 	}
 	
-	opt.get_user_env = false;
+	opt.get_user_env = -1;
 }
 
 /*---[ env var processing ]-----------------------------------------------*/
@@ -1419,7 +1420,7 @@ void set_options(const int argc, char **argv, int first)
 		{"mloader-image",    required_argument, 0, LONG_OPT_MLOADER_IMAGE},
 		{"ramdisk-image",    required_argument, 0, LONG_OPT_RAMDISK_IMAGE},
 		{"reboot",           no_argument,       0, LONG_OPT_REBOOT},            
-		{"get-user-env",     no_argument,       0, LONG_OPT_GET_USER_ENV},
+		{"get-user-env",     optional_argument, 0, LONG_OPT_GET_USER_ENV},
 		{NULL,               0,                 0, 0}
 	};
 	char *opt_string = "+a:AbB:c:C:d:D:e:g:Hi:IjJ:kKlm:n:N:"
@@ -1911,6 +1912,15 @@ void set_options(const int argc, char **argv, int first)
 				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
 				exit(1);
 			}
+			if (opt.nice < 0) {
+				uid_t my_uid = getuid();
+				if ((my_uid != 0) &&
+				    (my_uid != slurm_get_slurm_user_id())) {
+					error("Nice value must be non-negative, "
+					      "value ignored");
+					opt.nice = 0;
+				}
+			}
 			break;
 		case LONG_OPT_CTRL_COMM_IFHN:
 			xfree(opt.ctrl_comm_ifhn);
@@ -1995,7 +2005,10 @@ void set_options(const int argc, char **argv, int first)
 			opt.reboot = true;
 			break;
 		case LONG_OPT_GET_USER_ENV:
-			opt.get_user_env = true;
+			if (optarg)
+				opt.get_user_env = strtol(optarg, NULL, 10);
+			else
+				opt.get_user_env = 0;
 			break;
 		default:
 			if (spank_process_option (opt_char, optarg) < 0) {
@@ -2125,7 +2138,6 @@ static void _opt_args(int argc, char **argv)
 			exit(1);
 		}
 		_load_multi(&remote_argc, remote_argv);
-
 	}
 	else if (remote_argc > 0) {
 		char *fullpath;
@@ -2140,6 +2152,9 @@ static void _opt_args(int argc, char **argv)
 	}
 	if (!_opt_verify())
 		exit(1);
+
+	if (opt.multi_prog && verify_multi_name(remote_argv[0], opt.nprocs))
+		exit(1);
 }
 
 /* 
@@ -2504,14 +2519,15 @@ static List
 _create_path_list(void)
 {
 	List l = list_create(_freeF);
-	char *path = xstrdup(getenv("PATH"));
-	char *c, *lc;
+	char *path, *c, *lc;
 
-	if (!path) {
+	c = getenv("PATH");
+	if (!c) {
 		verbose("No PATH environment variable");
 		return l;
 	}
 
+	path = xstrdup(c);
 	c = lc = path;
 
 	while (*c != '\0') {
diff --git a/src/srun/opt.h b/src/srun/opt.h
index 7fbccde51..1bd844e00 100644
--- a/src/srun/opt.h
+++ b/src/srun/opt.h
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.h - definitions for srun option processing
- *  $Id: opt.h 11992 2007-08-10 18:59:15Z jette $
+ *  $Id: opt.h 12574 2007-10-26 17:00:52Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -212,7 +212,7 @@ typedef struct srun_options {
 	uint16_t mail_type;	/* --mail-type			*/
 	char *mail_user;	/* --mail-user			*/
 	char *ctrl_comm_ifhn;	/* --ctrl-comm-ifhn		*/
-	bool get_user_env;	/* --get-user-env		*/
+	int get_user_env;	/* --get-user-env[=secs]	*/
 } opt_t;
 
 extern opt_t opt;
diff --git a/src/srun/srun.c b/src/srun/srun.c
index efdfbb401..4fb3f0b00 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -1229,7 +1229,7 @@ srun_set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds)
 	 * create stdin file descriptor
 	 */
 	if (_is_local_file(job->ifname)) {
-		if (job->ifname->name == NULL || job->ifname->taskid != -1) {
+		if ((job->ifname->name == NULL) || (job->ifname->taskid != -1)) {
 			cio_fds->in.fd = STDIN_FILENO;
 		} else {
 			cio_fds->in.fd = open(job->ifname->name, O_RDONLY);
@@ -1247,7 +1247,7 @@ srun_set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds)
 	 * create stdout file descriptor
 	 */
 	if (_is_local_file(job->ofname)) {
-		if (job->ofname->name == NULL) {
+		if ((job->ofname->name == NULL) || (job->ofname->taskid != -1)) {
 			cio_fds->out.fd = STDOUT_FILENO;
 		} else {
 			cio_fds->out.fd = open(job->ofname->name,
@@ -1270,7 +1270,7 @@ srun_set_stdio_fds(srun_job_t *job, slurm_step_io_fds_t *cio_fds)
 		debug3("stdout and stderr sharing a file");
 		cio_fds->err.fd = cio_fds->out.fd;
 	} else if (_is_local_file(job->efname)) {
-		if (job->efname->name == NULL) {
+		if ((job->efname->name == NULL) || (job->efname->taskid != -1)) {
 			cio_fds->err.fd = STDERR_FILENO;
 		} else {
 			cio_fds->err.fd = open(job->efname->name,
diff --git a/src/srun/srun.wrapper.c b/src/srun/srun.wrapper.c
index 4f1f8fb9b..712a7724b 100644
--- a/src/srun/srun.wrapper.c
+++ b/src/srun/srun.wrapper.c
@@ -2,7 +2,8 @@
  * srun.wrapper.c - srun command wrapper for use with debuggers
  *	srun is the SLURM parallel job initiator and resource allocator
  *
- * For TotalView, a parallel job debugger from Etnus <http://www.etnus.com>
+ * For TotalView, a parallel job debugger from 
+ * TotalView Technologies, LLC <http://www.TotalViewTech.com>
  *	Type "<ctrl-a>" to specify arguments for srun
  *	Type "g" to start the program
  *
diff --git a/src/srun/srun_job.c b/src/srun/srun_job.c
index 1790c2be1..4c2ad3158 100644
--- a/src/srun/srun_job.c
+++ b/src/srun/srun_job.c
@@ -607,14 +607,14 @@ report_task_status(srun_job_t *job)
 	for (i = 0; i < opt.nprocs; i++) {
 		int state = job->task_state[i];
 		debug3("  state of task %d is %d", i, state);
-		snprintf(buf, 256, "task%d", i);
+		snprintf(buf, 256, "%d", i);
 		hostlist_push(hl[state], buf); 
 	}
 
 	for (i = 0; i< NTASK_STATES; i++) {
 		if (hostlist_count(hl[i]) > 0) {
 			hostlist_ranged_string(hl[i], MAXHOSTRANGELEN, buf);
-			info("%s: %s", buf, _task_state_name(i));
+			info("task%s: %s", buf, _task_state_name(i));
 		}
 		hostlist_destroy(hl[i]);
 	}
diff --git a/src/strigger/Makefile.in b/src/strigger/Makefile.in
index 4c8ca10ab..ffb5dbbea 100644
--- a/src/strigger/Makefile.in
+++ b/src/strigger/Makefile.in
@@ -174,6 +174,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sview/Makefile.in b/src/sview/Makefile.in
index 230584364..f72b149de 100644
--- a/src/sview/Makefile.in
+++ b/src/sview/Makefile.in
@@ -191,6 +191,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/src/sview/job_info.c b/src/sview/job_info.c
index d7c2be59b..e07749e1d 100644
--- a/src/sview/job_info.c
+++ b/src/sview/job_info.c
@@ -2330,9 +2330,9 @@ need_refresh:
 			
 			goto need_refresh;
 		}
-		if(first_time)
-			put_buttons_in_table(popup_win->grid_table,
-					     popup_win->grid_button_list);
+		
+		put_buttons_in_table(popup_win->grid_table,
+				     popup_win->grid_button_list);
 	}
 	gtk_widget_show_all(spec_info->display_widget);
 
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 5bcde55a1..ac957c0b0 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -162,6 +162,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in
index 3752b67bc..2f48840aa 100644
--- a/testsuite/expect/Makefile.in
+++ b/testsuite/expect/Makefile.in
@@ -143,6 +143,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/expect/README b/testsuite/expect/README
index adce31709..415879e13 100644
--- a/testsuite/expect/README
+++ b/testsuite/expect/README
@@ -108,8 +108,8 @@ test1.19   Test srun stdout/err file name formatting (--output and --error
            options with %j, %J, %n, %s and %t specifications).
 test1.20   Test srun stdout/err disabling (--output and --error options with 
            argument of "none").
-test1.21   Test srun stdin routing to specific task (--input option with 
-           numeric argument).
+test1.21   Test srun stdin/out routing with specific task number (--input 
+           and --output options with numeric argument).
 test1.22   Confirm that a job executes with various launch thread fanouts
            (--threads option).
 test1.23   Verify node configuration specification (--mem, --mincpus, and 
diff --git a/testsuite/expect/globals b/testsuite/expect/globals
index 4d4c7f51f..005cb3dac 100755
--- a/testsuite/expect/globals
+++ b/testsuite/expect/globals
@@ -456,6 +456,46 @@ proc wait_for_job { job_id desired_state } {
 	}
 }
 
+################################################################
+#
+# Proc: wait_for_step
+#
+# Purpose: Wait for a job step to be found, exponential back-off 
+# 1 to 10 seconds
+#
+# Returns: A non-zero return code indicates a failure.
+#
+# Input: step_id   -- The SLURM step id of a job we want to
+#                     wait for.
+#
+################################################################
+
+proc wait_for_step { step_id } {
+	global scontrol max_job_state_delay
+	set sleep_time  1
+	set my_delay    0
+	while 1 {
+		set fd [open "|$scontrol -o show step $step_id"]
+		gets $fd line
+		catch {close $fd}
+		if {[regexp {Nodes=} $line foo] == 1} {
+			return 0
+		}
+		if { $my_delay > $max_job_state_delay } {
+			send_user "FAILURE: Timeout waiting for job step\n"
+			return 1
+		}
+
+		exec sleep $sleep_time
+		set my_delay [expr $my_delay + $sleep_time]
+		set sleep_time  [expr $sleep_time * 2]
+		if { $sleep_time > 10 } {
+			set sleep_time 10
+		}
+	}
+}
+
+
 ################################################################
 #
 # Proc: test_front_end
diff --git a/testsuite/expect/test1.21 b/testsuite/expect/test1.21
index 8e2c1efa6..e920d7766 100755
--- a/testsuite/expect/test1.21
+++ b/testsuite/expect/test1.21
@@ -1,14 +1,14 @@
 #!/usr/bin/expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Test srun stdin routing to specific task (--input option with 
-#          numeric argument).
+#          Test srun stdin/out routing with specific task number (--input
+#          and --output options with numeric argument).
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
 #          anything else indicates a failure mode that must be investigated.
 ############################################################################
-# Copyright (C) 2002 The Regents of the University of California.
+# Copyright (C) 2002-2007 The Regents of the University of California.
 # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 # Written by Morris Jette <jette1@llnl.gov>
 # UCRL-CODE-226842.
@@ -75,9 +75,46 @@ expect {
 		wait
 	}
 }
+if {$matches != 1} {
+	send_user "\nFAILURE: stdin to specific task_id failed\n"
+	set exit_code 1
+}
+if {$exit_code == 0} {
+	send_user "\nSo far... stdin to specific task worked fine\n\n\n"
+}
 
+#
+# Spawn program to print task number, we only expect to see output from task 2
+#
+set job_id  0
+set matches 0
+set srun_pid [spawn $srun --output=$task_id -N1 -n10 -O -v env]
+expect {
+	-re "launching ($number).0 on host" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	-re "SLURM_PROCID=($number)" {
+		set proc_id $expect_out(1,string)
+		if {$task_id == $proc_id} {
+			incr matches
+		} else {
+			send_user "\nFAILURE: wrong task_id responded\n"
+			set exit_code 1
+		}
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		slow_kill $srun_pid
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
 if {$matches != 1} {
-	send_user "\nFAILURE: specific task_id failed to respond\n"
+	send_user "\nFAILURE: stdout from specific task_id failed\n"
 	set exit_code 1
 }
 
diff --git a/testsuite/expect/test1.54 b/testsuite/expect/test1.54
index 573422264..21a153bfb 100755
--- a/testsuite/expect/test1.54
+++ b/testsuite/expect/test1.54
@@ -96,6 +96,8 @@ if {$matches != 4} {
 }
 if {$exit_code != 0} {
 	exit $exit_code
+} else {
+	send_user "\nSo far, so good\n\n"
 }
 
 #
@@ -146,6 +148,37 @@ if {$matches != 4} {
 	set exit_code 1
 }
 
+if {$exit_code != 0} {
+	exit $exit_code
+} else {
+	send_user "\nSo far, so good\n\n"
+}
+
+#
+# Submit a slurm job that asks for more tasks than specified in our 
+# configuration file
+#
+set matches   0
+set srun_pid [spawn $srun -N1 -n5 --overcommit -l -t1 --multi-prog  ./$file_in]
+expect {
+	-re "Configuration file .* invalid" {
+		send_user "\nNo worries. This error is expected\n"
+		incr matches
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		slow_kill $srun_pid
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: did not note lack of a executable for task 5.\n"
+	set exit_code 1
+}
+
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_in
 	send_user "\nSUCCESS\n"
diff --git a/testsuite/expect/test1.89 b/testsuite/expect/test1.89
index 5edb827d9..c314a4f41 100755
--- a/testsuite/expect/test1.89
+++ b/testsuite/expect/test1.89
@@ -481,6 +481,9 @@ expect {
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_prog
 	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nNOTE: This test can fail if the node configuration in slurm.conf \n"
+	send_user "  (sockets, cores, threads) differs from the actual configuration\n"
 }
 exit $exit_code
 
diff --git a/testsuite/expect/test1.90 b/testsuite/expect/test1.90
index 9b2dd825e..374978e9f 100755
--- a/testsuite/expect/test1.90
+++ b/testsuite/expect/test1.90
@@ -527,6 +527,10 @@ expect {
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_prog
 	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nNOTE: This test can fail if the node configuration in slurm.conf \n"
+	send_user "  (sockets, cores, threads) differs from the actual configuration\n"
+
 }
 exit $exit_code
 
diff --git a/testsuite/expect/test11.5 b/testsuite/expect/test11.5
index 12b1b2581..243487b30 100755
--- a/testsuite/expect/test11.5
+++ b/testsuite/expect/test11.5
@@ -74,17 +74,14 @@ if {$job_id == 0} {
 	exit 1
 }
 
-exec $bin_rm -f $file_in
-
 #
-# Wait for job to begin execution
+# Wait for step  to begin execution
 #
-if {[wait_for_job $job_id RUNNING] != 0} {
-	send_user "\nFAILURE: waiting for job $job_id to run\n"
+if {[wait_for_step $job_id.0] != 0} {
+	send_user "\nFAILURE: waiting for step $job_id.0 to run\n"
 	cancel_job $job_id
 	exit 1
 }
-exec $bin_sleep 2
 
 #
 # Enable/disable/test ability to heckpoint
@@ -245,6 +242,7 @@ if {$matches != 1} {
 #
 cancel_job $job_id
 if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
 	send_user "\nSUCCESS\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test18.36 b/testsuite/expect/test18.36
index 3b649d2e2..8f7a6be43 100755
--- a/testsuite/expect/test18.36
+++ b/testsuite/expect/test18.36
@@ -491,6 +491,9 @@ expect {
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_prog
 	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nNOTE: This test can fail if the node configuration in slurm.conf \n"
+	send_user "  (sockets, cores, threads) differs from the actual configuration\n"
 }
 exit $exit_code
 
diff --git a/testsuite/expect/test18.37 b/testsuite/expect/test18.37
index b4dcb6c0f..ccdcfb461 100755
--- a/testsuite/expect/test18.37
+++ b/testsuite/expect/test18.37
@@ -530,6 +530,9 @@ expect {
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_prog
 	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nNOTE: This test can fail if the node configuration in slurm.conf \n"
+	send_user "  (sockets, cores, threads) differs from the actual configuration\n"
 }
 exit $exit_code
 
diff --git a/testsuite/expect/test6.7 b/testsuite/expect/test6.7
index 2e89e959c..269e76c38 100755
--- a/testsuite/expect/test6.7
+++ b/testsuite/expect/test6.7
@@ -75,7 +75,8 @@ if {[wait_for_job $job_id RUNNING] != 0} {
 	cancel_job $job_id
 	exit 1
 }
-exec $bin_sleep 2
+# Allow time for the step to start
+exec $bin_sleep 4
 
 #
 # Test verbose scancel
diff --git a/testsuite/slurm_unit/Makefile.in b/testsuite/slurm_unit/Makefile.in
index 3ce0d1481..48c72e40c 100644
--- a/testsuite/slurm_unit/Makefile.in
+++ b/testsuite/slurm_unit/Makefile.in
@@ -155,6 +155,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/slurm_unit/api/Makefile.in b/testsuite/slurm_unit/api/Makefile.in
index 0e3708419..bd6610ab2 100644
--- a/testsuite/slurm_unit/api/Makefile.in
+++ b/testsuite/slurm_unit/api/Makefile.in
@@ -175,6 +175,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/slurm_unit/api/manual/Makefile.in b/testsuite/slurm_unit/api/manual/Makefile.in
index 621d8d7b2..5e77e3dca 100644
--- a/testsuite/slurm_unit/api/manual/Makefile.in
+++ b/testsuite/slurm_unit/api/manual/Makefile.in
@@ -197,6 +197,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/slurm_unit/common/Makefile.in b/testsuite/slurm_unit/common/Makefile.in
index 1c9ca76d2..6dd0bbce7 100644
--- a/testsuite/slurm_unit/common/Makefile.in
+++ b/testsuite/slurm_unit/common/Makefile.in
@@ -183,6 +183,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/slurm_unit/slurmctld/Makefile.in b/testsuite/slurm_unit/slurmctld/Makefile.in
index 67c7ed299..83f241777 100644
--- a/testsuite/slurm_unit/slurmctld/Makefile.in
+++ b/testsuite/slurm_unit/slurmctld/Makefile.in
@@ -146,6 +146,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
diff --git a/testsuite/slurm_unit/slurmd/Makefile.in b/testsuite/slurm_unit/slurmd/Makefile.in
index 040f69df5..2be30e7ad 100644
--- a/testsuite/slurm_unit/slurmd/Makefile.in
+++ b/testsuite/slurm_unit/slurmd/Makefile.in
@@ -146,6 +146,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 RELEASE = @RELEASE@
+SED = @SED@
 SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
 SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
 SET_MAKE = @SET_MAKE@
-- 
GitLab