[clipper] 01/05: Imported Upstream version 2.1.20140911

Frédéric-Emmanuel Picca picca at moszumanska.debian.org
Wed Dec 31 10:59:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

picca pushed a commit to branch master
in repository clipper.

commit 47e9d419210468ae8b785bb0dabe09ea6231c071
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Wed Dec 31 11:21:45 2014 +0100

    Imported Upstream version 2.1.20140911
---
 Makefile.in                              |  236 ++--
 aclocal.m4                               |  276 +++--
 build-aux/ar-lib                         |    2 +-
 build-aux/config.guess                   |  619 +++++-----
 build-aux/config.sub                     |  290 +++--
 build-aux/depcomp                        |  531 ++++++---
 build-aux/install-sh                     |   35 +-
 build-aux/missing                        |  461 +++-----
 clipper.pc.in                            |    2 +-
 clipper/Makefile.am                      |   24 +-
 clipper/Makefile.in                      |  345 +++---
 clipper/cif/cif_data_io.cpp              |  123 +-
 clipper/clipper-mmdbold.h                |    9 -
 clipper/contrib/Makefile.in              |  157 ++-
 clipper/core/Makefile.am                 |    4 +-
 clipper/core/Makefile.in                 |  161 +--
 clipper/core/clipper_sysdep.h            |   10 +-
 clipper/core/ramachandran.cpp            | 1831 ++++++++++++++++++++++++++++++
 clipper/core/ramachandran.h              |    2 +-
 clipper/core/spacegroup.cpp              |    2 +-
 clipper/minimol/minimol_io.cpp           |   34 +-
 clipper/mmdb/clipper_mmdb.cpp            |   66 +-
 clipper/mmdb/clipper_mmdb.h              |   36 +-
 clipper/mmdbold/clipper_mmdb.cpp         |  888 ---------------
 clipper/mmdbold/clipper_mmdb.h           |  519 ---------
 clipper/mmdbold/clipper_mmdb_types.cpp   |  171 ---
 clipper/mmdbold/clipper_mmdb_types.h     |  272 -----
 clipper/mmdbold/clipper_mmdb_wrapper.cpp |  103 --
 clipper/mmdbold/clipper_mmdb_wrapper.h   |  110 --
 clipper/mmdbold/container_mmdb.cpp       |   95 --
 clipper/mmdbold/container_mmdb.h         |   74 --
 configure                                | 1207 ++++++++++----------
 configure.ac                             |   25 +-
 examples/Makefile.am                     |    2 +-
 examples/Makefile.in                     |  153 ++-
 examples/maketestdata.cpp                |    2 +-
 examples/sftest.cpp                      |    2 +-
 m4/fftw.m4                               |   20 +-
 38 files changed, 4334 insertions(+), 4565 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 502dd90..2fbe2ca 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,17 +79,18 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/clipper.pc.in \
-	$(srcdir)/config.h.in $(top_srcdir)/build-aux/ar-lib \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/config.h.in $(srcdir)/clipper.pc.in AUTHORS COPYING \
+	ChangeLog INSTALL README build-aux/ar-lib \
+	build-aux/config.guess build-aux/config.sub build-aux/depcomp \
+	build-aux/install-sh build-aux/missing build-aux/ltmain.sh \
+	$(top_srcdir)/build-aux/ar-lib \
 	$(top_srcdir)/build-aux/config.guess \
 	$(top_srcdir)/build-aux/config.sub \
 	$(top_srcdir)/build-aux/install-sh \
 	$(top_srcdir)/build-aux/ltmain.sh \
-	$(top_srcdir)/build-aux/missing $(top_srcdir)/configure \
-	AUTHORS COPYING ChangeLog INSTALL build-aux/ar-lib \
-	build-aux/config.guess build-aux/config.sub build-aux/depcomp \
-	build-aux/install-sh build-aux/ltmain.sh build-aux/missing
+	$(top_srcdir)/build-aux/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
 	$(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -90,13 +119,14 @@ am__v_at_0 = @
 am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -133,9 +163,30 @@ am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
 DATA = $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
@@ -214,7 +265,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-FFTW_LIBS = @FFTW_LIBS@
+FFTW2_LIBS = @FFTW2_LIBS@
 FGREP = @FGREP@
 FLIBS = @FLIBS@
 GREP = @GREP@
@@ -425,14 +476,13 @@ uninstall-pkgconfigDATA:
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
@@ -453,31 +503,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-cscopelist-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-	done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -493,12 +525,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -510,15 +537,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -527,18 +550,16 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
-
 cscope: cscope.files
 	test ! -s cscope.files \
 	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
 clean-cscope:
 	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
 
-cscope.files: clean-cscope cscopelist-recursive cscopelist
-
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -672,9 +693,9 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod u+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
@@ -844,27 +865,24 @@ ps-am:
 
 uninstall-am: uninstall-pkgconfigDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	cscopelist-recursive ctags-recursive install-am install-strip \
-	tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-cscope \
-	clean-generic clean-libtool cscope cscopelist \
-	cscopelist-recursive ctags ctags-recursive dist dist-all \
-	dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
-	dist-zip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs installdirs-am maintainer-clean \
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-cscope clean-generic \
+	clean-libtool cscope cscopelist-am ctags ctags-am dist \
+	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
+	dist-xz dist-zip distcheck distclean distclean-generic \
+	distclean-hdr distclean-libtool distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-pkgconfigDATA \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-pkgconfigDATA
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-pkgconfigDATA
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/aclocal.m4 b/aclocal.m4
index 773875e..2f330dc 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
@@ -19,24 +20,22 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 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.
 
-# serial 8
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.12'
+[am__api_version='1.13'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.12.2], [],
+m4_if([$1], [1.13.4], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -52,19 +51,17 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.12.2])dnl
+[AM_AUTOMAKE_VERSION([1.13.4])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 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.
 
-# serial 1
-
 # AM_PROG_AR([ACT-IF-FAIL])
 # -------------------------
 # Try to determine the archiver interface, and trigger the ar-lib wrapper
@@ -120,14 +117,12 @@ AC_SUBST([AR])dnl
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
-# serial 2
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
@@ -175,14 +170,12 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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.
 
-# serial 10
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
@@ -208,13 +201,12 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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.
 
-# serial 17
 
 # 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,
@@ -400,19 +392,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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.
 
-# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -441,7 +432,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -477,14 +468,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
 
-# serial 19
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
@@ -500,7 +489,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -530,8 +519,7 @@ AC_SUBST([CYGPATH_W])
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
 [AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated.  For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+             [$0: two- and three-arguments forms are deprecated.])
 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
@@ -585,18 +573,15 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
 		  [_AM_DEPENDENCIES([OBJC])],
 		  [m4_define([AC_PROG_OBJC],
 			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
 		  [_AM_DEPENDENCIES([OBJCXX])],
 		  [m4_define([AC_PROG_OBJCXX],
-			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
@@ -630,14 +615,12 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
-# serial 8
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -653,14 +636,12 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 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.
 
-# serial 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -677,14 +658,12 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
 
-# serial 7
-
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
 # Control maintainer-specific portions of Makefiles.
@@ -712,18 +691,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 ]
 )
 
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
-# serial 5
-
 # AM_MAKE_INCLUDE()
 # -----------------
 # Check to see how make treats includes.
@@ -768,14 +743,12 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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.
 
-# serial 7
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -783,11 +756,10 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # 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.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -800,8 +772,8 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   AC_MSG_WARN(['missing' script is too old or missing])
@@ -810,14 +782,12 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
-# serial 6
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
@@ -843,14 +813,12 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
 
-# serial 9
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
@@ -926,14 +894,12 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 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.
 
-# serial 3
-
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
 # Enable less verbose build rules; with the default set to DEFAULT
@@ -988,14 +954,12 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
-# serial 2
-
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor 'install' (even GNU) is that you can't
@@ -1018,14 +982,12 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 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.
 
-# serial 3
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1039,14 +1001,12 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 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.
 
-# serial 3
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
@@ -1060,76 +1020,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
diff --git a/build-aux/ar-lib b/build-aux/ar-lib
index 67f5f36..fe2301e 100755
--- a/build-aux/ar-lib
+++ b/build-aux/ar-lib
@@ -4,7 +4,7 @@
 me=ar-lib
 scriptversion=2012-03-01.08; # UTC
 
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2013 Free Software Foundation, Inc.
 # Written by Peter Rosin <peda at lysator.liu.se>.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/build-aux/config.guess b/build-aux/config.guess
index da83314..c6fad2f 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2009-04-27'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2009-04-27'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -56,8 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,12 +132,43 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
+case "${UNAME_MACHINE}" in
+  i?86)
+     test -z "$VENDOR" && VENDOR=pc
+     ;;
+  *)
+     test -z "$VENDOR" && VENDOR=unknown
+     ;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -170,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep __ELF__ >/dev/null
+			| grep -q __ELF__
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
@@ -180,7 +204,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -201,21 +225,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-${VENDOR}-bitrig${UNAME_RELEASE}
+	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
 	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
@@ -223,7 +251,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +297,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -280,13 +311,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo alpha-dec-winnt3.5
 	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
+	echo m68k-${VENDOR}-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo ${UNAME_MACHINE}-${VENDOR}-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo ${UNAME_MACHINE}-${VENDOR}-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -295,13 +326,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+	echo arm-${VENDOR}-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
@@ -333,6 +364,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
 	eval $set_cc_for_build
 	SUN_ARCH="i386"
@@ -391,23 +425,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-${VENDOR}-mint${UNAME_RELEASE}
+	exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -477,8 +511,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -491,7 +525,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -548,7 +582,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -591,52 +625,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+			esac ;;
+		    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
+		    sed 's/^		//' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -656,7 +690,7 @@ EOF
 	    # => hppa64-hp-hpux11.23
 
 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep __LP64__ >/dev/null
+		grep -q __LP64__
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -717,9 +751,9 @@ EOF
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo ${UNAME_MACHINE}-${VENDOR}-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -727,22 +761,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+	exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+	exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+	exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+	exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -766,62 +800,70 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
 	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
-    *:Interix*:[3456]*)
-    	case ${UNAME_MACHINE} in
+    *:Interix*:*)
+	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
-	    EM64T | authenticamd | genuineintel)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-${VENDOR}-interix${UNAME_RELEASE}
 		exit ;;
 	esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
 	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -832,220 +874,167 @@ EOF
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
+	echo x86_64-${VENDOR}-cygwin
 	exit ;;
     p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
+	echo powerpcle-${VENDOR}-cygwin
 	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabi
+	    else
+		echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabihf
+	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    i*86:Linux:*:*)
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
-    mips:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef mips
-	#undef mipsel
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mipsel
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    mips64:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 	#undef CPU
-	#undef mips64
-	#undef mips64el
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mips64el
+	CPU=${UNAME_MACHINE}el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips64
+	CPU=${UNAME_MACHINE}
 	#else
 	CPU=
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
-	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+    or32:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-${VENDOR}-linux-${LIBC}
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-${VENDOR}-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-${VENDOR}-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-${VENDOR}-linux-${LIBC} ;;
+	  *)    echo hppa-${VENDOR}-linux-${LIBC} ;;
 	esac
 	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+    ppc64:Linux:*:*)
+	echo powerpc64-${VENDOR}-linux-${LIBC}
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-${VENDOR}-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-${VENDOR}-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-${VENDOR}-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
 	exit ;;
-    i*86:Linux:*:*)
-	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us. cd to the root directory to prevent
-	# problems with other programs or directories called `ld' in the path.
-	# Set LC_ALL=C to ensure ld outputs messages in English.
-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-			 | sed -ne '/supported targets:/!d
-				    s/[ 	][ 	]*/ /g
-				    s/.*supported targets: *//
-				    s/ .*//
-				    p'`
-        case "$ld_supported_targets" in
-	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-		;;
-	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit ;;
-	  "")
-		# Either a pre-BFD a.out linker (linux-gnuoldld) or
-		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit ;;
-	esac
-	# Determine whether the default compiler is a.out or elf
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#ifdef __ELF__
-	# ifdef __GLIBC__
-	#  if __GLIBC__ >= 2
-	LIBC=gnu
-	#  else
-	LIBC=gnulibc1
-	#  endif
-	# else
-	LIBC=gnulibc1
-	# endif
-	#else
-	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-	LIBC=gnu
-	#else
-	LIBC=gnuaout
-	#endif
-	#endif
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^LIBC/{
-		s: ::g
-		p
-	    }'`"
-	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-		exit
-	}
-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
@@ -1053,11 +1042,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+	# Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -1066,16 +1055,16 @@ EOF
 	echo ${UNAME_MACHINE}-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo ${UNAME_MACHINE}-${VENDOR}-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo ${UNAME_MACHINE}-${VENDOR}-atheos
 	exit ;;
     i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
 	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-${VENODR}-lynxos${UNAME_RELEASE}
 	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1089,13 +1078,13 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
@@ -1117,13 +1106,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
 	# prints for the "djgpp" host, or else GDB configury will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
-        exit ;;
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1134,7 +1123,7 @@ EOF
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-${VENODR}-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1158,8 +1147,8 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 	OS_REL='.3'
 	test -r /etc/.relid \
@@ -1171,19 +1160,19 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
 	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
@@ -1202,10 +1191,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1231,11 +1220,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv${UNAME_RELEASE}
 	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-${VENDOR}-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1248,6 +1237,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-${VENDOR}-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1274,9 +1266,21 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1290,7 +1294,10 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1314,13 +1321,13 @@ EOF
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo ${UNAME_MACHINE}-${VENDOR}-plan9
 	exit ;;
     *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
+	echo pdp10-${VENDOR}-tops10
 	exit ;;
     *:TENEX:*:*)
-	echo pdp10-unknown-tenex
+	echo pdp10-${VENDOR}-tenex
 	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
@@ -1329,19 +1336,19 @@ EOF
 	echo pdp10-xkl-tops20
 	exit ;;
     *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
+	echo pdp10-${VENDOR}-tops20
 	exit ;;
     *:ITS:*:*)
-	echo pdp10-unknown-its
+	echo pdp10-${VENDOR}-its
 	exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1359,11 +1366,11 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-esx
+	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
 eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
@@ -1381,11 +1388,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+	"4"
 #else
-	  ""
+	""
 #endif
-         ); exit (0);
+	); exit (0);
 #endif
 #endif
 
diff --git a/build-aux/config.sub b/build-aux/config.sub
index a39437d..8b612ab 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,44 +1,40 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2009-04-17'
+timestamp='2013-04-24'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -72,8 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,13 +115,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -149,10 +149,13 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
+	-bluegene*)
+		os=-cnk
+		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
@@ -167,10 +170,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -215,6 +218,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -239,20 +248,27 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -270,32 +286,45 @@ case $basic_machine in
 	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
-	| nios | nios2 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| or32 \
+	| open8 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
-	| v850 | v850e \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12)
-		# Motorola 68HC11/12.
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -305,6 +334,21 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -319,25 +363,30 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -355,28 +404,34 @@ case $basic_machine in
 	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
-	| nios-* | nios2-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
 	| tron-* \
-	| v850-* | v850e-* | vax-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -401,7 +456,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -467,11 +522,24 @@ case $basic_machine in
 		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
 		os=-linux
 		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-        cegcc)
+	cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -503,7 +571,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16)
+	cr16 | cr16-*)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -661,7 +729,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -719,6 +786,13 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	microblaze*)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
@@ -755,10 +829,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -823,6 +905,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -905,9 +993,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -932,7 +1021,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1001,6 +1094,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -1057,20 +1153,8 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
-		;;
 	tile*)
-		basic_machine=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1140,6 +1224,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1237,9 +1324,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=-auroraux
+		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1260,22 +1350,23 @@ case $os in
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-	      | -kopensolaris* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1283,7 +1374,7 @@ case $os in
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1322,7 +1413,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1371,7 +1462,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1407,15 +1498,14 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
 	-dicos*)
 		os=-dicos
 		;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1438,10 +1528,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+	score-*)
 		os=-elf
 		;;
-        spu-*)
+	spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1453,8 +1543,20 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-        c4x-* | tic4x-*)
-        	os=-coff
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1474,14 +1576,11 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
-        mep-*)
+	mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1490,6 +1589,9 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
@@ -1508,7 +1610,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
@@ -1613,7 +1715,7 @@ case $basic_machine in
 			-sunos*)
 				vendor=sun
 				;;
-			-aix*)
+			-cnk*|-aix*)
 				vendor=ibm
 				;;
 			-beos*)
diff --git a/build-aux/depcomp b/build-aux/depcomp
index df8eea7..4ebd5b3 100755
--- a/build-aux/depcomp
+++ b/build-aux/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # 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
@@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -57,6 +56,66 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -80,18 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -114,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -123,13 +198,17 @@ gcc3)
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -137,31 +216,31 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -179,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -188,43 +266,41 @@ sgi)
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -237,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -248,44 +322,100 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
 
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -297,8 +427,8 @@ icc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -309,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -322,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -333,77 +461,107 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
-	       s/^ *//
-	       s/ \\*$//
-	       s/$/:/
-	       p
-	     }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
 
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
@@ -422,7 +580,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,18 +600,18 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -503,12 +661,15 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -525,7 +686,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -544,10 +705,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -579,23 +740,23 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-	set fnord "$@"
-	shift
-	shift
-	;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-	set fnord "$@" "$arg"
-	shift
-	shift
-	;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/build-aux/install-sh b/build-aux/install-sh
index 6781b98..377bb86 100755
--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
 	shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
 	      if test -z "$dir_arg" || {
 		   # Check for POSIX incompatibilities with -m.
 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
+		   # other-writable bit of parent directory when it shouldn't.
 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
 		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
 		   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/build-aux/missing b/build-aux/missing
index 28055d2..cdea514 100755
--- a/build-aux/missing
+++ b/build-aux/missing
@@ -1,11 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-06-26.16; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # 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
@@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -100,272 +70,141 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-	   sed 's/\.am$/.in/' |
-	   while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo "#! /bin/sh"
-	echo "# Created by GNU Automake missing as a replacement of"
-	echo "#  $ $@"
-	echo "exit 0"
-	chmod +x $file
-	exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.y)
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.c
-	    fi
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.h
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f y.tab.h; then
-	echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-	echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.l)
-	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" lex.yy.c
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f lex.yy.c; then
-	echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo ".ab help2man is required to generate this page"
-	exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
-
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-exit 0
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/clipper.pc.in b/clipper.pc.in
index a0bdfab..1d741de 100644
--- a/clipper.pc.in
+++ b/clipper.pc.in
@@ -8,5 +8,5 @@ Description: crystallographic automation and complex data manipulation libraries
 Version: @VERSION@
 Requires: @CLIPPER_REQUIRES@
 Libs: -L${libdir} @CLIPPER_LIBS@
-Libs.private: @FFTW_LIBS@ -lm @PTHREAD_LIBS@
+Libs.private: @FFTW2_LIBS@ -lm @PTHREAD_LIBS@
 Cflags: -I${includedir} @PTHREAD_CFLAGS@
diff --git a/clipper/Makefile.am b/clipper/Makefile.am
index d5d0197..ae5a169 100644
--- a/clipper/Makefile.am
+++ b/clipper/Makefile.am
@@ -3,7 +3,7 @@ pkginclude_HEADERS = \
 clipper-ccp4.h          clipper-contrib.h       clipper-phs.h \
 clipper-cctbx.h         clipper-minimol.h       clipper.h \
 clipper-cif.h           clipper-mmdb.h          minimal-clipper-hkl.h \
-clipper-cns.h           clipper-mmdbold.h       minimal-clipper-map.h
+clipper-cns.h           minimal-clipper-map.h
 
 SUBDIRS = core
 
@@ -18,7 +18,7 @@ lib_LTLIBRARIES =
 if BUILD_MMDB
 lib_LTLIBRARIES += mmdb/libclipper-mmdb.la
 mmdb_libclipper_mmdb_la_LDFLAGS = @VERSION_INFO@
-mmdb_libclipper_mmdb_la_LIBADD = core/libclipper-core.la -lmmdb
+mmdb_libclipper_mmdb_la_LIBADD = core/libclipper-core.la -lmmdb2
 mmdb_libclipper_mmdb_la_SOURCES = mmdb/clipper_mmdb.cpp
 mmdb_includedir=$(pkgincludedir)/mmdb
 mmdb_include_HEADERS = mmdb/clipper_mmdb.h
@@ -27,10 +27,10 @@ endif
 if BUILD_MINIMOL
 lib_LTLIBRARIES += minimol/libclipper-minimol.la
 minimol_libclipper_minimol_la_LDFLAGS = @VERSION_INFO@
-# minimol uses libmmdb directly (although <mmdb/mmdb_manager.h> is included
+# minimol uses libmmdb directly (although <mmdb2/mmdb_manager.h> is included
 # indirectly, via clipper/clipper-mmdb.h)
 minimol_libclipper_minimol_la_LIBADD = core/libclipper-core.la \
-				       mmdb/libclipper-mmdb.la -lmmdb
+				       mmdb/libclipper-mmdb.la -lmmdb2
 minimol_libclipper_minimol_la_SOURCES = \
  minimol/minimol.cpp    minimol/container_minimol.cpp minimol/minimol_data.cpp \
  minimol/minimol_io.cpp minimol/minimol_seq.cpp       minimol/minimol_utils.cpp
@@ -52,26 +52,12 @@ endif
 if BUILD_CIF
 lib_LTLIBRARIES += cif/libclipper-cif.la
 cif_libclipper_cif_la_LDFLAGS = @VERSION_INFO@
-cif_libclipper_cif_la_LIBADD = core/libclipper-core.la -lmmdb
+cif_libclipper_cif_la_LIBADD = core/libclipper-core.la -lmmdb2
 cif_libclipper_cif_la_SOURCES = cif/cif_data_io.cpp
 cif_includedir=$(pkgincludedir)/cif
 cif_include_HEADERS = cif/cif_data_io.h
 endif
 
-if BUILD_MMDBOLD
-lib_LTLIBRARIES += mmdbold/libclipper-mmdbold.la
-mmdbold_libclipper_mmdbold_la_LDFLAGS = @VERSION_INFO@
-mmdbold_libclipper_mmdbold_la_LIBADD = core/libclipper-core.la -lmmdb
-mmdbold_libclipper_mmdbold_la_SOURCES = \
-        mmdbold/clipper_mmdb.cpp        mmdbold/clipper_mmdb_wrapper.cpp \
-       	mmdbold/clipper_mmdb_types.cpp  mmdbold/container_mmdb.cpp
-mmdbold_includedir=$(pkgincludedir)/mmdbold
-mmdbold_include_HEADERS = \
-        mmdbold/clipper_mmdb.h          mmdbold/clipper_mmdb_wrapper.h \
-        mmdbold/clipper_mmdb_types.h    mmdbold/container_mmdb.h
-EXTRA_DIST = mmdbold/clipper_mmdb.dox
-endif
-
 if BUILD_CCP4
 lib_LTLIBRARIES += ccp4/libclipper-ccp4.la
 ccp4_libclipper_ccp4_la_LDFLAGS = @VERSION_INFO@
diff --git a/clipper/Makefile.in b/clipper/Makefile.in
index aec4cee..d6f5cfc 100644
--- a/clipper/Makefile.in
+++ b/clipper/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,23 +16,51 @@
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -56,22 +84,20 @@ host_triplet = @host@
 @BUILD_MINIMOL_TRUE at am__append_3 = minimol/libclipper-minimol.la
 @BUILD_PHS_TRUE at am__append_4 = phs/libclipper-phs.la
 @BUILD_CIF_TRUE at am__append_5 = cif/libclipper-cif.la
- at BUILD_MMDBOLD_TRUE@am__append_6 = mmdbold/libclipper-mmdbold.la
- at BUILD_CCP4_TRUE@am__append_7 = ccp4/libclipper-ccp4.la
- at BUILD_CCTBX_TRUE@am__append_8 = cctbx/libclipper-cctbx.la
- at BUILD_CNS_TRUE@am__append_9 = cns/libclipper-cns.la
- at BUILD_FORTRAN_TRUE@am__append_10 = fortran/libclipper-fortran.la
+ at BUILD_CCP4_TRUE@am__append_6 = ccp4/libclipper-ccp4.la
+ at BUILD_CCTBX_TRUE@am__append_7 = cctbx/libclipper-cctbx.la
+ at BUILD_CNS_TRUE@am__append_8 = cns/libclipper-cns.la
+ at BUILD_FORTRAN_TRUE@am__append_9 = fortran/libclipper-fortran.la
 subdir = clipper
-DIST_COMMON = $(am__ccp4_include_HEADERS_DIST) \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/build-aux/depcomp \
+	$(am__ccp4_include_HEADERS_DIST) \
 	$(am__cctbx_include_HEADERS_DIST) \
 	$(am__cif_include_HEADERS_DIST) \
 	$(am__cns_include_HEADERS_DIST) \
 	$(am__minimol_include_HEADERS_DIST) \
 	$(am__mmdb_include_HEADERS_DIST) \
