Updated and cleaned automakefiles, and switched to automake1-4f. We still
authorlindahl <lindahl>
Thu, 28 Jun 2001 09:04:41 +0000 (09:04 +0000)
committerlindahl <lindahl>
Thu, 28 Jun 2001 09:04:41 +0000 (09:04 +0000)
can't use stock automake 1.4, but with these new files at least it doesn't
fail silently.
Removed the separate xdrf dummy file - we use defines in libxdrf instead.

25 files changed:
Makefile.am
README
acinclude.m4
aclocal.m4
configure
configure.in
include/config.h.in
include/copyrite.h
scripts/Makefile.am
share/template/Makefile.am
share/template/README
src/Makefile.am
src/contrib/Makefile.am
src/gmxlib/Makefile.am
src/gmxlib/copyrite.c
src/gmxlib/dumxdrf.c [deleted file]
src/gmxlib/libxdrf.c
src/gmxlib/mkinl_calcdist.c
src/gmxlib/mkinl_declarations.c
src/gmxlib/statutil.c
src/kernel/Makefile.am
src/mdlib/Makefile.am
src/mdlib/md.c
src/ngmx/Makefile.am
src/tools/Makefile.am

index ea6d7a32992cbe9aa284c4a79eb910f22182a85a..bf63039d506cfeec814e5156136166fe08809596 100644 (file)
@@ -1,4 +1,11 @@
-# Note: this file is generated automatically from Makefile.am
+## Process this file with automake to produce Makefile.in
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is automatically from Makefile.am by automake.
+
+# N.B.: To be able to use dependency tracking on all hosts (not only w. gmake/gcc)
+# and to use the suffix in library names we need the development versions of
+# automake. Presently, this means automake version 1.4f. In Groningen, you
+# can find that under ~lindahl/gnu/bin , or download a copy from www.gromacs.org
 
 AUTOMAKE_OPTIONS = foreign
 
@@ -7,32 +14,59 @@ SUBDIRS = include src share admin scripts man
 #
 # Most files in the config subdir is included automatically when
 # we issue "make dist", but some versions of automake seem to have
-# problems with it, so we include them all...
+# problems with it, so just include them all...
 
 EXTRA_DIST = config/depcomp    config/ltconfig         config/ltcf-c.sh   \
              config/ltcf-f77.sh config/config.guess    config/config.sub  \
             config/install-sh  config/missing          config/ltmain.sh   \
              config/mkinstalldirs
 
-#
-# This is a shortcut to construct the mdrun executable by first
-# building the two libraries and then only mdrun in kernel.
-# The second one installs it.
-#
+install-hook:
+       @echo ""
+       @echo "GROMACS is installed under $(prefix)."
+       @echo "Make sure to update your PATH and MANPATH to find the"
+       @echo "programs and unix manual pages, and possibly LD_LIBRARY_PATH"
+       @echo "or /etc/ld.so.conf if you are using dynamic libraries."
+
+# Shortcuts to construct and install the mdrun executable
+
 mdrun:         
-       (cd ${top_builddir}/src/gmxlib && $(MAKE))
-       (cd ${top_builddir}/src/mdlib && $(MAKE))
-       (cd ${top_builddir}/src/kernel && $(MAKE) mdrunXXX_SUFFIX_XXX)
+       (cd $(top_builddir)/src/gmxlib && $(MAKE))
+       (cd $(top_builddir)/src/mdlib && $(MAKE))
+       (cd $(top_builddir)/src/kernel && $(MAKE) mdrun)
 
 install-mdrun:
-       (cd ${top_builddir}/src/kernel && $(MAKE) install-mdrun)
+       (cd $(top_builddir)/src/kernel && $(MAKE) install-mdrun)
 
 links:
-       (cd /usr/local/bin && ln -sf ${bindir}/* .)
-
-#
-# Apart from normal things like .o, things matching this are removed
-# (The second one removes files beginning with a #)
+       programs=$(bindir)/* 
+       (cd /usr/local/bin && for i in $(programs); do \
+          (test ! -e $$i && $(LN_S) $$i .); \
+       done)
+
+rpm:   
+       mkdir -p rpm_buildroot/BUILD \
+         rpm_buildroot/SPECS \
+         rpm_buildroot/SOURCES \
+         rpm_buildroot/SRPMS \
+         rpm_buildroot/RPMS/i386
+       cp -f $(PACKAGE)-$(VERSION).tar.gz rpm_buildroot/SOURCES
+       cp -f admin/$(PACKAGE).spec rpm_buildroot/SPECS
+       rpm --rcfile /usr/lib/rpm/rpmrc:/etc/rpmrc:admin/rpmrc --clean --ba $(PACKAGE).spec
+       cp -f rpm_buildroot/RPMS/i386/*rpm $(top_builddir)
+       rm -rf rpm_buildroot
+
+mpi-rpm:       
+       mkdir -p rpm_buildroot/BUILD \
+         rpm_buildroot/SPECS \
+         rpm_buildroot/SOURCES \
+         rpm_buildroot/SRPMS \
+         rpm_buildroot/RPMS/i386
+       cp -f $(PACKAGE)-$(VERSION).tar.gz rpm_buildroot/SOURCES/$(PACKAGE)-mpi-$(VERSION).tar.gz
+       cp -f admin/$(PACKAGE)-mpi.spec rpm_buildroot/SPECS
+       rpm --rcfile /usr/lib/rpm/rpmrc:/etc/rpmrc:admin/rpmrc --clean --ba $(PACKAGE)-mpi.spec
+       cp -f rpm_buildroot/RPMS/i386/*rpm $(top_builddir)
+       rm -rf rpm_buildroot
 
 CLEANFILES = *~ \\\#* 
 
diff --git a/README b/README
index b830864f32b72c766ecd22c3286ac2ffcf4e90a7..7d06cf57ba0a4288893935bdc7a1fae27863ce08 100644 (file)
--- a/README
+++ b/README
@@ -16,7 +16,7 @@ you get notice of new versions or severe bugs, and it gives us a possibility
 to keep track of the number of users since no signature is required anymore.
 
 If you are a developer, or change the source for any other reason, check
-out http://developer.gromacs.org for details on using automake & autoconf!
+out http://www.gromacs.org/developer for details on using automake & autoconf!
 
                                * * * * *
 
index 5d299cdd1a3fca90a32ad6a32f6a7a87c7df4fe7..14cf3310599ebeff0541bd904b8751dd58500523 100644 (file)
@@ -5,16 +5,18 @@
 # including the possible prefixing with s or d to determine precision.
 # Arg 1 is the fftw header/library name to check for, without 
 # prefix or anything else (e.g. rfftw_mpi for real MPI transforms)
-# Arg 2 is the floating point size we want (real=4, double=8)
+# Arg 2 is the value of $enable_float, i.e. yes/no for precision=4/8.
 AC_DEFUN(ACX_CHECK_FFTW,
 [
 if test -z "$ac_fftw_firstname"; then
 
-if test "$2" = "8"; then
+if test "$2" = "no"; then
   prec="double"
+  realsize=8
   fftwcheckprefix=d
 else
   prec="single"
+  realsize=4
   fftwcheckprefix=s
 fi
 
@@ -33,7 +35,7 @@ AC_MSG_RESULT(no))
 if test -n "$fftwname"; then
 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
 AC_TRY_COMPILE([#include <$fftwname.h>],
-[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $2)]; ],
+[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; ],
 ok="yes",ok="no")
 fi
 
@@ -60,7 +62,7 @@ AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
 [/usr/local/include and /usr/local/lib by default.]
 [You can find information at www.gromacs.org, or in the INSTALL file.])
 ])
-AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $2)];],
+AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];],
 [
 fftwname=$xfftwname 
 usedprefix=$fftwcheckprefix
@@ -770,7 +772,7 @@ fi
 CPU_FLAGS=""
 
 if test "$GCC" = "yes"; then
-  AM_CONDITIONAL(GNU_CC,true)
+  ASFLAGS="$(ASFLAGS) -x assembler-with-cpp"
   # try to guess correct CPU flags, at least for linux
   case "${host_cpu}" in
     # i586/i686 cpu flags don't improve speed, thus no need to use them.
index 5f5384193048d2efc1d3923c16a41ae0b9e04f80..003d694cbc23aa36df16c3d1a303b37c0feb44e2 100644 (file)
@@ -1,14 +1,15 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+# aclocal.m4 generated automatically by aclocal 1.4f
 
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
 
  
 # ACX_CHECK_FFTW()
@@ -17,16 +18,18 @@ dnl PARTICULAR PURPOSE.
 # including the possible prefixing with s or d to determine precision.
 # Arg 1 is the fftw header/library name to check for, without 
 # prefix or anything else (e.g. rfftw_mpi for real MPI transforms)
-# Arg 2 is the floating point size we want (real=4, double=8)
+# Arg 2 is the value of $enable_float, i.e. yes/no for precision=4/8.
 AC_DEFUN(ACX_CHECK_FFTW,
 [
 if test -z "$ac_fftw_firstname"; then
 
-if test "$2" = "8"; then
+if test "$2" = "no"; then
   prec="double"
+  realsize=8
   fftwcheckprefix=d
 else
   prec="single"
+  realsize=4
   fftwcheckprefix=s
 fi
 
@@ -45,7 +48,7 @@ AC_MSG_RESULT(no))
 if test -n "$fftwname"; then
 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
 AC_TRY_COMPILE([#include <$fftwname.h>],
-[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $2)]; ],
+[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; ],
 ok="yes",ok="no")
 fi
 
@@ -72,7 +75,7 @@ AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
 [/usr/local/include and /usr/local/lib by default.]
 [You can find information at www.gromacs.org, or in the INSTALL file.])
 ])
-AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $2)];],
+AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];],
 [
 fftwname=$xfftwname 
 usedprefix=$fftwcheckprefix
@@ -780,7 +783,7 @@ fi
 CPU_FLAGS=""
 
 if test "$GCC" = "yes"; then
-  AM_CONDITIONAL(GNU_CC,true)
+  ASFLAGS="$(ASFLAGS) -x assembler-with-cpp"
   # try to guess correct CPU flags, at least for linux
   case "${host_cpu}" in
     # i586/i686 cpu flags don't improve speed, thus no need to use them.
@@ -1737,11 +1740,25 @@ AC_DEFUN([LT_AC_PROG_GCJ],
   AC_SUBST(GCJFLAGS)
 ])
 
-# Define a conditional.
+# serial 3
 
-AC_DEFUN(AM_CONDITIONAL,
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+#
+# FIXME: Once using 2.50, use this:
+# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE],
+        [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+ifelse([$1], [FALSE],
+       [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -1754,57 +1771,110 @@ fi])
 # some checks are only needed if your package does certain things.
 # But this isn't really a big deal.
 
-# serial 1
+# serial 5
 
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
-
-AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
+# The purpose of this macro is to provide the user with a means to
+# check macros which are provided without letting her know how the
+# information is coded.
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+      [],
+      [define([AC_PROVIDE_IFELSE],
+              [ifdef([AC_PROVIDE_$1],
+                     [$2], [$3])])])
+
+
+# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
+# ----------------------------------------------
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
 fi
+
+# Define the identity of the package.
+PACKAGE=$1
+AC_SUBST(PACKAGE)dnl
+VERSION=$2
+AC_SUBST(VERSION)dnl
 ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+
+# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
+# the ones we care about.
+ifdef([m4_pattern_allow],
+      [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_MISSING_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CC],
+                  [AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_][CC],
+                          defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CXX],
+                  [AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_][CXX],
+                          defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
+])
 
 #
 # Check to make sure that the build environment is sane.
 #
 
-AC_DEFUN(AM_SANITY_CHECK,
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
 # Just in case
 sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
-   if test "[$]*" = "X"; then
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftestfile`
+      set X `ls -t $srcdir/configure conftest.file`
    fi
-   if test "[$]*" != "X $srcdir/configure conftestfile" \
-      && test "[$]*" != "X conftestfile $srcdir/configure"; then
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -1814,7 +1884,7 @@ if (
 alias in your environment])
    fi
 
-   test "[$]2" = conftestfile
+   test "$[2]" = conftest.file
    )
 then
    # Ok.
@@ -1823,45 +1893,362 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-rm -f conftest*
 AC_MSG_RESULT(yes)])
 
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
-   $1=$2
-   AC_MSG_RESULT(found)
+
+# serial 2
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_INSTALL_SH
+# ---------------------
+# Like AM_MISSING_PROG, but only looks for install-sh.
+AC_DEFUN([AM_MISSING_INSTALL_SH],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+if test -z "$install_sh"; then
+   for install_sh in "$ac_aux_dir/install-sh" \
+                     "$ac_aux_dir/install.sh" \
+                     "${am_missing_run}${ac_auxdir}/install-sh";
+   do
+     test -f "$install_sh" && break
+   done
+   # FIXME: an evil hack: we remove the SHELL invocation from
+   # install_sh because automake adds it back in.  Sigh.
+   install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
+fi
+AC_SUBST(install_sh)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[test x"${MISSING+set}" = xset ||
+  MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
 else
-   $1="$3/missing $2"
-   AC_MSG_RESULT(missing)
+  am_missing_run=
+  am_backtick='`'
+  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
 fi
-AC_SUBST($1)])
+])
 
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to ${srcdir}/foo.  In other projects, it is set to `.'.
+# Of course, Automake must honor this variable whenever it call a tool
+# from the auxiliary directory.  The problem is that $srcdir (hence
+# $ac_aux_dir) can be either an absolute path or a path relative to
+# $top_srcdir or absolute, this depends on how configure is run.  This
+# is pretty anoying since it makes $ac_aux_dir quite unusable in
+# subdirectories: on the top source directory, any form will work
+# fine, but in subdirectories relative pat needs to be adapted.
+# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
+#   relative, but fail if $srcdir is absolute
+# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
+#   absolute, and success on relative paths.
+#
+# Consequently, we define and use $am_aux_dir, the "always absolute"
+# version of $ac_aux_dir.
 
-AC_DEFUN(AM_CONFIG_HEADER,
-[AC_PREREQ([2.12])
-AC_CONFIG_HEADER([$1])
-dnl When config.status generates a header, we must update the stamp-h file.
-dnl This file resides in the same directory as the config header
-dnl that is generated.  We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
-  case " <<$>>CONFIG_HEADERS " in
-  *" <<$>>am_file "*<<)>>
-    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
-    ;;
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
+_am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
+INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# serial 3
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+# AM_DEPENDENCIES(NAME)
+# ---------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX" or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+AC_DEFUN([AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+am_compiler_list=
+ifelse([$1], CC,
+       [AC_REQUIRE([AC_PROG_][CC])dnl
+AC_REQUIRE([AC_PROG_][CPP])
+depcc="$CC"
+depcpp="$CPP"],
+       [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
+AC_REQUIRE([AC_PROG_][CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"],
+       [$1], OBJC, [am_compiler_list='gcc3 gcc'
+depcc="$OBJC"
+depcpp=""],
+       [$1], GCJ,  [am_compiler_list='gcc3 gcc'
+depcc="$GCJ"
+depcpp=""],
+       [AC_REQUIRE([AC_PROG_][$1])dnl
+depcc="$$1"
+depcpp=""])
+
+AC_REQUIRE([AM_MAKE_INCLUDE])
+AC_REQUIRE([AM_DEP_TRACK])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir confdir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" confdir
+  cd confdir
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list="`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`"
+  fi
+  for depmode in $am_compiler_list; do
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+
+    case "$depmode" in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode="$depmode" \
+       source=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1; then
+      am_cv_$1_dependencies_compiler_type="$depmode"
+      break
+    fi
+  done
+
+  cd ..
+  rm -rf confdir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
+AC_SUBST([$1DEPMODE])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+  DEPDIR=.deps
+  # We redirect because .deps might already exist and be populated.
+  # In this situation we don't want to see an error.
+  rmdir .deps > /dev/null 2>&1
+else
+  DEPDIR=_deps
+fi
+AC_SUBST(DEPDIR)
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
+
+# Generate code to set up dependency tracking.
+# This macro should only be invoked once -- use via AC_REQUIRE.
+# Usage:
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP_TRUE" != x"" ||
+for mf in $CONFIG_FILES; do
+  case "$mf" in
+  Makefile) dirpart=.;;
+  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+  *) continue;;
   esac
-  am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
+  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+       s/\\\\$//
+       p
+       n
+       /\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+], [AMDEP_TRUE="$AMDEP_TRUE"
+ac_aux_dir="$ac_aux_dir"])])
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+       @echo done
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+_am_include='#'
+_am_quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+   _am_include=include
+   _am_quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$_am_include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      _am_include=.include
+      _am_quote='"'
+      _am_result=BSD
+   fi
+fi
+AC_SUBST(_am_include)
+AC_SUBST(_am_quote)
+AC_MSG_RESULT($_am_result)
+rm -f confinc confmf
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+# serial 3
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  We must strip everything past the first ":",
+# and everything past the last "/".
+
+AC_PREREQ([2.12])
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_CONFIG_HEADER([$1])
+  AC_OUTPUT_COMMANDS(
+   ifelse(patsubst([$1], [[^ ]], []),
+         [],
+         [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
+          patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
+  [am_indx=1
+  for am_file in $1; do
+    case " $CONFIG_HEADERS " in
+    *" $am_file "*)
+      echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
+      ;;
+    esac
+    am_indx=\`expr \$am_indx + 1\`
+  done])
+])
+
+
+# serial 1
+
+AC_DEFUN([AM_WITH_DMALLOC],
+[AC_MSG_CHECKING([if malloc debugging is wanted])
+AC_ARG_WITH(dmalloc,
+[  --with-dmalloc          use dmalloc, as in
+                          http://www.dmalloc.com/dmalloc.tar.gz],
+[if test "$withval" = yes; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(WITH_DMALLOC,1,
+            [Define if using the dmalloc debugging malloc package])
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  AC_MSG_RESULT(no)
+fi], [AC_MSG_RESULT(no)])
+])
 
index 8c243236ec1737c5ecf18373b2854df5c2e40061..c113cb30ed94add97c8cc9c87de4d31bac811ae2 100755 (executable)
--- a/configure
+++ b/configure
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
-ac_default_prefix=/usr/local/gromacs
-ac_help="$ac_help
-  --enable-mpi                  Compile parallel version of GROMACS"
 ac_help="$ac_help
-  --enable-vector               Compile for a vector machine"
+  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors"
+ac_default_prefix=/usr/local/gromacs
 ac_help="$ac_help
-  --enable-fortran              Fortran loops (default on sgi,ibm,sun,axp)"
+  --disable-float               use double instead of single precision"
 ac_help="$ac_help
-  --enable-float                Compile single precision GROMACS"
+  --enable-fortran              use fortran (default on sgi,ibm,sun,axp)"
 ac_help="$ac_help
-  --disable-type-suffix         Don't add a suffix to double precision files"
+  --enable-mpi                  compile for parallel runs using MPI"
 ac_help="$ac_help
-  --enable-mpi-suffix           Add a suffix to MPI files (default on ibm)"
+  --with-mpi-environment=VAR    only start parallel runs when VAR is set"
 ac_help="$ac_help
-  --enable-simplewater          Unroll water innerloops (default on sgi)"
+  --disable-nice                disable the nice priority on programs"
 ac_help="$ac_help
-  --disable-waterwater-loops    No special water-water loops (default on sgi)"
+  --disable-x86-asm             don't build assembly loops for x86"
 ac_help="$ac_help
-  --disable-nice                Disable the nice priority on mdrun"
+  --disable-cpu-optimization    no detection or tuning flags for cpu version"
 ac_help="$ac_help
-  --disable-x86-asm             Disable assembly loops on x86"
+  --disable-arch-subdirs        don't use subdirectories in bindir and libdir"
 ac_help="$ac_help
-  --disable-xdr                 Disable portable trajectory routines"
+  --enable-vector               create inner loops for a vector machine"
 ac_help="$ac_help
-  --disable-cpu-detection       Don't extend detection with exact cpu type"
+  --disable-waterloop-unrolling expand water loops (hack for sgi)"
 ac_help="$ac_help
-  --enable-software-recip       Do software 1/x (might be slower)"
+  --disable-waterwater-loops    turn off double unrolled loops (hack for sgi)"
 ac_help="$ac_help
-  --disable-software-sqrt       No software 1/sqrt (default on sgi,rs6000)"
+  --enable-software-recip       perform software 1/x"
 ac_help="$ac_help
-  --enable-vectorized-recip     Vectorize 1/x in LJ-only loops"
+  --disable-software-sqrt       no software 1/sqrt (disabled on sgi,rs6000)"
 ac_help="$ac_help
-  --enable-vectorized-sqrt=A,B  Loops to vectorize (default none)
-                                Choices: normal,solvent,water,water-water"
+  --enable-vectorized-recip     vectorize LJ-only inner loops"
 ac_help="$ac_help
-  --enable-prefetch-x=A,B       Prefetch coordinates in selected innerloops"
+  --enable-vectorized-sqrt=A,B  vectorize selected inner loops (default none)
+                                choices: normal,solvent,water,water-water"
 ac_help="$ac_help
-  --enable-prefetch-f=A,B       Prefetch forces in selected innerloops"
+  --enable-prefetch-x=A,B       prefetch coordinates in selected innerloops"
 ac_help="$ac_help
-  --enable-hide-square-latency  Try to get coords to cache before using them"
+  --enable-prefetch-f=A,B       prefetch forces in selected innerloops"
 ac_help="$ac_help
-  --enable-hide-table-latency   Try to get table data to cache before using it"
+  --enable-hide-square-latency  load coords to cache in advance"
 ac_help="$ac_help
-  --with-mpi-environment=VAR    Only start MPI mdrun when VAR is set"
+  --enable-hide-table-latency   load table data to cache in advance"
 ac_help="$ac_help
   --enable-shared[=PKGS]        build shared libraries [default=yes]"
 ac_help="$ac_help
@@ -67,6 +66,9 @@ ac_help="$ac_help
   --disable-libtool-lock        avoid locking (might break parallel builds)"
 ac_help="$ac_help
   --with-pic                    try to use only PIC/non-PIC [default=both]"
+ac_help="$ac_help
+  --with-dmalloc          use dmalloc, as in
+                          http://www.dmalloc.com/dmalloc.tar.gz"
 ac_help="$ac_help
   --with-x                use the X Window System"
 ac_help="$ac_help
@@ -553,13 +555,6 @@ for ac_site_file in $CONFIG_SITE; do
   fi
 done
 
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
-else
-  echo "creating cache $cache_file"
-  > $cache_file
-fi
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -583,12 +578,12 @@ else
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:587: checking for Cygwin environment" >&5
+echo "configure:582: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 592 "configure"
+#line 587 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -599,7 +594,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -616,19 +611,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:620: checking for mingw32 environment" >&5
+echo "configure:615: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 625 "configure"
+#line 620 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -677,7 +672,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:681: checking for a BSD compatible install" >&5
+echo "configure:676: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -730,23 +725,24 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:734: checking whether build environment is sane" >&5
+echo "configure:729: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftestfile`
+      set X `ls -t $srcdir/configure conftest.file`
    fi
-   if test "$*" != "X $srcdir/configure conftestfile" \
-      && test "$*" != "X conftestfile $srcdir/configure"; then
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -756,7 +752,7 @@ if (
 alias in your environment" 1>&2; exit 1; }
    fi
 
-   test "$2" = conftestfile
+   test "$2" = conftest.file
    )
 then
    # Ok.
@@ -765,7 +761,6 @@ else
    { echo "configure: error: newly created file is older than distributed files!
 Check your system clock" 1>&2; exit 1; }
 fi
-rm -f conftest*
 echo "$ac_t""yes" 1>&6
 if test "$program_transform_name" = s,x,x,; then
   program_transform_name=
@@ -786,8 +781,53 @@ test "$program_suffix" != NONE &&
 # sed with no file args requires a program.
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
+test x"${MISSING+set}" = xset ||
+  MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  am_backtick='`'
+  echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:801: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AWK="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+  echo "$ac_t""$AWK" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:791: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:831: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -813,14 +853,48 @@ else
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+  :
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
 
-PACKAGE=gromacs
 
-VERSION=3.0
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+  DEPDIR=.deps
+  # We redirect because .deps might already exist and be populated.
+  # In this situation we don't want to see an error.
+  rmdir .deps > /dev/null 2>&1
+else
+  DEPDIR=_deps
+fi
 
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
-  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+
+# test to see if srcdir already configured
+if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run \"make distclean\" there first" 1>&2; exit 1; }
 fi
+
+# Define the identity of the package.
+PACKAGE=gromacs
+VERSION=3.0
 cat >> confdefs.h <<EOF
 #define PACKAGE "$PACKAGE"
 EOF
@@ -830,503 +904,443 @@ cat >> confdefs.h <<EOF
 EOF
 
 
+# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
+# the ones we care about.
 
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:837: checking for working aclocal" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
-   ACLOCAL=aclocal
-   echo "$ac_t""found" 1>&6
-else
-   ACLOCAL="$missing_dir/missing aclocal"
-   echo "$ac_t""missing" 1>&6
-fi
+# Some tools Automake needs.
 
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:850: checking for working autoconf" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
-   AUTOCONF=autoconf
-   echo "$ac_t""found" 1>&6
-else
-   AUTOCONF="$missing_dir/missing autoconf"
-   echo "$ac_t""missing" 1>&6
-fi
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
 
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:863: checking for working automake" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
-   AUTOMAKE=automake
-   echo "$ac_t""found" 1>&6
-else
-   AUTOMAKE="$missing_dir/missing automake"
-   echo "$ac_t""missing" 1>&6
-fi
 
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:876: checking for working autoheader" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
-   AUTOHEADER=autoheader
-   echo "$ac_t""found" 1>&6
-else
-   AUTOHEADER="$missing_dir/missing autoheader"
-   echo "$ac_t""missing" 1>&6
-fi
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
 
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:889: checking for working makeinfo" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf.  Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
-   MAKEINFO=makeinfo
-   echo "$ac_t""found" 1>&6
-else
-   MAKEINFO="$missing_dir/missing makeinfo"
-   echo "$ac_t""missing" 1>&6
-fi
 
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
 
-SHARED_VERSION_INFO="1:0:0"
 
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 
-#######################################################################
-# User options
-#######################################################################
+AMTAR=${AMTAR-"${am_missing_run}tar"}
 
-#####
 
-# Check whether --enable-mpi or --disable-mpi was given.
-if test "${enable_mpi+set}" = set; then
-  enableval="$enable_mpi"
-  enable_mpi=$enableval
-else
-  enable_mpi=no
+if test -z "$install_sh"; then
+   for install_sh in "$ac_aux_dir/install-sh" \
+                     "$ac_aux_dir/install.sh" \
+                     "${am_missing_run}${ac_auxdir}/install-sh";
+   do
+     test -f "$install_sh" && break
+   done
+   # FIXME: an evil hack: we remove the SHELL invocation from
+   # install_sh because automake adds it back in.  Sigh.
+   install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
 fi
 
+_am_dirpart="`echo $install_sh | sed -e 's,//*[^/]*$,,'`"
+INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
 
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
 
-#####
 
-# Check whether --enable-vector or --disable-vector was given.
-if test "${enable_vector+set}" = set; then
-  enableval="$enable_vector"
-  enable_vector=$enableval
-else
-  enable_vector=no
-fi
 
+  
+
+SHARED_VERSION_INFO="1:0:0"
 
 
-#####
 
-# Check whether --enable-fortran or --disable-fortran was given.
-if test "${enable_fortran+set}" = set; then
-  enableval="$enable_fortran"
-  enable_fortran=$enableval
-else
-  enable_fortran=check
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:963: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
+
 
 
-#####
 
+
+
+
+
+#######################################################################
+# Simple options and makefile variables
+#######################################################################
+
+
+### Single/Double
 # Check whether --enable-float or --disable-float was given.
 if test "${enable_float+set}" = set; then
   enableval="$enable_float"
-  enable_float=$enableval
+  :
 else
   enable_float=yes
 fi
 
+if test "enable_float" = "no"; then
+  cat >> confdefs.h <<\EOF
+#define DOUBLE 
+EOF
 
+fi
 
-#####
-
-# Check whether --enable-type-suffix or --disable-type-suffix was given.
-if test "${enable_type_suffix+set}" = set; then
-  enableval="$enable_type_suffix"
-  enable_type_suffix=$enableval
+### Fortran or not
+# Check whether --enable-fortran or --disable-fortran was given.
+if test "${enable_fortran+set}" = set; then
+  enableval="$enable_fortran"
+  :
 else
-  enable_type_suffix=yes
+  case "${host_cpu}-${host_os}" in
+  sparc*-solaris* | alpha*-* | rs6000*-aix* | powerpc*-aix* | mips*-irix*) enable_fortran=yes ;;
+  *) enable_fortran=no ;;
+ esac
 fi
 
+if test "$enable_fortran" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define USE_FORTRAN 
+EOF
 
-
-#####
-
-# Check whether --enable-mpi-suffix or --disable-mpi-suffix was given.
-if test "${enable_mpi_suffix+set}" = set; then
-  enableval="$enable_mpi_suffix"
-  enable_mpi_suffix=$enableval
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerf.lo f77_wrappers.lo"
+  if test "$enable_float" = "yes"; then
+    MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincs.lo fsettle.lo fshake.lo"
+  else
+    MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincsd.lo fsettled.lo fshaked.lo"
+  fi
 else
-  enable_mpi_suffix=check
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerc.lo"
+  MDLIB_LIBOBJS="${MDLIB_LIBOBJS} clincs.lo csettle.lo cshake.lo"
 fi
 
 
-#####
-
-# Check whether --enable-simplewater or --disable-simplewater was given.
-if test "${enable_simplewater+set}" = set; then
-  enableval="$enable_simplewater"
-  enable_simplewater=$enableval
+### MPI or not
+# Check whether --enable-mpi or --disable-mpi was given.
+if test "${enable_mpi+set}" = set; then
+  enableval="$enable_mpi"
+  :
 else
-  enable_simplewater=check
+  enable_mpi=no
 fi
 
 
 
-#####
-# Check whether --enable-waterwater-loops or --disable-waterwater-loops was given.
-if test "${enable_waterwater_loops+set}" = set; then
-  enableval="$enable_waterwater_loops"
-  enable_waterwater_loops=$enableval
+### MPI environment
+# Check whether --with-mpi-environment or --without-mpi-environment was given.
+if test "${with_mpi_environment+set}" = set; then
+  withval="$with_mpi_environment"
+  :
 else
-  enable_waterwater_loops=check
+  case "${host_cpu}" in
+  mips*-irix*) with_mpi_environment="MPI_ENVIRONMENT" ;;
+  *) with_mpi_environment=no ;;
+esac
 fi
 
+if test "$with_mpi_environment" != "no"; then
+  cat >> confdefs.h <<EOF
+#define CHECK_MPI_ENV "$with_mpi_environment"
+EOF
 
+fi
 
-#####
 
+### Automatic nicing of programs
 # Check whether --enable-nice or --disable-nice was given.
 if test "${enable_nice+set}" = set; then
   enableval="$enable_nice"
-  enable_nice=$enableval
+  :
 else
   enable_nice=yes
 fi
 
+if test "$enable_nice" = "no"; then
+  cat >> confdefs.h <<\EOF
+#define NO_NICE 
+EOF
 
+fi
 
-#####
 
+### X86 assembly code
 # Check whether --enable-x86_asm or --disable-x86_asm was given.
 if test "${enable_x86_asm+set}" = set; then
   enableval="$enable_x86_asm"
-  enable_x86_asm=$enableval
+  :
 else
   enable_x86_asm=yes
 fi
 
+case "${host_cpu}" in
+   i?86) ;;    
+   *) enable_x86_asm=no ;;
+esac
 
 
-#####
+### Optimize for host cpu version
+# Check whether --enable-cpu-optimization or --disable-cpu-optimization was given.
+if test "${enable_cpu_optimization+set}" = set; then
+  enableval="$enable_cpu_optimization"
+  :
+else
+  enable_cpu_optimization=yes
+fi
+
 
-# Check whether --enable-xdr or --disable-xdr was given.
-if test "${enable_xdr+set}" = set; then
-  enableval="$enable_xdr"
-  enable_xdr=$enableval
+
+### Remove the arch/cpu subdirs in bin and lib
+# Check whether --enable-arch-subdirs or --disable-arch-subdirs was given.
+if test "${enable_arch_subdirs+set}" = set; then
+  enableval="$enable_arch_subdirs"
+  :
 else
-  enable_xdr=yes
+  enable_arch_subdirs=yes
 fi
 
 
 
-#####
+### Vector machine inner loops
+# Check whether --enable-vector or --disable-vector was given.
+if test "${enable_vector+set}" = set; then
+  enableval="$enable_vector"
+  :
+else
+  enable_vector=no
+fi
+
+if test "$enable_vector" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define USE_VECTOR 
+EOF
+
+fi
+
 
-# Check whether --enable-cpu-detection or --disable-cpu-detection was given.
-if test "${enable_cpu_detection+set}" = set; then
-  enableval="$enable_cpu_detection"
-  enable_cpu_detection=$enableval
+### Simplewater hack for SGI - disabled unrolling is the same as simplewater=yes
+# Check whether --enable-waterloop-unrolling or --disable-waterloop-unrolling was given.
+if test "${enable_waterloop_unrolling+set}" = set; then
+  enableval="$enable_waterloop_unrolling"
+  :
 else
-  enable_cpu_detection=yes
+  case "${host_cpu}-${host_os}" in
+  mips*-irix*) enable_waterloop_unrolling=yes ;;
+  *) enable_waterloop_unrolling=no ;;
+esac
 fi
 
+if test "$enable_waterloops_unrolling" = "no"; then
+  cat >> confdefs.h <<\EOF
+#define SIMPLEWATER 
+EOF
+
+fi
 
 
-#####
+### Turn off the special water-water loops on SGI...
+# Check whether --enable-waterwater-loops or --disable-waterwater-loops was given.
+if test "${enable_waterwater_loops+set}" = set; then
+  enableval="$enable_waterwater_loops"
+  :
+else
+  case "${host_cpu}-${host_os}" in
+  mips*-irix*) enable_waterwater_loops=yes ;;
+  *) enable_waterwater_loops=no ;;
+esac
+fi
+
+if test "$enable_waterwater_loops" = "no"; then
+  cat >> confdefs.h <<\EOF
+#define DISABLE_WATERWATER_LOOPS 
+EOF
+
+fi
 
+
+### Do software 1/x
 # Check whether --enable-software-recip or --disable-software-recip was given.
 if test "${enable_software_recip+set}" = set; then
   enableval="$enable_software_recip"
-  enable_softwarerecip=$enableval
+  :
 else
-  enable_softwarerecip=no
+  enable_software_recip=no
 fi
 
+if test "$enable_software_recip" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define SOFTWARE_RECIP 
+EOF
 
+fi
 
-#####
 
+### Do software 1/sqrt(x)
 # Check whether --enable-software-sqrt or --disable-software-sqrt was given.
 if test "${enable_software_sqrt+set}" = set; then
   enableval="$enable_software_sqrt"
-  enable_softwaresqrt=$enableval
+  :
 else
-  enable_softwaresqrt=check
+  case "${host_cpu}-${host_os}" in
+  mips*-irix* | rs6000*-aix*) enable_software_sqrt=no ;;
+  *) enable_software_sqrt=yes ;;
+esac
 fi
 
+if test "$enable_software_sqrt" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define SOFTWARE_SQRT 
+EOF
 
+fi
 
-#####
 
-# Check whether --enable-vectorized_recip or --disable-vectorized_recip was given.
+### Vectorize 1/x
+# Check whether --enable-vectorized-recip or --disable-vectorized-recip was given.
 if test "${enable_vectorized_recip+set}" = set; then
   enableval="$enable_vectorized_recip"
-  enable_vectorized_recip=$enableval
+  :
 else
   enable_vectorized_recip=no
 fi
 
+if test "$enable_vectorized_recip" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define VECTORIZE_RECIP 
+EOF
 
+else 
+  if test "$enable_vectorized_recip" != "no"; then
+    { echo "configure: error: Vectorized reciprocal is only meaningful for normal LJ-only loops" 1>&2; exit 1; }
+  fi
+fi
 
-#####
-
-# Check whether --enable-vectorized_sqrt or --disable-vectorized_sqrt was given.
+### Vectorize 1/sqrt(x)
+# Check whether --enable-vectorized-sqrt or --disable-vectorized-sqrt was given.
 if test "${enable_vectorized_sqrt+set}" = set; then
   enableval="$enable_vectorized_sqrt"
-  enable_vectorized_sqrt=$enableval
+  :
 else
-  enable_vectorized_sqrt=no
+  enable_vectorized_sqrt=not_selected
 fi
 
+# processing of vectorized_sqrt choices is done just before the final output stage!
 
 
-#####
-# Check whether --enable-prefetch_x or --disable-prefetch_x was given.
+# The four options below used to improve code scheduling, but the newest CPUs can usually rearrange
+# instructions dynamically at runtime, so they might not make much difference now:
+
+### Coordinate prefetching
+# Check whether --enable-prefetch-x or --disable-prefetch-x was given.
 if test "${enable_prefetch_x+set}" = set; then
   enableval="$enable_prefetch_x"
-  enable_prefetch_x=$enableval
+  :
 else
   enable_prefetch_x=no
 fi
 
+# processing of prefetch-x choices is done just before the final output stage!
 
 
-#####
-# Check whether --enable-prefetch_f or --disable-prefetch_f was given.
+### Force prefetching
+# Check whether --enable-prefetch-f or --disable-prefetch-f was given.
 if test "${enable_prefetch_f+set}" = set; then
   enableval="$enable_prefetch_f"
-  enable_prefetch_f=$enableval
+  :
 else
   enable_prefetch_f=no
 fi
 
+# processing of prefetch-f choices is done just before the final output stage!
 
 
-#####
-# Check whether --enable-hide_square_latency or --disable-hide_square_latency was given.
+### First load all coords in a water-water iteration, then square all pairs, then add the sums to get r2.
+# Check whether --enable-hide-square-latency or --disable-hide-square-latency was given.
 if test "${enable_hide_square_latency+set}" = set; then
   enableval="$enable_hide_square_latency"
-  enable_hide_square_latency=$enableval
+  :
 else
   enable_hide_square_latency=no
 fi
 
+if test "$enable_hide_square_latency" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define DECREASE_SQUARE_LATENCY 
+EOF
 
+fi
 
-#####
-# Check whether --enable-hide_table_latency or --disable-hide_table_latency was given.
+
+### Do the table lookups for all interactions between two water molecules before using the results
+# Check whether --enable-hide-table-latency or --disable-hide-table-latency was given.
 if test "${enable_hide_table_latency+set}" = set; then
   enableval="$enable_hide_table_latency"
-  enable_hide_table_latency=$enableval
+  :
 else
   enable_hide_table_latency=no
 fi
 
+if test "$enable_hide_table_latency" = "yes"; then
+  cat >> confdefs.h <<\EOF
+#define DECREASE_LOOKUP_LATENCY 
+EOF
 
-
-#####
-
-# Check whether --with-mpi-environment or --without-mpi-environment was given.
-if test "${with_mpi_environment+set}" = set; then
-  withval="$with_mpi_environment"
-  with_mpi_environment="$withval"
-else
-  with_mpi_environment=check
-fi
-
-
-
-########################################################################
-# Process the options
-########################################################################
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1169: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
-  case $nonopt in
-  NONE)
-    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
-    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
-    fi ;;
-  *) host_alias=$nonopt ;;
-  esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-
-case "${host_cpu}" in
- i?86)  
-   x86=yes 
-   ;;  
- *)      
-   x86=false 
-   ;;
-esac
-
-if test "$enable_fortran" = "check"; then
-case "${host_cpu}-${host_os}" in
-
-  sparc*-solaris* | alpha*-* | rs6000*-aix* | mips*-irix*)
-    enable_fortran=yes 
-    ;;
 
-  *)
-    enable_fortran=no 
-    ;;
- esac  
-fi
 
-if test "$enable_mpi_suffix" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-  rs6000*-aix* | powerpc*-aix*)
-    enable_mpi_suffix=yes
-    ;;
-  *)
-    enable_mpi_suffix=no 
-    ;;
- esac  
-fi
 
-if test "$enable_simplewater" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-  mips*-irix*)
-    enable_simplewater=yes 
-    ;;
 
-  *)
-    enable_simplewater=no 
-    ;;
-esac   
-fi
 
-if test "$enable_waterwater_loops" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-   mips*-irix*)
-     enable_waterwater_loops=no 
-     ;;
 
-   *)
-     enable_waterwater_loops=yes 
-     ;;
-esac
-fi
+############################################################
+# Checks for programs
+############################################################
 
-if test "$enable_softwaresqrt" = "check"; then
+# normally we use the default compiler, but on alpha/linux we try the compaq ones first
 case "${host_cpu}-${host_os}" in
-
-  mips*-irix* | rs6000*-aix*)
-    enable_softwaresqrt=no 
-    ;;
-
-  *)
-    enable_softwaresqrt=yes 
-    ;;
-esac
-fi
-
-if test "$with_mpi_environment" = "check" -a "$enable_mpi" = "yes"; then
-case "${host_cpu}" in
-  mips*-irix*)
-    with_mpi_environment="MPI_ENVIRONMENT"
+  alpha*-linux*)
+    cc_names="ccc cc gcc"
+    f77_names="fort f77 g77"
     ;;
-   *)
-    with_mpi_environment=no
+  *) 
+    cc_names="cc xlc gcc"
+    f77_names="f77 xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
     ;;
 esac
-fi  
-
-case "${host_cpu}" in
- alpha*)  
-   cat >> confdefs.h <<\EOF
-#define USE_AXP_ASM 
-EOF
-   ;;  
- *)      
-   ;;
-esac
 
 if test "$enable_fortran" = "yes"; then
-  # vendor f77 before g77 - but special compiler list for alpha-linux
-  case "${host_cpu}-${host_os}" in
-    alpha*-linux*)
-      for ac_prog in fort f77 g77
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1294: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$F77"; then
-  ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_F77="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-F77="$ac_cv_prog_F77"
-if test -n "$F77"; then
-  echo "$ac_t""$F77" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$F77" && break
-done
-
-      ;;
-    *)   
-      for ac_prog in f77 xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90
+  for ac_prog in $f77_names
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1330: checking for $ac_word" >&5
+echo "configure:1344: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1355,15 +1369,13 @@ fi
 test -n "$F77" && break
 done
 
-      ;;
-  esac
   if test -z "$F77"; then
   for ac_prog in g77 f77 f2c
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1367: checking for $ac_word" >&5
+echo "configure:1379: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1396,7 +1408,7 @@ done
 fi
 
 echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1400: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5
+echo "configure:1412: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5
 
 ac_ext=f
 ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
@@ -1409,7 +1421,7 @@ cat > conftest.$ac_ext << EOF
       end
 
 EOF
-if { (eval echo configure:1413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_f77_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1435,12 +1447,12 @@ if test $ac_cv_prog_f77_works = no; then
   { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1439: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1451: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6
 cross_compiling=$ac_cv_prog_f77_cross
 
 echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6
-echo "configure:1444: checking whether we are using GNU Fortran 77" >&5
+echo "configure:1456: checking whether we are using GNU Fortran 77" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1449,7 +1461,7 @@ else
   yes
 #endif
 EOF
-if { ac_try='$F77 -E conftest.fpp'; { (eval echo configure:1453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='$F77 -E conftest.fpp'; { (eval echo configure:1465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_g77=yes
 else
   ac_cv_prog_g77=no
@@ -1464,7 +1476,7 @@ if test $ac_cv_prog_g77 = yes; then
   ac_save_FFLAGS="$FFLAGS"
   FFLAGS=
   echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6
-echo "configure:1468: checking whether $F77 accepts -g" >&5
+echo "configure:1480: checking whether $F77 accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1499,14 +1511,13 @@ fi
   fi
 fi
 
-case "${host_cpu}-${host_os}" in
-    alpha*-linux*)
-      for ac_prog in ccc cc
+# the (non-mpi) c compiler, which is also used for programs executed during build stage
+for ac_prog in $cc_names
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1510: checking for $ac_word" >&5
+echo "configure:1521: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1534,44 +1545,11 @@ fi
 
 test -n "$CC" && break
 done
- # do vendor cc before gcc
-      ;;
-    *)   
-      # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1544: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
- # do vendor cc before gcc
-      ;;
-esac
+
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1575: checking for $ac_word" >&5
+echo "configure:1553: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1601,7 +1579,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1605: checking for $ac_word" >&5
+echo "configure:1583: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1652,7 +1630,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1656: checking for $ac_word" >&5
+echo "configure:1634: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1684,7 +1662,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1688: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1666: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1695,12 +1673,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1699 "configure"
+#line 1677 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1726,12 +1704,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1708: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1735: checking whether we are using GNU C" >&5
+echo "configure:1713: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1740,7 +1718,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1759,7 +1737,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1763: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1741: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1790,8 +1768,9 @@ else
   fi
 fi
 
+
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1795: checking how to run the C preprocessor" >&5
+echo "configure:1774: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1806,13 +1785,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 1789 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1823,13 +1802,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1827 "configure"
+#line 1806 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1840,13 +1819,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1844 "configure"
+#line 1823 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1870,12 +1849,196 @@ else
 fi
 echo "$ac_t""$CPP" 1>&6
 
-BUILD_CC=$CC
+am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+       @echo done
+END
+# If we don't find an include directive, just comment out the code.
+echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6
+echo "configure:1860: checking for style of include used by $am_make" >&5
+_am_include='#'
+_am_quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+   _am_include=include
+   _am_quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$_am_include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      _am_include=.include
+      _am_quote='"'
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$ac_t""$_am_result" 1>&6
+rm -f confinc confmf
+
+am_compiler_list=
+
+depcc="$CC"
+depcpp="$CPP"
+
+
+
+
+echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6
+echo "configure:1899: checking dependency style of $depcc" >&5
+if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir confdir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" confdir
+  cd confdir
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list="`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`"
+  fi
+  for depmode in $am_compiler_list; do
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+
+    case "$depmode" in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode="$depmode" \
+       source=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1; then
+      am_cv_CC_dependencies_compiler_type="$depmode"
+      break
+    fi
+  done
+
+  cd ..
+  rm -rf confdir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+
+echo "$ac_t""$am_cv_CC_dependencies_compiler_type" 1>&6
+CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type"
+
+
+# Check for environment variable CC_FOR_BUILD before overwriting it
+if test -z "$CC_FOR_BUILD"; then
+  CC_FOR_BUILD=$CC
+fi
+
+# if we are using mpi, also get an MPICC. We cannot set that in the PROG_CC macro
+# above, since autoconf checks that the created file can be executed. This would
+# fail on platforms where MPI executables can only be run through a batchqueue.
+
+if test "$enable_mpi" = "yes"; then
+  for ac_prog in mpicc mpcc mpxlf hcc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1979: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MPICC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$MPICC"; then
+  ac_cv_prog_MPICC="$MPICC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_MPICC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+MPICC="$ac_cv_prog_MPICC"
+if test -n "$MPICC"; then
+  echo "$ac_t""$MPICC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$MPICC" && break
+done
+test -n "$MPICC" || MPICC="$CC"
+       
+# now change the normal cc to the MPI one - see the comment above.
+  CC=$MPICC
+  echo $ac_n "checking whether the MPI cc command works""... $ac_c" 1>&6
+echo "configure:2012: checking whether the MPI cc command works" >&5 # be paranoid
+  cat > conftest.$ac_ext <<EOF
+#line 2014 "configure"
+#include "confdefs.h"
+#include <mpi.h>
+int main() {
+int argc; char **argv; MPI_Init(&argc,&argv);
+; return 0; }
+EOF
+if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  { echo "configure: error: Cannot compile and link MPI code with $CC" 1>&2; exit 1; }
+fi
+rm -f conftest*
+  cat >> confdefs.h <<\EOF
+#define USE_MPI 
+EOF
 
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} mpiio.lo" 
+else
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} libnet.lo" 
+fi
 
 if test "$enable_fortran" = "yes"; then
   echo $ac_n "checking for Fortran 77 libraries""... $ac_c" 1>&6
-echo "configure:1879: checking for Fortran 77 libraries" >&5
+echo "configure:2042: checking for Fortran 77 libraries" >&5
 
 
 if eval "test \"`echo '$''{'ac_cv_flibs'+set}'`\" = set"; then
@@ -2034,7 +2197,7 @@ echo "$ac_t""$FLIBS" 1>&6
 
 
 echo $ac_n "checking fortran name mangling""... $ac_c" 1>&6
-echo "configure:2038: checking fortran name mangling" >&5
+echo "configure:2201: checking fortran name mangling" >&5
 cat > mangle-func.f <<EOF
       subroutine foobar()
       return
@@ -2044,7 +2207,7 @@ cat > mangle-func.f <<EOF
       end
 EOF
 ac_try='$F77 -c $FFLAGS mangle-func.f 1>&5'
-if { (eval echo configure:2048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then
+if { (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then
   ac_try=""
 else
   echo "configure: failed program was:" >&5
@@ -2065,14 +2228,14 @@ cross_compiling=$ac_cv_prog_cc_cross
 ac_save_LIBS="$LIBS"
 LIBS="mangle-func.o $FLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2069 "configure"
+#line 2232 "configure"
 #include "confdefs.h"
 
 int main() {
 foobar();
 ; return 0; }
 EOF
-if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_f77_mangle_type=lowercase
 else
@@ -2080,14 +2243,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 2084 "configure"
+#line 2247 "configure"
 #include "confdefs.h"
 
 int main() {
 foobar_();
 ; return 0; }
 EOF
-if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_f77_mangle_type=lowercase-underscore
 else
@@ -2095,14 +2258,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 2099 "configure"
+#line 2262 "configure"
 #include "confdefs.h"
 
 int main() {
 FOOBAR();
 ; return 0; }
 EOF
-if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_f77_mangle_type=uppercase
 else
@@ -2110,14 +2273,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 2114 "configure"
+#line 2277 "configure"
 #include "confdefs.h"
 
 int main() {
 FOOBAR_();
 ; return 0; }
 EOF
-if { (eval echo configure:2121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_f77_mangle_type=uppercase-underscore
 else
@@ -2174,7 +2337,7 @@ EOF
 esac
 
 echo $ac_n "checking whether f77 functions with underscore get an extra underscore""... $ac_c" 1>&6
-echo "configure:2178: checking whether f77 functions with underscore get an extra underscore" >&5
+echo "configure:2341: checking whether f77 functions with underscore get an extra underscore" >&5
 
 
 ac_ext=c
@@ -2187,14 +2350,14 @@ cross_compiling=$ac_cv_prog_cc_cross
 ac_save_LIBS="$LIBS"
 LIBS="mangle-func.o $FLIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2191 "configure"
+#line 2354 "configure"
 #include "confdefs.h"
 
 int main() {
 $mangle_try();
 ; return 0; }
 EOF
-if { (eval echo configure:2198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_f77_mangle_underscore=yes;
              cat >> confdefs.h <<\EOF
@@ -2218,1812 +2381,1734 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 rm -f mangle-func*
 echo "$ac_t""$ac_f77_mangle_underscore" 1>&6
-
+  
 fi
 
-# if we are using mpi, also get an MPICC. We cannot set that in the PROG_CC macro
-# above, since autoconf checks that the created file can be executed. This would
-# fail on platforms where MPI executables can only be run through a batchqueue.
-
-if test "$enable_mpi" = "yes"; then
-  for ac_prog in mpicc mpcc mpxlf hcc
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2235: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MPICC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$MPICC"; then
-  ac_cv_prog_MPICC="$MPICC" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_MPICC="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:2389: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
 fi
-MPICC="$ac_cv_prog_MPICC"
-if test -n "$MPICC"; then
-  echo "$ac_t""$MPICC" 1>&6
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$MPICC" && break
-done
-test -n "$MPICC" || MPICC="$CC"
-       
-# now change the normal cc to the MPI one - see the comment above.
-  CC=$MPICC
-  echo $ac_n "checking whether the MPI cc command works""... $ac_c" 1>&6
-echo "configure:2268: checking whether the MPI cc command works" >&5 # be paranoid
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2270 "configure"
+#line 2404 "configure"
 #include "confdefs.h"
-#include <mpi.h>
-int main() {
-int argc; char **argv; MPI_Init(&argc,&argv);
-; return 0; }
+#include <assert.h>
+Syntax Error
 EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  { echo "configure: error: Cannot compile and link MPI code with $CC" 1>&2; exit 1; }
-fi
-rm -f conftest*
-  
-
-if true; then
-  USE_MPI_TRUE=
-  USE_MPI_FALSE='#'
-else
-  USE_MPI_TRUE='#'
-  USE_MPI_FALSE=
-fi
-else
-  
-
-if false; then
-  USE_MPI_TRUE=
-  USE_MPI_FALSE='#'
-else
-  USE_MPI_TRUE='#'
-  USE_MPI_FALSE=
-fi
-fi
-
-# A rather complicated check for the capabilities of as, to make
-# sure we can compile the assembly innerloops.
-if test "$x86" = "yes"; then
-  if  test "$enable_x86_asm" = "yes"; then
-    if test "$enable_float" = "no"; then
-      echo "configure: warning: The assembly loops can only be used in single precision - disabling" 1>&2
-      enable_x86_asm=no
-    else 
-      echo $ac_n "checking whether as fully supports intel syntax""... $ac_c" 1>&6
-echo "configure:2317: checking whether as fully supports intel syntax" >&5
-cat > conftest.s << EOF
-.intel_syntax noprefix 
-checkasm:
-       emms
-       pswapd mm0,mm0
-       movups xmm0,checkasm
-       emms
-       ret
-EOF
-      if { ac_try='$CC -c conftest.s'; { (eval echo configure:2327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
-       echo "$ac_t""yes" 1>&6
-      else
-        echo "$ac_t""no" 1>&6 
-       { echo "configure: error: Upgrade to binutils>=2.11, download the as executable     
-                    from www.gromacs.org, or disable assembly loops." 1>&2; exit 1; }
-      fi
-    fi 
-  fi
-else # not x86
-enable_x86_asm=no
-fi
-
-# Extract the first word of "ident", so it can be a program name with args.
-set dummy ident; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2343: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_IDENT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$IDENT" in
-  /*)
-  ac_cv_path_IDENT="$IDENT" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_IDENT="$IDENT" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_IDENT="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_IDENT" && ac_cv_path_IDENT="no"
-  ;;
-esac
-fi
-IDENT="$ac_cv_path_IDENT"
-if test -n "$IDENT"; then
-  echo "$ac_t""$IDENT" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-if test "$IDENT" != "no"; then
-  # seems as if we have the ident program, but does the
-  # compiler support it?
-  echo $ac_n "checking whether the compiler supports ident""... $ac_c" 1>&6
-echo "configure:2380: checking whether the compiler supports ident" >&5        
+  CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2382 "configure"
+#line 2421 "configure"
 #include "confdefs.h"
-#ident  "@(#) file.h 1.1 12/16/92"
+#include <assert.h>
+Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  
-    echo "$ac_t""yes" 1>&6 
-    cat >> confdefs.h <<\EOF
-#define HAVE_IDENT 
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2438 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
 EOF
-
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  CPP=/lib/cpp
 fi
 rm -f conftest*
 fi
-
-
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2409: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
-  rm -f conftestdata
-  ac_cv_prog_LN_S="ln -s"
-else
-  ac_cv_prog_LN_S=ln
+rm -f conftest*
 fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
 fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
+  CPP="$ac_cv_prog_CPP"
 else
-  echo "$ac_t""no" 1>&6
+  ac_cv_prog_CPP="$CPP"
 fi
+echo "$ac_t""$CPP" 1>&6
 
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-else
-  enable_shared=yes
-fi
 
-# Check whether --enable-static or --disable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-else
-  enable_static=yes
-fi
+if test "$enable_cpu_tuning" = "yes"; then
+  
 
-# Check whether --enable-fast-install or --disable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval="$enable_fast_install"
-  p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-else
-  enable_fast_install=yes
-fi
 
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:2499: checking build system type" >&5
+#
+# Determine the exact cpu type on some common systems where it is 
+# not visible from the host triplet.
+# (on e.g. intel and dec/tru64 the host type is enough)
 
-build_alias=$build
-case "$build_alias" in
-NONE)
-  case $nonopt in
-  NONE) build_alias=$host_alias ;;
-  *) build_alias=$nonopt ;;
-  esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:2528: checking for ld used by GCC" >&5
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:2558: checking for GNU ld" >&5
-else
-  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:2561: checking for non-GNU ld" >&5
-fi
-if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
+case "${host_cpu}-${host_os}" in
 
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  echo "$ac_t""$LD" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:2596: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  lt_cv_prog_gnu_ld=yes
-else
-  lt_cv_prog_gnu_ld=no
-fi
-fi
+rs6000*-aix*)
+  # we need to fool the combination of m4, sh and awk - thus the seemingly unnecessary n
+  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ n=1; print $n }'`
+  if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER4 >/dev/null 2>&1; then
+    gmxcpu=power4
+  elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER3 >/dev/null 2>&1; then
+    gmxcpu=power3
+  elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER2 >/dev/null 2>&1; then
+    gmxcpu=power2
+  else
+    gmxcpu=""
+  fi
+  ;;
 
-echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$lt_cv_prog_gnu_ld
+powerpc*-aix*)
+  if /usr/sbin/lscfg -vp | grep PowerPC | grep 604 >/dev/null 2>&1; then
+    gmxcpu=ppc604
+  elif /usr/sbin/lscfg -vp | grep PowerPC | grep 603 >/dev/null 2>&1; then
+    gmxcpu=ppc603
+  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64a >/dev/null 2>&1; then
+    gmxcpu=rs64a
+  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64b >/dev/null 2>&1; then
+    gmxcpu=rs64b
+  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64c >/dev/null 2>&1; then
+    gmxcpu=rs64c
+  else
+    gmxcpu=""
+  fi
+  ;;
 
+mips*-irix*)
+  if /sbin/hinv | grep CPU | grep R12000 >/dev/null 2>&1; then
+    gmxcpu=r12000
+  elif /sbin/hinv | grep CPU | grep R10000 >/dev/null 2>&1; then
+    gmxcpu=r10000
+  elif /sbin/hinv | grep CPU | grep R8000 >/dev/null 2>&1; then
+    gmxcpu=r8000
+  elif /sbin/hinv | grep CPU | grep R5000 >/dev/null 2>&1; then
+    gmxcpu=r5000
+  else
+    gmxcpu=""
+  fi
+  ;;
 
-echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:2613: checking for $LD option to reload object files" >&5
-if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
+sparc*-solaris*)
+  if /usr/sbin/prtconf | grep UltraSPARC-III >/dev/null 2>&1; then
+    gmxcpu=ultrasparc3
+  elif /usr/sbin/prtconf | grep UltraSPARC-IIi >/dev/null 2>&1; then
+    gmxcpu=ultrasparc2i
+  elif /usr/sbin/prtconf | grep UltraSPARC-II >/dev/null 2>&1; then
+    gmxcpu=ultrasparc2
+  elif /usr/sbin/prtconf | grep UltraSPARC >/dev/null 2>&1; then
+    gmxcpu=ultrasparc
+  else
+    gmxcpu=""
+  fi
+  ;;
+*)
+  gmxcpu=""
+  ;;
 
-echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
-reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
+esac
 
-echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:2625: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -B"
-       break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -p"
-       break
-      else
-       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
+  gmxcpu=""
 fi
 
-NM="$lt_cv_path_NM"
-echo "$ac_t""$NM" 1>&6
 
-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:2663: checking how to recognise dependant libraries" >&5
-if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [regex]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
 
-case $host_os in
-aix*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-bsdi4*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
+# Try to determine "good" native compiler flags if none specified on command
+# line. To avoid repeating the entire procedure for fortran flags, we first
+# determine our suggested choices for both C and fortran, and then possibly
+# override them with user choices.
 
-cygwin* | mingw* |pw32*)
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
+cc_vendor="unknown"
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  case "$host_os" in
-  rhapsody* | darwin1.012)
-    lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
-    ;;
-  *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
-    ;;
-  esac
-  ;;
+case "${host_cpu}-${host_os}" in
 
-freebsd* )
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
+  *-solaris2*) 
+    case "${gmxcpu}" in
+      ultrasparc3*)
+        xCFLAGS="-fast -xO5 -xtarget=ultra3 -fsimple=2 -fnonstd -dalign"
+        xFFLAGS=$xCFLAGS
+        ;;
+      ultrasparc2i*)
+        xCFLAGS="-fast -xO5 -xtarget=ultra2i -fsimple=2 -fnonstd -dalign"
+        xFFLAGS=$xCFLAGS
+        ;;
+      ultrasparc2*)
+        xCFLAGS="-fast -xO5 -xtarget=ultra2 -fsimple=2 -fnonstd -dalign"
+        xFFLAGS=$xCFLAGS
+        ;;
+      ultrasparc*)
+        xCFLAGS="-fast -xO5 -xtarget=ultra -fsimple=2 -fnonstd -dalign"
+        xFFLAGS=$xCFLAGS
+        ;;
+      *)
+        xCFLAGS="-native -fast -xO5 -fsimple=2 -fnonstd -dalign"
+        xFFLAGS=$xCFLAGS
+        ;;
     esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20*|hpux11*)
-  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
-  ;;
+    ;;
 
-irix5* | irix6*)
-  case $host_os in
-  irix5*)
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+  *-hpux*)  
+    xCFLAGS="-Ae +O3 +Oall"
+    xFFLAGS=$xCFLAGS
+    # If you haven't noticed, we don't like hp very much...
+    # but perhaps that will change if they make something nice out of ia64.
     ;;
-  *)
-    case $LD in
-    *-32|*"-32 ") libmagic=32-bit;;
-    *-n32|*"-n32 ") libmagic=N32;;
-    *-64|*"-64 ") libmagic=64-bit;;
-    *) libmagic=never-match;;
+
+  rs6000*-aix*)
+    # dont use inter-procedure analysis for the innerloops - they take
+    # forever to compile with it, and it doesnt help at all.
+    case "${gmxcpu}" in
+      power4*)
+       xCFLAGS="-O3 -qarch=pwr4 -qtune=pwr4 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=pwr4 -qtune=pwr4 -qmaxmem=16384 -qhot -qnoipa"
+       ;;
+      power3*)
+       xCFLAGS="-O3 -qarch=pwr3 -qtune=pwr3 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=pwr3 -qtune=pwr3 -qmaxmem=16384 -qhot -qnoipa"
+       ;;
+      power2*)
+       xCFLAGS="-O3 -qarch=pwr2 -qtune=pwr2 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=pwr2 -qtune=pwr2 -qmaxmem=16384 -qhot -qnoipa"
+       ;;
+      power)
+       xCFLAGS="-O3 -qarch=pwr -qtune=pwr -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=pwr -qtune=pwr -qmaxmem=16384 -qhot -qnoipa"
+       ;;
+      *)
+       # I don't think people are using anything older than power2, so we tune for
+        # pwr, but dont set the arch since it is nice to have common binaries 
+        # that run also on powerpc.
+       xCFLAGS="-O3 -qlanglvl=ansi -qtune=pwr -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qtune=pwr -qmaxmem=16384 -qhot"
+       ;;
     esac
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
     ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux-gnu*)
-  case $host_cpu in
-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
-  fi
-  ;;
-
-newsos6)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
 
-osf3* | osf4* | osf5*)
-  # this will be overridden with pass_all, but let us keep it just in case
-  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  powerpc*-aix*)
+    case "${gmxcpu}" in
+      ppc604)
+       xCFLAGS="-O3 -qarch=604 -qtune=604 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=604 -qtune=604 -qmaxmem=16384 -qhot"
+       ;;
+      ppc603)
+       xCFLAGS="-O3 -qarch=603 -qtune=603 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=603 -qtune=603 -qmaxmem=16384 -qhot"
+       ;;
+      rs64a)
+       xCFLAGS="-O3 -qarch=rs64a -qtune=rs64a -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=rs64a -qtune=rs64a -qmaxmem=16384 -qhot"
+       ;;
+      rs64b)
+       xCFLAGS="-O3 -qarch=rs64b -qtune=rs64b -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=rs64b -qtune=rs64b -qmaxmem=16384 -qhot"
+       ;;
+      rs64c)
+       xCFLAGS="-O3 -qarch=rs64c -qtune=rs64c -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qarch=rs64c -qtune=rs64c -qmaxmem=16384 -qhot"
+       ;;
+      *)
+       xCFLAGS="-O3 -qlanglvl=ansi -qmaxmem=16384"
+       xFFLAGS="-O3 -Q -qmaxmem=16384 -qhot"
+       ;;
+    esac
+    ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  mips*-irix*)
+    xCFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -fullwarn -woff 1174 -D__INLINE_INTRINSICS"
+    xFFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -OPT:cray_ivdep=TRUE"
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=/lib/libc.so
-  ;;
+    if $CC -version | grep "Version 7.1" > /dev/null 2>&1; then
+      xCFLAGS="$xCFLAGS -GCM:aggressive_speculation -GCM:array_speculation" 
+      xFFLAGS="$xFFLAGS -GCM:aggressive_speculation -GCM:array_speculation" 
+    fi
 
-sysv5uw[78]* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+    if $CC -version | grep "Version 7.3" > /dev/null 2>&1; then
+      xCFLAGS="$xCFLAGS -SWP:heur=fdms,nhms,fdnms" 
+      xFFLAGS="$xFFLAGS -SWP:heur=fdms,nhms,fdnms" 
+    fi
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  case $host_vendor in
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    case "${gmxcpu}" in
+      r12000*)
+       xCFLAGS="-n32 -r12000 -mips4 $xCFLAGS"
+       xFFLAGS="-n32 -r12000 -mips4 $xFFLAGS"
+       xLDFLAGS="-n32 -r12000 -mips4"
+       ;;
+      r10000*)
+       xCFLAGS="-n32 -r10000 -mips4 $xCFLAGS"
+       xFFLAGS="-n32 -r10000 -mips4 $xFFLAGS"
+       xLDFLAGS="-n32 -r10000 -mips4"
+       ;;
+      r8000*)
+       xCFLAGS="-n32 -r8000 -mips4 $xCFLAGS"
+       xFFLAGS="-n32 -r8000 -mips4 $xFFLAGS"
+       xLDFLAGS="-n32 -r8000 -mips4"
+       ;;
+      r5000*)
+       xCFLAGS="-n32 -r5000 -mips4 $xCFLAGS"
+       xFFLAGS="-n32 -r5000 -mips4 $xFFLAGS"
+       xLDFLAGS="-n32 -r5000 -mips4"
+       ;;
+      *)               
+       xCFLAGS="-n32 $xCFLAGS"
+       xFFLAGS="-n32 $xFFLAGS"
+       xLDFLAGS="-n32"
+       ;;
+    esac
     ;;
-  esac
-  ;;
-esac
-
-fi
-
-echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
 
-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:2827: checking for object suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  rm -f conftest*
-echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:2833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  for ac_file in conftest.*; do
-    case $ac_file in
-    *.c) ;;
-    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+  alpha*-osf*)
+    case "${host_cpu}" in
+      alphaev*)
+        # extract the processor from cpu type (e.g. alphaev56 -> ev56)
+        evtype=`echo ${host_cpu} | sed 's/alpha//'`
+        xCFLAGS="-O5 -arch $evtype -tune $evtype -fast -unroll 2 -fp_reorder"
+        xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
+        xLDFLAGS="-O4"
+        ;;
+      *)
+       xCFLAGS="-O5 -arch host -tune host -fast -unroll 2 -fp_reorder"
+       xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
+       xLDFLAGS="-O4"
+       ;;
     esac
-  done
-else
-  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
-
-
+    ;;
 
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2853: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  alpha*-linux*)
+    case "${host_cpu}" in
+      alphaev*)
+       # extract the processor from cpu type (e.g. alphaev56 -> ev56)
+       evtype=`echo ${host_cpu} | sed 's/alpha//'`
+       tmpCFLAGS="-O5 -arch $evtype -tune $evtype -fast -unroll 2 -fp_reorder"
+       tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
+       tmpLDFLAGS="-O4"
+       ;;
+      *)
+       tmpCFLAGS="-O5 -arch host -tune host -fast -unroll 2 -fp_reorder"
+       tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
+       tmpLDFLAGS="-O4"
+       ;;
+    esac
+    if $CC -V 2>  /dev/null | grep Compaq > /dev/null 2>&1; then
+      xCFLAGS="$tmpCFLAGS"
+      cc_vendor="Compaq"
+    fi
+    if test "$enable_fortran" = "yes"; then
+      if $F77 -V 2>  /dev/null | grep Compaq > /dev/null 2>&1; then
+        xFFLAGS="$tmpFFLAGS"
+      fi
+    fi
+    ;;
+
+  *-*)
+    # most of these systems (e.g. linux, FreeBSD) use gcc which is treated
+    # further down, but we can at least check if the Portland compilers are used:
+    if $CC -V 2>  /dev/null | grep Portland > /dev/null 2>&1; then
+      case "${host_cpu}" in
+       i586)
+         pgiopt="-tp p5" 
+          ;;
+       i686)
+         pgiopt="-tp p6" 
+         ;;
+      esac
+      xCFLAGS="$pgiopt -fast -Minfo=loop -pc 32"
+    fi
+    if test "$enable_fortran" = "yes"; then
+      if $F77 -V 2>  /dev/null | grep Portland > /dev/null 2>&1; then
+       xFFLAGS="$xCFLAGS -Mneginfo=loop"
+      fi       
+    fi
+    ;;
+esac   
+# Phew, end of all those operating systems and processors!                     
+
+# use default flags for gcc/g77 on all systems
+if test $ac_cv_prog_gcc = yes; then
+  xCFLAGS="-O6 -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
+  # -malign-double for x86 systems
+  
+
+echo $ac_n "checking whether $CC accepts -malign-double""... $ac_c" 1>&6
+echo "configure:2767: checking whether $CC accepts -malign-double" >&5
+if eval "test \"`echo '$''{'ac_align_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
-  ac_cv_exeext=.exe
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC -malign-double -c conftest.c 2>&1`"; then
+       ac_align_double=yes
 else
-  rm -f conftest*
-  echo 'int main () { return 0; }' > conftest.$ac_ext
-  ac_cv_exeext=
-  if { (eval echo configure:2863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
-    for file in conftest.*; do
-      case $file in
-      *.c | *.o | *.obj) ;;
-      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
-      esac
-    done
-  else
-    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
-  fi
-  rm -f conftest*
-  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
+       ac_align_double=no
 fi
+rm -f conftest*
 
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
+fi
 
-if test $host != $build; then
-  ac_tool_prefix=${host_alias}-
+echo "$ac_t""$ac_align_double" 1>&6
+if test "$ac_align_double" = yes; then
+       :
+       xCFLAGS="$xCFLAGS -malign-double"
 else
-  ac_tool_prefix=
+       :
+       
 fi
 
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+fi
+  
+if test $enable_fortran = yes; then
+  if test $ac_cv_prog_g77 = yes; then
+    xFFLAGS="-O3 -ffast-math -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
+    # -malign-double for f77 on x86 systems - haven't checked that this works yet.
+    #ACX_CHECK_F77_FLAGS(-malign-double,align_double,xFFLAGS="$xFFLAGS -malign-double")
+  fi
+fi
 
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:2896: checking for ${ac_tool_prefix}file" >&5
-if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+CPU_FLAGS=""
+
+if test "$GCC" = "yes"; then
+  ASFLAGS="$(ASFLAGS) -x assembler-with-cpp"
+  # try to guess correct CPU flags, at least for linux
+  case "${host_cpu}" in
+    # i586/i686 cpu flags don't improve speed, thus no need to use them.
+    # don't check f77 separately - we assume f77 and gcc are similar
+         
+    powerpc*)
+      cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
+      is60x=`echo $cputype | egrep "^600-9e?$"`
+      if test -n "$is60x"; then
+       
+
+echo $ac_n "checking whether $CC accepts -mcpu=$cputype""... $ac_c" 1>&6
+echo "configure:2816: checking whether $CC accepts -mcpu=$cputype" >&5
+if eval "test \"`echo '$''{'ac_m_cpu_60x'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="/usr/bin:$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC -mcpu=$cputype -c conftest.c 2>&1`"; then
+       ac_m_cpu_60x=yes
+else
+       ac_m_cpu_60x=no
+fi
+rm -f conftest*
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$ac_t""$MAGIC_CMD" 1>&6
+echo "$ac_t""$ac_m_cpu_60x" 1>&6
+if test "$ac_m_cpu_60x" = yes; then
+       :
+       CPU_FLAGS=-mcpu=$cputype
 else
-  echo "$ac_t""no" 1>&6
+       :
+       
 fi
 
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2958: checking for file" >&5
-if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+      elif test "$cputype" = 750; then
+        
+
+echo $ac_n "checking whether $CC accepts -mcpu=750""... $ac_c" 1>&6
+echo "configure:2843: checking whether $CC accepts -mcpu=750" >&5
+if eval "test \"`echo '$''{'ac_m_cpu_750'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="/usr/bin:$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC -mcpu=750 -c conftest.c 2>&1`"; then
+       ac_m_cpu_750=yes
+else
+       ac_m_cpu_750=no
 fi
+rm -f conftest*
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$ac_t""$MAGIC_CMD" 1>&6
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-  else
-    MAGIC_CMD=:
-  fi
+echo "$ac_t""$ac_m_cpu_750" 1>&6
+if test "$ac_m_cpu_750" = yes; then
+       :
+       CPU_FLAGS=-mcpu=750
+else
+       :
+       
 fi
 
-  fi
-  ;;
-esac
+      fi
+      if test -z "$CPU_FLAGS"; then
+        
 
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3029: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo $ac_n "checking whether $CC accepts -mcpu=powerpc""... $ac_c" 1>&6
+echo "configure:2871: checking whether $CC accepts -mcpu=powerpc" >&5
+if eval "test \"`echo '$''{'ac_m_cpu_powerpc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC -mcpu=powerpc -c conftest.c 2>&1`"; then
+       ac_m_cpu_powerpc=yes
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+       ac_m_cpu_powerpc=no
 fi
+rm -f conftest*
+
 fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
+
+echo "$ac_t""$ac_m_cpu_powerpc" 1>&6
+if test "$ac_m_cpu_powerpc" = yes; then
+       :
+       CPU_FLAGS=-mcpu=powerpc
 else
-  echo "$ac_t""no" 1>&6
+       :
+       
 fi
 
+      fi
+      if test -z "$CPU_FLAGS"; then
+       
 
-if test -z "$ac_cv_prog_RANLIB"; then
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3061: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo $ac_n "checking whether $CC accepts -mpowerpc""... $ac_c" 1>&6
+echo "configure:2899: checking whether $CC accepts -mpowerpc" >&5
+if eval "test \"`echo '$''{'ac_m_powerpc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC -mpowerpc -c conftest.c 2>&1`"; then
+       ac_m_powerpc=yes
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="ranlib"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
+       ac_m_powerpc=no
 fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+rm -f conftest*
+
 fi
 
+echo "$ac_t""$ac_m_powerpc" 1>&6
+if test "$ac_m_powerpc" = yes; then
+       :
+       CPU_FLAGS=-mpowerpc
 else
-  RANLIB=":"
-fi
+       :
+       
 fi
 
-# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3096: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      fi
+   esac
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  
+
+if false; then
+  GNU_CC_TRUE=
+  GNU_CC_FALSE='#'
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  GNU_CC_TRUE='#'
+  GNU_CC_FALSE=
 fi
 fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
-  echo "$ac_t""$STRIP" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+
+if test -n "$CPU_FLAGS"; then
+  xCFLAGS="$xCFLAGS $CPU_FLAGS"
+  xFFLAGS="$xFFLAGS $CPU_FLAGS"
 fi
 
+# Now check if the user provided anything special for C or fortran...
+# Not nice to have checked everything then, but otherwise we would have
+# to use entirely separate checks for C and fortran flags, doubling the code.
+if test "$ac_test_CFLAGS" != "set"; then
+  CFLAGS="$xCFLAGS"
+  # Use the extra link optimization flags on e.g. irix only when
+  # we are using our own C compiler flags
+  LDFLAGS="$LDFLAGS $xLDFLAGS"
+  
+  if test -z "$CFLAGS"; then
+    echo "*******************************************************************"
+    echo "* WARNING: No special optimization settings found for the C       *"
+    echo "* compiler. Use  make CFLAGS=..., or edit the top level Makefile. *"
+    echo "* Reverting to the default setting CFLAGS=-O3. (mail us about it!)*"
+    echo "*******************************************************************"
+    CFLAGS="-O3"
+  fi
+  
 
-if test -z "$ac_cv_prog_STRIP"; then
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3128: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+echo $ac_n "checking whether $CC accepts ${CFLAGS}""... $ac_c" 1>&6
+echo "configure:2961: checking whether $CC accepts ${CFLAGS}" >&5
+if eval "test \"`echo '$''{'ac_guessed_cflags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  echo 'void f(){}' > conftest.c
+if test -z "`$CC ${CFLAGS} -c conftest.c 2>&1`"; then
+       ac_guessed_cflags=yes
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_STRIP="strip"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+       ac_guessed_cflags=no
 fi
+rm -f conftest*
+
 fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
-  echo "$ac_t""$STRIP" 1>&6
+
+echo "$ac_t""$ac_guessed_cflags" 1>&6
+if test "$ac_guessed_cflags" = yes; then
+       :
+       
 else
-  echo "$ac_t""no" 1>&6
+       :
+       
+    echo "*******************************************************************"
+    echo "* Sorry, these optimization settings don't seem to work for       *"
+    echo "* your C compiler. Use make CFLAGS=..., or edit the top Makefile. *"
+    echo "*******************************************************************"
+    CFLAGS=""
+  
 fi
 
 else
-  STRIP=":"
-fi
+  echo "******************************************"
+  echo "* Using CFLAGS from environment variable *"
+  echo "******************************************"
 fi
 
+if test "$enable_fortran" = "yes"; then        
+  if test "$ac_test_FFLAGS" != "set"; then
+    FFLAGS="$xFFLAGS"
+    if test -z "$FFLAGS"; then
+      echo "*******************************************************************"
+      echo "* WARNING: No special optimization settings found for the fortran *"
+      echo "* compiler. Use  make FFLAGS=..., or edit the top level Makefile. *"
+      echo "* Reverting to the default setting FFLAGS=-O3. (mail us about it!)*"
+      echo "*******************************************************************"
+      FFLAGS="-O3"
+    fi
+    
 
-# Check for any special flags to pass to ltconfig.
-libtool_flags="--cache-file=$cache_file"
-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-
-
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
-  :
+echo $ac_n "checking whether $F77 accepts ${FFLAGS}""... $ac_c" 1>&6
+echo "configure:3010: checking whether $F77 accepts ${FFLAGS}" >&5
+if eval "test \"`echo '$''{'ac_guessed_fflags'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.f << EOF
+      subroutine f
+      return 
+      end
+EOF
+if test -z "`$F77 ${FFLAGS} -c conftest.f `"; then
+       ac_guessed_fflags=yes
+else
+       ac_guessed_fflags=no
 fi
+rm -f conftest*
 
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+fi
 
-# Check whether --with-pic or --without-pic was given.
-if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
+echo "$ac_t""$ac_guessed_fflags" 1>&6
+if test "$ac_guessed_fflags" = yes; then
+       :
+       
 else
-  pic_mode=default
+       :
+       
+      echo "*******************************************************************"
+      echo "* Sorry, these optimization settings don't seem to work for       *"
+      echo "* your f77 compiler. Use make FFLAGS=.., or edit the top Makefile.*"
+      echo "*******************************************************************"
+      FFLAGS=""
+    
 fi
 
-test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
-test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+  else
+    echo "******************************************"
+    echo "* Using FFLAGS from environment variable *"
+    echo "******************************************"
+  fi
+fi
+  
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 3195 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:3196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
+
+
+# Check x86 asm prerequisites and the capabilities of as
+if test "$enable_x86_asm" = "yes"; then
+  if test "$enable_float" = "no"; then
+    echo "configure: warning: x86 assembly loops can only be used in single precision - disabling" 1>&2
+    enable_x86_asm=no
+  else 
+    echo $ac_n "checking whether as fully supports intel syntax""... $ac_c" 1>&6
+echo "configure:3060: checking whether as fully supports intel syntax" >&5
+cat > conftest.s << EOF
+.intel_syntax noprefix 
+checkasm:
+       emms
+       pswapd mm0,mm0
+       movups xmm0,checkasm
+       emms
+       ret
+EOF
+    if { ac_try='$CC -c conftest.s'; { (eval echo configure:3070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+      echo "$ac_t""yes" 1>&6
+    else
+      echo "$ac_t""no" 1>&6 
+      { echo "configure: error: Upgrade to a more recent binutils, download the as executable     
+                   from www.gromacs.org, or disable assembly loops." 1>&2; exit 1; }
+    fi
+    GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} x86_cpuid.lo x86_sse.lo x86_3dnow.lo"
   fi
-  rm -rf conftest*
-  ;;
+fi
 
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:3217: checking whether the C compiler needs -belf" >&5
-if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+# Extract the first word of "ident", so it can be a program name with args.
+set dummy ident; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3084: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_IDENT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-     ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+  case "$IDENT" in
+  /*)
+  ac_cv_path_IDENT="$IDENT" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_IDENT="$IDENT" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_IDENT="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_IDENT" && ac_cv_path_IDENT="no"
+  ;;
+esac
+fi
+IDENT="$ac_cv_path_IDENT"
+if test -n "$IDENT"; then
+  echo "$ac_t""$IDENT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
 
-     cat > conftest.$ac_ext <<EOF
-#line 3230 "configure"
+if test "$IDENT" != "no"; then
+  # seems as if we have the ident program, but does the
+  # compiler support it?
+  echo $ac_n "checking whether the compiler supports ident""... $ac_c" 1>&6
+echo "configure:3121: checking whether the compiler supports ident" >&5        
+  cat > conftest.$ac_ext <<EOF
+#line 3123 "configure"
 #include "confdefs.h"
-
-int main() {
-
-; return 0; }
+#ident  "@(#) file.h 1.1 12/16/92"
 EOF
-if { (eval echo configure:3237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  lt_cv_cc_needs_belf=yes
+  
+    echo "$ac_t""yes" 1>&6 
+    cat >> confdefs.h <<\EOF
+#define HAVE_IDENT 
+EOF
+
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  lt_cv_cc_needs_belf=no
+  echo "$ac_t""no" 1>&6
 fi
 rm -f conftest*
-     ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
 fi
 
-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+  enable_shared=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
   ;;
-
-
 esac
-
-
-# Save cache, so that ltconfig can load it
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
 else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
+  enable_shared=yes
 fi
-rm -f confcache
-
-
-# Actually configure libtool.  ac_aux_dir is where install-sh is found.
-AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
-AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
-objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
-deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
 
-# Reload cache, that may have been modified by ltconfig
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+  enable_static=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
 else
-  echo "creating cache $cache_file"
-  > $cache_file
+  enable_static=yes
 fi
 
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:3218: checking build system type" >&5
 
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
 
-LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-f77.sh"
-lt_save_CC="$CC"
-lt_save_CFLAGS="$CFLAGS"
-AR="$AR" LTCC="$CC" CC="$F77" F77="$F77" CFLAGS="$FFLAGS" CPPFLAGS="" \
-MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
-AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
-objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
-deplibs_check_method="$deplibs_check_method" \
-file_magic_cmd="$file_magic_cmd" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
---build="$build" --add-tag=F77 $ac_aux_dir/ltcf-f77.sh $host \
-|| { echo "configure: error: libtool tag configuration failed" 1>&2; exit 1; }
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
 
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
 
-  
-  
-
-  
-        
-        
-for ac_func in strcasecmp
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3377: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:3247: checking for ld used by GCC" >&5
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:3277: checking for GNU ld" >&5
+else
+  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:3280: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3382 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+       test "$with_gnu_ld" != no && break
+      else
+       test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 fi
-rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$ac_t""$LD" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
-done
-
-for ac_func in strdup
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3432: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:3315: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3437 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi
+fi
 
-int main() {
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
 
-; return 0; }
-EOF
-if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:3332: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:3344: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}nm
+    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+       lt_cv_path_NM="$tmp_nm -B"
+       break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+       lt_cv_path_NM="$tmp_nm -p"
+       break
+      else
+       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+       continue # so that we can try to find one that supports BSD flags
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi
-rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+NM="$lt_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:3382: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
+echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
+echo "configure:3403: checking how to recognise dependant libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
 
-# Try to detect the cpu - must be done before some lib searches
-if test "$enable_cpu_detection" = "yes"; then
-  
+case $host_os in
+aix*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-#
-# Determine the exact cpu type on some common systems where it is 
-# not visible from the host triplet.
-# (on e.g. intel and dec/tru64 the host type is enough)
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
 
-case "${host_cpu}-${host_os}" in
+cygwin* | mingw* |pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
 
-rs6000*-aix*)
-  # we need to fool the combination of m4, sh and awk - thus the seemingly unnecessary n
-  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ n=1; print $n }'`
-  if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER4 >/dev/null 2>&1; then
-    gmxcpu=power4
-  elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER3 >/dev/null 2>&1; then
-    gmxcpu=power3
-  elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER2 >/dev/null 2>&1; then
-    gmxcpu=power2
-  else
-    gmxcpu=""
-  fi
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.012)
+    lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
   ;;
 
-powerpc*-aix*)
-  if /usr/sbin/lscfg -vp | grep PowerPC | grep 604 >/dev/null 2>&1; then
-    gmxcpu=ppc604
-  elif /usr/sbin/lscfg -vp | grep PowerPC | grep 603 >/dev/null 2>&1; then
-    gmxcpu=ppc603
-  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64a >/dev/null 2>&1; then
-    gmxcpu=rs64a
-  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64b >/dev/null 2>&1; then
-    gmxcpu=rs64b
-  elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64c >/dev/null 2>&1; then
-    gmxcpu=rs64c
+freebsd* )
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
   else
-    gmxcpu=""
+    lt_cv_deplibs_check_method=pass_all
   fi
   ;;
 
-mips*-irix*)
-  if /sbin/hinv | grep CPU | grep R12000 >/dev/null 2>&1; then
-    gmxcpu=r12000
-  elif /sbin/hinv | grep CPU | grep R10000 >/dev/null 2>&1; then
-    gmxcpu=r10000
-  elif /sbin/hinv | grep CPU | grep R8000 >/dev/null 2>&1; then
-    gmxcpu=r8000
-  elif /sbin/hinv | grep CPU | grep R5000 >/dev/null 2>&1; then
-    gmxcpu=r5000
-  else
-    gmxcpu=""
-  fi
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-sparc*-solaris*)
-  if /usr/sbin/prtconf | grep UltraSPARC-III >/dev/null 2>&1; then
-    gmxcpu=ultrasparc3
-  elif /usr/sbin/prtconf | grep UltraSPARC-IIi >/dev/null 2>&1; then
-    gmxcpu=ultrasparc2i
-  elif /usr/sbin/prtconf | grep UltraSPARC-II >/dev/null 2>&1; then
-    gmxcpu=ultrasparc2
-  elif /usr/sbin/prtconf | grep UltraSPARC >/dev/null 2>&1; then
-    gmxcpu=ultrasparc
+hpux10.20*|hpux11*)
+  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6*)
+  case $host_os in
+  irix5*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   else
-    gmxcpu=""
+    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
   fi
   ;;
-*)
-  gmxcpu=""
-  ;;
 
-esac
+newsos6)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
 
-else
-  gmxcpu=""
-fi
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-############################################################################
-# Checks for libraries.
-############################################################################
-echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
-echo "configure:3568: checking for sqrt in -lm" >&5
-ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3576 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char sqrt();
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-int main() {
-sqrt()
-; return 0; }
-EOF
-if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+sysv5uw[78]* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-  LIBS="-lm $LIBS"
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  esac
+  ;;
+esac
 
-else
-  echo "$ac_t""no" 1>&6
-{ echo "configure: error: No math library found" 1>&2; exit 1; }
 fi
 
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
 
-#####
-# IBM provides a MASS library with vectorized and optimized math stuff,
-# and an xlopt library which partly overlaps this. They must come before
-# libm in the link list, thus the test goes after m!
-if test "${host_vendor}" = "ibm"; then
-  echo $ac_n "checking for main in -lxlopt""... $ac_c" 1>&6
-echo "configure:3622: checking for main in -lxlopt" >&5
-ac_lib_var=`echo xlopt'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:3567: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lxlopt  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3630 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:3637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo xlopt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lxlopt $LIBS"
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
 
-else
-  echo "$ac_t""no" 1>&6
-fi
 
-  echo $ac_n "checking for main in -lmass""... $ac_c" 1>&6
-echo "configure:3665: checking for main in -lmass" >&5
-ac_lib_var=`echo mass'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3593: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmass  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3673 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:3680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo mass | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lmass $LIBS"
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
 
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
 else
-  echo "$ac_t""no" 1>&6
+  ac_tool_prefix=
 fi
-  
-  vectmass=no
-  case "$gmxcpu" in
-    power4*)
-      echo $ac_n "checking for main in -lmassvp4""... $ac_c" 1>&6
-echo "configure:3711: checking for main in -lmassvp4" >&5
-ac_lib_var=`echo massvp4'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:3636: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmassvp4  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3719 "configure"
-#include "confdefs.h"
+  case $MAGIC_CMD in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           egrep "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
 
-int main() {
-main()
-; return 0; }
 EOF
-if { (eval echo configure:3726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  vectmass=yes LIBS="$LIBS -lmassvp4"
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$ac_t""$MAGIC_CMD" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
-  ;;
-    power3*)
-      echo $ac_n "checking for main in -lmassvp3""... $ac_c" 1>&6
-echo "configure:3748: checking for main in -lmassvp3" >&5
-ac_lib_var=`echo massvp3'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:3698: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmassvp3  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3756 "configure"
-#include "confdefs.h"
+  case $MAGIC_CMD in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           egrep "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
 
-int main() {
-main()
-; return 0; }
 EOF
-if { (eval echo configure:3763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  vectmass=yes LIBS="$LIBS -lmassvp3"
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$ac_t""$MAGIC_CMD" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
   ;;
-    power2*)
-      echo $ac_n "checking for main in -lmassvp3""... $ac_c" 1>&6
-echo "configure:3785: checking for main in -lmassvp3" >&5
-ac_lib_var=`echo massvp3'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+esac
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3769: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmassvp3  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3793 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  vectmass=yes LIBS="$LIBS -lmassvp2"
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
-  ;;
-    *)
-      echo $ac_n "checking for main in -lmassv""... $ac_c" 1>&6
-echo "configure:3822: checking for main in -lmassv" >&5
-ac_lib_var=`echo massv'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmassv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3830 "configure"
-#include "confdefs.h"
 
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3801: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  vectmass=yes LIBS="$LIBS -lmassv"
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
-  ;;
-  esac
-  if test "$vectmass" = "yes"; then
-    cat >> confdefs.h <<\EOF
-#define USE_IBM_MASS 
-EOF
-
-  fi
-fi 
 
-if test "$enable_float" = "yes"; then
-  precision=4
 else
-  precision=8
+  RANLIB=":"
+fi
 fi
 
-if test "$enable_mpi" = "yes"; then
-  
-if test -z "$ac_fftw_firstname"; then
-
-if test "$precision" = "8"; then
-  prec="double"
-  fftwcheckprefix=d
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3836: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  prec="single"
-  fftwcheckprefix=s
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ac_t""$STRIP" 1>&6
+else
+  echo "$ac_t""no" 1>&6
 fi
 
-usedprefix=""
-ok="no"
-# check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
-echo $ac_n "checking for fftw_mpi.h""... $ac_c" 1>&6
-echo "configure:3888: checking for fftw_mpi.h" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3890 "configure"
-#include "confdefs.h"
-#include <fftw_mpi.h>
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:3897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-fftwname=fftw_mpi 
-echo "$ac_t""yes" 1>&6
 
+if test -z "$ac_cv_prog_STRIP"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3868: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_STRIP="strip"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ac_t""$STRIP" 1>&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
   echo "$ac_t""no" 1>&6
 fi
-rm -f conftest*
-
 
-if test -n "$fftwname"; then
-# we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
-cat > conftest.$ac_ext <<EOF
-#line 3915 "configure"
-#include "confdefs.h"
-#include <$fftwname.h>
-int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)]; 
-; return 0; }
-EOF
-if { (eval echo configure:3922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ok="yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ok="no"
+  STRIP=":"
 fi
-rm -f conftest*
 fi
 
-fftwname=fftw_mpi
 
-if test "$ok" != "yes"; then
-  xfftwname=${fftwcheckprefix}${fftwname}
-  echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
-echo "configure:3939: checking for $xfftwname.h" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 3941 "configure"
-#include "confdefs.h"
-#include <$xfftwname.h>
-int main() {
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 
-; return 0; }
-EOF
-if { (eval echo configure:3948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  pic_mode=default
+fi
+
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 3935 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:3936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+  fi
   rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:3957: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
   
-echo "$ac_t""no" 1>&6
-{ echo "configure: error: Cannot find any $prec precision $fftwname.h or $xfftwname.h
-Do you have $prec precision FFTW installed? If you are using packages,
-note that you also need fftw-devel to compile GROMACS. You can find the 
-software at www.fftw.org, and detailed instructions at www.gromacs.org.
-If you compiled FFTW yourself:                                        
-Note that the default FFTW setup is double precision. Change the FFTW
-configuration to single with --enable-float. If you want MPI support,
-use --enable-mpi. It is a good idea to install both single & double. 
-If your sysadm doesn't want to install it you can do it to a location
-in your home directory and provide the correct paths in the CPPFLAGS
-and LDFLAGS environment variables before running configure.
-That is also necessary to do if your compiler doesn't search
-/usr/local/include and /usr/local/lib by default.
-You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit 1; }
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
-fi
-rm -f conftest*
-cat > conftest.$ac_ext <<EOF
-#line 3975 "configure"
+     cat > conftest.$ac_ext <<EOF
+#line 3970 "configure"
 #include "confdefs.h"
-#include <$xfftwname.h>
+
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)];
+
 ; return 0; }
 EOF
-if { (eval echo configure:3982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  
-fftwname=$xfftwname 
-usedprefix=$fftwcheckprefix
-
+  lt_cv_cc_needs_belf=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  
-{ echo "configure: error: Cannot find any $prec precision $fftwname.h or $xfftwname.h
-Do you have $prec precision FFTW installed? If you are using packages,
-note that you also need fftw-devel to compile GROMACS. You can find the 
-software at www.fftw.org, and detailed instructions at www.gromacs.org.
-If you compiled FFTW yourself:                                       
-Note that the default FFTW setup is double precision. Change the FFTW
-configuration to single with --enable-float. If you want MPI support,
-use --enable-mpi. It is a good idea to install both single & double. 
-If your sysadm doesn't want to install it you can do it to a location
-in your home directory and provide the correct paths in the CPPFLAGS
-and LDFLAGS environment variables before running configure.
-That is also necessary to do if your compiler doesn't search
-/usr/local/include and /usr/local/lib by default.
-You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit 1; }
+  lt_cv_cc_needs_belf=no
 fi
 rm -f conftest*
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
 fi
 
-echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4012: checking for main in -l$fftwname" >&5
-ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-f77.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+AR="$AR" LTCC="$CC" CC="$F77" F77="$F77" CFLAGS="$FFLAGS" CPPFLAGS="" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=F77 $ac_aux_dir/ltcf-f77.sh $host \
+|| { echo "configure: error: libtool tag configuration failed" 1>&2; exit 1; }
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+  
+  
+
+  
+        
+        
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:4062: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+
+
+
+
+############################################################################
+# Checks for libraries.
+############################################################################
+echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
+echo "configure:4093: checking for sqrt in -lm" >&5
+ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-l$fftwname  $LIBS"
+LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4020 "configure"
+#line 4101 "configure"
 #include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char sqrt();
 
 int main() {
-main()
+sqrt()
 ; return 0; }
 EOF
-if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4038,55 +4123,42 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo $fftwname | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-l$fftwname $LIBS"
+  LIBS="-lm $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find a library to match the $fftwname header" 1>&2; exit 1; }
+{ echo "configure: error: No math library found" 1>&2; exit 1; }
 fi
 
-ac_fftw_savedprefix=$usedprefix
-ac_fftw_firstname=$fftwname
-
-else
-
-fftwname=${ac_fftw_savedprefix}fftw_mpi
-echo $ac_n "checking for $fftwname.h""... $ac_c" 1>&6
-echo "configure:4062: checking for $fftwname.h" >&5
-cat > conftest.$ac_ext <<EOF
-#line 4064 "configure"
-#include "confdefs.h"
-#include <$fftwname.h>
-int main() {
 
-; return 0; }
-EOF
-if { (eval echo configure:4071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
-echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4075: checking for main in -l$fftwname" >&5
-ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
+#####
+# IBM provides a MASS library with vectorized and optimized math stuff,
+# and an xlopt library which partly overlaps this. They must come before
+# libm in the link list, thus the test goes after that for libm!
+if test "${host_vendor}" = "ibm"; then
+  echo $ac_n "checking for main in -lxlopt""... $ac_c" 1>&6
+echo "configure:4147: checking for main in -lxlopt" >&5
+ac_lib_var=`echo xlopt'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-l$fftwname  $LIBS"
+LIBS="-lxlopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4083 "configure"
+#line 4155 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4101,117 +4173,426 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo $fftwname | sed -e 's/^a-zA-Z0-9_/_/g' \
+    ac_tr_lib=HAVE_LIB`echo xlopt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-l$fftwname $LIBS"
+  LIBS="-lxlopt $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find a library to match the $fftwname header" 1>&2; exit 1; }
 fi
 
+  echo $ac_n "checking for main in -lmass""... $ac_c" 1>&6
+echo "configure:4190: checking for main in -lmass" >&5
+ac_lib_var=`echo mass'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmass  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4198 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  
-echo "$ac_t""no" 1>&6
-{ echo "configure: error: Cant find $fftwname.h header. Make sure all your fftw prefixes match - we already use $ac_fftw_firstname.h" 1>&2; exit 1; }
-
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo mass | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
 
+  LIBS="-lmass $LIBS"
 
-  
-if test -z "$ac_fftw_firstname"; then
-
-if test "$precision" = "8"; then
-  prec="double"
-  fftwcheckprefix=d
 else
-  prec="single"
-  fftwcheckprefix=s
+  echo "$ac_t""no" 1>&6
 fi
-
-usedprefix=""
-ok="no"
-# check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
-echo $ac_n "checking for rfftw_mpi.h""... $ac_c" 1>&6
-echo "configure:4147: checking for rfftw_mpi.h" >&5
+  
+  vectmass=no
+  case "$gmxcpu" in
+    power4*)
+       # first check for a power4 lib, then power3, power2.
+      
+echo $ac_n "checking for library containing main""... $ac_c" 1>&6
+echo "configure:4238: checking for library containing main" >&5
+if eval "test \"`echo '$''{'ac_cv_search_main'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_main="no"
 cat > conftest.$ac_ext <<EOF
-#line 4149 "configure"
+#line 4245 "configure"
 #include "confdefs.h"
-#include <rfftw_mpi.h>
-int main() {
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
 
+int main() {
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  
-fftwname=rfftw_mpi 
-echo "$ac_t""yes" 1>&6
-
+  ac_cv_search_main="none required"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
 fi
 rm -f conftest*
-
-
-if test -n "$fftwname"; then
-# we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
+test "$ac_cv_search_main" = "no" && for i in massvp4,massvp3,massvp2,massv; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4174 "configure"
+#line 4267 "configure"
 #include "confdefs.h"
-#include <$fftwname.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)]; 
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:4181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ok="yes"
+  ac_cv_search_main="-l$i"
+break
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ok="no"
 fi
 rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
 fi
 
-fftwname=rfftw_mpi
-
-if test "$ok" != "yes"; then
-  xfftwname=${fftwcheckprefix}${fftwname}
-  echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
-echo "configure:4198: checking for $xfftwname.h" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 4200 "configure"
+echo "$ac_t""$ac_cv_search_main" 1>&6
+if test "$ac_cv_search_main" != "no"; then
+  test "$ac_cv_search_main" = "none required" || LIBS="$ac_cv_search_main $LIBS"
+  vectmass=yes
+else :
+  
+fi ;;
+    power3*)
+      
+echo $ac_n "checking for library containing main""... $ac_c" 1>&6
+echo "configure:4301: checking for library containing main" >&5
+if eval "test \"`echo '$''{'ac_cv_search_main'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_main="no"
+cat > conftest.$ac_ext <<EOF
+#line 4308 "configure"
 #include "confdefs.h"
-#include <$xfftwname.h>
-int main() {
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
 
+int main() {
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:4207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+  ac_cv_search_main="none required"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+test "$ac_cv_search_main" = "no" && for i in massvp3,massvp2,massv; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4330 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_main="-l$i"
+break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_main" 1>&6
+if test "$ac_cv_search_main" != "no"; then
+  test "$ac_cv_search_main" = "none required" || LIBS="$ac_cv_search_main $LIBS"
+  vectmass=yes
+else :
+  
+fi ;;
+    power2*)
+      
+echo $ac_n "checking for library containing main""... $ac_c" 1>&6
+echo "configure:4364: checking for library containing main" >&5
+if eval "test \"`echo '$''{'ac_cv_search_main'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_main="no"
+cat > conftest.$ac_ext <<EOF
+#line 4371 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_main="none required"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_main" = "no" && for i in massvp2,massv; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4393 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_main="-l$i"
+break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_main" 1>&6
+if test "$ac_cv_search_main" != "no"; then
+  test "$ac_cv_search_main" = "none required" || LIBS="$ac_cv_search_main $LIBS"
+  vectmass=yes
+else :
+  
+fi ;;
+    *)
+      
+echo $ac_n "checking for library containing main""... $ac_c" 1>&6
+echo "configure:4427: checking for library containing main" >&5
+if eval "test \"`echo '$''{'ac_cv_search_main'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_main="no"
+cat > conftest.$ac_ext <<EOF
+#line 4434 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_main="none required"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_main" = "no" && for i in massv; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4456 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char main();
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_main="-l$i"
+break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_main" 1>&6
+if test "$ac_cv_search_main" != "no"; then
+  test "$ac_cv_search_main" = "none required" || LIBS="$ac_cv_search_main $LIBS"
+  vectmass=yes
+else :
+  
+fi ;;
+  esac
+  if test "$vectmass" = "yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_LIBMASSV_ANY 
+EOF
+
+    if test "$enable_vectorized_recip" = "not_selected"; then
+      echo "Note: vector MASS lib present - vectorizing 1/x inner loops"
+      enable_vectorized_recip="yes"
+    fi
+    if test "$enable_vectorized_sqrt" = "not_selected"; then
+      echo "Note: vector MASS lib present - vectorizing 1/sqrt inner loops"
+      enable_vectorized_sqrt="yes"
+    fi    
+  else
+    echo "******************************************************************************"
+    echo "*Didn't find the IBM MASS library. It's not necessary, but can provide 20%   *"
+    echo "*performance improvement by loop vectorization. Add the library search path  *"
+    echo "*with -L in the LDFLAGS variable. If you can't find MASS, download it from   *"
+    echo "*http://www.research.ibm.com/mass                                            *"
+    echo "******************************************************************************"
+  fi
+fi 
+
+
+if test -z "$ac_fftw_firstname"; then
+
+if test "$enable_float" = "no"; then
+  prec="double"
+  realsize=8
+  fftwcheckprefix=d
+else
+  prec="single"
+  realsize=4
+  fftwcheckprefix=s
+fi
+
+usedprefix=""
+ok="no"
+# check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
+echo $ac_n "checking for fftw.h""... $ac_c" 1>&6
+echo "configure:4528: checking for fftw.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4530 "configure"
+#include "confdefs.h"
+#include <fftw.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+fftwname=fftw 
+echo "$ac_t""yes" 1>&6
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+if test -n "$fftwname"; then
+# we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
+cat > conftest.$ac_ext <<EOF
+#line 4555 "configure"
+#include "confdefs.h"
+#include <$fftwname.h>
+int main() {
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; 
+; return 0; }
+EOF
+if { (eval echo configure:4562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ok="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ok="no"
+fi
+rm -f conftest*
+fi
+
+fftwname=fftw
+
+if test "$ok" != "yes"; then
+  xfftwname=${fftwcheckprefix}${fftwname}
+  echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
+echo "configure:4579: checking for $xfftwname.h" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 4581 "configure"
+#include "confdefs.h"
+#include <$xfftwname.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+echo "$ac_t""no" 1>&6
 { echo "configure: error: Cannot find any $prec precision $fftwname.h or $xfftwname.h
 Do you have $prec precision FFTW installed? If you are using packages,
 note that you also need fftw-devel to compile GROMACS. You can find the 
@@ -4230,14 +4611,14 @@ You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit
 fi
 rm -f conftest*
 cat > conftest.$ac_ext <<EOF
-#line 4234 "configure"
+#line 4615 "configure"
 #include "confdefs.h"
 #include <$xfftwname.h>
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)];
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];
 ; return 0; }
 EOF
-if { (eval echo configure:4241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 fftwname=$xfftwname 
@@ -4267,7 +4648,7 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4271: checking for main in -l$fftwname" >&5
+echo "configure:4652: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4275,14 +4656,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4279 "configure"
+#line 4660 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4315,22 +4696,22 @@ ac_fftw_firstname=$fftwname
 
 else
 
-fftwname=${ac_fftw_savedprefix}rfftw_mpi
+fftwname=${ac_fftw_savedprefix}fftw
 echo $ac_n "checking for $fftwname.h""... $ac_c" 1>&6
-echo "configure:4321: checking for $fftwname.h" >&5
+echo "configure:4702: checking for $fftwname.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4323 "configure"
+#line 4704 "configure"
 #include "confdefs.h"
 #include <$fftwname.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4334: checking for main in -l$fftwname" >&5
+echo "configure:4715: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4338,14 +4719,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4342 "configure"
+#line 4723 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4387,36 +4768,36 @@ rm -f conftest*
 fi
 
 
-fi
-
 
 if test -z "$ac_fftw_firstname"; then
 
-if test "$precision" = "8"; then
+if test "$enable_float" = "no"; then
   prec="double"
+  realsize=8
   fftwcheckprefix=d
 else
   prec="single"
+  realsize=4
   fftwcheckprefix=s
 fi
 
 usedprefix=""
 ok="no"
 # check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
-echo $ac_n "checking for fftw.h""... $ac_c" 1>&6
-echo "configure:4408: checking for fftw.h" >&5
+echo $ac_n "checking for rfftw.h""... $ac_c" 1>&6
+echo "configure:4789: checking for rfftw.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4410 "configure"
+#line 4791 "configure"
 #include "confdefs.h"
-#include <fftw.h>
+#include <rfftw.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
-fftwname=fftw 
+fftwname=rfftw 
 echo "$ac_t""yes" 1>&6
 
 else
@@ -4431,14 +4812,14 @@ rm -f conftest*
 if test -n "$fftwname"; then
 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
 cat > conftest.$ac_ext <<EOF
-#line 4435 "configure"
+#line 4816 "configure"
 #include "confdefs.h"
 #include <$fftwname.h>
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)]; 
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; 
 ; return 0; }
 EOF
-if { (eval echo configure:4442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ok="yes"
 else
@@ -4450,21 +4831,21 @@ fi
 rm -f conftest*
 fi
 
-fftwname=fftw
+fftwname=rfftw
 
 if test "$ok" != "yes"; then
   xfftwname=${fftwcheckprefix}${fftwname}
   echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
-echo "configure:4459: checking for $xfftwname.h" >&5
+echo "configure:4840: checking for $xfftwname.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 4461 "configure"
+#line 4842 "configure"
 #include "confdefs.h"
 #include <$xfftwname.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4491,14 +4872,14 @@ You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit
 fi
 rm -f conftest*
 cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4876 "configure"
 #include "confdefs.h"
 #include <$xfftwname.h>
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)];
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];
 ; return 0; }
 EOF
-if { (eval echo configure:4502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 fftwname=$xfftwname 
@@ -4528,7 +4909,7 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4532: checking for main in -l$fftwname" >&5
+echo "configure:4913: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4536,14 +4917,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4540 "configure"
+#line 4921 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4576,22 +4957,22 @@ ac_fftw_firstname=$fftwname
 
 else
 
-fftwname=${ac_fftw_savedprefix}fftw
+fftwname=${ac_fftw_savedprefix}rfftw
 echo $ac_n "checking for $fftwname.h""... $ac_c" 1>&6
-echo "configure:4582: checking for $fftwname.h" >&5
+echo "configure:4963: checking for $fftwname.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4584 "configure"
+#line 4965 "configure"
 #include "confdefs.h"
 #include <$fftwname.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4595: checking for main in -l$fftwname" >&5
+echo "configure:4976: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4599,14 +4980,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4603 "configure"
+#line 4984 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4649,33 +5030,37 @@ fi
 
 
 
+if test "$enable_mpi" = "yes"; then
+  
 if test -z "$ac_fftw_firstname"; then
 
-if test "$precision" = "8"; then
+if test "$enable_float" = "no"; then
   prec="double"
+  realsize=8
   fftwcheckprefix=d
 else
   prec="single"
+  realsize=4
   fftwcheckprefix=s
 fi
 
 usedprefix=""
 ok="no"
 # check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
-echo $ac_n "checking for rfftw.h""... $ac_c" 1>&6
-echo "configure:4667: checking for rfftw.h" >&5
+echo $ac_n "checking for fftw_mpi.h""... $ac_c" 1>&6
+echo "configure:5052: checking for fftw_mpi.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4669 "configure"
+#line 5054 "configure"
 #include "confdefs.h"
-#include <rfftw.h>
+#include <fftw_mpi.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
-fftwname=rfftw 
+fftwname=fftw_mpi 
 echo "$ac_t""yes" 1>&6
 
 else
@@ -4690,14 +5075,14 @@ rm -f conftest*
 if test -n "$fftwname"; then
 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
 cat > conftest.$ac_ext <<EOF
-#line 4694 "configure"
+#line 5079 "configure"
 #include "confdefs.h"
 #include <$fftwname.h>
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)]; 
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; 
 ; return 0; }
 EOF
-if { (eval echo configure:4701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ok="yes"
 else
@@ -4709,21 +5094,21 @@ fi
 rm -f conftest*
 fi
 
-fftwname=rfftw
+fftwname=fftw_mpi
 
 if test "$ok" != "yes"; then
   xfftwname=${fftwcheckprefix}${fftwname}
   echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
-echo "configure:4718: checking for $xfftwname.h" >&5
+echo "configure:5103: checking for $xfftwname.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 4720 "configure"
+#line 5105 "configure"
 #include "confdefs.h"
 #include <$xfftwname.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4750,14 +5135,14 @@ You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit
 fi
 rm -f conftest*
 cat > conftest.$ac_ext <<EOF
-#line 4754 "configure"
+#line 5139 "configure"
 #include "confdefs.h"
 #include <$xfftwname.h>
 int main() {
-int _array_ [1 - 2 * !((sizeof(fftw_real)) == $precision)];
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];
 ; return 0; }
 EOF
-if { (eval echo configure:4761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 fftwname=$xfftwname 
@@ -4787,7 +5172,7 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4791: checking for main in -l$fftwname" >&5
+echo "configure:5176: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4795,14 +5180,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4799 "configure"
+#line 5184 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4835,22 +5220,22 @@ ac_fftw_firstname=$fftwname
 
 else
 
-fftwname=${ac_fftw_savedprefix}rfftw
+fftwname=${ac_fftw_savedprefix}fftw_mpi
 echo $ac_n "checking for $fftwname.h""... $ac_c" 1>&6
-echo "configure:4841: checking for $fftwname.h" >&5
+echo "configure:5226: checking for $fftwname.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4843 "configure"
+#line 5228 "configure"
 #include "confdefs.h"
 #include <$fftwname.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
-echo "configure:4854: checking for main in -l$fftwname" >&5
+echo "configure:5239: checking for main in -l$fftwname" >&5
 ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4858,14 +5243,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$fftwname  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4862 "configure"
+#line 5247 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4907,50 +5292,301 @@ rm -f conftest*
 fi
 
 
+  
+if test -z "$ac_fftw_firstname"; then
 
-case ${ac_fftw_savedprefix} in
- d)
-   cat >> confdefs.h <<\EOF
-#define FFTW_NAME_DFFTW 
-EOF
+if test "$enable_float" = "no"; then
+  prec="double"
+  realsize=8
+  fftwcheckprefix=d
+else
+  prec="single"
+  realsize=4
+  fftwcheckprefix=s
+fi
 
-   ;;  
- s)
-   cat >> confdefs.h <<\EOF
-#define FFTW_NAME_SFFTW 
-EOF
+usedprefix=""
+ok="no"
+# check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
+echo $ac_n "checking for rfftw_mpi.h""... $ac_c" 1>&6
+echo "configure:5313: checking for rfftw_mpi.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 5315 "configure"
+#include "confdefs.h"
+#include <rfftw_mpi.h>
+int main() {
 
-   ;;  
- *)
-   cat >> confdefs.h <<\EOF
-#define FFTW_NAME_FFTW 
+; return 0; }
 EOF
+if { (eval echo configure:5322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+fftwname=rfftw_mpi 
+echo "$ac_t""yes" 1>&6
 
-   ;;  
-esac
-
-######
-if test "$enable_xdr" = "no"; then
-  echo "configure: warning: * Not using XDR cripples GROMACS significantly. You won't be able to *
-              * read or write any compressed trajectories. You have no choice on   *
-              * windows, but if you run UNIX locate the RPC files - you have them! *" 1>&2
-else
-# check for xtc headers
-  for ac_hdr in rpc/rpc.h rpc/xdr.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4944: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4949 "configure"
-#include "confdefs.h"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+if test -n "$fftwname"; then
+# we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
+cat > conftest.$ac_ext <<EOF
+#line 5340 "configure"
+#include "confdefs.h"
+#include <$fftwname.h>
+int main() {
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; 
+; return 0; }
+EOF
+if { (eval echo configure:5347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ok="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ok="no"
+fi
+rm -f conftest*
+fi
+
+fftwname=rfftw_mpi
+
+if test "$ok" != "yes"; then
+  xfftwname=${fftwcheckprefix}${fftwname}
+  echo $ac_n "checking for $xfftwname.h""... $ac_c" 1>&6
+echo "configure:5364: checking for $xfftwname.h" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 5366 "configure"
+#include "confdefs.h"
+#include <$xfftwname.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:5373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+echo "$ac_t""no" 1>&6
+{ echo "configure: error: Cannot find any $prec precision $fftwname.h or $xfftwname.h
+Do you have $prec precision FFTW installed? If you are using packages,
+note that you also need fftw-devel to compile GROMACS. You can find the 
+software at www.fftw.org, and detailed instructions at www.gromacs.org.
+If you compiled FFTW yourself:                                        
+Note that the default FFTW setup is double precision. Change the FFTW
+configuration to single with --enable-float. If you want MPI support,
+use --enable-mpi. It is a good idea to install both single & double. 
+If your sysadm doesn't want to install it you can do it to a location
+in your home directory and provide the correct paths in the CPPFLAGS
+and LDFLAGS environment variables before running configure.
+That is also necessary to do if your compiler doesn't search
+/usr/local/include and /usr/local/lib by default.
+You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit 1; }
+
+fi
+rm -f conftest*
+cat > conftest.$ac_ext <<EOF
+#line 5400 "configure"
+#include "confdefs.h"
+#include <$xfftwname.h>
+int main() {
+int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];
+; return 0; }
+EOF
+if { (eval echo configure:5407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+fftwname=$xfftwname 
+usedprefix=$fftwcheckprefix
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+{ echo "configure: error: Cannot find any $prec precision $fftwname.h or $xfftwname.h
+Do you have $prec precision FFTW installed? If you are using packages,
+note that you also need fftw-devel to compile GROMACS. You can find the 
+software at www.fftw.org, and detailed instructions at www.gromacs.org.
+If you compiled FFTW yourself:                                       
+Note that the default FFTW setup is double precision. Change the FFTW
+configuration to single with --enable-float. If you want MPI support,
+use --enable-mpi. It is a good idea to install both single & double. 
+If your sysadm doesn't want to install it you can do it to a location
+in your home directory and provide the correct paths in the CPPFLAGS
+and LDFLAGS environment variables before running configure.
+That is also necessary to do if your compiler doesn't search
+/usr/local/include and /usr/local/lib by default.
+You can find information at www.gromacs.org, or in the INSTALL file." 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
+echo "configure:5437: checking for main in -l$fftwname" >&5
+ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$fftwname  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5445 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo $fftwname | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-l$fftwname $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: Can't find a library to match the $fftwname header" 1>&2; exit 1; }
+fi
+
+ac_fftw_savedprefix=$usedprefix
+ac_fftw_firstname=$fftwname
+
+else
+
+fftwname=${ac_fftw_savedprefix}rfftw_mpi
+echo $ac_n "checking for $fftwname.h""... $ac_c" 1>&6
+echo "configure:5487: checking for $fftwname.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 5489 "configure"
+#include "confdefs.h"
+#include <$fftwname.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:5496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+echo $ac_n "checking for main in -l$fftwname""... $ac_c" 1>&6
+echo "configure:5500: checking for main in -l$fftwname" >&5
+ac_lib_var=`echo $fftwname'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$fftwname  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5508 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo $fftwname | sed -e 's/^a-zA-Z0-9_/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-l$fftwname $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: Can't find a library to match the $fftwname header" 1>&2; exit 1; }
+fi
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+echo "$ac_t""no" 1>&6
+{ echo "configure: error: Cant find $fftwname.h header. Make sure all your fftw prefixes match - we already use $ac_fftw_firstname.h" 1>&2; exit 1; }
+
+fi
+rm -f conftest*
+
+fi
+
+
+fi
+
+case ${ac_fftw_savedprefix} in
+ d) cat >> confdefs.h <<\EOF
+#define FFTW_NAME_DFFTW 
+EOF
+ ;;    
+ s) cat >> confdefs.h <<\EOF
+#define FFTW_NAME_SFFTW 
+EOF
+ ;;    
+ *) cat >> confdefs.h <<\EOF
+#define FFTW_NAME_FFTW 
+EOF
+ ;;    
+esac
+
+######
+# check for xtc headers
+for ac_hdr in rpc/rpc.h rpc/xdr.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5580: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5585 "configure"
+#include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4970,17 +5606,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
-else
-  echo "$ac_t""no" 1>&6
-{ echo "configure: error: RPC/XDR include headers not found" 1>&2; exit 1; }
-fi
-done
-
-# check for xtc libs
-# on solaris the xdr stuff is in -lnsl
-  echo $ac_n "checking for xdr_float in -lnsl""... $ac_c" 1>&6
-echo "configure:4984: checking for xdr_float in -lnsl" >&5
+ # check for xtc libs if we found headers - on solaris the xdr stuff is in libnsl
+echo $ac_n "checking for xdr_float in -lnsl""... $ac_c" 1>&6
+echo "configure:5612: checking for xdr_float in -lnsl" >&5
 ac_lib_var=`echo nsl'_'xdr_float | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4988,7 +5616,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4992 "configure"
+#line 5620 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4999,7 +5627,7 @@ int main() {
 xdr_float()
 ; return 0; }
 EOF
-if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5026,704 +5654,740 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  cat > conftest.$ac_ext <<EOF
-#line 5031 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 5659 "configure"
 #include "confdefs.h"
 #include<rpc/rpc.h> 
- #include<rpc/xdr.h>
+#include<rpc/xdr.h>
 int main() {
  XDR *xd; float f; xdr_float(xd,&f);
 ; return 0; }
 EOF
-if { (eval echo configure:5039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  :
+if { (eval echo configure:5667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  have_xdr=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  { echo "configure: error: RPC/XDR libraries not found" 1>&2; exit 1; }
+  echo "configure: warning: RPC/XDR libraries not found - disabling xtc" 1>&2
 fi
 rm -f conftest*
 
-
-if true; then
-  GMX_USE_XDR_TRUE=
-  GMX_USE_XDR_FALSE='#'
 else
-  GMX_USE_XDR_TRUE='#'
-  GMX_USE_XDR_FALSE=
+  echo "$ac_t""no" 1>&6
+echo "configure: warning: RPC/XDR include headers not found - disabling xtc" 1>&2
 fi
+done
+
+
+if test "$have_xdr" != "yes"; then
+  echo "*****************************************************************************"
+  echo "*WARNING - XDR not found. This cripples GROMACS significantly - you can't   *"
+  echo "*read/write portable trajectories. No choice on windows, but locate the RPC *"
+  echo "*header files and libraries if you run UNIX - they do exist!                *"
+  echo "*****************************************************************************"
 fi
 
 #####
-# Look for X
-# If we find X, set shell vars x_includes and x_libraries to the
-# paths, otherwise set no_x=yes.
-# Uses ac_ vars as temps to allow command line to override cache and checks.
-# --without-x overrides everything else, but does not touch the cache.
-echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:5066: checking for X" >&5
-
-# Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
-  withval="$with_x"
-  :
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+# Checks for additional and/or optional functions or libraries.
+#AC_FUNC_MALLOC
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:5697: checking for 8-bit clean memcmp" >&5
+if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=NO ac_x_libraries=NO
-rm -fr conftestdir
-if mkdir conftestdir; then
-  cd conftestdir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
-  cat > Imakefile <<'EOF'
-acfindx:
-       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_memcmp_clean=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5705 "configure"
+#include "confdefs.h"
+
+main()
+{
+  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+
 EOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case "$ac_im_incroot" in
-       /usr/include) ;;
-       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
-    esac
-    case "$ac_im_usrlibdir" in
-       /usr/lib | /lib) ;;
-       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
-    esac
-  fi
-  cd ..
-  rm -fr conftestdir
+if { (eval echo configure:5715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_memcmp_clean=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
 fi
 
-if test "$ac_x_includes" = NO; then
-  # Guess where to find include files, by looking for this one X11 .h file.
-  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+fi
 
-  # First, try using that file with no special directory specified.
-cat > conftest.$ac_ext <<EOF
-#line 5128 "configure"
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:5733: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5738 "configure"
 #include "confdefs.h"
-#include <$x_direct_test_include>
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:5755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
+  ac_cv_type_signal=void
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  # Look for the header file in a standard set of common directories.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-  for ac_dir in               \
-    /usr/X11/include          \
-    /usr/X11R6/include        \
-    /usr/X11R5/include        \
-    /usr/X11R4/include        \
-                              \
-    /usr/include/X11          \
-    /usr/include/X11R6        \
-    /usr/include/X11R5        \
-    /usr/include/X11R4        \
-                              \
-    /usr/local/X11/include    \
-    /usr/local/X11R6/include  \
-    /usr/local/X11R5/include  \
-    /usr/local/X11R4/include  \
-                              \
-    /usr/local/include/X11    \
-    /usr/local/include/X11R6  \
-    /usr/local/include/X11R5  \
-    /usr/local/include/X11R4  \
-                              \
-    /usr/X386/include         \
-    /usr/x386/include         \
-    /usr/XFree86/include/X11  \
-                              \
-    /usr/include              \
-    /usr/local/include        \
-    /usr/unsupported/include  \
-    /usr/athena/include       \
-    /usr/local/x11r5/include  \
-    /usr/lpp/Xamples/include  \
-                              \
-    /usr/openwin/include      \
-    /usr/openwin/share/include \
-    ; \
-  do
-    if test -r "$ac_dir/$x_direct_test_include"; then
-      ac_x_includes=$ac_dir
-      break
-    fi
-  done
+  ac_cv_type_signal=int
 fi
 rm -f conftest*
-fi # $ac_x_includes = NO
+fi
 
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
 
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
 
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS="$LIBS"
-  LIBS="-l$x_direct_test_library $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5202 "configure"
+echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:5774: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5779 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vprintf(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char vprintf();
 
 int main() {
-${x_direct_test_function}()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_vprintf) || defined (__stub___vprintf)
+choke me
+#else
+vprintf();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
+  eval "ac_cv_func_vprintf=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# First see if replacing the include by lib works.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
-    /usr/X11/lib          \
-    /usr/X11R6/lib        \
-    /usr/X11R5/lib        \
-    /usr/X11R4/lib        \
-                          \
-    /usr/lib/X11          \
-    /usr/lib/X11R6        \
-    /usr/lib/X11R5        \
-    /usr/lib/X11R4        \
-                          \
-    /usr/local/X11/lib    \
-    /usr/local/X11R6/lib  \
-    /usr/local/X11R5/lib  \
-    /usr/local/X11R4/lib  \
-                          \
-    /usr/local/lib/X11    \
-    /usr/local/lib/X11R6  \
-    /usr/local/lib/X11R5  \
-    /usr/local/lib/X11R4  \
-                          \
-    /usr/X386/lib         \
-    /usr/x386/lib         \
-    /usr/XFree86/lib/X11  \
-                          \
-    /usr/lib              \
-    /usr/local/lib        \
-    /usr/unsupported/lib  \
-    /usr/athena/lib       \
-    /usr/local/x11r5/lib  \
-    /usr/lpp/Xamples/lib  \
-    /lib/usr/lib/X11     \
-                          \
-    /usr/openwin/lib      \
-    /usr/openwin/share/lib \
-    ; \
-do
-  for ac_extension in a so sl; do
-    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
+  eval "ac_cv_func_vprintf=no"
 fi
 rm -f conftest*
-fi # $ac_x_libraries = NO
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
+EOF
 
-if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
 else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+  echo "$ac_t""no" 1>&6
 fi
-fi
-  fi
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  echo "$ac_t""$have_x" 1>&6
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
-fi
-
-if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-  cat >> confdefs.h <<\EOF
-#define X_DISPLAY_MISSING 1
-EOF
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
-
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    case "`(uname -sr) 2>/dev/null`" in
-    "SunOS 5"*)
-      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5315: checking whether -R must be followed by a space" >&5
-      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
-      cat > conftest.$ac_ext <<EOF
-#line 5318 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:5325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_nospace=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_nospace=no
-fi
-rm -f conftest*
-      if test $ac_R_nospace = yes; then
-       echo "$ac_t""no" 1>&6
-       X_LIBS="$X_LIBS -R$x_libraries"
-      else
-       LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat > conftest.$ac_ext <<EOF
-#line 5341 "configure"
-#include "confdefs.h"
-
-int main() {
 
-; return 0; }
-EOF
-if { (eval echo configure:5348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_space=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_space=no
-fi
-rm -f conftest*
-       if test $ac_R_space = yes; then
-         echo "$ac_t""yes" 1>&6
-         X_LIBS="$X_LIBS -R $x_libraries"
-       else
-         echo "$ac_t""neither works" 1>&6
-       fi
-      fi
-      LIBS="$ac_xsave_LIBS"
-    esac
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And karl@cs.umb.edu says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5380: checking for dnet_ntoa in -ldnet" >&5
-ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:5826: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5388 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 5831 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _doprnt(); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
+char _doprnt();
 
 int main() {
-dnet_ntoa()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+_doprnt();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func__doprnt=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func__doprnt=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+  cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
+EOF
+
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:5421: checking for dnet_ntoa in -ldnet_stub" >&5
-ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet_stub  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5429 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
+fi
 
-int main() {
-dnet_ntoa()
-; return 0; }
+echo $ac_n "checking if malloc debugging is wanted""... $ac_c" 1>&6
+echo "configure:5879: checking if malloc debugging is wanted" >&5
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+  withval="$with_dmalloc"
+  if test "$withval" = yes; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define WITH_DMALLOC 1
 EOF
-if { (eval echo configure:5440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  echo "$ac_t""no" 1>&6
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    fi
 
-    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to dickey@clark.net.
-    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:5469: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
+for ac_func in strcasecmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5902: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5474 "configure"
+#line 5907 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname(); below.  */
+    which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gethostbyname();
+char $ac_func();
 
 int main() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-gethostbyname();
+$ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
-    if test $ac_cv_func_gethostbyname = no; then
-      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:5518: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+for ac_func in strdup
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5957: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lnsl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5526 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 5962 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gethostbyname();
+char $ac_func();
 
 int main() {
-gethostbyname()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
-    fi
 
-    # lieder@skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says simon@lia.di.epfl.ch: it contains
-    # gethostby* variants that don't use the nameserver (or something).
-    # -lsocket must be given before -lnsl if both are needed.
-    # We assume that if connect needs -lnsl, so does gethostbyname.
-    echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:5567: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+#####
+# Look for X
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:6017: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+  :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5572 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
-
-int main() {
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
+fi
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_connect) || defined (__stub___connect)
-choke me
-#else
-connect();
-#endif
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 
-; return 0; }
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 6079 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
 EOF
-if { (eval echo configure:5595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_func_connect=yes"
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_connect=no"
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
 fi
 rm -f conftest*
-fi
+fi # $ac_x_includes = NO
 
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
 
-    if test $ac_cv_func_connect = no; then
-      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:5616: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
   ac_save_LIBS="$LIBS"
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5624 "configure"
+#line 6153 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
 
 int main() {
-connect()
+${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:5635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11     \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+fi # $ac_x_libraries = NO
 
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
 else
-  echo "$ac_t""no" 1>&6
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
 fi
 
-    fi
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
 
-    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
-    echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:5659: checking for remove" >&5
-if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:6266: checking whether -R must be followed by a space" >&5
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      cat > conftest.$ac_ext <<EOF
+#line 6269 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_nospace=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_nospace=no
+fi
+rm -f conftest*
+      if test $ac_R_nospace = yes; then
+       echo "$ac_t""no" 1>&6
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat > conftest.$ac_ext <<EOF
+#line 6292 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_space=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_space=no
+fi
+rm -f conftest*
+       if test $ac_R_space = yes; then
+         echo "$ac_t""yes" 1>&6
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         echo "$ac_t""neither works" 1>&6
+       fi
+      fi
+      LIBS="$ac_xsave_LIBS"
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And karl@cs.umb.edu says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:6331: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5664 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-ldnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6339 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove(); below.  */
-#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char remove();
+char dnet_ntoa();
 
 int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_remove) || defined (__stub___remove)
-choke me
-#else
-remove();
-#endif
-
+dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_remove=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_remove=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    if test $ac_cv_func_remove = no; then
-      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5708: checking for remove in -lposix" >&5
-ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:6372: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lposix  $LIBS"
+LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5716 "configure"
+#line 6380 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char remove();
+char dnet_ntoa();
 
 int main() {
-remove()
+dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5738,84 +6402,89 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
 else
   echo "$ac_t""no" 1>&6
 fi
 
     fi
 
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5751: checking for shmat" >&5
-if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to dickey@clark.net.
+    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:6420: checking for gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5756 "configure"
+#line 6425 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat(); below.  */
+    which can conflict with char gethostbyname(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char shmat();
+char gethostbyname();
 
 int main() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shmat) || defined (__stub___shmat)
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
 choke me
 #else
-shmat();
+gethostbyname();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_shmat=yes"
+  eval "ac_cv_func_gethostbyname=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_shmat=no"
+  eval "ac_cv_func_gethostbyname=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    if test $ac_cv_func_shmat = no; then
-      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5800: checking for shmat in -lipc" >&5
-ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+    if test $ac_cv_func_gethostbyname = no; then
+      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:6469: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lipc  $LIBS"
+LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5808 "configure"
+#line 6477 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char shmat();
+char gethostbyname();
 
 int main() {
-shmat()
+gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:5819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5830,44 +6499,90 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
 else
   echo "$ac_t""no" 1>&6
 fi
 
     fi
-  fi
 
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS="$LDFLAGS"
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
-  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:5852: checking for IceConnectionNumber in -lICE" >&5
-ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says simon@lia.di.epfl.ch: it contains
+    # gethostby* variants that don't use the nameserver (or something).
+    # -lsocket must be given before -lnsl if both are needed.
+    # We assume that if connect needs -lnsl, so does gethostbyname.
+    echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:6518: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6523 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char connect();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_connect=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_connect = no; then
+      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:6567: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5860 "configure"
+#line 6575 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char IceConnectionNumber();
+char connect();
 
 int main() {
-IceConnectionNumber()
+connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5882,17 +6597,252 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-  LDFLAGS="$ac_save_LDFLAGS"
+    fi
 
-fi
+    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
+    echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:6610: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6615 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char remove();
 
+int main() {
 
-# try to find motif headers and libraries
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_remove=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_remove = no; then
+      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:6659: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lposix  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6667 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:6678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:6702: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6707 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shmat();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_shmat = no; then
+      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:6751: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lipc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6759 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:6770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS="$LDFLAGS"
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:6803: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6811 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char IceConnectionNumber();
+
+int main() {
+IceConnectionNumber()
+; return 0; }
+EOF
+if { (eval echo configure:6822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  LDFLAGS="$ac_save_LDFLAGS"
+
+fi
+
+# try to find motif headers and libraries
 
 
 
@@ -5921,7 +6871,7 @@ fi
 
 
 echo $ac_n "checking for Motif""... $ac_c" 1>&6
-echo "configure:5925: checking for Motif" >&5
+echo "configure:6875: checking for Motif" >&5
 
 
 #
@@ -5945,14 +6895,14 @@ LDFLAGS="$X_LIBS $LDFLAGS"
 #
 ac_cv_motif_includes="none"
 cat > conftest.$ac_ext <<EOF
-#line 5949 "configure"
+#line 6899 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 int main() {
 int a;
 ; return 0; }
 EOF
-if { (eval echo configure:5956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 # Xm/Xm.h is in the standard search path.
@@ -6017,14 +6967,14 @@ LDFLAGS="$X_LIBS $LDFLAGS"
 #
 ac_cv_motif_libraries="none"
 cat > conftest.$ac_ext <<EOF
-#line 6021 "configure"
+#line 6971 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 int main() {
 XtToolkitInitialize();
 ; return 0; }
 EOF
-if { (eval echo configure:6028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
 # libXm.a is in the standard search path.
@@ -6113,35 +7063,74 @@ test "$motif_libraries_result" = "none" && motif_libraries_result="(none)"
 test "$motif_includes_result" = "none" && motif_includes_result="(none)"
 echo "$ac_t""libraries $motif_libraries_result, headers $motif_includes_result" 1>&6
 
-if test "$motif_includes" = "none" -a "$motif_libraries" != "none"; then
-  echo "configure: warning:  In addition to Motif/Lesstif libraries we also need includes. Disabling." 1>&2
-  motif_include=none
+use_motif=no
+if test "$motif_libraries" != "none"; then
+  if test "$motif_includes" != "none"; then
+    GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} mgmx.lo widget.lo"
+    use_motif=yes
+  else
+    echo "configure: warning:  Sorry, we need both Motif/Lesstif libraries and includes. Disabling." 1>&2
+    motif_include=none
+  fi
 fi
+if test "$no_x" != "yes"; then
+  LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+  INCLUDES="$INCLUDES $X_CFLAGS $MOTIF_CFLAGS" 
+  
 
-if test "$motif_includes" != "none"; then
-  use_motif="yes"
+if true; then
+  USE_X11_TRUE=
+  USE_X11_FALSE='#'
 else
-  use_motif="no"
+  USE_X11_TRUE='#'
+  USE_X11_FALSE=
 fi
+else
+  
+
+if false; then
+  USE_X11_TRUE=
+  USE_X11_FALSE='#'
+else
+  USE_X11_TRUE='#'
+  USE_X11_FALSE=
+fi
+fi
+
+#### 
+# And collect the f77 libs to the linker - on Solaris, f77 stuff must go first,
+# but on e.g. ibm the mass libraries must come before -lm... 
+case "${host_cpu}-${host_os}" in
+  sparc*-solaris*) LIBS="$FLIBS $LIBS" ;;
+  *) LIBS="$LIBS $FLIBS" ;;
+esac
+
+
+
+
+
 
-#####
-# Checks for header files.
+
+
+########################################################################
+# Checks for header files and types
+########################################################################
 
 for ac_hdr in limits.h malloc.h strings.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6135: checking for $ac_hdr" >&5
+echo "configure:7124: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6140 "configure"
+#line 7129 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6168,20 +7157,60 @@ else
 fi
 done
 
-
-#####
-# Checks for typedefs, structures, and compiler characteristics.
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6176: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7165: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6181 "configure"
+#line 7170 "configure"
 #include "confdefs.h"
-
-int main() {
-
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+#####
+# Checks for typedefs, structures, and compiler characteristics.
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:7205: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7210 "configure"
+#include "confdefs.h"
+
+int main() {
+
 /* Ultrix mips cc rejects this.  */
 typedef int charset[2]; const charset x;
 /* SunOS 4.1.1 cc rejects this.  */
@@ -6226,7 +7255,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -6247,12 +7276,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6251: checking for ANSI C header files" >&5
+echo "configure:7280: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6256 "configure"
+#line 7285 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6260,7 +7289,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6277,7 +7306,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 6281 "configure"
+#line 7310 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 6299 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
-  :
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6320 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:6331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  :
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:6355: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6360 "configure"
+#line 7328 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
 #include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_size_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
-  cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:6388: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6393 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <time.h>
-int main() {
-struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:6401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_struct_tm=time.h
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_tm=sys/time.h
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
-if test $ac_cv_struct_tm = sys/time.h; then
-  cat >> confdefs.h <<\EOF
-#define TM_IN_SYS_TIME 1
-EOF
-
-fi
-
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:6422: checking for uid_t in sys/types.h" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6427 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "uid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_uid_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_uid_t=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
-if test $ac_cv_type_uid_t = no; then
-  cat >> confdefs.h <<\EOF
-#define uid_t int
-EOF
-
-  cat >> confdefs.h <<\EOF
-#define gid_t int
-EOF
-
-fi
-
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:6456: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 6463 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:6470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_c_inline=$ac_kw; break
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
-
-fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
-  inline | yes) ;;
-  no) cat >> confdefs.h <<\EOF
-#define inline 
-EOF
- ;;
-  *)  cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
-EOF
- ;;
-esac
-
-
-#####
-# Checks for library functions.
-#AC_FUNC_MALLOC
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:6500: checking for 8-bit clean memcmp" >&5
-if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_memcmp_clean=no
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6508 "configure"
-#include "confdefs.h"
-
-main()
-{
-  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
-  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
-
 EOF
-if { (eval echo configure:6518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_func_memcmp_clean=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_memcmp_clean=no
-fi
-rm -fr conftest*
-fi
-
-fi
-
-echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:6536: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6541 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:6558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_type_signal=void
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:6577: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6582 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vprintf(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char vprintf();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
-choke me
-#else
-vprintf();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:6605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:6629: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6634 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _doprnt();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub__doprnt) || defined (__stub____doprnt)
-choke me
-#else
-_doprnt();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:6657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_DOPRNT 1
-EOF
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-#####
-# Collect the libraries and includes for X and/or motif
-if test "$no_x" != "yes"; then
-  LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
-  INCLUDES="$INCLUDES $X_CFLAGS $MOTIF_CFLAGS" 
-  
-
-if true; then
-  USE_X11_TRUE=
-  USE_X11_FALSE='#'
-else
-  USE_X11_TRUE='#'
-  USE_X11_FALSE=
-fi
-  use_x11="yes"
-else
-  use_x11="no"
-  
-
-if false; then
-  USE_X11_TRUE=
-  USE_X11_FALSE='#'
-else
-  USE_X11_TRUE='#'
-  USE_X11_FALSE=
-fi
-fi
-
-#### 
-# And collect the f77 libs to the linker - on Solaris, f77 stuff must go first,
-# but on e.g. ibm the mass libraries must come before -lm...
-case "${host_cpu}-${host_os}" in
-  sparc*-solaris*)
-    LIBS="$FLIBS $LIBS"
-    ;;
-  *)
-    LIBS="$LIBS $FLIBS"
-    ;;
-esac
-    
-########################################################################
-# Substitute things in output and header files.
-########################################################################
-SUFFIX=""
-GMXLIB_COND_OBJ=""
-
-if test "$enable_mpi" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define USE_MPI 
-EOF
-
-        GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} mpiio.lo"
-        if test "$enable_mpi_suffix" = "yes"; then
-         SUFFIX="_mpi"
-       fi
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} libnet.lo"
-fi
-
-if test "$enable_vector" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define USE_VECTOR 
-EOF
-
-fi
-
-if test "$enable_fortran" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define USE_FORTRAN 
-EOF
-
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} innerf.lo f77_wrappers.lo"
-       if test "$enable_float" = "yes"; then
-          MDLIB_COND_OBJ="flincs.lo fsettle.lo fshake.lo"
-        else
-          MDLIB_COND_OBJ="flincsd.lo fsettled.lo fshaked.lo"
-       fi
-       
-
-if true; then
-  USE_FORTRAN_TRUE=
-  USE_FORTRAN_FALSE='#'
-else
-  USE_FORTRAN_TRUE='#'
-  USE_FORTRAN_FALSE=
-fi
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} innerc.lo"
-        MDLIB_COND_OBJ="clincs.lo csettle.lo cshake.lo"
-       
-
-if false; then
-  USE_FORTRAN_TRUE=
-  USE_FORTRAN_FALSE='#'
-else
-  USE_FORTRAN_TRUE='#'
-  USE_FORTRAN_FALSE=
-fi
-fi
-
-if test "$enable_float" = "no"; then
-       cat >> confdefs.h <<\EOF
-#define DOUBLE 
-EOF
-
-        if test "$enable_type_suffix" = "yes"; then
-         SUFFIX="${SUFFIX}_d"
-       fi
-       
-
-if true; then
-  USE_DOUBLE_TRUE=
-  USE_DOUBLE_FALSE='#'
-else
-  USE_DOUBLE_TRUE='#'
-  USE_DOUBLE_FALSE=
-fi
-else
-       
-
-if false; then
-  USE_DOUBLE_TRUE=
-  USE_DOUBLE_FALSE='#'
-else
-  USE_DOUBLE_TRUE='#'
-  USE_DOUBLE_FALSE=
-fi
-fi
-
-if test "$enable_simplewater" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define SIMPLEWATER 
-EOF
-
-fi
-
-if test "$enable_waterwater_loops" = "no"; then
-       cat >> confdefs.h <<\EOF
-#define DISABLE_WATERWATER_LOOPS 
-EOF
-
-fi
-
-if test "$enable_nice" = "no"; then
-       cat >> confdefs.h <<\EOF
-#define NO_NICE 
-EOF
-
-fi
-
-if test "$enable_x86_asm" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define USE_SSE 
-EOF
-
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} x86_cpuid.lo x86_sse.lo x86_3dnow.lo"
-fi
-
-if test "$motif_includes" != "none" -a "$motif_libraries" != "none"; then
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} mgmx.lo widget.lo"
-fi
-
-if test "$enable_xdr" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define USE_XDR 
-EOF
-
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} libxdrf.lo ftocstr.lo"
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} dumxdrf.lo"
-fi
-
-if test "$enable_softwaresqrt" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define SOFTWARE_SQRT 
-EOF
-
-fi
-
-if test "$enable_softwarerecip" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define SOFTWARE_RECIP 
-EOF
-
-fi
-
-if test "$enable_hide_square_latency" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define DECREASE_SQUARE_LATENCY 
-EOF
-
-fi
-
-if test "$enable_hide_table_latency" = "yes"; then
-       cat >> confdefs.h <<\EOF
-#define DECREASE_LOOKUP_LATENCY 
-EOF
-
-fi
-
-if test "$with_mpi_environment" != "no" -a "$enable_mpi" = "yes"; then
-       cat >> confdefs.h <<EOF
-#define CHECK_MPI_ENV "$with_mpi_environment"
-EOF
-
-fi
-
-
-list_of_vectorized_sqrt=""
-if test "$enable_vectorized_sqrt" != "no"; then
-  if test "$enable_vectorized_sqrt" = "yes"; then
-    enable_vectorized_sqrt="normal,solvent,water,water-water"
-  fi
-  if echo $enable_vectorized_sqrt | grep "normal" >/dev/null; then
-    list_of_vectorized_sqrt="normal "
-    cat >> confdefs.h <<\EOF
-#define VECTORIZE_INVSQRT 
-EOF
-
-  fi
-  if echo $enable_vectorized_sqrt | grep "solvent" >/dev/null; then
-    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}solvent "
-    cat >> confdefs.h <<\EOF
-#define VECTORIZE_INVSQRT_S 
-EOF
-
-  fi
-  if echo $enable_vectorized_sqrt | sed 's/water-water//' | grep "water" >/dev/null; then
-    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water "
-    cat >> confdefs.h <<\EOF
-#define VECTORIZE_INVSQRT_W 
-EOF
-
-  fi
-  if echo $enable_vectorized_sqrt | grep "water-water" >/dev/null; then
-    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water-water "
-    cat >> confdefs.h <<\EOF
-#define VECTORIZE_INVSQRT_WW 
-EOF
-
-  fi
-fi
-if test -z "$list_of_vectorized_sqrt"; then
-  list_of_vectorized_sqrt="no"
-fi
-
-
-list_of_prefetch_x=""
-if test "$enable_prefetch_x" != "no"; then
-  if test "$enable_prefetch_x" = "yes"; then
-    enable_prefetch_x="normal,solvent,water,water-water"
-  fi
-  if echo $enable_prefetch_x | grep "normal" >/dev/null; then
-    list_of_prefetch_x="normal "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_X 
-EOF
-
-  fi
-  if echo $enable_prefetch_x | grep "solvent" >/dev/null; then
-    list_of_prefetch_x="${list_of_prefetch_x}solvent "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_X_S 
-EOF
-
-  fi
-  if echo $enable_prefetch_x | sed 's/water-water//' | grep "water" >/dev/null; then
-    list_of_prefetch_x="${list_of_prefetch_x}water "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_X_W 
-EOF
-
-  fi
-  if echo $enable_prefetch_x | grep "water-water" >/dev/null; then
-    list_of_prefetch_x="${list_of_prefetch_x}water-water "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_X_WW 
-EOF
-
-  fi
-fi
-if test -z "$list_of_prefetch_x"; then
-  list_of_prefetch_x="no"
-fi
-
-list_of_prefetch_f=""
-if test "$enable_prefetch_f" != "no"; then
-  if test "$enable_prefetch_f" = "yes"; then
-    enable_prefetch_f="normal,solvent,water,water-water"
-  fi
-  if echo $enable_prefetch_f | grep "normal" >/dev/null; then
-    list_of_prefetch_f="normal "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_F 
-EOF
-
-  fi
-  if echo $enable_prefetch_f | grep "solvent" >/dev/null; then
-    list_of_prefetch_f="${list_of_prefetch_f}solvent "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_F_S 
-EOF
-
-  fi
-  if echo $enable_prefetch_f | sed 's/water-water//' | grep "water"; then
-    list_of_prefetch_f="${list_of_prefetch_f}water "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_F_W 
-EOF
-
-  fi
-  if echo $enable_prefetch_f | grep "water-water" >/dev/null; then
-    list_of_prefetch_f="${list_of_prefetch_f}water-water "
-    cat >> confdefs.h <<\EOF
-#define PREFETCH_F_WW 
-EOF
-
-  fi
-fi
-if test -z "$list_of_prefetch_f"; then
-  list_of_prefetch_f="no"
-fi
-
-if test "$enable_vectorized_recip" != "yes" -a "$enable_vectorized_recip" != "no"; then
-  { echo "configure: error: Vectorized reciprocal is only meaningful for normal loops" 1>&2; exit 1; }
-fi
-
-if test "$enable_vectorized_recip" = "yes"; then
-  cat >> confdefs.h <<\EOF
-#define VECTORIZE_RECIP 
-EOF
-
-fi
-
-echo "1: ${datadir}"
-echo '2: ${datadir}' 
-cat >> confdefs.h <<EOF
-#define GMXLIBDIR "${datadir}/top"
-EOF
-
-
-
-# Check if there are any optimizations and options for this arch and cpu
-
-
-
-
-
-# Try to determine "good" native compiler flags if none specified on command
-# line. To avoid repeating the entire procedure for fortran flags, we first
-# determine our suggested choices for both C and fortran, and then possibly
-# override them with user choices.
-
-cc_vendor="unknown"
-
-case "${host_cpu}-${host_os}" in
-
-  *-solaris2*) 
-    case "${gmxcpu}" in
-      ultrasparc3*)
-        xCFLAGS="-fast -xO5 -xtarget=ultra3 -fsimple=2 -fnonstd -dalign"
-        xFFLAGS=$xCFLAGS
-        ;;
-      ultrasparc2i*)
-        xCFLAGS="-fast -xO5 -xtarget=ultra2i -fsimple=2 -fnonstd -dalign"
-        xFFLAGS=$xCFLAGS
-        ;;
-      ultrasparc2*)
-        xCFLAGS="-fast -xO5 -xtarget=ultra2 -fsimple=2 -fnonstd -dalign"
-        xFFLAGS=$xCFLAGS
-        ;;
-      ultrasparc*)
-        xCFLAGS="-fast -xO5 -xtarget=ultra -fsimple=2 -fnonstd -dalign"
-        xFFLAGS=$xCFLAGS
-        ;;
-      *)
-        xCFLAGS="-native -fast -xO5 -fsimple=2 -fnonstd -dalign"
-        xFFLAGS=$xCFLAGS
-        ;;
-    esac
-    ;;
-
-  *-hpux*)  
-    xCFLAGS="-Ae +O3 +Oall"
-    xFFLAGS=$xCFLAGS
-    # If you haven't noticed, we don't like hp very much...
-    # but perhaps that will change if they make something nice out of ia64.
-    ;;
-
-  rs6000*-aix*)
-    # dont use inter-procedure analysis for the innerloops - they take
-    # forever to compile with it, and it doesnt help at all.
-    case "${gmxcpu}" in
-      power4*)
-       xCFLAGS="-O3 -qarch=pwr4 -qtune=pwr4 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=pwr4 -qtune=pwr4 -qmaxmem=16384 -qhot -qnoipa"
-       ;;
-      power3*)
-       xCFLAGS="-O3 -qarch=pwr3 -qtune=pwr3 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=pwr3 -qtune=pwr3 -qmaxmem=16384 -qhot -qnoipa"
-       ;;
-      power2*)
-       xCFLAGS="-O3 -qarch=pwr2 -qtune=pwr2 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=pwr2 -qtune=pwr2 -qmaxmem=16384 -qhot -qnoipa"
-       ;;
-      power)
-       xCFLAGS="-O3 -qarch=pwr -qtune=pwr -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=pwr -qtune=pwr -qmaxmem=16384 -qhot -qnoipa"
-       ;;
-      *)
-       # I don't think people are using anything older than power2, so we tune for
-        # pwr, but dont set the arch since it is nice to have common binaries 
-        # that run also on powerpc.
-       xCFLAGS="-O3 -qlanglvl=ansi -qtune=pwr -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qtune=pwr -qmaxmem=16384 -qhot"
-       ;;
-    esac
-    ;;
-
-  powerpc*-aix*)
-    case "${gmxcpu}" in
-      ppc604)
-       xCFLAGS="-O3 -qarch=604 -qtune=604 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=604 -qtune=604 -qmaxmem=16384 -qhot"
-       ;;
-      ppc603)
-       xCFLAGS="-O3 -qarch=603 -qtune=603 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=603 -qtune=603 -qmaxmem=16384 -qhot"
-       ;;
-      rs64a)
-       xCFLAGS="-O3 -qarch=rs64a -qtune=rs64a -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=rs64a -qtune=rs64a -qmaxmem=16384 -qhot"
-       ;;
-      rs64b)
-       xCFLAGS="-O3 -qarch=rs64b -qtune=rs64b -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=rs64b -qtune=rs64b -qmaxmem=16384 -qhot"
-       ;;
-      rs64c)
-       xCFLAGS="-O3 -qarch=rs64c -qtune=rs64c -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qarch=rs64c -qtune=rs64c -qmaxmem=16384 -qhot"
-       ;;
-      *)
-       xCFLAGS="-O3 -qlanglvl=ansi -qmaxmem=16384"
-       xFFLAGS="-O3 -Q -qmaxmem=16384 -qhot"
-       ;;
-    esac
-    ;;
-
-  mips*-irix*)
-    xCFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -fullwarn -woff 1174 -D__INLINE_INTRINSICS"
-    xFFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -OPT:cray_ivdep=TRUE"
-
-    if $CC -version | grep "Version 7.1" > /dev/null 2>&1; then
-      xCFLAGS="$xCFLAGS -GCM:aggressive_speculation -GCM:array_speculation" 
-      xFFLAGS="$xFFLAGS -GCM:aggressive_speculation -GCM:array_speculation" 
-    fi
-
-    if $CC -version | grep "Version 7.3" > /dev/null 2>&1; then
-      xCFLAGS="$xCFLAGS -SWP:heur=fdms,nhms,fdnms" 
-      xFFLAGS="$xFFLAGS -SWP:heur=fdms,nhms,fdnms" 
-    fi
-
-    case "${gmxcpu}" in
-      r12000*)
-       xCFLAGS="-n32 -r12000 -mips4 $xCFLAGS"
-       xFFLAGS="-n32 -r12000 -mips4 $xFFLAGS"
-       xLDFLAGS="-n32 -r12000 -mips4"
-       ;;
-      r10000*)
-       xCFLAGS="-n32 -r10000 -mips4 $xCFLAGS"
-       xFFLAGS="-n32 -r10000 -mips4 $xFFLAGS"
-       xLDFLAGS="-n32 -r10000 -mips4"
-       ;;
-      r8000*)
-       xCFLAGS="-n32 -r8000 -mips4 $xCFLAGS"
-       xFFLAGS="-n32 -r8000 -mips4 $xFFLAGS"
-       xLDFLAGS="-n32 -r8000 -mips4"
-       ;;
-      r5000*)
-       xCFLAGS="-n32 -r5000 -mips4 $xCFLAGS"
-       xFFLAGS="-n32 -r5000 -mips4 $xFFLAGS"
-       xLDFLAGS="-n32 -r5000 -mips4"
-       ;;
-      *)               
-       xCFLAGS="-n32 $xCFLAGS"
-       xFFLAGS="-n32 $xFFLAGS"
-       xLDFLAGS="-n32"
-       ;;
-    esac
-    ;;
-
-  alpha*-osf*)
-    case "${host_cpu}" in
-      alphaev*)
-        # extract the processor from cpu type (e.g. alphaev56 -> ev56)
-        evtype=`echo ${host_cpu} | sed 's/alpha//'`
-        xCFLAGS="-O5 -arch $evtype -tune $evtype -fast -unroll 2 -fp_reorder"
-        xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
-        xLDFLAGS="-O4"
-        ;;
-      *)
-       xCFLAGS="-O5 -arch host -tune host -fast -unroll 2 -fp_reorder"
-       xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
-       xLDFLAGS="-O4"
-       ;;
-    esac
-    ;;
-
-  alpha*-linux*)
-    case "${host_cpu}" in
-      alphaev*)
-       # extract the processor from cpu type (e.g. alphaev56 -> ev56)
-       evtype=`echo ${host_cpu} | sed 's/alpha//'`
-       tmpCFLAGS="-O5 -arch $evtype -tune $evtype -fast -unroll 2 -fp_reorder"
-       tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
-       tmpLDFLAGS="-O4"
-       ;;
-      *)
-       tmpCFLAGS="-O5 -arch host -tune host -fast -unroll 2 -fp_reorder"
-       tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
-       tmpLDFLAGS="-O4"
-       ;;
-    esac
-    if $CC -V 2>  /dev/null | grep Compaq > /dev/null 2>&1; then
-      xCFLAGS="$tmpCFLAGS"
-      cc_vendor="Compaq"
-    fi
-    if test "$enable_fortran" = "yes"; then
-      if $F77 -V 2>  /dev/null | grep Compaq > /dev/null 2>&1; then
-        xFFLAGS="$tmpFFLAGS"
-      fi
-    fi
-    ;;
-
-  *-*)
-    # most of these systems (e.g. linux, FreeBSD) use gcc which is treated
-    # further down, but we can at least check if the Portland compilers are used:
-    if $CC -V 2>  /dev/null | grep Portland > /dev/null 2>&1; then
-      case "${host_cpu}" in
-       i586)
-         pgiopt="-tp p5" 
-          ;;
-       i686)
-         pgiopt="-tp p6" 
-         ;;
-      esac
-      xCFLAGS="$pgiopt -fast -Minfo=loop -pc 32"
-    fi
-    if test "$enable_fortran" = "yes"; then
-      if $F77 -V 2>  /dev/null | grep Portland > /dev/null 2>&1; then
-       xFFLAGS="$xCFLAGS -Mneginfo=loop"
-      fi       
-    fi
-    ;;
-esac   
-# Phew, end of all those operating systems and processors!                     
-
-# use default flags for gcc/g77 on all systems
-if test $ac_cv_prog_gcc = yes; then
-  xCFLAGS="-O6 -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
-  # -malign-double for x86 systems
-  
-
-echo $ac_n "checking whether $CC accepts -malign-double""... $ac_c" 1>&6
-echo "configure:7246: checking whether $CC accepts -malign-double" >&5
-if eval "test \"`echo '$''{'ac_align_double'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC -malign-double -c conftest.c 2>&1`"; then
-       ac_align_double=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
 else