-	$(am__mmdbold_include_HEADERS_DIST) \
-	$(am__phs_include_HEADERS_DIST) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(top_srcdir)/build-aux/depcomp
+	$(am__phs_include_HEADERS_DIST) $(pkginclude_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
 	$(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -115,9 +141,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ccp4_includedir)" \
 	"$(DESTDIR)$(cctbx_includedir)" "$(DESTDIR)$(cif_includedir)" \
 	"$(DESTDIR)$(cns_includedir)" \
 	"$(DESTDIR)$(minimol_includedir)" \
-	"$(DESTDIR)$(mmdb_includedir)" \
-	"$(DESTDIR)$(mmdbold_includedir)" \
-	"$(DESTDIR)$(phs_includedir)" "$(DESTDIR)$(pkgincludedir)"
+	"$(DESTDIR)$(mmdb_includedir)" "$(DESTDIR)$(phs_includedir)" \
+	"$(DESTDIR)$(pkgincludedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 @BUILD_CCP4_TRUE at ccp4_libclipper_ccp4_la_DEPENDENCIES =  \
 @BUILD_CCP4_TRUE@	core/libclipper-core.la
@@ -222,24 +247,6 @@ mmdb_libclipper_mmdb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
 	$(AM_CXXFLAGS) $(CXXFLAGS) $(mmdb_libclipper_mmdb_la_LDFLAGS) \
 	$(LDFLAGS) -o $@
 @BUILD_MMDB_TRUE at am_mmdb_libclipper_mmdb_la_rpath = -rpath $(libdir)
- at BUILD_MMDBOLD_TRUE@mmdbold_libclipper_mmdbold_la_DEPENDENCIES =  \
- at BUILD_MMDBOLD_TRUE@	core/libclipper-core.la
-am__mmdbold_libclipper_mmdbold_la_SOURCES_DIST =  \
-	mmdbold/clipper_mmdb.cpp mmdbold/clipper_mmdb_wrapper.cpp \
-	mmdbold/clipper_mmdb_types.cpp mmdbold/container_mmdb.cpp
- at BUILD_MMDBOLD_TRUE@am_mmdbold_libclipper_mmdbold_la_OBJECTS =  \
- at BUILD_MMDBOLD_TRUE@	mmdbold/clipper_mmdb.lo \
- at BUILD_MMDBOLD_TRUE@	mmdbold/clipper_mmdb_wrapper.lo \
- at BUILD_MMDBOLD_TRUE@	mmdbold/clipper_mmdb_types.lo \
- at BUILD_MMDBOLD_TRUE@	mmdbold/container_mmdb.lo
-mmdbold_libclipper_mmdbold_la_OBJECTS =  \
-	$(am_mmdbold_libclipper_mmdbold_la_OBJECTS)
-mmdbold_libclipper_mmdbold_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
-	$(AM_CXXFLAGS) $(CXXFLAGS) \
-	$(mmdbold_libclipper_mmdbold_la_LDFLAGS) $(LDFLAGS) -o $@
- at BUILD_MMDBOLD_TRUE@am_mmdbold_libclipper_mmdbold_la_rpath = -rpath \
- at BUILD_MMDBOLD_TRUE@	$(libdir)
 @BUILD_PHS_TRUE at phs_libclipper_phs_la_DEPENDENCIES =  \
 @BUILD_PHS_TRUE@	core/libclipper-core.la
 am__phs_libclipper_phs_la_SOURCES_DIST = phs/phs_io.cpp
@@ -291,7 +298,6 @@ SOURCES = $(ccp4_libclipper_ccp4_la_SOURCES) \
 	$(fortran_libclipper_fortran_la_SOURCES) \
 	$(minimol_libclipper_minimol_la_SOURCES) \
 	$(mmdb_libclipper_mmdb_la_SOURCES) \
-	$(mmdbold_libclipper_mmdbold_la_SOURCES) \
 	$(phs_libclipper_phs_la_SOURCES)
 DIST_SOURCES = $(am__ccp4_libclipper_ccp4_la_SOURCES_DIST) \
 	$(am__cctbx_libclipper_cctbx_la_SOURCES_DIST) \
@@ -300,15 +306,15 @@ DIST_SOURCES = $(am__ccp4_libclipper_ccp4_la_SOURCES_DIST) \
 	$(am__fortran_libclipper_fortran_la_SOURCES_DIST) \
 	$(am__minimol_libclipper_minimol_la_SOURCES_DIST) \
 	$(am__mmdb_libclipper_mmdb_la_SOURCES_DIST) \
-	$(am__mmdbold_libclipper_mmdbold_la_SOURCES_DIST) \
 	$(am__phs_libclipper_phs_la_SOURCES_DIST)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -323,20 +329,36 @@ am__minimol_include_HEADERS_DIST = minimol/container_minimol.h \
 	minimol/minimol_data.h minimol/minimol_seq.h minimol/minimol.h \
 	minimol/minimol_io.h minimol/minimol_utils.h
 am__mmdb_include_HEADERS_DIST = mmdb/clipper_mmdb.h
-am__mmdbold_include_HEADERS_DIST = mmdbold/clipper_mmdb.h \
-	mmdbold/clipper_mmdb_wrapper.h mmdbold/clipper_mmdb_types.h \
-	mmdbold/container_mmdb.h
 am__phs_include_HEADERS_DIST = phs/phs_io.h
 HEADERS = $(ccp4_include_HEADERS) $(cctbx_include_HEADERS) \
 	$(cif_include_HEADERS) $(cns_include_HEADERS) \
 	$(minimol_include_HEADERS) $(mmdb_include_HEADERS) \
-	$(mmdbold_include_HEADERS) $(phs_include_HEADERS) \
-	$(pkginclude_HEADERS)
+	$(phs_include_HEADERS) $(pkginclude_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = core contrib
@@ -398,7 +420,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-FFTW_LIBS = @FFTW_LIBS@
+FFTW2_LIBS = @FFTW2_LIBS@
 FGREP = @FGREP@
 FLIBS = @FLIBS@
 GREP = @GREP@
@@ -502,23 +524,23 @@ pkginclude_HEADERS = \
 clipper-ccp4.h          clipper-contrib.h       clipper-phs.h \
 clipper-cctbx.h         clipper-minimol.h       clipper.h \
 clipper-cif.h           clipper-mmdb.h          minimal-clipper-hkl.h \
-clipper-cns.h           clipper-mmdbold.h       minimal-clipper-map.h
+clipper-cns.h           minimal-clipper-map.h
 
 SUBDIRS = core $(am__append_1)
 AM_CPPFLAGS = -I$(top_srcdir)
 lib_LTLIBRARIES = $(am__append_2) $(am__append_3) $(am__append_4) \
 	$(am__append_5) $(am__append_6) $(am__append_7) \
-	$(am__append_8) $(am__append_9) $(am__append_10)
+	$(am__append_8) $(am__append_9)
 @BUILD_MMDB_TRUE at mmdb_libclipper_mmdb_la_LDFLAGS = @VERSION_INFO@
- at BUILD_MMDB_TRUE@mmdb_libclipper_mmdb_la_LIBADD = core/libclipper-core.la -lmmdb
+ at BUILD_MMDB_TRUE@mmdb_libclipper_mmdb_la_LIBADD = core/libclipper-core.la -lmmdb2
 @BUILD_MMDB_TRUE at mmdb_libclipper_mmdb_la_SOURCES = mmdb/clipper_mmdb.cpp
 @BUILD_MMDB_TRUE at mmdb_includedir = $(pkgincludedir)/mmdb
 @BUILD_MMDB_TRUE at mmdb_include_HEADERS = mmdb/clipper_mmdb.h
 @BUILD_MINIMOL_TRUE at minimol_libclipper_minimol_la_LDFLAGS = @VERSION_INFO@
-# minimol uses libmmdb directly (although <mmdb/mmdb_manager.h> is included
+# minimol uses libmmdb directly (although <mmdb2/mmdb_manager.h> is included
 # indirectly, via clipper/clipper-mmdb.h)
 @BUILD_MINIMOL_TRUE at minimol_libclipper_minimol_la_LIBADD = core/libclipper-core.la \
- at BUILD_MINIMOL_TRUE@				       mmdb/libclipper-mmdb.la -lmmdb
+ at BUILD_MINIMOL_TRUE@				       mmdb/libclipper-mmdb.la -lmmdb2
 
 @BUILD_MINIMOL_TRUE at minimol_libclipper_minimol_la_SOURCES = \
 @BUILD_MINIMOL_TRUE@ minimol/minimol.cpp    minimol/container_minimol.cpp minimol/minimol_data.cpp \
@@ -535,22 +557,10 @@ lib_LTLIBRARIES = $(am__append_2) $(am__append_3) $(am__append_4) \
 @BUILD_PHS_TRUE at phs_includedir = $(pkgincludedir)/phs
 @BUILD_PHS_TRUE at phs_include_HEADERS = phs/phs_io.h
 @BUILD_CIF_TRUE at cif_libclipper_cif_la_LDFLAGS = @VERSION_INFO@
- at BUILD_CIF_TRUE@cif_libclipper_cif_la_LIBADD = core/libclipper-core.la -lmmdb
+ at BUILD_CIF_TRUE@cif_libclipper_cif_la_LIBADD = core/libclipper-core.la -lmmdb2
 @BUILD_CIF_TRUE at cif_libclipper_cif_la_SOURCES = cif/cif_data_io.cpp
 @BUILD_CIF_TRUE at cif_includedir = $(pkgincludedir)/cif
 @BUILD_CIF_TRUE at cif_include_HEADERS = cif/cif_data_io.h
- at BUILD_MMDBOLD_TRUE@mmdbold_libclipper_mmdbold_la_LDFLAGS = @VERSION_INFO@
- at BUILD_MMDBOLD_TRUE@mmdbold_libclipper_mmdbold_la_LIBADD = core/libclipper-core.la -lmmdb
- at BUILD_MMDBOLD_TRUE@mmdbold_libclipper_mmdbold_la_SOURCES = \
- at BUILD_MMDBOLD_TRUE@        mmdbold/clipper_mmdb.cpp        mmdbold/clipper_mmdb_wrapper.cpp \
- at BUILD_MMDBOLD_TRUE@       	mmdbold/clipper_mmdb_types.cpp  mmdbold/container_mmdb.cpp
-
- at BUILD_MMDBOLD_TRUE@mmdbold_includedir = $(pkgincludedir)/mmdbold
- at BUILD_MMDBOLD_TRUE@mmdbold_include_HEADERS = \
- at BUILD_MMDBOLD_TRUE@        mmdbold/clipper_mmdb.h          mmdbold/clipper_mmdb_wrapper.h \
- at BUILD_MMDBOLD_TRUE@        mmdbold/clipper_mmdb_types.h    mmdbold/container_mmdb.h
-
- at BUILD_MMDBOLD_TRUE@EXTRA_DIST = mmdbold/clipper_mmdb.dox
 @BUILD_CCP4_TRUE at ccp4_libclipper_ccp4_la_LDFLAGS = @VERSION_INFO@
 @BUILD_CCP4_TRUE at ccp4_libclipper_ccp4_la_LIBADD = core/libclipper-core.la -lccp4c
 @BUILD_CCP4_TRUE at ccp4_libclipper_ccp4_la_SOURCES = \
@@ -611,6 +621,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -659,6 +670,7 @@ ccp4/ccp4_map_io.lo: ccp4/$(am__dirstamp) \
 	ccp4/$(DEPDIR)/$(am__dirstamp)
 ccp4/ccp4_utils.lo: ccp4/$(am__dirstamp) \
 	ccp4/$(DEPDIR)/$(am__dirstamp)
+
 ccp4/libclipper-ccp4.la: $(ccp4_libclipper_ccp4_la_OBJECTS) $(ccp4_libclipper_ccp4_la_DEPENDENCIES) $(EXTRA_ccp4_libclipper_ccp4_la_DEPENDENCIES) ccp4/$(am__dirstamp)
 	$(AM_V_CXXLD)$(ccp4_libclipper_ccp4_la_LINK) $(am_ccp4_libclipper_ccp4_la_rpath) $(ccp4_libclipper_ccp4_la_OBJECTS) $(ccp4_libclipper_ccp4_la_LIBADD) $(LIBS)
 cctbx/$(am__dirstamp):
@@ -669,6 +681,7 @@ cctbx/$(DEPDIR)/$(am__dirstamp):
 	@: > cctbx/$(DEPDIR)/$(am__dirstamp)
 cctbx/clipper_cctbx.lo: cctbx/$(am__dirstamp) \
 	cctbx/$(DEPDIR)/$(am__dirstamp)
+
 cctbx/libclipper-cctbx.la: $(cctbx_libclipper_cctbx_la_OBJECTS) $(cctbx_libclipper_cctbx_la_DEPENDENCIES) $(EXTRA_cctbx_libclipper_cctbx_la_DEPENDENCIES) cctbx/$(am__dirstamp)
 	$(AM_V_CXXLD)$(cctbx_libclipper_cctbx_la_LINK) $(am_cctbx_libclipper_cctbx_la_rpath) $(cctbx_libclipper_cctbx_la_OBJECTS) $(cctbx_libclipper_cctbx_la_LIBADD) $(LIBS)
 cif/$(am__dirstamp):
@@ -678,6 +691,7 @@ cif/$(DEPDIR)/$(am__dirstamp):
 	@$(MKDIR_P) cif/$(DEPDIR)
 	@: > cif/$(DEPDIR)/$(am__dirstamp)
 cif/cif_data_io.lo: cif/$(am__dirstamp) cif/$(DEPDIR)/$(am__dirstamp)
+
 cif/libclipper-cif.la: $(cif_libclipper_cif_la_OBJECTS) $(cif_libclipper_cif_la_DEPENDENCIES) $(EXTRA_cif_libclipper_cif_la_DEPENDENCIES) cif/$(am__dirstamp)
 	$(AM_V_CXXLD)$(cif_libclipper_cif_la_LINK) $(am_cif_libclipper_cif_la_rpath) $(cif_libclipper_cif_la_OBJECTS) $(cif_libclipper_cif_la_LIBADD) $(LIBS)
 cns/$(am__dirstamp):
@@ -688,6 +702,7 @@ cns/$(DEPDIR)/$(am__dirstamp):
 	@: > cns/$(DEPDIR)/$(am__dirstamp)
 cns/cns_hkl_io.lo: cns/$(am__dirstamp) cns/$(DEPDIR)/$(am__dirstamp)
 cns/cns_map_io.lo: cns/$(am__dirstamp) cns/$(DEPDIR)/$(am__dirstamp)
+
 cns/libclipper-cns.la: $(cns_libclipper_cns_la_OBJECTS) $(cns_libclipper_cns_la_DEPENDENCIES) $(EXTRA_cns_libclipper_cns_la_DEPENDENCIES) cns/$(am__dirstamp)
 	$(AM_V_CXXLD)$(cns_libclipper_cns_la_LINK) $(am_cns_libclipper_cns_la_rpath) $(cns_libclipper_cns_la_OBJECTS) $(cns_libclipper_cns_la_LIBADD) $(LIBS)
 fortran/$(am__dirstamp):
@@ -698,6 +713,7 @@ fortran/$(DEPDIR)/$(am__dirstamp):
 	@: > fortran/$(DEPDIR)/$(am__dirstamp)
 fortran/f_interface.lo: fortran/$(am__dirstamp) \
 	fortran/$(DEPDIR)/$(am__dirstamp)
+
 fortran/libclipper-fortran.la: $(fortran_libclipper_fortran_la_OBJECTS) $(fortran_libclipper_fortran_la_DEPENDENCIES) $(EXTRA_fortran_libclipper_fortran_la_DEPENDENCIES) fortran/$(am__dirstamp)
 	$(AM_V_CXXLD)$(fortran_libclipper_fortran_la_LINK) $(am_fortran_libclipper_fortran_la_rpath) $(fortran_libclipper_fortran_la_OBJECTS) $(fortran_libclipper_fortran_la_LIBADD) $(LIBS)
 minimol/$(am__dirstamp):
@@ -718,6 +734,7 @@ minimol/minimol_seq.lo: minimol/$(am__dirstamp) \
 	minimol/$(DEPDIR)/$(am__dirstamp)
 minimol/minimol_utils.lo: minimol/$(am__dirstamp) \
 	minimol/$(DEPDIR)/$(am__dirstamp)
+
 minimol/libclipper-minimol.la: $(minimol_libclipper_minimol_la_OBJECTS) $(minimol_libclipper_minimol_la_DEPENDENCIES) $(EXTRA_minimol_libclipper_minimol_la_DEPENDENCIES) minimol/$(am__dirstamp)
 	$(AM_V_CXXLD)$(minimol_libclipper_minimol_la_LINK) $(am_minimol_libclipper_minimol_la_rpath) $(minimol_libclipper_minimol_la_OBJECTS) $(minimol_libclipper_minimol_la_LIBADD) $(LIBS)
 mmdb/$(am__dirstamp):
@@ -728,24 +745,9 @@ mmdb/$(DEPDIR)/$(am__dirstamp):
 	@: > mmdb/$(DEPDIR)/$(am__dirstamp)
 mmdb/clipper_mmdb.lo: mmdb/$(am__dirstamp) \
 	mmdb/$(DEPDIR)/$(am__dirstamp)
+
 mmdb/libclipper-mmdb.la: $(mmdb_libclipper_mmdb_la_OBJECTS) $(mmdb_libclipper_mmdb_la_DEPENDENCIES) $(EXTRA_mmdb_libclipper_mmdb_la_DEPENDENCIES) mmdb/$(am__dirstamp)
 	$(AM_V_CXXLD)$(mmdb_libclipper_mmdb_la_LINK) $(am_mmdb_libclipper_mmdb_la_rpath) $(mmdb_libclipper_mmdb_la_OBJECTS) $(mmdb_libclipper_mmdb_la_LIBADD) $(LIBS)
-mmdbold/$(am__dirstamp):
-	@$(MKDIR_P) mmdbold
-	@: > mmdbold/$(am__dirstamp)
-mmdbold/$(DEPDIR)/$(am__dirstamp):
-	@$(MKDIR_P) mmdbold/$(DEPDIR)
-	@: > mmdbold/$(DEPDIR)/$(am__dirstamp)
-mmdbold/clipper_mmdb.lo: mmdbold/$(am__dirstamp) \
-	mmdbold/$(DEPDIR)/$(am__dirstamp)
-mmdbold/clipper_mmdb_wrapper.lo: mmdbold/$(am__dirstamp) \
-	mmdbold/$(DEPDIR)/$(am__dirstamp)
-mmdbold/clipper_mmdb_types.lo: mmdbold/$(am__dirstamp) \
-	mmdbold/$(DEPDIR)/$(am__dirstamp)
-mmdbold/container_mmdb.lo: mmdbold/$(am__dirstamp) \
-	mmdbold/$(DEPDIR)/$(am__dirstamp)
-mmdbold/libclipper-mmdbold.la: $(mmdbold_libclipper_mmdbold_la_OBJECTS) $(mmdbold_libclipper_mmdbold_la_DEPENDENCIES) $(EXTRA_mmdbold_libclipper_mmdbold_la_DEPENDENCIES) mmdbold/$(am__dirstamp)
-	$(AM_V_CXXLD)$(mmdbold_libclipper_mmdbold_la_LINK) $(am_mmdbold_libclipper_mmdbold_la_rpath) $(mmdbold_libclipper_mmdbold_la_OBJECTS) $(mmdbold_libclipper_mmdbold_la_LIBADD) $(LIBS)
 phs/$(am__dirstamp):
 	@$(MKDIR_P) phs
 	@: > phs/$(am__dirstamp)
@@ -753,6 +755,7 @@ phs/$(DEPDIR)/$(am__dirstamp):
 	@$(MKDIR_P) phs/$(DEPDIR)
 	@: > phs/$(DEPDIR)/$(am__dirstamp)
 phs/phs_io.lo: phs/$(am__dirstamp) phs/$(DEPDIR)/$(am__dirstamp)
+
 phs/libclipper-phs.la: $(phs_libclipper_phs_la_OBJECTS) $(phs_libclipper_phs_la_DEPENDENCIES) $(EXTRA_phs_libclipper_phs_la_DEPENDENCIES) phs/$(am__dirstamp)
 	$(AM_V_CXXLD)$(phs_libclipper_phs_la_LINK) $(am_phs_libclipper_phs_la_rpath) $(phs_libclipper_phs_la_OBJECTS) $(phs_libclipper_phs_la_LIBADD) $(LIBS)
 
@@ -772,8 +775,6 @@ mostlyclean-compile:
 	-rm -f minimol/*.lo
 	-rm -f mmdb/*.$(OBJEXT)
 	-rm -f mmdb/*.lo
-	-rm -f mmdbold/*.$(OBJEXT)
-	-rm -f mmdbold/*.lo
 	-rm -f phs/*.$(OBJEXT)
 	-rm -f phs/*.lo
 
@@ -796,10 +797,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at minimol/$(DEPDIR)/minimol_seq.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at minimol/$(DEPDIR)/minimol_utils.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at mmdb/$(DEPDIR)/clipper_mmdb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at mmdbold/$(DEPDIR)/clipper_mmdb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at mmdbold/$(DEPDIR)/clipper_mmdb_types.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at mmdbold/$(DEPDIR)/clipper_mmdb_wrapper.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at mmdbold/$(DEPDIR)/container_mmdb.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at phs/$(DEPDIR)/phs_io.Plo at am__quote@
 
 .cpp.o:
@@ -838,7 +835,6 @@ clean-libtool:
 	-rm -rf fortran/.libs fortran/_libs
 	-rm -rf minimol/.libs minimol/_libs
 	-rm -rf mmdb/.libs mmdb/_libs
-	-rm -rf mmdbold/.libs mmdbold/_libs
 	-rm -rf phs/.libs phs/_libs
 install-ccp4_includeHEADERS: $(ccp4_include_HEADERS)
 	@$(NORMAL_INSTALL)
@@ -966,27 +962,6 @@ uninstall-mmdb_includeHEADERS:
 	@list='$(mmdb_include_HEADERS)'; test -n "$(mmdb_includedir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(mmdb_includedir)'; $(am__uninstall_files_from_dir)
-install-mmdbold_includeHEADERS: $(mmdbold_include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(mmdbold_include_HEADERS)'; test -n "$(mmdbold_includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mmdbold_includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mmdbold_includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(mmdbold_includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(mmdbold_includedir)" || exit $$?; \
-	done
-
-uninstall-mmdbold_includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(mmdbold_include_HEADERS)'; test -n "$(mmdbold_includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(mmdbold_includedir)'; $(am__uninstall_files_from_dir)
 install-phs_includeHEADERS: $(phs_include_HEADERS)
 	@$(NORMAL_INSTALL)
 	@list='$(phs_include_HEADERS)'; test -n "$(phs_includedir)" || list=; \
@@ -1036,14 +1011,13 @@ uninstall-pkgincludeHEADERS:
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
@@ -1064,31 +1038,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-cscopelist-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-	done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1104,12 +1060,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -1121,15 +1072,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -1138,9 +1085,10 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1216,7 +1164,7 @@ check: check-recursive
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ccp4_includedir)" "$(DESTDIR)$(cctbx_includedir)" "$(DESTDIR)$(cif_includedir)" "$(DESTDIR)$(cns_includedir)" "$(DESTDIR)$(minimol_includedir)" "$(DESTDIR)$(mmdb_includedir)" "$(DESTDIR)$(mmdbold_includedir)" "$(DESTDIR)$(phs_includedir)" "$(DESTDIR)$(pkgincludedir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ccp4_includedir)" "$(DESTDIR)$(cctbx_includedir)" "$(DESTDIR)$(cif_includedir)" "$(DESTDIR)$(cns_includedir)" "$(DESTDIR)$(minimol_includedir)" "$(DESTDIR)$(mmdb_includedir)" "$(DESTDIR)$(phs_includedir)" "$(DESTDIR)$(pkgincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
@@ -1259,8 +1207,6 @@ distclean-generic:
 	-rm -f minimol/$(am__dirstamp)
 	-rm -f mmdb/$(DEPDIR)/$(am__dirstamp)
 	-rm -f mmdb/$(am__dirstamp)
-	-rm -f mmdbold/$(DEPDIR)/$(am__dirstamp)
-	-rm -f mmdbold/$(am__dirstamp)
 	-rm -f phs/$(DEPDIR)/$(am__dirstamp)
 	-rm -f phs/$(am__dirstamp)
 
@@ -1273,7 +1219,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 	mostlyclean-am
 
 distclean: distclean-recursive
-	-rm -rf ccp4/$(DEPDIR) cctbx/$(DEPDIR) cif/$(DEPDIR) cns/$(DEPDIR) fortran/$(DEPDIR) minimol/$(DEPDIR) mmdb/$(DEPDIR) mmdbold/$(DEPDIR) phs/$(DEPDIR)
+	-rm -rf ccp4/$(DEPDIR) cctbx/$(DEPDIR) cif/$(DEPDIR) cns/$(DEPDIR) fortran/$(DEPDIR) minimol/$(DEPDIR) mmdb/$(DEPDIR) phs/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -1293,8 +1239,8 @@ info-am:
 install-data-am: install-ccp4_includeHEADERS \
 	install-cctbx_includeHEADERS install-cif_includeHEADERS \
 	install-cns_includeHEADERS install-minimol_includeHEADERS \
-	install-mmdb_includeHEADERS install-mmdbold_includeHEADERS \
-	install-phs_includeHEADERS install-pkgincludeHEADERS
+	install-mmdb_includeHEADERS install-phs_includeHEADERS \
+	install-pkgincludeHEADERS
 
 install-dvi: install-dvi-recursive
 
@@ -1323,7 +1269,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-	-rm -rf ccp4/$(DEPDIR) cctbx/$(DEPDIR) cif/$(DEPDIR) cns/$(DEPDIR) fortran/$(DEPDIR) minimol/$(DEPDIR) mmdb/$(DEPDIR) mmdbold/$(DEPDIR) phs/$(DEPDIR)
+	-rm -rf ccp4/$(DEPDIR) cctbx/$(DEPDIR) cif/$(DEPDIR) cns/$(DEPDIR) fortran/$(DEPDIR) minimol/$(DEPDIR) mmdb/$(DEPDIR) phs/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1344,17 +1290,13 @@ uninstall-am: uninstall-ccp4_includeHEADERS \
 	uninstall-cctbx_includeHEADERS uninstall-cif_includeHEADERS \
 	uninstall-cns_includeHEADERS uninstall-libLTLIBRARIES \
 	uninstall-minimol_includeHEADERS uninstall-mmdb_includeHEADERS \
-	uninstall-mmdbold_includeHEADERS uninstall-phs_includeHEADERS \
-	uninstall-pkgincludeHEADERS
+	uninstall-phs_includeHEADERS uninstall-pkgincludeHEADERS
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-	cscopelist-recursive ctags-recursive install-am install-strip \
-	tags-recursive
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist \
-	cscopelist-recursive ctags ctags-recursive distclean \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
 	distclean-compile distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
 	install install-am install-ccp4_includeHEADERS \
@@ -1364,17 +1306,16 @@ uninstall-am: uninstall-ccp4_includeHEADERS \
 	install-html install-html-am install-info install-info-am \
 	install-libLTLIBRARIES install-man \
 	install-minimol_includeHEADERS install-mmdb_includeHEADERS \
-	install-mmdbold_includeHEADERS install-pdf install-pdf-am \
-	install-phs_includeHEADERS install-pkgincludeHEADERS \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-ccp4_includeHEADERS uninstall-cctbx_includeHEADERS \
-	uninstall-cif_includeHEADERS uninstall-cns_includeHEADERS \
-	uninstall-libLTLIBRARIES uninstall-minimol_includeHEADERS \
-	uninstall-mmdb_includeHEADERS uninstall-mmdbold_includeHEADERS \
+	install-pdf install-pdf-am install-phs_includeHEADERS \
+	install-pkgincludeHEADERS install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-ccp4_includeHEADERS \
+	uninstall-cctbx_includeHEADERS uninstall-cif_includeHEADERS \
+	uninstall-cns_includeHEADERS uninstall-libLTLIBRARIES \
+	uninstall-minimol_includeHEADERS uninstall-mmdb_includeHEADERS \
 	uninstall-phs_includeHEADERS uninstall-pkgincludeHEADERS
 
 
diff --git a/clipper/cif/cif_data_io.cpp b/clipper/cif/cif_data_io.cpp
index 664e375..6db4303 100644
--- a/clipper/cif/cif_data_io.cpp
+++ b/clipper/cif/cif_data_io.cpp
@@ -52,7 +52,8 @@ extern "C" {
 #include <fstream>
 
 #ifndef  __MMDB_MMCIF__
-#include <mmdb/mmdb_mmcif.h>
+#include <mmdb2/mmdb_mmcif_.h>
+#undef strchr
 #endif
 
 
@@ -66,8 +67,7 @@ CIFfile::CIFfile()
 {
    mode = NONE;
 
-   // Argh, bug. It's things like this that make me dislike object
-   // oriented programming - "Magic happens behind your back".  The
+   // The
    // problem was that we were trying to import into f_phi_i in
    // close_read() when f_phi_i had not been initialised by calling
    // import_hkl_data for it (because it comes from a function that
@@ -80,7 +80,11 @@ CIFfile::CIFfile()
    f_sigf_i = NULL;
    f_phi_i  = NULL;
    rfree_i  = NULL;
-      
+   d_sigd_i     = NULL;
+   ABCD_i       = NULL;
+   I_sigI_i     = NULL;
+   f_sigf_ano_i = NULL;
+   
    // set these when we find them....
    clipper_cell_set_flag = 0; 
    clipper_reso_set_flag = 0; 
@@ -184,19 +188,23 @@ void CIFfile::close_read()
      Message::message( Message_fatal( "CIFfile: no file open for read" ) );
 
   // make sure the data list is sized
-  if ( f_sigf_i != NULL ) f_sigf_i->update();
-  if (  f_phi_i != NULL )  f_phi_i->update();
-  if (  rfree_i != NULL )  rfree_i->update();
+  if ( f_sigf_i     != NULL ) f_sigf_i->update();
+  if (  f_phi_i     != NULL )  f_phi_i->update();
+  if (  rfree_i     != NULL )  rfree_i->update();
+  if ( d_sigd_i     != NULL ) d_sigd_i->update();
+  if (   ABCD_i     != NULL )   ABCD_i->update();
+  if ( I_sigI_i     != NULL ) I_sigI_i->update();
+  if ( f_sigf_ano_i != NULL ) f_sigf_ano_i->update();
 
   int ret_val = 0;
   int n_calc_data = 0; 
-  InitMatType(); 
+  ::mmdb::InitMatType(); 
 
   // read the data from the CIF file
 
   // stat cif_file_name.c_str() here, make sure it exists, is readable.
 
-  CMMCIFFile ciffile; 
+  ::mmdb::mmcif::File ciffile; 
   int ierr = ciffile.ReadMMCIFFile(filename.c_str());
   int ierr_f;
   int ierr_calc;
@@ -205,7 +213,7 @@ void CIFfile::close_read()
   int ierr_intensity_flag;
   int ierr_ABCD_flag;
       
-  if (ierr!=CIFRC_Ok) { 
+  if (ierr!=::mmdb::mmcif::CIFRC_Ok) { 
 
     std::string mess = "CIFfile: close_read  - Could not read: ";
     mess += filename.c_str();
@@ -215,15 +223,15 @@ void CIFfile::close_read()
 
     for(int i=0; i<ciffile.GetNofData(); i++) {  
 	 
-      PCMMCIFData data = ciffile.GetCIFData(i);
+      ::mmdb::mmcif::PData data = ciffile.GetCIFData(i);
 	 
       for (int icat=0; icat<data->GetNumberOfCategories(); icat++) { 
 
-	PCMMCIFCategory cat = data->GetCategory(icat);
+	::mmdb::mmcif::PCategory cat = data->GetCategory(icat);
 
 	std::string cat_name(cat->GetCategoryName()); 
 
-	PCMMCIFLoop mmCIFLoop = data->GetLoop(cat_name.c_str());
+	::mmdb::mmcif::PLoop mmCIFLoop = data->GetLoop(cat_name.c_str());
 
 	if (mmCIFLoop == NULL) { 
 
@@ -235,9 +243,9 @@ void CIFfile::close_read()
 	    ret_val = 1;
 
 	    int h,k,l;
-	    realtype F, sigF, Fcalc, phi, F_plus, sigF_plus, F_minus, sigF_minus, I, sigI;
-	    realtype I_plus, sigI_plus, I_minus, sigI_minus, D, D_sigma;
-	    realtype HLA, HLB, HLC, HLD;
+	    ::mmdb::realtype F, sigF, Fcalc, phi, F_plus, sigF_plus, F_minus, sigF_minus, I, sigI;
+	    ::mmdb::realtype I_plus, sigI_plus, I_minus, sigI_minus, D, D_sigma;
+	    ::mmdb::realtype HLA, HLB, HLC, HLD;
 	    xtype x1[2], x_anom[5], x_hl[4];
 
 	    for (int j=0; j<mmCIFLoop->GetLoopLength(); j++) { 
@@ -288,29 +296,32 @@ void CIFfile::close_read()
 		}
 
 		// RFree flag
-		char *s = mmCIFLoop->GetString("status", j, ierr_rfree_flag);
-		if (! ierr_rfree_flag) { 
-		   x1[0] = -1;
-		   if (s) {
-		      // std::cout << "read status :" << s << ":" << std::endl;
-		      if (strncmp(s, "o", 1)) {
-			 x1[0] = 1;
-		      } else {
-			 if (strncmp(s, "f", 1)) {
-			    x1[0] = 0;
+		if (rfree_i) { 
+		   char *s = mmCIFLoop->GetString("status", j, ierr_rfree_flag);
+		   if (! ierr_rfree_flag) { 
+		      x1[0] = -1; 
+		      if (s) {
+			 // std::cout << "read status :" << s << ":" << std::endl;
+			 // could be also "x"; not observed, just listed
+			 if (! strncmp(s, "o", 1)) {
+			    x1[0] = 1;
+			 } else {
+			    if (! strncmp(s, "f", 1)) {
+			       x1[0] = 0;
+			    }
 			 }
 		      }
+		      // 
+		      // Every output reflection gets one of these, even if
+		      // it is set to -1.  Is that the correct thing to do?
+		      // I have looked at over 200 recent sf mmCIFs and if
+		      // the contain conventional data then they all have
+		      // the status flag.
+		      //
+		      // However, SFS from EM data do not
+		      // 
+		      rfree_i->data_import( HKL(h,k,l), x1);
 		   }
-		   // 
-		   // Every output reflection gets one of these, even if
-		   // it is set to -1.  Is that the correct thing to do?
-		   // I have looked at over 200 recent sf mmCIFs and if
-		   // the contain conventional data then they all have
-		   // the status flag.
-		   //
-		   // However, SFS from EM data do not
-		   // 
-		   rfree_i->data_import( HKL(h,k,l), x1);
 		}
 
 		
@@ -448,20 +459,20 @@ Resolution CIFfile::resolution( const Cell& cell ) const
   FILE* cif = fopen( filename.c_str(), "r" );
   if ( cif == NULL )
     Message::message( Message_fatal( "CIFfile: resolution  - Could not read: "+filename ) );
-  CMMCIFFile ciffile; 
+  ::mmdb::mmcif::File ciffile; 
   int ierr = ciffile.ReadMMCIFFile(filename.c_str()); 
-  if (ierr!=CIFRC_Ok) { 
+  if (ierr!=::mmdb::mmcif::CIFRC_Ok) { 
     std::string mess = "CIFfile: resolution  - Could not read: ";
     mess += filename.c_str();
     mess += ". Dirty mmCIF file? "; 
     Message::message( Message_warn( mess )); 
   } else { // read the reflections from the phs
     for(int i=0; i<ciffile.GetNofData(); i++) {  
-      PCMMCIFData data = ciffile.GetCIFData(i);
+      ::mmdb::mmcif::PData data = ciffile.GetCIFData(i);
       for (int icat=0; icat<data->GetNumberOfCategories(); icat++) { 
-	PCMMCIFCategory cat = data->GetCategory(icat);
+	::mmdb::mmcif::PCategory cat = data->GetCategory(icat);
 	std::string cat_name(cat->GetCategoryName()); 
-	PCMMCIFLoop mmCIFLoop = data->GetLoop( (char *) cat_name.c_str() );
+	::mmdb::mmcif::PLoop mmCIFLoop = data->GetLoop( (char *) cat_name.c_str() );
 	if (mmCIFLoop == NULL) { 
 	} else {
 	  if (cat_name == "_refln") { 
@@ -533,10 +544,10 @@ void CIFfile::import_hkl_info( HKL_info& target )
      ftype slim = target.resolution().invresolsq_limit();
      ftype tmp_lim = 0.0; 
   
-     CMMCIFFile ciffile; 
+     ::mmdb::mmcif::File ciffile; 
      int ierr = ciffile.ReadMMCIFFile(filename.c_str()); 
       
-     if (ierr!=CIFRC_Ok) { 
+     if (ierr!=::mmdb::mmcif::CIFRC_Ok) { 
      
 	std::string mess = "CIFfile: import_hkl_data  - Could not read: ";
 	mess += filename.c_str();
@@ -547,22 +558,22 @@ void CIFfile::import_hkl_info( HKL_info& target )
 
 	for(int i=0; i<ciffile.GetNofData(); i++) {  
 	 
-	   PCMMCIFData data = ciffile.GetCIFData(i);
+	   ::mmdb::mmcif::PData data = ciffile.GetCIFData(i);
 	 
 	   for (int icat=0; icat<data->GetNumberOfCategories(); icat++) { 
 
-	      PCMMCIFCategory cat = data->GetCategory(icat);
+	      ::mmdb::mmcif::PCategory cat = data->GetCategory(icat);
 
 	      std::string cat_name(cat->GetCategoryName()); 
 
-	      PCMMCIFLoop mmCIFLoop = data->GetLoop(cat_name.c_str() );
+	      ::mmdb::mmcif::PLoop mmCIFLoop = data->GetLoop(cat_name.c_str() );
 
 	      if (mmCIFLoop) {
 
 		 if (cat_name == "_refln") { 
 
 		    int h,k,l;
-		    //realtype F, sigF; 
+		    //::mmdb::realtype F, sigF; 
 
 		    for (int j=0; j<mmCIFLoop->GetLoopLength(); j++) { 
 
@@ -594,7 +605,7 @@ void CIFfile::import_hkl_info( HKL_info& target )
 	   }
 	}
      }
-     // CMMCIFFile is closed on destruction of ciffile.
+     // ::mmdb::mmcif::File is closed on destruction of ciffile.
 
      // Now we can initialise target properly, if we OK reading the hkls.
      if (!clipper_reso_set_flag) {
@@ -655,10 +666,10 @@ CIFfile::set_cell_symm_reso_by_cif(std::string cif_file_name) {
    if ( cif == NULL )
       Message::message( Message_fatal( "CIFfile: set_cell_symm_reso_by_cif - Could not read: "+cif_file_name ) );
    
-   CMMCIFFile ciffile; 
+   ::mmdb::mmcif::File ciffile; 
    int ierr = ciffile.ReadMMCIFFile(cif_file_name.c_str()); 
    
-   if (ierr!=CIFRC_Ok) { 
+   if (ierr!=::mmdb::mmcif::CIFRC_Ok) { 
       
       std::string mess = "CIFfile: set_cell_symm_reso_by_cif: Could not read: ";
       mess += filename.c_str();
@@ -669,10 +680,10 @@ CIFfile::set_cell_symm_reso_by_cif(std::string cif_file_name) {
       
       for(int i=0; i<ciffile.GetNofData(); i++) {  
 	 
-	 PCMMCIFData data = ciffile.GetCIFData(i);
+	 ::mmdb::mmcif::PData data = ciffile.GetCIFData(i);
 	 // data is the same as mmCIF in Eugenes example
 
-	 PCMMCIFStruct mmCIFStruct = data->GetStructure("_cell");
+	 ::mmdb::mmcif::PStruct mmCIFStruct = data->GetStructure("_cell");
 
 	 char *cat_name_str;
 	 std::string cat_name;
@@ -687,7 +698,7 @@ CIFfile::set_cell_symm_reso_by_cif(std::string cif_file_name) {
 	       
 	       cat_name = cat_name_str; 
 	       if (cat_name == "_cell") {
-		  realtype a,b,c,alpha,beta,gamma;
+		  ::mmdb::realtype a,b,c,alpha,beta,gamma;
 		  int ierr = 0; 
 		  ierr += mmCIFStruct->GetReal (a,     "length_a");
 		  ierr += mmCIFStruct->GetReal (b,     "length_b");
@@ -737,11 +748,11 @@ CIFfile::set_cell_symm_reso_by_cif(std::string cif_file_name) {
 	 // clipper function).
 	 for (int icat=0; icat<data->GetNumberOfCategories(); icat++) { 
 
-	    PCMMCIFCategory cat = data->GetCategory(icat);
+	    ::mmdb::mmcif::PCategory cat = data->GetCategory(icat);
 
 	    std::string cat_name(cat->GetCategoryName()); 
 
-	    PCMMCIFLoop mmCIFLoop = data->GetLoop(cat_name.c_str() );
+	    ::mmdb::mmcif::PLoop mmCIFLoop = data->GetLoop(cat_name.c_str() );
 	    
 	    if (mmCIFLoop) { 
 	       if (cat_name == "_symmetry_equiv") {
@@ -768,7 +779,7 @@ CIFfile::set_cell_symm_reso_by_cif(std::string cif_file_name) {
 	    if (cat_name_str != NULL) { 
 	       cat_name = cat_name_str; 
 	       if ( cat_name == "_reflns") {
-		  realtype reso;
+		  ::mmdb::realtype reso;
 		  int ierr = mmCIFStruct->GetReal(reso, "d_resolution_high");
 		  if (! ierr ) {
 		     clipper_reso_set_flag = 1;
diff --git a/clipper/clipper-mmdbold.h b/clipper/clipper-mmdbold.h
deleted file mode 100644
index 723b42b..0000000
--- a/clipper/clipper-mmdbold.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Clipper header file */
-/* (C) 2000-2003 Kevin Cowtan */
-
-#ifndef CLIPPER_MMDBOLD_H
-#define CLIPPER_MMDBOLD_H
-
-#include "clipper/mmdbold/container_mmdb.h"
-
-#endif
diff --git a/clipper/contrib/Makefile.in b/clipper/contrib/Makefile.in
index 09a3eaf..c3d9979 100644
--- a/clipper/contrib/Makefile.in
+++ b/clipper/contrib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -19,23 +19,51 @@
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -55,8 +83,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = clipper/contrib
-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(top_srcdir)/build-aux/depcomp
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/build-aux/depcomp $(library_include_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
 	$(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -155,6 +183,23 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 HEADERS = $(library_include_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -190,7 +235,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-FFTW_LIBS = @FFTW_LIBS@
+FFTW2_LIBS = @FFTW2_LIBS@
 FGREP = @FGREP@
 FLIBS = @FLIBS@
 GREP = @GREP@
@@ -343,6 +388,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -377,6 +423,7 @@ clean-libLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libclipper-contrib.la: $(libclipper_contrib_la_OBJECTS) $(libclipper_contrib_la_DEPENDENCIES) $(EXTRA_libclipper_contrib_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(libclipper_contrib_la_LINK) -rpath $(libdir) $(libclipper_contrib_la_OBJECTS) $(libclipper_contrib_la_LIBADD) $(LIBS)
 
@@ -450,26 +497,15 @@ uninstall-library_includeHEADERS:
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(library_includedir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -481,15 +517,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -498,9 +530,10 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -657,20 +690,20 @@ uninstall-am: uninstall-libLTLIBRARIES \
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-library_includeHEADERS \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-libLTLIBRARIES \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES \
+	install-library_includeHEADERS install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
 	uninstall-library_includeHEADERS
 
 
diff --git a/clipper/core/Makefile.am b/clipper/core/Makefile.am
index dd39f96..6aac4fe 100644
--- a/clipper/core/Makefile.am
+++ b/clipper/core/Makefile.am
@@ -3,8 +3,8 @@
 
 lib_LTLIBRARIES = libclipper-core.la
 libclipper_core_la_LDFLAGS = @VERSION_INFO@
-libclipper_core_la_LIBADD = $(FFTW_LIBS) $(PTHREAD_LIBS)
-libclipper_core_la_CPPFLAGS = $(FFTW_CXXFLAGS) $(PTHREAD_CFLAGS)
+libclipper_core_la_LIBADD = $(FFTW2_LIBS) $(PTHREAD_LIBS)
+libclipper_core_la_CPPFLAGS = $(PTHREAD_CFLAGS)
 
 libclipper_core_la_SOURCES = \
 atomsf.cpp              coords.cpp              nxmap_operator.cpp \
diff --git a/clipper/core/Makefile.in b/clipper/core/Makefile.in
index bf5eb2b..a2fb120 100644
--- a/clipper/core/Makefile.in
+++ b/clipper/core/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -19,23 +19,51 @@
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -55,8 +83,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = clipper/core
-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(top_srcdir)/build-aux/depcomp
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/build-aux/depcomp $(library_include_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
 	$(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -188,6 +216,23 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 HEADERS = $(library_include_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -223,7 +268,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-FFTW_LIBS = @FFTW_LIBS@
+FFTW2_LIBS = @FFTW2_LIBS@
 FGREP = @FGREP@
 FLIBS = @FLIBS@
 GREP = @GREP@
@@ -325,8 +370,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libclipper-core.la
 libclipper_core_la_LDFLAGS = @VERSION_INFO@
-libclipper_core_la_LIBADD = $(FFTW_LIBS) $(PTHREAD_LIBS)
-libclipper_core_la_CPPFLAGS = $(FFTW_CXXFLAGS) $(PTHREAD_CFLAGS)
+libclipper_core_la_LIBADD = $(FFTW2_LIBS) $(PTHREAD_LIBS)
+libclipper_core_la_CPPFLAGS = $(PTHREAD_CFLAGS)
 libclipper_core_la_SOURCES = \
 atomsf.cpp              coords.cpp              nxmap_operator.cpp \
 cell.cpp                derivs.cpp              ramachandran.cpp \
@@ -393,6 +438,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -427,6 +473,7 @@ clean-libLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libclipper-core.la: $(libclipper_core_la_OBJECTS) $(libclipper_core_la_DEPENDENCIES) $(EXTRA_libclipper_core_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(libclipper_core_la_LINK) -rpath $(libdir) $(libclipper_core_la_OBJECTS) $(libclipper_core_la_LIBADD) $(LIBS)
 
@@ -800,26 +847,15 @@ uninstall-library_includeHEADERS:
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(library_includedir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -831,15 +867,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -848,9 +880,10 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1007,20 +1040,20 @@ uninstall-am: uninstall-libLTLIBRARIES \
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-library_includeHEADERS \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-libLTLIBRARIES \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES \
+	install-library_includeHEADERS install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
 	uninstall-library_includeHEADERS
 
 
diff --git a/clipper/core/clipper_sysdep.h b/clipper/core/clipper_sysdep.h
index bcc4515..9b1cd73 100644
--- a/clipper/core/clipper_sysdep.h
+++ b/clipper/core/clipper_sysdep.h
@@ -103,14 +103,20 @@ namespace clipper {
 #ifndef CLIPPER_DISABLE_THREADS
 
 #if defined(__WIN32__) || defined(_WIN32)
+// Through this header file, all windows macros are included in all programs
+// that use clipper. Avoid some conflicts.
+#define HKL HKL_RENAMED
+
+// adding WIN32_LEAN_AND_MEAN makes some or all #undefs not necessary,
+// but for now I'm leaving older workarounds unchanged
+#define WIN32_LEAN_AND_MEAN 1
 
 #include <windows.h>
 
-// Through this header file, all windows macros are included in all programs
-// that use clipper. Avoid some conflicts.
 #undef small
 #undef CompareString
 #undef NO_ERROR
+#undef HKL
 
 #undef AddAtom
 #define CLIPPER_MUTEX_INIT(MUTEX) InitializeCriticalSection(MUTEX)
diff --git a/clipper/core/ramachandran.cpp b/clipper/core/ramachandran.cpp
index a7fac7f..161b6c2 100644
--- a/clipper/core/ramachandran.cpp
+++ b/clipper/core/ramachandran.cpp
@@ -379,6 +379,1817 @@ namespace data {
      0,    0,    0,    0,    0,    4,    2,    6,    0,    0,    0,    0,//35
   };
 
+  int rama5_data_size = 72;
+  ftype32 rama5_gly[] = {
+  // 0
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 1
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 2
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 3
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 4
+  0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 5
+  0,0,0,0,0,0,0,1,3,4,5,4,4,3,2,1,1,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,2,3,4,5,5,3,2,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 6
+  0,0,0,0,1,4,7,12,16,18,17,14,10,7,4,3,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,2,4,7,10,13,15,14,10,5,2,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 7
+  0,0,2,5,12,21,35,51,61,62,53,40,25,15,8,4,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+  1,1,1,2,4,8,14,21,28,33,34,30,22,12,5,2,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 8
+  1,5,12,25,44,75,117,157,178,175,145,111,84,30,14,6,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,
+  2,3,5,9,15,24,35,48,58,63,62,55,40,23,11,4,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 9
+  10,22,43,74,121,192,279,346,381,402,336,227,143,56,23,9,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,
+  7,11,17,26,38,53,71,90,105,121,128,100,67,41,20,8,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,4,
+  // 10
+  35,65,108,169,259,374,560,622,689,668,551,400,230,102,35,12,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,4,8,13,
+  20,30,43,59,78,98,137,164,193,228,188,137,103,65,34,14,5,1,
+  0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,3,6,16,
+  // 11
+  96,147,220,318,465,682,931,1045,1207,1190,812,494,305,135,80,14,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,1,2,4,8,13,21,33,
+  48,80,91,114,138,160,205,248,291,319,234,224,167,89,44,20,8,3,
+  1,0,0,0,0,0,0,0,1,1,1,1,2,3,4,10,24,58,
+  // 12
+  202,282,397,606,852,1104,1390,1687,1973,2022,1179,573,352,158,52,15,4,1,
+  0,0,0,0,0,0,0,0,0,1,2,3,7,13,21,34,60,74,
+  102,181,167,193,221,306,391,445,331,346,251,204,183,95,49,24,11,5,
+  2,1,1,1,2,2,2,2,2,2,3,3,4,7,14,32,69,133,
+  // 13
+  375,506,662,940,1119,1290,1398,1690,2039,1881,1042,595,312,140,48,14,4,1,
+  1,1,1,1,1,0,0,0,1,3,6,11,19,31,48,73,116,136,
+  169,304,324,369,379,402,405,379,321,295,251,213,183,127,50,25,14,9,
+  4,3,3,4,5,5,6,6,6,6,7,8,11,20,42,85,152,246,
+  // 14
+  609,800,1069,1226,1286,1271,1376,1477,1329,1078,715,462,246,114,37,12,5,3,
+  2,3,3,3,3,2,2,3,5,9,16,26,41,61,95,156,164,218,
+  283,435,431,536,475,407,399,321,294,260,216,183,146,105,58,25,22,19,
+  6,5,6,7,9,9,10,10,10,11,12,15,25,49,97,173,280,435,
+  // 15
+  966,1261,1585,1748,1363,1171,1121,1041,860,687,480,340,178,87,24,10,5,5,
+  5,5,6,6,6,6,6,7,12,20,32,49,73,103,148,258,253,372,
+  408,525,541,559,550,499,389,326,301,266,226,153,104,61,40,35,21,14,
+  7,8,9,11,12,13,14,14,15,16,19,28,50,97,177,298,483,753,
+  // 16
+  1481,1628,1517,1393,1176,1029,881,687,567,447,294,182,93,45,17,9,7,7,
+  7,8,10,11,11,11,12,15,22,41,52,80,158,212,215,322,372,439,
+  558,560,591,509,472,439,323,264,247,183,160,140,94,57,39,67,24,10,
+  9,9,12,15,16,16,52,17,18,21,28,45,85,159,273,447,670,1042,
+  // 17
+  1415,1475,1546,1259,1001,793,550,414,318,254,153,82,45,40,21,9,8,9,
+  10,12,14,16,18,18,20,24,37,78,83,118,173,226,295,418,502,540,
+  485,432,562,535,414,347,268,278,200,174,133,103,61,54,37,46,38,16,
+  9,10,14,17,17,19,35,22,47,26,38,66,123,230,407,608,858,1192,
+  // 18
+  1393,1359,1277,988,726,527,395,285,166,106,63,60,28,20,13,9,11,12,
+  14,16,18,22,24,25,28,41,68,88,116,153,184,261,331,379,421,477,
+  576,441,419,361,308,344,244,227,163,132,106,61,48,43,34,24,21,12,
+  9,9,12,14,49,16,22,19,66,30,47,84,180,294,510,721,1014,1286,
+  // 19
+  1058,958,910,751,502,342,246,148,86,52,28,21,20,13,9,11,14,16,
+  37,20,25,34,45,34,34,56,112,99,117,176,242,315,329,341,328,354,
+  478,430,407,312,247,207,168,178,141,98,72,55,48,40,31,22,14,10,
+  8,7,8,9,10,11,14,32,25,33,53,97,209,355,668,852,1018,1065,
+  // 20
+  805,696,619,469,329,225,150,102,52,32,17,16,19,13,9,13,16,19,
+  29,21,27,35,43,35,49,91,106,102,142,192,193,337,342,281,272,322,
+  360,332,268,234,207,186,149,114,98,80,68,81,49,39,26,18,19,15,
+  7,5,5,5,7,9,14,29,23,33,54,93,169,374,575,832,819,831,
+  // 21
+  572,548,395,308,278,176,92,45,27,17,12,10,10,9,9,16,27,18,
+  19,35,35,28,30,44,48,60,61,86,116,232,179,253,292,269,268,317,
+  294,248,247,200,183,168,135,153,113,96,60,53,48,38,23,16,22,17,
+  5,3,3,3,4,7,15,21,21,30,50,84,151,298,484,530,546,633,
+  // 22
+  379,320,280,235,193,101,55,27,17,12,9,8,8,8,9,16,28,15,
+  16,17,28,50,29,48,45,53,69,94,106,111,143,213,188,214,189,207,
+  256,243,202,182,177,135,136,133,119,87,82,58,50,46,55,29,19,6,
+  3,2,1,2,3,5,10,14,17,26,42,97,129,223,343,355,427,404,
+  // 23
+  261,210,160,122,98,57,32,19,18,22,10,8,7,7,8,9,10,11,
+  13,16,19,21,24,29,34,38,52,60,81,93,133,193,166,194,165,196,
+  192,167,203,171,153,129,130,131,115,81,58,63,53,34,20,17,10,4,
+  2,1,1,2,3,4,6,9,13,21,35,77,103,184,216,206,234,243,
+  // 24
+  130,112,111,75,51,34,22,15,16,19,9,7,7,6,6,7,7,9,
+  11,13,16,19,21,24,29,32,50,63,97,83,99,164,146,210,163,176,
+  179,191,204,185,164,131,135,132,105,104,62,60,53,34,20,9,5,3,
+  2,1,1,2,2,4,5,7,18,45,27,46,98,82,108,137,163,193,
+  // 25
+  88,76,55,43,32,22,16,12,9,8,7,6,6,5,5,5,9,15,
+  10,11,13,15,17,19,29,34,33,40,55,70,85,105,109,132,185,212,
+  162,154,198,189,165,171,132,157,107,81,59,45,33,22,13,8,5,3,
+  1,1,1,2,2,3,4,6,9,14,35,45,42,64,102,101,102,111,
+  // 26
+  70,52,35,30,26,17,11,9,8,6,6,5,4,4,3,4,9,17,
+  10,9,11,12,14,15,24,32,58,42,44,57,105,101,123,153,151,207,
+  167,172,201,224,212,198,206,160,117,88,61,44,32,24,12,7,4,2,
+  1,1,1,2,2,2,3,5,9,13,17,23,32,75,73,76,61,81,
+  // 27
+  34,29,24,24,22,14,8,6,6,5,4,3,3,2,2,2,3,5,
+  6,7,8,9,10,12,14,20,25,27,33,44,58,73,94,124,119,195,
+  198,216,204,227,253,203,180,153,119,93,59,38,32,33,12,6,3,2,
+  1,1,1,2,2,2,21,8,9,12,16,47,26,83,43,45,45,41,
+  // 28
+  23,20,17,16,13,8,6,4,4,3,3,2,2,1,1,2,2,3,
+  5,6,7,7,8,9,12,15,19,23,29,39,52,67,85,125,135,166,
+  262,215,202,197,185,183,167,137,167,86,52,37,23,17,8,5,3,1,
+  1,1,2,2,2,2,15,7,9,13,17,29,22,25,29,33,34,30,
+  // 29
+  15,13,13,11,7,5,4,2,2,2,1,1,1,1,1,1,2,3,
+  4,5,6,6,6,7,10,13,17,21,28,50,65,103,124,116,142,183,
+  216,202,255,203,213,187,191,130,124,74,43,46,26,11,6,3,2,1,
+  1,1,2,3,3,3,4,6,9,12,16,18,19,19,20,23,26,21,
+  // 30
+  9,7,21,18,3,2,2,1,1,1,0,0,0,0,1,1,2,3,
+  4,5,5,5,5,5,8,11,15,19,28,49,82,81,97,135,197,270,
+  252,273,276,240,244,209,163,166,111,62,38,24,14,8,4,2,1,1,
+  1,2,2,3,3,4,4,6,7,10,12,14,14,13,12,15,16,14,
+  // 31
+  4,3,3,2,1,1,0,0,0,0,0,0,0,0,0,1,2,3,
+  3,4,4,5,4,5,7,9,13,18,26,41,62,98,109,153,194,320,
+  305,309,288,271,260,217,174,130,80,76,50,19,11,6,3,1,1,1,
+  1,2,3,3,4,4,5,5,6,6,8,9,9,8,8,8,12,6,
+  // 32
+  3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,1,2,2,
+  3,3,3,27,11,5,6,9,12,18,27,51,71,101,133,168,239,292,
+  314,351,341,386,303,213,211,144,68,47,28,16,10,5,3,1,1,1,
+  1,2,3,4,4,4,39,5,4,4,4,5,5,4,4,4,32,5,
+  // 33
+  2,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,2,2,
+  3,3,3,4,4,5,7,9,13,19,30,51,71,98,141,212,276,334,
+  338,362,362,396,338,226,198,126,65,39,24,15,10,6,4,2,1,1,
+  1,2,3,3,4,4,5,4,3,3,2,2,2,2,2,2,2,2,
+  // 34
+  1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,2,
+  2,3,3,5,6,8,8,10,14,20,32,50,79,147,170,236,292,307,
+  424,431,387,349,233,176,164,93,61,37,23,15,11,8,5,3,1,1,
+  1,1,2,3,3,3,3,3,2,2,1,1,1,1,1,1,1,1,
+  // 35
+  1,1,1,1,1,1,1,0,0,0,35,0,0,0,1,1,1,2,
+  2,2,3,6,10,11,11,12,17,31,64,81,82,173,229,324,379,467,
+  529,415,378,362,272,199,112,72,51,39,22,15,12,11,8,5,2,1,
+  1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,
+  // 36
+  1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,
+  1,2,3,6,11,13,13,14,23,43,56,59,88,138,206,372,381,418,
+  611,418,381,372,206,138,88,59,56,43,23,14,13,13,11,6,3,2,
+  1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
+  // 37
+  1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,1,
+  1,1,2,5,8,11,12,15,22,39,51,72,112,199,272,362,378,415,
+  529,467,379,324,229,173,82,81,64,31,17,12,11,11,10,6,3,2,
+  2,2,1,1,1,0,0,0,35,0,0,0,1,1,1,1,1,1,
+  // 38
+  1,1,1,1,1,1,1,1,1,2,2,3,3,3,3,3,2,1,
+  1,1,1,3,5,8,11,15,23,37,61,93,164,176,233,350,387,431,
+  424,307,292,236,170,147,79,50,32,20,14,10,8,8,6,5,3,3,
+  2,2,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+  // 39
+  2,2,2,2,2,2,2,2,2,3,3,4,5,4,4,3,3,2,
+  1,1,1,2,4,6,10,15,24,39,65,126,198,226,338,396,362,362,
+  338,334,276,212,141,98,71,51,30,19,13,9,7,5,4,4,3,3,
+  3,2,2,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+  // 40
+  3,5,32,4,4,4,5,5,4,4,4,5,39,4,4,4,3,2,
+  1,1,1,1,3,5,10,16,28,47,68,144,211,213,303,386,341,351,
+  314,292,239,168,133,101,71,51,27,18,12,9,6,5,11,27,3,3,
+  3,2,2,1,0,0,0,0,0,0,0,0,0,0,1,1,1,2,
+  // 41
+  4,6,12,8,8,8,9,9,8,6,6,5,5,4,4,3,3,2,
+  1,1,1,1,3,6,11,19,50,76,80,130,174,217,260,271,288,309,
+  305,320,194,153,109,98,62,41,26,18,13,9,7,5,4,5,4,4,
+  3,3,2,1,0,0,0,0,0,0,0,0,0,1,1,2,3,3,
+  // 42
+  9,14,16,15,12,13,14,14,12,10,7,6,4,4,3,3,2,2,
+  1,1,1,2,4,8,14,24,38,62,111,166,163,209,244,240,276,273,
+  252,270,197,135,97,81,82,49,28,19,15,11,8,5,5,5,5,5,
+  4,3,2,1,1,0,0,0,0,1,1,1,2,2,3,18,21,7,
+  // 43
+  15,21,26,23,20,19,19,18,16,12,9,6,4,3,3,3,2,1,
+  1,1,2,3,6,11,26,46,43,74,124,130,191,187,213,203,255,202,
+  216,183,142,116,124,103,65,50,28,21,17,13,10,7,6,6,6,5,
+  4,3,2,1,1,1,1,1,1,2,2,2,4,5,7,11,13,13,
+  // 44
+  23,30,34,33,29,25,22,29,17,13,9,7,15,2,2,2,2,1,
+  1,1,3,5,8,17,23,37,52,86,167,137,167,183,185,197,202,215,
+  262,166,135,125,85,67,52,39,29,23,19,15,12,9,8,7,7,6,
+  5,3,2,2,1,1,2,2,3,3,4,4,6,8,13,16,17,20,
+  // 45
+  34,41,45,45,43,83,26,47,16,12,9,8,21,2,2,2,1,1,
+  1,2,3,6,12,33,32,38,59,93,119,153,180,203,253,227,204,216,
+  198,195,119,124,94,73,58,44,33,27,25,20,14,12,10,9,8,7,
+  6,5,3,2,2,2,3,3,4,5,6,6,8,14,22,24,24,29,
+  // 46
+  70,81,61,76,73,75,32,23,17,13,9,5,3,2,2,2,1,1,
+  1,2,4,7,12,24,32,44,61,88,117,160,206,198,212,224,201,172,
+  167,207,151,153,123,101,105,57,44,42,58,32,24,15,14,12,11,9,
+  10,17,9,4,3,4,4,5,6,6,8,9,11,17,26,30,35,52,
+  // 47
+  88,111,102,101,102,64,42,45,35,14,9,6,4,3,2,2,1,1,
+  1,3,5,8,13,22,33,45,59,81,107,157,132,171,165,189,198,154,
+  162,212,185,132,109,105,85,70,55,40,33,34,29,19,17,15,13,11,
+  10,15,9,5,5,5,6,6,7,8,9,12,16,22,32,43,55,76,
+  // 48
+  130,193,163,137,108,82,98,46,27,45,18,7,5,4,2,2,1,1,
+  2,3,5,9,20,34,53,60,62,104,105,132,135,131,164,185,204,191,
+  179,176,163,210,146,164,99,83,97,63,50,32,29,24,21,19,16,13,
+  11,9,7,7,6,6,7,7,9,19,16,15,22,34,51,75,111,112,
+  // 49
+  261,243,234,206,216,184,103,77,35,21,13,9,6,4,3,2,1,1,
+  2,4,10,17,20,34,53,63,58,81,115,131,130,129,153,171,203,167,
+  192,196,165,194,166,193,133,93,81,60,52,38,34,29,24,21,19,16,
+  13,11,10,9,8,7,7,8,10,22,18,19,32,57,98,122,160,210,
+  // 50
+  379,404,427,355,343,223,129,97,42,26,17,14,10,5,3,2,1,2,
+  3,6,19,29,55,46,50,58,82,87,119,133,136,135,177,182,202,243,
+  256,207,189,214,188,213,143,111,106,94,69,53,45,48,29,50,28,17,
+  16,15,28,16,9,8,8,8,9,12,17,27,55,101,193,235,280,320,
+  // 51
+  572,633,546,530,484,298,151,84,50,30,21,21,15,7,4,3,3,3,
+  5,17,22,16,23,38,48,53,60,96,113,153,135,168,183,200,247,248,
+  294,317,268,269,292,253,179,232,116,86,61,60,48,44,30,28,35,35,
+  19,18,27,16,9,9,10,10,12,17,27,45,92,176,278,308,395,548,
+  // 52
+  805,831,819,832,575,374,169,93,54,33,23,29,14,9,7,5,5,5,
+  7,15,19,18,26,39,49,81,68,80,98,114,149,186,207,234,268,332,
+  360,322,272,281,342,337,193,192,142,102,106,91,49,35,43,35,27,21,
+  29,19,16,13,9,13,19,16,17,32,52,102,150,225,329,469,619,696,
+  // 53
+  1058,1065,1018,852,668,355,209,97,53,33,25,32,14,11,10,9,8,7,
+  8,10,14,22,31,40,48,55,72,98,141,178,168,207,247,312,407,430,
+  478,354,328,341,329,315,242,176,117,99,112,56,34,34,45,34,25,20,
+  37,16,14,11,9,13,20,21,28,52,86,148,246,342,502,751,910,958,
+  // 54
+  1393,1286,1014,721,510,294,180,84,47,30,66,19,22,16,49,14,12,9,
+  9,12,21,24,34,43,48,61,106,132,163,227,244,344,308,361,419,441,
+  576,477,421,379,331,261,184,153,116,88,68,41,28,25,24,22,18,16,
+  14,12,11,9,13,20,28,60,63,106,166,285,395,527,726,988,1277,1359,
+  // 55
+  1415,1192,858,608,407,230,123,66,38,26,47,22,35,19,17,17,14,10,
+  9,16,38,46,37,54,61,103,133,174,200,278,268,347,414,535,562,432,
+  485,540,502,418,295,226,173,118,83,78,37,24,20,18,18,16,14,12,
+  10,9,8,9,21,40,45,82,153,254,318,414,550,793,1001,1259,1546,1475,
+  // 56
+  1481,1042,670,447,273,159,85,45,28,21,18,17,52,16,16,15,12,9,
+  9,10,24,67,39,57,94,140,160,183,247,264,323,439,472,509,591,560,
+  558,439,372,322,215,212,158,80,52,41,22,15,12,11,11,11,10,8,
+  7,7,7,9,17,45,93,182,294,447,566,687,880,1029,1175,1393,1517,1628,
+  // 57
+  966,753,483,298,177,97,50,28,19,16,15,14,14,13,12,11,9,8,
+  7,14,21,35,40,61,104,153,226,266,301,326,389,499,550,559,541,525,
+  408,372,253,258,148,103,73,49,32,20,12,7,6,6,6,6,6,5,
+  5,5,5,10,24,87,178,340,480,687,860,1040,1120,1170,1362,1748,1585,1261,
+  // 58
+  609,435,280,173,97,49,25,15,12,11,10,10,10,9,9,7,6,5,
+  6,19,22,25,58,105,146,183,216,260,294,321,399,407,475,536,431,435,
+  283,218,164,156,95,61,41,26,16,9,5,3,2,2,3,3,3,3,
+  2,3,5,12,37,114,246,462,714,1078,1329,1476,1375,1271,1285,1226,1069,800,
+  // 59
+  375,246,152,85,42,20,11,8,7,6,6,6,6,5,5,4,3,3,
+  4,9,14,25,50,127,183,213,251,295,321,379,405,402,379,369,324,304,
+  169,136,116,73,48,31,19,11,6,3,1,0,0,0,1,1,1,1,
+  1,1,4,14,48,140,312,595,1041,1881,2038,1689,1397,1289,1118,940,662,506,
+  // 60
+  202,133,69,32,14,7,4,3,3,2,2,2,2,2,2,1,1,1,
+  2,5,11,24,49,95,183,204,251,346,331,445,391,306,221,193,167,181,
+  102,74,60,34,21,13,7,3,2,1,0,0,0,0,0,0,0,0,
+  0,1,4,15,52,158,352,573,1178,2021,1972,1686,1389,1103,852,606,397,282,
+  // 61
+  96,58,24,10,4,3,2,1,1,1,1,0,0,0,0,0,0,0,
+  1,3,8,20,44,89,167,224,234,319,291,248,205,160,138,114,91,80,
+  48,33,21,13,8,4,2,1,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,14,80,135,305,494,812,1190,1206,1044,930,681,464,318,220,147,
+  // 62
+  35,16,6,3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,
+  0,1,5,14,34,65,103,137,188,228,193,164,137,98,78,59,43,30,
+  20,13,8,4,2,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,12,35,102,230,400,551,668,688,622,560,374,259,169,108,65,
+  // 63
+  10,4,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,8,20,41,67,100,128,121,105,90,71,53,38,26,17,11,
+  7,5,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,9,23,56,143,227,336,402,381,346,279,191,121,74,43,22,
+  // 64
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,4,11,23,40,55,62,63,58,48,35,24,15,9,5,3,
+  2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,6,14,30,84,111,145,175,178,157,117,75,44,25,12,5,
+  // 65
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,2,5,12,22,30,34,33,28,21,14,8,4,2,1,1,
+  1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,4,8,15,25,40,53,62,61,51,35,21,12,5,2,0,
+  // 66
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,2,5,10,14,15,13,10,7,4,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,3,4,7,10,14,17,18,16,12,7,4,1,0,0,0,
+  // 67
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,2,3,5,5,4,3,2,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,1,1,2,3,4,4,5,4,3,1,0,0,0,0,0,0,
+  // 68
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+  // 69
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 70
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 71
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+  };
+  ftype32 rama5_pro[] = {
+  // 0
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 1
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 2
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 3
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 4
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 5
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 6
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 7
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 8
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 9
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 10
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 11
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 12
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 13
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 14
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 15
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 16
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 17
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 18
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 19
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 20
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 21
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 22
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 23
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 24
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 25
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 26
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 27
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 28
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 29
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 30
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 31
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 32
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 33
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 34
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 35
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 36
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 37
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 38
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 39
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 40
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 41
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 42
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 43
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 44
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 45
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 46
+  0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 47
+  1,1,2,2,3,3,4,4,4,4,3,2,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,1,2,2,3,3,3,3,3,
+  2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 48
+  7,8,9,10,10,10,10,10,8,7,6,4,3,1,0,0,0,0,
+  0,0,0,0,0,0,1,2,3,4,5,6,8,10,11,11,10,9,
+  7,5,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,5,
+  // 49
+  24,26,26,26,26,24,22,18,15,11,9,7,5,3,2,0,0,0,
+  0,0,0,0,1,3,5,7,8,10,13,16,20,24,26,26,24,21,
+  16,12,8,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,1,2,5,8,14,19,
+  // 50
+  56,59,59,56,51,45,38,30,23,17,13,49,51,8,6,4,2,0,
+  0,0,1,3,6,9,13,17,20,24,31,40,49,56,60,58,53,44,
+  34,24,16,9,4,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,1,4,9,17,27,40,50,
+  // 51
+  112,111,105,95,83,71,57,45,34,27,23,46,49,24,22,17,11,7,
+  4,4,5,9,15,22,30,37,45,56,73,94,114,129,135,128,114,94,
+  70,47,29,16,8,4,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,1,5,14,27,45,68,90,105,
+  // 52
+  200,197,178,139,116,96,76,61,48,42,42,47,53,56,52,44,33,24,
+  17,14,16,23,33,45,60,76,97,127,167,212,253,281,288,271,235,186,
+  134,87,52,29,15,7,4,2,1,1,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,1,6,17,36,66,106,147,177,194,
+  // 53
+  549,301,257,189,146,114,90,73,63,61,69,82,95,101,98,84,67,51,
+  38,32,34,43,60,82,111,149,202,344,415,452,529,573,572,523,439,336,
+  233,148,85,47,25,13,7,4,3,2,1,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,2,7,19,46,91,156,230,291,326,332,
+  // 54
+  440,356,283,253,180,120,95,80,74,81,99,121,142,157,156,136,106,81,
+  63,54,56,70,96,135,192,273,388,538,712,887,1019,1156,1059,910,834,539,
+  485,223,128,67,35,18,10,6,4,3,1,1,1,1,1,1,1,1,
+  0,0,0,0,0,0,0,3,10,27,64,129,224,341,453,604,589,517,
+  // 55
+  596,432,308,236,161,113,89,129,110,174,122,151,180,302,301,181,142,106,
+  85,74,78,98,138,206,312,471,695,1058,1289,1616,1869,1981,1657,1392,1115,844,
+  507,316,196,94,43,22,12,8,5,3,2,1,1,2,2,2,2,1,
+  0,0,0,0,0,0,4,15,46,110,216,363,533,697,818,906,881,776,
+  // 56
+  721,493,320,204,133,93,74,88,85,134,131,190,206,269,337,202,159,119,
+  96,87,94,122,185,297,481,766,1192,1752,2124,2509,2701,2849,2510,2098,1523,1066,
+  624,413,247,110,46,23,12,8,6,3,2,1,2,2,3,3,2,2,
+  1,0,0,0,0,5,20,69,179,356,610,867,1104,1276,1381,1386,1267,1001,
+  // 57
+  817,526,303,171,100,66,54,55,67,91,123,226,262,227,290,184,148,113,
+  93,88,100,148,249,414,730,1187,1810,2681,3165,3521,3561,3703,3479,2832,1876,1126,
+  690,492,243,105,43,20,11,7,5,3,2,1,2,2,3,3,3,2,
+  1,0,0,0,4,20,77,218,468,815,1263,1639,1911,2046,2116,1977,1623,1168,
+  // 58
+  872,555,348,126,64,39,34,38,51,72,99,125,144,153,153,139,115,91,
+  78,77,96,172,315,547,1052,1676,2350,3241,4104,4390,4452,4223,4187,3139,1965,1186,
+  673,362,184,78,33,15,8,5,3,2,1,1,1,2,3,3,2,2,
+  1,0,0,2,13,59,192,465,892,1424,1979,2471,2875,3010,2804,2445,2093,1463,
+  // 59
+  781,440,195,79,33,19,18,23,34,49,67,85,98,102,99,88,74,61,
+  55,59,85,168,342,643,1264,2006,2729,4348,5144,5262,5401,4751,3633,2907,1712,1047,
+  571,284,129,53,21,10,6,3,2,1,0,0,1,2,2,2,2,1,
+  0,0,0,5,31,121,344,753,1341,2021,2903,3684,4287,4109,3624,2862,1957,1231,
+  // 60
+  603,306,120,41,14,8,8,13,19,27,37,47,53,55,53,47,39,34,
+  33,40,70,154,339,679,1266,2017,2892,4099,4624,5144,4698,3924,3003,2018,1331,791,
+  408,188,78,29,11,5,3,1,0,0,0,0,0,1,1,1,1,0,
+  0,0,1,10,53,186,479,979,1680,2519,3559,4542,4411,3925,3198,2384,1673,1038,
+  // 61
+  390,167,58,16,5,3,4,6,9,13,17,20,22,22,21,18,16,15,
+  16,24,54,136,315,639,1172,1809,2626,3504,3932,4174,3645,3010,2225,1429,889,491,
+  236,99,37,13,5,2,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,2,16,72,226,545,1091,1862,2726,3711,4199,4050,3519,2733,1944,1282,757,
+  // 62
+  204,73,21,5,1,1,2,3,4,5,5,6,7,6,5,5,4,5,
+  7,14,39,107,257,525,1089,1532,2111,2774,2967,2742,2357,1871,1349,870,497,248,
+  106,39,13,5,2,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,4,20,77,226,532,1047,1936,2975,3469,3210,3129,2600,2046,1379,851,456,
+  // 63
+  77,22,4,0,0,0,1,1,1,1,1,1,1,1,0,0,1,2,
+  3,9,26,73,180,372,803,1081,1407,1849,1755,1661,1415,1076,722,422,214,92,
+  34,11,4,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,5,21,69,188,412,863,1440,1763,1987,2118,2015,1697,1254,811,452,210,
+  // 64
+  17,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,5,16,44,106,220,392,594,801,934,965,881,704,491,294,149,64,23,
+  7,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,6,19,53,133,281,501,773,1044,1236,1288,1172,926,629,362,172,63,
+  // 65
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,8,23,52,107,191,290,379,431,425,361,262,160,81,34,11,3,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,5,15,36,81,162,279,418,547,624,618,524,375,221,106,38,9,
+  // 66
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,10,22,42,73,109,139,150,137,104,66,34,13,4,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,4,11,23,44,79,128,182,226,240,218,164,100,48,17,4,0,
+  // 67
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,4,8,14,21,30,35,36,30,20,11,4,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,3,7,13,22,35,50,63,70,66,52,32,15,6,2,0,0,
+  // 68
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,4,5,6,6,6,5,3,2,1,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,3,6,10,14,17,18,16,12,7,3,1,0,0,0,0,
+  // 69
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,3,4,5,5,4,3,1,0,0,0,0,0,0,0,
+  // 70
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+  // 71
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+  };
+  ftype32 rama5_ngp[] = {
+  // 0
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 1
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 2
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 3
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 4
+  0,0,0,0,0,0,0,0,1,2,2,3,3,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 5
+  0,0,0,0,0,0,1,3,5,7,9,10,9,7,4,2,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 6
+  0,0,0,0,1,3,7,13,19,23,24,24,21,15,9,5,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,1,1,1,1,1,7,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 7
+  0,0,0,2,6,13,24,35,45,51,57,46,37,26,17,9,5,2,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,2,2,2,2,2,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 8
+  0,1,4,10,19,34,53,71,89,90,96,86,65,42,27,14,7,3,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,5,3,3,4,4,4,3,2,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 9
+  2,6,12,24,41,65,91,114,140,147,142,121,97,58,39,18,9,4,
+  2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,7,4,6,9,6,5,4,3,2,1,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 10
+  7,14,26,43,68,101,130,158,208,235,211,149,129,73,46,22,10,5,
+  2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,2,3,5,6,13,16,8,7,6,4,3,2,1,
+  0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,3,
+  // 11
+  14,25,41,64,102,148,206,247,317,288,202,153,108,68,41,19,9,4,
+  2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,1,1,1,2,2,4,5,6,13,19,9,9,8,4,3,2,1,
+  0,0,0,0,1,1,2,2,1,1,1,1,1,1,1,1,3,7,
+  // 12
+  21,36,56,95,144,181,210,250,245,212,173,128,80,53,38,20,8,4,
+  2,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,3,
+  5,1,1,2,5,4,3,5,6,7,9,9,8,6,4,3,2,1,
+  0,0,0,1,1,2,3,3,3,2,2,7,1,1,2,6,7,12,
+  // 13
+  28,48,76,105,132,167,174,181,170,142,112,83,55,33,19,12,7,3,
+  2,1,1,1,1,1,0,0,0,0,0,0,0,2,1,0,1,1,
+  5,1,1,1,2,2,3,3,4,5,7,8,6,4,3,2,1,1,
+  0,0,1,1,2,5,6,5,4,3,3,3,2,2,3,7,12,16,
+  // 14
+  32,51,73,92,98,125,122,123,109,91,69,48,31,18,10,6,3,2,
+  1,1,1,1,1,1,1,1,0,0,0,0,0,4,1,1,3,1,
+  5,1,1,1,1,2,2,2,3,3,4,4,3,3,2,1,1,0,
+  0,0,1,1,2,5,7,6,5,4,3,2,2,3,4,6,16,19,
+  // 15
+  38,41,55,57,70,87,73,70,58,47,34,23,13,8,9,3,2,1,
+  1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,3,2,
+  1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,0,0,
+  0,0,1,1,2,3,4,5,4,4,3,2,2,3,4,6,11,24,
+  // 16
+  22,26,31,36,39,39,37,32,26,19,13,7,4,3,4,1,1,1,
+  1,1,0,0,0,0,1,1,1,1,3,1,1,6,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,2,3,3,3,3,2,2,2,2,3,6,14,22,
+  // 17
+  13,16,18,20,20,18,16,12,9,5,3,2,1,1,1,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,2,2,2,2,2,1,1,1,2,3,4,8,10,
+  // 18
+  7,8,9,9,8,7,5,3,2,1,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,1,1,0,0,1,2,3,4,6,
+  // 19
+  3,4,3,3,2,2,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,3,
+  // 20
+  1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+  // 21
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 22
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 23
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 24
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 25
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 26
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 27
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 28
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 29
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 30
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 31
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 32
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 33
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,1,1,2,3,3,3,3,2,
+  2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 34
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,2,3,5,7,10,11,12,11,8,
+  6,4,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 35
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+  1,1,1,1,1,1,2,3,4,7,11,16,21,27,30,30,27,22,
+  16,10,5,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 36
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,
+  2,2,2,3,3,4,5,8,12,18,26,37,49,60,67,68,59,47,
+  34,22,12,6,3,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 37
+  0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,
+  4,5,6,6,7,10,13,19,29,40,57,75,96,122,126,128,107,86,
+  63,42,23,12,6,3,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 38
+  1,1,1,1,1,1,1,1,1,1,2,2,4,5,6,6,7,11,
+  13,9,11,12,15,19,26,38,59,75,107,137,167,208,208,205,196,141,
+  101,69,39,20,11,5,3,1,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 39
+  2,2,3,3,3,3,3,3,3,3,4,12,8,10,10,13,16,14,
+  15,16,22,25,27,36,49,65,91,127,171,229,296,332,361,353,264,218,
+  137,93,56,31,15,8,4,2,1,0,0,0,0,0,0,0,0,0,
+  0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,
+  // 40
+  4,5,6,6,7,7,7,6,5,6,7,9,12,22,32,18,19,29,
+  24,24,29,37,54,78,84,108,146,215,278,328,381,429,457,434,342,261,
+  180,105,76,45,25,12,11,3,1,0,0,0,0,0,0,0,0,1,
+  1,1,1,1,2,2,1,1,1,1,1,1,1,1,2,2,3,3,
+  // 41
+  8,10,11,12,12,12,12,14,13,14,12,15,19,27,31,29,28,32,
+  37,39,45,56,79,100,132,182,230,298,365,453,489,546,529,508,381,289,
+  204,121,73,40,23,12,6,3,1,0,0,0,0,0,1,1,1,1,
+  1,2,2,3,6,3,3,2,2,2,2,6,2,3,4,4,5,7,
+  // 42
+  16,18,20,21,21,20,18,23,23,22,20,25,30,40,43,50,44,43,
+  45,56,66,86,117,154,195,264,328,404,484,568,599,663,613,595,435,312,
+  218,126,74,44,24,14,6,3,1,1,1,1,1,1,1,1,1,1,
+  2,2,3,4,9,4,4,4,4,4,4,8,5,7,7,9,11,13,
+  // 43
+  29,32,34,35,38,32,29,34,27,33,36,39,50,62,56,60,62,58,
+  62,74,93,127,163,227,298,385,457,563,632,705,761,773,712,615,498,334,
+  232,130,76,46,26,16,7,3,2,1,1,1,1,1,1,1,1,2,
+  2,3,4,5,6,6,7,7,7,7,8,8,17,15,15,17,20,24,
+  // 44
+  49,53,55,58,71,52,49,52,46,44,41,53,61,71,77,77,90,74,
+  76,102,129,173,234,329,455,547,647,719,818,893,900,863,816,673,497,332,
+  213,140,75,43,25,13,7,4,2,1,1,2,2,2,2,2,2,2,
+  3,4,5,7,8,9,10,10,11,12,13,15,18,23,26,30,44,44,
+  // 45
+  87,90,92,97,87,87,86,62,69,48,50,59,77,85,109,90,104,106,
+  102,116,170,247,320,441,602,704,800,899,957,953,908,906,852,654,474,318,
+  200,131,72,46,23,13,7,4,3,2,2,2,2,2,2,2,2,3,
+  4,5,7,8,10,16,15,15,21,22,31,25,30,39,45,51,71,87,
+  // 46
+  125,134,146,142,122,117,99,72,62,59,54,62,68,86,89,87,103,118,
+  119,136,190,275,387,531,719,826,938,1035,1020,961,922,873,758,604,440,298,
+  186,114,65,39,22,13,8,5,3,2,2,2,2,2,2,2,3,5,
+  7,6,11,10,12,16,18,23,30,33,36,41,50,60,74,102,110,118,
+  // 47
+  183,205,205,198,184,150,115,89,71,65,51,57,61,77,86,87,102,120,
+  134,159,229,323,453,633,845,992,1098,1123,1092,975,916,833,712,568,405,264,
+  164,100,58,34,21,13,8,6,4,3,3,2,4,4,3,3,4,5,
+  8,8,15,14,17,22,23,31,39,47,53,60,74,83,104,138,157,163,
+  // 48
+  268,274,276,264,252,214,165,110,84,64,45,42,52,56,73,91,93,112,
+  160,190,258,389,519,713,950,1152,1199,1156,1103,945,873,781,637,497,351,236,
+  171,95,53,32,23,16,8,13,5,4,3,3,10,5,3,4,5,6,
+  7,9,11,19,20,28,32,43,52,60,70,84,117,128,167,182,208,258,
+  // 49
+  337,366,358,347,335,227,179,124,81,63,41,35,36,41,49,62,84,99,
+  149,192,294,443,598,802,1022,1212,1201,1141,1084,974,821,647,617,454,310,223,
+  145,79,49,30,19,12,8,12,4,4,3,2,3,3,3,4,7,7,
+  7,9,11,14,20,29,37,58,71,80,92,121,154,168,197,258,286,314,
+  // 50
+  461,473,471,407,331,254,204,125,76,48,41,39,34,35,42,56,77,95,
+  136,205,304,453,615,808,1065,1099,1132,1117,1006,878,735,617,497,364,264,185,
+  124,80,47,29,18,11,7,5,3,3,2,2,2,3,4,5,5,5,
+  11,10,11,20,21,36,49,70,85,102,115,145,183,214,276,324,396,404,
+  // 51
+  541,533,521,421,342,247,176,111,71,47,33,33,39,38,45,61,81,105,
+  153,229,327,470,604,778,927,1001,1028,998,880,762,635,554,443,355,255,181,
+  117,79,47,31,18,11,6,7,3,2,2,2,2,3,4,5,4,5,
+  6,9,12,18,24,40,58,81,106,134,157,192,232,277,345,406,454,498,
+  // 52
+  638,615,559,438,339,244,153,99,69,45,33,34,47,49,56,74,94,123,
+  170,248,344,465,575,732,850,960,988,928,828,707,592,514,432,368,263,190,
+  127,84,50,32,20,12,5,6,4,1,1,1,2,2,3,3,3,4,
+  5,9,13,18,28,46,69,95,134,178,219,260,314,360,451,516,585,601,
+  // 53
+  814,726,639,464,305,192,126,76,57,39,35,46,50,59,76,91,110,146,
+  178,258,339,464,571,709,859,894,952,898,795,719,610,502,436,336,262,208,
+  157,96,62,32,18,9,4,4,4,1,1,1,1,1,6,5,2,3,
+  4,7,10,20,31,47,82,132,210,280,340,397,468,530,554,615,720,748,
+  // 54
+  852,709,512,344,227,147,90,57,36,32,35,51,71,78,96,123,130,159,
+  227,251,312,382,536,628,744,808,846,858,774,675,614,541,489,438,286,224,
+  154,104,79,36,19,9,4,1,0,0,0,1,1,1,1,1,1,2,
+  3,6,9,16,34,61,125,205,336,500,598,665,709,732,762,806,855,846,
+  // 55
+  774,587,424,286,174,102,58,36,28,27,41,50,70,93,110,119,120,150,
+  193,219,273,360,481,558,670,741,804,827,776,728,651,584,532,446,304,229,
+  159,100,63,38,18,8,3,1,0,0,0,0,0,1,1,1,1,1,
+  2,6,10,18,39,89,210,437,726,978,1131,1221,1151,1058,1013,981,960,853,
+  // 56
+  653,464,312,199,117,65,35,24,21,21,31,36,52,70,84,96,96,112,
+  133,174,216,287,383,465,590,707,785,833,789,764,703,633,547,452,333,239,
+  158,98,52,31,16,7,2,0,0,0,0,0,0,0,0,0,0,1,
+  1,4,9,19,56,171,440,872,1360,1764,2020,2034,1906,1590,1327,1128,1023,807,
+  // 57
+  540,383,230,131,71,36,19,14,14,15,20,27,36,46,55,77,71,82,
+  92,131,160,215,310,406,530,694,782,850,847,806,752,669,560,471,344,230,
+  152,86,43,22,13,6,1,0,0,0,0,0,0,0,0,0,0,0,
+  1,3,8,25,96,330,783,1436,2174,2765,3134,3095,2745,2166,1700,1356,1078,746,
+  // 58
+  419,265,154,78,37,17,8,6,6,9,15,18,22,28,33,38,42,47,
+  56,77,110,147,225,341,495,613,759,893,913,893,788,694,570,422,272,182,
+  129,59,30,14,6,2,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,2,8,35,159,506,1132,1975,3103,4118,4744,4533,3614,2736,2105,1578,1098,695,
+  // 59
+  306,178,90,40,17,7,3,2,3,4,8,10,12,15,18,20,22,25,
+  31,42,63,105,197,283,407,577,692,871,986,872,719,592,439,311,204,126,
+  74,39,18,8,3,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,9,47,209,626,1346,2431,4229,6649,7923,6169,4175,3105,2229,1507,828,503,
+  // 60
+  202,102,45,17,6,2,1,1,1,1,2,3,4,6,7,8,9,11,
+  14,21,37,68,122,215,323,471,611,774,747,628,522,411,334,216,138,83,
+  45,22,9,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,9,52,223,647,1372,2484,4373,5829,5886,4645,3662,2606,1686,1025,599,365,
+  // 61
+  113,50,19,6,2,1,0,0,0,0,0,1,1,1,2,3,3,4,
+  5,10,20,43,86,155,245,360,468,572,531,458,375,280,205,136,82,46,
+  22,9,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,11,47,191,548,1175,2068,3274,4073,4070,3486,2735,1907,1190,691,395,224,
+  // 62
+  50,18,5,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+  2,4,11,27,57,111,183,257,327,370,347,310,237,177,115,71,39,19,
+  8,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,10,34,133,386,852,1473,2138,2530,2611,2330,1790,1198,711,397,218,112,
+  // 63
+  15,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,2,6,15,35,66,112,165,195,222,212,171,126,86,53,29,14,6,
+  2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,6,21,75,215,503,860,1219,1444,1493,1293,957,611,343,183,93,42,
+  // 64
+  2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,8,19,37,66,89,110,109,104,81,57,35,19,9,3,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,4,12,36,97,225,399,560,666,668,560,391,231,123,61,27,9,
+  // 65
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,4,9,19,30,40,47,48,42,32,20,11,5,2,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,4,6,17,40,78,138,198,231,220,172,111,63,35,14,4,1,
+  // 66
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,2,4,8,13,16,18,17,14,9,5,2,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,3,6,13,24,40,55,61,54,40,25,13,9,2,0,0,
+  // 67
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,3,5,5,5,5,3,2,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,5,7,11,13,13,11,7,4,2,1,0,0,0,
+  // 68
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,2,1,1,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,2,2,3,3,3,2,1,0,0,0,0,0,0,
+  // 69
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+  // 70
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 71
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+  };
+  ftype32 rama5_ngl[] = {
+  // 0
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 1
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 2
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 3
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 4
+  0,0,0,0,0,0,0,0,1,1,2,3,3,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 5
+  0,0,0,0,0,0,1,2,5,7,8,9,8,6,4,2,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 6
+  0,0,0,0,1,3,7,12,18,22,23,22,19,14,9,5,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,1,1,1,1,1,6,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 7
+  0,0,0,2,6,13,22,33,43,48,54,44,35,25,16,9,4,2,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,2,2,2,2,1,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 8
+  0,1,4,9,18,32,50,67,84,85,90,81,61,39,25,13,7,3,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,5,2,3,4,4,3,3,2,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 9
+  2,5,12,22,39,62,86,107,131,138,133,114,91,55,37,17,8,4,
+  2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,7,4,6,8,6,5,4,3,2,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 10
+  6,13,24,40,64,95,123,148,198,221,201,144,121,68,43,21,9,4,
+  2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,2,3,4,5,12,15,8,6,5,4,3,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,
+  // 11
+  13,23,39,60,96,139,193,234,299,271,189,145,101,63,38,17,9,4,
+  2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,1,1,1,2,2,4,5,6,12,19,8,9,8,4,3,2,1,
+  0,0,0,0,1,1,1,2,1,1,1,1,1,1,1,1,3,6,
+  // 12
+  20,34,53,89,139,169,198,238,232,200,163,120,78,50,36,19,8,3,
+  2,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,3,
+  5,1,1,1,5,4,3,4,5,6,8,8,7,6,4,3,2,1,
+  0,0,0,1,1,2,3,3,3,2,2,7,1,1,2,6,7,11,
+  // 13
+  26,45,72,100,126,157,164,172,160,133,106,79,52,31,18,11,6,3,
+  1,1,1,1,1,1,0,0,0,0,0,0,0,2,0,0,1,1,
+  5,1,1,1,2,2,2,3,4,5,7,7,6,4,3,2,1,1,
+  0,0,1,1,2,5,6,5,4,3,2,3,2,2,3,6,12,15,
+  // 14
+  30,48,68,86,93,118,114,115,104,85,65,46,29,17,9,6,3,2,
+  1,1,1,1,1,1,1,1,0,0,0,0,0,3,1,0,2,1,
+  5,1,1,1,1,1,2,2,2,3,4,4,3,2,2,1,1,0,
+  0,0,1,1,2,5,6,5,5,4,3,2,2,2,3,6,15,18,
+  // 15
+  36,39,52,54,66,82,69,67,55,44,33,21,13,8,8,3,2,1,
+  1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,3,2,
+  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+  0,0,0,1,2,3,4,4,4,3,3,2,2,2,4,6,11,24,
+  // 16
+  21,24,29,34,36,37,35,30,25,18,12,7,4,3,3,1,1,1,
+  1,0,0,0,0,0,1,1,1,1,2,1,1,5,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,2,3,3,3,3,2,2,2,2,3,6,15,21,
+  // 17
+  13,15,17,19,19,17,15,11,8,5,3,2,1,1,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,2,2,2,1,1,1,1,2,4,7,9,
+  // 18
+  7,8,9,9,8,6,5,3,2,1,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,2,4,5,
+  // 19
+  3,3,3,3,2,1,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,
+  // 20
+  1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+  // 21
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 22
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 23
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 24
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 25
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 26
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 27
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 28
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 29
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 30
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 31
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 32
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 33
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,1,1,2,3,3,3,3,2,
+  2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 34
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,1,2,3,5,7,9,11,11,10,8,
+  6,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 35
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+  1,1,1,1,1,1,2,3,4,7,10,15,20,25,29,29,26,21,
+  15,9,5,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 36
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,
+  2,2,2,2,3,4,5,8,12,17,25,35,46,56,63,64,55,44,
+  32,20,12,6,3,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 37
+  0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,3,3,4,
+  4,5,5,6,7,9,12,18,27,38,53,71,91,115,119,121,101,81,
+  59,39,22,12,6,3,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 38
+  0,1,1,1,1,1,1,1,1,1,2,2,3,5,5,5,7,10,
+  12,9,10,12,14,18,25,36,55,70,101,129,158,196,195,192,185,134,
+  96,65,37,19,10,5,2,1,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 39
+  2,2,3,3,3,3,2,2,3,3,4,11,7,9,10,13,15,13,
+  14,15,21,24,26,34,46,62,85,120,162,216,280,313,342,337,250,206,
+  130,88,53,30,14,7,3,2,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,
+  // 40
+  4,5,5,6,6,7,7,5,5,6,7,9,11,20,30,17,19,27,
+  23,23,27,34,51,73,79,102,138,202,262,310,358,404,431,410,322,246,
+  171,99,71,42,24,11,10,3,1,0,0,0,0,0,0,0,0,1,
+  1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,
+  // 41
+  8,9,10,11,12,12,11,13,12,13,12,14,18,25,29,27,26,30,
+  34,36,42,53,75,95,123,171,217,280,346,426,460,516,498,479,359,272,
+  193,114,69,38,21,11,6,2,1,0,0,0,0,0,0,1,1,1,
+  1,1,2,2,5,3,2,2,2,2,2,5,2,3,3,4,5,6,
+  // 42
+  15,17,18,19,20,18,17,22,22,20,18,24,28,38,40,47,41,41,
+  43,52,62,82,112,146,183,249,308,381,460,536,565,629,578,561,409,294,
+  206,118,70,41,23,13,6,3,1,1,0,1,1,1,1,1,1,1,
+  2,2,3,4,8,4,4,4,3,3,4,8,5,6,7,8,10,12,
+  // 43
+  27,30,32,33,36,30,28,32,26,31,36,37,47,58,53,57,59,55,
+  58,70,88,120,154,215,282,364,431,533,596,667,718,729,671,581,469,314,
+  218,123,71,43,24,15,6,3,2,1,1,1,1,1,1,1,1,2,
+  2,3,4,5,6,6,6,6,6,7,7,8,16,14,14,16,19,23,
+  // 44
+  46,50,52,54,67,49,46,49,44,41,38,50,57,70,72,73,85,70,
+  72,96,123,164,220,309,429,516,613,679,772,844,848,813,770,634,467,314,
+  201,132,70,41,23,12,6,3,2,1,1,1,2,2,2,2,2,2,
+  3,4,5,6,7,8,9,10,10,11,13,14,17,22,25,29,41,42,
+  // 45
+  82,85,87,91,82,82,81,58,65,45,47,56,72,80,101,86,99,100,
+  96,109,161,233,302,416,568,665,755,851,900,903,857,854,804,617,449,301,
+  189,123,68,43,22,12,7,4,2,2,2,2,2,2,2,2,2,3,
+  4,5,6,8,9,15,14,14,19,21,29,24,29,37,43,49,67,82,
+  // 46
+  118,127,139,133,115,110,94,68,58,56,51,58,64,81,84,82,97,111,
+  111,128,180,260,365,501,679,777,884,977,958,907,870,824,717,571,415,281,
+  176,108,62,37,20,12,7,4,3,2,2,2,2,2,2,2,3,4,
+  7,6,10,9,12,15,17,21,28,31,34,39,47,57,70,96,104,112,
+  // 47
+  173,193,196,186,174,143,109,84,67,62,49,54,58,73,81,81,96,114,
+  126,150,216,305,430,598,799,936,1036,1064,1031,919,864,786,672,537,381,250,
+  155,94,55,32,20,12,8,5,4,3,2,2,3,4,3,3,3,5,
+  7,7,14,13,16,21,22,29,36,45,51,57,70,78,98,130,148,154,
+  // 48
+  253,259,261,250,237,202,157,104,80,61,44,40,50,52,69,86,88,106,
+  151,179,243,367,489,673,896,1088,1134,1093,1042,892,823,740,603,469,330,223,
+  161,89,50,31,22,15,8,12,4,4,3,2,10,5,3,3,5,5,
+  6,8,10,18,19,27,30,41,49,57,66,80,111,121,157,175,196,244,
+  // 49
+  319,347,340,331,319,216,170,117,76,60,39,33,34,39,46,58,79,93,
+  139,181,278,418,563,758,968,1145,1133,1078,1024,923,776,614,583,429,293,211,
+  137,75,47,29,18,11,7,11,4,3,3,2,2,3,3,4,6,7,
+  6,8,10,13,19,27,36,54,66,76,86,114,146,158,186,246,271,297,
+  // 50
+  437,449,449,388,314,241,194,120,73,47,39,37,32,34,40,53,73,90,
+  129,193,287,427,580,763,1003,1038,1068,1053,950,829,694,586,475,346,251,176,
+  120,76,45,28,17,10,6,5,3,2,2,2,2,3,4,4,5,5,
+  10,9,10,19,20,34,46,65,80,96,109,137,172,203,261,309,376,385,
+  // 51
+  516,509,498,403,327,238,169,107,69,46,33,33,39,38,45,58,77,100,
+  145,216,308,445,571,735,876,943,971,946,834,723,604,528,426,342,246,175,
+  116,77,46,30,17,10,6,6,3,2,2,2,2,2,4,4,4,4,
+  6,8,11,17,23,38,55,76,100,126,149,181,218,262,328,388,433,475,
+  // 52
+  614,593,537,420,325,235,148,97,68,44,34,37,49,50,56,72,90,118,
+  161,235,325,441,543,696,803,908,940,886,790,678,570,498,423,363,258,189,
+  127,84,50,32,20,12,5,6,3,1,1,1,1,2,3,3,3,3,
+  5,9,12,17,26,44,65,90,127,168,209,246,299,343,430,495,562,577,
+  // 53
+  790,703,618,447,297,188,124,76,57,40,36,49,53,61,77,90,107,140,
+  171,245,321,440,543,679,816,851,907,869,773,702,603,503,446,342,269,213,
+  160,99,64,33,18,9,4,4,4,1,1,1,1,1,6,4,2,3,
+  4,7,10,19,29,44,78,125,198,264,321,377,446,510,534,596,696,723,
+  // 54
+  832,691,500,343,223,147,95,59,38,34,38,55,75,87,99,123,130,154,
+  218,242,298,363,512,599,712,776,823,836,770,684,637,574,517,461,319,240,
+  177,110,81,38,20,9,4,2,1,0,0,0,1,1,1,1,1,2,
+  3,5,9,15,32,59,118,194,317,473,569,633,682,708,743,792,836,829,
+  // 55
+  761,577,417,282,173,102,60,41,32,35,45,55,75,104,120,121,119,147,
+  187,210,259,345,463,537,647,723,794,839,799,774,722,655,595,494,347,264,
+  178,112,68,40,20,9,4,1,0,0,0,0,0,1,1,1,1,1,
+  2,6,10,17,36,84,198,413,687,929,1081,1172,1113,1036,1000,976,953,847,
+  // 56
+  655,464,312,199,118,66,38,28,24,27,36,45,66,80,101,102,98,112,
+  131,169,207,278,372,455,582,707,810,884,854,859,819,759,655,545,404,283,
+  184,120,60,34,18,8,3,1,0,0,0,0,0,0,0,0,0,1,
+  1,4,9,18,52,162,416,827,1293,1683,1937,1964,1851,1566,1326,1145,1046,812,
+  // 57
+  557,392,234,133,72,38,21,16,16,19,26,39,54,56,72,84,75,83,
+  92,129,156,210,305,405,540,719,839,946,970,954,909,848,721,602,441,279,
+  180,109,52,25,15,7,2,1,0,0,0,0,0,0,0,0,0,0,
+  1,3,7,23,91,313,744,1368,2073,2648,3019,3011,2691,2153,1721,1398,1117,768,
+  // 58
+  442,280,160,80,39,18,10,7,9,12,21,26,29,35,41,44,45,49,
+  57,76,109,147,228,350,527,666,843,1036,1098,1109,998,922,799,580,372,238,
+  157,74,37,17,8,3,1,0,0,0,0,0,0,0,0,0,0,0,
+  1,2,7,33,151,482,1078,1887,2976,3952,4590,4416,3572,2748,2146,1646,1160,748,
+  // 59
+  328,188,95,42,18,7,4,3,4,7,11,13,16,19,22,24,25,27,
+  32,43,64,107,203,301,450,649,811,1076,1235,1155,991,833,649,458,287,176,
+  99,51,24,10,4,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,8,44,200,598,1287,2335,4067,6371,7643,6046,4198,3171,2316,1590,899,552,
+  // 60
+  221,110,48,18,7,3,1,1,2,3,4,5,7,8,9,10,11,12,
+  15,22,40,76,132,240,374,555,733,974,1001,923,764,607,496,312,200,119,
+  63,30,12,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,9,49,214,621,1319,2397,4211,5632,5760,4704,3736,2721,1783,1107,650,398,
+  // 61
+  127,56,20,6,2,1,0,0,0,1,1,1,2,2,3,3,4,4,
+  6,10,22,48,97,180,299,439,591,747,727,668,553,424,315,202,123,68,
+  33,14,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,10,45,185,530,1138,2010,3190,4002,4060,3558,2821,2007,1271,754,439,251,
+  // 62
+  58,21,6,2,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+  2,5,12,30,68,135,237,329,441,519,494,435,348,265,181,111,62,31,
+  13,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,9,33,130,377,833,1446,2124,2554,2655,2400,1864,1274,777,446,249,129,
+  // 63
+  18,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,2,7,18,42,82,147,213,268,314,295,249,193,137,87,49,24,10,
+  3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,5,21,74,213,497,862,1225,1462,1518,1336,1006,663,388,214,111,50,
+  // 64
+  3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,4,10,23,46,82,115,145,152,149,122,90,58,33,16,6,2,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,4,12,36,99,228,408,570,684,695,595,429,265,149,76,34,12,
+  // 65
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,5,11,23,38,52,63,67,62,48,32,18,9,3,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,4,6,18,42,82,150,209,248,240,194,132,79,45,18,6,1,
+  // 66
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,2,5,10,16,21,24,24,20,14,8,4,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,3,7,15,27,46,61,70,63,49,32,18,11,3,0,0,
+  // 67
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,4,5,7,7,6,4,2,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,1,3,5,9,13,16,16,14,10,6,3,1,0,0,0,
+  // 68
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,2,2,1,1,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,2,3,3,4,3,2,1,0,0,0,0,0,0,
+  // 69
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+  // 70
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 71
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+  };
+  ftype32 rama5_all[] = {
+  // 0
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 1
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 2
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 3
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 4
+  0,0,0,0,0,0,0,0,1,1,2,2,2,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 5
+  0,0,0,0,0,0,1,2,5,7,8,9,8,6,4,2,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 6
+  0,0,0,0,1,3,7,12,18,21,23,22,18,13,8,5,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,2,2,2,1,1,6,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 7
+  0,0,0,2,6,13,24,35,45,50,54,44,34,24,15,8,4,2,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,2,3,4,5,5,5,4,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 8
+  0,1,4,10,21,37,56,75,93,93,95,83,63,38,24,12,6,3,
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,3,4,9,8,9,9,9,7,5,3,1,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 9
+  3,7,14,27,46,74,104,130,155,159,151,129,99,55,36,16,8,3,
+  1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,1,2,3,4,6,9,15,14,16,18,14,10,7,5,3,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+  // 10
+  9,18,32,53,82,125,165,195,246,267,235,169,132,73,43,19,9,4,
+  2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+  2,3,5,7,9,12,15,18,21,27,31,20,15,11,7,4,2,1,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,
+  // 11
+  21,36,57,89,133,190,265,312,377,347,250,185,119,73,43,17,8,4,
+  2,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,2,4,
+  6,8,10,12,15,18,24,29,32,37,41,28,27,16,9,5,2,1,
+  0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,5,11,
+  // 12
+  38,61,90,143,209,249,303,364,405,366,251,166,101,60,38,19,7,3,
+  2,1,1,1,1,0,0,0,0,0,0,0,0,1,2,4,6,11,
+  15,14,18,21,25,35,42,40,33,33,34,26,22,15,9,5,3,1,
+  1,0,0,1,1,2,3,3,3,2,2,7,2,2,3,9,13,23,
+  // 13
+  60,93,131,177,215,255,278,297,312,259,182,124,76,42,21,13,6,2,
+  1,1,1,1,1,1,0,0,0,0,1,1,2,5,5,8,13,15,
+  23,28,28,31,35,38,39,34,33,31,28,26,20,13,8,5,2,1,
+  1,1,1,1,2,5,6,5,4,4,3,4,3,4,7,14,26,39,
+  // 14
+  85,115,153,186,201,222,221,229,219,173,124,84,50,26,12,6,3,2,
+  1,1,1,1,1,1,1,1,1,1,2,3,4,9,10,14,20,22,
+  31,41,39,42,42,40,39,32,32,28,23,20,16,11,7,4,2,1,
+  1,1,1,2,3,6,7,6,5,4,4,4,4,7,13,23,42,58,
+  // 15
+  120,147,180,182,186,184,170,162,130,110,75,49,29,15,12,3,2,1,
+  1,1,1,1,1,1,1,2,2,3,4,6,8,11,16,24,26,31,
+  33,45,48,47,48,39,37,30,27,28,21,15,11,8,5,4,2,1,
+  1,1,1,2,3,4,5,5,5,5,4,5,7,12,22,36,54,84,
+  // 16
+  154,167,150,161,142,128,115,94,74,56,39,24,13,6,5,2,1,1,
+  1,1,1,1,1,2,2,2,3,5,7,9,15,25,21,28,36,37,
+  54,49,57,48,45,37,32,28,23,18,14,10,7,6,4,5,3,1,
+  1,1,1,2,3,4,7,5,5,4,5,6,10,18,31,48,88,113,
+  // 17
+  135,135,150,133,107,85,65,51,38,27,18,10,6,3,2,1,1,1,
+  1,2,2,2,2,2,2,3,4,6,9,12,15,23,25,35,51,45,
+  48,45,48,40,37,32,25,29,20,16,11,10,6,4,3,2,3,1,
+  1,1,1,2,2,3,6,4,6,4,5,8,14,24,41,62,86,114,
+  // 18
+  117,113,116,97,73,55,40,27,18,12,7,4,3,2,3,1,1,1,
+  2,2,2,2,2,3,3,4,7,7,9,13,17,22,29,35,36,39,
+  45,41,39,32,31,25,21,20,16,10,8,7,5,4,3,2,2,1,
+  1,0,1,2,2,2,2,3,4,4,5,9,17,29,45,70,87,111,
+  // 19
+  99,90,87,68,51,34,24,14,9,5,3,2,2,1,2,1,1,1,
+  2,2,2,2,3,3,3,5,7,8,12,16,19,23,27,33,31,33,
+  36,36,36,29,25,20,17,17,13,8,6,5,4,3,2,2,1,1,
+  0,0,0,0,1,1,1,2,2,3,6,10,20,31,46,74,85,101,
+  // 20
+  77,67,63,46,33,22,14,10,4,3,2,1,1,1,1,1,1,1,
+  2,2,2,2,3,3,4,10,11,10,17,18,19,29,26,30,26,30,
+  30,31,26,24,20,16,13,11,9,7,6,7,4,3,2,2,1,1,
+  0,0,0,0,0,1,1,1,2,3,6,9,17,32,46,69,72,84,
+  // 21
+  54,49,40,29,25,18,8,5,2,1,1,1,1,1,1,1,1,1,
+  2,2,2,2,4,5,3,4,6,9,10,21,16,18,29,24,28,28,
+  27,23,23,18,17,15,14,12,8,9,5,5,4,3,5,1,1,1,
+  0,0,0,0,0,0,1,3,2,3,4,8,17,33,45,53,50,58,
+  // 22
+  36,29,25,21,19,9,5,3,1,1,1,1,0,0,1,1,1,1,
+  1,2,2,2,3,4,3,4,5,7,8,12,14,17,16,19,18,18,
+  18,22,19,15,16,14,10,9,10,7,8,7,4,2,2,1,1,0,
+  0,0,0,0,0,0,0,1,1,2,4,7,14,21,26,33,38,37,
+  // 23
+  22,18,16,12,9,5,3,2,1,2,0,0,0,0,0,0,1,1,
+  1,1,1,2,2,2,4,3,5,6,7,9,11,13,16,19,17,18,
+  16,17,18,16,15,12,11,11,10,8,5,5,4,2,1,1,0,0,
+  0,0,0,0,0,0,0,0,1,2,3,5,12,14,17,21,22,22,
+  // 24
+  14,11,11,7,4,3,2,1,1,2,0,0,0,0,0,0,0,1,
+  1,1,1,1,2,2,3,3,4,5,6,7,9,13,14,20,15,17,
+  16,16,18,18,15,12,12,11,9,10,6,5,4,4,1,1,0,0,
+  0,0,0,0,0,0,0,0,1,1,2,4,9,8,11,14,14,16,
+  // 25
+  8,7,5,4,3,2,1,1,0,0,0,0,0,0,0,0,0,0,
+  1,1,1,1,2,2,2,2,3,3,7,5,8,11,10,11,14,17,
+  14,16,16,18,17,13,12,13,10,7,5,4,2,2,1,0,0,0,
+  0,0,0,0,0,0,0,0,1,1,3,4,4,6,7,8,9,10,
+  // 26
+  5,4,3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,1,1,1,1,2,5,3,3,4,8,7,13,15,12,17,
+  16,17,15,18,20,14,18,12,10,8,6,4,2,1,1,0,0,0,
+  0,0,0,2,0,0,0,0,1,1,2,2,3,4,5,6,8,6,
+  // 27
+  3,3,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,1,1,2,2,3,4,5,6,9,11,13,14,
+  20,17,17,18,20,16,18,14,12,9,6,4,2,1,1,0,0,0,
+  0,0,0,0,0,0,0,0,1,1,2,7,3,3,4,4,5,4,
+  // 28
+  2,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,2,2,3,3,5,7,8,10,13,15,
+  16,16,18,17,19,18,16,13,12,8,5,3,2,1,0,0,0,0,
+  0,0,0,0,0,0,0,0,1,1,1,3,2,3,3,3,3,2,
+  // 29
+  1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,2,2,3,5,8,10,10,13,18,
+  17,19,20,19,18,18,14,12,9,6,5,4,2,1,0,0,0,0,
+  0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,1,1,
+  // 30
+  0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,1,2,2,5,7,8,12,12,20,24,
+  25,26,25,23,22,22,16,14,12,5,4,2,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+  // 31
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,1,2,4,6,11,12,13,17,28,
+  30,26,29,26,25,23,16,10,7,9,4,1,1,0,0,0,0,0,
+  0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,
+  // 32
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,1,1,2,2,5,8,10,15,16,19,25,
+  33,31,35,32,30,18,21,12,6,4,2,1,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+  // 33
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,1,2,3,6,9,12,18,21,25,29,
+  33,33,33,32,23,18,15,11,5,3,2,1,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 34
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,1,2,2,4,6,9,13,21,27,31,36,37,
+  40,40,35,33,23,18,13,10,5,3,2,1,0,0,0,0,0,0,
+  0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 35
+  0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,1,
+  1,1,1,1,1,2,2,4,6,9,14,21,26,40,49,51,64,61,
+  60,44,36,34,26,20,12,7,4,3,2,1,0,3,0,0,0,0,
+  0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 36
+  0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,
+  2,2,2,3,3,4,6,8,12,19,27,38,51,66,80,86,82,76,
+  72,64,43,34,23,16,10,6,5,2,1,1,0,1,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 37
+  0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,3,
+  4,4,5,6,7,9,12,17,26,38,53,72,93,121,131,137,124,109,
+  92,80,50,38,26,18,10,6,6,2,1,1,0,1,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 38
+  1,1,1,1,1,1,1,1,1,1,2,2,3,5,5,5,6,9,
+  11,8,9,11,13,17,23,34,52,68,98,126,158,195,204,205,206,158,
+  121,93,61,37,26,17,9,6,3,2,1,3,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 39
+  2,2,3,3,3,2,2,2,2,3,4,11,7,9,9,12,14,12,
+  13,13,19,21,23,31,43,57,79,112,153,206,272,305,338,340,260,223,
+  151,107,71,49,30,16,9,6,3,2,1,1,0,0,0,0,1,1,
+  1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,
+  // 40
+  4,5,6,6,6,7,7,5,5,5,7,8,11,18,27,16,17,24,
+  21,20,24,31,47,67,72,94,128,187,243,293,341,386,416,407,324,259,
+  181,120,90,57,34,19,15,6,3,2,1,1,0,0,1,3,1,1,
+  1,1,1,1,1,1,1,1,1,0,1,1,1,1,2,2,2,3,
+  // 41
+  8,9,11,11,11,12,12,13,11,12,11,13,16,24,27,25,24,28,
+  31,32,38,49,68,86,112,157,202,261,321,399,434,487,474,467,354,278,
+  200,130,81,50,29,19,11,6,3,2,1,1,1,1,1,1,1,1,
+  1,2,2,2,5,2,2,2,2,1,1,5,2,3,3,4,5,6,
+  // 42
+  14,16,18,19,20,18,17,22,23,19,17,22,26,35,37,45,37,37,
+  38,49,56,74,101,135,167,230,286,352,430,503,532,592,549,535,397,291,
+  207,130,81,51,30,21,12,6,4,2,2,1,1,1,1,1,1,1,
+  2,2,3,3,8,4,4,3,3,3,3,7,5,6,7,8,10,12,
+  // 43
+  26,29,33,32,34,30,28,31,25,29,32,34,44,53,49,53,55,51,
+  54,64,80,109,140,196,256,336,397,492,555,622,675,681,636,551,454,303,
+  214,126,81,53,35,22,12,7,4,3,2,2,2,2,2,1,1,2,
+  2,3,4,4,5,6,6,6,6,6,7,7,14,14,13,15,18,22,
+  // 44
+  44,48,50,52,63,47,44,47,41,39,35,46,53,64,66,67,77,63,
+  67,88,111,149,201,281,390,470,561,623,717,780,788,754,717,598,444,303,
+  206,133,76,49,32,17,11,7,5,3,3,3,3,3,2,2,2,2,
+  3,4,5,6,7,8,8,9,10,11,12,13,16,21,23,27,38,40,
+  // 45
+  77,80,84,87,77,80,76,56,60,41,43,51,65,73,93,78,90,91,
+  87,100,145,211,274,381,519,608,692,781,832,840,801,793,749,580,431,293,
+  188,129,74,51,29,18,12,8,5,4,4,4,3,3,3,3,3,3,
+  4,5,6,7,9,14,13,13,18,20,26,22,26,36,42,46,62,78,
+  // 46
+  112,120,132,125,108,105,89,65,57,51,47,54,58,74,77,75,89,101,
+  100,118,162,236,331,459,618,712,815,900,888,846,808,764,666,533,399,272,
+  175,114,69,46,28,20,13,10,7,5,6,4,4,4,3,3,3,5,
+  7,6,9,9,11,14,16,20,26,29,32,36,43,54,66,90,98,108,
+  // 47
+  164,183,186,178,168,135,105,81,64,57,45,49,53,67,74,76,87,103,
+  115,134,195,278,391,547,732,856,950,971,948,855,805,734,629,499,361,240,
+  156,102,65,43,29,22,15,12,8,6,7,5,6,6,4,4,4,6,
+  8,7,13,13,16,20,20,26,34,41,49,54,64,72,93,123,139,147,
+  // 48
+  243,253,253,236,225,192,153,101,76,60,41,37,46,48,62,79,80,96,
+  137,161,220,335,447,616,822,997,1037,1000,957,822,756,683,564,445,314,219,
+  161,98,61,43,33,25,17,18,12,9,6,6,11,7,4,5,6,7,
+  7,8,10,17,18,25,27,38,45,52,61,74,103,114,148,166,188,233,
+  // 49
+  318,342,336,318,309,215,164,116,73,57,37,31,32,36,42,52,71,85,
+  126,166,253,379,512,692,884,1044,1033,986,936,849,719,572,546,405,282,207,
+  141,88,59,42,32,26,20,19,11,12,7,6,5,5,6,7,7,8,
+  7,8,13,13,18,25,32,50,60,69,79,105,136,150,176,234,263,289,
+  // 50
+  433,451,448,386,314,239,188,116,70,44,37,35,30,31,37,49,66,81,
+  116,178,263,391,528,698,917,951,974,965,879,768,648,550,447,327,243,180,
+  130,94,62,45,34,28,20,15,12,11,9,7,6,7,7,8,6,6,
+  10,9,11,19,19,31,42,59,73,87,100,126,161,197,249,300,364,379,
+  // 51
+  524,523,509,413,335,238,168,106,67,47,31,31,37,34,41,53,70,91,
+  132,195,279,407,524,676,806,873,893,871,772,668,560,499,409,331,241,183,
+  132,97,66,51,41,32,22,19,14,11,8,7,6,6,7,8,5,5,
+  7,11,12,17,21,35,51,76,91,116,137,168,207,252,317,381,429,482,
+  // 52
+  633,617,561,447,339,242,152,98,67,46,33,36,46,45,51,65,82,107,
+  147,213,297,403,499,638,742,837,865,817,734,625,531,471,407,353,263,199,
+  151,104,73,56,47,37,23,22,16,10,7,7,6,5,6,5,5,5,
+  7,10,12,15,27,42,60,83,118,155,194,231,284,332,423,494,571,597,
+  // 53
+  822,738,655,478,327,200,132,79,57,39,36,46,50,57,71,83,97,128,
+  156,221,289,404,499,616,750,782,831,800,713,650,560,476,431,339,277,229,
+  193,123,89,60,46,40,25,19,14,10,9,5,5,4,10,6,4,4,
+  6,7,10,18,27,40,72,115,182,245,302,357,427,495,531,612,719,759,
+  // 54
+  890,745,551,381,249,161,101,61,39,34,40,52,70,81,95,114,118,140,
+  198,220,272,334,468,544,652,713,758,768,710,640,600,548,501,454,331,258,
+  209,146,110,64,47,34,21,16,11,8,10,4,4,3,3,3,3,3,
+  5,6,9,15,29,55,109,181,292,440,534,604,654,690,740,814,876,893,
+  // 55
+  824,629,462,310,194,118,68,43,32,34,44,53,70,97,110,112,109,135,
+  171,191,238,320,423,490,595,667,734,773,740,729,690,629,582,492,359,280,
+  205,143,102,73,44,30,20,13,8,5,4,3,2,2,2,2,2,2,
+  3,6,10,16,34,79,183,381,634,863,1007,1099,1058,1009,996,995,1002,904,
+  // 56
+  705,509,346,221,133,75,42,30,25,27,35,42,62,74,93,95,92,104,
+  121,159,188,254,341,417,533,658,753,819,795,799,774,732,643,544,415,302,
+  212,152,87,61,38,28,15,9,5,3,2,2,1,1,1,1,1,2,
+  3,4,8,17,49,150,383,763,1195,1559,1804,1847,1758,1507,1313,1165,1087,868,
+  // 57
+  589,424,258,148,82,43,23,18,17,18,24,36,50,52,67,78,69,76,
+  85,118,143,192,281,376,501,670,781,882,908,905,864,818,706,597,450,297,
+  200,133,73,46,28,16,9,5,3,2,1,1,1,1,1,1,1,1,
+  2,3,7,22,85,288,685,1266,1926,2462,2823,2832,2543,2059,1679,1401,1145,797,
+  // 58
+  459,297,172,89,44,21,11,8,9,12,22,24,27,33,38,40,42,45,
+  53,72,102,135,212,327,493,624,791,963,1034,1043,944,884,781,578,372,247,
+  168,87,50,30,16,9,5,3,1,1,0,0,0,0,0,0,0,0,
+  1,2,7,31,139,444,994,1752,2774,3735,4334,4174,3385,2628,2069,1607,1153,756,
+  // 59
+  331,194,101,46,20,9,5,4,5,6,11,12,15,18,20,22,23,25,
+  29,40,59,99,189,283,428,612,765,1003,1158,1087,943,805,629,450,289,179,
+  108,59,34,16,8,4,2,1,0,0,0,0,0,0,0,0,0,0,
+  0,2,7,41,184,553,1192,2171,3797,6007,7154,5665,3961,3008,2204,1534,885,552,
+  // 60
+  218,112,50,20,7,3,2,2,2,3,4,5,6,8,9,9,10,11,
+  14,20,37,71,124,226,354,526,692,913,946,872,724,577,473,300,196,124,
+  67,35,17,7,3,1,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,8,46,198,577,1224,2225,3944,5350,5434,4448,3531,2581,1697,1057,627,388,
+  // 61
+  123,55,21,7,2,1,0,0,0,1,1,1,2,2,3,3,3,4,
+  5,10,20,45,92,171,283,416,561,711,688,628,521,399,297,193,120,70,
+  35,16,7,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,9,42,172,495,1058,1870,2989,3761,3808,3338,2658,1888,1193,710,417,241,
+  // 62
+  55,20,6,2,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+  2,4,11,29,64,130,225,310,415,495,468,410,328,249,171,106,60,31,
+  14,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,3,8,31,121,351,773,1345,1975,2385,2478,2236,1740,1188,725,416,234,122,
+  // 63
+  17,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  1,2,6,17,40,77,139,202,253,295,279,235,182,128,82,46,23,10,
+  4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,5,19,69,198,461,800,1138,1359,1407,1240,935,614,359,199,103,47,
+  // 64
+  3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,9,22,44,78,110,137,143,140,115,85,54,31,15,6,2,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,3,11,35,93,211,377,527,633,643,550,396,245,137,71,32,11,
+  // 65
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,5,11,22,36,50,60,63,58,45,30,17,8,3,1,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,2,4,6,17,39,76,139,193,229,222,179,122,72,41,17,5,1,
+  // 66
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,2,5,9,15,20,23,22,19,13,7,3,1,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,1,2,3,7,14,25,43,57,64,58,45,29,16,10,2,0,0,
+  // 67
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,2,4,5,6,7,6,4,2,1,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,1,1,3,5,8,12,15,15,13,9,5,3,1,0,0,0,
+  // 68
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,1,1,2,2,2,1,1,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,1,1,2,3,3,3,3,2,1,0,0,0,0,0,0,
+  // 69
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+  // 70
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  // 71
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+  };
 }
 
 
@@ -475,6 +2286,26 @@ Ramachandran::Ramachandran( TYPE type )
 void Ramachandran::init( TYPE type )
 {
   switch (type) {
+  case Gly5:
+    Prob_phi_2d::init( data::rama5_data_size );
+    Prob_phi_2d::accumulate( data::rama5_gly );
+    break;
+  case Pro5:
+    Prob_phi_2d::init( data::rama5_data_size );
+    Prob_phi_2d::accumulate( data::rama5_pro );
+    break;
+  case NonGlyPro5:
+    Prob_phi_2d::init( data::rama5_data_size );
+    Prob_phi_2d::accumulate( data::rama5_ngp );
+    break;
+  case NonGly5:
+    Prob_phi_2d::init( data::rama5_data_size );
+    Prob_phi_2d::accumulate( data::rama5_ngl );
+    break;
+  case All5:
+    Prob_phi_2d::init( data::rama5_data_size );
+    Prob_phi_2d::accumulate( data::rama5_all );
+    break;
   case Gly:
     Prob_phi_2d::init( data::rama_data_size );
     Prob_phi_2d::accumulate( data::rama_gly );
diff --git a/clipper/core/ramachandran.h b/clipper/core/ramachandran.h
index 7222206..ee29bdb 100644
--- a/clipper/core/ramachandran.h
+++ b/clipper/core/ramachandran.h
@@ -94,7 +94,7 @@ namespace clipper {
   {
   public:
     //! enumeration of built-in Ramachandran tables
-    enum TYPE { Gly, Pro, NonGlyPro, NonGly, All };
+    enum TYPE { Gly, Pro, NonGlyPro, NonGly, All, Gly5, Pro5, NonGlyPro5, NonGly5, All5 };
     //! null constructor
     Ramachandran() {}
     //! constructor: from standard plot
diff --git a/clipper/core/spacegroup.cpp b/clipper/core/spacegroup.cpp
index 2c11c09..242b837 100644
--- a/clipper/core/spacegroup.cpp
+++ b/clipper/core/spacegroup.cpp
@@ -511,7 +511,7 @@ Spgr_descr::Spgr_descr( const String& symb, TYPE type )
     ops.init_hall( symbx );
   } else if ( type == XHM ) {
     char ext = ' ';
-    int c = symbx.find_first_of( ":" );
+    size_t c = symbx.find_first_of( ":" );
     if ( c != String::npos ) {
       if ( c+1 < symbx.length() ) ext = symbx[c+1];
       symbx = symbx.substr(0,c);
diff --git a/clipper/minimol/minimol_io.cpp b/clipper/minimol/minimol_io.cpp
index 37aa7e0..7a60080 100644
--- a/clipper/minimol/minimol_io.cpp
+++ b/clipper/minimol/minimol_io.cpp
@@ -122,13 +122,13 @@ void MMDBfile::import_minimol( MiniMol& minimol, const int hnd )
   int h_chn = NewSelection();
   int h_mod = NewSelection();
   if ( hnd < 0 ) {
-    SelectAtoms( h_atm, 0, 0, SKEY_NEW );
+    SelectAtoms( h_atm, 0, 0, ::mmdb::SKEY_NEW );
   } else {
-    Select( h_atm, STYPE_ATOM, hnd, SKEY_NEW );
+    Select( h_atm, ::mmdb::STYPE_ATOM, hnd, ::mmdb::SKEY_NEW );
   }
-  Select( h_res, STYPE_RESIDUE, h_atm, SKEY_NEW );
-  Select( h_chn, STYPE_CHAIN,   h_atm, SKEY_NEW );
-  Select( h_mod, STYPE_MODEL,   h_atm, SKEY_NEW );
+  Select( h_res, ::mmdb::STYPE_RESIDUE, h_atm, ::mmdb::SKEY_NEW );
+  Select( h_chn, ::mmdb::STYPE_CHAIN,   h_atm, ::mmdb::SKEY_NEW );
+  Select( h_mod, ::mmdb::STYPE_MODEL,   h_atm, ::mmdb::SKEY_NEW );
 
   // now import objects
   char txt[256];
@@ -153,14 +153,14 @@ void MMDBfile::import_minimol( MiniMol& minimol, const int hnd )
 		MAtom atm( Atom::null() );
 		atm.set_name( p_atm->GetAtomName(), p_atm->altLoc );
 		atm.set_element( p_atm->element );
-		if ( p_atm->WhatIsSet & ASET_Coordinates )
+		if ( p_atm->WhatIsSet & ::mmdb::ASET_Coordinates )
 		  atm.set_coord_orth(
 		    Coord_orth( p_atm->x, p_atm->y, p_atm->z ) );
-		if ( p_atm->WhatIsSet & ASET_Occupancy )
+		if ( p_atm->WhatIsSet & ::mmdb::ASET_Occupancy )
 		  atm.set_occupancy( p_atm->occupancy );
-		if ( p_atm->WhatIsSet & ASET_tempFactor )
+		if ( p_atm->WhatIsSet & ::mmdb::ASET_tempFactor )
 		  atm.set_u_iso( Util::b2u( p_atm->tempFactor ) );
-		if ( p_atm->WhatIsSet & ASET_Anis_tFac )
+		if ( p_atm->WhatIsSet & ::mmdb::ASET_Anis_tFac )
 		  atm.set_u_aniso_orth(
 		    U_aniso_orth( p_atm->u11, p_atm->u22, p_atm->u33,
 				  p_atm->u12, p_atm->u13, p_atm->u23 ) );
@@ -271,25 +271,25 @@ void MMDBfile::export_minimol( const MiniMol& minimol )
 
   // Now create MMDB objects for anything which is missing
   if ( smod.db == NULL ) {
-    smod.db = new CModel();
+    smod.db = new mmdb::CModel();
     AddModel( smod.db );
   }
   for ( int p = 0; p < smod.data.size(); p++ ) {  // loop over chains
     SPoly& spol = smod.data[p];
     if ( spol.db == NULL ) {
-      spol.db = new CChain();
+      spol.db = new mmdb::CChain();
       smod.db->AddChain( spol.db );
     }
     for ( int r = 0; r < spol.data.size(); r++ ) {  // loop over residues
       SMono& smon = spol.data[r];
       if ( smon.db == NULL ) {
-	smon.db = new CResidue();
+	smon.db = new mmdb::CResidue();
 	spol.db->AddResidue( smon.db );
       }
       for ( int a = 0; a < smon.data.size(); a++ ) {  // loop over atoms
 	SAtom& satm = smon.data[a];
 	if ( satm.db == NULL ) {
-	  satm.db = new CAtom();
+	  satm.db = new mmdb::CAtom();
 	  smon.db->AddAtom( satm.db );
 	}
       }
@@ -313,15 +313,15 @@ void MMDBfile::export_minimol( const MiniMol& minimol )
           satm.db->x = satm.mm->coord_orth().x();
           satm.db->y = satm.mm->coord_orth().y();
           satm.db->z = satm.mm->coord_orth().z();
-          satm.db->WhatIsSet |= ASET_Coordinates;
+          satm.db->WhatIsSet |= ::mmdb::ASET_Coordinates;
         }
         if ( !Util::is_nan( satm.mm->occupancy() ) ) {  // set atom occ
           satm.db->occupancy = satm.mm->occupancy();
-          satm.db->WhatIsSet |= ASET_Occupancy;
+          satm.db->WhatIsSet |= ::mmdb::ASET_Occupancy;
         }
         if ( !Util::is_nan( satm.mm->u_iso() ) ) {      // set atom u_iso
           satm.db->tempFactor = Util::u2b( satm.mm->u_iso() );
-          satm.db->WhatIsSet |= ASET_tempFactor;
+          satm.db->WhatIsSet |= ::mmdb::ASET_tempFactor;
         }
         if ( !satm.mm->u_aniso_orth().is_null() ) {     // set atom u_aniso
           satm.db->u11 = satm.mm->u_aniso_orth()(0,0);
@@ -330,7 +330,7 @@ void MMDBfile::export_minimol( const MiniMol& minimol )
           satm.db->u12 = satm.mm->u_aniso_orth()(0,1);
           satm.db->u13 = satm.mm->u_aniso_orth()(0,2);
           satm.db->u23 = satm.mm->u_aniso_orth()(1,2);
-          satm.db->WhatIsSet |= ASET_Anis_tFac;
+          satm.db->WhatIsSet |= ::mmdb::ASET_Anis_tFac;
         }
         if ( satm.mm->id() != "" )       // atom id
           satm.db->SetAtomName( (char*)satm.mm->id().substr(0,19).c_str() );
diff --git a/clipper/mmdb/clipper_mmdb.cpp b/clipper/mmdb/clipper_mmdb.cpp
index 7005ff0..857d259 100644
--- a/clipper/mmdb/clipper_mmdb.cpp
+++ b/clipper/mmdb/clipper_mmdb.cpp
@@ -57,11 +57,11 @@ String MMDBAtom::id() const
 { return String( name ); }
 
 String MMDBAtom::element() const
-{ return String( CAtom::element ); }
+{ return String( mmdb::CAtom::element ); }
 
 Coord_orth MMDBAtom::coord_orth() const
 {
-  if ( !Ter && WhatIsSet & ASET_Coordinates )
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_Coordinates )
     return Coord_orth( x, y, z );
   else
     return Coord_orth( Coord_orth::null() );
@@ -69,19 +69,19 @@ Coord_orth MMDBAtom::coord_orth() const
 
 ftype MMDBAtom::occupancy() const
 {
-  if ( !Ter && WhatIsSet & ASET_Occupancy ) return CAtom::occupancy;
-  else                                      return Util::nan();
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_Occupancy ) return mmdb::CAtom::occupancy;
+  else                                              return Util::nan();
 }
 
 ftype MMDBAtom::u_iso() const
 {
-  if ( !Ter && WhatIsSet & ASET_tempFactor ) return Util::b2u(tempFactor);
-  else                                       return Util::nan();
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_tempFactor ) return Util::b2u(tempFactor);
+  else                                               return Util::nan();
 }
 
 U_aniso_orth MMDBAtom::u_aniso_orth() const
 {
-  if ( !Ter && WhatIsSet & ASET_Anis_tFac )
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_Anis_tFac )
     return U_aniso_orth( u11, u22, u33,
 			 u12, u13, u23 );
   else
@@ -90,7 +90,7 @@ U_aniso_orth MMDBAtom::u_aniso_orth() const
 
 Sig_Coord_orth MMDBAtom::sig_coord_orth() const
 {
-  if ( !Ter && WhatIsSet & ASET_CoordSigma )
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_CoordSigma )
     return Sig_Coord_orth( sigX, sigY, sigZ );
   else
     return Sig_Coord_orth( Sig_Coord_orth::null() );
@@ -98,19 +98,19 @@ Sig_Coord_orth MMDBAtom::sig_coord_orth() const
 
 ftype MMDBAtom::sig_occupancy() const
 {
-  if ( !Ter && WhatIsSet & ASET_OccSigma ) return sigOcc;
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_OccSigma ) return sigOcc;
   else                                     return Util::nan();
 }
 
 ftype MMDBAtom::sig_u_iso() const
 {
-  if ( !Ter && WhatIsSet & ASET_tFacSigma ) return Util::b2u(sigTemp);
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_tFacSigma ) return Util::b2u(sigTemp);
   else                                      return Util::nan();
 }
 
 Sig_U_aniso_orth MMDBAtom::sig_u_aniso_orth() const
 {
-  if ( !Ter && WhatIsSet & ASET_Anis_tFSigma )
+  if ( !Ter && WhatIsSet & ::mmdb::ASET_Anis_tFSigma )
     return Sig_U_aniso_orth( su11, su22, su33,
 			     su12, su13, su23 );
   else
@@ -118,82 +118,82 @@ Sig_U_aniso_orth MMDBAtom::sig_u_aniso_orth() const
 }
 
 void MMDBAtom::set_id( const String& n )
-{ SetAtomName( (char *)n.c_str() ); }
+{ this->SetAtomName( (char *)n.c_str() ); }
 
 void MMDBAtom::set_element( const String& n )
 { SetElementName( (char *)n.c_str() ); }
 
 void MMDBAtom::set_coord_orth( const Coord_orth& v )
 {
-  WhatIsSet &= ~ASET_Coordinates;
+  WhatIsSet &= ~::mmdb::ASET_Coordinates;
   if ( !v.is_null() ) {
     x = v.x(); y = v.y(); z = v.z();
-    WhatIsSet |= ASET_Coordinates;
+    WhatIsSet |= ::mmdb::ASET_Coordinates;
   }
 }
 
 void MMDBAtom::set_occupancy( const ftype& v )
 { 
-  WhatIsSet &= ~ASET_Occupancy;
+  WhatIsSet &= ~::mmdb::ASET_Occupancy;
   if ( !Util::is_nan( v ) ) {
-    CAtom::occupancy = v;
-    WhatIsSet |= ASET_Occupancy;
+    mmdb::CAtom::occupancy = v;
+    WhatIsSet |= ::mmdb::ASET_Occupancy;
   }
 }
 
 void MMDBAtom::set_u_iso( const ftype& v )
 { 
-  WhatIsSet &= ~ASET_tempFactor;
+  WhatIsSet &= ~::mmdb::ASET_tempFactor;
   if ( !Util::is_nan( v ) ) {
     tempFactor = Util::u2b(v);
-    WhatIsSet |= ASET_tempFactor;
+    WhatIsSet |= ::mmdb::ASET_tempFactor;
   }
 }
 
 void MMDBAtom::set_u_aniso_orth( const U_aniso_orth& v )
 {
-  WhatIsSet &= ~ASET_Anis_tFac;
+  WhatIsSet &= ~::mmdb::ASET_Anis_tFac;
   if ( !v.is_null() ) {
     u11 = v(0,0); u22 = v(1,1); u33 = v(2,2);
     u12 = v(0,1); u13 = v(0,2); u23 = v(1,2);
-    WhatIsSet |= ASET_Anis_tFac;
+    WhatIsSet |= ::mmdb::ASET_Anis_tFac;
   }
 }
 
 void MMDBAtom::set_sig_coord_orth( const Sig_Coord_orth& s )
 {
-  WhatIsSet &= ~ASET_CoordSigma;
+  WhatIsSet &= ~::mmdb::ASET_CoordSigma;
   if ( !s.is_null() ) {
     sigX = s.sigx(); sigY = s.sigy(); sigZ = s.sigz();
-    WhatIsSet |= ASET_CoordSigma;
+    WhatIsSet |= ::mmdb::ASET_CoordSigma;
   }
 }
 
 void MMDBAtom::set_sig_occupancy( const ftype& s )
 { 
-  WhatIsSet &= ~ASET_OccSigma;
+  WhatIsSet &= ~::mmdb::ASET_OccSigma;
   if ( !Util::is_nan( s ) ) {
     sigOcc = s;
-    WhatIsSet |= ASET_OccSigma;
+    WhatIsSet |= ::mmdb::ASET_OccSigma;
   }
 }
 
 void MMDBAtom::set_sig_u_iso( const ftype& s )
 { 
-  WhatIsSet &= ~ASET_tFacSigma;
+  WhatIsSet &= ~::mmdb::ASET_tFacSigma;
   if ( !Util::is_nan( s ) ) {
     sigTemp = Util::u2b(s);
-    WhatIsSet |= ASET_tFacSigma;
+    WhatIsSet |= ::mmdb::ASET_tFacSigma;
   }
 }
 
 void MMDBAtom::set_sig_u_aniso_orth( const Sig_U_aniso_orth& s )
 {
-  WhatIsSet &= ~ASET_Anis_tFSigma;
+  WhatIsSet &= ~::mmdb::ASET_Anis_tFSigma;
   if ( !s.is_null() ) {
     su11 = s(0,0); su22 = s(1,1); su33 = s(2,2);
     su12 = s(0,1); su13 = s(0,2); su23 = s(1,2);
-    WhatIsSet |= ASET_Anis_tFSigma;
+    WhatIsSet |= ::mmdb::ASET_Anis_tFSigma;
   }
 }
 
@@ -207,7 +207,7 @@ int MMDBAtom::serial_num() const
 
 /*! \return The atomic charge. */
 String MMDBAtom::charge() const
-{ return String( CAtom::charge ); }
+{ return String( mmdb::CAtom::charge ); }
 
 
 // residue
@@ -254,7 +254,7 @@ void MMDBModel::set_id( const String& n )
 
 /*! For later initialisation: see init() */
 MMDBManager::MMDBManager() 
-{ InitMatType(); Message::message( Message_ctor( " [MMDBManager: constructed>" ) ); }
+{ ::mmdb::InitMatType(); Message::message( Message_ctor( " [MMDBManager: constructed>" ) ); }
 
 MMDBManager::~MMDBManager()
 { Message::message( Message_dtor( " <MMDBManager: destroyed]" ) ); }
@@ -291,8 +291,8 @@ Cell MMDBManager::cell() const
 {
   mmdb::CMMDBManager& mmdb = const_cast<MMDBManager&>(*this);
   if ( mmdb.isCrystInfo() ) {
-    return Cell( Cell_descr( Cryst.a, Cryst.b, Cryst.c,
-			     Cryst.alpha, Cryst.beta, Cryst.gamma ) );
+    return Cell( Cell_descr( this->cryst.a, this->cryst.b, this->cryst.c,
+			     this->cryst.alpha, this->cryst.beta, this->cryst.gamma ) );
   } else {
     return Cell();  // null
   }
diff --git a/clipper/mmdb/clipper_mmdb.h b/clipper/mmdb/clipper_mmdb.h
index c5a2884..cfd173b 100644
--- a/clipper/mmdb/clipper_mmdb.h
+++ b/clipper/mmdb/clipper_mmdb.h
@@ -48,29 +48,29 @@
 
 #include "../core/coords.h"
 
-#include <mmdb/mmdb_manager.h>
+#include <mmdb2/mmdb_manager.h>
 
 
 namespace clipper {
 
   namespace mmdb {
-    typedef ::CAtom CAtom;
-    typedef ::CResidue CResidue;
-    typedef ::CChain CChain;
-    typedef ::CModel CModel;
-    typedef ::CMMDBManager CMMDBManager;
-
-    typedef ::PCAtom PCAtom;
-    typedef ::PCResidue PCResidue;
-    typedef ::PCChain PCChain;
-    typedef ::PCModel PCModel;
-    typedef ::PCMMDBManager PCMMDBManager;
-
-    typedef ::PPCAtom PPCAtom;
-    typedef ::PPCResidue PPCResidue;
-    typedef ::PPCChain PPCChain;
-    typedef ::PPCModel PPCModel;
-    typedef ::PPCMMDBManager PPCMMDBManager;
+    typedef ::mmdb::Atom CAtom;
+    typedef ::mmdb::Residue CResidue;
+    typedef ::mmdb::Chain CChain;
+    typedef ::mmdb::Model CModel;
+    typedef ::mmdb::Manager CMMDBManager;
+
+    typedef ::mmdb::PAtom PCAtom;
+    typedef ::mmdb::PResidue PCResidue;
+    typedef ::mmdb::PChain PCChain;
+    typedef ::mmdb::PModel PCModel;
+    typedef ::mmdb::PManager PCMMDBManager;
+
+    typedef ::mmdb::PPAtom PPCAtom;
+    typedef ::mmdb::PPResidue PPCResidue;
+    typedef ::mmdb::PPChain PPCChain;
+    typedef ::mmdb::PPModel PPCModel;
+    typedef ::mmdb::PPManager PPCMMDBManager;
   }
 
   // PDB 'sigma' classes (should be depracated)
diff --git a/clipper/mmdbold/clipper_mmdb.cpp b/clipper/mmdbold/clipper_mmdb.cpp
deleted file mode 100644
index 6dd1d85..0000000
--- a/clipper/mmdbold/clipper_mmdb.cpp
+++ /dev/null
@@ -1,888 +0,0 @@
-/* clipper_mmdb.cpp: MMDB wrapper */
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-#include "clipper_mmdb.h"
-
-#include <string.h>
-#include <set>
-#include <algorithm>
-
-
-namespace clipper {
-
-
-Message_ctor message_ctor_mmdb( " [MMDB: constructed>" );
-Message_dtor message_dtor_mmdb( " <MMDB: destroyed]" );
-
-
-// MMDB wrapper types
-// atom
-
-/*! \return \c true if uninitialised */
-bool DBAtom::is_null() const
-{ return ptr == NULL; }
-
-/*! \return \c true if not null and not "TER" */
-bool DBAtom::is_atom() const
-{ if ( is_null() ) return false; return !(ptr->Ter); }
-
-/*! \return The parent residue of this atom (check result.is_null()) */
-DBResidue DBAtom::residue() const
-{ return DBResidue( ptr->GetResidue() ); }
-
-/*! Set all the hierarchy independent properties of this atom from
-  another (DB or non-DB) atom.
-  \param a The source atom. */
-void DBAtom::set( const DBAtom_base& a )
-{
-  set_type( a.type() );
-  set_element( a.element() );
-  set_altconf( a.altconf() );
-  set_coord_orth( a.coord_orth() );
-  set_occupancy( a.occupancy() );
-  set_u_iso( a.u_iso() );
-  set_u_aniso_orth( a.u_aniso_orth() );
-}
-
-int DBAtom::index() const
-{
-  DBResidue m = residue();
-  int natm;
-  for ( natm = 0; natm < m.size(); natm++ )
-    if ( ptr == m[natm].pcatom() ) break;
-  return natm;
-}
-
-String DBAtom::type() const
-{ return String( ptr->name ); }
-
-String DBAtom::element() const
-{
-  if ( is_atom() ) return String( ptr->element );
-  return "";
-}
-
-String DBAtom::altconf() const
-{ return String( ptr->altLoc ); }
-
-Coord_orth DBAtom::coord_orth() const
-{
-  if ( is_atom() ) if ( ptr->WhatIsSet & ASET_Coordinates )
-    return Coord_orth( ptr->x, ptr->y, ptr->z );
-  return Coord_orth( Coord_orth::null() );
-}
-
-ftype DBAtom::occupancy() const
-{
-  if ( is_atom() ) if ( ptr->WhatIsSet & ASET_Occupancy )
-      return ptr->occupancy;
-  return Util::nan();
-}
-
-ftype DBAtom::u_iso() const
-{
-  if ( is_atom() ) if ( ptr->WhatIsSet & ASET_tempFactor )
-    return Util::b2u(ptr->tempFactor);
-  return Util::nan();
-}
-
-U_aniso_orth DBAtom::u_aniso_orth() const
-{
-  if ( is_atom() ) if ( ptr->WhatIsSet & ASET_Anis_tFac )
-    return U_aniso_orth( ptr->u11, ptr->u22, ptr->u33,
-			 ptr->u12, ptr->u13, ptr->u23 );
-  return U_aniso_orth( U_aniso_orth::null() );
-}
-
-Sig_Coord_orth DBAtom::sig_coord_orth() const
-{
-  if ( ptr->WhatIsSet & ASET_CoordSigma )
-    return Sig_Coord_orth( ptr->sigX, ptr->sigY, ptr->sigZ );
-  else
-    return Sig_Coord_orth( Sig_Coord_orth::null() );
-}
-
-ftype DBAtom::sig_occupancy() const
-{
-  if ( ptr->WhatIsSet & ASET_OccSigma ) return ptr->sigOcc;
-  else                                  return Util::nan();
-}
-
-ftype DBAtom::sig_u_iso() const
-{
-  if ( ptr->WhatIsSet & ASET_tFacSigma ) return Util::b2u(ptr->sigTemp);
-  else                                   return Util::nan();
-}
-
-Sig_U_aniso_orth DBAtom::sig_u_aniso_orth() const
-{
-  if ( ptr->WhatIsSet & ASET_Anis_tFSigma )
-    return Sig_U_aniso_orth( ptr->su11, ptr->su22, ptr->su33,
-			ptr->su12, ptr->su13, ptr->su23 );
-  else
-    return Sig_U_aniso_orth( Sig_U_aniso_orth::null() );
-}
-
-void DBAtom::set_type( const String& n )
-{ ptr->SetAtomName( (char *)n.c_str() ); }
-
-void DBAtom::set_element( const String& n )
-{ ptr->SetElementName( (char *)n.c_str() ); }
-
-void DBAtom::set_altconf( const String& n )
-{ /*strncpy( ptr->altLoc, n.c_str(), 20 );*/ }
-
-void DBAtom::set_coord_orth( const Coord_orth& v )
-{
-  ptr->WhatIsSet &= ~ASET_Coordinates;
-  if ( !v.is_null() ) {
-    ptr->x = v.x(); ptr->y = v.y(); ptr->z = v.z();
-    ptr->WhatIsSet |= ASET_Coordinates;
-  }
-}
-
-void DBAtom::set_occupancy( const ftype& v )
-{ 
-  ptr->WhatIsSet &= ~ASET_Occupancy;
-  if ( !Util::is_nan( v ) ) {
-    ptr->occupancy = v;
-    ptr->WhatIsSet |= ASET_Occupancy;
-  }
-}
-
-void DBAtom::set_u_iso( const ftype& v )
-{ 
-  ptr->WhatIsSet &= ~ASET_tempFactor;
-  if ( !Util::is_nan( v ) ) {
-    ptr->tempFactor = Util::u2b(v);
-    ptr->WhatIsSet |= ASET_tempFactor;
-  }
-}
-
-void DBAtom::set_u_aniso_orth( const U_aniso_orth& v )
-{
-  ptr->WhatIsSet &= ~ASET_Anis_tFac;
-  if ( !v.is_null() ) {
-    ptr->u11 = v(0,0); ptr->u22 = v(1,1); ptr->u33 = v(2,2);
-    ptr->u12 = v(0,1); ptr->u13 = v(0,2); ptr->u23 = v(1,2);
-    ptr->WhatIsSet |= ASET_Anis_tFac;
-  }
-}
-
-void DBAtom::set_sig_coord_orth( const Sig_Coord_orth& s )
-{
-  ptr->WhatIsSet &= ~ASET_CoordSigma;
-  if ( !s.is_null() ) {
-    ptr->sigX = s.sigx(); ptr->sigY = s.sigy(); ptr->sigZ = s.sigz();
-    ptr->WhatIsSet |= ASET_CoordSigma;
-  }
-}
-
-void DBAtom::set_sig_occupancy( const ftype& s )
-{ 
-  ptr->WhatIsSet &= ~ASET_OccSigma;
-  if ( !Util::is_nan( s ) ) {
-    ptr->sigOcc = s;
-    ptr->WhatIsSet |= ASET_OccSigma;
-  }
-}
-
-void DBAtom::set_sig_u_iso( const ftype& s )
-{ 
-  ptr->WhatIsSet &= ~ASET_tFacSigma;
-  if ( !Util::is_nan( s ) ) {
-    ptr->sigTemp = Util::u2b(s);
-    ptr->WhatIsSet |= ASET_tFacSigma;
-  }
-}
-
-void DBAtom::set_sig_u_aniso_orth( const Sig_U_aniso_orth& s )
-{
-  ptr->WhatIsSet &= ~ASET_Anis_tFSigma;
-  if ( !s.is_null() ) {
-    ptr->su11 = s(0,0); ptr->su22 = s(1,1); ptr->su33 = s(2,2);
-    ptr->su12 = s(0,1); ptr->su13 = s(0,2); ptr->su23 = s(1,2);
-    ptr->WhatIsSet |= ASET_Anis_tFSigma;
-  }
-}
-
-/*! \return The atom serial number. */
-int DBAtom::serial_num() const
-{ return ptr->serNum; }
-
-/*! \return The atomic charge. */
-String DBAtom::charge() const
-{ return String( ptr->charge ); }
-
-
-// residue
-
-bool DBResidue::is_null() const
-{ return ptr == NULL; }
-
-DBChain DBResidue::chain() const
-{ return DBChain( ptr->GetChain() ); }
-
-void DBResidue::set( const DBResidue_base& r )
-{
-  set_type( r.type() );
-  set_seqnum( r.seqnum() );
-  set_inscode( r.inscode() );
-}
-
-int DBResidue::index() const
-{
-  DBChain m = chain();
-  int nres;
-  for ( nres = 0; nres < m.size(); nres++ )
-    if ( ptr == m[nres].pcresidue() ) break;
-  return nres;
-}
-
-String DBResidue::type() const
-{ return String( ptr->GetResName() ); }
-
-int DBResidue::seqnum() const
-{ return ptr->GetSeqNum(); }
-
-String DBResidue::inscode() const
-{ return String( ptr->GetResName() ); }
-
-void DBResidue::set_type( const String& n )
-{ ptr->SetResName( (char *)n.c_str() ); }
-
-void DBResidue::set_seqnum( const int& n )
-{ ptr->seqNum = n; }
-
-void DBResidue::set_inscode( const String& n )
-{ strncpy( ptr->insCode, n.c_str(), 10 ); }
-
-/*! See MMDB::finalise_edit(). */
-DBAtom DBResidue::add_atom( const DBAtom_base& a )
-{
-  PCAtom p = new CAtom();
-  DBAtom atom( p );
-  atom.set( a );
-  PCMMDBCoorManager pmmdb = (PCMMDBCoorManager)(ptr->GetCoordHierarchy());
-  if ( pmmdb->AddAtom( chain().model().index()+1, chain().index(), index(), p )
-       <= 0 )
-    Message::message( Message_fatal( "DBResidue: attempt to add atom already in residue" ) );
-  //((PCMMDBFile)ptr->GetCoordHierarchy())->FinishStructEdit();
-  return atom;
-}
-
-DBAtom DBResidue::atom( const String& type ) const
-{
-  DBAtom a;
-  for ( int i = 0; i < size(); i++ ) {
-    a = (*this)[i];
-    if ( a.is_atom() )
-      if ( a.type().find( type ) != String::npos ) return a;
-  }
-  return DBAtom();
-}
-
-int DBResidue::size() const
-{
-  if ( ptr != NULL ) return ptr->GetNumberOfAtoms();
-  else               return 0;
-}
-
-DBAtom DBResidue::operator[] ( const int& i ) const
-{ return DBAtom( ptr->GetAtom(i) ); }
-
-
-// chain
-
-bool DBChain::is_null() const
-{ return ptr == NULL; }
-
-void DBChain::set( const DBChain_base& c )
-{ set_id( c.id() ); }
-
-int DBChain::index() const
-{
-  DBModel m = model();
-  int nchn;
-  for ( nchn = 0; nchn < m.size(); nchn++ )
-    if ( ptr == m[nchn].pcchain() ) break;
-  return nchn;
-}
-
-String DBChain::id() const
-{ return String( ptr->GetChainID() ); }
-
-void DBChain::set_id( const String& n )
-{ ptr->SetChainID( (char *)n.c_str() ); }
-
-DBModel DBChain::model() const
-{ return DBModel( ptr->GetModel() ); }
-
-/*! See MMDB::finalise_edit(). */
-DBResidue DBChain::add_residue( const DBResidue_base& r )
-{
-  PCResidue p = new CResidue();
-  DBResidue res( p );
-  res.set( r );
-  PCMMDBCoorManager pmmdb = (PCMMDBCoorManager)(ptr->GetCoordHierarchy());
-  if ( pmmdb->AddResidue( model().index()+1, index(), p ) <= 0 )
-    Message::message( Message_fatal( "DBChain: attempt to add residue already in chain" ) );
-  //((PCMMDBFile)ptr->GetCoordHierarchy())->FinishStructEdit();
-  return res;
-}
-
-DBResidue DBChain::residue( const int& seqnum ) const
-{
-  DBResidue r0, r1;
-  // first try and guess where to find the residue
-  if ( size() > 0 ) {
-    r0 = (*this)[0];
-    if ( !r0.is_null() ) {
-      int i = seqnum - r0.seqnum();
-      if ( i >= 0 && i < size() ) {
-	r1 = (*this)[i];
-	if ( !r1.is_null() )
-	  if ( r1.seqnum() == seqnum ) return r1;
-      }
-    }
-  }
-  // if that fails, do binary slice (FIXME)
-  // if that fails, search for it
-  for ( int i = 0; i < size(); i++ ) {
-    r1 = (*this)[i];
-    if ( !r1.is_null() )
-      if ( r1.seqnum() == seqnum ) return r1;
-  }
-  return DBResidue();
-}
-
-int DBChain::size() const
-{
-  if ( ptr != NULL ) return ptr->GetNumberOfResidues();
-  else               return 0;
-}
-
-DBResidue DBChain::operator[] ( const int& i ) const
-{ return DBResidue( ptr->GetResidue(i) ); }
-
-
-// model
-
-bool DBModel::is_null() const
-{ return ptr == NULL; }
-
-void DBModel::set( const DBModel_base& m )
-{ set_id( m.id() ); }
-
-int DBModel::index() const
-{ return ptr->GetSerNum()-1; }
-
-String DBModel::id() const
-{ return String( ptr->GetEntryID() ); }
-
-void DBModel::set_id( const String& n )
-{ ptr->SetEntryID( (char *)n.c_str() ); }
-
-DBManager DBModel::manager() const
-{ return DBManager( (mmdb::XMMDBManager*)ptr->GetCoordHierarchy() ); }
-
-/*! See MMDB::finalise_edit(). */
-DBChain DBModel::add_chain( const DBChain_base& r )
-{
-  PCChain p = new CChain();
-  DBChain chn( p );
-  chn.set( r );
-  //int nmdl = ptr->GetSerNum();
-  PCMMDBCoorManager pmmdb = (PCMMDBCoorManager)(ptr->GetCoordHierarchy());
-  if ( pmmdb->AddChain( index()+1, p ) <= 0 )
-    Message::message( Message_fatal( "DBModel: attempt to add chain already in model" ) );
-  return chn;
-}
-
-DBChain DBModel::chain( const String& id ) const
-{
-  DBChain c;
-  for ( int i = 0; i < size(); i++ ) {
-    c = (*this)[i];
-    if ( !c.is_null() )
-      if ( c.id() == id ) return c;
-  }
-  return DBChain();
-}
-
-int DBModel::size() const
-{
-  if ( ptr != NULL ) return ptr->GetNumberOfChains();
-  else               return 0;
-}
-
-DBChain DBModel::operator[] ( const int& i ) const
-{ return DBChain( ptr->GetChain(i) ); }
-
-
-// selection types
-
-DBAtom_selection::DBAtom_selection( mmdb::PPCAtom p, int n ) : list( p, p+n )
-{}
-
-void DBAtom_selection::add_atom( DBAtom a )
-{ list.push_back( a.pcatom() ); }
-
-DBAtom_selection operator& ( const DBAtom_selection& a1, const DBAtom_selection& a2 )
-{
-  std::set<mmdb::PCAtom> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCAtom> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCAtom> v;
-  std::set_intersection( s1.begin(), s1.end(), s2.begin(), s2.end(),
-			 std::back_inserter( v ) );
-  return DBAtom_selection( &(v[0]), v.size() );
-}
-
-DBAtom_selection operator| ( const DBAtom_selection& a1, const DBAtom_selection& a2 )
-{
-  std::set<mmdb::PCAtom> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCAtom> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCAtom> v;
-  std::set_union( s1.begin(), s1.end(), s2.begin(), s2.end(),
-		  std::back_inserter( v ) );
-  return DBAtom_selection( &(v[0]), v.size() );
-}
-
-DBAtom_selection operator^ ( const DBAtom_selection& a1, const DBAtom_selection& a2 )
-{
-  std::set<mmdb::PCAtom> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCAtom> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCAtom> v;
-  std::set_symmetric_difference( s1.begin(), s1.end(), s2.begin(), s2.end(),
-				 std::back_inserter( v ) );
-  return DBAtom_selection( &(v[0]), v.size() );
-}
-
-DBAtom_selection_inv operator! ( const DBAtom_selection& a )
-{ return DBAtom_selection_inv( a ); }
-
-
-DBResidue_selection::DBResidue_selection( mmdb::PPCResidue p, int n ) : list( p, p+n )
-{}
-
-void DBResidue_selection::add_residue( DBResidue a )
-{ list.push_back( a.pcresidue() ); }
-
-DBResidue_selection operator& ( const DBResidue_selection& a1, const DBResidue_selection& a2 )
-{
-  std::set<mmdb::PCResidue> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCResidue> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCResidue> v;
-  std::set_intersection( s1.begin(), s1.end(), s2.begin(), s2.end(),
-			 std::back_inserter( v ) );
-  return DBResidue_selection( &(v[0]), v.size() );
-}
-
-DBResidue_selection operator| ( const DBResidue_selection& a1, const DBResidue_selection& a2 )
-{
-  std::set<mmdb::PCResidue> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCResidue> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCResidue> v;
-  std::set_union( s1.begin(), s1.end(), s2.begin(), s2.end(),
-		  std::back_inserter( v ) );
-  return DBResidue_selection( &(v[0]), v.size() );
-}
-
-DBResidue_selection operator^ ( const DBResidue_selection& a1, const DBResidue_selection& a2 )
-{
-  std::set<mmdb::PCResidue> s1( a1.list.begin(), a1.list.end() );
-  std::set<mmdb::PCResidue> s2( a2.list.begin(), a2.list.end() );
-  std::vector<mmdb::PCResidue> v;
-  std::set_symmetric_difference( s1.begin(), s1.end(), s2.begin(), s2.end(),
-				 std::back_inserter( v ) );
-  return DBResidue_selection( &(v[0]), v.size() );
-}
-
-DBResidue_selection_inv operator! ( const DBResidue_selection& a )
-{ return DBResidue_selection_inv( a ); }
-
-
-DBChain_selection::DBChain_selection( mmdb::PPCChain p, int n ) : list( p, p+n )
-{}
-
-void DBChain_selection::add_chain( DBChain a )
-{ list.push_back( a.pcchain() ); }
-
-
-DBModel_selection::DBModel_selection( mmdb::PPCModel p, int n ) : list( p, p+n )
-{}
-
-void DBModel_selection::add_model( DBModel a )
-{ list.push_back( a.pcmodel() ); }
-
-
-
-// DBManager methods
-
-/*! Fetch the first (usually the only) model, or the N'th model
-  indexed from 1 if an argument is supplied.
-  \param i The number of the model to return.
-  \return The requested model, or a null model if i does not exist. */
-DBModel DBManager::model( const int i )
-{ return DBModel( ptr->GetModel(i) ); }
-
-int DBManager::size() const
-{
-  if ( ptr != NULL ) return ptr->GetNumberOfModels();
-  else               return 0;
-}
-
-/*! The new model becomes the last in the list. Usually you would just
-  use this to add the initial model when starting from a blank db.
-  See finalise_edit(). */
-DBModel DBManager::add_model( const DBModel_base& m )
-{
-  PCModel p = new CModel();
-  DBModel mod( p );
-  mod.set( m );
-  if ( ptr->AddModel( p ) <= 0 )
-    Message::message( Message_fatal( "DBModel: attempt to add chain already in model" ) );
-  return mod;
-}
-
-/*! Update the hierarchy after adding or removing objects. This
-  invalidates all pointer and all DBModel/DBChain/DBResidue/DBAtom
-  objects. */
-void DBManager::finalise_edit()
-{
-  ptr->FinishStructEdit();
-}
-
-/*! Fetch the model with a given index, based fromzero. Note that MMDB
-  models are indexed from 1, so this method differs by 1 in numbering
-  from the model ID you will need for a search function. See
-  MMDB::model().
-  \param i The index of the model to return.
-  \return The requested model, or a null model if i does not exist. */
-DBModel DBManager::operator[] ( const int& i ) const
-{ return DBModel( ptr->GetModel(i+1) ); }
-
-
-/*! Select atoms using an MMDB coordinate ID expression.
-  \param s The coordinate ID expression.
-  \return The atom selection object.
-  \par Examples:
-  <table>
-  <tr><td> \b Coordinate_ID_expression <td> \b Meaning
-  <tr><td> \c *                 <td> all atoms in all models/chains/residues
-  <tr><td> \c [C]               <td> all carbons in all models/chains/residues
-  <tr><td> \c /1///:A           <td> all atoms in alternate location A in all residues of chain without a chain ID, in model 1
-  <tr><td> \c 30-120            <td> all atoms in residues 30 to 120 in all models and chains.
-  <tr><td> \c A/30.A-120.S      <td> all atoms in residues 30 insertion code A to 120 insertion code S in A-chains of all models.
-  <tr><td> \c A/30.A-120.S/[!S] <td> all atoms but sulphur in residues 30 insertion code A to 120 insertion code S in A-chains of all models.
-  <tr><td> \c (ALA,SER)         <td> all atoms in residues ALA and SER in all models/chains.
-  <tr><td> \c /1/A/(!ALA,SER)/CA[C] <td> all C-alpha atoms in all residues but ALA and SER in model 1 chain A.
-  </table> */
-DBAtom_selection DBManager::select_atoms( const String& s )
-{
-  mmdb::PPCAtom psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->Select( hndl, STYPE_ATOM, (char *)s.c_str(), SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBAtom_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select residues using an MMDB coordinate ID expression.
-  \param s The coordinate ID expression.
-  \return The residue selection object. */
-DBResidue_selection DBManager::select_residues( const String& s )
-{
-  mmdb::PPCResidue psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->Select( hndl, STYPE_RESIDUE, (char *)s.c_str(), SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBResidue_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select chains using an MMDB coordinate ID expression.
-  \param s The coordinate ID expression.
-  \return The chain selection object. */
-DBChain_selection DBManager::select_chains( const String& s )
-{
-  mmdb::PPCChain psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->Select( hndl, STYPE_CHAIN, (char *)s.c_str(), SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBChain_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select models using an MMDB coordinate ID expression.
-  \param s The coordinate ID expression.
-  \return The model selection object. */
-DBModel_selection DBManager::select_models( const String& s )
-{
-  mmdb::PPCModel psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->Select( hndl, STYPE_MODEL, (char *)s.c_str(), SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBModel_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select atoms which neighbour the atoms in some list.
-  \param s The atom selection containing the list of atoms.
-  \param r1 Lower bound on the neighbour distance.
-  \param r2 Upper bound on the neighbour distance.
-  \return The atom selection object. */
-DBAtom_selection DBManager::select_atoms_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 )
-{
-  mmdb::PPCAtom psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectNeighbours( hndl, STYPE_ATOM, s.ppcatom(), s.size(), r1, r2,
-			 SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBAtom_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select residues which neighbour the atoms in some list.
-  \param s The atom selection containing the list of atoms.
-  \param r1 Lower bound on the neighbour distance.
-  \param r2 Upper bound on the neighbour distance.
-  \return The atom selection object. */
-DBResidue_selection DBManager::select_residues_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 )
-{
-  mmdb::PPCResidue psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectNeighbours( hndl, STYPE_RESIDUE, s.ppcatom(), s.size(), r1, r2,
-			 SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBResidue_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select atoms by a sphere about defined by centre and radius.
-  \param c The centre of the sphere.
-  \param r The radius of the sphere.
-  \return The atom selection object. */
-DBAtom_selection DBManager::select_atoms_sphere( const Coord_orth& c, const ftype& r )
-{
-  mmdb::PPCAtom psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectSphere( hndl, STYPE_ATOM, c.x(), c.y(), c.z(), r, SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBAtom_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select residues by a sphere defined by centre and radius.
-  \param c The centre of the sphere.
-  \param r The radius of the sphere.
-  \return The residue selection object. */
-DBResidue_selection DBManager::select_residues_sphere( const Coord_orth& c, const ftype& r )
-{
-  mmdb::PPCResidue psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectSphere( hndl, STYPE_RESIDUE, c.x(), c.y(), c.z(), r, SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBResidue_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Select atoms by a cylinder defined by centres of ends and radius.
-  \param c1 The centre of one end.
-  \param c2 The centre of the other end.
-  \param r The radius of the cylinder.
-  \return The atom selection object. */
-DBAtom_selection DBManager::select_atoms_cylinder( const Coord_orth& c1, const Coord_orth& c2, const ftype& r )
-{
-  mmdb::PPCAtom psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectCylinder( hndl, STYPE_ATOM, c1.x(), c1.y(), c1.z(), c2.x(), c2.y(), c2.z(), r, SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBAtom_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-/*! Atoms are selected whose serial numbers lie between i1 and i2, inclusive.
-  If both parameters are omitted. then all atoms are selected.
-  \param i1 Lower bound on serial number.
-  \param i2 Upper bound on serial number.
-  \return The atom selection object. */
-DBAtom_selection DBManager::select_atoms_serial( const int i1, const int i2 )
-{
-  mmdb::PPCAtom psel;
-  int hndl, nsel;
-  hndl = ptr->NewSelection();
-  ptr->SelectAtoms( hndl, i1, i2, SKEY_NEW );
-  ptr->GetSelIndex( hndl, psel, nsel );
-  DBAtom_selection result( psel, nsel );
-  ptr->DeleteSelection( hndl );
-  return result;
-}
-
-
-// MMDB methods
-
-/*! For later initialisation: see init() */
-MMDB::MMDB() 
-{
-  InitMatType();
-  ptr = new mmdb::XMMDBManager();
-  Message::message( message_ctor_mmdb );
-}
-
-/*! \param spacegroup \param cell */
-MMDB::MMDB( const Spacegroup& spacegroup, const Cell& cell )
-{
-  InitMatType();
-  ptr = new mmdb::XMMDBManager();
-  init( spacegroup, cell );
-  Message::message( message_ctor_mmdb );
-}
-
-/*! WARNING: Unlike copying a DBManager which just creates a new smart pointer, this duplicates the entire MMDB. */
-MMDB::MMDB( const MMDB& c )
-{
-  delete ptr;
-  ptr = new mmdb::XMMDBManager();
-  init( c.spacegroup(), c.cell() );
-  ptr->Copy( c.pcmmdbmanager(), MMDBFCM_All );
-  Message::message( message_ctor_mmdb );
-}
-
-MMDB::~MMDB()
-{
-  delete ptr;
-  Message::message( message_dtor_mmdb );
-}
-
-/*! This can be used to build a model from scratch, or it can also be
-  called after a model has been imported to change the spacegroup or
-  cell info.
-  \note This can be used to set a spacegroup which MMDB itself may not
-  recognize. The symops and methods which depend on them should still
-  work though.
-  \param spacegroup The new spacegroup.
-  \param cell The new cell.
- */
-void MMDB::init( const Spacegroup& spacegroup, const Cell& cell )
-{
-  spacegroup_ = spacegroup;
-  cell_ = cell;
-  ptr->set_cell( cell_ );
-  ptr->set_spacegroup( spacegroup_ );
-}
-
-bool MMDB::is_null() const
-{ return ( spacegroup_.is_null() || cell_.is_null() ); }
-
-const Spacegroup& MMDB::spacegroup() const
-{ return spacegroup_; }
-
-const Cell& MMDB::cell() const
-{ return cell_; }
-
-/*! The file may be either a PDB or mmCIF file.
-  If the spacegroup or cell are not set, they will be taken from the
-  file, otherwise the existing values override the ones in the file.
-  \param file The filename (or pathname) of the file to read. */
-void MMDB::read_file( const String& file )
-{
-  int err = ptr->ReadCoorFile( (char *)file.c_str() );
-  if (err) Message::message( Message_fatal( "MMDB: read_file error: "+file+" : "+String(err) ) );
-  // set spacegroup if necessary
-  if ( spacegroup_.is_null() ) spacegroup_ = ptr->spacegroup();
-  else                         ptr->set_spacegroup( spacegroup_ );
-  // set cell if necessary
-  if ( cell_.is_null() ) cell_ = ptr->cell();
-  else                   ptr->set_cell( cell_ );
-}
-
-/*! The output file type will be the same as the file read, otherwise PDB.
-  \param file The filename (or pathname) of the file to write.
-  \param type 0=PDB, 1=CIF, 2=binary, default=same as input file, or PDB. */
-void MMDB::write_file( const String& file, TYPE type )
-{
-  const TYPE types[3] = { PDB, CIF, Binary };
-  int rtype = ptr->GetFileType();
-  if ( type == Default && rtype >= 0 && rtype <= 2 ) type = types[ rtype ];
-  int err;
-  switch ( type ) {
-  case Binary:
-    err = ptr->WriteMMDBF( (char *)file.c_str() ); break;
-  case CIF:
-    err = ptr->WriteCIFASCII( (char *)file.c_str() ); break;
-  case PDB:
-  default:
-    err = ptr->WritePDBASCII( (char *)file.c_str() ); break;
-  }
-  if (err) Message::message( Message_fatal( "MMDB: write_file error: "+file+" : "+String(err) ) ); 
-}
-
-
-void MMDB::debug() const
-{
-  std::cout << "MMDB object: clipper+mmdb cell, clipper+mmdb spgr\n";
-  cell().debug();
-  ptr->cell().debug();
-  spacegroup().debug();
-  ptr->spacegroup().debug();
-}
-
-
-} // namespace clipper
diff --git a/clipper/mmdbold/clipper_mmdb.h b/clipper/mmdbold/clipper_mmdb.h
deleted file mode 100644
index b4a5d45..0000000
--- a/clipper/mmdbold/clipper_mmdb.h
+++ /dev/null
@@ -1,519 +0,0 @@
-/*!  \file clipper_mmdb.h
-  Header file for MMDB wrapper
-  \ingroup g_mmdb
-*/
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-
-#ifndef CLIPPER_MMDBOLD
-#define CLIPPER_MMDBOLD
-
-
-#include "clipper_mmdb_types.h"
-#include "clipper_mmdb_wrapper.h"
-
-
-namespace clipper {
-
-  // forward definitions
-  class DBAtom;
-  class DBResidue;
-  class DBChain;
-  class DBModel;
-  class DBManager;
-  class DBAtom_selection_inv;
-  class DBResidue_selection_inv;
-
-
-  // ==== abstract base classes ====
-
-  //! Abstract base class for all objects with lists of atoms
-  class DBAtom_list
-  {
-  public:
-    virtual ~DBAtom_list() {}
-    //! number of atoms in object
-    virtual int size() const = 0;
-    //! access N'th atom in object 
-    virtual DBAtom operator[] ( const int& i ) const = 0;
-  };
-
-  //! Abstract base class for all objects with lists of residues
-  class DBResidue_list
-  {
-  public:
-    virtual ~DBResidue_list() {}
-    //! number of residues in object
-    virtual int size() const = 0;
-    //! access N'th residue in object 
-    virtual DBResidue operator[] ( const int& i ) const = 0;
-  };
-
-  //! Abstract base class for all objects with lists of chains
-  class DBChain_list
-  {
-  public:
-    virtual ~DBChain_list() {}
-    //! number of chains in object
-    virtual int size() const = 0;
-    //! access N'th chain in object 
-    virtual DBChain operator[] ( const int& i ) const = 0;
-  };
-
-  //! Abstract base class for all objects with lists of models
-  class DBModel_list
-  {
-  public:
-    virtual ~DBModel_list() {}
-    //! number of models in object
-    virtual int size() const = 0;
-    //! access N'th model in object 
-    virtual DBModel operator[] ( const int& i ) const = 0;
-  };
-
-
-  // ==== MMDB type wrappers (smart pointers) ====
-
-  //! MMDB atom object wrapper
-  /*! This object can be viewed in two ways:
-   - As an atom object in the hierarchy, or
-   - As a smart pointer to by used in place of mmdb::PCAtom
-   This object may be assigned from a PCAtom, and all the methods of
-   the mmdb CAtom object are available through the '->' operator, just
-   as they would be if you were using a PCAtom.
-
-   But you may also consider it as an object in its own right, using
-   the convenience methods provided with no penalty. These methods
-   allow access to a subset of the MMDB functionality, but are often
-   more concise than their MMDB equivalents, as well as being more
-   consistent with the rest of the Clipper interface. */
-  class DBAtom : public DBAtom_base
-  {
-  public:
-    //! null constructor
-    DBAtom() : ptr(NULL) {}
-    //! constructor: from MMDB atom
-    DBAtom( mmdb::PCAtom p ) : ptr(p) {}
-    bool is_null() const;                //!< test for null object
-    bool is_atom() const;                //!< test if this is an atom
-    DBResidue residue() const;           //!< get parent
-    void set( const DBAtom_base& a );    //!< set all properties
-    int index() const;  //!< return the index of this object in parent
-
-    // standard atom properties
-    String type() const;
-    String element() const;
-    String altconf() const;
-    Coord_orth coord_orth() const;
-    ftype occupancy() const;
-    ftype u_iso() const;
-    U_aniso_orth u_aniso_orth() const;
-    Sig_Coord_orth sig_coord_orth() const;
-    ftype sig_occupancy() const;
-    ftype sig_u_iso() const;
-    Sig_U_aniso_orth sig_u_aniso_orth() const;
-    void set_type( const String& n );
-    void set_element( const String& n );
-    void set_altconf( const String& n );
-    void set_coord_orth( const Coord_orth& v );
-    void set_occupancy( const ftype& v );
-    void set_u_iso( const ftype& v );
-    void set_u_aniso_orth( const U_aniso_orth& v );
-    void set_sig_coord_orth( const Sig_Coord_orth& s );
-    void set_sig_occupancy( const ftype& s );
-    void set_sig_u_iso( const ftype& s );
-    void set_sig_u_aniso_orth( const Sig_U_aniso_orth& s );
-    // other atom properties
-    int serial_num() const;         //!< get atom serial number
-    String charge() const;          //!< get atom charge
-
-    //! direct access to MMDB Atom
-    mmdb::PCAtom pcatom() { return ptr; }
-    //! direct access to MMDB Atom
-    mmdb::PCAtom operator -> () { return pcatom(); }
-  private:
-    mmdb::PCAtom ptr;
-  };
-
-  //! MMDB residue object wrapper
-  class DBResidue : public DBAtom_list, public DBResidue_base
-  {
-  public:
-    //! null constructor
-    DBResidue() : ptr(NULL) {}
-    //! constructor: from MMDB res
-    DBResidue( mmdb::PCResidue p ) : ptr(p) {}
-    bool is_null() const;                 //!< test for null object
-    DBChain chain() const;                //!< get parent
-    void set( const DBResidue_base& r );  //!< set all properties
-    int index() const;  //!< return the index of this object in parent
-
-    // standard residue properties
-    String type() const;
-    int seqnum() const;
-    String inscode() const;
-    void set_type( const String& n );
-    void set_seqnum( const int& n );
-    void set_inscode( const String& n );
-
-    DBAtom add_atom( const DBAtom_base& a );  //!< add an atom to the residue
-    //! access atom within residue by type
-    DBAtom atom( const String& type ) const;
-
-    int size() const;
-    DBAtom operator[] ( const int& i ) const;
-    //! direct access to MMDB Residue
-    mmdb::PCResidue pcresidue() { return ptr; }
-    //! direct access to MMDB Residue
-    mmdb::PCResidue operator -> () { return pcresidue(); }
-  private:
-    mmdb::PCResidue ptr;
-  };
-
-  //! MMDB chain object wrapper
-  class DBChain : public DBResidue_list, public DBChain_base
-  {
-  public:
-    //! null constructor
-    DBChain() : ptr(NULL) {}
-    //! constructor: from MMDB chain
-    DBChain( mmdb::PCChain p ) : ptr(p) {}
-    bool is_null() const;               //!< test for null object
-    DBModel model() const;              //!< get parent
-    void set( const DBChain_base& c );  //!< set all properties
-    int index() const;  //!< return the index of this object in parent
-
-    // chain properties
-    String id() const;
-    void set_id( const String& n );
-
-    DBResidue add_residue( const DBResidue_base& r );  //!< add residue at end
-    //! access residue within chain by seqnum
-    DBResidue residue( const int& seqnum ) const;
-
-    int size() const;
-    DBResidue operator[] ( const int& i ) const;
-    //! direct access to MMDB Chain
-    mmdb::PCChain pcchain() { return ptr; }
-    //! direct access to MMDB Chain
-    mmdb::PCChain operator -> () { return pcchain(); }
-  private:
-    mmdb::PCChain ptr;
-  };
-
-  //! MMDB model object wrapper
-  class DBModel : public DBChain_list, public DBModel_base
-  {
-  public:
-    //! null constructor
-    DBModel() : ptr(NULL) {}
-    //! constructor: from MMDB model
-    explicit DBModel( mmdb::PCModel p ) : ptr(p) {}
-    bool is_null() const;               //!< test for null object
-    DBManager manager() const;          //!< get parent
-    void set( const DBModel_base& m );  //!< set all properties
-    int index() const;  //!< return the index of this object in parent
-
-    // model properties
-    String id() const;
-    void set_id( const String& n );
-
-    DBChain add_chain( const DBChain_base& c );  //!< add a chain to the model
-    //! access chain within residue by type
-    DBChain chain( const String& id ) const;
-
-    int size() const;
-    DBChain operator[] ( const int& i ) const;
-    //! direct access to MMDB Model
-    mmdb::PCModel pcmodel() { return ptr; }
-    //! direct access to MMDB Model
-    mmdb::PCModel operator -> () { return pcmodel(); }
-  private:
-    mmdb::PCModel ptr;
-  };
-
-
-  // ==== List (selection) types ====
-
-  //! Atom selection object
-  /*! An atom selection may hold an abitrary list of atoms in any
-    order, including duplicates. However, if constructed using a
-    selection function, the selection will always be sorted and
-    unique. Application of logical operators to a selection also
-    reduces it to a sorted, unique list. */
-  class DBAtom_selection : public DBAtom_list
-  {
-  public:
-    //! null constructor
-    DBAtom_selection() {}
-    //! constructor: from MMDB selection table
-    DBAtom_selection( mmdb::PPCAtom p, int n );
-    int size() const { return list.size(); }
-    DBAtom operator[] ( const int& i ) const { return DBAtom( list[i] ); }
-    //! add an atom to the end of the selection
-    void add_atom( DBAtom a );
-    friend DBAtom_selection operator&
-      ( const DBAtom_selection& a1, const DBAtom_selection& a2 );
-    friend DBAtom_selection operator|
-      ( const DBAtom_selection& a1, const DBAtom_selection& a2 );
-    friend DBAtom_selection operator^
-      ( const DBAtom_selection& a1, const DBAtom_selection& a2 );
-    friend DBAtom_selection_inv operator! ( const DBAtom_selection& a );
-    //! direct access to MMDB Atoms
-    mmdb::PPCAtom ppcatom() { return &list[0]; }
-  private:
-    std::vector<mmdb::PCAtom> list;
-  };
-
-  //! Inverse atom selection object \internal
-  /*! A residue selection may hold an abitrary list of residues in any
-    order, including duplicates. However, if constructed using a
-    selection function, the selection will always be sorted and
-    unique. Application of logical operators to a selection also
-    reduces it to a sorted, unique list. */
-  class DBAtom_selection_inv : protected DBAtom_selection
-  {
-  public:
-    explicit DBAtom_selection_inv( DBAtom_selection s ) : DBAtom_selection(s) {}
-    friend DBAtom_selection_inv operator& ( const DBAtom_selection_inv& a1, const DBAtom_selection_inv& a2 ) { return !(!a1 | !a2); }
-    friend DBAtom_selection_inv operator| ( const DBAtom_selection_inv& a1, const DBAtom_selection_inv& a2 ) { return !(!a1 & !a2); }
-    friend DBAtom_selection operator^ ( const DBAtom_selection_inv& a1, const DBAtom_selection_inv& a2 ) { return (!a1 ^ !a2); }
-    friend DBAtom_selection operator& ( const DBAtom_selection& a1, const DBAtom_selection_inv& a2 ) { return a1 ^ (a1 & !a2); }
-    friend DBAtom_selection operator& ( const DBAtom_selection_inv& a1, const DBAtom_selection& a2 ) { return a2 ^ (a2 & !a1); }
-    friend DBAtom_selection operator! ( const DBAtom_selection_inv& a ) { return a; }
-  };
-
-  //! Residue selection object
-  class DBResidue_selection : public DBResidue_list
-  {
-  public:
-    //! null constructor
-    DBResidue_selection() {}
-    //! constructor: from MMDB selection table
-    DBResidue_selection( mmdb::PPCResidue p, int n );
-    int size() const { return list.size(); }
-    DBResidue operator[] ( const int& i ) const { return DBResidue( list[i] ); }
-    //! add a residue to the end of the selection
-    void add_residue( DBResidue a );
-    friend DBResidue_selection operator&
-      ( const DBResidue_selection& a1, const DBResidue_selection& a2 );
-    friend DBResidue_selection operator|
-      ( const DBResidue_selection& a1, const DBResidue_selection& a2 );
-    friend DBResidue_selection operator^
-      ( const DBResidue_selection& a1, const DBResidue_selection& a2 );
-    friend DBResidue_selection_inv operator! ( const DBResidue_selection& a );
-    //! direct access to MMDB Residues
-    mmdb::PPCResidue ppcresidue() { return &list[0]; }
-  private:
-    std::vector<mmdb::PCResidue> list;
-  };
-
-  //! Inverse residue selection object \internal
-  class DBResidue_selection_inv : protected DBResidue_selection
-  {
-  public:
-    explicit DBResidue_selection_inv( DBResidue_selection s ) : DBResidue_selection(s) {}
-    friend DBResidue_selection_inv operator& ( const DBResidue_selection_inv& a1, const DBResidue_selection_inv& a2 ) { return !(!a1 | !a2); }
-    friend DBResidue_selection_inv operator| ( const DBResidue_selection_inv& a1, const DBResidue_selection_inv& a2 ) { return !(!a1 & !a2); }
-    friend DBResidue_selection operator^ ( const DBResidue_selection_inv& a1, const DBResidue_selection_inv& a2 ) { return (!a1 ^ !a2); }
-    friend DBResidue_selection operator& ( const DBResidue_selection& a1, const DBResidue_selection_inv& a2 ) { return a1 ^ (a1 & !a2); }
-    friend DBResidue_selection operator& ( const DBResidue_selection_inv& a1, const DBResidue_selection& a2 ) { return a2 ^ (a2 & !a1); }
-    friend DBResidue_selection operator! ( const DBResidue_selection_inv& a ) { return a; }
-  };
-
-  //! Chain selection object
-  class DBChain_selection : public DBChain_list
-  {
-  public:
-    //! null constructor
-    DBChain_selection() {}
-    //! constructor: from MMDB selection table
-    DBChain_selection( mmdb::PPCChain p, int n );
-    int size() const { return list.size(); }
-    DBChain operator[] ( const int& i ) const { return DBChain( list[i] ); }
-    //! add a chain to the end of the selection
-    void add_chain( DBChain a );
-    //! direct access to MMDB Chains
-    mmdb::PPCChain ppcchain() { return &list[0]; }
-  private:
-    std::vector<mmdb::PCChain> list;
-  };
-
-  //! Model selection object
-  class DBModel_selection : public DBModel_list
-  {
-  public:
-    //! null constructor
-    DBModel_selection() {}
-    //! constructor: from MMDB selection table
-    DBModel_selection( mmdb::PPCModel p, int n );
-    int size() const { return list.size(); }
-    DBModel operator[] ( const int& i ) const { return DBModel( list[i] ); }
-    //! add a model to the end of the selection
-    void add_model( DBModel a );
-    //! direct access to MMDB Models
-    mmdb::PPCModel ppcmodel() { return &list[0]; }
-  private:
-    std::vector<mmdb::PCModel> list;
-  };
-
-
-  // ==== MMDB manager wrapper ====
-
-
-  //! MMDB object wrapper
-  /*! This is a smart pointer to an MMDB-manager. It should not be
-    used directly, instead use the derived clipper::MMDB class. This
-    class is returned when you ask for a reference to an MMDB, e.g. as
-    the parent of a DBModel, however it should not be instantiated
-    directly.
-  */
-
-  class DBManager : public DBModel_list
-  {
-  public:
-    //! null constructor
-    DBManager() {}
-    //! constructor: from MMDB selection table
-    explicit DBManager( mmdb::XMMDBManager* p ) : ptr(p) {}
-
-    //! access N'th model (indexed from 1)
-    DBModel model( const int i = 1);
-    //! add a model
-    DBModel add_model( const DBModel_base& m );
-    //! finalise structure edit
-    void finalise_edit();
-    //! Select atoms by string selection function
-    DBAtom_selection select_atoms( const String& s );
-    //! Select residues by string selection function
-    DBResidue_selection select_residues( const String& s );
-    //! Select chains by string selection function
-    DBChain_selection select_chains( const String& s );
-    //! Select models by string selection function
-    DBModel_selection select_models( const String& s );
-    //! Select atoms neighbouring some atom selection
-    DBAtom_selection select_atoms_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 );
-    //! Select residues neighbouring some atom selection
-    DBResidue_selection select_residues_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 );
-    //! Select atoms by sphere about some centre
-    DBAtom_selection select_atoms_sphere( const Coord_orth& c, const ftype& r );
-    //! Select residues by sphere about some centre
-    DBResidue_selection select_residues_sphere( const Coord_orth& c, const ftype& r );
-    //! Select atoms by cylinder
-    DBAtom_selection select_atoms_cylinder( const Coord_orth& c1, const Coord_orth& c2, const ftype& r );
-    //! Select atoms by serial number
-    DBAtom_selection select_atoms_serial( const int i1 = 0, const int i2 = 0 );
-    int size() const;
-    DBModel operator[] ( const int& i ) const;
-    //! direct access to MMDB Manager
-    mmdb::PCMMDBManager pcmmdbmanager() const { return ptr; }
-    //! direct access to MMDB Manager
-    mmdb::PCMMDBManager operator -> () { return pcmmdbmanager(); }
-
-  protected:
-    mmdb::XMMDBManager* ptr;
-  };
-
-
-  //! MMDB object
-  /*! This is the Clipper form of an MMDB-manager. Unlike the other
-    data objects, it does not use external i/o objects, the i/o
-    methods are built in. All MMDB functionality may be accessed
-    through the -> operator, however the new read_file() and
-    write_file() methods should be used in preference since they set
-    the spacegroup and cell properties correctly.
-  */
-  class MMDB : public DBManager
-  {
-  public:
-    enum TYPE { Default=-1, PDB, CIF, Binary };
-    //! null constructor
-    MMDB();
-    //! constructor: from spacegroup and cell
-    MMDB( const Spacegroup& spacegroup, const Cell& cell );
-    //! override copy constructor
-    MMDB( const MMDB& c );
-    //! destructor
-    ~MMDB();
-    //! initialise: from spacegroup and cell
-    void init( const Spacegroup& spacegroup, const Cell& cell );
-
-    //! test if object has been initialised
-    bool is_null() const;
-
-    //! get spacegroup
-    const Spacegroup& spacegroup() const;
-    //! get cell
-    const Cell& cell() const;
-    //! import model from file
-    void read_file( const String& file );
-    //! export model to file
-    void write_file( const String& file, TYPE type = Default );
-
-    // inherited functions listed for documentation purposes
-    //-- DBModel model( const int i = 1);
-    //-- DBModel add_model( const DBModel_base& m );
-    //-- void finalise_edit();
-    //-- DBAtom_selection select_atoms( const String& s );
-    //-- DBResidue_selection select_residues( const String& s );
-    //-- DBChain_selection select_chains( const String& s );
-    //-- DBModel_selection select_models( const String& s );
-    //-- DBAtom_selection select_atoms_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 );
-    //-- DBResidue_selection select_residues_near( DBAtom_selection& s, const ftype& r1, const ftype& r2 );
-    //-- DBAtom_selection select_atoms_sphere( const Coord_orth& c, const ftype& r );
-    //-- DBResidue_selection select_residues_sphere( const Coord_orth& c, const ftype& r );
-    //-- DBAtom_selection select_atoms_cylinder( const Coord_orth& c1, const Coord_orth& c2, const ftype& r );
-    //-- DBAtom_selection select_atoms_serial( const int i1 = 0, const int i2 = 0 );
-    //-- int size() const;
-    //-- DBModel operator[] ( const int& i ) const;
-    //-- mmdb::PCMMDBManager pcmmdbmanager() const { return ptr; }
-    //-- mmdb::PCMMDBManager operator -> () { return pcmmdbmanager(); }
-
-    void debug() const;
-  private:
-    Spacegroup spacegroup_;
-    Cell cell_;
-  };
-
-
-} // namespace clipper
-
-#endif
diff --git a/clipper/mmdbold/clipper_mmdb_types.cpp b/clipper/mmdbold/clipper_mmdb_types.cpp
deleted file mode 100644
index aea48db..0000000
--- a/clipper/mmdbold/clipper_mmdb_types.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/* clipper_mmdb_types.cpp: model types wrapper */
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-#include "clipper_mmdb_types.h"
-
-
-namespace clipper {
-
-
-/*! The coordinates and U_aniso_orth are transformed. The sigmas are not,
-  since without the full variance-covariance matrix this transformation
-  is impossible.
-  \param rt The operator to apply.
-  \untested
-*/
-void DBAtom_base::transform( const RTop_orth rt ) {
-  set_coord_orth( coord_orth().transform( rt ) );
-  set_u_aniso_orth( u_aniso_orth().transform( rt ) );
-}
-
-
-NDBAtom::NDBAtom( const DBAtom_base& a )
-{
-  set_type( a.type() );
-  set_element( a.element() );
-  set_altconf( a.altconf() );
-  set_coord_orth( a.coord_orth() );
-  set_occupancy( a.occupancy() );
-  set_u_iso( a.u_iso() );
-  set_u_aniso_orth( a.u_aniso_orth() );
-}
-
-String NDBAtom::type() const
-{ return type_; }
-
-String NDBAtom::element() const
-{ return element_; }
-
-String NDBAtom::altconf() const
-{ return altconf_; }
-
-Coord_orth NDBAtom::coord_orth() const
-{ return xyz; }
-
-ftype NDBAtom::occupancy() const
-{ return occ; }
-
-ftype NDBAtom::u_iso() const
-{ return u; }
-
-U_aniso_orth NDBAtom::u_aniso_orth() const
-{ return uij; }
-
-void NDBAtom::set_type( const String& n )
-{ type_ = n; }
-
-void NDBAtom::set_element( const String& n )
-{ element_ = n; }
-
-void NDBAtom::set_altconf( const String& n )
-{ altconf_ = n; }
-
-void NDBAtom::set_coord_orth( const Coord_orth& v )
-{ xyz = v; }
-
-void NDBAtom::set_occupancy( const ftype& v )
-{ occ = v; }
-
-void NDBAtom::set_u_iso( const ftype& v )
-{ u = v; }
-
-void NDBAtom::set_u_aniso_orth( const U_aniso_orth& v )
-{ uij = v; }
-
-NDBAtom NDBAtom::null()
-{
-  NDBAtom a;
-  a.set_coord_orth( Coord_orth( Coord_orth::null() ) );
-  a.set_occupancy( Util::nan() );
-  a.set_u_iso( Util::nan() );
-  a.set_u_aniso_orth( U_aniso_orth( U_aniso_orth::null() ) );
-  return a;
-}
-
-// Residue
-
-NDBResidue::NDBResidue( const DBResidue_base& r )
-{ set_type( r.type() ); }
-
-String NDBResidue::type() const
-{ return type_; }
-
-void NDBResidue::set_type( const String& n )
-{ type_ = n; }
-
-int NDBResidue::seqnum() const
-{ return seqnum_; }
-
-void NDBResidue::set_seqnum( const int& n )
-{ seqnum_ = n; }
-
-String NDBResidue::inscode() const
-{ return inscode_; }
-
-void NDBResidue::set_inscode( const String& n )
-{ inscode_ = n; }
-
-
-// Chain
-
-NDBChain::NDBChain( const DBChain_base& c )
-{ set_id( c.id() ); }
-
-String NDBChain::id() const
-{ return id_; }
-
-void NDBChain::set_id( const String& n )
-{ id_ = n; }
-
-
-// Model
-
-NDBModel::NDBModel( const DBModel_base& m )
-{ set_id( m.id() ); }
-
-String NDBModel::id() const
-{ return id_; }
-
-void NDBModel::set_id( const String& n )
-{ id_ = n; }
-
-
-} // namespace clipper
diff --git a/clipper/mmdbold/clipper_mmdb_types.h b/clipper/mmdbold/clipper_mmdb_types.h
deleted file mode 100644
index 81b59f2..0000000
--- a/clipper/mmdbold/clipper_mmdb_types.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/*! \file clipper_mmdb_types.h
-  Header file for atomic model types
-  \ingroup g_mmdb
-*/
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-
-#ifndef CLIPPER_MMDBOLD_TYPES
-#define CLIPPER_MMDBOLD_TYPES
-
-
-#include "../core/coords.h"
-
-
-namespace clipper {
-
-  // PDB 'sigma' classes (should be depracated)
-
-  //! Standard deviation of orthognal coordinates
-  /*! see clipper::Coord_orth
-    \note In my view this is a stupid definition, but its in the PDB.
-    \ingroup g_mmdb */
-  class Sig_Coord_orth : public Vec3<>
-  {
-  public:
-    Sig_Coord_orth() {}    //!< null constructor
-    explicit Sig_Coord_orth( const Vec3<>& v ) :
-      Vec3<>( v ) {}  //!< constructor: copy/convert
-    Sig_Coord_orth( const ftype& sigx, const ftype& sigy, const ftype& sigz ) :
-      Vec3<>( sigx, sigy, sigz ) {}    //!< constructor: from sig(x,y,z)
-    const ftype& sigx() const { return (*this)[0]; }  //!< get sigx
-    const ftype& sigy() const { return (*this)[1]; }  //!< get sigy
-    const ftype& sigz() const { return (*this)[2]; }  //!< get sigz
-  };
-
-
-  //! Standard deviation of anisotropic atomic displacement parameters
-  /*! see clipper::U_aniso_orth
-    \note In my view this is a stupid definition, but its in the PDB.
-    \ingroup g_mmdb */
-  class Sig_U_aniso_orth : public Mat33sym<>
-  {
-  public:
-    //! null constructor
-    Sig_U_aniso_orth() {};
-    //! constructor: from Mat33sym
-    explicit Sig_U_aniso_orth( const Mat33sym<>& m ) : Mat33sym<>(m) {}
-    //! constructor: from sig_Uij
-    Sig_U_aniso_orth( const ftype& su11, const ftype& su22, const ftype& su33,
-		 const ftype& su12, const ftype& su13, const ftype& su23 ) :
-      Mat33sym<>( su11, su22, su33, su12, su13, su23 ) {}
-  };
-
-
-  // abstract base classes ========================================
-
-  //! Abstract base class for a single atom
-  /*! \ingroup g_mmdb */
-  class DBAtom_base
-  {
-  public:
-    virtual ~DBAtom_base() {}
-    //! get atom name (e.g. CA, CZ1, OH)
-    /*! \return The atom type name. */
-    virtual String type() const = 0;
-    //! get atom element name (e.g. C, O, ZN2+ )
-    /*! \return The atom element name. */
-    virtual String element() const = 0;
-    //! get atom alternate conformation code
-    /*! \return The atom alternate conformation code. */
-    virtual String altconf() const = 0;
-    //! get atom coordinate (in orthogonal Angstroms)
-    /*! \return The atom coordinate. (result.is_null() if not set) */
-    virtual Coord_orth coord_orth() const = 0;
-    //! get atom occupancy
-    /*! \return The atom occupancy. (NaN if not set) */
-    virtual ftype occupancy() const = 0;
-    //! get atom atomic displacement parameter (U iso)
-    /*! \return The atom temperature factor. (NaN if not set) */
-    virtual ftype u_iso() const = 0;
-    //! get atom anisotropic U
-    /*! \return The atom U_aniso. (result.is_null() if not set) */
-    virtual U_aniso_orth u_aniso_orth() const = 0;
-    //! set atom name (e.g. CA, CZ1, OH)
-    /*! \param n The atom type name. */
-    virtual void set_type( const String& n ) = 0;
-    //! set atom element name (e.g. C, O, ZN2+  )
-    /*! \param n The atom element name. */
-    virtual void set_element( const String& n ) = 0;
-    //! set atom alternate conformation code
-    /*! \param n The atom alternate conformation code. */
-    virtual void set_altconf( const String& n ) = 0;
-    //! set void atom coordinate (in orthogonal Angstroms)
-    /*! \param v The atom coordinate. (Use null coordinate to clear) */
-    virtual void set_coord_orth( const Coord_orth& v ) = 0;
-    //! set atom occupancy
-    /*! \param v The atom occupancy. (Use NaN to clear) */
-    virtual void set_occupancy( const ftype& v ) = 0;
-    //! set atom atomic displacement parameter (U iso)
-    /*! \param v The atom temperature factor. (Use NaN to clear) */
-    virtual void set_u_iso( const ftype& v ) = 0;
-    //! set atom anisotropic U
-    /*! \param v The atom U_aniso. (Use null U_aniso to clear) */
-    virtual void set_u_aniso_orth( const U_aniso_orth& v ) = 0;
-
-    //! apply an RT operator to the atom
-    void transform( const RTop_orth rt );
-  };
-
-  //! Abstract base class for a single monomer (residue or base)
-  /*! \ingroup g_mmdb */
-  class DBResidue_base
-  {
-  public:
-    virtual ~DBResidue_base() {}
-    //! get monomer name/type (e.g. TYR/ARG, A/T/C/G)
-    virtual String type() const = 0;
-    //! get monomer sequence number
-    virtual int seqnum() const = 0;
-    //! get monomer insertion code
-    virtual String inscode() const = 0;
-    //! set monomer name/type (e.g. TYR/ARG, A/T/C/G)
-    virtual void set_type( const String& n ) = 0;
-    //! set monomer sequence number
-    virtual void set_seqnum( const int& n ) = 0;
-    //! set monomer insertion code
-    virtual void set_inscode( const String& n ) = 0;
-  };
-
-  //! Abstract base class for a single polymer (chain)
-  /*! \ingroup g_mmdb */
-  class DBChain_base
-  {
-  public:
-    virtual ~DBChain_base() {}
-    //! get polymer id (e.g. A, B)
-    virtual String id() const = 0;
-    //! get polymer id (e.g. A, B)
-    virtual void set_id( const String& n ) = 0;
-  };
-
-  //! Abstract base class for a model
-  /*! \ingroup g_mmdb */
-  class DBModel_base
-  {
-  public:
-    virtual ~DBModel_base() {}
-    //! get polymer id (e.g. A, B)
-    virtual String id() const = 0;
-    //! get polymer id (e.g. A, B)
-    virtual void set_id( const String& n ) = 0;
-  };
-
-
-  // trivial non-abstract examples ========================================
-
-  //! A single non-database atom
-  /*! \ingroup g_mmdb */
-  class NDBAtom : public DBAtom_base
-  {
-  public:
-    NDBAtom() {}                      //!< null constuctor
-    NDBAtom( const DBAtom_base& a );  //!< constuctor: from Atom base
-    String type() const;
-    String element() const;
-    String altconf() const;
-    Coord_orth coord_orth() const;
-    ftype occupancy() const;
-    ftype u_iso() const;
-    U_aniso_orth u_aniso_orth() const;
-    void set_type( const String& n );
-    void set_element( const String& n );
-    void set_altconf( const String& n );
-    void set_coord_orth( const Coord_orth& v );
-    void set_occupancy( const ftype& v );
-    void set_u_iso( const ftype& v );
-    void set_u_aniso_orth( const U_aniso_orth& v );
-    static NDBAtom null();
-  private:
-    String type_, element_, altconf_;
-    Coord_orth xyz; Sig_Coord_orth sig_xyz;
-    ftype occ,  sig_occ;
-    ftype u, sig_u;
-    U_aniso_orth uij; Sig_U_aniso_orth sig_uij;
-  };
-
-  //! A non-database single monomer with no contents (residue or base)
-  /*! \ingroup g_mmdb */
-  class NDBResidue : public DBResidue_base
-  {
-  public:
-    NDBResidue() {}                         //!< null constuctor
-    NDBResidue( const DBResidue_base& r );  //!< constuctor: from Residue base
-    String type() const;
-    int seqnum() const;
-    String inscode() const;
-    void set_type( const String& n );
-    void set_seqnum( const int& n );
-    void set_inscode( const String& n );
-  private:
-    int seqnum_;
-    String type_, inscode_;
-  };
-
-  //! A single non-database polymer with no contents (chain)
-  /*! \ingroup g_mmdb */
-  class NDBChain : public DBChain_base
-  {
-  public:
-    NDBChain() {}                       //!< null constuctor
-    NDBChain( const DBChain_base& c );  //!< constuctor: from Chain base
-    String id() const;
-    void set_id( const String& n );
-  private:
-    String id_;
-  };
-
-  //! A single non-database model with no contents
-  /*! \ingroup g_mmdb */
-  class NDBModel : public DBModel_base
-  {
-  public:
-    NDBModel() {}                       //!< null constuctor
-    NDBModel( const DBModel_base& m );  //!< constuctor: from Model base
-    String id() const;
-    void set_id( const String& n );
-  private:
-    String id_;
-  };
-
-
-} // namespace clipper
-
-#endif
diff --git a/clipper/mmdbold/clipper_mmdb_wrapper.cpp b/clipper/mmdbold/clipper_mmdb_wrapper.cpp
deleted file mode 100644
index e229a04..0000000
--- a/clipper/mmdbold/clipper_mmdb_wrapper.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/* mmdb_wrapper.cpp: MMDB_WRAPPER wrapper */
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-#include "clipper_mmdb_wrapper.h"
-#include <string.h>
-
-
-namespace clipper {
-
-namespace mmdb {
-
-void XMMDBCryst::set_spacegroup( const Spacegroup& spacegroup )
-{
-  String name = spacegroup.descr().symbol_hm();
-  strncpy( spaceGroup, name.substr( 0, 29 ).c_str(), 30 );
-  SymOps.Reset();
-  SymOps.PutGroupName( spaceGroup );
-  for ( int i = 0; i < spacegroup.num_symops(); i++ )
-    SymOps.AddSymOp( (char *)spacegroup.symop(i).format().c_str() );
-  WhatIsSet |= CSET_SpaceGroup;
-}
-
-Spacegroup XMMDBManager::spacegroup()
-{
-  if ( isSpaceGroup() ) {  // get spacegroup from ops
-    int nops = GetNumberOfSymOps();
-    String ops = "";
-    for ( int i = 0; i < nops; i++ ) ops += String( GetSymOp(i) ) + ";";
-    return Spacegroup( Spgr_descr( ops, Spacegroup::Symops ) );
-  } else {                 // otherwise get spacegroup from name
-    String name = String( GetSpaceGroup() ).trim();
-    if ( name.find_first_of( "PABCFIR" ) == String::npos ) name = "P 1";
-    return Spacegroup( Spgr_descr( name, Spacegroup::HM ) );
-  }
-}
-
-Cell XMMDBManager::cell()
-{
-  Cell_descr cd( 0, 0, 0 );
-  if ( isCrystInfo() ) {
-    cd = Cell_descr( Cryst.a, Cryst.b, Cryst.c,
-		     Cryst.alpha, Cryst.beta, Cryst.gamma );
-  }
-  return Cell( cd );
-}
-
-void XMMDBManager::set_spacegroup( const Spacegroup& spacegroup )
-{
-  // convert to XMMDBCryst so we can set protected symops
-  XMMDBCryst crys2;
-  crys2.Copy( &Cryst );
-  crys2.set_spacegroup( spacegroup );
-  Cryst.Copy( &crys2 );
-}
-
-void XMMDBManager::set_cell( const Cell& cell )
-{
-  SetCell( cell.descr().a(), cell.descr().b(), cell.descr().c(),
-	   cell.descr().alpha_deg(), cell.descr().beta_deg(),
-	   cell.descr().gamma_deg() );
-}
-
-} // namespace mmdb
-
-} // namespace clipper
diff --git a/clipper/mmdbold/clipper_mmdb_wrapper.h b/clipper/mmdbold/clipper_mmdb_wrapper.h
deleted file mode 100644
index 079da97..0000000
--- a/clipper/mmdbold/clipper_mmdb_wrapper.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*! \file clipper_mmdb_wrapper.h
-  Header file for mmdb wrapper
-  \ingroup g_mmdb
-*/
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-
-#ifndef CLIPPER_MMDBOLD_WRAPPER
-#define CLIPPER_MMDBOLD_WRAPPER
-
-
-#include "../core/coords.h"
-
-#include <mmdb/mmdb_manager.h>
-
-
-namespace clipper {
-
-  namespace mmdb {
-
-    typedef ::CAtom CAtom;
-    typedef ::CResidue CResidue;
-    typedef ::CChain CChain;
-    typedef ::CModel CModel;
-    typedef ::CMMDBCryst CMMDBCryst;
-    typedef ::CMMDBManager CMMDBManager;
-
-    typedef ::PCAtom PCAtom;
-    typedef ::PCResidue PCResidue;
-    typedef ::PCChain PCChain;
-    typedef ::PCModel PCModel;
-    typedef ::PCMMDBCryst PCMMDBCryst;
-    typedef ::PCMMDBManager PCMMDBManager;
-
-    typedef ::PPCAtom PPCAtom;
-    typedef ::PPCResidue PPCResidue;
-    typedef ::PPCChain PPCChain;
-    typedef ::PPCModel PPCModel;
-    typedef ::PPCMMDBCryst PPCMMDBCryst;
-    typedef ::PPCMMDBManager PPCMMDBManager;
-
-    // Extension to MMDBCryst to provide spacegroup i/o
-    /*! \ingroup g_mmdb */
-    class XMMDBCryst : public CMMDBCryst
-    {
-    public:
-      //! set spacegroup
-      void set_spacegroup( const Spacegroup& spacegroup );
-    };
-
-    // Extension to MMDBManager to provide cell/spacegroup i/o
-    /*! \ingroup g_mmdb */
-    class XMMDBManager : public CMMDBManager
-    {
-    public:
-      //! get spacegroup as Clipper object
-      Spacegroup spacegroup();
-      //! get cell as Clipper object
-      Cell cell();
-      //! set spacegroup from Clipper object
-      void set_spacegroup( const Spacegroup& spacegroup );
-      //! set cell from Clipper object
-      void set_cell( const Cell& cell );
-    };
-
-  } // namespace mmdb
-
-
-
-} // namespace clipper
-
-#endif
diff --git a/clipper/mmdbold/container_mmdb.cpp b/clipper/mmdbold/container_mmdb.cpp
deleted file mode 100644
index 405fa3e..0000000
--- a/clipper/mmdbold/container_mmdb.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* container_mdb.cpp: class file for reflection data class + children */
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-
-#include "container_mmdb.h"
-
-
-namespace clipper {
-
-
-/*! The object is constructed at the given location in the hierarchy.
-  An attempt is made to initialise the object using information from
-  its parents in the hierarchy.
-  \param parent An object in the hierarchy (usually the parent of the
-  new object).
-  \param name The path from \c parent to the new object (usually just
-  the name of the new object). */
-CMMDB::CMMDB( Container& parent, const String name ) : Container( parent, name )
-{
-  init( NullSpacegroup, NullCell );
-}
-
-
-/*! An attempt is made to initialise the object using information from
-  the supplied parameters, or if they are Null, from its parents in
-  the hierarchy.
-  \param spacegroup The spacegroup for the model.
-  \param name The cell for the model. */
-void CMMDB::init( const Spacegroup& spacegroup, const Cell& cell )
-{
-  // use supplied values by default
-  const Spacegroup* sp = &spacegroup;  // use pointers so we can reassign
-  const Cell* cp = &cell;
-  // otherwise get them from the tree
-  if ( sp->is_null() ) sp = parent_of_type_ptr<const Spacegroup>();
-  if ( cp->is_null() ) cp = parent_of_type_ptr<const Cell>();
-  // initialise
-  if ( sp != NULL && cp != NULL )
-    if ( !sp->is_null() && !cp->is_null() )
-      MMDB::init( *sp, *cp );
-  Container::update();
-}
-
-
-/*! Hierarchical update. If this object is uninitialised, an attempt
-  is made to initialise the object using information from its parents
-  in the hierarchy. The childen of the object are then updated. */
-void CMMDB::update()
-{
-  if ( CMMDB::is_null() )
-    init( NullSpacegroup, NullCell );
-  else
-    Container::update();
-}
-
-
-} // namespace clipper
diff --git a/clipper/mmdbold/container_mmdb.h b/clipper/mmdbold/container_mmdb.h
deleted file mode 100644
index 1e59f19..0000000
--- a/clipper/mmdbold/container_mmdb.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*! \file mmdbold/container_mmdb.h
-    Header file for Container versions of various objects
-*/
-//C Copyright (C) 2000-2006 Kevin Cowtan and University of York
-//L
-//L  This library is free software and is distributed under the terms
-//L  and conditions of version 2.1 of the GNU Lesser General Public
-//L  Licence (LGPL) with the following additional clause:
-//L
-//L     `You may also combine or link a "work that uses the Library" to
-//L     produce a work containing portions of the Library, and distribute
-//L     that work under terms of your choice, provided that you give
-//L     prominent notice with each copy of the work that the specified
-//L     version of the Library is used in it, and that you include or
-//L     provide public access to the complete corresponding
-//L     machine-readable source code for the Library including whatever
-//L     changes were used in the work. (i.e. If you make changes to the
-//L     Library you must distribute those, but you do not need to
-//L     distribute source or object code to those portions of the work
-//L     not covered by this licence.)'
-//L
-//L  Note that this clause grants an additional right and does not impose
-//L  any additional restriction, and so does not affect compatibility
-//L  with the GNU General Public Licence (GPL). If you wish to negotiate
-//L  other terms, please contact the maintainer.
-//L
-//L  You can redistribute it and/or modify the library under the terms of
-//L  the GNU Lesser General Public License as published by the Free Software
-//L  Foundation; either version 2.1 of the License, or (at your option) any
-//L  later version.
-//L
-//L  This library is distributed in the hope that it will be useful, but
-//L  WITHOUT ANY WARRANTY; without even the implied warranty of
-//L  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//L  Lesser General Public License for more details.
-//L
-//L  You should have received a copy of the CCP4 licence and/or GNU
-//L  Lesser General Public License along with this library; if not, write
-//L  to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
-//L  The GNU Lesser General Public can also be obtained by writing to the
-//L  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-//L  MA 02111-1307 USA
-
-
-#ifndef CLIPPER_CONTAINER_MMDBOLD
-#define CLIPPER_CONTAINER_MMDBOLD
-
-
-#include "../core/container_types.h"
-#include "clipper_mmdb.h"
-
-
-namespace clipper
-{
-
-  //! MMDB container
-  /*! See clipper::MMDB for method descriptions. */
-  class CMMDB : public Container, public MMDB
-  {
-  public:
-    //! null constructor
-    CMMDB() {}
-    //! constructor: inherit spacegroup, cell
-    CMMDB( Container& parent, const String name = "" );
-    //! initialiser: supply or inherit spacegroup, cell
-    void init( const Spacegroup& spacegroup, const Cell& cell );
-    //! hierarchical update
-    void update();
-  };
-
-
-} // namespace clipper
-
-#endif
diff --git a/configure b/configure
index 934091e..ec71405 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for clipper 2.1.20130601.
+# Generated by GNU Autoconf 2.69 for clipper 2.1.20140911.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='clipper'
 PACKAGE_TARNAME='clipper'
-PACKAGE_VERSION='2.1.20130601'
-PACKAGE_STRING='clipper 2.1.20130601'
+PACKAGE_VERSION='2.1.20140911'
+PACKAGE_STRING='clipper 2.1.20140911'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -640,7 +640,7 @@ PTHREAD_CFLAGS
 PTHREAD_LIBS
 PTHREAD_CC
 ax_pthread_config
-FFTW_LIBS
+FFTW2_LIBS
 FLIBS
 ac_ct_F77
 FFLAGS
@@ -697,17 +697,17 @@ build_vendor
 build_cpu
 build
 LIBTOOL
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-ac_ct_CC
-CFLAGS
-CC
 ac_ct_AR
 AR
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
 am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
@@ -717,11 +717,11 @@ am__include
 DEPDIR
 OBJEXT
 EXEEXT
-ac_ct_CXX
+ac_ct_CC
 CPPFLAGS
 LDFLAGS
-CXXFLAGS
-CXX
+CFLAGS
+CC
 AM_BACKSLASH
 AM_DEFAULT_VERBOSITY
 AM_DEFAULT_V
@@ -804,7 +804,6 @@ enable_contrib
 enable_phs
 enable_cns
 enable_mmdb
-enable_mmdbold
 enable_minimol
 enable_cif
 enable_ccp4
@@ -814,14 +813,14 @@ enable_fortran
       ac_precious_vars='build_alias
 host_alias
 target_alias
-CXX
-CXXFLAGS
+CC
+CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
+CXX
+CXXFLAGS
 CCC
-CC
-CFLAGS
 CPP
 CXXCPP
 F77
@@ -1366,7 +1365,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures clipper 2.1.20130601 to adapt to many kinds of systems.
+\`configure' configures clipper 2.1.20140911 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1436,7 +1435,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of clipper 2.1.20130601:";;
+     short | recursive ) echo "Configuration of clipper 2.1.20140911:";;
    esac
   cat <<\_ACEOF
 
@@ -1463,8 +1462,6 @@ Optional Features:
   --disable-cns           enable cns-hkl-interface library
   --enable-mmdb           enable mmdb-interface library (requires mmdb
                           library)
-  --enable-mmdbold        enable old mmdb-interface library (requires mmdb
-                          library)
   --enable-minimol        enable minimol library (requires mmdb library)
   --enable-cif            enable cif-interface library (requires mmdb library)
   --enable-ccp4           enable ccp4-interface library (requires ccp4c
@@ -1483,15 +1480,15 @@ Optional Packages:
                         (or the compiler's sysroot if not specified).
 
 Some influential environment variables:
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
+  CC          C compiler command
+  CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
-  CC          C compiler command
-  CFLAGS      C compiler flags
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
   CPP         C preprocessor
   CXXCPP      C++ preprocessor
   F77         Fortran 77 compiler command
@@ -1563,7 +1560,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-clipper configure 2.1.20130601
+clipper configure 2.1.20140911
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1577,10 +1574,10 @@ fi
 ## Autoconf initialization. ##
 ## ------------------------ ##
 
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
+# ac_fn_c_try_compile LINENO
+# --------------------------
 # Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
+ac_fn_c_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext
@@ -1600,7 +1597,7 @@ $as_echo "$ac_try_echo"; } >&5
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
+	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
@@ -1613,12 +1610,12 @@ fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_cxx_try_compile
+} # ac_fn_c_try_compile
 
-# ac_fn_c_try_compile LINENO
-# --------------------------
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
 # Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
+ac_fn_cxx_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext
@@ -1638,7 +1635,7 @@ $as_echo "$ac_try_echo"; } >&5
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
+	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
@@ -1651,7 +1648,7 @@ fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_c_try_compile
+} # ac_fn_cxx_try_compile
 
 # ac_fn_c_try_link LINENO
 # -----------------------
@@ -2220,7 +2217,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by clipper $as_me 2.1.20130601, which was
+It was created by clipper $as_me 2.1.20140911, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2602,7 +2599,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 ac_config_headers="$ac_config_headers config.h"
 
-am__api_version='1.12'
+am__api_version='1.13'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2786,8 +2783,8 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
@@ -3088,7 +3085,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='clipper'
- VERSION='2.1.20130601'
+ VERSION='2.1.20140911'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3128,6 +3125,10 @@ mkdir_p='$(MKDIR_P)'
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
@@ -3135,27 +3136,22 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3164,7 +3160,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3174,32 +3170,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    test -n "$CXX" && break
-  done
 fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3208,7 +3200,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3218,21 +3210,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
+  if test "x$ac_ct_CC" = x; then
+    CC=""
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -3240,76 +3228,282 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    CXX=$ac_ct_CXX
+    CC=$ac_ct_CC
   fi
+else
+  CC="$ac_cv_prog_CC"
 fi
 
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
 done
+  done
+IFS=$as_save_IFS
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
-$as_echo_n "checking whether the C++ compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
 
-ac_rmfiles=
-for ac_file in $ac_files
+  fi
+fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-rm -f $ac_rmfiles
+  done
+IFS=$as_save_IFS
 
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
 $as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
@@ -3358,14 +3552,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C++ compiler cannot create executables
+as_fn_error 77 "C compiler cannot create executables
 See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
-$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
 $as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
@@ -3459,7 +3653,7 @@ $as_echo "$ac_try_echo"; } >&5
     else
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C++ compiled programs.
+as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details" "$LINENO" 5; }
     fi
@@ -3521,9 +3715,9 @@ fi
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3540,33 +3734,33 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
   ac_compiler_gnu=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
-  GXX=yes
+  GCC=yes
 else
-  GXX=
+  GCC=
 fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3578,10 +3772,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 else
-  CXXFLAGS=""
+  CFLAGS=""
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3593,11 +3787,11 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
 
 else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
 	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3609,33 +3803,123 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+   ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
   else
-    CXXFLAGS="-g"
+    CFLAGS="-g"
   fi
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
   else
-    CXXFLAGS=
+    CFLAGS=
   fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3705,11 +3989,11 @@ fi
 
 
 
-depcc="$CXX"  am_compiler_list=
+depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -3732,7 +4016,7 @@ else
   # directory.
   mkdir sub
 
-  am_cv_CXX_dependencies_compiler_type=none
+  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
@@ -3805,7 +4089,7 @@ else
       #   icc: Command line remark: option '-MP' not supported
       if (grep 'ignoring option' conftest.err ||
           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
+        am_cv_CC_dependencies_compiler_type=$depmode
         break
       fi
     fi
@@ -3814,232 +4098,46 @@ else
   cd ..
   rm -rf conftest.dir
 else
-  am_cv_CXX_dependencies_compiler_type=none
+  am_cv_CC_dependencies_compiler_type=none
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
   test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
 fi
 
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
   else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if ${ac_cv_prog_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4048,7 +4146,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4058,32 +4156,32 @@ IFS=$as_save_IFS
 
 fi
 fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    test -n "$CC" && break
+    test -n "$CXX" && break
   done
 fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4092,7 +4190,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4102,21 +4200,21 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$ac_ct_CC" && break
+  test -n "$ac_ct_CXX" && break
 done
 
-  if test "x$ac_ct_CC" = x; then
-    CC=""
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -4124,20 +4222,14 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    CC=$ac_ct_CC
+    CXX=$ac_ct_CXX
   fi
 fi
 
+  fi
 fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
 for ac_option in --version -v -V -qversion; do
@@ -4161,9 +4253,9 @@ $as_echo "$ac_try_echo"; } >&5
   test $ac_status = 0; }
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4180,33 +4272,33 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
   ac_compiler_gnu=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
-  GCC=yes
+  GXX=yes
 else
-  GCC=
+  GXX=
 fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4218,10 +4310,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
 else
-  CFLAGS=""
+  CXXFLAGS=""
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4233,11 +4325,11 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
 
 else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
 	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4249,134 +4341,44 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
   else
-    CFLAGS="-g"
+    CXXFLAGS="-g"
   fi
 else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
   else
-    CFLAGS=
+    CXXFLAGS=
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-depcc="$CC"   am_compiler_list=
+depcc="$CXX"  am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -4399,7 +4401,7 @@ else
   # directory.
   mkdir sub
 
-  am_cv_CC_dependencies_compiler_type=none
+  am_cv_CXX_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
@@ -4472,7 +4474,7 @@ else
       #   icc: Command line remark: option '-MP' not supported
       if (grep 'ignoring option' conftest.err ||
           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
+        am_cv_CXX_dependencies_compiler_type=$depmode
         break
       fi
     fi
@@ -4481,22 +4483,22 @@ else
   cd ..
   rm -rf conftest.dir
 else
-  am_cv_CC_dependencies_compiler_type=none
+  am_cv_CXX_dependencies_compiler_type=none
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
  if
   test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
 else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
 fi
 
 
@@ -15497,11 +15499,6 @@ if test "${enable_mmdb+set}" = set; then :
   enableval=$enable_mmdb;
 fi
 
-# Check whether --enable-mmdbold was given.
-if test "${enable_mmdbold+set}" = set; then :
-  enableval=$enable_mmdbold;
-fi
-
 # Check whether --enable-minimol was given.
 if test "${enable_minimol+set}" = set; then :
   enableval=$enable_minimol;
@@ -19306,7 +19303,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prefixed single-precision FFTW2 (sfftw.h)" >&5
 $as_echo_n "checking for prefixed single-precision FFTW2 (sfftw.h)... " >&6; }
-FFTW_LIBS="-lsrfftw -lsfftw"
+FFTW2_LIBS="-lsrfftw -lsfftw"
 LIBS="$FFTW2_LIBS $saved_LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -19322,7 +19319,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 int
 main ()
 {
-float a; fftw_real *p = &a;
+float a; fftw_real *p = &a; return *fftw_version
   ;
   return 0;
 }
@@ -19343,7 +19340,7 @@ $as_echo "#define FFTW2_PREFIX_S 1" >>confdefs.h
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for not prefixed single-precision FFTW2 (fftw.h)" >&5
 $as_echo_n "checking for not prefixed single-precision FFTW2 (fftw.h)... " >&6; }
-  FFTW_LIBS="-lrfftw -lfftw"
+  FFTW2_LIBS="-lrfftw -lfftw"
   LIBS="$FFTW2_LIBS $saved_LIBS"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -19359,7 +19356,7 @@ $as_echo_n "checking for not prefixed single-precision FFTW2 (fftw.h)... " >&6;
 int
 main ()
 {
-float a; fftw_real *p = &a;
+float a; fftw_real *p = &a; return *fftw_version
   ;
   return 0;
 }
@@ -19835,7 +19832,6 @@ test "x$enable_contrib" != xno && CLIPPER_LIBS="-lclipper-contrib $CLIPPER_LIBS"
 test "x$enable_phs" != xno     && CLIPPER_LIBS="-lclipper-phs $CLIPPER_LIBS"
 test "x$enable_cns" != xno     && CLIPPER_LIBS="-lclipper-cns $CLIPPER_LIBS"
 test "x$enable_mmdb" = xyes    && CLIPPER_LIBS="-lclipper-mmdb $CLIPPER_LIBS"
-test "x$enable_mmdbold" = xyes && CLIPPER_LIBS="-lclipper-mmdbold $CLIPPER_LIBS"
 test "x$enable_minimol" = xyes && CLIPPER_LIBS="-lclipper-minimol $CLIPPER_LIBS"
 test "x$enable_cif" = xyes     && CLIPPER_LIBS="-lclipper-cif $CLIPPER_LIBS"
 test "x$enable_ccp4" = xyes    && CLIPPER_LIBS="-lclipper-ccp4 $CLIPPER_LIBS"
@@ -19850,13 +19846,13 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_CCIF_Init in -lmmdb" >&5
-$as_echo_n "checking for MMDB_CCIF_Init in -lmmdb... " >&6; }
-if ${ac_cv_lib_mmdb_MMDB_CCIF_Init+:} false; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_CCIF_Init in -lmmdb2" >&5
+$as_echo_n "checking for MMDB_CCIF_Init in -lmmdb2... " >&6; }
+if ${ac_cv_lib_mmdb2_MMDB_CCIF_Init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmmdb  $LIBS"
+LIBS="-lmmdb2  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -19884,29 +19880,28 @@ return MMDB_CCIF_Init ();
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_mmdb_MMDB_CCIF_Init=yes
+  ac_cv_lib_mmdb2_MMDB_CCIF_Init=yes
 else
-  ac_cv_lib_mmdb_MMDB_CCIF_Init=no
+  ac_cv_lib_mmdb2_MMDB_CCIF_Init=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mmdb_MMDB_CCIF_Init" >&5
-$as_echo "$ac_cv_lib_mmdb_MMDB_CCIF_Init" >&6; }
-if test "x$ac_cv_lib_mmdb_MMDB_CCIF_Init" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mmdb2_MMDB_CCIF_Init" >&5
+$as_echo "$ac_cv_lib_mmdb2_MMDB_CCIF_Init" >&6; }
+if test "x$ac_cv_lib_mmdb2_MMDB_CCIF_Init" = xyes; then :
   :
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mmdb library not found" >&5
-$as_echo "$as_me: WARNING: mmdb library not found" >&2;}
+  as_fn_error $? "mmdb2 library not found" "$LINENO" 5
 fi
 
 
-ac_fn_cxx_check_header_mongrel "$LINENO" "mmdb/mmdb_manager.h" "ac_cv_header_mmdb_mmdb_manager_h" "$ac_includes_default"
-if test "x$ac_cv_header_mmdb_mmdb_manager_h" = xyes; then :
+ac_fn_cxx_check_header_mongrel "$LINENO" "mmdb2/mmdb_manager.h" "ac_cv_header_mmdb2_mmdb_manager_h" "$ac_includes_default"
+if test "x$ac_cv_header_mmdb2_mmdb_manager_h" = xyes; then :
   :
 else
-  as_fn_error $? "mmdb headers not found" "$LINENO" 5
+  as_fn_error $? "mmdb2 headers not found" "$LINENO" 5
 fi
 
 
@@ -19916,7 +19911,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-    CLIPPER_REQUIRES="mmdb"
+    # CLIPPER_REQUIRES is only for clipper.pc
+    CLIPPER_REQUIRES="mmdb2"
 fi
 
 if test "x$enable_ccp4" = "xyes"; then
@@ -19967,8 +19963,7 @@ $as_echo "$ac_cv_lib_ccp4c_ccp4_banner" >&6; }
 if test "x$ac_cv_lib_ccp4c_ccp4_banner" = xyes; then :
   :
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ccp4c library not found" >&5
-$as_echo "$as_me: WARNING: ccp4c library not found" >&2;}
+  as_fn_error $? "ccp4c library not found" "$LINENO" 5
 fi
 
     ac_fn_c_check_header_mongrel "$LINENO" "ccp4/ccp4_general.h" "ac_cv_header_ccp4_ccp4_general_h" "$ac_includes_default"
@@ -20024,8 +20019,7 @@ $as_echo "yes" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cctbx library not found" >&5
-$as_echo "$as_me: WARNING: cctbx library not found" >&2;}
+                    as_fn_error $? "cctbx library not found" "$LINENO" 5
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -20173,14 +20167,14 @@ if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
   as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -20622,7 +20616,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by clipper $as_me 2.1.20130601, which was
+This file was extended by clipper $as_me 2.1.20140911, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20688,7 +20682,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-clipper config.status 2.1.20130601
+clipper config.status 2.1.20140911
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -21883,7 +21877,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -21934,7 +21928,7 @@ $as_echo X"$mf" |
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -22973,7 +22967,6 @@ echo contrib: "     "  ${enable_contrib:-yes}
 echo phs: "         "  ${enable_phs:-yes}
 echo cns: "         "  ${enable_cns:-yes}
 echo mmdb: "        "  ${enable_mmdb:-no}
-echo mmdbold: "     "  ${enable_mmdbold:-no}
 echo minimol: "     "  ${enable_minimol:-no}
 echo cif: "         "  ${enable_cif:-no}
 echo ccp4: "        "  ${enable_ccp4:-no}
diff --git a/configure.ac b/configure.ac
index 73131bc..d08fb34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 
-AC_INIT(clipper, 2.1.20130601)
+AC_INIT(clipper, 2.1.20140911)
 
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_MACRO_DIR(m4)
@@ -7,8 +7,9 @@ AC_CONFIG_SRCDIR(clipper/clipper.h)
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([1.11 foreign subdir-objects silent-rules -Wall])
 
+AC_PROG_CC
 AC_PROG_CXX
-AM_PROG_AR
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_PROG_INSTALL
 
 LT_INIT([disable-shared])
@@ -26,8 +27,6 @@ AC_ARG_ENABLE(cns, AS_HELP_STRING([--disable-cns],
 # optional libraries not built by default
 AC_ARG_ENABLE(mmdb, AS_HELP_STRING([--enable-mmdb],
                      [enable mmdb-interface library (requires mmdb library)]))
-AC_ARG_ENABLE(mmdbold, AS_HELP_STRING([--enable-mmdbold],
-                  [enable old mmdb-interface library (requires mmdb library)]))
 AC_ARG_ENABLE(minimol, AS_HELP_STRING([--enable-minimol],
                   [enable minimol library (requires mmdb library)]))
 AC_ARG_ENABLE(cif, AS_HELP_STRING([--enable-cif],
@@ -56,7 +55,7 @@ if test "x$enable_fortran" = "xyes"; then
 fi
 
 AC_SEARCH_LIBS(cos, m, , AC_MSG_ERROR([math library not found.]))
-SINGLE_FFTW
+SINGLE_FFTW2
 
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
@@ -72,7 +71,6 @@ test "x$enable_contrib" != xno && CLIPPER_LIBS="-lclipper-contrib $CLIPPER_LIBS"
 test "x$enable_phs" != xno     && CLIPPER_LIBS="-lclipper-phs $CLIPPER_LIBS"
 test "x$enable_cns" != xno     && CLIPPER_LIBS="-lclipper-cns $CLIPPER_LIBS"
 test "x$enable_mmdb" = xyes    && CLIPPER_LIBS="-lclipper-mmdb $CLIPPER_LIBS"
-test "x$enable_mmdbold" = xyes && CLIPPER_LIBS="-lclipper-mmdbold $CLIPPER_LIBS"
 test "x$enable_minimol" = xyes && CLIPPER_LIBS="-lclipper-minimol $CLIPPER_LIBS"
 test "x$enable_cif" = xyes     && CLIPPER_LIBS="-lclipper-cif $CLIPPER_LIBS"
 test "x$enable_ccp4" = xyes    && CLIPPER_LIBS="-lclipper-ccp4 $CLIPPER_LIBS"
@@ -82,15 +80,17 @@ test "x$enable_fortran" = xyes && CLIPPER_LIBS="-lclipper-fortran $CLIPPER_LIBS"
 if test "x$enable_mmdb" = "xyes" -o "x$enable_mmdbold" = "xyes" -o \
         "x$enable_minimol" = "xyes" -o "x$enable_cif" = "xyes"; then
     AC_LANG_PUSH(C++)
-    AC_CHECK_LIB(mmdb, MMDB_CCIF_Init, :, AC_MSG_WARN(mmdb library not found))
-    AC_CHECK_HEADER(mmdb/mmdb_manager.h, :,
-                                         AC_MSG_ERROR(mmdb headers not found))
+    AC_CHECK_LIB(mmdb2, MMDB_CCIF_Init, :,
+                 AC_MSG_ERROR(mmdb2 library not found))
+    AC_CHECK_HEADER(mmdb2/mmdb_manager.h, :,
+                    AC_MSG_ERROR(mmdb2 headers not found))
     AC_LANG_POP(C++)
-    CLIPPER_REQUIRES="mmdb"
+    # CLIPPER_REQUIRES is only for clipper.pc
+    CLIPPER_REQUIRES="mmdb2"
 fi
 
 if test "x$enable_ccp4" = "xyes"; then
-    AC_CHECK_LIB(ccp4c, ccp4_banner, :, AC_MSG_WARN(ccp4c library not found))
+    AC_CHECK_LIB(ccp4c, ccp4_banner, :, AC_MSG_ERROR(ccp4c library not found))
     AC_CHECK_HEADER(ccp4/ccp4_general.h, :,
                                        AC_MSG_ERROR(libccp4 headers not found))
     CLIPPER_REQUIRES="libccp4c $CLIPPER_REQUIRES"
@@ -104,7 +104,7 @@ if test "x$enable_cctbx" = "xyes"; then
                                     [cctbx::Miller::Index a])],
                    AC_MSG_RESULT(yes),
                    [AC_MSG_RESULT(no)
-                    AC_MSG_WARN(cctbx library not found)])
+                    AC_MSG_ERROR(cctbx library not found)])
     AC_LANG_POP(C++)
 fi
 
@@ -129,7 +129,6 @@ echo contrib: "     "  ${enable_contrib:-yes}
 echo phs: "         "  ${enable_phs:-yes}
 echo cns: "         "  ${enable_cns:-yes}
 echo mmdb: "        "  ${enable_mmdb:-no}
-echo mmdbold: "     "  ${enable_mmdbold:-no}
 echo minimol: "     "  ${enable_minimol:-no}
 echo cif: "         "  ${enable_cif:-no}
 echo ccp4: "        "  ${enable_ccp4:-no}
diff --git a/examples/Makefile.am b/examples/Makefile.am
index bf5ebc8..75c35dd 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -54,7 +54,7 @@ AM_CPPFLAGS = -I$(top_srcdir)
 LIBS = -L$(libdir)
 
 # LDADD is used for programs for which program_LDADD is not set
-LDADD = ../clipper/core/libclipper-core.la $(FFTW_LIBS)
+LDADD = ../clipper/core/libclipper-core.la $(FFTW2_LIBS)
 
 ADD_CLIPPER_CCP4 = ../clipper/ccp4/libclipper-ccp4.la
 ADD_CLIPPER_MMDB = ../clipper/mmdb/libclipper-mmdb.la
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 3145d05..b40f223 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,23 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -62,7 +90,7 @@ check_PROGRAMS = rfltest$(EXEEXT) sgtest$(EXEEXT) symtest$(EXEEXT) \
 @BUILD_FORTRAN_TRUE at am__append_7 = ftndemo
 @BUILD_CCTBX_TRUE at am__append_8 = cctbxtest
 subdir = examples
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/build-aux/depcomp COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
@@ -253,6 +281,23 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -288,7 +333,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-FFTW_LIBS = @FFTW_LIBS@
+FFTW2_LIBS = @FFTW2_LIBS@
 FGREP = @FGREP@
 FLIBS = @FLIBS@
 GREP = @GREP@
@@ -410,7 +455,7 @@ symtest_SOURCES = symtest.cpp
 AM_CPPFLAGS = -I$(top_srcdir)
 
 # LDADD is used for programs for which program_LDADD is not set
-LDADD = ../clipper/core/libclipper-core.la $(FFTW_LIBS)
+LDADD = ../clipper/core/libclipper-core.la $(FFTW2_LIBS)
 ADD_CLIPPER_CCP4 = ../clipper/ccp4/libclipper-ccp4.la
 ADD_CLIPPER_MMDB = ../clipper/mmdb/libclipper-mmdb.la
 ADD_CLIPPER_CIF = ../clipper/cif/libclipper-cif.la
@@ -474,57 +519,75 @@ clean-checkPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 ccad$(EXEEXT): $(ccad_OBJECTS) $(ccad_DEPENDENCIES) $(EXTRA_ccad_DEPENDENCIES) 
 	@rm -f ccad$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(ccad_OBJECTS) $(ccad_LDADD) $(LIBS)
+
 cctbxtest$(EXEEXT): $(cctbxtest_OBJECTS) $(cctbxtest_DEPENDENCIES) $(EXTRA_cctbxtest_DEPENDENCIES) 
 	@rm -f cctbxtest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(cctbxtest_OBJECTS) $(cctbxtest_LDADD) $(LIBS)
+
 ciftophs$(EXEEXT): $(ciftophs_OBJECTS) $(ciftophs_DEPENDENCIES) $(EXTRA_ciftophs_DEPENDENCIES) 
 	@rm -f ciftophs$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(ciftophs_OBJECTS) $(ciftophs_LDADD) $(LIBS)
+
 cmaplocal$(EXEEXT): $(cmaplocal_OBJECTS) $(cmaplocal_DEPENDENCIES) $(EXTRA_cmaplocal_DEPENDENCIES) 
 	@rm -f cmaplocal$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(cmaplocal_OBJECTS) $(cmaplocal_LDADD) $(LIBS)
+
 cns2mtz$(EXEEXT): $(cns2mtz_OBJECTS) $(cns2mtz_DEPENDENCIES) $(EXTRA_cns2mtz_DEPENDENCIES) 
 	@rm -f cns2mtz$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(cns2mtz_OBJECTS) $(cns2mtz_LDADD) $(LIBS)
+
 cnstest$(EXEEXT): $(cnstest_OBJECTS) $(cnstest_DEPENDENCIES) $(EXTRA_cnstest_DEPENDENCIES) 
 	@rm -f cnstest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(cnstest_OBJECTS) $(cnstest_LDADD) $(LIBS)
+
 diffmap$(EXEEXT): $(diffmap_OBJECTS) $(diffmap_DEPENDENCIES) $(EXTRA_diffmap_DEPENDENCIES) 
 	@rm -f diffmap$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(diffmap_OBJECTS) $(diffmap_LDADD) $(LIBS)
+
 ffttest$(EXEEXT): $(ffttest_OBJECTS) $(ffttest_DEPENDENCIES) $(EXTRA_ffttest_DEPENDENCIES) 
 	@rm -f ffttest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(ffttest_OBJECTS) $(ffttest_LDADD) $(LIBS)
+
 ftndemo$(EXEEXT): $(ftndemo_OBJECTS) $(ftndemo_DEPENDENCIES) $(EXTRA_ftndemo_DEPENDENCIES) 
 	@rm -f ftndemo$(EXEEXT)
 	$(AM_V_GEN)$(ftndemo_LINK) $(ftndemo_OBJECTS) $(ftndemo_LDADD) $(LIBS)
+
 maketestdata$(EXEEXT): $(maketestdata_OBJECTS) $(maketestdata_DEPENDENCIES) $(EXTRA_maketestdata_DEPENDENCIES) 
 	@rm -f maketestdata$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(maketestdata_OBJECTS) $(maketestdata_LDADD) $(LIBS)
+
 maptest$(EXEEXT): $(maptest_OBJECTS) $(maptest_DEPENDENCIES) $(EXTRA_maptest_DEPENDENCIES) 
 	@rm -f maptest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(maptest_OBJECTS) $(maptest_LDADD) $(LIBS)
+
 mtztest$(EXEEXT): $(mtztest_OBJECTS) $(mtztest_DEPENDENCIES) $(EXTRA_mtztest_DEPENDENCIES) 
 	@rm -f mtztest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(mtztest_OBJECTS) $(mtztest_LDADD) $(LIBS)
+
 phstest$(EXEEXT): $(phstest_OBJECTS) $(phstest_DEPENDENCIES) $(EXTRA_phstest_DEPENDENCIES) 
 	@rm -f phstest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(phstest_OBJECTS) $(phstest_LDADD) $(LIBS)
+
 rfltest$(EXEEXT): $(rfltest_OBJECTS) $(rfltest_DEPENDENCIES) $(EXTRA_rfltest_DEPENDENCIES) 
 	@rm -f rfltest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(rfltest_OBJECTS) $(rfltest_LDADD) $(LIBS)
+
 sftest$(EXEEXT): $(sftest_OBJECTS) $(sftest_DEPENDENCIES) $(EXTRA_sftest_DEPENDENCIES) 
 	@rm -f sftest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(sftest_OBJECTS) $(sftest_LDADD) $(LIBS)
+
 sgtest$(EXEEXT): $(sgtest_OBJECTS) $(sgtest_DEPENDENCIES) $(EXTRA_sgtest_DEPENDENCIES) 
 	@rm -f sgtest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(sgtest_OBJECTS) $(sgtest_LDADD) $(LIBS)
+
 sktest$(EXEEXT): $(sktest_OBJECTS) $(sktest_DEPENDENCIES) $(EXTRA_sktest_DEPENDENCIES) 
 	@rm -f sktest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(sktest_OBJECTS) $(sktest_LDADD) $(LIBS)
+
 symtest$(EXEEXT): $(symtest_OBJECTS) $(symtest_DEPENDENCIES) $(EXTRA_symtest_DEPENDENCIES) 
 	@rm -f symtest$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(symtest_OBJECTS) $(symtest_LDADD) $(LIBS)
@@ -592,26 +655,15 @@ mostlyclean-libtool:
 clean-libtool:
 	-rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -623,15 +675,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -640,9 +688,10 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
 	case "$(srcdir)" in \
 	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
 	  *) sdir=$(subdir)/$(srcdir) ;; \
@@ -796,9 +845,9 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean \
-	clean-checkPROGRAMS clean-generic clean-libtool cscopelist \
-	ctags distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
+	ctags ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
 	install-data-am install-dvi install-dvi-am install-exec \
@@ -808,7 +857,7 @@ uninstall-am:
 	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am
+	tags tags-am uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/examples/maketestdata.cpp b/examples/maketestdata.cpp
index 24e9658..ef0082c 100644
--- a/examples/maketestdata.cpp
+++ b/examples/maketestdata.cpp
@@ -78,7 +78,7 @@ int main( int argc, char** argv )
     clipper::mmdb::PPCAtom psel;
     int hndl, nsel;
     hndl = mmdb.NewSelection();
-    mmdb.Select( hndl, STYPE_ATOM, "(!WAT,H2O,HOH)", SKEY_NEW );
+    mmdb.Select( hndl, ::mmdb::STYPE_ATOM, "(!WAT,H2O,HOH)", ::mmdb::SKEY_NEW );
     mmdb.GetSelIndex( hndl, psel, nsel );
     clipper::MMDBAtom_list atoms( psel, nsel );
     mmdb.DeleteSelection( hndl );
diff --git a/examples/sftest.cpp b/examples/sftest.cpp
index ebc123c..f714d93 100644
--- a/examples/sftest.cpp
+++ b/examples/sftest.cpp
@@ -104,7 +104,7 @@ int main( int argc, char** argv )
   clipper::mmdb::PPCAtom psel;
   int hndl, nsel;
   hndl = mmdb.NewSelection();
-  mmdb.SelectAtoms( hndl, 0, 0, SKEY_NEW );
+  mmdb.SelectAtoms( hndl, 0, 0, ::mmdb::SKEY_NEW );
   mmdb.GetSelIndex( hndl, psel, nsel );
   clipper::MMDBAtom_list atoms( psel, nsel ); 
   mmdb.DeleteSelection( hndl );
diff --git a/m4/fftw.m4 b/m4/fftw.m4
index f740f09..146f03d 100644
--- a/m4/fftw.m4
+++ b/m4/fftw.m4
@@ -27,35 +27,31 @@
 #     SINGLE_FFTW2
 #     LIBS="$FFTW2_LIBS $LIBS"
 #
-#   Note: Linking with double-precision version instead of single will not
-#         fail, but may result in errors or crashes when program runs.
-#         This macro does not use any special options or variables
-#         to prevent using different options here for checking
-#         and for actual compilation.
-#
 # LICENSE
 #
 #   Public Domain
 #
 
-AC_DEFUN([SINGLE_FFTW],
+AC_DEFUN([SINGLE_FFTW2],
 [
 saved_LIBS="$LIBS"
 AC_LANG_PUSH(C++)
 
 AC_MSG_CHECKING([for prefixed single-precision FFTW2 (sfftw.h)])
-FFTW_LIBS="-lsrfftw -lsfftw"
+FFTW2_LIBS="-lsrfftw -lsfftw"
 LIBS="$FFTW2_LIBS $saved_LIBS"
-AC_TRY_LINK([#include <sfftw.h>], [float a; fftw_real *p = &a;], 
+AC_TRY_LINK([#include <sfftw.h>],
+            [float a; fftw_real *p = &a; return *fftw_version], 
             have_fftw=yes, have_fftw=no)
 AC_MSG_RESULT($have_fftw)
 if test $have_fftw = yes; then
   AC_DEFINE(FFTW2_PREFIX_S, 1, [Define if FFTW2 is prefixed.])
 else
   AC_MSG_CHECKING([for not prefixed single-precision FFTW2 (fftw.h)])
-  FFTW_LIBS="-lrfftw -lfftw"
+  FFTW2_LIBS="-lrfftw -lfftw"
   LIBS="$FFTW2_LIBS $saved_LIBS"
-  AC_TRY_LINK([#include <fftw.h>], [float a; fftw_real *p = &a;], 
+  AC_TRY_LINK([#include <fftw.h>],
+              [float a; fftw_real *p = &a; return *fftw_version], 
               [AC_MSG_RESULT(yes)],
               [AC_MSG_RESULT(no)
                AC_MSG_ERROR([single-precision FFTW 2 library not found.])])
@@ -63,5 +59,5 @@ fi
 
 AC_LANG_POP(C++)
 LIBS="$saved_LIBS"
-AC_SUBST(FFTW_LIBS)
+AC_SUBST(FFTW2_LIBS)
 ])

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clipper.git



More information about the debian-science-commits mailing list