-       ac_align_double=no
+  rm -rf conftest*
+  ac_cv_header_stdc=no
 fi
 rm -f conftest*
 
 fi
 
-echo "$ac_t""$ac_align_double" 1>&6
-if test "$ac_align_double" = yes; then
-       :
-       xCFLAGS="$xCFLAGS -malign-double"
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
 else
-       :
-       
-fi
+  cat > conftest.$ac_ext <<EOF
+#line 7349 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
 
+EOF
+if { (eval echo configure:7360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
 fi
-  
-if test $enable_fortran = yes; then
-  if test $ac_cv_prog_g77 = yes; then
-    xFFLAGS="-O3 -ffast-math -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
-    # -malign-double for f77 on x86 systems - haven't checked that this works yet.
-    #ACX_CHECK_F77_FLAGS(-malign-double,align_double,xFFLAGS="$xFFLAGS -malign-double")
-  fi
+rm -fr conftest*
 fi
 
-CPU_FLAGS=""
+fi
+fi
 
-if test "$GCC" = "yes"; then
-  
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
 
-if true; then
-  GNU_CC_TRUE=
-  GNU_CC_FALSE='#'
-else
-  GNU_CC_TRUE='#'
-  GNU_CC_FALSE=
 fi
-  # try to guess correct CPU flags, at least for linux
-  case "${host_cpu}" in
-    # i586/i686 cpu flags don't improve speed, thus no need to use them.
-    # don't check f77 separately - we assume f77 and gcc are similar
-         
-    powerpc*)
-      cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
-      is60x=`echo $cputype | egrep "^600-9e?$"`
-      if test -n "$is60x"; then
-       
 
-echo $ac_n "checking whether $CC accepts -mcpu=$cputype""... $ac_c" 1>&6
-echo "configure:7303: checking whether $CC accepts -mcpu=$cputype" >&5
-if eval "test \"`echo '$''{'ac_m_cpu_60x'+set}'`\" = set"; then
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:7384: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC -mcpu=$cputype -c conftest.c 2>&1`"; then
-       ac_m_cpu_60x=yes
+  cat > conftest.$ac_ext <<EOF
+#line 7389 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
 else
-       ac_m_cpu_60x=no
+  rm -rf conftest*
+  ac_cv_type_size_t=no
 fi
 rm -f conftest*
 
 fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+  cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
 
-echo "$ac_t""$ac_m_cpu_60x" 1>&6
-if test "$ac_m_cpu_60x" = yes; then
-       :
-       CPU_FLAGS=-mcpu=$cputype
-else
-       :
-       
 fi
 
-      elif test "$cputype" = 750; then
-        
-
-echo $ac_n "checking whether $CC accepts -mcpu=750""... $ac_c" 1>&6
-echo "configure:7330: checking whether $CC accepts -mcpu=750" >&5
-if eval "test \"`echo '$''{'ac_m_cpu_750'+set}'`\" = set"; then
+echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
+echo "configure:7417: checking whether struct tm is in sys/time.h or time.h" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC -mcpu=750 -c conftest.c 2>&1`"; then
-       ac_m_cpu_750=yes
+  cat > conftest.$ac_ext <<EOF
+#line 7422 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <time.h>
+int main() {
+struct tm *tp; tp->tm_sec;
+; return 0; }
+EOF
+if { (eval echo configure:7430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_struct_tm=time.h
 else
-       ac_m_cpu_750=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_struct_tm=sys/time.h
 fi
 rm -f conftest*
-
 fi
 
-echo "$ac_t""$ac_m_cpu_750" 1>&6
-if test "$ac_m_cpu_750" = yes; then
-       :
-       CPU_FLAGS=-mcpu=750
-else
-       :
-       
-fi
+echo "$ac_t""$ac_cv_struct_tm" 1>&6
+if test $ac_cv_struct_tm = sys/time.h; then
+  cat >> confdefs.h <<\EOF
+#define TM_IN_SYS_TIME 1
+EOF
 
-      fi
-      if test -z "$CPU_FLAGS"; then
-        
+fi
 
-echo $ac_n "checking whether $CC accepts -mcpu=powerpc""... $ac_c" 1>&6
-echo "configure:7358: checking whether $CC accepts -mcpu=powerpc" >&5
-if eval "test \"`echo '$''{'ac_m_cpu_powerpc'+set}'`\" = set"; then
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:7451: checking for uid_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC -mcpu=powerpc -c conftest.c 2>&1`"; then
-       ac_m_cpu_powerpc=yes
+  cat > conftest.$ac_ext <<EOF
+#line 7456 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "uid_t" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_uid_t=yes
 else
-       ac_m_cpu_powerpc=no
+  rm -rf conftest*
+  ac_cv_type_uid_t=no
 fi
 rm -f conftest*
 
 fi
 
-echo "$ac_t""$ac_m_cpu_powerpc" 1>&6
-if test "$ac_m_cpu_powerpc" = yes; then
-       :
-       CPU_FLAGS=-mcpu=powerpc
-else
-       :
-       
-fi
+echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+if test $ac_cv_type_uid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define uid_t int
+EOF
 
-      fi
-      if test -z "$CPU_FLAGS"; then
-       
+  cat >> confdefs.h <<\EOF
+#define gid_t int
+EOF
 
-echo $ac_n "checking whether $CC accepts -mpowerpc""... $ac_c" 1>&6
-echo "configure:7386: checking whether $CC accepts -mpowerpc" >&5
-if eval "test \"`echo '$''{'ac_m_powerpc'+set}'`\" = set"; then
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:7485: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC -mpowerpc -c conftest.c 2>&1`"; then
-       ac_m_powerpc=yes
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat > conftest.$ac_ext <<EOF
+#line 7492 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:7499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_inline=$ac_kw; break
 else
-       ac_m_powerpc=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+  inline | yes) ;;
+  no) cat >> confdefs.h <<\EOF
+#define inline 
+EOF
+ ;;
+  *)  cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+    
+
+
+
+
+
+
+
+
+
+
+
+########################################################################
+# Process vectorization and prefetch options for inner loops
+########################################################################
+# check which loops to vectorize
+list_of_vectorized_sqrt=""
+if test "$enable_vectorized_sqrt" != "no"; then
+  if test "$enable_vectorized_sqrt" = "yes" -o "$enable_vectorized_sqrt" = "all" ; then
+    enable_vectorized_sqrt="normal,solvent,water,water-water"
+  fi
+  if echo $enable_vectorized_sqrt | grep "normal" >/dev/null; then
+    list_of_vectorized_sqrt="normal "
+    cat >> confdefs.h <<\EOF
+#define VECTORIZE_INVSQRT 
+EOF
+
+  fi
+  if echo $enable_vectorized_sqrt | grep "solvent" >/dev/null; then
+    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}solvent "
+    cat >> confdefs.h <<\EOF
+#define VECTORIZE_INVSQRT_S 
+EOF
+
+  fi
+  if echo $enable_vectorized_sqrt | sed 's/water-water//' | grep "water" >/dev/null; then
+    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water "
+    cat >> confdefs.h <<\EOF
+#define VECTORIZE_INVSQRT_W 
+EOF
 
-fi
+  fi
+  if echo $enable_vectorized_sqrt | grep "water-water" >/dev/null; then
+    list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water-water "
+    cat >> confdefs.h <<\EOF
+#define VECTORIZE_INVSQRT_WW 
+EOF
 
-echo "$ac_t""$ac_m_powerpc" 1>&6
-if test "$ac_m_powerpc" = yes; then
-       :
-       CPU_FLAGS=-mpowerpc
-else
-       :
-       
+  fi
+fi
+if test -z "$list_of_vectorized_sqrt"; then
+  list_of_vectorized_sqrt="no"
 fi
 
-      fi
-   esac
-else
-  
 
-if false; then
-  GNU_CC_TRUE=
-  GNU_CC_FALSE='#'
-else
-  GNU_CC_TRUE='#'
-  GNU_CC_FALSE=
-fi
-fi
+# check loops to prefetch coordinates in
+list_of_prefetch_x=""
+if test "$enable_prefetch_x" != "no"; then
+  if test "$enable_prefetch_x" = "yes" -o "$enable_prefetch_x" = "all"; then
+    enable_prefetch_x="normal,solvent,water,water-water"
+  fi
+  if echo $enable_prefetch_x | grep "normal" >/dev/null; then
+    list_of_prefetch_x="normal "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_X 
+EOF
 
-if test -n "$CPU_FLAGS"; then
-  xCFLAGS="$xCFLAGS $CPU_FLAGS"
-  xFFLAGS="$xFFLAGS $CPU_FLAGS"
-fi
+  fi
+  if echo $enable_prefetch_x | grep "solvent" >/dev/null; then
+    list_of_prefetch_x="${list_of_prefetch_x}solvent "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_X_S 
+EOF
 
-# Now check if the user provided anything special for C or fortran...
-# Not nice to have checked everything then, but otherwise we would have
-# to use entirely separate checks for C and fortran flags, doubling the code.
-if test "$ac_test_CFLAGS" != "set"; then
-  CFLAGS="$xCFLAGS"
-  # Use the extra link optimization flags on e.g. irix only when
-  # we are using our own C compiler flags
-  LDFLAGS="$LDFLAGS $xLDFLAGS"
-  
-  if test -z "$CFLAGS"; then
-    echo "*******************************************************************"
-    echo "* WARNING: No special optimization settings found for the C       *"
-    echo "* compiler. Use  make CFLAGS=..., or edit the top level Makefile. *"
-    echo "* Reverting to the default setting CFLAGS=-O3. (mail us about it!)*"
-    echo "*******************************************************************"
-    CFLAGS="-O3"
   fi
-  
+  if echo $enable_prefetch_x | sed 's/water-water//' | grep "water" >/dev/null; then
+    list_of_prefetch_x="${list_of_prefetch_x}water "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_X_W 
+EOF
 
-echo $ac_n "checking whether $CC accepts ${CFLAGS}""... $ac_c" 1>&6
-echo "configure:7448: checking whether $CC accepts ${CFLAGS}" >&5
-if eval "test \"`echo '$''{'ac_guessed_cflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`$CC ${CFLAGS} -c conftest.c 2>&1`"; then
-       ac_guessed_cflags=yes
-else
-       ac_guessed_cflags=no
-fi
-rm -f conftest*
+  fi
+  if echo $enable_prefetch_x | grep "water-water" >/dev/null; then
+    list_of_prefetch_x="${list_of_prefetch_x}water-water "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_X_WW 
+EOF
 
+  fi
 fi
-
-echo "$ac_t""$ac_guessed_cflags" 1>&6
-if test "$ac_guessed_cflags" = yes; then
-       :
-       
-else
-       :
-       
-    echo "*******************************************************************"
-    echo "* Sorry, these optimization settings don't seem to work for       *"
-    echo "* your C compiler. Use make CFLAGS=..., or edit the top Makefile. *"
-    echo "*******************************************************************"
-    CFLAGS=""
-  
+if test -z "$list_of_prefetch_x"; then
+  list_of_prefetch_x="no"
 fi
 
-else
-  echo "******************************************"
-  echo "* Using CFLAGS from environment variable *"
-  echo "******************************************"
-fi
 
-if test "$enable_fortran" = "yes"; then        
-  if test "$ac_test_FFLAGS" != "set"; then
-    FFLAGS="$xFFLAGS"
-    if test -z "$FFLAGS"; then
-      echo "*******************************************************************"
-      echo "* WARNING: No special optimization settings found for the fortran *"
-      echo "* compiler. Use  make FFLAGS=..., or edit the top level Makefile. *"
-      echo "* Reverting to the default setting FFLAGS=-O3. (mail us about it!)*"
-      echo "*******************************************************************"
-      FFLAGS="-O3"
-    fi
-    
+# check loops to prefetch forces in
+list_of_prefetch_f=""
+if test "$enable_prefetch_f" != "no"; then
+  if test "$enable_prefetch_f" = "yes" -o "$enable_prefetch_f" = "all"; then
+    enable_prefetch_f="normal,solvent,water,water-water"
+  fi
+  if echo $enable_prefetch_f | grep "normal" >/dev/null; then
+    list_of_prefetch_f="normal "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_F 
+EOF
 
-echo $ac_n "checking whether $F77 accepts ${FFLAGS}""... $ac_c" 1>&6
-echo "configure:7497: checking whether $F77 accepts ${FFLAGS}" >&5
-if eval "test \"`echo '$''{'ac_guessed_fflags'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.f << EOF
-      subroutine f
-      return 
-      end
+  fi
+  if echo $enable_prefetch_f | grep "solvent" >/dev/null; then
+    list_of_prefetch_f="${list_of_prefetch_f}solvent "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_F_S 
 EOF
-if test -z "`$F77 ${FFLAGS} -c conftest.f `"; then
-       ac_guessed_fflags=yes
-else
-       ac_guessed_fflags=no
-fi
-rm -f conftest*
 
-fi
+  fi
+  if echo $enable_prefetch_f | sed 's/water-water//' | grep "water"; then
+    list_of_prefetch_f="${list_of_prefetch_f}water "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_F_W 
+EOF
 
-echo "$ac_t""$ac_guessed_fflags" 1>&6
-if test "$ac_guessed_fflags" = yes; then
-       :
-       
-else
-       :
-       
-      echo "*******************************************************************"
-      echo "* Sorry, these optimization settings don't seem to work for       *"
-      echo "* your f77 compiler. Use make FFLAGS=.., or edit the top Makefile.*"
-      echo "*******************************************************************"
-      FFLAGS=""
-    
-fi
+  fi
+  if echo $enable_prefetch_f | grep "water-water" >/dev/null; then
+    list_of_prefetch_f="${list_of_prefetch_f}water-water "
+    cat >> confdefs.h <<\EOF
+#define PREFETCH_F_WW 
+EOF
 
-  else
-    echo "******************************************"
-    echo "* Using FFLAGS from environment variable *"
-    echo "******************************************"
   fi
 fi
-  
+if test -z "$list_of_prefetch_f"; then
+  list_of_prefetch_f="no"
+fi
 
-          # should be automatic, but doesnt seem to be?
 
 
 
@@ -7542,66 +7661,60 @@ fi
 
 
 
-# put binaries and libraries in subdirectories named as the arch
-if test -n "$gmxcpu"; then
-  bindir="\${exec_prefix}/bin/${host}/${gmxcpu}"
-  libdir="\${exec_prefix}/lib/${host}/${gmxcpu}"
-else
-  bindir="\${exec_prefix}/bin/${host}"
-  libdir="\${exec_prefix}/lib/${host}"
-fi
+########################################################################
+# Final output stage
+########################################################################
+ASFLAGS="$ASFLAGS $CFLAGS"
+AS="$CC"
 
 
+          # should be automatic, but doesnt seem to be?
 
 
 
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
+# To tell libraries apart, we use four versions of the name. For instance, libgmx:
+# libgmx               single prec, no mpi.
+# libgmx_d             double prec, no mpi.
+# libgmx_mpi           single prec, mpi.
+# libgmx_mpi_d         double prec, mpi.
+# However, the non-suffixed names are linked to the _mpi and/or _d suffixed
+# ones upon installation if that is the only version available.
+
+if test "$enable_mpi" = "yes"; then
+  LIBSUFFIX="_mpi"
+fi
+if test "$enable_float" = "no"; then
+  LIBSUFFIX="${LIBSUFFIX}_d"
+fi
+
+# Unless the user has explicitly requested a prefix/suffix/transform, we
+# use _d on double precision files. Don't add anything for mpi, but at the
+# end we tell the user it is possible and smart to do in some cases!
+if test "$program_transform_name" = "s,x,x,"; then
+  name_transform_provided=no;
+  if test "$enable_float" = "no"; then
+    program_transform_name="s,\$\$,_d,"
+  fi
 else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+  name_transform_provided=yes;
+fi
+
+# put binaries and libraries in subdirectories named as the arch and cpu
+if test "$enable_arch_subdirs" = "yes"; then
+  if test -n "$gmxcpu"; then
+    bindir="${bindir}/${host}/${gmxcpu}"
+    libdir="${libdir}/${host}/${gmxcpu}"
   else
-    echo "not updating unwritable cache $cache_file"
+    bindir="${bindir}/${host}"
+    libdir="${libdir}/${host}"
   fi
 fi
-rm -f confcache
+
+
+
+
+trap '' 1 2 15
 
 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
 
@@ -7656,33 +7769,15 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile
-                 src/Makefile
-                 src/gmxlib/Makefile
-                 src/mdlib/Makefile
-                 src/kernel/Makefile
-                 src/tools/Makefile
-                 src/ngmx/Makefile
-                src/contrib/Makefile
-                 include/Makefile
-                include/types/Makefile
-                 scripts/Makefile
-                admin/Makefile
-                 share/Makefile
-                share/tutor/Makefile
-                share/tutor/gmxdemo/Makefile
-                share/tutor/nmr1/Makefile
-                share/tutor/nmr2/Makefile
-                share/tutor/water/Makefile
-                share/tutor/speptide/Makefile
-                share/template/Makefile
-                share/template/Template.mak
-                share/top/Makefile
-                share/html/Makefile
-                 share/html/images/Makefile
-                 share/html/online/Makefile
-                 man/Makefile
-                 man/man1/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile include/Makefile include/types/Makefile src/Makefile
+           src/gmxlib/Makefile src/mdlib/Makefile src/kernel/Makefile
+           src/tools/Makefile src/ngmx/Makefile src/contrib/Makefile
+           scripts/Makefile admin/Makefile share/Makefile share/tutor/Makefile
+           share/tutor/gmxdemo/Makefile share/tutor/nmr1/Makefile
+          share/tutor/nmr2/Makefile share/tutor/water/Makefile
+          share/tutor/speptide/Makefile share/template/Makefile
+          share/top/Makefile share/html/Makefile share/html/images/Makefile
+           share/html/online/Makefile man/Makefile man/man1/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -7724,7 +7819,16 @@ s%@AUTOCONF@%$AUTOCONF%g
 s%@AUTOMAKE@%$AUTOMAKE%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
+s%@AMTAR@%$AMTAR%g
+s%@install_sh@%$install_sh%g
+s%@INSTALL_STRIP_PROGRAM@%$INSTALL_STRIP_PROGRAM%g
+s%@AWK@%$AWK%g
 s%@SET_MAKE@%$SET_MAKE%g
+s%@AMDEP_TRUE@%$AMDEP_TRUE%g
+s%@AMDEP_FALSE@%$AMDEP_FALSE%g
+s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%g
+s%@DEPDIR@%$DEPDIR%g
+s%@SHARED_VERSION_INFO@%$SHARED_VERSION_INFO%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
@@ -7733,44 +7837,39 @@ s%@host_os@%$host_os%g
 s%@F77@%$F77%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
-s%@BUILD_CC@%$BUILD_CC%g
-s%@FLIBS@%$FLIBS%g
+s%@_am_include@%$_am_include%g
+s%@_am_quote@%$_am_quote%g
+s%@CCDEPMODE@%$CCDEPMODE%g
+s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
 s%@MPICC@%$MPICC%g
-s%@USE_MPI_TRUE@%$USE_MPI_TRUE%g
-s%@USE_MPI_FALSE@%$USE_MPI_FALSE%g
+s%@FLIBS@%$FLIBS%g
+s%@GNU_CC_TRUE@%$GNU_CC_TRUE%g
+s%@GNU_CC_FALSE@%$GNU_CC_FALSE%g
 s%@IDENT@%$IDENT%g
-s%@LN_S@%$LN_S%g
 s%@build@%$build%g
 s%@build_alias@%$build_alias%g
 s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
+s%@LN_S@%$LN_S%g
 s%@OBJEXT@%$OBJEXT%g
 s%@EXEEXT@%$EXEEXT%g
 s%@RANLIB@%$RANLIB%g
 s%@STRIP@%$STRIP%g
 s%@LIBTOOL@%$LIBTOOL%g
-s%@GMX_USE_XDR_TRUE@%$GMX_USE_XDR_TRUE%g
-s%@GMX_USE_XDR_FALSE@%$GMX_USE_XDR_FALSE%g
+s%@LIBOBJS@%$LIBOBJS%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
-s%@LIBOBJS@%$LIBOBJS%g
 s%@USE_X11_TRUE@%$USE_X11_TRUE%g
 s%@USE_X11_FALSE@%$USE_X11_FALSE%g
-s%@USE_FORTRAN_TRUE@%$USE_FORTRAN_TRUE%g
-s%@USE_FORTRAN_FALSE@%$USE_FORTRAN_FALSE%g
-s%@USE_DOUBLE_TRUE@%$USE_DOUBLE_TRUE%g
-s%@USE_DOUBLE_FALSE@%$USE_DOUBLE_FALSE%g
-s%@GNU_CC_TRUE@%$GNU_CC_TRUE%g
-s%@GNU_CC_FALSE@%$GNU_CC_FALSE%g
+s%@ASFLAGS@%$ASFLAGS%g
+s%@AS@%$AS%g
 s%@INCLUDES@%$INCLUDES%g
-s%@GMXLIB_COND_OBJ@%$GMXLIB_COND_OBJ%g
-s%@MDLIB_COND_OBJ@%$MDLIB_COND_OBJ%g
-s=XXX_SUFFIX_XXX=$SUFFIX=g
-s%@SUFFIX@%$SUFFIX%g
-s%@SHARED_VERSION_INFO@%$SHARED_VERSION_INFO%g
+s%@GMXLIB_LIBOBJS@%$GMXLIB_LIBOBJS%g
+s%@MDLIB_LIBOBJS@%$MDLIB_LIBOBJS%g
+s%@LIBSUFFIX@%$LIBSUFFIX%g
 
 CEOF
 EOF
@@ -7812,33 +7911,15 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile
-                 src/Makefile
-                 src/gmxlib/Makefile
-                 src/mdlib/Makefile
-                 src/kernel/Makefile
-                 src/tools/Makefile
-                 src/ngmx/Makefile
-                src/contrib/Makefile
-                 include/Makefile
-                include/types/Makefile
-                 scripts/Makefile
-                admin/Makefile
-                 share/Makefile
-                share/tutor/Makefile
-                share/tutor/gmxdemo/Makefile
-                share/tutor/nmr1/Makefile
-                share/tutor/nmr2/Makefile
-                share/tutor/water/Makefile
-                share/tutor/speptide/Makefile
-                share/template/Makefile
-                share/template/Template.mak
-                share/top/Makefile
-                share/html/Makefile
-                 share/html/images/Makefile
-                 share/html/online/Makefile
-                 man/Makefile
-                 man/man1/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile include/Makefile include/types/Makefile src/Makefile
+           src/gmxlib/Makefile src/mdlib/Makefile src/kernel/Makefile
+           src/tools/Makefile src/ngmx/Makefile src/contrib/Makefile
+           scripts/Makefile admin/Makefile share/Makefile share/tutor/Makefile
+           share/tutor/gmxdemo/Makefile share/tutor/nmr1/Makefile
+          share/tutor/nmr2/Makefile share/tutor/water/Makefile
+          share/tutor/speptide/Makefile share/template/Makefile
+          share/top/Makefile share/html/Makefile share/html/images/Makefile
+           share/html/online/Makefile man/Makefile man/man1/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -8006,11 +8087,60 @@ fi; done
 
 EOF
 cat >> $CONFIG_STATUS <<EOF
-
+am_indx=1
+  for am_file in include/config.h; do
+    case " $CONFIG_HEADERS " in
+    *" $am_file "*)
+      echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
+      ;;
+    esac
+    am_indx=\`expr \$am_indx + 1\`
+  done
+AMDEP_TRUE="$AMDEP_TRUE"
+ac_aux_dir="$ac_aux_dir"
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > include/stamp-h
+test -z "$CONFIG_HEADERS" || echo timestamp >     include/stamp-h
+
+test x"$AMDEP_TRUE" != x"" ||
+for mf in $CONFIG_FILES; do
+  case "$mf" in
+  Makefile) dirpart=.;;
+  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+  *) continue;;
+  esac
+  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+       s/\\\\$//
+       p
+       n
+       /\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+
 
 exit 0
 EOF
@@ -8019,40 +8149,53 @@ rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
+
+
+
+
+
+
+
+#########################################################
+# Print the most important options, to avoid stupid mistakes
+#
+
 echo ""
 echo "GROMACS is ready to compile. Summary of main options:"
-echo "Architecture                  : $host"
-if test "$enable_cpu_detection" = "yes"; then
-if test -n "$gmxcpu"; then
-echo "Optimize for CPU              : $gmxcpu"
+if test "$enable_cpu_detection" = "yes" -a -n "$gmxcpu"; then
+  echo "Architecture                  : $host / CPU $gmxcpu"
 else
-echo "(Extra CPU detection not necessary or unavailable on this host)" 
+  echo "Architecture                  : $host"
 fi
-fi
-echo "Vector architecture           : $enable_vector"
+if test "$enable_mpi" = "yes" -a "$with_mpi_environment" != "no"; then
+echo "MPI parallelization           : yes, when $with_mpi_environment is set"
+else
 echo "MPI parallelization           : $enable_mpi"
-if test "$enable_mpi" = "yes"; then
-echo "Checking MPI environment      : $with_mpi_environment"
-echo "MPI suffix on files           : $enable_mpi_suffix"
 fi
 echo "Using Fortran code            : $enable_fortran"
-echo "Single precision              : $enable_float"
 if test "$enable_float" = "no"; then
-echo "Suffix on double prec. files  : $enable_type_suffix"
+  echo "Precision                     : double"
+  if test "$name_transform_provided" = "no"; then
+    echo "(Program names will be suffixed with _d, override with --program-suffix)"
+  fi
+else
+  echo "Precision                     : single"
 fi
-echo "Automatically nice mdrun      : $enable_nice"
-echo "Using x86 SSE/3DNow assembly  : $enable_x86_asm"
-echo "Software 1/x                  : $enable_softwarerecip"
-echo "Software 1/sqrt(x)            : $enable_softwaresqrt"
+case "${host_cpu}" in
+   i?86) echo "Using x86 assembly            : $enable_x86_asm" ;;     
+   *) ;;
+esac
+echo "Software 1/x                  : $enable_software_recip"
+echo "Software 1/sqrt(x)            : $enable_software_sqrt"
 echo "Vectorize 1/x                 : $enable_vectorized_recip"
 echo "Vectorize 1/sqrt(x)           : $list_of_vectorized_sqrt"
 echo "Prefetch coordinates in loops : $list_of_prefetch_x"
 echo "Prefetch forces in loops      : $list_of_prefetch_f"
-echo "X11 support                   : $use_x11"
 echo "Motif support                 : $use_motif"
-echo ""
-echo "GROMACS will be installed under $prefix"
-echo "Make sure to update your PATH and MANPATH to find the"
-echo "programs and unix manual pages, and possibly LD_LIBRARY_PATH"
-echo "or /etc/ld.so.conf if you are using dynamic libraries"
-
+if test "$name_transform_provided" = "no" -a "$enable_mpi" = "yes"; then
+  echo ""
+  echo "You can install MPI programs with suffixed names to have both MPI and non-MPI"
+  echo "versions. It is useful when you need a charge queue to run MPI-linked programs."
+  echo "Set a suffix with --program-suffix=_mpi (or _mpi_d for double). In that case"
+  echo "you only need MPI for mdrun, so you can issue make mdrun; make mdrun-install."
+fi
index 31fb13b50923e6c739abfb28810602625d47535c..c574de297eea5d53703e65b4703a10949acedac3 100644 (file)
 #######################################################################
 # Process this file wth autoconf to produce a configure script.
 #######################################################################
+
+# Disable caching to avoid stupid mistakes 
+define([AC_CACHE_LOAD], )
+define([AC_CACHE_SAVE], )
+
 AC_INIT(src/gmxlib/3dview.c)
 AC_PREREQ(2.13)
 AC_CONFIG_AUX_DIR(config)
 AM_INIT_AUTOMAKE(gromacs, 3.0)
+AC_PREFIX_DEFAULT(/usr/local/gromacs)
+AM_CONFIG_HEADER(include/config.h)
 dnl This is the version info according to the libtool versioning system.
 dnl It does *not* correspond to the release number.
 SHARED_VERSION_INFO="1:0:0"
-AC_PREFIX_DEFAULT(/usr/local/gromacs)
-AM_CONFIG_HEADER(include/config.h)
-
-#######################################################################
-# User options
-#######################################################################
-
-#####
-
-AC_ARG_ENABLE(mpi,     
- [  --enable-mpi                  Compile parallel version of GROMACS], 
- enable_mpi=$enableval, enable_mpi=no)
-
-
-#####
-
-AC_ARG_ENABLE(vector,     
- [  --enable-vector               Compile for a vector machine], 
- enable_vector=$enableval, enable_vector=no)
+AC_SUBST(SHARED_VERSION_INFO)
 
+AC_CANONICAL_HOST
 
-#####
 
-AC_ARG_ENABLE(fortran, 
- [  --enable-fortran              Fortran loops (default on sgi,ibm,sun,axp)], 
- enable_fortran=$enableval,enable_fortran=check)
 
 
-#####
 
-AC_ARG_ENABLE(float,  
- [  --enable-float                Compile single precision GROMACS], 
- enable_float=$enableval, enable_float=yes)
 
 
-#####
 
-AC_ARG_ENABLE(type-suffix,     
- [  --disable-type-suffix         Don't add a suffix to double precision files], 
- enable_type_suffix=$enableval, enable_type_suffix=yes)
 
+#######################################################################
+# Simple options and makefile variables
+#######################################################################
 
-#####
 
-AC_ARG_ENABLE(mpi-suffix,     
- [  --enable-mpi-suffix           Add a suffix to MPI files (default on ibm)], 
- enable_mpi_suffix=$enableval, enable_mpi_suffix=check)
+### Single/Double
+AC_ARG_ENABLE(float,
+ [  --disable-float               use double instead of single precision],, enable_float=yes)
+if test "enable_float" = "no"; then
+  AC_DEFINE(DOUBLE,,[Compile in double precision])
+fi
 
-#####
+### Fortran or not
+AC_ARG_ENABLE(fortran,
+ [  --enable-fortran              use fortran (default on sgi,ibm,sun,axp)],, 
+[case "${host_cpu}-${host_os}" in
+  sparc*-solaris* | alpha*-* | rs6000*-aix* | powerpc*-aix* | mips*-irix*) enable_fortran=yes ;;
+  *) enable_fortran=no ;;
+ esac])
+if test "$enable_fortran" = "yes"; then
+  AC_DEFINE(USE_FORTRAN,,[Use Fortran for innerloops and some other core stuff])
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerf.lo f77_wrappers.lo"
+  if test "$enable_float" = "yes"; then
+    MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincs.lo fsettle.lo fshake.lo"
+  else
+    MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincsd.lo fsettled.lo fshaked.lo"
+  fi
+else
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerc.lo"
+  MDLIB_LIBOBJS="${MDLIB_LIBOBJS} clincs.lo csettle.lo cshake.lo"
+fi
 
-AC_ARG_ENABLE(simplewater,     
- [  --enable-simplewater          Unroll water innerloops (default on sgi)], 
- enable_simplewater=$enableval, enable_simplewater=check)
 
+### MPI or not
+AC_ARG_ENABLE(mpi,
+ [  --enable-mpi                  compile for parallel runs using MPI],,enable_mpi=no)
 
-#####
-AC_ARG_ENABLE(waterwater-loops,     
- [  --disable-waterwater-loops    No special water-water loops (default on sgi)], 
- enable_waterwater_loops=$enableval, enable_waterwater_loops=check)
 
+### MPI environment
+AC_ARG_WITH(mpi-environment,
+ [  --with-mpi-environment=VAR    only start parallel runs when VAR is set],,
+[case "${host_cpu}" in
+  mips*-irix*) with_mpi_environment="MPI_ENVIRONMENT" ;;
+  *) with_mpi_environment=no ;;
+esac])
+if test "$with_mpi_environment" != "no"; then
+  AC_DEFINE_UNQUOTED(CHECK_MPI_ENV,"$with_mpi_environment",[If defined, only start MPI runs when this variable is set])
+fi
 
-#####
 
+### Automatic nicing of programs
 AC_ARG_ENABLE(nice,
- [  --disable-nice                Disable the nice priority on mdrun], 
- enable_nice=$enableval, enable_nice=yes)
+ [  --disable-nice                disable the nice priority on programs],, enable_nice=yes)
+if test "$enable_nice" = "no"; then
+  AC_DEFINE(NO_NICE,,[Turn off the automatic nicing of GROMACS])
+fi
 
 
-#####
-
+### X86 assembly code
 AC_ARG_ENABLE(x86_asm,     
- [  --disable-x86-asm             Disable assembly loops on x86], 
- enable_x86_asm=$enableval, enable_x86_asm=yes)
-
-
-#####
-
-AC_ARG_ENABLE(xdr,     
- [  --disable-xdr                 Disable portable trajectory routines], 
- enable_xdr=$enableval, enable_xdr=yes)
-
-
-#####
-
-AC_ARG_ENABLE(cpu-detection,     
- [  --disable-cpu-detection       Don't extend detection with exact cpu type], 
- enable_cpu_detection=$enableval, enable_cpu_detection=yes)
-
-
-#####
-
-AC_ARG_ENABLE(software-recip,     
-[  --enable-software-recip       Do software 1/x (might be slower)], 
- enable_softwarerecip=$enableval, enable_softwarerecip=no)
-
-
-#####
-
-AC_ARG_ENABLE(software-sqrt,     
-[  --disable-software-sqrt       No software 1/sqrt (default on sgi,rs6000)], 
- enable_softwaresqrt=$enableval, enable_softwaresqrt=check)
+ [  --disable-x86-asm             don't build assembly loops for x86],,enable_x86_asm=yes)
+case "${host_cpu}" in
+   i?86) ;;    
+   *) enable_x86_asm=no ;;
+esac
 
 
-#####
+### Optimize for host cpu version
+AC_ARG_ENABLE(cpu-optimization,     
+ [  --disable-cpu-optimization    no detection or tuning flags for cpu version],, enable_cpu_optimization=yes)
 
-AC_ARG_ENABLE(vectorized_recip,     
- [  --enable-vectorized-recip     Vectorize 1/x in LJ-only loops],
- enable_vectorized_recip=$enableval, enable_vectorized_recip=no)
 
+### Remove the arch/cpu subdirs in bin and lib
+AC_ARG_ENABLE(arch-subdirs,     
+ [  --disable-arch-subdirs        don't use subdirectories in bindir and libdir],, enable_arch_subdirs=yes)
 
-#####
 
-AC_ARG_ENABLE(vectorized_sqrt,     
- [  --enable-vectorized-sqrt=A,B  Loops to vectorize (default none)
-                                Choices: normal,solvent,water,water-water],
- enable_vectorized_sqrt=$enableval, enable_vectorized_sqrt=no)
+### Vector machine inner loops
+AC_ARG_ENABLE(vector,     
+ [  --enable-vector               create inner loops for a vector machine],, enable_vector=no)
+if test "$enable_vector" = "yes"; then
+  AC_DEFINE(USE_VECTOR,,[Optimize for a vector architecture])
+fi
 
 
-#####
-AC_ARG_ENABLE(prefetch_x,     
- [  --enable-prefetch-x=A,B       Prefetch coordinates in selected innerloops],
- enable_prefetch_x=$enableval, enable_prefetch_x=no)
+### Simplewater hack for SGI - disabled unrolling is the same as simplewater=yes
+AC_ARG_ENABLE(waterloop-unrolling,     
+ [  --disable-waterloop-unrolling expand water loops (hack for sgi)],, 
+[case "${host_cpu}-${host_os}" in
+  mips*-irix*) enable_waterloop_unrolling=yes ;;
+  *) enable_waterloop_unrolling=no ;;
+esac])
+if test "$enable_waterloops_unrolling" = "no"; then
+  AC_DEFINE(SIMPLEWATER,,[Expand the water loops to three inner loops])
+fi
 
 
-#####
-AC_ARG_ENABLE(prefetch_f,     
- [  --enable-prefetch-f=A,B       Prefetch forces in selected innerloops],
- enable_prefetch_f=$enableval, enable_prefetch_f=no)
+### Turn off the special water-water loops on SGI...
+AC_ARG_ENABLE(waterwater-loops,     
+ [  --disable-waterwater-loops    turn off double unrolled loops (hack for sgi)],,
+[case "${host_cpu}-${host_os}" in
+  mips*-irix*) enable_waterwater_loops=yes ;;
+  *) enable_waterwater_loops=no ;;
+esac])
+if test "$enable_waterwater_loops" = "no"; then
+  AC_DEFINE(DISABLE_WATERWATER_LOOPS,,[Don't use special loops for water-water interactions])
+fi
 
 
-#####
-AC_ARG_ENABLE(hide_square_latency,     
- [  --enable-hide-square-latency  Try to get coords to cache before using them],
- enable_hide_square_latency=$enableval, enable_hide_square_latency=no)
+### Do software 1/x
+AC_ARG_ENABLE(software-recip,     
+ [  --enable-software-recip       perform software 1/x],, enable_software_recip=no)
+if test "$enable_software_recip" = "yes"; then
+  AC_DEFINE(SOFTWARE_RECIP,,[Use the GROMACS software 1/x])
+fi
 
 
-#####
-AC_ARG_ENABLE(hide_table_latency,     
- [  --enable-hide-table-latency   Try to get table data to cache before using it],
- enable_hide_table_latency=$enableval, enable_hide_table_latency=no)
+### Do software 1/sqrt(x)
+AC_ARG_ENABLE(software-sqrt,     
+ [  --disable-software-sqrt       no software 1/sqrt (disabled on sgi,rs6000)],,
+[case "${host_cpu}-${host_os}" in
+  mips*-irix* | rs6000*-aix*) enable_software_sqrt=no ;;
+  *) enable_software_sqrt=yes ;;
+esac])
+if test "$enable_software_sqrt" = "yes"; then
+  AC_DEFINE(SOFTWARE_SQRT,,[Use the GROMACS software 1/sqrt(x)])
+fi
 
 
-#####
+### Vectorize 1/x
+AC_ARG_ENABLE(vectorized-recip,     
+ [  --enable-vectorized-recip     vectorize LJ-only inner loops],, enable_vectorized_recip=no)
+if test "$enable_vectorized_recip" = "yes"; then
+  AC_DEFINE(VECTORIZE_RECIP,,[Vectorize the reciprocal calculation])
+else 
+  if test "$enable_vectorized_recip" != "no"; then
+    AC_MSG_ERROR([Vectorized reciprocal is only meaningful for normal LJ-only loops])
+  fi
+fi
 
-AC_ARG_WITH(mpi-environment,     
- [  --with-mpi-environment=VAR    Only start MPI mdrun when VAR is set], 
- with_mpi_environment="$withval", with_mpi_environment=check)
+### Vectorize 1/sqrt(x)
+AC_ARG_ENABLE(vectorized-sqrt,     
+ [  --enable-vectorized-sqrt=A,B  vectorize selected inner loops (default none)
+                                choices: normal,solvent,water,water-water],, enable_vectorized_sqrt=not_selected)
+# processing of vectorized_sqrt choices is done just before the final output stage!
 
 
-########################################################################
-# Process the options
-########################################################################
+# The four options below used to improve code scheduling, but the newest CPUs can usually rearrange
+# instructions dynamically at runtime, so they might not make much difference now:
 
-AC_CANONICAL_HOST
+### Coordinate prefetching
+AC_ARG_ENABLE(prefetch-x,     
+ [  --enable-prefetch-x=A,B       prefetch coordinates in selected innerloops],, enable_prefetch_x=no)
+# processing of prefetch-x choices is done just before the final output stage!
 
-case "${host_cpu}" in
- i?86)  
-   x86=yes 
-   ;;  
- *)      
-   x86=false 
-   ;;
-esac
 
-if test "$enable_fortran" = "check"; then
-case "${host_cpu}-${host_os}" in
+### Force prefetching
+AC_ARG_ENABLE(prefetch-f,     
+ [  --enable-prefetch-f=A,B       prefetch forces in selected innerloops],, enable_prefetch_f=no)
+# processing of prefetch-f choices is done just before the final output stage!
 
-  sparc*-solaris* | alpha*-* | rs6000*-aix* | mips*-irix*)
-    enable_fortran=yes 
-    ;;
 
-  *)
-    enable_fortran=no 
-    ;;
- esac  
+### First load all coords in a water-water iteration, then square all pairs, then add the sums to get r2.
+AC_ARG_ENABLE(hide-square-latency,     
+ [  --enable-hide-square-latency  load coords to cache in advance],, enable_hide_square_latency=no)
+if test "$enable_hide_square_latency" = "yes"; then
+  AC_DEFINE(DECREASE_SQUARE_LATENCY,,[Try to get coordinates to cache before using them])
 fi
 
-if test "$enable_mpi_suffix" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-  rs6000*-aix* | powerpc*-aix*)
-    enable_mpi_suffix=yes
-    ;;
-  *)
-    enable_mpi_suffix=no 
-    ;;
- esac  
+### Do the table lookups for all interactions between two water molecules before using the results
+AC_ARG_ENABLE(hide-table-latency,     
+ [  --enable-hide-table-latency   load table data to cache in advance],, enable_hide_table_latency=no)
+if test "$enable_hide_table_latency" = "yes"; then
+  AC_DEFINE(DECREASE_LOOKUP_LATENCY,,[Try to get table data to cache before using it])
 fi
 
-if test "$enable_simplewater" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-  mips*-irix*)
-    enable_simplewater=yes 
-    ;;
 
-  *)
-    enable_simplewater=no 
-    ;;
-esac   
-fi
 
-if test "$enable_waterwater_loops" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-   mips*-irix*)
-     enable_waterwater_loops=no 
-     ;;
 
-   *)
-     enable_waterwater_loops=yes 
-     ;;
-esac
-fi
 
-if test "$enable_softwaresqrt" = "check"; then
-case "${host_cpu}-${host_os}" in
 
-  mips*-irix* | rs6000*-aix*)
-    enable_softwaresqrt=no 
-    ;;
 
-  *)
-    enable_softwaresqrt=yes 
-    ;;
-esac
-fi
 
-if [test "$with_mpi_environment" = "check" -a "$enable_mpi" = "yes"]; then
-case "${host_cpu}" in
-  mips*-irix*)
-    with_mpi_environment="MPI_ENVIRONMENT"
+############################################################
+# Checks for programs
+############################################################
+
+# normally we use the default compiler, but on alpha/linux we try the compaq ones first
+case "${host_cpu}-${host_os}" in
+  alpha*-linux*)
+    cc_names="ccc cc gcc"
+    f77_names="fort f77 g77"
     ;;
-   *)
-    with_mpi_environment=no
+  *) 
+    cc_names="cc xlc gcc"
+    f77_names="f77 xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
     ;;
 esac
-fi  
-
-case "${host_cpu}" in
- alpha*)  
-   AC_DEFINE(USE_AXP_ASM,,[Include Alpha AXP assembly for vectorized sqrt/invsqrt]) 
-   ;;  
- *)      
-   ;;
-esac
 
 if test "$enable_fortran" = "yes"; then
-  # vendor f77 before g77 - but special compiler list for alpha-linux
-  case "${host_cpu}-${host_os}" in
-    alpha*-linux*)
-      AC_CHECK_PROGS(F77, fort f77 g77)
-      ;;
-    *)   
-      AC_CHECK_PROGS(F77, f77 xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90)
-      ;;
-  esac
+  AC_CHECK_PROGS(F77, $f77_names)
   AC_PROG_F77
   if test -z "$F77"; then
     AC_MSG_ERROR([No fortran compiler found])
   fi
 fi
 
-case "${host_cpu}-${host_os}" in
-    alpha*-linux*)
-      AC_CHECK_PROGS(CC, ccc cc) # do vendor cc before gcc
-      ;;
-    *)   
-      AC_CHECK_PROG(CC, cc, cc) # do vendor cc before gcc
-      ;;
-esac
+# the (non-mpi) c compiler, which is also used for programs executed during build stage
+AC_CHECK_PROGS(CC, $cc_names)
 AC_PROG_CC
-AC_PROG_CPP
-BUILD_CC=$CC
-AC_SUBST(BUILD_CC)
-
-if test "$enable_fortran" = "yes"; then
-  AC_F77_LIBRARY_LDFLAGS  
-  ACX_F77_NAME_MANGLING
+# Check for environment variable CC_FOR_BUILD before overwriting it
+if test -z "$CC_FOR_BUILD"; then
+  CC_FOR_BUILD=$CC
 fi
+AC_SUBST(CC_FOR_BUILD) 
 
 # if we are using mpi, also get an MPICC. We cannot set that in the PROG_CC macro
 # above, since autoconf checks that the created file can be executed. This would
@@ -299,22 +256,35 @@ if test "$enable_mpi" = "yes"; then
   CC=$MPICC
   AC_MSG_CHECKING([whether the MPI cc command works]) # be paranoid
   AC_TRY_LINK([#include <mpi.h>],[int argc; char **argv; MPI_Init(&argc,&argv);],
-               AC_MSG_RESULT([yes]),
-               AC_MSG_ERROR([Cannot compile and link MPI code with $CC]))
-  AM_CONDITIONAL(USE_MPI,true)
+    AC_MSG_RESULT([yes]),AC_MSG_ERROR([Cannot compile and link MPI code with $CC]))
+  AC_DEFINE(USE_MPI,,[Make a parallel version of GROMACS using MPI])
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} mpiio.lo" 
+else
+  GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} libnet.lo" 
+fi
+
+if test "$enable_fortran" = "yes"; then
+  AC_F77_LIBRARY_LDFLAGS  
+  ACX_F77_NAME_MANGLING  
+fi
+
+AC_PROG_CPP
+
+if test "$enable_cpu_tuning" = "yes"; then
+  ACX_DETECT_GMXCPU
 else
-  AM_CONDITIONAL(USE_MPI,false)
-fi
-
-# A rather complicated check for the capabilities of as, to make
-# sure we can compile the assembly innerloops.
-if test "$x86" = "yes"; then
-  if [ test "$enable_x86_asm" = "yes"]; then
-    if test "$enable_float" = "no"; then
-      AC_MSG_WARN([The assembly loops can only be used in single precision - disabling])
-      enable_x86_asm=no
-    else 
-      AC_MSG_CHECKING([whether as fully supports intel syntax])
+  gmxcpu=""
+fi
+ACX_COMPILER_MAXOPT
+
+
+# Check x86 asm prerequisites and the capabilities of as
+if test "$enable_x86_asm" = "yes"; then
+  if test "$enable_float" = "no"; then
+    AC_MSG_WARN([x86 assembly loops can only be used in single precision - disabling])
+    enable_x86_asm=no
+  else 
+    AC_MSG_CHECKING([whether as fully supports intel syntax])
 cat > conftest.s << EOF
 .intel_syntax noprefix 
 checkasm:
@@ -324,17 +294,15 @@ checkasm:
        emms
        ret
 EOF
-      if AC_TRY_COMMAND($CC -c conftest.s); then
-       AC_MSG_RESULT([yes])
-      else
-        AC_MSG_RESULT([no]) 
-       AC_MSG_ERROR([Upgrade to binutils>=2.11, download the as executable]     
-                    [from www.gromacs.org, or disable assembly loops.])
-      fi
-    fi 
+    if AC_TRY_COMMAND($CC -c conftest.s); then
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no]) 
+      AC_MSG_ERROR([Upgrade to a more recent binutils, download the as executable]     
+                   [from www.gromacs.org, or disable assembly loops.])
+    fi
+    GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} x86_cpuid.lo x86_sse.lo x86_3dnow.lo"
   fi
-else # not x86
-enable_x86_asm=no
 fi
 
 AC_PATH_PROG(IDENT,ident,no)
@@ -348,18 +316,14 @@ if test "$IDENT" != "no"; then
     AC_MSG_RESULT([no]))
 fi
 
-
-AC_PROG_LN_S
 AM_PROG_LIBTOOL
-AC_CHECK_FUNCS(strcasecmp)
-AC_CHECK_FUNCS(strdup)
+AC_PROG_LN_S
+
+
+
+
+
 
-# Try to detect the cpu - must be done before some lib searches
-if test "$enable_cpu_detection" = "yes"; then
-  ACX_DETECT_GMXCPU
-else
-  gmxcpu=""
-fi
 
 ############################################################################
 # Checks for libraries.
@@ -369,229 +333,155 @@ AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR([No math library found]))
 #####
 # IBM provides a MASS library with vectorized and optimized math stuff,
 # and an xlopt library which partly overlaps this. They must come before
-# libm in the link list, thus the test goes after m!
+# libm in the link list, thus the test goes after that for libm!
 if test "${host_vendor}" = "ibm"; then
   AC_CHECK_LIB(xlopt,main)
   AC_CHECK_LIB(mass,main)  
   vectmass=no
   case "$gmxcpu" in
     power4*)
-      AC_CHECK_LIB(massvp4,main,[vectmass=yes LIBS="$LIBS -lmassvp4"])  ;;
+       # first check for a power4 lib, then power3, power2.
+      AC_SEARCH_LIBS(main,[massvp4,massvp3,massvp2,massv],[vectmass=yes]) ;;
     power3*)
-      AC_CHECK_LIB(massvp3,main,[vectmass=yes LIBS="$LIBS -lmassvp3"])  ;;
+      AC_SEARCH_LIBS(main,[massvp3,massvp2,massv],[vectmass=yes]) ;;
     power2*)
-      AC_CHECK_LIB(massvp3,main,[vectmass=yes LIBS="$LIBS -lmassvp2"])  ;;
+      AC_SEARCH_LIBS(main,[massvp2,massv],[vectmass=yes]) ;;
     *)
-      AC_CHECK_LIB(massv,main,[vectmass=yes LIBS="$LIBS -lmassv"])  ;;
+      AC_SEARCH_LIBS(main,[massv],[vectmass=yes]) ;;
   esac
   if test "$vectmass" = "yes"; then
-    AC_DEFINE(USE_IBM_MASS,,[Use the vectorized routines in IBM MASS library])
+    AC_DEFINE(HAVE_LIBMASSV_ANY,,[Use vectorized routines in the IBM MASS library])
+    if test "$enable_vectorized_recip" = "not_selected"; then
+      echo "Note: vector MASS lib present - vectorizing 1/x inner loops"
+      enable_vectorized_recip="yes"
+    fi
+    if test "$enable_vectorized_sqrt" = "not_selected"; then
+      echo "Note: vector MASS lib present - vectorizing 1/sqrt inner loops"
+      enable_vectorized_sqrt="yes"
+    fi    
+  else
+    echo "******************************************************************************"
+    echo "*Didn't find the IBM MASS library. It's not necessary, but can provide 20%   *"
+    echo "*performance improvement by loop vectorization. Add the library search path  *"
+    echo "*with -L in the LDFLAGS variable. If you can't find MASS, download it from   *"
+    echo "*http://www.research.ibm.com/mass                                            *"
+    echo "******************************************************************************"
   fi
 fi 
 
-if test "$enable_float" = "yes"; then
-  precision=4
-else
-  precision=8
-fi
+ACX_CHECK_FFTW(fftw,$enable_float)
+ACX_CHECK_FFTW(rfftw,$enable_float)
 
 if test "$enable_mpi" = "yes"; then
-  ACX_CHECK_FFTW(fftw_mpi,$precision)
-  ACX_CHECK_FFTW(rfftw_mpi,$precision)
+  ACX_CHECK_FFTW(fftw_mpi,$enable_float)
+  ACX_CHECK_FFTW(rfftw_mpi,$enable_float)
 fi
 
-ACX_CHECK_FFTW(fftw,$precision)
-ACX_CHECK_FFTW(rfftw,$precision)
-
 case ${ac_fftw_savedprefix} in
- d)
-   AC_DEFINE(FFTW_NAME_DFFTW,,[Use the d prefix on fftw includes])
-   ;;  
- s)
-   AC_DEFINE(FFTW_NAME_SFFTW,,[Use the s prefix on fftw includes])
-   ;;  
- *)
-   AC_DEFINE(FFTW_NAME_FFTW,,[Dont use any prefixing on fftw includes])
-   ;;  
+ d) AC_DEFINE(FFTW_NAME_DFFTW,,[Use the d prefix on fftw includes]) ;; 
+ s) AC_DEFINE(FFTW_NAME_SFFTW,,[Use the s prefix on fftw includes]) ;; 
+ *) AC_DEFINE(FFTW_NAME_FFTW,,[Dont use any prefix on fftw includes]) ;;       
 esac
 
 ######
-if test "$enable_xdr" = "no"; then
-  AC_MSG_WARN([* Not using XDR cripples GROMACS significantly. You won't be able to *]
-              [* read or write any compressed trajectories. You have no choice on   *]
-              [* windows, but if you run UNIX locate the RPC files - you have them! *])
-else
 # check for xtc headers
-  AC_CHECK_HEADERS(rpc/rpc.h rpc/xdr.h,,AC_MSG_ERROR([RPC/XDR include headers not found]))
-# check for xtc libs
-# on solaris the xdr stuff is in -lnsl
-  AC_CHECK_LIB(nsl,xdr_float)
-  AC_TRY_LINK(
-[#include<rpc/rpc.h> 
- #include<rpc/xdr.h>],
-  [ XDR *xd; float f; xdr_float(xd,&f);],,AC_MSG_ERROR([RPC/XDR libraries not found]))
-AM_CONDITIONAL(GMX_USE_XDR,true)
-fi
-
-#####
-# Look for X
-AC_PATH_XTRA
-
-# try to find motif headers and libraries
-AC_FIND_MOTIF
-if [test "$motif_includes" = "none" -a "$motif_libraries" != "none"]; then
-  AC_MSG_WARN([ In addition to Motif/Lesstif libraries we also need includes. Disabling.])
-  motif_include=none
+AC_CHECK_HEADERS(rpc/rpc.h rpc/xdr.h,
+[# check for xtc libs if we found headers - on solaris the xdr stuff is in libnsl
+AC_CHECK_LIB(nsl,xdr_float)
+AC_TRY_LINK([#include<rpc/rpc.h> 
+#include<rpc/xdr.h>],[ XDR *xd; float f; xdr_float(xd,&f);],
+[have_xdr=yes],AC_MSG_WARN([RPC/XDR libraries not found - disabling xtc]))
+],AC_MSG_WARN([RPC/XDR include headers not found - disabling xtc]))
+
+if test "$have_xdr" != "yes"; then
+  echo "*****************************************************************************"
+  echo "*WARNING - XDR not found. This cripples GROMACS significantly - you can't   *"
+  echo "*read/write portable trajectories. No choice on windows, but locate the RPC *"
+  echo "*header files and libraries if you run UNIX - they do exist!                *"
+  echo "*****************************************************************************"
 fi
 
-if test "$motif_includes" != "none"; then
-  use_motif="yes"
-else
-  use_motif="no"
-fi
-
-#####
-# Checks for header files.
-
-AC_CHECK_HEADERS([limits.h malloc.h strings.h unistd.h],,AC_MSG_ERROR([Include headers not found]))
-
-#####
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_STRUCT_TM
-AC_TYPE_UID_T
-AC_C_INLINE
-
 #####
-# Checks for library functions.
+# Checks for additional and/or optional functions or libraries.
 #AC_FUNC_MALLOC
 AC_FUNC_MEMCMP
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
+AM_WITH_DMALLOC
+AC_CHECK_FUNCS(strcasecmp)
+AC_CHECK_FUNCS(strdup)
 
 #####
-# Collect the libraries and includes for X and/or motif
+# Look for X
+AC_PATH_XTRA
+# try to find motif headers and libraries
+AC_FIND_MOTIF
+use_motif=no
+if test "$motif_libraries" != "none"; then
+  if test "$motif_includes" != "none"; then
+    GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} mgmx.lo widget.lo"
+    use_motif=yes
+  else
+    AC_MSG_WARN([ Sorry, we need both Motif/Lesstif libraries and includes. Disabling.])
+    motif_include=none
+  fi
+fi
 if test "$no_x" != "yes"; then
   LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
   INCLUDES="$INCLUDES $X_CFLAGS $MOTIF_CFLAGS" 
   AM_CONDITIONAL(USE_X11,true)
-  use_x11="yes"
 else
-  use_x11="no"
   AM_CONDITIONAL(USE_X11,false)
 fi
 
 #### 
 # And collect the f77 libs to the linker - on Solaris, f77 stuff must go first,
-# but on e.g. ibm the mass libraries must come before -lm...
+# but on e.g. ibm the mass libraries must come before -lm... 
 case "${host_cpu}-${host_os}" in
-  sparc*-solaris*)
-    LIBS="$FLIBS $LIBS"
-    ;;
-  *)
-    LIBS="$LIBS $FLIBS"
-    ;;
+  sparc*-solaris*) LIBS="$FLIBS $LIBS" ;;
+  *) LIBS="$LIBS $FLIBS" ;;
 esac
-    
-########################################################################
-# Substitute things in output and header files.
-########################################################################
-SUFFIX=""
-GMXLIB_COND_OBJ=""
 
-if test "$enable_mpi" = "yes"; then
-       AC_DEFINE(USE_MPI,,[Make a parallel version of GROMACS using MPI])
-        GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} mpiio.lo"
-        if test "$enable_mpi_suffix" = "yes"; then
-         SUFFIX="_mpi"
-       fi
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} libnet.lo"
-fi
 
-if test "$enable_vector" = "yes"; then
-       AC_DEFINE(USE_VECTOR,,[Optimize for a vector architecture])
-fi
 
-if test "$enable_fortran" = "yes"; then
-       AC_DEFINE(USE_FORTRAN,,[Use Fortran for innerloops and some other core stuff])
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} innerf.lo f77_wrappers.lo"
-       if test "$enable_float" = "yes"; then
-          MDLIB_COND_OBJ="flincs.lo fsettle.lo fshake.lo"
-        else
-          MDLIB_COND_OBJ="flincsd.lo fsettled.lo fshaked.lo"
-       fi
-       AM_CONDITIONAL(USE_FORTRAN,true)
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} innerc.lo"
-        MDLIB_COND_OBJ="clincs.lo csettle.lo cshake.lo"
-       AM_CONDITIONAL(USE_FORTRAN,false)
-fi
 
-if test "$enable_float" = "no"; then
-       AC_DEFINE(DOUBLE,,[Compile in double precision])
-        if test "$enable_type_suffix" = "yes"; then
-         SUFFIX="${SUFFIX}_d"
-       fi
-       AM_CONDITIONAL(USE_DOUBLE,true)
-else
-       AM_CONDITIONAL(USE_DOUBLE,false)
-fi
 
-if test "$enable_simplewater" = "yes"; then
-       AC_DEFINE(SIMPLEWATER,,[Expand the water loops to three inner loops])
-fi
 
-if test "$enable_waterwater_loops" = "no"; then
-       AC_DEFINE(DISABLE_WATERWATER_LOOPS,,[Don't use special loops for all-water interactions])
-fi
 
-if test "$enable_nice" = "no"; then
-       AC_DEFINE(NO_NICE,,[Turn off the automatic nicing of gromacs])
-fi
 
-if test "$enable_x86_asm" = "yes"; then
-       AC_DEFINE(USE_SSE,,[Use x86 assembly loops])
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} x86_cpuid.lo x86_sse.lo x86_3dnow.lo"
-fi
+########################################################################
+# Checks for header files and types
+########################################################################
+
+AC_CHECK_HEADERS([limits.h malloc.h strings.h unistd.h],,AC_MSG_ERROR([Include headers not found]))
+AC_CHECK_HEADERS(unistd.h)
+
+#####
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+AC_TYPE_UID_T
+AC_C_INLINE
+    
+
 
-if [test "$motif_includes" != "none" -a "$motif_libraries" != "none"]; then
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} mgmx.lo widget.lo"
-fi
 
-if test "$enable_xdr" = "yes"; then
-       AC_DEFINE(USE_XDR,,[Use xdr routines to make trajectories portable])
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} libxdrf.lo ftocstr.lo"
-else
-       GMXLIB_COND_OBJ="${GMXLIB_COND_OBJ} dumxdrf.lo"
-fi
 
-if test "$enable_softwaresqrt" = "yes"; then
-       AC_DEFINE(SOFTWARE_SQRT,,[Use the GROMACS software 1/sqrt(x)])
-fi
 
-if test "$enable_softwarerecip" = "yes"; then
-       AC_DEFINE(SOFTWARE_RECIP,,[Use the GROMACS software 1/x])
-fi
 
-if test "$enable_hide_square_latency" = "yes"; then
-       AC_DEFINE(DECREASE_SQUARE_LATENCY,,[Try to get coordinates to cache before using them])
-fi
 
-if test "$enable_hide_table_latency" = "yes"; then
-       AC_DEFINE(DECREASE_LOOKUP_LATENCY,,[Try to get table data to cache before using it])
-fi
 
-if test "$with_mpi_environment" != "no" -a "$enable_mpi" = "yes"; then
-       AC_DEFINE_UNQUOTED(CHECK_MPI_ENV,"$with_mpi_environment",
-                 [If defined, only start MPI runs when this variable is set])
-fi
 
 
+
+########################################################################
+# Process vectorization and prefetch options for inner loops
+########################################################################
+# check which loops to vectorize
 list_of_vectorized_sqrt=""
 if test "$enable_vectorized_sqrt" != "no"; then
-  if test "$enable_vectorized_sqrt" = "yes"; then
+  if test "$enable_vectorized_sqrt" = "yes" -o "$enable_vectorized_sqrt" = "all" ; then
     enable_vectorized_sqrt="normal,solvent,water,water-water"
   fi
   if echo $enable_vectorized_sqrt | grep "normal" >/dev/null; then
@@ -616,9 +506,10 @@ if test -z "$list_of_vectorized_sqrt"; then
 fi
 
 
+# check loops to prefetch coordinates in
 list_of_prefetch_x=""
 if test "$enable_prefetch_x" != "no"; then
-  if test "$enable_prefetch_x" = "yes"; then
+  if test "$enable_prefetch_x" = "yes" -o "$enable_prefetch_x" = "all"; then
     enable_prefetch_x="normal,solvent,water,water-water"
   fi
   if echo $enable_prefetch_x | grep "normal" >/dev/null; then
@@ -642,9 +533,11 @@ if test -z "$list_of_prefetch_x"; then
   list_of_prefetch_x="no"
 fi
 
+
+# check loops to prefetch forces in
 list_of_prefetch_f=""
 if test "$enable_prefetch_f" != "no"; then
-  if test "$enable_prefetch_f" = "yes"; then
+  if test "$enable_prefetch_f" = "yes" -o "$enable_prefetch_f" = "all"; then
     enable_prefetch_f="normal,solvent,water,water-water"
   fi
   if echo $enable_prefetch_f | grep "normal" >/dev/null; then
@@ -668,102 +561,123 @@ if test -z "$list_of_prefetch_f"; then
   list_of_prefetch_f="no"
 fi
 
-if test "$enable_vectorized_recip" != "yes" -a "$enable_vectorized_recip" != "no"; then
-  AC_MSG_ERROR([Vectorized reciprocal is only meaningful for normal loops])
-fi
 
-if test "$enable_vectorized_recip" = "yes"; then
-  AC_DEFINE(VECTORIZE_RECIP,,[Vectorize the reciprocal calculation])
-fi
-AC_DEFINE_UNQUOTED(GMXLIBDIR,"${datadir}/top",[Default topology file location])
 
 
-# Check if there are any optimizations and options for this arch and cpu
-ACX_COMPILER_MAXOPT
+
+
+
+
+########################################################################
+# Final output stage
+########################################################################
+ASFLAGS="$ASFLAGS $CFLAGS"
+AS="$CC"
+AC_SUBST(ASFLAGS)
+AC_SUBST(AS)
 AC_SUBST(INCLUDES)          # should be automatic, but doesnt seem to be?
+AC_SUBST(GMXLIB_LIBOBJS)
+AC_SUBST(MDLIB_LIBOBJS)
 
-AC_SUBST(GMXLIB_COND_OBJ)
-AC_SUBST(MDLIB_COND_OBJ)
-ACX_SUBST_XXX(SUFFIX)
-AC_SUBST(SUFFIX)
+# To tell libraries apart, we use four versions of the name. For instance, libgmx:
+# libgmx               single prec, no mpi.
+# libgmx_d             double prec, no mpi.
+# libgmx_mpi           single prec, mpi.
+# libgmx_mpi_d         double prec, mpi.
+# However, the non-suffixed names are linked to the _mpi and/or _d suffixed
+# ones upon installation if that is the only version available.
 
+if test "$enable_mpi" = "yes"; then
+  LIBSUFFIX="_mpi"
+fi
+if test "$enable_float" = "no"; then
+  LIBSUFFIX="${LIBSUFFIX}_d"
+fi
+AC_SUBST(LIBSUFFIX) 
 
-# put binaries and libraries in subdirectories named as the arch
-if test -n "$gmxcpu"; then
-  bindir="\${exec_prefix}/bin/${host}/${gmxcpu}"
-  libdir="\${exec_prefix}/lib/${host}/${gmxcpu}"
+# Unless the user has explicitly requested a prefix/suffix/transform, we
+# use _d on double precision files. Don't add anything for mpi, but at the
+# end we tell the user it is possible and smart to do in some cases!
+if test "$program_transform_name" = "s,x,x,"; then
+  name_transform_provided=no;
+  if test "$enable_float" = "no"; then
+    program_transform_name="s,\$\$,_d,"
+  fi
 else
-  bindir="\${exec_prefix}/bin/${host}"
-  libdir="\${exec_prefix}/lib/${host}"
+  name_transform_provided=yes;
 fi
 
+# put binaries and libraries in subdirectories named as the arch and cpu
+if test "$enable_arch_subdirs" = "yes"; then
+  if test -n "$gmxcpu"; then
+    bindir="${bindir}/${host}/${gmxcpu}"
+    libdir="${libdir}/${host}/${gmxcpu}"
+  else
+    bindir="${bindir}/${host}"
+    libdir="${libdir}/${host}"
+  fi
+fi
 AC_SUBST(bindir)
 AC_SUBST(libdir)
-AC_SUBST(SHARED_VERSION_INFO)
 
-AC_OUTPUT([Makefile
-                 src/Makefile
-                 src/gmxlib/Makefile
-                 src/mdlib/Makefile
-                 src/kernel/Makefile
-                 src/tools/Makefile
-                 src/ngmx/Makefile
-                src/contrib/Makefile
-                 include/Makefile
-                include/types/Makefile
-                 scripts/Makefile
-                admin/Makefile
-                 share/Makefile
-                share/tutor/Makefile
-                share/tutor/gmxdemo/Makefile
-                share/tutor/nmr1/Makefile
-                share/tutor/nmr2/Makefile
-                share/tutor/water/Makefile
-                share/tutor/speptide/Makefile
-                share/template/Makefile
-                share/template/Template.mak
-                share/top/Makefile
-                share/html/Makefile
-                 share/html/images/Makefile
-                 share/html/online/Makefile
-                 man/Makefile
-                 man/man1/Makefile])
+
+AC_OUTPUT([Makefile include/Makefile include/types/Makefile src/Makefile
+           src/gmxlib/Makefile src/mdlib/Makefile src/kernel/Makefile
+           src/tools/Makefile src/ngmx/Makefile src/contrib/Makefile
+           scripts/Makefile admin/Makefile share/Makefile share/tutor/Makefile
+           share/tutor/gmxdemo/Makefile share/tutor/nmr1/Makefile
+          share/tutor/nmr2/Makefile share/tutor/water/Makefile
+          share/tutor/speptide/Makefile share/template/Makefile
+          share/top/Makefile share/html/Makefile share/html/images/Makefile
+           share/html/online/Makefile man/Makefile man/man1/Makefile])
+
+
+
+
+
+
+
+
+#########################################################
+# Print the most important options, to avoid stupid mistakes
+#
 
 echo ""
 echo "GROMACS is ready to compile. Summary of main options:"
-echo "Architecture                  : $host"
-if test "$enable_cpu_detection" = "yes"; then
-if test -n "$gmxcpu"; then
-echo "Optimize for CPU              : $gmxcpu"
+if test "$enable_cpu_detection" = "yes" -a -n "$gmxcpu"; then
+  echo "Architecture                  : $host / CPU $gmxcpu"
 else
-echo "(Extra CPU detection not necessary or unavailable on this host)" 
+  echo "Architecture                  : $host"
 fi
-fi
-echo "Vector architecture           : $enable_vector"
+if test "$enable_mpi" = "yes" -a "$with_mpi_environment" != "no"; then
+echo "MPI parallelization           : yes, when $with_mpi_environment is set"
+else
 echo "MPI parallelization           : $enable_mpi"
-if test "$enable_mpi" = "yes"; then
-echo "Checking MPI environment      : $with_mpi_environment"
-echo "MPI suffix on files           : $enable_mpi_suffix"
 fi
 echo "Using Fortran code            : $enable_fortran"
-echo "Single precision              : $enable_float"
 if test "$enable_float" = "no"; then
-echo "Suffix on double prec. files  : $enable_type_suffix"
+  echo "Precision                     : double"
+  if test "$name_transform_provided" = "no"; then
+    echo "(Program names will be suffixed with _d, override with --program-suffix)"
+  fi
+else
+  echo "Precision                     : single"
 fi
-echo "Automatically nice mdrun      : $enable_nice"
-echo "Using x86 SSE/3DNow assembly  : $enable_x86_asm"
-echo "Software 1/x                  : $enable_softwarerecip"
-echo "Software 1/sqrt(x)            : $enable_softwaresqrt"
+case "${host_cpu}" in
+   i?86) echo "Using x86 assembly            : $enable_x86_asm" ;;     
+   *) ;;
+esac
+echo "Software 1/x                  : $enable_software_recip"
+echo "Software 1/sqrt(x)            : $enable_software_sqrt"
 echo "Vectorize 1/x                 : $enable_vectorized_recip"
 echo "Vectorize 1/sqrt(x)           : $list_of_vectorized_sqrt"
 echo "Prefetch coordinates in loops : $list_of_prefetch_x"
 echo "Prefetch forces in loops      : $list_of_prefetch_f"
-echo "X11 support                   : $use_x11"
 echo "Motif support                 : $use_motif"
-echo ""
-echo "GROMACS will be installed under $prefix"
-echo "Make sure to update your PATH and MANPATH to find the"
-echo "programs and unix manual pages, and possibly LD_LIBRARY_PATH"
-echo "or /etc/ld.so.conf if you are using dynamic libraries"
-
+if test "$name_transform_provided" = "no" -a "$enable_mpi" = "yes"; then
+  echo ""
+  echo "You can install MPI programs with suffixed names to have both MPI and non-MPI"
+  echo "versions. It is useful when you need a charge queue to run MPI-linked programs."
+  echo "Set a suffix with --program-suffix=_mpi (or _mpi_d for double). In that case"
+  echo "you only need MPI for mdrun, so you can issue make mdrun; make mdrun-install."
+fi
index 483085fd97bf95c39a4228aec0f41dacdf87925a..1a2b0d05272fdad7efe4382cd7441fc98e571e78 100644 (file)
 /* Version number of package */
 #undef VERSION
 
-/* Include Alpha AXP assembly for vectorized sqrt/invsqrt */
-#undef USE_AXP_ASM
+/* Compile in double precision */
+#undef DOUBLE
+
+/* Use Fortran for innerloops and some other core stuff */
+#undef USE_FORTRAN
+
+/* If defined, only start MPI runs when this variable is set */
+#undef CHECK_MPI_ENV
+
+/* Turn off the automatic nicing of GROMACS */
+#undef NO_NICE
+
+/* Optimize for a vector architecture */
+#undef USE_VECTOR
+
+/* Expand the water loops to three inner loops */
+#undef SIMPLEWATER
+
+/* Don't use special loops for water-water interactions */
+#undef DISABLE_WATERWATER_LOOPS
+
+/* Use the GROMACS software 1/x */
+#undef SOFTWARE_RECIP
+
+/* Use the GROMACS software 1/sqrt(x) */
+#undef SOFTWARE_SQRT
+
+/* Vectorize the reciprocal calculation */
+#undef VECTORIZE_RECIP
+
+/* Try to get coordinates to cache before using them */
+#undef DECREASE_SQUARE_LATENCY
+
+/* Try to get table data to cache before using it */
+#undef DECREASE_LOOKUP_LATENCY
+
+/* Make a parallel version of GROMACS using MPI */
+#undef USE_MPI
 
 /* call f77 with lowercase, no underscore */
 #undef F77_NAME_LOWERCASE
 /* Does this machine have the ident command */
 #undef HAVE_IDENT
 
-/* Use the vectorized routines in IBM MASS library */
-#undef USE_IBM_MASS
+/* Use vectorized routines in the IBM MASS library */
+#undef HAVE_LIBMASSV_ANY
 
 /* Use the d prefix on fftw includes */
 #undef FFTW_NAME_DFFTW
 /* Use the s prefix on fftw includes */
 #undef FFTW_NAME_SFFTW
 
-/* Dont use any prefixing on fftw includes */
+/* Dont use any prefix on fftw includes */
 #undef FFTW_NAME_FFTW
 
+/* Define if using the dmalloc debugging malloc package */
+#undef WITH_DMALLOC
+
 /* Use motif/lesstif libraries */
 #undef HAVE_MOTIF
 
-/* Make a parallel version of GROMACS using MPI */
-#undef USE_MPI
-
-/* Optimize for a vector architecture */
-#undef USE_VECTOR
-
-/* Use Fortran for innerloops and some other core stuff */
-#undef USE_FORTRAN
-
-/* Compile in double precision */
-#undef DOUBLE
-
-/* Expand the water loops to three inner loops */
-#undef SIMPLEWATER
-
-/* Don't use special loops for all-water interactions */
-#undef DISABLE_WATERWATER_LOOPS
-
-/* Turn off the automatic nicing of gromacs */
-#undef NO_NICE
-
-/* Use x86 assembly loops */
-#undef USE_SSE
-
-/* Use xdr routines to make trajectories portable */
-#undef USE_XDR
-
-/* Use the GROMACS software 1/sqrt(x) */
-#undef SOFTWARE_SQRT
-
-/* Use the GROMACS software 1/x */
-#undef SOFTWARE_RECIP
-
-/* Try to get coordinates to cache before using them */
-#undef DECREASE_SQUARE_LATENCY
-
-/* Try to get table data to cache before using it */
-#undef DECREASE_LOOKUP_LATENCY
-
-/* If defined, only start MPI runs when this variable is set */
-#undef CHECK_MPI_ENV
-
 /* Vectorize 1/sqrt(x) in normal loops */
 #undef VECTORIZE_INVSQRT
 
 /* Prefetch coordinates in water-water loops */
 #undef PREFETCH_F_WW
 
-/* Vectorize the reciprocal calculation */
-#undef VECTORIZE_RECIP
-
-/* Default topology file location */
-#undef GMXLIBDIR
-
index 430f9e13db06741bee077a3c094eb270b71db027..857150083a480b89493ca0358af926b9f0f59187 100644 (file)
@@ -51,24 +51,23 @@ extern "C" {
 #endif
   
 #include <stdio.h>
-
+  
 /* Has to be a function, so we can get version number from autoconf */   
 char *GromacsVersion();
   
   
 static char *CopyrightText[] = {
-  "",
-  "Copyright (c) 1991-2001",
-  "Dept. of Biophysical Chemistry, University of Groningen, The Netherlands",
-  "For additional resources, check out http://www.gromacs.org"
-  ""
-  "This program 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"
+  "Copyright (c) 1991-2001, University of Groningen, The Netherlands"
+};
+
+static char *GPLText[] = {
+  "This program 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."
-  ""
 };
-  
+
+
 extern void pr_difftime(FILE *out,double dt);
 
 void CopyRight(FILE *out,char *szProgram);
index 94ec8b8fc2bd5aff5f0566b8505579611b10b31d..9d5bd26a2984dad26ec1d619205011e13d6234f4 100644 (file)
@@ -1,7 +1,7 @@
-## Process this file with automake to produce Makefile.in
+ ## Process this file with automake to produce Makefile.in
 #
 # Don't edit - this file is generated automatically from Makefile.am
 #
 
-EXTRA_DIST =   grompplog2top       make_gromos_nb.pl   make_gromos_rtp.py \
+EXTRA_SCRIPTS = grompplog2top       make_gromos_nb.pl   make_gromos_rtp.py \
                make_gromos_bon.pl make_gromos_rtp.pl  
index 75c320a7ec0a1adbe2c7cf3d3f23b0840167ca8e..babf9161bde13743203343293a6fb033d2500250 100644 (file)
@@ -8,19 +8,31 @@ templatedir = ${datadir}/template
 # we don't build this, it's meant for the user to play with.
 # Since a Makefile is used for the installation, we call the
 # template makefile Template.mak, and rename it to Makefile when installing.
-
-template_DATA = template.c README
-
-EXTRA_DIST = Template.mak.in ${template_DATA}
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+CC = @CC@
+
+template_DATA = template.c README Makefile.@host@
+EXTRA_DIST = template.c README Template.mak
+
+#BUILT_SOURCES = Makefile.@host@
+
+Makefile.@host@: Template.mak Makefile 
+       cat $< | sed 's,@libdir\@,$(libdir),' | \
+       sed 's,@LDFLAGS\@,$(LDFLAGS),' | \
+       sed 's,@LIBS\@,$(LIBS),' | \
+       sed 's,@CPPFLAGS\@,$(CPPFLAGS),' | \
+       sed 's,@CFLAGS\@,$(CFLAGS),' | \
+       sed 's,@CC\@,$(CC),' | \
+       sed 's,@includedir\@,$(includedir),' | \
+       sed 's,@host\@,@host@,' >$@
 
 install-data-hook:
-       $(mkinstalldirs) $(DESTDIR)$(templatedir)
-       echo "$(INSTALL_DATA) Template.mak $(DESTDIR)$(templatedir)/Makefile"; \
-       $(INSTALL_DATA) Template.mak $(DESTDIR)$(templatedir)/Makefile; 
-
-
-CLEANFILES = *~ \\\#* *.ene *.hat *.tr? *.xtc *.edr *.ene *.xvg core *.log mdout.mdp *.tp? mon.out confout.gro deshuf.ndx output.* *.gz *.ps *.dat *.g87 *~ \\\#*
+       (cd $(DESTDIR)$(templatedir) && test ! -e Makefile && $(LN_S) Makefile.@host@ Makefile)
 
+CLEANFILES = *~ \\\#* 
 
 
 
index ea5cf2c0a4d66db29e049ff43f1890caf3dedc84..0c72fc91473d95d5e6c3d4e6dc344e763acc6c08 100644 (file)
@@ -2,21 +2,23 @@ Once installed, this directory contains a Makefile and
 a small program that you could use as a template when 
 writing your own analysis software.
 
-The Makefile is created during the configuration phase
-to contain the correct paths and libraries to the most
-recent installation. 
-It might be a good idea to make a copy if you plan to 
-compile for several architectures.
+A Makefile.arch is created for each architecture you install 
+(the first one is linked to Makefile) with the correct paths 
+and libraries. If there is more than one, copy the one
+that corresponds best to your computer.
 
 ----------------------------------------------------------
-If you are looking in the distribution directory the
+
+If you are reading this in the distribution directory, 
 there will be a Makefile.am which automake uses to 
 create a Makefile.in which in turn is converted to
 a Makefile by the configure script. Note that this is
 NOT the template makefile - it is called Template.mak,
-but is renamed when then 
-
+and used to create Makefile.arch at build time.
 
 You should NOT touch or copy Makefile.in unless you
 really know what you are doing - it is a template file
 used by the configure script to create the real Makefile.
+
+If you want to use automake and autoconf yourself, look
+in the contrib directory of the distribution.
index 6e1437c6c2ab7bd76663cc0109cf8b8f0a1d7cdf..42b5923f8bb6dd288b51d79102d38a35cdb45017 100644 (file)
@@ -1,18 +1,16 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is automatically from Makefile.am by automake.
 
 SUBDIRS = gmxlib mdlib kernel tools ngmx contrib
 # don't do anything for the local directory
 
 mdrun:         
-       (cd ${top_builddir}/src/gmxlib && $(MAKE))
-       (cd ${top_builddir}/src/mdlib && $(MAKE))
-       (cd ${top_builddir}/src/kernel && $(MAKE) mdrunXXX_SUFFIX_XXX)
+       (cd $(top_builddir)/src/gmxlib && $(MAKE))
+       (cd $(top_builddir)/src/mdlib && $(MAKE))
+       (cd $(top_builddir)/src/kernel && $(MAKE) mdrun)
 
 install-mdrun:
-       cd ${top_builddir}/src/kernel 
-       make install-mdrun
+       (cd $(top_builddir)/src/kernel && $(MAKE) install-mdrun)
 
 CLEANFILES = *~ \\\#*
\ No newline at end of file
index 9205dff007fd0db4e1a4a1c506bb08e71556d37f..3318388bb703c21b48a59fa79cd6745c4e2dd8cc 100644 (file)
@@ -1,19 +1,13 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
+LDADD = ../mdlib/libmd@LIBSUFFIX@.la ../gmxlib/libgmx@LIBSUFFIX@.la
 
-# This is necessary for VPATH to work, 
-# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
-LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib 
-LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
 
 EXTRA_DIST              = README  
 
-# NB: The programs in contrib do not get double/mpi suffixes automatically,
-# to make it easier for new developers to understand this file. If you want
-# to have it, append "XXX_SUFFIX_XXX" to the program name.
 # These programs are not compiled or installed by default - you will have to 
 # issue "make <program>" and copy the binary to the correct location yourself! 
 # Add new entries in Makefile.am!
@@ -21,41 +15,11 @@ EXTRA_DIST              = README
 EXTRA_PROGRAMS                 = sigeps mk6_n copyrgt mkyaw prfn options hrefify mkice \
                           total hexamer optwat addquote do_shift g_anavel my_dssp anaf 
 
-copyrgt_SOURCES        = copyrgt.c
-
-sigeps_SOURCES                 = sigeps.c 
-
-mk6_n_SOURCES          = mk6_n.c 
+# Note: you don't have to list sources for "prog" if it is the single file prog.c
 
 my_dssp_SOURCES        = my_dssp.c dsspcore.c
 
-hrefify_SOURCES        = hrefify.c
-
-total_SOURCES          = total.f
-
-optwat_SOURCES                 = optwat.c
-
-hexamer_SOURCES        = hexamer.c
-
-do_shift_SOURCES       = do_shift.c
-
-anaf_SOURCES           = anaf.c
-
-mkyaw_SOURCES          = mkyaw.c
-
-mkice_SOURCES          = mkice.c
-
-prfn_SOURCES           = prfn.c
-
-options_SOURCES                = options.c
-
-g_anavel_SOURCES       = g_anavel.c
-
-addquote_SOURCES       = addquote.c
-
-# clean things explicitly, since the target names might have changed
-CLEANFILES   =         ${bin_PROGRAMS} ${EXTRA_PROGRAMS}       \
-               *_mpi *_d *~ \\\#*
+CLEANFILES   =         *~ \\\#*
 
 
 
index 9e46a7511eac35976e915969d082d96a28c72fa8..677e046ef2432b413e1c02a64c0d8084ce27ce11 100644 (file)
@@ -1,20 +1,17 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Note that Makefile is generated automatically from Makefile.in,
-# which is automatically generated from Makefile.am
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
 
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
 
-# 
-# This is necessary for VPATH builds (and thus distcheck) to work, 
-# but it can probably be included in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
+lib_LTLIBRARIES = libgmx@LIBSUFFIX@.la
 
-# produce the gmx library
-#
+libgmx@LIBSUFFIX@_la_LIBADD = @GMXLIB_LIBOBJS@
+libgmx@LIBSUFFIX@_la_DEPENDENCIES = @GMXLIB_LIBOBJS@
+libgmx@LIBSUFFIX@_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
 
-lib_LTLIBRARIES = libgmxXXX_SUFFIX_XXX.la
-
-libgmxXXX_SUFFIX_XXX_la_SOURCES = \
+libgmx@LIBSUFFIX@_la_SOURCES = \
        3dview.c        atomprop.c      block_tx.c      bondfree.c      \
        buffer.c        calcgrid.c      calch.c         inner.h         \
        confio.c        copyrite.c      disre.c         do_fit.c        \
@@ -33,59 +30,38 @@ libgmxXXX_SUFFIX_XXX_la_SOURCES = \
        trnio.c         trxio.c         txtdump.c       typedefs.c      \
        viewit.c        wgms.c          wman.c          writeps.c       \
        xdrd.c          xtcio.c         xvgr.c          replace.h       \
-       x86_cpu.c       
-
-EXTRA_libgmxXXX_SUFFIX_XXX_la_SOURCES = \
-       mpiio.c         libnet.c        x86_3dnow.S     f77_wrappers.c  \
-       libxdrf.c       ftocstr.c       dumxdrf.c       mgmx.c          \
-       widget.c        widget.h        x86_cpuid.S     axp_asm.s       \
-       x86_sse.S       
-
-if USE_FORTRAN
-BUILT_SOURCES = innerf.f
-else
-BUILT_SOURCES = innerc.c
-endif
-
-#
-# NB: The contents of GMXLIB_COND_OBJ is defined in
-#     the main configure.in script file
-#
+       x86_cpu.c       libxdrf.c       
 
-libgmxXXX_SUFFIX_XXX_la_LIBADD = @GMXLIB_COND_OBJ@     
-libgmxXXX_SUFFIX_XXX_la_DEPENDENCIES = @GMXLIB_COND_OBJ@       
-libgmxXXX_SUFFIX_XXX_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+EXTRA_libgmx@LIBSUFFIX@_la_SOURCES = \
+       mpiio.c         libnet.c        x86_sse.S       x86_3dnow.S     \
+       mgmx.c          widget.c        widget.h        x86_cpuid.S     \
+       axp_asm.s       f77_wrappers.c  
 
+#if FORTRAN
+#BUILT_SOURCES = innerf.f
+#else
+#BUILT_SOURCES = innerc.c
+#endif
 
 
 # The inner loops
 innerf.f:      mkinl 
                ./mkinl fortran 
-
 innerc.c:      mkinl
                ./mkinl c
 
-# The compaq compiler is really stupid and thinks a .S file is some
-# kind of object. Instead it preprocesses the .s files.
-# To make this work with both gcc and the compaq compilers, we
-# do a workaround to make gcc preprocess the .s file instead:
-
-if GNU_CC
-axp_asm.lo:    axp_asm.s
-       $(COMPILE) -x assembler-with-cpp -c $(srcdir)/axp_asm.s
-endif
 
-# Mkinl is special - we cant use a noinst_PROGRAMS target, since it
-# might have to be compiled with a special non-MPI compiler whose files
-# can be executed on the build machine (i.e., not for the target host):
+# mkinl is special - cant use a noinst_PROGRAMS target, since it might have 
+# to be compiled with a non-MPI compiler whose files can be executed directly:
 
-EXTRA_DIST      = \
-       mkinl.c                 mkinl_declarations.c    mkinl_outerloop.c  \
-       mkinl_innerloop.c       mkinl_calcdist.c        mkinl_invsqrt.c    \
-       mkinl_recip.c           mkinl_interactions.c    metacode.c         \
-       mkinl.h                 mkinl_fortrandata.h
+EXTRA_DIST      =                      mkinl_declarations.c    \
+               mkinl_outerloop.c       mkinl_innerloop.c       \
+               mkinl_invsqrt.c         mkinl_calcdist.c        \
+               mkinl_recip.c           mkinl_interactions.c    \
+               metacode.c              mkinl.h                 \
+               mkinl_fortrandata.h     mkinl.c
 
-BUILD_COMPILE = $(BUILD_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+BUILD_COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 
 metacode.o:    metacode.c
                $(BUILD_COMPILE) -c $(srcdir)/metacode.c
@@ -114,8 +90,16 @@ MKINL_OBJ   = \
 mkinl:         $(MKINL_OBJ)
                $(BUILD_COMPILE) -o $@ $(MKINL_OBJ)
 
-# clean things explicitly, since the target names might have changed
-CLEANFILES     = ${lib_LTLIBRARIES} *_d.la *_mpi.la *~ \\\#* innerc.c innerf.f mkinl
+# link the mpi library to non-mpi names if the latter are not present
+install-exec-hook:
+       if test `echo @LIBSUFFIX@|grep _mpi`; then \
+          mpi="libgmx@LIBSUFFIX@"; nompi=`echo $(mpi)|sed ,_mpi,,`"; \
+         (cd $(libdir) && test -e $(mpi).a -a ! -e $(nompi).a && $(LN_S) $(mpi).a $(nompi).a); \
+         (cd $(libdir) && test -e $(mpi).so -a ! -e $(nompi).so && $(LN_S) $(mpi).so $(nompi).so); \
+       fi
+
+# clean all libtool libraries, since the target names might have changed
+CLEANFILES     = *.la *~ \\\#* innerc.c innerf.f mkinl
 
 
 
index a8d65529435872841cc64baff37ea154c5fb0498..9f31f1b1f521903c3055b51725a51e146925a075 100644 (file)
@@ -196,6 +196,8 @@ char *cool_quote(void)
 void CopyRight(FILE *out,char *szProgram)
 {
 #define NCR (int)asize(CopyrightText)
+#define NGPL (int)asize(GPLText)
+
   char buf[256];
   char *ptr;
   
@@ -212,9 +214,12 @@ void CopyRight(FILE *out,char *szProgram)
   fprintf(out,"\n");
   
   for(i=0; (i<NCR); i++) 
-    fprintf(out,"  %s\n",CopyrightText[i]);
+    sp_print(out,CopyrightText[i]);
+  for(i=0; (i<NGPL); i++)
+    sp_print(out,GPLText[i]);
+
+  fprintf(out,"\n");
 
-  
   sprintf(buf,"%s",szProgram);
 #ifdef DOUBLE
   strcat(buf," (double precision)");
diff --git a/src/gmxlib/dumxdrf.c b/src/gmxlib/dumxdrf.c
deleted file mode 100644 (file)
index aa95746..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * $Id$
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
- * Copyright (c) 1991-2001
- * BIOSON Research Institute, Dept. of Biophysical Chemistry
- * University of Groningen, The Netherlands
- * 
- * This program 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.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * Great Red Owns Many ACres of Sand 
- */
-static char *SRCID_dumxdrf_c = "$Id$";
-#include "fatal.h"
-#include "xdrf.h"
-       
-int xdropen(XDR *xdrs, const char *filename, const char *type)
-{
-  fatal_error(0,"xdropen called");
-  
-  return 0;
-}
-
-int xdrclose(XDR *xdrs) 
-{
-  fatal_error(0,"xdrclose called");
-  
-  return 0;
-}
-
-int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) 
-{
-  fatal_error(0,"xdr3dfcoord called");
-  
-  return 0;
-}
-
-bool_t xdr_int(XDR *xdr, int *i)
-{
-  fatal_error(0,"xdr_int called");
-  
-  return (bool_t) 0;
-}
-
-bool_t xdr_float(XDR *xdr, float *f)
-{
-  fatal_error(0,"xdr_float called");
-  
-  return (bool_t) 0;
-}
-   
-bool_t xdr_double(XDR *xdr, double *d)
-{
-  fatal_error(0,"xdr_double called");
-  
-  return (bool_t) 0;
-}
-
-bool_t xdr_string(XDR *xdr,char **s,int size)
-{
-  fatal_error(0,"xdr_string called");
-  
-  return (bool_t) 0;
-}
-
index 5a90b258859b7367e6293c0eb2cb52a46e351ccd..2a86d868343784371bdca50d7aab81c3b7fe0ea5 100644 (file)
  * Gromacs Runs On Most of All Computer Systems
  */
 static char *SRCID_libxdrf_c = "$Id$";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <limits.h>
 #include <malloc.h>
 #include <math.h>
@@ -42,19 +46,103 @@ static char *SRCID_libxdrf_c = "$Id$";
 #include "xdrf.h"
 #include <callf77.h>
 
-int ftocstr(char *, int, char *, int);
-int ctofstr(char *, int, char *);
-
 #define MAXID 20
 static FILE *xdrfiles[MAXID];
 static XDR *xdridptr[MAXID];
 static char xdrmodes[MAXID];
 static unsigned int cnt;
 
+#ifndef USE_XDR
+int xdropen(XDR *xdrs, const char *filename, const char *type)
+{
+  fatal_error(0,"xdropen called, but GROMACS compiled without XDR support");
+  
+  return 0;
+}
+
+int xdrclose(XDR *xdrs) 
+{
+  fatal_error(0,"xdrclose called, but GROMACS compiled without XDR support");
+  
+  return 0;
+}
+
+int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) 
+{
+  fatal_error(0,"xdr3dfcoord called, but GROMACS compiled without XDR support");
+  
+  return 0;
+}
+
+bool_t xdr_int(XDR *xdr, int *i)
+{
+  fatal_error(0,"xdr_int called, but GROMACS compiled without XDR support");
+  
+  return (bool_t) 0;
+}
+
+bool_t xdr_float(XDR *xdr, float *f)
+{
+  fatal_error(0,"xdr_float called, but GROMACS compiled without XDR support");
+  
+  return (bool_t) 0;
+}
+   
+bool_t xdr_double(XDR *xdr, double *d)
+{
+  fatal_error(0,"xdr_double called, but GROMACS compiled without XDR support");
+  
+  return (bool_t) 0;
+}
+
+bool_t xdr_string(XDR *xdr,char **s,int size)
+{
+  fatal_error(0,"xdr_string called, but GROMACS compiled without XDR support");
+  
+  return (bool_t) 0;
+}
+
+#else /* we have xdr support */
+
 #ifdef USE_FORTRAN
 
 typedef void (* F77_FUNC(xdrfproc,XDRFPROC))(int *, void *, int *);
 
+int ftocstr(char *ds, int dl, char *ss, int sl)
+    /* dst, src ptrs */
+    /* dst max len */
+    /* src len */
+{
+    char *p;
+
+    p = ss + sl;
+    while ( --p >= ss && *p == ' ' );
+    sl = p - ss + 1;
+    dl--;
+    ds[0] = 0;
+    if (sl > dl)
+      return 1;
+    while (sl--)
+      (*ds++ = *ss++);
+    *ds = '\0';
+    return 0;
+}
+
+
+int ctofstr(char *ds, int dl, char *ss)
+     /* dest space */
+     /* max dest length */
+     /* src string (0-term) */
+{
+    while (dl && *ss) {
+       *ds++ = *ss++;
+       dl--;
+    }
+    while (dl--)
+       *ds++ = ' ';
+    return 0;
+}
+
 void
 F77_FUNC(xdrfbool,XDRFBOOL)(int *xdrid, int *pb, int *ret) 
 {
@@ -1079,5 +1167,5 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) {
     return 1;
 }
 
-
+#endif 
    
index 2c0b7c2eb0638535e4eb2d154d463b0c9a10e339..0ac3242a39848d285377ea237199c1b242c481df 100644 (file)
@@ -69,8 +69,8 @@ void call_vectorized_routines()
      * otherwise we can gain some speed by writing back to the
      * same array buf1
      */
-#ifdef USE_IBM_MASS
-    /* IBM provide special fast single and double routines in their MASS libraries */
+#ifdef HAVE_LIBMASSV_ANY
+    /* IBM provide special fast single and double routines in their vectorized MASS libraries */
 #ifdef DOUBLE
     code( bC ? "vrsqrt(%s,buf1,&m);" : "call vrsqrt(%s,buf1,m)",
          OVERWRITE_RSQ ? "buf1" : "buf2" );      
@@ -101,8 +101,8 @@ void call_vectorized_routines()
        * it is probably faster to square the value when
        * we use it.
        */
-#if defined(USE_IBM_MASS)
-    /* IBM stuff again. They provide a nice reciprocal */
+#ifdef HAVE_LIBMASSV_ANY
+    /* IBM stuff again. They provide a nice vectorized reciprocal, too */
 #ifdef DOUBLE
     code( bC ? "vrec(%s,buf1,&m);" : "call vrec(%s,buf1,m)",
          OVERWRITE_RSQ ? "buf1" : "buf2" );
index b9bcc545c625961c3b8936f74b86ec60776f21b8..671328a03e684e93431dc348bf072fed97580597 100644 (file)
@@ -101,7 +101,7 @@ void file_header(void)
   if(bC)
     fprintf(output,"\n\n#define x86trunc(a,b) asm(\"fld %%1 ; fistpl %%0\" : \"=m\" (*&b) : \"f\" (a));\n\n");
 #endif
-#ifdef USE_IBM_MASS
+#ifdef HAVE_LIBMASSV_ANY
   if(bC)
     fprintf(output,
            "void vsrec(float *, float *, int *);\n"
index 387c4ce0fffd68c6a056afe35cf5aeb5c9a68922..9bf5ead40423c8402a6b947ac8653df3489e67ab 100644 (file)
@@ -419,13 +419,13 @@ void parse_common_args(int *argc,char *argv[],unsigned long Flags,bool bNice,
   static int  nicelevel=0,mantp=0,npri=0;
   static bool bExcept=FALSE,bGUI=FALSE,bDebug=FALSE;
   static char *deffnm=NULL;
-  
+     
   FILE *fp;  
   bool bPrint,bExit;
   int  i,j,k,npall;
   char *ptr,*newdesc;
   char *envstr;
-  
+
   t_pargs *all_pa=NULL;
   
   t_pargs motif_pa  = { "-X",    FALSE, etBOOL,  {&bGUI},
@@ -509,8 +509,14 @@ void parse_common_args(int *argc,char *argv[],unsigned long Flags,bool bNice,
     bQuiet = TRUE;
 #endif
   
-  if (!program)
-    program  = strdup(argv[0]);
+  /* When you run a dynamically linked program before installing
+   * it, libtool uses wrapper scripts and prefixes the name with "lt-".
+   * Until libtool is fixed to set argv[0] right, rip away the prefix:
+   */
+  if(strlen(argv[0])>3 && !strncmp(argv[0],"lt-",3)) 
+    program = strdup(argv[0]+3);
+  else
+    program = strdup(argv[0]);
 
   /* Check ALL the flags ... */
   snew(all_pa,NPCA_PA+npargs);
index 0ec2ee5c77ab25cc109a921fd515f1a7d6cb1bf8..ee43e8cb1ac770258e5a49d9d7724c266d839a02 100644 (file)
@@ -1,25 +1,20 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
+
+LDADD = ../mdlib/libmd@LIBSUFFIX@.la ../gmxlib/libgmx@LIBSUFFIX@.la 
 
-# This is necessary for VPATH to work, 
-# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
-LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib
-LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
 
 bin_PROGRAMS = \
-       gromppXXX_SUFFIX_XXX            mdrunXXX_SUFFIX_XXX             \
-       tpbconvXXX_SUFFIX_XXX           pdb2gmxXXX_SUFFIX_XXX           \
-       protonateXXX_SUFFIX_XXX         nmrunXXX_SUFFIX_XXX             \
-       luckXXX_SUFFIX_XXX              gmxdumpXXX_SUFFIX_XXX           \
-       gmxcheckXXX_SUFFIX_XXX          x2topXXX_SUFFIX_XXX             \
-       xmdrunXXX_SUFFIX_XXX
+       grompp          mdrun           tpbconv         pdb2gmx         \
+       protonate       nmrun           luck            gmxdump         \
+       gmxcheck        x2top           xmdrun
 
 
 
-gromppXXX_SUFFIX_XXX_SOURCES = \
+grompp_SOURCES = \
        topio.c         toppush.c       topcat.c        topshake.c      \
        convparm.c      tomorse.c       sorting.c       splitter.c      \
        dum_parm.c      readir.c        add_par.c       topexcl.c       \
@@ -28,18 +23,12 @@ gromppXXX_SUFFIX_XXX_SOURCES = \
        sorting.h       topdirs.h       toppush.h       dum_parm.h      \
        readir.h        topcat.h        topexcl.h       topshake.h
 
-
-mdrunXXX_SUFFIX_XXX_SOURCES = \
-       mdrun.c
-
-
-tpbconvXXX_SUFFIX_XXX_SOURCES = \
+tpbconv_SOURCES = \
        readir.c        toputil.c       topdirs.c       add_par.c       \
        topexcl.c       tpbconv.c       add_par.h       toputil.h       \
        topdirs.h       readir.h        topexcl.h
 
-
-pdb2gmxXXX_SUFFIX_XXX_SOURCES = \
+pdb2gmx_SOURCES = \
        hizzie.c        xlate.c         specbond.c      ter_db.c        \
        h_db.c          genhydro.c      pdb2top.c       gen_ad.c        \
        gen_dum.c       pgutil.c        resall.c        hackblock.c     \
@@ -50,32 +39,17 @@ pdb2gmxXXX_SUFFIX_XXX_SOURCES = \
        topdirs.h       genhydro.h      hizzie.h        specbond.h      \
        topexcl.h
 
-
-protonateXXX_SUFFIX_XXX_SOURCES = \
+protonate_SOURCES = \
        hackblock.c     ter_db.c        h_db.c          genhydro.c      \
        pgutil.c        resall.c        add_par.c       topexcl.c       \
        toputil.c       topdirs.c       protonate.c     add_par.h       \
        h_db.h          resall.h        toputil.h       hackblock.h     \
        pgutil.h        ter_db.h        topdirs.h       topexcl.h
 
-
-nmrunXXX_SUFFIX_XXX_SOURCES = \
-       nmrun.c
-
-
-luckXXX_SUFFIX_XXX_SOURCES = \
-       luck.c
-
-
-gmxdumpXXX_SUFFIX_XXX_SOURCES = \
-       gmxdump.c
-
-
-gmxcheckXXX_SUFFIX_XXX_SOURCES = \
+gmxcheck_SOURCES = \
        gmxcheck.c      tpbcmp.c        tpbcmp.h
 
-
-x2topXXX_SUFFIX_XXX_SOURCES = \
+x2top_SOURCES = \
        toppush.c       nm2type.c       pdb2top.c       gen_ad.c        \
        gen_dum.c       pgutil.c        resall.c        hackblock.c     \
        add_par.c       topexcl.c       toputil.c       topdirs.c       \
@@ -84,25 +58,22 @@ x2topXXX_SUFFIX_XXX_SOURCES = \
        pgutil.h        topdirs.h       toppush.h       topexcl.h       \
        x2top.h
 
-
-xmdrunXXX_SUFFIX_XXX_SOURCES = \
+xmdrun_SOURCES = \
        glaasje.c       glaasje.h       gctio.c         init_sh.c       \
        init_sh.h       ionize.c        ionize.h        ion_data.h      \
        xmdrun.c        do_gct.c        do_gct.h        relax_sh.c
 
 
-install-mdrun: mdrunXXX_SUFFIX_XXX
-       $(mkinstalldirs) $(DESTDIR)$(bindir)
-       if test -f mdrunXXX_SUFFIX_XXX; then \
-               echo "$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) mdrunXXX_SUFFIX_XXX $(DESTDIR)$(bindir)/mdrunXXX_SUFFIX_XXX"; \
-            $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) mdrunXXX_SUFFIX_XXX $(DESTDIR)$(bindir)/mdrunXXX_SUFFIX_XXX; \
-       fi
-
+# shortcut to install only mdrun
 
+install-mdrun: mdrun$(EXEEXT)
+       $(mkinstalldirs) $(DESTDIR)$(bindir)
+       if test -f mdrun$(EXEEXT); then \
+         f="`echo mdrun$(EXEEXT)|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
+         echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f"; \
+         $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f; \
+       else :; fi
 
-# clean things explicitly, since the target names might have changed
-
-CLEANFILES   =         ${bin_PROGRAMS} ${EXTRA_PROGRAMS}       \
-               *_mpi *_d *~ \\\#*
+CLEANFILES = *~ \\\#*
 
 
index 520597624fba692c6113404273481b8d58216440..d8373af235d6175a6b5424e9f016469bd29e65ea 100644 (file)
@@ -1,23 +1,15 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
 
-# This is necessary for VPATH to work, 
-# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
+libmd@LIBSUFFIX@_la_LIBADD         = @MDLIB_LIBOBJS@   
+libmd@LIBSUFFIX@_la_DEPENDENCIES   = @MDLIB_LIBOBJS@   
 
-# Dependencies and extra objects should come before the target definition
-libmdXXX_SUFFIX_XXX_la_LIBADD         = @MDLIB_COND_OBJ@       
-libmdXXX_SUFFIX_XXX_la_DEPENDENCIES   = @MDLIB_COND_OBJ@       
+lib_LTLIBRARIES = libmd@LIBSUFFIX@.la
 
-
-
-# Finally, the library definition
-
-lib_LTLIBRARIES = libmdXXX_SUFFIX_XXX.la
-
-libmdXXX_SUFFIX_XXX_la_SOURCES = \
+libmd@LIBSUFFIX@_la_SOURCES = \
        calcmu.c        calcvir.c                       \
        congrad.c       constr.c        coupling.c      \
        dummies.c       ebin.c          edsam.c         \
@@ -34,13 +26,19 @@ libmdXXX_SUFFIX_XXX_la_SOURCES = \
        vcm.c           wnblist.c       poisson.h       \
        splittop.h      wnblist.h
 
-EXTRA_libmdXXX_SUFFIX_XXX_la_SOURCES = \
+EXTRA_libmd@LIBSUFFIX@_la_SOURCES = \
        cshake.c        csettle.c       clincs.c        \
        fshake.f        fsettle.f       flincs.f        \
        fshaked.f       fsettled.f      flincsd.f
 
-# clean things explicitly, since the target names might have changed
-CLEANFILES     = ${lib_LIBRARIES} *_d.a *_mpi.a *~ \\\#*
-
 
+# link the mpi library to non-mpi names if the latter are not present
+install-exec-hook:
+       if test `echo @LIBSUFFIX@|grep _mpi`; then \
+         mpi="libgmx@LIBSUFFIX@"; nompi=`echo $(mpi)|sed ,_mpi,,`; \
+         (cd $(libdir) && test -e $(mpi).a -a ! -e $(nompi).a && $(LN_S) $(mpi).a $(nompi).a); \
+         (cd $(libdir) && test -e $(mpi).so -a ! -e $(nompi).so && $(LN_S) $(mpi).so $(nompi).so); \
+       fi
 
+# clean all libtool libraries, since the target names might have changed
+CLEANFILES     = *.la *~ \\\#*
index 5c126a6e8d909930baeb5754385c816e75a48ea6..28c90f0bdf9cd113c80231222f70b543eeba306d 100644 (file)
@@ -57,7 +57,7 @@ static char *SRCID_md_c = "$Id$";
 
 volatile bool bGotTermSignal = FALSE, bGotUsr1Signal = FALSE;
 
-static void signal_handler(int n)
+static RETSIGTYPE signal_handler(int n)
 {
   switch (n) {
   case SIGTERM:
index 381150da0cd10a9f113ae47f4fdecf1abdbe4fb6..c9ba6e882c3e8960e8eeec5da06e12cfa14c724b 100644 (file)
@@ -1,23 +1,18 @@
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
+LDADD = ../mdlib/libmd@LIBSUFFIX@.la ../gmxlib/libgmx@LIBSUFFIX@.la
 
-# This is necessary for VPATH to work, 
-# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
-LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib 
-LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
+# Ngmx requires X11 - nothing is built if it doesn't exist
 
-# Ngmx requires X - nothing is built if it doesn't exist
+if USE_X11
 
-if USE_X11 
+bin_PROGRAMS     = ngmx xrama highway
+EXTRA_PROGRAMS   = gmxlogo dlg scrollw showcol
 
-bin_PROGRAMS     =     ngmxXXX_SUFFIX_XXX      xramaXXX_SUFFIX_XXX     \
-                       highwayXXX_SUFFIX_XXX
-
-EXTRA_PROGRAMS   =     gmxlogoXXX_SUFFIX_XXX  dlgXXX_SUFFIX_XXX        \
-                       scrollwXXX_SUFFIX_XXX showcolXXX_SUFFIX_XXX
+endif
 
 XSRC   =       xutil.c         xmb.c           x11.c           \
                xdlghi.c        fgrid.c         xdlgitem.c      \
@@ -30,27 +25,19 @@ XSRC        =       xutil.c         xmb.c           x11.c           \
                xdlg.h          xdlgitem.h      xutil.h         \
                buttons.h       fgrid.h         manager.h       \
                nener.h         nload.h         popup.h         \
-               x11.h           xdlghi.h        xmb.h           \
-               alert.bm        gromacs.bm      play.bm         \
-               rewind.bm       stop_ani.bm     ff.bm           \
-               info.bm         rama.bm         stop.bm
-
-ngmxXXX_SUFFIX_XXX_SOURCES    = ngmx.c $(XSRC)
-
-xramaXXX_SUFFIX_XXX_SOURCES   = xrama.c $(XSRC)
+               x11.h           xdlghi.h        xmb.h           
 
-highwayXXX_SUFFIX_XXX_SOURCES = highway.c $(XSRC) 
+EXTRA_DIST =   alert.bm        gromacs.bm      play.bm         \
+               rewind.bm       stop_ani.bm     ff.bm           \
+               info.bm         rama.bm         stop.bm
 
-gmxlogoXXX_SUFFIX_XXX_SOURCES = gmxlogo.c logo.c $(XSRC)
 
-dlgXXX_SUFFIX_XXX_SOURCES     = dlg.c $(XSRC)
-
-scrollwXXX_SUFFIX_XXX_SOURCES = scrollw.c $(XSRC)
-
-showcolXXX_SUFFIX_XXX_SOURCES = showcol.c $(XSRC)
-
-endif
+ngmx_SOURCES    = ngmx.c $(XSRC)
+xrama_SOURCES   = xrama.c $(XSRC)
+highway_SOURCES = highway.c $(XSRC) 
+gmxlogo_SOURCES = gmxlogo.c logo.c $(XSRC)
+dlg_SOURCES     = dlg.c $(XSRC)
+scrollw_SOURCES = scrollw.c $(XSRC)
+showcol_SOURCES = showcol.c $(XSRC)
 
-# clean things explicitly, since the target names might have changed
-CLEANFILES   =         ${bin_PROGRAMS} ${EXTRA_PROGRAMS}       \
-               *_mpi *_d *~ \\\#*
+CLEANFILES   =         *~ \\\#*
index fc9e8f86292b75f14890fc2c1ac5a92de336a0fc..9b2198867b6fe4d692bc4fd29daf7c9bc95159e4 100644 (file)
 ## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: Makefile is automatically generated from Makefile.in by the configure
+# script, and Makefile.in is generated from Makefile.am by automake.
+INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -DGMXLIBDIR=\"$(datadir)/top\"
+LDADD = ../mdlib/libmd@LIBSUFFIX@.la ../gmxlib/libgmx@LIBSUFFIX@.la
 
-# This is necessary for VPATH to work, 
-# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
-LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib 
-LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
 
 bin_PROGRAMS = \
-       averageXXX_SUFFIX_XXX           do_dsspXXX_SUFFIX_XXX           \
-       editconfXXX_SUFFIX_XXX          eneconvXXX_SUFFIX_XXX           \
-       g_analyzeXXX_SUFFIX_XXX         g_anaeigXXX_SUFFIX_XXX          \
-       g_angleXXX_SUFFIX_XXX           g_bondXXX_SUFFIX_XXX            \
-       g_bundleXXX_SUFFIX_XXX          g_chiXXX_SUFFIX_XXX             \
-       g_clusterXXX_SUFFIX_XXX         g_confrmsXXX_SUFFIX_XXX         \
-       g_covarXXX_SUFFIX_XXX           g_densityXXX_SUFFIX_XXX         \
-       g_dielectricXXX_SUFFIX_XXX      g_dihXXX_SUFFIX_XXX             \
-       g_dipolesXXX_SUFFIX_XXX         g_disreXXX_SUFFIX_XXX           \
-       g_distXXX_SUFFIX_XXX            g_dyndomXXX_SUFFIX_XXX          \
-       g_enematXXX_SUFFIX_XXX          g_energyXXX_SUFFIX_XXX          \
-       g_lieXXX_SUFFIX_XXX                                             \
-       g_gyrateXXX_SUFFIX_XXX          g_h2orderXXX_SUFFIX_XXX         \
-       g_hbondXXX_SUFFIX_XXX           g_helixXXX_SUFFIX_XXX           \
-       g_mdmatXXX_SUFFIX_XXX           g_mindistXXX_SUFFIX_XXX         \
-       g_msdXXX_SUFFIX_XXX             g_morphXXX_SUFFIX_XXX           \
-       g_nmeigXXX_SUFFIX_XXX           g_nmensXXX_SUFFIX_XXX           \
-       g_orderXXX_SUFFIX_XXX           g_potentialXXX_SUFFIX_XXX       \
-       g_ramaXXX_SUFFIX_XXX                                            \
-       g_rdfXXX_SUFFIX_XXX             g_rmsXXX_SUFFIX_XXX             \
-       g_rmsdistXXX_SUFFIX_XXX         g_rmsfXXX_SUFFIX_XXX            \
-       g_rotacfXXX_SUFFIX_XXX          g_saltbrXXX_SUFFIX_XXX          \
-       g_sasXXX_SUFFIX_XXX             g_sgangleXXX_SUFFIX_XXX         \
-       g_sorientXXX_SUFFIX_XXX         g_tcafXXX_SUFFIX_XXX            \
-       g_trajXXX_SUFFIX_XXX            g_velaccXXX_SUFFIX_XXX          \
-       genboxXXX_SUFFIX_XXX            genconfXXX_SUFFIX_XXX           \
-       genionXXX_SUFFIX_XXX            genprXXX_SUFFIX_XXX             \
-       make_ndxXXX_SUFFIX_XXX          mk_angndxXXX_SUFFIX_XXX         \
-       trjcatXXX_SUFFIX_XXX            trjconvXXX_SUFFIX_XXX           \
-       trjorderXXX_SUFFIX_XXX          wheelXXX_SUFFIX_XXX             \
-       xpm2psXXX_SUFFIX_XXX
-
-
-AUTOCORR_SRC         =         autocorr.c      expfit.c        polynomials.c   \
-                       levenmar.c
-
-averageXXX_SUFFIX_XXX_SOURCES      =    average.c
-
-do_dsspXXX_SUFFIX_XXX_SOURCES      =    do_dssp.c
-
-editconfXXX_SUFFIX_XXX_SOURCES     =    editconf.c
-
-eneconvXXX_SUFFIX_XXX_SOURCES      =    eneconv.c
-
-g_analyzeXXX_SUFFIX_XXX_SOURCES    =   g_analyze.c     $(AUTOCORR_SRC)
-
-g_anaeigXXX_SUFFIX_XXX_SOURCES     =   g_anaeig.c      eigio.c
-
-g_angleXXX_SUFFIX_XXX_SOURCES      =   g_angle.c       anadih.c        $(AUTOCORR_SRC)
-
-g_bondXXX_SUFFIX_XXX_SOURCES       =   g_bond.c        lsq.c
-
-g_bundleXXX_SUFFIX_XXX_SOURCES     =   g_bundle.c
-
-g_chiXXX_SUFFIX_XXX_SOURCES        =   g_chi.c         anadih.c        pp2shift.c      \
-                       pp2shift.h      dlist.c         $(AUTOCORR_SRC)
-
-g_clusterXXX_SUFFIX_XXX_SOURCES    =   g_cluster.c     ql77.c          ql77.h          \
-                       cmat.c
-
-g_confrmsXXX_SUFFIX_XXX_SOURCES    =    g_confrms.c
-
-g_covarXXX_SUFFIX_XXX_SOURCES      =   g_covar.c       eigio.c         ql77.c          \
-                       ql77.h
-
-g_densityXXX_SUFFIX_XXX_SOURCES    =    g_density.c
-
-g_dielectricXXX_SUFFIX_XXX_SOURCES =   g_dielectric.c  $(AUTOCORR_SRC)
-
-g_dihXXX_SUFFIX_XXX_SOURCES        =    g_dih.c
-
-g_dipolesXXX_SUFFIX_XXX_SOURCES    =   g_dipoles.c     lsq.c           $(AUTOCORR_SRC)
-
-g_disreXXX_SUFFIX_XXX_SOURCES      =    g_disre.c
-
-g_distXXX_SUFFIX_XXX_SOURCES       =    g_dist.c
-
-g_dyndomXXX_SUFFIX_XXX_SOURCES     =    g_dyndom.c
-
-g_enematXXX_SUFFIX_XXX_SOURCES     =    g_enemat.c
-
-g_energyXXX_SUFFIX_XXX_SOURCES     =   g_energy.c      $(AUTOCORR_SRC)
-
-g_lieXXX_SUFFIX_XXX_SOURCES        =   g_lie.c
-
-g_gyrateXXX_SUFFIX_XXX_SOURCES     =    g_gyrate.c
-
-g_h2orderXXX_SUFFIX_XXX_SOURCES    =    g_h2order.c
-
-g_hbondXXX_SUFFIX_XXX_SOURCES      =   g_hbond.c       $(AUTOCORR_SRC)
-
-g_helixXXX_SUFFIX_XXX_SOURCES      =   g_helix.c       hxprops.c       hxprops.h       \
-                       fitahx.c        fitahx.h
-
-g_mdmatXXX_SUFFIX_XXX_SOURCES      =    g_mdmat.c
-
-g_mindistXXX_SUFFIX_XXX_SOURCES    =    g_mindist.c
-
-g_msdXXX_SUFFIX_XXX_SOURCES        =   g_msd.c         lsq.c
-
-g_morphXXX_SUFFIX_XXX_SOURCES      =   g_morph.c
-
-g_nmeigXXX_SUFFIX_XXX_SOURCES      =   g_nmeig.c       eigio.c         eigio.h         \
-                       ql77.c          ql77.h
-
-g_nmensXXX_SUFFIX_XXX_SOURCES      =   g_nmens.c       eigio.c 
-
-g_orderXXX_SUFFIX_XXX_SOURCES      =   g_order.c
-
-g_potentialXXX_SUFFIX_XXX_SOURCES  =   g_potential.c
-
-g_ramaXXX_SUFFIX_XXX_SOURCES       =   g_rama.c
-
-g_rdfXXX_SUFFIX_XXX_SOURCES        =   g_rdf.c         $(AUTOCORR_SRC)
-
-g_rmsXXX_SUFFIX_XXX_SOURCES        =   g_rms.c         cmat.c          cmat.h
-
-g_rmsdistXXX_SUFFIX_XXX_SOURCES    =   g_rmsdist.c
-
-g_rmsfXXX_SUFFIX_XXX_SOURCES       =   g_rmsf.c        ql77.c          ql77.h
-
-g_rotacfXXX_SUFFIX_XXX_SOURCES     =   g_rotacf.c      $(AUTOCORR_SRC)
-
-g_saltbrXXX_SUFFIX_XXX_SOURCES     =   g_saltbr.c      
-
-g_sasXXX_SUFFIX_XXX_SOURCES        =   g_sas.c         nsc.c           nsc.h
-
-g_sgangleXXX_SUFFIX_XXX_SOURCES    =   g_sgangle.c     
-
-g_sorientXXX_SUFFIX_XXX_SOURCES    =   g_sorient.c     
-
-g_tcafXXX_SUFFIX_XXX_SOURCES       =   g_tcaf.c        $(AUTOCORR_SRC)
-
-g_trajXXX_SUFFIX_XXX_SOURCES       =   g_traj.c
-
-g_velaccXXX_SUFFIX_XXX_SOURCES     =   g_velacc.c      $(AUTOCORR_SRC)
-
-genboxXXX_SUFFIX_XXX_SOURCES       =   genbox.c        addconf.c       addconf.h
-
-genconfXXX_SUFFIX_XXX_SOURCES      =   genconf.c  
-
-genionXXX_SUFFIX_XXX_SOURCES       =   genion.c        calcpot.c       calcpot.h       edittop.c
-
-genprXXX_SUFFIX_XXX_SOURCES        =   genpr.c  
-
-make_ndxXXX_SUFFIX_XXX_SOURCES     =   make_ndx.c  
-
-mk_angndxXXX_SUFFIX_XXX_SOURCES    =   mk_angndx.c  
-
-trjcatXXX_SUFFIX_XXX_SOURCES       =   trjcat.c
-
-trjconvXXX_SUFFIX_XXX_SOURCES      =   trjconv.c
-
-trjorderXXX_SUFFIX_XXX_SOURCES     =   trjorder.c
-
-wheelXXX_SUFFIX_XXX_SOURCES        =   wheel.c
-
-xpm2psXXX_SUFFIX_XXX_SOURCES       =   xpm2ps.c
-
-
-# clean things explicitly, since the target names might have changed
-CLEANFILES   =         ${bin_PROGRAMS} ${EXTRA_PROGRAMS}       \
-               *_mpi *_d *~ \\\#*
+       average         do_dssp         editconf        eneconv         \
+       g_analyze       g_anaeig        g_angle         g_bond          \
+       g_bundle        g_chi           g_cluster       g_confrms       \
+       g_covar         g_density       g_dielectric    g_dih           \
+       g_dipoles       g_disre         g_dist          g_dyndom        \
+       g_enemat        g_energy        g_lie           g_gyrate        \
+       g_h2order       g_hbond         g_helix         g_mdmat         \
+       g_mindist       g_msd           g_morph         g_nmeig         \
+       g_nmens         g_order         g_potential     g_rama          \
+       g_rdf           g_rms           g_rmsdist       g_rmsf          \
+       g_rotacf        g_saltbr        g_sas           g_sgangle       \
+       g_sorient       g_tcaf          g_traj          g_velacc        \
+       genbox          genconf         genion          genpr           \
+       make_ndx        mk_angndx       trjcat          trjconv         \
+       trjorder        wheel           xpm2ps
+
+
+AUTOCORR_SRC         =         autocorr.c expfit.c polynomials.c levenmar.c
+
+# Note: you don't have to list sources for "prog" if it is the single file prog.c
+
+g_analyze_SOURCES    =         g_analyze.c $(AUTOCORR_SRC)
+g_anaeig_SOURCES     =         g_anaeig.c eigio.c
+g_angle_SOURCES      =         g_angle.c anadih.c $(AUTOCORR_SRC)
+g_bond_SOURCES       =         g_bond.c lsq.c
+g_chi_SOURCES        =         g_chi.c anadih.c pp2shift.c pp2shift.h dlist.c $(AUTOCORR_SRC)
+g_cluster_SOURCES    =         g_cluster.c cmat.c ql77.c ql77.h        
+g_covar_SOURCES      =         g_covar.c eigio.c ql77.c ql77.h
+g_dielectric_SOURCES =         g_dielectric.c $(AUTOCORR_SRC)
+g_dipoles_SOURCES    =         g_dipoles.c lsq.c $(AUTOCORR_SRC)
+g_energy_SOURCES     =         g_energy.c $(AUTOCORR_SRC)
+g_hbond_SOURCES      =         g_hbond.c $(AUTOCORR_SRC)
+g_helix_SOURCES      =         g_helix.c hxprops.c hxprops.h fitahx.c fitahx.h
+g_msd_SOURCES        =         g_msd.c lsq.c
+g_nmeig_SOURCES      =         g_nmeig.c eigio.c eigio.h ql77.c ql77.h
+g_nmens_SOURCES      =         g_nmens.c eigio.c       
+g_rdf_SOURCES        =         g_rdf.c $(AUTOCORR_SRC)
+g_rms_SOURCES        =         g_rms.c cmat.c cmat.h
+g_rmsf_SOURCES       =         g_rmsf.c ql77.c ql77.h
+g_rotacf_SOURCES     =         g_rotacf.c $(AUTOCORR_SRC)
+g_sas_SOURCES        =         g_sas.c nsc.c nsc.h
+g_tcaf_SOURCES       =         g_tcaf.c $(AUTOCORR_SRC)
+g_velacc_SOURCES     =         g_velacc.c $(AUTOCORR_SRC)
+genbox_SOURCES       =         genbox.c addconf.c addconf.h
+genion_SOURCES       =         genion.c calcpot.c calcpot.h edittop.c
+
+CLEANFILES   =         *~ \\\#*