[netcdf] 01/09: Imported Upstream version 4.4.0~rc1

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat Jul 25 00:22:08 UTC 2015


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

sebastic pushed a commit to branch master
in repository netcdf.

commit bb9683b0b7f3ba155e08562686472be0b2e8372d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Jul 25 01:50:36 2015 +0200

    Imported Upstream version 4.4.0~rc1
---
 .gitignore                                  |    1 +
 .travis.yml                                 |   26 +-
 CMakeLists.txt                              |  140 +-
 Doxyfile.developer                          |    2 +-
 INSTALL                                     |  259 -
 INSTALL.cmake                               |  161 -
 docs/install.dox => INSTALL.md              |  313 +-
 Makefile.am                                 |    2 +-
 Makefile.in                                 |   54 +-
 RELEASE_NOTES.md                            |   28 +
 aclocal.m4                                  |  181 +-
 cf                                          |  203 -
 cf.cmake                                    |   14 -
 compile                                     |    2 +-
 config.guess                                |  201 +-
 config.h.cmake.in                           |    1 +
 config.h.in                                 |   14 +-
 config.sub                                  |   40 +-
 configure                                   | 2306 +++++----
 configure.ac                                |   37 +-
 depcomp                                     |    2 +-
 docs/.gitignore                             |    1 +
 docs/CMakeLists.txt                         |   26 +-
 docs/Doxyfile.in                            |   11 +-
 docs/FAQ.md                                 |   23 +-
 docs/Makefile.am                            |   13 +-
 docs/Makefile.in                            |   41 +-
 docs/OPeNDAP.dox                            |  692 +++
 docs/architecture.dox                       |    6 +-
 docs/attribute_conventions.md               |  128 +
 docs/auth.md                                |  489 ++
 docs/auth.md.in                             |   14 +
 docs/file_format_specifications.md          |  744 +++
 docs/guide.dox                              | 1700 +------
 docs/images/Makefile.in                     |   27 +-
 docs/install-fortran.md                     |  237 +-
 docs/install.md                             |  428 +-
 docs/mainpage.dox                           |   12 +-
 docs/{notes.dox => notes.md}                |   42 +-
 docs/ocauth.md                              |  475 ++
 docs/software.md                            | 2719 ++++++++++
 docs/tutorial.dox                           |    2 +-
 docs/windows-binaries.md                    |   51 +-
 examples/C/Makefile.in                      |   31 +-
 examples/CDL/Makefile.in                    |   30 +-
 examples/Makefile.in                        |   27 +-
 h5_test/CMakeLists.txt                      |    2 -
 h5_test/Makefile.am                         |   11 +-
 h5_test/Makefile.in                         |   38 +-
 h5_test/tst_h_endian_float.c                |   83 +
 h5_test/tst_h_vars.c                        |   86 +-
 include/Makefile.am                         |    4 +
 include/Makefile.in                         |   41 +-
 include/ncdispatch.h                        |   15 +-
 include/netcdf.h                            |    7 +-
 include/netcdf_mem.h                        |   82 +
 install-sh                                  |  366 +-
 libdap2/Makefile.in                         |   31 +-
 libdap2/dapcvt.c                            |   32 +-
 libdap2/dapdebug.h                          |    1 -
 libdap2/env                                 |    6 +-
 libdap2/ncd2dispatch.c                      |   31 +-
 libdispatch/Makefile.in                     |   31 +-
 libdispatch/dfile.c                         |  281 +-
 libdispatch/dgroup.c                        |    3 +
 libdispatch/dvar.c                          |   64 +
 libdispatch/dvarinq.c                       |  122 +-
 libdispatch/dvarput.c                       |   15 +-
 liblib/CMakeLists.txt                       |    2 +-
 liblib/Makefile.am                          |   14 +-
 liblib/Makefile.in                          |   37 +-
 libnetcdf.settings.in                       |    1 +
 libsrc/CMakeLists.txt                       |   12 +-
 libsrc/Makefile.in                          |   31 +-
 libsrc/attr.c                               |  343 +-
 libsrc/attr.m4                              |    4 +-
 libsrc/ffio.c                               |    2 +
 libsrc/memio.c                              |  184 +-
 libsrc/mmapio.c                             |    2 +
 libsrc/nc3internal.c                        |  254 +-
 libsrc/ncio.c                               |   34 +-
 libsrc/ncio.h                               |    4 +-
 libsrc/ncx.c                                | 5955 ----------------------
 libsrc/posixio.c                            |    4 +-
 libsrc/putget.c                             | 3959 ---------------
 libsrc/winceio.c                            |    2 +
 libsrc4/Makefile.in                         |   31 +-
 libsrc4/nc4file.c                           |  438 +-
 libsrc4/nc4hdf.c                            |   30 +-
 libsrc4/nc4internal.c                       |    4 +-
 libsrc5/Makefile.in                         |   31 +-
 ljna                                        |   33 -
 ltmain.sh                                   | 5508 ++++++++++++--------
 m4/libtool.m4                               | 2546 ++++++----
 m4/ltoptions.m4                             |  127 +-
 m4/ltsugar.m4                               |    7 +-
 m4/ltversion.m4                             |   12 +-
 m4/lt~obsolete.m4                           |    7 +-
 mclean                                      |   10 -
 missing                                     |    2 +-
 nc-config.in                                |    4 +-
 nc_test/CMakeLists.txt                      |    1 +
 nc_test/Makefile.am                         |    4 +-
 nc_test/Makefile.in                         |   63 +-
 nc_test/test_get.c                          | 6161 -----------------------
 nc_test/test_put.c                          | 7206 ---------------------------
 nc_test/tst_put_vars.c                      |   69 +
 nc_test4/CMakeLists.txt                     |    8 +-
 nc_test4/Makefile.am                        |   25 +-
 nc_test4/Makefile.in                        |  135 +-
 nc_test4/tst_fills2.c                       |   14 +
 nc_test4/tst_h4_lendian.c                   |  167 +
 nc_test4/tst_h5_endians.c                   |  136 +
 ncdap_test/CMakeLists.txt                   |   28 +-
 ncdap_test/Makefile.am                      |   14 +-
 ncdap_test/Makefile.in                      |   59 +-
 ncdap_test/expected3/Makefile.in            |   27 +-
 ncdap_test/expected4/Makefile.in            |   27 +-
 ncdap_test/expectremote3/Makefile.in        |   27 +-
 ncdap_test/expectremote4/Makefile.in        |   27 +-
 ncdap_test/t_ncf330.c                       |   72 +
 ncdap_test/testauth.old                     |  213 +
 ncdap_test/testauth.sh                      |  344 +-
 ncdap_test/{testauth.sh => testauth.sh.old} |    0
 ncdap_test/testdata3/Makefile.in            |   27 +-
 ncdap_test/tst_ncdap.sh                     |    1 +
 ncdap_test/tst_ncdap3.sh                    |    2 +
 ncdap_test/tst_ncdap4.sh                    |    2 +
 ncdap_test/tst_nocache3.sh                  |    2 +
 ncdap_test/tst_nocache4.sh                  |    2 +
 ncdap_test/tst_remote.sh                    |   13 +-
 ncdap_test/tst_remote3.sh                   |    4 +-
 ncdap_test/tst_remote4.sh                   |    2 +
 ncdap_test/tst_special.sh                   |    2 +
 ncdap_test/tst_tds.sh                       |    2 +
 ncdump/CMakeLists.txt                       |   68 +-
 ncdump/Makefile.am                          |    6 +-
 ncdump/Makefile.in                          |   62 +-
 ncdump/cdl/Makefile.in                      |   27 +-
 ncdump/expected/Makefile.in                 |   27 +-
 ncdump/ncdump.c                             |  106 +-
 ncdump/ncdump.h                             |    2 +
 ncdump/tst_fillbug.sh                       |    7 +
 ncdump/tst_inmemory.sh                      |   57 +
 ncdump/tst_nccopy4.sh                       |    8 +-
 ncdump/tst_output.sh                        |   10 +-
 ncgen/Makefile.in                           |   34 +-
 ncgen/main.c                                |   15 +-
 ncgen3/Makefile.in                          |   34 +-
 ncgen3/load.c                               |    4 +
 nctest/Makefile.in                          |   34 +-
 oc2/CMakeLists.txt                          |    1 +
 oc2/Make0                                   |   28 +-
 oc2/Makefile.am                             |    2 +-
 oc2/Makefile.in                             |   30 +-
 oc2/daptab.c                                |  251 +-
 oc2/daptab.h                                |    2 +-
 oc2/ocauth.html                             |  434 ++
 oc2/occurlfunctions.c                       |    6 +-
 oc2/ocdata.c                                |    5 +-
 oc2/ocdata.h                                |    4 +-
 oc2/ocinternal.c                            |   11 +-
 oc2/ocinternal.h                            |    2 +-
 oc2/ocrc.c                                  |   26 +-
 oc2/ocuri.c                                 |    2 -
 oc2/xxdr.h                                  |    5 +-
 test-driver                                 |   15 +-
 wjna                                        |   43 -
 168 files changed, 17095 insertions(+), 32101 deletions(-)

diff --git a/.gitignore b/.gitignore
index d82f396..791625a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 ### 'Normal' gitignore files.
+autom4te.cache
 ctest.c
 ctest64.c
 debug.txt
diff --git a/.travis.yml b/.travis.yml
index 2041e46..0a61082 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,20 +4,22 @@ compiler:
   - clang
 
 before_install:
-  # Get CMake >=2.8.8, HDF5 >= 1.8.6
-  # - sudo add-apt-repository -y ppa:amcg/netcdf-parallel
   - sudo apt-get update -qq
-  - sudo apt-get install -y -qq libcurl4-openssl-dev m4 wget autoconf libtool clang
-  - wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/hdf5-1.8.14.tar.bz2
-  - sudo mv hdf5-1.8.14.tar.bz2 /usr/local
-  - pushd /usr/local
-  - sudo tar -jxf hdf5-1.8.14.tar.bz2
-  - popd
+  - sudo apt-get install -y -qq libcurl4-openssl-dev m4 wget autoconf libtool clang libjpeg8-dev
+
+  ###
+  # Install dependencies from a pre-built binary.
+  ###
+  - cd /
+  - sudo wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/travisdeps.tar.bz2
+  - sudo tar -jxf travisdeps.tar.bz2
+  - cd -
 
 before_script:
-  - autoreconf -if
-  - ./configure
+  - mkdir build
+  - cd build
+  - cmake .. -DENABLE_EXTRA_TESTS=ON -DENABLE_HDF4=ON
 
 script:
-  - make
-  - LD_LIBRARY_PATH=/usr/local/lib make check
+  - make -j 4
+  - make test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7167cd..02cc3a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,13 +24,13 @@ set(PACKAGE "netCDF" CACHE STRING "")
 #####
 
 SET(NC_VERSION_MAJOR 4)
-SET(NC_VERSION_MINOR 3)
-SET(NC_VERSION_PATCH 3)
-SET(NC_VERSION_NOTE ".1")
+SET(NC_VERSION_MINOR 4)
+SET(NC_VERSION_PATCH 0)
+SET(NC_VERSION_NOTE "-rc1")
 SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})
 SET(VERSION ${netCDF_VERSION})
 SET(NC_VERSION ${netCDF_VERSION})
-SET(netCDF_LIB_VERSION 7.2.1)
+SET(netCDF_LIB_VERSION 7.3.0)
 SET(netCDF_SO_VERSION 7)
 SET(PACKAGE_VERSION ${VERSION})
 
@@ -44,8 +44,35 @@ IF(UNAME)
   getuname(osname -s)
   getuname(osrel  -r)
   getuname(cpu    -m)
-  set(BUILDNAME "${osname}-${osrel}-${cpu}" CACHE STRING "Build name variable for CDash")
+  set(TMP_BUILDNAME "${osname}-${osrel}-${cpu}")
 ENDIF()
+
+###
+# Allow for some customization of the buildname.
+# This will make it easier to identify different builds,
+# based on values passed from command line/shell scripts.
+#
+# For ctest scripts, we can use CTEST_BUILD_NAME.
+###
+
+SET(BUILDNAME_PREFIX "" CACHE STRING "")
+SET(BUILDNAME_SUFFIX "" CACHE STRING "")
+
+IF(BUILDNAME_PREFIX)
+  SET(TMP_BUILDNAME "${BUILDNAME_PREFIX}-${TMP_BUILDNAME}")
+ENDIF()
+
+IF(BUILDNAME_SUFFIX)
+  SET(TMP_BUILDNAME "${TMP_BUILDNAME}-${BUILDNAME_SUFFIX}")
+ENDIF()
+
+IF(NOT BUILDNAME)
+  SET(BUILDNAME "${TMP_BUILDNAME}" CACHE STRING "Build name variable for CDash")
+ENDIF()
+###
+# End BUILDNAME customization.
+###
+
 # For CMAKE_INSTALL_LIBDIR
 INCLUDE(GNUInstallDirs)
 
@@ -117,6 +144,8 @@ SET(EXTRA_DEPS "")
 # Set CTest Properties
 ################################
 
+
+
 ENABLE_TESTING()
 INCLUDE(CTest)
 
@@ -286,6 +315,7 @@ OPTION(BUILD_UTILITIES "Build ncgen, ncgen3, ncdump." ON)
 # Option to use MMAP
 OPTION(ENABLE_MMAP "Use MMAP." OFF)
 IF(ENABLE_MMAP)
+  CHECK_FUNCTION_EXISTS(mremap  HAVE_MREMAP)
   IF(NOT HAVE_MREMAP)
     MESSAGE(WARNING "mremap not found: disabling MMAP support.")
     SET(ENABLE_MMAP OFF)
@@ -309,6 +339,7 @@ ENDIF()
 # Option Logging, only valid for netcdf4.
 OPTION(ENABLE_LOGGING "Enable Logging." OFF)
 IF(ENABLE_LOGGING)
+  ADD_DEFINITIONS(-DLOGGING)
   SET(LOGGING ON)
 ENDIF()
 
@@ -360,7 +391,7 @@ IF(ENABLE_HDF4)
     MESSAGE(FATAL_ERROR "Can't find or link to the hdf4 mfhdf library.")
   ENDIF()
 
-  SET(HDF4_LIBRARIES ${HDF4_MFHDF_LIB} ${HDF4_DF_LIB})
+  SET(HDF4_LIBRARIES ${HDF4_DF_LIB} ${HDF4_MFHDF_LIB})
   # End include files, libraries.
   MESSAGE(STATUS "HDF4 libraries: ${HDF4_DF_LIB}, ${HDF4_MFHDF_LIB}")
 
@@ -422,7 +453,6 @@ IF(ENABLE_RPC)
 ENDIF()
 
 # Option to Enable HDF5
-OPTION(USE_SZIP "Use SZip" OFF)
 OPTION(USE_HDF5 "Use HDF5." ${ENABLE_NETCDF_4})
 
 IF(USE_HDF5 OR ENABLE_NETCDF_4)
@@ -461,9 +491,8 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
     # Find out if HDF5 was built with parallel support.
     # Do that by checking for the targets H5Pget_fapl_mpiposx and
     # H5Pget_fapl_mpio in ${HDF5_LIB}.
-    CHECK_LIBRARY_EXISTS(${HDF5_hdf5_LIBRARY} H5Pget_fapl_mpiposix "" HDF5_IS_PARALLEL_MPIPOSIX)
-    CHECK_LIBRARY_EXISTS(${HDF5_hdf5_LIBRARY} H5Pget_fapl_mpio "" HDF5_IS_PARALLEL_MPIO)
-
+    CHECK_LIBRARY_EXISTS(hdf5 H5Pget_fapl_mpiposix "" HDF5_IS_PARALLEL_MPIPOSIX)
+    CHECK_LIBRARY_EXISTS(hdf5 H5Pget_fapl_mpio "" HDF5_IS_PARALLEL_MPIO)
     IF(HDF5_IS_PARALLEL_MPIPOSIX OR HDF5_IS_PARALLEL_MPIO)
       SET(HDF5_IS_PARALLEL ON)
     ENDIF()
@@ -483,6 +512,9 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
 
   ENDIF(NOT MSVC)
 
+  CHECK_LIBRARY_EXISTS(hdf5 H5free_memory "" HDF5_HAS_H5FREE)
+
+
   # Assert HDF5 version.
   SET(HDF5_VERSION_REQUIRED 1.8.10)
 
@@ -531,9 +563,16 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
   ENDIF()
 
   #Check to see if H5Z_SZIP exists in HDF5_Libraries. If so, we must use szip.
+  CHECK_LIBRARY_EXISTS(hdf5 H5Z_SZIP "" USE_SZIP)
   IF(USE_SZIP)
-    FIND_PACKAGE(SZIP NO_MODULE REQUIRED)
-    INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIR})
+    FIND_LIBRARY(SZIP NAMES szip sz)
+    IF(SZIP)
+      SET(SZIP_LIBRARY ${SZIP})
+    ELSE()
+      MESSAGE(FATAL_ERROR "HDF5 Requires SZIP, but cannot find libszip or libsz.")
+    ENDIF()
+    #FIND_PACKAGE(SZIP NO_MODULE REQUIRED)
+    #INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIR})
   ENDIF()
 
   SET(H5_USE_16_API 1)
@@ -549,6 +588,20 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
   ENDIF()
   SET(USE_ZLIB ON)
   INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
+
+  ##
+  # Check to see if libhdf5 contains
+  # 'H5free_memory'.
+  ##
+#  CHECK_C_SOURCE_COMPILES("
+#  #include <hdf5.h>
+#  int main() {H5free_memory(NULL);}" HDF5_HAS_H5FREE)
+#  CHECK_SYMBOL_EXISTS(H5free_memory "H5public.h" HDF5_HAS_H5FREE)
+# CHECK_LIBRARY_EXISTS(hdf5 H5free_memory "-L${HDF5_hdf5_LIBRARY}" HDF5_HAS_H5FREE)
+#  MESSAGE(STATUS "HDF5_HAS_H5FREE: ${HDF5_HAS_H5FREE}")
+
+
+
 ENDIF()
 
 # Option to Build DAP Client
@@ -648,8 +701,9 @@ IF(NOT WIN32)
   ENDIF()
 ENDIF()
 
+##
 # Enable Tests
-#IF(NOT MSVC)
+##
 OPTION(ENABLE_TESTS "Enable basic tests, run with 'make test'." ON)
 IF(ENABLE_TESTS)
   SET(BUILD_TESTSETS ON CACHE BOOL "")
@@ -678,6 +732,27 @@ IF(ENABLE_TESTS)
     @ONLY
     )
 
+  ###
+  # This option dictates whether or not to turn on
+  # tests which are known to fail.  This is not the
+  # same thing as an 'expected failure'. Rather, these
+  # are tests that will need to be fixed eventually.
+  #
+  # By placing them here, we can occasionaly turn this
+  # flag on and see if any known failures have been
+  # fixed in the course of code improvement/other bug
+  # fixes.
+  #
+  # To use this, simply add as a fencepost around tests
+  # which are known to fail.
+  ###
+
+  OPTION(ENABLE_FAILING_TESTS "Run tests which are known to fail, check to see if any have been fixed." OFF)
+
+  ###
+  # End known-failures.
+  ###
+  MARK_AS_ADVANCED(ENABLE_FAILING_TESTS)
 ENDIF()
 
 ###
@@ -770,13 +845,14 @@ IF(ENABLE_PNETCDF)
   IF(NOT PNETCDF)
     MESSAGE(STATUS "Cannot find pNetCDF library. Disabling pNetCDF support.")
     SET(USE_PNETCDF OFF CACHE BOOL "")
+  ELSE()
+    SET(STATUS_PNETCDF "ON")
+    INCLUDE_DIRECTORIES(${PNETCDF_INCLUDE_DIR})
+    SET(HAVE_LIBPNETCDF ON)
+    # pnetcdf => parallel
+    SET(STATUS_PARALLEL "ON")
+    SET(USE_PARALLEL ON)
   ENDIF()
-  SET(STATUS_PNETCDF "ON")
-  INCLUDE_DIRECTORIES(${PNETCDF_INCLUDE_DIR})
-  SET(HAVE_LIBPNETCDF ON)
-  # pnetcdf => parallel
-  SET(STATUS_PARALLEL "ON")
-  SET(USE_PARALLEL ON)
 ENDIF()
 
 # Enable Parallel Tests.
@@ -957,7 +1033,6 @@ CHECK_FUNCTION_EXISTS(MPI_Comm_f2C  HAVE_MPI_COMM_F2C)
 CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
 CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE)
 CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
-CHECK_FUNCTION_EXISTS(mremap  HAVE_MREMAP)
 CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
 CHECK_FUNCTION_EXISTS(_filelengthi64 HAVE_FILE_LENGTH_I64)
 
@@ -989,13 +1064,13 @@ ENDIF(NOT MSVC)
 MACRO(GEN_m4 filename)
 #  IF(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c)
 IF(NC_M4)
-    ADD_CUSTOM_COMMAND(
-      OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
-      COMMAND ${NC_M4}
-      ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
-      VERBATIM
-      )
-  ENDIF()
+  ADD_CUSTOM_COMMAND(
+    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
+    COMMAND ${NC_M4}
+    ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.c
+    VERBATIM
+    )
+ENDIF(NC_M4)
 ENDMACRO(GEN_m4)
 
 # Binary tests, but ones which depend on value of 'TEMP_LARGE' being defined.
@@ -1040,7 +1115,7 @@ ENDMACRO()
 # Build a binary used by a script, but don't make a test out of it.
 MACRO(build_bin_test F)
   ADD_EXECUTABLE(${F} ${F}.c)
-  TARGET_LINK_LIBRARIES(${F} netcdf)
+  TARGET_LINK_LIBRARIES(${F} netcdf ${ALL_TLL_LIBS})
   IF(MSVC)
     SET_TARGET_PROPERTIES(${F}
       PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
@@ -1086,14 +1161,10 @@ ENDMACRO()
 
 MACRO(add_bin_test prefix F)
   ADD_EXECUTABLE(${prefix}_${F} ${F}.c)
-  # Some tests explicitly depend on HDF5, e.g., ncdump_tst_h_scalar.
-  # Some others depend on HDF5_HL, e.g., nc_test4_tst_interops.
-  # Hence, we have to link the tests against those libraries.
-  # TODO see if we can implement a more fine-grained approach
+
   TARGET_LINK_LIBRARIES(${prefix}_${F}
+    ${ALL_TLL_LIBS}
     netcdf
-    ${HDF5_C_LIBRARIES}
-    ${HDF5_HL_LIBRARIES}
     )
   IF(MSVC)
     SET_TARGET_PROPERTIES(${prefix}_${F}
@@ -1300,6 +1371,7 @@ IF(ENABLE_TESTS)
   ENDIF()
   ADD_SUBDIRECTORY(nc_test)
   IF(USE_NETCDF4)
+    INCLUDE_DIRECTORIES(h5_test)
     ADD_SUBDIRECTORY(nc_test4)
     ADD_SUBDIRECTORY(h5_test)
   ENDIF()
diff --git a/Doxyfile.developer b/Doxyfile.developer
index c1ee03d..47dcecb 100755
--- a/Doxyfile.developer
+++ b/Doxyfile.developer
@@ -38,7 +38,7 @@ PROJECT_NAME           = netCDF-C
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 4.3.3.1
+PROJECT_NUMBER         = 4.4.0-rc1
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index d7fed90..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,259 +0,0 @@
-Documentation for getting and building netCDF
-*********************************************
-
-This document is for getting and building the netCDF C library and
-utilities, version 4.3.  Other libraries that depend on the netCDF C
-library, such as the Fortran and C++ libraries, are available as
-separate distributions that can be built and installed after the C
-library is successfully installed.  The netCDF-Java library is also a
-separate distribution that is currently independent of the netCDF C
-library.
-
-Getting NetCDF
-**************
-
-The easiest way to get netCDF is through a package management program,
-such as rpm, yum, adept, and others. NetCDF is available from many
-different repositories, including the default Red Hat and Ubuntu
-repositories.
-
-When getting netCDF from a software repository, you will wish to get
-the development version of the package ("netcdf-devel"). This includes
-the netcdf.h header file.
-
-Unfortunately, you may not be able to get a recent version of netCDF
-from a package management system, in which case you must build from
-source code. Visit
-
-  http://github.com/Unidata/netcdf-c/releases
-
-
-to download the source distribution for the latest, fully-tested release.
-
-Alternatively, you may download the latest developer snapshot via
-the `git` program. This may be accessed from the command line
-as follows:
-
-   $ git clone http://github.com/Unidata/netcdf-c.git
-
-If you prefer, there are many git GUI programs which may be used
-as an alternative to the command line.  A listing of these may be found
-here:
-
-   * http://git-scm.com/downloads/guis
-
-Warning: the developer snapshot release contains bug-fixes and new
-features added since the last full release. It may also contain
-portability bugs.
-
-Once you have downloaded and unpacked the distribution, see the
-following section on building.
-
-Building NetCDF
-***************
-
-The netCDF-C library and utilities requires 3rd party libraries for
-full functionality.
-
-  *  Building with NetCDF-4 and the Remote Data Client
-  *  Building NetCDF with Classic Library Only
-  *  Building with HDF4 Support
-  *  Building with Parallel I/O Support
-
-Building with NetCDF-4 and the Remote Data Client
-*************************************************
-
-The usual way of building netCDF requires the HDF5, zlib, and curl
-libraries. (And, optionally, the szlib library). Versions required are
-at least HDF5 1.8.8, zlib 1.2.5, and curl 7.18.0 or later.
-(Optionally, if building with szlib, get szip 2.0 or later.)
-
-HDF5 1.8.9 and zlib 1.2.7 packages are available from the netCDF-4 ftp
-site:
-
-  ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4
-
-If you wish to use the remote data client code, then you will also
-need libcurl, which can be obtained from the curl website:
-
-  http://curl.haxx.se/download.html
-
-Make sure you run ``make check'' for the HDF5 and zlib
-distributions. They are very well-behaved distributions, but sometimes
-the build doesn't work (perhaps because of something subtly
-misconfigured on the target machine). If one of these libraries is not
-working, netCDF will have serious problems.
-
-Note that for building netCDF, it is not necessary to build the HDF5
-Fortran, C++, or Java API's.  Only the HDF5 C library is used.
-
-Optionally, you can also build netCDF-4 with the szip library
-(a.k.a. szlib). NetCDF cannot create szipped data files, but can read
-HDF5 data files that have used szip.
-
-There are license restrictions on the use of szip, see the section on
-licensing terms in the web page on szip compression in HDF products:
-
-  http://www.hdfgroup.org/doc_resource/SZIP/
-
-These license restrictions seem to apply to commercial users who are
-writing data. (Data readers are not restricted.) But here at NetCDF
-World Headquarters, in Sunny Boulder, Colorado, there are no lawyers,
-only programmers, so please read the szip documents for the license
-agreement to see how it applies to your situation.
-
-If ``make check'' fails for either zlib or HDF5, the problem must be
-resolved before the netCDF-4 installation can continue. For HDF5
-problems, see the HDF5 help services:
-
-  http://www.hdfgroup.org/services/support.html
-
-Build zlib like this:
-
-  ./configure --prefix=/home/ed/local
-  make check install
-
-Then you build HDF5, specifying the location of the zlib library:
-
-  ./configure --with-zlib=/home/ed/local --prefix=/home/ed/local 
-  make check install
-
-Note that for shared libraries, you may need to add the install
-directory to the LD_LIBRARY_PATH environment variable. See the netCDF
-FAQ:
-
-  http://www.unidata.ucar.edu/netcdf/docs/faq.html#Shared%20Libraries
-
-for more details on using shared libraries.
-
-If you are building HDF5 with szip, then include the --with-szlib=
-option, with the directory holding the szip library.
-
-After HDF5 is done, build netcdf, specifying the location of the HDF5,
-zlib, and (if built into HDF5) the szip header files and libraries in
-the CPPFLAGS and LDFLAGS environment variables.  For example:
-
-  CPPFLAGS=-I/home/ed/local/include LDFLAGS=-L/home/ed/local/lib ./configure --prefix=/home/ed/local
-  make check install
-
-The configure script will try to find necessary tools in your
-path. When you run configure you may optionally use the --prefix
-argument to change the default installation directory. The above
-examples install the zlib, HDF5, and netCDF-4 libraries in
-/home/ed/local/lib, the header file in /home/ed/local/include, and the
-utilities in /home/ed/local/bin.  If you don't provide a --prefix
-option, installation will be in /usr/local/, in subdirectories lib/,
-include/, and bin/.
-
-Building NetCDF with Classic Library Only
-*****************************************
-
-It is possible to build the netCDF C libraries and utilities so that
-only the netCDF classic and 64-bit offset formats are supported, or
-the remote data access client is not built.  (See
-
-  http://www.unidata.ucar.edu/netcdf/docs/netcdf_format.html
-
-for more information about the netCDF format variants.  See the
-netCDF-DAP site
-
-  http://opendap.org/netCDF-DAP 
-
-for more information about remote client access to data on OPeNDAP
-servers.)
-
-To build without support for the netCDF-4 formats or the additional
-netCDF-4 functions, but with remote access, use:
-
-  ./configure --prefix=/home/ed/local --disable-netcdf-4
-  make check install
-
-(Replace ``/home/ed/local'' with the name of the directory where
-netCDF is to be installed.)
-
-Starting with version 4.1.1 the netCDF C libraries and utilities have
-supported remote data access, using the OPeNDAP protocols.  To build 
-with full support for netCDF-4 APIs and format but without remote
-client access, use:
-
-  ./configure --prefix=/home/ed/local --disable-dap
-  make check install
-
-To build without netCDF-4 support or remote client access, use:
-
-  ./configure --prefix=/home/ed/local --disable-netcdf-4 --disable-dap
-  make check install
-
-If you get the message that netCDF installed correctly, then you are
-done!
-
-Building with HDF4 Support
-**************************
-
-The netCDF-4 library can (since version 4.1) read HDF4 data files, if
-they were created with the SD (Scientific Data) API. To enable this
-feature, use the --enable-hdf4 option. The location for the HDF4
-header files and library must be set in the CPPFLAGS and LDFLAGS
-options.
-
-For HDF4 access to work, the library must be build with netCDF-4
-features.
-
-Building with Parallel I/O Support
-**********************************
-
-For parallel I/O to work, HDF5 must be installed with
-–enable-parallel, and an MPI library (and related libraries) must be
-made available to the HDF5 configure. This can be accomplished with
-the mpicc wrapper script, in the case of MPICH2.
-
-The following works to build HDF5 with parallel I/O on our netCDF
-testing system:
-
-  CC=mpicc ./configure --enable-parallel --prefix=/shecky/local_par --with-zlib=/shecky/local_par
-  make check install
-
-If the HDF5 used by netCDF has been built with parallel I/O, then
-netCDF will also be built with support for parallel I/O. This allows
-parallel I/O access to netCDF-4/HDF5 files.  (See
-
-  http://www.unidata.ucar.edu/netcdf/docs/netcdf_format.html
-
-for more information about the netCDF format variants.)
-
-If parallel I/O access to netCDF classic and 64-bit offset files is
-also needed, the parallel-netcdf library should also be installed,
-(and the replacement pnetcdf.h at
-
-  ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/pnetcdf.h
-
-must be used). Then configure netCDF with the --enable-pnetcdf flag.
-
-Linking to NetCDF
-*****************
-
-For static build, to use netCDF-4 you must link to all the libraries,
-netCDF, HDF5, zlib, szip (if used with HDF5 build), and curl (if the
-remote access client has not been disabled). This will mean -L options
-to your build for the locations of the libraries, and -l (lower-case
-L) for the names of the libraries.
-
-For example, one user reports that she can build other applications
-with netCDF-4 by setting the LIBS environment variable:
-
-  LIBS='-L/X/netcdf-4.0/lib -lnetcdf -L/X/hdf5-1.8.6/lib -lhdf5_hl -lhdf5 -lz -lm -L/X/szip-2.1/lib -lsz'
-
-For shared builds, only -lnetcdf is needed. All other libraries will
-be found automatically.
-
-The ``nc-config --all'' command can be used to learn what options are
-needed for the local netCDF installation.
-
-For example, this works for linking an application named myapp.c with
-netCDF-4 libraries:
-
-    cc -o myapp myapp.c `nc-config --cflags --libs`
-
-Building on Windows
-*******************
-Refer to the document COMPILE_CMake.txt
diff --git a/INSTALL.cmake b/INSTALL.cmake
deleted file mode 100644
index 388f08b..0000000
--- a/INSTALL.cmake
+++ /dev/null
@@ -1,161 +0,0 @@
-Documentation for building netCDF with CMake
-********************************************************
-
-This document describes building the netCDF 4.3 C libraries
-using KitWare's CMake utility.  By integrating CMake, we are 
-able to  provide cross-platform (Windows as well as Linux/Unix)
-configuration and build support.
-
-For instructions on getting the latest version of netCDF,
-as well as how to get and build the netCDF dependencies,
-please refer to the 'INSTALL' file found in the root 
-netCDF source directory.
-
-
-Getting CMake
-*************
-
-CMake, a software configuration and testing tool, is maintained by
-Kitware.  CMake is available in many linux package management
-systems, as well as the 'macports' package management system for 
-OSX. 
-
-CMake may also be downloaded for these platforms, as well as Windows,
-from the CMake website at http://www.cmake.org.
-
-Building NetCDF with CMake
-**************************
-
-The netCDF-C library and utilities requires 3rd party libraries for
-full functionality.
-
-  *  Building with NetCDF-4 and the Remote Data Client
-  *  Building NetCDF with Classic Library Only
-  *  Building with HDF4 Support
-  *  Building with Parallel I/O Support
-
-Note that CMake encourages 'out-of-source-tree' builds, i.e. the
-directory used to build netCDF is not the root of the netCDF
-file structure.  For example, it is fairly common practice to
-create a 'build' directory inside the source directory. The examples
-in this file will use syntax which assumes the user is currently
-located in c:\netcdf-src-dir\build\.
-
-Building NetCDF with Classic Library Only
-*****************************************
-
-It is possible to build the netCDF C libraries and utilities so that
-only the netCDF classic and 64-bit offset formats are supported, or
-the remote data access client is not built.  (See
-
-  http://www.unidata.ucar.edu/netcdf/docs/netcdf_format.html
-
-for more information about the netCDF format variants.  See the
-netCDF-DAP site
-
-  http://opendap.org/netCDF-DAP 
-
-for more information about remote client access to data on OPeNDAP
-servers.)
-
-To build without support for the netCDF-4 formats or the additional
-netCDF-4 functions, but with remote access, use:
-
-Windows:
-	> cmake -DCMAKE_INSTALL_PREFIX=C:\Home\Ed\Local -DENABLE_NETCDF_4=OFF
-	> cmake --build .
-	> cmake --build . --target RUN_TESTS
-	> cmake --build . --target INSTALL
-
-Linux/Unix:	
-  	> cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_NETCDF_4=OFF
-   	> make 
-	> make test install
-
-(Replace ``/home/ed/local'' with the name of the directory where
-netCDF is to be installed.)
-
-Starting with version 4.1.1 the netCDF C libraries and utilities have
-supported remote data access, using the OPeNDAP protocols.  To build 
-with full support for netCDF-4 APIs and format but without remote
-client access, use:
-
-Windows:
-	> cmake -DCMAKE_INSTALL_PREFIX=C:\Home\Ed\Local -DENABLE_DAP=OFF
-	> cmake --build .
-	> cmake --build . --target RUN_TESTS
-	> cmake --build . --target INSTALL
-
-Linux/Unix
-        > cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_DAP=OFF
-	> make
-	> make test install
-	
-
-If you get the message that netCDF installed correctly, then you are
-done!
-
-
-
-Building with HDF4 Support
-**************************
-
-The netCDF-4 library can (since version 4.1) read HDF4 data files, if
-they were created with the SD (Scientific Data) API. To enable this
-feature, use the -DENABLE_HDF4=ON option. The location for the HDF4
-header files and library must be set in the CPPFLAGS and LDFLAGS
-options.
-
-For HDF4 access to work, the library must be build with netCDF-4
-features.
-
-Building with Parallel I/O Support
-**********************************
-
-For parallel I/O to work, HDF5 must be installed with
--DENABLE_PARALLEL=ON, and an MPI library (and related libraries) must be
-made available to the HDF5 configure. This can be accomplished with
-the mpicc wrapper script, in the case of MPICH2 (assuming you are building
-within the `netcdf/build` directory).
-
-  CC=mpicc cmake .. -DENABLE_PARALLEL=ON -DCMAKE_INSTALL_PREFIX=/shecky/local_par 
-  make check install
-
-If the HDF5 used by netCDF has been built with parallel I/O, then
-netCDF will also be built with support for parallel I/O. This allows
-parallel I/O access to netCDF-4/HDF5 files.  (See
-
-  http://www.unidata.ucar.edu/netcdf/docs/netcdf_format.html
-
-for more information about the netCDF format variants.)
-
-If parallel I/O access to netCDF classic and 64-bit offset files is
-also needed, the parallel-netcdf library should also be installed,
-(and the replacement pnetcdf.h at
-
-  ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/pnetcdf.h
-
-must be used). Then configure netCDF with the --enable-pnetcdf flag.
-
-Linking to NetCDF
-*****************
-
-For static build, to use netCDF-4 you must link to all the libraries,
-netCDF, HDF5, zlib, szip (if used with HDF5 build), and curl (if the
-remote access client has not been disabled). This will mean -L options
-to your build for the locations of the libraries, and -l (lower-case
-L) for the names of the libraries.
-
-For shared builds, only -lnetcdf is needed. All other libraries will
-be found automatically.
-
-On Windows, when using Visual Studio and compiling a shared library (.dll),
-netcdf will be built with an 'import' library, named netcdf.lib. Visual
-Studio projects should link against this import library, instead of linking
-against the netcdf.dll file directly.
-
-To specify static libraries with CMake, you must use the 'BUILD_SHARED_LIBS=OFF'
-flag when invoking CMake.
-
- 	netcdf/build> cmake .. -D"BUILD_SHARED_LIBS=OFF" 
-
diff --git a/docs/install.dox b/INSTALL.md
similarity index 60%
rename from docs/install.dox
rename to INSTALL.md
index 5344a5c..9a96a08 100644
--- a/docs/install.dox
+++ b/INSTALL.md
@@ -1,4 +1,7 @@
-/*!
+Getting and Building netCDF {#getting_and_building_netcdf}
+=============================
+
+[TOC]
 
 This document is for getting and building the netCDF C library and
 utilities, version 4.3.0.  Other libraries that depend on the netCDF C
@@ -8,15 +11,14 @@ library is successfully installed.  The netCDF-Java library is also a
 separate distribution that is currently independent of the netCDF C
 library.
 
-\page getting_and_building_netcdf Getting and Building NetCDF-C
-
-\brief This page provides instructions for obtaining and building netCDF-C.
 
-\tableofcontents
+Getting netCDF-C {#getting}
+=========================
 
-\section getting Getting NetCDF
+* For information regarding the netCDF-Fortran libraries, see \subpage building_netcdf_fortran.
 
-\subsection sec_get_pre_built Getting pre-built netCDF-C libraries.
+Getting pre-built netCDF-C libraries. {#sec_get_pre_built}
+-------------------------------------
 
 The easiest way to get netCDF is through a package management program,
 such as rpm, yum, adept, and others. NetCDF is available from many
@@ -27,11 +29,12 @@ When getting netCDF from a software repository, you will wish to get
 the development version of the package ("netcdf-devel"). This includes
 the netcdf.h header file.
 
-\note If you are interested in building netCDF-C on Windows, please see \ref winbin and \ref netCDF-CMake.
+Pre-release libraries for Windows may be found here: \ref winbin.
 
-\subsection sec_get_source Getting the latest netCDF-C Source Code
+Getting the latest netCDF-C Source Code {#sec_get_source}
+----------------------------------------
 
-Starting with netCDF-C version 4.3.1, the netCDF-C source code is hosted at the 
+Starting with netCDF-C version 4.3.1, the netCDF-C source code is hosted at the
 Unidata GitHub repository, available at http://github.com/Unidata/netcdf-c.
 
 Two options are available for building from source:
@@ -39,7 +42,7 @@ Two options are available for building from source:
 - The latest release.
 - The developer snapshot.
 
-\subsubsection sec_latest_release The latest release
+### The latest release {#sec_latest_release}
 
 The latest release may be downloaded from github at the following location:
 
@@ -47,20 +50,23 @@ The latest release may be downloaded from github at the following location:
 
 Source files are available in `.tar.gz` and `.zip` formats.
 
-\subsubsection sec_dev_snapshot The developer snapshot
+### The developer snapshot {#sec_dev_snapshot}
 
 The developer snapshot may be cloned from github directly by using the `git` command.
 
-    $ git clone http://github.com/Unidata/netcdf-c netcdf-c
+> $ git clone http://github.com/Unidata/netcdf-c netcdf-c
 
-\warning The developer snapshot release contains bug-fixes and new
+**Note:**
+
+> ***The developer snapshot release contains bug-fixes and new
 features added since the last full release. It may also contain
-portability bugs.
+portability bugs.***
 
 Once you have downloaded and unpacked the distribution, see the
 following section on \ref building.
 
-\section building Building NetCDF
+Building netCDF-C {#building}
+===========================
 
 The netCDF-C library and utilities require third-party libraries for
 full functionality. (See \ref architecture).
@@ -68,22 +74,32 @@ full functionality. (See \ref architecture).
 - \ref build_classic
 - \ref build_hdf4
 - \ref build_parallel
-- <a class="el" href="http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html" >Building netCDF-Fortran Libraries</a>
+- \ref building_netcdf_fortran
 - \ref configure_options
 
-\subsection sub CMake and Windows support
+Requirements {#netcdf_requirements}
+----------------------------------
+
+* HDF5 1.8.9 (netcdf-4 support)
+* zlib 1.2.5
+* curl 7.18.0 (DAP support)
+
+
+CMake and Windows support {#sub}
+--------------------------------
 
 - \ref netCDF-CMake
-- \ref winbin
+- \subpage winbin
 
-\subsection build_default Building with NetCDF-4 and the Remote Data Client
+Building with netCDF-4 and the Remote Data Client {#build_default}
+--------------------------------
 
 The usual way of building netCDF requires the HDF5, zlib, and curl
 libraries. (And, optionally, the szlib library). Versions required are
-at least HDF5 1.8.8, zlib 1.2.5, and curl 7.18.0 or later.
+at least HDF5 1.8.9, zlib 1.2.5, and curl 7.18.0 or later.
 (Optionally, if building with szlib, get szip 2.0 or later.)
 
-HDF5 1.8.12 and zlib 1.2.8 packages are available from the <a
+HDF5 1.8.9 and zlib 1.2.7 packages are available from the <a
 href="ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4">netCDF-4 ftp
 site</a>. If you wish to use the remote data client code, then you
 will also need libcurl, which can be obtained from the <a
@@ -101,7 +117,7 @@ Fortran, C++, or Java API's.  Only the HDF5 C library is used.
 Optionally, you can also build netCDF-4 with the szip library
 (a.k.a. szlib). NetCDF cannot create szipped data files, but can read
 HDF5 data files that have used szip.
-
+8
 There are license restrictions on the use of szip, see the section on
 licensing terms in the <a
 href="http://www.hdfgroup.org/doc_resource/SZIP/">web page on szip
@@ -120,17 +136,17 @@ services</a>.
 
 Build zlib like this:
 
-\verbatim
-./configure --prefix=/home/username/local
-make check install
-\endverbatim
+~~~
+$ ./configure --prefix=/home/username/local
+$ make check install
+~~~
 
 Then you build HDF5, specifying the location of the zlib library:
 
-\verbatim
-./configure --with-zlib=/home/username/local --prefix=/home/username/local 
-make check install
-\endverbatim
+~~~
+$ ./configure --with-zlib=/home/username/local --prefix=/home/username/local
+$ make check install
+~~~
 
 In all cases, the installation location specified with the <CODE>--prefix</CODE>
 option must be different from the source directory where the software
@@ -144,14 +160,14 @@ FAQ</a> for more details on using shared libraries.
 If you are building HDF5 with szip, then include the <CODE>--with-szlib=</CODE>
 option, with the directory holding the szip library.
 
-After HDF5 is done, build netCDF, specifying the location of the
+After HDF5 is done, build netcdf, specifying the location of the
 HDF5, zlib, and (if built into HDF5) the szip header files and
 libraries in the CPPFLAGS and LDFLAGS environment variables. For example:
 
-\verbatim
-CPPFLAGS=-I/home/username/local/include LDFLAGS=-L/home/username/local/lib ./configure --prefix=/home/username/local
-make check install
-\endverbatim
+~~~
+$ CPPFLAGS=-I/home/username/local/include LDFLAGS=-L/home/username/local/lib ./configure --prefix=/home/username/local
+$ make check install
+~~~
 
 The configure script will try to find necessary tools in your
 path. When you run configure you may optionally use the <CODE>--prefix</CODE>
@@ -164,7 +180,8 @@ include/, and bin/.  The installation location specified with the
 <CODE>--prefix</CODE> option must be different from the source directory where the
 software is being built.
 
-\subsection build_classic Building NetCDF with Classic Library Only
+Building netCDF with Classic Library Only {#build_classic}
+---------------------------------------
 
 It is possible to build the netCDF C libraries and utilities so that
 only the netCDF classic and 64-bit offset formats are supported, or
@@ -177,80 +194,82 @@ on OPeNDAP servers.)
 To build without support for the netCDF-4 formats or the additional
 netCDF-4 functions, but with remote access, use:
 
-\verbatim
-./configure --prefix=/home/username/local --disable-netcdf-4
-make check install
-\endverbatim
+~~~
+$ ./configure --prefix=/home/username/local --disable-netcdf-4
+$ make check install
+~~~
 
-(Replace ``/home/username/local'' with the name of the directory where
+(Replace `/home/username/local` with the name of the directory where
 netCDF is to be installed.  The installation location specified with
 the <CODE>--prefix</CODE> option must be different from the source directory where
 the software is being built.)
 
 Starting with version 4.1.1 the netCDF C libraries and utilities have
-supported remote data access, using the OPeNDAP protocols.  To build 
+supported remote data access, using the OPeNDAP protocols.  To build
 with full support for netCDF-4 APIs and format but without remote
 client access, use:
 
-\verbatim
-./configure --prefix=/home/username/local --disable-dap
-make check install
-\endverbatim
+~~~
+$ ./configure --prefix=/home/username/local --disable-dap
+$ make check install
+~~~
 
 To build without netCDF-4 support or remote client access, use:
 
-\verbatim
-./configure --prefix=/home/username/local --disable-netcdf-4 --disable-dap
-make check install
-\endverbatim
+~~~
+$ ./configure --prefix=/home/username/local --disable-netcdf-4 --disable-dap
+$ make check install
+~~~
 
 If you get the message that netCDF installed correctly, then you are
 done!
 
-\subsection build_hdf4 Building with HDF4 Support
+Building with HDF4 Support {#build_hdf4}
+---------------------
 
 The netCDF-4 library can (since version 4.1) read HDF4 data files, if
-they were created with the SD (Scientific Data) API. 
+they were created with the SD (Scientific Data) API.
 
 For this to work, you must build the HDF4 library with the
 configure option
-\verbatim
+~~~
   --disable-netcdf
-\endverbatim
+~~~
 to prevent it from building an HDF4 version of the netCDF-2 library
 that conflicts with the netCDF-2 functions that are built into the Unidata
 netCDF library.
 
-Then, when building netCDF-4, use the 
-\verbatim
+Then, when building netCDF-4, use the
+~~~
   --enable-hdf4
-\endverbatim
+~~~
 option to configure. The location for the HDF4 header files and
 library must be set in the CPPFLAGS and LDFLAGS options.
 
-For HDF4 access to work, the library must be built with netCDF-4
+For HDF4 access to work, the library must be build with netCDF-4
 features.
 
 Here's an example, assuming the HDF5 library has been built and
 installed in H5DIR and you will build and install the HDF4 library in
 H4DIR (which could be the same as H5DIR):
 
-\verbatim
+~~~
 # Build and install HDF4
-cd ${HDF4_SOURCE_DIRECTORY}
-./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
-make
-make install
-# Build and install netCDF with HDF4 access enabled
-cd ${NETCDF_SOURCE_DIRECTORY}
-CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
-LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
-./configure --enable-hdf4 --enable-hdf4-file-tests
-make check
-make install
-\endverbatim
-
-\subsection build_parallel Building with Parallel I/O Support
+$ cd ${HDF4_SOURCE_DIRECTORY}
+$ ./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
+$ make
+$ make install
+$ # Build and install netCDF with HDF4 access enabled
+$ cd ${NETCDF_SOURCE_DIRECTORY}
+$ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
+$          LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
+$ ./configure --enable-hdf4 --enable-hdf4-file-tests
+$ make check
+$ make install
+~~~
+
+Building with Parallel I/O Support {#build_parallel}
+--------------
 
 For parallel I/O to work, HDF5 must be installed with
 –enable-parallel, and an MPI library (and related libraries) must be
@@ -260,10 +279,10 @@ the mpicc wrapper script, in the case of MPICH2.
 The following works to build HDF5 with parallel I/O on our netCDF
 testing system:
 
-\verbatim
+~~~
 CC=mpicc ./configure --enable-parallel
 make check install
-\endverbatim
+~~~
 
 If the HDF5 used by netCDF has been built with parallel I/O, then
 netCDF will also be built with support for parallel I/O. This allows
@@ -277,15 +296,15 @@ variants.)
 The following works to build netCDF-4 with parallel I/O on our netCDF
 testing system:
 
-\verbatim
-H5DIR=/where/parallel/HDF5/was/installed
-CPPFLAGS="-I${H5DIR}/include"
-CC=mpicc
-LDFLAGS=-L${H5DIR}/lib
-LIBS=-ldl
-./configure --disable-shared --enable-parallel-tests
-make check install
-\endverbatim
+~~~
+$ H5DIR=/where/parallel/HDF5/was/installed
+$ CPPFLAGS="-I${H5DIR}/include"
+$ CC=mpicc
+$ LDFLAGS=-L${H5DIR}/lib
+$ LIBS=-ldl
+$ ./configure --disable-shared --enable-parallel-tests
+$ make check install
+~~~
 
 
 If parallel I/O access to netCDF classic and 64-bit offset files is
@@ -295,7 +314,8 @@ href=ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/pnetcdf.h>replacement
 pnetcdf.h</a> should no longer be used.)  Then configure netCDF with the
 "--enable-pnetcdf" option.
 
-\subsection linking Linking to NetCDF
+Linking to netCDF-C {#linking}
+-------------------
 
 For static build, to use netCDF-4 you must link to all the libraries,
 netCDF, HDF5, zlib, szip (if used with HDF5 build), and curl (if the
@@ -306,9 +326,9 @@ L) for the names of the libraries.
 For example, one user reports that she can build other applications
 with netCDF-4 by setting the LIBS environment variable:
 
-\verbatim
-LIBS='-L/X/netcdf-4.0/lib -lnetcdf -L/X/hdf5-1.8.6/lib -lhdf5_hl -lhdf5 -lz -lm -L/X/szip-2.1/lib -lsz'
-\endverbatim
+~~~
+LIBS='-L/X/netcdf-4.0/lib -lnetcdf -L/X/hdf5-1.8.9/lib -lhdf5_hl -lhdf5 -lz -lm -L/X/szip-2.1/lib -lsz'
+~~~
 
 For shared builds, only -lnetcdf is needed. All other libraries will
 be found automatically.
@@ -319,11 +339,14 @@ needed for the local netCDF installation.
 For example, this works for linking an application named myapp.c with
 netCDF-4 libraries:
 
-\verbatim
+~~~
 cc -o myapp myapp.c `nc-config --cflags --libs`
-\endverbatim
+~~~
+
+configure options {#configure_options}
+-----------------------------
 
-\subsection configure_options ./configure options
+These options are used for `autotools`-based builds.  For `cmake` options, see
 
 Note: --disable prefix indicates that the option is normally enabled.
 <table>
@@ -367,4 +390,108 @@ Note: --disable prefix indicates that the option is normally enabled.
 <tr><td>--disable-largefile<td>omit support for large files<td>
 <tr><td>--enable-mmap<td>Use mmap to implement NC_DISKLESS<td>
 </table>
-*/
+
+Build Instructions for netCDF-C using CMake {#netCDF-CMake}
+===========================================
+
+## Overview {#cmake_overview}
+
+Starting with netCDF-C 4.3.0, we are happy to announce the inclusion of CMake support.  CMake will allow for building netCDF on a wider range of platforms, include Microsoft Windows with Visual Studio.  CMake support also provides robust unit and regression testing tools.  We will also maintain the standard autotools-based build system in parallel.
+
+In addition to providing new build options for netCDF-C, we will also provide pre-built binary downloads for the shared versions of netCDF for use with Visual Studio.
+
+
+##  Requirements {#cmake_requirements}
+The following packages are required to build netCDF-C using CMake.
+
+* netCDF-C Source Code
+* CMake version 2.8.12 or greater.
+* Optional Requirements:
+	* HDF5 Libraries for netCDF4/HDF5 support.
+	* libcurl for DAP support.
+
+<center>
+<img src="deptree.jpg" height="250px" />
+</center>
+
+## The CMake Build Process {#cmake_build}
+
+There are four steps in the Build Process when using CMake
+
+1. Configuration: Before compiling, the software is configured based on the desired options.
+2. Building: Once configuration is complete, the libraries are compiled.
+3. Testing: Post-build, it is possible to run tests to ensure the functionality of the netCDF-C libraries.
+4. Installation: If all tests pass, the libraries can be installed in the location specified during configuration.
+
+For users who prefer pre-built binaries, installation packages are available at \ref winbin
+
+### Configuration {#cmake_configuration}
+
+The output of the configuration step is a project file based on the appropriate configurator specified.  Common configurators include:
+
+* Unix Makefiles
+* Visual Studio
+* CodeBlocks
+* ... and others
+
+### Common CMake Options {#cmake_common_options}
+
+| **Option** | **Autotools** | **CMake** |
+| :------- | :---- | :----- |
+Specify Install Location | --prefix=PREFIX | -D"CMAKE\_INSTALL\_PREFIX=PREFIX"
+Enable/Disable netCDF-4 | --enable-netcdf-4<br>--disable-netcdf-4 | -D"ENABLE\_NETCDF\_4=ON" <br> -D"ENABLE\_NETCDF\_4=OFF"
+Enable/Disable DAP | --enable-dap <br> --disable-dap | -D"ENABLE\_DAP=ON" <br> -D"ENABLE\_DAP=OFF"
+Enable/Disable Utilities | --enable-utilities <br> --disable-utilities | -D"BUILD\_UTILITIES=ON" <br> -D"BUILD\_UTILITIES=OFF"
+Specify shared/Static Libraries | --enable-shared <br> --enable-static | -D"BUILD\_SHARED\_LIBS=ON" <br> -D"BUILD\_SHARED\_LIBS=OFF"
+Enable/Disable Tests | --enable-testsets <br> --disable-testsets | -D"ENABLE\_TESTS=ON" <br> -D"ENABLE\_TESTS=OFF"
+Specify a custom library location | Use *CFLAGS* and *LDFLAGS* | -D"CMAKE\_PREFIX\_PATH=/usr/custom_libs/"
+
+A full list of *basic* options can be found by invoking `cmake [Source Directory] -L`. To enable a list of *basic* and *advanced* options, one would invoke `cmake [Source Directory] -LA`.
+
+### Configuring your build from the command line. {#cmake_command_line}
+
+The easiest configuration case would be one in which all of the dependent libraries are installed on the system path (in either Unix/Linux or Windows) and all the default options are desired. From the build directory (often, but not required to be located within the source directory):
+
+> $ cmake [Source Directory]
+
+If you have libraries installed in a custom directory, you may need to specify the **CMAKE\_PREFIX_PATH** variable to tell cmake where the libraries are installed. For example:
+
+> $ cmake [Source Directory] -DCMAKE\_PREFIX\_PATH=/usr/custom_libraries/
+
+## Building {#cmake_building}
+
+The compiler can be executed directly with 'make' or the appropriate command for the configurator which was used.
+
+> $ make
+
+Building can also be executed indirectly via cmake:
+
+> $ cmake --build [Build Directory]
+
+## Testing {#cmake_testing}
+
+Testing can be executed several different ways:
+
+> $ make test
+
+or
+
+> $ ctest
+
+or
+
+> $ cmake --build [Build Directory] --target test
+
+### Installation {#cmake_installation}
+
+Once netCDF has been built and tested, it may be installed using the following commands:
+
+> $ make install
+
+or
+
+> $ cmake --build [Build Directory] --target install
+
+## See Also {#cmake_see_also}
+
+For further information regarding netCDF and CMake, see \ref cmake_faq
diff --git a/Makefile.am b/Makefile.am
index 40dec02..7fc886f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
 # These files get added to the distribution.
-EXTRA_DIST = README.md COPYRIGHT INSTALL INSTALL.cmake test_prog.c \
+EXTRA_DIST = README.md COPYRIGHT INSTALL.md test_prog.c \
 	lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt \
 	config.h.cmake.in cmake_uninstall.cmake.in \
 	FixBundle.cmake.in \
diff --git a/Makefile.in b/Makefile.in
index 71827fb..7d7786d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,17 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -99,12 +109,6 @@ target_triplet = @target@
 @BUILD_DLL_TRUE@${prefix}/lib/libnetcdf.la ${prefix}/lib/netcdfdll.def
 
 subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) \
-	$(srcdir)/config.h.in $(srcdir)/nc-config.in \
-	$(srcdir)/netcdf.pc.in $(srcdir)/libnetcdf.settings.in \
-	$(srcdir)/postinstall.sh.in INSTALL compile config.guess \
-	config.sub install-sh missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -112,6 +116,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -209,6 +215,10 @@ CSCOPE = cscope
 DIST_SUBDIRS = include oc2 h5_test libdispatch libsrc libsrc4 libdap2 \
 	libsrc5 liblib ncgen3 ncgen ncdump nctest nc_test nc_test4 \
 	ncdap_test docs examples
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(srcdir)/libnetcdf.settings.in $(srcdir)/nc-config.in \
+	$(srcdir)/netcdf.pc.in $(srcdir)/postinstall.sh.in compile \
+	config.guess config.sub install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -298,6 +308,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -313,10 +324,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -351,8 +364,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -418,7 +433,7 @@ top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
 
 # These files get added to the distribution.
-EXTRA_DIST = README.md COPYRIGHT INSTALL INSTALL.cmake test_prog.c \
+EXTRA_DIST = README.md COPYRIGHT INSTALL.md test_prog.c \
 	lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt \
 	config.h.cmake.in cmake_uninstall.cmake.in \
 	FixBundle.cmake.in \
@@ -524,7 +539,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -840,15 +854,15 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -883,17 +897,17 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1079,6 +1093,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA \
 	uninstall-am uninstall-binSCRIPTS uninstall-pkgconfigDATA \
 	uninstall-settingsDATA
 
+.PRECIOUS: Makefile
+
 
 #####
 # If ENABLE_FORTRAN was turned on,
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index ee0a7ca..f01d2cd 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -5,6 +5,34 @@ Release Notes       {#RELEASE_NOTES}
 
 This file contains a high-level description of this package's evolution. Releases are in reverse chronological order (most recent first). Note that, as of netcdf 4.2, the `netcdf-c++` and `netcdf-fortran` libraries have been separated into their own libraries.
 
+## 4.4.0 Released TBD
+
+### 4.4.0-RC1 Released 2015-06-09
+
+* The pre-built Windows binaries are now built using `Visual Studio 2012`, instead of `Visual Studio 2010`.  Source-code compilation remains function with `Visual Studio 2010`, this is just a change in the pre-built binaries.
+
+* Added support for opening in-memory file content. See `include/netcdf_mem.h` for the procedure signature. Basically, it allows one to fill a chunk of memory with the equivalent of some netCDF file and then open it and read from it as if it were any other file. See [NCF-328](https://bugtracking.unidata.ucar.edu/browse/NCF-328) for more information.
+
+* Addressed an issue when reading hdf4 files with explicit little-endian datatypes. This issue was [reported by Tim Burgess at GitHub](https://github.com/Unidata/netcdf-c/issues/113).  See [NCF-332](https://bugtracking.unidata.ucar.edu/browse/NCF-332) for more information.  
+
+* Addressed an issue with IBM's `XL C` compiler on AIX and how it handled some calls to malloc.  Also, as suggested by Wolfgang Hayek, developers using this compiler may need to pass `CPPFLAGS=-D_LINUX_SOURCE_COMPAT` to avoid some test failures.
+
+* Addressed an issure in netcdf4 related to specifying an endianness explicitly.  When specifying an endianness for `NC_FLOAT`, the value would appear to not be written to file, if checked with `ncdump -s`.  The issue was more subtle; the value would be written but was not being read from file properly for non-`NC_INT`.  See [GitHub Issue](https://github.com/Unidata/netcdf-c/issues/112) or [NCF-331](https://bugtracking.unidata.ucar.edu/browse/NCF-331) for more information.
+
+* Addressed an issue in netcdf4 on Windows w/DAP related to how byte values were copied with sscanf.  Issue originally reported by Ellen Johnson at Mathworks, see [NCF-330](https://bugtracking.unidata.ucar.edu/browse/NCF-330) for more information.
+
+* Addressed in issue in netcdf4 files on Windows, built with Microsoft Visual Studio, which could result in a memory leak.  See [NCF-329](https://bugtracking.unidata.ucar.edu/browse/NCF-329) for more information.
+
+* Addressed an issue in netcdf4 files where writing unlimited dimensions that were not declared at head of the dimensions list, as reported by Ellen Johnson at Mathworks.  See [NCF-326](https://bugtracking.unidata.ucar.edu/browse/NCF-326) for more information.
+
+* Added an authorization reference document as oc2/ocauth.html.
+
+* Fixed bug resulting in segmentation violation when trying to add a
+  _FillValue attribute to a variable in an existing netCDF-4 file
+  defined without it (thanks to Alexander Barth). See
+  [NCF-187](https://bugtracking.unidata.ucar.edu/browse/NCF-187) for
+  more information.
+
 ## 4.3.3.1 Released 2015-02-25
 
 * Fixed a bug related to renaming the attributes of coordinate variables in a subgroup. See [NCF-325](https://bugtracking.unidata.ucar.edu/browse/NCF-325) for more information.
diff --git a/aclocal.m4 b/aclocal.m4
index b18dbea..a0c40b0 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,121 +20,7 @@ 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'.])])
 
-# longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
-
-# Note: If the type 'long long int' exists but is only 32 bits large
-# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
-# defined. In this case you can treat 'long long int' like 'long int'.
-
-AC_DEFUN([AC_TYPE_LONG_LONG_INT],
-[
-  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
-     [ac_cv_type_long_long_int=yes
-      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
-        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
-        if test $ac_cv_type_long_long_int = yes; then
-          dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
-          dnl If cross compiling, assume the bug is not important, since
-          dnl nobody cross compiles for this platform as far as we know.
-          AC_RUN_IFELSE(
-            [AC_LANG_PROGRAM(
-               [[@%:@include <limits.h>
-                 @%:@ifndef LLONG_MAX
-                 @%:@ define HALF \
-                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-                 @%:@ define LLONG_MAX (HALF - 1 + HALF)
-                 @%:@endif]],
-               [[long long int n = 1;
-                 int i;
-                 for (i = 0; ; i++)
-                   {
-                     long long int m = n << i;
-                     if (m >> i != n)
-                       return 1;
-                     if (LLONG_MAX / 2 < m)
-                       break;
-                   }
-                 return 0;]])],
-            [],
-            [ac_cv_type_long_long_int=no],
-            [:])
-        fi
-      fi])
-  if test $ac_cv_type_long_long_int = yes; then
-    AC_DEFINE([HAVE_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type 'long long int'.])
-  fi
-])
-
-# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
-
-# Note: If the type 'unsigned long long int' exists but is only 32 bits
-# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
-# will not be defined. In this case you can treat 'unsigned long long int'
-# like 'unsigned long int'.
-
-AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
-[
-  AC_CACHE_CHECK([for unsigned long long int],
-    [ac_cv_type_unsigned_long_long_int],
-    [ac_cv_type_unsigned_long_long_int=yes
-     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
-       AC_LINK_IFELSE(
-         [_AC_TYPE_LONG_LONG_SNIPPET],
-         [],
-         [ac_cv_type_unsigned_long_long_int=no])
-     fi])
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type 'unsigned long long int'.])
-  fi
-])
-
-# Expands to a C program that can be used to test for simultaneous support
-# of 'long long' and 'unsigned long long'. We don't want to say that
-# 'long long' is available if 'unsigned long long' is not, or vice versa,
-# because too many programs rely on the symmetry between signed and unsigned
-# integer types (excluding 'bool').
-AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
-[
-  AC_LANG_PROGRAM(
-    [[/* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
-      int i = 63;]],
-    [[/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));]])
-])
-
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -146,10 +32,10 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 # 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.14'
+[am__api_version='1.15'
 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.14.1], [],
+m4_if([$1], [1.15], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -165,14 +51,14 @@ 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.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -217,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -256,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -447,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -523,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -613,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -687,7 +572,11 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -716,7 +605,7 @@ 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-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -727,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -737,7 +626,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -759,7 +648,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -794,7 +683,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -844,7 +733,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -883,7 +772,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -912,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -959,7 +848,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -978,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1059,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1119,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1147,7 +1036,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1166,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/cf b/cf
deleted file mode 100644
index f22b46d..0000000
--- a/cf
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/bin/bash
-#X="-x"
-#NB=1
-DB=1
-
-if test $# != 0 ; then
-cmds=$@
-fi
-
-HDF5=1
-DAP=1
-#HDF4=1
-#PNETCDF=1
-
-#PAR=1
-
-if test "x$PNETCDF" = x1 ; then
-PAR=1
-fi
-
-#RPC=1
-#PGI=1
-#M32=1
-#M64=1
-
-CFLAGS=""
-#CFLAGS="-Wall -Wno-unused-variable -Wno-unused-parameter -Wconversion ${CFLAGS}"
-CFLAGS="-Wall ${CFLAGS}"
-#CFLAGS="-Wconversion"
-
-stddir="/usr/local"
-PREFIX=/usr/local
-
-if test "x${cmds}" = x ; then
-  cmds=""
-else
-for f in $cmds ; do
-  if test "x$f" = "xdistcheck" ; then
-    PREFIX=/tmp/$HOST
-  fi
-done
-fi
-
-# HDF4=>HDF5
-if test "x$HDF4" = x1 ; then
-HDF5=1
-fi
-
-# Test pgi compiler
-if test "x$PGI" = x1 ; then
-PATH="/opt/pgi/linux86/11.1/bin:$PATH"
-CC=pgcc
-else
-CC=gcc
-fi
-
-MALLOC_CHECK=""
-
-CPPFLAGS=""
-LDFLAGS=""
-
-CFLAGS="-g -O0 $CFLAGS"
-
-case "$HOST" in
-  mort)
-	CFLAGS="-std=c99 $CFLAGS"
-	;;
-  yakov)
-	CFLAGS="-std=c99 $CFLAGS"
-	;;
-  spock)
-	if test "x$PGI" = x ; then
-  	  CFLAGS="-Wdeclaration-after-statement -Wall $CFLAGS"
-	fi
-	;;
-  spike)
-	CFLAGS="-Wall $CFLAGS"
-	;;
-  *)
-	;;
-esac
-
-MAKE=make
-IGNORE="test 0 = 1"
-
-if test "x$HDF5" = "x1" ; then
-CPPFLAGS="-I${stddir}/include $CPPFLAGS"
-LDFLAGS="-L${stddir}/lib -lhdf5_hl -lhdf5 -lz $LDFLAGS"
-LD_LIBRARY_PATH="${stddir}/lib:$LD_LIBRARY_PATH"
-fi
-
-if test "x$HDF4" = "x1" ; then
-LDFLAGS="$LDFLAGS -ljpeg"
-fi
-
-if test "x$DAP" = "x1" -o "x$CDMR" = "x1" -o "x$RPC" = "x1" ; then
-if curl-config --version >/dev/null ; then
-TMP=`curl-config --cflags`
-CPPFLAGS="$TMP $CPPFLAGS"
-TMP=`curl-config --libs`
-LDFLAGS="$TMP $LDFLAGS"
-TMP=`curl-config --prefix`
-LD_LIBRARY_PATH="$TMP/lib:$LD_LIBRARY_PATH"
-else
-  echo "Cannot find curl-config"
-  exit 1
-fi
-fi
-
-CXXFLAGS="$CPPFLAGS $CXXFLAGS"
-
-FLAGS="--prefix ${PREFIX}"
-#FLAGS="$FLAGS --disable-f77 --disable-f90"
-#FLAGS="$FLAGS --disable-cxx"
-FLAGS="$FLAGS --disable-examples"
-#FLAGS="$FLAGS --disable-utilities"
-#FLAGS="$FLAGS --enable-cxx-4"
-#FLAGS="$FLAGS --enable-dap-long-tests"
-#FLAGS="$FLAGS --enable-ffio"
-#FLAGS="$FLAGS --enable-benchmarks"
-#FLAGS="$FLAGS --enable-extra-tests"
-#FLAGS="$FLAGS --enable-large-file-tests"
-#FLAGS="$FLAGS --disable-testsets"
-#FLAGS="$FLAGS --disable-dap-remote-tests"
-FLAGS="$FLAGS --enable-dap-auth-tests"
-#FLAGS="$FLAGS --enable-doxygen"
-#FLAGS="$FLAGS --enable-logging"
-#FLAGS="$FLAGS --disable-diskless"
-#FLAGS="$FLAGS --enable-mmap"
-#FLAGS="$FLAGS --with-udunits"
-#FLAGS="$FLAGS --with-libcf"
-#valgrind => not shared
-#FLAGS="$FLAGS --enable-valgrind-tests"
-FLAGS="$FLAGS --enable-jna"
-
-if test "x${DB}" = x1 ; then
-FLAGS="$FLAGS --disable-shared"
-else
-FLAGS="$FLAGS --enable-shared"
-fi
-
-if test "x${PAR}" != x ; then
-FLAGS="$FLAGS --enable-parallel"
-fi
-
-if test "x$HDF5" = "x" ; then
-FLAGS="$FLAGS --disable-netcdf-4"
-fi
-if test "x$HDF4" = x1 ; then
-FLAGS="$FLAGS --enable-hdf4 --enable-hdf4-file-tests"
-fi
-if test "x$DAP" = "x" ; then
-FLAGS="$FLAGS --disable-dap"
-fi
-if test "x$CDMR" = "x1" ; then
-FLAGS="$FLAGS --enable-cdmremote"
-fi
-if test "x$RPC" = "x1" ; then
-FLAGS="$FLAGS --enable-rpc"
-fi
-
-if test "x$PNETCDF" = x1 ; then
-if test -f /machine/local_mpich2 ; then
-MPI1=/machine/local_mpich2
-MPI2=/machine/local_par7
-MPI3=/machine/local_par
-else
-MPI1=/usr/local
-MPI2=${MPI1}
-MPI3=${MPI1}
-fi
-PATH=${PATH}:${MPI1}/bin
-CC="${MPI1}/bin/mpicc"
-CPPFLAGS="-I${MPI2}/include -I${MPI1}/include -I${MPI3}/include"
-LDFLAGS="-L${MPI2}/lib -L${MPI1}/lib -L${MPI3}/lib"
-LDLIBS="-lmpich -lmpl"
-FLAGS="$FLAGS --enable-pnetcdf"
-FLAGS="$FLAGS --enable-parallel-tests"
-fi
-
-export PATH
-export CC
-export CPPFLAGS
-export CFLAGS
-export LDFLAGS
-export LD_LIBRARY_PATH
-export MALLOC_CHECK
-export CXXFLAGS
-
-DISTCHECK_CONFIGURE_FLAGS="$FLAGS"
-export DISTCHECK_CONFIGURE_FLAGS
-
-if test -z "$NB" ; then
-${MAKE} maintainer-clean >/dev/null 2>&1
-if autoreconf -i --force ; then ok=1; else exit ; fi
-fi
-
-if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
-sh $X ./configure ${FLAGS}
-for c in $cmds; do
-  ${MAKE} ${FORCE} $c
-done
-exit 0
diff --git a/cf.cmake b/cf.cmake
deleted file mode 100644
index 1267498..0000000
--- a/cf.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-rm -fr build
-mkdir build
-cd build
-UL=/usr/local
-PPATH="$UL"
-HDF5="-DHDF5_LIB=${UL}/lib/libhdf5.so -DHDF5_HL_LIB=${UL}/lib/libhdf5_hl.so -DHDF5_INCLUDE_DIR=${UL}/include"
-FLAGS="-DCMAKE_PREFIX_PATH=$PPATH"
-FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=${UL}"
-FLAGS="$FLAGS -DCMAKE_PREFIX_PATH="$PPATH"
-FLAGS="$FLAGS -DENABLE_DAP_REMOTE_TESTS=true
-FLAGS="$FLAGS -DENABLE_DAP_AUTH_TESTS=true"
-cmake $FLAGS ${HDF5} ..
-cmake --build .
-make test
diff --git a/compile b/compile
index 531136b..a85b723 100755
--- a/compile
+++ b/compile
@@ -3,7 +3,7 @@
 
 scriptversion=2012-10-14.11; # UTC
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey at cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/config.guess b/config.guess
index b79252d..6c32c86 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2014-11-04'
 
 # 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
@@ -24,12 +24,12 @@ timestamp='2013-06-10'
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # 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
 #
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+# Please send patches to <config-patches at gnu.org>.
 
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
 	;;
 esac
 
@@ -579,8 +579,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -826,7 +827,7 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -969,10 +970,10 @@ EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
 	exit ;;
-    or32:Linux:*:*)
+    or32:Linux:*:* | or1k*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
@@ -1260,16 +1261,26 @@ EOF
 	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
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    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
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
 	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
@@ -1361,154 +1372,6 @@ EOF
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/config.h.cmake.in b/config.h.cmake.in
index ec27617..07db7b5 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -88,6 +88,7 @@ are set when opening a binary file on Windows. */
 #cmakedefine USE_FFIO 1
 #cmakedefine USE_PARALLEL_POSIX 1
 #cmakedefine USE_PARALLEL_MPIO 1
+#cmakedefine HDF5_HAS_H5FREE 1
 #cmakedefine USE_PARALLEL 1
 #cmakedefine USE_PNETCDF 1
 #cmakedefine USE_MMAP 1
diff --git a/config.h.in b/config.h.in
index 815186b..8b24c4b 100644
--- a/config.h.in
+++ b/config.h.in
@@ -125,6 +125,9 @@
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
+/* Define to 1 if you have the `H5free_memory' function. */
+#undef HAVE_H5FREE_MEMORY
+
 /* Define to 1 if you have the `H5Pget_fapl_mpio' function. */
 #undef HAVE_H5PGET_FAPL_MPIO
 
@@ -167,7 +170,7 @@
 /* Define to 1 if the system has the type `longlong'. */
 #undef HAVE_LONGLONG
 
-/* Define to 1 if the system has the type 'long long int'. */
+/* Define to 1 if the system has the type `long long int'. */
 #undef HAVE_LONG_LONG_INT
 
 /* Define to 1 if you have the <malloc.h> header file. */
@@ -311,7 +314,7 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to 1 if the system has the type 'unsigned long long int'. */
+/* Define to 1 if the system has the type `unsigned long long int'. */
 #undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define to 1 if you have the `vprintf' function. */
@@ -320,6 +323,10 @@
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
+/* if true, H5free_memory() will be used to free hdf5-allocated memory in
+   nc4file. */
+#undef HDF5_HAS_H5FREE
+
 /* if true, include JNA bug fix */
 #undef JNA
 
@@ -329,8 +336,7 @@
 /* If true, turn on logging. */
 #undef LOGGING
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* max size of the default per-var chunk cache. */
diff --git a/config.sub b/config.sub
index 9633db7..7ffe373 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-08-10'
+timestamp='2014-12-03'
 
 # 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
@@ -25,7 +25,7 @@ timestamp='2013-08-10'
 # of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+# Please send patches to <config-patches at gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -68,7 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -265,6 +265,7 @@ case $basic_machine in
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -282,8 +283,10 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipsr5900 | mipsr5900el \
@@ -295,11 +298,11 @@ case $basic_machine in
 	| nds32 | nds32le | nds32be \
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| 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 \
@@ -310,6 +313,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -324,7 +328,10 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -381,6 +388,7 @@ case $basic_machine in
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -400,8 +408,10 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipsr5900-* | mipsr5900el-* \
@@ -413,6 +423,7 @@ case $basic_machine in
 	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -430,6 +441,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -767,6 +779,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -822,6 +837,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -1367,14 +1386,14 @@ case $os in
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1592,9 +1611,6 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
-	or1k-*)
-		os=-elf
-		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/configure b/configure
index 8d1aef9..0787f3d 100755
--- a/configure
+++ b/configure
@@ -663,6 +663,7 @@ HAS_SZLIB
 HAS_HDF5
 HAS_PNETCDF
 HAS_HDF4
+HAS_SZIP
 HAS_NC4
 HAS_NC2
 HAS_DAP
@@ -722,6 +723,7 @@ DOT
 DOXYGEN
 NC_M4
 CPP
+LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -781,6 +783,15 @@ LDFLAGS
 CFLAGS
 CC
 BUILD_INTERNAL_DOCS
+NC_ENABLE_DOXYGEN_PDF_OUTPUT
+NC_ENABLE_DOXYGEN_PDF_OUTPUT_FALSE
+NC_ENABLE_DOXYGEN_PDF_OUTPUT_TRUE
+SERVER_SIDE_SEARCH
+SERVER_SIDE_SEARCH_FALSE
+SERVER_SIDE_SEARCH_TRUE
+SHOW_DOXYGEN_TAG_LIST
+SHOW_DOXYGEN_TAG_LIST_FALSE
+SHOW_DOXYGEN_TAG_LIST_TRUE
 BUILD_DOCS_FALSE
 BUILD_DOCS_TRUE
 BUILD_DLL_FALSE
@@ -878,6 +889,9 @@ enable_maintainer_mode
 enable_dll
 with_minblocksize
 enable_doxygen
+enable_doxygen_tasks
+enable_doxygen_server_side_search
+enable_doxygen_pdf_output
 enable_dot
 enable_internal_docs
 enable_fsync
@@ -920,6 +934,7 @@ enable_shared
 enable_static
 with_pic
 enable_fast_install
+with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
@@ -935,6 +950,7 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
+LT_SYS_LIBRARY_PATH
 CPP'
 
 
@@ -1562,6 +1578,16 @@ Optional Features:
                           sometimes confusing) to the casual installer
   --enable-dll            build a win32 DLL (only works on mingw)
   --enable-doxygen        Enable generation of documentation.
+  --enable-doxygen-tasks  Enable Doxygen-generated test, todo and bug list
+                          documentation. Developers only.
+  --enable-doxygen-server-side-search
+                          Enable doxygen server-side search. This is of
+                          interest to developers only, or users who will serve
+                          the documentation via a web server instead of
+                          browsing locally.
+  --enable-doxygen-pdf-output
+                          Build netCDF library documentation in PDF format.
+                          Experimental.
   --enable-dot            Use dot (provided by graphviz) to generate charts
                           and graphs in the doxygen-based documentation.
   --enable-internal-docs  Include documentation of library internals. This is
@@ -1669,9 +1695,12 @@ Optional Packages:
                           --enable-large-file-tests
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
 
 Some influential environment variables:
   CC          C compiler command
@@ -1681,6 +1710,8 @@ Some influential environment variables:
   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>
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   CPP         C preprocessor
 
 Use these variables to override the choices made by `configure' or to help
@@ -2981,7 +3012,7 @@ ac_config_headers="$ac_config_headers config.h"
 
 
 # This call is required by automake.
-am__api_version='1.14'
+am__api_version='1.15'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3153,8 +3184,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -3173,7 +3204,7 @@ else
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3501,8 +3532,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -3560,6 +3591,7 @@ END
   fi
 fi
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
     # Check whether --enable-maintainer-mode was given.
@@ -3637,6 +3669,9 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+###
+# Doxygen and doxygen-related options.
+###
 # Check whether --enable-doxygen was given.
 if test "${enable_doxygen+set}" = set; then :
   enableval=$enable_doxygen;
@@ -3652,6 +3687,56 @@ else
 fi
 
 
+# Check whether --enable-doxygen-tasks was given.
+if test "${enable_doxygen_tasks+set}" = set; then :
+  enableval=$enable_doxygen_tasks;
+fi
+
+test "x$enable_doxygen_tasks" = xyes || enable_doxygen_tasks=no
+ if test "x$enable_doxygen_tasks" = xyes; then
+  SHOW_DOXYGEN_TAG_LIST_TRUE=
+  SHOW_DOXYGEN_TAG_LIST_FALSE='#'
+else
+  SHOW_DOXYGEN_TAG_LIST_TRUE='#'
+  SHOW_DOXYGEN_TAG_LIST_FALSE=
+fi
+
+SHOW_DOXYGEN_TAG_LIST=$enable_doxygen_tasks
+
+
+# Check whether --enable-doxygen-server-side-search was given.
+if test "${enable_doxygen_server_side_search+set}" = set; then :
+  enableval=$enable_doxygen_server_side_search;
+fi
+
+test "x$enable_doxygen_server_side_search" = xyes || enable_doxygen_server_side_search=no
+ if test "x$enable_doxygen_server_side_search" = xyes; then
+  SERVER_SIDE_SEARCH_TRUE=
+  SERVER_SIDE_SEARCH_FALSE='#'
+else
+  SERVER_SIDE_SEARCH_TRUE='#'
+  SERVER_SIDE_SEARCH_FALSE=
+fi
+
+SERVER_SIDE_SEARCH=$enable_doxygen_server_side_search
+
+
+# Check whether --enable-doxygen-pdf-output was given.
+if test "${enable_doxygen_pdf_output+set}" = set; then :
+  enableval=$enable_doxygen_pdf_output;
+fi
+
+                if test "x$enable_doxygen_pdf_output" = xyes; then
+  NC_ENABLE_DOXYGEN_PDF_OUTPUT_TRUE=
+  NC_ENABLE_DOXYGEN_PDF_OUTPUT_FALSE='#'
+else
+  NC_ENABLE_DOXYGEN_PDF_OUTPUT_TRUE='#'
+  NC_ENABLE_DOXYGEN_PDF_OUTPUT_FALSE=
+fi
+
+NC_ENABLE_DOXYGEN_PDF_OUTPUT=$enable_doxygen_pdf_output
+
+
 # Check whether --enable-dot was given.
 if test "${enable_dot+set}" = set; then :
   enableval=$enable_dot;
@@ -5451,8 +5536,8 @@ $as_echo "#define LARGE_FILE_TESTS 1" >>confdefs.h
 fi
 
 # Does the user want to run benchmarks?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether benchmaks should be run (experimental)" >&5
-$as_echo_n "checking whether benchmaks should be run (experimental)... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether benchmarks should be run (experimental)" >&5
+$as_echo_n "checking whether benchmarks should be run (experimental)... " >&6; }
 # Check whether --enable-benchmarks was given.
 if test "${enable_benchmarks+set}" = set; then :
   enableval=$enable_benchmarks;
@@ -6516,8 +6601,8 @@ esac
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
 
 
@@ -6531,7 +6616,7 @@ macro_revision='1.3337'
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
@@ -6580,7 +6665,7 @@ func_echo_all ()
     $ECHO ""
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -6903,19 +6988,19 @@ test -z "$GREP" && GREP=grep
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -6929,7 +7014,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -6940,7 +7025,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -6951,32 +7036,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -7019,33 +7104,38 @@ if ${lt_cv_path_NM+:} false; then :
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -7056,15 +7146,15 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -7170,9 +7260,9 @@ esac
   fi
 fi
 
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -7180,8 +7270,8 @@ fi
     esac
   fi
 
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -7232,7 +7322,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -7272,7 +7362,7 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -7323,22 +7413,22 @@ else
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -7356,7 +7446,7 @@ else
 
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -7374,30 +7464,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -7520,13 +7586,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -7651,13 +7717,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -7684,8 +7750,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -7763,7 +7828,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -7781,8 +7846,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -7835,6 +7900,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 
 fi
@@ -7989,8 +8057,8 @@ else
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -8002,7 +8070,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 
@@ -8156,7 +8224,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -8164,7 +8232,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -8177,7 +8245,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -8394,7 +8462,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -8484,7 +8552,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -8517,14 +8585,44 @@ case `$NM -V 2>&1` in
   symcode='[ABCDGIRSTW]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -8542,21 +8640,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -8604,11 +8705,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -8634,7 +8735,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -8654,13 +8755,13 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -8681,7 +8782,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -8734,6 +8835,16 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
 $as_echo_n "checking for sysroot... " >&6; }
 
@@ -8746,9 +8857,9 @@ fi
 
 
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -8758,8 +8869,8 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -8771,18 +8882,99 @@ $as_echo "${lt_sysroot:-no}" >&6; }
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -8791,24 +8983,25 @@ ia64-*-hpux*)
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -8837,9 +9030,50 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -8862,10 +9096,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -8884,10 +9118,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -8905,7 +9139,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -8945,13 +9179,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -8963,7 +9198,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -8972,7 +9207,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -8988,7 +9223,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -9099,7 +9334,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 
@@ -9602,7 +9837,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -9620,7 +9855,7 @@ else
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -9659,7 +9894,7 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -9688,7 +9923,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -9701,32 +9936,32 @@ fi
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[012][,.]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -9734,6 +9969,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     ;;
   esac
 
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10335,14 +10605,14 @@ if test "${enable_shared+set}" = set; then :
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10366,14 +10636,14 @@ if test "${enable_static+set}" = set; then :
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10397,14 +10667,14 @@ if test "${with_pic+set}" = set; then :
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10412,8 +10682,6 @@ else
 fi
 
 
-test -z "$pic_mode" && pic_mode=default
-
 
 
 
@@ -10429,14 +10697,14 @@ if test "${enable_fast_install+set}" = set; then :
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10450,11 +10718,63 @@ fi
 
 
 
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
 
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -10503,7 +10823,7 @@ test -z "$LN_S" && LN_S="ln -s"
 
 
 
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -10542,7 +10862,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -10553,14 +10873,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -10569,15 +10889,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
 # Only perform the check for file, if the check method requires it
@@ -10592,22 +10905,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -10630,13 +10943,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -10658,22 +10971,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -10696,13 +11009,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -10723,7 +11036,7 @@ esac
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC="$CC"
+lt_save_CC=$CC
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10785,7 +11098,7 @@ if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -10801,7 +11114,7 @@ else
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -10831,7 +11144,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -10849,17 +11162,18 @@ lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
 
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -10870,8 +11184,8 @@ lt_prog_compiler_static=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -10887,6 +11201,11 @@ lt_prog_compiler_static=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -10957,7 +11276,7 @@ lt_prog_compiler_static=
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -10965,10 +11284,29 @@ lt_prog_compiler_static=
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -10984,7 +11322,7 @@ lt_prog_compiler_static=
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      lt_prog_compiler_static='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -10995,7 +11333,7 @@ lt_prog_compiler_static=
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -11020,6 +11358,12 @@ lt_prog_compiler_static=
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -11117,7 +11461,7 @@ lt_prog_compiler_static=
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -11146,7 +11490,7 @@ lt_prog_compiler_static=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -11178,7 +11522,7 @@ else
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -11208,7 +11552,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -11240,7 +11584,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -11259,13 +11603,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
     :
 else
     lt_prog_compiler_static=
@@ -11385,8 +11729,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -11398,9 +11742,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -11443,9 +11787,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -11460,7 +11804,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -11468,12 +11812,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    link_all_deplibs=no
-    ;;
   esac
 
   ld_shlibs=yes
@@ -11481,7 +11822,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -11503,24 +11844,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -11533,7 +11874,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -11552,7 +11893,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -11568,7 +11909,7 @@ _LT_EOF
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -11578,7 +11919,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -11586,61 +11927,89 @@ _LT_EOF
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -11651,42 +12020,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -11695,13 +12069,13 @@ _LT_EOF
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -11719,8 +12093,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -11732,7 +12106,7 @@ _LT_EOF
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -11747,9 +12121,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -11766,15 +12140,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
+    if test no = "$ld_shlibs"; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -11790,7 +12164,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -11798,34 +12172,57 @@ _LT_EOF
       ;;
 
     aix[4-9]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -11844,13 +12241,21 @@ _LT_EOF
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct=no
+	hardcode_direct_absolute=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -11869,36 +12274,42 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	link_all_deplibs=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      export_dynamic_flag_spec='${wl}-bexpall'
+      export_dynamic_flag_spec='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
+        if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -11933,7 +12344,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -11941,17 +12352,17 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
+	 if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -11986,7 +12397,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -11994,21 +12405,33 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) >  [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -12017,7 +12440,7 @@ fi
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -12047,16 +12470,17 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -12065,18 +12489,18 @@ fi
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -12085,7 +12509,7 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -12104,24 +12528,24 @@ fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
+  allow_undefined_flag=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
 
   else
   ld_shlibs=no
@@ -12163,33 +12587,33 @@ fi
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
+      export_dynamic_flag_spec='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
+	export_dynamic_flag_spec='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -12197,25 +12621,25 @@ fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -12227,7 +12651,7 @@ if ${lt_cv_prog_compiler__b+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -12246,14 +12670,14 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -12261,8 +12685,8 @@ fi
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -12273,7 +12697,7 @@ fi
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
+	  export_dynamic_flag_spec='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -12284,8 +12708,8 @@ fi
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -12295,8 +12719,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -12308,25 +12732,35 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
+           LDFLAGS=$save_LDFLAGS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs=yes
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -12340,7 +12774,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -12348,27 +12782,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
 	fi
       else
 	ld_shlibs=no
@@ -12379,33 +12805,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -12416,24 +12862,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -12443,11 +12889,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -12457,10 +12903,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -12509,43 +12955,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
+      no_undefined_flag='$wl-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
+      export_dynamic_flag_spec='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -12560,10 +13006,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	export_dynamic_flag_spec='$wl-Blargedynsym'
 	;;
       esac
     fi
@@ -12571,7 +13017,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -12597,7 +13043,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -12812,14 +13258,14 @@ esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -12835,28 +13281,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -12870,7 +13323,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -12879,7 +13332,7 @@ fi
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -12896,14 +13349,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -12911,41 +13366,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -12955,18 +13460,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -12974,8 +13479,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -12987,7 +13492,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -12996,8 +13501,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -13013,17 +13518,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -13032,8 +13537,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -13060,7 +13565,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -13073,8 +13578,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -13087,7 +13592,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -13100,8 +13605,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -13114,8 +13619,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -13133,12 +13638,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -13168,10 +13674,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -13189,14 +13695,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -13204,8 +13711,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -13214,8 +13721,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -13228,8 +13735,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -13240,7 +13747,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -13248,8 +13755,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -13268,8 +13775,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -13278,13 +13785,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -13328,7 +13855,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -13343,29 +13875,17 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -13375,7 +13895,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -13384,58 +13904,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -13446,8 +13976,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -13457,11 +13987,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -13469,8 +13999,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -13491,24 +14021,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -13526,7 +14056,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -13534,8 +14064,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -13545,20 +14075,35 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
 
 
 
@@ -13655,15 +14200,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" ||
    test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
+   test yes = "$hardcode_automatic"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
+  if test no != "$hardcode_direct" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -13678,12 +14223,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -13693,7 +14238,7 @@ fi
 
 
 
-  if test "x$enable_dlopen" != xyes; then
+  if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -13703,23 +14248,23 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -13757,10 +14302,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
 
-    lt_cv_dlopen="dyld"
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -13768,10 +14313,18 @@ fi
 
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+  lt_cv_dlopen=shl_load
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -13810,11 +14363,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen=dlopen
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -13853,7 +14406,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -13892,7 +14445,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -13931,7 +14484,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
 fi
 
 
@@ -13952,21 +14505,21 @@ fi
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -13974,7 +14527,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -14021,9 +14574,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -14053,7 +14606,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -14073,14 +14626,14 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -14127,9 +14680,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -14159,7 +14712,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -14180,9 +14733,9 @@ fi
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -14226,7 +14779,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -14254,7 +14807,7 @@ fi
 
 
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -14262,13 +14815,13 @@ $as_echo "$can_build_shared" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -14276,8 +14829,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
     ;;
 
   aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -14287,7 +14844,7 @@ $as_echo "$enable_shared" >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -14301,7 +14858,7 @@ 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
 
-CC="$lt_save_CC"
+CC=$lt_save_CC
 
 
 
@@ -14528,7 +15085,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14574,7 +15131,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14598,7 +15155,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14643,7 +15200,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14667,7 +15224,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -16862,7 +17419,7 @@ fi
 
 done
 
-   for ac_func in H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP
+   for ac_func in H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16975,6 +17532,14 @@ $as_echo "#define USE_SZIP 1" >>confdefs.h
 
    fi
 
+   if test "x$ac_cv_func_H5free_memory" = xyes; then
+
+$as_echo "#define HDF5_HAS_H5FREE 1" >>confdefs.h
+
+   fi
+
+
+
    # If the user wants hdf4 built in, check it out.
    if test "x$enable_hdf4" = xyes; then
       for ac_header in mfhdf.h
@@ -17443,6 +18008,30 @@ else
   BUILD_MMAP_FALSE=
 fi
 
+ if test x$enable_doxygen = xyes; then
+  BUILD_DOCS_TRUE=
+  BUILD_DOCS_FALSE='#'
+else
+  BUILD_DOCS_TRUE='#'
+  BUILD_DOCS_FALSE=
+fi
+
+ if test x$enable_doxygen_tasks = xyes; then
+  SHOW_DOXYGEN_TAG_LIST_TRUE=
+  SHOW_DOXYGEN_TAG_LIST_FALSE='#'
+else
+  SHOW_DOXYGEN_TAG_LIST_TRUE='#'
+  SHOW_DOXYGEN_TAG_LIST_FALSE=
+fi
+
+ if test x$enable_doxygen_server_side_search = xyes; then
+  SERVER_SIDE_SEARCH_TRUE=
+  SERVER_SIDE_SEARCH_FALSE='#'
+else
+  SERVER_SIDE_SEARCH_TRUE='#'
+  SERVER_SIDE_SEARCH_FALSE=
+fi
+
 
 # If the machine doesn't have a long long, and we want netCDF-4, then
 # we've got problems!
@@ -17459,18 +18048,18 @@ else
 /* end confdefs.h.  */
 
   /* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
+	 implementations with broken preprocessors.  Perhaps this can
+	 be revisited in 2012.  In the meantime, code should not expect
+	 #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       int i = 63;
 int
 main ()
@@ -17479,9 +18068,9 @@ main ()
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
+	      | (llmax / ll) | (llmax % ll)
+	      | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+	      | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
@@ -17513,33 +18102,33 @@ if ${ac_cv_type_long_long_int+:} false; then :
 else
   ac_cv_type_long_long_int=yes
       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
-        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
-        if test $ac_cv_type_long_long_int = yes; then
-                                        if test "$cross_compiling" = yes; then :
+	ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+	if test $ac_cv_type_long_long_int = yes; then
+	  	  	  	  if test "$cross_compiling" = yes; then :
   :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <limits.h>
-                 #ifndef LLONG_MAX
-                 # define HALF \
-                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-                 # define LLONG_MAX (HALF - 1 + HALF)
-                 #endif
+		 #ifndef LLONG_MAX
+		 # define HALF \
+			  (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+		 # define LLONG_MAX (HALF - 1 + HALF)
+		 #endif
 int
 main ()
 {
 long long int n = 1;
-                 int i;
-                 for (i = 0; ; i++)
-                   {
-                     long long int m = n << i;
-                     if (m >> i != n)
-                       return 1;
-                     if (LLONG_MAX / 2 < m)
-                       break;
-                   }
-                 return 0;
+		 int i;
+		 for (i = 0; ; i++)
+		   {
+		     long long int m = n << i;
+		     if (m >> i != n)
+		       return 1;
+		     if (LLONG_MAX / 2 < m)
+		       break;
+		   }
+		 return 0;
   ;
   return 0;
 }
@@ -17553,7 +18142,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-        fi
+	fi
       fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
@@ -17576,18 +18165,18 @@ else
 /* end confdefs.h.  */
 
   /* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
+	 implementations with broken preprocessors.  Perhaps this can
+	 be revisited in 2012.  In the meantime, code should not expect
+	 #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       int i = 63;
 int
 main ()
@@ -17596,9 +18185,9 @@ main ()
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
+	      | (llmax / ll) | (llmax % ll)
+	      | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+	      | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
@@ -17704,6 +18293,8 @@ HAS_NC2=$nc_build_v2
 
 HAS_NC4=$enable_netcdf_4
 
+HAS_SZIP=$ac_cv_func_H5Z_SZIP
+
 HAS_HDF4=$enable_hdf4
 
 HAS_PNETCDF=$enable_pnetcdf
@@ -17983,6 +18574,18 @@ if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_DOCS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${SHOW_DOXYGEN_TAG_LIST_TRUE}" && test -z "${SHOW_DOXYGEN_TAG_LIST_FALSE}"; then
+  as_fn_error $? "conditional \"SHOW_DOXYGEN_TAG_LIST\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SERVER_SIDE_SEARCH_TRUE}" && test -z "${SERVER_SIDE_SEARCH_FALSE}"; then
+  as_fn_error $? "conditional \"SERVER_SIDE_SEARCH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NC_ENABLE_DOXYGEN_PDF_OUTPUT_TRUE}" && test -z "${NC_ENABLE_DOXYGEN_PDF_OUTPUT_FALSE}"; then
+  as_fn_error $? "conditional \"NC_ENABLE_DOXYGEN_PDF_OUTPUT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 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
@@ -18128,6 +18731,18 @@ if test -z "${BUILD_MMAP_TRUE}" && test -z "${BUILD_MMAP_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_MMAP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_DOCS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SHOW_DOXYGEN_TAG_LIST_TRUE}" && test -z "${SHOW_DOXYGEN_TAG_LIST_FALSE}"; then
+  as_fn_error $? "conditional \"SHOW_DOXYGEN_TAG_LIST\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SERVER_SIDE_SEARCH_TRUE}" && test -z "${SERVER_SIDE_SEARCH_FALSE}"; then
+  as_fn_error $? "conditional \"SERVER_SIDE_SEARCH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -18729,6 +19344,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -18776,10 +19392,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -18844,7 +19463,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -18896,9 +19516,12 @@ CFLAGS \
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
 nm_file_list_spec \
+lt_cv_truncate_bin \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
 lt_prog_compiler_wl \
@@ -18933,7 +19556,7 @@ old_striplib \
 striplib; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -18960,10 +19583,11 @@ postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -18972,19 +19596,16 @@ sys_lib_dlsearch_path_spec; do
 done
 
 ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
@@ -19727,55 +20348,53 @@ $as_echo X"$file" |
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 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.
+
+# GNU Libtool 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 of the License, or
+# (at your option) any later version.
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing 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/>.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -19804,6 +20423,9 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
 # Shell to use when invoking shell scripts.
 SHELL=$lt_SHELL
 
@@ -19915,18 +20537,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
 # The name of the directory that contains temporary libtool files.
 objdir=$objdir
 
@@ -20017,8 +20648,11 @@ hardcode_into_libs=$hardcode_into_libs
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -20111,13 +20745,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -20169,13 +20803,72 @@ hardcode_action=$hardcode_action
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -20184,7 +20877,7 @@ _LT_EOF
   esac
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -20194,165 +20887,6 @@ ltmain="$ac_aux_dir/ltmain.sh"
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
diff --git a/configure.ac b/configure.ac
index 4507ae6..ac3fa14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,12 +80,35 @@ AC_ARG_WITH([minblocksize],
 AC_MSG_RESULT([$NCIO_MINBLOCKSIZE])
 AC_DEFINE_UNQUOTED([NCIO_MINBLOCKSIZE], [$NCIO_MINBLOCKSIZE], [min blocksize for posixio.])
 
+###
+# Doxygen and doxygen-related options.
+###
 AC_ARG_ENABLE([doxygen],
   [AS_HELP_STRING([--enable-doxygen],
     [Enable generation of documentation.])])
 test "x$enable_doxygen" = xyes || enable_doxygen=no
 AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" = xyes])
 
+AC_ARG_ENABLE([doxygen-tasks],
+    [AS_HELP_STRING([--enable-doxygen-tasks],
+        [Enable Doxygen-generated test, todo and bug list documentation. Developers only.])])
+test "x$enable_doxygen_tasks" = xyes || enable_doxygen_tasks=no
+AM_CONDITIONAL([SHOW_DOXYGEN_TAG_LIST], [test "x$enable_doxygen_tasks" = xyes])
+AC_SUBST([SHOW_DOXYGEN_TAG_LIST], [$enable_doxygen_tasks])
+
+AC_ARG_ENABLE([doxygen-server-side-search],
+    [AS_HELP_STRING([--enable-doxygen-server-side-search],
+        [Enable doxygen server-side search. This is of interest to developers only, or users who will serve the documentation via a web server instead of browsing locally.])])
+test "x$enable_doxygen_server_side_search" = xyes || enable_doxygen_server_side_search=no
+AM_CONDITIONAL([SERVER_SIDE_SEARCH], [test "x$enable_doxygen_server_side_search" = xyes])
+AC_SUBST([SERVER_SIDE_SEARCH], [$enable_doxygen_server_side_search])
+
+AC_ARG_ENABLE([doxygen-pdf-output],
+    [AS_HELP_STRING([--enable-doxygen-pdf-output],
+        [Build netCDF library documentation in PDF format. Experimental.])])
+               AM_CONDITIONAL([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [test "x$enable_doxygen_pdf_output" = xyes])
+AC_SUBST([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [$enable_doxygen_pdf_output])
+
 AC_ARG_ENABLE([dot],
 	[AS_HELP_STRING([--enable-dot],
 	[Use dot (provided by graphviz) to generate charts and graphs in the doxygen-based documentation.])])
@@ -503,7 +526,7 @@ if test "x$enable_large_file_tests" = xyes; then
 fi
 
 # Does the user want to run benchmarks?
-AC_MSG_CHECKING([whether benchmaks should be run (experimental)])
+AC_MSG_CHECKING([whether benchmarks should be run (experimental)])
 AC_ARG_ENABLE([benchmarks],
               [AS_HELP_STRING([--enable-benchmarks],
                               [Run benchmarks. This is an experimental feature. You must fetch
@@ -840,7 +863,7 @@ if test "x$enable_netcdf_4" = xyes; then
    [AC_MSG_ERROR([Can't find or link to the hdf5 high-level. Use --disable-netcdf-4, or see config.log for errors.])])
 
    AC_CHECK_HEADERS([hdf5.h], [], [AC_MSG_ERROR([Compiling a test with HDF5 failed.  Either hdf5.h cannot be found, or config.log should be checked for other reason.])])
-   AC_CHECK_FUNCS([H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP])
+   AC_CHECK_FUNCS([H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory])
 
    # The user may have parallel HDF5 based on MPI POSIX.
    if test "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
@@ -875,6 +898,12 @@ if test "x$enable_netcdf_4" = xyes; then
   	AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables])
    fi
 
+   if test "x$ac_cv_func_H5free_memory" = xyes; then
+      AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
+   fi
+
+
+
    # If the user wants hdf4 built in, check it out.
    if test "x$enable_hdf4" = xyes; then
       AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
@@ -969,6 +998,9 @@ AM_CONDITIONAL(BUILD_CDMREMOTE, [test "x$enable_cdmremote" = xyes]) # Alias
 AM_CONDITIONAL(BUILD_RPC, [test "x$enable_rpc" = xyes])
 AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
 AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
+AM_CONDITIONAL(BUILD_DOCS, [test x$enable_doxygen = xyes])
+AM_CONDITIONAL(SHOW_DOXYGEN_TAG_LIST, [test x$enable_doxygen_tasks = xyes])
+AM_CONDITIONAL(SERVER_SIDE_SEARCH, [test x$enable_doxygen_server_side_search = xyes])
 
 # If the machine doesn't have a long long, and we want netCDF-4, then
 # we've got problems!
@@ -1047,6 +1079,7 @@ AC_SUBST(NC_LIBS,[$NC_LIBS])
 AC_SUBST(HAS_DAP,[$enable_dap])
 AC_SUBST(HAS_NC2,[$nc_build_v2])
 AC_SUBST(HAS_NC4,[$enable_netcdf_4])
+AC_SUBST(HAS_SZIP,[$ac_cv_func_H5Z_SZIP])
 AC_SUBST(HAS_HDF4,[$enable_hdf4])
 AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
 AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
diff --git a/depcomp b/depcomp
index 4ebd5b3..fc98710 100755
--- a/depcomp
+++ b/depcomp
@@ -3,7 +3,7 @@
 
 scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 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
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 0000000..e5b3c00
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1 @@
+auth.md
\ No newline at end of file
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 20125e6..93a754f 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -16,6 +16,15 @@ IF(ENABLE_DOXYGEN)
   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
     ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
 
+
+  # Create auth.md by combining auth.md.in and oc2/ocauth.md
+
+  ADD_CUSTOM_TARGET(auth_doc ALL
+    cat ${CMAKE_SOURCE_DIR}/docs/auth.md.in ${CMAKE_SOURCE_DIR}/docs/ocauth.md > ${CMAKE_CURRENT_SOURCE_DIR}/auth.md
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    VERBATIM
+    )
+
   # Generate User Documentation
   ADD_CUSTOM_TARGET(doc_all ALL
     ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@@ -38,21 +47,6 @@ IF(ENABLE_DOXYGEN)
         COMMENT "Building NetCDF PDF Documentation" VERBATIM
         )
 
-      # Process 'guide' netcdf documentation.
-      ADD_CUSTOM_TARGET(doc_guide_pdf ALL
-        make
-        COMMAND mv refman.pdf ../netcdf-guide.pdf
-        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex_guide"
-        COMMENT "Building NetCDF-Guide PDF Documentation" VERBATIM
-        )
-
-      # Process 'tutorial' netcdf documentation.
-      ADD_CUSTOM_TARGET(doc_tutorial_pdf ALL
-        make
-        COMMAND mv refman.pdf ../netcdf-tutorial.pdf
-        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex_tutorial"
-        COMMENT "Building NetCDF-Tutorial PDF Documentation" VERBATIM
-        )
       INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/netcdf.pdf"
 	"${CMAKE_CURRENT_BINARY_DIR}/netcdf-guide.pdf"
 	"${CMAKE_CURRENT_BINARY_DIR}/netcdf-tutorial.pdf"
@@ -77,6 +71,6 @@ IF(ENABLE_DOXYGEN)
 
 ENDIF(ENABLE_DOXYGEN)
 
-SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am netcdf.m4 DoxygenLayout.xml Doxyfile.in Doxyfile.guide.in footer.html mainpage.dox tutorial.dox install.dox dispatch.dox guide.dox types.dox notes.dox cdl.dox architecture.dox internal.dox install-fortran.dox Doxyfile.in.cmake windows-binaries.md building-with-cmake.md)
+SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am netcdf.m4 DoxygenLayout.xml Doxyfile.in Doxyfile.guide.in footer.html mainpage.dox tutorial.dox dispatch.dox guide.dox types.dox notes.md cdl.dox architecture.dox internal.dox install-fortran.dox Doxyfile.in.cmake windows-binaries.md building-with-cmake.md install.md)
 
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
index d8d5e89..cd7b596 100644
--- a/docs/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -746,22 +746,27 @@ WARN_LOGFILE           =
 INPUT = \
     @abs_top_srcdir@/docs/mainpage.dox \
     @abs_top_srcdir@/RELEASE_NOTES.md \
-    @abs_top_srcdir@/docs/architecture.dox \
     @abs_top_srcdir@/docs/install.md \
     @abs_top_srcdir@/docs/install-fortran.md \
     @abs_top_srcdir@/docs/dispatch.dox \
     @abs_top_srcdir@/docs/types.dox \
-    @abs_top_srcdir@/docs/notes.dox \
     @abs_top_srcdir@/docs/internal.dox \
     @abs_top_srcdir@/docs/windows-binaries.md \
-    @abs_top_srcdir@/docs/all-error-codes.md \
     @abs_top_srcdir@/docs/guide.dox \
+    @abs_top_srcdir@/docs/OPeNDAP.dox \
+    @abs_top_srcdir@/docs/auth.md \
+    @abs_top_srcdir@/docs/attribute_conventions.md \
+    @abs_top_srcdir@/docs/file_format_specifications.md \
     @abs_top_srcdir@/docs/tutorial.dox \
+    @abs_top_srcdir@/docs/notes.md \
+    @abs_top_srcdir@/docs/all-error-codes.md \
     @abs_top_srcdir@/docs/FAQ.md \
+    @abs_top_srcdir@/docs/software.md \
     @abs_top_srcdir@/docs/COPYRIGHT.dox \
     @abs_top_srcdir@/docs/credits.md \
     @abs_top_srcdir@/include/netcdf.h \
     @abs_top_srcdir@/include/netcdf_meta.h \
+    @abs_top_srcdir@/include/netcdf_mem.h \
     @abs_top_srcdir@/libdispatch/dfile.c \
     @abs_top_srcdir@/libdispatch/ddim.c \
     @abs_top_srcdir@/libdispatch/dvar.c \
diff --git a/docs/FAQ.md b/docs/FAQ.md
index b619ba8..cddbf5c 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -236,14 +236,16 @@ have used netCDF is available from
 What are some references to netCDF? {#What-are-some-references-to-netCDF}
 -----------------
 
-
 A primary reference is the User's Guide:
 
 Rew, R. K., G. P. Davis, S. Emmerson, and H. Davies, **NetCDF User's
 Guide for C, An Interface for Data Access, Version 3**, April 1997.
 
+To cite use of netCDF software, please use this Digital Object Identifier (DOI):
+[http://dx.doi.org/10.5065/D6H70CW6](http://dx.doi.org/10.5065/D6H70CW6)
+
 Current online and downloadable documentation is available from the
-[documentation directory](http://www.unidata.ucar.edu/software/netcdf/docs/index.html).
+[documentation directory](http://www.unidata.ucar.edu/netcdf/docs/).
 
 Other references include:
 
@@ -463,23 +465,14 @@ The SDS ([Scientific DataSet](http://research.microsoft.com/en-us/projects/sds/)
 
 ----------
 
-How do I build netCDF for use with Fortran compiler *xxx* and C compiler *yyy* on platform *zzz*? {#How-do-I-build-netCDF-for-use-with-Fortran-compiler}
+How do I build and install netCDF for a specific development environment? {#How-do-I-build-and-install-netCDF-for-a-specific-development-environment}
 -----------------
 
+You have to build and install the netCDF C library first, before you build and install other language libraries that depend on it, such as Fortran, C++, or Python netCDF libraries. The netCDF Java library is mostly independent of the netCDF C library, unless you need to write netCDF-4 files from Java, in which case you will also need an installed netCDF C library.
 
+For more details, see
+[Getting and Building netCDF](http://www.unidata.ucar.edu/netcdf/docs/getting_and_building_netcdf.html).
 
-If you have an unusual combination of compilers or platform, you may
-have to set a few environment variables before invoking
-
-~~~~ {.boldcode}
-  ./configure
-  make test
-  make install
-~~~~
-
-For details, see the [NetCDF Installation and Porting Guide](http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/index.html).
-
-You should also check reports we maintain of successful [builds in other environments](other-builds.html). If you have success with a combination useful to others, please send it for addition to the list.
 
 ----------
 
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 1eaf629..a800036 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -5,12 +5,13 @@
 
 # These files will be included with the dist.
 EXTRA_DIST = netcdf.m4 DoxygenLayout.xml Doxyfile.in footer.html \
-    mainpage.dox tutorial.dox install.dox dispatch.dox \
-    guide.dox types.dox notes.dox cdl.dox \
+    mainpage.dox tutorial.dox dispatch.dox \
+    guide.dox types.dox cdl.dox \
     architecture.dox internal.dox windows-binaries.md \
     building-with-cmake.md CMakeLists.txt \
-    groups.dox install.md install-fortran.md \
-    all-error-codes.md cmake_faq.md credits.md
+    groups.dox install.md notes.md install-fortran.md \
+    all-error-codes.md cmake_faq.md credits.md auth.md.in auth.md \
+	software.md ocauth.md
 
 # Turn off parallel builds in this directory.
 .NOTPARALLEL:
@@ -50,10 +51,12 @@ endif
 
 doxyfile.stamp:
 	$(DOXYGEN) Doxyfile
-	echo Timestamp > doxyfile.stamp
 
 CLEANFILES = doxyfile.stamp html latex man
 
+auth.md: auth.md.in ocauth.md
+	cat auth.md.in ocauth.md > auth.md
+
 # This builds the docs from source, if necessary, and tars up
 # everything needed for the website. Run this and copy the resulting
 # tarball to the /contents/netcdf/docs directory to update the on-line
diff --git a/docs/Makefile.in b/docs/Makefile.in
index 1aa8a66..a6f15aa 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,17 @@
 # Copyright 2005-2011, see the COPYRIGHT file for more information.
 # This file builds the netcdf documentation.
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -82,8 +92,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = docs
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(srcdir)/Doxyfile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -91,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = Doxyfile
@@ -150,6 +159,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -223,6 +233,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -238,10 +249,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -276,8 +289,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -341,12 +356,13 @@ top_srcdir = @top_srcdir@
 
 # These files will be included with the dist.
 EXTRA_DIST = netcdf.m4 DoxygenLayout.xml Doxyfile.in footer.html \
-    mainpage.dox tutorial.dox install.dox dispatch.dox \
-    guide.dox types.dox notes.dox cdl.dox \
+    mainpage.dox tutorial.dox dispatch.dox \
+    guide.dox types.dox cdl.dox \
     architecture.dox internal.dox windows-binaries.md \
     building-with-cmake.md CMakeLists.txt \
-    groups.dox install.md install-fortran.md \
-    all-error-codes.md cmake_faq.md credits.md
+    groups.dox install.md notes.md install-fortran.md \
+    all-error-codes.md cmake_faq.md credits.md auth.md.in auth.md \
+	software.md ocauth.md
 
 
 # To build documentation you must have M4 in their path.
@@ -368,7 +384,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign docs/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -669,6 +684,8 @@ uninstall-am:
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
 	uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Turn off parallel builds in this directory.
 .NOTPARALLEL:
@@ -700,7 +717,9 @@ uninstall-am:
 
 doxyfile.stamp:
 	$(DOXYGEN) Doxyfile
-	echo Timestamp > doxyfile.stamp
+
+auth.md: auth.md.in ocauth.md
+	cat auth.md.in ocauth.md > auth.md
 
 # This builds the docs from source, if necessary, and tars up
 # everything needed for the website. Run this and copy the resulting
diff --git a/docs/OPeNDAP.dox b/docs/OPeNDAP.dox
new file mode 100644
index 0000000..deee826
--- /dev/null
+++ b/docs/OPeNDAP.dox
@@ -0,0 +1,692 @@
+/*! \page dap_support DAP Support
+
+\tableofcontents
+
+\section dap_introduction OPeNDAP Introduction
+
+Beginning with netCDF version 4.1, optional support is provided for
+accessing data through OPeNDAP servers using the DAP protocol.
+Currently, only DAP protocol version 2 is supported; DAP protocol
+version 4 support is under development.
+
+DAP support is automatically enabled if a usable curl library can be
+set using the LDFLAGS environment variable (similar to the way
+that the HDF5 libraries are referenced).
+DAP support can forcibly be enabled or disabled using the --enable-dap
+flag or the --disable-dap flag, respectively.  If enabled,
+then DAP2 support requires access to the curl library.
+Refer to the installation manual for details
+
+DAP uses a data model that is different from that supported by netCDF,
+either classic or enhanced. Generically, the DAP data model is encoded
+textually in a DDS (Dataset Descriptor Structure). There is a second
+data model for DAP attributes, which is encoded textually in a DAS
+(Dataset Attribute Structure). For detailed information about the DAP
+DDS and DAS, refer to the OPeNDAP web site http://opendap.org.
+
+\subsection dap_dap_information OPeNDAP Documentation
+
+See the following pages for more information.
+
+- \subpage dap_accessing_data
+- \subpage oc_auth
+- \subpage dap_to_netcdf
+- \subpage var_dim_trans
+- \subpage var_name_trans
+
+\page dap_accessing_data Accessing OPeNDAP Data
+
+\tableofcontents
+
+In order to access an OPeNDAP data source through the netCDF API, the
+file name normally used is replaced with a URL with a specific
+format. The URL is composed of three parts.
+ -  URL - this is a standard form URL such as
+    http://remotetest.unidata.ucar.edu/dts/test.01
+
+ -  Constraints - these are suffixed to the URL and take the form
+    “?\<projections>&\<selections>”. The meaning of the terms projection
+    and selection is somewhat complicated; and the OPeNDAP web site,
+    http://www.opendap.org, should be consulted. The interaction of DAP
+    constraints with netCDF is complex and at the moment requires an
+    understanding of how DAP is translated to netCDF.
+
+ - Client parameters - these may be specified in either of
+   two ways.  The older, deprecated form prefixes text to the
+   front of the url and is of the the general form [\<name>]
+   or [\<name>=value].  Examples include [show=fetch] and
+   [noprefetch].  The newer, preferred form prefixes the
+   parameters to the end of the url using the semi-standard '#'
+   format: e.g. http://....#show=fetch&noprefetch.
+
+It is possible to see what the translation does to a particular DAP
+data source in either of two ways. First, one can examine the DDS
+source through a web browser and then examine the translation using
+the ncdump -h command to see the netCDF Classic translation. The
+ncdump output will actually be the union of the DDS with the DAS, so
+to see the complete translation, it is necessary to view both.
+
+For example, if a web browser is given the following, the first URL
+will return the DDS for the specified dataset, and the second URL will
+return the DAS for the specified dataset.
+
+\code
+     http://remotetest.unidata.ucar.edu/dts/test.01.dds
+     http://remotetest.unidata.ucar.edu/dts/test.01.das
+\endcode
+
+Then by using the following ncdump command, it is possible to see the
+equivalent netCDF Classic translation.
+
+\code
+     ncdump -h http://remotetest.unidata.ucar.edu/dts/test.01
+\endcode
+
+The DDS output from the web server should look like this.
+
+\code
+Dataset {
+    Byte b;
+    Int32 i32;
+    UInt32 ui32;
+    Int16 i16;
+    UInt16 ui16;
+    Float32 f32;
+    Float64 f64;
+    String s;
+    Url u;
+} SimpleTypes;
+\endcode
+
+The DAS output from the web server should look like this.
+
+\code
+Attributes {
+    Facility {
+        String PrincipleInvestigator ``Mark Abbott'', ``Ph.D'';
+        String DataCenter ``COAS Environmental Computer Facility'';
+        String DrifterType ``MetOcean WOCE/OCM'';
+    }
+    b {
+        String Description ``A test byte'';
+        String units ``unknown'';
+    }
+    i32 {
+        String Description ``A 32 bit test server int'';
+        String units ``unknown'';
+    }
+}
+\endcode
+
+The output from ncdump should look like this.
+
+\code
+netcdf test {
+dimensions:
+	stringdim64 = 64 ;
+variables:
+	byte b ;
+		b:Description = "A test byte" ;
+		b:units = "unknown" ;
+	int i32 ;
+		i32:Description = "A 32 bit test server int" ;
+		i32:units = "unknown" ;
+	int ui32 ;
+	short i16 ;
+	short ui16 ;
+	float f32 ;
+	double f64 ;
+	char s(stringdim64) ;
+	char u(stringdim64) ;
+}
+\endcode
+
+Note that the fields of type String and type URL have suddenly
+acquired a dimension. This is because strings are translated to arrays
+of char, which requires adding an extra dimension. The size of the
+dimension is determined in a variety of ways and can be specified. It
+defaults to 64 and when read, the underlying string is either padded
+or truncated to that length.
+
+Also note that the Facility attributes do not appear in the
+translation because they are neither global nor associated with a
+variable in the DDS.
+
+Alternately, one can get the text of the DDS as a global attribute by
+using the client parameters mechanism . In this case, the parameter
+“show=dds” can be used, and the data retrieved using
+the following command
+
+\code
+     ncdump -h http://remotetest.unidata.ucar.edu/dts/test.01.dds#show=dds
+\endcode
+
+The ncdump -h command will then show both the translation and the
+original DDS. In the above example, the DDS would appear as the global
+attribute “_DDS” as follows.
+
+\code
+netcdf test {
+...
+variables:
+        :_DDS = "Dataset { Byte b; Int32 i32; UInt32 ui32; Int16 i16;
+                 UInt16 ui16; Float32 f32; Float64 f64;
+                 Strings; Url u; } SimpleTypes;"
+
+	byte b ;
+...
+}
+\endcode
+
+\page dap_to_netcdf DAP to NetCDF Translation Rules
+
+\tableofcontents
+
+Currently only one translation available: DAP 2 Protocol to netCDF-3.
+There used to be a DAP 2 Protocol to netCDF-4 translation
+but that has been removed until the DAP4 protocol is available.
+
+\section nc3_trans_rules netCDF-3 Translation Rules
+
+The current default translation code translates the OPeNDAP protocol
+to netCDF-3 (classic). This netCDF-3 translation converts an OPeNDAP
+DAP protocol version 2 DDS to netCDF-3 and is designed to mimic as
+closely as possible the translation provided by the libnc-dap
+system, except that some errors in that older translation have
+been fixed.
+
+For illustrative purposes, the following example will be used.
+
+\code
+Dataset {
+  Int32 f1;
+  Structure {
+    Int32 f11;
+    Structure {
+      Int32 f1[3];
+      Int32 f2;
+    } FS2[2];
+  } S1;
+  Structure {
+    Grid {
+      Array:
+        Float32 temp[lat=2][lon=2];
+      Maps:
+        Int32 lat[lat=2];
+        Int32 lon[lon=2];
+    } G1;
+  } S2;
+  Grid {
+      Array:
+        Float32 G2[lat=2][lon=2];
+      Maps:
+        Int32 lat[2];
+        Int32 lon[2];
+  } G2;
+  Int32 lat[lat=2];
+  Int32 lon[lon=2];
+} D1;
+\endcode
+
+\section var_def Variable Definition
+
+The set of netCDF variables is derived from the fields with primitive
+base types as they occur in Sequences, Grids, and Structures. The
+field names are modified to be fully qualified initially. For the
+above, the set of variables are as follows. The coordinate variables
+within grids are left out in order to mimic the behavior of libnc-dap.
+
+\code
+    f1
+    S1.f11
+    S1.FS2.f1
+    S1.FS2.f2
+    S2.G1.temp
+    S2.G2.G2
+    lat
+    lon
+\endcode
+
+\page var_dim_trans Variable Dimension Translation
+
+\tableofcontents
+
+A variable's rank is determined from three sources.
+- The variable has the dimensions associated with the field it
+represents (e.g. S1.FS2.f1[3] in the above example).
+- The variable inherits the dimensions associated with any containing
+structure that has a rank greater than zero. These dimensions precede
+those of case 1. Thus, we have in our example, f1[2][3], where the
+first dimension comes from the containing Structure FS2[2].
+- The variable's set of dimensions are altered if any of its
+containers is a DAP DDS Sequence. This is discussed more fully below.
+
+If the type of the netCDF variable is char, then an extra string
+dimension is added as the last dimension.
+
+\section dim_trans Dimension translation
+
+For dimensions, the rules are as follows.
+
+Fields in dimensioned structures inherit the dimension of the
+structure; thus the above list would have the following dimensioned
+variables.
+
+\code
+        S1.FS2.f1 -> S1.FS2.f1[2][3]
+        S1.FS2.f2 -> S1.FS2.f2[2]
+        S2.G1.temp -> S2.G1.temp[lat=2][lon=2]
+        S2.G1.lat -> S2.G1.lat[lat=2]
+        S2.G1.lon -> S2.G1.lon[lon=2]
+        S2.G2.G2 -> S2.G2.lon[lat=2][lon=2]
+        S2.G2.lat -> S2.G2.lat[lat=2]
+        S2.G2.lon -> S2.G2.lon[lon=2]
+        lat -> lat[lat=2]
+        lon -> lon[lon=2]
+\endcode
+
+Collect all of the dimension specifications from the DDS, both named
+and anonymous (unnamed) For each unique anonymous dimension with value
+NN create a netCDF dimension of the form "XX_<i>=NN", where XX is the
+fully qualified name of the variable and i is the i'th (inherited)
+dimension of the array where the anonymous dimension occurs. For our
+example, this would create the following dimensions.
+
+\code
+        S1.FS2.f1_0 = 2 ;
+        S1.FS2.f1_1 = 3 ;
+        S1.FS2.f2_0 = 2 ;
+        S2.G2.lat_0 = 2 ;
+        S2.G2.lon_0 = 2 ;
+\endcode
+
+If however, the anonymous dimension is the single dimension of a MAP
+vector in a Grid then the dimension is given the same name as the map
+vector This leads to the following.
+
+\code
+        S2.G2.lat_0 -> S2.G2.lat
+        S2.G2.lon_0 -> S2.G2.lon
+\endcode
+
+For each unique named dimension "<name>=NN", create a netCDF dimension
+of the form "<name>=NN", where name has the qualifications removed. If
+this leads to duplicates (i.e. same name and same value), then the
+duplicates are ignored. This produces the following.
+
+\code
+        S2.G2.lat -> lat
+        S2.G2.lon -> lon
+\endcode
+
+Note that this produces duplicates that will be ignored later.
+
+At this point the only dimensions left to process should be named
+dimensions with the same name as some dimension from step number 3,
+but with a different value. For those dimensions create a dimension of
+the form "<name>M=NN" where M is a counter starting at 1. The example
+has no instances of this.
+
+Finally and if needed, define a single UNLIMITED dimension named
+"unlimited" with value zero. Unlimited will be used to handle certain
+kinds of DAP sequences (see below).
+
+This leads to the following set of dimensions.
+
+\code
+dimensions:
+  unlimited = UNLIMITED;
+  lat = 2 ;
+  lon = 2 ;
+  S1.FS2.f1_0 = 2 ;
+  S1.FS2.f1_1 = 3 ;
+  S1.FS2.f2_0 = 2 ;
+\endcode
+
+\page var_name_trans Variable Name Translation
+
+\tableofcontents
+
+The steps for variable name translation are as follows.
+
+Take the set of variables captured above. Thus for the above DDS, the
+following fields would be collected.
+
+\code
+        f1
+        S1.f11
+        S1.FS2.f1
+        S1.FS2.f2
+        S2.G1.temp
+        S2.G2.G2
+        lat
+        lon
+\endcode
+
+All grid array variables are renamed to be the same as the containing
+grid and the grid prefix is removed. In the above DDS, this results in
+the following changes.
+
+\code
+        G1.temp -> G1
+        G2.G2 -> G2
+\endcode
+
+It is important to note that this process could produce duplicate
+variables (i.e. with the same name); in that case they are all assumed
+to have the same content and the duplicates are ignored. If it turns
+out that the duplicates have different content, then the translation
+will not detect this. YOU HAVE BEEN WARNED.
+
+The final netCDF-3 schema (minus attributes) is then as follows.
+
+\code
+netcdf t {
+dimensions:
+        unlimited = UNLIMITED ;
+        lat = 2 ;
+        lon = 2 ;
+        S1.FS2.f1_0 = 2 ;
+        S1.FS2.f1_1 = 3 ;
+        S1.FS2.f2_0 = 2 ;
+variables:
+        int f1 ;
+        int lat(lat) ;
+        int lon(lon) ;
+        int S1.f11 ;
+	int S1.FS2.f1(S1.FS2.f1_0, S1.FS2.f1_1) ;
+        int S1.FS2.f2(S1_FS2_f2_0) ;
+        float S2.G1(lat, lon) ;
+        float G2(lat, lon) ;
+}
+\endcode
+
+In actuality, the unlimited dimension is dropped because it is unused.
+
+There are differences with the original libnc-dap here because
+libnc-dap technically was incorrect. The original would have said
+this, for example.
+
+\code
+int S1.FS2.f1(lat, lat) ;
+\endcode
+
+Note that this is incorrect because it dimensions S1.FS2.f1(2,2)
+rather than S1.FS2.f1(2,3).
+
+\section dap_translation Translating DAP DDS Sequences
+
+Any variable (as determined above) that is contained directly or
+indirectly by a Sequence is subject to revision of its rank using the
+following rules.
+
+Let the variable be contained in Sequence Q1, where Q1 is the
+innermost containing sequence. If Q1 is itself contained (directly or
+indirectly) in a sequence, or Q1 is contained (again directly or
+indirectly) in a structure that has rank greater than 0, then the
+variable will have an initial UNLIMITED dimension. Further, all
+dimensions coming from "above" and including (in the containment
+sense) the innermost Sequence, Q1, will be removed and replaced by
+that single UNLIMITED dimension. The size associated with that
+UNLIMITED is zero, which means that its contents are inaccessible
+through the netCDF-3 API. Again, this differs from libnc-dap, which
+leaves out such variables. Again, however, this difference is backward
+compatible.
+
+If the variable is contained in a single Sequence (i.e. not nested)
+and all containing structures have rank 0, then the variable will have
+an initial dimension whose size is the record count for that
+Sequence. The name of the new dimension will be the name of the
+Sequence.
+
+Consider this example.
+
+\code
+Dataset {
+  Structure {
+    Sequence {
+      Int32 f1[3];
+      Int32 f2;
+    } SQ1;
+  } S1[2];
+  Sequence {
+    Structure {
+      Int32 x1[7];
+    } S2[5];
+  } Q2;
+} D;
+\endcode
+
+The corresponding netCDF-3 translation is pretty much as follows (the
+value for dimension Q2 may differ).
+
+\code
+dimensions:
+    unlimited = UNLIMITED ; // (0 currently)
+    S1.SQ1.f1_0 = 2 ;
+    S1.SQ1.f1_1 = 3 ;
+    S1.SQ1.f2_0 = 2 ;
+    Q2.S2.x1_0 = 5 ;
+    Q2.S2.x1_1 = 7 ;
+    Q2 = 5 ;
+variables:
+    int S1.SQ1.f1(unlimited, S1.SQ1.f1_1) ;
+    int S1.SQ1.f2(unlimited) ;
+    int Q2.S2.x1(Q2, Q2.S2.x1_0, Q2.S2.x1_1) ;
+\endcode
+
+Note that for example S1.SQ1.f1_0 is not actually used because it has
+been folded into the unlimited dimension.
+
+Note that for sequences without a leading unlimited dimension, there
+is a performance cost because the translation code has to walk the
+data to determine how many records are associated with the
+sequence. Since libnc-dap did essentially the same thing, it can be
+assumed that the cost is not prohibitive.
+
+\section dap_caching Caching
+
+In an effort to provide better performance for some access patterns,
+client-side caching of data is available. The default is no caching,
+but it may be enabled by prefixing the URL with the paramter "cache".
+
+Caching operates basically as follows.
+
+When a URL is first accessed using nc_open(), netCDF automatically
+does a pre-fetch of selected variables. These include all variables
+smaller than a specified (and user definable) size. This allows, for
+example, quick access to coordinate variables. This can be suppressed
+with the parameter "noprefetch".
+
+Whenever a request is made using some variant of the nc_get_var() API
+procedures, the complete variable is fetched and stored in the cache
+as a new cache entry. Subsequence requests for any part of that
+variable will access the cache entry to obtain the data.
+
+The cache may become too full, either because there are too many
+entries or because it is taking up too much disk space. In this case
+cache entries are purged until the cache size limits are reached. The
+cache purge algorithm is LRU (least recently used) so that variables
+that are repeatedly referenced will tend to stay in the cache.
+
+The cache is completely purged when nc_close() is invoked.
+
+In order to decide if you should enable caching, you will need to have
+some understanding of the access patterns of your program.
+
+The ncdump program always dumps one or more whole variables so it
+turns on caching.
+
+If your program accesses only parts of a number of variables, then
+caching should probably not be used since fetching whole variables
+will probably slow down your program for no purpose.
+
+Unfortunately, caching is currently an all or nothing proposition, so
+for more complex access patterns, the decision to cache or not may not
+have an obvious answer. Probably a good rule of thumb is to avoid
+caching initially and later turn it on to see its effect on
+performance.
+
+\section dap_defined_params Defined Client Parameters
+
+Currently, a limited set of client parameters is
+recognized. Parameters not listed here are ignored, but no error is
+signalled.
+
+Parameter Name Legal Values Semantics
+- "log" | "log=<file>" - Turn on logging and send the log output to
+  the specified file. If no file is specified, then output is sent to standard
+  error.
+- "show=... das|dds|url" - This causes information to appear as
+  specific global attributes. The currently recognized tags are "dds"
+  to display the underlying DDS, "das" similarly, and "url" to display
+  the url used to retrieve the data. This parameter may be specified
+  multiple times (e.g. “show=dds&show=url”).
+- "show=fetch" - This parameter causes the netCDF code to log a copy
+  of the complete url for every HTTP get request. If logging is
+  enabled, then this can be helpful in checking to see the access
+  behavior of the netCDF code.
+- "stringlength=NN" - Specify the default string length to use for
+  string dimensions. The default is 64.
+- "stringlength_<var>=NN" - Specify the default string length to use
+  for a string dimension for the specified variable. The default is
+  64.
+- "cache" - This enables caching.
+- "cachelimit=NN" - Specify the maximum amount of space allowed for
+  the cache.
+- "cachecount=NN" - Specify the maximum number of entries in the
+  cache.
+- "noprefetch" - This disables prefetch of small variables.
+
+\section dap_debug Notes on Debugging OPeNDAP Access
+
+The OPeNDAP support makes use of the logging facility of the
+underlying oc system (see http://www.opendap.org/oc).
+Note that this is currently separate from the
+existing netCDF logging facility. Turning on this logging can
+sometimes give important information. Logging can be enabled by
+using the client parameter "log" or "log=filename",
+where the first case will send log output to standard error and the
+second will send log output to the specified file.
+
+Users should also be aware that if one is
+accessing data over an NFS mount, one may see some .nfsxxxxx files;
+those can be ignored.
+
+\subsection http_config HTTP Configuration.
+
+Limited support for configuring the http connection is provided via
+parameters in the “.dodsrc” configuration file. The relevant .dodsrc file is
+located by first looking in the current working directory, and if not
+found, then looking in the directory specified by the “$HOME”
+environment variable.
+
+Entries in the .dodsrc file are of the form:
+
+\code
+     ['['<url>']']<key>=<value>
+\endcode
+
+That is, it consists of a key name and value pair and optionally
+preceded by a url enclosed in square brackets.
+
+For given KEY and URL strings, the value chosen is as follows:
+
+If URL is null, then look for the .dodsrc entry that has no url prefix
+and whose key is same as the KEY for which we are looking.
+
+If the URL is not null, then look for all the .dodsrc entries that
+have a url, URL1, say, and for which URL1 is a prefix (in the string
+sense) of URL. For example, if URL = http//x.y/a, then it will match
+entries of the form
+
+\code
+              1. [http//x.y/a]KEY=VALUE
+              2. [http//x.y/a/b]KEY=VALUE
+\endcode
+
+It will not match an entry of the form
+
+\code
+              [http//x.y/b]KEY=VALUE
+\endcode
+
+because “http://x.y/b” is not a string prefix of
+“http://x.y/a”. Finally from the set so constructed, choose the entry
+with the longest url prefix: “http//x.y/a/b]KEY=VALUE” in this case.
+
+Currently, the supported set of keys (with descriptions) are as
+follows.
+
+<pre>
+    HTTP.VERBOSE
+        Type: boolean ("1"/"0")
+        Description: Produce verbose output, especially using SSL.
+        Related CURL Flags: CURLOPT_VERBOSE
+    HTTP.DEFLATE
+        Type: boolean ("1"/"0")
+        Description: Allow use of compression by the server.
+        Related CURL Flags: CURLOPT_ENCODING
+    HTTP.COOKIEJAR
+        Type: String representing file path
+        Description: Specify the name of file into which to store cookies. Defaults to in-memory storage.
+        Related CURL Flags:CURLOPT_COOKIEJAR
+    HTTP.CREDENTIALS.USER
+        Type: String representing user name
+        Description: Specify the user name for Digest and Basic authentication.
+        Related CURL Flags:
+    HTTP.CREDENTIALS.PASSWORD
+        Type: String representing password
+        Type: boolean ("1"/"0")
+        Description: Specify the password for Digest and Basic authentication.
+        Related CURL Flags:
+    HTTP.SSL.CERTIFICATE
+        Type: String representing file path
+        Description: Path to a file containing a PEM cerficate.
+        Related CURL Flags: CURLOPT_CERT
+    HTTP.SSL.KEY
+        Type: String representing file path
+        Description: Same as HTTP.SSL.CERTIFICATE, and should usually have the same value.
+        Related CURL Flags: CURLOPT_SSLKEY
+    HTTP.SSL.KEYPASSWORD
+        Type: String representing password
+        Description: Password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
+        Related CURL Flags: CURLOPT_KEYPASSWORD
+    HTTP.SSL.CAPATH
+        Type: String representing directory
+        Description: Path to a directory containing trusted certificates for validating server sertificates.
+        Related CURL Flags: CURLOPT_CAPATH
+    HTTP.SSL.VALIDATE
+        Type: boolean ("1"/"0")
+        Description: Cause the client to verify the server's presented certificate.
+        Related CURL Flags: CURLOPT_SSL_VERIFYPEER, CURLOPT_SSL_VERIFYHOST
+    HTTP.TIMEOUT
+        Type: String ("dddddd")
+        Description: Specify the maximum time in seconds that you allow the http transfer operation to take.
+        Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL
+    HTTP.PROXY_SERVER
+        Type: String representing url to access the proxy: (e.g.http://[username:password@]host[:port])
+        Description: Specify the needed information for accessing a proxy.
+        Related CURL Flags: CURLOPT_PROXY, CURLOPT_PROXYHOST, CURLOPT_PROXYUSERPWD
+</pre>
+
+The related curl flags line indicates the curl flags modified by this
+key. See the libcurl documentation of the curl_easy_setopt() function
+for more detail (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html).
+
+For ESG client side key support, the following entries must be specified:
+
+\code
+    HTTP.SSL.VALIDATE
+    HTTP.COOKIEJAR
+    HTTP.SSL.CERTIFICATE
+    HTTP.SSL.KEY
+    HTTP.SSL.CAPATH
+\endcode
+
+Additionally, for ESG, the HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY
+entries should have same value, which is the file path for the
+certificate produced by MyProxyLogon. The HTTP.SSL.CAPATH entry should
+be the path to the "certificates" directory produced by MyProxyLogon.
+
+*/
\ No newline at end of file
diff --git a/docs/architecture.dox b/docs/architecture.dox
index ef19ed2..2f1588c 100644
--- a/docs/architecture.dox
+++ b/docs/architecture.dox
@@ -1,7 +1,4 @@
-/** \file 
-Documentation of netCDF architecture.
-
-\page architecture NetCDF Library Architecture
+/*! \page architecture NetCDF Library Architecture
 
 \image html netcdf_architecture.png "NetCDF Architecture"
 \image latex netcdf_architecture.png "NetCDF Architecture"
@@ -17,4 +14,3 @@ The netCDF C-based libraries depend on a core C library and some externally deve
 - "Apps" in the above means applications, not mobile apps!
 
 */
-
diff --git a/docs/attribute_conventions.md b/docs/attribute_conventions.md
new file mode 100644
index 0000000..5cee1bf
--- /dev/null
+++ b/docs/attribute_conventions.md
@@ -0,0 +1,128 @@
+Appendix A: Attribute Conventions {#attribute_conventions}
+=====================
+
+Attribute conventions are assumed by some netCDF generic applications, e.g., ‘units’ as the name for a string attribute that gives the units for a netCDF variable.
+
+It is strongly recommended that applicable conventions be followed unless there are good reasons for not doing so. Below we list the names and meanings of recommended standard attributes that have proven useful. Note that some of these (e.g. units, valid_range, scale_factor) assume numeric data and should not be used with character data.
+
+    Attribute names commencing with underscore ('_') are reserved for use by the netCDF library.
+
+# Conventions
+
+
+`units`
+
+> A character string that specifies the units used for the variable's data. Unidata has developed a freely-available library of routines to convert between character string and binary forms of unit specifications and to perform various useful operations on the binary forms. This library is used in some netCDF applications. Using the recommended units syntax permits data represented in conformable units to be automatically converted to common units for arithmetic operations. For more info [...]
+
+
+`long_name`
+
+> A long descriptive name. This could be used for labeling plots, for example. If a variable has no long_name attribute assigned, the variable name should be used as a default.
+
+`_FillValue`
+
+> The _FillValue attribute specifies the fill value used to pre-fill disk space allocated to the variable. Such pre-fill occurs unless nofill mode is set using nc_set_fill(). The fill value is returned when reading values that were never written. If _FillValue is defined then it should be scalar and of the same type as the variable. If the variable is packed using scale_factor and add_offset attributes (see below), the _FillValue attribute should have the data type of the packed data.
+
+<p>
+
+> It is not necessary to define your own _FillValue attribute for a variable if the default fill value for the type of the variable is adequate. However, use of the default fill value for data type byte is not recommended. Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed.
+
+<p>
+
+> Generic applications often need to write a value to represent undefined or missing values. The fill value provides an appropriate value for this purpose because it is normally outside the valid range and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the fill value to be within the valid range.
+
+`missing_value`
+
+> This attribute is not treated in any special way by the library or conforming generic applications, but is often useful documentation and may be used by specific applications. The missing_value attribute can be a scalar or vector containing values indicating missing data. These values should all be outside the valid range so that generic applications will treat them as missing.
+
+<p>
+
+> When scale_factor and add_offset are used for packing, the value(s) of the missing_value attribute should be specified in the domain of the data in the file (the packed data), so that missing values can be detected before the scale_factor and add_offset are applied.
+
+
+`valid_min`
+
+> A scalar specifying the minimum valid value for this variable.
+
+`valid_max`
+
+> A scalar specifying the maximum valid value for this variable.
+
+`valid_range`
+
+
+> A vector of two numbers specifying the minimum and maximum valid values for this variable, equivalent to specifying values for both valid_min and valid_max attributes. Any of these attributes define the valid range. The attribute valid_range must not be defined if either valid_min or valid_max is defined.
+
+<p>
+
+> Generic applications should treat values outside the valid range as missing. The type of each valid_range, valid_min and valid_max attribute should match the type of its variable (except that for byte data, these can be of a signed integral type to specify the intended range).
+
+<p>
+
+> If neither valid_min, valid_max nor valid_range is defined then generic applications should define a valid range as follows. If the data type is byte and _FillValue is not explicitly defined, then the valid range should include all possible values. Otherwise, the valid range should exclude the _FillValue (whether defined explicitly or by default) as follows. If the _FillValue is positive then it defines a valid maximum, otherwise it defines a valid minimum. For integer types, there sho [...]
+
+<p>
+
+> If the variable is packed using scale_factor and add_offset attributes (see below), the _FillValue, missing_value, valid_range, valid_min, or valid_max attributes should have the data type of the packed data.
+
+`scale_factor`
+
+> If present for a variable, the data are to be multiplied by this factor after the data are read by the application that accesses the data.
+
+> If valid values are specified using the valid_min, valid_max, valid_range, or _FillValue attributes, those values should be specified in the domain of the data in the file (the packed data), so that they can be interpreted before the scale_factor and add_offset are applied.
+
+`add_offset`
+
+> If present for a variable, this number is to be added to the data after it is read by the application that accesses the data. If both scale_factor and add_offset attributes are present, the data are first scaled before the offset is added. The attributes scale_factor and add_offset can be used together to provide simple data compression to store low-resolution floating-point data as small integers in a netCDF dataset. When scaled data are written, the application should first subtract  [...]
+
+<p>
+
+> When scale_factor and add_offset are used for packing, the associated variable (containing the packed data) is typically of type byte or short, whereas the unpacked values are intended to be of type float or double. The attributes scale_factor and add_offset should both be of the type intended for the unpacked data, e.g. float or double.
+
+`Coordinates`
+
+> Following the CF (Climate and Forecast) conventions for netCDF metadata, we define an auxiliary coordinate variable as any netCDF variable that contains coordinate data, but is not a coordinate variable (See Coordinate Variables). Unlike coordinate variables, there is no relationship between the name of an auxiliary coordinate variable and the name(s) of its dimension(s).
+
+<p>
+
+> The value of the coordinates attribute is a blank separated list of names of auxiliary coordinate variables and (optionally) coordinate variables. There is no restriction on the order in which the variable names appear in the coordinates attribute string.
+
+`signedness`
+
+> Deprecated attribute, originally designed to indicate whether byte values should be treated as signed or unsigned. The attributes valid_min and valid_max may be used for this purpose. For example, if you intend that a byte variable store only non-negative values, you can use valid_min = 0 and valid_max = 255. This attribute is ignored by the netCDF library.
+
+`C_format`
+
+> A character array providing the format that should be used by C applications to print values for this variable. For example, if you know a variable is only accurate to three significant digits, it would be appropriate to define the C_format attribute as "%.3g". The ncdump utility program uses this attribute for variables for which it is defined. The format applies to the scaled (internal) type and value, regardless of the presence of the scaling attributes scale_factor and add_offset.
+
+`FORTRAN_format`
+
+> A character array providing the format that should be used by FORTRAN applications to print values for this variable. For example, if you know a variable is only accurate to three significant digits, it would be appropriate to define the FORTRAN_format attribute as "(G10.3)".
+
+`title`
+
+> A global attribute that is a character array providing a succinct description of what is in the dataset.
+
+`history`
+
+> A global attribute for an audit trail. This is a character array with a line for each invocation of a program that has modified the dataset. Well-behaved generic netCDF applications should append a line containing: date, time of day, user name, program name and command arguments.
+
+`Conventions`
+
+> If present, 'Conventions' is a global attribute that is a character array for the name of the conventions followed by the dataset. Originally, these conventions were named by a string that was interpreted as a directory name relative to the directory /pub/netcdf/Conventions/ on the host ftp.unidata.ucar.edu. The web page http://www.unidata.ucar.edu/netcdf/conventions.html is now the preferred and authoritative location for registering a URI reference to a set of conventions maintained  [...]
+
+<p>
+
+> It may be convenient for defining institutions and groups to use a hierarchical structure for general conventions and more specialized conventions. For example, if a group named NUWG agrees upon a set of conventions for dimension names, variable names, required attributes, and netCDF representations for certain discipline-specific data structures, they may store a document describing the agreed-upon conventions in a dataset in the NUWG/ subdirectory of the Conventions directory. Datase [...]
+
+<p>
+
+> Later, if the group agrees upon some additional conventions for a specific subset of NUWG data, for example time series data, the description of the additional conventions might be stored in the NUWG/Time_series/ subdirectory, and datasets that adhered to these additional conventions would use the global Conventions attribute with value "NUWG/Time_series", implying that this dataset adheres to the NUWG conventions and also to the additional NUWG time-series conventions.
+
+<p>
+
+> It is possible for a netCDF file to adhere to more than one set of conventions, even when there is no inheritance relationship among the conventions. In this case, the value of the 'Conventions' attribute may be a single text string containing a list of the convention names separated by blank space (recommended) or commas (if a convention name contains blanks).
+
+<p>
+
+> Typical conventions web sites will include references to documents in some form agreed upon by the community that supports the conventions and examples of netCDF file structures that follow the conventions.
diff --git a/docs/auth.md b/docs/auth.md
new file mode 100644
index 0000000..036e0d4
--- /dev/null
+++ b/docs/auth.md
@@ -0,0 +1,489 @@
+Authorization Support in the netCDF-C Libraries {#oc_auth}
+==================================================
+
+\brief It is possible to support a number of authorization schemes
+in the netCDF-C library.
+
+With one exception, authorization in the netCDF-C library is
+delegated to the oc2 code, which in turn delegates it to the
+libcurl library. The exception is that the location of the rc
+file can be specified by setting the environment variable *NCRCFILE*.
+Note that the value of this environment variable should be the
+absolute path of the rc file, not the path to its containing directory.
+
+Following is the authorization documentation.
+<center>
+
+OC Authorization Support {#oc_auth_support}
+========================
+
+Author: Dennis Heimbigner<br>
+dmh at ucar dot edu
+
+Draft: 11/21/2014<br>
+Last Revised: 12/23/2014<br>
+OC Version 2.1
+</center>
+
+## Table of Contents {#auth_toc}
+
+1.  [Introduction](#Introduction)
+2.  [URL-Based Authentication](#URL-AUTH)
+3.  [RC File Authentication](#DODSRC)
+4.  [Redirection-Based Authentication](#REDIR)
+5.  [URL Constrained RC File Entries](#URLCONS)
+6.  [Client-Side Certificates](#CLIENTCERTS)
+7.  [Appendix A. All RC-File Keys](#allkeys)
+8.  [Appendix B. ESG Access in Detail](#ESGDETAIL)
+
+## Introduction {#Introduction}
+
+OC can support user authorization using those provided by the curl
+library. This includes basic password authentication as well as
+certificate-based authorization.
+
+With some exceptions (e.g. see the section on [redirection](#REDIR)) The
+libcurl authorization mechanisms can be accessed in two ways
+
+1.  Inserting the username and password into the url, or
+2.  Accessing information from a so-called *rc* file named either
+    *.daprc* or *.dodsrc*
+
+## URL-Based Authentication {#URL-AUTH}
+
+For simple password based authentication, it is possible to directly
+insert the username and the password into a url in this form.
+
+        http://username:password@host/...
+
+This username and password will be used if the server asks for
+authentication. Note that only simple password authentication is
+supported in this format. Specifically note that [redirection](#REDIR)
+based authorization will not work with this.
+
+## RC File Authentication {#DODSRC}
+
+The oc library supports an *rc* file mechanism to allow the passing of a
+number of parameters to liboc and libcurl.
+
+The file must be called one of the following names: ".daprc", ".dodsrc"
+If both .daprc and .dodsrc exist, then the .daprc file will take
+precedence.
+
+Searching for the rc file first looks in the current directory and then
+in the home directory (as defined by the HOME environment variable). It
+is also possible to specify a direct path using the *-R* option to
+ocprint or using the *oc\_set\_rcfile* procedure (see oc.h). Note that
+for these latter cases, the path must be to the file itself, not to the
+containing directory.
+
+The rc file format is a series of lines of the general form:
+
+    [<host:port>]<key>=<value>
+
+where the bracket-enclosed host:port is optional and will be discussed
+subsequently.
+
+The currently defined set of authorization-related keys are as follows.
+The second column is the affected curl\_easy\_setopt option(s).
+
+Key
+
+curl\_easy\_setopt Option
+
+HTTP.COOKIEJAR
+
+CURLOPT\_COOKIEJAR, CURLOPT\_COOKIEFILE
+
+HTTP.PROXY\_SERVER
+
+CURLOPT\_PROXY, CURLOPT\_PROXYPORT, CURLOPT\_PROXYUSERPWD
+
+HTTP.SSL.CERTIFICATE
+
+CURLOPT\_SSLCERT
+
+HTTP.SSL.KEY
+
+CURLOPT\_SSLKEY
+
+HTTP.SSL.KEYPASSWORD
+
+CURLOPT\_KEYPASSWORD
+
+HTTP.SSL.CAINFO
+
+CURLOPT\_SSLCAINFO
+
+HTTP.SSL.CAPATH
+
+CURLOPT\_SSLCAPATH
+
+HTTP.SSL.VERIFYPEER
+
+CURLOPT\_SSL\_VERIFYPEER
+
+HTTP.CREDENTIALS.USERPASSWORD
+
+CURLOPT\_USERPASSWORD
+
+### Password Authentication
+
+The key HTTP.CREDENTIALS.USERPASSWORD can be used to set the simple
+password authentication. This is an alternative to setting it in the
+url. The value must be of the form "username:password".
+
+### Cookie Jar
+
+The HTTP.COOKIEJAR key specifies the name of file from which to read
+cookies (CURLOPT\_COOKIEJAR) and also the file into which to store
+cookies (CURLOPT\_COOKIEFILE). The same value is used for both CURLOPT
+values. It defaults to in-memory storage.
+
+### Certificate Authentication
+
+HTTP.SSL.CERTIFICATE specifies a file path for a file containing a PEM
+cerficate. This is typically used for client-side authentication.
+
+HTTP.SSL.KEY is essentially the same as HTTP.SSL.CERTIFICATE and should
+usually have the same value.
+
+HTTP.SSL.KEYPASSWORD specifies the password for accessing the
+HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE file.
+
+HTTP.SSL.CAPATH specifies the path to a directory containing trusted
+certificates for validating server sertificates.
+
+HTTP.SSL.VALIDATE is a boolean (1/0) value that if true (1) specifies
+that the client should verify the server's presented certificate.
+
+HTTP.PROXY\_SERVER specified the url for accessing the proxy:
+(e.g.http://\[username:password@\]host\[:port\])
+
+## Redirection-Based Authentication {#REDIR}
+
+
+Some sites provide authentication by using a third party site to to the
+authentication. One example is
+[URS](https://uat.urs.earthdata.nasa.gov), the EOSDIS User Registration
+System.
+
+The process is usually as follows.
+
+1.  The client contacts the server of interest (SOI), the actual
+    data provider.
+2.  The SOI sends a redirect to the client to connect to the URS system.
+3.  The client authenticates with URS.
+4.  URS sends a redirect (with authorization information) to send the
+    client back to the SOI to actually obtain the data.
+
+In order for this to work with libcurl, the client will usually need to
+provide a .netrc file so that the redirection will work correctly. The
+format of this .netrc file will contain content that typically look like
+this.
+
+    machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
+
+where the machine is the one to which the client is redirected for
+authorization, and the login and password are those needed to
+authenticate.
+
+The .netrc file can be specified in two ways.
+
+1.  Specify the netrc file to liboc using the procedure in oc.h:
+
+        oc_set_netrc(OClink* link, const char* file)
+
+    (This is equivalent to the -N flag to ocprint).
+
+2.  Put the following line in your .daprc/.dodsrc file.
+
+        HTTP.NETRC=<path to netrc file>
+
+One final note. In using this, it is probable that you will need to
+specify a cookie jar (HTTP.COOKIEJAR) so that the redirect site can pass
+back authorization information.
+
+## URL Constrained RC File Entries {#URLCONS}
+
+Each line of the rc file can begin with a host+port enclosed in square
+brackets. The form is "host:port". If the port is not specified then the
+form is just "host". The reason that more of the url is not used is that
+libcurl's authorization grain is not any finer than host level.
+
+Examples.
+
+    [remotetest.unidata.ucar.edu]HTTP.VERBOSE=1
+    or
+    [fake.ucar.edu:9090]HTTP.VERBOSE=0
+
+If the url request from, say, the *oc\_open* method has a host+port
+matchine one of the prefixes in the rc file, then the corresponding
+entry will be used, otherwise ignored.
+
+For example, the URL
+
+    http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
+
+will have HTTP.VERBOSE set to 1.
+
+Similarly,
+
+    http://fake.ucar.edu:9090/dts/test.01
+
+will have HTTP.VERBOSE set to 0.
+
+## Client-Side Certificates {#CLIENTCERTS}
+
+Some systems, notably ESG (Earth System Grid), requires the use of
+client-side certificates, as well as being [re-direction based](#REDIR).
+This requires setting the following entries:
+
+-   HTTP.COOKIEJAR — a file path for storing cookies
+    across re-direction.
+-   HTTP.NETRC — the path to the netrc file.
+-   HTTP.SSL.CERTIFICATE — the file path for the client side
+    certificate file.
+-   HTTP.SSL.KEY — this should have the same value
+    as HTTP.SSL.CERTIFICATE.
+-   HTTP.SSL.CAPATH — the path to a "certificates" directory.
+-   HTTP.SSL.VALIDATE — force validation of the server certificate.
+
+Note that the first two are to support re-direction based
+authentication.
+
+## Appendix A. All RC-File Keys {#allkeys}
+
+For completeness, this is the list of all rc-file keys.
+
+Key
+
+curl\_easy\_setopt Option
+
+HTTP.DEFLATE
+
+CUROPT\_DEFLATE\
+with value "deflate,gzip"
+
+HTTP.VERBOSE
+
+CUROPT\_VERBOSE
+
+HTTP.TIMEOUT
+
+CUROPT\_TIMEOUT
+
+HTTP.USERAGENT
+
+CUROPT\_USERAGENT
+
+HTTP.COOKIEJAR
+
+CUROPT\_COOKIEJAR
+
+HTTP.COOKIE\_JAR
+
+CUROPT\_COOKIEJAR
+
+HTTP.PROXY\_SERVER
+
+CURLOPT\_PROXY,\
+CURLOPT\_PROXYPORT,\
+CURLOPT\_PROXYUSERPWD
+
+HTTP.SSL.CERTIFICATE
+
+CUROPT\_SSLCERT
+
+HTTP.SSL.KEY
+
+CUROPT\_SSLKEY
+
+HTTP.SSL.KEYPASSWORD
+
+CUROPT\_KEYPASSWORD
+
+HTTP.SSL.CAINFO
+
+CUROPT\_SSLCAINFO
+
+HTTP.SSL.CAPATH
+
+CUROPT\_SSLCAPATH
+
+HTTP.SSL.VERIFYPEER
+
+CUROPT\_SSL\_VERIFYPEER
+
+HTTP.CREDENTIALS.USERPASSWORD
+
+CUROPT\_USERPASSWORD
+
+HTTP.NETRC
+
+CURLOPT\_NETRC,CURLOPT\_NETRC\_FILE
+
+## Appendix B. ESG Access in Detail {#ESGDETAIL}
+
+It is possible to access Earth Systems Grid (ESG) datasets from ESG
+servers through the OC API using the techniques described in the section
+on [Client-Side Certificates](#CLIENTCERTS).
+
+In order to access ESG datasets, however, it is necessary to register as
+a user with ESG and to setup your environment so that proper
+authentication is established between an oc client program and the ESG
+data server. Specifically, it is necessary to use what is called
+"client-side keys" to enable this authentication. Normally, when a
+client accesses a server in a secure fashion (using "https"), the server
+provides an authentication certificate to the client. With client-side
+keys, the client must also provide a certificate to the server so that
+the server can know with whom it is communicating.
+
+The oc library uses the *curl* library and it is that underlying library
+that must be properly configured.
+
+### Terminology
+
+The key elements for client-side keys requires the constructions of two
+"stores" on the client side.
+
+-   Keystore - a repository to hold the client side key.
+-   Truststore - a repository to hold a chain of certificates that can
+    be used to validate the certificate sent by the server to
+    the client.
+
+The server actually has a similar set of stores, but the client need not
+be concerned with those.
+
+### Initial Steps
+
+The first step is to obtain authorization from ESG. Note that this
+information may evolve over time, and may be out of date. This
+discussion is in terms of BADC and NCSA. You will need to substitute as
+necessary.
+
+1.  Register at http://badc.nerc.ac.uk/register to obtain access to badc
+    and to obtain an openid, which will looks something like:
+
+        https://ceda.ac.uk/openid/Firstname.Lastname
+
+2.  Ask BADC for access to whatever datasets are of interest.
+3.  Obtain short term credentials at
+    http://grid.ncsa.illinois.edu/myproxy/MyProxyLogon/ You will need to
+    download and run the MyProxyLogon program. This will create a
+    keyfile in, typically, the directory ".globus". The keyfile will
+    have a name similar to this: "x509up\_u13615" The other elements in
+    ".globus" are certificates to use in validating the certificate your
+    client gets from the server.
+4.  Obtain the program source ImportKey.java from this location:
+    http://www.agentbob.info/agentbob/79-AB.html (read the whole page,
+    it will help you understand the remaining steps).
+
+### Building the KeyStore
+
+You will have to modify the keyfile in the previous step and then create
+a keystore and install the key and a certificate. The commands are
+these:
+
+        openssl pkcs8 -topk8 -nocrypt -in x509up_u13615 -inform PEM -out key.der -outform DER
+
+        openssl x509 -in x509up_u13615 -inform PEM -out cert.der -outform DER
+
+        java -classpath  -Dkeypassword="" -Dkeystore=./ key.der cert.der
+
+Note, the file names "key.der" and "cert.der" can be whatever you
+choose. It is probably best to leave the .der extension, though.
+
+### Building the TrustStore
+
+Building the truststore is a bit tricky because as provided, the
+certificates in ".globus" need some massaging. See the script below for
+the details. The primary command is this, which is executed for every
+certificate, c, in globus. It sticks the certificate into the file named
+"truststore"
+
+      keytool -trustcacerts -storepass "password" -v -keystore "truststore"  -importcert -file "${c}"
+
+### Running the C Client
+
+Refer to the section on [Client-Side Certificates](#CLIENTCERTS). The
+keys specified there must be set in the rc file to support ESG access.
+
+-   HTTP.COOKIEJAR=\~/.dods\_cookies
+-   HTTP.NETRC=\~/.netrc
+-   HTTP.SSL.CERTIFICATE=\~/esgkeystore
+-   HTTP.SSL.KEY=\~/esgkeystore
+-   HTTP.SSL.CAPATH=\~/.globus
+-   HTTP.SSL.VALIDATE=1
+
+Of course, the file paths above are suggestions only; you can modify as
+needed. The HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY entries should have
+same value, which is the file path for the certificate produced by
+MyProxyLogon. The HTTP.SSL.CAPATH entry should be the path to the
+"certificates" directory produced by MyProxyLogon.
+
+As noted, also uses re-direction based authentication. So, when it
+receives an initial connection from a client, it redirects to a separate
+authentication server. When that server has authenticated the client, it
+redirects back to the original url to complete the request.
+
+### Script for creating Stores
+
+The following script shows in detail how to actually construct the key
+and trust stores. It is specific to the format of the globus file as it
+was when ESG support was first added. It may have changed since then, in
+which case, you will need to seek some help in fixing this script. It
+would help if you communicated what you changed to the author so this
+document can be updated.
+
+    #!/bin/sh -x
+    KEYSTORE="esgkeystore"
+    TRUSTSTORE="esgtruststore"
+    GLOBUS="globus"
+    TRUSTROOT="certificates"
+    CERT="x509up_u13615"
+    TRUSTROOTPATH="$GLOBUS/$TRUSTROOT"
+    CERTFILE="$GLOBUS/$CERT"
+    PWD="password"
+
+    D="-Dglobus=$GLOBUS"
+    CCP="bcprov-jdk16-145.jar"
+    CP="./build:${CCP}"
+    JAR="myproxy.jar"
+
+    # Initialize needed directories
+    rm -fr build
+    mkdir build
+    rm -fr $GLOBUS
+    mkdir $GLOBUS
+    rm -f $KEYSTORE
+    rm -f $TRUSTSTORE
+
+    # Compile MyProxyCmd and ImportKey
+    javac -d ./build -classpath "$CCP" *.java
+    javac -d ./build ImportKey.java
+
+    # Execute MyProxyCmd
+    java -cp "$CP myproxy.MyProxyCmd
+
+    # Build the keystore
+    openssl pkcs8 -topk8 -nocrypt -in $CERTFILE -inform PEM -out key.der -outform DER
+    openssl x509 -in $CERTFILE -inform PEM -out cert.der -outform DER
+    java -Dkeypassword=$PWD -Dkeystore=./${KEYSTORE} -cp ./build ImportKey key.der cert.der
+
+    # Clean up the certificates in the globus directory
+    for c in ${TRUSTROOTPATH}/*.0 ; do
+        alias=`basename $c .0`
+        sed -e '0,/---/d' <$c >/tmp/${alias}
+        echo "-----BEGIN CERTIFICATE-----" >$c
+        cat /tmp/${alias} >>$c
+    done
+
+    # Build the truststore
+    for c in ${TRUSTROOTPATH}/*.0 ; do
+        alias=`basename $c .0`
+        echo "adding: $TRUSTROOTPATH/${c}"
+        echo "alias: $alias"
+        yes | keytool -trustcacerts -storepass "$PWD" -v -keystore ./$TRUSTSTORE -alias $alias -importcert -file "${c}"
+    done
+    exit
diff --git a/docs/auth.md.in b/docs/auth.md.in
new file mode 100644
index 0000000..8df4b79
--- /dev/null
+++ b/docs/auth.md.in
@@ -0,0 +1,14 @@
+Authorization Support in the netCDF-C Libraries {#oc_auth}
+==================================================
+
+\brief It is possible to support a number of authorization schemes
+in the netCDF-C library.
+
+With one exception, authorization in the netCDF-C library is
+delegated to the oc2 code, which in turn delegates it to the
+libcurl library. The exception is that the location of the rc
+file can be specified by setting the environment variable *NCRCFILE*.
+Note that the value of this environment variable should be the
+absolute path of the rc file, not the path to its containing directory.
+
+Following is the authorization documentation.
diff --git a/docs/file_format_specifications.md b/docs/file_format_specifications.md
new file mode 100644
index 0000000..972e757
--- /dev/null
+++ b/docs/file_format_specifications.md
@@ -0,0 +1,744 @@
+Appendix B. File Format Specifications {#file_format_specifications}
+=======================================
+
+[TOC]
+
+\section classic_format_spec The NetCDF Classic Format Specification
+
+To present the format more formally, we use a BNF grammar notation. In
+this notation:
+- Non-terminals (entities defined by grammar rules) are in lower case.
+- Terminals (atomic entities in terms of which the format
+specification is written) are in upper case, and are specified
+literally as US-ASCII characters within single-quote characters or are
+described with text between angle brackets (‘\<’ and ‘\>’).
+- Optional entities are enclosed between braces (‘[’ and ‘]’).
+- A sequence of zero or more occurrences of an entity is denoted by
+  ‘[entity ...]’.
+- A vertical line character (‘|’) separates alternatives. Alternation
+  has lower precedence than concatenation.
+- Comments follow ‘//’ characters.
+- A single byte that is not a printable character is denoted using a
+hexadecimal number with the notation ‘\\xDD’, where each D is a
+hexadecimal digit.
+- A literal single-quote character is denoted by ‘\'’, and a literal
+back-slash character is denoted by ‘\\’.
+
+Following the grammar, a few additional notes are included to specify
+format characteristics that are impractical to capture in a BNF
+grammar, and to note some special cases for implementers. Comments in
+the grammar point to the notes and special cases, and help to clarify
+the intent of elements of the format.
+
+<h1>The Format in Detail</h1>
+
+<pre>
+     netcdf_file  = header  data
+     header       = magic  numrecs  dim_list  gatt_list  var_list
+     magic        = 'C'  'D'  'F'  VERSION
+     VERSION      = \\x01 |                      // classic format
+                    \\x02                        // 64-bit offset format
+     numrecs      = NON_NEG | STREAMING         // length of record dimension
+     dim_list     = ABSENT | NC_DIMENSION  nelems  [dim ...]
+     gatt_list    = att_list                    // global attributes
+     att_list     = ABSENT | NC_ATTRIBUTE  nelems  [attr ...]
+     var_list     = ABSENT | NC_VARIABLE   nelems  [var ...]
+     ABSENT       = ZERO  ZERO                  // Means list is not present
+     ZERO         = \\x00 \\x00 \\x00 \\x00         // 32-bit zero
+     NC_DIMENSION = \\x00 \\x00 \\x00 \\x0A         // tag for list of dimensions
+     NC_VARIABLE  = \\x00 \\x00 \\x00 \\x0B         // tag for list of variables
+     NC_ATTRIBUTE = \\x00 \\x00 \\x00 \\x0C         // tag for list of attributes
+     nelems       = NON_NEG       // number of elements in following sequence
+     dim          = name  dim_length
+     name         = nelems  namestring
+                         // Names a dimension, variable, or attribute.
+                         // Names should match the regular expression
+                         // ([a-zA-Z0-9_]|{MUTF8})([^\\x00-\\x1F/\\x7F-\\xFF]|{MUTF8})*
+                         // For other constraints, see "Note on names", below.
+     namestring   = ID1 [IDN ...] padding
+     ID1          = alphanumeric | '_'
+     IDN          = alphanumeric | special1 | special2
+     alphanumeric = lowercase | uppercase | numeric | MUTF8
+     lowercase    = 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|
+                    'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'
+     uppercase    = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|
+                    'N'|'O'|'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z'
+     numeric      = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
+                                  // special1 chars have traditionally been
+                                  // permitted in netCDF names.
+     special1     = '_'|'.'|'@'|'+'|'-'
+                                  // special2 chars are recently permitted in
+                                  // names (and require escaping in CDL).
+                                  // Note: '/' is not permitted.
+     special2     = ' ' | '!' | '"' | '#'  | '$' | '%' | '&' | '\'' |
+                    '(' | ')' | '*' | ','  | ':' | ';' | '<' | '='  |
+                    '>' | '?' | '[' | '\\' | ']' | '^' | '`' | '{'  |
+                    '|' | '}' | '~'
+     MUTF8        = <multibyte UTF-8 encoded, NFC-normalized Unicode character>
+     dim_length   = NON_NEG       // If zero, this is the record dimension.
+                                  // There can be at most one record dimension.
+     attr         = name  nc_type  nelems  [values ...]
+     nc_type      = NC_BYTE   |
+                    NC_CHAR   |
+                    NC_SHORT  |
+                    NC_INT    |
+                    NC_FLOAT  |
+                    NC_DOUBLE
+     var          = name  nelems  [dimid ...]  vatt_list  nc_type  vsize  begin
+                                  // nelems is the dimensionality (rank) of the
+                                  // variable: 0 for scalar, 1 for vector, 2
+                                  // for matrix, ...
+     dimid        = NON_NEG       // Dimension ID (index into dim_list) for
+                                  // variable shape.  We say this is a "record
+                                  // variable" if and only if the first
+                                  // dimension is the record dimension.
+     vatt_list    = att_list      // Variable-specific attributes
+     vsize        = NON_NEG       // Variable size.  If not a record variable,
+                                  // the amount of space in bytes allocated to
+                                  // the variable's data.  If a record variable,
+                                  // the amount of space per record.  See "Note
+                                  // on vsize", below.
+     begin        = OFFSET        // Variable start location.  The offset in
+                                  // bytes (seek index) in the file of the
+                                  // beginning of data for this variable.
+     data         = non_recs  recs
+     non_recs     = [vardata ...] // The data for all non-record variables,
+                                  // stored contiguously for each variable, in
+                                  // the same order the variables occur in the
+                                  // header.
+     vardata      = [values ...]  // All data for a non-record variable, as a
+                                  // block of values of the same type as the
+                                  // variable, in row-major order (last
+                                  // dimension varying fastest).
+     recs         = [record ...]  // The data for all record variables are
+                                  // stored interleaved at the end of the
+                                  // file.
+     record       = [varslab ...] // Each record consists of the n-th slab
+                                  // from each record variable, for example
+                                  // x[n,...], y[n,...], z[n,...] where the
+                                  // first index is the record number, which
+                                  // is the unlimited dimension index.
+     varslab      = [values ...]  // One record of data for a variable, a
+                                  // block of values all of the same type as
+                                  // the variable in row-major order (last
+                                  // index varying fastest).
+     values       = bytes | chars | shorts | ints | floats | doubles
+     string       = nelems  [chars]
+     bytes        = [BYTE ...]  padding
+     chars        = [CHAR ...]  padding
+     shorts       = [SHORT ...]  padding
+     ints         = [INT ...]
+     floats       = [FLOAT ...]
+     doubles      = [DOUBLE ...]
+     padding      = <0, 1, 2, or 3 bytes to next 4-byte boundary>
+                                  // Header padding uses null (\\x00) bytes.  In
+                                  // data, padding uses variable's fill value.
+                                  // See "Note on padding", below, for a special
+                                  // case.
+     NON_NEG      = <non-negative INT>
+     STREAMING    = \\xFF \\xFF \\xFF \\xFF   // Indicates indeterminate record
+                                          // count, allows streaming data
+     OFFSET       = <non-negative INT> |  // For classic format or
+                    <non-negative INT64>  // for 64-bit offset format
+     BYTE         = <8-bit byte>          // See "Note on byte data", below.
+     CHAR         = <8-bit byte>          // See "Note on char data", below.
+     SHORT        = <16-bit signed integer, Bigendian, two's complement>
+     INT          = <32-bit signed integer, Bigendian, two's complement>
+     INT64        = <64-bit signed integer, Bigendian, two's complement>
+     FLOAT        = <32-bit IEEE single-precision float, Bigendian>
+     DOUBLE       = <64-bit IEEE double-precision float, Bigendian>
+                                  // following type tags are 32-bit integers
+     NC_BYTE      = \\x00 \\x00 \\x00 \\x01       // 8-bit signed integers
+     NC_CHAR      = \\x00 \\x00 \\x00 \\x02       // text characters
+     NC_SHORT     = \\x00 \\x00 \\x00 \\x03       // 16-bit signed integers
+     NC_INT       = \\x00 \\x00 \\x00 \\x04       // 32-bit signed integers
+     NC_FLOAT     = \\x00 \\x00 \\x00 \\x05       // IEEE single precision floats
+     NC_DOUBLE    = \\x00 \\x00 \\x00 \\x06       // IEEE double precision floats
+                                  // Default fill values for each type, may be
+                                  // overridden by variable attribute named
+                                  // '_FillValue'. See "Note on fill values",
+                                  // below.
+     FILL_CHAR    = \\x00                      // null byte
+     FILL_BYTE    = \\x81                      // (signed char) -127
+     FILL_SHORT   = \\x80 \\x01                 // (short) -32767
+     FILL_INT     = \\x80 \\x00 \\x00 \\x01       // (int) -2147483647
+     FILL_FLOAT   = \\x7C \\xF0 \\x00 \\x00       // (float) 9.9692099683868690e+36
+     FILL_DOUBLE  = \\x47 \\x9E \\x00 \\x00 \\x00 \\x00 \\x00 \\x00 //(double)9.9692099683868690e+36
+</pre>
+
+Note on vsize: This number is the product of the dimension lengths
+(omitting the record dimension) and the number of bytes per value
+(determined from the type), increased to the next multiple of 4, for
+each variable. If a record variable, this is the amount of space per
+record (except that, for backward compatibility, it always includes
+padding to the next multiple of 4 bytes, even in the exceptional case
+noted below under “Note on padding”). The netCDF “record size” is
+calculated as the sum of the vsize's of all the record variables.
+
+The vsize field is actually redundant, because its value may be
+computed from other information in the header. The 32-bit vsize field
+is not large enough to contain the size of variables that require more
+than 2^32 - 4 bytes, so 2^32 - 1 is used in the vsize field for such
+variables.
+
+Note on names: Earlier versions of the netCDF C-library reference
+implementation enforced a more restricted set of characters in
+creating new names, but permitted reading names containing arbitrary
+bytes. This specification extends the permitted characters in names to
+include multi-byte UTF-8 encoded Unicode and additional printing
+characters from the US-ASCII alphabet. The first character of a name
+must be alphanumeric, a multi-byte UTF-8 character, or '_' (reserved
+for special names with meaning to implementations, such as the
+“_FillValue” attribute). Subsequent characters may also include
+printing special characters, except for '/' which is not allowed in
+names. Names that have trailing space characters are also not
+permitted.
+
+Implementations of the netCDF classic and 64-bit offset format must
+ensure that names are normalized according to Unicode NFC
+normalization rules during encoding as UTF-8 for storing in the file
+header. This is necessary to ensure that gratuitous differences in the
+representation of Unicode names do not cause anomalies in comparing
+files and querying data objects by name.
+
+Note on streaming data: The largest possible record count, 2^32 - 1,
+is reserved to indicate an indeterminate number of records. This means
+that the number of records in the file must be determined by other
+means, such as reading them or computing the current number of records
+from the file length and other information in the header. It also
+means that the numrecs field in the header will not be updated as
+records are added to the file. [This feature is not yet implemented].
+
+Note on padding: In the special case when there is only one record
+variable and it is of type character, byte, or short, no padding is
+used between record slabs, so records after the first record do not
+necessarily start on four-byte boundaries. However, as noted above
+under “Note on vsize”, the vsize field is computed to include padding
+to the next multiple of 4 bytes. In this case, readers should ignore
+vsize and assume no padding. Writers should store vsize as if padding
+were included.
+
+Note on byte data: It is possible to interpret byte data as either
+signed (-128 to 127) or unsigned (0 to 255). When reading byte data
+through an interface that converts it into another numeric type, the
+default interpretation is signed. There are various attribute
+conventions for specifying whether bytes represent signed or unsigned
+data, but no standard convention has been established. The variable
+attribute “_Unsigned” is reserved for this purpose in future
+implementations.
+
+Note on char data: Although the characters used in netCDF names must
+be encoded as UTF-8, character data may use other encodings. The
+variable attribute “_Encoding” is reserved for this purpose in future
+implementations.
+
+Note on fill values: Because data variables may be created before
+their values are written, and because values need not be written
+sequentially in a netCDF file, default “fill values” are defined for
+each type, for initializing data values before they are explicitly
+written. This makes it possible to detect reading values that were
+never written. The variable attribute “_FillValue”, if present,
+overrides the default fill value for a variable. If _FillValue is
+defined then it should be scalar and of the same type as the variable.
+
+Fill values are not required, however, because netCDF libraries have
+traditionally supported a “no fill” mode when writing, omitting the
+initialization of variable values with fill values. This makes the
+creation of large files faster, but also eliminates the possibility of
+detecting the inadvertent reading of values that haven't been written.
+
+\section computing_offsets Notes on Computing File Offsets
+
+The offset (position within the file) of a specified data value in a
+classic format or 64-bit offset data file is completely determined by
+the variable start location (the offset in the begin field), the
+external type of the variable (the nc_type field), and the dimension
+indices (one for each of the variable's dimensions) of the value
+desired.
+
+The external size in bytes of one data value for each possible netCDF
+type, denoted extsize below, is:
+- NC_BYTE 	1
+- NC_CHAR 	1
+- NC_SHORT 	2
+- NC_INT 	4
+- NC_FLOAT 	4
+- NC_DOUBLE 	8
+
+The record size, denoted by recsize below, is the sum of the vsize
+fields of record variables (variables that use the unlimited
+dimension), using the actual value determined by dimension sizes and
+variable type in case the vsize field is too small for the variable
+size.
+
+To compute the offset of a value relative to the beginning of a
+variable, it is helpful to precompute a “product vector” from the
+dimension lengths. Form the products of the dimension lengths for the
+variable from right to left, skipping the leftmost (record) dimension
+for record variables, and storing the results as the product vector
+for each variable.
+
+For example:
+
+\code
+Non-record variable:
+
+dimension lengths: [ 5 3 2 7] product vector: [210 42 14 7]
+
+Record variable:
+
+dimension lengths: [0 2 9 4] product vector: [0 72 36 4]
+\endcode
+
+At this point, the leftmost product, when rounded up to the next
+multiple of 4, is the variable size, vsize, in the grammar above. For
+example, in the non-record variable above, the value of the vsize
+field is 212 (210 rounded up to a multiple of 4). For the record
+variable, the value of vsize is just 72, since this is already a
+multiple of 4.
+
+Let coord be the array of coordinates (dimension indices, zero-based)
+of the desired data value. Then the offset of the value from the
+beginning of the file is just the file offset of the first data value
+of the desired variable (its begin field) added to the inner product
+of the coord and product vectors times the size, in bytes, of each
+datum for the variable. Finally, if the variable is a record variable,
+the product of the record number, 'coord[0]', and the record size,
+recsize, is added to yield the final offset value.
+
+A special case: Where there is exactly one record variable, we drop
+the requirement that each record be four-byte aligned, so in this case
+there is no record padding.
+
+\subsection offset_examples Examples
+
+By using the grammar above, we can derive the smallest valid netCDF
+file, having no dimensions, no variables, no attributes, and hence, no
+data. A CDL representation of the empty netCDF file is
+
+\code
+netcdf empty { }
+\endcode
+
+This empty netCDF file has 32 bytes. It begins with the four-byte
+“magic number” that identifies it as a netCDF version 1 file: ‘C’,
+‘D’, ‘F’, ‘\\x01’. Following are seven 32-bit integer zeros
+representing the number of records, an empty list of dimensions, an
+empty list of global attributes, and an empty list of variables.
+
+Below is an (edited) dump of the file produced using the Unix command
+
+\code
+od -xcs empty.nc
+\endcode
+
+Each 16-byte portion of the file is displayed with 4 lines. The first
+line displays the bytes in hexadecimal. The second line displays the
+bytes as characters. The third line displays each group of two bytes
+interpreted as a signed 16-bit integer. The fourth line (added by
+human) presents the interpretation of the bytes in terms of netCDF
+components and values.
+
+\code
+        4344    4601    0000    0000    0000    0000    0000    0000
+       C   D   F 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+       17220   17921   00000   00000   00000   00000   00000   00000
+     [magic number ] [  0 records  ] [  0 dimensions   (ABSENT)    ]
+
+        0000    0000    0000    0000    0000    0000    0000    0000
+      \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+       00000   00000   00000   00000   00000   00000   00000   00000
+     [  0 global atts  (ABSENT)    ] [  0 variables    (ABSENT)    ]
+\endcode
+
+As a less trivial example, consider the CDL
+
+\code
+     netcdf tiny {
+     dimensions:
+             dim = 5;
+     variables:
+             short vx(dim);
+     data:
+             vx = 3, 1, 4, 1, 5 ;
+     }
+\endcode
+
+which corresponds to a 92-byte netCDF file. The following is an edited dump of this file:
+
+\code
+        4344    4601    0000    0000    0000    000a    0000    0001
+       C   D   F 001  \0  \0  \0  \0  \0  \0  \0  \n  \0  \0  \0 001
+       17220   17921   00000   00000   00000   00010   00000   00001
+     [magic number ] [  0 records  ] [NC_DIMENSION ] [ 1 dimension ]
+
+        0000    0003    6469    6d00    0000    0005    0000    0000
+      \0  \0  \0 003   d   i   m  \0  \0  \0  \0 005  \0  \0  \0  \0
+       00000   00003   25705   27904   00000   00005   00000   00000
+     [  3 char name = "dim"        ] [ size = 5    ] [ 0 global atts
+
+        0000    0000    0000    000b    0000    0001    0000    0002
+      \0  \0  \0  \0  \0  \0  \0 013  \0  \0  \0 001  \0  \0  \0 002
+       00000   00000   00000   00011   00000   00001   00000   00002
+      (ABSENT)     ] [NC_VARIABLE  ] [ 1 variable  ] [ 2 char name =
+
+        7678    0000    0000    0001    0000    0000    0000    0000
+       v   x  \0  \0  \0  \0  \0 001  \0  \0  \0  \0  \0  \0  \0  \0
+       30328   00000   00000   00001   00000   00000   00000   00000
+      "vx"         ] [1 dimension  ] [ with ID 0   ] [ 0 attributes
+
+        0000    0000    0000    0003    0000    000c    0000    0050
+      \0  \0  \0  \0  \0  \0  \0 003  \0  \0  \0  \f  \0  \0  \0   P
+       00000   00000   00000   00003   00000   00012   00000   00080
+      (ABSENT)     ] [type NC_SHORT] [size 12 bytes] [offset:    80]
+
+        0003    0001    0004    0001    0005    8001
+      \0 003  \0 001  \0 004  \0 001  \0 005 200 001
+       00003   00001   00004   00001   00005  -32767
+     [    3] [    1] [    4] [    1] [    5] [fill ]
+\endcode
+
+\section offset_format_spec The 64-bit Offset Format
+
+The netCDF 64-bit offset format differs from the classic format only
+in the VERSION byte, ‘\\x02’ instead of ‘\\x01’, and the OFFSET entity,
+a 64-bit instead of a 32-bit offset from the beginning of the
+file. This small format change permits much larger files, but there
+are still some practical size restrictions. Each fixed-size variable
+and the data for one record's worth of each record variable are still
+limited in size to a little less that 4 GiB. The rationale for this
+limitation is to permit aggregate access to all the data in a netCDF
+variable (or a record's worth of data) on 32-bit platforms.
+
+\section netcdf_4_spec The NetCDF-4 Format
+
+The netCDF-4 format implements and expands the netCDF-3 data model by
+using an enhanced version of HDF5 as the storage layer. Use is made of
+features that are only available in HDF5 version 1.8 and later.
+
+Using HDF5 as the underlying storage layer, netCDF-4 files remove many
+of the restrictions for classic and 64-bit offset files. The richer
+enhanced model supports user-defined types and data structures,
+hierarchical scoping of names using groups, additional primitive types
+including strings, larger variable sizes, and multiple unlimited
+dimensions. The underlying HDF5 storage layer also supports
+per-variable compression, multidimensional tiling, and efficient
+dynamic schema changes, so that data need not be copied when adding
+new variables to the file schema.
+
+Creating a netCDF-4/HDF5 file with netCDF-4 results in an HDF5
+file. The features of netCDF-4 are a subset of the features of HDF5,
+so the resulting file can be used by any existing HDF5 application.
+
+Although every file in netCDF-4 format is an HDF5 file, there are HDF5
+files that are not netCDF-4 format files, because the netCDF-4 format
+intentionally uses a limited subset of the HDF5 data model and file
+format features. Some HDF5 features not supported in the netCDF
+enhanced model and netCDF-4 format include non-hierarchical group
+structures, HDF5 reference types, multiple links to a data object,
+user-defined atomic data types, stored property lists, more permissive
+rules for data object names, the HDF5 date/time type, and attributes
+associated with user-defined types.
+
+A complete specification of HDF5 files is beyond the scope of this
+document. For more information about HDF5, see the HDF5 web site:
+http://hdf.ncsa.uiuc.edu/HDF5/.
+
+The specification that follows is sufficient to allow HDF5 users to
+create files that will be accessable from netCDF-4.
+
+\subsection creation_order Creation Order
+
+The netCDF API maintains the creation order of objects that are
+created in the file. The same is not true in HDF5, which maintains the
+objects in alphabetical order. Starting in version 1.8 of HDF5, the
+ability to maintain creation order was added. This must be explicitly
+turned on in the HDF5 data file in several ways.
+
+Each group must have link and attribute creation order set. The
+following code (from libsrc4/nc4hdf.c) shows how the netCDF-4 library
+sets these when creating a group.
+
+\code
+           /* Create group, with link_creation_order set in the group
+            * creation property list. */
+           if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+              return NC_EHDFERR;
+           if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0)
+              BAIL(NC_EHDFERR);
+           if (H5Pset_attr_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0)
+              BAIL(NC_EHDFERR);
+           if ((grp->hdf_grpid = H5Gcreate2(grp->parent->hdf_grpid, grp->name,
+                                            H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+              BAIL(NC_EHDFERR);
+           if (H5Pclose(gcpl_id) < 0)
+              BAIL(NC_EHDFERR);
+\endcode
+
+Each dataset in the HDF5 file must be created with a property list for
+which the attribute creation order has been set to creation
+ordering. The H5Pset_attr_creation_order funtion is used to set the
+creation ordering of attributes of a variable.
+
+The following example code (from libsrc4/nc4hdf.c) shows how the
+creation ordering is turned on by the netCDF library.
+
+\code
+        /* Turn on creation order tracking. */
+        if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
+                                       H5P_CRT_ORDER_INDEXED) < 0)
+           BAIL(NC_EHDFERR);
+\endcode
+
+\subsection groups_spec Groups
+
+NetCDF-4 groups are the same as HDF5 groups, but groups in a netCDF-4
+file must be strictly hierarchical. In general, HDF5 permits
+non-hierarchical structuring of groups (for example, a group that is
+its own grandparent). These non-hierarchical relationships are not
+allowed in netCDF-4 files.
+
+In the netCDF API, the global attribute becomes a group-level
+attribute. That is, each group may have its own global attributes.
+
+The root group of a file is named “/” in the netCDF API, where names
+of groups are used. It should be noted that the netCDF API (like the
+HDF5 API) makes little use of names, and refers to entities by number.
+
+\subsection dims_spec Dimensions with HDF5 Dimension Scales
+
+Until version 1.8, HDF5 did not have any capability to represent
+shared dimensions. With the 1.8 release, HDF5 introduced the dimension
+scale feature to allow shared dimensions in HDF5 files.
+
+The dimension scale is unfortunately not exactly equivilent to the
+netCDF shared dimension, and this leads to a number of compromises in
+the design of netCDF-4.
+
+A netCDF shared dimension consists solely of a length and a name. An
+HDF5 dimension scale also includes values for each point along the
+dimension, information that is (optionally) included in a netCDF
+coordinate variable.
+
+To handle the case of a netCDF dimension without a coordinate
+variable, netCDF-4 creates dimension scales of type char, and leaves
+the contents of the dimension scale empty. Only the name and length of
+the scale are significant. To distinguish this case, netCDF-4 takes
+advantage of the NAME attribute of the dimension scale. (Not to be
+confused with the name of the scale itself.) In the case of dimensions
+without coordinate data, the HDF5 dimension scale NAME attribute is
+set to the string: "This is a netCDF dimension but not a netCDF
+variable."
+
+In the case where a coordinate variable is defined for a dimension,
+the HDF5 dimscale matches the type of the netCDF coordinate variable,
+and contains the coordinate data.
+
+A further difficulty arrises when an n-dimensional coordinate variable
+is defined, where n is greater than one. NetCDF allows such coordinate
+variables, but the HDF5 model does not allow dimension scales to be
+attached to other dimension scales, making it impossible to completely
+represent the multi-dimensional coordinate variables of the netCDF
+model.
+
+To capture this information, multidimensional coordinate variables
+have an attribute named _Netcdf4Coordinates. The attribute is an array
+of H5T_NATIVE_INT, with the netCDF dimension IDs of each of its
+dimensions.
+
+The _Netcdf4Coordinates attribute is otherwise hidden by the netCDF
+API. It does not appear as one of the attributes for the netCDF
+variable involved, except through the HDF5 API.
+
+\subsection dim_spec2 Dimensions without HDF5 Dimension Scales
+
+Starting with the netCDF-4.1 release, netCDF can read HDF5 files which
+do not use dimension scales. In this case the netCDF library assigns
+dimensions to the HDF5 dataset as needed, based on the length of the
+dimension.
+
+When an HDF5 file is opened, each dataset is examined in turn. The
+lengths of all the dimensions involved in the shape of the dataset are
+determined. Each new (i.e. previously unencountered) length results in
+the creation of a phony dimension in the netCDF API.
+
+This will not accurately detect a shared, unlimited dimension in the
+HDF5 file, if different datasets have different lengths along this
+dimension (possible in HDF5, but not in netCDF).
+
+Note that this is a read-only capability for the netCDF library. When
+the netCDF library writes HDF5 files, they always use a dimension
+scale for every dimension.
+
+Datasets must have either dimension scales for every dimension, or no
+dimension scales at all. Partial dimension scales are not, at this
+time, understood by the netCDF library.
+
+\subsection dim_spec3 Dimension and Coordinate Variable Ordering
+
+In order to preserve creation order, the netCDF-4 library writes
+variables in their creation order. Since some variables are also
+dimension scales, their order reflects both the order of the
+dimensions and the order of the coordinate variables.
+
+However, these may be different. Consider the following code:
+
+\code
+           /* Create a test file. */
+           if (nc_create(FILE_NAME, NC_CLASSIC_MODEL|NC_NETCDF4, &ncid)) ERR;
+
+           /* Define dimensions in order. */
+           if (nc_def_dim(ncid, DIM0, NC_UNLIMITED, &dimids[0])) ERR;
+           if (nc_def_dim(ncid, DIM1, 4, &dimids[1])) ERR;
+
+           /* Define coordinate variables in a different order. */
+           if (nc_def_var(ncid, DIM1, NC_DOUBLE, 1, &dimids[1], &varid[1])) ERR;
+           if (nc_def_var(ncid, DIM0, NC_DOUBLE, 1, &dimids[0], &varid[0])) ERR;
+\endcode
+
+In this case the order of the coordinate variables will be different
+from the order of the dimensions.
+
+In practice, this should make little difference in user code, but if
+the user is writing code that depends on the ordering of dimensions,
+the netCDF library was updated in version 4.1 to detect this
+condition, and add the attribute _Netcdf4Dimid to the dimension scales
+in the HDF5 file. This attribute holds a scalar H5T_NATIVE_INT which
+is the (zero-based) dimension ID for this dimension.
+
+If this attribute is present on any dimension scale, it must be
+present on all dimension scales in the file.
+
+\subsection vars_spec Variables
+
+Variables in netCDF-4/HDF5 files exactly correspond to HDF5
+datasets. The data types match naturally between netCDF and HDF5.
+
+In netCDF classic format, the problem of endianness is solved by
+writing all data in big-endian order. The HDF5 library allows data to
+be written as either big or little endian, and automatically reorders
+the data when it is read, if necessary.
+
+By default, netCDF uses the native types on the machine which writes
+the data. Users may change the endianness of a variable (before any
+data are written). In that case the specified endian type will be used
+in HDF5 (for example, a H5T_STD_I16LE will be used for NC_SHORT, if
+little-endian has been specified for that variable.)
+- NC_BYTE = H5T_NATIVE_SCHAR
+- NC_UBYTE = H5T_NATIVE_SCHAR
+- NC_CHAR = H5T_C_S1
+- NC_STRING = variable length array of H5T_C_S1
+- NC_SHORT = H5T_NATIVE_SHORT
+- NC_USHORT = H5T_NATIVE_USHORT
+- NC_INT = H5T_NATIVE_INT
+- NC_UINT = H5T_NATIVE_UINT
+- NC_INT64 = H5T_NATIVE_LLONG
+- NC_UINT64 = H5T_NATIVE_ULLONG
+- NC_FLOAT = H5T_NATIVE_FLOAT
+- NC_DOUBLE = H5T_NATIVE_DOUBLE
+
+The NC_CHAR type represents a single character, and the NC_STRING an
+array of characters. This can be confusing because a one-dimensional
+array of NC_CHAR is used to represent a string (i.e. a scalar
+NC_STRING).
+
+An odd case may arise in which the user defines a variable with the
+same name as a dimension, but which is not intended to be the
+coordinate variable for that dimension. In this case the string
+"_nc4_non_coord_" is pre-pended to the name of the HDF5 dataset, and
+stripped from the name for the netCDF API.
+
+\subsection atts_spec Attributes
+
+Attributes in HDF5 and netCDF-4 correspond very closely. Each
+attribute in an HDF5 file is represented as an attribute in the
+netCDF-4 file, with the exception of the attributes below, which are
+ignored by the netCDF-4 API.
+- _Netcdf4Coordinates An integer array containing the dimension IDs of
+  a variable which is a multi-dimensional coordinate variable.
+- _nc3_strict When this (scalar, H5T_NATIVE_INT) attribute exists in
+  the root group of the HDF5 file, the netCDF API will enforce the
+  netCDF classic model on the data file.
+- REFERENCE_LIST This attribute is created and maintained by the HDF5
+  dimension scale API.
+- CLASS This attribute is created and maintained by the HDF5 dimension
+  scale API.
+- DIMENSION_LIST This attribute is created and maintained by the HDF5
+  dimension scale API.
+- NAME This attribute is created and maintained by the HDF5 dimension
+  scale API.
+- _Netcdf4Dimid Holds a scalar H5T_NATIVE_INT that is the (zero-based)
+  dimension ID for this dimension, needed when dimensions and
+  coordinate variables are defined in different orders.
+
+\subsection user_defined_spec User-Defined Data Types
+
+Each user-defined data type in an HDF5 file exactly corresponds to a
+user-defined data type in the netCDF-4 file. Only base data types
+which correspond to netCDF-4 data types may be used. (For example, no
+HDF5 reference data types may be used.)
+
+\subsection compression_spec Compression
+
+The HDF5 library provides data compression using the zlib library and
+the szlib library. NetCDF-4 only allows users to create data with the
+zlib library (due to licensing restrictions on the szlib
+library). Since HDF5 supports the transparent reading of the data with
+either compression filter, the netCDF-4 library can read data
+compressed with szlib (if the underlying HDF5 library is built to
+support szlib), but has no way to write data with szlib compression.
+
+With zlib compression (a.k.a. deflation) the user may set a deflation
+factor from 0 to 9. In our measurements the zero deflation level does
+not compress the data, but does incur the performance penalty of
+compressing the data. The netCDF API does not allow the user to write
+a variable with zlib deflation of 0 - when asked to do so, it turns
+off deflation for the variable instead. NetCDF can read an HDF5 file
+with deflation of zero, and correctly report that to the user.
+
+\section netcdf_4_classic_spec The NetCDF-4 Classic Model Format
+
+Every classic and 64-bit offset file can be represented as a netCDF-4
+file, with no loss of information. There are some significant benefits
+to using the simpler netCDF classic model with the netCDF-4 file
+format. For example, software that writes or reads classic model data
+can write or read netCDF-4 classic model format data by
+recompiling/relinking to a netCDF-4 API library, with no or only
+trivial changes needed to the program source code. The netCDF-4
+classic model format supports this usage by enforcing rules on what
+functions may be called to store data in the file, to make sure its
+data can be read by older netCDF applications (when relinked to a
+netCDF-4 library).
+
+Writing data in this format prevents use of enhanced model features
+such as groups, added primitive types not available in the classic
+model, and user-defined types. However performance features of the
+netCDF-4 formats that do not require additional features of the
+enhanced model, such as per-variable compression and chunking,
+efficient dynamic schema changes, and larger variable size limits,
+offer potentially significant performance improvements to readers of
+data stored in this format, without requiring program changes.
+
+When a file is created via the netCDF API with a CLASSIC_MODEL mode
+flag, the library creates an attribute (_nc3_strict) in the root
+group. This attribute is hidden by the netCDF API, but is read when
+the file is later opened, and used to ensure that no enhanced model
+features are written to the file.
+
+\section hdf4_sd_format HDF4 SD Format
+
+Starting with version 4.1, the netCDF libraries can read HDF4 SD
+(Scientific Dataset) files. Access is limited to those HDF4 files
+created with the Scientific Dataset API. Access is read-only.
+
+Dataset types are translated between HDF4 and netCDF in a
+straighforward manner.
+- DFNT_CHAR = NC_CHAR
+- DFNT_UCHAR, DFNT_UINT8 = NC_UBYTE
+- DFNT_INT8 = NC_BYTE
+- DFNT_INT16 = NC_SHORT
+- DFNT_UINT16 = NC_USHORT
+- DFNT_INT32 = NC_INT
+- DFNT_UINT32 = NC_UINT
+- DFNT_FLOAT32 = NC_FLOAT
+- DFNT_FLOAT64 = NC_DOUBLE
diff --git a/docs/guide.dox b/docs/guide.dox
index ee9f948..a9c4362 100644
--- a/docs/guide.dox
+++ b/docs/guide.dox
@@ -1,29 +1,17 @@
-/*! \page guide.dox The NetCDF User's Guide
+/*! \page user_guide The NetCDF User's Guide
 
-\brief The NetCDF User's Guide
+<H2>The sections of the netCDF User's Guide</H2>
 
-\tableofcontents
-
-\section user_guide The NetCDF User's Guide
-
-- \subpage netcdf_summary
 - \subpage netcdf_introduction
 - \subpage file_structure_and_performance
+- \subpage data_type
 - \subpage netcdf_data_set_components
 - \subpage netcdf_perf_chunking
 - \subpage netcdf_utilities_guide
-- \subpage file_format_specifications
+- \subpage dap_support
+- \subpage users_guide_appendices
 
-Data
-- \ref external_types
-- \ref classic_structures
-- \ref user_defined_types
-- \ref type_conversion
-- \ref data_access
-- \ref remote_client
-- \ref type_conversion
-
-\section netcdf_summary The Purpose of NetCDF
+<H2>The Purpose of NetCDF</H2>
 
 The purpose of the Network Common Data Form (netCDF) interface is to
 allow you to create, access, and share array-oriented data in a form
@@ -68,7 +56,7 @@ http://www.unidata.ucar.edu/software/netcdf-java.
 
 \tableofcontents
 
-\section netcdf_interface The NetCDF Interface
+\section netcdf_interface The netCDF Interface
 
 The Network Common Data Form, or netCDF, is an interface to a library
 of data access functions for storing and retrieving data in the form
@@ -115,8 +103,7 @@ netCDF software is freely available <a
 href="ftp://ftp.unidata.ucar.edu/pub/netcdf">via FTP</a> to encourage
 its widespread use.
 
-For detailed installation instructions, see <a
-href="http://www.unidata.ucar.edu/netcdf/docs/building.html" >Building NetCDF</a>.
+For detailed installation instructions, see \ref getting_and_building_netcdf.
 
 \section netcdf_format The netCDF File Format
 
@@ -235,6 +222,21 @@ better).
 
 For more discussion of format issues see The NetCDF Tutorial.
 
+\section architecture NetCDF Library Architecture
+
+\image html netcdf_architecture.png "NetCDF Architecture"
+\image latex netcdf_architecture.png "NetCDF Architecture"
+\image rtf netcdf_architecture.png "NetCDF Architecture"
+
+
+The netCDF C-based libraries depend on a core C library and some externally developed libraries.
+
+- NetCDF-Java is an independent implementation, not shown here
+- C-based 3rd-party netCDF APIs for other languages include Python, Ruby, Perl, Fortran-2003, MATLAB, IDL, and R
+- Libraries that don't support netCDF-4 include Perl and old C++
+- 3rd party libraries are optional (HDF5, HDF4, zlib, szlib, pnetcdf, libcurl), depending on what features are needed and how netCDF is configured
+- "Apps" in the above means applications, not mobile apps!
+
 \section performance What about Performance?
 
 One of the goals of netCDF is to support efficient access to small
@@ -288,7 +290,7 @@ conventions are often needed for local use. These should be
 contributed to the above netCDF conventions site if likely to interest
 other users in similar areas.
 
-\section limitations Limitations of NetCDF
+\section limitations Limitations of netCDF
 
 The netCDF classic data model is widely applicable to data that can be
 organized into a collection of named array variables with named
@@ -776,238 +778,6 @@ others not. In this case the compression and decompression of data
 happen transparently to the user, and the data may be stored, read,
 and written compressed.
 
-\section attribute_conventions Attribute Conventions
-
-Attribute conventions are assumed by some netCDF generic applications,
-e.g., ‘units’ as the name for a string attribute that gives the units
-for a netCDF variable.
-
-It is strongly recommended that applicable conventions be followed
-unless there are good reasons for not doing so. Below we list the
-names and meanings of recommended standard attributes that have proven
-useful. Note that some of these (e.g. units, valid_range,
-scale_factor) assume numeric data and should not be used with
-character data.
-
-\note Attribute names commencing with underscore ('_') are reserved
-for use by the netCDF library.
-
-\subsection units Units
-
-A character string that specifies the units used for the variable's
-data. Unidata has developed a freely-available library of routines to
-convert between character string and binary forms of unit
-specifications and to perform various useful operations on the binary
-forms. This library is used in some netCDF applications. Using the
-recommended units syntax permits data represented in conformable units
-to be automatically converted to common units for arithmetic
-operations. For more information see Units.
-
-\subsection long_name Long Name
-
-A long descriptive name. This could be used for labeling plots, for
-example. If a variable has no long_name attribute assigned, the
-variable name should be used as a default.
-
-\subsection _FillValue FillValue
-
-The _FillValue attribute specifies the fill value used to pre-fill
-disk space allocated to the variable. Such pre-fill occurs unless
-nofill mode is set using nc_set_fill(). The fill value is returned
-when reading values that were never written. If ::_FillValue is defined
-then it should be scalar and of the same type as the variable. If the
-variable is packed using scale_factor and add_offset attributes (see
-below), the _FillValue attribute should have the data type of the
-packed data.
-
-It is not necessary to define your own _FillValue attribute for a
-variable if the default fill value for the type of the variable is
-adequate. However, use of the default fill value for data type byte is
-not recommended. Note that if you change the value of this attribute,
-the changed value applies only to subsequent writes; previously
-written data are not changed.
-
-Generic applications often need to write a value to represent
-undefined or missing values. The fill value provides an appropriate
-value for this purpose because it is normally outside the valid range
-and therefore treated as missing when read by generic applications. It
-is legal (but not recommended) for the fill value to be within the
-valid range.
-
-\subsection missing_value Missing Value
-
-This attribute is not treated in any special way by the library or
-conforming generic applications, but is often useful documentation and
-may be used by specific applications. The missing_value attribute can
-be a scalar or vector containing values indicating missing data. These
-values should all be outside the valid range so that generic
-applications will treat them as missing.
-
-When scale_factor and add_offset are used for packing, the value(s) of
-the missing_value attribute should be specified in the domain of the
-data in the file (the packed data), so that missing values can be
-detected before the scale_factor and add_offset are applied.
-valid_min A scalar specifying the minimum valid value for this
-variable.  valid_max A scalar specifying the maximum valid value for
-this variable.  valid_range A vector of two numbers specifying the
-minimum and maximum valid values for this variable, equivalent to
-specifying values for both valid_min and valid_max attributes. Any of
-these attributes define the valid range. The attribute valid_range
-must not be defined if either valid_min or valid_max is defined.
-
-Generic applications should treat values outside the valid range as
-missing. The type of each valid_range, valid_min and valid_max
-attribute should match the type of its variable (except that for byte
-data, these can be of a signed integral type to specify the intended
-range).
-
-If neither valid_min, valid_max nor valid_range is defined then
-generic applications should define a valid range as follows. If the
-data type is byte and _FillValue is not explicitly defined, then the
-valid range should include all possible values. Otherwise, the valid
-range should exclude the _FillValue (whether defined explicitly or by
-default) as follows. If the _FillValue is positive then it defines a
-valid maximum, otherwise it defines a valid minimum. For integer
-types, there should be a difference of 1 between the _FillValue and
-this valid minimum or maximum. For floating point types, the
-difference should be twice the minimum possible (1 in the least
-significant bit) to allow for rounding error.
-
-If the variable is packed using scale_factor and add_offset attributes
-(see below), the _FillValue, missing_value, valid_range, valid_min, or
-valid_max attributes should have the data type of the packed data.
-
-\subsection scale_factor Scale Factor
-
-If present for a variable, the data are to be multiplied by this
-factor after the data are read by the application that accesses the
-data.
-
-If valid values are specified using the valid_min, valid_max,
-valid_range, or _FillValue attributes, those values should be
-specified in the domain of the data in the file (the packed data), so
-that they can be interpreted before the scale_factor and add_offset
-are applied.
-
-\subsection add_offset Add Offset
-
-If present for a variable, this number is to be added to the data
-after it is read by the application that accesses the data. If both
-scale_factor and add_offset attributes are present, the data are first
-scaled before the offset is added. The attributes scale_factor and
-add_offset can be used together to provide simple data compression to
-store low-resolution floating-point data as small integers in a netCDF
-dataset. When scaled data are written, the application should first
-subtract the offset and then divide by the scale factor, rounding the
-result to the nearest integer to avoid a bias caused by truncation
-towards zero.
-
-When scale_factor and add_offset are used for packing, the associated
-variable (containing the packed data) is typically of type byte or
-short, whereas the unpacked values are intended to be of type float or
-double. The attributes scale_factor and add_offset should both be of
-the type intended for the unpacked data, e.g. float or double.
-
-\subsection coordinates Coordinates
-
-Following the CF (Climate and Forecast) conventions for netCDF
-metadata, we define an <em>auxiliary coordinate variable</em> as any netCDF
-variable that contains coordinate data, but is not a coordinate
-variable (See \ref coordinate_variables).  Unlike coordinate
-variables, there is no relationship between the name of an auxiliary
-coordinate variable and the name(s) of its dimension(s).
-
-The value of the coordinates attribute is a blank separated list of
-names of auxiliary coordinate variables and (optionally) coordinate
-variables.  There is no restriction on the order in which the variable
-names appear in the coordinates attribute string.
-
-\subsection signedness Signedness
-
-Deprecated attribute, originally designed to indicate whether byte
-values should be treated as signed or unsigned. The attributes
-valid_min and valid_max may be used for this purpose. For example, if
-you intend that a byte variable store only non-negative values, you
-can use valid_min = 0 and valid_max = 255. This attribute is ignored
-by the netCDF library.
-
-\subsection C_format C Format
-
-\tableofcontents
-
-A character array providing the format that should be used by C
-applications to print values for this variable. For example, if you
-know a variable is only accurate to three significant digits, it would
-be appropriate to define the C_format attribute as "%.3g". The ncdump
-utility program uses this attribute for variables for which it is
-defined. The format applies to the scaled (internal) type and value,
-regardless of the presence of the scaling attributes scale_factor and
-add_offset.
-
-\subsection FORTRAN_format FORTRAN format
-
-A character array providing the format that should be used by FORTRAN
-applications to print values for this variable. For example, if you
-know a variable is only accurate to three significant digits, it would
-be appropriate to define the FORTRAN_format attribute as "(G10.3)".
-
-\subsection title Title
-
-A global attribute that is a character array providing a succinct
-description of what is in the dataset.
-
-\subsection history History
-
-A global attribute for an audit trail. This is a character array with
-a line for each invocation of a program that has modified the
-dataset. Well-behaved generic netCDF applications should append a line
-containing: date, time of day, user name, program name and command
-arguments.
-
-\subsection Conventions Conventions
-
-If present, 'Conventions' is a global attribute that is a character
-array for the name of the conventions followed by the
-dataset. Originally, these conventions were named by a string that was
-interpreted as a directory name relative to the directory
-/pub/netcdf/Conventions/ on the host ftp.unidata.ucar.edu. The web
-page http://www.unidata.ucar.edu/netcdf/conventions.html is now the
-preferred and authoritative location for registering a URI reference
-to a set of conventions maintained elsewhere. The FTP site will be
-preserved for compatibility with existing references, but authors of
-new conventions should submit a request to
-support-netcdf at unidata.ucar.edu for listing on the Unidata conventions
-web page.
-
-It may be convenient for defining institutions and groups to use a
-hierarchical structure for general conventions and more specialized
-conventions. For example, if a group named NUWG agrees upon a set of
-conventions for dimension names, variable names, required attributes,
-and netCDF representations for certain discipline-specific data
-structures, they may store a document describing the agreed-upon
-conventions in a dataset in the NUWG/ subdirectory of the Conventions
-directory. Datasets that followed these conventions would contain a
-global Conventions attribute with value "NUWG".
-
-Later, if the group agrees upon some additional conventions for a
-specific subset of NUWG data, for example time series data, the
-description of the additional conventions might be stored in the
-NUWG/Time_series/ subdirectory, and datasets that adhered to these
-additional conventions would use the global Conventions attribute with
-value "NUWG/Time_series", implying that this dataset adheres to the
-NUWG conventions and also to the additional NUWG time-series
-conventions.
-
-It is possible for a netCDF file to adhere to more than one set of
-conventions, even when there is no inheritance relationship among the
-conventions. In this case, the value of the 'Conventions' attribute
-may be a single text string containing a list of the convention names
-separated by blank space (recommended) or commas (if a convention name
-contains blanks).
-
-Typical conventions web sites will include references to documents in
-some form agreed upon by the community that supports the conventions
-and examples of netCDF file structures that follow the conventions.
 
 \section background Background and Evolution of the NetCDF Interface
 
@@ -1823,674 +1593,6 @@ release stage. It is tested in libsrc4/tst_interops.c, which contains
 some examples of how to create HDF5 files, modify them in netCDF-4,
 and then verify them in HDF5. (And vice versa).
 
-\section dap_support DAP Support
-
-Beginning with netCDF version 4.1, optional support is provided for
-accessing data through OPeNDAP servers using the DAP protocol.
-Currently, only DAP protocol version 2 is supported; DAP protocol
-version 4 support is under development.
-
-DAP support is automatically enabled if a usable curl library can be
-set using the LDFLAGS environment variable (similar to the way
-that the HDF5 libraries are referenced).
-DAP support can forcibly be enabled or disabled using the --enable-dap
-flag or the --disable-dap flag, respectively.  If enabled,
-then DAP2 support requires access to the curl library.
-Refer to the installation manual for details
-
-DAP uses a data model that is different from that supported by netCDF,
-either classic or enhanced. Generically, the DAP data model is encoded
-textually in a DDS (Dataset Descriptor Structure). There is a second
-data model for DAP attributes, which is encoded textually in a DAS
-(Dataset Attribute Structure). For detailed information about the DAP
-DDS and DAS, refer to the OPeNDAP web site http://opendap.org.
-
-\subsection Accessing OPeNDAP Data
-
-In order to access an OPeNDAP data source through the netCDF API, the
-file name normally used is replaced with a URL with a specific
-format. The URL is composed of three parts.
- -  URL - this is a standard form URL such as
-    http://remotetest.unidata.ucar.edu/dts/test.01
-
- -  Constraints - these are suffixed to the URL and take the form
-    “?\<projections>&\<selections>”. The meaning of the terms projection
-    and selection is somewhat complicated; and the OPeNDAP web site,
-    http://www.opendap.org, should be consulted. The interaction of DAP
-    constraints with netCDF is complex and at the moment requires an
-    understanding of how DAP is translated to netCDF.
-
- - Client parameters - these may be specified in either of
-   two ways.  The older, deprecated form prefixes text to the
-   front of the url and is of the the general form [\<name>]
-   or [\<name>=value].  Examples include [show=fetch] and
-   [noprefetch].  The newer, preferred form prefixes the
-   parameters to the end of the url using the semi-standard '#'
-   format: e.g. http://....#show=fetch&noprefetch.
-
-It is possible to see what the translation does to a particular DAP
-data source in either of two ways. First, one can examine the DDS
-source through a web browser and then examine the translation using
-the ncdump -h command to see the netCDF Classic translation. The
-ncdump output will actually be the union of the DDS with the DAS, so
-to see the complete translation, it is necessary to view both.
-
-For example, if a web browser is given the following, the first URL
-will return the DDS for the specified dataset, and the second URL will
-return the DAS for the specified dataset.
-
-\code
-     http://remotetest.unidata.ucar.edu/dts/test.01.dds
-     http://remotetest.unidata.ucar.edu/dts/test.01.das
-\endcode
-
-Then by using the following ncdump command, it is possible to see the
-equivalent netCDF Classic translation.
-
-\code
-     ncdump -h http://remotetest.unidata.ucar.edu/dts/test.01
-\endcode
-
-The DDS output from the web server should look like this.
-
-\code
-Dataset {
-    Byte b;
-    Int32 i32;
-    UInt32 ui32;
-    Int16 i16;
-    UInt16 ui16;
-    Float32 f32;
-    Float64 f64;
-    String s;
-    Url u;
-} SimpleTypes;
-\endcode
-
-The DAS output from the web server should look like this.
-
-\code
-Attributes {
-    Facility {
-        String PrincipleInvestigator ``Mark Abbott'', ``Ph.D'';
-        String DataCenter ``COAS Environmental Computer Facility'';
-        String DrifterType ``MetOcean WOCE/OCM'';
-    }
-    b {
-        String Description ``A test byte'';
-        String units ``unknown'';
-    }
-    i32 {
-        String Description ``A 32 bit test server int'';
-        String units ``unknown'';
-    }
-}
-\endcode
-
-The output from ncdump should look like this.
-
-\code
-netcdf test {
-dimensions:
-	stringdim64 = 64 ;
-variables:
-	byte b ;
-		b:Description = "A test byte" ;
-		b:units = "unknown" ;
-	int i32 ;
-		i32:Description = "A 32 bit test server int" ;
-		i32:units = "unknown" ;
-	int ui32 ;
-	short i16 ;
-	short ui16 ;
-	float f32 ;
-	double f64 ;
-	char s(stringdim64) ;
-	char u(stringdim64) ;
-}
-\endcode
-
-Note that the fields of type String and type URL have suddenly
-acquired a dimension. This is because strings are translated to arrays
-of char, which requires adding an extra dimension. The size of the
-dimension is determined in a variety of ways and can be specified. It
-defaults to 64 and when read, the underlying string is either padded
-or truncated to that length.
-
-Also note that the Facility attributes do not appear in the
-translation because they are neither global nor associated with a
-variable in the DDS.
-
-Alternately, one can get the text of the DDS as a global attribute by
-using the client parameters mechanism . In this case, the parameter
-“show=dds” can be used, and the data retrieved using
-the following command
-
-\code
-     ncdump -h http://remotetest.unidata.ucar.edu/dts/test.01.dds#show=dds
-\endcode
-
-The ncdump -h command will then show both the translation and the
-original DDS. In the above example, the DDS would appear as the global
-attribute “_DDS” as follows.
-
-\code
-netcdf test {
-...
-variables:
-        :_DDS = "Dataset { Byte b; Int32 i32; UInt32 ui32; Int16 i16;
-                 UInt16 ui16; Float32 f32; Float64 f64;
-                 Strings; Url u; } SimpleTypes;"
-
-	byte b ;
-...
-}
-\endcode
-
-\subsection dap_to_netcdf DAP to NetCDF Translation Rules
-
-Currently only one translation available: DAP 2 Protocol to netCDF-3.
-There used to be a DAP 2 Protocol to netCDF-4 translation
-but that has been removed until the DAP4 protocol is available.
-
-\subsubsection nc3_trans_rules netCDF-3 Translation Rules
-
-The current default translation code translates the OPeNDAP protocol
-to netCDF-3 (classic). This netCDF-3 translation converts an OPeNDAP
-DAP protocol version 2 DDS to netCDF-3 and is designed to mimic as
-closely as possible the translation provided by the libnc-dap
-system, except that some errors in that older translation have
-been fixed.
-
-For illustrative purposes, the following example will be used.
-
-\code
-Dataset {
-  Int32 f1;
-  Structure {
-    Int32 f11;
-    Structure {
-      Int32 f1[3];
-      Int32 f2;
-    } FS2[2];
-  } S1;
-  Structure {
-    Grid {
-      Array:
-        Float32 temp[lat=2][lon=2];
-      Maps:
-        Int32 lat[lat=2];
-        Int32 lon[lon=2];
-    } G1;
-  } S2;
-  Grid {
-      Array:
-        Float32 G2[lat=2][lon=2];
-      Maps:
-        Int32 lat[2];
-        Int32 lon[2];
-  } G2;
-  Int32 lat[lat=2];
-  Int32 lon[lon=2];
-} D1;
-\code
-
-\subsubsection var_def Variable Definition
-
-The set of netCDF variables is derived from the fields with primitive
-base types as they occur in Sequences, Grids, and Structures. The
-field names are modified to be fully qualified initially. For the
-above, the set of variables are as follows. The coordinate variables
-within grids are left out in order to mimic the behavior of libnc-dap.
-
-\code
-    f1
-    S1.f11
-    S1.FS2.f1
-    S1.FS2.f2
-    S2.G1.temp
-    S2.G2.G2
-    lat
-    lon
-\endcode
-
-\subsection var_dim_trans Variable Dimension Translation
-
-A variable's rank is determined from three sources.
-- The variable has the dimensions associated with the field it
-represents (e.g. S1.FS2.f1[3] in the above example).
-- The variable inherits the dimensions associated with any containing
-structure that has a rank greater than zero. These dimensions precede
-those of case 1. Thus, we have in our example, f1[2][3], where the
-first dimension comes from the containing Structure FS2[2].
-- The variable's set of dimensions are altered if any of its
-containers is a DAP DDS Sequence. This is discussed more fully below.
-
-If the type of the netCDF variable is char, then an extra string
-dimension is added as the last dimension.
-
-\subsubsection dim_trans Dimension translation
-
-For dimensions, the rules are as follows.
-
-Fields in dimensioned structures inherit the dimension of the
-structure; thus the above list would have the following dimensioned
-variables.
-
-\code
-        S1.FS2.f1 -> S1.FS2.f1[2][3]
-        S1.FS2.f2 -> S1.FS2.f2[2]
-        S2.G1.temp -> S2.G1.temp[lat=2][lon=2]
-        S2.G1.lat -> S2.G1.lat[lat=2]
-        S2.G1.lon -> S2.G1.lon[lon=2]
-        S2.G2.G2 -> S2.G2.lon[lat=2][lon=2]
-        S2.G2.lat -> S2.G2.lat[lat=2]
-        S2.G2.lon -> S2.G2.lon[lon=2]
-        lat -> lat[lat=2]
-        lon -> lon[lon=2]
-\endcode
-
-Collect all of the dimension specifications from the DDS, both named
-and anonymous (unnamed) For each unique anonymous dimension with value
-NN create a netCDF dimension of the form "XX_<i>=NN", where XX is the
-fully qualified name of the variable and i is the i'th (inherited)
-dimension of the array where the anonymous dimension occurs. For our
-example, this would create the following dimensions.
-
-\code
-        S1.FS2.f1_0 = 2 ;
-        S1.FS2.f1_1 = 3 ;
-        S1.FS2.f2_0 = 2 ;
-        S2.G2.lat_0 = 2 ;
-        S2.G2.lon_0 = 2 ;
-\endcode
-
-If however, the anonymous dimension is the single dimension of a MAP
-vector in a Grid then the dimension is given the same name as the map
-vector This leads to the following.
-
-\code
-        S2.G2.lat_0 -> S2.G2.lat
-        S2.G2.lon_0 -> S2.G2.lon
-\endcode
-
-For each unique named dimension "<name>=NN", create a netCDF dimension
-of the form "<name>=NN", where name has the qualifications removed. If
-this leads to duplicates (i.e. same name and same value), then the
-duplicates are ignored. This produces the following.
-
-\code
-        S2.G2.lat -> lat
-        S2.G2.lon -> lon
-\endcode
-
-Note that this produces duplicates that will be ignored later.
-
-At this point the only dimensions left to process should be named
-dimensions with the same name as some dimension from step number 3,
-but with a different value. For those dimensions create a dimension of
-the form "<name>M=NN" where M is a counter starting at 1. The example
-has no instances of this.
-
-Finally and if needed, define a single UNLIMITED dimension named
-"unlimited" with value zero. Unlimited will be used to handle certain
-kinds of DAP sequences (see below).
-
-This leads to the following set of dimensions.
-
-\code
-dimensions:
-  unlimited = UNLIMITED;
-  lat = 2 ;
-  lon = 2 ;
-  S1.FS2.f1_0 = 2 ;
-  S1.FS2.f1_1 = 3 ;
-  S1.FS2.f2_0 = 2 ;
-\endcode
-
-\subsection var_name_trans Variable Name Translation
-
-The steps for variable name translation are as follows.
-
-Take the set of variables captured above. Thus for the above DDS, the
-following fields would be collected.
-
-\code
-        f1
-        S1.f11
-        S1.FS2.f1
-        S1.FS2.f2
-        S2.G1.temp
-        S2.G2.G2
-        lat
-        lon
-\endcode
-
-All grid array variables are renamed to be the same as the containing
-grid and the grid prefix is removed. In the above DDS, this results in
-the following changes.
-
-\code
-        G1.temp -> G1
-        G2.G2 -> G2
-\endcode
-
-It is important to note that this process could produce duplicate
-variables (i.e. with the same name); in that case they are all assumed
-to have the same content and the duplicates are ignored. If it turns
-out that the duplicates have different content, then the translation
-will not detect this. YOU HAVE BEEN WARNED.
-
-The final netCDF-3 schema (minus attributes) is then as follows.
-
-\code
-netcdf t {
-dimensions:
-        unlimited = UNLIMITED ;
-        lat = 2 ;
-        lon = 2 ;
-        S1.FS2.f1_0 = 2 ;
-        S1.FS2.f1_1 = 3 ;
-        S1.FS2.f2_0 = 2 ;
-variables:
-        int f1 ;
-        int lat(lat) ;
-        int lon(lon) ;
-        int S1.f11 ;
-	int S1.FS2.f1(S1.FS2.f1_0, S1.FS2.f1_1) ;
-        int S1.FS2.f2(S1_FS2_f2_0) ;
-        float S2.G1(lat, lon) ;
-        float G2(lat, lon) ;
-}
-\endcode
-
-In actuality, the unlimited dimension is dropped because it is unused.
-
-There are differences with the original libnc-dap here because
-libnc-dap technically was incorrect. The original would have said
-this, for example.
-
-\code
-int S1.FS2.f1(lat, lat) ;
-\endcode
-
-Note that this is incorrect because it dimensions S1.FS2.f1(2,2)
-rather than S1.FS2.f1(2,3).
-
-\subsubsection translation Translating DAP DDS Sequences
-
-Any variable (as determined above) that is contained directly or
-indirectly by a Sequence is subject to revision of its rank using the
-following rules.
-
-Let the variable be contained in Sequence Q1, where Q1 is the
-innermost containing sequence. If Q1 is itself contained (directly or
-indirectly) in a sequence, or Q1 is contained (again directly or
-indirectly) in a structure that has rank greater than 0, then the
-variable will have an initial UNLIMITED dimension. Further, all
-dimensions coming from "above" and including (in the containment
-sense) the innermost Sequence, Q1, will be removed and replaced by
-that single UNLIMITED dimension. The size associated with that
-UNLIMITED is zero, which means that its contents are inaccessible
-through the netCDF-3 API. Again, this differs from libnc-dap, which
-leaves out such variables. Again, however, this difference is backward
-compatible.
-
-If the variable is contained in a single Sequence (i.e. not nested)
-and all containing structures have rank 0, then the variable will have
-an initial dimension whose size is the record count for that
-Sequence. The name of the new dimension will be the name of the
-Sequence.
-
-Consider this example.
-
-\code
-Dataset {
-  Structure {
-    Sequence {
-      Int32 f1[3];
-      Int32 f2;
-    } SQ1;
-  } S1[2];
-  Sequence {
-    Structure {
-      Int32 x1[7];
-    } S2[5];
-  } Q2;
-} D;
-\endcode
-
-The corresponding netCDF-3 translation is pretty much as follows (the
-value for dimension Q2 may differ).
-
-\code
-dimensions:
-    unlimited = UNLIMITED ; // (0 currently)
-    S1.SQ1.f1_0 = 2 ;
-    S1.SQ1.f1_1 = 3 ;
-    S1.SQ1.f2_0 = 2 ;
-    Q2.S2.x1_0 = 5 ;
-    Q2.S2.x1_1 = 7 ;
-    Q2 = 5 ;
-variables:
-    int S1.SQ1.f1(unlimited, S1.SQ1.f1_1) ;
-    int S1.SQ1.f2(unlimited) ;
-    int Q2.S2.x1(Q2, Q2.S2.x1_0, Q2.S2.x1_1) ;
-\endcode
-
-Note that for example S1.SQ1.f1_0 is not actually used because it has
-been folded into the unlimited dimension.
-
-Note that for sequences without a leading unlimited dimension, there
-is a performance cost because the translation code has to walk the
-data to determine how many records are associated with the
-sequence. Since libnc-dap did essentially the same thing, it can be
-assumed that the cost is not prohibitive.
-
-\subsubsection caching Caching
-
-In an effort to provide better performance for some access patterns,
-client-side caching of data is available. The default is no caching,
-but it may be enabled by prefixing the URL with the paramter "cache".
-
-Caching operates basically as follows.
-
-When a URL is first accessed using nc_open(), netCDF automatically
-does a pre-fetch of selected variables. These include all variables
-smaller than a specified (and user definable) size. This allows, for
-example, quick access to coordinate variables. This can be suppressed
-with the parameter "noprefetch".
-
-Whenever a request is made using some variant of the nc_get_var() API
-procedures, the complete variable is fetched and stored in the cache
-as a new cache entry. Subsequence requests for any part of that
-variable will access the cache entry to obtain the data.
-
-The cache may become too full, either because there are too many
-entries or because it is taking up too much disk space. In this case
-cache entries are purged until the cache size limits are reached. The
-cache purge algorithm is LRU (least recently used) so that variables
-that are repeatedly referenced will tend to stay in the cache.
-
-The cache is completely purged when nc_close() is invoked.
-
-In order to decide if you should enable caching, you will need to have
-some understanding of the access patterns of your program.
-
-The ncdump program always dumps one or more whole variables so it
-turns on caching.
-
-If your program accesses only parts of a number of variables, then
-caching should probably not be used since fetching whole variables
-will probably slow down your program for no purpose.
-
-Unfortunately, caching is currently an all or nothing proposition, so
-for more complex access patterns, the decision to cache or not may not
-have an obvious answer. Probably a good rule of thumb is to avoid
-caching initially and later turn it on to see its effect on
-performance.
-
-\subsubsection defined_params Defined Client Parameters
-
-Currently, a limited set of client parameters is
-recognized. Parameters not listed here are ignored, but no error is
-signalled.
-
-Parameter Name Legal Values Semantics
-- "log" | "log=<file>" - Turn on logging and send the log output to
-  the specified file. If no file is specified, then output is sent to standard
-  error.
-- "show=... das|dds|url" - This causes information to appear as
-  specific global attributes. The currently recognized tags are "dds"
-  to display the underlying DDS, "das" similarly, and "url" to display
-  the url used to retrieve the data. This parameter may be specified
-  multiple times (e.g. “show=dds&show=url”).
-- "show=fetch" - This parameter causes the netCDF code to log a copy
-  of the complete url for every HTTP get request. If logging is
-  enabled, then this can be helpful in checking to see the access
-  behavior of the netCDF code.
-- "stringlength=NN" - Specify the default string length to use for
-  string dimensions. The default is 64.
-- "stringlength_<var>=NN" - Specify the default string length to use
-  for a string dimension for the specified variable. The default is
-  64.
-- "cache" - This enables caching.
-- "cachelimit=NN" - Specify the maximum amount of space allowed for
-  the cache.
-- "cachecount=NN" - Specify the maximum number of entries in the
-  cache.
-- "noprefetch" - This disables prefetch of small variables.
-
-\subsubsection dap_debug Notes on Debugging OPeNDAP Access
-
-The OPeNDAP support makes use of the logging facility of the
-underlying oc system (see http://www.opendap.org/oc).
-Note that this is currently separate from the
-existing netCDF logging facility. Turning on this logging can
-sometimes give important information. Logging can be enabled by
-using the client parameter "log" or "log=filename",
-where the first case will send log output to standard error and the
-second will send log output to the specified file.
-
-Users should also be aware that if one is
-accessing data over an NFS mount, one may see some .nfsxxxxx files;
-those can be ignored.
-
-\subsubsection http_config HTTP Configuration.
-
-Limited support for configuring the http connection is provided via
-parameters in the “.dodsrc” configuration file. The relevant .dodsrc file is
-located by first looking in the current working directory, and if not
-found, then looking in the directory specified by the “$HOME”
-environment variable.
-
-Entries in the .dodsrc file are of the form:
-
-\code
-     ['['<url>']']<key>=<value>
-\endcode
-
-That is, it consists of a key name and value pair and optionally
-preceded by a url enclosed in square brackets.
-
-For given KEY and URL strings, the value chosen is as follows:
-
-If URL is null, then look for the .dodsrc entry that has no url prefix
-and whose key is same as the KEY for which we are looking.
-
-If the URL is not null, then look for all the .dodsrc entries that
-have a url, URL1, say, and for which URL1 is a prefix (in the string
-sense) of URL. For example, if URL = http//x.y/a, then it will match
-entries of the form
-
-\code
-              1. [http//x.y/a]KEY=VALUE
-              2. [http//x.y/a/b]KEY=VALUE
-\endcode
-
-It will not match an entry of the form
-
-\code
-              [http//x.y/b]KEY=VALUE
-\endcode
-
-because “http://x.y/b” is not a string prefix of
-“http://x.y/a”. Finally from the set so constructed, choose the entry
-with the longest url prefix: “http//x.y/a/b]KEY=VALUE” in this case.
-
-Currently, the supported set of keys (with descriptions) are as
-follows.
-
-<pre>
-    HTTP.VERBOSE
-        Type: boolean ("1"/"0")
-        Description: Produce verbose output, especially using SSL.
-        Related CURL Flags: CURLOPT_VERBOSE
-    HTTP.DEFLATE
-        Type: boolean ("1"/"0")
-        Description: Allow use of compression by the server.
-        Related CURL Flags: CURLOPT_ENCODING
-    HTTP.COOKIEJAR
-        Type: String representing file path
-        Description: Specify the name of file into which to store cookies. Defaults to in-memory storage.
-        Related CURL Flags:CURLOPT_COOKIEJAR
-    HTTP.CREDENTIALS.USER
-        Type: String representing user name
-        Description: Specify the user name for Digest and Basic authentication.
-        Related CURL Flags:
-    HTTP.CREDENTIALS.PASSWORD
-        Type: String representing password
-        Type: boolean ("1"/"0")
-        Description: Specify the password for Digest and Basic authentication.
-        Related CURL Flags:
-    HTTP.SSL.CERTIFICATE
-        Type: String representing file path
-        Description: Path to a file containing a PEM cerficate.
-        Related CURL Flags: CURLOPT_CERT
-    HTTP.SSL.KEY
-        Type: String representing file path
-        Description: Same as HTTP.SSL.CERTIFICATE, and should usually have the same value.
-        Related CURL Flags: CURLOPT_SSLKEY
-    HTTP.SSL.KEYPASSWORD
-        Type: String representing password
-        Description: Password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
-        Related CURL Flags: CURLOPT_KEYPASSWORD
-    HTTP.SSL.CAPATH
-        Type: String representing directory
-        Description: Path to a directory containing trusted certificates for validating server sertificates.
-        Related CURL Flags: CURLOPT_CAPATH
-    HTTP.SSL.VALIDATE
-        Type: boolean ("1"/"0")
-        Description: Cause the client to verify the server's presented certificate.
-        Related CURL Flags: CURLOPT_SSL_VERIFYPEER, CURLOPT_SSL_VERIFYHOST
-    HTTP.TIMEOUT
-        Type: String ("dddddd")
-        Description: Specify the maximum time in seconds that you allow the http transfer operation to take.
-        Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL
-    HTTP.PROXY_SERVER
-        Type: String representing url to access the proxy: (e.g.http://[username:password@]host[:port])
-        Description: Specify the needed information for accessing a proxy.
-        Related CURL Flags: CURLOPT_PROXY, CURLOPT_PROXYHOST, CURLOPT_PROXYUSERPWD
-</pre>
-
-The related curl flags line indicates the curl flags modified by this
-key. See the libcurl documentation of the curl_easy_setopt() function
-for more detail (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html).
-
-For ESG client side key support, the following entries must be specified:
-
-\code
-    HTTP.SSL.VALIDATE
-    HTTP.COOKIEJAR
-    HTTP.SSL.CERTIFICATE
-    HTTP.SSL.KEY
-    HTTP.SSL.CAPATH
-\endcode
-
-Additionally, for ESG, the HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY
-entries should have same value, which is the file path for the
-certificate produced by MyProxyLogon. The HTTP.SSL.CAPATH entry should
-be the path to the "certificates" directory produced by MyProxyLogon.
 
 \page netcdf_perf_chunking Improving Performance with Chunking
 
@@ -2977,7 +2079,7 @@ extended as necessary.
 The ncgen man-page reference has more details about CDL representation
 of constants of user-defined types.
 
-\section guide_ncdump ncdump
+\section ncdump_guide ncdump
 
 Convert NetCDF file to text form (CDL)
 
@@ -3256,7 +2358,7 @@ Copy a netCDF file, optionally changing format, compression, or chunking in the
 \subsection  nccopy_SYNOPSIS nccopy synopsis
 
 \code
-nccopy [-k kind_name] [-kind_code] [-d n] [-s] [-c chunkspec] [-u] [-w] 
+nccopy [-k kind_name] [-kind_code] [-d n] [-s] [-c chunkspec] [-u] [-w]
        [-[v|V] var1,...] [-[g|G] grp1,...] [-m bufsize] [-h chunk_cache]
        [-e cache_elems] [-r]   infile   outfile
 \endcode
@@ -3274,7 +2376,7 @@ a netCDF-4 classic model file as well, permitting data compression,
 efficient schema changes, larger variable sizes, and use of other
 netCDF-4 features.
 
-If no output format is specified, with either \b -k  \e kind_name 
+If no output format is specified, with either \b -k  \e kind_name
 or \e -kind_code, then the output will use the same
 format as the input, unless the input is classic or 64-bit offset
 and either chunking or compression is specified, in which case the
@@ -3345,7 +2447,7 @@ Note that \b nccopy requires all variables to be compressed using the
 same compression level, but the API has no such restriction.  With
 a program you can customize compression for each variable independently.
 
-\par -s 
+\par -s
 For netCDF-4 output, including netCDF-4 classic model, specify
 shuffling of variable data bytes before compression or after
 decompression.  Shuffling refers to interlacing of bytes in a chunk so
@@ -3769,749 +2871,11 @@ faster, but it will also eliminate the possibility of detecting the
 inadvertent reading of values that haven't been written.
 </pre>
 
-\page file_format_specifications File Format Specifications
-
-\tableofcontents
-
-\section classic_format_spec The NetCDF Classic Format Specification
-
-To present the format more formally, we use a BNF grammar notation. In
-this notation:
-- Non-terminals (entities defined by grammar rules) are in lower case.
-- Terminals (atomic entities in terms of which the format
-specification is written) are in upper case, and are specified
-literally as US-ASCII characters within single-quote characters or are
-described with text between angle brackets (‘\<’ and ‘\>’).
-- Optional entities are enclosed between braces (‘[’ and ‘]’).
-- A sequence of zero or more occurrences of an entity is denoted by
-  ‘[entity ...]’.
-- A vertical line character (‘|’) separates alternatives. Alternation
-  has lower precedence than concatenation.
-- Comments follow ‘//’ characters.
-- A single byte that is not a printable character is denoted using a
-hexadecimal number with the notation ‘\\xDD’, where each D is a
-hexadecimal digit.
-- A literal single-quote character is denoted by ‘\'’, and a literal
-back-slash character is denoted by ‘\\’.
-
-Following the grammar, a few additional notes are included to specify
-format characteristics that are impractical to capture in a BNF
-grammar, and to note some special cases for implementers. Comments in
-the grammar point to the notes and special cases, and help to clarify
-the intent of elements of the format.
-
-<h1>The Format in Detail</h1>
-
-<pre>
-     netcdf_file  = header  data
-     header       = magic  numrecs  dim_list  gatt_list  var_list
-     magic        = 'C'  'D'  'F'  VERSION
-     VERSION      = \\x01 |                      // classic format
-                    \\x02                        // 64-bit offset format
-     numrecs      = NON_NEG | STREAMING         // length of record dimension
-     dim_list     = ABSENT | NC_DIMENSION  nelems  [dim ...]
-     gatt_list    = att_list                    // global attributes
-     att_list     = ABSENT | NC_ATTRIBUTE  nelems  [attr ...]
-     var_list     = ABSENT | NC_VARIABLE   nelems  [var ...]
-     ABSENT       = ZERO  ZERO                  // Means list is not present
-     ZERO         = \\x00 \\x00 \\x00 \\x00         // 32-bit zero
-     NC_DIMENSION = \\x00 \\x00 \\x00 \\x0A         // tag for list of dimensions
-     NC_VARIABLE  = \\x00 \\x00 \\x00 \\x0B         // tag for list of variables
-     NC_ATTRIBUTE = \\x00 \\x00 \\x00 \\x0C         // tag for list of attributes
-     nelems       = NON_NEG       // number of elements in following sequence
-     dim          = name  dim_length
-     name         = nelems  namestring
-                         // Names a dimension, variable, or attribute.
-                         // Names should match the regular expression
-                         // ([a-zA-Z0-9_]|{MUTF8})([^\\x00-\\x1F/\\x7F-\\xFF]|{MUTF8})*
-                         // For other constraints, see "Note on names", below.
-     namestring   = ID1 [IDN ...] padding
-     ID1          = alphanumeric | '_'
-     IDN          = alphanumeric | special1 | special2
-     alphanumeric = lowercase | uppercase | numeric | MUTF8
-     lowercase    = 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|
-                    'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'
-     uppercase    = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|
-                    'N'|'O'|'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z'
-     numeric      = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
-                                  // special1 chars have traditionally been
-                                  // permitted in netCDF names.
-     special1     = '_'|'.'|'@'|'+'|'-'
-                                  // special2 chars are recently permitted in
-                                  // names (and require escaping in CDL).
-                                  // Note: '/' is not permitted.
-     special2     = ' ' | '!' | '"' | '#'  | '$' | '%' | '&' | '\'' |
-                    '(' | ')' | '*' | ','  | ':' | ';' | '<' | '='  |
-                    '>' | '?' | '[' | '\\' | ']' | '^' | '`' | '{'  |
-                    '|' | '}' | '~'
-     MUTF8        = <multibyte UTF-8 encoded, NFC-normalized Unicode character>
-     dim_length   = NON_NEG       // If zero, this is the record dimension.
-                                  // There can be at most one record dimension.
-     attr         = name  nc_type  nelems  [values ...]
-     nc_type      = NC_BYTE   |
-                    NC_CHAR   |
-                    NC_SHORT  |
-                    NC_INT    |
-                    NC_FLOAT  |
-                    NC_DOUBLE
-     var          = name  nelems  [dimid ...]  vatt_list  nc_type  vsize  begin
-                                  // nelems is the dimensionality (rank) of the
-                                  // variable: 0 for scalar, 1 for vector, 2
-                                  // for matrix, ...
-     dimid        = NON_NEG       // Dimension ID (index into dim_list) for
-                                  // variable shape.  We say this is a "record
-                                  // variable" if and only if the first
-                                  // dimension is the record dimension.
-     vatt_list    = att_list      // Variable-specific attributes
-     vsize        = NON_NEG       // Variable size.  If not a record variable,
-                                  // the amount of space in bytes allocated to
-                                  // the variable's data.  If a record variable,
-                                  // the amount of space per record.  See "Note
-                                  // on vsize", below.
-     begin        = OFFSET        // Variable start location.  The offset in
-                                  // bytes (seek index) in the file of the
-                                  // beginning of data for this variable.
-     data         = non_recs  recs
-     non_recs     = [vardata ...] // The data for all non-record variables,
-                                  // stored contiguously for each variable, in
-                                  // the same order the variables occur in the
-                                  // header.
-     vardata      = [values ...]  // All data for a non-record variable, as a
-                                  // block of values of the same type as the
-                                  // variable, in row-major order (last
-                                  // dimension varying fastest).
-     recs         = [record ...]  // The data for all record variables are
-                                  // stored interleaved at the end of the
-                                  // file.
-     record       = [varslab ...] // Each record consists of the n-th slab
-                                  // from each record variable, for example
-                                  // x[n,...], y[n,...], z[n,...] where the
-                                  // first index is the record number, which
-                                  // is the unlimited dimension index.
-     varslab      = [values ...]  // One record of data for a variable, a
-                                  // block of values all of the same type as
-                                  // the variable in row-major order (last
-                                  // index varying fastest).
-     values       = bytes | chars | shorts | ints | floats | doubles
-     string       = nelems  [chars]
-     bytes        = [BYTE ...]  padding
-     chars        = [CHAR ...]  padding
-     shorts       = [SHORT ...]  padding
-     ints         = [INT ...]
-     floats       = [FLOAT ...]
-     doubles      = [DOUBLE ...]
-     padding      = <0, 1, 2, or 3 bytes to next 4-byte boundary>
-                                  // Header padding uses null (\\x00) bytes.  In
-                                  // data, padding uses variable's fill value.
-                                  // See "Note on padding", below, for a special
-                                  // case.
-     NON_NEG      = <non-negative INT>
-     STREAMING    = \\xFF \\xFF \\xFF \\xFF   // Indicates indeterminate record
-                                          // count, allows streaming data
-     OFFSET       = <non-negative INT> |  // For classic format or
-                    <non-negative INT64>  // for 64-bit offset format
-     BYTE         = <8-bit byte>          // See "Note on byte data", below.
-     CHAR         = <8-bit byte>          // See "Note on char data", below.
-     SHORT        = <16-bit signed integer, Bigendian, two's complement>
-     INT          = <32-bit signed integer, Bigendian, two's complement>
-     INT64        = <64-bit signed integer, Bigendian, two's complement>
-     FLOAT        = <32-bit IEEE single-precision float, Bigendian>
-     DOUBLE       = <64-bit IEEE double-precision float, Bigendian>
-                                  // following type tags are 32-bit integers
-     NC_BYTE      = \\x00 \\x00 \\x00 \\x01       // 8-bit signed integers
-     NC_CHAR      = \\x00 \\x00 \\x00 \\x02       // text characters
-     NC_SHORT     = \\x00 \\x00 \\x00 \\x03       // 16-bit signed integers
-     NC_INT       = \\x00 \\x00 \\x00 \\x04       // 32-bit signed integers
-     NC_FLOAT     = \\x00 \\x00 \\x00 \\x05       // IEEE single precision floats
-     NC_DOUBLE    = \\x00 \\x00 \\x00 \\x06       // IEEE double precision floats
-                                  // Default fill values for each type, may be
-                                  // overridden by variable attribute named
-                                  // '_FillValue'. See "Note on fill values",
-                                  // below.
-     FILL_CHAR    = \\x00                      // null byte
-     FILL_BYTE    = \\x81                      // (signed char) -127
-     FILL_SHORT   = \\x80 \\x01                 // (short) -32767
-     FILL_INT     = \\x80 \\x00 \\x00 \\x01       // (int) -2147483647
-     FILL_FLOAT   = \\x7C \\xF0 \\x00 \\x00       // (float) 9.9692099683868690e+36
-     FILL_DOUBLE  = \\x47 \\x9E \\x00 \\x00 \\x00 \\x00 \\x00 \\x00 //(double)9.9692099683868690e+36
-</pre>
-
-Note on vsize: This number is the product of the dimension lengths
-(omitting the record dimension) and the number of bytes per value
-(determined from the type), increased to the next multiple of 4, for
-each variable. If a record variable, this is the amount of space per
-record (except that, for backward compatibility, it always includes
-padding to the next multiple of 4 bytes, even in the exceptional case
-noted below under “Note on padding”). The netCDF “record size” is
-calculated as the sum of the vsize's of all the record variables.
-
-The vsize field is actually redundant, because its value may be
-computed from other information in the header. The 32-bit vsize field
-is not large enough to contain the size of variables that require more
-than 2^32 - 4 bytes, so 2^32 - 1 is used in the vsize field for such
-variables.
-
-Note on names: Earlier versions of the netCDF C-library reference
-implementation enforced a more restricted set of characters in
-creating new names, but permitted reading names containing arbitrary
-bytes. This specification extends the permitted characters in names to
-include multi-byte UTF-8 encoded Unicode and additional printing
-characters from the US-ASCII alphabet. The first character of a name
-must be alphanumeric, a multi-byte UTF-8 character, or '_' (reserved
-for special names with meaning to implementations, such as the
-“_FillValue” attribute). Subsequent characters may also include
-printing special characters, except for '/' which is not allowed in
-names. Names that have trailing space characters are also not
-permitted.
-
-Implementations of the netCDF classic and 64-bit offset format must
-ensure that names are normalized according to Unicode NFC
-normalization rules during encoding as UTF-8 for storing in the file
-header. This is necessary to ensure that gratuitous differences in the
-representation of Unicode names do not cause anomalies in comparing
-files and querying data objects by name.
-
-Note on streaming data: The largest possible record count, 2^32 - 1,
-is reserved to indicate an indeterminate number of records. This means
-that the number of records in the file must be determined by other
-means, such as reading them or computing the current number of records
-from the file length and other information in the header. It also
-means that the numrecs field in the header will not be updated as
-records are added to the file. [This feature is not yet implemented].
-
-Note on padding: In the special case when there is only one record
-variable and it is of type character, byte, or short, no padding is
-used between record slabs, so records after the first record do not
-necessarily start on four-byte boundaries. However, as noted above
-under “Note on vsize”, the vsize field is computed to include padding
-to the next multiple of 4 bytes. In this case, readers should ignore
-vsize and assume no padding. Writers should store vsize as if padding
-were included.
-
-Note on byte data: It is possible to interpret byte data as either
-signed (-128 to 127) or unsigned (0 to 255). When reading byte data
-through an interface that converts it into another numeric type, the
-default interpretation is signed. There are various attribute
-conventions for specifying whether bytes represent signed or unsigned
-data, but no standard convention has been established. The variable
-attribute “_Unsigned” is reserved for this purpose in future
-implementations.
-
-Note on char data: Although the characters used in netCDF names must
-be encoded as UTF-8, character data may use other encodings. The
-variable attribute “_Encoding” is reserved for this purpose in future
-implementations.
-
-Note on fill values: Because data variables may be created before
-their values are written, and because values need not be written
-sequentially in a netCDF file, default “fill values” are defined for
-each type, for initializing data values before they are explicitly
-written. This makes it possible to detect reading values that were
-never written. The variable attribute “_FillValue”, if present,
-overrides the default fill value for a variable. If _FillValue is
-defined then it should be scalar and of the same type as the variable.
-
-Fill values are not required, however, because netCDF libraries have
-traditionally supported a “no fill” mode when writing, omitting the
-initialization of variable values with fill values. This makes the
-creation of large files faster, but also eliminates the possibility of
-detecting the inadvertent reading of values that haven't been written.
-
-\section computing_offsets Notes on Computing File Offsets
-
-The offset (position within the file) of a specified data value in a
-classic format or 64-bit offset data file is completely determined by
-the variable start location (the offset in the begin field), the
-external type of the variable (the nc_type field), and the dimension
-indices (one for each of the variable's dimensions) of the value
-desired.
-
-The external size in bytes of one data value for each possible netCDF
-type, denoted extsize below, is:
-- NC_BYTE 	1
-- NC_CHAR 	1
-- NC_SHORT 	2
-- NC_INT 	4
-- NC_FLOAT 	4
-- NC_DOUBLE 	8
-
-The record size, denoted by recsize below, is the sum of the vsize
-fields of record variables (variables that use the unlimited
-dimension), using the actual value determined by dimension sizes and
-variable type in case the vsize field is too small for the variable
-size.
-
-To compute the offset of a value relative to the beginning of a
-variable, it is helpful to precompute a “product vector” from the
-dimension lengths. Form the products of the dimension lengths for the
-variable from right to left, skipping the leftmost (record) dimension
-for record variables, and storing the results as the product vector
-for each variable.
-
-For example:
-
-\code
-Non-record variable:
-
-dimension lengths: [ 5 3 2 7] product vector: [210 42 14 7]
-
-Record variable:
-
-dimension lengths: [0 2 9 4] product vector: [0 72 36 4]
-\endcode
-
-At this point, the leftmost product, when rounded up to the next
-multiple of 4, is the variable size, vsize, in the grammar above. For
-example, in the non-record variable above, the value of the vsize
-field is 212 (210 rounded up to a multiple of 4). For the record
-variable, the value of vsize is just 72, since this is already a
-multiple of 4.
-
-Let coord be the array of coordinates (dimension indices, zero-based)
-of the desired data value. Then the offset of the value from the
-beginning of the file is just the file offset of the first data value
-of the desired variable (its begin field) added to the inner product
-of the coord and product vectors times the size, in bytes, of each
-datum for the variable. Finally, if the variable is a record variable,
-the product of the record number, 'coord[0]', and the record size,
-recsize, is added to yield the final offset value.
-
-A special case: Where there is exactly one record variable, we drop
-the requirement that each record be four-byte aligned, so in this case
-there is no record padding.
-
-\subsection offset_examples Examples
+\page users_guide_appendices Appendices
 
-By using the grammar above, we can derive the smallest valid netCDF
-file, having no dimensions, no variables, no attributes, and hence, no
-data. A CDL representation of the empty netCDF file is
-
-\code
-netcdf empty { }
-\endcode
-
-This empty netCDF file has 32 bytes. It begins with the four-byte
-“magic number” that identifies it as a netCDF version 1 file: ‘C’,
-‘D’, ‘F’, ‘\\x01’. Following are seven 32-bit integer zeros
-representing the number of records, an empty list of dimensions, an
-empty list of global attributes, and an empty list of variables.
-
-Below is an (edited) dump of the file produced using the Unix command
-
-\code
-od -xcs empty.nc
-\endcode
-
-Each 16-byte portion of the file is displayed with 4 lines. The first
-line displays the bytes in hexadecimal. The second line displays the
-bytes as characters. The third line displays each group of two bytes
-interpreted as a signed 16-bit integer. The fourth line (added by
-human) presents the interpretation of the bytes in terms of netCDF
-components and values.
-
-\code
-        4344    4601    0000    0000    0000    0000    0000    0000
-       C   D   F 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
-       17220   17921   00000   00000   00000   00000   00000   00000
-     [magic number ] [  0 records  ] [  0 dimensions   (ABSENT)    ]
-
-        0000    0000    0000    0000    0000    0000    0000    0000
-      \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
-       00000   00000   00000   00000   00000   00000   00000   00000
-     [  0 global atts  (ABSENT)    ] [  0 variables    (ABSENT)    ]
-\endcode
-
-As a less trivial example, consider the CDL
-
-\code
-     netcdf tiny {
-     dimensions:
-             dim = 5;
-     variables:
-             short vx(dim);
-     data:
-             vx = 3, 1, 4, 1, 5 ;
-     }
-\endcode
-
-which corresponds to a 92-byte netCDF file. The following is an edited dump of this file:
-
-\code
-        4344    4601    0000    0000    0000    000a    0000    0001
-       C   D   F 001  \0  \0  \0  \0  \0  \0  \0  \n  \0  \0  \0 001
-       17220   17921   00000   00000   00000   00010   00000   00001
-     [magic number ] [  0 records  ] [NC_DIMENSION ] [ 1 dimension ]
-
-        0000    0003    6469    6d00    0000    0005    0000    0000
-      \0  \0  \0 003   d   i   m  \0  \0  \0  \0 005  \0  \0  \0  \0
-       00000   00003   25705   27904   00000   00005   00000   00000
-     [  3 char name = "dim"        ] [ size = 5    ] [ 0 global atts
-
-        0000    0000    0000    000b    0000    0001    0000    0002
-      \0  \0  \0  \0  \0  \0  \0 013  \0  \0  \0 001  \0  \0  \0 002
-       00000   00000   00000   00011   00000   00001   00000   00002
-      (ABSENT)     ] [NC_VARIABLE  ] [ 1 variable  ] [ 2 char name =
-
-        7678    0000    0000    0001    0000    0000    0000    0000
-       v   x  \0  \0  \0  \0  \0 001  \0  \0  \0  \0  \0  \0  \0  \0
-       30328   00000   00000   00001   00000   00000   00000   00000
-      "vx"         ] [1 dimension  ] [ with ID 0   ] [ 0 attributes
-
-        0000    0000    0000    0003    0000    000c    0000    0050
-      \0  \0  \0  \0  \0  \0  \0 003  \0  \0  \0  \f  \0  \0  \0   P
-       00000   00000   00000   00003   00000   00012   00000   00080
-      (ABSENT)     ] [type NC_SHORT] [size 12 bytes] [offset:    80]
-
-        0003    0001    0004    0001    0005    8001
-      \0 003  \0 001  \0 004  \0 001  \0 005 200 001
-       00003   00001   00004   00001   00005  -32767
-     [    3] [    1] [    4] [    1] [    5] [fill ]
-\endcode
-
-\section offset_format_spec The 64-bit Offset Format
-
-The netCDF 64-bit offset format differs from the classic format only
-in the VERSION byte, ‘\\x02’ instead of ‘\\x01’, and the OFFSET entity,
-a 64-bit instead of a 32-bit offset from the beginning of the
-file. This small format change permits much larger files, but there
-are still some practical size restrictions. Each fixed-size variable
-and the data for one record's worth of each record variable are still
-limited in size to a little less that 4 GiB. The rationale for this
-limitation is to permit aggregate access to all the data in a netCDF
-variable (or a record's worth of data) on 32-bit platforms.
-
-\section netcdf_4_spec The NetCDF-4 Format
-
-The netCDF-4 format implements and expands the netCDF-3 data model by
-using an enhanced version of HDF5 as the storage layer. Use is made of
-features that are only available in HDF5 version 1.8 and later.
-
-Using HDF5 as the underlying storage layer, netCDF-4 files remove many
-of the restrictions for classic and 64-bit offset files. The richer
-enhanced model supports user-defined types and data structures,
-hierarchical scoping of names using groups, additional primitive types
-including strings, larger variable sizes, and multiple unlimited
-dimensions. The underlying HDF5 storage layer also supports
-per-variable compression, multidimensional tiling, and efficient
-dynamic schema changes, so that data need not be copied when adding
-new variables to the file schema.
-
-Creating a netCDF-4/HDF5 file with netCDF-4 results in an HDF5
-file. The features of netCDF-4 are a subset of the features of HDF5,
-so the resulting file can be used by any existing HDF5 application.
-
-Although every file in netCDF-4 format is an HDF5 file, there are HDF5
-files that are not netCDF-4 format files, because the netCDF-4 format
-intentionally uses a limited subset of the HDF5 data model and file
-format features. Some HDF5 features not supported in the netCDF
-enhanced model and netCDF-4 format include non-hierarchical group
-structures, HDF5 reference types, multiple links to a data object,
-user-defined atomic data types, stored property lists, more permissive
-rules for data object names, the HDF5 date/time type, and attributes
-associated with user-defined types.
-
-A complete specification of HDF5 files is beyond the scope of this
-document. For more information about HDF5, see the HDF5 web site:
-http://hdf.ncsa.uiuc.edu/HDF5/.
-
-The specification that follows is sufficient to allow HDF5 users to
-create files that will be accessable from netCDF-4.
-
-\subsection creation_order Creation Order
-
-The netCDF API maintains the creation order of objects that are
-created in the file. The same is not true in HDF5, which maintains the
-objects in alphabetical order. Starting in version 1.8 of HDF5, the
-ability to maintain creation order was added. This must be explicitly
-turned on in the HDF5 data file in several ways.
-
-Each group must have link and attribute creation order set. The
-following code (from libsrc4/nc4hdf.c) shows how the netCDF-4 library
-sets these when creating a group.
-
-\code
-           /* Create group, with link_creation_order set in the group
-            * creation property list. */
-           if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
-              return NC_EHDFERR;
-           if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0)
-              BAIL(NC_EHDFERR);
-           if (H5Pset_attr_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0)
-              BAIL(NC_EHDFERR);
-           if ((grp->hdf_grpid = H5Gcreate2(grp->parent->hdf_grpid, grp->name,
-                                            H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
-              BAIL(NC_EHDFERR);
-           if (H5Pclose(gcpl_id) < 0)
-              BAIL(NC_EHDFERR);
-\endcode
-
-Each dataset in the HDF5 file must be created with a property list for
-which the attribute creation order has been set to creation
-ordering. The H5Pset_attr_creation_order funtion is used to set the
-creation ordering of attributes of a variable.
-
-The following example code (from libsrc4/nc4hdf.c) shows how the
-creation ordering is turned on by the netCDF library.
-
-\code
-        /* Turn on creation order tracking. */
-        if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
-                                       H5P_CRT_ORDER_INDEXED) < 0)
-           BAIL(NC_EHDFERR);
-\endcode
-
-\subsection groups_spec Groups
-
-NetCDF-4 groups are the same as HDF5 groups, but groups in a netCDF-4
-file must be strictly hierarchical. In general, HDF5 permits
-non-hierarchical structuring of groups (for example, a group that is
-its own grandparent). These non-hierarchical relationships are not
-allowed in netCDF-4 files.
-
-In the netCDF API, the global attribute becomes a group-level
-attribute. That is, each group may have its own global attributes.
-
-The root group of a file is named “/” in the netCDF API, where names
-of groups are used. It should be noted that the netCDF API (like the
-HDF5 API) makes little use of names, and refers to entities by number.
-
-\subsection dims_spec Dimensions with HDF5 Dimension Scales
-
-Until version 1.8, HDF5 did not have any capability to represent
-shared dimensions. With the 1.8 release, HDF5 introduced the dimension
-scale feature to allow shared dimensions in HDF5 files.
-
-The dimension scale is unfortunately not exactly equivilent to the
-netCDF shared dimension, and this leads to a number of compromises in
-the design of netCDF-4.
-
-A netCDF shared dimension consists solely of a length and a name. An
-HDF5 dimension scale also includes values for each point along the
-dimension, information that is (optionally) included in a netCDF
-coordinate variable.
-
-To handle the case of a netCDF dimension without a coordinate
-variable, netCDF-4 creates dimension scales of type char, and leaves
-the contents of the dimension scale empty. Only the name and length of
-the scale are significant. To distinguish this case, netCDF-4 takes
-advantage of the NAME attribute of the dimension scale. (Not to be
-confused with the name of the scale itself.) In the case of dimensions
-without coordinate data, the HDF5 dimension scale NAME attribute is
-set to the string: "This is a netCDF dimension but not a netCDF
-variable."
-
-In the case where a coordinate variable is defined for a dimension,
-the HDF5 dimscale matches the type of the netCDF coordinate variable,
-and contains the coordinate data.
-
-A further difficulty arrises when an n-dimensional coordinate variable
-is defined, where n is greater than one. NetCDF allows such coordinate
-variables, but the HDF5 model does not allow dimension scales to be
-attached to other dimension scales, making it impossible to completely
-represent the multi-dimensional coordinate variables of the netCDF
-model.
-
-To capture this information, multidimensional coordinate variables
-have an attribute named _Netcdf4Coordinates. The attribute is an array
-of H5T_NATIVE_INT, with the netCDF dimension IDs of each of its
-dimensions.
-
-The _Netcdf4Coordinates attribute is otherwise hidden by the netCDF
-API. It does not appear as one of the attributes for the netCDF
-variable involved, except through the HDF5 API.
-
-\subsection dim_spec2 Dimensions without HDF5 Dimension Scales
-
-Starting with the netCDF-4.1 release, netCDF can read HDF5 files which
-do not use dimension scales. In this case the netCDF library assigns
-dimensions to the HDF5 dataset as needed, based on the length of the
-dimension.
-
-When an HDF5 file is opened, each dataset is examined in turn. The
-lengths of all the dimensions involved in the shape of the dataset are
-determined. Each new (i.e. previously unencountered) length results in
-the creation of a phony dimension in the netCDF API.
-
-This will not accurately detect a shared, unlimited dimension in the
-HDF5 file, if different datasets have different lengths along this
-dimension (possible in HDF5, but not in netCDF).
-
-Note that this is a read-only capability for the netCDF library. When
-the netCDF library writes HDF5 files, they always use a dimension
-scale for every dimension.
-
-Datasets must have either dimension scales for every dimension, or no
-dimension scales at all. Partial dimension scales are not, at this
-time, understood by the netCDF library.
-
-\subsection dim_spec3 Dimension and Coordinate Variable Ordering
-
-In order to preserve creation order, the netCDF-4 library writes
-variables in their creation order. Since some variables are also
-dimension scales, their order reflects both the order of the
-dimensions and the order of the coordinate variables.
-
-However, these may be different. Consider the following code:
-
-\code
-           /* Create a test file. */
-           if (nc_create(FILE_NAME, NC_CLASSIC_MODEL|NC_NETCDF4, &ncid)) ERR;
-
-           /* Define dimensions in order. */
-           if (nc_def_dim(ncid, DIM0, NC_UNLIMITED, &dimids[0])) ERR;
-           if (nc_def_dim(ncid, DIM1, 4, &dimids[1])) ERR;
-
-           /* Define coordinate variables in a different order. */
-           if (nc_def_var(ncid, DIM1, NC_DOUBLE, 1, &dimids[1], &varid[1])) ERR;
-           if (nc_def_var(ncid, DIM0, NC_DOUBLE, 1, &dimids[0], &varid[0])) ERR;
-\endcode
-
-In this case the order of the coordinate variables will be different
-from the order of the dimensions.
-
-In practice, this should make little difference in user code, but if
-the user is writing code that depends on the ordering of dimensions,
-the netCDF library was updated in version 4.1 to detect this
-condition, and add the attribute _Netcdf4Dimid to the dimension scales
-in the HDF5 file. This attribute holds a scalar H5T_NATIVE_INT which
-is the (zero-based) dimension ID for this dimension.
-
-If this attribute is present on any dimension scale, it must be
-present on all dimension scales in the file.
-
-\subsection vars_spec Variables
-
-Variables in netCDF-4/HDF5 files exactly correspond to HDF5
-datasets. The data types match naturally between netCDF and HDF5.
-
-In netCDF classic format, the problem of endianness is solved by
-writing all data in big-endian order. The HDF5 library allows data to
-be written as either big or little endian, and automatically reorders
-the data when it is read, if necessary.
-
-By default, netCDF uses the native types on the machine which writes
-the data. Users may change the endianness of a variable (before any
-data are written). In that case the specified endian type will be used
-in HDF5 (for example, a H5T_STD_I16LE will be used for NC_SHORT, if
-little-endian has been specified for that variable.)
-- NC_BYTE = H5T_NATIVE_SCHAR
-- NC_UBYTE = H5T_NATIVE_SCHAR
-- NC_CHAR = H5T_C_S1
-- NC_STRING = variable length array of H5T_C_S1
-- NC_SHORT = H5T_NATIVE_SHORT
-- NC_USHORT = H5T_NATIVE_USHORT
-- NC_INT = H5T_NATIVE_INT
-- NC_UINT = H5T_NATIVE_UINT
-- NC_INT64 = H5T_NATIVE_LLONG
-- NC_UINT64 = H5T_NATIVE_ULLONG
-- NC_FLOAT = H5T_NATIVE_FLOAT
-- NC_DOUBLE = H5T_NATIVE_DOUBLE
-
-The NC_CHAR type represents a single character, and the NC_STRING an
-array of characters. This can be confusing because a one-dimensional
-array of NC_CHAR is used to represent a string (i.e. a scalar
-NC_STRING).
-
-An odd case may arise in which the user defines a variable with the
-same name as a dimension, but which is not intended to be the
-coordinate variable for that dimension. In this case the string
-"_nc4_non_coord_" is pre-pended to the name of the HDF5 dataset, and
-stripped from the name for the netCDF API.
-
-\subsection atts_spec Attributes
-
-Attributes in HDF5 and netCDF-4 correspond very closely. Each
-attribute in an HDF5 file is represented as an attribute in the
-netCDF-4 file, with the exception of the attributes below, which are
-ignored by the netCDF-4 API.
-- _Netcdf4Coordinates An integer array containing the dimension IDs of
-  a variable which is a multi-dimensional coordinate variable.
-- _nc3_strict When this (scalar, H5T_NATIVE_INT) attribute exists in
-  the root group of the HDF5 file, the netCDF API will enforce the
-  netCDF classic model on the data file.
-- REFERENCE_LIST This attribute is created and maintained by the HDF5
-  dimension scale API.
-- CLASS This attribute is created and maintained by the HDF5 dimension
-  scale API.
-- DIMENSION_LIST This attribute is created and maintained by the HDF5
-  dimension scale API.
-- NAME This attribute is created and maintained by the HDF5 dimension
-  scale API.
-- _Netcdf4Dimid Holds a scalar H5T_NATIVE_INT that is the (zero-based)
-  dimension ID for this dimension, needed when dimensions and
-  coordinate variables are defined in different orders.
-
-\subsection user_defined_spec User-Defined Data Types
-
-Each user-defined data type in an HDF5 file exactly corresponds to a
-user-defined data type in the netCDF-4 file. Only base data types
-which correspond to netCDF-4 data types may be used. (For example, no
-HDF5 reference data types may be used.)
-
-\subsection compression_spec Compression
-
-The HDF5 library provides data compression using the zlib library and
-the szlib library. NetCDF-4 only allows users to create data with the
-zlib library (due to licensing restrictions on the szlib
-library). Since HDF5 supports the transparent reading of the data with
-either compression filter, the netCDF-4 library can read data
-compressed with szlib (if the underlying HDF5 library is built to
-support szlib), but has no way to write data with szlib compression.
-
-With zlib compression (a.k.a. deflation) the user may set a deflation
-factor from 0 to 9. In our measurements the zero deflation level does
-not compress the data, but does incur the performance penalty of
-compressing the data. The netCDF API does not allow the user to write
-a variable with zlib deflation of 0 - when asked to do so, it turns
-off deflation for the variable instead. NetCDF can read an HDF5 file
-with deflation of zero, and correctly report that to the user.
-
-\section netcdf_4_classic_spec The NetCDF-4 Classic Model Format
-
-Every classic and 64-bit offset file can be represented as a netCDF-4
-file, with no loss of information. There are some significant benefits
-to using the simpler netCDF classic model with the netCDF-4 file
-format. For example, software that writes or reads classic model data
-can write or read netCDF-4 classic model format data by
-recompiling/relinking to a netCDF-4 API library, with no or only
-trivial changes needed to the program source code. The netCDF-4
-classic model format supports this usage by enforcing rules on what
-functions may be called to store data in the file, to make sure its
-data can be read by older netCDF applications (when relinked to a
-netCDF-4 library).
-
-Writing data in this format prevents use of enhanced model features
-such as groups, added primitive types not available in the classic
-model, and user-defined types. However performance features of the
-netCDF-4 formats that do not require additional features of the
-enhanced model, such as per-variable compression and chunking,
-efficient dynamic schema changes, and larger variable size limits,
-offer potentially significant performance improvements to readers of
-data stored in this format, without requiring program changes.
-
-When a file is created via the netCDF API with a CLASSIC_MODEL mode
-flag, the library creates an attribute (_nc3_strict) in the root
-group. This attribute is hidden by the netCDF API, but is read when
-the file is later opened, and used to ensure that no enhanced model
-features are written to the file.
-
-\section hdf4_sd_format HDF4 SD Format
-
-Starting with version 4.1, the netCDF libraries can read HDF4 SD
-(Scientific Dataset) files. Access is limited to those HDF4 files
-created with the Scientific Dataset API. Access is read-only.
-
-Dataset types are translated between HDF4 and netCDF in a
-straighforward manner.
-- DFNT_CHAR = NC_CHAR
-- DFNT_UCHAR, DFNT_UINT8 = NC_UBYTE
-- DFNT_INT8 = NC_BYTE
-- DFNT_INT16 = NC_SHORT
-- DFNT_UINT16 = NC_USHORT
-- DFNT_INT32 = NC_INT
-- DFNT_UINT32 = NC_UINT
-- DFNT_FLOAT32 = NC_FLOAT
-- DFNT_FLOAT64 = NC_DOUBLE
+The following appendices are available.
 
+- \subpage attribute_conventions
+- \subpage file_format_specifications
 
 */
diff --git a/docs/images/Makefile.in b/docs/images/Makefile.in
index 0509e2e..3874079 100644
--- a/docs/images/Makefile.in
+++ b/docs/images/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,7 +89,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = docs/images
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -87,6 +96,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -111,6 +121,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -159,6 +170,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -174,10 +186,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -212,8 +226,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -294,7 +310,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/images/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign docs/images/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -469,6 +484,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/docs/install-fortran.md b/docs/install-fortran.md
index d4246b2..f813d00 100644
--- a/docs/install-fortran.md
+++ b/docs/install-fortran.md
@@ -4,15 +4,21 @@ Building the NetCDF-4.2 and later Fortran libraries {#building_netcdf_fortran}
 [TOC]
 
 In versions before 4.2, the Fortran netCDF library source was bundled
-with the C library source in one distribution, and it was possible to
-combine the libraries in a single library file. With version 4.2, the
-Fortran netCDF library for Fortran77 and Fortran90 APIs has been
-separated into its own source distribution, and should now be built as a
-separate library, after the C library is built and installed. This
-separation simplifies the building and use of the C and Fortran netCDF
-libraries and allows them to evolve independently.
-
-Please note that in the example commands below, we assume use of a
+with the C library source in one distribution. With more recent
+versions, the Fortran netCDF library has been split off into an
+independent source distribution, intended to be built as a separate
+library, *after* the C library is built and installed. This separation
+simplifies the building and use of the C and Fortran netCDF libraries
+and allows them to evolve independently.
+
+More recently, building netcdf-fortran as an automated step in the
+netcdf-c build is now possible (for non-MSVC builds) by using new
+options at configure time, so if you haven't built and installed the
+netCDF-C library yet, you may want to try the new netCDF-C <a
+href="http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#getting"
+>Fortran-bootstrap procedure</a>.
+
+In the example commands below, we assume use of a
 POSIX-standard shell, such as sh, bash, ksh, or zsh. If you are using
 csh instead, you will have to use the
 
@@ -22,8 +28,8 @@ syntax to set environment variables instead of the
 
        ENV_VARIABLE=value
 
-syntax used in the examples that use a POSIX-standard shell. In either
-case, <I>${DIR1}</I> is the value of the environment variable <I>DIR1</I>.
+syntax used in the examples. In either case, `${VAR}` is the
+value of the shell variable or environment variable VAR.
 
 It will be easier to build the netCDF Fortran library if the C (and if
 needed, HDF5) libraries are built as shared libraries (the default), but
@@ -33,41 +39,68 @@ Building with shared libraries {#building_fortran_shared_libraries}
 ==============================
 
 1.  First make sure the netCDF C library has been built, tested, and
-    installed under directory <I>${DIR1}</I>, as specified by
-    --prefix=<I>${DIR1}</I> to the C library configure script, or under
-    directory /usr/local by default.
-2.  For the Fortran netCDF library, use the same C compiler as used to
-    create the netCDF C library, specified with the CC environment
-    variable, if necessary.
+    installed. The shell variable NCDIR should be set such that
+    the shared library for netCDF C is under `${NCDIR}/lib` and
+    netCDF utilities such as ncdump are under `${NCDIR}/bin`. For example:
+
+        NCDIR=/usr/local
+    
+2.  The configure script will try to determine suitable Fortran and C
+    compilers for building netCDF Fortran, but you can instead specify
+    them with the FC and CC environment variables, if needed. For
+    example:
+
+		CC=/usr/local/cc
+		FC=/usr/local/fortran
+    
 3.  If the netCDF C library was installed as a shared library in a
     location that is not searched by default, you will need to set the
     LD\_LIBRARY\_PATH environment variable (or DYLD\_LIBRARY\_PATH on
-    OSX) to specify that directory before running the configure script,
-    for example:
+    OSX) to specify that directory before running the configure script.
+    For example:
 
-        export LD_LIBRARY_PATH=${DIR1}/lib:${LD_LIBRARY_PATH}
+        export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
 
 4.  If you set the LD\_LIBRARY\_PATH (or DYLD\_LIBRARY\_PATH)
-    environment variable in the previous step, don't use the "sudo"
-    command before the following "configure" or "make check" commands.
-    Using "sudo" causes the LD\_\* environment variables to be ignored,
-    as a security precaution. You can use "sudo make install" as the
-    last step, but you shouldn't need to use "sudo" before that.
-5.  For the configure script, set CPPFLAGS and LDFLAGS variables to
-    specify the include and lib directories for the netCDF C library.
-    For example, to install the Fortran libraries in the same directory
-    *\${DIR1}* where the C netCDF library is installed:
-
-          CPPFLAGS=-I${DIR1}/include LDFLAGS=-L${DIR1}/lib ./configure --prefix=${DIR1}
+    environment variable in the previous step, don't use "sudo"
+    before the following "configure" or "make check" commands.
+    Using "sudo" causes the LD\_\* environment variables to be
+    ignored. You can use "sudo make install" as the last
+    step if necessary, but don't use "sudo" before that.
+    
+5.  Set the shell variable `NFDIR` to where you want to install
+    netCDF Fortran, which can be the same location where the netCDF C
+    was installed (default /usr/local), but **not** the source
+    directory where you are building the software.  Then, from the top-level
+    source directory, run the configure script, using CPPFLAGS and LDFLAGS to
+    specify where the netCDF C library was installed:
+
+		NFDIR=/usr/local
+        CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib \
+		./configure --prefix=${NFDIR}
 
     If you are cross-compiling, you should also include the configure
     option "--disable-fortran-type-check", as in:
 
-          CPPFLAGS=-I${DIR1}/include LDFLAGS=-L${DIR1}/lib \
-            ./configure --disable-fortran-type-check --prefix=${DIR1}
+        CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib \
+        ./configure --prefix=${NFDIR} --disable-fortran-type-check
 
-6.  If that succeeds, run "make check".
-7.  If that succeeds, run "make install" or "sudo make install".
+	To see other configure options, run `configure --help`.
+
+6.  If that succeeds, run
+
+		make check
+
+7.  If that succeeds, run
+
+		make install
+
+	or
+
+		sudo make install
+
+If you encounter problems, send the complete "config.log" file
+generated by running configure to support-netcdf at unidata.ucar.edu.
 
 Building with static libraries {#building_fortran_with_static_libraries}
 ==============================
@@ -76,115 +109,121 @@ If you can't build the C netCDF library as a shared library or if it has
 already been installed by someone else only as a static library (which
 means there are no libnetcdf.so files in the library directory where the
 netCDF C library was installed), then building and installing the
-Fortran netCDF libraries will be somewhat more complicated.
-
-If you need to set the LD\_LIBRARY\_PATH (or DYLD\_LIBRARY\_PATH)
-environment variable, don't use the "sudo" command before the following
-"configure" or "make check" commands. Using "sudo" causes the LD\_\*
-environment variables to be ignored. You can use "sudo make install" as
-the last step, but you shouldn't need to use "sudo" before that.
-
-1.  Assume the static netCDF C library is installed under *\${DIR1}*,
-    and the other needed shared libraries for HDF5, zlib, and curl are
-    installed under *\${DIR2}* (which might be the same as *\${DIR1}*).
-2.  Use the same C compiler as used to create the netCDF C library,
-    specified with the CC environment variable, if necessary.
-3.  Set the CPPFLAGS, LDFLAGS, and LD\_LIBRARY\_PATH environment
+Fortran netCDF libraries will be more complicated.
+    
+1.  The configure script will try to determine suitable Fortran and C
+    compilers for building netCDF Fortran, but you can also, specify
+    them with the FC and CC environment variables.
+
+2.  Assume the static netCDF C library is installed under `${NCDIR}`,
+    the HDF5 library under `${H5DIR}`, and other needed libraries
+    such as zlib and curl under `${ODIR}`. Some or all of these could
+    be the same (for example /usr/local).
+
+3.  Let the shell variable `${NFDIR}` specify where you want to
+    install the netCDF Fortran library.  This can be the same location
+    where the netCDF C library is installed (default is /usr/local).
+
+4.  Set the CPPFLAGS, LDFLAGS, LD\_LIBRARY\_PATH, and LIBS environment
     variables to specify where the netCDF C library is installed and
-    where the other shared libraries may be found, before running the
-    configure script. For example:
+    where the other libraries may be found. For example:
 
-          CPPFLAGS="-I${DIR1}/include -I${DIR2}/include" \
-          LD_LIBRARY_PATH=${DIR1}/lib:${DIR2}/lib:${LD_LIBRARY_PATH} \
-          LDFLAGS="-L${DIR1}/lib -L${DIR2}/lib" \
-          LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl" \
-          ./configure --disable-shared --prefix=${DIR1}
+        CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include -I${ODIR}/include" \
+        LDFLAGS="-L${NCDIR}/lib -L${H5DIR}/lib -L${ODIR}/lib" \
+        LD_LIBRARY_PATH=${NCDIR}/lib:${H5DIR}/lib:${ODIR}/lib \
+        LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl" \
+        ./configure --disable-shared --prefix=${NCDIR}
 
     If you are cross-compiling, you should also include the configure
     option "--disable-fortran-type-check".
 
-4.  For parallel I/O: The configure script sets CFLAGS appropriately for
+5.  For parallel I/O: The configure script sets CFLAGS appropriately for
     standard compilers, but if you are building with parallel I/O using
-    wrappers such as mpicc and mpif90, you sometimes have to set CFLAGS
-    to indicate which Fortran compiler is wrapped by mpif90. For
-    example, if "mpicc --show" and "mpif90 --show" indicate gcc and
-    gfortran are being used, then set CFLAGS=-DgFortran, and similarly
-    set CFLAGS=-DpgiFortran for Portland Group compilers.
-5.  If that succeeds, run "make check".
-6.  If that succeeds, run "make install" or "sudo make install".
+    wrappers such as mpicc, mpif90, and mpif77, specify compilers
+    using the CC, FC, and F77 variables before configure.  For example:
+
+        CC=mpicc FC=mpif90 F77=mpif77 CPPFLAGS=-I${NCDIR}/include \
+        LDFLAGS=-L${NCDIR}/lib ./configure --prefix=${NFDIR}
+
+    You may have to use absolute path names for CC, F90, and F77 if
+	configure can't find them. Finally, you may also need to set
+	CFLAGS to indicate which Fortran compiler is wrapped by mpif90 nd
+	mpif77. For example, if "mpif90 --show" indicates gfortran is
+	being used, then set CFLAGS=-DgFortran, and similarly set
+	CFLAGS=-DpgiFortran for Portland Group compilers.
+
+6.  If that succeeds, run "make check".
+
+7.  If that succeeds, run "make install" or "sudo make install".
+
+If you encounter problems, send the complete "config.log" file
+generated by running configure to support-netcdf at unidata.ucar.edu.
 
 Linking your programs with netCDF Fortran libraries {#linking_against_netcdf_fortran}
 ==============================
 
 If you built the shared libraries, you can link with something like
 
-       fortran_compiler my_prog.f -o my_prog -I${DIR1}/include -L${DIR1}/lib -lnetcdff
+    fortran my_prog.f -o my_prog -I${NFDIR}/include -L${NFDIR}/lib -lnetcdff
 
 to link your Fortran software with the installed netCDF Fortran and C
-libraries. If you didn't install the shared libraries in a standard
-place, you may need to set LD\_LIBRARY\_PATH (or DYLD\_LIBRARY\_PATH for
-OSX) before running the resulting program.
+libraries.
+
+If you didn't install the shared libraries in a standard place, you
+may need to set LD\_LIBRARY\_PATH (or DYLD\_LIBRARY\_PATH for OSX) to
+include `${NFDIR}/lib` before running the resulting
+program. Alternatively, you may add `${NFDIR}/lib` to the
+LD\_RUN\_PATH environment variable before linking, or use the
+`-Wl,-rpath -Wl,${NFDIR}/lib` linker flag, or have your system
+administrator add `${NFDIR}/lib` to `/etc/ld.so.conf'.  See
+operating system documentation about shared libraries for more
+information, such as the ld(1) and ld.so(8) manual pages.
 
 If you built static libraries, you will need to use something like
 
-       fortran_compiler my_prog.f -o my_prog -I${DIR1}/include \
-        -L${DIR1}/lib -lnetcdff -lnetcdf -L${DIR2}/lib -lhdf5_hl -lhdf5 -lz -lcurl -lm
+    fortran my_prog.f -o my_prog -I${NFDIR}/include \
+    -L${NCDIR}/lib -lnetcdff -lnetcdf \
+	-L${H5DIR}/lib -lhdf5_hl -lhdf5 -L${ODIR} -lz -lcurl -lm
 
 to link Fortran software with the installed Fortran library and the
 libraries on which it depends.
 
 A simpler alternative that should work for either shared or static
-libraries is to use the "nf-config" utility installed in *${DIR1}*/bin:
+libraries is to use the "nf-config" utility installed in `${NFDIR}/bin`:
 
-       `nf-config --fc` my_prog.f -o my_prog `nf-config --fflags --flibs`
+	fortran my_prog.f -o my_prog `nf-config --fflags --flibs`
 
 or the more general "pkg-config" utility, if you have it:
 
-       fortran_compiler my_prog.f -o my_prog `pkg-config --cflags --libs netcdf-fortran`
-       
+	fortran my_prog.f -o my_prog `pkg-config --cflags --libs netcdf-fortran`
 
 Specifying The Environment for Building {#specify_build_env_fortran}
 ========================================
 
-
-The netCDF configure script searches your path to find the compilers and tools it needed. To use compilers that can't be found in your path, set their environment variables.
-
-The configure script will use gcc and associated GNU tools if they are found. Many users, especially those with performance concerns, will wish to use a vendor supplied compiler.
-
-For example, on an AIX system, users may wish to use xlc (the AIX compiler) in one of its many flavors. Set environment variables before the build to achieve this.
-
-For example, to change the C compiler, set CC to xlc (in sh: export CC=xlc). (But don't forget to also set CXX to xlC, or else configure will try to use g++, the GNU C++ compiler to build the netCDF C++ API. Similarly set FC to xlf90 so that the Fortran APIs are built properly.)
-
-By default, the netCDF library is built with assertions turned on. If you wish to turn off assertions, set CPPFLAGS to -DNDEBUG (csh ex: setenv CPPFLAGS -DNDEBUG).
-
-If GNU compilers are used, the configure script sets CPPFLAGS to “-g -O2”. If this is not desired, set CPPFLAGS to nothing, or to whatever other value you wish to use, before running configure.
-
 For cross-compiles, the following environment variables can be used to override the default fortran/C type settings like this (in sh):
 
-     export NCBYTE_T=''integer(selected_int_kind(2))''
-     export NCSHORT_T=''integer*2''
-     export NF_INT1_T=''integer(selected_int_kind(2))''
-     export NF_INT2_T=''integer*2''
+     export NCBYTE_T="integer(selected_int_kind(2))"
+     export NCSHORT_T="integer*2"
+     export NF_INT1_T="integer(selected_int_kind(2))"
+     export NF_INT2_T="integer*2"
      export NF_INT1_IS_C_SHORT=1
      export NF_INT2_IS_C_SHORT=1
      export NF_INT_IS_C_INT=1
      export NF_REAL_IS_C_FLOAT=1
      export NF_DOUBLEPRECISION_IS_C_DOUBLE=1
      
-In this case you will need to run configure with –disable-fortran-compiler-check and –disable-fortran-type-check.
+In this case you will need to run configure with `–disable-fortran-compiler-check` and `–disable-fortran-type-check`.
 
-Variable Description Notes
+Environment Variable Description Notes
 --------------------------
 
 Variable | Usage | Description
 ---|---|---
 CC	| C compiler	| If you don't specify this, the configure script will try to find a suitable C compiler. The default choice is gcc. If you wish to use a vendor compiler you must set CC to that compiler, and set other environment variables (as described below) to appropriate settings.
-FC	| Fortran compiler (if any)| 	If you don't specify this, the configure script will try to find a suitable Fortran and Fortran 77 compiler. Set FC to "" explicitly, or provide the –disable-f77 option to configure, if no Fortran interface (neither F90 nor F77) is desired. Use –disable-f90 to disable the netCDF Fortran 90 API, but build the netCDF Fortran 77 API.
-F77	| Fortran 77 compiler (if any)	| Only specify this if your platform explicitly needs a different Fortran 77 compiler. Otherwise use FC to specify the Fortran compiler. If you don't specify this, the configure script will try to find a suitable Fortran compiler. For vendor compilers, make sure you're using the same vendor's Fortran 90 compiler. Using Fortran compilers from different vendors, or mixing vendor compilers with g77, the GNU F77 compiler, is not supported and may not work.
-CXX	| C++ compiler	| If you don't specify this, the configure script will try to find a suitable C++ compiler. Set CXX to "" explicitly, or use the –disable-cxx configure option, if no C++ interface is desired. If using a vendor C++ compiler, use that vendor's C compiler to compile the C interface. Using different vendor compilers for C and C++ may not work.
-CFLAGS	| C compiler flags	| "-O" or "-g", for example.
+FC	| Fortran compiler (if any) | 	If you don't specify this, the configure script will try to find a suitable Fortran and Fortran 77 compiler. Use –disable-f90 to disable the netCDF Fortran 90 API, but build the netCDF Fortran 77 API.
+F77	| Fortran 77 compiler (if any)	| Only specify this if your platform explicitly needs a different Fortran 77 compiler. Otherwise use FC to specify the Fortran compiler. If you don't specify this, the configure script will try to find a suitable Fortran compiler. For vendor compilers, make sure you're using the same vendor's Fortran 90 compiler. Using Fortran compilers from different vendors is not supported and may not work.
+CFLAGS	| C compiler flags	| "-O -g2", for example.
 CPPFLAGS	| C preprocessor options	| "-DNDEBUG" to omit assertion checks, for example.
 FCFLAGS| 	Fortran 90 compiler flags	| "-O" or "-g", for example. These flags will be used for FORTRAN 90. If setting these you may also need to set FFLAGS for the FORTRAN 77 test programs.
 FFLAGS	| Fortran 77 compiler flags	| "-O" or "-g", for example. If you need to pass the same arguments to the FORTRAN 90 build, also set FCFLAGS.
-CXXFLAGS	| C++ compiler flags	| "-O" or "-g", for example.
-ARFLAGS, NMFLAGS, FPP, M4FLAGS, LIBS, FLIBS, FLDFLAGS	| Miscellaneous	| One or more of these were needed for some platforms, as specified below. Unless specified, you should not set these environment variables, because that may interfere with the configure script. 
\ No newline at end of file
+ARFLAGS, NMFLAGS, FPP, M4FLAGS, LIBS, FLIBS, FLDFLAGS	| Miscellaneous	| One or more of these may be needed for some platforms. Unless required, you should not set these environment variables, because that may interfere with the configure script. 
diff --git a/docs/install.md b/docs/install.md
index 265d8f6..ac48957 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -1,130 +1,124 @@
-Getting and Building NetCDF-C {#getting_and_building_netcdf}
+Getting and Building netCDF {#getting_and_building_netcdf}
 =============================
 
 [TOC]
 
 This document is for getting and building the netCDF C library and
-utilities, version 4.3.0.  Other libraries that depend on the netCDF C
-library, such as the Fortran and C++ libraries, are available as
-separate distributions that can be built and installed after the C
-library is successfully installed.  The netCDF-Java library is also a
-separate distribution that is currently independent of the netCDF C
-library.
+utilities for the most recent released version.  Other libraries that
+depend on the netCDF C library, such as the Fortran, Python, Java, and
+C++ libraries, are available as separate distributions that can be
+optionally built and installed after the C library is successfully
+installed.  The netCDF-Java library is independent of the netCDF C
+library unless writing netCDF-4 files from Java is required.
 
 
-Getting NetCDF {#getting}
+Getting netCDF-C {#getting}
 =========================
 
-Getting pre-built NetCDF-C libraries. {#sec_get_pre_built}
+* For information regarding the netCDF-Fortran libraries, see \subpage building_netcdf_fortran.
+* Functionality to make it easier to build netcdf-fortran as part of
+  the netcdf-c build for *non-MSVC* builds may be enabled at configure
+  time by using the following **Highly Experimental** options:
+
+ * Autotools: `--enable-remote-fortran-bootstrap`
+ * CMake:  `-DENABLE_REMOTE_FORTRAN_BOOTSTRAP=ON`
+
+For more details, see the <a href="http://github.com/Unidata/netcdf-c/blob/v4.3.3.1/RELEASE_NOTES.md">draft instructions</a> in the Release 4.3.3-rc3 Notes.
+
+Getting pre-built netCDF-C libraries. {#sec_get_pre_built}
 -------------------------------------
 
 The easiest way to get netCDF is through a package management program,
-such as rpm, yum, adept, and others. NetCDF is available from many
-different repositories, including the default Red Hat and Ubuntu
-repositories.
+such as rpm, yum, homebrew, macports, adept, and others. NetCDF is
+available from many different repositories, including the default Red
+Hat and Ubuntu repositories.
 
-When getting netCDF from a software repository, you will wish to get
-the development version of the package ("netcdf-devel"). This includes
-the netcdf.h header file.
+When getting netCDF from a software repository, you should get a
+development version that includes the netcdf.h header file. A
+development version will typically have a name such as "netcdf-devel"
+or "libnetcdf-dev".
 
-Pre-release libraries for Windows may be found here: \ref winbin.
+Instructions for installing and using pre-built libraries for Windows may be found here: \ref winbin.
 
-Getting the latest NetCDF-C Source Code {#sec_get_source}
+Getting the latest netCDF-C Source Code {#sec_get_source}
 ----------------------------------------
 
-Starting with netCDF-C version 4.3.1, the netCDF-C source code is hosted at the
-Unidata GitHub repository, available at http://github.com/Unidata/netcdf-c.
+The netCDF-C source code is hosted from the <a href="http://github.com/Unidata/netcdf-c" >Unidata GitHub repository</a>.
+
 
 Two options are available for building from source:
 
-- The latest release.
-- The developer snapshot.
+* The latest release.
+* The developer snapshot.
 
 ### The latest release {#sec_latest_release}
 
-The latest release may be downloaded from github at the following location:
-
-- http://github.com/Unidata/netcdf-c/releases
+The latest full release may be <a href="http://github.com/Unidata/netcdf-c/releases" >downloaded from GitHub</a>.
 
 Source files are available in `.tar.gz` and `.zip` formats.
 
 ### The developer snapshot {#sec_dev_snapshot}
 
-The developer snapshot may be cloned from github directly by using the `git` command.
+The developer snapshot may be cloned from GitHub directly by using the `git` command.
 
 > $ git clone http://github.com/Unidata/netcdf-c netcdf-c
 
 **Note:**
 
-> ***The developer snapshot release contains bug-fixes and new
-features added since the last full release. It may also contain
-portability bugs.***
-
-Once you have downloaded and unpacked the distribution, see the
-following section on \ref building.
+*The developer snapshot release contains bug-fixes and new features added since the last full release, but may also contain new bugs, as it is not tested as extensively as the full release.*
 
-Building NetCDF {#building}
+Building netCDF-C {#building}
 ===========================
 
 The netCDF-C library and utilities require third-party libraries for
 full functionality. (See \ref architecture).
-- \ref build_default
-- \ref build_classic
-- \ref build_hdf4
-- \ref build_parallel
-- \ref building_netcdf_fortran
-- \ref configure_options
+* \ref build_default
+* \ref build_classic
+* \ref build_hdf4
+* \ref build_parallel
+* \ref building_netcdf_fortran
+* \ref configure_options
 
 Requirements {#netcdf_requirements}
 ----------------------------------
 
-* HDF5 1.8.9 (netcdf-4 support)
-* zlib 1.2.5
-* curl 7.18.0 (DAP support)
+* HDF5 1.8.9 or later (for netCDF-4 support)
+* zlib 1.2.5 or later (for netCDF-4 compression)
+* curl 7.18.0 or later (for DAP remote access client support)
 
 
 CMake and Windows support {#sub}
 --------------------------------
 
-- \ref netCDF-CMake
-- \ref winbin
+* \ref netCDF-CMake
+* \subpage winbin
 
-Building with NetCDF-4 and the Remote Data Client {#build_default}
+Building with netCDF-4 and the Remote Data Client {#build_default}
 --------------------------------
 
 The usual way of building netCDF requires the HDF5, zlib, and curl
-libraries. (And, optionally, the szlib library). Versions required are
+libraries. Versions required are
 at least HDF5 1.8.9, zlib 1.2.5, and curl 7.18.0 or later.
-(Optionally, if building with szlib, get szip 2.0 or later.)
 
-HDF5 1.8.9 and zlib 1.2.7 packages are available from the <a
-href="ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4">netCDF-4 ftp
-site</a>. If you wish to use the remote data client code, then you
+HDF5 and zlib packages are available from the <a
+href="http://www.hdfgroup.org/downloads/">HDF5 downloads site</a> and
+the <a href="http://www.zlib.net/">zlib home site</a>.
+If you wish to use the remote data client code, then you
 will also need libcurl, which can be obtained from the <a
 href="http://curl.haxx.se/download.html">curl website</a>.
 
-Make sure you run ``make check'' for the HDF5 and zlib
-distributions. They are very well-behaved distributions, but sometimes
-the build doesn't work (perhaps because of something subtly
-misconfigured on the target machine). If one of these libraries is not
-working, netCDF will have serious problems.
-
 Note that for building netCDF, it is not necessary to build the HDF5
-Fortran, C++, or Java API's.  Only the HDF5 C library is used.
+Fortran, C++, or Java API's.  Only the HDF5 C library is used, even
+for netCDF Fortran or C++ libraries.
 
 Optionally, you can also build netCDF-4 with the szip library
-(a.k.a. szlib). NetCDF cannot create szipped data files, but can read
+(a.k.a. szlib). If building with szlib, get szip 2.0 or later.
+NetCDF cannot create szipped data files, but can read
 HDF5 data files that have used szip.
-8
-There are license restrictions on the use of szip, see the section on
-licensing terms in the <a
+To determine whether license restrictions on the use of szip apply to
+your situation, see the <a
 href="http://www.hdfgroup.org/doc_resource/SZIP/">web page on szip
-compression in HDF products</a>. These license restrictions seem to
-apply to commercial users who are writing data. (Data readers are not
-restricted.) But here at NetCDF World Headquarters, in Sunny Boulder,
-Colorado, there are no lawyers, only programmers, so please read the
-szip documents for the license agreement to see how it applies to your
-situation.
+compression in HDF products</a>.
 
 If ``make check'' fails for either zlib or HDF5, the problem must be
 resolved before the netCDF-4 installation can continue. For HDF5
@@ -132,92 +126,88 @@ problems, see the <a
 href="http://www.hdfgroup.org/services/support.html">HDF5 help
 services</a>.
 
-Build zlib like this:
+To build zlib from source, specify where you want to install zlib in
+a shell variable you will also use later (ZDIR, for example), and build it like this
+from the top-level zlib source directory
+
+    $ # Build and install zlib
+    $ ZDIR=/usr/local
+    $ ./configure --prefix=${ZDIR}
+    $ make check
+    $ make install   # or sudo make install, if root permissions required
 
-~~~
-$ ./configure --prefix=/home/username/local
-$ make check install
-~~~
+Next, specify where you want to install HDF5 in another shell
+variable, for example H5DIR, and build it from the HDF5 top-level
+source directory:
 
-Then you build HDF5, specifying the location of the zlib library:
+    $ # Build and install HDF5
+    $ H5DIR=/usr/local
+    $ ./configure --with-zlib=${ZDIR} --prefix=${H5DIR}
+    $ make check
+    $ make install   # or sudo make install, if root permissions required
 
-~~~
-$ ./configure --with-zlib=/home/username/local --prefix=/home/username/local
-$ make check install
-~~~
+If you are building HDF5 with the optional szip library, include the
+<CODE>--with-szlib=</CODE> option to specify where it was installed.
 
 In all cases, the installation location specified with the <CODE>--prefix</CODE>
-option must be different from the source directory where the software
+option *must be different* from the source directory where the software
 is being built.
 
-Note that for shared libraries, you may need to add the install
-directory to the LD_LIBRARY_PATH environment variable. See
-the <a href="http://www.unidata.ucar.edu/netcdf/docs/faq.html#Shared%20Libraries">netCDF
+Before building netCDF, you may need to add ${H5DIR}/lib to the
+LD_LIBRARY_PATH environment variable if that lib directory is not searched
+by default. See the <a
+href="http://www.unidata.ucar.edu/netcdf/docs/faq.html#Shared%20Libraries">netCDF
 FAQ</a> for more details on using shared libraries.
 
-If you are building HDF5 with szip, then include the <CODE>--with-szlib=</CODE>
-option, with the directory holding the szip library.
-
-After HDF5 is done, build netcdf, specifying the location of the
-HDF5, zlib, and (if built into HDF5) the szip header files and
-libraries in the CPPFLAGS and LDFLAGS environment variables. For example:
-
-~~~
-$ CPPFLAGS=-I/home/username/local/include LDFLAGS=-L/home/username/local/lib ./configure --prefix=/home/username/local
-$ make check install
-~~~
-
-The configure script will try to find necessary tools in your
-path. When you run configure you may optionally use the <CODE>--prefix</CODE>
-argument to change the default installation directory. The above
-examples install the zlib, HDF5, and netCDF-4 libraries in
-/home/username/local/lib, the header file in /home/username/local/include, and the
-utilities in /home/username/local/bin. If you don't provide a <CODE>--prefix</CODE>
-option, installation will be in /usr/local/, in subdirectories lib/,
-include/, and bin/.  The installation location specified with the
-<CODE>--prefix</CODE> option must be different from the source directory where the
-software is being built.
-
-Building NetCDF with Classic Library Only {#build_classic}
+Indicate where you want to install netCDF in another shell
+variable, for example NCDIR. Then run the netCDF configure script,
+specifying where HDF5 was installed using the CPPFLAGS and LDFLAGS
+environment variables. For example, from the top-level netCDF source
+directory:
+
+    $ # Build and install netCDF-4
+    $ NCDIR=/usr/local
+    $ CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure --prefix=${NCDIR}
+    $ make check
+    $ make install  # or sudo make install
+
+If you don't provide a <CODE>--prefix</CODE> option, installation will
+be in /usr/local/, in subdirectories lib/, include/, and bin/.  The
+installation location specified with the <CODE>--prefix</CODE> option
+must be different from the source directory where the software is
+being built.
+
+Building netCDF with Classic Library Only {#build_classic}
 ---------------------------------------
 
 It is possible to build the netCDF C libraries and utilities so that
 only the netCDF classic and 64-bit offset formats are supported, or
-the remote data access client is not built. (See \ref netcdf_format)
+the remote data access client is not built. (See \ref netcdf_format
 for more information about the netCDF format variants.  See the <a
-href="http://opendap.org/netCDF-DAP">netCDF-DAP site</a>
-for more information about remote client access to data
-on OPeNDAP servers.)
+href="http://www.opendap.org/documentation">DAP documentation and
+support site</a> for more information about remote client access to
+data on OPeNDAP servers.)
 
-To build without support for the netCDF-4 formats or the additional
-netCDF-4 functions, but with remote access, use:
+If necessary, set the NCDIR shell variable to indicate where netCDF should be
+installed. Then to build a netCDF-3 library without support for the
+netCDF-4 formats or functions, but with remote client access, use:
 
-~~~
-$ ./configure --prefix=/home/username/local --disable-netcdf-4
-$ make check install
-~~~
+    $ # Build and install netCDF-3 from netCDF-4 source
+    $ ./configure --prefix=${NCDIR} --disable-netcdf-4
+    $ make check install
 
-(Replace `/home/username/local` with the name of the directory where
-netCDF is to be installed.  The installation location specified with
-the <CODE>--prefix</CODE> option must be different from the source directory where
-the software is being built.)
+To build with full support for netCDF-4 API's and format but without
+remote client access, use:
 
-Starting with version 4.1.1 the netCDF C libraries and utilities have
-supported remote data access, using the OPeNDAP protocols.  To build
-with full support for netCDF-4 APIs and format but without remote
-client access, use:
-
-~~~
-$ ./configure --prefix=/home/username/local --disable-dap
-$ make check install
-~~~
+    $ # Build and install netCDF-4 without DAP client support
+    $ ./configure --prefix=${NCDIR} --disable-dap
+    $ make check install
 
 To build without netCDF-4 support or remote client access, use:
 
-~~~
-$ ./configure --prefix=/home/username/local --disable-netcdf-4 --disable-dap
-$ make check install
-~~~
+    $ # Build and install minimal netCDF-3 with no DAP client support
+    $ ./configure --prefix=${NCDIR} --disable-netcdf-4 --disable-dap
+    $ make check install
 
 If you get the message that netCDF installed correctly, then you are
 done!
@@ -225,46 +215,41 @@ done!
 Building with HDF4 Support {#build_hdf4}
 ---------------------
 
-The netCDF-4 library can (since version 4.1) read HDF4 data files, if
-they were created with the SD (Scientific Data) API.
+The netCDF-4 library can read HDF4 data files, if they were created
+with the SD (Scientific Data) API.
 
 For this to work, you must build the HDF4 library with the
-configure option
-~~~
-  --disable-netcdf
-~~~
+configure option <CODE>--disable-netcdf</CODE>
 to prevent it from building an HDF4 version of the netCDF-2 library
 that conflicts with the netCDF-2 functions that are built into the Unidata
 netCDF library.
 
-Then, when building netCDF-4, use the
-~~~
-  --enable-hdf4
-~~~
+Then, when building netCDF-4, use the <CODE>--enable-hdf4</CODE>.
 option to configure. The location for the HDF4 header files and
-library must be set in the CPPFLAGS and LDFLAGS options.
+library must be specified in the CPPFLAGS and LDFLAGS environment variables
+or configure options.
 
-For HDF4 access to work, the library must be build with netCDF-4
+For HDF4 access to work, the library must be built with netCDF-4
 features.
 
 Here's an example, assuming the HDF5 library has been built and
 installed in H5DIR and you will build and install the HDF4 library in
-H4DIR (which could be the same as H5DIR):
-
-~~~
-# Build and install HDF4
-$ cd ${HDF4_SOURCE_DIRECTORY}
-$ ./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
-$ make
-$ make install
-$ # Build and install netCDF with HDF4 access enabled
-$ cd ${NETCDF_SOURCE_DIRECTORY}
-$ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
-$          LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
-$ ./configure --enable-hdf4 --enable-hdf4-file-tests
-$ make check
-$ make install
-~~~
+H4DIR (which could be the same as H5DIR). From the top-level HDF4
+source directory:
+
+    $ # Build and install HDF4
+    $ ./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
+    $ make check
+    $ make install
+
+Then from the top-level netCDF directory:
+
+    $ # Build and install netCDF-4 with HDF4 access enabled
+    $ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
+      LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
+      ./configure --enable-hdf4 --enable-hdf4-file-tests
+    $ make check
+    $ make install
 
 Building with Parallel I/O Support {#build_parallel}
 --------------
@@ -272,74 +257,79 @@ Building with Parallel I/O Support {#build_parallel}
 For parallel I/O to work, HDF5 must be installed with
 –enable-parallel, and an MPI library (and related libraries) must be
 made available to the HDF5 configure. This can be accomplished with
-the mpicc wrapper script, in the case of MPICH2.
+an mpicc wrapper script.
 
-The following works to build HDF5 with parallel I/O on our netCDF
-testing system:
+The following works from the top-level HDF5 source directory to build
+HDF5 with parallel I/O:
 
-~~~
-CC=mpicc ./configure --enable-parallel
-make check install
-~~~
+    $ # Build and install HDF5 with parallel support
+    $ CC=mpicc ./configure --enable-parallel --prefix=${H5DIR}
+    $ make check
+    $ make install
 
 If the HDF5 used by netCDF has been built with parallel I/O, then
-netCDF will also be built with support for parallel I/O. This allows
-parallel I/O access to netCDF-4/HDF5 files. Note that shared libraries
-are not supported for parallel HDF5, which makes linking more
-difficult to get right.  "LIBS=-ldl" is also sometimes needed to link
-successfully with parallel HDF5 libraries.
-(See /ref netcdf_formats for more information about the netCDF format
-variants.)
-
-The following works to build netCDF-4 with parallel I/O on our netCDF
-testing system:
-
-~~~
-$ H5DIR=/where/parallel/HDF5/was/installed
-$ CPPFLAGS="-I${H5DIR}/include"
-$ CC=mpicc
-$ LDFLAGS=-L${H5DIR}/lib
-$ LIBS=-ldl
-$ ./configure --disable-shared --enable-parallel-tests
-$ make check install
-~~~
-
+netCDF will also be built with inherited support for parallel
+I/O. This allows parallel I/O access to netCDF-4/HDF5 files. Note that
+shared libraries are not supported for parallel HDF5, which makes
+linking more difficult to get right.  (See /ref netcdf_formats for
+more information about the netCDF format variants.)
+
+From the top-level netCDF-4 source directory, the following builds
+netCDF-4 with parallel I/O, assuming H5DIR specifies where parallel
+HDF5 was installed:
+
+    $ # Build, test, and install netCDF-4 with HDF5 parallel support
+    $ CC=mpicc CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib \
+      ./configure --disable-shared --enable-parallel-tests --prefix=${NCDIR}
+    $ make check
+    $ make install
 
 If parallel I/O access to netCDF classic and 64-bit offset files is
-also needed, the parallel-netcdf library should also be installed.
-(Note: the previously recommended <a
-href=ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/pnetcdf.h>replacement
-pnetcdf.h</a> should no longer be used.)  Then configure netCDF with the
-"--enable-pnetcdf" option.
-
-Linking to NetCDF {#linking}
+needed, an alternate
+[parallel-netcdf library](https://trac.mcs.anl.gov/projects/parallel-netcdf/wiki/WikiStart),
+referred to as "PnetCDF", must also be installed. Assume it was
+installed in the directory named by the PNDIR shell variable.
+Then, from the top-level netCDF-4 source directory, configure netCDF
+with the "--enable-pnetcdf" option:
+
+    $ # Build, test, and install netCDF-4 with pnetcdf support
+    $ CC=mpicc CPPFLAGS="-I${H5DIR}/include -I${PNDIR}/include" \
+      LDFLAGS="-L${H5DIR}/lib -L${PNDIR}/lib" ./configure \
+	  --disable-shared --enable-pnetcdf  --enable-parallel-tests \
+	  --prefix=${NCDIR}
+    $ make check
+    $ make install
+
+Linking to netCDF-C {#linking}
 -------------------
 
-For static build, to use netCDF-4 you must link to all the libraries,
+For static builds of applications that use netCDF-4 you must link to all the libraries,
 netCDF, HDF5, zlib, szip (if used with HDF5 build), and curl (if the
-remote access client has not been disabled). This will mean -L options
+remote access client has not been disabled). This will require -L options
 to your build for the locations of the libraries, and -l (lower-case
 L) for the names of the libraries.
 
-For example, one user reports that she can build other applications
-with netCDF-4 by setting the LIBS environment variable:
+For example, you might build other applications with netCDF-4 by
+setting the LIBS environment variable, assuming NCDIR, H5DIR, and ZDIR
+indicate where netCDF, HDF5, and zlib are installed:
 
-~~~
-LIBS='-L/X/netcdf-4.0/lib -lnetcdf -L/X/hdf5-1.8.9/lib -lhdf5_hl -lhdf5 -lz -lm -L/X/szip-2.1/lib -lsz'
-~~~
+    LIBS="-L${NCDIR}/lib -lnetcdf -L${H5DIR}/lib -lhdf5_hl -lhdf5 -L${ZDIR}/lib -lz -lm"
 
-For shared builds, only -lnetcdf is needed. All other libraries will
-be found automatically.
+For shared builds, only <CODE>-L${NCDIR}/lib -lnetcdf</CODE> is
+needed. All other libraries will be found automatically.
 
-The ``nc-config --all'' command can be used to learn what options are
-needed for the local netCDF installation.
+The <CODE>pkg-config</CODE> or <CODE>nc-config</CODE> utilities can be
+used to specify build options for software that uses netCDF.  For
+example, to compile and link an application named myapp.c with a
+netCDF-C libraries, whether shared or static, you can use
 
-For example, this works for linking an application named myapp.c with
-netCDF-4 libraries:
+    $ cc -o myapp myapp.c `nc-config --cflags --libs`
+
+or
 
-~~~
-cc -o myapp myapp.c `nc-config --cflags --libs`
-~~~
+    $ PKG_CONFIG_PATH=${NCDIR}/lib/pkgconfig:$PKG_CONFIG_PATH
+    $ export PKG_CONFIG_PATH
+    $ cc -o myapp myapp.c `pkg-config --cflags --libs netcdf`
 
 configure options {#configure_options}
 -----------------------------
@@ -352,8 +342,8 @@ Note: --disable prefix indicates that the option is normally enabled.
 <tr><td>--disable-doxygen<td>Disable generation of documentation.<td>doxygen
 <tr><td>--disable-fsync<td>disable fsync support<td>kernel fsync support
 <tr><td>--enable-valgrind-tests <td>build with valgrind-tests; static builds only<td>valgrind
-<tr><td>--enable-netcdf-4<td>build with netcdf-4<td>HDF5 and zlib
-<tr><td>--enable-netcdf4<td>synonym for enable-netcdf-4
+<tr><td>--disable-netcdf-4<td>build netcdf-3 without HDF5 and zlib<td>
+<tr><td>--disable-netcdf4<td>synonym for disable-netcdf-4
 <tr><td>--enable-hdf4<td>build netcdf-4 with HDF4 read capability<td>HDF4, HDF5 and zlib
 <tr><td>--enable-hdf4-file-tests<td>test ability to read HDF4 files<td>selected HDF4 files from Unidata ftp site
 <tr><td>--enable-pnetcdf<td>build netcdf-4 with parallel I/O for classic and
@@ -376,20 +366,18 @@ Note: --disable prefix indicates that the option is normally enabled.
                           tests are complete). See option --with-temp-large to
                           specify temporary directory<td>
 <tr><td>--enable-benchmarks<td>Run benchmarks. This is an experimental feature.
-			  The benchmarks are a
-                          bunch of extra tests, which are timed. We use these
-                          tests to check netCDF performance.
+			  The benchmarks are extra tests, used to check netCDF performance.
     <td>sample data files from the Unidata ftp site
 <tr><td>--disable-extreme-numbers
 <td>don't use extreme numbers during testing, such as MAX_INT - 1<td>
 <tr><td>--enable-dll<td>build a win32 DLL<td>mingw compiler
-<tr><td>--disable-shared<td>build shared libraries<td>
-<tr><td>--disable-static<td>build static libraries<td>
-<tr><td>--disable-largefile<td>omit support for large files<td>
+<tr><td>--disable-shared<td>don't build shared libraries<td>
+<tr><td>--disable-static<td>don't build static libraries<td>
+<tr><td>--disable-largefile<td>omit support for files larger than 2GB<td>
 <tr><td>--enable-mmap<td>Use mmap to implement NC_DISKLESS<td>
 </table>
 
-Build Instructions for NetCDF-C using CMake {#netCDF-CMake}
+Build Instructions for netCDF-C using CMake {#netCDF-CMake}
 ===========================================
 
 ## Overview {#cmake_overview}
@@ -492,4 +480,4 @@ or
 
 ## See Also {#cmake_see_also}
 
-For further information regarding NetCDF and CMake, see \ref cmake_faq
+For further information regarding netCDF and CMake, see \ref cmake_faq
diff --git a/docs/mainpage.dox b/docs/mainpage.dox
index 73a5da2..5048fa1 100644
--- a/docs/mainpage.dox
+++ b/docs/mainpage.dox
@@ -15,9 +15,17 @@ The NetCDF homepage may be found at <a href="http://www.unidata.ucar.edu/netcdf"
 - \subpage RELEASE_NOTES
 - \ref getting_and_building_netcdf
 
-\subsection nightly_status The Latest NetCDF-C Build Status
+\subsection nightly_status The Latest NetCDF Build Status
 
-- <A href="http://my.cdash.org/index.php?project=netcdf-c">The NetCDF-C Nightly and Continuous Integration Dashboard</A>
+\subsubsection NetCDF-C
+
+- <A href="http://my.cdash.org/index.php?project=netcdf-c">The netCDF-C Nightly and Continuous Integration Dashboard</A>
+- <A href="https://travis-ci.org/Unidata/netcdf-c">NetCDF-C at Travis-CI</A>
+
+\subsubsection NetCDF-Fortran
+
+- <A href="http://my.cdash.org/index.php?project=netcdf-fortran">The netCDF-Fortran Nightly and Continuous Integration Dashboard</A>
+- <A href="https://travis-ci.org/Unidata/netcdf-c">NetCDF-Fortran at Travis-CI</A>
 
 \section learn-more Learn more about using NetCDF-C
 
diff --git a/docs/notes.dox b/docs/notes.md
similarity index 80%
rename from docs/notes.dox
rename to docs/notes.md
index e30f1e3..133670b 100644
--- a/docs/notes.dox
+++ b/docs/notes.md
@@ -1,41 +1,39 @@
-/** \file
-Documentation of error handling.
+# NetCDF Programming Notes {#programming_notes}
 
-\page programming_notes Programming Notes
+[TOC]
 
-\tableofcontents
+<H2>See Also:</H2>
 
-\section ignored_if_null Ignored if NULL
+* \subpage nc-error-codes
+
+# Ignored if NULL {#ignored_if_null}
 
 Many of the argurments of netCDF functions are pointers. For example,
 the nc_inq() functions takes four pointers:
 
-\code
+~~~.C
 int nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
-\endcode
+~~~
 
-A NULL may be passed for any of these pointers, and it will be
-ignored. For example, interested in the number of dimensions only, the
-following code will work:
+A NULL may be passed for any of these pointers, and it will be ignored. For example, interested in the number of dimensions only, the following code will work:
 
-\code
+~~~.C
 int ndims;
 ...
 if (nc_inq(ncid, &ndims, NULL, NULL, NULL))
    return SOME_ERROR;
-\endcode
+~~~
 
-\section Allocating Storage for the Result
+# Allocating Storage for the Result {#allocating_storage_for_the_result}
 
-User must allocate space for the result of an inq function before the
-function is called.
+User must allocate space for the result of an inq function before the function is called.
 
-\section specify_hyperslab Specify a Hyperslab
+# Specify a Hyperslab {#specify_hyperslab}
 
 The NetCDF allows specification of hyperslabs to be read or written
 with vectors which specify the start, count, stride, and mapping.
 
-\subsection start_vector A Vector Specifying Start Index for Each Dimension
+## A Vector Specifying Start Index for Each Dimension {#start_vector}
 
 A vector of size_t integers specifying the index in the
 variable where the first of the data values will be read.
@@ -47,7 +45,7 @@ The length of start vector must be the same as the number of
 dimensions of the specified variable. The elements of start
 correspond, in order, to the variable's dimensions.
 
-\subsection count_vector A Vector Specifying Count for Each Dimension
+## A Vector Specifying Count for Each Dimension {#count_vector}
 
 A vector of size_t integers specifying the edge lengths
 along each dimension of the block of data values to be read.
@@ -61,7 +59,7 @@ variable's dimensions.
 Setting any element of the count array to zero causes the function to
 exit without error, and without doing anything.
 
-\subsection stride_vector A Vector Specifying Stride for Each Dimension
+## A Vector Specifying Stride for Each Dimension {#stride_vector}
 
 A vector of size_t integers specifying the interval between selected
 indices.
@@ -75,7 +73,7 @@ variable's dimensions.
 
 A NULL stride argument is treated as (1, 1, ... , 1).
 
-\subsection map_vector A Vector Specifying Mapping for Each Dimension
+## A Vector Specifying Mapping for Each Dimension {#map_vector}
 
 A vector of integers that specifies the mapping between the dimensions
 of a netCDF variable and the in-memory structure of the internal data
@@ -94,7 +92,7 @@ type-independent units of elements.
 memory locations is 1 and not the element's byte-length as in netCDF
 2.
 
-\section ncid NetCDF ID
+# NetCDF ID {#ncid}
 
 Most netCDF function require the netCDF ID as a first parameter.
 
@@ -109,5 +107,3 @@ that is returned by nc_open() and nc_create().)
 For netCDF-4/HDF5 files, netCDF IDs can come not just from nc_open()
 and nc_create(), but also from nc_def_grp(), nc_inq_grps(),
 nc_inq_ncid(), nc_inq_grp_parent(), and nc_inq_grp_full_ncid().
-
-*/
\ No newline at end of file
diff --git a/docs/ocauth.md b/docs/ocauth.md
new file mode 100644
index 0000000..5b04663
--- /dev/null
+++ b/docs/ocauth.md
@@ -0,0 +1,475 @@
+<center>
+
+OC Authorization Support {#oc_auth_support}
+========================
+
+Author: Dennis Heimbigner<br>
+dmh at ucar dot edu
+
+Draft: 11/21/2014<br>
+Last Revised: 12/23/2014<br>
+OC Version 2.1
+</center>
+
+## Table of Contents {#auth_toc}
+
+1.  [Introduction](#Introduction)
+2.  [URL-Based Authentication](#URL-AUTH)
+3.  [RC File Authentication](#DODSRC)
+4.  [Redirection-Based Authentication](#REDIR)
+5.  [URL Constrained RC File Entries](#URLCONS)
+6.  [Client-Side Certificates](#CLIENTCERTS)
+7.  [Appendix A. All RC-File Keys](#allkeys)
+8.  [Appendix B. ESG Access in Detail](#ESGDETAIL)
+
+## Introduction {#Introduction}
+
+OC can support user authorization using those provided by the curl
+library. This includes basic password authentication as well as
+certificate-based authorization.
+
+With some exceptions (e.g. see the section on [redirection](#REDIR)) The
+libcurl authorization mechanisms can be accessed in two ways
+
+1.  Inserting the username and password into the url, or
+2.  Accessing information from a so-called *rc* file named either
+    *.daprc* or *.dodsrc*
+
+## URL-Based Authentication {#URL-AUTH}
+
+For simple password based authentication, it is possible to directly
+insert the username and the password into a url in this form.
+
+        http://username:password@host/...
+
+This username and password will be used if the server asks for
+authentication. Note that only simple password authentication is
+supported in this format. Specifically note that [redirection](#REDIR)
+based authorization will not work with this.
+
+## RC File Authentication {#DODSRC}
+
+The oc library supports an *rc* file mechanism to allow the passing of a
+number of parameters to liboc and libcurl.
+
+The file must be called one of the following names: ".daprc", ".dodsrc"
+If both .daprc and .dodsrc exist, then the .daprc file will take
+precedence.
+
+Searching for the rc file first looks in the current directory and then
+in the home directory (as defined by the HOME environment variable). It
+is also possible to specify a direct path using the *-R* option to
+ocprint or using the *oc\_set\_rcfile* procedure (see oc.h). Note that
+for these latter cases, the path must be to the file itself, not to the
+containing directory.
+
+The rc file format is a series of lines of the general form:
+
+    [<host:port>]<key>=<value>
+
+where the bracket-enclosed host:port is optional and will be discussed
+subsequently.
+
+The currently defined set of authorization-related keys are as follows.
+The second column is the affected curl\_easy\_setopt option(s).
+
+Key
+
+curl\_easy\_setopt Option
+
+HTTP.COOKIEJAR
+
+CURLOPT\_COOKIEJAR, CURLOPT\_COOKIEFILE
+
+HTTP.PROXY\_SERVER
+
+CURLOPT\_PROXY, CURLOPT\_PROXYPORT, CURLOPT\_PROXYUSERPWD
+
+HTTP.SSL.CERTIFICATE
+
+CURLOPT\_SSLCERT
+
+HTTP.SSL.KEY
+
+CURLOPT\_SSLKEY
+
+HTTP.SSL.KEYPASSWORD
+
+CURLOPT\_KEYPASSWORD
+
+HTTP.SSL.CAINFO
+
+CURLOPT\_SSLCAINFO
+
+HTTP.SSL.CAPATH
+
+CURLOPT\_SSLCAPATH
+
+HTTP.SSL.VERIFYPEER
+
+CURLOPT\_SSL\_VERIFYPEER
+
+HTTP.CREDENTIALS.USERPASSWORD
+
+CURLOPT\_USERPASSWORD
+
+### Password Authentication
+
+The key HTTP.CREDENTIALS.USERPASSWORD can be used to set the simple
+password authentication. This is an alternative to setting it in the
+url. The value must be of the form "username:password".
+
+### Cookie Jar
+
+The HTTP.COOKIEJAR key specifies the name of file from which to read
+cookies (CURLOPT\_COOKIEJAR) and also the file into which to store
+cookies (CURLOPT\_COOKIEFILE). The same value is used for both CURLOPT
+values. It defaults to in-memory storage.
+
+### Certificate Authentication
+
+HTTP.SSL.CERTIFICATE specifies a file path for a file containing a PEM
+cerficate. This is typically used for client-side authentication.
+
+HTTP.SSL.KEY is essentially the same as HTTP.SSL.CERTIFICATE and should
+usually have the same value.
+
+HTTP.SSL.KEYPASSWORD specifies the password for accessing the
+HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE file.
+
+HTTP.SSL.CAPATH specifies the path to a directory containing trusted
+certificates for validating server sertificates.
+
+HTTP.SSL.VALIDATE is a boolean (1/0) value that if true (1) specifies
+that the client should verify the server's presented certificate.
+
+HTTP.PROXY\_SERVER specified the url for accessing the proxy:
+(e.g.http://\[username:password@\]host\[:port\])
+
+## Redirection-Based Authentication {#REDIR}
+
+
+Some sites provide authentication by using a third party site to to the
+authentication. One example is
+[URS](https://uat.urs.earthdata.nasa.gov), the EOSDIS User Registration
+System.
+
+The process is usually as follows.
+
+1.  The client contacts the server of interest (SOI), the actual
+    data provider.
+2.  The SOI sends a redirect to the client to connect to the URS system.
+3.  The client authenticates with URS.
+4.  URS sends a redirect (with authorization information) to send the
+    client back to the SOI to actually obtain the data.
+
+In order for this to work with libcurl, the client will usually need to
+provide a .netrc file so that the redirection will work correctly. The
+format of this .netrc file will contain content that typically look like
+this.
+
+    machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
+
+where the machine is the one to which the client is redirected for
+authorization, and the login and password are those needed to
+authenticate.
+
+The .netrc file can be specified in two ways.
+
+1.  Specify the netrc file to liboc using the procedure in oc.h:
+
+        oc_set_netrc(OClink* link, const char* file)
+
+    (This is equivalent to the -N flag to ocprint).
+
+2.  Put the following line in your .daprc/.dodsrc file.
+
+        HTTP.NETRC=<path to netrc file>
+
+One final note. In using this, it is probable that you will need to
+specify a cookie jar (HTTP.COOKIEJAR) so that the redirect site can pass
+back authorization information.
+
+## URL Constrained RC File Entries {#URLCONS}
+
+Each line of the rc file can begin with a host+port enclosed in square
+brackets. The form is "host:port". If the port is not specified then the
+form is just "host". The reason that more of the url is not used is that
+libcurl's authorization grain is not any finer than host level.
+
+Examples.
+
+    [remotetest.unidata.ucar.edu]HTTP.VERBOSE=1
+    or
+    [fake.ucar.edu:9090]HTTP.VERBOSE=0
+
+If the url request from, say, the *oc\_open* method has a host+port
+matchine one of the prefixes in the rc file, then the corresponding
+entry will be used, otherwise ignored.
+
+For example, the URL
+
+    http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
+
+will have HTTP.VERBOSE set to 1.
+
+Similarly,
+
+    http://fake.ucar.edu:9090/dts/test.01
+
+will have HTTP.VERBOSE set to 0.
+
+## Client-Side Certificates {#CLIENTCERTS}
+
+Some systems, notably ESG (Earth System Grid), requires the use of
+client-side certificates, as well as being [re-direction based](#REDIR).
+This requires setting the following entries:
+
+-   HTTP.COOKIEJAR — a file path for storing cookies
+    across re-direction.
+-   HTTP.NETRC — the path to the netrc file.
+-   HTTP.SSL.CERTIFICATE — the file path for the client side
+    certificate file.
+-   HTTP.SSL.KEY — this should have the same value
+    as HTTP.SSL.CERTIFICATE.
+-   HTTP.SSL.CAPATH — the path to a "certificates" directory.
+-   HTTP.SSL.VALIDATE — force validation of the server certificate.
+
+Note that the first two are to support re-direction based
+authentication.
+
+## Appendix A. All RC-File Keys {#allkeys}
+
+For completeness, this is the list of all rc-file keys.
+
+Key
+
+curl\_easy\_setopt Option
+
+HTTP.DEFLATE
+
+CUROPT\_DEFLATE\
+with value "deflate,gzip"
+
+HTTP.VERBOSE
+
+CUROPT\_VERBOSE
+
+HTTP.TIMEOUT
+
+CUROPT\_TIMEOUT
+
+HTTP.USERAGENT
+
+CUROPT\_USERAGENT
+
+HTTP.COOKIEJAR
+
+CUROPT\_COOKIEJAR
+
+HTTP.COOKIE\_JAR
+
+CUROPT\_COOKIEJAR
+
+HTTP.PROXY\_SERVER
+
+CURLOPT\_PROXY,\
+CURLOPT\_PROXYPORT,\
+CURLOPT\_PROXYUSERPWD
+
+HTTP.SSL.CERTIFICATE
+
+CUROPT\_SSLCERT
+
+HTTP.SSL.KEY
+
+CUROPT\_SSLKEY
+
+HTTP.SSL.KEYPASSWORD
+
+CUROPT\_KEYPASSWORD
+
+HTTP.SSL.CAINFO
+
+CUROPT\_SSLCAINFO
+
+HTTP.SSL.CAPATH
+
+CUROPT\_SSLCAPATH
+
+HTTP.SSL.VERIFYPEER
+
+CUROPT\_SSL\_VERIFYPEER
+
+HTTP.CREDENTIALS.USERPASSWORD
+
+CUROPT\_USERPASSWORD
+
+HTTP.NETRC
+
+CURLOPT\_NETRC,CURLOPT\_NETRC\_FILE
+
+## Appendix B. ESG Access in Detail {#ESGDETAIL}
+
+It is possible to access Earth Systems Grid (ESG) datasets from ESG
+servers through the OC API using the techniques described in the section
+on [Client-Side Certificates](#CLIENTCERTS).
+
+In order to access ESG datasets, however, it is necessary to register as
+a user with ESG and to setup your environment so that proper
+authentication is established between an oc client program and the ESG
+data server. Specifically, it is necessary to use what is called
+"client-side keys" to enable this authentication. Normally, when a
+client accesses a server in a secure fashion (using "https"), the server
+provides an authentication certificate to the client. With client-side
+keys, the client must also provide a certificate to the server so that
+the server can know with whom it is communicating.
+
+The oc library uses the *curl* library and it is that underlying library
+that must be properly configured.
+
+### Terminology
+
+The key elements for client-side keys requires the constructions of two
+"stores" on the client side.
+
+-   Keystore - a repository to hold the client side key.
+-   Truststore - a repository to hold a chain of certificates that can
+    be used to validate the certificate sent by the server to
+    the client.
+
+The server actually has a similar set of stores, but the client need not
+be concerned with those.
+
+### Initial Steps
+
+The first step is to obtain authorization from ESG. Note that this
+information may evolve over time, and may be out of date. This
+discussion is in terms of BADC and NCSA. You will need to substitute as
+necessary.
+
+1.  Register at http://badc.nerc.ac.uk/register to obtain access to badc
+    and to obtain an openid, which will looks something like:
+
+        https://ceda.ac.uk/openid/Firstname.Lastname
+
+2.  Ask BADC for access to whatever datasets are of interest.
+3.  Obtain short term credentials at
+    http://grid.ncsa.illinois.edu/myproxy/MyProxyLogon/ You will need to
+    download and run the MyProxyLogon program. This will create a
+    keyfile in, typically, the directory ".globus". The keyfile will
+    have a name similar to this: "x509up\_u13615" The other elements in
+    ".globus" are certificates to use in validating the certificate your
+    client gets from the server.
+4.  Obtain the program source ImportKey.java from this location:
+    http://www.agentbob.info/agentbob/79-AB.html (read the whole page,
+    it will help you understand the remaining steps).
+
+### Building the KeyStore
+
+You will have to modify the keyfile in the previous step and then create
+a keystore and install the key and a certificate. The commands are
+these:
+
+        openssl pkcs8 -topk8 -nocrypt -in x509up_u13615 -inform PEM -out key.der -outform DER
+
+        openssl x509 -in x509up_u13615 -inform PEM -out cert.der -outform DER
+
+        java -classpath  -Dkeypassword="" -Dkeystore=./ key.der cert.der
+
+Note, the file names "key.der" and "cert.der" can be whatever you
+choose. It is probably best to leave the .der extension, though.
+
+### Building the TrustStore
+
+Building the truststore is a bit tricky because as provided, the
+certificates in ".globus" need some massaging. See the script below for
+the details. The primary command is this, which is executed for every
+certificate, c, in globus. It sticks the certificate into the file named
+"truststore"
+
+      keytool -trustcacerts -storepass "password" -v -keystore "truststore"  -importcert -file "${c}"
+
+### Running the C Client
+
+Refer to the section on [Client-Side Certificates](#CLIENTCERTS). The
+keys specified there must be set in the rc file to support ESG access.
+
+-   HTTP.COOKIEJAR=\~/.dods\_cookies
+-   HTTP.NETRC=\~/.netrc
+-   HTTP.SSL.CERTIFICATE=\~/esgkeystore
+-   HTTP.SSL.KEY=\~/esgkeystore
+-   HTTP.SSL.CAPATH=\~/.globus
+-   HTTP.SSL.VALIDATE=1
+
+Of course, the file paths above are suggestions only; you can modify as
+needed. The HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY entries should have
+same value, which is the file path for the certificate produced by
+MyProxyLogon. The HTTP.SSL.CAPATH entry should be the path to the
+"certificates" directory produced by MyProxyLogon.
+
+As noted, also uses re-direction based authentication. So, when it
+receives an initial connection from a client, it redirects to a separate
+authentication server. When that server has authenticated the client, it
+redirects back to the original url to complete the request.
+
+### Script for creating Stores
+
+The following script shows in detail how to actually construct the key
+and trust stores. It is specific to the format of the globus file as it
+was when ESG support was first added. It may have changed since then, in
+which case, you will need to seek some help in fixing this script. It
+would help if you communicated what you changed to the author so this
+document can be updated.
+
+    #!/bin/sh -x
+    KEYSTORE="esgkeystore"
+    TRUSTSTORE="esgtruststore"
+    GLOBUS="globus"
+    TRUSTROOT="certificates"
+    CERT="x509up_u13615"
+    TRUSTROOTPATH="$GLOBUS/$TRUSTROOT"
+    CERTFILE="$GLOBUS/$CERT"
+    PWD="password"
+
+    D="-Dglobus=$GLOBUS"
+    CCP="bcprov-jdk16-145.jar"
+    CP="./build:${CCP}"
+    JAR="myproxy.jar"
+
+    # Initialize needed directories
+    rm -fr build
+    mkdir build
+    rm -fr $GLOBUS
+    mkdir $GLOBUS
+    rm -f $KEYSTORE
+    rm -f $TRUSTSTORE
+
+    # Compile MyProxyCmd and ImportKey
+    javac -d ./build -classpath "$CCP" *.java
+    javac -d ./build ImportKey.java
+
+    # Execute MyProxyCmd
+    java -cp "$CP myproxy.MyProxyCmd
+
+    # Build the keystore
+    openssl pkcs8 -topk8 -nocrypt -in $CERTFILE -inform PEM -out key.der -outform DER
+    openssl x509 -in $CERTFILE -inform PEM -out cert.der -outform DER
+    java -Dkeypassword=$PWD -Dkeystore=./${KEYSTORE} -cp ./build ImportKey key.der cert.der
+
+    # Clean up the certificates in the globus directory
+    for c in ${TRUSTROOTPATH}/*.0 ; do
+        alias=`basename $c .0`
+        sed -e '0,/---/d' <$c >/tmp/${alias}
+        echo "-----BEGIN CERTIFICATE-----" >$c
+        cat /tmp/${alias} >>$c
+    done
+
+    # Build the truststore
+    for c in ${TRUSTROOTPATH}/*.0 ; do
+        alias=`basename $c .0`
+        echo "adding: $TRUSTROOTPATH/${c}"
+        echo "alias: $alias"
+        yes | keytool -trustcacerts -storepass "$PWD" -v -keystore ./$TRUSTSTORE -alias $alias -importcert -file "${c}"
+    done
+    exit
diff --git a/docs/software.md b/docs/software.md
new file mode 100644
index 0000000..fed0596
--- /dev/null
+++ b/docs/software.md
@@ -0,0 +1,2719 @@
+Software for Manipulating or Displaying NetCDF Data {#software}
+===================================================
+
+This document provides references to software packages that may be used for manipulating or displaying [netCDF](/software/netcdf/) data. We include information about both freely-available and licensed (commercial) software that can be used with netCDF data. We rely on developers to help keep this list up-to-date. If you know of corrections or additions, please [send them to us (mailto:support at unidata.ucar.edu). Where practical, we would like to include WWW links to information about thes [...]
+
+Other useful guides to utilities that can handle netCDF data include ARM's list of [ARM-tested netCDF data tools](http://science.arm.gov/%7ecflynn/ARM_Tested_Tools/), which includes some downloadable binaries and the NOAA Geophysical Fluid Dynamics Laboratory [guide to netCDF utilities](http://nomads.gfdl.noaa.gov/sandbox/products/vis/data/netcdf/GFDL_VG_NetCDF_Utils.html).
+
+------------------------------------------------------------------------
+
+[Freely Available Software](#freely)
+------------------------------------
+
+-   [ANDX (ARM NetCDF Data eXtract) and ANAX (ARM NetCDF ASCII
+    eXtract)](#ANDX)
+
+-   [ANTS (ARM NetCDF Tool Suite)](#ANTS)
+-   [ARGOS (interActive thRee-dimensional Graphics ObServatory)](#ARGOS)
+-   [CDAT (Climate Data Analysis Tool)](#CDAT)
+-   [CDFconvert (Convert netCDF to RPN and GEMPAK Grids)](#CDFconvert)
+-   [cdfsync (network synchronization of netCDF files)](#cdfsync)
+-   [CDO (Climate Data Operators)](#CDO)
+-   [CIDS Tools](#CIDS_Tools)
+-   [CSIRO MATLAB/netCDF interface](#CSIRO-MATLAB)
+-   [EPIC](#EPIC)
+-   [Excel Use](#ExcelUse)
+-   [EzGet](#EzGet)
+-   [FAN (File Array Notation)](#FAN)
+-   [FERRET](#FERRET)
+-   [FIMEX (File Interpolation, Manipulation, and EXtraction)](#fimex)
+-   [FWTools (GIS Binary Kit for Windows and Linux)](#fwtools)
+-   [GDAL (Geospatial Data Abstraction Library)](#GDAL)
+-   [GDL (GNU Data Language)](#GDL)
+-   [Gfdnavi (Geophysical fluid data navigator)](#Gfdnavi)
+-   [GMT (Generic Mapping Tools)](#GMT)
+-   [Grace](#Grace)
+-   [GrADS (Grid Analysis and Display System)](#GrADS)
+-   [Gri](#Gri)
+-   [GXSM - Gnome X Scanning Microscopy project](#GXSM)
+-   [HDF (Hierarchical Data Format) interface](#HDF_interface)
+-   [HDF-EOS to netCDF converter](#HDF-EOS)
+-   [HIPHOP (Handy IDL-Program for HDF-Output Plotting)](#HIPHOP)
+-   [HOPS (Hyperslab OPerator
+    Suite)](#HOPS))
+-   [iCDF (imports chromatographic netCDF data into MATLAB)](#iCDF)
+-   [IDV (Integrated Data Viewer)](#IDV)
+-   [Ingrid](#Ingrid)
+-   [Intel Array Visualizer](#IntelArrayVisualizer)
+-   [IVE (Interactive Visualization Environment)](#IVE)
+-   [JSON format with the ncdump-json utility](#JSON)
+-   [Java interface](#Java_interface)
+-   [Kst (2D plotting tool)](#KST)
+-   [Labview interface](#Labview-API)
+-   [MBDyn (MultiBody Dynamics)](#MBDyn)
+-   [Max_diff_nc](#Maxdiffnc)
+-   [MeteoExplorer](#MeteoExplorer)
+-   [MeteoInfo](#MeteoInfo)
+-   [MexEPS (MATLAB interface)](#MexEPS)
+-   [MEXNC and SNCTOOLS (a MATLAB interface)](#MEXNC)
+-   [Mirone (Windows MATLAB-based display)](#Mirone)
+-   [ncBrowse (netCDF File Browser)](#ncBrowse)
+-   [nccmp (netCDF compare)](#nccmp)
+-   [ncdx (netCDF for OpenDX)](#ncdx)
+-   [ncensemble (command line utility to do ensemble
+    statistics)](#ncensemble)
+-   [NCL (NCAR Command Language)](#NCL)
+-   [NCO (NetCDF Operators)](#NCO)
+-   [ncregrid](#ncregrid)
+-   [nctoolbox (a MATLAB common data model interface)](#nctoolbox)
+-   [ncview](#ncview)
+-   [NetCDF Toolbox for MATLAB-5](#matlab5)
+-   [ncvtk](#ncvtk)
+-   [netcdf tools](#netcdf_tools)
+-   [netcdf4excel (add-in for MS Excel)](#netcdf4excel)
+-   [NetCDF95 alternative Fortran API](#netcdf95)
+-   [Objective-C interface](#Objective-C)
+-   [Octave interface](#NCMEX)
+-   [Octave interface (Barth)](#Octave)
+-   [OPeNDAP (formerly DODS)](#OPeNDAP)
+-   [OpenDX (formerly IBM Data Explorer)](#OpenDX)
+-   [Panoply](#Panoply)
+-   [Parallel-NetCDF](#Parallel-NetCDF)
+-   [Paraview and vtkCSCSNetCDF](#Paraview)
+-   [Perl interfaces](#Perl)
+-   [PolyPaint+](#PolyPaint)
+-   [Pomegranate](#pomegranate)
+-   [Pupynere (PUre PYthon NEtcdf REader)](#pupynere)
+-   [PyNGL and PyNIO](#PyNGL)
+-   [Python interfaces](#Python)
+-   [QGIS (Quantum GIS)](#QGIS)
+-   [R interface](#R)
+-   [Ruby interface](#Ruby)
+-   [Scientific DataSet (SDS) Library](#SDS)
+-   [Apache Spatial Information System (SIS)](#SIS)
+-   [Tcl/Tk interfaces](#TclTk)
+-   [Tcl-nap (N-dimensional array processor)](#Tcl-nap)
+-   [Visual Basic and VB.net](#VB)
+-   [VisAD](#VisAD)
+-   [WebWinds](#WebWinds)
+-   [xray (Python N-D labelled arrays)](#xray)
+-   [Zebra](#Zebra)
+-   [User-contributed software](#user)
+
+------------------------------------------------------------------------
+
+[Commercial or Licensed Packages](#commercial)
+----------------------------------------------
+
+-   [ASA ViewNcDap](#ViewNcDap)
+-   [Avizo](#Avizo)
+-   [AVS](#AVS)
+-   [Barrodale UFI](#BCS-UFI)
+-   [DioVISTA/Storm](#DioVISTAStorm)
+-   [EnSight](#EnSight)
+-   [Environmental WorkBench](#Environmental_WorkBench)
+-   [ESRI](#ESRI)
+-   [FME](#FME)
+-   [HDF Explorer](#HDF-Explorer)
+-   [IDL Interface](#IDL)
+-   [InterFormat](#InterFormat)
+-   [IRIS Explorer Module](#IRIS_Explorer_Module)
+-   [LeoNetCDF](#LeoNetCDF)
+-   [Mathematica](#Mathematica)
+-   [MATLAB](#MATLAB)
+-   [Noesys](#Noesys)
+-   [Origin](#Origin)
+-   [PPLUS](#PPLUS)
+-   [PV-Wave](#PV-Wave)
+-   [Slicer Dicer](#SlicerDicer)
+-   [vGeo](#vGeo)
+-   [VISAGE and Decimate](#VISAGE_and_Decimate)
+-   [Voyager](#Voyager)
+
+
+
+Freely Available Software {#freely}
+=========================
+
+ANDX and ANAX {#ANDX}
+------------------------------------
+
+The ARM Program has developed [ANDX (ARM NetCDF Data
+eXtract)](http://engineering.arm.gov/~sbeus/andx-web/html/), a
+command-line utility designed for routine examination and extraction of
+data from netcdf files. Data can be displayed graphically (line-plot,
+scatter-plot, overlay, color-intensity, etc.) or extracted as ASCII
+data. Whether displayed graphically or extracted as ASCII, results can
+be saved to disk or viewed on screen.
+
+[ANAX (ARM NetCDF ASCII
+eXtract)](http://science.arm.gov/~cflynn/ARM_Tested_Tools/) is a
+scaled-down version of ANDX -- it is designed to only extract ASCII
+data. All features of ANDX pertaining to non-graphic data extraction are
+included in ANAX.
+
+ANTS {#ANTS}
+---------------------------
+
+The ARM Program has developed [ANTS (ARM NetCDF Tool
+Suite)](http://science.arm.gov/~cflynn/ANTS/), a collection of netCDF
+tools and utilities providing various means of creating and modifying
+netcdf files. ANTS is based on nctools written by Chuck Denham. The
+utilities within nctools were modified to compile with version 3.5 of
+the netCDF library, the command syntax was modified for consistency with
+other tools, and changes were made to accommodate ARM standard netCDF.
+
+The original functions from nctools were intended mainly for the
+creation, definition, and copying of fundamental netCDF elements. ARM
+added others which focus on manipulation of data within existing netCDF
+files. Additional functions have special support for multi-dimensional
+data such as "slicing" cross sections from multi-dimensional variable
+data or joining lesser-dimensional fields to form multi-dimensional
+structures. Functions have been added to support execution of arithmetic
+and logical operations, bundling or splitting netCDF files, comparing
+the structure or content of files, and so on.
+
+Essentially every type of netCDF library function call is exercised in
+ANTS. In this way then, this open-source collection of tools also
+represents a library of coding examples for fundamental netCDF tasks.
+See the [website](http://science.arm.gov/~cflynn/ANTS/) for more
+information.
+
+ARGOS {#ARGOS}
+-----------------------------
+
+[ARGOS](http://www.lapeth.ethz.ch/argos/index.html) (interActive
+thRee-dimensional Graphics ObServatory) is a new IDL-based interactive
+3D visualization tool, developed by [David N.
+Bresch](http://www.lapeth.ethz.ch/~david/index.html) and [Mark A.
+Liniger](http://www.lapeth.ethz.ch/~mark/index.html) at the Institute
+for Atmospheric Science at the Swiss Federal Institute of Technology,
+ETH, Zürich.
+
+A highly optimized graphical user interface allows quick and elegant
+creation of even complex 3D graphics (volume rendering,
+isosurfaces,...), including Z-buffered overlays (with hidden lines),
+light and data shading, Xray images, 3D trajectories, animations and
+virtual flights around your data, all documented in a full on-line
+[html-help](http://www.lapeth.ethz.ch/argos/argos_general.html). The
+netCDF data format is preferred, but any other format can be read by
+providing an IDL (or FORTRAN or C or C++) interface. Some toolboxes (for
+atmospheric model output, trajectory display, radar data) have already
+been written, others might easily be added (in IDL, FORTRAN or C code).
+All interactive activities are tracked in a script, allowing quick
+reconstruction of anything done as well as running ARGOS in batch script
+mode.
+
+Information about [copyright and licensing
+conditions](http://www.lapeth.ethz.ch/argos/argos_copyright.html) are
+available. For further information and installation, please E-mail to:
+bresch at atmos.umnw.ethz.ch
+
+CDAT {#CDAT}
+---------------------------
+
+The [Climate Data Analysis Tool (CDAT)](http://cdat.sf.net), developed
+by the [Program for Climate Model Diagnosis and Intercomparison
+(PCMDI)](http://www-pcmdi.llnl.gov/) at Lawrence Livermore National
+Laboratory, provides the capabilities needed to analyze model data,
+perform complex mathematical calculations, and graphically display the
+results. It provides the necessary tools to diagnose, validate, and
+intercompare large observational and global climate model data sets.
+It includes the ability to ingest large climate datasets in netCDF, HDF,
+DRS, and GrADS/GRIB format; the Visualization and Computation System
+(VCS) module, visually displays and animates ingested or created data;
+and the Library of AMIP Data Transmission Standards (LATS) module
+outputs data in the machine-independent netCDF or GrADS/GRIB file
+formats.
+
+In addition, the Command Line Interface (CLI) module allows CDAT to
+receive argument and function input via the command line, and the
+Graphical User Interface (GUI) allows CDAT to receive argument and
+function input via a point-and-click environment.
+
+The software, which runs as a standalone process or within PCMDI's
+Visualization and Computation System (VCS), provides climate scientists
+with an easy and fast method to read different file formats, and to
+analyze and graphically display climate data in an integrated fashion.
+CDAT includes a set of pre-defined functions to allow the user to
+manipulate the data and send the output to a file which can be viewed as
+an image, or as a collection of images in an animation. The software has
+a gradual learning curve, allowing the novice user to quickly obtain
+useful results.
+
+CDFconvert {#CDFconvert}
+---------------------------------------
+
+The [MRG CDFconvert
+package](http://www.atmos.albany.edu/facstaff/rmctc/cdf_cvt/) provided
+by the Mesoscale Research Group, McGill University/SUNY Albany, is
+designed to address data conversion issues for gridded datasets stored
+under the
+[COARDS](http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html)
+convention. CDFconvert converts regular Cylindrical Equidistant
+(Lat/Long) and Gaussian (Spherical) netCDF grids into either the
+Canadian [RPN Standard
+File](http://www.cmc.ec.gc.ca/rpn/modcom/si/libraries/rmnlib/fstd/index.html)
+or [GEMPAK](/software/gempak/index.html) file formats. MRG CDFconvert
+has the flexibility to handle netCDF files generated by a number of
+sources, including NCEP and ECMWF. User-definable conversion tables make
+the extension of the package to different datasets possible.
+
+cdfsync {#cdfsync}
+---------------------------------
+
+Joe Sirott of NOAA's Pacific Marine Environmental Laboratory has
+developed cdfsync, a program that allows users to rapidly synchronize a
+set of netCDF files over a network. Fast synchronization times are
+achieved by only transmitting the differences between files. It is built
+on the Open Source [rsync](http://samba.anu.edu.au/rsync/) program, but
+contains a number of optimizations including:
+
+-   Special handling of netCDF files for faster synchronization
+    calculations
+-   Much faster updates of large numbers of small netCDF files
+-   In-place updates of large netCDF files
+
+The latest version should run on Linux variants and Solaris.
+
+More information is available at the [cdfsync
+website](http://www.epic.noaa.gov/epic/software/cdfsync/).
+
+CDO (Climate Data Operators) {#CDO}
+--------------------------------------------------
+
+Uwe Schulzweida at the Max Planck Institute for Meteorology has
+developed [CDO](http://code.zmaw.de/projects/cdo), a collection of
+Operators to manipulate and analyze Climate Data files. Supported file
+formats include netCDF and GRIB. There are more than 350 operators
+available. The following table provides a brief overview of the main
+categories.
+
+-   File information (info, sinfo, diff, ...)
+-   File operations (copy, cat, merge, split\*, ...)
+-   Selection (selcode, selvar, sellevel, seltimestep, ...)
+-   Missing values (setctomiss, setmisstoc, setrtomiss)
+-   Arithmetic (add, sub, mul, div, ...)
+-   Mathematical functions (sqrt, exp, log, sin, cos, ...)
+-   Comparision (eq, ne, le, lt, ge, gt, ...)
+-   Conditions (ifthen, ifnotthen, ifthenc, ifnotthenc)
+-   Field statistics (fldsum, fldavg, fldstd, fldmin, fldmax, ...)
+-   Vertical statistics (vertsum, vertavg, vertstd, vertmin, ...)
+-   Time range statistics (timavg, yearavg, monavg, dayavg, ...)
+-   Field interpolation (remapbil, remapcon, remapdis, ...)
+-   Vertical interpolation (ml2pl, ml2hl)
+-   Time interpolation (inttime, intyear)
+
+As an example of use of CDO, converting from GRIB to netCDF can be as
+simple as
+
+        cdo -f nc copy file.grb file.nc
+
+or with relative time axis (for usage with GrADS)
+        cdo -r -f nc copy file.grb file.nc
+
+or using ECMWF reanalysis on a reduced grid
+        cdo -R -f nc copy file.grb file.nc
+
+More information is available on the [CDO
+homepage](http://code.zmaw.de/projects/cdo).
+
+CIDS Tools {#CIDS_Tools}
+---------------------------------------
+
+The Center for Clouds Chemistry and Climate
+([C4](http://www-c4.ucsd.edu/)) Integrated Data Systems
+([CIDS](http://www-c4.ucsd.edu/~cids/)) group has developed several
+useful netCDF utilities:
+-   cdf2idl: Writes an IDL script to read a NetCDF file.
+-   cdf2c: Writes C code to read a NetCDF file.
+-   cdf2fortran: Writes FORTRAN source code to read a NetCDF file.
+-   cdf2asc: Dumps NetCDF data to an ASCII file.
+
+The source for these utilities can be downloaded from [CIDS NetCDF
+Visualization Tools
+site](http://www-c4.ucsd.edu/~cids/software/visual.html).
+
+CSIRO MATLAB/netCDF interface {#CSIRO-MATLAB}
+------------------------------------------------------------
+
+The [CSIRO MATLAB/netCDF
+interface](http://www.marine.csiro.au/sw/matlab-netcdf.html) is now
+available from the [CSIRO Marine
+Laboratories](http://www.marine.csiro.au).
+The CSIRO MATLAB/netCDF interface is run from within MATLAB and has a
+simple syntax. It has options for automatically handling missing values,
+scale factors, and permutation of hyperslabs. It is, however, limited to
+retrieving data from, and information about, existing netCDF files.
+
+The basis of the interface is a machine-dependent mex-file called
+mexcdf53. Rather than call the mex-file directly users are advised to
+employ both [Chuck Denham's netCDF toolbox](#NC4ML5) and the CSIRO
+MATLAB/netCDF interface described here. For read-only access to existing
+netCDF data, the CSIRO interface has a simpler syntax than the netCDF
+Toolbox, but the latter may also be used to create and manipulate netCDF
+variables and datasets.
+
+EPIC {#EPIC}
+---------------------------
+
+NOAA's Pacific Marine Environmental Laboratory
+([PMEL](http://www.pmel.noaa.gov/)) has developed the
+[EPIC](http://www.pmel.noaa.gov/epic/) software package for
+oceanographic data. EPIC provides graphical display and data field
+manipulation for multi-dimensional netCDF files (up to 4 dimensions).
+PMEL has been using this software on Unix and VMS several years. At
+present, they have:
+
+-   a data file I/O library (
+    [epslib](http://www.pmel.noaa.gov/epic/eps-manual/epslib_toc.html),
+    which is layered on top of the netCDF library).
+-   epslib allows transparent access to multiple data file formats
+-   a [MATLAB MexEPS
+    interface](http://www.epic.noaa.gov/epic/software/mexeps.htm) for
+    using any supported EPIC file with MATLAB
+-   [suite of EPIC
+    programs](http://www.epic.noaa.gov/epic/software/ep_programs.htm)
+    for graphics and analysis of hydrographic profile data and time
+    series data.
+
+This software was developed on Sun/Unix and is also supported for
+DEC/Ultrix and VAX/VMS as a system for data management, display and
+analysis system for observational oceanographic time series and
+hydrographic data. The EPIC software includes over 50 programs for
+oceanographic display and analysis, as well as utilities for putting
+in-situ or observational data on-line (with on-the-fly graphics and data
+download) on the WWW.
+The developers are interested in coordinating with others who may be
+developing oceanographic software for use with netCDF files. The EPIC
+software is available via anonymous FTP from ftp.noaapmel.gov in the
+epic/ and /eps directories. To obtain the EPIC software, please see Web
+pages at <http://www.pmel.noaa.gov/epic/download/index.html>. For
+information about EPIC, please see the Web pages at
+<http://www.pmel.noaa.gov/epic/index.html>. Contact epic at pmel.noaa.gov,
+or Nancy Soreide, nns at noaapmel.gov, for more information.
+
+Excel Use
+------------------------------------
+
+Several packages are available for accessing netCDF data from Microsoft
+Excel, including the [netcdf4excel](#netcdf4excel) add-in for Excel, and
+a [Scientific Dataset (SDS) Library](#SDS) that supports a DataSetEditor
+add-in for Excel to view and modify various forms of data, including
+netCDF.
+
+EzGet {#EzGet}
+-----------------------------
+
+A FORTRAN library called
+[EzGet](http://www-pcmdi.llnl.gov/ktaylor/ezget/ezget.html) has been
+developed at [PCMDI](http://www-pcmdi.llnl.gov/PCMDI.html) to facilitate
+retrieval of modeled and observed climate data stored in popular formats
+including [DRS](http://www-pcmdi.llnl.gov/drach/DRS.html),
+[netCDF](/software/netcdf/), [GrADS](http://grads.iges.org/grads), and,
+if a control file is supplied,
+[GRIB](ftp://nic.fb4.noaa.gov/pub/nws/nmc/docs/gribed1/). You can
+specify how the data should be structured and whether it should undergo
+a grid transformation before you receive it, even when you know little
+about the original structure of the stored data (e.g., its original
+dimension order, grid, and domain).
+The EzGet library comprises a set of subroutines that can be linked to
+any FORTRAN program. EzGet reads files through the
+[cdunif](http://www-pcmdi.llnl.gov/drach/cdunif.html) interface, but use
+of EzGet does not require familiarity with cdunif. The main advantages
+of using EzGet instead of the lower level cdunif library include:
+
+-   Substantial error trapping capabilities and detailed error messages
+-   Versatile capability of conveniently selecting data from specified
+    regions (e.g., oceans, North America, all land areas north of 45
+    degrees latitude, etc.)
+-   Ability to map data to a new grid at the time it is retrieved by
+    EzGet
+-   Automatic creation of \`\`weights'' for use in subsequent averaging
+    or masking of data
+-   Increased control in specifying the domain of the data to be
+    retrieved.
+
+For more information about EzGet, including instructions for downloading
+the documentation or software, see the EzGet home page at
+<http://www-pcmdi.llnl.gov/ktaylor/ezget/ezget.html>. For questions or
+comments on EzGet, contact Karl Taylor (taylor13 at llnl.gov).
+
+FAN
+-------------------------
+
+[FAN (File Array Notation)](/software/netcdf/fan_utils.html) is Harvey
+Davies' package for extracting and manipulating array data from netCDF
+files. The package includes the three utilities nc2text, text2nc, and
+ncrob for printing selected data from netCDF arrays, copying ASCII data
+into netCDF arrays, and performing various operations (sum, mean, max,
+min, product, ...) on netCDF arrays. A library (fanlib) is also included
+that supports the use of FAN from C programs. The package is available
+via anonymous FTP from
+<ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/fan.tar.Z>. Questions and
+comments may be sent to Harvey Davies, harvey.davies at csiro.au.
+
+FERRET {#FERRET}
+-------------------------------
+
+[FERRET](http://ferret.wrc.noaa.gov/Ferret/) is an interactive computer
+visualization and analysis environment designed to meet the needs of
+oceanographers and meteorologists analyzing large and complex gridded
+data sets. It is available by anonymous ftp from abyss.pmel.noaa.gov for
+a number of computer systems: SUN (Solaris and SUNOS), DECstation
+(Ultrix and OSF/1), SGI, VAX/VMS and Macintosh (limited support), and
+IBM RS-6000 (soon to be released).
+FERRET offers a Mathematica-like approach to analysis; new variables may
+be defined interactively as mathematical expressions involving data set
+variables. Calculations may be applied over arbitrarily shaped regions.
+Fully documented graphics are produced with a single command. Graphics
+styles included line plots, scatter plots, contour plots, color-filled
+contour plots, vector plots, wire frame plots, etc. Detailed controls
+over plot characteristics, page layout and overlays are provided. NetCDF
+is supported both as an input and an output format.
+
+Many excellent software packages have been developed recently for
+scientific visualization. The features that make FERRET distinctive
+among these packages are Mathematica-like flexibility, geophysical
+formatting (latitude/longitude/date), "intelligent" connection to its
+data base, special memory management for very large calculations, and
+symmetrical processing in 4 dimensions. Contact Steve Hankin,
+hankin at noaapmel.gov, for more information.
+
+Fimex {#fimex}
+-----------------------------
+
+Heiko Klein (Norwegian Meteorological Institute) has developed the
+[fimex](https://wiki.met.no/fimex/start) (File Interpolation,
+Manipulation, and EXtraction) C++ library for gridded geospatial data.
+It converts between several data formats (currently netCDF, NcML, GRIB1
+or GRIB2, and felt). Fimex also enables you to change the projection and
+interpolation of scalar and vector grids, to subset the gridded data,
+and to extract only parts of the files. Fimex supports a growing list of
+other [features](https://wiki.met.no/fimex/features), including support
+for most NcML features and for netCDF-4 compression.
+
+For simple usage, Fimex also comes with the command line program fimex.
+
+Documentation and downloads are available from the [fimex web
+site](http://wiki.met.no/fimex/).
+
+FWTools (GIS Binary Kit for Windows and Linux) {#fwtools}
+------------------------------------------------------------------------
+
+[FWTools](http://fwtools.maptools.org/) is Frank Warmerdam's set of Open
+Source GIS binaries for Windows (win32) and Linux (x86 32bit) systems.
+The kits are intended to be easy for end users to install and get going
+with, and include OpenEV, GDAL, MapServer, PROJ.4 and OGDI as well as
+some supporting components. FWTools aims to track the latest development
+versions of the packages included as opposed to official releases, "to
+give folks a chance to use the *latest and greatest*".
+
+GDAL {#GDAL}
+---------------------------
+
+Frank Warmerdam's [GDAL](http://www.remotesensing.org/gdal/index.html)
+is a translator library for raster geospatial data formats that is
+released under an X/MIT style Open Source license. As a library, it
+presents a [single abstract data
+model](http://www.remotesensing.org/gdal/gdal_datamodel.html) to the
+calling application for all supported formats. The related
+[OGR](http://www.remotesensing.org/gdal/ogr) library (which lives within
+the GDAL source tree) provides a similar capability for simple features
+vector data.
+
+GDAL is in active use in several projects, and includes roughly 40
+format drivers, including a translator for netCDF (read/write). Other
+translators include GeoTIFF (read/write), Erdas Imagine (read/write),
+ESRI .BIL (read), .aux labeled raw (read/write), DTED (read), SDTS DEM
+(read), CEOS (read), JPEG (read/write), PNG (read/write), Geosoft GXF
+(read) and Arc/Info Binary Grid (read). A full list is available in
+[Supported
+Formats](http://www.remotesensing.org/gdal/formats_list.html).
+
+GDAL has recently included support for the netCDF-4 enhanced data model
+and netCDF-4 format, as well as improved support for recent additions to
+the CF conventions.
+
+As an example of the use of GDAL, converting an ArcInfo ASCII grid to
+netCDF (GMT conventions) as easy as:
+
+       gdal_translate arc_ascii.grd -of GMT gmt_grid.nc
+
+GDL (GNU Data Language) {#GDL}
+---------------------------------------------
+
+[GDL](http://gnudatalanguage.sourceforge.net/) is a free implementation
+of most of the programming language supported by [IDL](#IDL)
+(Interactive Data Language). GDL supports the netCDF-3 API.
+
+Gfdnavi (Geophysical fluid data navigator) {#Gfdnavi}
+--------------------------------------------------------------------
+
+[Gfdnavi](http://www.gfd-dennou.org/arch/davis/gfdnavi/index.en.htm) is
+a web-based tool to archive, share, distribute, analyze, and visualize
+geophysical fluid data and knowledge. The software is under development
+by members of the GFD Dennou Club, including T. Horinouchi (RISH, Kyoto
+U.), S. Nishizawa (RIMS, Kyoto U.), and colleagues. Gfdnavi uses a
+metadata database for managing and analyzing data and visualizations. It
+also permits publishing data for web access and will soon support access
+to data on other Gfdnavi servers. Web service APIs are now under
+development. A presentation [Introducing
+Gfdnavi](http://www.gfd-dennou.org/arch/davis/gfdnavi/presen/2007-03-05_GfdnaviIntro.En/pub/)
+describes the architecture and shows examples of use.
+
+Gfdnavi is dependent on two technologies:
+
+-   [Ruby on Rails](http://www.rubyonrails.com/), a framework for web
+    applications, and
+-   [the Dennou Ruby Project](http://ruby.gfd-dennou.org/), a collection
+    of tools for geophysical data. These tools include
+    [GPhys](http://ruby.gfd-dennou.org/products/gphys/) software to
+    handle GRIB, GrADS, and netCDF data uniformly.
+
+As an example of this technology, Takuji Kubota has established [a
+Gfdnavi server](http://www.gsmap.aero.osakafu-u.ac.jp/gfdnavi/) for the
+Global Satellite Mapping of Precipitation
+([GSMaP](http://www.radar.aero.osakafu-u.ac.jp/~gsmap/index_english.html))
+project.
+
+GMT {#GMT}
+-------------------------
+
+[GMT](http://gmt.soest.hawaii.edu/) (Generic Mapping Tools) is an open
+source collection of about 60 tools for manipulating geographic and
+Cartesian data sets (including filtering, trend fitting, gridding,
+projecting, etc.) and producing Encapsulated PostScript File (EPS)
+illustrations ranging from simple x-y plots via contour maps to
+artificially illuminated surfaces and 3-D perspective views. GMT
+supports 30 map projections and transformations and comes with support
+data such as coastlines, rivers, and political boundaries. GMT is
+developed and maintained by Paul Wessel and Walter H. F. Smith with help
+from a global set of volunteers, and is supported by the National
+Science Foundation. It is released under the GNU General Public License.
+
+The package can access COARDS-compliant netCDF grids as well as ASCII,
+native binary, or user-defined formats. The GMT package is available via
+anonymous ftp from several servers; see
+[gmt.soest.hawaii.edu](http://gmt.soest.hawaii.edu) for installation
+information.
+
+Grace {#Grace}
+-----------------------------
+
+[Grace](http://plasma-gate.weizmann.ac.il/Grace/) is a tool to make
+two-dimensional plots of scientific data, including 1D netCDF variables.
+It runs under the X Window System and OSF Motif (recent versions of
+LessTif are, by and large, fine, too). Grace runs on practically any
+version of Unix. As well, it has been successfully ported to VMS, OS/2
+and Win9\*/NT (some functionality may be missing, though). Grace is a
+descendant of ACE/gr.
+A few features of Grace are:
+
+-   User defined scaling, tick marks, labels, symbols, line styles,
+    colors.
+-   Batch mode for unattended plotting.
+-   Read and write parameters used during a session.
+-   Regressions, splines, running averages, DFT/FFT,
+    cross/auto-correlation, ...
+-   Support for dynamic module loading.
+-   Hardcopy support for PostScript, PDF, GIF, and PNM formats.
+-   Device-independent Type1 font rastering.
+-   Ability to read or write netCDF data.
+
+GrADS {#GrADS}
+-----------------------------
+
+[GrADS](http://grads.iges.org/grads/grads.html) (Grid Analysis and
+Display System) is an interactive desktop tool from
+[COLA/IGES](http://grads.iges.org/cola.html) that is currently in use
+worldwide for the analysis and display of earth science data. GrADS is
+implemented on all commonly available UNIX workstations, Apple
+Macintosh, and DOS or Linux based PCs, and is freely available via
+anonymous ftp. GrADS provides an integrated environment for access,
+manipulation, and display of earth science data in several forms,
+including GRIB and netCDF. For more information, see the [GrADS User's
+Guide](http://grads.iges.org/grads/gadoc/users.html).
+
+Gri
+-------------------------
+
+Gri is an extensible plotting language for producing scientific graphs,
+such as x-y plots, contour plots, and image plots. Dan Kelley of
+Dalhousie University is the author of Gri, which can read data from
+netCDF files as well as ASCII and native binary data. For more
+information on Gri, see the URL <http://gri.sourceforge.net/>.
+
+GXSM {#GXSM}
+---------------------------
+
+The GXSM is the Gnome X Scanning Microscopy project, it is a bit more
+than just a piece of software (the GXSM itself), there is full hardware
+support for DSP cards including open source DSP software and a growing
+set of SPM related electronics. For more information, see
+<http://gxsm.sourceforge.net/>.
+
+HDF interface {#HDF_interface}
+---------------------------------------------
+
+The National Center for Supercomputing Applications (NCSA) has added the
+netCDF interface to their [Hierarchical Data Format
+(HDF)](http://hdf.ncsa.uiuc.edu/) software. HDF is an extensible data
+format for self-describing files. A substantial set of applications and
+utilities based on HDF is available; these support raster-image
+manipulation and display and browsing through multidimensional
+scientific data. An implementation is now available that provides the
+netCDF interface to HDF. With this software, it is possible to use the
+netCDF calling interface to place data into an HDF file. The netCDF
+calling interface has not changed and netCDF files stored in XDR format
+are readable, so existing programs and data will still be usable
+(although programs will need to be relinked to the new library). There
+is currently no support for the mixing of HDF and netCDF structures. For
+example, a raster image can exist in the same file as a netCDF object,
+but you have to use the Raster Image interface to read the image and the
+netCDF interface to read the netCDF object. The other HDF interfaces are
+currently being modified to allow multi-file access, closer integration
+with the netCDF interface will probably be delayed until the end of that
+project.
+Eventually, it will be possible to integrate netCDF objects with the
+rest of the HDF tool suite. Such an integration will then allow tools
+written for netCDF and tools written for HDF to both interact
+intelligently with the new data files.
+
+HDF-EOS to netCDF converter {#HDF-EOS}
+-----------------------------------------------------
+
+The Goddard Earth Sciences Data and Information Services Center ([GES
+DISC](http://disc.gsfc.nasa.gov)) has developed an on-the-fly HDF-EOS to
+netCDF/CF converter for the following products, making them easier to
+use in the [Unidata IDV](#IDV) and
+[McIDAS-V](http://www.ssec.wisc.edu/mcidas/software/v/):
+
+-   AIRS Level 2 (scene) profiles of moisture, air temperature and trace
+    gases
+-   AIRS Level 3 (global grid) profiles of moisture, air temperature and
+    trace gases
+-   OMI UV-B at the surface
+-   TOMS ozone and aerosols
+
+[Instructions](http://disc.gsfc.nasa.gov/services/NetCDFConversionforIDVandMcIDAS-V.shtml)
+are available for searching and converting these data. More information
+on AIRS products is available at
+<http://disc.gsfc.nasa.gov/AIRS/index.html>.
+
+HIPHOP {#HIPHOP}
+-------------------------------
+
+[HIPHOP](http://www.knmi.nl/onderzk/atmosam/English/Service/hiphop/hiphop.html),
+developed by Dominik Brunner, is a widget based IDL application that
+largely facilitates the visualization and analysis of 2D, 3D, and 4D
+atmospheric science data, in particular atmospheric tracer distributions
+and meteorological fields.
+Graphical output of (atmospheric model) data can be quickly generated in
+a large number of different ways, including horizontal maps at selected
+model or pressure levels, vertical north-south, east-west, or slant
+cross-sections (including zonal averages), time slices, animations, etc.
+It also allows mathematical operations on the existing fields to
+generate new fields for further analysis, and it can be run as a batch
+application.
+
+The program handles data in netCDF, HDF and GRIB format. Interfaces to
+other data formats (e.g. ASCII and binary data) can be added easily.
+
+Beginning with Version 4.0, it also supports the ability to overlay
+meteorological fields on a number of different satellite images, and to
+draw air parcel trajectories.
+
+Hyperslab OPerator Suite (HOPS) {#HOPS}
+---------------------------------------------------------------------------------
+
+Hyperslab OPerator Suite
+([HOPS](http://www.cgd.ucar.edu/gds/svn/hyperslab.html)), developed by
+R. Saravanan at NCAR, is a bilingual, multi-platform software package
+for processing data in netCDF files conforming to the NCAR-CCM format or
+the NCAR Ocean Model format. HOPS is implemented in [IDL](#IDL), the
+widely-used commercial interpreted language, and also in
+[Yorick](ftp://ftp-icf.llnl.gov/pub/Yorick/), a public-domain
+interpreted language that is freely available from the Lawrence
+Livermore National Laboratory. The IDL version of HOPS should run on any
+platform supported by IDL. The Yorick version too runs on most common
+UNIX platforms, such as Sun, SGI, Cray, and LINUX computers.
+HOPS is not a monolithic program, but a suite of operators that act on
+data units called "hyperslabs". The design of HOPS is object-oriented,
+rather than procedure-oriented; the operators treat the numeric data and
+the associated meta-data (like coordinate information) as a single
+object.
+
+Note that HOPS is not a general purpose netCDF utility and works only
+for the NCAR CSM netCDF formats. For more information, check the [HOPS
+home page](http://www.cgd.ucar.edu/gds/svn/hyperslab.html).
+
+iCDF (imports chromatographic netCDF data into MATLAB) {#iCDF}
+-----------------------------------------------------------------------------
+
+Klavs M. Sørensen, Thomas Skov and Rasmus Bro (Faculty of Life Sciences,
+University of Copenhagen) have developed
+[iCDF](http://www.models.life.ku.dk/source/iCDF/index.asp), a free and
+documented toolbox for importing chromatographic data in the
+netCDF-based format that most manufacturers of chromatographic software
+support.
+
+The iCDF software is currently for XC-MS data (X: GC, LC, HPLC), but
+soon it will be able to import data using other detectors as well. It
+can be used to open netCDF files from many different instruments (e.g.
+Agilent, Bruker) and many chromatographic software packages (e.g.
+ChemStation).
+
+For more information, see the paper
+
+> Skov T and Bro R. (2008) Solving fundamental problems in
+> chromatographic analysis Analytical and Bioanalytical Chemistry, 390
+> (1): 281-285.
+
+IDV (Integrated Data Viewer) {#IDV}
+--------------------------------------------------
+
+Unidata's [Integrated Data Viewer (IDV)](/software/idv/) is a Java
+application (for Java 1.4 or later) that can be used to display a
+variety of netCDF files, particularly well formatted, geolocated
+datasets. Features include:
+
+-   Access to local and remote netCDF files and a variety of [other data
+    formats](/software/idv/docs/userguide/data/DataSources.html)
+-   Slicing and probing of multidimensional data
+-   Support for netCDF conventions (CF, COARDS, NUWG, AWIPS)
+-   InstallAnywhere installers for easy download and installation
+-   Save display state to a bundle for easy recreation of views
+-   Support for non-gridded data through the [Common Data Model
+    (CDM)](/software/netcdf-java/CDM/)
+
+The IDV uses the [VisAD Java
+library](http://www.ssec.wisc.edu/~billh/visad.html) for interactive and
+collaborative visualization and analysis and the [netCDF Java
+library](/software/netcdf-java/) for reading and manipulating netCDF
+files.
+
+Ingrid {#Ingrid}
+-------------------------------
+
+[Ingrid](http://ingrid.ldgo.columbia.edu/), by M. Benno Blumenthal
+\<benno at ldeo.columbia.edu\>, is designed to manipulate large datasets
+and model input/output. It can read data from its data catalog, a netCDF
+file, or a directly attached model, and output the data, either by
+feeding it to a model, creating a netCDF file, or creating plots and
+other representations of the data.
+
+Ingrid has a number of filters which allow simple data manipulations,
+such as adding two datasets together, smoothing, averaging, and
+regridding to a new coordinate. In addition to netCDF, it also reads
+HDF, CDF, VOGL, and SGI GL.
+
+Ingrid is currently running as a WWW daemon that can be accessed through
+<http://rainbow.ldgo.columbia.edu/datacatalog.html> to see some of its
+capabilities on a climate data catalog maintained by the [Climate
+Group](http://rainbow.ldeo.columbia.edu/) of the [Lamont-Doherty Earth
+Observatory](http://www.ldeo.columbia.edu/) of Columbia University. To
+quote the introduction:
+
+> The Data Catalog is both a catalog and a library of datasets, i.e. it
+> both helps you figure out which data you want, and helps you work with
+> the data. The interface allows you to make plots, tables, and files
+> from any dataset, its subsets, or processed versions thereof.
+>
+> This data server is designed to make data accessible to people using
+> WWW clients (viewers) and to serve as a data resource for WWW
+> documents. Since most documents cannot use raw data, the server is
+> able to deliver the data in a variety of ways: as data files (netCDF
+> and HDF), as tables (html), and in a variety of plots (line, contour,
+> color, vector) and plot formats (PostScript and gif). Processing of
+> the data, particularly averaging, can be requested as well.
+>
+> The Data Viewer in particular demonstrates the power of the Ingrid
+> daemon.
+
+Ingrid currently runs on Linux, for which binaries are available. CVS
+access to the current source can be arranged.
+
+ Intel Array Visualizer {#IntelArrayVisualizer}
+--------------------------------------------------------------
+
+The [Intel® Array
+Visualizer](http://www.intel.com/cd/software/products/asmo-na/eng/compilers/226277.htm)
+and Intel® Array Viewer are available as [free
+downloads](http://www.intel.com/cd/software/products/asmo-na/eng/compilers/226277.htm)
+for Windows platforms. They offer an application and a set of software
+tools and components, which include C, Fortran, and .Net libraries, for
+developing scientific visualization applications and for creating
+interactive graphs of array data in various formats, including HDF and
+netCDF.
+
+IVE {#IVE}
+-------------------------
+
+[IVE (Interactive Visualization
+Environment)](http://www.atmos.washington.edu/ive/) is a software
+package designed to interactively display and analyze gridded data. IVE
+assumes the data to be displayed are contained in one- two-, three- or
+four-dimensional arrays. By default, the numbers within these arrays are
+assumed to represent grid point values of some field variable (such as
+pressure) on a rectangular evenly spaced grid. IVE is, nevertheless,
+capable of displaying data on arbitrary curvilinear grids.
+
+If the data points are not evenly spaced on a rectangular grid, IVE must
+be informed of the grid structure, either by specifying "attributes" in
+the data input or by specifying the coordinate transform in a user
+supplied subroutine. Stretched rectangular grids (which occur when the
+stretching along a given coordinate is a function only of the value of
+that coordinate) can be accommodated by specifying one-dimensional
+arrays containing the grid-point locations along the stretched
+coordinate as part of the IVE input data. Staggered meshes can also be
+accommodated by setting "attributes" in the input data. The structure of
+more complicated curvilinear grids must be communicated to IVE via user
+supplied "transforms," which define the mapping between physical space
+and the array indices.
+
+Since four-dimensional data cannot be directly displayed on a flat
+computer screen, it is necessary to reduced the dimensionality of the
+data before it is displayed. One of IVE's primary capabilities involves
+dimension reduction or "data slicing." IVE allows the user to display
+lower-dimensional subsets of the data by fixing a coordinate or by
+averaging over the coordinate.
+
+IVE currently has the capability to display
+
+-   scalar fields as
+    -   2D scalar plots
+    -   1D scalar plots
+    -   vertical soundings
+    -   a single point value
+-   vector fields as 2D vector plots
+
+IVE lets you overlay plots, loop plots, and control a wide variety of
+display parameters.
+
+IVE also can perform algebraic computations on the gridded data and can
+calculate derivatives. More complicated computations can be performed in
+user supplied subroutines.
+
+IVE uses NetCDF for the data input format, and uses the [NCAR Graphics
+Library](http://ngwww.ucar.edu/ng/) to produce graphical output. IVE is
+[available](http://www.atmos.washington.edu/ive/getting.html) as source
+via anonymous ftp; and as binary on request for licensees of NCAR
+graphics.
+
+JSON format with the ncdump-json utility {#JSON}
+---------------------------------------------------------------
+
+Josep Llodrà has developed a program to output the contents of a
+netCDF-3 or netCDF-4 file in JSON (JavaScript Object Notation). It is
+based on Unidata's NCDUMP utility, and it keeps the original ncdump
+functionality, unless the "-j" option is used to specify JSON output.
+
+The program and source are available from
+<https://github.com/jllodra/ncdump-json> .
+
+Java interface {#Java_interface}
+-----------------------------------------------
+
+The [NetCDF-Java 4.2 Library](/packages/netcdf-java/) is a Java
+interface to netCDF files, as well as to many other types of scientific
+data formats. It is freely available and the source code is released
+under the (MIT-style) netCDF C library license. Previous versions use
+the GNU Lesser General Public License (LGPL).
+
+The library implements a Common Data Model
+([CDM](/software/netcdf-java/CDM/)), a generalization of the netCDF,
+OpenDAP and HDF5 data models. The library is a prototype for the
+netCDF-4 project, which provides a C language API for the "data access
+layer" of the CDM, on top of the HDF5 file format. The NetCDF-Java
+library is a 100% Java framework for *reading* netCDF and other file
+formats into the CDM, as well as *writing* to the netCDF-3 file format.
+The library also implements
+[NcML](http://www.unidata.ucar.edu/software/netcdf/ncml/), which allows
+you to add metadata to CDM datasets, as well as to create virtual
+datasets through aggregation.
+
+Kst (2D plotting tool) {#KST}
+--------------------------------------------
+
+[Kst](http://kst-plot.kde.org) is an open-source, cross-platform 2D
+plotting tool focused on performance and ease of use. Packages for
+Windows, various Linux distributions and Mac OS X are
+[available](http://sourceforge.net/projects/kst/files/), as well as the
+complete source code and CMake-based build files. A more detailed
+presentation of Kst can be found on the web page at
+<http://kst-plot.kde.org>, including numerous screenshots and all the
+useful download links.
+
+Kst is characterized by the following features:
+
+-   Outstanding performance: curves with millions of points are no
+    problem
+-   Plotting of live streams
+-   Out-of-the box support for a variety of formats (currently ASCII,
+    netCDF, dirfile, Qimage-supported types, fits images)
+-   User-friendly with a modern and consistent user interface
+-   A set of unique tools to boost efficiency, including a data import
+    wizard, capacity to edit multiple objects at once or the "Change
+    Data File" tool to compare multiple experiments easily
+-   An active community
+-   Easily expandable for new data formats or data analysis algorithms
+    thanks to a plugin-based architecture
+-   Available on Windows, Linux, and Mac OSX
+
+Labview interface {#Labview-API}
+-----------------------------------------------
+
+A netCDF Labview interface, implemented in the Labview programming
+language is available. The software includes A graphical user interface
+for editing netCDF data and conversion to other data formats. The
+package was developed and is maintained by L. F. Hwang of Sun Yat-sen
+University in China. For more information and to download the source
+code, see the [NetCDFLabview web
+site](https://sourceforge.net/projects/netcdflabview/).
+
+MBDyn (MultiBody Dynamics) #{MBDyn}
+--------------------------------------------------
+
+[MBDyn](http://www.aero.polimi.it/~mbdyn/) is an open-source MultiBody
+Dynamics analysis system developed at the Dipartimento di Ingegneria
+Aerospaziale of the University "Politecnico di Milano", Italy. It uses
+netCDF as its primary output format.
+
+MBDyn features the integrated multidisciplinary analysis of multibody,
+multiphysics systems, including nonlinear mechanics of rigid and
+flexible constrained bodies, smart materials, electric networks, active
+control, hydraulic networks, essential fixed-wing and rotorcraft
+aerodynamics. It allows users to simulate the behavior of heterogeneous
+mechanical, aero-servo-elastic systems based on first principles
+equations. It is being actively developed and used in the aerospace and
+automotive fields for dynamics analysis and simulation of complex
+systems. Dynamic linking of user-defined modules is heavily exploited to
+let users extend the feature library.
+
+Max_diff_nc ${Maxdiffnc}
+-------------------------------------------
+
+This is a program which compares two NetCDF files. Variables with the
+same ID in the two files are assumed to be of the same type and have the
+same shape. For each such couple of variables, the program computes the
+maximum of the absolute value of the difference, and the maximum of the
+absolute value of the relative difference. The program also tells you at
+what location (the subscript list of the array) the maximum difference
+is reached.
+
+The web page for this program is:
+<http://web.lmd.jussieu.fr/~lglmd/Max_diff_nc>
+
+This is a freely available tool.
+
+MeteoExplorer {#MeteoExplorer}
+---------------------------------------------
+
+[MeteoExplorer](http://www.eastmodelsoft.com/index_en.htm), developed by
+Lianqing Yu at China Meteorological Administration, is a cross-platform
+software application for analyzing and rendering atmospheric science and
+geoscience data. It supports popular data formats including WMO
+GRIB1/GRIB2, NetCDF, and MICAPS, and provides basic GIS functionalities.
+Developed with C++, Meteo Explorer targets multiple computing platforms
+including Microsoft Windows, GNU Linux, and SGI IRIX operating systems.
+
+The primary features include:
+
+-   Graphics layer management (navigation and animation)
+-   Objective analysis of physical elements in surface or upperair
+    soundings data
+-   Isoline analysis and shading of grid field
+-   Streamline analysis of wind field
+-   Computation of physics elements
+-   NetCDF data process and display
+-   GRIB1/GRIB2 data process and display
+-   MICAPS data process and display
+-   Satellite nephogram data display and animation, support AWX, GPF and
+    HDF format
+-   Interactive composition of synoptic chart (command undo/redo,
+    automatic save)
+-   Map zoom, pan, projection and clipping
+-   Full screen display and zoom to area
+-   Quick navigation via thumbnail view of graphics layers
+-   Save screen shot as image file (support formats: BMP, JPG, PNG)
+-   Vector graphics exported to clipboard or saved as EMF file (Windows
+    version only)
+-   Remote desktop connection support
+-   System configuration (dynamic menu)
+-   Fast switch of user interface language on the fly
+
+For more information, please visit [MeteoExplorer's home
+page](http://www.eastmodelsoft.com/software/mexplorer.htm) or contact
+the support staff via meteoexplorer at hotmail.com .
+
+MeteoInfo {#MeteoInfo}
+-------------------------------------
+
+For better cross-platform support,
+[MeteoInfo](http://www.meteothinker.com) has recently been re-developed
+using Unidata's NetCDF Java library. MeteoInfo is GIS software for
+visualization and analysis of spatial and meteorological data. The Java
+edition can be run in Windows, Mac OS, Linux, and Unix systems. The
+Groovy script engine was coupled in the software, so users can write
+Groovy script to run the software automatically for analysis with
+complex steps.
+
+Download: <http://www.meteothinker.com/>
+
+Java 6 is needed to run the software.
+
+MexEPS {#MexEPS}
+-------------------------------
+
+[PMEL](http://www.pmel.noaa.gov/) has developed a MATLAB interface,
+[MexEPS](http://www.epic.noaa.gov/epic/software/mexeps.htm), which
+supports several netCDF file conventions, including [those adopted by
+PMEL](ftp://ftp.unidata.ucar.edu/pub/netcdf/Conventions/PMEL-EPIC/).
+Many styles of time axes are supported and time manipulation routines
+ease the use of the time axis in MATLAB. The MexEPS package supports the
+following data formats:
+-   reading, writing and editing netCDF files;
+-   reading and writing Classic EPIC files
+-   reading formatted ASCII files
+
+It includes:
+-   VARIABLE, AXIS, ATTRIBUTE manipulation routines
+-   TIME manipulation
+    -   TIME enters MATLAB as YYMMDDhhmmss.fff
+    -   Can be converted to netCDF udunits time convention (e.g. days
+        *since* 1990-01-01 00:00:00)
+-   [MATLAB help](ftp://ftp.pmel.noaa.gov/eps/mexeps/help-m/) and
+    [example scripts](ftp://ftp.pmel.noaa.gov/eps/mexeps/examples/)
+    using MexEPS
+-   **ASCII2MAT** mexFunction, which reads a formatted file into MATLAB
+    as a matrix
+
+The MexEPS package is freely available in PMEL's anonymous ftp directory
+<ftp://ftp.pmel.noaa.gov/eps/mexeps/>
+
+If you have any questions or comments, please contact the author, Willa
+Zhu [(willa at pmel.noaa.gov)](mailto:willa at pmel.noaa.gov) or Nancy Soreide
+(nns at pmel.noaa.gov).
+
+MEXNC and SNCTOOLS {#MEXNC}
+------------------------------------------
+
+John Evans of Rutgers University maintains MEXNC and developed SNCTOOLS.
+[MEXNC](http://mexcdf.sourceforge.net/) is a mexfile interface to NetCDF
+files for MATLAB that has roughly a one-to-one equivalence with the C
+API for netCDF.
+[SNCTOOLS](http://mexcdf.sourceforge.net/tutorial/index.html) is a set
+of higher-level m-files that sit atop MEXNC, shielding the user from
+such low level netCDF details as file IDs, variable IDs, and dimension
+IDs. The general philosophy behind SNCTOOLS is providing the ability to
+read and write data without trying to invent a new syntax.
+
+Mirone (Windows MATLAB-based display) {#Mirone}
+--------------------------------------------------------------
+
+Joaquim Luis of Universidade do Algarve has developed
+[Mirone](http://w3.ualg.pt/~jluis/mirone/), a Windows MATLAB-based
+framework tool that allows the display and manipulation of a large
+number of grid/images formats through its interface with the
+[GDAL](http://remotesensing.org/gdal/) library. Its main purpose is to
+provide users with an easy-to-use graphical interface to manipulate
+[GMT](http://gmt.soest.hawaii.edu/) grids. In addition it offers a wide
+range of tools dedicated to topics in the earth sciences, including
+tools for multibeam mission planning, elastic deformation studies,
+tsunami propagation modeling, earth magnetic field computations and
+magnetic Parker inversions, Euler rotations and poles computations,
+plate tectonic reconstructions, and seismicity and focal mechanism
+plotting. The high quality mapping and cartographic capabilities for
+which GMT is renowned is guaranteed through Mirone's ability to
+automatically generate GMT cshell scripts and dos batch files.
+
+Although Mirone is written in MATLAB, a stand-alone version to run under
+Windows is also provided. Regrettably this version is not as efficient
+as the native MATLAB code but provides a solution for users that don't
+have MATLAB.
+
+Also see\
+ J. F. Luis. Mirone: A multi-purpose tool for exploring grid data.
+Computers & Geosciences, 33, 31-41, 2007.
+
+ncBrowse {#ncBrowse}
+-----------------------------------
+
+Donald Denbo of NOAA's Pacific Marine Environmental Laboratory has
+developed and made available
+[ncBrowse](http://www.epic.noaa.gov/java/ncBrowse), a Java application
+(JDK1.2) that provides flexible, interactive graphical displays of data
+and attributes from a wide range of netCDF data file conventions.
+Features include:
+
+-   Designed to work with arbitrary netCDF files.
+-   Browses file using the EPIC and COARDS conventions.
+-   Provides a "tree" view of the netCDF file.
+-   Handles character variables.
+-   Handles dimensions without an associated variable.
+-   Uses sgt graphics to perform 1 and 2 dimensional cuts through data.
+-   Save to file single variable as a "cdl" text file.
+-   InstallAnywhere scripts for UNIX, Win32, and MacOS.
+-   Currently uses Java 2 and Swing.
+
+ncBrowse will run on any UNIX or Windows machine with a Java 2 (JDK1.2)
+virtual machine installed. Automated installation scripts are available
+for Windows and UNIX. Additional information on ncBrowse and download
+instructions are available at <http://www.epic.noaa.gov/java/ncBrowse>.
+
+Questions and suggestions should be directed to
+\<[dwd at pmel.noaa.gov\>](mailto:dwd at pmel.noaa.gov). If you have problems
+reading a netCDF file with ncBrowse, please send him a copy of the file
+and he'll get ncBrowse to read it!
+
+nccmp {#nccmp}
+-----------------------------
+
+Remik Ziemlinski of the NOAA Geophysical Fluid Dynamics Laboratory has
+developed [nccmp](http://nccmp.sourceforge.net/), a tool to compare two
+netCDF files. It can use MPI, include/exclude specific variables or
+metadata and operates quickly. Highly recommended for regression testing
+with large datasets. See the Web site <http://nccmp.sourceforge.net/>
+for more information.
+
+NCL {#NCL}
+-------------------------
+
+The [NCAR Command Language (NCL)](http://www.ncl.ucar.edu/) is an
+intepreted programming language for scientific data analysis and
+visualization developed and maintained in NCAR's [Computational and
+Information Systems Laboratory](http://www.cisl.ucar.edu/).
+
+NCL has many features common to modern programming languages, including
+types, variables, operators, expressions, conditional statements, loops,
+and functions and procedures. NCL also has features that are not found
+in other programming languages, including those that handle the
+manipulation of metadata, the configuration of visualizations, the
+import of data from a variety of data formats, and an algebra that
+supports array operations.
+
+NCL has robust file input and output capabilities. It allows different
+datasets of different formats (netCDF, netCDF-4 classic, HDF4, HDF4-EOS,
+GRIB-1, and GRIB-2) to be imported into one uniform and consistent data
+manipulation environment, which internally is the netCDF data format.
+NCL doesn't place any restrictions or conventions on the organization of
+input netCDF files.
+
+NCL comes with many useful built-in functions and procedures for
+processing and manipulating data. There are over 600 functions and
+procedures that include routines for use specifically with climate and
+model data, empirical orthogonal functions, Fourier coefficients,
+wavelets, singular value decomposition, 1-, 2-, and 3-dimensional
+interpolation, approximation, and regridding, and computer analysis of
+scalar and vector global geophysical quantities.
+
+The visualizations are publication-quality and highly customizable, with
+hundreds of options available for tweaking the looks of your graphics.
+NCL can generate contours, XY plots, vectors, streamlines, and can
+overlay these plots on many different map projections. There are also
+specialized functions for generating histograms, wind roses, meteograms,
+skew-T plots, weather maps.
+
+Included with the software are two command line tools: "ncl\_convert2nc"
+for converting GRIB-1/2 or HDF files to netCDF files, and
+"ncl\_filedump" which will dump the contents of a file format that NCL
+recognizes (netCDF, GRIB-1/2, HDF, etc).
+
+NCL is available under an open source license or in binary form for
+several popular UNIX platforms, including (but not limited to) Linux,
+MacOSX, and Windows/Cygwin.
+
+Documentation and additional information on NCL are available from the
+[NCL website](http://www.ncl.ucar.edu/), which contains hundreds of
+[application examples](http://www.ncl.ucar.edu/Applications/) for one to
+download. You can also contact Mary Haley, at <haley at ucar.edu> for more
+information.
+
+NCO {#NCO}
+-------------------------
+
+[NCO](http://nco.sourceforge.net) (netCDF operators) is a package of
+command line operators that work on generic netCDF or HDF4 files:
+-   ncap2 - arithmetic processor
+-   ncatted - attribute editor
+-   ncbo - binary operator
+-   ncdiff - differencer
+-   ncea - ensemble averager
+-   ncecat - ensemble concatenator
+-   ncflint - file interpolator
+-   ncks - kitchen sink (extract, cut, paste, print data)
+-   ncpdq - permute dimensions quickly
+-   ncra - running averager
+-   ncrcat - record concatenator
+-   ncrename - renamer
+-   ncwa - weighted averager
+
+All operators may now be [OPeNDAP](/packages/dods) clients. OPeNDAP
+enables network transparent data access to any OPeNDAP server. Thus
+OPeNDAP-enabled NCO can operate on remote files accessible through any
+OPeNDAP server without transferring the files. Only the required data
+(e.g., the variable or hyperslab specified) are transferred.
+
+The source code is freely available from the [NCO home
+page](http://nco.sourceforge.net/), as is the NCO User's Guide.
+
+For more information, contact the author, Charlie Zender.
+
+ncregrid {#ncregrid}
+-----------------------------------
+
+Patrick Jöckel of the Max Planck Institute for Chemistry has developed
+**ncregrid**, a tool (written in FORTRAN-90) for data transfer of
+gridded 2- and 3-dimensional (spatial) geophysical/geochemical scalar
+fields between grids of different resolutions. The algorithm handles
+data on rectangular latitude/longitude grids (not necessarily evenly
+spaced) and vertical pressure hybrid grids of arbitrary resolution. The
+input/output data format is netCDF. ncregrid is freely available without
+any warranty under the GNU public license (GPL). ncregrid can be used as
+a "stand-alone" program, and/or linked as an interface to a model, in
+order to re-grid automatically the input from an arbitrary grid space
+onto the required grid resolution.
+
+More information is available on the web-page:
+<http://www.mpch-mainz.mpg.de/~joeckel/ncregrid/index.html>.
+
+nctoolbox (a MATLAB common data model interface) {#nctoolbox}
+----------------------------------------------------------------------------
+
+[nctoolbox](http://nctoolbox.github.io/nctoolbox/) is a MATLAB interface
+that provides read-only access to [Common Data
+Model](/software/netcdf-java/CDM/index.html) datasets. Under the hood,
+nctoolbox uses Unidata's NetCDF-Java as the data access layer. This
+allows nctoolbox to access to netCDF, OPeNDAP, HDF5, GRIB, GRIB2, HDF4,
+and many (15+) other file formats and services using the same API. It
+works with MATLAB 2008a and later. The nctoolbox software was developed
+by Brian Schlining (MBARI), Rich Signell (USGS), Sachin Kumar Bhate
+(freelance), and Alex Crosby (RPS/ASA).
+
+ncdx {#ncdx}
+---------------------------
+
+Patrick Jöckel of the Max Planck Institute for Chemistry has developed
+**ncdx**, a tool (written in FORTRAN-90) that scans a netCDF file and
+makes it [OpenDX](#OpenDX) compliant. ncdx is freely available without
+any warranty under the GNU public license (GPL). More information is
+available on the web-page:
+<http://www.mpch-mainz.mpg.de/~joeckel/ncdx/index.html>.
+
+ncensemble {#ncensemble}
+---------------------------------------
+
+Alan Iwi, of Rutherford Appleton Laboratory, offers this command line
+ensemble statistics utility. More information is available on the
+web-page: <http://home.badc.rl.ac.uk/iwi/ncensemble/>.
+
+ncview {#ncview}
+-------------------------------
+
+[Ncview](http://meteora.ucsd.edu/~pierce/ncview_home_page.html) is a
+visual browser for netCDF files. Typically you would use ncview to get a
+quick and easy, push-button look at your netCDF files. You can view
+simple movies of the data, view along various dimensions, take a look at
+the actual data values, change color maps, invert the data, etc. It runs
+on UNIX platforms under X11, R4 or higher. For more information, check
+out the [README](http://meteora.ucsd.edu/~pierce/docs/ncview.README)
+file; you can also see a representative [screen
+image](http://meteora.ucsd.edu/~pierce/docs/ncview.gif) (GIF, 66K) of
+ncview in action.
+The source may be downloaded from <ftp://cirrus.ucsd.edu/pub/ncview/>.
+For more information, please contact the author, David W. Pierce at
+<dpierce at ucsd.edu>.
+
+NetCDF Toolbox for MATLAB-5 {#matlab5}
+----------------------------------------------------
+
+The [NetCDF Toolbox for MATLAB-5](http://mexcdf.sourceforge.net/),
+originally developed by Charles R. Denham, combined netCDF-3 with
+[MATLAB](http://www.mathworks.com/products/matlab/) to form an interface
+that used MATLAB operator-syntax for arithmetic, logical, and
+subscripting operations on netCDF entities. The NetCDF Toolbox is in
+bug-fix-only mode, and is maintained by John.G.Evans.NE at gmail.com, on
+the [MEXNC, SNCTOOLS, and the NetCDF Toolbox](http://mexcdf.sf.net) web
+page.
+
+ncvtk {#ncvtk}
+-----------------------------
+
+[Ncvtk](http://ncvtk.sourceforge.net/) is a program for exploring
+planetary data stored in a NetCDF file. The NetCDF file should loosely
+follow the [CF metadata
+conventions](http://www.cgd.ucar.edu/cms/eaton/cf-metadata/).
+
+Ncvtk was designed from the ground up with the aim of offering a high
+degree of interactivity to scientists who have a need to explore
+structured, three-dimensional, time-dependent climate data on the
+sphere. A graphical user interface allows users to interact with their
+data via color/transparency/contour/vector plots, apply vertical slices,
+probe data, apply an external sun light, overlay hydrographic and
+geopolitical data, rotate, zoom, etc. with minimal fuss.
+
+Ncvtk is written in python and is based on the [Visualization Toolkit
+(VTK)](http://public.kitware.com/VTK/). Like python and VTK, Ncvtk is
+highly portable and known to run on Windows and Linux (i386, ia64,
+EMT64) platforms. More information about Ncvtk is available at
+<http://ncvtk.sourceforge.net>.
+
+Ivan Shmakov's netcdf tools {#netcdf_tools}
+----------------------------------------------------------
+
+The NetCDF tools is a free software package consisting of a few tools
+operating on NetCDF and, by utilizing the compatibility API, HDF4 files,
+which are intended to be usable from Shell scripts.
+
+The currently packaged tools are:
+
+-   a couple of simple shell wrappers over the respective NetCDF
+    functions (ncattget and ncattput);
+-   a more sophisticated ncget tool.
+
+The ncget tool implements functionalilty that is similar to hdp dumpsds
+(for NetCDF, which lacks such a tool), or complements it in the case of
+HDF4. It can be seen as a complement to the ncdump tool (included in
+both the NetCDF and HDF4 distributions) as well.
+
+This tool allows a selected part of a NetCDF variable or an HDF4
+scientific data set (SDS) to be extracted in either an ASCII or binary
+form, applying the transformation specified by the usual scale\_factor
+and add\_offset attributes. It allows one to feed the data contained in
+NetCDF variables (or HDF4 SDS) to the tools designed to operate on
+either ASCII (text) or raw (binary) data.
+
+This version of the package is the first one to be announced to the
+public. It has some known bugs and limitations, but it's proved to be
+quite usable. A [project
+page](http://freshmeat.net/projects/netcdf-tools) on freshmeat.net. The
+[source](http://waterlily.siamics.net/~ivan/src/netcdf-tools-0.1-rc1.tar.gz)
+is also available.
+
+netcdf4excel (add-in for MS Excel) {#netcdf4excel}
+-----------------------------------------------------------------
+
+Alexander Bruhns has developed [a netCDF add-in written in Visual Basic
+for MS Excel](http://code.google.com/p/netcdf4excel/). This add-in
+simplifies the use of NetCDF data in Excel, providing a ready to use
+solution for manipulating this type of data.
+
+For developers, the open-source (GPL V3 license) can be downloaded
+directly or checked out with Mercurial.
+
+The add-in is written in VBA 6.0 (so it won't work with Office 2010 64
+bits) and is designed for Excel 2007 running with the Microsoft Windows
+operating system. It supports opening netCDF classic format data with
+Excel for read or write access.
+
+More details are available on the [netcdf4excel web
+site](http://code.google.com/p/netcdf4excel/).
+
+NetCDF95 alternative Fortran API {#netcdf95}
+-----------------------------------------------------------
+
+Lionel Guez has developed and made feely available
+[NetCDF95](http://web.lmd.jussieu.fr/~lglmd/NetCDF95), a new alternative
+Fortran interface to the NetCDF library. Compared to the
+Unidata-provided Fortran 90 netCDF interface, the NetCDF95 interface is
+meant to be easier to use and more secure.
+
+Objective-C API {#Objective-C}
+---------------------------------------------
+
+Tom Moore has an Objective-C API, available here:
+[www.paleoterra.com/software](http://www.paleoterra.com/software). The
+netCDF Framework is an open source (Argonne Open Source License) MacOSX
+application framework that provides an Objective-C interface to the NCAR
+netCDF library version 3. The framework is available both as source code
+and universal compiles (works on both PPC and Intel macs). The source
+code has also been compiled by users for the GNUStep environment.
+Version 2 of the framework will provide classes for accessing multiple
+netCDF files, working with in-memory data slabs using standard notation,
+and some support for multithreading.
+
+### Mark Tracy's Objective-C API
+
+Mark Tracy has written [NetcdfStep](http://www.mt-se.com/nc_1.html), an
+Objective-C API for netCDF that uses Objective-C Foundation Classes.
+
+NetcdfStep is framework for using the netCDF library in object-oriented
+programming with Objective-C. It now supports the full functionality of
+netCDF 3.6.2.
+
+A [complete Mac OS X
+distribution](http://www.mt-se.com/pub/NetcdfStep-1.0.2.zip) including
+pre-built static library and [online
+documentation](http://www.mt-se.com/netcdfstep_doc/) are available.
+Applications linked to this framework have no external dependencies
+(other than Mac OS X itself). A [source-code only
+distribution](http://www.mt-se.com/pub/NetcdfStep-GNUstep-0.6.1.tar.gz)
+synced up to version 0.6.1 is available for GNUstep for use on Linux and
+other Unix platforms.
+
+Octave interface {#NCMEX}
+----------------------------------------
+
+The ARM Program has contributed NCMEX for Octave, a port of Chuck
+Denham's MATLAB NCMEX to [Octave](http://www.octave.org). The calling
+syntax is identical, so scripts using NCMEX in MATLAB should in theory
+be portable to Octave. In order to build NCMEX, a compiled C NetCDF
+library must already be installed.
+
+In addition to the base NetCDF library interface, this package includes
+a simple toolbox to automate the reading and writing of NetCDf files
+within Octave using NCMEX. These tools as well as the source for NCMEX
+are available from
+<http://engineering.arm.gov/~sbeus/octavex/octavex.tar> (NOTE: this .tar
+file contains other Octave extension functions besides NCMEX.)
+
+Also see [Octcdf](http://ocgmod1.marine.usf.edu/octcdf/), a netCDF
+toolbox for Octave.
+
+For installation instructions, see the README file inside the .tar file.
+
+Octave interface (Barth) {#Octave}
+-------------------------------------------------
+
+Alexander Barth has contributed the following:
+
+Octcdf is a netCDF toolbox for [Octave](http://www.octave.org/) which
+uses the same operator syntax as the [matlab netCDF
+toolbox](http://mexcdf.sourceforge.net/netcdf_toolbox.html) of Charles
+R. Denham. NetCDF dimensions, attributes and variables are Octave
+objects and can be accessed, sliced and changed just as regular
+variables. Unlike most netCDF toolboxes for matlab, it does not depend
+on the NCMEX wrapper around the netCDF interface. This octave toolbox is
+written in C++ calling directly the netCDF library. The octcdf toolbox
+can also be used to download data from an OpenDAP server. The octcdf
+source code is available at
+<http://modb.oce.ulg.ac.be/mediawiki/index.php/NetCDF_toolbox_for_Octave>.
+It was also included in the Octave Repository
+[octave-forge](http://octave.sourceforge.net/).
+
+OPeNDAP (formerly DODS) {#OPeNDAP}
+-------------------------------------------------
+
+The [OPeNDAP](http://opendap.org/) (formerly known as DODS) is an
+Open-source Project for a Network Data Access Protocol that makes local
+data and subsets of local data accessible to remote locations
+independent of the local storage format. OPeNDAP also provides tools for
+transforming existing applications into OPeNDAP clients, enabling them
+to remotely access OPeNDAP served data. OPeNDAP is based on existing
+data access tools; rather than developing a self contained system, it
+makes extensive use of existing data access APIs.
+
+OPeNDAP can be used to make netCDF data files available over the
+Internet and it can also be used to adapt existing software which use
+the netCDF API (by re-linking) to read data served by an OPeNDAP data
+server. In principle, any program written using netCDF can be adapted to
+read data from an OPeNDAP server - in other words any program which uses
+netCDF can become a client in the OPeNDAP client-server system. Included
+in the source and binary distributions are two freely available programs
+that have already been modified (re-linked).
+
+With a client program accessing data from a netCDF server, it is
+possible to access a small subset of a large dataset over the Internet
+without copying the entire dataset (as you would have to do with FTP or
+AFS). The client can see changes to the netCDF dataset, e.g. when new
+records are added (which would not be possible with FTP). Finally, the
+client can also access cross-sections of variable data without paging
+large amounts of data across the network (as you would have to do with
+NFS, for example).
+
+OPeNDAP software is freely available in both source form or binary form
+for selected platforms.
+
+OpenDX {#OpenDX}
+-------------------------------
+
+[OpenDX](http://www.opendx.org/about.html) (formerly IBM Data Explorer,
+also known as simply DX) is a general-purpose software package for data
+visualization and analysis. It employs a data-flow driven client-server
+execution model and provides a graphical program editor that allows the
+user to create a visualization using a point and click interface.
+DX runs on 7 major UNIX platforms as well as Windows 95/NT and is
+designed to take full advantage of multi-processor systems from IBM, SGI
+and Sun.
+
+DX is built upon an internal data model, which describes and provides
+uniform access services for any data brought into, generated by, or
+exported from the software. This data model supports a number of
+different classes of scientific data, which can be described by their
+shape (size and number of dimensions), rank (e.g., scalar, vector,
+tensor), type (float, integer, byte, etc. or real, complex, quaternion),
+where the data are located in space (positions), how the locations are
+related to each other (connections), aggregates or groups (e.g.,
+hierarchies, series, composites, multizone grids, etc.). It also
+supports those entities required for graphics and imaging operations
+within the context of Data Explorer. Regular and irregular, deformed or
+curvilinear, structured and unstructured data as well as "missing" or
+invalid data are supported.
+
+The details of the data model are hidden at the user level. As a result
+DX operations or modules are polymorphic and appear typeless. The DX
+Import module, which reads data for use within Data Explorer directly
+utilizes data in netCDF as well as other formats (e.g., HDF, CDF). One
+or more variables may be selected as well as step(s) of a time series.
+Data in conventional netCDFs are directly imported. Since the DX data
+model is more comprehensive than the netCDF data model, a methodology to
+extend netCDF via attribute conventions (e.g., for unstructured meshes,
+non-scalar data and hierarchies) for use with Data Explorer is
+available.
+
+DX supports a number of realization techniques for generating renderable
+geometry from data. These include color and opacity mapping (e.g., for
+surface and volume rendering), contours and isosurfaces, histograms,
+two-dimensional and three-dimensional plotting, surface deformation,
+etc. for scalar data. For vector data, arrow plots, streamlines,
+streaklines, etc. are provided. Realizations may be annotated with
+ribbons, tubes, axes, glyphs, text and display of data locations, meshes
+and boundaries. Data probing, picking, arbitrary surface and volume
+sampling, and arbitrary cutting/mapping planes are supported.
+
+DX supports a number of non-graphical functions such as point-wise
+mathematical expressions (e.g., arithmetic, transcendental, boolean,
+type conversion, etc.), univariate statistics and image processing
+(e.g., transformation, filter, warp, edge detection, convolution,
+equalization, blending, morphological operations, etc.). Field/vector
+operations such as divergence, gradient and curl, dot and cross
+products, etc. are provided. Non-gridded or scattered data may be
+interpolated to an arbitrary grid or triangulated, depending on the
+analysis requirements. The length, area or volume of various geometries
+may also be computed. Tools for data manipulation such as removal of
+data points, subsetting by position, sub/supersampling, grid
+construction, mapping, interpolation, regridding, transposition, etc.
+are available.
+
+Tools for doing cartographic projections and registration as well as
+earth, space and environmental sciences examples are available at
+Cornell University via info.tc.cornell.edu. Also see the [ncdx](#ncdx)
+tool for making netCDF files OpenDX compliant.
+
+Panoply {#Panoply}
+---------------------------------
+
+[Panoply](http://www.giss.nasa.gov/tools/panoply/) is an application
+that plots geo-gridded and other arrays from netCDF, HDF, GRIB, and
+other datasets. Features include:
+
+-   Slice and plot geo-gridded latitude-longitude, latitude-vertical,
+    longitude-vertical, or time-latitude arrays from larger
+    multidimensional variables.
+-   Two arrays may be combined in one plot by differencing, summing, or
+    averaging.
+-   Lon-lat data may be plotted as global maps (using any of over 75 map
+    projections) or as zonal average plots.
+-   Overlay continent outlines or masks on lon-lat plots.
+-   Use your favorite CPT, GGR, PAL, or ACT color table for scale
+    colorbar.
+-   Save plots to disk in GIF, JPEG, PNG or TIFF bitmap images or as PDF
+    or PostScript graphics files.
+-   Export lon-lat map plots in KMZ format.
+-   Export animations as AVI or MOV video or as a collection of
+    invididual frame images.
+-   Explore remote THREDDS and OpenDAP catalogs and open datasets served
+    from them.
+
+Panoply requires that your computer have a Java SE 6 runtime
+environment, or better, installed.
+
+Panoply is developed at the NASA Goddard Institute for Space Studies.
+Questions and suggestions should be directed to [Dr. Robert B.
+Schmunk](http://www.giss.nasa.gov/staff/rschmunk.html).
+
+Parallel-NetCDF {#Parallel-NetCDF}
+-------------------------------------------------
+
+A group of researchers at Northwestern University and Argonne National
+Laboratory (Jianwei Li, Wei-keng Liao, Alok Choudhary, Robert Ross,
+Rajeev Thakur, William Gropp, and Rob Latham) have designed and
+implemented a new [parallel interface for writing and reading netCDF
+data](http://www.mcs.anl.gov/parallel-netcdf/), tailored for use on high
+performance platforms with parallel I/O. The implementation builds on
+the MPI-IO interface, providing portability to most platforms in use and
+allowing users to leverage the many optimizations built into MPI-IO
+implementations. Testing so far has been on Linux platforms with ROMIO
+and IBM SP machines using IBM's MPI.
+
+Documentation and code for Parallel-NetCDF is now available for testing.
+Although a few interfaces are not implemented yet, the current
+implementation is complete enough to provide significant I/O performance
+improvements on parallel platforms, as described in a [technical
+report](ftp://info.mcs.anl.gov/pub/tech_reports/reports/P1048.pdf).
+Users are invited to test Parallel-NetCDF in their applications.
+
+Paraview and vtkCSCSNetCDF {#Paraview}
+-----------------------------------------------------
+
+<http://www.paraview.org/>
+
+ParaView is an application designed with the need to visualize large
+data sets in mind. The goals of the ParaView project include the
+following:
+
+-   Develop an open-source, multi-platform visualization application.
+-   Support distributed computation models to process large data sets.
+-   Create an open, flexible, and intuitive user interface.
+-   Develop an extensible architecture based on open standards.
+
+ParaView runs on distributed and shared memory parallel as well as
+single processor systems and has been successfully tested on Windows,
+Linux and various Unix workstations and clusters. Under the hood,
+ParaView uses the Visualization Toolkit as the data processing and
+rendering engine and has a user interface written using a unique blend
+of Tcl/Tk and C++.
+
+A vtk/ParaView reader for netCDF files can be found here.
+
+Perl interfaces {#Perl}
+--------------------------------------
+
+There are two netCDF interfaces for Perl:
+-   [PDL::NetCDF](http://search.cpan.org/~dhunt/PDL-NetCDF-4.05/netcdf.pd),
+    Doug Hunt's perl interface which uses the PDL (perl data language)
+    extension.
+-   [NetCDFPerl](/software/netcdf-perl/), Steve Emmerson's extension
+    module, based on version 2 of the netCDF package. Uses perl lists
+    for representing netCDF variables.
+
+PolyPaint+ {#PolyPaint}
+---------------------------------------
+
+[PolyPaint+](http://lasp.colorado.edu/polypaint/home.html) is an
+interactive scientific visualization tool that displays complex
+structures within three-dimensional data fields. It provides both color
+shaded-surface display and simple volumetric rendering in either index
+or true color. For shaded surface rendering, the PolyPaint+ routines
+first compute the polygon set that describes a desired surface within
+the 3D data volume. These polygons are then rendered as continuously
+shaded surfaces. PolyPaint+ contains a wide variety of options that
+control lighting, viewing, and shading. Objects rendered volumetrically
+may be viewed along with shaded surfaces. Additional data sets can be
+overlaid on shaded surfaces by color coding the data according to a
+specified color ramp. 3D visualizations can be viewed in stereo for
+added depth perspective.
+Currently supported 3D visualizations are the following:
+
+-   Shaded isosurface
+-   Transparent contour shells or isosurfaces at varying levels
+-   Volumetric or density plot
+-   Planes
+-   Contour ribbons
+-   Topographic surface from 2D geographic data sets
+
+3D data volumes may be sliced in the X, Y, or Z plane using an
+interactive cutting plane. A cross section of the data volume can be
+viewed in a 2D window as a 2D contour plot, a vector plot, a raster
+image or a combination of these options superimposed. Map outlines can
+be used as a background for 2D cross section plots of geographic data.
+All data is projected according to the coordinates specified by the user
+for the cross section window.
+
+The user interface provides direct manipulation tools for specifying the
+eye position, center of view, light sources, and color ramps. Subsetting
+of data can be done easily by selecting the data by index or geographic
+coordinate. On-line contextual help provides easy access to more detail
+about the software. Tutorials which range from very simple
+visualizations to complex combinations of data sets provide the user
+with a quick learning tool.
+
+Currently PolyPaint+ accepts only data which is in the NetCDF file
+format. A file conversion utility which converts from raw binary data to
+netCDf is a part of the application.
+
+PolyPaint+ is a joint effort of the University of Colorado and NCAR
+(National Center for Atmospheric Research) funded by the NASA AISRP
+program. A beta version of PolyPaint+ is currently available free of
+charge using FTP or for a nominal fee which would cover tape
+distribution. A license agreement must be signed in order to use it.
+
+You may order by...
+
+-   TELEPHONE : 303-492-7289 (Margi Klemp) : 303-497-8159 (Bill Boyd)
+-   U.S. MAIL :
+
+                Margi Klemp
+                University of Colorado / LASP
+                1234 Innovation Dr.
+                Boulder, CO 80303
+                USA
+
+-   E-MAIL : margi at aries.colorado.edu
+
+Pomegranate {#Pomegranate}
+-----------------------------------------
+
+The P9E Team at NASA JPL has developed
+[Pomegranate](http://pomegranate.jpl.nasa.gov/), a python application
+that "webifies" science data files. Supported formats include netCDF,
+HDF4, HDF5, GRIB and FITS.
+
+Pomegranate can be installed on web servers as either a WSGI or CGI
+application to provide webification (w10n) services. To learn more about
+w10n of science data files, please visit <http://webification.org/>. A
+brief [help](http://pomegranate.jpl.nasa.gov/test/help.txt) document
+describes how to use the [demo
+directory](http://pomegranate.jpl.nasa.gov/test) to browse or download
+metadata or data in netCDF, JSON, or other formats by clicking on data
+folder and document icons.
+
+Pomegranate can also be used as a standalone library or command line
+application. This greatly simplifies the retrieval of metadata and data
+from files in supported formats.
+
+Pomegranate is open source software and can be downloaded from
+<http://www.openchannelsoftware.com/projects/Pomegranate/>.
+
+PyNGL and PyNIO {#PyNGL}
+---------------------------------------
+
+NCAR's Computational and Information Systems Laboratory has developed
+[PyNGL](http://www.pyngl.ucar.edu/), a python package for scientific
+visualization and data analysis and
+[PyNIO](http://www.pyngl.ucar.edu/Nio.shtml), a Python package
+supporting access to a variety of data formats using an interface
+modelled on netCDF.
+
+Python interfaces {#Python}
+------------------------------------------
+
+Python is an interpreted, object-oriented language that is supported on
+a wide range of hardware and operating systems. Python information and
+sources can be obtained from <http://www.python.org/>. There are now
+several netCDF interfaces for Python.
+
+Jeff Whitaker of the NOAA Earth System Research Lab has developed a
+netCDF-4 module for python: <http://code.google.com/p/netcdf4-python/>.
+Most new features of netCDF-4 are implemented, such as multiple
+unlimited dimensions, groups and zlib data compression. All the new
+numeric data types (such as 64-bit and unsigned integer types) are
+implemented. Compound and variable length (vlen) data types are
+supported, but the enum and opaque data types are not. Mixtures of
+compound and vlen data types (compound types containing vlens, and vlens
+containing compound types) are not supported.
+
+[xray](#xray) is a higher-level interface that uses netcdf4-python
+internally to implement a pandas-like package for N-D labelled arrays
+for scientific data.
+
+André Gosselin of the Institut Maurice-Lamontagne, Péches & Océans
+Canada, has implemented pycdf, a new Python interface to the netCDF
+library. It is available from <http://pysclint.sourceforge.net/pycdf/>,
+where you will find the install files, installation instructions,
+extensive documentation in text and html format, and examples. pycdf
+requires the Numeric python package, and installs through the simple
+"python setyp.py install" command.
+
+Bill Noon (noon at snow.cit.cornell.edu) has implemented another netCDF
+Python module that allows easy creation, access, and browsing of netCDF
+data. The bindings also use the [udunits library](/software/udunits/) to
+do unit conversions. More information and source for Noon's Python
+netCDF module are available from
+<http://snow.cit.cornell.edu/noon/ncmodule.html>.
+
+The package from Konrad Hinsen has been integrated into his
+[ScientificPython](https://sourcesup.cru.fr/projects/scientific-py/)
+package.
+
+Dave Brown of NCAR's Computational and Information Systems Laboratory
+has developed [PyNIO](http://www.pyngl.ucar.edu/Nio.shtml), a Python
+package that allows read and/or write access to a variety of data
+formats using an interface modelled on netCDF. Currently supported
+formats include netCDF, HDF4, GRIB1 and GRIB2 (read only), and HDF-EOS 2
+Grid and Swath data (read only).
+
+Vicente Galiano of Miguel Hernandez University has developed a Python
+interface to PnetCDF. This Python's package called "PyPnetCDF" allows
+access to NetCDF files using MPI and the library pnetCDF developed by
+http://www.mcs.anl.gov/parallel-netcdf/. The tools are very similar to
+Konrad Hinsen's NetCDF package to Python but can read and write in a
+parallel way. For more information, see:
+<http://www.pyacts.org/pypnetcdf>.
+
+Pupynere (PUre PYthon NEtcdf REader) Roberto
+De Almeida has developed
+[pupynere](http://pypi.python.org/pypi/pupynere/), a PUre PYthon NEtcdf
+REader that allows read-access to netCDF files using the same syntax as
+the Scientific.IO.NetCDF Python module. Even though it's written in
+Python, the module is up to 40% faster than Scientific.IO.NetCDF and
+pynetcdf.
+
+R interface {#R}
+-------------------------------
+
+The R Project for Statistical Computing has developed
+[R](http://www.R-project.org/), a language and environment for
+statistical computing and graphics. It provides a wide variety of
+statistical and graphical techniques, including linear and nonlinear
+modelling, statistical tests, time series analysis, classification, and
+clustering.
+
+David Pierce has contributed the [ncdf4
+package](http://cran.r-project.org/web/packages/ncdf4/index.html) for
+reading netCDF data into R and for creating new netCDF dimensions,
+variables, and files, or manipulating existing netCDF files from R.
+
+Pavel Michna has contributed another package,
+[RNetCDF](http://cran.r-project.org/web/packages/RNetCDF/index.html),
+that also provides access to netCDF data and to udunits calendar
+functions from R.
+
+Robert Hijmans (with additional contributors) has created the [R raster
+package](http://cran.r-project.org/web/packages/raster/index.html) for
+geographic data analysis and modeling. The raster package can be used
+for reading, writing, manipulating, analyzing and modeling gridded
+spatial data. The package is especially useful for large datasets that
+don't fit into memory, because data is processed in chunks. See
+[Introduction to the 'raster'
+package](http://cran.r-project.org/web/packages/raster/vignettes/Raster.pdf)
+for more information.
+
+Quantum GIS (QGIS) {#QGIS}
+-----------------------------------------
+
+[Quantum GIS](http://www.qgis.org/) (QGIS) is an Open Source Geographic
+Information System (GIS) licensed under the GNU General Public License.
+QGIS is an official project of the Open Source Geospatial Foundation
+(OSGeo). It runs on Linux, Unix, Mac OSX, and Windows and supports
+numerous vector, raster, and database formats and functionalities. QGIS
+supports a desktop, browser, server, and client for viewing, editing,
+analysis, serving, and accessing data. Its server complies with the OGC
+WMS 1.3 standard. In addition to PostGIS and SpatiaLite formats, it can
+access data in vector formats supported by the OGR library as well as
+most raster formats supported by the GDAL library, including netCDF. For
+a more detailed list of features of the QGIS desktop, browser, server,
+and client, see the [QGIS features
+page](http://www.qgis.org/en/about-qgis/features.html).
+
+Ruby interface {#Ruby}
+-------------------------------------
+
+A group at the Research Institute for Sustainable Humanosphere (RISH) of
+Kyoto University has developed a [netCDF interface for
+Ruby](http://www.gfd-dennou.org/arch/ruby/products/ruby-netcdf/), an
+interpreted, object-oriented scripting language. This interface is
+intended to cover all the functionality of the C library for netCDF.
+Also available are combination functions such as iterators (which offer
+abstract ways to scan files and variables). Numeric arrays are handled
+by the "NArray" multi-dimensional array class, which is becoming the de
+facto standard multi-dimensional array for Ruby. See also the Ruby-based
+[GPhys software and Gfdnavi tool](#Gfdnavi) for accessing GRIB, GrADS,
+and netCDF data uniformly.
+
+More information about Ruby is available from the [Ruby web
+site](http://www.ruby-lang.org/).
+
+Scientific DataSet (SDS) Library {#SDS}
+------------------------------------------------------
+
+The [Scientific DataSet Library and Tools
+project](http://sds.codeplex.com), developed jointly by Microsoft
+Research Cambridge and Moscow State University, is aimed at manipulation
+and visualization of multidimensional data sets.
+
+Scientific DataSet (or SDS in short) is a .NET class library for
+manipulating scientific data and their metadata. SDS provides a unified
+API for convenient access to various data storages. Three types of
+storages are supported by the first release: NetCDF files, CSV text
+files and volatile in-memory datasets. SDS uses native NetCDF library
+built from version 4.0.1 both for 32 and 64-bit Windows platforms. New
+storage types can be added to SDS infractructure as plugins. Support for
+accessing TIFF image files from SDS as 2D arrays will be available soon
+as a separate CodePlex project.
+
+Three applications are built on top of SDS:
+
+-   sds command line utility. It allows users to examine data set
+    schema, copy data sets, modify their metadata.
+-   DataSetViewer application for visualization of data sets.
+    DataSetViewer is both a standalone application and Windows
+    Presentation Foundation Control that can be built into your
+    applications. DataSetViewer has support for interactive slicing of
+    multidimensional data along any dimension.
+-   DataSetEditor add-in for Microsoft Office Excel. DataSetEditor
+    provides ability to view and modify the contents of any data set as
+    Excel worksheets.
+
+You can read the Getting Started document at
+<http://sds.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=127282>
+for a more detailed introduction to the Scientific DataSet software. A
+Windows Installation package for SDS binaries along with DataSet Viewer
+and DataSet Editor are available also. You can also build core class
+libraries and the sds utility under Mono. You may use, copy, and
+reproduce this software for any non-commercial purpose. For further
+details see license at <http://sds.codeplex.com/license>.
+
+The SDS project is in beta phase and keeps evolving. You are welcome to
+join discussions or report issues at the CodePlex site:
+<http://sds.codeplex.com>.
+
+Apache Spatial Information System (SIS) {#SIS}
+-------------------------------------------------------------
+
+[Apache Spatial Information System
+(SIS)](https://builds.apache.org/job/sis-trunk/site/index.html) is a
+Java library for developing geospatial applications. SIS enables
+representation of coordinates for searching, data clustering, archiving,
+or any other relevant spatial needs. The library is an implementation of
+GeoAPI 3.0 interfaces and can be used for desktop or server
+applications.
+
+SIS provides data structures for geographic data and associated metadata
+along with methods to manipulate those data structures. The SIS metadata
+module forms the base of the library and enables the creation of
+metadata objects which comply with the ISO 19115 metadata model and
+which can be read from or written to ISO 19139 compliant XML documents.
+The SIS referencing module will enable the construction of geodetic data
+structures for geospatial referencing based on the ISO 19111 model such
+as axis, projection and coordinate reference system definitions, along
+with the associated operations which enable the mathematical conversion
+of coordinates between different systems of reference. The SIS storage
+modules will provide a common approach to the reading and writing of
+grid coverages applicable to simple imagery and multidimensional data
+structures.
+
+SIS supports creating ISO 19115 metadata from metadata in a netCDF store
+from a given file, URL, stream, or NetcdfFile object. SIS netCDF storage
+is intended to be a bridge between NetCDF Climate and Forecast (CF)
+conventions and ISO 19115 metadata.
+
+SIS is under developement as an Apache project. Release 0.3 is currently
+available for download.
+
+Tcl/Tk interfaces {#TclTk}
+------------------------------------------
+
+Dan Schmitt has developed [cdftcl](http://cnrit.tamu.edu/rsg/cdftcl/), a
+[Tcl/Tk](http://www.scriptics.com/) interface for netCDF. It allows the
+use of "wildcards" (\*) or ranges (1-4) in the subscript notation, and
+use of name references instead of variable IDs. Contact dan at computer.org
+for more information.
+
+Tcl-nap {#Tcl-nap}
+---------------------------------
+
+[Tcl-nap](http://tcl-nap.sourceforge.net) (n-dimensional array
+processor) is a loadable extension of Tcl which provides a powerful and
+efficient facility for processing data in the form of n-dimensional
+arrays. It has been designed to provide an array-processing facility
+with much of the functionality of languages such as
+[APL](http://www.acm.org/sigapl/), Fortran-90, [IDL](#IDL),
+[J](http://www.jsoftware.com/), [matlab](http://www.mathworks.com), and
+[octave](http://www.octave.org/).
+
+Support is provided for data based on n-dimensional grids, where the
+dimensions correspond to continuous spatial coordinates. There are
+interfaces to the HDF and netCDF file formats commonly used for such
+data, especially in Earth sciences such as Oceanography and Meteorology.
+
+The internal data structure is called a NAO (n-dimensional array object)
+and contains similar information to that of HDF SDSs and netCDF
+variables.
+
+Tcl-nap was developed as part of the [CSIRO CAPS
+project](http://www.dar.csiro.au/rs/avhrr_processing_software.htm), but
+can be loaded and used without the (satellite oriented) CAPS extension.
+
+Visual Basic and VB.net interfaces {#VB}
+-------------------------------------------------------
+
+Carsten Wieczorrek has developed code in VB 6 to export chromatographic
+data into the netcdf/ANDI format. The application writes netCDF files
+that can be read by CHROMELEON, for example. For others interested in
+programming with netcdf.dll from VB 6, see Wieczorrek's web page on
+[netCDF and VB 6.0](http://www.mn-net.com/netcdf_vb6) and for VB.net,
+see [netCDF and VB.net](http://www.mn-net.com/netcdf_vbnet).
+
+VisAD {#VisAD}
+-----------------------------
+
+[VisAD](http://www.ssec.wisc.edu/~billh/visad.html) is a Java class
+library for interactive and collaborative visualization and analysis of
+numerical data. It combines:
+-   The use of pure Java for platform independence and to support data
+    sharing and real-time collaboration among geographically distributed
+    users. Support for distributed computing is integrated at the lowest
+    levels of the system using Java RMI distributed objects.
+-   A general mathematical data model that can be adapted to virtually
+    any numerical data, that supports data sharing among different
+    users, different data sources and different scientific disciplines,
+    and that provides transparent access to data independent of storage
+    format and location (i.e., memory, disk or remote). The data model
+    has been adapted to netCDF, FITS, HDF-EOS, McIDAS, Vis5D, GIF and
+    JPEG file formats.
+-   A general display model that supports interactive 3-D, data fusion,
+    multiple data views, direct manipulation, collaboration, and virtual
+    reality. The display model has been adapted to Java3D and Java2D and
+    used in an ImmersaDesk virtual reality display.
+-   Data analysis and computation integrated with visualization to
+    support computational steering and other complex interaction modes.
+-   Support for two distinct communities: developers who create domain-
+    specific systems based on VisAD, and users of those domain-specific
+    systems. VisAD is designed to support a wide variety of user
+    interfaces, ranging from simple data browser applets to complex
+    applications that allow groups of scientists to collaboratively
+    develop data analysis algorithms.
+-   Developer extensibility in as many ways as possible.
+
+VisAD was written by programmers at the [SSEC Visualization
+Project](http://www.ssec.wisc.edu/~billh/vis.html) at the University of
+Wisconsin-Madison [Space Science and Engineering
+Center](http://www.ssec.wisc.edu/), and the [Unidata Program
+Center](/index.html).
+
+WebWinds {#WebWinds}
+-----------------------------------
+
+[WebWinds](http://www.openchannelsoftware.com/projects/WebWinds/) is a
+free Java-based science visualization and analysis package. In addition
+to several new analysis tools, the current fourth version does automatic
+scripting. This allows
+
+1.  a user to rapidly and automatically create and store a session,
+    either for his own use, or for use by a collaborator on another
+    machine;
+2.  a data provider to automatically create a specialized analysis
+    environment which can be downloaded (as a small script file) along
+    with a dataset from a Website; and
+3.  realtime collaboration or sharing of sessions over (even
+    low-bandwidth) networks, including the Internet.
+
+This scripting requires no knowledge of the scripting language syntax.
+Several sample script files are included with the distribution.
+
+In addition, this version contains a capability to geo-reference some
+data and to read ASCII data in tabular format. Also new is the ability
+to output data in numerical form (e.g. NetCDF) and a context sensitive,
+integrated help system.
+
+As with earlier versions, data in several different formats, including
+NetCDF, can be read in easily from your local machine or from the Web.
+In addition, most data can be subset or subsampled on load, making it
+possible to visualize very large multidimensional and/or multispectral
+datasets. The package includes several step-by-step examples.
+Installation of the software (including Java) on the PC or Mac is a
+process requiring one file to be downloaded and opened. If you need help
+getting started, a remote tutorial is available once you've downloaded
+the package.
+
+WebWinds is \`point and click' rather than language driven and it runs
+well on Unix, Windows (95/98/NT) and Mac platforms. It currently
+requires JDK 1.1. To download a copy of this release, go to
+<http://www.sci-conservices.com/rel4/webpage/wwhome.html>
+
+xray (Python N-D labelled arrays) {#xray}
+--------------------------------------------------------
+
+[xray](http://xray.readthedocs.org/en/stable/index.html) is an open
+source project and Python package that aims to bring the labeled data
+power of [pandas](http://pandas.pydata.org/) to the physical sciences,
+by providing N-dimensional variants of the core pandas data structures,
+Series and DataFrame: the xray DataArray and Dataset.
+
+xray adopts the [Common Data
+Model](http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/CDM)
+for self-describing scientific data in widespread use in the Earth
+sciences (e.g., netCDF and OPeNDAP): xray.Dataset is an in-memory
+representation of a netCDF file.
+
+xray is being developed by Stephan Hoyer, Alex Kleeman, and [other
+contributors](https://github.com/xray/xray/graphs/contributors).
+
+Zebra {#Zebra}
+-----------------------------
+
+[Zebra](http://www.atd.ucar.edu/rdp/zebra.html) (formerly named Zeb) is
+a system for data ingest, storage, integration and display, designed to
+operate in both real time and postprocessing modes. Zebra was developed
+by Jonathan Corbet and others in NCAR's [Research Data
+Program](http://www.atd.ucar.edu/rdp/rdp_home.html).
+Zebra's primary use is for the superpositioning of observational data
+sets (such as those collected by satellite, radar, mesonet and aircraft)
+and analysis products (such as model results, dual-Doppler synthesis or
+algorithm output). Data may be overlaid on a variety of display types,
+including constant altitude planes, vertical cross-sections, X-Y graphs,
+Skew-T plots and time-height profiles. The fields for display, color
+tables, contour intervals and various other display options are defined
+using an icon based user-interface. This highly flexible system allows
+scientific investigators to interactively superimpose and highlight
+diverse data sets; thus aiding data interpretation.
+
+Data handling capabilities permit external analysis programs to be
+easily linked with display and data storage processes. The data store
+accepts incoming data, stores it on disk, and makes it available to
+processes which need it. An application library is available for data
+handling. The library functions allow data storage, retrieval and
+queries using a single applications interface, regardless of the data's
+source and organization. NetCDF data that conforms to Zebra conventions
+is supported by this interface.
+
+Zebra is currently available to the university research community
+through the NCAR/ATD Research Data Program. Email requests to
+rdp-support at atd.ucar.edu. More information is on the web page
+http://www.atd.ucar.edu/rdp/zebra.html.
+
+------------------------------------------------------------------------
+
+User-Contributed Software {#user}
+================================================
+
+Unidata makes available a separate
+[catalog](/software/netcdf/Contrib.html) to a
+[directory](ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/) of freely
+available, user-contributed software and documentation related to the
+netCDF library. This software may be retrieved by anonymous FTP. We
+haven't necessarily used or tested this software; we make it available
+"as is".
+
+The criteria for inclusion in the netcdf/contrib/ directory of
+user-contributed software are:
+
+-   General usefulness to a significant part of the netCDF community
+-   Small size
+-   Infrequent need for updates
+-   Free availability
+
+------------------------------------------------------------------------
+
+Commercial or Licensed Packages {#commercial}
+===============================
+
+ASA ViewNcDap {#ViewNcDap}
+-----------------------------------------
+
+Applied Science Associates, Inc. has made the ASA View NC/Dap
+application freely available for
+[download](http://www.asascience.com/downloads). ViewNcDap is a
+stand-alone research-based tool (with included demonstration data) that
+allows a user to visualize four dimensional NetCDF and OPeNDAP data.
+ViewNcDap is a Windows application that includes temporal/time step
+functionality for viewing animations of data that include temporal
+information. The application may be used to visualize a variety of
+time-varying geospatial scientific data in a simple map framework. It
+handles CF conventions and includes some aliasing features that could
+permit additional formats to be read. It should not be considered a GIS
+system, but is used to quickly preview a variety of data on a simple
+map. Data may also be filtered and saved to a local netCDF file.
+
+Avizo {#Avizo}
+-----------------------------
+
+[Avizo](http://www.avizo3d.com/) software is a powerful tool for 3D data
+visualization and analysis. It offers a comprehensive feature set that
+addresses visualization, processing, analysis, communication and
+presentation. [Avizo Green
+Edition](http://www.vsg3d.com/vsg_prod_avizo_green.php) includes an
+advanced set of features dedicated to climate, oceanography,
+environmental or earth-mapped data. It provides high-level support for
+the netCDF format, a dedicated Earth visualization module, and a set of
+advanced geographical projections applicable to a wide range of fast 2D
+and 3D data representations.
+
+For more information, see [www.avizo3d.com](http://www.avizo3d.com/).
+
+AVS {#AVS}
+-------------------------
+
+[AVS](ftp://testavs.ncsc.org/avs/Info/WHAT_IS_AVS) (Application
+Visualization System) is a visualization application software and
+development environment. An AVS module has been written that allows
+multi-dimensional netCDF data sets to read into AVS as uniform or
+rectilinear field files. The AVS user can point and click to specify the
+name of the variable in the selected netCDF file, as well as selecting
+the hyperslab. If 1D coordinate variables exist (a variable that has the
+same name as a dimension) then the coordinate variable will be used to
+specify the coordinates of resulting rectilinear field file. If no
+coordinate variable exists, then the resulting field file will be
+uniform. Once in AVS, there are hundreds of analysis and display modules
+available for image processing, isosurface rendering, arbitrary slicing,
+alpha blending, streamline and vorticity calculation, particle
+advection, etc. AVS runs on many different platforms (Stardent, DEC,
+Cray, Convex, E and S, SET, Sun, IBM, SGI, HP, FPS and WaveTracer), and
+it has a flexible data model capable of handling multidimensional data
+on non-Cartesian grids.
+The module source code and documentation is available from the
+[International AVS Center](http://iac.ncsc.org/), in the
+<ftp://testavs.ncsc.org/avs/AVS5/Module_Src/data_input/read_netcdf/>
+directory.
+
+See also the information on [DDI](#DDI) for another way to use netCDF
+data with AVS.
+
+Barrodale UFI {#BCS-UFI}
+---------------------------------------
+
+[Barrodale Computing Services Ltd.](http://www.barrodale.com) (BCS) has
+developed a product that addresses one of the main objections heard from
+"technologists" (e.g., scientists, engineers, and other researchers) who
+avoid using databases to manage their data: "my very large data files
+are too cumbersome/difficult/slow/costly to load into a database". In
+addition to netCDF, these files come in a variety of formats (HDF5,
+GRIB, NITFS, FITS, etc.).
+
+This BCS product is called the [Universal File Interface
+(UFI)](http://www.barrodale.com/bcs/universal-file-interface-ufi); it's
+a database extension based on the IBM Informix Virtual Table Interface
+(VTI). *(Please continue reading even if you don't have Informix running
+on your system, because IBM has just made available, at no charge, the
+[Innovator-C
+Edition](http://www-01.ibm.com/software/data/informix/innovator-c-edition/)
+of Informix.)* A demo that uses UFI to access wind speeds can be seen
+[here](http://www.barrodale.com/bcs/universal-file-interface-animation).
+
+VTI is a technology that supports making external datasets appear as
+tables to SQL queries and statements. UFI is a BCS database extension
+for delivering the contents of external data files as though they were
+rows in a database table. UFI makes a file look like a set of database
+tables, so "UFI managed tables" are actually virtual database tables.
+Consequently, users of UFI can perform SQL queries on their files
+without having to first load them into a database.
+
+DioVISTA/Storm {#DioVISTAStorm}
+-----------------------------------------------
+
+[DioVISTA/Storm](http://www.hitachi-power-solutions.com/products/product03/p03_61.html)
+is a commercial software package that visualizes content of netCDF files
+as a time series of grids, isosurfaces, and arrows on a 3D virtual
+earth. Its user interface is similar to standard 3D earth visualizing
+software. It displays OGC KML files, Shapefiles, and online map
+resources through OGC Web Tile Map Services (WTMS). It supports CF
+Conventions version 1.6 (lon-lat-alt-time axis and trajectory). Its
+first version was released on Aug 5 2014.
+
+Environmental WorkBench {#Environmental_WorkBench}
+-----------------------------------------------------------------
+
+[SuperComputer Systems Engineering and Services
+Company](http://www.ssesco.com/) (SSESCO) has developed the
+[Environmental WorkBench](http://www.ssesco.com/files/ewb.html) (EWB),
+an easy to use visualization and analysis application targeted at
+environmental data. The EWB currently has numerous users in the fields
+of meteorological research, air quality work, and groundwater
+remediation.
+EWB system features include:
+
+-   Random access file structure using the netCDF-based public domain
+    MeRAF file system with support for gridded, discrete (non-grid-based
+    observation), and particle types
+-   Support for geo-referenced or Cartesian coordinate systems
+-   Object oriented Graphical User Interface (GUI) that is very easy to
+    use
+-   Tools for converting model and observational data sets and data
+    writers to netCDF
+-   Interactive rotation/translation of scenes in 3D space
+-   Time sequencing controls to step forward/backward, animate
+    sequentially, or go to a chosen time step; including multiple
+    asynchronous or non-uniform time steps
+-   Interactive slicers to select cross sections through 3D data sets
+-   Display operators available on the slices, including
+    -   Contour lines with selectable contour levels
+    -   Color shading by data value with variable transparency level
+    -   Arrow and streamline representation for vector quantities
+    -   Positional reference lines at user selected intervals
+    -   Color coded shapes at each grid node
+-   Multiple 3D isosurfaces at selected parameters and values with
+    variable transparency
+-   Display of particle positions with coloring by type, height, and
+    source
+-   Display of discrete data using colored spheres and labels for scalar
+    data and arrows for vectors (with arrowheads or meteorological
+    style)
+-   Multiple user definable color maps to which isosurface and colored
+    field shading may be separately assigned
+-   On screen annotation for generation of report ready figures
+-   Image export in any of the common image formats (gif, tiff,
+    encapsulated postscript, etc.)
+-   Graceful handling of missing or bad data values by all the graphics
+    rendering routines
+-   Automatic data synchronization to allow automatic screen updating as
+    new data arrives in real-time from a model or set of sensors
+-   Two and three dimensional interpolation from scattered observations
+    to a grid, using the Natural Neighbor Method. This robust volume
+    based method yields results far superior to distance weighting
+    schemes.
+
+Systems currently supported include Win95, WinNT, OS/2, IBM RS/6000,
+Silicon Graphics, HP and SUN workstations.
+
+SSESCO has implemented a meta-file layer on top of the netCDF library,
+called MeRAF. It handles multiple netCDF files as well as automatic
+max-min calculations, time-varying gridded, particle, and discrete data,
+logical groupings for discrete data, and an overall simplified and
+flexible interface for storing scientific data. MeRAF is being used by
+the DOE at the Hanford-Meteorological Site for observational data and
+will be used for their weather-modeling.
+
+ESRI {#ESRI}
+---------------------------
+
+[ESRI ArcGIS](http://www.esri.com/software/arcgis/index.html) version
+9.2 and later support [accessing netCDF time-based and multidimensional
+data](http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=An_overview_of_data_support_in_ArcGIS)
+that follows CF or COARDS conventions for associating spatial locations
+with data. A selected slice of netCDF data may be displayed in ArcGIS as
+a raster layer, feature layer, or table. You can also drag a netCDF file
+from Windows Explorer and drop it in an ESRI application such as ArcMap.
+
+FME {#FME}
+-------------------------
+
+[FME](http://www.safe.com/fme), developed by [Safe Software
+Inc.](http://www.safe.com), is a tool for transforming data for exchange
+between over [300 different formats and
+models](http://www.safe.com/fme/format-search/), including netCDF. FME's
+read and write support for netCDF allows users to move data into the
+netCDF common standard, regardless of its source, and conversely enables
+end-users to consume netCDF data for use in their preferred systems. For
+more information visit <http://www.safe.com/fme>.
+
+HDF Explorer {#HDF-Explorer}
+-------------------------------------------
+
+[HDF Explorer](http://www.space-research.org/) is a data visualization
+program that reads the HDF, HDF5 and netCDF data file formats (including
+netCDF classic format data). HDF Explorer runs in the Microsoft Windows
+operating systems.
+
+HDF Explorer offers a simple yet powerful interface for the
+visualization of HDF and netCDF data. The data is just a click of the
+mouse away. Data is first viewed in a tree-like interface, and then
+optionally loaded and visualized in a variety of ways. HDF Explorer
+features include fast access to data, grid, scalar and vector views. It
+also allows exporting your data either as an ASCII text file or a bitmap
+image.
+
+IDL Interface {#IDL}
+-----------------------------------
+
+[IDL](http://www.exelisvis.com/ProductsServices/IDL.aspx) (Interactive
+Data Language) is a scientific computing environment, developed and
+supported by [Excelis Visual Information
+Solutions](http://www.exelisvis.com/), that combines mathematics,
+advanced data visualization, scientific graphics, and a graphical user
+interface toolkit to analyze and visualize scientific data. Designed for
+use by scientists and scientific application developers, IDL's
+array-oriented, fourth-generation programming language allows you to
+prototype and develop complete applications. IDL now supports data in
+netCDF format.
+As an example, here is how to read data from a netCDF variable named GP
+in a file named "data/aprin.nc" into an IDL variable named gp using the
+IDL language:
+
+       id = ncdf_open('data/april.nc')
+        ncdf_varget,id, ncdf_varid( id, 'GP'), gp
+
+Now you can visualize the data in the gp variable in a large variety of
+ways and use it in other computations in IDL. You can FTP a demo version
+of IDL, including the netCDF interface, by following the instructions in
+pub/idl/README available via anonymous FTP from gateway.rsinc.com or
+boulder.colorado.edu.
+Other software packages that use or interoperate with IDL to access
+netCDF data includes [ARGOS](#ARGOS), [CIDS Tools](#CIDS_Tools),
+[DDI](#DDI), [HIPHOP](#HIPHOP), [Hyperslab OPerator Suite
+(HOPS)](Hyperslab_OPerator_Suite_(HOPS)), and [Noesys](Noesys).
+
+InterFormat {#InterFormat}
+-----------------------------------------
+
+[InterFormat](http://www.radio-logic.com/) is a medical image format
+conversion program with both Motif and character interfaces. InterFormat
+can automatically identify and convert most popular medical image
+formats and write output files in many standard medical image formats,
+or in formats such as netCDF that are suitable for input to leading
+scientific visualization packages. InterFormat runs on UNIX
+workstations; a version for OpenVMS is also available. A separate
+external module for [IBM Data Explorer](#OpenDX) is available for use in
+IBM Data Explorer's Visual Program Editor.
+For more details about the formats handled, program features, and
+pricing, see the Radio-Logic web site at
+[\<http://www.radio-logic.com\>](http://www.radio-logic.com).
+
+IRIS Explorer Module {#IRIS_Explorer_Module}
+-----------------------------------------------------------
+
+The Atmospheric and Oceanic Sciences Group at the National Center for
+Supercomputing Applications (NCSA) and the Mesoscale Dynamics and
+Precipitation Branch at NASA-Goddard Space Flight Center have developed
+the NCSA PATHFINDER module set for [IRIS
+Explorer](http://www.nag.co.uk:70/1h/Welcome_IEC). Two of the modules,
+[ReadDFG](http://redrock.ncsa.uiuc.edu/PATHFINDER/pathrel2/explorer/ReadDFG/ReadDFG.html)
+(to output Grids), and
+[ReadDF](http://redrock.ncsa.uiuc.edu/PATHFINDER/pathrel2/explorer/ReadDF/ReadDF.html)
+(to output Lattices) are capable of reading from NCSA HDF files,
+MFHDF/3.3 files, and Unidata netCDF files. A user-friendly interface
+provides control and information about the contents of the files.
+
+For ReadDF, the format translation is handled transparently. Up to five
+unique lattices may be generated from the file (as these files can
+contain multiple data fields) using a single module. A variety of
+dimensionalities and data types are supported also. Multiple variables
+may be combined in a single lattice to generate vector data. All three
+Explorer coordinate systems are supported.
+
+With ReadDFG, user selected variables from the file are output in up to
+five PATHFINDER grids. Each grid can consist of scalar data from one
+variable or vector data from multiple variables. Coordinate information
+from the file is also included in the grids. Any number of dimensions in
+any of the Explorer coordinate types are supported.
+
+For more information on the NCSA PATHFINDER project and other available
+modules, visit the WWW/Mosaic PATHFINDER Home Page at
+<http://redrock.ncsa.uiuc.edu/PATHFINDER/pathrel2/top/top.html> The
+ReadDF module may be downloaded either via the WWW server or anonymous
+ftp at redrock.ncsa.uiuc.edu in the /pub/PATHFINDER directory. For more
+information please send email to: pathfinder at redrock.ncsa.uiuc.edu
+
+See also the information on [DDI](#DDI) for another way to use netCDF
+data with IRIS Explorer.
+
+LeoNetCDF {#LeoNetCDF}
+-------------------------------------
+
+[LeoNetCDF](http://www.leokrut.com/leonetcdf.html) is a Windows
+application (Windows95/NT and higher) for editing netCDF files. It can
+display content of netCDF files in tree style control and permits
+editing its parameters in a standard Windows interface environment.
+
+Mathematica {#Mathematica}
+-----------------------------------------
+
+[Mathematica](http://www.wolfram.com/products/mathematica/index.html) is
+a technical computing environment that provides advanced numerical and
+symbolic computation and visualization. As of version 6, Mathematica
+adds classic [netCDF
+data](http://reference.wolfram.com/mathematica/ref/format/NetCDF.html)
+to the many forms of data it can import, export, and visualize.
+
+MATLAB {#MATLAB}
+-------------------------------
+
+[MATLAB](http://www.mathworks.com/products/matlab/) is an integrated
+technical computing environment that combines numeric computation,
+advanced graphics and visualization, and a high-level programming
+language. Versions 7.7 and later of MATLAB have built-in support for
+reading and writing netCDF data. MATLAB version 2012a includes the
+netCDF 4.1.2 library with OPeNDAP client support turned on, so remote
+access to netCDF and other data formats supported by OPeNDAP servers is
+available.
+For earlier versions, several freely-available software packages that
+implement a MATLAB/netCDF interface are available:
+[nctoolbox](#nctoolbox), [NetCDF Toolbox for MATLAB-5](#NC4ML5),
+[MexEPS](#MexEPS), the [CSIRO MATLAB/netCDF interface](#CSIRO-MATLAB),
+[NetCDF
+reader](http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15177&objectType=file),
+and [fanmat](/software/netcdf/Contrib.html).
+
+Noesys {#Neosys}
+-------------------------------
+
+[Noesys](http://www.rsinc.com/NOeSYS/index.cfm) is software for desktop
+science data access and visualization. Available for both Windows and
+Power Macintosh platforms, Noesys allows users to access, process,
+organize and visualize large amounts of technical data.
+Noesys can be used to:
+
+-   Access and organize complex technical data
+-   Export data objects to text and binary
+-   View and edit large multidimensional data sets (up to 7D) in a
+    spreadsheet-like environment
+-   Manipulate and process data using
+    [IDL®](http://www.exelisvis.com/ProductsServices/IDL.aspx), the
+    Interactive Data Language, from Research Systems, Inc.
+-   Interactively visualize column, matrix, and volumetric data sets
+-   Image global datasets as various map projections
+-   Create various projections from partial data or partial projections
+    from global data (Windows only)
+-   View and Edit HDF-EOS grid object data
+-   Subset datasets and data tables with a GUI dialog
+-   Change and save the number format of datasets and data table fields
+-   Drag and Drop HDF objects between files to organize or subset files
+-   Attach text annotations directly to the data file
+-   Add new data objects to files and create hierarchical groups
+-   Edit or create new color palettes
+-   Generate publication-quality graphics for data presentation
+
+Noesys has an interface to IDL®, allowing data to move back and forth
+between Noesys and IDL with the click of a mouse. Noesys includes the
+visual data analysis tools, Transform, T3D and Plot, for menu driven
+plotting, rendering, and image analysis. Noesys can import HDF, HDF-EOS,
+netCDF, ASCII, Binary, DTED, GeoTIFF, SDTS, TIFF, PICT, and BMP files,
+create annotations, macros, images, projections and color palettes
+specific to the data and save it the result as an HDF file. Noesys also
+includes an HDF-EOS Grid Editor. Noesys runs on Windows 95/98 & NT and
+Power Macintosh OS. More details and information about ordering Noesys
+are available from
+[\<http://www.rsinc.com/NOeSYS/index.cfm\>](http://www.rsinc.com/NOeSYS/index.cfm).
+
+Origin {#Origin}
+-------------------------------
+
+Ryan Toomey reports:
+
+Our website is <http://www.originlab.com/>
+
+A general description of Origin: Origin includes a suite of features
+that cater to the needs of scientists and engineers alike. Multi-sheet
+workbooks, publication-quality graphics, and standardized analysis tools
+provide a tightly integrated workspace for you to import data, create
+and annotate graphs, explore and analyze data, and publish your work. To
+ensure that Origin meets your data analysis requirements, intuitive
+tools for advanced statistics, regression, nonlinear curve fitting,
+signal processing, image processing and peak analysis are built-in.
+Since any analysis operation can be set to automatically recalculate,
+you can reuse your projects as templates for future work, thereby
+simplifying your daily routine.
+
+A general description of OriginPro: OriginPro offers all of the features
+of Origin plus extended analysis tools for statistics, 3D fitting, image
+processing and signal processing.
+
+A general description of OriginLab Corporation: "OriginLab Corporation
+produces professional data analysis and graphing software for scientists
+and engineers. Our products are designed to be easy-to-use, yet have the
+power and versatility to provide for the most demanding user."
+
+PPLUS {#PPLUS}
+-----------------------------
+
+[Plot-Plus (PPLUS)](http://dwd6.home.mindspring.com/) is a general
+purpose scientific graphics package, which is used in several PMEL
+applications. It will read most standard ascii or binary files, as well
+as netCDF file format, which used by the TOGA-TAO Project and the EPIC
+system for management display and analysis. PPLUS is an interactive,
+command driven, scientific graphics package which includes features such
+as Mercator projection, Polar Stereographic projection, color or gray
+scale area-fill contour plotting, and support for many devices:
+X-windows, PostScript, HP, Tektronix, and others. This powerful and
+flexible package recognizes netCDF data format, and it can extract axis
+lables and graph titles from the data files. The user can customize a
+plots, or combine several plots into a composite. Plots are of
+publication quality. The PPLUS graphics package is used for all the TAO
+workstation displays, including the animations. The animations are
+created by generating a PPLUS plot for each frame, transforming the
+PPLUS metacode files into HDF format with the PPLUS m2hdf filter, and
+then displaying the resulting bit maps as an animation with the
+XDataSlice utility, which is freely available on Internet from the
+National Center for Supercomputing Applications, at
+anonymous at ftp.ncsa.uiuc.edu (141.142.20.50). There is also a new m2gif
+utility which produces GIF files from PPLUS metacode files.
+PPLUS is supported for most Unix systems and for VAX/VMS, and is in use
+at many oceanographic institutes in the US (e.g., (PMEL, Harvard, WHOI,
+Scripps, NCAR, NASA, University of Rhode Island, University of Oregon,
+Texas A&M...) and also internationally (Japan, Germany, Australia,
+Korea...).
+
+Plot Plus is now available at no charge. It does require licensing on a
+per computer basis, but the license is at no cost. For more information
+about licensing, see
+[http://dwd6.home.mindspring.com/pplus_license.html/](http://dwd6.home.mindspring.com/pplus_license.html);
+source and documentation are available via anonymous FTP from
+<ftp://ftp.halcyon.com/pub/users/dwd/pplus1_3_2.tar.gz> and
+<ftp://ftp.pmel.noaa.gov/epic/manual-dir/pplus.pdf>.
+
+        Email:      plot_plus at halcyon.com
+        Postal mail:    c/o Donald Denbo
+                2138 N 186th St
+                Shoreline, WA 98133
+        Fax and Voice:  (206) 366-0624
+
+PV-Wave {#PV-Wave}
+---------------------------------
+
+[PV-Wave](http://www.vni.com/products/wave/index.html) is a software
+environment from [Visual Numerics](http://www.vni.com/) for solving
+problems requiring the application of graphics, mathematics, numerics
+and statistics to data and equations.
+PV-WAVE uses a fourth generation language (4GL) that analyzes and
+displays data as you enter commands. PV-WAVE includes integrated
+graphics, numerics, data I/O, and data management. The latest version of
+PV-Wave supports data access in numerous formats, including netCDF.
+
+See also the information on [DDI](#DDI) for another way to use netCDF
+data with PV-Wave.
+
+Slicer Dicer {#SlicerDicer}
+------------------------------------------
+
+[Slicer Dicer](http://www.slicerdicer.com/) is a volumetric data
+visualization tool, currently available for Windows and under
+development for other platforms. The Slicer Dicer Web site includes a
+complete list of features, an on-line user's guide, and examples of
+Slicer Dicer output. Visualizations features include:
+-   Perspective view of data rendered on interactively selected
+    orthogonal slices, oblique slices, blocks (arbitrary rectilinear
+    sub-volumes), cutouts, isosurfaces, and projected volumes (projected
+    maximum, minimum, maximum absolute, or minimum absolute).
+-   Optional annotations: caption, axes ticks and labels (default
+    "pretty" ticks, or override to place ticks where you want them),
+    color legend, data-cube outline.
+-   Animation modes: slices, space, time (any parametric dimension),
+    transparency, oblique slice orientation, rotation. Built-in
+    animation viewer supports speed and image size controls,
+    single-step, forward, backward, loop, and back-and-forth modes.
+-   Select color scale from 25+ built in color tables, or import from
+    palette file. Any data level or range of levels can be painted with
+    an arbitrary color.
+-   Any data level or range of levels can be rendered as either opaque
+    or transparent.
+
+vGeo {#vGeo}
+---------------------------
+
+[vGeo](http://www.vrco.com/products/vgeo/vgeo.html) (Virtual Global
+Explorer and Observatory) is an end-user product from
+[VRCO](http://www.vrco.com/) designed to import and visualize multiple
+disparate data sets, including computer simulations, observed
+measurements, images, model objects, and more. vGeo is available for
+IRIX, Linux and Windows platforms and supports displays ranging from
+desktop monitors to multi-walled projection systems. It accepts data in
+a variety of formats, including netCDF, and allows the user to specify
+how multiple files and variables are mapped into a data source. 3D
+graphics are built from the underlying data in real-time, and the user
+has interactive control of graphics, navigation, animation, and more.
+
+VISAGE and Decimate {#VISAGE_and_Decimate}
+---------------------------------------------------------
+
+[VISAGE](http://www.crd.ge.com/esl/cgsp/projects/visage/)
+(VISualization, Animation, and Graphics Environment) is a turnkey 3D
+visualization system developed at General Electric Corporate Research
+and Development, (Schroeder, WJ et al, "VISAGE: An Object-Oriented
+Scientific Visualization System", Proceedings of Visualization \`92
+Conference). VISAGE is designed to interface with a wide variety of
+data, and uses netCDF as the preferred format.
+
+VISAGE is used at GE Corporate R & D, GE Aircraft Engine, GE Canada, GE
+Power Generation, as well as ETH Zurich, Switzerland, MQS In Chieti,
+Italy, and Rensselaer Polytechnic Institute in Troy, New York.
+
+GE has another application called "Decimate" that does polygon
+reduction/decimation (Schroeder,WJ et al, "Decimation of Triangle
+Meshes", Proceedings of SIGGRAPH \`92). This application uses netCDF as
+a preferred format. Decimate is currently licensed to Cyberware, Inc.,
+makers of 3D laser digitizing hardware. Decimate is currently bundled
+with the scanners, and will soon be available as a commercial product.
+
+Voyager {#Voyager}
+---------------------------------
+
+[Makai Voyager](http://voyager.makai.com/), developed by Makai Ocean
+Engineering, Inc., is 3D/4D geospatial visualization software that
+enables users to import, fuse, view, and analyze large earth, ocean, and
+atmosphere scientific data as it is collected or simulated in a global
+geo-referenced GIS platform. The key differentiator of Makai Voyager is
+its level-of-detail (LOD) technology that enables users to stream big
+data rapidly over a network or the web.
+
+Features in Makai Voyager Version 1.2 include:
+
+-   Preprocessing LiDAR, GIS, & volumetric data from common formats into
+    streamable files
+-   Volume rendering for large 4D (3D + time) data, such as NetCDF
+-   Analysis tools and customizable graphs
+-   WMS and other streamable formats
+
+Individual or group licenses are available for Windows (32- and 64-bit),
+Linux, and Mac OS X. A full-featured 30-day trial version of Makai
+Voyager is [available for download](http://voyager.makai.com).
diff --git a/docs/tutorial.dox b/docs/tutorial.dox
index 7f1ecd6..8ad8568 100644
--- a/docs/tutorial.dox
+++ b/docs/tutorial.dox
@@ -68,7 +68,7 @@ The utility ncdump can be used to show the contents of netCDF
 files. By default, ncdump shows the CDL description of the file. This
 CDL description can be fed into ncgen to create the data file.
 
-See also: \ref guide_ncdump
+See also: \ref ncdump_guide
 
 \subsection netcdf_utilities_ncgen ncgen
 
diff --git a/docs/windows-binaries.md b/docs/windows-binaries.md
index ea32986..457e947 100644
--- a/docs/windows-binaries.md
+++ b/docs/windows-binaries.md
@@ -3,9 +3,9 @@ Installing and Using netCDF-C Libraries in Windows {#winbin}
 
 \brief NetCDF-C Libraries in a Windows Environment may be used under multiple sets of circumstances.
 
-\tableofcontents
+[TOC]
 
-There are several development environments available for programmers who develop on Windows. 
+There are several development environments available for programmers who develop on Windows.
 
 * `Microsoft Visual Studio `
 * `MSYS/MinGW`
@@ -13,38 +13,39 @@ There are several development environments available for programmers who develop
 
 For developers using `Microsoft Visual Studio`, you may download using the Windows build instructions, or you may download the pre-built netCDF-C libraries from this page.
 
-For developers using `MSYS/MinGW` or `Cygwin`, you may build netCDF-C using the Linux/Unix build instructions.  
+For developers using `MSYS/MinGW` or `Cygwin`, you may build netCDF-C using the Linux/Unix build instructions.
 
 > For complex builds that include netCDF-4 and/or DAP support this may prove tricky, as it is time consuming to collect all of the dependencies.  In these cases it may be easier to use the pre-built `netcdf` packages provided by the `MSYS` and `Cygwin` environments.
 
 Users who prefer to build the netCDF-C libraries from source in a Windows environment using Microsoft Visual Studio are referred to \ref netCDF-CMake
 
-# Getting pre-built netCDF-C Libraries for Visual Studio
+# Getting pre-built netCDF-C Libraries for Visual Studio {#msvc-prebuilt}
 
-These libraries can be used with Visual Studio 2010 projects.  The downloads are installer packages which contain the netCDF-C libraries and utilities (ncgen, ncgen3, ncdump and nccopy), as well as the associated dependencies.  
+These libraries have been built using Visual Studio 2012.  The downloads are installer packages which contain the netCDF-C libraries and utilities (ncgen, ncgen3, ncdump and nccopy), as well as the associated dependencies.
 
 
-## Included Dependencies
+## Included Dependencies {#msvc-inc-deps}
 
 The included dependencies and versions are as follows:
 
-* `libhdf5`: 1.8.14
+* `libhdf5`: 1.8.15
 * `libcurl`: 7.35.0
 * `zlib`:    1.2.8
 
-## Latest Release (netCDF-C 4.3.3.1)
+## Latest Release (netCDF-C 4.4.0-rc1) {#msvc-latest-release}
 
 Configuration		| 32-bit 						| 64-bit |
 :-------------------|:--------							|:-------|
-netCDF 3		| [netCDF4.3.3.1-NC3-32.exe][r1]		| [netCDF4.3.3.1-NC3-64.exe][r6] 
-netCDF3+DAP		| [netCDF4.3.3.1-NC3-DAP-32.exe][r2]	| [netCDF4.3.3.1-NC3-DAP-64.exe][r6]
-netCDF4			| [netCDF4.3.3.1-NC4-32.exe][r3]		| [netCDF4.3.3.1-NC4-64.exe][r7]
-netCDF4+DAP		| [netCDF4.3.3.1-NC4-DAP-32.exe][r4]	| [netCDF4.3.3.1-NC4-DAP-64.exe][r8]
+netCDF 3		| [netCDF4.4.0-rc1-NC3-32.exe][r1]		| [netCDF4.4.0-rc1-NC3-64.exe][r6]
+netCDF3+DAP		| [netCDF4.4.0-rc1-NC3-DAP-32.exe][r2]	| [netCDF4.4.0-rc1-NC3-DAP-64.exe][r6]
+netCDF4			| [netCDF4.4.0-rc1-NC4-32.exe][r3]		| [netCDF4.4.0-rc1-NC4-64.exe][r7]
+netCDF4+DAP		| [netCDF4.4.0-rc1-NC4-DAP-32.exe][r4]	| [netCDF4.4.0-rc1-NC4-DAP-64.exe][r8]
 
-# Using the netCDF-C Libraries with Visual Studio
-In order to use the netcdf libraries, you must ensure that the .dll files (along with any dependencies from deps/shared/bin) are on the system path. In order to compile a program using these libraries, you must first link your program against the appropriate 'import' (.lib) libraries.  
+# Using the netCDF-C Libraries with Visual Studio {#msvc-using}
 
-## Install Hierarchy
+In order to use the netcdf libraries, you must ensure that the .dll files (along with any dependencies from deps/shared/bin) are on the system path. In order to compile a program using these libraries, you must first link your program against the appropriate 'import' (.lib) libraries.
+
+## Install Hierarchy {#msvc-install-hierarchy}
 
 When installed, the netCDF libraries are placed in the specified locations, along with the netCDF-C utilities and dependencies.
 
@@ -52,18 +53,18 @@ When installed, the netCDF libraries are placed in the specified locations, alon
 <IMG SRC="InstallTreeWindows.png" width="400"/>
 </center>
 
-# Notes
+# Notes {#msvc-notes}
 
 *The following points should be considered when using the netCDF-C libraries on Windows.*
 
-1. When building the netCDF-C libraries with netCDF4 support, using the 'debug' libraries may cause extraneous warnings. These warnings are related to cross-dll memory management, and appear to be harmless. You can safely ignore them by using the 'release' libraries. [NCF-220]
+1. When building the netCDF-C libraries with netCDF4 support, using the `Debug` libraries may cause extraneous warnings. These warnings are related to cross-dll memory management, and appear to be harmless. You can safely ignore them by using the `Release` libraries. [NCF-220]
 
 
-[r1]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC3-32.exe
-[r2]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC3-DAP-32.exe
-[r3]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC4-32.exe
-[r4]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC4-DAP-32.exe
-[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC3-64.exe
-[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC3-DAP-64.exe
-[r7]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC4-64.exe
-[r8]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.3.3.1-NC4-DAP-64.exe
+[r1]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC3-32.exe
+[r2]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC3-DAP-32.exe
+[r3]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC4-32.exe
+[r4]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC4-DAP-32.exe
+[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC3-64.exe
+[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC3-DAP-64.exe
+[r7]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC4-64.exe
+[r8]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.4.0-rc1-NC4-DAP-64.exe
diff --git a/examples/C/Makefile.in b/examples/C/Makefile.in
index 549999c..600fa08 100644
--- a/examples/C/Makefile.in
+++ b/examples/C/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,17 @@
 
 # $Id: Makefile.am,v 1.26 2010/05/29 00:17:41 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -99,8 +109,6 @@ TESTS = $(am__EXEEXT_2) $(am__append_2) $(am__append_3)
 @USE_VALGRIND_TESTS_TRUE at am__append_2 = run_valgrind_tests.sh
 @USE_NETCDF4_TRUE@@USE_VALGRIND_TESTS_TRUE at am__append_3 = run_nc4_valgrind_tests.sh
 subdir = examples/C
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(top_srcdir)/test-driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -108,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -434,6 +443,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -482,6 +493,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -497,10 +509,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -535,8 +549,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -625,7 +641,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/C/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign examples/C/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -822,7 +837,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1189,6 +1204,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	recheck tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/examples/CDL/Makefile.in b/examples/CDL/Makefile.in
index bba01d4..d8fb05c 100644
--- a/examples/CDL/Makefile.in
+++ b/examples/CDL/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.3 2009/05/19 11:56:50 ed Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,8 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = examples/CDL
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/test-driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -94,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -322,6 +331,7 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -370,6 +380,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -385,10 +396,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -423,8 +436,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -515,7 +530,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/CDL/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign examples/CDL/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -576,7 +590,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -866,6 +880,8 @@ uninstall-am:
 	mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \
 	uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 212706d..705f32d 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 # netcdf directories. Not all directories are built, depending on the
 # options selected during configure.
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = examples
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -152,6 +162,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = C CDL
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -225,6 +236,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -240,10 +252,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -278,8 +292,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -362,7 +378,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign examples/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -657,6 +672,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/h5_test/CMakeLists.txt b/h5_test/CMakeLists.txt
index 23e3d61..bd491b2 100644
--- a/h5_test/CMakeLists.txt
+++ b/h5_test/CMakeLists.txt
@@ -18,5 +18,3 @@ FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SO
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ref_tst_h_compounds.h5 ref_tst_h_compounds2.h5 ref_tst_compounds.nc CMakeLists.txt Makefile.am)
 
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
-
-
diff --git a/h5_test/Makefile.am b/h5_test/Makefile.am
index 71d579e..eda33e7 100644
--- a/h5_test/Makefile.am
+++ b/h5_test/Makefile.am
@@ -1,7 +1,7 @@
 # This is part of the netCDF package.
 # Copyright 2011 University Corporation for Atmospheric Research/Unidata
 # See COPYRIGHT file for conditions of use.
-# 
+#
 # This entire directory will be skipped, unless the configure script
 # is run with --enable-netcdf-4. This directory contains tests that
 # only use HDF5; these tests don't use netCDF at all.
@@ -18,7 +18,7 @@ tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps	\
 tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_rd_cmp tst_h_vl	\
 tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints	\
 tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3	\
-tst_h_enums tst_h_dimscales4 #tst_h_filters 
+tst_h_enums tst_h_dimscales4 #tst_h_filters
 
 # If benchmarks were turned on, build and run a bunch more tests.
 if BUILD_BENCHMARKS
@@ -40,7 +40,7 @@ endif
 # This will run a bunch of the test programs with valgrind, the memory
 # checking tool. (Valgrind must be present for this to work.)
 if USE_VALGRIND_TESTS
-TESTS += run_valgrind_tests.sh 
+TESTS += run_valgrind_tests.sh
 endif # USE_VALGRIND_TESTS
 
 # We must include these files in the distribution.
@@ -50,8 +50,3 @@ run_valgrind_tests.sh ref_tst_compounds.nc h5_err_macros.h CMakeLists.txt
 
 # Clean up test results.
 CLEANFILES = tst_h_*.h5
-
-
-
-
-
diff --git a/h5_test/Makefile.in b/h5_test/Makefile.in
index 9eb7db9..0ae9d62 100644
--- a/h5_test/Makefile.in
+++ b/h5_test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@
 # This is part of the netCDF package.
 # Copyright 2011 University Corporation for Atmospheric Research/Unidata
 # See COPYRIGHT file for conditions of use.
-# 
+#
 # This entire directory will be skipped, unless the configure script
 # is run with --enable-netcdf-4. This directory contains tests that
 # only use HDF5; these tests don't use netCDF at all.
@@ -32,7 +32,17 @@
 # libraries for netCDF-4.
 #
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -96,9 +106,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -115,7 +122,7 @@ TESTS = $(am__EXEEXT_2) $(am__append_5) $(am__append_6)
 
 # This will run a bunch of the test programs with valgrind, the memory
 # checking tool. (Valgrind must be present for this to work.)
- at USE_VALGRIND_TESTS_TRUE@am__append_6 = run_valgrind_tests.sh 
+ at USE_VALGRIND_TESTS_TRUE@am__append_6 = run_valgrind_tests.sh
 subdir = h5_test
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -124,6 +131,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -508,6 +516,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -556,6 +566,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -571,10 +582,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -609,8 +622,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -708,7 +723,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign h5_test/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign h5_test/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -717,7 +731,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -996,7 +1010,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1482,6 +1496,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	recheck tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/h5_test/tst_h_endian_float.c b/h5_test/tst_h_endian_float.c
new file mode 100644
index 0000000..2a9d69c
--- /dev/null
+++ b/h5_test/tst_h_endian_float.c
@@ -0,0 +1,83 @@
+/* This is part of the netCDF package.
+   Copyright 2005 University Corporation for Atmospheric Research/Unidata
+   See COPYRIGHT file for conditions of use.
+
+   Test HDF5 file code. These are not intended to be exhaustive tests,
+   but they use HDF5 the same way that netCDF-4 does, so if these
+   tests don't work, than netCDF-4 won't work either.
+
+   This files tests dataset creation and writing.
+*/
+
+#include "h5_err_macros.h"
+#include <hdf5.h>
+
+#define FILE_NAME "tst_h_endian_float.h5"
+#define GRP_NAME "Henry_V"
+#define VAR_BOOL_NAME "Southhamptons_Battle_Record"
+#define GRP2_NAME "Some_3D_Met_Data"
+#define DIM1_LEN 3
+#define MAX_DIMS 255
+
+int
+main()
+{
+  hid_t fileid, grpid, spaceid, datasetid;
+  int bool_out[DIM1_LEN] = {0, 1, 0};
+  hsize_t dims[1];
+
+  printf("*** Checking HDF5 endianness control...");
+
+#define NATIVE_VAR_NAME "native_var"
+#define LE_VAR_NAME "le_var"
+#define BE_VAR_NAME "be_var"
+  #define LAT_LEN 2
+#define LON_LEN 3
+#define NDIMS 3
+#define LAT_NAME "Lat"
+#define LON_NAME "Lon"
+#define TIME_NAME "Time"
+#define PRES_NAME "Pressure"
+#define TEMP_NAME "Temperature"
+  {
+    int data[DIM1_LEN], data_in[DIM1_LEN];
+    hid_t typeid, native_typeid;
+    hid_t native_did, le_did, be_did;
+    H5T_order_t order;
+    htri_t equal;
+    int i;
+    float float_data_out[LAT_LEN][LON_LEN];
+    int lat, lon;
+
+   for (lat = 0; lat < LAT_LEN; lat++)
+	 for (lon = 0; lon < LON_LEN; lon++)
+	    float_data_out[lat][lon] = -666.666;
+
+    /* Open file and create group. */
+    if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+                            H5P_DEFAULT)) < 0) ERR;
+    if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+    /* Create a dataset of native endian. */
+    dims[0] = DIM1_LEN;
+    if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
+    if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_STD_I32BE,
+                                spaceid, H5P_DEFAULT)) < 0) ERR;
+    if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_IEEE_F32LE,
+                            spaceid, H5P_DEFAULT)) < 0) ERR;
+    if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_IEEE_F32BE,
+                            spaceid, H5P_DEFAULT)) < 0) ERR;
+
+    if (H5Dclose(native_did) < 0 ||
+        H5Dclose(le_did) < 0 ||
+        H5Dclose(be_did) < 0 ||
+        H5Sclose(spaceid) < 0 ||
+        H5Gclose(grpid) < 0 ||
+        H5Fclose(fileid) < 0)
+      ERR;
+
+  }
+
+  SUMMARIZE_ERR;
+  FINAL_RESULTS;
+}
diff --git a/h5_test/tst_h_vars.c b/h5_test/tst_h_vars.c
index 2f44071..aae31ba 100644
--- a/h5_test/tst_h_vars.c
+++ b/h5_test/tst_h_vars.c
@@ -30,16 +30,16 @@ main()
    printf("*** Checking HDF5 boolen variables...");
 
    /* Open file and create group. */
-   if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, 
+   if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
 			   H5P_DEFAULT)) < 0) ERR;
    if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
 
    /* Write an array of bools. */
    dims[0] = DIM1_LEN;
    if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
-   if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL, 
+   if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
 			      spaceid, H5P_DEFAULT)) < 0) ERR;
-   if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+   if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		bool_out) < 0) ERR;
    if (H5Dclose(datasetid) < 0 ||
        H5Sclose(spaceid) < 0 ||
@@ -75,7 +75,7 @@ main()
 	    float_data_out[lat][lon] = -666.666;
 
       /* Create file and group. */
-      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, 
+      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
 			      H5P_DEFAULT)) < 0) ERR;
       if ((grpid = H5Gcreate(fileid, GRP2_NAME, 0)) < 0) ERR;
 
@@ -96,14 +96,14 @@ main()
       if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
 
       /* Create two variables which use this space. */
-      if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT, 
+      if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
 				 spaceid, cparmsid)) < 0) ERR;
-      if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT, 
+      if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
 				 spaceid, cparmsid)) < 0) ERR;
 
       /* Get the spaceid and check various things. */
       if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
-      if (H5Sget_simple_extent_dims(spaceid_in, dims_in, 
+      if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
 				    max_dims_in) < 0) ERR;
       if (dims_in[0] != 0 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
       if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
@@ -122,14 +122,14 @@ main()
       if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
 
       /* Write one record of data to each dataset. */
-      if (H5Dwrite(pres_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid, 
+      if (H5Dwrite(pres_dsid, H5T_IEEE_F32BE, mem_spaceid, write_spaceid,
 		   H5P_DEFAULT, float_data_out) < 0) ERR;
-      if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid, 
+      if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
 		   H5P_DEFAULT, float_data_out) < 0) ERR;
-      
+
       /* Get the spaceid and check various things. */
       if ((spaceid_in = H5Dget_space(temp_dsid)) < 0) ERR;
-      if (H5Sget_simple_extent_dims(spaceid_in, dims_in, 
+      if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
 				    max_dims_in) < 0) ERR;
       if (dims_in[0] != 1 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
       if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
@@ -149,18 +149,18 @@ main()
       start[0] = 1;
       start[1] = 0;
       start[2] = 0;
-      if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET, 
+      if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET,
 			      start, NULL, count, NULL) < 0) ERR;
 
       /* Write second record of data to each dataset. */
-      if (H5Dwrite(pres_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid, 
+      if (H5Dwrite(pres_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
 		   H5P_DEFAULT, float_data_out) < 0) ERR;
-      if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid, 
+      if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
 		   H5P_DEFAULT, float_data_out) < 0) ERR;
-      
+
       /* Get the spaceid and check various things. */
       if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
-      if (H5Sget_simple_extent_dims(spaceid_in, dims_in, 
+      if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
 				    max_dims_in) < 0) ERR;
       if (dims_in[0] != 2 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
       if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
@@ -171,13 +171,13 @@ main()
 	  H5Sclose(spaceid) < 0 ||
 	  H5Gclose(grpid) < 0 ||
 	  H5Fclose(fileid) < 0) ERR;
-      
+
    }
 
    SUMMARIZE_ERR;
    printf("*** Checking HDF5 deflate filter setting and getting...");
 #define DEFLATE_LEVEL 9
-#define MAX_NAME 100   
+#define MAX_NAME 100
 #define NUM_CD_ELEM 10
 /* HDF5 defines this... */
 #define DEFLATE_NAME "deflate"
@@ -189,13 +189,13 @@ main()
       size_t cd_nelems = NUM_CD_ELEM;
       size_t namelen = MAX_NAME;
       char name[MAX_NAME + 1];
-      
+
 
       /* Open file and create group. */
-      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, 
+      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
 			      H5P_DEFAULT)) < 0) ERR;
       if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-      
+
       /* Write an array of bools, with compression. */
       dims[0] = DIM1_LEN;
       if ((propid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
@@ -203,9 +203,9 @@ main()
       if (H5Pset_chunk(propid, 1, dims)) ERR;
       if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
       if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
-      if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL, 
+      if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
 				 spaceid, propid)) < 0) ERR;
-      if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   bool_out) < 0) ERR;
       if (H5Dclose(datasetid) < 0 ||
 	  H5Pclose(propid) < 0 ||
@@ -224,11 +224,11 @@ main()
        * found in H5Zpublic.h. */
       if ((num_filters = H5Pget_nfilters(propid)) < 0) ERR;
       if (num_filters != 1) ERR;
-      if ((filter = H5Pget_filter2(propid, 0, &flags, &cd_nelems, cd_values, 
+      if ((filter = H5Pget_filter2(propid, 0, &flags, &cd_nelems, cd_values,
 				  namelen, name, &filter_config)) < 0) ERR;
       if (filter != H5Z_FILTER_DEFLATE || cd_nelems != 1 ||
 	  cd_values[0] != DEFLATE_LEVEL || strcmp(name, DEFLATE_NAME)) ERR;
-	  
+
       if (H5Dclose(datasetid) < 0 ||
 	  H5Pclose(propid) < 0 ||
 	  H5Gclose(grpid) < 0 ||
@@ -250,10 +250,10 @@ main()
       int f;
 
       /* Open file and create group. */
-      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, 
+      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
 			      H5P_DEFAULT)) < 0) ERR;
       if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-      
+
       /* Write an array of bools, with compression, fletcher32
        * checksum, shuffle filters. Like a hoogie with "the works." */
       dims[0] = DIM1_LEN;
@@ -264,9 +264,9 @@ main()
       if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
       if (H5Pset_fletcher32(propid)) ERR;
       if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
-      if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL, 
+      if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
 				 spaceid, propid)) < 0) ERR;
-      if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   bool_out) < 0) ERR;
       if (H5Dclose(datasetid) < 0 ||
 	  H5Pclose(propid) < 0 ||
@@ -287,7 +287,7 @@ main()
       if (num_filters != 3) ERR;
       for (f = 0; f < num_filters; f++)
       {
-	 if ((filter = H5Pget_filter2(propid, f, &flags, &cd_nelems, cd_values, 
+	 if ((filter = H5Pget_filter2(propid, f, &flags, &cd_nelems, cd_values,
 				      namelen, name, &filter_config)) < 0) ERR;
 	 switch (filter)
 	 {
@@ -299,7 +299,7 @@ main()
 	       break;
 	    case H5Z_FILTER_DEFLATE:
 	       found_deflate++;
-	       if (cd_nelems != 1 || cd_values[0] != DEFLATE_LEVEL || 
+	       if (cd_nelems != 1 || cd_values[0] != DEFLATE_LEVEL ||
 		   strcmp(name, DEFLATE_NAME)) ERR;
 	       break;
 	    default:
@@ -307,7 +307,7 @@ main()
 	 }
       }
       if (!found_fletcher32 || !found_deflate || !found_shuffle) ERR;
-	  
+
       if (H5Dclose(datasetid) < 0 ||
 	  H5Pclose(propid) < 0 ||
 	  H5Gclose(grpid) < 0 ||
@@ -333,24 +333,24 @@ main()
 	 data[i] = i;
 
       /* Open file and create group. */
-      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, 
+      if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
 			      H5P_DEFAULT)) < 0) ERR;
       if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-      
+
       /* Create a dataset of native endian. */
       dims[0] = DIM1_LEN;
       if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
-      if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT, 
+      if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT,
 				  spaceid, H5P_DEFAULT)) < 0) ERR;
-      if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_STD_I32LE, 
+      if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_STD_I32LE,
 			      spaceid, H5P_DEFAULT)) < 0) ERR;
-      if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_STD_I32BE, 
+      if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_STD_I32BE,
 			      spaceid, H5P_DEFAULT)) < 0) ERR;
-      if (H5Dwrite(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dwrite(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data) < 0) ERR;
-      if (H5Dwrite(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dwrite(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data) < 0) ERR;
-      if (H5Dwrite(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dwrite(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data) < 0) ERR;
       if (H5Dclose(native_did) < 0 ||
 	  H5Dclose(le_did) < 0 ||
@@ -371,7 +371,7 @@ main()
       if ((equal = H5Tequal(typeid, native_typeid)) < 0) ERR;
       if (!equal) ERR;
 
-      if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data_in) < 0) ERR;
       for (i = 0; i < DIM1_LEN; i++)
 	 if (data[i] != data_in[i]) ERR;
@@ -381,7 +381,7 @@ main()
       if ((order = H5Tget_order(typeid)) < 0) ERR;
       if (order != H5T_ORDER_LE) ERR;
 
-      if (H5Dread(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dread(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data_in) < 0) ERR;
       for (i = 0; i < DIM1_LEN; i++)
 	 if (data[i] != data_in[i]) ERR;
@@ -391,7 +391,7 @@ main()
       if ((order = H5Tget_order(typeid)) < 0) ERR;
       if (order != H5T_ORDER_BE) ERR;
 
-      if (H5Dread(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, 
+      if (H5Dread(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
 		   data_in) < 0) ERR;
       for (i = 0; i < DIM1_LEN; i++)
 	 if (data[i] != data_in[i]) ERR;
diff --git a/include/Makefile.am b/include/Makefile.am
index 186aed8..f4fb08e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -10,6 +10,10 @@ if BUILD_PARALLEL
 include_HEADERS += netcdf_par.h
 endif
 
+if BUILD_DISKLESS
+include_HEADERS += netcdf_mem.h
+endif
+
 noinst_HEADERS = nc_logging.h nc_tests.h fbits.h nc.h	\
 nclist.h ncuri.h utf8proc.h ncdispatch.h ncdimscale.h		\
 netcdf_f.h err_macros.h ncbytes.h nchashmap.h ceconstraints.h rnd.h	\
diff --git a/include/Makefile.in b/include/Makefile.in
index 52adeae..3d805d3 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 # directory.
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,11 +95,9 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 @BUILD_PARALLEL_TRUE at am__append_1 = netcdf_par.h
- at USE_NETCDF4_TRUE@am__append_2 = ncaux.h
+ at BUILD_DISKLESS_TRUE@am__append_2 = netcdf_mem.h
+ at USE_NETCDF4_TRUE@am__append_3 = ncaux.h
 subdir = include
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(srcdir)/netcdf_meta.h.in $(am__include_HEADERS_DIST) \
-	$(am__noinst_HEADERS_DIST)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -97,6 +105,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \
+	$(am__noinst_HEADERS_DIST) $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = netcdf_meta.h
@@ -120,7 +130,8 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__include_HEADERS_DIST = netcdf.h netcdf_meta.h netcdf_par.h
+am__include_HEADERS_DIST = netcdf.h netcdf_meta.h netcdf_par.h \
+	netcdf_mem.h
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -174,6 +185,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/netcdf_meta.h.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -222,6 +234,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -237,10 +250,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -275,8 +290,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -337,12 +354,13 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-include_HEADERS = netcdf.h netcdf_meta.h $(am__append_1)
+include_HEADERS = netcdf.h netcdf_meta.h $(am__append_1) \
+	$(am__append_2)
 noinst_HEADERS = nc_logging.h nc_tests.h fbits.h nc.h nclist.h ncuri.h \
 	utf8proc.h ncdispatch.h ncdimscale.h netcdf_f.h err_macros.h \
 	ncbytes.h nchashmap.h ceconstraints.h rnd.h nclog.h \
 	ncconfigure.h nc4internal.h nctime.h nc3dispatch.h \
-	nc3internal.h onstack.h $(am__append_2)
+	nc3internal.h onstack.h $(am__append_3)
 EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in
 all: all-am
 
@@ -359,7 +377,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign include/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -608,6 +625,8 @@ uninstall-am: uninstall-includeHEADERS
 	ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-includeHEADERS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/include/ncdispatch.h b/include/ncdispatch.h
index 1556474..a42ad4e 100644
--- a/include/ncdispatch.h
+++ b/include/ncdispatch.h
@@ -101,6 +101,11 @@ typedef struct NC_MPI_INFO {
     MPI_Info info;
 } NC_MPI_INFO;
 
+typedef struct NC_MEM_INFO {
+    size_t size;
+    void* memory;
+} NC_MEM_INFO;
+
 /* Define known dispatch tables and initializers */
 
 /*Forward*/
@@ -164,11 +169,11 @@ struct NC;
 
 int NC_create(const char *path, int cmode,
 	      size_t initialsz, int basepe, size_t *chunksizehintp, 
-	      int useparallel,void* mpi_info,
+	      int useparallel, void* parameters,
 	      int *ncidp);
 int NC_open(const char *path, int cmode,
 	    int basepe, size_t *chunksizehintp,
-	    int useparallel, void* mpi_info,
+	    int useparallel, void* parameters,
 	    int *ncidp);
 
 /* Expose the default vars and varm dispatch entries */
@@ -253,7 +258,8 @@ int (*inq_var_all)(int ncid, int varid, char *name, nc_type *xtypep,
 int (*var_par_access)(int, int, int);
 
 /* Note the following may still be invoked by netcdf client code
-   even when the file is a classic file
+   even when the file is a classic file; they will just return an error or
+   be ignored.
 */
 #ifdef USE_NETCDF4
 int (*show_metadata)(int);
@@ -294,6 +300,7 @@ int (*def_var_endian)(int, int, int);
 int (*set_var_chunk_cache)(int, int, size_t, size_t, float);
 int (*get_var_chunk_cache)(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp);
 #endif /*USE_NETCDF4*/
+
 };
 
 /* Following functions must be handled as non-dispatch */
@@ -349,6 +356,7 @@ extern const char* NCDAP_urllookup(void* dapurl, const char* param);
 #  define MSC_NCDISPATCH_EXTRA __declspec(dllimport)
 # endif
 MSC_NCDISPATCH_EXTRA extern char* NC_findtestserver(const char*, const char**);
+MSC_NCDISPATCH_EXTRA extern int nc_open_mem(const char*, int, size_t, void*, int*);
 #else
 extern char* NC_findtestserver(const char*,const char**);
 #endif
@@ -360,6 +368,7 @@ extern int NCDAP_ping(const char*);
 
 extern int NC_getshape(int ncid, int varid, int ndims, size_t* shape);
 extern int NC_is_recvar(int ncid, int varid, size_t* nrecs);
+extern int NC_inq_recvar(int ncid, int varid, int* nrecdims, int* is_recdim);
 
 #define nullstring(s) (s==NULL?"(null)":s)
 
diff --git a/include/netcdf.h b/include/netcdf.h
index c9ca0af..c17168e 100644
--- a/include/netcdf.h
+++ b/include/netcdf.h
@@ -120,18 +120,21 @@ extern "C" {
 #define NC_NOFILL	0x100	/**< Argument to nc_set_fill() to turn off filling of data. */
 
 /* Define the ioflags bits for nc_create and nc_open.
-   currently unused: 0x0010,0x0020,0x0040,0x0080
+   currently unused:
+        0x0002
+	0x0040
+	0x0080
    and the whole upper 16 bits
 */
 
 #define NC_NOWRITE	 0x0000	/**< Set read-only access for nc_open(). */
 #define NC_WRITE    	 0x0001	/**< Set read-write access for nc_open(). */
-/* unused: 0x0002 */
 #define NC_CLOBBER	 0x0000 /**< Destroy existing file. Mode flag for nc_create(). */
 #define NC_NOCLOBBER     0x0004	/**< Don't destroy existing file. Mode flag for nc_create(). */
 
 #define NC_DISKLESS      0x0008  /**< Use diskless file. Mode flag for nc_open() or nc_create(). */
 #define NC_MMAP          0x0010  /**< Use diskless file with mmap. Mode flag for nc_open() or nc_create(). */
+#define NC_INMEMORY      0x0020  /**< Read from memory. Mode flag for nc_open() or nc_create(). */
 
 #define NC_CLASSIC_MODEL 0x0100 /**< Enforce classic model. Mode flag for nc_create(). */
 #define NC_64BIT_OFFSET  0x0200  /**< Use large (64-bit) file offsets. Mode flag for nc_create(). */
diff --git a/include/netcdf_mem.h b/include/netcdf_mem.h
new file mode 100644
index 0000000..3959a98
--- /dev/null
+++ b/include/netcdf_mem.h
@@ -0,0 +1,82 @@
+/* \file netcdf_mem.h
+ * Copyright 2010 University Corporation for Atmospheric
+ * Research/Unidata. See COPYRIGHT file for more info.
+ *
+ * See \ref copyright file for more info.
+ *
+ */
+
+#ifndef NETCDF_MEM_H
+#define NETCDF_MEM_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#if defined(DLL_NETCDF) /* define when library is a DLL */
+#  if defined(DLL_EXPORT) /* define when building the library */
+#   define MSC_EXTRA __declspec(dllexport)
+#  else
+#   define MSC_EXTRA __declspec(dllimport)
+#  endif
+#include <io.h>
+#else
+#define MSC_EXTRA
+#endif	/* defined(DLL_NETCDF) */
+
+# define EXTERNL MSC_EXTRA extern
+
+/**
+Open a netCDF file with the contents taken from a block of memory.
+
+\param path Must be non-null, but otherwise only used to set the dataset name.
+
+\param mode the mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_NOWRITE|NC_DISKLESS|NC_INMEMORY.
+
+\param size The length of the block of memory being passed.
+
+\param memory Pointer to the block of memory containing the contents
+of a netcdf file.
+
+\param ncidp Pointer to location where returned netCDF ID is to be
+stored.
+
+\returns ::NC_NOERR No error.
+
+\returns ::NC_ENOMEM Out of memory.
+
+\returns ::NC_EDISKLESS diskless io is not enabled for fails.
+
+\returns ::NC_EINVAL, etc. other errors also returned by nc_open.
+
+<h1>Examples</h1>
+
+Here is an example using nc_open_mem() to open an existing netCDF dataset
+named foo.nc for read-only, non-shared access. It differs from the nc_open()
+example in that it assumes the contents of foo.nc have been read into memory.
+
+ at code
+#include <netcdf.h>
+#include <netcdf_mem.h>
+   ...
+int status = NC_NOERR;
+int ncid;
+size_t size;
+void* memory;
+   ...
+size = <compute file size of foo.nc in bytes>;
+memory = malloc(size);
+   ...
+status = nc_open_mem("foo.nc", 0, size, memory, &ncid);
+if (status != NC_NOERR) handle_error(status);
+ at endcode
+*/
+EXTERNL int
+nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* NETCDF_MEM_H */
diff --git a/install-sh b/install-sh
index 377bb86..0b0fdcb 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2013-12-25.23; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='	'
 nl='
 '
-IFS=" ""	$nl"
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
 dst_arg=
 
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
     -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-	shift;;
+        shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
     -o) chowncmd="$chownprog $2"
-	shift;;
+        shift;;
 
     -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)
+        is_target_a_directory=always
+        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;;
+    -T) is_target_a_directory=never;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)	shift
-	break;;
+    --) shift
+        break;;
 
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
     *)  break;;
   esac
   shift
 done
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
 fi
 
 if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
 
     *[0-7])
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -269,41 +274,15 @@ do
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       dstdir=$dst
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
@@ -314,74 +293,74 @@ do
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      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-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
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              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-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
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
     esac
 
     if
       $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -391,53 +370,51 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
 
-      eval "$initialize_posix_glob"
-
       oIFS=$IFS
       IFS=/
-      $posix_glob set -f
+      set -f
       set fnord $dstdir
       shift
-      $posix_glob set +f
+      set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -472,15 +449,12 @@ do
 
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
+       set +f &&
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
@@ -493,24 +467,24 @@ do
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
       }
     fi || exit 1
 
diff --git a/libdap2/Makefile.in b/libdap2/Makefile.in
index 2edccca..944d0d3 100644
--- a/libdap2/Makefile.in
+++ b/libdap2/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -92,8 +102,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -110,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -200,6 +209,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -249,6 +260,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -264,10 +276,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -302,8 +316,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -418,7 +434,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdap2/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign libdap2/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -427,7 +442,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -831,6 +846,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 makece::
 	bison -v -d -t -p dce dce.y
diff --git a/libdap2/dapcvt.c b/libdap2/dapcvt.c
index 59f0b66..394f30c 100644
--- a/libdap2/dapcvt.c
+++ b/libdap2/dapcvt.c
@@ -5,6 +5,10 @@
 #include "config.h"
 #include "ncdap.h"
 
+#ifdef _MSC_VER
+#include <crtdbg.h>
+#endif
+
 NCerror
 dapconvert(nc_type srctype, nc_type dsttype, char* memory0, char* value0, size_t count)
 {
@@ -199,12 +203,21 @@ dapcvtattrval(nc_type etype, void* dst, NClist* src)
     char* dstmem = (char*)dst;
 
     for(i=0;i<nvalues;i++) {
+
 	char* s = (char*)nclistget(src,i);
+
 	ok = 0;
 	switch (etype) {
 	case NC_BYTE: {
-	    unsigned char* p = (unsigned char*)dstmem;
-	    ok = sscanf(s,"%hhu",p);
+		char tmp[128];
+		
+		unsigned char* p = (unsigned char*)dstmem;
+#ifdef _MSC_VER
+		ok = sscanf(s,"%hC",p);
+		_ASSERTE(_CrtCheckMemory());
+#else	
+		ok = sscanf(s,"%hhu",p);
+#endif
 	    } break;
 	case NC_CHAR: {
 	    signed char* p = (signed char*)dstmem;
@@ -228,8 +241,13 @@ dapcvtattrval(nc_type etype, void* dst, NClist* src)
 	    } break;
 	case NC_UBYTE: {
 	    unsigned char* p = (unsigned char*)dstmem;
+#ifdef _MSC_VER
+		ok = sscanf(s, "%hc", p);
+		_ASSERTE(_CrtCheckMemory());
+#else
 	    ok = sscanf(s,"%hhu",p);
-	    } break;
+#endif
+		} break;
 	case NC_USHORT: {
 	    unsigned short* p = (unsigned short*)dstmem;
 	    ok = sscanf(s,"%hu",p);
@@ -240,8 +258,12 @@ dapcvtattrval(nc_type etype, void* dst, NClist* src)
 	    } break;
 	case NC_INT64: {
 	    long long* p = (long long*)dstmem;
-	    ok = sscanf(s,"%lld",p);
-	    } break;
+#ifdef _MSC_VER
+		ok = sscanf(s, "%I64d", p);
+#else
+		ok = sscanf(s,"%lld",p);
+#endif
+	} break;
 	case NC_UINT64: {
 	    unsigned long long* p = (unsigned long long*)dstmem;
 	    ok = sscanf(s,"%llu",p);
diff --git a/libdap2/dapdebug.h b/libdap2/dapdebug.h
index e2fd32c..6fe4b05 100644
--- a/libdap2/dapdebug.h
+++ b/libdap2/dapdebug.h
@@ -72,4 +72,3 @@ extern int dapthrow(int err);
 #define LOG2(level,msg,a1,a2) nclog(level,msg,a1,a2)
 
 #endif /*DEBUG_H*/
-
diff --git a/libdap2/env b/libdap2/env
index b1aa564..fd751e0 100644
--- a/libdap2/env
+++ b/libdap2/env
@@ -1,12 +1,12 @@
-TOP="/home/dmh/git/netcdf-c"
-#TOP="/cygdrive/f/git/netcdf-c"
+#TOP="/home/dmh/git/netcdf-c"
+TOP="/cygdrive/f/git/netcdf-c"
 
 alias xx="cd ..;make; cd libdap2"
 
 PARMS=""; ARGS=""; CON="" ; CE="";  OCON="" ; VAR=""; SHARP='#'
 alias q0=;alias qq=;alias qv=;alias q=;alias  qh=;alias qqh=;alias qall=;alias qv=;alias qo=;
 
-F="file://${TOP}/ncdap_test/testdata3/test.02"
+F="file://${TOP}/ncdap_test/testdata3/synth9"
 
 if test -f ./ncd ; then
 PROG=./ncd
diff --git a/libdap2/ncd2dispatch.c b/libdap2/ncd2dispatch.c
index 9beefc5..4445eb6 100644
--- a/libdap2/ncd2dispatch.c
+++ b/libdap2/ncd2dispatch.c
@@ -7,6 +7,12 @@
 #include "ncd2dispatch.h"
 #include "dapalign.h"
 
+#ifdef _MSC_VER
+#include <crtdbg.h>
+#endif
+
+#define NCRCFILE "NCRCFILE"
+
 #ifdef HAVE_GETRLIMIT
 #  ifdef HAVE_SYS_RESOURCE_H
 #    include <sys/time.h>
@@ -203,6 +209,12 @@ NCD2_initialize(void)
     if(nclogopen(NULL))
         ncsetlogging(1); /* turn it on */
 #endif
+    /* Look at env vars for rc file location */
+    if(getenv(NCRCFILE) != NULL) {
+	const char* ncrcfile = getenv(NCRCFILE);
+	if(oc_set_rcfile(ncrcfile) != OC_NOERR)
+	    return NC_EAUTH;
+    }
     return NC_NOERR;
 }
 
@@ -927,12 +939,23 @@ buildattribute(NCDAPCOMMON* dapcomm, NCattribute* att, nc_type vartype, int vari
 	else
 	    atype = nctypeconvert(dapcomm,att->etype);
 	typesize = nctypesizeof(atype);
-    if(nvalues > 0)
-      mem = malloc(typesize * nvalues);
+	if (nvalues > 0) {
+		mem = malloc(typesize * nvalues);
+#ifdef _MSC_VER
+		_ASSERTE(_CrtCheckMemory());
+#endif
+	}
     ncstat = dapcvtattrval(atype,mem,att->values);
+#ifdef _MSC_VER
+	_ASSERTE(_CrtCheckMemory());
+#endif
     ncstat = nc_put_att(drno->substrate,varid,att->name,atype,nvalues,mem);
-	nullfree(mem);
-    }
+#ifdef _MSC_VER
+	_ASSERTE(_CrtCheckMemory());
+#endif
+	if (mem != NULL)
+		free(mem);
+	}
     return THROW(ncstat);
 }
 
diff --git a/libdispatch/Makefile.in b/libdispatch/Makefile.in
index 3bfc302..fc60515 100644
--- a/libdispatch/Makefile.in
+++ b/libdispatch/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -95,8 +105,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -120,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -224,6 +233,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -272,6 +283,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -287,10 +299,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -325,8 +339,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -419,7 +435,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdispatch/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign libdispatch/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -428,7 +443,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -960,6 +975,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Build ncsettings.c as follows:
 # 1. copy ncsettings.hdr to ncsettings.c
diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c
index a0b2c8b..001bff0 100644
--- a/libdispatch/dfile.c
+++ b/libdispatch/dfile.c
@@ -78,77 +78,9 @@ nc_local_initialize(void)
 }
 
 static int
-NC_check_file_type(const char *path, int use_parallel, void *mpi_info,
-		   int* model, int* version)
+NC_interpret_magic_number(char* magic, int* model, int* version, int use_parallel)
 {
-   char magic[MAGIC_NUMBER_LEN];
-   int status = NC_NOERR;
-    
-   *model = 0;
-
-   /* Get the 4-byte magic from the beginning of the file. Don't use posix
-    * for parallel, use the MPI functions instead. */
-#ifdef USE_PARALLEL
-   if (use_parallel) 
-   {
-      MPI_File fh;
-      MPI_Status mstatus;
-      int retval;
-      MPI_Comm comm = MPI_COMM_WORLD;
-      MPI_Info info = MPI_INFO_NULL;
-
-      if(mpi_info != NULL) {
-	 comm = ((NC_MPI_INFO*)mpi_info)->comm;
-	 info = ((NC_MPI_INFO*)mpi_info)->info;
-      }
-      if((retval = MPI_File_open(comm, (char *)path, MPI_MODE_RDONLY,info, 
-				 &fh)) != MPI_SUCCESS)
-	 {status = NC_EPARINIT; goto done;}
-      if((retval = MPI_File_read(fh, magic, MAGIC_NUMBER_LEN, MPI_CHAR,
-				 &mstatus)) != MPI_SUCCESS)
-	 {status = NC_EPARINIT; goto done;}
-      if((retval = MPI_File_close(&fh)) != MPI_SUCCESS)
-	 {status = NC_EPARINIT; goto done;}
-   } else
-#endif /* USE_PARALLEL */
-   {
-      FILE *fp;
-      size_t i;
-#ifdef HAVE_SYS_STAT_H
-      struct stat st;
-#endif
-
-      if(path == NULL || strlen(path)==0)
-	 {status = NC_EINVAL; goto done;}
-	
-      if (!(fp = fopen(path, "r")))
-	 {status = errno; goto done;}
-
-#ifdef HAVE_SYS_STAT_H
-      /* The file must be at least MAGIC_NUMBER_LEN in size,
-         or otherwise the following fread will exhibit unexpected
-         behavior. */
-      if(!(fstat(fileno(fp),&st) == 0)) {
-	fclose(fp);
-	status = errno;
-        goto done;
-      }
-      
-      if(st.st_size < MAGIC_NUMBER_LEN) {
-	fclose(fp);
-	status = NC_ENOTNC;
-        goto done;
-      }
-#endif
-
-      i = fread(magic, MAGIC_NUMBER_LEN, 1, fp);
-      fclose(fp);
-      if(i == 0) 
-	{status = NC_ENOTNC; goto done;}
-      if(i != 1) 
-	{status = errno; goto done;}
-    }
-    
+    int status = NC_NOERR;
     /* Look at the magic number */
     /* Ignore the first byte for HDF */
 #ifdef USE_NETCDF4
@@ -177,6 +109,93 @@ NC_check_file_type(const char *path, int use_parallel, void *mpi_info,
 	 *model = (use_parallel || *version == 5)?NC_DISPATCH_NC5:NC_DISPATCH_NC3;
      } else
         {status = NC_ENOTNC; goto done;}
+done:
+     return status;
+}
+
+static int
+NC_check_file_type(const char *path, int flags, void *parameters,
+		   int* model, int* version)
+{
+   char magic[MAGIC_NUMBER_LEN];
+   int status = NC_NOERR;
+   int diskless = ((flags & NC_DISKLESS) == NC_DISKLESS);
+   int persist = ((flags & NC_WRITE) == NC_WRITE);
+   int use_parallel = ((flags & NC_MPIIO) == NC_MPIIO);
+   int inmemory = (diskless && ((flags & NC_INMEMORY) == NC_INMEMORY));
+    
+   *model = 0;
+
+    if(inmemory)  {
+	NC_MEM_INFO* meminfo = (NC_MEM_INFO*)parameters;
+	if(meminfo == NULL || meminfo->size < MAGIC_NUMBER_LEN)
+	    {status = NC_EDISKLESS; goto done;}
+	memcpy(magic,meminfo->memory,MAGIC_NUMBER_LEN);
+    } else {/* presumably a real file */
+       /* Get the 4-byte magic from the beginning of the file. Don't use posix
+        * for parallel, use the MPI functions instead. */
+#ifdef USE_PARALLEL
+	if (use_parallel) {
+	    MPI_File fh;
+	    MPI_Status mstatus;
+	    int retval;
+	    MPI_Comm comm = MPI_COMM_WORLD;
+	    MPI_Info info = MPI_INFO_NULL;
+	
+	    if(parameters != NULL) {
+	        comm = ((NC_MPI_INFO*)parameters)->comm;
+		info = ((NC_MPI_INFO*)parameters)->info;
+	    }
+	    if((retval = MPI_File_open(comm,(char*)path,MPI_MODE_RDONLY,info,
+				       &fh)) != MPI_SUCCESS)
+		{status = NC_EPARINIT; goto done;}
+	    if((retval = MPI_File_read(fh, magic, MAGIC_NUMBER_LEN, MPI_CHAR,
+				 &mstatus)) != MPI_SUCCESS)
+		{status = NC_EPARINIT; goto done;}
+	    if((retval = MPI_File_close(&fh)) != MPI_SUCCESS)
+		{status = NC_EPARINIT; goto done;}
+	} else
+#endif /* USE_PARALLEL */
+	{
+	    FILE *fp;
+	    size_t i;
+#ifdef HAVE_SYS_STAT_H
+	    struct stat st;
+#endif
+	    if(path == NULL || strlen(path)==0)
+		{status = NC_EINVAL; goto done;}
+	    
+	    if (!(fp = fopen(path, "r")))
+		{status = errno; goto done;}
+
+#ifdef HAVE_SYS_STAT_H
+	    /* The file must be at least MAGIC_NUMBER_LEN in size,
+	       or otherwise the following fread will exhibit unexpected
+  	       behavior. */
+	    if(!(fstat(fileno(fp),&st) == 0)) {
+	        fclose(fp);
+	        status = errno;
+	        goto done;
+	    }
+	    
+	    if(st.st_size < MAGIC_NUMBER_LEN) {
+		fclose(fp);
+		status = NC_ENOTNC;
+		goto done;
+	    }
+#endif
+
+	    i = fread(magic, MAGIC_NUMBER_LEN, 1, fp);
+	    fclose(fp);
+	    if(i == 0) 
+		{status = NC_ENOTNC; goto done;}
+	    if(i != 1) 
+		{status = errno; goto done;}
+	}
+    } /* !inmemory */
+    
+    /* Look at the magic number */
+    status = NC_interpret_magic_number(magic,model,version,use_parallel);
 
 done:
    return status;
@@ -648,6 +667,71 @@ nc__open(const char *path, int mode,
 		  NULL, ncidp);
 }
 
+/** 
+Open a netCDF file with the contents taken from a block of memory.
+
+\param path Must be non-null, but otherwise only used to set the dataset name.
+
+\param mode the mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_NOWRITE|NC_DISKLESS|NC_INMEMORY.
+
+\param size The length of the block of memory being passed.
+ 
+\param memory Pointer to the block of memory containing the contents
+of a netcdf file.
+
+\param ncidp Pointer to location where returned netCDF ID is to be
+stored.
+
+\returns ::NC_NOERR No error.
+
+\returns ::NC_ENOMEM Out of memory.
+
+\returns ::NC_EDISKLESS diskless io is not enabled for fails.
+
+\returns ::NC_EINVAL, etc. other errors also returned by nc_open.
+
+<h1>Examples</h1>
+
+Here is an example using nc_open_mem() to open an existing netCDF dataset
+named foo.nc for read-only, non-shared access. It differs from the nc_open()
+example in that it assumes the contents of foo.nc have been read into memory.
+
+ at code
+#include <netcdf.h>
+#include <netcdf_mem.h>
+   ... 
+int status = NC_NOERR;
+int ncid;
+size_t size;
+void* memory;
+   ... 
+size = <compute file size of foo.nc in bytes>;
+memory = malloc(size);
+   ... 
+status = nc_open_mem("foo.nc", 0, size, memory, &ncid);
+if (status != NC_NOERR) handle_error(status);
+ at endcode
+*/
+int
+nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp)
+{
+#ifdef USE_DISKLESS
+    NC_MEM_INFO meminfo;
+
+    /* Sanity checks */
+    if(memory == NULL || size < MAGIC_NUMBER_LEN || path == NULL)
+ 	return NC_EINVAL;
+    if(mode & (NC_WRITE|NC_MPIIO|NC_MPIPOSIX|NC_MMAP))
+	return NC_EINVAL;
+    mode |= (NC_INMEMORY|NC_DISKLESS);
+    meminfo.size = size;
+    meminfo.memory = memory;
+    return NC_open(path, mode, 0, NULL, 0, &meminfo, ncidp);
+#else
+    return NC_EDISKLESS;     
+#endif
+}
+
 /**
 \internal
 
@@ -1489,7 +1573,7 @@ applies to classic and 64-bit offset files.
 \param useparallel Non-zero if parallel I/O is to be used on this
 file.
 
-\param mpi_info Pointer to MPI comm and info.
+\param parameters Pointer to MPI comm and info.
 
 \param ncidp Pointer to location where returned netCDF ID is to be
 stored.
@@ -1499,7 +1583,7 @@ stored.
 int
 NC_create(const char *path, int cmode, size_t initialsz, 
 	  int basepe, size_t *chunksizehintp, int useparallel, 
-	  void* mpi_info, int *ncidp)
+	  void* parameters, int *ncidp)
 {
    int stat = NC_NOERR;
    NC* ncp = NULL;
@@ -1623,7 +1707,7 @@ NC_create(const char *path, int cmode, size_t initialsz,
 
    /* Assume create will fill in remaining ncp fields */
    if ((stat = dispatcher->create(path, cmode, initialsz, basepe, chunksizehintp,
-				   useparallel, mpi_info, dispatcher, ncp))) {
+				   useparallel, parameters, dispatcher, ncp))) {
 	del_from_NCList(ncp); /* oh well */
 	free_NC(ncp);
      } else {
@@ -1650,16 +1734,18 @@ For open, we have the following pieces of information to use to determine the di
 int
 NC_open(const char *path, int cmode,
 	int basepe, size_t *chunksizehintp,
-        int useparallel, void* mpi_info,
+        int useparallel, void* parameters,
         int *ncidp)
 {
    int stat = NC_NOERR;
    NC* ncp = NULL;
    NC_Dispatch* dispatcher = NULL;
-   /* Need two pieces of information for now */
+   int inmemory = ((cmode & NC_INMEMORY) == NC_INMEMORY);
+   /* Need pieces of information for now to decide model*/
    int model = 0;
    int isurl = 0; 
    int version = 0;
+   int flags = 0;
 
    if(!nc_initialized) {
       stat = NC_initialize();
@@ -1679,36 +1765,28 @@ NC_open(const char *path, int cmode,
    }
 #endif
 
-   isurl = NC_testurl(path);
-   if(isurl)
-      model = NC_urlmodel(path);
-   else {
-      version = 0;
-      model = 0;
-      /* Look at the file if it exists */
-      stat = NC_check_file_type(path,useparallel,mpi_info,
-				&model,&version);
-      if(stat == NC_NOERR) {
-	if(model == 0)
+   if(!inmemory) {
+       isurl = NC_testurl(path);
+       if(isurl)
+           model = NC_urlmodel(path);
+    }
+    if(model == 0) {
+	version = 0;
+	/* Try to find dataset type */
+	if(useparallel) flags |= NC_MPIIO;
+	if(inmemory) flags |= NC_INMEMORY;
+	stat = NC_check_file_type(path,flags,parameters,&model,&version);
+        if(stat == NC_NOERR) {
+   	if(model == 0)
 	    return NC_ENOTNC;
-      } else /* presumably not a netcdf file */
-	return stat;
-   }
+	} else /* presumably not a netcdf file */
+	    return stat;
+    }
 
-#if 1
    if(model == 0) {
-	fprintf(stderr,"Model != 0\n");
+	fprintf(stderr,"Model == 0\n");
 	return NC_ENOTNC;
    }
-#else
-Not longer needed
-   /* Look to the incoming cmode for hints */
-   if(model == 0) {
-      if(cmode & NC_PNETCDF) model = NC_DISPATCH_NC5;
-      else if(cmode & NC_NETCDF4) model = NC_DISPATCH_NC4;
-    }
-   if(model == 0) model = NC_DISPATCH_NC3; /* final default */
-#endif
 
    /* Force flag consistentcy */
    if(model & NC_DISPATCH_NC4)
@@ -1775,7 +1853,7 @@ havetable:
 
    /* Assume open will fill in remaining ncp fields */
    stat = dispatcher->open(path, cmode, basepe, chunksizehintp,
-			   useparallel, mpi_info, dispatcher, ncp);
+			   useparallel, parameters, dispatcher, ncp);
    if(stat == NC_NOERR) {
      if(ncidp) *ncidp = ncp->ext_ncid;
    } else {
@@ -1811,7 +1889,6 @@ nc__pseudofd(void)
 	pseudofd = maxfd+1;
 #endif
     }
-
     return pseudofd++;
 }
 
diff --git a/libdispatch/dgroup.c b/libdispatch/dgroup.c
index c93b854..5952bb9 100644
--- a/libdispatch/dgroup.c
+++ b/libdispatch/dgroup.c
@@ -42,6 +42,9 @@ files in one program context is limited to 32767.
  */
 /** \{ */
 
+/*!
+
+ */
 int nc_inq_ncid(int ncid, const char *name, int *grp_ncid)
 {
     NC* ncp;
diff --git a/libdispatch/dvar.c b/libdispatch/dvar.c
index a36832c..ec0d830 100644
--- a/libdispatch/dvar.c
+++ b/libdispatch/dvar.c
@@ -309,6 +309,70 @@ NC_is_recvar(int ncid, int varid, size_t* nrecs)
    return (dimset[0] == unlimid ? 1: 0);
 }
 
+/** \internal
+\ingroup variables
+Get the number of record dimensions for a variable and an array that
+identifies which of a variable's dimensions are record dimensions.
+Intended to be used instead of NC_is_recvar, which doesn't work for
+netCDF-4 variables which have multiple unlimited dimensions or an
+unlimited dimension that is not the first of a variable's dimensions.
+Example use:
+\code
+int nrecdims;
+int is_recdim[NC_MAX_VAR_DIMS];
+  ...
+status = NC_inq_recvar(ncid,varid,&nrecdims,is_recdim);
+isrecvar = (nrecdims > 0);
+\endcode
+ */
+int
+NC_inq_recvar(int ncid, int varid, int *nrecdims, int *is_recdim)
+{
+   int status = NC_NOERR;
+   int unlimid;
+   int nvardims;
+   int dimset[NC_MAX_VAR_DIMS];
+   int dim;
+    
+   *nrecdims = 0;
+   status = nc_inq_varndims(ncid,varid,&nvardims);
+   if(status != NC_NOERR) return status;
+   if(nvardims == 0) return NC_NOERR; /* scalars have no dims */
+   for(dim = 0; dim < nvardims; dim++)
+     is_recdim[dim] = 0;
+   status = nc_inq_unlimdim(ncid, &unlimid);
+   if(status != NC_NOERR) return status;
+   if(unlimid == -1) return status; /* no unlimited dims for any variables */
+#ifdef USE_NETCDF4
+   {
+     int nunlimdims;
+     int unlimids[NC_MAX_DIMS];
+     int recdim;
+     status = nc_inq_unlimdims(ncid, &nunlimdims, unlimids); /* for group or file, not variable */
+     if(status != NC_NOERR) return status;
+     if(nunlimdims == 0) return status;
+     status = nc_inq_vardimid(ncid, varid, dimset);
+     if(status != NC_NOERR) return status;
+     for (dim = 0; dim < nvardims; dim++) { /* netCDF-4 rec dims need not be first dim for a rec var */
+       for(recdim = 0; recdim < nunlimdims; recdim++) {
+	 if(dimset[dim] == unlimids[recdim]) {
+	   is_recdim[dim] = 1;
+	   *nrecdims += 1;
+	 }		
+       }
+     }
+   }
+#else
+   status = nc_inq_vardimid(ncid, varid, dimset);
+   if(status != NC_NOERR) return status;
+   if(dimset[0] == unlimid) {
+     is_recdim[0] = 1;
+     *nrecdims++;
+   }
+#endif /* USE_NETCDF4 */
+   return status;
+}
+
 /* Ok to use NC pointers because
    all IOSP's will use that structure,
    but not ok to use e.g. NC_Var pointers
diff --git a/libdispatch/dvarinq.c b/libdispatch/dvarinq.c
index b887602..781d8a4 100644
--- a/libdispatch/dvarinq.c
+++ b/libdispatch/dvarinq.c
@@ -12,7 +12,7 @@ Research/Unidata. See COPYRIGHT file for more info.
 Functions to learn about the variables in a file. */
 /*! \{ */ /* All these functions are part of this named group... */
 
-/** 
+/**
 \ingroup variables
 Find the ID of a variable, from the name.
 
@@ -20,7 +20,7 @@ The function nc_inq_varid returns the ID of a netCDF variable, given
 its name.
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param name Name of the variable.
@@ -57,12 +57,12 @@ nc_inq_varid(int ncid, const char *name, int *varidp)
    return ncp->dispatch->inq_varid(ncid, name, varidp);
 }
 
-/** 
+/**
 \ingroup variables
 Learn about a variable.
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -93,13 +93,13 @@ rh in an existing netCDF dataset named foo.nc:
 \code
      #include <netcdf.h>
         ...
-     int  status                     
-     int  ncid;                      
-     int  rh_id;                     
-     nc_type rh_type;                
-     int rh_ndims;                   
+     int  status
+     int  ncid;
+     int  rh_id;
+     nc_type rh_type;
+     int rh_ndims;
      int  rh_dimids[NC_MAX_VAR_DIMS];
-     int rh_natts 
+     int rh_natts
         ...
      status = nc_open ("foo.nc", NC_NOWRITE, &ncid);
      if (status != NC_NOERR) handle_error(status);
@@ -113,23 +113,23 @@ rh in an existing netCDF dataset named foo.nc:
 
  */
 int
-nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep,  
+nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep,
 	   int *ndimsp, int *dimidsp, int *nattsp)
 {
    NC* ncp;
    int stat = NC_check_id(ncid, &ncp);
    if(stat != NC_NOERR) return stat;
-   return ncp->dispatch->inq_var_all(ncid, varid, name, xtypep, ndimsp, 
-				     dimidsp, nattsp, NULL, NULL, NULL, 
+   return ncp->dispatch->inq_var_all(ncid, varid, name, xtypep, ndimsp,
+				     dimidsp, nattsp, NULL, NULL, NULL,
 				     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 }
 
-/** 
+/**
 \ingroup variables
 Learn the name of a variable.
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -142,7 +142,7 @@ NULL.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
  */
-int 
+int
 nc_inq_varname(int ncid, int varid, char *name)
 {
    return nc_inq_var(ncid, varid, name, NULL, NULL,
@@ -153,7 +153,7 @@ nc_inq_varname(int ncid, int varid, char *name)
 \ingroup variables
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -164,7 +164,7 @@ nc_inq_ncid().
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
  */
-int 
+int
 nc_inq_vartype(int ncid, int varid, nc_type *typep)
 {
    return nc_inq_var(ncid, varid, NULL, typep, NULL,
@@ -175,7 +175,7 @@ nc_inq_vartype(int ncid, int varid, nc_type *typep)
 \ingroup variables
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -187,7 +187,7 @@ stored. \ref ignored_if_null.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
  */
-int 
+int
 nc_inq_varndims(int ncid, int varid, int *ndimsp)
 {
    return nc_inq_var(ncid, varid, NULL, NULL, ndimsp, NULL, NULL);
@@ -197,7 +197,7 @@ nc_inq_varndims(int ncid, int varid, int *ndimsp)
 \ingroup variables
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -209,10 +209,10 @@ stored. \ref ignored_if_null.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
  */
-int 
+int
 nc_inq_vardimid(int ncid, int varid, int *dimidsp)
 {
-   return nc_inq_var(ncid, varid, NULL, NULL, NULL, 
+   return nc_inq_var(ncid, varid, NULL, NULL, NULL,
 		     dimidsp, NULL);
 }
 
@@ -220,7 +220,7 @@ nc_inq_vardimid(int ncid, int varid, int *dimidsp)
 \ingroup variables
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -232,13 +232,13 @@ stored. \ref ignored_if_null.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
  */
-int 
+int
 nc_inq_varnatts(int ncid, int varid, int *nattsp)
 {
    if (varid == NC_GLOBAL)
       return nc_inq_natts(ncid,nattsp);
    /*else*/
-   return nc_inq_var(ncid, varid, NULL, NULL, NULL, NULL, 
+   return nc_inq_var(ncid, varid, NULL, NULL, NULL, NULL,
 		     nattsp);
 }
 
@@ -249,7 +249,7 @@ Learn the storage and deflate settings for a variable.
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -265,12 +265,12 @@ variable, and a 0 otherwise. \ref ignored_if_null.
 variable, the deflate_level will be writen here. \ref ignored_if_null.
 
 \returns ::NC_NOERR No error.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file. 
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
 */
 int
-nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, 
+nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep,
 		   int *deflate_levelp)
 {
    NC* ncp;
@@ -308,7 +308,7 @@ files with szip compression.
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -321,7 +321,7 @@ here. \ref ignored_if_null.
 
 \returns ::NC_NOERR No error.
 \returns ::NC_EBADID Bad ncid.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file. 
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
 \returns ::NC_ENOTVAR Invalid variable ID.
 */
 int
@@ -352,12 +352,12 @@ nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
 }
 
 /** \ingroup variables
-Learn the checksum settings for a variable. 
+Learn the checksum settings for a variable.
 
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -368,7 +368,7 @@ it is not. \ref ignored_if_null.
 
 \returns ::NC_NOERR No error.
 \returns ::NC_EBADID Bad ncid.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file. 
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
 \returns ::NC_ENOTVAR Invalid variable ID.
 */
 int
@@ -403,7 +403,7 @@ nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -417,7 +417,7 @@ ignored_if_null.
 
 \returns ::NC_NOERR No error.
 \returns ::NC_EBADID Bad ncid.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file. 
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
 \returns ::NC_ENOTVAR Invalid variable ID.
 */
 int
@@ -426,8 +426,8 @@ nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
    NC *ncp;
    int stat = NC_check_id(ncid, &ncp);
    if(stat != NC_NOERR) return stat;
-   return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL, 
-				     NULL, NULL, NULL, NULL, NULL, storagep, 
+   return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL,
+				     NULL, NULL, NULL, NULL, NULL, storagep,
 				     chunksizesp, NULL, NULL, NULL, NULL, NULL);
 }
 
@@ -439,13 +439,13 @@ The fill mode of a variable is set by nc_def_var_fill().
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
 
 \param no_fill Pointer to an integer which will get a 1 if no_fill
-mode is set for this variable. \ref ignored_if_null. 
+mode is set for this variable. \ref ignored_if_null.
 
 \param fill_valuep A pointer which will get the fill value for this
 variable. \ref ignored_if_null.
@@ -487,7 +487,7 @@ Find the endianness of a variable.
 This is a wrapper for nc_inq_var_all().
 
 \param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as 
+nc_create(), nc_def_grp(), or associated inquiry functions such as
 nc_inq_ncid().
 
 \param varid Variable ID
@@ -498,7 +498,7 @@ stored in big-endian format, and ::NC_ENDIAN_NATIVE if the endianness
 is not set, and the variable is not created yet.
 
 \returns ::NC_NOERR No error.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file. 
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
 \returns ::NC_EBADID Bad ncid.
 \returns ::NC_ENOTVAR Invalid variable ID.
 */
@@ -529,34 +529,26 @@ nc_inq_var_endian(int ncid, int varid, int *endianp)
       );
 }
 
-/** Return number and list of unlimited dimensions.
+/*! Return number and list of unlimited dimensions.
 
 In netCDF-4 files, it's possible to have multiple unlimited
 dimensions. This function returns a list of the unlimited dimension
 ids visible in a group.
 
 Dimensions are visible in a group if they have been defined in that
-group, or any ancestor group. 
-
-ncid
-    NetCDF group ID, from a previous call to nc_open, nc_create, nc_def_grp, etc.
-nunlimdimsp
-    A pointer to an int which will get the number of visible unlimited dimensions. Ignored if NULL.
-unlimdimidsp
-    A pointer to an already allocated array of int which will get the ids of all visible unlimited dimensions. Ignored if NULL. To allocate the correct length for this array, call nc_inq_unlimdims with a NULL for this parameter and use the nunlimdimsp parameter to get the number of visible unlimited dimensions. 
-
-Errors
-
-NC_NOERR
-    No error.
-NC_EBADID
-    Bad group id.
-NC_ENOTNC4
-    Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4 operations can only be performed on files defined with a create mode which includes flag HDF5. (see nc_open).
-NC_ESTRICTNC3
-    This file was created with the strict netcdf-3 flag, therefore netcdf-4 operations are not allowed. (see nc_open).
-NC_EHDFERR
-    An error was reported by the HDF5 layer. 
+group, or any ancestor group.
+
+\param ncid NetCDF group ID, from a previous call to nc_open, nc_create, nc_def_grp, etc.
+\param nunlimdimsp A pointer to an int which will get the number of visible unlimited dimensions. Ignored if NULL.
+\param unlimdimidsp A pointer to an already allocated array of int which will get the ids of all visible unlimited dimensions. Ignored if NULL. To allocate the correct length for this array, call nc_inq_unlimdims with a NULL for this parameter and use the nunlimdimsp parameter to get the number of visible unlimited dimensions.
+
+This function will return one of the following values.
+
+\returns ::NC_NOERR No error.
+\returns ::NC_EBADID Bad group id.
+\returns ::NC_ENOTNC4 Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4 operations can only be performed on files defined with a create mode which includes flag HDF5. (see nc_open).
+\returns ::NC_ESTRICTNC3 This file was created with the strict netcdf-3 flag, therefore netcdf-4 operations are not allowed. (see nc_open).
+\returns ::NC_EHDFERR An error was reported by the HDF5 layer.
 
  */
 int
@@ -565,7 +557,7 @@ nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
     NC* ncp;
     int stat = NC_check_id(ncid,&ncp);
     if(stat != NC_NOERR) return stat;
-    return ncp->dispatch->inq_unlimdims(ncid, nunlimdimsp, 
+    return ncp->dispatch->inq_unlimdims(ncid, nunlimdimsp,
 					unlimdimidsp);
 }
 
diff --git a/libdispatch/dvarput.c b/libdispatch/dvarput.c
index 8a2e71c..71958f0 100644
--- a/libdispatch/dvarput.c
+++ b/libdispatch/dvarput.c
@@ -131,6 +131,8 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
    int memtypelen;
    const char* value = (const char*)value0;
    size_t numrecs;
+   int nrecdims;		   /* number of record dims for a variable */
+   int is_recdim[NC_MAX_VAR_DIMS]; /* for variable's dimensions */
    size_t varshape[NC_MAX_VAR_DIMS];
    size_t mystart[NC_MAX_VAR_DIMS];
    size_t myedges[NC_MAX_VAR_DIMS];
@@ -171,7 +173,10 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
    if(status != NC_NOERR) return status;
 
    /* Get variable dimension sizes */
-   isrecvar = NC_is_recvar(ncid,varid,&numrecs);
+   /* isrecvar = NC_is_recvar(ncid,varid,&numrecs); */
+   status = NC_inq_recvar(ncid,varid,&nrecdims,is_recdim);
+   if(status != NC_NOERR) return status;
+   isrecvar = (nrecdims > 0);
    NC_getshape(ncid,varid,rank,varshape);	
 
    /* Optimize out using various checks */
@@ -191,8 +196,8 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
 	size_t dimlen;
 	mystart[i] = (start == NULL ? 0 : start[i]);
 	if(edges == NULL) {
-	   if(i == 0 && isrecvar)
-  	      myedges[i] = numrecs - start[i];
+	   if(is_recdim[i] && isrecvar)
+  	      myedges[i] = varshape[i] - start[i];
 	   else
 	      myedges[i] = varshape[i] - mystart[i];
 	} else
@@ -206,8 +211,8 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
            return NC_ESTRIDE;
   	if(mystride[i] != 1) simplestride = 0;	
         /* illegal value checks */
-	dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
-	if(i == 0 && isrecvar) {/*do nothing*/}
+	dimlen = varshape[i];
+	if(is_recdim[i]) {/*do nothing*/}
         else {
 	  /* mystart is unsigned, will never be < 0 */
 	  if(mystart[i] > dimlen)
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index b091d69..ef7925f 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -72,7 +72,7 @@ IF(USE_DAP)
 ENDIF()
 
 IF(USE_HDF4)
-  SET(TLL_LIBS ${TLL_LIBS} ${HDF4_LIBRARIES})
+  SET(TLL_LIBS ${HDF4_MFHDF_LIB} ${HDF4_DF_LIB} ${TLL_LIBS})
 ENDIF()
 
 IF(ENABLE_PNETCDF AND PNETCDF)
diff --git a/liblib/Makefile.am b/liblib/Makefile.am
index 0b7e642..9b5df4f 100755
--- a/liblib/Makefile.am
+++ b/liblib/Makefile.am
@@ -12,12 +12,18 @@ include $(top_srcdir)/lib_flags.am
 # This is our output, the netcdf library the user will install.
 lib_LTLIBRARIES = libnetcdf.la
 
+##
 # These linker flags specify libtool version info.
 # Note: version-info of "9:0:2" results in soname of libnetcdf.so.7 -> libnetcdf.so.7.2.0
-libnetcdf_la_LDFLAGS = -version-info 9:0:2
+# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
+# for information regarding incrementing `-version-info`.
+##
+
+libnetcdf_la_LDFLAGS = -version-info 10:0:3
+
 libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS}
-libnetcdf_la_LIBADD = 
-CLEANFILES = 
+libnetcdf_la_LIBADD =
+CLEANFILES =
 
 # Turn on some extra stuff when building a DLL for windows.
 if BUILD_DLL
@@ -67,4 +73,4 @@ endif #USE_NETCDF4
 
 # We need at least one source file
 libnetcdf_la_SOURCES = stub.c
-EXTRA_DIST=CMakeLists.txt 
+EXTRA_DIST=CMakeLists.txt
diff --git a/liblib/Makefile.in b/liblib/Makefile.in
index db08228..819228a 100644
--- a/liblib/Makefile.in
+++ b/liblib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -94,8 +104,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -134,6 +142,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -240,6 +249,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -289,6 +300,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -304,10 +316,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -342,8 +356,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -412,7 +428,9 @@ lib_LTLIBRARIES = libnetcdf.la
 
 # These linker flags specify libtool version info.
 # Note: version-info of "9:0:2" results in soname of libnetcdf.so.7 -> libnetcdf.so.7.2.0
-libnetcdf_la_LDFLAGS = -version-info 9:0:2 $(am__append_3)
+# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
+# for information regarding incrementing `-version-info`.
+libnetcdf_la_LDFLAGS = -version-info 10:0:3 $(am__append_3)
 libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS} $(am__append_4)
 
 # The output library will always include netcdf3 and dispatch
@@ -425,7 +443,7 @@ CLEANFILES =
 
 # We need at least one source file
 libnetcdf_la_SOURCES = stub.c
-EXTRA_DIST = CMakeLists.txt 
+EXTRA_DIST = CMakeLists.txt
 all: all-am
 
 .SUFFIXES:
@@ -442,7 +460,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign liblib/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign liblib/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -451,7 +468,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -752,6 +769,8 @@ uninstall-am: uninstall-libLTLIBRARIES
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libnetcdf.settings.in b/libnetcdf.settings.in
index 1bc3b3a..7326692 100644
--- a/libnetcdf.settings.in
+++ b/libnetcdf.settings.in
@@ -28,6 +28,7 @@ NetCDF-2 API:		@HAS_NC2@
 NetCDF-4 API:		@HAS_NC4@
 HDF4 Support:		@HAS_HDF4@
 HDF5 Support:		@HAS_HDF5@
+HDF5/SZIP Support:      @HAS_SZIP@
 PNetCDF Support:	@HAS_PNETCDF@
 Parallel Support:	@HAS_PARALLEL@
 DAP Support:		@HAS_DAP@
diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt
index 7d221fd..3168913 100644
--- a/libsrc/CMakeLists.txt
+++ b/libsrc/CMakeLists.txt
@@ -3,7 +3,7 @@
 
 # Process these files with m4.
 SET(m4_SOURCES attr ncx putget t_ncxx)
-foreach (f ${m4_SOURCES})      
+foreach (f ${m4_SOURCES})
   GEN_m4(${f})
 endforeach(f)
 
@@ -24,7 +24,7 @@ ELSE (USE_FFIO)
   SET(libsrc_SOURCES ${libsrc_SOURCES} posixio.c)
 ENDIF (USE_FFIO)
 
-add_library(netcdf3 OBJECT ${libsrc_SOURCES}) 
+add_library(netcdf3 OBJECT ${libsrc_SOURCES})
 
 # The C API man page.
 
@@ -57,11 +57,3 @@ IF(NOT MSVC)
 
   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/netcdf.3 DESTINATION "share/man/man3" COMPONENT documentation)
 ENDIF()
-
-# Add files to the distribution
-FILE(GLOB libsrc_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
-SET(CUR_EXTRA_DIST attr.m4 ncx.m4 putget.m4 XGetopt.c memio.c mmapio.c ffio.c posixio.c CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${libsrc_SOURCES}")
-ADD_EXTRA_DIST("${libsrc_HEADERS}") 
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
-
diff --git a/libsrc/Makefile.in b/libsrc/Makefile.in
index c8e58c7..826425a 100644
--- a/libsrc/Makefile.in
+++ b/libsrc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -92,8 +102,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -119,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -236,6 +245,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -284,6 +295,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -299,10 +311,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -337,8 +351,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -436,7 +452,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libsrc/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign libsrc/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -445,7 +460,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -872,6 +887,8 @@ uninstall-man: uninstall-man3
 	tags tags-am uninstall uninstall-am uninstall-man \
 	uninstall-man3
 
+.PRECIOUS: Makefile
+
 
 # This tells make how to turn .m4 files into .c files.
 .m4.c:
diff --git a/libsrc/attr.c b/libsrc/attr.c
index 573cd22..22a961d 100644
--- a/libsrc/attr.c
+++ b/libsrc/attr.c
@@ -1,4 +1,6 @@
+#line 5 "attr.m4"
 /* Do not edit this file. It is produced from the corresponding .m4 source */
+#line 7
 /*
  *	Copyright 1996, University Corporation for Atmospheric Research
  *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
@@ -611,367 +613,704 @@ NC3_del_att(int ncid, int varid, const char *uname)
 	return NC_NOERR;
 }
 
+#line 674
 
 static int
+#line 675
 ncx_pad_putn_Iuchar(void **xpp, size_t nelems, const uchar *tp, nc_type type)
+#line 675
 {
+#line 675
 	switch(type) {
+#line 675
 	case NC_CHAR:
+#line 675
 		return NC_ECHAR;
+#line 675
 	case NC_BYTE:
+#line 675
 		return ncx_pad_putn_schar_uchar(xpp, nelems, tp);
+#line 675
 	case NC_SHORT:
+#line 675
 		return ncx_pad_putn_short_uchar(xpp, nelems, tp);
+#line 675
 	case NC_INT:
+#line 675
 		return ncx_putn_int_uchar(xpp, nelems, tp);
+#line 675
 	case NC_FLOAT:
+#line 675
 		return ncx_putn_float_uchar(xpp, nelems, tp);
+#line 675
 	case NC_DOUBLE:
+#line 675
 		return ncx_putn_double_uchar(xpp, nelems, tp);
+#line 675
 	default:
+#line 675
                 assert("ncx_pad_putn_Iuchar invalid type" == 0);
+#line 675
 	}
+#line 675
 	return NC_EBADTYPE;
+#line 675
 }
+#line 675
 
 static int
+#line 676
 ncx_pad_getn_Iuchar(const void **xpp, size_t nelems, uchar *tp, nc_type type)
+#line 676
 {
+#line 676
 	switch(type) {
+#line 676
 	case NC_CHAR:
+#line 676
 		return NC_ECHAR;
+#line 676
 	case NC_BYTE:
+#line 676
 		return ncx_pad_getn_schar_uchar(xpp, nelems, tp);
+#line 676
 	case NC_SHORT:
+#line 676
 		return ncx_pad_getn_short_uchar(xpp, nelems, tp);
+#line 676
 	case NC_INT:
+#line 676
 		return ncx_getn_int_uchar(xpp, nelems, tp);
+#line 676
 	case NC_FLOAT:
+#line 676
 		return ncx_getn_float_uchar(xpp, nelems, tp);
+#line 676
 	case NC_DOUBLE:
+#line 676
 		return ncx_getn_double_uchar(xpp, nelems, tp);
+#line 676
 	default:
+#line 676
 	        assert("ncx_pad_getn_Iuchar invalid type" == 0);
+#line 676
 	}
+#line 676
 	return NC_EBADTYPE;
+#line 676
 }
+#line 676
 
 
 static int
+#line 678
 ncx_pad_putn_Ischar(void **xpp, size_t nelems, const schar *tp, nc_type type)
+#line 678
 {
+#line 678
 	switch(type) {
+#line 678
 	case NC_CHAR:
+#line 678
 		return NC_ECHAR;
+#line 678
 	case NC_BYTE:
+#line 678
 		return ncx_pad_putn_schar_schar(xpp, nelems, tp);
+#line 678
 	case NC_SHORT:
+#line 678
 		return ncx_pad_putn_short_schar(xpp, nelems, tp);
+#line 678
 	case NC_INT:
+#line 678
 		return ncx_putn_int_schar(xpp, nelems, tp);
+#line 678
 	case NC_FLOAT:
+#line 678
 		return ncx_putn_float_schar(xpp, nelems, tp);
+#line 678
 	case NC_DOUBLE:
+#line 678
 		return ncx_putn_double_schar(xpp, nelems, tp);
+#line 678
 	default:
+#line 678
                 assert("ncx_pad_putn_Ischar invalid type" == 0);
+#line 678
 	}
+#line 678
 	return NC_EBADTYPE;
+#line 678
 }
+#line 678
 
 static int
+#line 679
 ncx_pad_getn_Ischar(const void **xpp, size_t nelems, schar *tp, nc_type type)
+#line 679
 {
+#line 679
 	switch(type) {
+#line 679
 	case NC_CHAR:
+#line 679
 		return NC_ECHAR;
+#line 679
 	case NC_BYTE:
+#line 679
 		return ncx_pad_getn_schar_schar(xpp, nelems, tp);
+#line 679
 	case NC_SHORT:
+#line 679
 		return ncx_pad_getn_short_schar(xpp, nelems, tp);
+#line 679
 	case NC_INT:
+#line 679
 		return ncx_getn_int_schar(xpp, nelems, tp);
+#line 679
 	case NC_FLOAT:
+#line 679
 		return ncx_getn_float_schar(xpp, nelems, tp);
+#line 679
 	case NC_DOUBLE:
+#line 679
 		return ncx_getn_double_schar(xpp, nelems, tp);
+#line 679
 	default:
+#line 679
 	        assert("ncx_pad_getn_Ischar invalid type" == 0);
+#line 679
 	}
+#line 679
 	return NC_EBADTYPE;
+#line 679
 }
+#line 679
 
 
 static int
+#line 681
 ncx_pad_putn_Ishort(void **xpp, size_t nelems, const short *tp, nc_type type)
+#line 681
 {
+#line 681
 	switch(type) {
+#line 681
 	case NC_CHAR:
+#line 681
 		return NC_ECHAR;
+#line 681
 	case NC_BYTE:
+#line 681
 		return ncx_pad_putn_schar_short(xpp, nelems, tp);
+#line 681
 	case NC_SHORT:
+#line 681
 		return ncx_pad_putn_short_short(xpp, nelems, tp);
+#line 681
 	case NC_INT:
+#line 681
 		return ncx_putn_int_short(xpp, nelems, tp);
+#line 681
 	case NC_FLOAT:
+#line 681
 		return ncx_putn_float_short(xpp, nelems, tp);
+#line 681
 	case NC_DOUBLE:
+#line 681
 		return ncx_putn_double_short(xpp, nelems, tp);
+#line 681
 	default:
+#line 681
                 assert("ncx_pad_putn_Ishort invalid type" == 0);
+#line 681
 	}
+#line 681
 	return NC_EBADTYPE;
+#line 681
 }
+#line 681
 
 static int
+#line 682
 ncx_pad_getn_Ishort(const void **xpp, size_t nelems, short *tp, nc_type type)
+#line 682
 {
+#line 682
 	switch(type) {
+#line 682
 	case NC_CHAR:
+#line 682
 		return NC_ECHAR;
+#line 682
 	case NC_BYTE:
+#line 682
 		return ncx_pad_getn_schar_short(xpp, nelems, tp);
+#line 682
 	case NC_SHORT:
+#line 682
 		return ncx_pad_getn_short_short(xpp, nelems, tp);
+#line 682
 	case NC_INT:
+#line 682
 		return ncx_getn_int_short(xpp, nelems, tp);
+#line 682
 	case NC_FLOAT:
+#line 682
 		return ncx_getn_float_short(xpp, nelems, tp);
+#line 682
 	case NC_DOUBLE:
+#line 682
 		return ncx_getn_double_short(xpp, nelems, tp);
+#line 682
 	default:
+#line 682
 	        assert("ncx_pad_getn_Ishort invalid type" == 0);
+#line 682
 	}
+#line 682
 	return NC_EBADTYPE;
+#line 682
 }
+#line 682
 
 
 static int
+#line 684
 ncx_pad_putn_Iint(void **xpp, size_t nelems, const int *tp, nc_type type)
+#line 684
 {
+#line 684
 	switch(type) {
+#line 684
 	case NC_CHAR:
+#line 684
 		return NC_ECHAR;
+#line 684
 	case NC_BYTE:
+#line 684
 		return ncx_pad_putn_schar_int(xpp, nelems, tp);
+#line 684
 	case NC_SHORT:
+#line 684
 		return ncx_pad_putn_short_int(xpp, nelems, tp);
+#line 684
 	case NC_INT:
+#line 684
 		return ncx_putn_int_int(xpp, nelems, tp);
+#line 684
 	case NC_FLOAT:
+#line 684
 		return ncx_putn_float_int(xpp, nelems, tp);
+#line 684
 	case NC_DOUBLE:
+#line 684
 		return ncx_putn_double_int(xpp, nelems, tp);
+#line 684
 	default:
+#line 684
                 assert("ncx_pad_putn_Iint invalid type" == 0);
+#line 684
 	}
+#line 684
 	return NC_EBADTYPE;
+#line 684
 }
+#line 684
 
 static int
+#line 685
 ncx_pad_getn_Iint(const void **xpp, size_t nelems, int *tp, nc_type type)
+#line 685
 {
+#line 685
 	switch(type) {
+#line 685
 	case NC_CHAR:
+#line 685
 		return NC_ECHAR;
+#line 685
 	case NC_BYTE:
+#line 685
 		return ncx_pad_getn_schar_int(xpp, nelems, tp);
+#line 685
 	case NC_SHORT:
+#line 685
 		return ncx_pad_getn_short_int(xpp, nelems, tp);
+#line 685
 	case NC_INT:
+#line 685
 		return ncx_getn_int_int(xpp, nelems, tp);
+#line 685
 	case NC_FLOAT:
+#line 685
 		return ncx_getn_float_int(xpp, nelems, tp);
+#line 685
 	case NC_DOUBLE:
+#line 685
 		return ncx_getn_double_int(xpp, nelems, tp);
+#line 685
 	default:
+#line 685
 	        assert("ncx_pad_getn_Iint invalid type" == 0);
+#line 685
 	}
+#line 685
 	return NC_EBADTYPE;
+#line 685
 }
+#line 685
 
 
 static int
+#line 687
 ncx_pad_putn_Ifloat(void **xpp, size_t nelems, const float *tp, nc_type type)
+#line 687
 {
+#line 687
 	switch(type) {
+#line 687
 	case NC_CHAR:
+#line 687
 		return NC_ECHAR;
+#line 687
 	case NC_BYTE:
+#line 687
 		return ncx_pad_putn_schar_float(xpp, nelems, tp);
+#line 687
 	case NC_SHORT:
+#line 687
 		return ncx_pad_putn_short_float(xpp, nelems, tp);
+#line 687
 	case NC_INT:
+#line 687
 		return ncx_putn_int_float(xpp, nelems, tp);
+#line 687
 	case NC_FLOAT:
+#line 687
 		return ncx_putn_float_float(xpp, nelems, tp);
+#line 687
 	case NC_DOUBLE:
+#line 687
 		return ncx_putn_double_float(xpp, nelems, tp);
+#line 687
 	default:
+#line 687
                 assert("ncx_pad_putn_Ifloat invalid type" == 0);
+#line 687
 	}
+#line 687
 	return NC_EBADTYPE;
+#line 687
 }
+#line 687
 
 static int
+#line 688
 ncx_pad_getn_Ifloat(const void **xpp, size_t nelems, float *tp, nc_type type)
+#line 688
 {
+#line 688
 	switch(type) {
+#line 688
 	case NC_CHAR:
+#line 688
 		return NC_ECHAR;
+#line 688
 	case NC_BYTE:
+#line 688
 		return ncx_pad_getn_schar_float(xpp, nelems, tp);
+#line 688
 	case NC_SHORT:
+#line 688
 		return ncx_pad_getn_short_float(xpp, nelems, tp);
+#line 688
 	case NC_INT:
+#line 688
 		return ncx_getn_int_float(xpp, nelems, tp);
+#line 688
 	case NC_FLOAT:
+#line 688
 		return ncx_getn_float_float(xpp, nelems, tp);
+#line 688
 	case NC_DOUBLE:
+#line 688
 		return ncx_getn_double_float(xpp, nelems, tp);
+#line 688
 	default:
+#line 688
 	        assert("ncx_pad_getn_Ifloat invalid type" == 0);
+#line 688
 	}
+#line 688
 	return NC_EBADTYPE;
+#line 688
 }
+#line 688
 
 
 static int
+#line 690
 ncx_pad_putn_Idouble(void **xpp, size_t nelems, const double *tp, nc_type type)
+#line 690
 {
+#line 690
 	switch(type) {
+#line 690
 	case NC_CHAR:
+#line 690
 		return NC_ECHAR;
+#line 690
 	case NC_BYTE:
+#line 690
 		return ncx_pad_putn_schar_double(xpp, nelems, tp);
+#line 690
 	case NC_SHORT:
+#line 690
 		return ncx_pad_putn_short_double(xpp, nelems, tp);
+#line 690
 	case NC_INT:
+#line 690
 		return ncx_putn_int_double(xpp, nelems, tp);
+#line 690
 	case NC_FLOAT:
+#line 690
 		return ncx_putn_float_double(xpp, nelems, tp);
+#line 690
 	case NC_DOUBLE:
+#line 690
 		return ncx_putn_double_double(xpp, nelems, tp);
+#line 690
 	default:
+#line 690
                 assert("ncx_pad_putn_Idouble invalid type" == 0);
+#line 690
 	}
+#line 690
 	return NC_EBADTYPE;
+#line 690
 }
+#line 690
 
 static int
+#line 691
 ncx_pad_getn_Idouble(const void **xpp, size_t nelems, double *tp, nc_type type)
+#line 691
 {
+#line 691
 	switch(type) {
+#line 691
 	case NC_CHAR:
+#line 691
 		return NC_ECHAR;
+#line 691
 	case NC_BYTE:
+#line 691
 		return ncx_pad_getn_schar_double(xpp, nelems, tp);
+#line 691
 	case NC_SHORT:
+#line 691
 		return ncx_pad_getn_short_double(xpp, nelems, tp);
+#line 691
 	case NC_INT:
+#line 691
 		return ncx_getn_int_double(xpp, nelems, tp);
+#line 691
 	case NC_FLOAT:
+#line 691
 		return ncx_getn_float_double(xpp, nelems, tp);
+#line 691
 	case NC_DOUBLE:
+#line 691
 		return ncx_getn_double_double(xpp, nelems, tp);
+#line 691
 	default:
+#line 691
 	        assert("ncx_pad_getn_Idouble invalid type" == 0);
+#line 691
 	}
+#line 691
 	return NC_EBADTYPE;
+#line 691
 }
+#line 691
 
 
 #ifdef IGNORE
 static int
+#line 694
 ncx_pad_putn_Ilong(void **xpp, size_t nelems, const long *tp, nc_type type)
+#line 694
 {
+#line 694
 	switch(type) {
+#line 694
 	case NC_CHAR:
+#line 694
 		return NC_ECHAR;
+#line 694
 	case NC_BYTE:
+#line 694
 		return ncx_pad_putn_schar_long(xpp, nelems, tp);
+#line 694
 	case NC_SHORT:
+#line 694
 		return ncx_pad_putn_short_long(xpp, nelems, tp);
+#line 694
 	case NC_INT:
+#line 694
 		return ncx_putn_int_long(xpp, nelems, tp);
+#line 694
 	case NC_FLOAT:
+#line 694
 		return ncx_putn_float_long(xpp, nelems, tp);
+#line 694
 	case NC_DOUBLE:
+#line 694
 		return ncx_putn_double_long(xpp, nelems, tp);
+#line 694
 	default:
+#line 694
                 assert("ncx_pad_putn_Ilong invalid type" == 0);
+#line 694
 	}
+#line 694
 	return NC_EBADTYPE;
+#line 694
 }
+#line 694
 
 static int
+#line 695
 ncx_pad_getn_Ilong(const void **xpp, size_t nelems, long *tp, nc_type type)
+#line 695
 {
+#line 695
 	switch(type) {
+#line 695
 	case NC_CHAR:
+#line 695
 		return NC_ECHAR;
+#line 695
 	case NC_BYTE:
+#line 695
 		return ncx_pad_getn_schar_long(xpp, nelems, tp);
+#line 695
 	case NC_SHORT:
+#line 695
 		return ncx_pad_getn_short_long(xpp, nelems, tp);
+#line 695
 	case NC_INT:
+#line 695
 		return ncx_getn_int_long(xpp, nelems, tp);
+#line 695
 	case NC_FLOAT:
+#line 695
 		return ncx_getn_float_long(xpp, nelems, tp);
+#line 695
 	case NC_DOUBLE:
+#line 695
 		return ncx_getn_double_long(xpp, nelems, tp);
+#line 695
 	default:
+#line 695
 	        assert("ncx_pad_getn_Ilong invalid type" == 0);
+#line 695
 	}
+#line 695
 	return NC_EBADTYPE;
+#line 695
 }
+#line 695
 
 #endif
 
 static int
+#line 698
 ncx_pad_putn_Ilonglong(void **xpp, size_t nelems, const longlong *tp, nc_type type)
+#line 698
 {
+#line 698
 	switch(type) {
+#line 698
 	case NC_CHAR:
+#line 698
 		return NC_ECHAR;
+#line 698
 	case NC_BYTE:
+#line 698
 		return ncx_pad_putn_schar_longlong(xpp, nelems, tp);
+#line 698
 	case NC_SHORT:
+#line 698
 		return ncx_pad_putn_short_longlong(xpp, nelems, tp);
+#line 698
 	case NC_INT:
+#line 698
 		return ncx_putn_int_longlong(xpp, nelems, tp);
+#line 698
 	case NC_FLOAT:
+#line 698
 		return ncx_putn_float_longlong(xpp, nelems, tp);
+#line 698
 	case NC_DOUBLE:
+#line 698
 		return ncx_putn_double_longlong(xpp, nelems, tp);
+#line 698
 	default:
+#line 698
                 assert("ncx_pad_putn_Ilonglong invalid type" == 0);
+#line 698
 	}
+#line 698
 	return NC_EBADTYPE;
+#line 698
 }
+#line 698
 
 static int
+#line 699
 ncx_pad_getn_Ilonglong(const void **xpp, size_t nelems, longlong *tp, nc_type type)
+#line 699
 {
+#line 699
 	switch(type) {
+#line 699
 	case NC_CHAR:
+#line 699
 		return NC_ECHAR;
+#line 699
 	case NC_BYTE:
+#line 699
 		return ncx_pad_getn_schar_longlong(xpp, nelems, tp);
+#line 699
 	case NC_SHORT:
+#line 699
 		return ncx_pad_getn_short_longlong(xpp, nelems, tp);
+#line 699
 	case NC_INT:
+#line 699
 		return ncx_getn_int_longlong(xpp, nelems, tp);
+#line 699
 	case NC_FLOAT:
+#line 699
 		return ncx_getn_float_longlong(xpp, nelems, tp);
+#line 699
 	case NC_DOUBLE:
+#line 699
 		return ncx_getn_double_longlong(xpp, nelems, tp);
+#line 699
 	default:
+#line 699
 	        assert("ncx_pad_getn_Ilonglong invalid type" == 0);
+#line 699
 	}
+#line 699
 	return NC_EBADTYPE;
+#line 699
 }
+#line 699
 
 
 
@@ -1107,9 +1446,9 @@ NC3_put_att(
     }
 
     if(attrpp != NULL) {
-        assert(old != NULL);
         *attrpp = attrp;
-        free_NC_attr(old);
+	if(old != NULL)
+	        free_NC_attr(old);
     } else {
         const int lstatus = incr_NC_attrarray(ncap, attrp);
         /*
diff --git a/libsrc/attr.m4 b/libsrc/attr.m4
index b1edba4..65ad747 100644
--- a/libsrc/attr.m4
+++ b/libsrc/attr.m4
@@ -831,9 +831,9 @@ NC3_put_att(
     }
 
     if(attrpp != NULL) {
-        assert(old != NULL);
         *attrpp = attrp;
-        free_NC_attr(old);
+	if(old != NULL)
+	        free_NC_attr(old);
     } else {
         const int lstatus = incr_NC_attrarray(ncap, attrp);
         /*
diff --git a/libsrc/ffio.c b/libsrc/ffio.c
index e4c5ac6..551640c 100644
--- a/libsrc/ffio.c
+++ b/libsrc/ffio.c
@@ -612,6 +612,7 @@ int
 ffio_create(const char *path, int ioflags,
 	size_t initialsz,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+	void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
@@ -709,6 +710,7 @@ int
 ffio_open(const char *path,
 	int ioflags,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+	void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
diff --git a/libsrc/memio.c b/libsrc/memio.c
index 460ccf2..ac3be87 100644
--- a/libsrc/memio.c
+++ b/libsrc/memio.c
@@ -22,6 +22,7 @@
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#include "ncdispatch.h"
 #include "nc3internal.h"
 
 #undef DEBUG
@@ -98,14 +99,20 @@ static long pagesize = 0;
 
 /* Create a new ncio struct to hold info about the file. */
 static int
-memio_new(const char* path, int ioflags, off_t initialsize, ncio** nciopp, NCMEMIO** memiop)
+memio_new(const char* path, int ioflags, off_t initialsize, void* memory, ncio** nciopp, NCMEMIO** memiop)
 {
     int status = NC_NOERR;
     ncio* nciop = NULL;
     NCMEMIO* memio = NULL;
+    off_t minsize = initialsize;
+    int inmemory = (fIsSet(ioflags,NC_INMEMORY));
 
-    if(pagesize == 0) {
+    /* use asserts because this is an internal function */
+    assert(memiop != NULL && nciopp != NULL);
+    assert(path != NULL || (memory != NULL && initialsize > 0));
+    assert(!inmemory || (memory != NULL && initialsize > 0));
 
+    if(pagesize == 0) {
 #if defined (_WIN32) || defined(_WIN64)
       SYSTEM_INFO info;
       GetSystemInfo (&info);
@@ -132,9 +139,6 @@ memio_new(const char* path, int ioflags, off_t initialsize, ncio** nciopp, NCMEM
     nciop->ioflags = ioflags;
     *((int*)&nciop->fd) = -1; /* caller will fix */
 
-    *((char**)&nciop->path) = strdup(path);
-    if(nciop->path == NULL) {status = NC_ENOMEM; goto fail;}
-
     *((ncio_relfunc**)&nciop->rel) = memio_rel;
     *((ncio_getfunc**)&nciop->get) = memio_get;
     *((ncio_movefunc**)&nciop->move) = memio_move;
@@ -142,30 +146,37 @@ memio_new(const char* path, int ioflags, off_t initialsize, ncio** nciopp, NCMEM
     *((ncio_filesizefunc**)&nciop->filesize) = memio_filesize;
     *((ncio_pad_lengthfunc**)&nciop->pad_length) = memio_pad_length;
     *((ncio_closefunc**)&nciop->close) = memio_close;
-
+ 
     memio = (NCMEMIO*)calloc(1,sizeof(NCMEMIO));
     if(memio == NULL) {status = NC_ENOMEM; goto fail;}
     *((void* *)&nciop->pvt) = memio;
 
+    *((char**)&nciop->path) = strdup(path);
+    if(nciop->path == NULL) {status = NC_ENOMEM; goto fail;}
     memio->alloc = initialsize;
-
-    memio->memory = NULL;
-    memio->size = 0;
     memio->pos = 0;
+    memio->size = minsize;
+    memio->memory = NULL;
     memio->persist = fIsSet(ioflags,NC_WRITE);
-
-    if(nciopp) *nciopp = nciop;
+    if(memiop && memio) *memiop = memio; else free(memio);
+    if(nciopp && nciop) *nciopp = nciop;
     else {
-        free((char*)nciop->path);
+        if(nciop->path != NULL) free((char*)nciop->path);
         free(nciop);
     }
-    if(memiop) *memiop = memio;
-    else free(memio);
+    if(inmemory) {
+	memio->memory = memory;
+    } else {
+        /* malloc memory */
+        memio->memory = (char*)malloc(memio->alloc);
+        if(memio->memory == NULL) {status = NC_ENOMEM; goto fail;}
+    }
 
 done:
     return status;
 
 fail:
+    if(memio != NULL) free(memio);
     if(nciop != NULL) {
         if(nciop->path != NULL) free((char*)nciop->path);
         free(nciop);
@@ -173,16 +184,16 @@ fail:
     goto done;
 }
 
-/* Create a file, and the ncio struct to go with it. This function is
-   only called from nc__create_mp.
+/* Create a file, and the ncio struct to go with it.
 
    path - path of file to create.
    ioflags - flags from nc_create
    initialsz - From the netcdf man page: "The argument
-   Iinitialsize sets the initial size of the file at creation time."
+               initialsize sets the initial size of the file at creation time."
    igeto - 
    igetsz - 
    sizehintp - the size of a page of data for buffered reads and writes.
+   parameters - arbitrary data 
    nciopp - pointer to a pointer that will get location of newly
    created and inited ncio struct.
    mempp - pointer to pointer to the initial memory read.
@@ -191,6 +202,7 @@ int
 memio_create(const char* path, int ioflags,
     size_t initialsz,
     off_t igeto, size_t igetsz, size_t* sizehintp,
+    void* parameters,
     ncio* *nciopp, void** const mempp)
 {
     ncio* nciop;
@@ -203,21 +215,12 @@ memio_create(const char* path, int ioflags,
     if(path == NULL ||* path == 0)
         return NC_EINVAL;
 
-    /* For diskless open has, the file must be classic version 1 or 2.*/
-    if(fIsSet(ioflags,NC_NETCDF4))
-        return NC_EDISKLESS; /* violates constraints */
-
-    status = memio_new(path, ioflags, initialsz, &nciop, &memio);
+    status = memio_new(path, ioflags, initialsz, NULL, &nciop, &memio);
     if(status != NC_NOERR)
         return status;
-    memio->size = 0;
-
-    /* malloc memory */
-    memio->memory = (char*)malloc(memio->alloc);
-    if(memio->memory == NULL) {status = NC_ENOMEM; goto unwind_open;}
 
     if(persist) {
-        /* Open the file, but make sure we can write it if needed */
+        /* Open the file just tomake sure we can write it if needed */
         oflags = (persist ? O_RDWR : O_RDONLY);    
 #ifdef O_BINARY
         fSet(oflags, O_BINARY);
@@ -261,14 +264,11 @@ fprintf(stderr,"memio_create: initial memory: %lu/%lu\n",(unsigned long)memio->m
     return NC_NOERR;
 
 unwind_open:
-    if(memio->memory != NULL)
-	free(memio->memory);
     memio_close(nciop,1);
     return status;
 }
 
-/* This function opens the data file. It is only called from nc.c,
-   from nc__open_mp and nc_delete_mp.
+/* This function opens the data file.
 
    path - path of data file.
    ioflags - flags passed into nc_open.
@@ -278,6 +278,7 @@ unwind_open:
    igetsz - the size in bytes of initial page get (a.k.a. extent). Not
    ever used in the library.
    sizehintp - the size of a page of data for buffered reads and writes.
+   parameters - arbitrary data 
    nciopp - pointer to pointer that will get address of newly created
    and inited ncio struct.
    mempp - pointer to pointer to the initial memory read.
@@ -286,85 +287,91 @@ int
 memio_open(const char* path,
     int ioflags,
     off_t igeto, size_t igetsz, size_t* sizehintp,
+    void* parameters,
     ncio* *nciopp, void** const mempp)
 {
     ncio* nciop = NULL;
-    int fd;
-    int status;
+    int fd = -1;
+    int status = NC_NOERR;
     int persist = (fIsSet(ioflags,NC_WRITE)?1:0);
-    int oflags;
+    int inmemory = (fIsSet(ioflags,NC_INMEMORY));
+    int oflags = 0;
     NCMEMIO* memio = NULL;
-    size_t sizehint;
-    off_t filesize;
+    size_t sizehint = 0;
+    off_t filesize = 0;
+    off_t red = 0;
+    char* pos = NULL;
+    NC_MEM_INFO* meminfo = (NC_MEM_INFO*)parameters;
 
-    if(path == NULL ||* path == 0)
-        return EINVAL;
+    if(path == NULL || strlen(path) == 0)
+        return NC_EINVAL;
 
     assert(sizehintp != NULL);
-    sizehint = *sizehintp;
+    sizehint = *sizehintp; 
 
-    /* Open the file, but make sure we can write it if needed */
-    oflags = (persist ? O_RDWR : O_RDONLY);    
+    if(inmemory) {
+	filesize = meminfo->size;
+    } else {
+        /* Open the file,and make sure we can write it if needed */
+        oflags = (persist ? O_RDWR : O_RDONLY);    
 #ifdef O_BINARY
-    fSet(oflags, O_BINARY);
+        fSet(oflags, O_BINARY);
 #endif
-    oflags |= O_EXCL;
+        oflags |= O_EXCL;
 #ifdef vms
-    fd = open(path, oflags, 0, "ctx=stm");
+        fd = open(path, oflags, 0, "ctx=stm");
 #else
-    fd  = open(path, oflags, OPENMODE);
+        fd  = open(path, oflags, OPENMODE);
 #endif
 #ifdef DEBUG
-    if(fd < 0) {
-	fprintf(stderr,"open failed: file=%s err=",path);
-	perror("");
-    }
+        if(fd < 0) {
+            fprintf(stderr,"open failed: file=%s err=",path);
+            perror("");
+	}
 #endif
-    if(fd < 0) {status = errno; goto unwind_open;}
+        if(fd < 0) {status = errno; goto unwind_open;}
 
-    /* get current filesize  = max(|file|,initialize)*/
-    filesize = lseek(fd,0,SEEK_END);
-    if(filesize < 0) {status = errno; goto unwind_open;}
-    /* move pointer back to beginning of file */
-    (void)lseek(fd,0,SEEK_SET);
-    if(filesize < (off_t)sizehint)
-        filesize = (off_t)sizehint;
+        /* get current filesize  = max(|file|,initialize)*/
+        filesize = lseek(fd,0,SEEK_END);
+        if(filesize < 0) {status = errno; goto unwind_open;}
+        /* move pointer back to beginning of file */
+        (void)lseek(fd,0,SEEK_SET);
+        if(filesize < (off_t)sizehint)
+            filesize = (off_t)sizehint;
+    }
 
-    status = memio_new(path, ioflags, filesize, &nciop, &memio);
+    if(inmemory)
+        status = memio_new(path, ioflags, filesize, meminfo->memory, &nciop, &memio);
+    else
+        status = memio_new(path, ioflags, filesize, NULL, &nciop, &memio);
     if(status != NC_NOERR) {
-      if(fd >= 0) 
-	close(fd);
+	if(fd >= 0) 
+	    close(fd);
       return status;
     }
-    memio->size = filesize;
-
-    memio->memory = (char*)malloc(memio->alloc);
-    if(memio->memory == NULL) {status = NC_ENOMEM; goto unwind_open;}
 
 #ifdef DEBUG
 fprintf(stderr,"memio_open: initial memory: %lu/%lu\n",(unsigned long)memio->memory,(unsigned long)memio->alloc);
 #endif
 
-    /* Read the file into the memio memory */
-    /* We need to do multiple reads because there is no
-       guarantee that the amount read will be the full amount */
-    {
-	off_t red = memio->size;
-	char* pos = memio->memory;
-	while(red > 0) {
-	    ssize_t count = read(fd, pos, red);
-	    if(count < 0)
-	        {status = errno; goto unwind_open;}
-	    if(count == 0)
-	        {status = NC_ENOTNC; goto unwind_open;}
-	    red -= count;
-	    pos += count;
-	}
+    if(!inmemory) {
+        /* Read the file into the memio memory */
+        /* We need to do multiple reads because there is no
+           guarantee that the amount read will be the full amount */
+        red = memio->size;
+        pos = memio->memory;
+        while(red > 0) {
+            ssize_t count = read(fd, pos, red);
+            if(count < 0) {status = errno; goto unwind_open;}
+            if(count == 0) {status = NC_ENOTNC; goto unwind_open;}
+            red -= count;
+            pos += count;
+        }
+        (void)close(fd);
     }
-    (void)close(fd); /* until memio_close() */
 
-    /* Use half the filesize as the blocksize */
-    sizehint = filesize/2;
+    /* Use half the filesize as the blocksize ; why? */
+    sizehint = filesize/2; 
 
     fd = nc__pseudofd();
     *((int* )&nciop->fd) = fd; 
@@ -379,8 +386,8 @@ fprintf(stderr,"memio_open: initial memory: %lu/%lu\n",(unsigned long)memio->mem
             goto unwind_open;
     }
 
-    *sizehintp = sizehint;
-    *nciopp = nciop;
+    if(sizehintp) *sizehintp = sizehint;
+    if(nciopp) *nciopp = nciop; else {ncio_close(nciop,0);}
     return NC_NOERR;
 
 unwind_open:
@@ -390,7 +397,6 @@ unwind_open:
     return status;
 }
 
-
 /* 
  *  Get file size in bytes.
  */
@@ -464,13 +470,15 @@ memio_close(ncio* nciop, int doUnlink)
     int status = NC_NOERR;
     NCMEMIO* memio;
     int fd = -1;
+    int inmemory = (fIsSet(nciop->ioflags,NC_INMEMORY));
+
     if(nciop == NULL || nciop->pvt == NULL) return NC_NOERR;
 
     memio = (NCMEMIO*)nciop->pvt;
     assert(memio != NULL);
 
     /* See if the user wants the contents persisted to a file */
-    if(memio->persist) {
+    if(!inmemory && memio->persist) {
         /* Try to open the file for writing */
 	int oflags = O_WRONLY|O_CREAT|O_TRUNC;
 #ifdef O_BINARY
@@ -496,7 +504,7 @@ memio_close(ncio* nciop, int doUnlink)
      }
 
 done:
-    if(memio->memory != NULL)
+    if(!inmemory && memio->memory != NULL)
 	free(memio->memory);
     /* do cleanup  */
     if(fd >= 0) (void)close(fd);		
diff --git a/libsrc/mmapio.c b/libsrc/mmapio.c
index 007ff5b..5f42b52 100644
--- a/libsrc/mmapio.c
+++ b/libsrc/mmapio.c
@@ -204,6 +204,7 @@ int
 mmapio_create(const char* path, int ioflags,
     size_t initialsz,
     off_t igeto, size_t igetsz, size_t* sizehintp,
+    void* parameters,
     ncio* *nciopp, void** const mempp)
 {
     ncio* nciop;
@@ -312,6 +313,7 @@ int
 mmapio_open(const char* path,
     int ioflags,
     off_t igeto, size_t igetsz, size_t* sizehintp,
+    void* parameters,
     ncio* *nciopp, void** const mempp)
 {
     ncio* nciop;
diff --git a/libsrc/nc3internal.c b/libsrc/nc3internal.c
index 78e3bd0..d563f56 100644
--- a/libsrc/nc3internal.c
+++ b/libsrc/nc3internal.c
@@ -16,8 +16,6 @@
 #endif
 
 #include "nc3internal.h"
-#include "ncdispatch.h"
-#include "nc3dispatch.h"
 #include "rnd.h"
 #include "ncx.h"
 
@@ -156,16 +154,16 @@ NC_begins(NC3_INFO* ncp,
 	} else {
 	  sizeof_off_t = 4;
 	}
-	
+
 	ncp->xsz = ncx_len_NC(ncp,sizeof_off_t);
 
-	if(ncp->vars.nelems == 0) 
+	if(ncp->vars.nelems == 0)
 		return NC_NOERR;
 
 	/* only (re)calculate begin_var if there is not sufficient space in header
 	   or start of non-record variables is not aligned as requested by valign */
 	if (ncp->begin_var < ncp->xsz + h_minfree ||
-	    ncp->begin_var != D_RNDUP(ncp->begin_var, v_align) ) 
+	    ncp->begin_var != D_RNDUP(ncp->begin_var, v_align) )
 	{
 	  index = (off_t) ncp->xsz;
 	  ncp->begin_var = D_RNDUP(index, v_align);
@@ -198,7 +196,7 @@ NC_begins(NC3_INFO* ncp,
 #if 0
 fprintf(stderr, "    VAR %d %s: %ld\n", ii, (*vpp)->name->cp, (long)index);
 #endif
-                if( sizeof_off_t == 4 && (index > X_OFF_MAX || index < 0) ) 
+                if( sizeof_off_t == 4 && (index > X_OFF_MAX || index < 0) )
 		{
 		    return NC_EVARSIZE;
                 }
@@ -264,7 +262,7 @@ fprintf(stderr, "    VAR %d %s: %ld\n", ii, (*vpp)->name->cp, (long)index);
 #if 0
 fprintf(stderr, "    REC %d %s: %ld\n", ii, (*vpp)->name->cp, (long)index);
 #endif
-                if( sizeof_off_t == 4 && (index > X_OFF_MAX || index < 0) ) 
+                if( sizeof_off_t == 4 && (index > X_OFF_MAX || index < 0) )
 		{
 		    return NC_EVARSIZE;
                 }
@@ -297,7 +295,7 @@ fprintf(stderr, "    REC %d %s: %ld\n", ii, (*vpp)->name->cp, (long)index);
 	}
 
 	/*
-	 * for special case of 
+	 * for special case of
 	 */
 	if(last != NULL) {
 	    if(ncp->recsize == last->len) { /* exactly one record variable, pack value */
@@ -549,7 +547,7 @@ fill_added(NC3_INFO *gnu, NC3_INFO *old)
 
 
 /*
- * Move the records "out". 
+ * Move the records "out".
  * Fill as needed.
  */
 static int
@@ -565,7 +563,7 @@ move_recs_r(NC3_INFO *gnu, NC3_INFO *old)
 	off_t gnu_off;
 	off_t old_off;
 	const size_t old_nrecs = NC_get_numrecs(old);
-	
+
 	/* Don't parallelize this loop */
 	for(recno = (int)old_nrecs -1; recno >= 0; recno--)
 	{
@@ -589,13 +587,13 @@ move_recs_r(NC3_INFO *gnu, NC3_INFO *old)
 			continue; 	/* nothing to do */
 
 		assert(gnu_off > old_off);
-	
+
 		status = ncio_move(gnu->nciop, gnu_off, old_off,
 			 old_varp->len, 0);
 
 		if(status != NC_NOERR)
 			return status;
-		
+
 	}
 	}
 
@@ -606,7 +604,7 @@ move_recs_r(NC3_INFO *gnu, NC3_INFO *old)
 
 
 /*
- * Move the "non record" variables "out". 
+ * Move the "non record" variables "out".
  * Fill as needed.
  */
 static int
@@ -620,7 +618,7 @@ move_vars_r(NC3_INFO *gnu, NC3_INFO *old)
 	NC_var *old_varp;
 	off_t gnu_off;
 	off_t old_off;
-	
+
 	/* Don't parallelize this loop */
 	for(varid = (int)old->vars.nelems -1;
 		 varid >= 0; varid--)
@@ -636,7 +634,7 @@ move_vars_r(NC3_INFO *gnu, NC3_INFO *old)
 		old_varp = *(old_varpp + varid);
 		gnu_off = gnu_varp->begin;
 		old_off = old_varp->begin;
-	
+
 		if (gnu_off > old_off) {
 		    err = ncio_move(gnu->nciop, gnu_off, old_off,
 			               old_varp->len, 0);
@@ -648,7 +646,7 @@ move_vars_r(NC3_INFO *gnu, NC3_INFO *old)
 
 
 /*
- * Given a valid ncp, return NC_EVARSIZE if any variable has a bad len 
+ * Given a valid ncp, return NC_EVARSIZE if any variable has a bad len
  * (product of non-rec dim sizes too large), else return NC_NOERR.
  */
 static int
@@ -664,7 +662,7 @@ NC_check_vlens(NC3_INFO *ncp)
     size_t rec_vars_count;
     int last = 0;
 
-    if(ncp->vars.nelems == 0) 
+    if(ncp->vars.nelems == 0)
 	return NC_NOERR;
 
     if ((ncp->flags & NC_64BIT_OFFSET) && sizeof(off_t) > 4) {
@@ -689,13 +687,13 @@ NC_check_vlens(NC3_INFO *ncp)
 	  rec_vars_count++;
 	}
     }
-    /* OK if last non-record variable size too large, since not used to 
+    /* OK if last non-record variable size too large, since not used to
        compute an offset */
     if( large_vars_count > 1) { /* only one "too-large" variable allowed */
       return NC_EVARSIZE;
     }
-    /* and it has to be the last one */ 
-    if( large_vars_count == 1 && last == 0) { 
+    /* and it has to be the last one */
+    if( large_vars_count == 1 && last == 0) {
       return NC_EVARSIZE;
     }
     if( rec_vars_count > 0 ) {
@@ -715,13 +713,13 @@ NC_check_vlens(NC3_INFO *ncp)
 		}
 	    }
 	}
-	/* OK if last record variable size too large, since not used to 
+	/* OK if last record variable size too large, since not used to
 	   compute an offset */
 	if( large_vars_count > 1) { /* only one "too-large" variable allowed */
 	    return NC_EVARSIZE;
 	}
-	/* and it has to be the last one */ 
-	if( large_vars_count == 1 && last == 0) { 
+	/* and it has to be the last one */
+	if( large_vars_count == 1 && last == 0) {
 	    return NC_EVARSIZE;
 	}
     }
@@ -771,7 +769,7 @@ NC_endef(NC3_INFO *ncp,
 				status = move_vars_r(ncp, ncp->old);
 				if(status != NC_NOERR)
 					return status;
-			} 
+			}
 			/* else if (ncp->begin_var == ncp->old->begin_var) { NOOP } */
 		}
 		else
@@ -783,7 +781,7 @@ NC_endef(NC3_INFO *ncp,
 				status = move_vars_r(ncp, ncp->old);
 				if(status != NC_NOERR)
 					return status;
-			} 
+			}
 		 	/* Even if (ncp->begin_rec == ncp->old->begin_rec)
 			   and     (ncp->begin_var == ncp->old->begin_var)
 			   might still have added a new record variable */
@@ -808,9 +806,9 @@ NC_endef(NC3_INFO *ncp,
 			status = fillerup(ncp);
 			if(status != NC_NOERR)
 				return status;
-			
+
 		}
-		else if(ncp->vars.nelems > ncp->old->vars.nelems)
+		else if(ncp->old != NULL && (ncp->vars.nelems > ncp->old->vars.nelems))
 		{
 			status = fill_added(ncp, ncp->old);
 			if(status != NC_NOERR)
@@ -859,7 +857,7 @@ NC_calcsize(const NC3_INFO *ncp, off_t *calcsizep)
 	NC_var *last_fix = NULL;	/* last "non-record" var */
 	int numrecvars = 0;	/* number of record variables */
 
-	if(ncp->vars.nelems == 0) { /* no non-record variables and 
+	if(ncp->vars.nelems == 0) { /* no non-record variables and
 				       no record variables */
 	    *calcsizep = ncp->xsz; /* size of header */
 	    return NC_NOERR;
@@ -881,7 +879,7 @@ NC_calcsize(const NC3_INFO *ncp, off_t *calcsizep)
 		int i;
 		varsize = 1;
 		    for(i = 0; i < last_fix->ndims; i++ ) {
-			varsize *= last_fix->shape[i];
+              varsize *= (last_fix->shape ? last_fix->shape[i] : 1);
 		    }
 	    }
 	    *calcsizep = last_fix->begin + varsize;
@@ -912,7 +910,7 @@ int NC3_new_nc(NC3_INFO** ncpp)
 
 	ncp->xsz = MIN_NC_XSZ;
 	assert(ncp->xsz == ncx_len_NC(ncp,0));
-	
+
         if(ncpp) *ncpp = ncp;
         return NC_NOERR;
 
@@ -930,10 +928,10 @@ NC3_create(const char *path, int ioflags,
 	int status;
 	void *xp = NULL;
 	int sizeof_off_t = 0;
-	NC3_INFO* nc3;
+	NC3_INFO* nc3 = NULL;
 
 	/* Create our specific NC3_INFO instance */
-	nc3 = new_NC3INFO(chunksizehintp);	
+	nc3 = new_NC3INFO(chunksizehintp);
 
 #if ALWAYS_NC_SHARE /* DEBUG */
 	fSet(ioflags, NC_SHARE);
@@ -947,8 +945,10 @@ NC3_create(const char *path, int ioflags,
 	/*
 	 * !_CRAYMPP, only pe 0 is valid
 	 */
-	if(basepe != 0)
-		return NC_EINVAL;
+	if(basepe != 0) {
+      if(nc3) free(nc3);
+      return NC_EINVAL;
+    }
 #endif
 
 	assert(nc3->flags == 0);
@@ -965,9 +965,9 @@ NC3_create(const char *path, int ioflags,
 	}
 
 	assert(nc3->xsz == ncx_len_NC(nc3,sizeof_off_t));
-	
+
         status =  ncio_create(path, ioflags, initialsz,
-			      0, nc3->xsz, &nc3->chunk,
+			      0, nc3->xsz, &nc3->chunk, NULL,
 			      &nc3->nciop, &xp);
 	if(status != NC_NOERR)
 	{
@@ -1012,7 +1012,7 @@ unwind_ioc:
 	/*FALLTHRU*/
 unwind_alloc:
 	free_NC3INFO(nc3);
-	if(nc) 
+	if(nc)
             NC3_DATA_SET(nc,NULL);
 	return status;
 }
@@ -1051,10 +1051,10 @@ NC3_open(const char * path, int ioflags,
                NC_Dispatch* dispatch, NC* nc)
 {
 	int status;
-	NC3_INFO* nc3;
+	NC3_INFO* nc3 = NULL;
 
 	/* Create our specific NC3_INFO instance */
-	nc3 = new_NC3INFO(chunksizehintp);	
+	nc3 = new_NC3INFO(chunksizehintp);
 
 #if ALWAYS_NC_SHARE /* DEBUG */
 	fSet(ioflags, NC_SHARE);
@@ -1064,15 +1064,17 @@ NC3_open(const char * path, int ioflags,
 	if (status = NC_init_pe(nc3, basepe)) {
 		return status;
 	}
-#else
+#else 
 	/*
 	 * !_CRAYMPP, only pe 0 is valid
 	 */
-	if(basepe != 0)
-		return NC_EINVAL;
+	if(basepe != 0) {
+        if(nc3) free(nc3);
+        return NC_EINVAL;
+    }
 #endif
-
-	status = ncio_open(path, ioflags, 0, 0, &nc3->chunk, &nc3->nciop, 0);
+        status = ncio_open(path, ioflags, 0, 0, &nc3->chunk, parameters,
+			       &nc3->nciop, NULL);
 	if(status)
 		goto unwind_alloc;
 
@@ -1111,7 +1113,7 @@ unwind_ioc:
 	/*FALLTHRU*/
 unwind_alloc:
 	free_NC3INFO(nc3);
-	if(nc) 
+	if(nc)
             NC3_DATA_SET(nc,NULL);
 	return status;
 }
@@ -1136,6 +1138,52 @@ NC3__enddef(int ncid,
 	return (NC_endef(nc3, h_minfree, v_align, v_minfree, r_align));
 }
 
+/*
+ * In data mode, same as ncclose.
+ * In define mode, restore previous definition.
+ * In create, remove the file.
+ */
+int
+NC3_abort(int ncid)
+{
+	int status;
+	NC *nc;
+	NC3_INFO* nc3;
+	int doUnlink = 0;
+
+	status = NC_check_id(ncid, &nc);
+	if(status != NC_NOERR)
+	    return status;
+	nc3 = NC3_DATA(nc);
+
+	doUnlink = NC_IsNew(nc3);
+
+	if(nc3->old != NULL)
+	{
+		/* a plain redef, not a create */
+		assert(!NC_IsNew(nc3));
+		assert(fIsSet(nc3->flags, NC_INDEF));
+		free_NC3INFO(nc3->old);
+		nc3->old = NULL;
+		fClr(nc3->flags, NC_INDEF);
+	}
+	else if(!NC_readonly(nc3))
+	{
+		status = NC_sync(nc3);
+		if(status != NC_NOERR)
+			return status;
+	}
+
+
+	(void) ncio_close(nc3->nciop, doUnlink);
+	nc3->nciop = NULL;
+
+	free_NC3INFO(nc3);
+	if(nc)
+            NC3_DATA_SET(nc,NULL);
+
+	return NC_NOERR;
+}
 
 int
 NC3_close(int ncid)
@@ -1144,7 +1192,7 @@ NC3_close(int ncid)
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 	    return status;
 	nc3 = NC3_DATA(nc);
@@ -1165,7 +1213,7 @@ NC3_close(int ncid)
 		(void) ncio_sync(nc3->nciop);
 	}
 
-	/* 
+	/*
 	 * If file opened for writing and filesize is less than
 	 * what it should be (due to previous use of NOFILL mode),
 	 * pad it to correct size, as reported by NC_calcsize().
@@ -1195,54 +1243,6 @@ NC3_close(int ncid)
 	return status;
 }
 
-/*
- * In data mode, same as ncclose.
- * In define mode, restore previous definition.
- * In create, remove the file.
- */
-int
-NC3_abort(int ncid)
-{
-	int status;
-	NC *nc;
-	NC3_INFO* nc3;
-	int doUnlink = 0;
-
-	status = NC_check_id(ncid, &nc);
-	if(status != NC_NOERR)
-	    return status;
-	nc3 = NC3_DATA(nc);
-
-	doUnlink = NC_IsNew(nc3);
-
-	if(nc3->old != NULL)
-	{
-		/* a plain redef, not a create */
-		assert(!NC_IsNew(nc3));
-		assert(fIsSet(nc3->flags, NC_INDEF));
-		free_NC3INFO(nc3->old);
-		nc3->old = NULL;
-		fClr(nc3->flags, NC_INDEF);
-	}
-	else if(!NC_readonly(nc3))
-	{
-		status = NC_sync(nc3);
-		if(status != NC_NOERR)
-			return status;
-	}
-
-
-	(void) ncio_close(nc3->nciop, doUnlink);
-	nc3->nciop = NULL;
-
-	free_NC3INFO(nc3);
-	if(nc)
-            NC3_DATA_SET(nc,NULL);
-
-	return NC_NOERR;
-}
-
-
 int
 NC3_redef(int ncid)
 {
@@ -1250,7 +1250,7 @@ NC3_redef(int ncid)
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
@@ -1261,7 +1261,7 @@ NC3_redef(int ncid)
 	if(NC_indef(nc3))
 		return NC_EINDEFINE;
 
-	
+
 	if(fIsSet(nc3->nciop->ioflags, NC_SHARE))
 	{
 		/* read in from disk */
@@ -1291,7 +1291,7 @@ NC3_inq(int ncid,
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
@@ -1308,14 +1308,14 @@ NC3_inq(int ncid,
 	return NC_NOERR;
 }
 
-int 
+int
 NC3_inq_unlimdim(int ncid, int *xtendimp)
 {
 	int status;
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
@@ -1333,7 +1333,7 @@ NC3_sync(int ncid)
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
@@ -1378,7 +1378,7 @@ NC3_set_fill(int ncid,
 	NC3_INFO* nc3;
 	int oldmode;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
@@ -1523,15 +1523,15 @@ NC3_inq_format(int ncid, int *formatp)
 	NC *nc;
 	NC3_INFO* nc3;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
 	nc3 = NC3_DATA(nc);
 
-	/* only need to check for netCDF-3 variants, since this is never called for netCDF-4 
+	/* only need to check for netCDF-3 variants, since this is never called for netCDF-4
 	   files */
-	*formatp = fIsSet(nc3->flags, NC_64BIT_OFFSET) ? NC_FORMAT_64BIT 
-	    : NC_FORMAT_CLASSIC; 
+	*formatp = fIsSet(nc3->flags, NC_64BIT_OFFSET) ? NC_FORMAT_64BIT
+	    : NC_FORMAT_CLASSIC;
 	return NC_NOERR;
 }
 
@@ -1541,7 +1541,7 @@ NC3_inq_format_extended(int ncid, int *formatp, int *modep)
 	int status;
 	NC *nc;
 
-	status = NC_check_id(ncid, &nc); 
+	status = NC_check_id(ncid, &nc);
 	if(status != NC_NOERR)
 		return status;
         if(formatp) *formatp = NC_FORMAT_NC3;
@@ -1564,11 +1564,11 @@ NC3_inq_format_extended(int ncid, int *formatp, int *modep)
 int
 NC3_inq_type(int ncid, nc_type typeid, char *name, size_t *size)
 {
-   int atomic_size[NUM_ATOMIC_TYPES] = {NC_BYTE_LEN, NC_CHAR_LEN, NC_SHORT_LEN, 
+   int atomic_size[NUM_ATOMIC_TYPES] = {NC_BYTE_LEN, NC_CHAR_LEN, NC_SHORT_LEN,
 					NC_INT_LEN, NC_FLOAT_LEN, NC_DOUBLE_LEN};
-   char atomic_name[NUM_ATOMIC_TYPES][NC_MAX_NAME + 1] = {"byte", "char", "short", 
+   char atomic_name[NUM_ATOMIC_TYPES][NC_MAX_NAME + 1] = {"byte", "char", "short",
 							  "int", "float", "double"};
-   
+
    /* Only netCDF classic model needs to be handled. */
    if (typeid < NC_BYTE || typeid > NC_DOUBLE)
       return NC_EBADTYPE;
@@ -1583,6 +1583,37 @@ NC3_inq_type(int ncid, nc_type typeid, char *name, size_t *size)
    return NC_NOERR;
 }
 
+/**************************************************/
+#if 0
+int
+NC3_set_content(int ncid, size_t size, void* memory)
+{
+    int status = NC_NOERR;
+    NC *nc;
+    NC3_INFO* nc3;
+
+    status = NC_check_id(ncid, &nc);
+    if(status != NC_NOERR)
+        return status;
+    nc3 = NC3_DATA(nc);
+
+#ifdef USE_DISKLESS
+    fClr(nc3->flags, NC_CREAT);
+    status = memio_set_content(nc3->nciop, size, memory);
+    if(status != NC_NOERR) goto done;
+    status = nc_get_NC(nc3);
+    if(status != NC_NOERR) goto done;
+#else
+    status = NC_EDISKLESS;
+#endif    				
+
+done:
+    return status;
+}
+#endif
+
+/**************************************************/
+
 int
 nc_delete_mp(const char * path, int basepe)
 {
@@ -1612,7 +1643,7 @@ nc_delete_mp(const char * path, int basepe)
 	if(basepe != 0)
 		return NC_EINVAL;
 #endif
-	
+
 	(void) nc_close(ncid);
 	if(unlink(path) == -1) {
 	    return NC_EIO;	/* No more specific error code is appropriate */
@@ -1625,4 +1656,3 @@ nc_delete(const char * path)
 {
         return nc_delete_mp(path, 0);
 }
-
diff --git a/libsrc/ncio.c b/libsrc/ncio.c
index 018b5a8..60377d8 100644
--- a/libsrc/ncio.c
+++ b/libsrc/ncio.c
@@ -16,49 +16,51 @@
 */
 
 /* Define known ncio packages */
-extern int posixio_create(const char*,int,size_t,off_t,size_t,size_t*,ncio**,void** const);
-extern int posixio_open(const char*,int,off_t,size_t,size_t*,ncio**,void** const);
+extern int posixio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
+extern int posixio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 
 #ifdef USE_FFIO
-extern int ffio_create(const char*,int,size_t,off_t,size_t,size_t*,ncio**,void** const);
-extern int ffio_open(const char*,int,off_t,size_t,size_t*,ncio**,void** const);
+extern int ffio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
+extern int ffio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #endif
 
 #ifdef USE_DISKLESS
 #  ifdef USE_MMAP
-     extern int mmapio_create(const char*,int,size_t,off_t,size_t,size_t*,ncio**,void** const);
-     extern int mmapio_open(const char*,int,off_t,size_t,size_t*,ncio**,void** const);
+     extern int mmapio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
+     extern int mmapio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #  endif
-     extern int memio_create(const char*,int,size_t,off_t,size_t,size_t*,ncio**,void** const);
-     extern int memio_open(const char*,int,off_t,size_t,size_t*,ncio**,void** const);
+     extern int memio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
+     extern int memio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #endif
 
 int
 ncio_create(const char *path, int ioflags, size_t initialsz,
                        off_t igeto, size_t igetsz, size_t *sizehintp,
+		       void* parameters,
                        ncio** iopp, void** const mempp)
 {
 #ifdef USE_DISKLESS
     if(fIsSet(ioflags,NC_DISKLESS)) {
 #  ifdef USE_MMAP
       if(fIsSet(ioflags,NC_MMAP))
-        return mmapio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,iopp,mempp);
+        return mmapio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
       else
 #  endif /*USE_MMAP*/
-        return memio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,iopp,mempp);
+        return memio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
     }
 #endif
 
 #ifdef USE_FFIO
-    return ffio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,iopp,mempp);
+    return ffio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
 #else
-    return posixio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,iopp,mempp);
+    return posixio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
 #endif
 }
 
 int
 ncio_open(const char *path, int ioflags,
                      off_t igeto, size_t igetsz, size_t *sizehintp,
+		     void* parameters,
                      ncio** iopp, void** const mempp)
 {
     /* Diskless open has the following constraints:
@@ -68,16 +70,16 @@ ncio_open(const char *path, int ioflags,
     if(fIsSet(ioflags,NC_DISKLESS)) {
 #  ifdef USE_MMAP
       if(fIsSet(ioflags,NC_MMAP))
-        return mmapio_open(path,ioflags,igeto,igetsz,sizehintp,iopp,mempp);
+        return mmapio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
       else
 #  endif /*USE_MMAP*/
-        return memio_open(path,ioflags,igeto,igetsz,sizehintp,iopp,mempp);
+        return memio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
     }
 #endif
 #ifdef USE_FFIO
-    return ffio_open(path,ioflags,igeto,igetsz,sizehintp,iopp,mempp);
+    return ffio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
 #else
-    return posixio_open(path,ioflags,igeto,igetsz,sizehintp,iopp,mempp);
+    return posixio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
 #endif
 }
 
diff --git a/libsrc/ncio.h b/libsrc/ncio.h
index 000ce14..71dc640 100644
--- a/libsrc/ncio.h
+++ b/libsrc/ncio.h
@@ -155,10 +155,12 @@ extern int ncio_close(ncio* const, int);
 
 extern int ncio_create(const char *path, int ioflags, size_t initialsz,
                        off_t igeto, size_t igetsz, size_t *sizehintp,
+		       void* parameters, /* new */
                        ncio** nciopp, void** const mempp);
 
 extern int ncio_open(const char *path, int ioflags,
                      off_t igeto, size_t igetsz, size_t *sizehintp,
+		     void* parameters, /* new */
                      ncio** nciopp, void** const mempp);
 
 /* With the advent of diskless io, we need to provide
@@ -170,6 +172,4 @@ extern int ncio_open(const char *path, int ioflags,
       the new package when appropriate.
 */
 
-
-
 #endif /* _NCIO_H_ */
diff --git a/libsrc/ncx.c b/libsrc/ncx.c
index e16afda..d1644d5 100644
--- a/libsrc/ncx.c
+++ b/libsrc/ncx.c
@@ -1,6 +1,4 @@
-#line 11 "ncx.m4"
 /* Do not edit this file. It is produced from the corresponding .m4 source */
-#line 13
 /*
  *	Copyright 1996, University Corporation for Atmospheric Research
  *	See netcdf/COPYRIGHT file for copying and redistribution conditions.
@@ -993,196 +991,105 @@ static struct sgl_limits min = {
 	{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }		/* Min IEEE */
 };
 
-#line 1057
 static void
 get_ix_float(const void *xp, float *ip)
 {
 		struct vax_single *const vsp = (struct vax_single *) ip;
-#line 1060
 		const struct ieee_single *const isp =
-#line 1060
 			 (const struct ieee_single *) xp;
-#line 1060
 		unsigned exp = isp->exp_hi << 1 | isp->exp_lo;
-#line 1060
 
-#line 1060
 		switch(exp) {
-#line 1060
 		case 0 :
-#line 1060
 			/* ieee subnormal */
-#line 1060
 			if(isp->mant_hi == min.ieee.mant_hi
-#line 1060
 				&& isp->mant_lo_hi == min.ieee.mant_lo_hi
-#line 1060
 				&& isp->mant_lo_lo == min.ieee.mant_lo_lo)
-#line 1060
 			{
-#line 1060
 				*vsp = min.s;
-#line 1060
 			}
-#line 1060
 			else
-#line 1060
 			{
-#line 1060
 				unsigned mantissa = (isp->mant_hi << 16)
-#line 1060
 					 | isp->mant_lo_hi << 8
-#line 1060
 					 | isp->mant_lo_lo;
-#line 1060
 				unsigned tmp = mantissa >> 20;
-#line 1060
 				if(tmp >= 4) {
-#line 1060
 					vsp->exp = 2;
-#line 1060
 				} else if (tmp >= 2) {
-#line 1060
 					vsp->exp = 1;
-#line 1060
 				} else {
-#line 1060
 					*vsp = min.s;
-#line 1060
 					break;
-#line 1060
 				} /* else */
-#line 1060
 				tmp = mantissa - (1 << (20 + vsp->exp ));
-#line 1060
 				tmp <<= 3 - vsp->exp;
-#line 1060
 				vsp->mantissa2 = tmp;
-#line 1060
 				vsp->mantissa1 = (tmp >> 16);
-#line 1060
 			}
-#line 1060
 			break;
-#line 1060
 		case 0xfe :
-#line 1060
 		case 0xff :
-#line 1060
 			*vsp = max.s;
-#line 1060
 			break;
-#line 1060
 		default :
-#line 1060
 			vsp->exp = exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
-#line 1060
 			vsp->mantissa2 = isp->mant_lo_hi << 8 | isp->mant_lo_lo;
-#line 1060
 			vsp->mantissa1 = isp->mant_hi;
-#line 1060
 		}
-#line 1060
 
-#line 1060
 		vsp->sign = isp->sign;
-#line 1060
 
 }
 
-#line 1114
 
 static void
 put_ix_float(void *xp, const float *ip)
 {
 		const struct vax_single *const vsp =
-#line 1118
 			 (const struct vax_single *)ip;
-#line 1118
 		struct ieee_single *const isp = (struct ieee_single *) xp;
-#line 1118
 
-#line 1118
 		switch(vsp->exp){
-#line 1118
 		case 0 :
-#line 1118
 			/* all vax float with zero exponent map to zero */
-#line 1118
 			*isp = min.ieee;
-#line 1118
 			break;
-#line 1118
 		case 2 :
-#line 1118
 		case 1 :
-#line 1118
 		{
-#line 1118
 			/* These will map to subnormals */
-#line 1118
 			unsigned mantissa = (vsp->mantissa1 << 16)
-#line 1118
 					 | vsp->mantissa2;
-#line 1118
 			mantissa >>= 3 - vsp->exp;
-#line 1118
 			mantissa += (1 << (20 + vsp->exp));
-#line 1118
 			isp->mant_lo_lo = mantissa;
-#line 1118
 			isp->mant_lo_hi = mantissa >> 8;
-#line 1118
 			isp->mant_hi = mantissa >> 16;
-#line 1118
 			isp->exp_lo = 0;
-#line 1118
 			isp->exp_hi = 0;
-#line 1118
 		}
-#line 1118
 			break;
-#line 1118
 		case 0xff : /* max.s.exp */
-#line 1118
 			if( vsp->mantissa2 == max.s.mantissa2
-#line 1118
 				&& vsp->mantissa1 == max.s.mantissa1)
-#line 1118
 			{
-#line 1118
 				/* map largest vax float to ieee infinity */
-#line 1118
 				*isp = max.ieee;
-#line 1118
 				break;
-#line 1118
 			} /* else, fall thru */
-#line 1118
 		default :
-#line 1118
 		{
-#line 1118
 			unsigned exp = vsp->exp - VAX_SNG_BIAS + IEEE_SNG_BIAS;
-#line 1118
 			isp->exp_hi = exp >> 1;
-#line 1118
 			isp->exp_lo = exp;
-#line 1118
 			isp->mant_lo_lo = vsp->mantissa2;
-#line 1118
 			isp->mant_lo_hi = vsp->mantissa2 >> 8;
-#line 1118
 			isp->mant_hi = vsp->mantissa1;
-#line 1118
 		}
-#line 1118
 		}
-#line 1118
 
-#line 1118
 		isp->sign = vsp->sign;
-#line 1118
 
 }
 
@@ -1242,7 +1149,6 @@ static const int cs_ieis_bias = 0x4000 - 0x7f;
 
 static const int cs_id_bias = 0x4000 - 0x3ff;
 
-#line 1253
 
 static void
 get_ix_float(const void *xp, float *ip)
@@ -1252,86 +1158,48 @@ get_ix_float(const void *xp, float *ip)
 	{
 		const ieee_single_hi *isp = (const ieee_single_hi *) xp;
 		cray_single *csp = (cray_single *) ip;
-#line 1261
 
-#line 1261
 		if(isp->exp == 0)
-#line 1261
 		{
-#line 1261
 			/* ieee subnormal */
-#line 1261
 			*ip = (double)isp->mant;
-#line 1261
 			if(isp->mant != 0)
-#line 1261
 			{
-#line 1261
 				csp->exp -= (ieee_single_bias + 22);
-#line 1261
 			}
-#line 1261
 		}
-#line 1261
 		else
-#line 1261
 		{
-#line 1261
 			csp->exp  = isp->exp + cs_ieis_bias + 1;
-#line 1261
 			csp->mant = isp->mant << (48 - 1 - 23);
-#line 1261
 			csp->mant |= (1 << (48 - 1));
-#line 1261
 		}
-#line 1261
 		csp->sign = isp->sign;
-#line 1261
 
-#line 1261
 
 	}
 	else
 	{
 		const ieee_single_lo *isp = (const ieee_single_lo *) xp;
 		cray_single *csp = (cray_single *) ip;
-#line 1266
 
-#line 1266
 		if(isp->exp == 0)
-#line 1266
 		{
-#line 1266
 			/* ieee subnormal */
-#line 1266
 			*ip = (double)isp->mant;
-#line 1266
 			if(isp->mant != 0)
-#line 1266
 			{
-#line 1266
 				csp->exp -= (ieee_single_bias + 22);
-#line 1266
 			}
-#line 1266
 		}
-#line 1266
 		else
-#line 1266
 		{
-#line 1266
 			csp->exp  = isp->exp + cs_ieis_bias + 1;
-#line 1266
 			csp->mant = isp->mant << (48 - 1 - 23);
-#line 1266
 			csp->mant |= (1 << (48 - 1));
-#line 1266
 		}
-#line 1266
 		csp->sign = isp->sign;
-#line 1266
 
-#line 1266
 
 	}
 }
@@ -1343,182 +1211,96 @@ put_ix_float(void *xp, const float *ip)
 	{
 		ieee_single_hi *isp = (ieee_single_hi*)xp;
 	const cray_single *csp = (const cray_single *) ip;
-#line 1276
 	int ieee_exp = csp->exp - cs_ieis_bias -1;
-#line 1276
 
-#line 1276
 	isp->sign = csp->sign;
-#line 1276
 
-#line 1276
 	if(ieee_exp >= 0xff)
-#line 1276
 	{
-#line 1276
 		/* NC_ERANGE => ieee Inf */
-#line 1276
 		isp->exp = 0xff;
-#line 1276
 		isp->mant = 0x0;
-#line 1276
 	}
-#line 1276
 	else if(ieee_exp > 0)
-#line 1276
 	{
-#line 1276
 		/* normal ieee representation */
-#line 1276
 		isp->exp  = ieee_exp;
-#line 1276
 		/* assumes cray rep is in normal form */
-#line 1276
 		assert(csp->mant & 0x800000000000);
-#line 1276
 		isp->mant = (((csp->mant << 1) &
-#line 1276
 				0xffffffffffff) >> (48 - 23));
-#line 1276
 	}
-#line 1276
 	else if(ieee_exp > -23)
-#line 1276
 	{
-#line 1276
 		/* ieee subnormal, right shift */
-#line 1276
 		const int rshift = (48 - 23 - ieee_exp);
-#line 1276
 
-#line 1276
 		isp->mant = csp->mant >> rshift;
-#line 1276
 
-#line 1276
 #if 0
-#line 1276
 		if(csp->mant & (1 << (rshift -1)))
-#line 1276
 		{
-#line 1276
 			/* round up */
-#line 1276
 			isp->mant++;
-#line 1276
 		}
-#line 1276
 #endif
-#line 1276
 
-#line 1276
 		isp->exp  = 0;
-#line 1276
 	}
-#line 1276
 	else
-#line 1276
 	{
-#line 1276
 		/* smaller than ieee can represent */
-#line 1276
 		isp->exp = 0;
-#line 1276
 		isp->mant = 0;
-#line 1276
 	}
-#line 1276
 
 	}
 	else
 	{
 		ieee_single_lo *isp = (ieee_single_lo*)xp;
 	const cray_single *csp = (const cray_single *) ip;
-#line 1281
 	int ieee_exp = csp->exp - cs_ieis_bias -1;
-#line 1281
 
-#line 1281
 	isp->sign = csp->sign;
-#line 1281
 
-#line 1281
 	if(ieee_exp >= 0xff)
-#line 1281
 	{
-#line 1281
 		/* NC_ERANGE => ieee Inf */
-#line 1281
 		isp->exp = 0xff;
-#line 1281
 		isp->mant = 0x0;
-#line 1281
 	}
-#line 1281
 	else if(ieee_exp > 0)
-#line 1281
 	{
-#line 1281
 		/* normal ieee representation */
-#line 1281
 		isp->exp  = ieee_exp;
-#line 1281
 		/* assumes cray rep is in normal form */
-#line 1281
 		assert(csp->mant & 0x800000000000);
-#line 1281
 		isp->mant = (((csp->mant << 1) &
-#line 1281
 				0xffffffffffff) >> (48 - 23));
-#line 1281
 	}
-#line 1281
 	else if(ieee_exp > -23)
-#line 1281
 	{
-#line 1281
 		/* ieee subnormal, right shift */
-#line 1281
 		const int rshift = (48 - 23 - ieee_exp);
-#line 1281
 
-#line 1281
 		isp->mant = csp->mant >> rshift;
-#line 1281
 
-#line 1281
 #if 0
-#line 1281
 		if(csp->mant & (1 << (rshift -1)))
-#line 1281
 		{
-#line 1281
 			/* round up */
-#line 1281
 			isp->mant++;
-#line 1281
 		}
-#line 1281
 #endif
-#line 1281
 
-#line 1281
 		isp->exp  = 0;
-#line 1281
 	}
-#line 1281
 	else
-#line 1281
 	{
-#line 1281
 		/* smaller than ieee can represent */
-#line 1281
 		isp->exp = 0;
-#line 1281
 		isp->mant = 0;
-#line 1281
 	}
-#line 1281
 
 	}
 }
@@ -1851,218 +1633,116 @@ static const struct dbl_limits {
 };
 
 
-#line 1661
 static void
 get_ix_double(const void *xp, double *ip)
 {
 	struct vax_double *const vdp =
-#line 1664
 			 (struct vax_double *)ip;
-#line 1664
 	const struct ieee_double *const idp =
-#line 1664
 			 (const struct ieee_double *) xp;
-#line 1664
 	{
-#line 1664
 		const struct dbl_limits *lim;
-#line 1664
 		int ii;
-#line 1664
 		for (ii = 0, lim = dbl_limits;
-#line 1664
 			ii < sizeof(dbl_limits)/sizeof(struct dbl_limits);
-#line 1664
 			ii++, lim++)
-#line 1664
 		{
-#line 1664
 			if ((idp->mant_lo == lim->ieee.mant_lo)
-#line 1664
 				&& (idp->mant_4 == lim->ieee.mant_4)
-#line 1664
 				&& (idp->mant_5 == lim->ieee.mant_5)
-#line 1664
 				&& (idp->mant_6 == lim->ieee.mant_6)
-#line 1664
 				&& (idp->exp_lo == lim->ieee.exp_lo)
-#line 1664
 				&& (idp->exp_hi == lim->ieee.exp_hi)
-#line 1664
 				)
-#line 1664
 			{
-#line 1664
 				*vdp = lim->d;
-#line 1664
 				goto doneit;
-#line 1664
 			}
-#line 1664
 		}
-#line 1664
 	}
-#line 1664
 	{
-#line 1664
 		unsigned exp = idp->exp_hi << 4 | idp->exp_lo;
-#line 1664
 		vdp->exp = exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
-#line 1664
 	}
-#line 1664
 	{
-#line 1664
 		unsigned mant_hi = ((idp->mant_6 << 16)
-#line 1664
 				 | (idp->mant_5 << 8)
-#line 1664
 				 | idp->mant_4);
-#line 1664
 		unsigned mant_lo = SWAP4(idp->mant_lo);
-#line 1664
 		vdp->mantissa1 = (mant_hi >> 13);
-#line 1664
 		vdp->mantissa2 = ((mant_hi & MASK(13)) << 3)
-#line 1664
 				| (mant_lo >> 29);
-#line 1664
 		vdp->mantissa3 = (mant_lo >> 13);
-#line 1664
 		vdp->mantissa4 = (mant_lo << 3);
-#line 1664
 	}
-#line 1664
 	doneit:
-#line 1664
 		vdp->sign = idp->sign;
-#line 1664
 
 }
 
 
-#line 1734
 static void
 put_ix_double(void *xp, const double *ip)
 {
 	const struct vax_double *const vdp = 
-#line 1737
 			(const struct vax_double *)ip;
-#line 1737
 	struct ieee_double *const idp =
-#line 1737
 			 (struct ieee_double *) xp;
-#line 1737
 
-#line 1737
 	if ((vdp->mantissa4 > (dbl_limits[0].d.mantissa4 - 3)) &&
-#line 1737
 		(vdp->mantissa3 == dbl_limits[0].d.mantissa3) &&
-#line 1737
 		(vdp->mantissa2 == dbl_limits[0].d.mantissa2) &&
-#line 1737
 		(vdp->mantissa1 == dbl_limits[0].d.mantissa1) &&
-#line 1737
 		(vdp->exp == dbl_limits[0].d.exp))
-#line 1737
 	{
-#line 1737
 		*idp = dbl_limits[0].ieee;
-#line 1737
 		goto shipit;
-#line 1737
 	}
-#line 1737
 	if ((vdp->mantissa4 == dbl_limits[1].d.mantissa4) &&
-#line 1737
 		(vdp->mantissa3 == dbl_limits[1].d.mantissa3) &&
-#line 1737
 		(vdp->mantissa2 == dbl_limits[1].d.mantissa2) &&
-#line 1737
 		(vdp->mantissa1 == dbl_limits[1].d.mantissa1) &&
-#line 1737
 		(vdp->exp == dbl_limits[1].d.exp))
-#line 1737
 	{
-#line 1737
 		*idp = dbl_limits[1].ieee;
-#line 1737
 		goto shipit;
-#line 1737
 	}
-#line 1737
 
-#line 1737
 	{
-#line 1737
 		unsigned exp = vdp->exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
-#line 1737
 
-#line 1737
 		unsigned mant_lo = ((vdp->mantissa2 & MASK(3)) << 29) |
-#line 1737
 			(vdp->mantissa3 << 13) |
-#line 1737
 			((vdp->mantissa4 >> 3) & MASK(13));
-#line 1737
 
-#line 1737
 		unsigned mant_hi = (vdp->mantissa1 << 13)
-#line 1737
 				 | (vdp->mantissa2 >> 3);
-#line 1737
 
-#line 1737
 		if((vdp->mantissa4 & 7) > 4)
-#line 1737
 		{
-#line 1737
 			/* round up */
-#line 1737
 			mant_lo++;
-#line 1737
 			if(mant_lo == 0)
-#line 1737
 			{
-#line 1737
 				mant_hi++;
-#line 1737
 				if(mant_hi > 0xffffff)
-#line 1737
 				{
-#line 1737
 					mant_hi = 0;
-#line 1737
 					exp++;
-#line 1737
 				}
-#line 1737
 			}
-#line 1737
 		}
-#line 1737
 
-#line 1737
 		idp->mant_lo = SWAP4(mant_lo);
-#line 1737
 		idp->mant_6 = mant_hi >> 16;
-#line 1737
 		idp->mant_5 = (mant_hi & 0xff00) >> 8;
-#line 1737
 		idp->mant_4 = mant_hi;
-#line 1737
 		idp->exp_hi = exp >> 4;
-#line 1737
 		idp->exp_lo = exp;
-#line 1737
 	}
-#line 1737
 		
-#line 1737
 	shipit:
-#line 1737
 		idp->sign = vdp->sign;
-#line 1737
 
 }
 
@@ -2504,1505 +2184,791 @@ ncx_get_off_t(const void **xpp, off_t *lp, size_t sizeof_off_t)
 /*
  * Aggregate numeric conversion functions.
  */
-#line 2625
 
 
-#line 2632
 
 /* schar */
 
-#line 2636
 int
 ncx_getn_schar_schar(const void **xpp, size_t nelems, schar *tp)
 {
 		(void) memcpy(tp, *xpp, nelems);
-#line 2639
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2639
 	return ENOERR;
-#line 2639
 
 }
-#line 2642
 int
 ncx_getn_schar_uchar(const void **xpp, size_t nelems, uchar *tp)
 {
 		(void) memcpy(tp, *xpp, nelems);
-#line 2645
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2645
 	return ENOERR;
-#line 2645
 
 }
 int
-#line 2647
 ncx_getn_schar_short(const void **xpp, size_t nelems, short *tp)
-#line 2647
 {
-#line 2647
 	schar *xp = (schar *)(*xpp);
-#line 2647
 
-#line 2647
 	while(nelems-- != 0)
-#line 2647
 	{
-#line 2647
 		*tp++ = *xp++;
-#line 2647
 	}
-#line 2647
 
-#line 2647
 	*xpp = (const void *)xp;
-#line 2647
 	return ENOERR;
-#line 2647
 }
-#line 2647
 
 int
-#line 2648
 ncx_getn_schar_int(const void **xpp, size_t nelems, int *tp)
-#line 2648
 {
-#line 2648
 	schar *xp = (schar *)(*xpp);
-#line 2648
 
-#line 2648
 	while(nelems-- != 0)
-#line 2648
 	{
-#line 2648
 		*tp++ = *xp++;
-#line 2648
 	}
-#line 2648
 
-#line 2648
 	*xpp = (const void *)xp;
-#line 2648
 	return ENOERR;
-#line 2648
 }
-#line 2648
 
 int
-#line 2649
 ncx_getn_schar_float(const void **xpp, size_t nelems, float *tp)
-#line 2649
 {
-#line 2649
 	schar *xp = (schar *)(*xpp);
-#line 2649
 
-#line 2649
 	while(nelems-- != 0)
-#line 2649
 	{
-#line 2649
 		*tp++ = *xp++;
-#line 2649
 	}
-#line 2649
 
-#line 2649
 	*xpp = (const void *)xp;
-#line 2649
 	return ENOERR;
-#line 2649
 }
-#line 2649
 
 int
-#line 2650
 ncx_getn_schar_double(const void **xpp, size_t nelems, double *tp)
-#line 2650
 {
-#line 2650
 	schar *xp = (schar *)(*xpp);
-#line 2650
 
-#line 2650
 	while(nelems-- != 0)
-#line 2650
 	{
-#line 2650
 		*tp++ = *xp++;
-#line 2650
 	}
-#line 2650
 
-#line 2650
 	*xpp = (const void *)xp;
-#line 2650
 	return ENOERR;
-#line 2650
 }
-#line 2650
 
 int
-#line 2651
 ncx_getn_schar_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2651
 {
-#line 2651
 	schar *xp = (schar *)(*xpp);
-#line 2651
 
-#line 2651
 	while(nelems-- != 0)
-#line 2651
 	{
-#line 2651
 		*tp++ = *xp++;
-#line 2651
 	}
-#line 2651
 
-#line 2651
 	*xpp = (const void *)xp;
-#line 2651
 	return ENOERR;
-#line 2651
 }
-#line 2651
 
 int
-#line 2652
 ncx_getn_schar_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2652
 {
-#line 2652
 	schar *xp = (schar *)(*xpp);
-#line 2652
 
-#line 2652
 	while(nelems-- != 0)
-#line 2652
 	{
-#line 2652
 		*tp++ = *xp++;
-#line 2652
 	}
-#line 2652
 
-#line 2652
 	*xpp = (const void *)xp;
-#line 2652
 	return ENOERR;
-#line 2652
 }
-#line 2652
 
 int
-#line 2653
 ncx_getn_schar_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2653
 {
-#line 2653
 	schar *xp = (schar *)(*xpp);
-#line 2653
 
-#line 2653
 	while(nelems-- != 0)
-#line 2653
 	{
-#line 2653
 		*tp++ = *xp++;
-#line 2653
 	}
-#line 2653
 
-#line 2653
 	*xpp = (const void *)xp;
-#line 2653
 	return ENOERR;
-#line 2653
 }
-#line 2653
 
 
-#line 2656
 int
 ncx_pad_getn_schar_schar(const void **xpp, size_t nelems, schar *tp)
 {
 		size_t rndup = nelems % X_ALIGN;
-#line 2659
 
-#line 2659
 	if(rndup)
-#line 2659
 		rndup = X_ALIGN - rndup;
-#line 2659
 
-#line 2659
 	(void) memcpy(tp, *xpp, nelems);
-#line 2659
 	*xpp = (void *)((char *)(*xpp) + nelems + rndup);
-#line 2659
 
-#line 2659
 	return ENOERR;
-#line 2659
 
 }
-#line 2662
 int
 ncx_pad_getn_schar_uchar(const void **xpp, size_t nelems, uchar *tp)
 {
 		size_t rndup = nelems % X_ALIGN;
-#line 2665
 
-#line 2665
 	if(rndup)
-#line 2665
 		rndup = X_ALIGN - rndup;
-#line 2665
 
-#line 2665
 	(void) memcpy(tp, *xpp, nelems);
-#line 2665
 	*xpp = (void *)((char *)(*xpp) + nelems + rndup);
-#line 2665
 
-#line 2665
 	return ENOERR;
-#line 2665
 
 }
 int
-#line 2667
 ncx_pad_getn_schar_short(const void **xpp, size_t nelems, short *tp)
-#line 2667
 {
-#line 2667
 	size_t rndup = nelems % X_ALIGN;
-#line 2667
 	schar *xp = (schar *) *xpp;
-#line 2667
 
-#line 2667
 	if(rndup)
-#line 2667
 		rndup = X_ALIGN - rndup;
-#line 2667
 
-#line 2667
 	while(nelems-- != 0)
-#line 2667
 	{
-#line 2667
 		*tp++ = *xp++;
-#line 2667
 	}
-#line 2667
 
-#line 2667
 	*xpp = (void *)(xp + rndup);
-#line 2667
 	return ENOERR;
-#line 2667
 }
-#line 2667
 
 int
-#line 2668
 ncx_pad_getn_schar_int(const void **xpp, size_t nelems, int *tp)
-#line 2668
 {
-#line 2668
 	size_t rndup = nelems % X_ALIGN;
-#line 2668
 	schar *xp = (schar *) *xpp;
-#line 2668
 
-#line 2668
 	if(rndup)
-#line 2668
 		rndup = X_ALIGN - rndup;
-#line 2668
 
-#line 2668
 	while(nelems-- != 0)
-#line 2668
 	{
-#line 2668
 		*tp++ = *xp++;
-#line 2668
 	}
-#line 2668
 
-#line 2668
 	*xpp = (void *)(xp + rndup);
-#line 2668
 	return ENOERR;
-#line 2668
 }
-#line 2668
 
 int
-#line 2669
 ncx_pad_getn_schar_float(const void **xpp, size_t nelems, float *tp)
-#line 2669
 {
-#line 2669
 	size_t rndup = nelems % X_ALIGN;
-#line 2669
 	schar *xp = (schar *) *xpp;
-#line 2669
 
-#line 2669
 	if(rndup)
-#line 2669
 		rndup = X_ALIGN - rndup;
-#line 2669
 
-#line 2669
 	while(nelems-- != 0)
-#line 2669
 	{
-#line 2669
 		*tp++ = *xp++;
-#line 2669
 	}
-#line 2669
 
-#line 2669
 	*xpp = (void *)(xp + rndup);
-#line 2669
 	return ENOERR;
-#line 2669
 }
-#line 2669
 
 int
-#line 2670
 ncx_pad_getn_schar_double(const void **xpp, size_t nelems, double *tp)
-#line 2670
 {
-#line 2670
 	size_t rndup = nelems % X_ALIGN;
-#line 2670
 	schar *xp = (schar *) *xpp;
-#line 2670
 
-#line 2670
 	if(rndup)
-#line 2670
 		rndup = X_ALIGN - rndup;
-#line 2670
 
-#line 2670
 	while(nelems-- != 0)
-#line 2670
 	{
-#line 2670
 		*tp++ = *xp++;
-#line 2670
 	}
-#line 2670
 
-#line 2670
 	*xpp = (void *)(xp + rndup);
-#line 2670
 	return ENOERR;
-#line 2670
 }
-#line 2670
 
 int
-#line 2671
 ncx_pad_getn_schar_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2671
 {
-#line 2671
 	size_t rndup = nelems % X_ALIGN;
-#line 2671
 	schar *xp = (schar *) *xpp;
-#line 2671
 
-#line 2671
 	if(rndup)
-#line 2671
 		rndup = X_ALIGN - rndup;
-#line 2671
 
-#line 2671
 	while(nelems-- != 0)
-#line 2671
 	{
-#line 2671
 		*tp++ = *xp++;
-#line 2671
 	}
-#line 2671
 
-#line 2671
 	*xpp = (void *)(xp + rndup);
-#line 2671
 	return ENOERR;
-#line 2671
 }
-#line 2671
 
 int
-#line 2672
 ncx_pad_getn_schar_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2672
 {
-#line 2672
 	size_t rndup = nelems % X_ALIGN;
-#line 2672
 	schar *xp = (schar *) *xpp;
-#line 2672
 
-#line 2672
 	if(rndup)
-#line 2672
 		rndup = X_ALIGN - rndup;
-#line 2672
 
-#line 2672
 	while(nelems-- != 0)
-#line 2672
 	{
-#line 2672
 		*tp++ = *xp++;
-#line 2672
 	}
-#line 2672
 
-#line 2672
 	*xpp = (void *)(xp + rndup);
-#line 2672
 	return ENOERR;
-#line 2672
 }
-#line 2672
 
 int
-#line 2673
 ncx_pad_getn_schar_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2673
 {
-#line 2673
 	size_t rndup = nelems % X_ALIGN;
-#line 2673
 	schar *xp = (schar *) *xpp;
-#line 2673
 
-#line 2673
 	if(rndup)
-#line 2673
 		rndup = X_ALIGN - rndup;
-#line 2673
 
-#line 2673
 	while(nelems-- != 0)
-#line 2673
 	{
-#line 2673
 		*tp++ = *xp++;
-#line 2673
 	}
-#line 2673
 
-#line 2673
 	*xpp = (void *)(xp + rndup);
-#line 2673
 	return ENOERR;
-#line 2673
 }
-#line 2673
 
 
-#line 2676
 int
 ncx_putn_schar_schar(void **xpp, size_t nelems, const schar *tp)
 {
 		(void) memcpy(*xpp, tp, nelems);
-#line 2679
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2679
 
-#line 2679
 	return ENOERR;
-#line 2679
 
 }
-#line 2682
 int
 ncx_putn_schar_uchar(void **xpp, size_t nelems, const uchar *tp)
 {
 		(void) memcpy(*xpp, tp, nelems);
-#line 2685
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2685
 
-#line 2685
 	return ENOERR;
-#line 2685
 
 }
 int
-#line 2687
 ncx_putn_schar_short(void **xpp, size_t nelems, const short *tp)
-#line 2687
 {
-#line 2687
 	int status = ENOERR;
-#line 2687
 	schar *xp = (schar *) *xpp;
-#line 2687
 
-#line 2687
 	while(nelems-- != 0)
-#line 2687
 	{
-#line 2687
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2687
 			status = NC_ERANGE;
-#line 2687
 		*xp++ = (schar) *tp++;
-#line 2687
 	}
-#line 2687
 
-#line 2687
 	*xpp = (void *)xp;
-#line 2687
 	return status;
-#line 2687
 }
-#line 2687
 
 int
-#line 2688
 ncx_putn_schar_int(void **xpp, size_t nelems, const int *tp)
-#line 2688
 {
-#line 2688
 	int status = ENOERR;
-#line 2688
 	schar *xp = (schar *) *xpp;
-#line 2688
 
-#line 2688
 	while(nelems-- != 0)
-#line 2688
 	{
-#line 2688
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2688
 			status = NC_ERANGE;
-#line 2688
 		*xp++ = (schar) *tp++;
-#line 2688
 	}
-#line 2688
 
-#line 2688
 	*xpp = (void *)xp;
-#line 2688
 	return status;
-#line 2688
 }
-#line 2688
 
 int
-#line 2689
 ncx_putn_schar_float(void **xpp, size_t nelems, const float *tp)
-#line 2689
 {
-#line 2689
 	int status = ENOERR;
-#line 2689
 	schar *xp = (schar *) *xpp;
-#line 2689
 
-#line 2689
 	while(nelems-- != 0)
-#line 2689
 	{
-#line 2689
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2689
 			status = NC_ERANGE;
-#line 2689
 		*xp++ = (schar) *tp++;
-#line 2689
 	}
-#line 2689
 
-#line 2689
 	*xpp = (void *)xp;
-#line 2689
 	return status;
-#line 2689
 }
-#line 2689
 
 int
-#line 2690
 ncx_putn_schar_double(void **xpp, size_t nelems, const double *tp)
-#line 2690
 {
-#line 2690
 	int status = ENOERR;
-#line 2690
 	schar *xp = (schar *) *xpp;
-#line 2690
 
-#line 2690
 	while(nelems-- != 0)
-#line 2690
 	{
-#line 2690
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2690
 			status = NC_ERANGE;
-#line 2690
 		*xp++ = (schar) *tp++;
-#line 2690
 	}
-#line 2690
 
-#line 2690
 	*xpp = (void *)xp;
-#line 2690
 	return status;
-#line 2690
 }
-#line 2690
 
 int
-#line 2691
 ncx_putn_schar_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2691
 {
-#line 2691
 	int status = ENOERR;
-#line 2691
 	schar *xp = (schar *) *xpp;
-#line 2691
 
-#line 2691
 	while(nelems-- != 0)
-#line 2691
 	{
-#line 2691
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2691
 			status = NC_ERANGE;
-#line 2691
 		*xp++ = (schar) *tp++;
-#line 2691
 	}
-#line 2691
 
-#line 2691
 	*xpp = (void *)xp;
-#line 2691
 	return status;
-#line 2691
 }
-#line 2691
 
 int
-#line 2692
 ncx_putn_schar_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2692
 {
-#line 2692
 	int status = ENOERR;
-#line 2692
 	schar *xp = (schar *) *xpp;
-#line 2692
 
-#line 2692
 	while(nelems-- != 0)
-#line 2692
 	{
-#line 2692
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2692
 			status = NC_ERANGE;
-#line 2692
 		*xp++ = (schar) *tp++;
-#line 2692
 	}
-#line 2692
 
-#line 2692
 	*xpp = (void *)xp;
-#line 2692
 	return status;
-#line 2692
 }
-#line 2692
 
 int
-#line 2693
 ncx_putn_schar_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2693
 {
-#line 2693
 	int status = ENOERR;
-#line 2693
 	schar *xp = (schar *) *xpp;
-#line 2693
 
-#line 2693
 	while(nelems-- != 0)
-#line 2693
 	{
-#line 2693
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2693
 			status = NC_ERANGE;
-#line 2693
 		*xp++ = (schar) *tp++;
-#line 2693
 	}
-#line 2693
 
-#line 2693
 	*xpp = (void *)xp;
-#line 2693
 	return status;
-#line 2693
 }
-#line 2693
 
 
-#line 2696
 int
 ncx_pad_putn_schar_schar(void **xpp, size_t nelems, const schar *tp)
 {
 		size_t rndup = nelems % X_ALIGN;
-#line 2699
 
-#line 2699
 	if(rndup)
-#line 2699
 		rndup = X_ALIGN - rndup;
-#line 2699
 
-#line 2699
 	(void) memcpy(*xpp, tp, nelems);
-#line 2699
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2699
 
-#line 2699
 	if(rndup)
-#line 2699
 	{
-#line 2699
 		(void) memcpy(*xpp, nada, rndup);
-#line 2699
 		*xpp = (void *)((char *)(*xpp) + rndup);
-#line 2699
 	}
-#line 2699
 	
-#line 2699
 	return ENOERR;
-#line 2699
 
 }
-#line 2702
 int
 ncx_pad_putn_schar_uchar(void **xpp, size_t nelems, const uchar *tp)
 {
 		size_t rndup = nelems % X_ALIGN;
-#line 2705
 
-#line 2705
 	if(rndup)
-#line 2705
 		rndup = X_ALIGN - rndup;
-#line 2705
 
-#line 2705
 	(void) memcpy(*xpp, tp, nelems);
-#line 2705
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 2705
 
-#line 2705
 	if(rndup)
-#line 2705
 	{
-#line 2705
 		(void) memcpy(*xpp, nada, rndup);
-#line 2705
 		*xpp = (void *)((char *)(*xpp) + rndup);
-#line 2705
 	}
-#line 2705
 	
-#line 2705
 	return ENOERR;
-#line 2705
 
 }
 int
-#line 2707
 ncx_pad_putn_schar_short(void **xpp, size_t nelems, const short *tp)
-#line 2707
 {
-#line 2707
 	int status = ENOERR;
-#line 2707
 	size_t rndup = nelems % X_ALIGN;
-#line 2707
 	schar *xp = (schar *) *xpp;
-#line 2707
 
-#line 2707
 	if(rndup)
-#line 2707
 		rndup = X_ALIGN - rndup;
-#line 2707
 
-#line 2707
 	while(nelems-- != 0)
-#line 2707
 	{
-#line 2707
 		/* N.B. schar as signed */
-#line 2707
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2707
 			status = NC_ERANGE;
-#line 2707
 		*xp++ = (schar) *tp++;
-#line 2707
 	}
-#line 2707
 
-#line 2707
 
-#line 2707
 	if(rndup)
-#line 2707
 	{
-#line 2707
 		(void) memcpy(xp, nada, rndup);
-#line 2707
 		xp += rndup;
-#line 2707
 	}
-#line 2707
 
-#line 2707
 	*xpp = (void *)xp;
-#line 2707
 	return status;
-#line 2707
 }
-#line 2707
 
 int
-#line 2708
 ncx_pad_putn_schar_int(void **xpp, size_t nelems, const int *tp)
-#line 2708
 {
-#line 2708
 	int status = ENOERR;
-#line 2708
 	size_t rndup = nelems % X_ALIGN;
-#line 2708
 	schar *xp = (schar *) *xpp;
-#line 2708
 
-#line 2708
 	if(rndup)
-#line 2708
 		rndup = X_ALIGN - rndup;
-#line 2708
 
-#line 2708
 	while(nelems-- != 0)
-#line 2708
 	{
-#line 2708
 		/* N.B. schar as signed */
-#line 2708
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2708
 			status = NC_ERANGE;
-#line 2708
 		*xp++ = (schar) *tp++;
-#line 2708
 	}
-#line 2708
 
-#line 2708
 
-#line 2708
 	if(rndup)
-#line 2708
 	{
-#line 2708
 		(void) memcpy(xp, nada, rndup);
-#line 2708
 		xp += rndup;
-#line 2708
 	}
-#line 2708
 
-#line 2708
 	*xpp = (void *)xp;
-#line 2708
 	return status;
-#line 2708
 }
-#line 2708
 
 int
-#line 2709
 ncx_pad_putn_schar_float(void **xpp, size_t nelems, const float *tp)
-#line 2709
 {
-#line 2709
 	int status = ENOERR;
-#line 2709
 	size_t rndup = nelems % X_ALIGN;
-#line 2709
 	schar *xp = (schar *) *xpp;
-#line 2709
 
-#line 2709
 	if(rndup)
-#line 2709
 		rndup = X_ALIGN - rndup;
-#line 2709
 
-#line 2709
 	while(nelems-- != 0)
-#line 2709
 	{
-#line 2709
 		/* N.B. schar as signed */
-#line 2709
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2709
 			status = NC_ERANGE;
-#line 2709
 		*xp++ = (schar) *tp++;
-#line 2709
 	}
-#line 2709
 
-#line 2709
 
-#line 2709
 	if(rndup)
-#line 2709
 	{
-#line 2709
 		(void) memcpy(xp, nada, rndup);
-#line 2709
 		xp += rndup;
-#line 2709
 	}
-#line 2709
 
-#line 2709
 	*xpp = (void *)xp;
-#line 2709
 	return status;
-#line 2709
 }
-#line 2709
 
 int
-#line 2710
 ncx_pad_putn_schar_double(void **xpp, size_t nelems, const double *tp)
-#line 2710
 {
-#line 2710
 	int status = ENOERR;
-#line 2710
 	size_t rndup = nelems % X_ALIGN;
-#line 2710
 	schar *xp = (schar *) *xpp;
-#line 2710
 
-#line 2710
 	if(rndup)
-#line 2710
 		rndup = X_ALIGN - rndup;
-#line 2710
 
-#line 2710
 	while(nelems-- != 0)
-#line 2710
 	{
-#line 2710
 		/* N.B. schar as signed */
-#line 2710
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2710
 			status = NC_ERANGE;
-#line 2710
 		*xp++ = (schar) *tp++;
-#line 2710
 	}
-#line 2710
 
-#line 2710
 
-#line 2710
 	if(rndup)
-#line 2710
 	{
-#line 2710
 		(void) memcpy(xp, nada, rndup);
-#line 2710
 		xp += rndup;
-#line 2710
 	}
-#line 2710
 
-#line 2710
 	*xpp = (void *)xp;
-#line 2710
 	return status;
-#line 2710
 }
-#line 2710
 
 int
-#line 2711
 ncx_pad_putn_schar_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2711
 {
-#line 2711
 	int status = ENOERR;
-#line 2711
 	size_t rndup = nelems % X_ALIGN;
-#line 2711
 	schar *xp = (schar *) *xpp;
-#line 2711
 
-#line 2711
 	if(rndup)
-#line 2711
 		rndup = X_ALIGN - rndup;
-#line 2711
 
-#line 2711
 	while(nelems-- != 0)
-#line 2711
 	{
-#line 2711
 		/* N.B. schar as signed */
-#line 2711
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2711
 			status = NC_ERANGE;
-#line 2711
 		*xp++ = (schar) *tp++;
-#line 2711
 	}
-#line 2711
 
-#line 2711
 
-#line 2711
 	if(rndup)
-#line 2711
 	{
-#line 2711
 		(void) memcpy(xp, nada, rndup);
-#line 2711
 		xp += rndup;
-#line 2711
 	}
-#line 2711
 
-#line 2711
 	*xpp = (void *)xp;
-#line 2711
 	return status;
-#line 2711
 }
-#line 2711
 
 int
-#line 2712
 ncx_pad_putn_schar_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2712
 {
-#line 2712
 	int status = ENOERR;
-#line 2712
 	size_t rndup = nelems % X_ALIGN;
-#line 2712
 	schar *xp = (schar *) *xpp;
-#line 2712
 
-#line 2712
 	if(rndup)
-#line 2712
 		rndup = X_ALIGN - rndup;
-#line 2712
 
-#line 2712
 	while(nelems-- != 0)
-#line 2712
 	{
-#line 2712
 		/* N.B. schar as signed */
-#line 2712
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2712
 			status = NC_ERANGE;
-#line 2712
 		*xp++ = (schar) *tp++;
-#line 2712
 	}
-#line 2712
 
-#line 2712
 
-#line 2712
 	if(rndup)
-#line 2712
 	{
-#line 2712
 		(void) memcpy(xp, nada, rndup);
-#line 2712
 		xp += rndup;
-#line 2712
 	}
-#line 2712
 
-#line 2712
 	*xpp = (void *)xp;
-#line 2712
 	return status;
-#line 2712
 }
-#line 2712
 
 int
-#line 2713
 ncx_pad_putn_schar_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2713
 {
-#line 2713
 	int status = ENOERR;
-#line 2713
 	size_t rndup = nelems % X_ALIGN;
-#line 2713
 	schar *xp = (schar *) *xpp;
-#line 2713
 
-#line 2713
 	if(rndup)
-#line 2713
 		rndup = X_ALIGN - rndup;
-#line 2713
 
-#line 2713
 	while(nelems-- != 0)
-#line 2713
 	{
-#line 2713
 		/* N.B. schar as signed */
-#line 2713
 		if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
-#line 2713
 			status = NC_ERANGE;
-#line 2713
 		*xp++ = (schar) *tp++;
-#line 2713
 	}
-#line 2713
 
-#line 2713
 
-#line 2713
 	if(rndup)
-#line 2713
 	{
-#line 2713
 		(void) memcpy(xp, nada, rndup);
-#line 2713
 		xp += rndup;
-#line 2713
 	}
-#line 2713
 
-#line 2713
 	*xpp = (void *)xp;
-#line 2713
 	return status;
-#line 2713
 }
-#line 2713
 
 
 
 /* short */
 
 int
-#line 2718
 ncx_getn_short_schar(const void **xpp, size_t nelems, schar *tp)
-#line 2718
 {
-#line 2718
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2718
 
-#line 2718
  /* basic algorithm is:
-#line 2718
   *   - ensure sane alignment of input data
-#line 2718
   *   - copy (conversion happens automatically) input data
-#line 2718
   *     to output
-#line 2718
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2718
   *     at next location for converted output
-#line 2718
   */
-#line 2718
   long i, j, ni;
-#line 2718
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2718
   short *xp;
-#line 2718
   int nrange = 0;         /* number of range errors */
-#line 2718
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2718
   long cxp = (long) *((char**)xpp);
-#line 2718
 
-#line 2718
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2718
   /* sjl: manually stripmine so we can limit amount of
-#line 2718
    * vector work space reserved to LOOPCNT elements. Also
-#line 2718
    * makes vectorisation easy */
-#line 2718
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2718
     ni=Min(nelems-j,LOOPCNT);
-#line 2718
     if (realign) {
-#line 2718
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2718
       xp = tmp;
-#line 2718
     } else {
-#line 2718
       xp = (short *) *xpp;
-#line 2718
     }
-#line 2718
    /* copy the next block */
-#line 2718
 #pragma cdir loopcnt=LOOPCNT
-#line 2718
 #pragma cdir shortloop
-#line 2718
     for (i=0; i<ni; i++) {
-#line 2718
       tp[i] = (schar) Max( SCHAR_MIN, Min(SCHAR_MAX, (schar) xp[i]));
-#line 2718
      /* test for range errors (not always needed but do it anyway) */
-#line 2718
       nrange += xp[i] < SCHAR_MIN || xp[i] > SCHAR_MAX;
-#line 2718
     }
-#line 2718
    /* update xpp and tp */
-#line 2718
     if (realign) xp = (short *) *xpp;
-#line 2718
     xp += ni;
-#line 2718
     tp += ni;
-#line 2718
     *xpp = (void*)xp;
-#line 2718
   }
-#line 2718
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2718
 
-#line 2718
 #else   /* not SX */
-#line 2718
 	const char *xp = (const char *) *xpp;
-#line 2718
 	int status = ENOERR;
-#line 2718
 
-#line 2718
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2718
 	{
-#line 2718
 		const int lstatus = ncx_get_short_schar(xp, tp);
-#line 2718
 		if(lstatus != ENOERR)
-#line 2718
 			status = lstatus;
-#line 2718
 	}
-#line 2718
 
-#line 2718
 	*xpp = (const void *)xp;
-#line 2718
 	return status;
-#line 2718
 #  endif
-#line 2718
 }
-#line 2718
 
 int
-#line 2719
 ncx_getn_short_uchar(const void **xpp, size_t nelems, uchar *tp)
-#line 2719
 {
-#line 2719
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2719
 
-#line 2719
  /* basic algorithm is:
-#line 2719
   *   - ensure sane alignment of input data
-#line 2719
   *   - copy (conversion happens automatically) input data
-#line 2719
   *     to output
-#line 2719
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2719
   *     at next location for converted output
-#line 2719
   */
-#line 2719
   long i, j, ni;
-#line 2719
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2719
   short *xp;
-#line 2719
   int nrange = 0;         /* number of range errors */
-#line 2719
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2719
   long cxp = (long) *((char**)xpp);
-#line 2719
 
-#line 2719
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2719
   /* sjl: manually stripmine so we can limit amount of
-#line 2719
    * vector work space reserved to LOOPCNT elements. Also
-#line 2719
    * makes vectorisation easy */
-#line 2719
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2719
     ni=Min(nelems-j,LOOPCNT);
-#line 2719
     if (realign) {
-#line 2719
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2719
       xp = tmp;
-#line 2719
     } else {
-#line 2719
       xp = (short *) *xpp;
-#line 2719
     }
-#line 2719
    /* copy the next block */
-#line 2719
 #pragma cdir loopcnt=LOOPCNT
-#line 2719
 #pragma cdir shortloop
-#line 2719
     for (i=0; i<ni; i++) {
-#line 2719
       tp[i] = (uchar) Max( UCHAR_MIN, Min(UCHAR_MAX, (uchar) xp[i]));
-#line 2719
      /* test for range errors (not always needed but do it anyway) */
-#line 2719
       nrange += xp[i] < UCHAR_MIN || xp[i] > UCHAR_MAX;
-#line 2719
     }
-#line 2719
    /* update xpp and tp */
-#line 2719
     if (realign) xp = (short *) *xpp;
-#line 2719
     xp += ni;
-#line 2719
     tp += ni;
-#line 2719
     *xpp = (void*)xp;
-#line 2719
   }
-#line 2719
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2719
 
-#line 2719
 #else   /* not SX */
-#line 2719
 	const char *xp = (const char *) *xpp;
-#line 2719
 	int status = ENOERR;
-#line 2719
 
-#line 2719
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2719
 	{
-#line 2719
 		const int lstatus = ncx_get_short_uchar(xp, tp);
-#line 2719
 		if(lstatus != ENOERR)
-#line 2719
 			status = lstatus;
-#line 2719
 	}
-#line 2719
 
-#line 2719
 	*xpp = (const void *)xp;
-#line 2719
 	return status;
-#line 2719
 #  endif
-#line 2719
 }
-#line 2719
 
 #if X_SIZEOF_SHORT == SIZEOF_SHORT
 /* optimized version */
@@ -4019,1539 +2985,782 @@ ncx_getn_short_short(const void **xpp, size_t nelems, short *tp)
 }
 #else
 int
-#line 2734
 ncx_getn_short_short(const void **xpp, size_t nelems, short *tp)
-#line 2734
 {
-#line 2734
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2734
 
-#line 2734
  /* basic algorithm is:
-#line 2734
   *   - ensure sane alignment of input data
-#line 2734
   *   - copy (conversion happens automatically) input data
-#line 2734
   *     to output
-#line 2734
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2734
   *     at next location for converted output
-#line 2734
   */
-#line 2734
   long i, j, ni;
-#line 2734
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2734
   short *xp;
-#line 2734
   int nrange = 0;         /* number of range errors */
-#line 2734
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2734
   long cxp = (long) *((char**)xpp);
-#line 2734
 
-#line 2734
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2734
   /* sjl: manually stripmine so we can limit amount of
-#line 2734
    * vector work space reserved to LOOPCNT elements. Also
-#line 2734
    * makes vectorisation easy */
-#line 2734
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2734
     ni=Min(nelems-j,LOOPCNT);
-#line 2734
     if (realign) {
-#line 2734
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2734
       xp = tmp;
-#line 2734
     } else {
-#line 2734
       xp = (short *) *xpp;
-#line 2734
     }
-#line 2734
    /* copy the next block */
-#line 2734
 #pragma cdir loopcnt=LOOPCNT
-#line 2734
 #pragma cdir shortloop
-#line 2734
     for (i=0; i<ni; i++) {
-#line 2734
       tp[i] = (short) Max( SHORT_MIN, Min(SHORT_MAX, (short) xp[i]));
-#line 2734
      /* test for range errors (not always needed but do it anyway) */
-#line 2734
       nrange += xp[i] < SHORT_MIN || xp[i] > SHORT_MAX;
-#line 2734
     }
-#line 2734
    /* update xpp and tp */
-#line 2734
     if (realign) xp = (short *) *xpp;
-#line 2734
     xp += ni;
-#line 2734
     tp += ni;
-#line 2734
     *xpp = (void*)xp;
-#line 2734
   }
-#line 2734
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2734
 
-#line 2734
 #else   /* not SX */
-#line 2734
 	const char *xp = (const char *) *xpp;
-#line 2734
 	int status = ENOERR;
-#line 2734
 
-#line 2734
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2734
 	{
-#line 2734
 		const int lstatus = ncx_get_short_short(xp, tp);
-#line 2734
 		if(lstatus != ENOERR)
-#line 2734
 			status = lstatus;
-#line 2734
 	}
-#line 2734
 
-#line 2734
 	*xpp = (const void *)xp;
-#line 2734
 	return status;
-#line 2734
 #  endif
-#line 2734
 }
-#line 2734
 
 #endif
 int
-#line 2736
 ncx_getn_short_int(const void **xpp, size_t nelems, int *tp)
-#line 2736
 {
-#line 2736
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2736
 
-#line 2736
  /* basic algorithm is:
-#line 2736
   *   - ensure sane alignment of input data
-#line 2736
   *   - copy (conversion happens automatically) input data
-#line 2736
   *     to output
-#line 2736
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2736
   *     at next location for converted output
-#line 2736
   */
-#line 2736
   long i, j, ni;
-#line 2736
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2736
   short *xp;
-#line 2736
   int nrange = 0;         /* number of range errors */
-#line 2736
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2736
   long cxp = (long) *((char**)xpp);
-#line 2736
 
-#line 2736
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2736
   /* sjl: manually stripmine so we can limit amount of
-#line 2736
    * vector work space reserved to LOOPCNT elements. Also
-#line 2736
    * makes vectorisation easy */
-#line 2736
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2736
     ni=Min(nelems-j,LOOPCNT);
-#line 2736
     if (realign) {
-#line 2736
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2736
       xp = tmp;
-#line 2736
     } else {
-#line 2736
       xp = (short *) *xpp;
-#line 2736
     }
-#line 2736
    /* copy the next block */
-#line 2736
 #pragma cdir loopcnt=LOOPCNT
-#line 2736
 #pragma cdir shortloop
-#line 2736
     for (i=0; i<ni; i++) {
-#line 2736
       tp[i] = (int) Max( INT_MIN, Min(INT_MAX, (int) xp[i]));
-#line 2736
      /* test for range errors (not always needed but do it anyway) */
-#line 2736
       nrange += xp[i] < INT_MIN || xp[i] > INT_MAX;
-#line 2736
     }
-#line 2736
    /* update xpp and tp */
-#line 2736
     if (realign) xp = (short *) *xpp;
-#line 2736
     xp += ni;
-#line 2736
     tp += ni;
-#line 2736
     *xpp = (void*)xp;
-#line 2736
   }
-#line 2736
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2736
 
-#line 2736
 #else   /* not SX */
-#line 2736
 	const char *xp = (const char *) *xpp;
-#line 2736
 	int status = ENOERR;
-#line 2736
 
-#line 2736
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2736
 	{
-#line 2736
 		const int lstatus = ncx_get_short_int(xp, tp);
-#line 2736
 		if(lstatus != ENOERR)
-#line 2736
 			status = lstatus;
-#line 2736
 	}
-#line 2736
 
-#line 2736
 	*xpp = (const void *)xp;
-#line 2736
 	return status;
-#line 2736
 #  endif
-#line 2736
 }
-#line 2736
 
 int
-#line 2737
 ncx_getn_short_float(const void **xpp, size_t nelems, float *tp)
-#line 2737
 {
-#line 2737
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2737
 
-#line 2737
  /* basic algorithm is:
-#line 2737
   *   - ensure sane alignment of input data
-#line 2737
   *   - copy (conversion happens automatically) input data
-#line 2737
   *     to output
-#line 2737
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2737
   *     at next location for converted output
-#line 2737
   */
-#line 2737
   long i, j, ni;
-#line 2737
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2737
   short *xp;
-#line 2737
   int nrange = 0;         /* number of range errors */
-#line 2737
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2737
   long cxp = (long) *((char**)xpp);
-#line 2737
 
-#line 2737
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2737
   /* sjl: manually stripmine so we can limit amount of
-#line 2737
    * vector work space reserved to LOOPCNT elements. Also
-#line 2737
    * makes vectorisation easy */
-#line 2737
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2737
     ni=Min(nelems-j,LOOPCNT);
-#line 2737
     if (realign) {
-#line 2737
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2737
       xp = tmp;
-#line 2737
     } else {
-#line 2737
       xp = (short *) *xpp;
-#line 2737
     }
-#line 2737
    /* copy the next block */
-#line 2737
 #pragma cdir loopcnt=LOOPCNT
-#line 2737
 #pragma cdir shortloop
-#line 2737
     for (i=0; i<ni; i++) {
-#line 2737
       tp[i] = (float) Max( FLOAT_MIN, Min(FLOAT_MAX, (float) xp[i]));
-#line 2737
      /* test for range errors (not always needed but do it anyway) */
-#line 2737
       nrange += xp[i] < FLOAT_MIN || xp[i] > FLOAT_MAX;
-#line 2737
     }
-#line 2737
    /* update xpp and tp */
-#line 2737
     if (realign) xp = (short *) *xpp;
-#line 2737
     xp += ni;
-#line 2737
     tp += ni;
-#line 2737
     *xpp = (void*)xp;
-#line 2737
   }
-#line 2737
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2737
 
-#line 2737
 #else   /* not SX */
-#line 2737
 	const char *xp = (const char *) *xpp;
-#line 2737
 	int status = ENOERR;
-#line 2737
 
-#line 2737
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2737
 	{
-#line 2737
 		const int lstatus = ncx_get_short_float(xp, tp);
-#line 2737
 		if(lstatus != ENOERR)
-#line 2737
 			status = lstatus;
-#line 2737
 	}
-#line 2737
 
-#line 2737
 	*xpp = (const void *)xp;
-#line 2737
 	return status;
-#line 2737
 #  endif
-#line 2737
 }
-#line 2737
 
 int
-#line 2738
 ncx_getn_short_double(const void **xpp, size_t nelems, double *tp)
-#line 2738
 {
-#line 2738
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2738
 
-#line 2738
  /* basic algorithm is:
-#line 2738
   *   - ensure sane alignment of input data
-#line 2738
   *   - copy (conversion happens automatically) input data
-#line 2738
   *     to output
-#line 2738
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2738
   *     at next location for converted output
-#line 2738
   */
-#line 2738
   long i, j, ni;
-#line 2738
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2738
   short *xp;
-#line 2738
   int nrange = 0;         /* number of range errors */
-#line 2738
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2738
   long cxp = (long) *((char**)xpp);
-#line 2738
 
-#line 2738
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2738
   /* sjl: manually stripmine so we can limit amount of
-#line 2738
    * vector work space reserved to LOOPCNT elements. Also
-#line 2738
    * makes vectorisation easy */
-#line 2738
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2738
     ni=Min(nelems-j,LOOPCNT);
-#line 2738
     if (realign) {
-#line 2738
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2738
       xp = tmp;
-#line 2738
     } else {
-#line 2738
       xp = (short *) *xpp;
-#line 2738
     }
-#line 2738
    /* copy the next block */
-#line 2738
 #pragma cdir loopcnt=LOOPCNT
-#line 2738
 #pragma cdir shortloop
-#line 2738
     for (i=0; i<ni; i++) {
-#line 2738
       tp[i] = (double) Max( DOUBLE_MIN, Min(DOUBLE_MAX, (double) xp[i]));
-#line 2738
      /* test for range errors (not always needed but do it anyway) */
-#line 2738
       nrange += xp[i] < DOUBLE_MIN || xp[i] > DOUBLE_MAX;
-#line 2738
     }
-#line 2738
    /* update xpp and tp */
-#line 2738
     if (realign) xp = (short *) *xpp;
-#line 2738
     xp += ni;
-#line 2738
     tp += ni;
-#line 2738
     *xpp = (void*)xp;
-#line 2738
   }
-#line 2738
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2738
 
-#line 2738
 #else   /* not SX */
-#line 2738
 	const char *xp = (const char *) *xpp;
-#line 2738
 	int status = ENOERR;
-#line 2738
 
-#line 2738
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2738
 	{
-#line 2738
 		const int lstatus = ncx_get_short_double(xp, tp);
-#line 2738
 		if(lstatus != ENOERR)
-#line 2738
 			status = lstatus;
-#line 2738
 	}
-#line 2738
 
-#line 2738
 	*xpp = (const void *)xp;
-#line 2738
 	return status;
-#line 2738
 #  endif
-#line 2738
 }
-#line 2738
 
 int
-#line 2739
 ncx_getn_short_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2739
 {
-#line 2739
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2739
 
-#line 2739
  /* basic algorithm is:
-#line 2739
   *   - ensure sane alignment of input data
-#line 2739
   *   - copy (conversion happens automatically) input data
-#line 2739
   *     to output
-#line 2739
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2739
   *     at next location for converted output
-#line 2739
   */
-#line 2739
   long i, j, ni;
-#line 2739
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2739
   short *xp;
-#line 2739
   int nrange = 0;         /* number of range errors */
-#line 2739
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2739
   long cxp = (long) *((char**)xpp);
-#line 2739
 
-#line 2739
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2739
   /* sjl: manually stripmine so we can limit amount of
-#line 2739
    * vector work space reserved to LOOPCNT elements. Also
-#line 2739
    * makes vectorisation easy */
-#line 2739
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2739
     ni=Min(nelems-j,LOOPCNT);
-#line 2739
     if (realign) {
-#line 2739
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2739
       xp = tmp;
-#line 2739
     } else {
-#line 2739
       xp = (short *) *xpp;
-#line 2739
     }
-#line 2739
    /* copy the next block */
-#line 2739
 #pragma cdir loopcnt=LOOPCNT
-#line 2739
 #pragma cdir shortloop
-#line 2739
     for (i=0; i<ni; i++) {
-#line 2739
       tp[i] = (uint) Max( UINT_MIN, Min(UINT_MAX, (uint) xp[i]));
-#line 2739
      /* test for range errors (not always needed but do it anyway) */
-#line 2739
       nrange += xp[i] < UINT_MIN || xp[i] > UINT_MAX;
-#line 2739
     }
-#line 2739
    /* update xpp and tp */
-#line 2739
     if (realign) xp = (short *) *xpp;
-#line 2739
     xp += ni;
-#line 2739
     tp += ni;
-#line 2739
     *xpp = (void*)xp;
-#line 2739
   }
-#line 2739
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2739
 
-#line 2739
 #else   /* not SX */
-#line 2739
 	const char *xp = (const char *) *xpp;
-#line 2739
 	int status = ENOERR;
-#line 2739
 
-#line 2739
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2739
 	{
-#line 2739
 		const int lstatus = ncx_get_short_uint(xp, tp);
-#line 2739
 		if(lstatus != ENOERR)
-#line 2739
 			status = lstatus;
-#line 2739
 	}
-#line 2739
 
-#line 2739
 	*xpp = (const void *)xp;
-#line 2739
 	return status;
-#line 2739
 #  endif
-#line 2739
 }
-#line 2739
 
 int
-#line 2740
 ncx_getn_short_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2740
 {
-#line 2740
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2740
 
-#line 2740
  /* basic algorithm is:
-#line 2740
   *   - ensure sane alignment of input data
-#line 2740
   *   - copy (conversion happens automatically) input data
-#line 2740
   *     to output
-#line 2740
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2740
   *     at next location for converted output
-#line 2740
   */
-#line 2740
   long i, j, ni;
-#line 2740
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2740
   short *xp;
-#line 2740
   int nrange = 0;         /* number of range errors */
-#line 2740
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2740
   long cxp = (long) *((char**)xpp);
-#line 2740
 
-#line 2740
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2740
   /* sjl: manually stripmine so we can limit amount of
-#line 2740
    * vector work space reserved to LOOPCNT elements. Also
-#line 2740
    * makes vectorisation easy */
-#line 2740
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2740
     ni=Min(nelems-j,LOOPCNT);
-#line 2740
     if (realign) {
-#line 2740
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2740
       xp = tmp;
-#line 2740
     } else {
-#line 2740
       xp = (short *) *xpp;
-#line 2740
     }
-#line 2740
    /* copy the next block */
-#line 2740
 #pragma cdir loopcnt=LOOPCNT
-#line 2740
 #pragma cdir shortloop
-#line 2740
     for (i=0; i<ni; i++) {
-#line 2740
       tp[i] = (longlong) Max( LONGLONG_MIN, Min(LONGLONG_MAX, (longlong) xp[i]));
-#line 2740
      /* test for range errors (not always needed but do it anyway) */
-#line 2740
       nrange += xp[i] < LONGLONG_MIN || xp[i] > LONGLONG_MAX;
-#line 2740
     }
-#line 2740
    /* update xpp and tp */
-#line 2740
     if (realign) xp = (short *) *xpp;
-#line 2740
     xp += ni;
-#line 2740
     tp += ni;
-#line 2740
     *xpp = (void*)xp;
-#line 2740
   }
-#line 2740
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2740
 
-#line 2740
 #else   /* not SX */
-#line 2740
 	const char *xp = (const char *) *xpp;
-#line 2740
 	int status = ENOERR;
-#line 2740
 
-#line 2740
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2740
 	{
-#line 2740
 		const int lstatus = ncx_get_short_longlong(xp, tp);
-#line 2740
 		if(lstatus != ENOERR)
-#line 2740
 			status = lstatus;
-#line 2740
 	}
-#line 2740
 
-#line 2740
 	*xpp = (const void *)xp;
-#line 2740
 	return status;
-#line 2740
 #  endif
-#line 2740
 }
-#line 2740
 
 int
-#line 2741
 ncx_getn_short_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2741
 {
-#line 2741
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2741
 
-#line 2741
  /* basic algorithm is:
-#line 2741
   *   - ensure sane alignment of input data
-#line 2741
   *   - copy (conversion happens automatically) input data
-#line 2741
   *     to output
-#line 2741
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2741
   *     at next location for converted output
-#line 2741
   */
-#line 2741
   long i, j, ni;
-#line 2741
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2741
   short *xp;
-#line 2741
   int nrange = 0;         /* number of range errors */
-#line 2741
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2741
   long cxp = (long) *((char**)xpp);
-#line 2741
 
-#line 2741
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2741
   /* sjl: manually stripmine so we can limit amount of
-#line 2741
    * vector work space reserved to LOOPCNT elements. Also
-#line 2741
    * makes vectorisation easy */
-#line 2741
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2741
     ni=Min(nelems-j,LOOPCNT);
-#line 2741
     if (realign) {
-#line 2741
       memcpy(tmp, *xpp, ni*SIZEOF_SHORT);
-#line 2741
       xp = tmp;
-#line 2741
     } else {
-#line 2741
       xp = (short *) *xpp;
-#line 2741
     }
-#line 2741
    /* copy the next block */
-#line 2741
 #pragma cdir loopcnt=LOOPCNT
-#line 2741
 #pragma cdir shortloop
-#line 2741
     for (i=0; i<ni; i++) {
-#line 2741
       tp[i] = (ulonglong) Max( ULONGLONG_MIN, Min(ULONGLONG_MAX, (ulonglong) xp[i]));
-#line 2741
      /* test for range errors (not always needed but do it anyway) */
-#line 2741
       nrange += xp[i] < ULONGLONG_MIN || xp[i] > ULONGLONG_MAX;
-#line 2741
     }
-#line 2741
    /* update xpp and tp */
-#line 2741
     if (realign) xp = (short *) *xpp;
-#line 2741
     xp += ni;
-#line 2741
     tp += ni;
-#line 2741
     *xpp = (void*)xp;
-#line 2741
   }
-#line 2741
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2741
 
-#line 2741
 #else   /* not SX */
-#line 2741
 	const char *xp = (const char *) *xpp;
-#line 2741
 	int status = ENOERR;
-#line 2741
 
-#line 2741
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2741
 	{
-#line 2741
 		const int lstatus = ncx_get_short_ulonglong(xp, tp);
-#line 2741
 		if(lstatus != ENOERR)
-#line 2741
 			status = lstatus;
-#line 2741
 	}
-#line 2741
 
-#line 2741
 	*xpp = (const void *)xp;
-#line 2741
 	return status;
-#line 2741
 #  endif
-#line 2741
 }
-#line 2741
 
 
 int
-#line 2743
 ncx_pad_getn_short_schar(const void **xpp, size_t nelems, schar *tp)
-#line 2743
 {
-#line 2743
 	const size_t rndup = nelems % 2;
-#line 2743
 
-#line 2743
 	const char *xp = (const char *) *xpp;
-#line 2743
 	int status = ENOERR;
-#line 2743
 
-#line 2743
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2743
 	{
-#line 2743
 		const int lstatus = ncx_get_short_schar(xp, tp);
-#line 2743
 		if(lstatus != ENOERR)
-#line 2743
 			status = lstatus;
-#line 2743
 	}
-#line 2743
 
-#line 2743
 	if(rndup != 0)
-#line 2743
 		xp += X_SIZEOF_SHORT;
-#line 2743
 		
-#line 2743
 	*xpp = (void *)xp;
-#line 2743
 	return status;
-#line 2743
 }
-#line 2743
 
 int
-#line 2744
 ncx_pad_getn_short_uchar(const void **xpp, size_t nelems, uchar *tp)
-#line 2744
 {
-#line 2744
 	const size_t rndup = nelems % 2;
-#line 2744
 
-#line 2744
 	const char *xp = (const char *) *xpp;
-#line 2744
 	int status = ENOERR;
-#line 2744
 
-#line 2744
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2744
 	{
-#line 2744
 		const int lstatus = ncx_get_short_uchar(xp, tp);
-#line 2744
 		if(lstatus != ENOERR)
-#line 2744
 			status = lstatus;
-#line 2744
 	}
-#line 2744
 
-#line 2744
 	if(rndup != 0)
-#line 2744
 		xp += X_SIZEOF_SHORT;
-#line 2744
 		
-#line 2744
 	*xpp = (void *)xp;
-#line 2744
 	return status;
-#line 2744
 }
-#line 2744
 
 int
-#line 2745
 ncx_pad_getn_short_short(const void **xpp, size_t nelems, short *tp)
-#line 2745
 {
-#line 2745
 	const size_t rndup = nelems % 2;
-#line 2745
 
-#line 2745
 	const char *xp = (const char *) *xpp;
-#line 2745
 	int status = ENOERR;
-#line 2745
 
-#line 2745
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2745
 	{
-#line 2745
 		const int lstatus = ncx_get_short_short(xp, tp);
-#line 2745
 		if(lstatus != ENOERR)
-#line 2745
 			status = lstatus;
-#line 2745
 	}
-#line 2745
 
-#line 2745
 	if(rndup != 0)
-#line 2745
 		xp += X_SIZEOF_SHORT;
-#line 2745
 		
-#line 2745
 	*xpp = (void *)xp;
-#line 2745
 	return status;
-#line 2745
 }
-#line 2745
 
 int
-#line 2746
 ncx_pad_getn_short_int(const void **xpp, size_t nelems, int *tp)
-#line 2746
 {
-#line 2746
 	const size_t rndup = nelems % 2;
-#line 2746
 
-#line 2746
 	const char *xp = (const char *) *xpp;
-#line 2746
 	int status = ENOERR;
-#line 2746
 
-#line 2746
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2746
 	{
-#line 2746
 		const int lstatus = ncx_get_short_int(xp, tp);
-#line 2746
 		if(lstatus != ENOERR)
-#line 2746
 			status = lstatus;
-#line 2746
 	}
-#line 2746
 
-#line 2746
 	if(rndup != 0)
-#line 2746
 		xp += X_SIZEOF_SHORT;
-#line 2746
 		
-#line 2746
 	*xpp = (void *)xp;
-#line 2746
 	return status;
-#line 2746
 }
-#line 2746
 
 int
-#line 2747
 ncx_pad_getn_short_float(const void **xpp, size_t nelems, float *tp)
-#line 2747
 {
-#line 2747
 	const size_t rndup = nelems % 2;
-#line 2747
 
-#line 2747
 	const char *xp = (const char *) *xpp;
-#line 2747
 	int status = ENOERR;
-#line 2747
 
-#line 2747
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2747
 	{
-#line 2747
 		const int lstatus = ncx_get_short_float(xp, tp);
-#line 2747
 		if(lstatus != ENOERR)
-#line 2747
 			status = lstatus;
-#line 2747
 	}
-#line 2747
 
-#line 2747
 	if(rndup != 0)
-#line 2747
 		xp += X_SIZEOF_SHORT;
-#line 2747
 		
-#line 2747
 	*xpp = (void *)xp;
-#line 2747
 	return status;
-#line 2747
 }
-#line 2747
 
 int
-#line 2748
 ncx_pad_getn_short_double(const void **xpp, size_t nelems, double *tp)
-#line 2748
 {
-#line 2748
 	const size_t rndup = nelems % 2;
-#line 2748
 
-#line 2748
 	const char *xp = (const char *) *xpp;
-#line 2748
 	int status = ENOERR;
-#line 2748
 
-#line 2748
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2748
 	{
-#line 2748
 		const int lstatus = ncx_get_short_double(xp, tp);
-#line 2748
 		if(lstatus != ENOERR)
-#line 2748
 			status = lstatus;
-#line 2748
 	}
-#line 2748
 
-#line 2748
 	if(rndup != 0)
-#line 2748
 		xp += X_SIZEOF_SHORT;
-#line 2748
 		
-#line 2748
 	*xpp = (void *)xp;
-#line 2748
 	return status;
-#line 2748
 }
-#line 2748
 
 int
-#line 2749
 ncx_pad_getn_short_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2749
 {
-#line 2749
 	const size_t rndup = nelems % 2;
-#line 2749
 
-#line 2749
 	const char *xp = (const char *) *xpp;
-#line 2749
 	int status = ENOERR;
-#line 2749
 
-#line 2749
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2749
 	{
-#line 2749
 		const int lstatus = ncx_get_short_uint(xp, tp);
-#line 2749
 		if(lstatus != ENOERR)
-#line 2749
 			status = lstatus;
-#line 2749
 	}
-#line 2749
 
-#line 2749
 	if(rndup != 0)
-#line 2749
 		xp += X_SIZEOF_SHORT;
-#line 2749
 		
-#line 2749
 	*xpp = (void *)xp;
-#line 2749
 	return status;
-#line 2749
 }
-#line 2749
 
 int
-#line 2750
 ncx_pad_getn_short_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2750
 {
-#line 2750
 	const size_t rndup = nelems % 2;
-#line 2750
 
-#line 2750
 	const char *xp = (const char *) *xpp;
-#line 2750
 	int status = ENOERR;
-#line 2750
 
-#line 2750
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2750
 	{
-#line 2750
 		const int lstatus = ncx_get_short_longlong(xp, tp);
-#line 2750
 		if(lstatus != ENOERR)
-#line 2750
 			status = lstatus;
-#line 2750
 	}
-#line 2750
 
-#line 2750
 	if(rndup != 0)
-#line 2750
 		xp += X_SIZEOF_SHORT;
-#line 2750
 		
-#line 2750
 	*xpp = (void *)xp;
-#line 2750
 	return status;
-#line 2750
 }
-#line 2750
 
 int
-#line 2751
 ncx_pad_getn_short_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2751
 {
-#line 2751
 	const size_t rndup = nelems % 2;
-#line 2751
 
-#line 2751
 	const char *xp = (const char *) *xpp;
-#line 2751
 	int status = ENOERR;
-#line 2751
 
-#line 2751
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2751
 	{
-#line 2751
 		const int lstatus = ncx_get_short_ulonglong(xp, tp);
-#line 2751
 		if(lstatus != ENOERR)
-#line 2751
 			status = lstatus;
-#line 2751
 	}
-#line 2751
 
-#line 2751
 	if(rndup != 0)
-#line 2751
 		xp += X_SIZEOF_SHORT;
-#line 2751
 		
-#line 2751
 	*xpp = (void *)xp;
-#line 2751
 	return status;
-#line 2751
 }
-#line 2751
 
 
 int
-#line 2753
 ncx_putn_short_schar(void **xpp, size_t nelems, const schar *tp)
-#line 2753
 {
-#line 2753
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2753
 
-#line 2753
  /* basic algorithm is:
-#line 2753
   *   - ensure sane alignment of output data
-#line 2753
   *   - copy (conversion happens automatically) input data
-#line 2753
   *     to output
-#line 2753
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2753
   *     at next location for converted output
-#line 2753
   */
-#line 2753
   long i, j, ni;
-#line 2753
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2753
   short *xp;
-#line 2753
   int nrange = 0;         /* number of range errors */
-#line 2753
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2753
   long cxp = (long) *((char**)xpp);
-#line 2753
 
-#line 2753
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2753
   /* sjl: manually stripmine so we can limit amount of
-#line 2753
    * vector work space reserved to LOOPCNT elements. Also
-#line 2753
    * makes vectorisation easy */
-#line 2753
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2753
     ni=Min(nelems-j,LOOPCNT);
-#line 2753
     if (realign) {
-#line 2753
       xp = tmp;
-#line 2753
     } else {
-#line 2753
       xp = (short *) *xpp;
-#line 2753
     }
-#line 2753
    /* copy the next block */
-#line 2753
 #pragma cdir loopcnt=LOOPCNT
-#line 2753
 #pragma cdir shortloop
-#line 2753
     for (i=0; i<ni; i++) {
-#line 2753
       /* the normal case: */
-#line 2753
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2753
      /* test for range errors (not always needed but do it anyway) */
-#line 2753
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2753
     }
-#line 2753
    /* copy workspace back if necessary */ 
-#line 2753
     if (realign) {
-#line 2753
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2753
       xp = (short *) *xpp;
-#line 2753
     }
-#line 2753
    /* update xpp and tp */
-#line 2753
     xp += ni;
-#line 2753
     tp += ni;
-#line 2753
     *xpp = (void*)xp;
-#line 2753
   }
-#line 2753
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2753
 
-#line 2753
 #else   /* not SX */
-#line 2753
 
-#line 2753
 	char *xp = (char *) *xpp;
-#line 2753
 	int status = ENOERR;
-#line 2753
 
-#line 2753
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2753
 	{
-#line 2753
 		int lstatus = ncx_put_short_schar(xp, tp);
-#line 2753
 		if(lstatus != ENOERR)
-#line 2753
 			status = lstatus;
-#line 2753
 	}
-#line 2753
 
-#line 2753
 	*xpp = (void *)xp;
-#line 2753
 	return status;
-#line 2753
 #endif
-#line 2753
 }
-#line 2753
 
 int
-#line 2754
 ncx_putn_short_uchar(void **xpp, size_t nelems, const uchar *tp)
-#line 2754
 {
-#line 2754
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2754
 
-#line 2754
  /* basic algorithm is:
-#line 2754
   *   - ensure sane alignment of output data
-#line 2754
   *   - copy (conversion happens automatically) input data
-#line 2754
   *     to output
-#line 2754
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2754
   *     at next location for converted output
-#line 2754
   */
-#line 2754
   long i, j, ni;
-#line 2754
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2754
   short *xp;
-#line 2754
   int nrange = 0;         /* number of range errors */
-#line 2754
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2754
   long cxp = (long) *((char**)xpp);
-#line 2754
 
-#line 2754
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2754
   /* sjl: manually stripmine so we can limit amount of
-#line 2754
    * vector work space reserved to LOOPCNT elements. Also
-#line 2754
    * makes vectorisation easy */
-#line 2754
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2754
     ni=Min(nelems-j,LOOPCNT);
-#line 2754
     if (realign) {
-#line 2754
       xp = tmp;
-#line 2754
     } else {
-#line 2754
       xp = (short *) *xpp;
-#line 2754
     }
-#line 2754
    /* copy the next block */
-#line 2754
 #pragma cdir loopcnt=LOOPCNT
-#line 2754
 #pragma cdir shortloop
-#line 2754
     for (i=0; i<ni; i++) {
-#line 2754
       /* the normal case: */
-#line 2754
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2754
      /* test for range errors (not always needed but do it anyway) */
-#line 2754
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2754
     }
-#line 2754
    /* copy workspace back if necessary */ 
-#line 2754
     if (realign) {
-#line 2754
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2754
       xp = (short *) *xpp;
-#line 2754
     }
-#line 2754
    /* update xpp and tp */
-#line 2754
     xp += ni;
-#line 2754
     tp += ni;
-#line 2754
     *xpp = (void*)xp;
-#line 2754
   }
-#line 2754
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2754
 
-#line 2754
 #else   /* not SX */
-#line 2754
 
-#line 2754
 	char *xp = (char *) *xpp;
-#line 2754
 	int status = ENOERR;
-#line 2754
 
-#line 2754
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2754
 	{
-#line 2754
 		int lstatus = ncx_put_short_uchar(xp, tp);
-#line 2754
 		if(lstatus != ENOERR)
-#line 2754
 			status = lstatus;
-#line 2754
 	}
-#line 2754
 
-#line 2754
 	*xpp = (void *)xp;
-#line 2754
 	return status;
-#line 2754
 #endif
-#line 2754
 }
-#line 2754
 
 #if X_SIZEOF_SHORT == SIZEOF_SHORT
 /* optimized version */
@@ -5568,1771 +3777,900 @@ ncx_putn_short_short(void **xpp, size_t nelems, const short *tp)
 }
 #else
 int
-#line 2769
 ncx_putn_short_short(void **xpp, size_t nelems, const short *tp)
-#line 2769
 {
-#line 2769
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2769
 
-#line 2769
  /* basic algorithm is:
-#line 2769
   *   - ensure sane alignment of output data
-#line 2769
   *   - copy (conversion happens automatically) input data
-#line 2769
   *     to output
-#line 2769
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2769
   *     at next location for converted output
-#line 2769
   */
-#line 2769
   long i, j, ni;
-#line 2769
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2769
   short *xp;
-#line 2769
   int nrange = 0;         /* number of range errors */
-#line 2769
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2769
   long cxp = (long) *((char**)xpp);
-#line 2769
 
-#line 2769
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2769
   /* sjl: manually stripmine so we can limit amount of
-#line 2769
    * vector work space reserved to LOOPCNT elements. Also
-#line 2769
    * makes vectorisation easy */
-#line 2769
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2769
     ni=Min(nelems-j,LOOPCNT);
-#line 2769
     if (realign) {
-#line 2769
       xp = tmp;
-#line 2769
     } else {
-#line 2769
       xp = (short *) *xpp;
-#line 2769
     }
-#line 2769
    /* copy the next block */
-#line 2769
 #pragma cdir loopcnt=LOOPCNT
-#line 2769
 #pragma cdir shortloop
-#line 2769
     for (i=0; i<ni; i++) {
-#line 2769
       /* the normal case: */
-#line 2769
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2769
      /* test for range errors (not always needed but do it anyway) */
-#line 2769
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2769
     }
-#line 2769
    /* copy workspace back if necessary */ 
-#line 2769
     if (realign) {
-#line 2769
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2769
       xp = (short *) *xpp;
-#line 2769
     }
-#line 2769
    /* update xpp and tp */
-#line 2769
     xp += ni;
-#line 2769
     tp += ni;
-#line 2769
     *xpp = (void*)xp;
-#line 2769
   }
-#line 2769
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2769
 
-#line 2769
 #else   /* not SX */
-#line 2769
 
-#line 2769
 	char *xp = (char *) *xpp;
-#line 2769
 	int status = ENOERR;
-#line 2769
 
-#line 2769
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2769
 	{
-#line 2769
 		int lstatus = ncx_put_short_short(xp, tp);
-#line 2769
 		if(lstatus != ENOERR)
-#line 2769
 			status = lstatus;
-#line 2769
 	}
-#line 2769
 
-#line 2769
 	*xpp = (void *)xp;
-#line 2769
 	return status;
-#line 2769
 #endif
-#line 2769
 }
-#line 2769
 
 #endif
 int
-#line 2771
 ncx_putn_short_int(void **xpp, size_t nelems, const int *tp)
-#line 2771
 {
-#line 2771
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2771
 
-#line 2771
  /* basic algorithm is:
-#line 2771
   *   - ensure sane alignment of output data
-#line 2771
   *   - copy (conversion happens automatically) input data
-#line 2771
   *     to output
-#line 2771
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2771
   *     at next location for converted output
-#line 2771
   */
-#line 2771
   long i, j, ni;
-#line 2771
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2771
   short *xp;
-#line 2771
   int nrange = 0;         /* number of range errors */
-#line 2771
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2771
   long cxp = (long) *((char**)xpp);
-#line 2771
 
-#line 2771
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2771
   /* sjl: manually stripmine so we can limit amount of
-#line 2771
    * vector work space reserved to LOOPCNT elements. Also
-#line 2771
    * makes vectorisation easy */
-#line 2771
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2771
     ni=Min(nelems-j,LOOPCNT);
-#line 2771
     if (realign) {
-#line 2771
       xp = tmp;
-#line 2771
     } else {
-#line 2771
       xp = (short *) *xpp;
-#line 2771
     }
-#line 2771
    /* copy the next block */
-#line 2771
 #pragma cdir loopcnt=LOOPCNT
-#line 2771
 #pragma cdir shortloop
-#line 2771
     for (i=0; i<ni; i++) {
-#line 2771
       /* the normal case: */
-#line 2771
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2771
      /* test for range errors (not always needed but do it anyway) */
-#line 2771
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2771
     }
-#line 2771
    /* copy workspace back if necessary */ 
-#line 2771
     if (realign) {
-#line 2771
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2771
       xp = (short *) *xpp;
-#line 2771
     }
-#line 2771
    /* update xpp and tp */
-#line 2771
     xp += ni;
-#line 2771
     tp += ni;
-#line 2771
     *xpp = (void*)xp;
-#line 2771
   }
-#line 2771
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2771
 
-#line 2771
 #else   /* not SX */
-#line 2771
 
-#line 2771
 	char *xp = (char *) *xpp;
-#line 2771
 	int status = ENOERR;
-#line 2771
 
-#line 2771
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2771
 	{
-#line 2771
 		int lstatus = ncx_put_short_int(xp, tp);
-#line 2771
 		if(lstatus != ENOERR)
-#line 2771
 			status = lstatus;
-#line 2771
 	}
-#line 2771
 
-#line 2771
 	*xpp = (void *)xp;
-#line 2771
 	return status;
-#line 2771
 #endif
-#line 2771
 }
-#line 2771
 
 int
-#line 2772
 ncx_putn_short_float(void **xpp, size_t nelems, const float *tp)
-#line 2772
 {
-#line 2772
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2772
 
-#line 2772
  /* basic algorithm is:
-#line 2772
   *   - ensure sane alignment of output data
-#line 2772
   *   - copy (conversion happens automatically) input data
-#line 2772
   *     to output
-#line 2772
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2772
   *     at next location for converted output
-#line 2772
   */
-#line 2772
   long i, j, ni;
-#line 2772
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2772
   short *xp;
-#line 2772
   int nrange = 0;         /* number of range errors */
-#line 2772
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2772
   long cxp = (long) *((char**)xpp);
-#line 2772
 
-#line 2772
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2772
   /* sjl: manually stripmine so we can limit amount of
-#line 2772
    * vector work space reserved to LOOPCNT elements. Also
-#line 2772
    * makes vectorisation easy */
-#line 2772
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2772
     ni=Min(nelems-j,LOOPCNT);
-#line 2772
     if (realign) {
-#line 2772
       xp = tmp;
-#line 2772
     } else {
-#line 2772
       xp = (short *) *xpp;
-#line 2772
     }
-#line 2772
    /* copy the next block */
-#line 2772
 #pragma cdir loopcnt=LOOPCNT
-#line 2772
 #pragma cdir shortloop
-#line 2772
     for (i=0; i<ni; i++) {
-#line 2772
       /* the normal case: */
-#line 2772
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2772
      /* test for range errors (not always needed but do it anyway) */
-#line 2772
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2772
     }
-#line 2772
    /* copy workspace back if necessary */ 
-#line 2772
     if (realign) {
-#line 2772
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2772
       xp = (short *) *xpp;
-#line 2772
     }
-#line 2772
    /* update xpp and tp */
-#line 2772
     xp += ni;
-#line 2772
     tp += ni;
-#line 2772
     *xpp = (void*)xp;
-#line 2772
   }
-#line 2772
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2772
 
-#line 2772
 #else   /* not SX */
-#line 2772
 
-#line 2772
 	char *xp = (char *) *xpp;
-#line 2772
 	int status = ENOERR;
-#line 2772
 
-#line 2772
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2772
 	{
-#line 2772
 		int lstatus = ncx_put_short_float(xp, tp);
-#line 2772
 		if(lstatus != ENOERR)
-#line 2772
 			status = lstatus;
-#line 2772
 	}
-#line 2772
 
-#line 2772
 	*xpp = (void *)xp;
-#line 2772
 	return status;
-#line 2772
 #endif
-#line 2772
 }
-#line 2772
 
 int
-#line 2773
 ncx_putn_short_double(void **xpp, size_t nelems, const double *tp)
-#line 2773
 {
-#line 2773
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2773
 
-#line 2773
  /* basic algorithm is:
-#line 2773
   *   - ensure sane alignment of output data
-#line 2773
   *   - copy (conversion happens automatically) input data
-#line 2773
   *     to output
-#line 2773
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2773
   *     at next location for converted output
-#line 2773
   */
-#line 2773
   long i, j, ni;
-#line 2773
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2773
   short *xp;
-#line 2773
   int nrange = 0;         /* number of range errors */
-#line 2773
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2773
   long cxp = (long) *((char**)xpp);
-#line 2773
 
-#line 2773
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2773
   /* sjl: manually stripmine so we can limit amount of
-#line 2773
    * vector work space reserved to LOOPCNT elements. Also
-#line 2773
    * makes vectorisation easy */
-#line 2773
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2773
     ni=Min(nelems-j,LOOPCNT);
-#line 2773
     if (realign) {
-#line 2773
       xp = tmp;
-#line 2773
     } else {
-#line 2773
       xp = (short *) *xpp;
-#line 2773
     }
-#line 2773
    /* copy the next block */
-#line 2773
 #pragma cdir loopcnt=LOOPCNT
-#line 2773
 #pragma cdir shortloop
-#line 2773
     for (i=0; i<ni; i++) {
-#line 2773
       /* the normal case: */
-#line 2773
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2773
      /* test for range errors (not always needed but do it anyway) */
-#line 2773
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2773
     }
-#line 2773
    /* copy workspace back if necessary */ 
-#line 2773
     if (realign) {
-#line 2773
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2773
       xp = (short *) *xpp;
-#line 2773
     }
-#line 2773
    /* update xpp and tp */
-#line 2773
     xp += ni;
-#line 2773
     tp += ni;
-#line 2773
     *xpp = (void*)xp;
-#line 2773
   }
-#line 2773
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2773
 
-#line 2773
 #else   /* not SX */
-#line 2773
 
-#line 2773
 	char *xp = (char *) *xpp;
-#line 2773
 	int status = ENOERR;
-#line 2773
 
-#line 2773
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2773
 	{
-#line 2773
 		int lstatus = ncx_put_short_double(xp, tp);
-#line 2773
 		if(lstatus != ENOERR)
-#line 2773
 			status = lstatus;
-#line 2773
 	}
-#line 2773
 
-#line 2773
 	*xpp = (void *)xp;
-#line 2773
 	return status;
-#line 2773
 #endif
-#line 2773
 }
-#line 2773
 
 int
-#line 2774
 ncx_putn_short_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2774
 {
-#line 2774
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2774
 
-#line 2774
  /* basic algorithm is:
-#line 2774
   *   - ensure sane alignment of output data
-#line 2774
   *   - copy (conversion happens automatically) input data
-#line 2774
   *     to output
-#line 2774
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2774
   *     at next location for converted output
-#line 2774
   */
-#line 2774
   long i, j, ni;
-#line 2774
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2774
   short *xp;
-#line 2774
   int nrange = 0;         /* number of range errors */
-#line 2774
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2774
   long cxp = (long) *((char**)xpp);
-#line 2774
 
-#line 2774
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2774
   /* sjl: manually stripmine so we can limit amount of
-#line 2774
    * vector work space reserved to LOOPCNT elements. Also
-#line 2774
    * makes vectorisation easy */
-#line 2774
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2774
     ni=Min(nelems-j,LOOPCNT);
-#line 2774
     if (realign) {
-#line 2774
       xp = tmp;
-#line 2774
     } else {
-#line 2774
       xp = (short *) *xpp;
-#line 2774
     }
-#line 2774
    /* copy the next block */
-#line 2774
 #pragma cdir loopcnt=LOOPCNT
-#line 2774
 #pragma cdir shortloop
-#line 2774
     for (i=0; i<ni; i++) {
-#line 2774
       /* the normal case: */
-#line 2774
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2774
      /* test for range errors (not always needed but do it anyway) */
-#line 2774
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2774
     }
-#line 2774
    /* copy workspace back if necessary */ 
-#line 2774
     if (realign) {
-#line 2774
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2774
       xp = (short *) *xpp;
-#line 2774
     }
-#line 2774
    /* update xpp and tp */
-#line 2774
     xp += ni;
-#line 2774
     tp += ni;
-#line 2774
     *xpp = (void*)xp;
-#line 2774
   }
-#line 2774
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2774
 
-#line 2774
 #else   /* not SX */
-#line 2774
 
-#line 2774
 	char *xp = (char *) *xpp;
-#line 2774
 	int status = ENOERR;
-#line 2774
 
-#line 2774
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2774
 	{
-#line 2774
 		int lstatus = ncx_put_short_uint(xp, tp);
-#line 2774
 		if(lstatus != ENOERR)
-#line 2774
 			status = lstatus;
-#line 2774
 	}
-#line 2774
 
-#line 2774
 	*xpp = (void *)xp;
-#line 2774
 	return status;
-#line 2774
 #endif
-#line 2774
 }
-#line 2774
 
 int
-#line 2775
 ncx_putn_short_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2775
 {
-#line 2775
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2775
 
-#line 2775
  /* basic algorithm is:
-#line 2775
   *   - ensure sane alignment of output data
-#line 2775
   *   - copy (conversion happens automatically) input data
-#line 2775
   *     to output
-#line 2775
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2775
   *     at next location for converted output
-#line 2775
   */
-#line 2775
   long i, j, ni;
-#line 2775
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2775
   short *xp;
-#line 2775
   int nrange = 0;         /* number of range errors */
-#line 2775
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2775
   long cxp = (long) *((char**)xpp);
-#line 2775
 
-#line 2775
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2775
   /* sjl: manually stripmine so we can limit amount of
-#line 2775
    * vector work space reserved to LOOPCNT elements. Also
-#line 2775
    * makes vectorisation easy */
-#line 2775
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2775
     ni=Min(nelems-j,LOOPCNT);
-#line 2775
     if (realign) {
-#line 2775
       xp = tmp;
-#line 2775
     } else {
-#line 2775
       xp = (short *) *xpp;
-#line 2775
     }
-#line 2775
    /* copy the next block */
-#line 2775
 #pragma cdir loopcnt=LOOPCNT
-#line 2775
 #pragma cdir shortloop
-#line 2775
     for (i=0; i<ni; i++) {
-#line 2775
       /* the normal case: */
-#line 2775
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2775
      /* test for range errors (not always needed but do it anyway) */
-#line 2775
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2775
     }
-#line 2775
    /* copy workspace back if necessary */ 
-#line 2775
     if (realign) {
-#line 2775
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2775
       xp = (short *) *xpp;
-#line 2775
     }
-#line 2775
    /* update xpp and tp */
-#line 2775
     xp += ni;
-#line 2775
     tp += ni;
-#line 2775
     *xpp = (void*)xp;
-#line 2775
   }
-#line 2775
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2775
 
-#line 2775
 #else   /* not SX */
-#line 2775
 
-#line 2775
 	char *xp = (char *) *xpp;
-#line 2775
 	int status = ENOERR;
-#line 2775
 
-#line 2775
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2775
 	{
-#line 2775
 		int lstatus = ncx_put_short_longlong(xp, tp);
-#line 2775
 		if(lstatus != ENOERR)
-#line 2775
 			status = lstatus;
-#line 2775
 	}
-#line 2775
 
-#line 2775
 	*xpp = (void *)xp;
-#line 2775
 	return status;
-#line 2775
 #endif
-#line 2775
 }
-#line 2775
 
 int
-#line 2776
 ncx_putn_short_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2776
 {
-#line 2776
 #if _SX && X_SIZEOF_SHORT == SIZEOF_SHORT
-#line 2776
 
-#line 2776
  /* basic algorithm is:
-#line 2776
   *   - ensure sane alignment of output data
-#line 2776
   *   - copy (conversion happens automatically) input data
-#line 2776
   *     to output
-#line 2776
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2776
   *     at next location for converted output
-#line 2776
   */
-#line 2776
   long i, j, ni;
-#line 2776
   short tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2776
   short *xp;
-#line 2776
   int nrange = 0;         /* number of range errors */
-#line 2776
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2776
   long cxp = (long) *((char**)xpp);
-#line 2776
 
-#line 2776
   realign = (cxp & 7) % SIZEOF_SHORT;
-#line 2776
   /* sjl: manually stripmine so we can limit amount of
-#line 2776
    * vector work space reserved to LOOPCNT elements. Also
-#line 2776
    * makes vectorisation easy */
-#line 2776
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2776
     ni=Min(nelems-j,LOOPCNT);
-#line 2776
     if (realign) {
-#line 2776
       xp = tmp;
-#line 2776
     } else {
-#line 2776
       xp = (short *) *xpp;
-#line 2776
     }
-#line 2776
    /* copy the next block */
-#line 2776
 #pragma cdir loopcnt=LOOPCNT
-#line 2776
 #pragma cdir shortloop
-#line 2776
     for (i=0; i<ni; i++) {
-#line 2776
       /* the normal case: */
-#line 2776
       xp[i] = (short) Max( X_SHORT_MIN, Min(X_SHORT_MAX, (short) tp[i]));
-#line 2776
      /* test for range errors (not always needed but do it anyway) */
-#line 2776
       nrange += tp[i] < X_SHORT_MIN || tp[i] > X_SHORT_MAX;
-#line 2776
     }
-#line 2776
    /* copy workspace back if necessary */ 
-#line 2776
     if (realign) {
-#line 2776
       memcpy(*xpp, tmp, ni*X_SIZEOF_SHORT);
-#line 2776
       xp = (short *) *xpp;
-#line 2776
     }
-#line 2776
    /* update xpp and tp */
-#line 2776
     xp += ni;
-#line 2776
     tp += ni;
-#line 2776
     *xpp = (void*)xp;
-#line 2776
   }
-#line 2776
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2776
 
-#line 2776
 #else   /* not SX */
-#line 2776
 
-#line 2776
 	char *xp = (char *) *xpp;
-#line 2776
 	int status = ENOERR;
-#line 2776
 
-#line 2776
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2776
 	{
-#line 2776
 		int lstatus = ncx_put_short_ulonglong(xp, tp);
-#line 2776
 		if(lstatus != ENOERR)
-#line 2776
 			status = lstatus;
-#line 2776
 	}
-#line 2776
 
-#line 2776
 	*xpp = (void *)xp;
-#line 2776
 	return status;
-#line 2776
 #endif
-#line 2776
 }
-#line 2776
 
 
 int
-#line 2778
 ncx_pad_putn_short_schar(void **xpp, size_t nelems, const schar *tp)
-#line 2778
 {
-#line 2778
 	const size_t rndup = nelems % 2;
-#line 2778
 
-#line 2778
 	char *xp = (char *) *xpp;
-#line 2778
 	int status = ENOERR;
-#line 2778
 
-#line 2778
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2778
 	{
-#line 2778
 		int lstatus = ncx_put_short_schar(xp, tp);
-#line 2778
 		if(lstatus != ENOERR)
-#line 2778
 			status = lstatus;
-#line 2778
 	}
-#line 2778
 
-#line 2778
 	if(rndup != 0)
-#line 2778
 	{
-#line 2778
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2778
 		xp += X_SIZEOF_SHORT;	
-#line 2778
 	}
-#line 2778
 		
-#line 2778
 	*xpp = (void *)xp;
-#line 2778
 	return status;
-#line 2778
 }
-#line 2778
 
 int
-#line 2779
 ncx_pad_putn_short_uchar(void **xpp, size_t nelems, const uchar *tp)
-#line 2779
 {
-#line 2779
 	const size_t rndup = nelems % 2;
-#line 2779
 
-#line 2779
 	char *xp = (char *) *xpp;
-#line 2779
 	int status = ENOERR;
-#line 2779
 
-#line 2779
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2779
 	{
-#line 2779
 		int lstatus = ncx_put_short_uchar(xp, tp);
-#line 2779
 		if(lstatus != ENOERR)
-#line 2779
 			status = lstatus;
-#line 2779
 	}
-#line 2779
 
-#line 2779
 	if(rndup != 0)
-#line 2779
 	{
-#line 2779
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2779
 		xp += X_SIZEOF_SHORT;	
-#line 2779
 	}
-#line 2779
 		
-#line 2779
 	*xpp = (void *)xp;
-#line 2779
 	return status;
-#line 2779
 }
-#line 2779
 
 int
-#line 2780
 ncx_pad_putn_short_short(void **xpp, size_t nelems, const short *tp)
-#line 2780
 {
-#line 2780
 	const size_t rndup = nelems % 2;
-#line 2780
 
-#line 2780
 	char *xp = (char *) *xpp;
-#line 2780
 	int status = ENOERR;
-#line 2780
 
-#line 2780
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2780
 	{
-#line 2780
 		int lstatus = ncx_put_short_short(xp, tp);
-#line 2780
 		if(lstatus != ENOERR)
-#line 2780
 			status = lstatus;
-#line 2780
 	}
-#line 2780
 
-#line 2780
 	if(rndup != 0)
-#line 2780
 	{
-#line 2780
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2780
 		xp += X_SIZEOF_SHORT;	
-#line 2780
 	}
-#line 2780
 		
-#line 2780
 	*xpp = (void *)xp;
-#line 2780
 	return status;
-#line 2780
 }
-#line 2780
 
 int
-#line 2781
 ncx_pad_putn_short_int(void **xpp, size_t nelems, const int *tp)
-#line 2781
 {
-#line 2781
 	const size_t rndup = nelems % 2;
-#line 2781
 
-#line 2781
 	char *xp = (char *) *xpp;
-#line 2781
 	int status = ENOERR;
-#line 2781
 
-#line 2781
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2781
 	{
-#line 2781
 		int lstatus = ncx_put_short_int(xp, tp);
-#line 2781
 		if(lstatus != ENOERR)
-#line 2781
 			status = lstatus;
-#line 2781
 	}
-#line 2781
 
-#line 2781
 	if(rndup != 0)
-#line 2781
 	{
-#line 2781
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2781
 		xp += X_SIZEOF_SHORT;	
-#line 2781
 	}
-#line 2781
 		
-#line 2781
 	*xpp = (void *)xp;
-#line 2781
 	return status;
-#line 2781
 }
-#line 2781
 
 int
-#line 2782
 ncx_pad_putn_short_float(void **xpp, size_t nelems, const float *tp)
-#line 2782
 {
-#line 2782
 	const size_t rndup = nelems % 2;
-#line 2782
 
-#line 2782
 	char *xp = (char *) *xpp;
-#line 2782
 	int status = ENOERR;
-#line 2782
 
-#line 2782
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2782
 	{
-#line 2782
 		int lstatus = ncx_put_short_float(xp, tp);
-#line 2782
 		if(lstatus != ENOERR)
-#line 2782
 			status = lstatus;
-#line 2782
 	}
-#line 2782
 
-#line 2782
 	if(rndup != 0)
-#line 2782
 	{
-#line 2782
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2782
 		xp += X_SIZEOF_SHORT;	
-#line 2782
 	}
-#line 2782
 		
-#line 2782
 	*xpp = (void *)xp;
-#line 2782
 	return status;
-#line 2782
 }
-#line 2782
 
 int
-#line 2783
 ncx_pad_putn_short_double(void **xpp, size_t nelems, const double *tp)
-#line 2783
 {
-#line 2783
 	const size_t rndup = nelems % 2;
-#line 2783
 
-#line 2783
 	char *xp = (char *) *xpp;
-#line 2783
 	int status = ENOERR;
-#line 2783
 
-#line 2783
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2783
 	{
-#line 2783
 		int lstatus = ncx_put_short_double(xp, tp);
-#line 2783
 		if(lstatus != ENOERR)
-#line 2783
 			status = lstatus;
-#line 2783
 	}
-#line 2783
 
-#line 2783
 	if(rndup != 0)
-#line 2783
 	{
-#line 2783
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2783
 		xp += X_SIZEOF_SHORT;	
-#line 2783
 	}
-#line 2783
 		
-#line 2783
 	*xpp = (void *)xp;
-#line 2783
 	return status;
-#line 2783
 }
-#line 2783
 
 int
-#line 2784
 ncx_pad_putn_short_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2784
 {
-#line 2784
 	const size_t rndup = nelems % 2;
-#line 2784
 
-#line 2784
 	char *xp = (char *) *xpp;
-#line 2784
 	int status = ENOERR;
-#line 2784
 
-#line 2784
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2784
 	{
-#line 2784
 		int lstatus = ncx_put_short_uint(xp, tp);
-#line 2784
 		if(lstatus != ENOERR)
-#line 2784
 			status = lstatus;
-#line 2784
 	}
-#line 2784
 
-#line 2784
 	if(rndup != 0)
-#line 2784
 	{
-#line 2784
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2784
 		xp += X_SIZEOF_SHORT;	
-#line 2784
 	}
-#line 2784
 		
-#line 2784
 	*xpp = (void *)xp;
-#line 2784
 	return status;
-#line 2784
 }
-#line 2784
 
 int
-#line 2785
 ncx_pad_putn_short_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2785
 {
-#line 2785
 	const size_t rndup = nelems % 2;
-#line 2785
 
-#line 2785
 	char *xp = (char *) *xpp;
-#line 2785
 	int status = ENOERR;
-#line 2785
 
-#line 2785
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2785
 	{
-#line 2785
 		int lstatus = ncx_put_short_longlong(xp, tp);
-#line 2785
 		if(lstatus != ENOERR)
-#line 2785
 			status = lstatus;
-#line 2785
 	}
-#line 2785
 
-#line 2785
 	if(rndup != 0)
-#line 2785
 	{
-#line 2785
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2785
 		xp += X_SIZEOF_SHORT;	
-#line 2785
 	}
-#line 2785
 		
-#line 2785
 	*xpp = (void *)xp;
-#line 2785
 	return status;
-#line 2785
 }
-#line 2785
 
 int
-#line 2786
 ncx_pad_putn_short_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2786
 {
-#line 2786
 	const size_t rndup = nelems % 2;
-#line 2786
 
-#line 2786
 	char *xp = (char *) *xpp;
-#line 2786
 	int status = ENOERR;
-#line 2786
 
-#line 2786
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
-#line 2786
 	{
-#line 2786
 		int lstatus = ncx_put_short_ulonglong(xp, tp);
-#line 2786
 		if(lstatus != ENOERR)
-#line 2786
 			status = lstatus;
-#line 2786
 	}
-#line 2786
 
-#line 2786
 	if(rndup != 0)
-#line 2786
 	{
-#line 2786
 		(void) memcpy(xp, nada, X_SIZEOF_SHORT);
-#line 2786
 		xp += X_SIZEOF_SHORT;	
-#line 2786
 	}
-#line 2786
 		
-#line 2786
 	*xpp = (void *)xp;
-#line 2786
 	return status;
-#line 2786
 }
-#line 2786
 
 
 
 /* int */
 
 int
-#line 2791
 ncx_getn_int_schar(const void **xpp, size_t nelems, schar *tp)
-#line 2791
 {
-#line 2791
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2791
 
-#line 2791
  /* basic algorithm is:
-#line 2791
   *   - ensure sane alignment of input data
-#line 2791
   *   - copy (conversion happens automatically) input data
-#line 2791
   *     to output
-#line 2791
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2791
   *     at next location for converted output
-#line 2791
   */
-#line 2791
   long i, j, ni;
-#line 2791
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2791
   int *xp;
-#line 2791
   int nrange = 0;         /* number of range errors */
-#line 2791
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2791
   long cxp = (long) *((char**)xpp);
-#line 2791
 
-#line 2791
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2791
   /* sjl: manually stripmine so we can limit amount of
-#line 2791
    * vector work space reserved to LOOPCNT elements. Also
-#line 2791
    * makes vectorisation easy */
-#line 2791
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2791
     ni=Min(nelems-j,LOOPCNT);
-#line 2791
     if (realign) {
-#line 2791
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2791
       xp = tmp;
-#line 2791
     } else {
-#line 2791
       xp = (int *) *xpp;
-#line 2791
     }
-#line 2791
    /* copy the next block */
-#line 2791
 #pragma cdir loopcnt=LOOPCNT
-#line 2791
 #pragma cdir shortloop
-#line 2791
     for (i=0; i<ni; i++) {
-#line 2791
       tp[i] = (schar) Max( SCHAR_MIN, Min(SCHAR_MAX, (schar) xp[i]));
-#line 2791
      /* test for range errors (not always needed but do it anyway) */
-#line 2791
       nrange += xp[i] < SCHAR_MIN || xp[i] > SCHAR_MAX;
-#line 2791
     }
-#line 2791
    /* update xpp and tp */
-#line 2791
     if (realign) xp = (int *) *xpp;
-#line 2791
     xp += ni;
-#line 2791
     tp += ni;
-#line 2791
     *xpp = (void*)xp;
-#line 2791
   }
-#line 2791
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2791
 
-#line 2791
 #else   /* not SX */
-#line 2791
 	const char *xp = (const char *) *xpp;
-#line 2791
 	int status = ENOERR;
-#line 2791
 
-#line 2791
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2791
 	{
-#line 2791
 		const int lstatus = ncx_get_int_schar(xp, tp);
-#line 2791
 		if(lstatus != ENOERR)
-#line 2791
 			status = lstatus;
-#line 2791
 	}
-#line 2791
 
-#line 2791
 	*xpp = (const void *)xp;
-#line 2791
 	return status;
-#line 2791
 #  endif
-#line 2791
 }
-#line 2791
 
 int
-#line 2792
 ncx_getn_int_uchar(const void **xpp, size_t nelems, uchar *tp)
-#line 2792
 {
-#line 2792
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2792
 
-#line 2792
  /* basic algorithm is:
-#line 2792
   *   - ensure sane alignment of input data
-#line 2792
   *   - copy (conversion happens automatically) input data
-#line 2792
   *     to output
-#line 2792
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2792
   *     at next location for converted output
-#line 2792
   */
-#line 2792
   long i, j, ni;
-#line 2792
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2792
   int *xp;
-#line 2792
   int nrange = 0;         /* number of range errors */
-#line 2792
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2792
   long cxp = (long) *((char**)xpp);
-#line 2792
 
-#line 2792
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2792
   /* sjl: manually stripmine so we can limit amount of
-#line 2792
    * vector work space reserved to LOOPCNT elements. Also
-#line 2792
    * makes vectorisation easy */
-#line 2792
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2792
     ni=Min(nelems-j,LOOPCNT);
-#line 2792
     if (realign) {
-#line 2792
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2792
       xp = tmp;
-#line 2792
     } else {
-#line 2792
       xp = (int *) *xpp;
-#line 2792
     }
-#line 2792
    /* copy the next block */
-#line 2792
 #pragma cdir loopcnt=LOOPCNT
-#line 2792
 #pragma cdir shortloop
-#line 2792
     for (i=0; i<ni; i++) {
-#line 2792
       tp[i] = (uchar) Max( UCHAR_MIN, Min(UCHAR_MAX, (uchar) xp[i]));
-#line 2792
      /* test for range errors (not always needed but do it anyway) */
-#line 2792
       nrange += xp[i] < UCHAR_MIN || xp[i] > UCHAR_MAX;
-#line 2792
     }
-#line 2792
    /* update xpp and tp */
-#line 2792
     if (realign) xp = (int *) *xpp;
-#line 2792
     xp += ni;
-#line 2792
     tp += ni;
-#line 2792
     *xpp = (void*)xp;
-#line 2792
   }
-#line 2792
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2792
 
-#line 2792
 #else   /* not SX */
-#line 2792
 	const char *xp = (const char *) *xpp;
-#line 2792
 	int status = ENOERR;
-#line 2792
 
-#line 2792
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2792
 	{
-#line 2792
 		const int lstatus = ncx_get_int_uchar(xp, tp);
-#line 2792
 		if(lstatus != ENOERR)
-#line 2792
 			status = lstatus;
-#line 2792
 	}
-#line 2792
 
-#line 2792
 	*xpp = (const void *)xp;
-#line 2792
 	return status;
-#line 2792
 #  endif
-#line 2792
 }
-#line 2792
 
 int
-#line 2793
 ncx_getn_int_short(const void **xpp, size_t nelems, short *tp)
-#line 2793
 {
-#line 2793
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2793
 
-#line 2793
  /* basic algorithm is:
-#line 2793
   *   - ensure sane alignment of input data
-#line 2793
   *   - copy (conversion happens automatically) input data
-#line 2793
   *     to output
-#line 2793
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2793
   *     at next location for converted output
-#line 2793
   */
-#line 2793
   long i, j, ni;
-#line 2793
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2793
   int *xp;
-#line 2793
   int nrange = 0;         /* number of range errors */
-#line 2793
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2793
   long cxp = (long) *((char**)xpp);
-#line 2793
 
-#line 2793
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2793
   /* sjl: manually stripmine so we can limit amount of
-#line 2793
    * vector work space reserved to LOOPCNT elements. Also
-#line 2793
    * makes vectorisation easy */
-#line 2793
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2793
     ni=Min(nelems-j,LOOPCNT);
-#line 2793
     if (realign) {
-#line 2793
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2793
       xp = tmp;
-#line 2793
     } else {
-#line 2793
       xp = (int *) *xpp;
-#line 2793
     }
-#line 2793
    /* copy the next block */
-#line 2793
 #pragma cdir loopcnt=LOOPCNT
-#line 2793
 #pragma cdir shortloop
-#line 2793
     for (i=0; i<ni; i++) {
-#line 2793
       tp[i] = (short) Max( SHORT_MIN, Min(SHORT_MAX, (short) xp[i]));
-#line 2793
      /* test for range errors (not always needed but do it anyway) */
-#line 2793
       nrange += xp[i] < SHORT_MIN || xp[i] > SHORT_MAX;
-#line 2793
     }
-#line 2793
    /* update xpp and tp */
-#line 2793
     if (realign) xp = (int *) *xpp;
-#line 2793
     xp += ni;
-#line 2793
     tp += ni;
-#line 2793
     *xpp = (void*)xp;
-#line 2793
   }
-#line 2793
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2793
 
-#line 2793
 #else   /* not SX */
-#line 2793
 	const char *xp = (const char *) *xpp;
-#line 2793
 	int status = ENOERR;
-#line 2793
 
-#line 2793
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2793
 	{
-#line 2793
 		const int lstatus = ncx_get_int_short(xp, tp);
-#line 2793
 		if(lstatus != ENOERR)
-#line 2793
 			status = lstatus;
-#line 2793
 	}
-#line 2793
 
-#line 2793
 	*xpp = (const void *)xp;
-#line 2793
 	return status;
-#line 2793
 #  endif
-#line 2793
 }
-#line 2793
 
 #if X_SIZEOF_INT == SIZEOF_INT
 /* optimized version */
@@ -7360,1163 +4698,590 @@ ncx_getn_int_uint(const void **xpp, size_t nelems, unsigned int *tp)
 }
 #else
 int
-#line 2819
 ncx_getn_int_int(const void **xpp, size_t nelems, int *tp)
-#line 2819
 {
-#line 2819
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2819
 
-#line 2819
  /* basic algorithm is:
-#line 2819
   *   - ensure sane alignment of input data
-#line 2819
   *   - copy (conversion happens automatically) input data
-#line 2819
   *     to output
-#line 2819
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2819
   *     at next location for converted output
-#line 2819
   */
-#line 2819
   long i, j, ni;
-#line 2819
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2819
   int *xp;
-#line 2819
   int nrange = 0;         /* number of range errors */
-#line 2819
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2819
   long cxp = (long) *((char**)xpp);
-#line 2819
 
-#line 2819
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2819
   /* sjl: manually stripmine so we can limit amount of
-#line 2819
    * vector work space reserved to LOOPCNT elements. Also
-#line 2819
    * makes vectorisation easy */
-#line 2819
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2819
     ni=Min(nelems-j,LOOPCNT);
-#line 2819
     if (realign) {
-#line 2819
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2819
       xp = tmp;
-#line 2819
     } else {
-#line 2819
       xp = (int *) *xpp;
-#line 2819
     }
-#line 2819
    /* copy the next block */
-#line 2819
 #pragma cdir loopcnt=LOOPCNT
-#line 2819
 #pragma cdir shortloop
-#line 2819
     for (i=0; i<ni; i++) {
-#line 2819
       tp[i] = (int) Max( INT_MIN, Min(INT_MAX, (int) xp[i]));
-#line 2819
      /* test for range errors (not always needed but do it anyway) */
-#line 2819
       nrange += xp[i] < INT_MIN || xp[i] > INT_MAX;
-#line 2819
     }
-#line 2819
    /* update xpp and tp */
-#line 2819
     if (realign) xp = (int *) *xpp;
-#line 2819
     xp += ni;
-#line 2819
     tp += ni;
-#line 2819
     *xpp = (void*)xp;
-#line 2819
   }
-#line 2819
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2819
 
-#line 2819
 #else   /* not SX */
-#line 2819
 	const char *xp = (const char *) *xpp;
-#line 2819
 	int status = ENOERR;
-#line 2819
 
-#line 2819
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2819
 	{
-#line 2819
 		const int lstatus = ncx_get_int_int(xp, tp);
-#line 2819
 		if(lstatus != ENOERR)
-#line 2819
 			status = lstatus;
-#line 2819
 	}
-#line 2819
 
-#line 2819
 	*xpp = (const void *)xp;
-#line 2819
 	return status;
-#line 2819
 #  endif
-#line 2819
 }
-#line 2819
 
 int
-#line 2820
 ncx_getn_int_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2820
 {
-#line 2820
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2820
 
-#line 2820
  /* basic algorithm is:
-#line 2820
   *   - ensure sane alignment of input data
-#line 2820
   *   - copy (conversion happens automatically) input data
-#line 2820
   *     to output
-#line 2820
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2820
   *     at next location for converted output
-#line 2820
   */
-#line 2820
   long i, j, ni;
-#line 2820
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2820
   int *xp;
-#line 2820
   int nrange = 0;         /* number of range errors */
-#line 2820
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2820
   long cxp = (long) *((char**)xpp);
-#line 2820
 
-#line 2820
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2820
   /* sjl: manually stripmine so we can limit amount of
-#line 2820
    * vector work space reserved to LOOPCNT elements. Also
-#line 2820
    * makes vectorisation easy */
-#line 2820
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2820
     ni=Min(nelems-j,LOOPCNT);
-#line 2820
     if (realign) {
-#line 2820
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2820
       xp = tmp;
-#line 2820
     } else {
-#line 2820
       xp = (int *) *xpp;
-#line 2820
     }
-#line 2820
    /* copy the next block */
-#line 2820
 #pragma cdir loopcnt=LOOPCNT
-#line 2820
 #pragma cdir shortloop
-#line 2820
     for (i=0; i<ni; i++) {
-#line 2820
       tp[i] = (uint) Max( UINT_MIN, Min(UINT_MAX, (uint) xp[i]));
-#line 2820
      /* test for range errors (not always needed but do it anyway) */
-#line 2820
       nrange += xp[i] < UINT_MIN || xp[i] > UINT_MAX;
-#line 2820
     }
-#line 2820
    /* update xpp and tp */
-#line 2820
     if (realign) xp = (int *) *xpp;
-#line 2820
     xp += ni;
-#line 2820
     tp += ni;
-#line 2820
     *xpp = (void*)xp;
-#line 2820
   }
-#line 2820
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2820
 
-#line 2820
 #else   /* not SX */
-#line 2820
 	const char *xp = (const char *) *xpp;
-#line 2820
 	int status = ENOERR;
-#line 2820
 
-#line 2820
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2820
 	{
-#line 2820
 		const int lstatus = ncx_get_int_uint(xp, tp);
-#line 2820
 		if(lstatus != ENOERR)
-#line 2820
 			status = lstatus;
-#line 2820
 	}
-#line 2820
 
-#line 2820
 	*xpp = (const void *)xp;
-#line 2820
 	return status;
-#line 2820
 #  endif
-#line 2820
 }
-#line 2820
 
 #endif
 
 int
-#line 2823
 ncx_getn_int_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2823
 {
-#line 2823
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2823
 
-#line 2823
  /* basic algorithm is:
-#line 2823
   *   - ensure sane alignment of input data
-#line 2823
   *   - copy (conversion happens automatically) input data
-#line 2823
   *     to output
-#line 2823
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2823
   *     at next location for converted output
-#line 2823
   */
-#line 2823
   long i, j, ni;
-#line 2823
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2823
   int *xp;
-#line 2823
   int nrange = 0;         /* number of range errors */
-#line 2823
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2823
   long cxp = (long) *((char**)xpp);
-#line 2823
 
-#line 2823
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2823
   /* sjl: manually stripmine so we can limit amount of
-#line 2823
    * vector work space reserved to LOOPCNT elements. Also
-#line 2823
    * makes vectorisation easy */
-#line 2823
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2823
     ni=Min(nelems-j,LOOPCNT);
-#line 2823
     if (realign) {
-#line 2823
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2823
       xp = tmp;
-#line 2823
     } else {
-#line 2823
       xp = (int *) *xpp;
-#line 2823
     }
-#line 2823
    /* copy the next block */
-#line 2823
 #pragma cdir loopcnt=LOOPCNT
-#line 2823
 #pragma cdir shortloop
-#line 2823
     for (i=0; i<ni; i++) {
-#line 2823
       tp[i] = (longlong) Max( LONGLONG_MIN, Min(LONGLONG_MAX, (longlong) xp[i]));
-#line 2823
      /* test for range errors (not always needed but do it anyway) */
-#line 2823
       nrange += xp[i] < LONGLONG_MIN || xp[i] > LONGLONG_MAX;
-#line 2823
     }
-#line 2823
    /* update xpp and tp */
-#line 2823
     if (realign) xp = (int *) *xpp;
-#line 2823
     xp += ni;
-#line 2823
     tp += ni;
-#line 2823
     *xpp = (void*)xp;
-#line 2823
   }
-#line 2823
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2823
 
-#line 2823
 #else   /* not SX */
-#line 2823
 	const char *xp = (const char *) *xpp;
-#line 2823
 	int status = ENOERR;
-#line 2823
 
-#line 2823
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2823
 	{
-#line 2823
 		const int lstatus = ncx_get_int_longlong(xp, tp);
-#line 2823
 		if(lstatus != ENOERR)
-#line 2823
 			status = lstatus;
-#line 2823
 	}
-#line 2823
 
-#line 2823
 	*xpp = (const void *)xp;
-#line 2823
 	return status;
-#line 2823
 #  endif
-#line 2823
 }
-#line 2823
 
 int
-#line 2824
 ncx_getn_int_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2824
 {
-#line 2824
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2824
 
-#line 2824
  /* basic algorithm is:
-#line 2824
   *   - ensure sane alignment of input data
-#line 2824
   *   - copy (conversion happens automatically) input data
-#line 2824
   *     to output
-#line 2824
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2824
   *     at next location for converted output
-#line 2824
   */
-#line 2824
   long i, j, ni;
-#line 2824
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2824
   int *xp;
-#line 2824
   int nrange = 0;         /* number of range errors */
-#line 2824
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2824
   long cxp = (long) *((char**)xpp);
-#line 2824
 
-#line 2824
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2824
   /* sjl: manually stripmine so we can limit amount of
-#line 2824
    * vector work space reserved to LOOPCNT elements. Also
-#line 2824
    * makes vectorisation easy */
-#line 2824
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2824
     ni=Min(nelems-j,LOOPCNT);
-#line 2824
     if (realign) {
-#line 2824
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2824
       xp = tmp;
-#line 2824
     } else {
-#line 2824
       xp = (int *) *xpp;
-#line 2824
     }
-#line 2824
    /* copy the next block */
-#line 2824
 #pragma cdir loopcnt=LOOPCNT
-#line 2824
 #pragma cdir shortloop
-#line 2824
     for (i=0; i<ni; i++) {
-#line 2824
       tp[i] = (ulonglong) Max( ULONGLONG_MIN, Min(ULONGLONG_MAX, (ulonglong) xp[i]));
-#line 2824
      /* test for range errors (not always needed but do it anyway) */
-#line 2824
       nrange += xp[i] < ULONGLONG_MIN || xp[i] > ULONGLONG_MAX;
-#line 2824
     }
-#line 2824
    /* update xpp and tp */
-#line 2824
     if (realign) xp = (int *) *xpp;
-#line 2824
     xp += ni;
-#line 2824
     tp += ni;
-#line 2824
     *xpp = (void*)xp;
-#line 2824
   }
-#line 2824
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2824
 
-#line 2824
 #else   /* not SX */
-#line 2824
 	const char *xp = (const char *) *xpp;
-#line 2824
 	int status = ENOERR;
-#line 2824
 
-#line 2824
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2824
 	{
-#line 2824
 		const int lstatus = ncx_get_int_ulonglong(xp, tp);
-#line 2824
 		if(lstatus != ENOERR)
-#line 2824
 			status = lstatus;
-#line 2824
 	}
-#line 2824
 
-#line 2824
 	*xpp = (const void *)xp;
-#line 2824
 	return status;
-#line 2824
 #  endif
-#line 2824
 }
-#line 2824
 
 
 int
-#line 2826
 ncx_getn_int_float(const void **xpp, size_t nelems, float *tp)
-#line 2826
 {
-#line 2826
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2826
 
-#line 2826
  /* basic algorithm is:
-#line 2826
   *   - ensure sane alignment of input data
-#line 2826
   *   - copy (conversion happens automatically) input data
-#line 2826
   *     to output
-#line 2826
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2826
   *     at next location for converted output
-#line 2826
   */
-#line 2826
   long i, j, ni;
-#line 2826
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2826
   int *xp;
-#line 2826
   int nrange = 0;         /* number of range errors */
-#line 2826
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2826
   long cxp = (long) *((char**)xpp);
-#line 2826
 
-#line 2826
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2826
   /* sjl: manually stripmine so we can limit amount of
-#line 2826
    * vector work space reserved to LOOPCNT elements. Also
-#line 2826
    * makes vectorisation easy */
-#line 2826
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2826
     ni=Min(nelems-j,LOOPCNT);
-#line 2826
     if (realign) {
-#line 2826
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2826
       xp = tmp;
-#line 2826
     } else {
-#line 2826
       xp = (int *) *xpp;
-#line 2826
     }
-#line 2826
    /* copy the next block */
-#line 2826
 #pragma cdir loopcnt=LOOPCNT
-#line 2826
 #pragma cdir shortloop
-#line 2826
     for (i=0; i<ni; i++) {
-#line 2826
       tp[i] = (float) Max( FLOAT_MIN, Min(FLOAT_MAX, (float) xp[i]));
-#line 2826
      /* test for range errors (not always needed but do it anyway) */
-#line 2826
       nrange += xp[i] < FLOAT_MIN || xp[i] > FLOAT_MAX;
-#line 2826
     }
-#line 2826
    /* update xpp and tp */
-#line 2826
     if (realign) xp = (int *) *xpp;
-#line 2826
     xp += ni;
-#line 2826
     tp += ni;
-#line 2826
     *xpp = (void*)xp;
-#line 2826
   }
-#line 2826
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2826
 
-#line 2826
 #else   /* not SX */
-#line 2826
 	const char *xp = (const char *) *xpp;
-#line 2826
 	int status = ENOERR;
-#line 2826
 
-#line 2826
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2826
 	{
-#line 2826
 		const int lstatus = ncx_get_int_float(xp, tp);
-#line 2826
 		if(lstatus != ENOERR)
-#line 2826
 			status = lstatus;
-#line 2826
 	}
-#line 2826
 
-#line 2826
 	*xpp = (const void *)xp;
-#line 2826
 	return status;
-#line 2826
 #  endif
-#line 2826
 }
-#line 2826
 
 int
-#line 2827
 ncx_getn_int_double(const void **xpp, size_t nelems, double *tp)
-#line 2827
 {
-#line 2827
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2827
 
-#line 2827
  /* basic algorithm is:
-#line 2827
   *   - ensure sane alignment of input data
-#line 2827
   *   - copy (conversion happens automatically) input data
-#line 2827
   *     to output
-#line 2827
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2827
   *     at next location for converted output
-#line 2827
   */
-#line 2827
   long i, j, ni;
-#line 2827
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2827
   int *xp;
-#line 2827
   int nrange = 0;         /* number of range errors */
-#line 2827
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2827
   long cxp = (long) *((char**)xpp);
-#line 2827
 
-#line 2827
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2827
   /* sjl: manually stripmine so we can limit amount of
-#line 2827
    * vector work space reserved to LOOPCNT elements. Also
-#line 2827
    * makes vectorisation easy */
-#line 2827
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2827
     ni=Min(nelems-j,LOOPCNT);
-#line 2827
     if (realign) {
-#line 2827
       memcpy(tmp, *xpp, ni*SIZEOF_INT);
-#line 2827
       xp = tmp;
-#line 2827
     } else {
-#line 2827
       xp = (int *) *xpp;
-#line 2827
     }
-#line 2827
    /* copy the next block */
-#line 2827
 #pragma cdir loopcnt=LOOPCNT
-#line 2827
 #pragma cdir shortloop
-#line 2827
     for (i=0; i<ni; i++) {
-#line 2827
       tp[i] = (double) Max( DOUBLE_MIN, Min(DOUBLE_MAX, (double) xp[i]));
-#line 2827
      /* test for range errors (not always needed but do it anyway) */
-#line 2827
       nrange += xp[i] < DOUBLE_MIN || xp[i] > DOUBLE_MAX;
-#line 2827
     }
-#line 2827
    /* update xpp and tp */
-#line 2827
     if (realign) xp = (int *) *xpp;
-#line 2827
     xp += ni;
-#line 2827
     tp += ni;
-#line 2827
     *xpp = (void*)xp;
-#line 2827
   }
-#line 2827
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2827
 
-#line 2827
 #else   /* not SX */
-#line 2827
 	const char *xp = (const char *) *xpp;
-#line 2827
 	int status = ENOERR;
-#line 2827
 
-#line 2827
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2827
 	{
-#line 2827
 		const int lstatus = ncx_get_int_double(xp, tp);
-#line 2827
 		if(lstatus != ENOERR)
-#line 2827
 			status = lstatus;
-#line 2827
 	}
-#line 2827
 
-#line 2827
 	*xpp = (const void *)xp;
-#line 2827
 	return status;
-#line 2827
 #  endif
-#line 2827
 }
-#line 2827
 
 
 int
-#line 2829
 ncx_putn_int_schar(void **xpp, size_t nelems, const schar *tp)
-#line 2829
 {
-#line 2829
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2829
 
-#line 2829
  /* basic algorithm is:
-#line 2829
   *   - ensure sane alignment of output data
-#line 2829
   *   - copy (conversion happens automatically) input data
-#line 2829
   *     to output
-#line 2829
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2829
   *     at next location for converted output
-#line 2829
   */
-#line 2829
   long i, j, ni;
-#line 2829
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2829
   int *xp;
-#line 2829
   int nrange = 0;         /* number of range errors */
-#line 2829
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2829
   long cxp = (long) *((char**)xpp);
-#line 2829
 
-#line 2829
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2829
   /* sjl: manually stripmine so we can limit amount of
-#line 2829
    * vector work space reserved to LOOPCNT elements. Also
-#line 2829
    * makes vectorisation easy */
-#line 2829
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2829
     ni=Min(nelems-j,LOOPCNT);
-#line 2829
     if (realign) {
-#line 2829
       xp = tmp;
-#line 2829
     } else {
-#line 2829
       xp = (int *) *xpp;
-#line 2829
     }
-#line 2829
    /* copy the next block */
-#line 2829
 #pragma cdir loopcnt=LOOPCNT
-#line 2829
 #pragma cdir shortloop
-#line 2829
     for (i=0; i<ni; i++) {
-#line 2829
       /* the normal case: */
-#line 2829
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2829
      /* test for range errors (not always needed but do it anyway) */
-#line 2829
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2829
     }
-#line 2829
    /* copy workspace back if necessary */ 
-#line 2829
     if (realign) {
-#line 2829
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2829
       xp = (int *) *xpp;
-#line 2829
     }
-#line 2829
    /* update xpp and tp */
-#line 2829
     xp += ni;
-#line 2829
     tp += ni;
-#line 2829
     *xpp = (void*)xp;
-#line 2829
   }
-#line 2829
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2829
 
-#line 2829
 #else   /* not SX */
-#line 2829
 
-#line 2829
 	char *xp = (char *) *xpp;
-#line 2829
 	int status = ENOERR;
-#line 2829
 
-#line 2829
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2829
 	{
-#line 2829
 		int lstatus = ncx_put_int_schar(xp, tp);
-#line 2829
 		if(lstatus != ENOERR)
-#line 2829
 			status = lstatus;
-#line 2829
 	}
-#line 2829
 
-#line 2829
 	*xpp = (void *)xp;
-#line 2829
 	return status;
-#line 2829
 #endif
-#line 2829
 }
-#line 2829
 
 int
-#line 2830
 ncx_putn_int_uchar(void **xpp, size_t nelems, const uchar *tp)
-#line 2830
 {
-#line 2830
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2830
 
-#line 2830
  /* basic algorithm is:
-#line 2830
   *   - ensure sane alignment of output data
-#line 2830
   *   - copy (conversion happens automatically) input data
-#line 2830
   *     to output
-#line 2830
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2830
   *     at next location for converted output
-#line 2830
   */
-#line 2830
   long i, j, ni;
-#line 2830
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2830
   int *xp;
-#line 2830
   int nrange = 0;         /* number of range errors */
-#line 2830
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2830
   long cxp = (long) *((char**)xpp);
-#line 2830
 
-#line 2830
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2830
   /* sjl: manually stripmine so we can limit amount of
-#line 2830
    * vector work space reserved to LOOPCNT elements. Also
-#line 2830
    * makes vectorisation easy */
-#line 2830
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2830
     ni=Min(nelems-j,LOOPCNT);
-#line 2830
     if (realign) {
-#line 2830
       xp = tmp;
-#line 2830
     } else {
-#line 2830
       xp = (int *) *xpp;
-#line 2830
     }
-#line 2830
    /* copy the next block */
-#line 2830
 #pragma cdir loopcnt=LOOPCNT
-#line 2830
 #pragma cdir shortloop
-#line 2830
     for (i=0; i<ni; i++) {
-#line 2830
       /* the normal case: */
-#line 2830
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2830
      /* test for range errors (not always needed but do it anyway) */
-#line 2830
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2830
     }
-#line 2830
    /* copy workspace back if necessary */ 
-#line 2830
     if (realign) {
-#line 2830
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2830
       xp = (int *) *xpp;
-#line 2830
     }
-#line 2830
    /* update xpp and tp */
-#line 2830
     xp += ni;
-#line 2830
     tp += ni;
-#line 2830
     *xpp = (void*)xp;
-#line 2830
   }
-#line 2830
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2830
 
-#line 2830
 #else   /* not SX */
-#line 2830
 
-#line 2830
 	char *xp = (char *) *xpp;
-#line 2830
 	int status = ENOERR;
-#line 2830
 
-#line 2830
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2830
 	{
-#line 2830
 		int lstatus = ncx_put_int_uchar(xp, tp);
-#line 2830
 		if(lstatus != ENOERR)
-#line 2830
 			status = lstatus;
-#line 2830
 	}
-#line 2830
 
-#line 2830
 	*xpp = (void *)xp;
-#line 2830
 	return status;
-#line 2830
 #endif
-#line 2830
 }
-#line 2830
 
 int
-#line 2831
 ncx_putn_int_short(void **xpp, size_t nelems, const short *tp)
-#line 2831
 {
-#line 2831
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2831
 
-#line 2831
  /* basic algorithm is:
-#line 2831
   *   - ensure sane alignment of output data
-#line 2831
   *   - copy (conversion happens automatically) input data
-#line 2831
   *     to output
-#line 2831
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2831
   *     at next location for converted output
-#line 2831
   */
-#line 2831
   long i, j, ni;
-#line 2831
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2831
   int *xp;
-#line 2831
   int nrange = 0;         /* number of range errors */
-#line 2831
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2831
   long cxp = (long) *((char**)xpp);
-#line 2831
 
-#line 2831
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2831
   /* sjl: manually stripmine so we can limit amount of
-#line 2831
    * vector work space reserved to LOOPCNT elements. Also
-#line 2831
    * makes vectorisation easy */
-#line 2831
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2831
     ni=Min(nelems-j,LOOPCNT);
-#line 2831
     if (realign) {
-#line 2831
       xp = tmp;
-#line 2831
     } else {
-#line 2831
       xp = (int *) *xpp;
-#line 2831
     }
-#line 2831
    /* copy the next block */
-#line 2831
 #pragma cdir loopcnt=LOOPCNT
-#line 2831
 #pragma cdir shortloop
-#line 2831
     for (i=0; i<ni; i++) {
-#line 2831
       /* the normal case: */
-#line 2831
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2831
      /* test for range errors (not always needed but do it anyway) */
-#line 2831
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2831
     }
-#line 2831
    /* copy workspace back if necessary */ 
-#line 2831
     if (realign) {
-#line 2831
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2831
       xp = (int *) *xpp;
-#line 2831
     }
-#line 2831
    /* update xpp and tp */
-#line 2831
     xp += ni;
-#line 2831
     tp += ni;
-#line 2831
     *xpp = (void*)xp;
-#line 2831
   }
-#line 2831
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2831
 
-#line 2831
 #else   /* not SX */
-#line 2831
 
-#line 2831
 	char *xp = (char *) *xpp;
-#line 2831
 	int status = ENOERR;
-#line 2831
 
-#line 2831
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2831
 	{
-#line 2831
 		int lstatus = ncx_put_int_short(xp, tp);
-#line 2831
 		if(lstatus != ENOERR)
-#line 2831
 			status = lstatus;
-#line 2831
 	}
-#line 2831
 
-#line 2831
 	*xpp = (void *)xp;
-#line 2831
 	return status;
-#line 2831
 #endif
-#line 2831
 }
-#line 2831
 
 #if X_SIZEOF_INT == SIZEOF_INT
 /* optimized version */
@@ -8544,1322 +5309,671 @@ ncx_putn_int_uint(void **xpp, size_t nelems, const unsigned int *tp)
 }
 #else
 int
-#line 2857
 ncx_putn_int_int(void **xpp, size_t nelems, const int *tp)
-#line 2857
 {
-#line 2857
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2857
 
-#line 2857
  /* basic algorithm is:
-#line 2857
   *   - ensure sane alignment of output data
-#line 2857
   *   - copy (conversion happens automatically) input data
-#line 2857
   *     to output
-#line 2857
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2857
   *     at next location for converted output
-#line 2857
   */
-#line 2857
   long i, j, ni;
-#line 2857
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2857
   int *xp;
-#line 2857
   int nrange = 0;         /* number of range errors */
-#line 2857
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2857
   long cxp = (long) *((char**)xpp);
-#line 2857
 
-#line 2857
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2857
   /* sjl: manually stripmine so we can limit amount of
-#line 2857
    * vector work space reserved to LOOPCNT elements. Also
-#line 2857
    * makes vectorisation easy */
-#line 2857
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2857
     ni=Min(nelems-j,LOOPCNT);
-#line 2857
     if (realign) {
-#line 2857
       xp = tmp;
-#line 2857
     } else {
-#line 2857
       xp = (int *) *xpp;
-#line 2857
     }
-#line 2857
    /* copy the next block */
-#line 2857
 #pragma cdir loopcnt=LOOPCNT
-#line 2857
 #pragma cdir shortloop
-#line 2857
     for (i=0; i<ni; i++) {
-#line 2857
       /* the normal case: */
-#line 2857
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2857
      /* test for range errors (not always needed but do it anyway) */
-#line 2857
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2857
     }
-#line 2857
    /* copy workspace back if necessary */ 
-#line 2857
     if (realign) {
-#line 2857
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2857
       xp = (int *) *xpp;
-#line 2857
     }
-#line 2857
    /* update xpp and tp */
-#line 2857
     xp += ni;
-#line 2857
     tp += ni;
-#line 2857
     *xpp = (void*)xp;
-#line 2857
   }
-#line 2857
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2857
 
-#line 2857
 #else   /* not SX */
-#line 2857
 
-#line 2857
 	char *xp = (char *) *xpp;
-#line 2857
 	int status = ENOERR;
-#line 2857
 
-#line 2857
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2857
 	{
-#line 2857
 		int lstatus = ncx_put_int_int(xp, tp);
-#line 2857
 		if(lstatus != ENOERR)
-#line 2857
 			status = lstatus;
-#line 2857
 	}
-#line 2857
 
-#line 2857
 	*xpp = (void *)xp;
-#line 2857
 	return status;
-#line 2857
 #endif
-#line 2857
 }
-#line 2857
 
 int
-#line 2858
 ncx_putn_int_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2858
 {
-#line 2858
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2858
 
-#line 2858
  /* basic algorithm is:
-#line 2858
   *   - ensure sane alignment of output data
-#line 2858
   *   - copy (conversion happens automatically) input data
-#line 2858
   *     to output
-#line 2858
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2858
   *     at next location for converted output
-#line 2858
   */
-#line 2858
   long i, j, ni;
-#line 2858
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2858
   int *xp;
-#line 2858
   int nrange = 0;         /* number of range errors */
-#line 2858
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2858
   long cxp = (long) *((char**)xpp);
-#line 2858
 
-#line 2858
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2858
   /* sjl: manually stripmine so we can limit amount of
-#line 2858
    * vector work space reserved to LOOPCNT elements. Also
-#line 2858
    * makes vectorisation easy */
-#line 2858
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2858
     ni=Min(nelems-j,LOOPCNT);
-#line 2858
     if (realign) {
-#line 2858
       xp = tmp;
-#line 2858
     } else {
-#line 2858
       xp = (int *) *xpp;
-#line 2858
     }
-#line 2858
    /* copy the next block */
-#line 2858
 #pragma cdir loopcnt=LOOPCNT
-#line 2858
 #pragma cdir shortloop
-#line 2858
     for (i=0; i<ni; i++) {
-#line 2858
       /* the normal case: */
-#line 2858
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2858
      /* test for range errors (not always needed but do it anyway) */
-#line 2858
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2858
     }
-#line 2858
    /* copy workspace back if necessary */ 
-#line 2858
     if (realign) {
-#line 2858
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2858
       xp = (int *) *xpp;
-#line 2858
     }
-#line 2858
    /* update xpp and tp */
-#line 2858
     xp += ni;
-#line 2858
     tp += ni;
-#line 2858
     *xpp = (void*)xp;
-#line 2858
   }
-#line 2858
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2858
 
-#line 2858
 #else   /* not SX */
-#line 2858
 
-#line 2858
 	char *xp = (char *) *xpp;
-#line 2858
 	int status = ENOERR;
-#line 2858
 
-#line 2858
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2858
 	{
-#line 2858
 		int lstatus = ncx_put_int_uint(xp, tp);
-#line 2858
 		if(lstatus != ENOERR)
-#line 2858
 			status = lstatus;
-#line 2858
 	}
-#line 2858
 
-#line 2858
 	*xpp = (void *)xp;
-#line 2858
 	return status;
-#line 2858
 #endif
-#line 2858
 }
-#line 2858
 
 #endif
 
 int
-#line 2861
 ncx_putn_int_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2861
 {
-#line 2861
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2861
 
-#line 2861
  /* basic algorithm is:
-#line 2861
   *   - ensure sane alignment of output data
-#line 2861
   *   - copy (conversion happens automatically) input data
-#line 2861
   *     to output
-#line 2861
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2861
   *     at next location for converted output
-#line 2861
   */
-#line 2861
   long i, j, ni;
-#line 2861
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2861
   int *xp;
-#line 2861
   int nrange = 0;         /* number of range errors */
-#line 2861
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2861
   long cxp = (long) *((char**)xpp);
-#line 2861
 
-#line 2861
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2861
   /* sjl: manually stripmine so we can limit amount of
-#line 2861
    * vector work space reserved to LOOPCNT elements. Also
-#line 2861
    * makes vectorisation easy */
-#line 2861
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2861
     ni=Min(nelems-j,LOOPCNT);
-#line 2861
     if (realign) {
-#line 2861
       xp = tmp;
-#line 2861
     } else {
-#line 2861
       xp = (int *) *xpp;
-#line 2861
     }
-#line 2861
    /* copy the next block */
-#line 2861
 #pragma cdir loopcnt=LOOPCNT
-#line 2861
 #pragma cdir shortloop
-#line 2861
     for (i=0; i<ni; i++) {
-#line 2861
       /* the normal case: */
-#line 2861
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2861
      /* test for range errors (not always needed but do it anyway) */
-#line 2861
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2861
     }
-#line 2861
    /* copy workspace back if necessary */ 
-#line 2861
     if (realign) {
-#line 2861
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2861
       xp = (int *) *xpp;
-#line 2861
     }
-#line 2861
    /* update xpp and tp */
-#line 2861
     xp += ni;
-#line 2861
     tp += ni;
-#line 2861
     *xpp = (void*)xp;
-#line 2861
   }
-#line 2861
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2861
 
-#line 2861
 #else   /* not SX */
-#line 2861
 
-#line 2861
 	char *xp = (char *) *xpp;
-#line 2861
 	int status = ENOERR;
-#line 2861
 
-#line 2861
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2861
 	{
-#line 2861
 		int lstatus = ncx_put_int_longlong(xp, tp);
-#line 2861
 		if(lstatus != ENOERR)
-#line 2861
 			status = lstatus;
-#line 2861
 	}
-#line 2861
 
-#line 2861
 	*xpp = (void *)xp;
-#line 2861
 	return status;
-#line 2861
 #endif
-#line 2861
 }
-#line 2861
 
 int
-#line 2862
 ncx_putn_int_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2862
 {
-#line 2862
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2862
 
-#line 2862
  /* basic algorithm is:
-#line 2862
   *   - ensure sane alignment of output data
-#line 2862
   *   - copy (conversion happens automatically) input data
-#line 2862
   *     to output
-#line 2862
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2862
   *     at next location for converted output
-#line 2862
   */
-#line 2862
   long i, j, ni;
-#line 2862
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2862
   int *xp;
-#line 2862
   int nrange = 0;         /* number of range errors */
-#line 2862
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2862
   long cxp = (long) *((char**)xpp);
-#line 2862
 
-#line 2862
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2862
   /* sjl: manually stripmine so we can limit amount of
-#line 2862
    * vector work space reserved to LOOPCNT elements. Also
-#line 2862
    * makes vectorisation easy */
-#line 2862
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2862
     ni=Min(nelems-j,LOOPCNT);
-#line 2862
     if (realign) {
-#line 2862
       xp = tmp;
-#line 2862
     } else {
-#line 2862
       xp = (int *) *xpp;
-#line 2862
     }
-#line 2862
    /* copy the next block */
-#line 2862
 #pragma cdir loopcnt=LOOPCNT
-#line 2862
 #pragma cdir shortloop
-#line 2862
     for (i=0; i<ni; i++) {
-#line 2862
       /* the normal case: */
-#line 2862
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2862
      /* test for range errors (not always needed but do it anyway) */
-#line 2862
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2862
     }
-#line 2862
    /* copy workspace back if necessary */ 
-#line 2862
     if (realign) {
-#line 2862
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2862
       xp = (int *) *xpp;
-#line 2862
     }
-#line 2862
    /* update xpp and tp */
-#line 2862
     xp += ni;
-#line 2862
     tp += ni;
-#line 2862
     *xpp = (void*)xp;
-#line 2862
   }
-#line 2862
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2862
 
-#line 2862
 #else   /* not SX */
-#line 2862
 
-#line 2862
 	char *xp = (char *) *xpp;
-#line 2862
 	int status = ENOERR;
-#line 2862
 
-#line 2862
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2862
 	{
-#line 2862
 		int lstatus = ncx_put_int_ulonglong(xp, tp);
-#line 2862
 		if(lstatus != ENOERR)
-#line 2862
 			status = lstatus;
-#line 2862
 	}
-#line 2862
 
-#line 2862
 	*xpp = (void *)xp;
-#line 2862
 	return status;
-#line 2862
 #endif
-#line 2862
 }
-#line 2862
 
 int
-#line 2863
 ncx_putn_int_float(void **xpp, size_t nelems, const float *tp)
-#line 2863
 {
-#line 2863
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2863
 
-#line 2863
  /* basic algorithm is:
-#line 2863
   *   - ensure sane alignment of output data
-#line 2863
   *   - copy (conversion happens automatically) input data
-#line 2863
   *     to output
-#line 2863
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2863
   *     at next location for converted output
-#line 2863
   */
-#line 2863
   long i, j, ni;
-#line 2863
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2863
   int *xp;
-#line 2863
   double d;               /* special case for ncx_putn_int_float */
-#line 2863
   int nrange = 0;         /* number of range errors */
-#line 2863
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2863
   long cxp = (long) *((char**)xpp);
-#line 2863
 
-#line 2863
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2863
   /* sjl: manually stripmine so we can limit amount of
-#line 2863
    * vector work space reserved to LOOPCNT elements. Also
-#line 2863
    * makes vectorisation easy */
-#line 2863
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2863
     ni=Min(nelems-j,LOOPCNT);
-#line 2863
     if (realign) {
-#line 2863
       xp = tmp;
-#line 2863
     } else {
-#line 2863
       xp = (int *) *xpp;
-#line 2863
     }
-#line 2863
    /* copy the next block */
-#line 2863
 #pragma cdir loopcnt=LOOPCNT
-#line 2863
 #pragma cdir shortloop
-#line 2863
     for (i=0; i<ni; i++) {
-#line 2863
       /* for some reason int to float, for putn, requires a special case */ 
-#line 2863
       d = tp[i];
-#line 2863
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) d));
-#line 2863
       nrange += d < X_INT_MIN || d > X_INT_MAX;
-#line 2863
     }
-#line 2863
    /* copy workspace back if necessary */ 
-#line 2863
     if (realign) {
-#line 2863
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2863
       xp = (int *) *xpp;
-#line 2863
     }
-#line 2863
    /* update xpp and tp */
-#line 2863
     xp += ni;
-#line 2863
     tp += ni;
-#line 2863
     *xpp = (void*)xp;
-#line 2863
   }
-#line 2863
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2863
 
-#line 2863
 #else   /* not SX */
-#line 2863
 
-#line 2863
 	char *xp = (char *) *xpp;
-#line 2863
 	int status = ENOERR;
-#line 2863
 
-#line 2863
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2863
 	{
-#line 2863
 		int lstatus = ncx_put_int_float(xp, tp);
-#line 2863
 		if(lstatus != ENOERR)
-#line 2863
 			status = lstatus;
-#line 2863
 	}
-#line 2863
 
-#line 2863
 	*xpp = (void *)xp;
-#line 2863
 	return status;
-#line 2863
 #endif
-#line 2863
 }
-#line 2863
 
 int
-#line 2864
 ncx_putn_int_double(void **xpp, size_t nelems, const double *tp)
-#line 2864
 {
-#line 2864
 #if _SX && X_SIZEOF_INT == SIZEOF_INT
-#line 2864
 
-#line 2864
  /* basic algorithm is:
-#line 2864
   *   - ensure sane alignment of output data
-#line 2864
   *   - copy (conversion happens automatically) input data
-#line 2864
   *     to output
-#line 2864
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2864
   *     at next location for converted output
-#line 2864
   */
-#line 2864
   long i, j, ni;
-#line 2864
   int tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2864
   int *xp;
-#line 2864
   int nrange = 0;         /* number of range errors */
-#line 2864
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2864
   long cxp = (long) *((char**)xpp);
-#line 2864
 
-#line 2864
   realign = (cxp & 7) % SIZEOF_INT;
-#line 2864
   /* sjl: manually stripmine so we can limit amount of
-#line 2864
    * vector work space reserved to LOOPCNT elements. Also
-#line 2864
    * makes vectorisation easy */
-#line 2864
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2864
     ni=Min(nelems-j,LOOPCNT);
-#line 2864
     if (realign) {
-#line 2864
       xp = tmp;
-#line 2864
     } else {
-#line 2864
       xp = (int *) *xpp;
-#line 2864
     }
-#line 2864
    /* copy the next block */
-#line 2864
 #pragma cdir loopcnt=LOOPCNT
-#line 2864
 #pragma cdir shortloop
-#line 2864
     for (i=0; i<ni; i++) {
-#line 2864
       /* the normal case: */
-#line 2864
       xp[i] = (int) Max( X_INT_MIN, Min(X_INT_MAX, (int) tp[i]));
-#line 2864
      /* test for range errors (not always needed but do it anyway) */
-#line 2864
       nrange += tp[i] < X_INT_MIN || tp[i] > X_INT_MAX;
-#line 2864
     }
-#line 2864
    /* copy workspace back if necessary */ 
-#line 2864
     if (realign) {
-#line 2864
       memcpy(*xpp, tmp, ni*X_SIZEOF_INT);
-#line 2864
       xp = (int *) *xpp;
-#line 2864
     }
-#line 2864
    /* update xpp and tp */
-#line 2864
     xp += ni;
-#line 2864
     tp += ni;
-#line 2864
     *xpp = (void*)xp;
-#line 2864
   }
-#line 2864
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2864
 
-#line 2864
 #else   /* not SX */
-#line 2864
 
-#line 2864
 	char *xp = (char *) *xpp;
-#line 2864
 	int status = ENOERR;
-#line 2864
 
-#line 2864
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
-#line 2864
 	{
-#line 2864
 		int lstatus = ncx_put_int_double(xp, tp);
-#line 2864
 		if(lstatus != ENOERR)
-#line 2864
 			status = lstatus;
-#line 2864
 	}
-#line 2864
 
-#line 2864
 	*xpp = (void *)xp;
-#line 2864
 	return status;
-#line 2864
 #endif
-#line 2864
 }
-#line 2864
 
 
 
 /* float */
 
 int
-#line 2869
 ncx_getn_float_schar(const void **xpp, size_t nelems, schar *tp)
-#line 2869
 {
-#line 2869
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2869
 
-#line 2869
  /* basic algorithm is:
-#line 2869
   *   - ensure sane alignment of input data
-#line 2869
   *   - copy (conversion happens automatically) input data
-#line 2869
   *     to output
-#line 2869
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2869
   *     at next location for converted output
-#line 2869
   */
-#line 2869
   long i, j, ni;
-#line 2869
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2869
   float *xp;
-#line 2869
   int nrange = 0;         /* number of range errors */
-#line 2869
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2869
   long cxp = (long) *((char**)xpp);
-#line 2869
 
-#line 2869
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2869
   /* sjl: manually stripmine so we can limit amount of
-#line 2869
    * vector work space reserved to LOOPCNT elements. Also
-#line 2869
    * makes vectorisation easy */
-#line 2869
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2869
     ni=Min(nelems-j,LOOPCNT);
-#line 2869
     if (realign) {
-#line 2869
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2869
       xp = tmp;
-#line 2869
     } else {
-#line 2869
       xp = (float *) *xpp;
-#line 2869
     }
-#line 2869
    /* copy the next block */
-#line 2869
 #pragma cdir loopcnt=LOOPCNT
-#line 2869
 #pragma cdir shortloop
-#line 2869
     for (i=0; i<ni; i++) {
-#line 2869
       tp[i] = (schar) Max( SCHAR_MIN, Min(SCHAR_MAX, (schar) xp[i]));
-#line 2869
      /* test for range errors (not always needed but do it anyway) */
-#line 2869
       nrange += xp[i] < SCHAR_MIN || xp[i] > SCHAR_MAX;
-#line 2869
     }
-#line 2869
    /* update xpp and tp */
-#line 2869
     if (realign) xp = (float *) *xpp;
-#line 2869
     xp += ni;
-#line 2869
     tp += ni;
-#line 2869
     *xpp = (void*)xp;
-#line 2869
   }
-#line 2869
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2869
 
-#line 2869
 #else   /* not SX */
-#line 2869
 	const char *xp = (const char *) *xpp;
-#line 2869
 	int status = ENOERR;
-#line 2869
 
-#line 2869
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2869
 	{
-#line 2869
 		const int lstatus = ncx_get_float_schar(xp, tp);
-#line 2869
 		if(lstatus != ENOERR)
-#line 2869
 			status = lstatus;
-#line 2869
 	}
-#line 2869
 
-#line 2869
 	*xpp = (const void *)xp;
-#line 2869
 	return status;
-#line 2869
 #  endif
-#line 2869
 }
-#line 2869
 
 int
-#line 2870
 ncx_getn_float_uchar(const void **xpp, size_t nelems, uchar *tp)
-#line 2870
 {
-#line 2870
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2870
 
-#line 2870
  /* basic algorithm is:
-#line 2870
   *   - ensure sane alignment of input data
-#line 2870
   *   - copy (conversion happens automatically) input data
-#line 2870
   *     to output
-#line 2870
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2870
   *     at next location for converted output
-#line 2870
   */
-#line 2870
   long i, j, ni;
-#line 2870
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2870
   float *xp;
-#line 2870
   int nrange = 0;         /* number of range errors */
-#line 2870
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2870
   long cxp = (long) *((char**)xpp);
-#line 2870
 
-#line 2870
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2870
   /* sjl: manually stripmine so we can limit amount of
-#line 2870
    * vector work space reserved to LOOPCNT elements. Also
-#line 2870
    * makes vectorisation easy */
-#line 2870
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2870
     ni=Min(nelems-j,LOOPCNT);
-#line 2870
     if (realign) {
-#line 2870
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2870
       xp = tmp;
-#line 2870
     } else {
-#line 2870
       xp = (float *) *xpp;
-#line 2870
     }
-#line 2870
    /* copy the next block */
-#line 2870
 #pragma cdir loopcnt=LOOPCNT
-#line 2870
 #pragma cdir shortloop
-#line 2870
     for (i=0; i<ni; i++) {
-#line 2870
       tp[i] = (uchar) Max( UCHAR_MIN, Min(UCHAR_MAX, (uchar) xp[i]));
-#line 2870
      /* test for range errors (not always needed but do it anyway) */
-#line 2870
       nrange += xp[i] < UCHAR_MIN || xp[i] > UCHAR_MAX;
-#line 2870
     }
-#line 2870
    /* update xpp and tp */
-#line 2870
     if (realign) xp = (float *) *xpp;
-#line 2870
     xp += ni;
-#line 2870
     tp += ni;
-#line 2870
     *xpp = (void*)xp;
-#line 2870
   }
-#line 2870
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2870
 
-#line 2870
 #else   /* not SX */
-#line 2870
 	const char *xp = (const char *) *xpp;
-#line 2870
 	int status = ENOERR;
-#line 2870
 
-#line 2870
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2870
 	{
-#line 2870
 		const int lstatus = ncx_get_float_uchar(xp, tp);
-#line 2870
 		if(lstatus != ENOERR)
-#line 2870
 			status = lstatus;
-#line 2870
 	}
-#line 2870
 
-#line 2870
 	*xpp = (const void *)xp;
-#line 2870
 	return status;
-#line 2870
 #  endif
-#line 2870
 }
-#line 2870
 
 int
-#line 2871
 ncx_getn_float_short(const void **xpp, size_t nelems, short *tp)
-#line 2871
 {
-#line 2871
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2871
 
-#line 2871
  /* basic algorithm is:
-#line 2871
   *   - ensure sane alignment of input data
-#line 2871
   *   - copy (conversion happens automatically) input data
-#line 2871
   *     to output
-#line 2871
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2871
   *     at next location for converted output
-#line 2871
   */
-#line 2871
   long i, j, ni;
-#line 2871
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2871
   float *xp;
-#line 2871
   int nrange = 0;         /* number of range errors */
-#line 2871
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2871
   long cxp = (long) *((char**)xpp);
-#line 2871
 
-#line 2871
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2871
   /* sjl: manually stripmine so we can limit amount of
-#line 2871
    * vector work space reserved to LOOPCNT elements. Also
-#line 2871
    * makes vectorisation easy */
-#line 2871
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2871
     ni=Min(nelems-j,LOOPCNT);
-#line 2871
     if (realign) {
-#line 2871
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2871
       xp = tmp;
-#line 2871
     } else {
-#line 2871
       xp = (float *) *xpp;
-#line 2871
     }
-#line 2871
    /* copy the next block */
-#line 2871
 #pragma cdir loopcnt=LOOPCNT
-#line 2871
 #pragma cdir shortloop
-#line 2871
     for (i=0; i<ni; i++) {
-#line 2871
       tp[i] = (short) Max( SHORT_MIN, Min(SHORT_MAX, (short) xp[i]));
-#line 2871
      /* test for range errors (not always needed but do it anyway) */
-#line 2871
       nrange += xp[i] < SHORT_MIN || xp[i] > SHORT_MAX;
-#line 2871
     }
-#line 2871
    /* update xpp and tp */
-#line 2871
     if (realign) xp = (float *) *xpp;
-#line 2871
     xp += ni;
-#line 2871
     tp += ni;
-#line 2871
     *xpp = (void*)xp;
-#line 2871
   }
-#line 2871
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2871
 
-#line 2871
 #else   /* not SX */
-#line 2871
 	const char *xp = (const char *) *xpp;
-#line 2871
 	int status = ENOERR;
-#line 2871
 
-#line 2871
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2871
 	{
-#line 2871
 		const int lstatus = ncx_get_float_short(xp, tp);
-#line 2871
 		if(lstatus != ENOERR)
-#line 2871
 			status = lstatus;
-#line 2871
 	}
-#line 2871
 
-#line 2871
 	*xpp = (const void *)xp;
-#line 2871
 	return status;
-#line 2871
 #  endif
-#line 2871
 }
-#line 2871
 
 int
-#line 2872
 ncx_getn_float_int(const void **xpp, size_t nelems, int *tp)
-#line 2872
 {
-#line 2872
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2872
 
-#line 2872
  /* basic algorithm is:
-#line 2872
   *   - ensure sane alignment of input data
-#line 2872
   *   - copy (conversion happens automatically) input data
-#line 2872
   *     to output
-#line 2872
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2872
   *     at next location for converted output
-#line 2872
   */
-#line 2872
   long i, j, ni;
-#line 2872
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2872
   float *xp;
-#line 2872
   int nrange = 0;         /* number of range errors */
-#line 2872
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2872
   long cxp = (long) *((char**)xpp);
-#line 2872
 
-#line 2872
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2872
   /* sjl: manually stripmine so we can limit amount of
-#line 2872
    * vector work space reserved to LOOPCNT elements. Also
-#line 2872
    * makes vectorisation easy */
-#line 2872
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2872
     ni=Min(nelems-j,LOOPCNT);
-#line 2872
     if (realign) {
-#line 2872
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2872
       xp = tmp;
-#line 2872
     } else {
-#line 2872
       xp = (float *) *xpp;
-#line 2872
     }
-#line 2872
    /* copy the next block */
-#line 2872
 #pragma cdir loopcnt=LOOPCNT
-#line 2872
 #pragma cdir shortloop
-#line 2872
     for (i=0; i<ni; i++) {
-#line 2872
       tp[i] = (int) Max( INT_MIN, Min(INT_MAX, (int) xp[i]));
-#line 2872
      /* test for range errors (not always needed but do it anyway) */
-#line 2872
       nrange += xp[i] < INT_MIN || xp[i] > INT_MAX;
-#line 2872
     }
-#line 2872
    /* update xpp and tp */
-#line 2872
     if (realign) xp = (float *) *xpp;
-#line 2872
     xp += ni;
-#line 2872
     tp += ni;
-#line 2872
     *xpp = (void*)xp;
-#line 2872
   }
-#line 2872
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2872
 
-#line 2872
 #else   /* not SX */
-#line 2872
 	const char *xp = (const char *) *xpp;
-#line 2872
 	int status = ENOERR;
-#line 2872
 
-#line 2872
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2872
 	{
-#line 2872
 		const int lstatus = ncx_get_float_int(xp, tp);
-#line 2872
 		if(lstatus != ENOERR)
-#line 2872
 			status = lstatus;
-#line 2872
 	}
-#line 2872
 
-#line 2872
 	*xpp = (const void *)xp;
-#line 2872
 	return status;
-#line 2872
 #  endif
-#line 2872
 }
-#line 2872
 
 #if X_SIZEOF_FLOAT == SIZEOF_FLOAT && !defined(NO_IEEE_FLOAT)
 /* optimized version */
@@ -9883,95 +5997,50 @@ ncx_getn_float_float(const void **xpp, size_t nfloats, float *ip)
 	while(ip < end)
 	{
 		struct vax_single *const vsp = (struct vax_single *) ip;
-#line 2894
 		const struct ieee_single *const isp =
-#line 2894
 			 (const struct ieee_single *) (*xpp);
-#line 2894
 		unsigned exp = isp->exp_hi << 1 | isp->exp_lo;
-#line 2894
 
-#line 2894
 		switch(exp) {
-#line 2894
 		case 0 :
-#line 2894
 			/* ieee subnormal */
-#line 2894
 			if(isp->mant_hi == min.ieee.mant_hi
-#line 2894
 				&& isp->mant_lo_hi == min.ieee.mant_lo_hi
-#line 2894
 				&& isp->mant_lo_lo == min.ieee.mant_lo_lo)
-#line 2894
 			{
-#line 2894
 				*vsp = min.s;
-#line 2894
 			}
-#line 2894
 			else
-#line 2894
 			{
-#line 2894
 				unsigned mantissa = (isp->mant_hi << 16)
-#line 2894
 					 | isp->mant_lo_hi << 8
-#line 2894
 					 | isp->mant_lo_lo;
-#line 2894
 				unsigned tmp = mantissa >> 20;
-#line 2894
 				if(tmp >= 4) {
-#line 2894
 					vsp->exp = 2;
-#line 2894
 				} else if (tmp >= 2) {
-#line 2894
 					vsp->exp = 1;
-#line 2894
 				} else {
-#line 2894
 					*vsp = min.s;
-#line 2894
 					break;
-#line 2894
 				} /* else */
-#line 2894
 				tmp = mantissa - (1 << (20 + vsp->exp ));
-#line 2894
 				tmp <<= 3 - vsp->exp;
-#line 2894
 				vsp->mantissa2 = tmp;
-#line 2894
 				vsp->mantissa1 = (tmp >> 16);
-#line 2894
 			}
-#line 2894
 			break;
-#line 2894
 		case 0xfe :
-#line 2894
 		case 0xff :
-#line 2894
 			*vsp = max.s;
-#line 2894
 			break;
-#line 2894
 		default :
-#line 2894
 			vsp->exp = exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
-#line 2894
 			vsp->mantissa2 = isp->mant_lo_hi << 8 | isp->mant_lo_lo;
-#line 2894
 			vsp->mantissa1 = isp->mant_hi;
-#line 2894
 		}
-#line 2894
 
-#line 2894
 		vsp->sign = isp->sign;
-#line 2894
 
 
 		ip++;
@@ -9999,1045 +6068,529 @@ ncx_getn_float_float(const void **xpp, size_t nelems, float *tp)
 
 #endif
 int
-#line 2920
 ncx_getn_float_double(const void **xpp, size_t nelems, double *tp)
-#line 2920
 {
-#line 2920
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2920
 
-#line 2920
  /* basic algorithm is:
-#line 2920
   *   - ensure sane alignment of input data
-#line 2920
   *   - copy (conversion happens automatically) input data
-#line 2920
   *     to output
-#line 2920
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2920
   *     at next location for converted output
-#line 2920
   */
-#line 2920
   long i, j, ni;
-#line 2920
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2920
   float *xp;
-#line 2920
   int nrange = 0;         /* number of range errors */
-#line 2920
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2920
   long cxp = (long) *((char**)xpp);
-#line 2920
 
-#line 2920
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2920
   /* sjl: manually stripmine so we can limit amount of
-#line 2920
    * vector work space reserved to LOOPCNT elements. Also
-#line 2920
    * makes vectorisation easy */
-#line 2920
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2920
     ni=Min(nelems-j,LOOPCNT);
-#line 2920
     if (realign) {
-#line 2920
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2920
       xp = tmp;
-#line 2920
     } else {
-#line 2920
       xp = (float *) *xpp;
-#line 2920
     }
-#line 2920
    /* copy the next block */
-#line 2920
 #pragma cdir loopcnt=LOOPCNT
-#line 2920
 #pragma cdir shortloop
-#line 2920
     for (i=0; i<ni; i++) {
-#line 2920
       tp[i] = (double) Max( DOUBLE_MIN, Min(DOUBLE_MAX, (double) xp[i]));
-#line 2920
      /* test for range errors (not always needed but do it anyway) */
-#line 2920
       nrange += xp[i] < DOUBLE_MIN || xp[i] > DOUBLE_MAX;
-#line 2920
     }
-#line 2920
    /* update xpp and tp */
-#line 2920
     if (realign) xp = (float *) *xpp;
-#line 2920
     xp += ni;
-#line 2920
     tp += ni;
-#line 2920
     *xpp = (void*)xp;
-#line 2920
   }
-#line 2920
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2920
 
-#line 2920
 #else   /* not SX */
-#line 2920
 	const char *xp = (const char *) *xpp;
-#line 2920
 	int status = ENOERR;
-#line 2920
 
-#line 2920
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2920
 	{
-#line 2920
 		const int lstatus = ncx_get_float_double(xp, tp);
-#line 2920
 		if(lstatus != ENOERR)
-#line 2920
 			status = lstatus;
-#line 2920
 	}
-#line 2920
 
-#line 2920
 	*xpp = (const void *)xp;
-#line 2920
 	return status;
-#line 2920
 #  endif
-#line 2920
 }
-#line 2920
 
 int
-#line 2921
 ncx_getn_float_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2921
 {
-#line 2921
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2921
 
-#line 2921
  /* basic algorithm is:
-#line 2921
   *   - ensure sane alignment of input data
-#line 2921
   *   - copy (conversion happens automatically) input data
-#line 2921
   *     to output
-#line 2921
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2921
   *     at next location for converted output
-#line 2921
   */
-#line 2921
   long i, j, ni;
-#line 2921
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2921
   float *xp;
-#line 2921
   int nrange = 0;         /* number of range errors */
-#line 2921
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2921
   long cxp = (long) *((char**)xpp);
-#line 2921
 
-#line 2921
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2921
   /* sjl: manually stripmine so we can limit amount of
-#line 2921
    * vector work space reserved to LOOPCNT elements. Also
-#line 2921
    * makes vectorisation easy */
-#line 2921
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2921
     ni=Min(nelems-j,LOOPCNT);
-#line 2921
     if (realign) {
-#line 2921
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2921
       xp = tmp;
-#line 2921
     } else {
-#line 2921
       xp = (float *) *xpp;
-#line 2921
     }
-#line 2921
    /* copy the next block */
-#line 2921
 #pragma cdir loopcnt=LOOPCNT
-#line 2921
 #pragma cdir shortloop
-#line 2921
     for (i=0; i<ni; i++) {
-#line 2921
       tp[i] = (uint) Max( UINT_MIN, Min(UINT_MAX, (uint) xp[i]));
-#line 2921
      /* test for range errors (not always needed but do it anyway) */
-#line 2921
       nrange += xp[i] < UINT_MIN || xp[i] > UINT_MAX;
-#line 2921
     }
-#line 2921
    /* update xpp and tp */
-#line 2921
     if (realign) xp = (float *) *xpp;
-#line 2921
     xp += ni;
-#line 2921
     tp += ni;
-#line 2921
     *xpp = (void*)xp;
-#line 2921
   }
-#line 2921
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2921
 
-#line 2921
 #else   /* not SX */
-#line 2921
 	const char *xp = (const char *) *xpp;
-#line 2921
 	int status = ENOERR;
-#line 2921
 
-#line 2921
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2921
 	{
-#line 2921
 		const int lstatus = ncx_get_float_uint(xp, tp);
-#line 2921
 		if(lstatus != ENOERR)
-#line 2921
 			status = lstatus;
-#line 2921
 	}
-#line 2921
 
-#line 2921
 	*xpp = (const void *)xp;
-#line 2921
 	return status;
-#line 2921
 #  endif
-#line 2921
 }
-#line 2921
 
 int
-#line 2922
 ncx_getn_float_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2922
 {
-#line 2922
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2922
 
-#line 2922
  /* basic algorithm is:
-#line 2922
   *   - ensure sane alignment of input data
-#line 2922
   *   - copy (conversion happens automatically) input data
-#line 2922
   *     to output
-#line 2922
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2922
   *     at next location for converted output
-#line 2922
   */
-#line 2922
   long i, j, ni;
-#line 2922
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2922
   float *xp;
-#line 2922
   int nrange = 0;         /* number of range errors */
-#line 2922
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2922
   long cxp = (long) *((char**)xpp);
-#line 2922
 
-#line 2922
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2922
   /* sjl: manually stripmine so we can limit amount of
-#line 2922
    * vector work space reserved to LOOPCNT elements. Also
-#line 2922
    * makes vectorisation easy */
-#line 2922
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2922
     ni=Min(nelems-j,LOOPCNT);
-#line 2922
     if (realign) {
-#line 2922
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2922
       xp = tmp;
-#line 2922
     } else {
-#line 2922
       xp = (float *) *xpp;
-#line 2922
     }
-#line 2922
    /* copy the next block */
-#line 2922
 #pragma cdir loopcnt=LOOPCNT
-#line 2922
 #pragma cdir shortloop
-#line 2922
     for (i=0; i<ni; i++) {
-#line 2922
       tp[i] = (longlong) Max( LONGLONG_MIN, Min(LONGLONG_MAX, (longlong) xp[i]));
-#line 2922
      /* test for range errors (not always needed but do it anyway) */
-#line 2922
       nrange += xp[i] < LONGLONG_MIN || xp[i] > LONGLONG_MAX;
-#line 2922
     }
-#line 2922
    /* update xpp and tp */
-#line 2922
     if (realign) xp = (float *) *xpp;
-#line 2922
     xp += ni;
-#line 2922
     tp += ni;
-#line 2922
     *xpp = (void*)xp;
-#line 2922
   }
-#line 2922
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2922
 
-#line 2922
 #else   /* not SX */
-#line 2922
 	const char *xp = (const char *) *xpp;
-#line 2922
 	int status = ENOERR;
-#line 2922
 
-#line 2922
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2922
 	{
-#line 2922
 		const int lstatus = ncx_get_float_longlong(xp, tp);
-#line 2922
 		if(lstatus != ENOERR)
-#line 2922
 			status = lstatus;
-#line 2922
 	}
-#line 2922
 
-#line 2922
 	*xpp = (const void *)xp;
-#line 2922
 	return status;
-#line 2922
 #  endif
-#line 2922
 }
-#line 2922
 
 int
-#line 2923
 ncx_getn_float_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2923
 {
-#line 2923
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2923
 
-#line 2923
  /* basic algorithm is:
-#line 2923
   *   - ensure sane alignment of input data
-#line 2923
   *   - copy (conversion happens automatically) input data
-#line 2923
   *     to output
-#line 2923
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2923
   *     at next location for converted output
-#line 2923
   */
-#line 2923
   long i, j, ni;
-#line 2923
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2923
   float *xp;
-#line 2923
   int nrange = 0;         /* number of range errors */
-#line 2923
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2923
   long cxp = (long) *((char**)xpp);
-#line 2923
 
-#line 2923
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2923
   /* sjl: manually stripmine so we can limit amount of
-#line 2923
    * vector work space reserved to LOOPCNT elements. Also
-#line 2923
    * makes vectorisation easy */
-#line 2923
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2923
     ni=Min(nelems-j,LOOPCNT);
-#line 2923
     if (realign) {
-#line 2923
       memcpy(tmp, *xpp, ni*SIZEOF_FLOAT);
-#line 2923
       xp = tmp;
-#line 2923
     } else {
-#line 2923
       xp = (float *) *xpp;
-#line 2923
     }
-#line 2923
    /* copy the next block */
-#line 2923
 #pragma cdir loopcnt=LOOPCNT
-#line 2923
 #pragma cdir shortloop
-#line 2923
     for (i=0; i<ni; i++) {
-#line 2923
       tp[i] = (ulonglong) Max( ULONGLONG_MIN, Min(ULONGLONG_MAX, (ulonglong) xp[i]));
-#line 2923
      /* test for range errors (not always needed but do it anyway) */
-#line 2923
       nrange += xp[i] < ULONGLONG_MIN || xp[i] > ULONGLONG_MAX;
-#line 2923
     }
-#line 2923
    /* update xpp and tp */
-#line 2923
     if (realign) xp = (float *) *xpp;
-#line 2923
     xp += ni;
-#line 2923
     tp += ni;
-#line 2923
     *xpp = (void*)xp;
-#line 2923
   }
-#line 2923
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2923
 
-#line 2923
 #else   /* not SX */
-#line 2923
 	const char *xp = (const char *) *xpp;
-#line 2923
 	int status = ENOERR;
-#line 2923
 
-#line 2923
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2923
 	{
-#line 2923
 		const int lstatus = ncx_get_float_ulonglong(xp, tp);
-#line 2923
 		if(lstatus != ENOERR)
-#line 2923
 			status = lstatus;
-#line 2923
 	}
-#line 2923
 
-#line 2923
 	*xpp = (const void *)xp;
-#line 2923
 	return status;
-#line 2923
 #  endif
-#line 2923
 }
-#line 2923
 
 
 int
-#line 2925
 ncx_putn_float_schar(void **xpp, size_t nelems, const schar *tp)
-#line 2925
 {
-#line 2925
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2925
 
-#line 2925
  /* basic algorithm is:
-#line 2925
   *   - ensure sane alignment of output data
-#line 2925
   *   - copy (conversion happens automatically) input data
-#line 2925
   *     to output
-#line 2925
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2925
   *     at next location for converted output
-#line 2925
   */
-#line 2925
   long i, j, ni;
-#line 2925
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2925
   float *xp;
-#line 2925
   int nrange = 0;         /* number of range errors */
-#line 2925
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2925
   long cxp = (long) *((char**)xpp);
-#line 2925
 
-#line 2925
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2925
   /* sjl: manually stripmine so we can limit amount of
-#line 2925
    * vector work space reserved to LOOPCNT elements. Also
-#line 2925
    * makes vectorisation easy */
-#line 2925
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2925
     ni=Min(nelems-j,LOOPCNT);
-#line 2925
     if (realign) {
-#line 2925
       xp = tmp;
-#line 2925
     } else {
-#line 2925
       xp = (float *) *xpp;
-#line 2925
     }
-#line 2925
    /* copy the next block */
-#line 2925
 #pragma cdir loopcnt=LOOPCNT
-#line 2925
 #pragma cdir shortloop
-#line 2925
     for (i=0; i<ni; i++) {
-#line 2925
       /* the normal case: */
-#line 2925
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2925
      /* test for range errors (not always needed but do it anyway) */
-#line 2925
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2925
     }
-#line 2925
    /* copy workspace back if necessary */ 
-#line 2925
     if (realign) {
-#line 2925
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2925
       xp = (float *) *xpp;
-#line 2925
     }
-#line 2925
    /* update xpp and tp */
-#line 2925
     xp += ni;
-#line 2925
     tp += ni;
-#line 2925
     *xpp = (void*)xp;
-#line 2925
   }
-#line 2925
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2925
 
-#line 2925
 #else   /* not SX */
-#line 2925
 
-#line 2925
 	char *xp = (char *) *xpp;
-#line 2925
 	int status = ENOERR;
-#line 2925
 
-#line 2925
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2925
 	{
-#line 2925
 		int lstatus = ncx_put_float_schar(xp, tp);
-#line 2925
 		if(lstatus != ENOERR)
-#line 2925
 			status = lstatus;
-#line 2925
 	}
-#line 2925
 
-#line 2925
 	*xpp = (void *)xp;
-#line 2925
 	return status;
-#line 2925
 #endif
-#line 2925
 }
-#line 2925
 
 int
-#line 2926
 ncx_putn_float_uchar(void **xpp, size_t nelems, const uchar *tp)
-#line 2926
 {
-#line 2926
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2926
 
-#line 2926
  /* basic algorithm is:
-#line 2926
   *   - ensure sane alignment of output data
-#line 2926
   *   - copy (conversion happens automatically) input data
-#line 2926
   *     to output
-#line 2926
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2926
   *     at next location for converted output
-#line 2926
   */
-#line 2926
   long i, j, ni;
-#line 2926
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2926
   float *xp;
-#line 2926
   int nrange = 0;         /* number of range errors */
-#line 2926
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2926
   long cxp = (long) *((char**)xpp);
-#line 2926
 
-#line 2926
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2926
   /* sjl: manually stripmine so we can limit amount of
-#line 2926
    * vector work space reserved to LOOPCNT elements. Also
-#line 2926
    * makes vectorisation easy */
-#line 2926
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2926
     ni=Min(nelems-j,LOOPCNT);
-#line 2926
     if (realign) {
-#line 2926
       xp = tmp;
-#line 2926
     } else {
-#line 2926
       xp = (float *) *xpp;
-#line 2926
     }
-#line 2926
    /* copy the next block */
-#line 2926
 #pragma cdir loopcnt=LOOPCNT
-#line 2926
 #pragma cdir shortloop
-#line 2926
     for (i=0; i<ni; i++) {
-#line 2926
       /* the normal case: */
-#line 2926
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2926
      /* test for range errors (not always needed but do it anyway) */
-#line 2926
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2926
     }
-#line 2926
    /* copy workspace back if necessary */ 
-#line 2926
     if (realign) {
-#line 2926
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2926
       xp = (float *) *xpp;
-#line 2926
     }
-#line 2926
    /* update xpp and tp */
-#line 2926
     xp += ni;
-#line 2926
     tp += ni;
-#line 2926
     *xpp = (void*)xp;
-#line 2926
   }
-#line 2926
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2926
 
-#line 2926
 #else   /* not SX */
-#line 2926
 
-#line 2926
 	char *xp = (char *) *xpp;
-#line 2926
 	int status = ENOERR;
-#line 2926
 
-#line 2926
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2926
 	{
-#line 2926
 		int lstatus = ncx_put_float_uchar(xp, tp);
-#line 2926
 		if(lstatus != ENOERR)
-#line 2926
 			status = lstatus;
-#line 2926
 	}
-#line 2926
 
-#line 2926
 	*xpp = (void *)xp;
-#line 2926
 	return status;
-#line 2926
 #endif
-#line 2926
 }
-#line 2926
 
 int
-#line 2927
 ncx_putn_float_short(void **xpp, size_t nelems, const short *tp)
-#line 2927
 {
-#line 2927
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2927
 
-#line 2927
  /* basic algorithm is:
-#line 2927
   *   - ensure sane alignment of output data
-#line 2927
   *   - copy (conversion happens automatically) input data
-#line 2927
   *     to output
-#line 2927
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2927
   *     at next location for converted output
-#line 2927
   */
-#line 2927
   long i, j, ni;
-#line 2927
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2927
   float *xp;
-#line 2927
   int nrange = 0;         /* number of range errors */
-#line 2927
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2927
   long cxp = (long) *((char**)xpp);
-#line 2927
 
-#line 2927
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2927
   /* sjl: manually stripmine so we can limit amount of
-#line 2927
    * vector work space reserved to LOOPCNT elements. Also
-#line 2927
    * makes vectorisation easy */
-#line 2927
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2927
     ni=Min(nelems-j,LOOPCNT);
-#line 2927
     if (realign) {
-#line 2927
       xp = tmp;
-#line 2927
     } else {
-#line 2927
       xp = (float *) *xpp;
-#line 2927
     }
-#line 2927
    /* copy the next block */
-#line 2927
 #pragma cdir loopcnt=LOOPCNT
-#line 2927
 #pragma cdir shortloop
-#line 2927
     for (i=0; i<ni; i++) {
-#line 2927
       /* the normal case: */
-#line 2927
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2927
      /* test for range errors (not always needed but do it anyway) */
-#line 2927
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2927
     }
-#line 2927
    /* copy workspace back if necessary */ 
-#line 2927
     if (realign) {
-#line 2927
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2927
       xp = (float *) *xpp;
-#line 2927
     }
-#line 2927
    /* update xpp and tp */
-#line 2927
     xp += ni;
-#line 2927
     tp += ni;
-#line 2927
     *xpp = (void*)xp;
-#line 2927
   }
-#line 2927
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2927
 
-#line 2927
 #else   /* not SX */
-#line 2927
 
-#line 2927
 	char *xp = (char *) *xpp;
-#line 2927
 	int status = ENOERR;
-#line 2927
 
-#line 2927
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2927
 	{
-#line 2927
 		int lstatus = ncx_put_float_short(xp, tp);
-#line 2927
 		if(lstatus != ENOERR)
-#line 2927
 			status = lstatus;
-#line 2927
 	}
-#line 2927
 
-#line 2927
 	*xpp = (void *)xp;
-#line 2927
 	return status;
-#line 2927
 #endif
-#line 2927
 }
-#line 2927
 
 int
-#line 2928
 ncx_putn_float_int(void **xpp, size_t nelems, const int *tp)
-#line 2928
 {
-#line 2928
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2928
 
-#line 2928
  /* basic algorithm is:
-#line 2928
   *   - ensure sane alignment of output data
-#line 2928
   *   - copy (conversion happens automatically) input data
-#line 2928
   *     to output
-#line 2928
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2928
   *     at next location for converted output
-#line 2928
   */
-#line 2928
   long i, j, ni;
-#line 2928
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2928
   float *xp;
-#line 2928
   int nrange = 0;         /* number of range errors */
-#line 2928
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2928
   long cxp = (long) *((char**)xpp);
-#line 2928
 
-#line 2928
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2928
   /* sjl: manually stripmine so we can limit amount of
-#line 2928
    * vector work space reserved to LOOPCNT elements. Also
-#line 2928
    * makes vectorisation easy */
-#line 2928
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2928
     ni=Min(nelems-j,LOOPCNT);
-#line 2928
     if (realign) {
-#line 2928
       xp = tmp;
-#line 2928
     } else {
-#line 2928
       xp = (float *) *xpp;
-#line 2928
     }
-#line 2928
    /* copy the next block */
-#line 2928
 #pragma cdir loopcnt=LOOPCNT
-#line 2928
 #pragma cdir shortloop
-#line 2928
     for (i=0; i<ni; i++) {
-#line 2928
       /* the normal case: */
-#line 2928
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2928
      /* test for range errors (not always needed but do it anyway) */
-#line 2928
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2928
     }
-#line 2928
    /* copy workspace back if necessary */ 
-#line 2928
     if (realign) {
-#line 2928
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2928
       xp = (float *) *xpp;
-#line 2928
     }
-#line 2928
    /* update xpp and tp */
-#line 2928
     xp += ni;
-#line 2928
     tp += ni;
-#line 2928
     *xpp = (void*)xp;
-#line 2928
   }
-#line 2928
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2928
 
-#line 2928
 #else   /* not SX */
-#line 2928
 
-#line 2928
 	char *xp = (char *) *xpp;
-#line 2928
 	int status = ENOERR;
-#line 2928
 
-#line 2928
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2928
 	{
-#line 2928
 		int lstatus = ncx_put_float_int(xp, tp);
-#line 2928
 		if(lstatus != ENOERR)
-#line 2928
 			status = lstatus;
-#line 2928
 	}
-#line 2928
 
-#line 2928
 	*xpp = (void *)xp;
-#line 2928
 	return status;
-#line 2928
 #endif
-#line 2928
 }
-#line 2928
 
 #if X_SIZEOF_FLOAT == SIZEOF_FLOAT && !defined(NO_IEEE_FLOAT)
 /* optimized version */
@@ -11061,93 +6614,49 @@ ncx_putn_float_float(void **xpp, size_t nfloats, const float *ip)
 	while(ip < end)
 	{
 		const struct vax_single *const vsp =
-#line 2950
 			 (const struct vax_single *)ip;
-#line 2950
 		struct ieee_single *const isp = (struct ieee_single *) (*xpp);
-#line 2950
 
-#line 2950
 		switch(vsp->exp){
-#line 2950
 		case 0 :
-#line 2950
 			/* all vax float with zero exponent map to zero */
-#line 2950
 			*isp = min.ieee;
-#line 2950
 			break;
-#line 2950
 		case 2 :
-#line 2950
 		case 1 :
-#line 2950
 		{
-#line 2950
 			/* These will map to subnormals */
-#line 2950
 			unsigned mantissa = (vsp->mantissa1 << 16)
-#line 2950
 					 | vsp->mantissa2;
-#line 2950
 			mantissa >>= 3 - vsp->exp;
-#line 2950
 			mantissa += (1 << (20 + vsp->exp));
-#line 2950
 			isp->mant_lo_lo = mantissa;
-#line 2950
 			isp->mant_lo_hi = mantissa >> 8;
-#line 2950
 			isp->mant_hi = mantissa >> 16;
-#line 2950
 			isp->exp_lo = 0;
-#line 2950
 			isp->exp_hi = 0;
-#line 2950
 		}
-#line 2950
 			break;
-#line 2950
 		case 0xff : /* max.s.exp */
-#line 2950
 			if( vsp->mantissa2 == max.s.mantissa2
-#line 2950
 				&& vsp->mantissa1 == max.s.mantissa1)
-#line 2950
 			{
-#line 2950
 				/* map largest vax float to ieee infinity */
-#line 2950
 				*isp = max.ieee;
-#line 2950
 				break;
-#line 2950
 			} /* else, fall thru */
-#line 2950
 		default :
-#line 2950
 		{
-#line 2950
 			unsigned exp = vsp->exp - VAX_SNG_BIAS + IEEE_SNG_BIAS;
-#line 2950
 			isp->exp_hi = exp >> 1;
-#line 2950
 			isp->exp_lo = exp;
-#line 2950
 			isp->mant_lo_lo = vsp->mantissa2;
-#line 2950
 			isp->mant_lo_hi = vsp->mantissa2 >> 8;
-#line 2950
 			isp->mant_hi = vsp->mantissa1;
-#line 2950
 		}
-#line 2950
 		}
-#line 2950
 
-#line 2950
 		isp->sign = vsp->sign;
-#line 2950
 
 	
 		ip++;
@@ -11175,1548 +6684,783 @@ ncx_putn_float_float(void **xpp, size_t nelems, const float *tp)
 
 #endif
 int
-#line 2976
 ncx_putn_float_double(void **xpp, size_t nelems, const double *tp)
-#line 2976
 {
-#line 2976
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2976
 
-#line 2976
  /* basic algorithm is:
-#line 2976
   *   - ensure sane alignment of output data
-#line 2976
   *   - copy (conversion happens automatically) input data
-#line 2976
   *     to output
-#line 2976
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2976
   *     at next location for converted output
-#line 2976
   */
-#line 2976
   long i, j, ni;
-#line 2976
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2976
   float *xp;
-#line 2976
   int nrange = 0;         /* number of range errors */
-#line 2976
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2976
   long cxp = (long) *((char**)xpp);
-#line 2976
 
-#line 2976
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2976
   /* sjl: manually stripmine so we can limit amount of
-#line 2976
    * vector work space reserved to LOOPCNT elements. Also
-#line 2976
    * makes vectorisation easy */
-#line 2976
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2976
     ni=Min(nelems-j,LOOPCNT);
-#line 2976
     if (realign) {
-#line 2976
       xp = tmp;
-#line 2976
     } else {
-#line 2976
       xp = (float *) *xpp;
-#line 2976
     }
-#line 2976
    /* copy the next block */
-#line 2976
 #pragma cdir loopcnt=LOOPCNT
-#line 2976
 #pragma cdir shortloop
-#line 2976
     for (i=0; i<ni; i++) {
-#line 2976
       /* the normal case: */
-#line 2976
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2976
      /* test for range errors (not always needed but do it anyway) */
-#line 2976
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2976
     }
-#line 2976
    /* copy workspace back if necessary */ 
-#line 2976
     if (realign) {
-#line 2976
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2976
       xp = (float *) *xpp;
-#line 2976
     }
-#line 2976
    /* update xpp and tp */
-#line 2976
     xp += ni;
-#line 2976
     tp += ni;
-#line 2976
     *xpp = (void*)xp;
-#line 2976
   }
-#line 2976
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2976
 
-#line 2976
 #else   /* not SX */
-#line 2976
 
-#line 2976
 	char *xp = (char *) *xpp;
-#line 2976
 	int status = ENOERR;
-#line 2976
 
-#line 2976
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2976
 	{
-#line 2976
 		int lstatus = ncx_put_float_double(xp, tp);
-#line 2976
 		if(lstatus != ENOERR)
-#line 2976
 			status = lstatus;
-#line 2976
 	}
-#line 2976
 
-#line 2976
 	*xpp = (void *)xp;
-#line 2976
 	return status;
-#line 2976
 #endif
-#line 2976
 }
-#line 2976
 
 int
-#line 2977
 ncx_putn_float_uint(void **xpp, size_t nelems, const uint *tp)
-#line 2977
 {
-#line 2977
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2977
 
-#line 2977
  /* basic algorithm is:
-#line 2977
   *   - ensure sane alignment of output data
-#line 2977
   *   - copy (conversion happens automatically) input data
-#line 2977
   *     to output
-#line 2977
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2977
   *     at next location for converted output
-#line 2977
   */
-#line 2977
   long i, j, ni;
-#line 2977
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2977
   float *xp;
-#line 2977
   int nrange = 0;         /* number of range errors */
-#line 2977
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2977
   long cxp = (long) *((char**)xpp);
-#line 2977
 
-#line 2977
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2977
   /* sjl: manually stripmine so we can limit amount of
-#line 2977
    * vector work space reserved to LOOPCNT elements. Also
-#line 2977
    * makes vectorisation easy */
-#line 2977
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2977
     ni=Min(nelems-j,LOOPCNT);
-#line 2977
     if (realign) {
-#line 2977
       xp = tmp;
-#line 2977
     } else {
-#line 2977
       xp = (float *) *xpp;
-#line 2977
     }
-#line 2977
    /* copy the next block */
-#line 2977
 #pragma cdir loopcnt=LOOPCNT
-#line 2977
 #pragma cdir shortloop
-#line 2977
     for (i=0; i<ni; i++) {
-#line 2977
       /* the normal case: */
-#line 2977
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2977
      /* test for range errors (not always needed but do it anyway) */
-#line 2977
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2977
     }
-#line 2977
    /* copy workspace back if necessary */ 
-#line 2977
     if (realign) {
-#line 2977
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2977
       xp = (float *) *xpp;
-#line 2977
     }
-#line 2977
    /* update xpp and tp */
-#line 2977
     xp += ni;
-#line 2977
     tp += ni;
-#line 2977
     *xpp = (void*)xp;
-#line 2977
   }
-#line 2977
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2977
 
-#line 2977
 #else   /* not SX */
-#line 2977
 
-#line 2977
 	char *xp = (char *) *xpp;
-#line 2977
 	int status = ENOERR;
-#line 2977
 
-#line 2977
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2977
 	{
-#line 2977
 		int lstatus = ncx_put_float_uint(xp, tp);
-#line 2977
 		if(lstatus != ENOERR)
-#line 2977
 			status = lstatus;
-#line 2977
 	}
-#line 2977
 
-#line 2977
 	*xpp = (void *)xp;
-#line 2977
 	return status;
-#line 2977
 #endif
-#line 2977
 }
-#line 2977
 
 int
-#line 2978
 ncx_putn_float_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 2978
 {
-#line 2978
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2978
 
-#line 2978
  /* basic algorithm is:
-#line 2978
   *   - ensure sane alignment of output data
-#line 2978
   *   - copy (conversion happens automatically) input data
-#line 2978
   *     to output
-#line 2978
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2978
   *     at next location for converted output
-#line 2978
   */
-#line 2978
   long i, j, ni;
-#line 2978
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2978
   float *xp;
-#line 2978
   int nrange = 0;         /* number of range errors */
-#line 2978
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2978
   long cxp = (long) *((char**)xpp);
-#line 2978
 
-#line 2978
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2978
   /* sjl: manually stripmine so we can limit amount of
-#line 2978
    * vector work space reserved to LOOPCNT elements. Also
-#line 2978
    * makes vectorisation easy */
-#line 2978
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2978
     ni=Min(nelems-j,LOOPCNT);
-#line 2978
     if (realign) {
-#line 2978
       xp = tmp;
-#line 2978
     } else {
-#line 2978
       xp = (float *) *xpp;
-#line 2978
     }
-#line 2978
    /* copy the next block */
-#line 2978
 #pragma cdir loopcnt=LOOPCNT
-#line 2978
 #pragma cdir shortloop
-#line 2978
     for (i=0; i<ni; i++) {
-#line 2978
       /* the normal case: */
-#line 2978
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2978
      /* test for range errors (not always needed but do it anyway) */
-#line 2978
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2978
     }
-#line 2978
    /* copy workspace back if necessary */ 
-#line 2978
     if (realign) {
-#line 2978
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2978
       xp = (float *) *xpp;
-#line 2978
     }
-#line 2978
    /* update xpp and tp */
-#line 2978
     xp += ni;
-#line 2978
     tp += ni;
-#line 2978
     *xpp = (void*)xp;
-#line 2978
   }
-#line 2978
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2978
 
-#line 2978
 #else   /* not SX */
-#line 2978
 
-#line 2978
 	char *xp = (char *) *xpp;
-#line 2978
 	int status = ENOERR;
-#line 2978
 
-#line 2978
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2978
 	{
-#line 2978
 		int lstatus = ncx_put_float_longlong(xp, tp);
-#line 2978
 		if(lstatus != ENOERR)
-#line 2978
 			status = lstatus;
-#line 2978
 	}
-#line 2978
 
-#line 2978
 	*xpp = (void *)xp;
-#line 2978
 	return status;
-#line 2978
 #endif
-#line 2978
 }
-#line 2978
 
 int
-#line 2979
 ncx_putn_float_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 2979
 {
-#line 2979
 #if _SX && X_SIZEOF_FLOAT == SIZEOF_FLOAT
-#line 2979
 
-#line 2979
  /* basic algorithm is:
-#line 2979
   *   - ensure sane alignment of output data
-#line 2979
   *   - copy (conversion happens automatically) input data
-#line 2979
   *     to output
-#line 2979
   *   - update tp to point at next unconverted input, and xpp to point
-#line 2979
   *     at next location for converted output
-#line 2979
   */
-#line 2979
   long i, j, ni;
-#line 2979
   float tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2979
   float *xp;
-#line 2979
   int nrange = 0;         /* number of range errors */
-#line 2979
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2979
   long cxp = (long) *((char**)xpp);
-#line 2979
 
-#line 2979
   realign = (cxp & 7) % SIZEOF_FLOAT;
-#line 2979
   /* sjl: manually stripmine so we can limit amount of
-#line 2979
    * vector work space reserved to LOOPCNT elements. Also
-#line 2979
    * makes vectorisation easy */
-#line 2979
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2979
     ni=Min(nelems-j,LOOPCNT);
-#line 2979
     if (realign) {
-#line 2979
       xp = tmp;
-#line 2979
     } else {
-#line 2979
       xp = (float *) *xpp;
-#line 2979
     }
-#line 2979
    /* copy the next block */
-#line 2979
 #pragma cdir loopcnt=LOOPCNT
-#line 2979
 #pragma cdir shortloop
-#line 2979
     for (i=0; i<ni; i++) {
-#line 2979
       /* the normal case: */
-#line 2979
       xp[i] = (float) Max( X_FLOAT_MIN, Min(X_FLOAT_MAX, (float) tp[i]));
-#line 2979
      /* test for range errors (not always needed but do it anyway) */
-#line 2979
       nrange += tp[i] < X_FLOAT_MIN || tp[i] > X_FLOAT_MAX;
-#line 2979
     }
-#line 2979
    /* copy workspace back if necessary */ 
-#line 2979
     if (realign) {
-#line 2979
       memcpy(*xpp, tmp, ni*X_SIZEOF_FLOAT);
-#line 2979
       xp = (float *) *xpp;
-#line 2979
     }
-#line 2979
    /* update xpp and tp */
-#line 2979
     xp += ni;
-#line 2979
     tp += ni;
-#line 2979
     *xpp = (void*)xp;
-#line 2979
   }
-#line 2979
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2979
 
-#line 2979
 #else   /* not SX */
-#line 2979
 
-#line 2979
 	char *xp = (char *) *xpp;
-#line 2979
 	int status = ENOERR;
-#line 2979
 
-#line 2979
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
-#line 2979
 	{
-#line 2979
 		int lstatus = ncx_put_float_ulonglong(xp, tp);
-#line 2979
 		if(lstatus != ENOERR)
-#line 2979
 			status = lstatus;
-#line 2979
 	}
-#line 2979
 
-#line 2979
 	*xpp = (void *)xp;
-#line 2979
 	return status;
-#line 2979
 #endif
-#line 2979
 }
-#line 2979
 
 
 /* double */
 
 int
-#line 2983
 ncx_getn_double_schar(const void **xpp, size_t nelems, schar *tp)
-#line 2983
 {
-#line 2983
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2983
 
-#line 2983
  /* basic algorithm is:
-#line 2983
   *   - ensure sane alignment of input data
-#line 2983
   *   - copy (conversion happens automatically) input data
-#line 2983
   *     to output
-#line 2983
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2983
   *     at next location for converted output
-#line 2983
   */
-#line 2983
   long i, j, ni;
-#line 2983
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2983
   double *xp;
-#line 2983
   int nrange = 0;         /* number of range errors */
-#line 2983
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2983
   long cxp = (long) *((char**)xpp);
-#line 2983
 
-#line 2983
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2983
   /* sjl: manually stripmine so we can limit amount of
-#line 2983
    * vector work space reserved to LOOPCNT elements. Also
-#line 2983
    * makes vectorisation easy */
-#line 2983
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2983
     ni=Min(nelems-j,LOOPCNT);
-#line 2983
     if (realign) {
-#line 2983
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2983
       xp = tmp;
-#line 2983
     } else {
-#line 2983
       xp = (double *) *xpp;
-#line 2983
     }
-#line 2983
    /* copy the next block */
-#line 2983
 #pragma cdir loopcnt=LOOPCNT
-#line 2983
 #pragma cdir shortloop
-#line 2983
     for (i=0; i<ni; i++) {
-#line 2983
       tp[i] = (schar) Max( SCHAR_MIN, Min(SCHAR_MAX, (schar) xp[i]));
-#line 2983
      /* test for range errors (not always needed but do it anyway) */
-#line 2983
       nrange += xp[i] < SCHAR_MIN || xp[i] > SCHAR_MAX;
-#line 2983
     }
-#line 2983
    /* update xpp and tp */
-#line 2983
     if (realign) xp = (double *) *xpp;
-#line 2983
     xp += ni;
-#line 2983
     tp += ni;
-#line 2983
     *xpp = (void*)xp;
-#line 2983
   }
-#line 2983
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2983
 
-#line 2983
 #else   /* not SX */
-#line 2983
 	const char *xp = (const char *) *xpp;
-#line 2983
 	int status = ENOERR;
-#line 2983
 
-#line 2983
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2983
 	{
-#line 2983
 		const int lstatus = ncx_get_double_schar(xp, tp);
-#line 2983
 		if(lstatus != ENOERR)
-#line 2983
 			status = lstatus;
-#line 2983
 	}
-#line 2983
 
-#line 2983
 	*xpp = (const void *)xp;
-#line 2983
 	return status;
-#line 2983
 #  endif
-#line 2983
 }
-#line 2983
 
 int
-#line 2984
 ncx_getn_double_uchar(const void **xpp, size_t nelems, uchar *tp)
-#line 2984
 {
-#line 2984
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2984
 
-#line 2984
  /* basic algorithm is:
-#line 2984
   *   - ensure sane alignment of input data
-#line 2984
   *   - copy (conversion happens automatically) input data
-#line 2984
   *     to output
-#line 2984
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2984
   *     at next location for converted output
-#line 2984
   */
-#line 2984
   long i, j, ni;
-#line 2984
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2984
   double *xp;
-#line 2984
   int nrange = 0;         /* number of range errors */
-#line 2984
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2984
   long cxp = (long) *((char**)xpp);
-#line 2984
 
-#line 2984
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2984
   /* sjl: manually stripmine so we can limit amount of
-#line 2984
    * vector work space reserved to LOOPCNT elements. Also
-#line 2984
    * makes vectorisation easy */
-#line 2984
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2984
     ni=Min(nelems-j,LOOPCNT);
-#line 2984
     if (realign) {
-#line 2984
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2984
       xp = tmp;
-#line 2984
     } else {
-#line 2984
       xp = (double *) *xpp;
-#line 2984
     }
-#line 2984
    /* copy the next block */
-#line 2984
 #pragma cdir loopcnt=LOOPCNT
-#line 2984
 #pragma cdir shortloop
-#line 2984
     for (i=0; i<ni; i++) {
-#line 2984
       tp[i] = (uchar) Max( UCHAR_MIN, Min(UCHAR_MAX, (uchar) xp[i]));
-#line 2984
      /* test for range errors (not always needed but do it anyway) */
-#line 2984
       nrange += xp[i] < UCHAR_MIN || xp[i] > UCHAR_MAX;
-#line 2984
     }
-#line 2984
    /* update xpp and tp */
-#line 2984
     if (realign) xp = (double *) *xpp;
-#line 2984
     xp += ni;
-#line 2984
     tp += ni;
-#line 2984
     *xpp = (void*)xp;
-#line 2984
   }
-#line 2984
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2984
 
-#line 2984
 #else   /* not SX */
-#line 2984
 	const char *xp = (const char *) *xpp;
-#line 2984
 	int status = ENOERR;
-#line 2984
 
-#line 2984
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2984
 	{
-#line 2984
 		const int lstatus = ncx_get_double_uchar(xp, tp);
-#line 2984
 		if(lstatus != ENOERR)
-#line 2984
 			status = lstatus;
-#line 2984
 	}
-#line 2984
 
-#line 2984
 	*xpp = (const void *)xp;
-#line 2984
 	return status;
-#line 2984
 #  endif
-#line 2984
 }
-#line 2984
 
 int
-#line 2985
 ncx_getn_double_short(const void **xpp, size_t nelems, short *tp)
-#line 2985
 {
-#line 2985
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2985
 
-#line 2985
  /* basic algorithm is:
-#line 2985
   *   - ensure sane alignment of input data
-#line 2985
   *   - copy (conversion happens automatically) input data
-#line 2985
   *     to output
-#line 2985
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2985
   *     at next location for converted output
-#line 2985
   */
-#line 2985
   long i, j, ni;
-#line 2985
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2985
   double *xp;
-#line 2985
   int nrange = 0;         /* number of range errors */
-#line 2985
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2985
   long cxp = (long) *((char**)xpp);
-#line 2985
 
-#line 2985
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2985
   /* sjl: manually stripmine so we can limit amount of
-#line 2985
    * vector work space reserved to LOOPCNT elements. Also
-#line 2985
    * makes vectorisation easy */
-#line 2985
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2985
     ni=Min(nelems-j,LOOPCNT);
-#line 2985
     if (realign) {
-#line 2985
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2985
       xp = tmp;
-#line 2985
     } else {
-#line 2985
       xp = (double *) *xpp;
-#line 2985
     }
-#line 2985
    /* copy the next block */
-#line 2985
 #pragma cdir loopcnt=LOOPCNT
-#line 2985
 #pragma cdir shortloop
-#line 2985
     for (i=0; i<ni; i++) {
-#line 2985
       tp[i] = (short) Max( SHORT_MIN, Min(SHORT_MAX, (short) xp[i]));
-#line 2985
      /* test for range errors (not always needed but do it anyway) */
-#line 2985
       nrange += xp[i] < SHORT_MIN || xp[i] > SHORT_MAX;
-#line 2985
     }
-#line 2985
    /* update xpp and tp */
-#line 2985
     if (realign) xp = (double *) *xpp;
-#line 2985
     xp += ni;
-#line 2985
     tp += ni;
-#line 2985
     *xpp = (void*)xp;
-#line 2985
   }
-#line 2985
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2985
 
-#line 2985
 #else   /* not SX */
-#line 2985
 	const char *xp = (const char *) *xpp;
-#line 2985
 	int status = ENOERR;
-#line 2985
 
-#line 2985
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2985
 	{
-#line 2985
 		const int lstatus = ncx_get_double_short(xp, tp);
-#line 2985
 		if(lstatus != ENOERR)
-#line 2985
 			status = lstatus;
-#line 2985
 	}
-#line 2985
 
-#line 2985
 	*xpp = (const void *)xp;
-#line 2985
 	return status;
-#line 2985
 #  endif
-#line 2985
 }
-#line 2985
 
 int
-#line 2986
 ncx_getn_double_int(const void **xpp, size_t nelems, int *tp)
-#line 2986
 {
-#line 2986
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2986
 
-#line 2986
  /* basic algorithm is:
-#line 2986
   *   - ensure sane alignment of input data
-#line 2986
   *   - copy (conversion happens automatically) input data
-#line 2986
   *     to output
-#line 2986
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2986
   *     at next location for converted output
-#line 2986
   */
-#line 2986
   long i, j, ni;
-#line 2986
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2986
   double *xp;
-#line 2986
   int nrange = 0;         /* number of range errors */
-#line 2986
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2986
   long cxp = (long) *((char**)xpp);
-#line 2986
 
-#line 2986
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2986
   /* sjl: manually stripmine so we can limit amount of
-#line 2986
    * vector work space reserved to LOOPCNT elements. Also
-#line 2986
    * makes vectorisation easy */
-#line 2986
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2986
     ni=Min(nelems-j,LOOPCNT);
-#line 2986
     if (realign) {
-#line 2986
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2986
       xp = tmp;
-#line 2986
     } else {
-#line 2986
       xp = (double *) *xpp;
-#line 2986
     }
-#line 2986
    /* copy the next block */
-#line 2986
 #pragma cdir loopcnt=LOOPCNT
-#line 2986
 #pragma cdir shortloop
-#line 2986
     for (i=0; i<ni; i++) {
-#line 2986
       tp[i] = (int) Max( INT_MIN, Min(INT_MAX, (int) xp[i]));
-#line 2986
      /* test for range errors (not always needed but do it anyway) */
-#line 2986
       nrange += xp[i] < INT_MIN || xp[i] > INT_MAX;
-#line 2986
     }
-#line 2986
    /* update xpp and tp */
-#line 2986
     if (realign) xp = (double *) *xpp;
-#line 2986
     xp += ni;
-#line 2986
     tp += ni;
-#line 2986
     *xpp = (void*)xp;
-#line 2986
   }
-#line 2986
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2986
 
-#line 2986
 #else   /* not SX */
-#line 2986
 	const char *xp = (const char *) *xpp;
-#line 2986
 	int status = ENOERR;
-#line 2986
 
-#line 2986
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2986
 	{
-#line 2986
 		const int lstatus = ncx_get_double_int(xp, tp);
-#line 2986
 		if(lstatus != ENOERR)
-#line 2986
 			status = lstatus;
-#line 2986
 	}
-#line 2986
 
-#line 2986
 	*xpp = (const void *)xp;
-#line 2986
 	return status;
-#line 2986
 #  endif
-#line 2986
 }
-#line 2986
 
 int
-#line 2987
 ncx_getn_double_float(const void **xpp, size_t nelems, float *tp)
-#line 2987
 {
-#line 2987
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2987
 
-#line 2987
  /* basic algorithm is:
-#line 2987
   *   - ensure sane alignment of input data
-#line 2987
   *   - copy (conversion happens automatically) input data
-#line 2987
   *     to output
-#line 2987
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2987
   *     at next location for converted output
-#line 2987
   */
-#line 2987
   long i, j, ni;
-#line 2987
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2987
   double *xp;
-#line 2987
   int nrange = 0;         /* number of range errors */
-#line 2987
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2987
   long cxp = (long) *((char**)xpp);
-#line 2987
 
-#line 2987
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2987
   /* sjl: manually stripmine so we can limit amount of
-#line 2987
    * vector work space reserved to LOOPCNT elements. Also
-#line 2987
    * makes vectorisation easy */
-#line 2987
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2987
     ni=Min(nelems-j,LOOPCNT);
-#line 2987
     if (realign) {
-#line 2987
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2987
       xp = tmp;
-#line 2987
     } else {
-#line 2987
       xp = (double *) *xpp;
-#line 2987
     }
-#line 2987
    /* copy the next block */
-#line 2987
 #pragma cdir loopcnt=LOOPCNT
-#line 2987
 #pragma cdir shortloop
-#line 2987
     for (i=0; i<ni; i++) {
-#line 2987
       tp[i] = (float) Max( FLOAT_MIN, Min(FLOAT_MAX, (float) xp[i]));
-#line 2987
      /* test for range errors (not always needed but do it anyway) */
-#line 2987
       nrange += xp[i] < FLOAT_MIN || xp[i] > FLOAT_MAX;
-#line 2987
     }
-#line 2987
    /* update xpp and tp */
-#line 2987
     if (realign) xp = (double *) *xpp;
-#line 2987
     xp += ni;
-#line 2987
     tp += ni;
-#line 2987
     *xpp = (void*)xp;
-#line 2987
   }
-#line 2987
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2987
 
-#line 2987
 #else   /* not SX */
-#line 2987
 	const char *xp = (const char *) *xpp;
-#line 2987
 	int status = ENOERR;
-#line 2987
 
-#line 2987
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2987
 	{
-#line 2987
 		const int lstatus = ncx_get_double_float(xp, tp);
-#line 2987
 		if(lstatus != ENOERR)
-#line 2987
 			status = lstatus;
-#line 2987
 	}
-#line 2987
 
-#line 2987
 	*xpp = (const void *)xp;
-#line 2987
 	return status;
-#line 2987
 #  endif
-#line 2987
 }
-#line 2987
 
-#line 2989
 int
-#line 2989
 ncx_getn_double_uint(const void **xpp, size_t nelems, uint *tp)
-#line 2989
 {
-#line 2989
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2989
 
-#line 2989
  /* basic algorithm is:
-#line 2989
   *   - ensure sane alignment of input data
-#line 2989
   *   - copy (conversion happens automatically) input data
-#line 2989
   *     to output
-#line 2989
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2989
   *     at next location for converted output
-#line 2989
   */
-#line 2989
   long i, j, ni;
-#line 2989
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2989
   double *xp;
-#line 2989
   int nrange = 0;         /* number of range errors */
-#line 2989
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2989
   long cxp = (long) *((char**)xpp);
-#line 2989
 
-#line 2989
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2989
   /* sjl: manually stripmine so we can limit amount of
-#line 2989
    * vector work space reserved to LOOPCNT elements. Also
-#line 2989
    * makes vectorisation easy */
-#line 2989
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2989
     ni=Min(nelems-j,LOOPCNT);
-#line 2989
     if (realign) {
-#line 2989
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2989
       xp = tmp;
-#line 2989
     } else {
-#line 2989
       xp = (double *) *xpp;
-#line 2989
     }
-#line 2989
    /* copy the next block */
-#line 2989
 #pragma cdir loopcnt=LOOPCNT
-#line 2989
 #pragma cdir shortloop
-#line 2989
     for (i=0; i<ni; i++) {
-#line 2989
       tp[i] = (uint) Max( UINT_MIN, Min(UINT_MAX, (uint) xp[i]));
-#line 2989
      /* test for range errors (not always needed but do it anyway) */
-#line 2989
       nrange += xp[i] < UINT_MIN || xp[i] > UINT_MAX;
-#line 2989
     }
-#line 2989
    /* update xpp and tp */
-#line 2989
     if (realign) xp = (double *) *xpp;
-#line 2989
     xp += ni;
-#line 2989
     tp += ni;
-#line 2989
     *xpp = (void*)xp;
-#line 2989
   }
-#line 2989
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2989
 
-#line 2989
 #else   /* not SX */
-#line 2989
 	const char *xp = (const char *) *xpp;
-#line 2989
 	int status = ENOERR;
-#line 2989
 
-#line 2989
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2989
 	{
-#line 2989
 		const int lstatus = ncx_get_double_uint(xp, tp);
-#line 2989
 		if(lstatus != ENOERR)
-#line 2989
 			status = lstatus;
-#line 2989
 	}
-#line 2989
 
-#line 2989
 	*xpp = (const void *)xp;
-#line 2989
 	return status;
-#line 2989
 #  endif
-#line 2989
 }
-#line 2989
 
 int
-#line 2990
 ncx_getn_double_longlong(const void **xpp, size_t nelems, longlong *tp)
-#line 2990
 {
-#line 2990
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2990
 
-#line 2990
  /* basic algorithm is:
-#line 2990
   *   - ensure sane alignment of input data
-#line 2990
   *   - copy (conversion happens automatically) input data
-#line 2990
   *     to output
-#line 2990
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2990
   *     at next location for converted output
-#line 2990
   */
-#line 2990
   long i, j, ni;
-#line 2990
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2990
   double *xp;
-#line 2990
   int nrange = 0;         /* number of range errors */
-#line 2990
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2990
   long cxp = (long) *((char**)xpp);
-#line 2990
 
-#line 2990
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2990
   /* sjl: manually stripmine so we can limit amount of
-#line 2990
    * vector work space reserved to LOOPCNT elements. Also
-#line 2990
    * makes vectorisation easy */
-#line 2990
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2990
     ni=Min(nelems-j,LOOPCNT);
-#line 2990
     if (realign) {
-#line 2990
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2990
       xp = tmp;
-#line 2990
     } else {
-#line 2990
       xp = (double *) *xpp;
-#line 2990
     }
-#line 2990
    /* copy the next block */
-#line 2990
 #pragma cdir loopcnt=LOOPCNT
-#line 2990
 #pragma cdir shortloop
-#line 2990
     for (i=0; i<ni; i++) {
-#line 2990
       tp[i] = (longlong) Max( LONGLONG_MIN, Min(LONGLONG_MAX, (longlong) xp[i]));
-#line 2990
      /* test for range errors (not always needed but do it anyway) */
-#line 2990
       nrange += xp[i] < LONGLONG_MIN || xp[i] > LONGLONG_MAX;
-#line 2990
     }
-#line 2990
    /* update xpp and tp */
-#line 2990
     if (realign) xp = (double *) *xpp;
-#line 2990
     xp += ni;
-#line 2990
     tp += ni;
-#line 2990
     *xpp = (void*)xp;
-#line 2990
   }
-#line 2990
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2990
 
-#line 2990
 #else   /* not SX */
-#line 2990
 	const char *xp = (const char *) *xpp;
-#line 2990
 	int status = ENOERR;
-#line 2990
 
-#line 2990
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2990
 	{
-#line 2990
 		const int lstatus = ncx_get_double_longlong(xp, tp);
-#line 2990
 		if(lstatus != ENOERR)
-#line 2990
 			status = lstatus;
-#line 2990
 	}
-#line 2990
 
-#line 2990
 	*xpp = (const void *)xp;
-#line 2990
 	return status;
-#line 2990
 #  endif
-#line 2990
 }
-#line 2990
 
 int
-#line 2991
 ncx_getn_double_ulonglong(const void **xpp, size_t nelems, ulonglong *tp)
-#line 2991
 {
-#line 2991
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 2991
 
-#line 2991
  /* basic algorithm is:
-#line 2991
   *   - ensure sane alignment of input data
-#line 2991
   *   - copy (conversion happens automatically) input data
-#line 2991
   *     to output
-#line 2991
   *   - update xpp to point at next unconverted input, and tp to point
-#line 2991
   *     at next location for converted output
-#line 2991
   */
-#line 2991
   long i, j, ni;
-#line 2991
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 2991
   double *xp;
-#line 2991
   int nrange = 0;         /* number of range errors */
-#line 2991
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 2991
   long cxp = (long) *((char**)xpp);
-#line 2991
 
-#line 2991
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 2991
   /* sjl: manually stripmine so we can limit amount of
-#line 2991
    * vector work space reserved to LOOPCNT elements. Also
-#line 2991
    * makes vectorisation easy */
-#line 2991
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 2991
     ni=Min(nelems-j,LOOPCNT);
-#line 2991
     if (realign) {
-#line 2991
       memcpy(tmp, *xpp, ni*SIZEOF_DOUBLE);
-#line 2991
       xp = tmp;
-#line 2991
     } else {
-#line 2991
       xp = (double *) *xpp;
-#line 2991
     }
-#line 2991
    /* copy the next block */
-#line 2991
 #pragma cdir loopcnt=LOOPCNT
-#line 2991
 #pragma cdir shortloop
-#line 2991
     for (i=0; i<ni; i++) {
-#line 2991
       tp[i] = (ulonglong) Max( ULONGLONG_MIN, Min(ULONGLONG_MAX, (ulonglong) xp[i]));
-#line 2991
      /* test for range errors (not always needed but do it anyway) */
-#line 2991
       nrange += xp[i] < ULONGLONG_MIN || xp[i] > ULONGLONG_MAX;
-#line 2991
     }
-#line 2991
    /* update xpp and tp */
-#line 2991
     if (realign) xp = (double *) *xpp;
-#line 2991
     xp += ni;
-#line 2991
     tp += ni;
-#line 2991
     *xpp = (void*)xp;
-#line 2991
   }
-#line 2991
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 2991
 
-#line 2991
 #else   /* not SX */
-#line 2991
 	const char *xp = (const char *) *xpp;
-#line 2991
 	int status = ENOERR;
-#line 2991
 
-#line 2991
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 2991
 	{
-#line 2991
 		const int lstatus = ncx_get_double_ulonglong(xp, tp);
-#line 2991
 		if(lstatus != ENOERR)
-#line 2991
 			status = lstatus;
-#line 2991
 	}
-#line 2991
 
-#line 2991
 	*xpp = (const void *)xp;
-#line 2991
 	return status;
-#line 2991
 #  endif
-#line 2991
 }
-#line 2991
 
 #if X_SIZEOF_DOUBLE == SIZEOF_DOUBLE && !defined(NO_IEEE_FLOAT)
 /* optimized version */
@@ -12740,87 +7484,46 @@ ncx_getn_double_double(const void **xpp, size_t ndoubles, double *ip)
 	while(ip < end)
 	{
 	struct vax_double *const vdp =
-#line 3013
 			 (struct vax_double *)ip;
-#line 3013
 	const struct ieee_double *const idp =
-#line 3013
 			 (const struct ieee_double *) (*xpp);
-#line 3013
 	{
-#line 3013
 		const struct dbl_limits *lim;
-#line 3013
 		int ii;
-#line 3013
 		for (ii = 0, lim = dbl_limits;
-#line 3013
 			ii < sizeof(dbl_limits)/sizeof(struct dbl_limits);
-#line 3013
 			ii++, lim++)
-#line 3013
 		{
-#line 3013
 			if ((idp->mant_lo == lim->ieee.mant_lo)
-#line 3013
 				&& (idp->mant_4 == lim->ieee.mant_4)
-#line 3013
 				&& (idp->mant_5 == lim->ieee.mant_5)
-#line 3013
 				&& (idp->mant_6 == lim->ieee.mant_6)
-#line 3013
 				&& (idp->exp_lo == lim->ieee.exp_lo)
-#line 3013
 				&& (idp->exp_hi == lim->ieee.exp_hi)
-#line 3013
 				)
-#line 3013
 			{
-#line 3013
 				*vdp = lim->d;
-#line 3013
 				goto doneit;
-#line 3013
 			}
-#line 3013
 		}
-#line 3013
 	}
-#line 3013
 	{
-#line 3013
 		unsigned exp = idp->exp_hi << 4 | idp->exp_lo;
-#line 3013
 		vdp->exp = exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
-#line 3013
 	}
-#line 3013
 	{
-#line 3013
 		unsigned mant_hi = ((idp->mant_6 << 16)
-#line 3013
 				 | (idp->mant_5 << 8)
-#line 3013
 				 | idp->mant_4);
-#line 3013
 		unsigned mant_lo = SWAP4(idp->mant_lo);
-#line 3013
 		vdp->mantissa1 = (mant_hi >> 13);
-#line 3013
 		vdp->mantissa2 = ((mant_hi & MASK(13)) << 3)
-#line 3013
 				| (mant_lo >> 29);
-#line 3013
 		vdp->mantissa3 = (mant_lo >> 13);
-#line 3013
 		vdp->mantissa4 = (mant_lo << 3);
-#line 3013
 	}
-#line 3013
 	doneit:
-#line 3013
 		vdp->sign = idp->sign;
-#line 3013
 
 		ip++;
 		*xpp = (char *)(*xpp) + X_SIZEOF_DOUBLE;
@@ -12849,1085 +7552,548 @@ ncx_getn_double_double(const void **xpp, size_t nelems, double *tp)
 #endif
 
 int
-#line 3040
 ncx_putn_double_schar(void **xpp, size_t nelems, const schar *tp)
-#line 3040
 {
-#line 3040
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3040
 
-#line 3040
  /* basic algorithm is:
-#line 3040
   *   - ensure sane alignment of output data
-#line 3040
   *   - copy (conversion happens automatically) input data
-#line 3040
   *     to output
-#line 3040
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3040
   *     at next location for converted output
-#line 3040
   */
-#line 3040
   long i, j, ni;
-#line 3040
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3040
   double *xp;
-#line 3040
   int nrange = 0;         /* number of range errors */
-#line 3040
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3040
   long cxp = (long) *((char**)xpp);
-#line 3040
 
-#line 3040
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3040
   /* sjl: manually stripmine so we can limit amount of
-#line 3040
    * vector work space reserved to LOOPCNT elements. Also
-#line 3040
    * makes vectorisation easy */
-#line 3040
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3040
     ni=Min(nelems-j,LOOPCNT);
-#line 3040
     if (realign) {
-#line 3040
       xp = tmp;
-#line 3040
     } else {
-#line 3040
       xp = (double *) *xpp;
-#line 3040
     }
-#line 3040
    /* copy the next block */
-#line 3040
 #pragma cdir loopcnt=LOOPCNT
-#line 3040
 #pragma cdir shortloop
-#line 3040
     for (i=0; i<ni; i++) {
-#line 3040
       /* the normal case: */
-#line 3040
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3040
      /* test for range errors (not always needed but do it anyway) */
-#line 3040
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3040
     }
-#line 3040
    /* copy workspace back if necessary */ 
-#line 3040
     if (realign) {
-#line 3040
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3040
       xp = (double *) *xpp;
-#line 3040
     }
-#line 3040
    /* update xpp and tp */
-#line 3040
     xp += ni;
-#line 3040
     tp += ni;
-#line 3040
     *xpp = (void*)xp;
-#line 3040
   }
-#line 3040
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3040
 
-#line 3040
 #else   /* not SX */
-#line 3040
 
-#line 3040
 	char *xp = (char *) *xpp;
-#line 3040
 	int status = ENOERR;
-#line 3040
 
-#line 3040
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3040
 	{
-#line 3040
 		int lstatus = ncx_put_double_schar(xp, tp);
-#line 3040
 		if(lstatus != ENOERR)
-#line 3040
 			status = lstatus;
-#line 3040
 	}
-#line 3040
 
-#line 3040
 	*xpp = (void *)xp;
-#line 3040
 	return status;
-#line 3040
 #endif
-#line 3040
 }
-#line 3040
 
 int
-#line 3041
 ncx_putn_double_uchar(void **xpp, size_t nelems, const uchar *tp)
-#line 3041
 {
-#line 3041
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3041
 
-#line 3041
  /* basic algorithm is:
-#line 3041
   *   - ensure sane alignment of output data
-#line 3041
   *   - copy (conversion happens automatically) input data
-#line 3041
   *     to output
-#line 3041
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3041
   *     at next location for converted output
-#line 3041
   */
-#line 3041
   long i, j, ni;
-#line 3041
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3041
   double *xp;
-#line 3041
   int nrange = 0;         /* number of range errors */
-#line 3041
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3041
   long cxp = (long) *((char**)xpp);
-#line 3041
 
-#line 3041
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3041
   /* sjl: manually stripmine so we can limit amount of
-#line 3041
    * vector work space reserved to LOOPCNT elements. Also
-#line 3041
    * makes vectorisation easy */
-#line 3041
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3041
     ni=Min(nelems-j,LOOPCNT);
-#line 3041
     if (realign) {
-#line 3041
       xp = tmp;
-#line 3041
     } else {
-#line 3041
       xp = (double *) *xpp;
-#line 3041
     }
-#line 3041
    /* copy the next block */
-#line 3041
 #pragma cdir loopcnt=LOOPCNT
-#line 3041
 #pragma cdir shortloop
-#line 3041
     for (i=0; i<ni; i++) {
-#line 3041
       /* the normal case: */
-#line 3041
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3041
      /* test for range errors (not always needed but do it anyway) */
-#line 3041
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3041
     }
-#line 3041
    /* copy workspace back if necessary */ 
-#line 3041
     if (realign) {
-#line 3041
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3041
       xp = (double *) *xpp;
-#line 3041
     }
-#line 3041
    /* update xpp and tp */
-#line 3041
     xp += ni;
-#line 3041
     tp += ni;
-#line 3041
     *xpp = (void*)xp;
-#line 3041
   }
-#line 3041
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3041
 
-#line 3041
 #else   /* not SX */
-#line 3041
 
-#line 3041
 	char *xp = (char *) *xpp;
-#line 3041
 	int status = ENOERR;
-#line 3041
 
-#line 3041
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3041
 	{
-#line 3041
 		int lstatus = ncx_put_double_uchar(xp, tp);
-#line 3041
 		if(lstatus != ENOERR)
-#line 3041
 			status = lstatus;
-#line 3041
 	}
-#line 3041
 
-#line 3041
 	*xpp = (void *)xp;
-#line 3041
 	return status;
-#line 3041
 #endif
-#line 3041
 }
-#line 3041
 
 int
-#line 3042
 ncx_putn_double_short(void **xpp, size_t nelems, const short *tp)
-#line 3042
 {
-#line 3042
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3042
 
-#line 3042
  /* basic algorithm is:
-#line 3042
   *   - ensure sane alignment of output data
-#line 3042
   *   - copy (conversion happens automatically) input data
-#line 3042
   *     to output
-#line 3042
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3042
   *     at next location for converted output
-#line 3042
   */
-#line 3042
   long i, j, ni;
-#line 3042
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3042
   double *xp;
-#line 3042
   int nrange = 0;         /* number of range errors */
-#line 3042
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3042
   long cxp = (long) *((char**)xpp);
-#line 3042
 
-#line 3042
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3042
   /* sjl: manually stripmine so we can limit amount of
-#line 3042
    * vector work space reserved to LOOPCNT elements. Also
-#line 3042
    * makes vectorisation easy */
-#line 3042
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3042
     ni=Min(nelems-j,LOOPCNT);
-#line 3042
     if (realign) {
-#line 3042
       xp = tmp;
-#line 3042
     } else {
-#line 3042
       xp = (double *) *xpp;
-#line 3042
     }
-#line 3042
    /* copy the next block */
-#line 3042
 #pragma cdir loopcnt=LOOPCNT
-#line 3042
 #pragma cdir shortloop
-#line 3042
     for (i=0; i<ni; i++) {
-#line 3042
       /* the normal case: */
-#line 3042
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3042
      /* test for range errors (not always needed but do it anyway) */
-#line 3042
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3042
     }
-#line 3042
    /* copy workspace back if necessary */ 
-#line 3042
     if (realign) {
-#line 3042
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3042
       xp = (double *) *xpp;
-#line 3042
     }
-#line 3042
    /* update xpp and tp */
-#line 3042
     xp += ni;
-#line 3042
     tp += ni;
-#line 3042
     *xpp = (void*)xp;
-#line 3042
   }
-#line 3042
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3042
 
-#line 3042
 #else   /* not SX */
-#line 3042
 
-#line 3042
 	char *xp = (char *) *xpp;
-#line 3042
 	int status = ENOERR;
-#line 3042
 
-#line 3042
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3042
 	{
-#line 3042
 		int lstatus = ncx_put_double_short(xp, tp);
-#line 3042
 		if(lstatus != ENOERR)
-#line 3042
 			status = lstatus;
-#line 3042
 	}
-#line 3042
 
-#line 3042
 	*xpp = (void *)xp;
-#line 3042
 	return status;
-#line 3042
 #endif
-#line 3042
 }
-#line 3042
 
 int
-#line 3043
 ncx_putn_double_int(void **xpp, size_t nelems, const int *tp)
-#line 3043
 {
-#line 3043
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3043
 
-#line 3043
  /* basic algorithm is:
-#line 3043
   *   - ensure sane alignment of output data
-#line 3043
   *   - copy (conversion happens automatically) input data
-#line 3043
   *     to output
-#line 3043
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3043
   *     at next location for converted output
-#line 3043
   */
-#line 3043
   long i, j, ni;
-#line 3043
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3043
   double *xp;
-#line 3043
   int nrange = 0;         /* number of range errors */
-#line 3043
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3043
   long cxp = (long) *((char**)xpp);
-#line 3043
 
-#line 3043
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3043
   /* sjl: manually stripmine so we can limit amount of
-#line 3043
    * vector work space reserved to LOOPCNT elements. Also
-#line 3043
    * makes vectorisation easy */
-#line 3043
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3043
     ni=Min(nelems-j,LOOPCNT);
-#line 3043
     if (realign) {
-#line 3043
       xp = tmp;
-#line 3043
     } else {
-#line 3043
       xp = (double *) *xpp;
-#line 3043
     }
-#line 3043
    /* copy the next block */
-#line 3043
 #pragma cdir loopcnt=LOOPCNT
-#line 3043
 #pragma cdir shortloop
-#line 3043
     for (i=0; i<ni; i++) {
-#line 3043
       /* the normal case: */
-#line 3043
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3043
      /* test for range errors (not always needed but do it anyway) */
-#line 3043
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3043
     }
-#line 3043
    /* copy workspace back if necessary */ 
-#line 3043
     if (realign) {
-#line 3043
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3043
       xp = (double *) *xpp;
-#line 3043
     }
-#line 3043
    /* update xpp and tp */
-#line 3043
     xp += ni;
-#line 3043
     tp += ni;
-#line 3043
     *xpp = (void*)xp;
-#line 3043
   }
-#line 3043
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3043
 
-#line 3043
 #else   /* not SX */
-#line 3043
 
-#line 3043
 	char *xp = (char *) *xpp;
-#line 3043
 	int status = ENOERR;
-#line 3043
 
-#line 3043
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3043
 	{
-#line 3043
 		int lstatus = ncx_put_double_int(xp, tp);
-#line 3043
 		if(lstatus != ENOERR)
-#line 3043
 			status = lstatus;
-#line 3043
 	}
-#line 3043
 
-#line 3043
 	*xpp = (void *)xp;
-#line 3043
 	return status;
-#line 3043
 #endif
-#line 3043
 }
-#line 3043
 
 int
-#line 3044
 ncx_putn_double_float(void **xpp, size_t nelems, const float *tp)
-#line 3044
 {
-#line 3044
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3044
 
-#line 3044
  /* basic algorithm is:
-#line 3044
   *   - ensure sane alignment of output data
-#line 3044
   *   - copy (conversion happens automatically) input data
-#line 3044
   *     to output
-#line 3044
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3044
   *     at next location for converted output
-#line 3044
   */
-#line 3044
   long i, j, ni;
-#line 3044
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3044
   double *xp;
-#line 3044
   int nrange = 0;         /* number of range errors */
-#line 3044
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3044
   long cxp = (long) *((char**)xpp);
-#line 3044
 
-#line 3044
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3044
   /* sjl: manually stripmine so we can limit amount of
-#line 3044
    * vector work space reserved to LOOPCNT elements. Also
-#line 3044
    * makes vectorisation easy */
-#line 3044
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3044
     ni=Min(nelems-j,LOOPCNT);
-#line 3044
     if (realign) {
-#line 3044
       xp = tmp;
-#line 3044
     } else {
-#line 3044
       xp = (double *) *xpp;
-#line 3044
     }
-#line 3044
    /* copy the next block */
-#line 3044
 #pragma cdir loopcnt=LOOPCNT
-#line 3044
 #pragma cdir shortloop
-#line 3044
     for (i=0; i<ni; i++) {
-#line 3044
       /* the normal case: */
-#line 3044
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3044
      /* test for range errors (not always needed but do it anyway) */
-#line 3044
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3044
     }
-#line 3044
    /* copy workspace back if necessary */ 
-#line 3044
     if (realign) {
-#line 3044
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3044
       xp = (double *) *xpp;
-#line 3044
     }
-#line 3044
    /* update xpp and tp */
-#line 3044
     xp += ni;
-#line 3044
     tp += ni;
-#line 3044
     *xpp = (void*)xp;
-#line 3044
   }
-#line 3044
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3044
 
-#line 3044
 #else   /* not SX */
-#line 3044
 
-#line 3044
 	char *xp = (char *) *xpp;
-#line 3044
 	int status = ENOERR;
-#line 3044
 
-#line 3044
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3044
 	{
-#line 3044
 		int lstatus = ncx_put_double_float(xp, tp);
-#line 3044
 		if(lstatus != ENOERR)
-#line 3044
 			status = lstatus;
-#line 3044
 	}
-#line 3044
 
-#line 3044
 	*xpp = (void *)xp;
-#line 3044
 	return status;
-#line 3044
 #endif
-#line 3044
 }
-#line 3044
 
-#line 3046
 int
-#line 3046
 ncx_putn_double_uint(void **xpp, size_t nelems, const uint *tp)
-#line 3046
 {
-#line 3046
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3046
 
-#line 3046
  /* basic algorithm is:
-#line 3046
   *   - ensure sane alignment of output data
-#line 3046
   *   - copy (conversion happens automatically) input data
-#line 3046
   *     to output
-#line 3046
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3046
   *     at next location for converted output
-#line 3046
   */
-#line 3046
   long i, j, ni;
-#line 3046
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3046
   double *xp;
-#line 3046
   int nrange = 0;         /* number of range errors */
-#line 3046
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3046
   long cxp = (long) *((char**)xpp);
-#line 3046
 
-#line 3046
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3046
   /* sjl: manually stripmine so we can limit amount of
-#line 3046
    * vector work space reserved to LOOPCNT elements. Also
-#line 3046
    * makes vectorisation easy */
-#line 3046
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3046
     ni=Min(nelems-j,LOOPCNT);
-#line 3046
     if (realign) {
-#line 3046
       xp = tmp;
-#line 3046
     } else {
-#line 3046
       xp = (double *) *xpp;
-#line 3046
     }
-#line 3046
    /* copy the next block */
-#line 3046
 #pragma cdir loopcnt=LOOPCNT
-#line 3046
 #pragma cdir shortloop
-#line 3046
     for (i=0; i<ni; i++) {
-#line 3046
       /* the normal case: */
-#line 3046
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3046
      /* test for range errors (not always needed but do it anyway) */
-#line 3046
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3046
     }
-#line 3046
    /* copy workspace back if necessary */ 
-#line 3046
     if (realign) {
-#line 3046
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3046
       xp = (double *) *xpp;
-#line 3046
     }
-#line 3046
    /* update xpp and tp */
-#line 3046
     xp += ni;
-#line 3046
     tp += ni;
-#line 3046
     *xpp = (void*)xp;
-#line 3046
   }
-#line 3046
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3046
 
-#line 3046
 #else   /* not SX */
-#line 3046
 
-#line 3046
 	char *xp = (char *) *xpp;
-#line 3046
 	int status = ENOERR;
-#line 3046
 
-#line 3046
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3046
 	{
-#line 3046
 		int lstatus = ncx_put_double_uint(xp, tp);
-#line 3046
 		if(lstatus != ENOERR)
-#line 3046
 			status = lstatus;
-#line 3046
 	}
-#line 3046
 
-#line 3046
 	*xpp = (void *)xp;
-#line 3046
 	return status;
-#line 3046
 #endif
-#line 3046
 }
-#line 3046
 
 int
-#line 3047
 ncx_putn_double_longlong(void **xpp, size_t nelems, const longlong *tp)
-#line 3047
 {
-#line 3047
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3047
 
-#line 3047
  /* basic algorithm is:
-#line 3047
   *   - ensure sane alignment of output data
-#line 3047
   *   - copy (conversion happens automatically) input data
-#line 3047
   *     to output
-#line 3047
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3047
   *     at next location for converted output
-#line 3047
   */
-#line 3047
   long i, j, ni;
-#line 3047
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3047
   double *xp;
-#line 3047
   int nrange = 0;         /* number of range errors */
-#line 3047
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3047
   long cxp = (long) *((char**)xpp);
-#line 3047
 
-#line 3047
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3047
   /* sjl: manually stripmine so we can limit amount of
-#line 3047
    * vector work space reserved to LOOPCNT elements. Also
-#line 3047
    * makes vectorisation easy */
-#line 3047
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3047
     ni=Min(nelems-j,LOOPCNT);
-#line 3047
     if (realign) {
-#line 3047
       xp = tmp;
-#line 3047
     } else {
-#line 3047
       xp = (double *) *xpp;
-#line 3047
     }
-#line 3047
    /* copy the next block */
-#line 3047
 #pragma cdir loopcnt=LOOPCNT
-#line 3047
 #pragma cdir shortloop
-#line 3047
     for (i=0; i<ni; i++) {
-#line 3047
       /* the normal case: */
-#line 3047
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3047
      /* test for range errors (not always needed but do it anyway) */
-#line 3047
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3047
     }
-#line 3047
    /* copy workspace back if necessary */ 
-#line 3047
     if (realign) {
-#line 3047
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3047
       xp = (double *) *xpp;
-#line 3047
     }
-#line 3047
    /* update xpp and tp */
-#line 3047
     xp += ni;
-#line 3047
     tp += ni;
-#line 3047
     *xpp = (void*)xp;
-#line 3047
   }
-#line 3047
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3047
 
-#line 3047
 #else   /* not SX */
-#line 3047
 
-#line 3047
 	char *xp = (char *) *xpp;
-#line 3047
 	int status = ENOERR;
-#line 3047
 
-#line 3047
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3047
 	{
-#line 3047
 		int lstatus = ncx_put_double_longlong(xp, tp);
-#line 3047
 		if(lstatus != ENOERR)
-#line 3047
 			status = lstatus;
-#line 3047
 	}
-#line 3047
 
-#line 3047
 	*xpp = (void *)xp;
-#line 3047
 	return status;
-#line 3047
 #endif
-#line 3047
 }
-#line 3047
 
 int
-#line 3048
 ncx_putn_double_ulonglong(void **xpp, size_t nelems, const ulonglong *tp)
-#line 3048
 {
-#line 3048
 #if _SX && X_SIZEOF_DOUBLE == SIZEOF_DOUBLE
-#line 3048
 
-#line 3048
  /* basic algorithm is:
-#line 3048
   *   - ensure sane alignment of output data
-#line 3048
   *   - copy (conversion happens automatically) input data
-#line 3048
   *     to output
-#line 3048
   *   - update tp to point at next unconverted input, and xpp to point
-#line 3048
   *     at next location for converted output
-#line 3048
   */
-#line 3048
   long i, j, ni;
-#line 3048
   double tmp[LOOPCNT];        /* in case input is misaligned */
-#line 3048
   double *xp;
-#line 3048
   int nrange = 0;         /* number of range errors */
-#line 3048
   int realign = 0;        /* "do we need to fix input data alignment?" */
-#line 3048
   long cxp = (long) *((char**)xpp);
-#line 3048
 
-#line 3048
   realign = (cxp & 7) % SIZEOF_DOUBLE;
-#line 3048
   /* sjl: manually stripmine so we can limit amount of
-#line 3048
    * vector work space reserved to LOOPCNT elements. Also
-#line 3048
    * makes vectorisation easy */
-#line 3048
   for (j=0; j<nelems && nrange==0; j+=LOOPCNT) {
-#line 3048
     ni=Min(nelems-j,LOOPCNT);
-#line 3048
     if (realign) {
-#line 3048
       xp = tmp;
-#line 3048
     } else {
-#line 3048
       xp = (double *) *xpp;
-#line 3048
     }
-#line 3048
    /* copy the next block */
-#line 3048
 #pragma cdir loopcnt=LOOPCNT
-#line 3048
 #pragma cdir shortloop
-#line 3048
     for (i=0; i<ni; i++) {
-#line 3048
       /* the normal case: */
-#line 3048
       xp[i] = (double) Max( X_DOUBLE_MIN, Min(X_DOUBLE_MAX, (double) tp[i]));
-#line 3048
      /* test for range errors (not always needed but do it anyway) */
-#line 3048
       nrange += tp[i] < X_DOUBLE_MIN || tp[i] > X_DOUBLE_MAX;
-#line 3048
     }
-#line 3048
    /* copy workspace back if necessary */ 
-#line 3048
     if (realign) {
-#line 3048
       memcpy(*xpp, tmp, ni*X_SIZEOF_DOUBLE);
-#line 3048
       xp = (double *) *xpp;
-#line 3048
     }
-#line 3048
    /* update xpp and tp */
-#line 3048
     xp += ni;
-#line 3048
     tp += ni;
-#line 3048
     *xpp = (void*)xp;
-#line 3048
   }
-#line 3048
   return nrange == 0 ? ENOERR : NC_ERANGE;
-#line 3048
 
-#line 3048
 #else   /* not SX */
-#line 3048
 
-#line 3048
 	char *xp = (char *) *xpp;
-#line 3048
 	int status = ENOERR;
-#line 3048
 
-#line 3048
 	for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
-#line 3048
 	{
-#line 3048
 		int lstatus = ncx_put_double_ulonglong(xp, tp);
-#line 3048
 		if(lstatus != ENOERR)
-#line 3048
 			status = lstatus;
-#line 3048
 	}
-#line 3048
 
-#line 3048
 	*xpp = (void *)xp;
-#line 3048
 	return status;
-#line 3048
 #endif
-#line 3048
 }
-#line 3048
 
 #if X_SIZEOF_DOUBLE == SIZEOF_DOUBLE && !defined(NO_IEEE_FLOAT)
 /* optimized version */
@@ -13951,123 +8117,64 @@ ncx_putn_double_double(void **xpp, size_t ndoubles, const double *ip)
 	while(ip < end)
 	{
 	const struct vax_double *const vdp = 
-#line 3070
 			(const struct vax_double *)ip;
-#line 3070
 	struct ieee_double *const idp =
-#line 3070
 			 (struct ieee_double *) (*xpp);
-#line 3070
 
-#line 3070
 	if ((vdp->mantissa4 > (dbl_limits[0].d.mantissa4 - 3)) &&
-#line 3070
 		(vdp->mantissa3 == dbl_limits[0].d.mantissa3) &&
-#line 3070
 		(vdp->mantissa2 == dbl_limits[0].d.mantissa2) &&
-#line 3070
 		(vdp->mantissa1 == dbl_limits[0].d.mantissa1) &&
-#line 3070
 		(vdp->exp == dbl_limits[0].d.exp))
-#line 3070
 	{
-#line 3070
 		*idp = dbl_limits[0].ieee;
-#line 3070
 		goto shipit;
-#line 3070
 	}
-#line 3070
 	if ((vdp->mantissa4 == dbl_limits[1].d.mantissa4) &&
-#line 3070
 		(vdp->mantissa3 == dbl_limits[1].d.mantissa3) &&
-#line 3070
 		(vdp->mantissa2 == dbl_limits[1].d.mantissa2) &&
-#line 3070
 		(vdp->mantissa1 == dbl_limits[1].d.mantissa1) &&
-#line 3070
 		(vdp->exp == dbl_limits[1].d.exp))
-#line 3070
 	{
-#line 3070
 		*idp = dbl_limits[1].ieee;
-#line 3070
 		goto shipit;
-#line 3070
 	}
-#line 3070
 
-#line 3070
 	{
-#line 3070
 		unsigned exp = vdp->exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
-#line 3070
 
-#line 3070
 		unsigned mant_lo = ((vdp->mantissa2 & MASK(3)) << 29) |
-#line 3070
 			(vdp->mantissa3 << 13) |
-#line 3070
 			((vdp->mantissa4 >> 3) & MASK(13));
-#line 3070
 
-#line 3070
 		unsigned mant_hi = (vdp->mantissa1 << 13)
-#line 3070
 				 | (vdp->mantissa2 >> 3);
-#line 3070
 
-#line 3070
 		if((vdp->mantissa4 & 7) > 4)
-#line 3070
 		{
-#line 3070
 			/* round up */
-#line 3070
 			mant_lo++;
-#line 3070
 			if(mant_lo == 0)
-#line 3070
 			{
-#line 3070
 				mant_hi++;
-#line 3070
 				if(mant_hi > 0xffffff)
-#line 3070
 				{
-#line 3070
 					mant_hi = 0;
-#line 3070
 					exp++;
-#line 3070
 				}
-#line 3070
 			}
-#line 3070
 		}
-#line 3070
 
-#line 3070
 		idp->mant_lo = SWAP4(mant_lo);
-#line 3070
 		idp->mant_6 = mant_hi >> 16;
-#line 3070
 		idp->mant_5 = (mant_hi & 0xff00) >> 8;
-#line 3070
 		idp->mant_4 = mant_hi;
-#line 3070
 		idp->exp_hi = exp >> 4;
-#line 3070
 		idp->exp_lo = exp;
-#line 3070
 	}
-#line 3070
 		
-#line 3070
 	shipit:
-#line 3070
 		idp->sign = vdp->sign;
-#line 3070
 
 		ip++;
 		*xpp = (char *)(*xpp) + X_SIZEOF_DOUBLE;
@@ -14106,11 +8213,8 @@ int
 ncx_getn_text(const void **xpp, size_t nelems, char *tp)
 {
 	(void) memcpy(tp, *xpp, nelems);
-#line 3107
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3107
 	return ENOERR;
-#line 3107
 
 }
 
@@ -14118,23 +8222,14 @@ int
 ncx_pad_getn_text(const void **xpp, size_t nelems, char *tp)
 {
 	size_t rndup = nelems % X_ALIGN;
-#line 3113
 
-#line 3113
 	if(rndup)
-#line 3113
 		rndup = X_ALIGN - rndup;
-#line 3113
 
-#line 3113
 	(void) memcpy(tp, *xpp, nelems);
-#line 3113
 	*xpp = (void *)((char *)(*xpp) + nelems + rndup);
-#line 3113
 
-#line 3113
 	return ENOERR;
-#line 3113
 
 }
 
@@ -14142,13 +8237,9 @@ int
 ncx_putn_text(void **xpp, size_t nelems, const char *tp)
 {
 	(void) memcpy(*xpp, tp, nelems);
-#line 3119
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3119
 
-#line 3119
 	return ENOERR;
-#line 3119
 
 }
 
@@ -14156,35 +8247,20 @@ int
 ncx_pad_putn_text(void **xpp, size_t nelems, const char *tp)
 {
 	size_t rndup = nelems % X_ALIGN;
-#line 3125
 
-#line 3125
 	if(rndup)
-#line 3125
 		rndup = X_ALIGN - rndup;
-#line 3125
 
-#line 3125
 	(void) memcpy(*xpp, tp, nelems);
-#line 3125
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3125
 
-#line 3125
 	if(rndup)
-#line 3125
 	{
-#line 3125
 		(void) memcpy(*xpp, nada, rndup);
-#line 3125
 		*xpp = (void *)((char *)(*xpp) + rndup);
-#line 3125
 	}
-#line 3125
 	
-#line 3125
 	return ENOERR;
-#line 3125
 
 }
 
@@ -14195,11 +8271,8 @@ int
 ncx_getn_void(const void **xpp, size_t nelems, void *tp)
 {
 	(void) memcpy(tp, *xpp, nelems);
-#line 3134
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3134
 	return ENOERR;
-#line 3134
 
 }
 
@@ -14207,23 +8280,14 @@ int
 ncx_pad_getn_void(const void **xpp, size_t nelems, void *tp)
 {
 	size_t rndup = nelems % X_ALIGN;
-#line 3140
 
-#line 3140
 	if(rndup)
-#line 3140
 		rndup = X_ALIGN - rndup;
-#line 3140
 
-#line 3140
 	(void) memcpy(tp, *xpp, nelems);
-#line 3140
 	*xpp = (void *)((char *)(*xpp) + nelems + rndup);
-#line 3140
 
-#line 3140
 	return ENOERR;
-#line 3140
 
 }
 
@@ -14231,13 +8295,9 @@ int
 ncx_putn_void(void **xpp, size_t nelems, const void *tp)
 {
 	(void) memcpy(*xpp, tp, nelems);
-#line 3146
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3146
 
-#line 3146
 	return ENOERR;
-#line 3146
 
 }
 
@@ -14245,34 +8305,19 @@ int
 ncx_pad_putn_void(void **xpp, size_t nelems, const void *tp)
 {
 	size_t rndup = nelems % X_ALIGN;
-#line 3152
 
-#line 3152
 	if(rndup)
-#line 3152
 		rndup = X_ALIGN - rndup;
-#line 3152
 
-#line 3152
 	(void) memcpy(*xpp, tp, nelems);
-#line 3152
 	*xpp = (void *)((char *)(*xpp) + nelems);
-#line 3152
 
-#line 3152
 	if(rndup)
-#line 3152
 	{
-#line 3152
 		(void) memcpy(*xpp, nada, rndup);
-#line 3152
 		*xpp = (void *)((char *)(*xpp) + rndup);
-#line 3152
 	}
-#line 3152
 	
-#line 3152
 	return ENOERR;
-#line 3152
 
 }
diff --git a/libsrc/posixio.c b/libsrc/posixio.c
index ce05dce..0bb1e04 100644
--- a/libsrc/posixio.c
+++ b/libsrc/posixio.c
@@ -667,7 +667,7 @@ done:
 	pxp->bf_rflags |= rflags;
 	pxp->bf_refcount++;
 
-	*vpp = (char *)pxp->bf_base + diff;
+    *vpp = (void *)((char *)pxp->bf_base + diff);
 	return ENOERR;
 }
 
@@ -1516,6 +1516,7 @@ int
 posixio_create(const char *path, int ioflags,
 	size_t initialsz,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+	void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
@@ -1659,6 +1660,7 @@ int
 posixio_open(const char *path,
 	int ioflags,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+        void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
diff --git a/libsrc/putget.c b/libsrc/putget.c
index 6520b92..3add44a 100644
--- a/libsrc/putget.c
+++ b/libsrc/putget.c
@@ -1,6 +1,4 @@
-#line 9 "../../libsrc/putget.m4"
 /* Do not edit this file. It is produced from the corresponding .m4 source */
-#line 11
 /*
  *	Copyright 1996, University Corporation for Atmospheric Research
  *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
@@ -72,7 +70,6 @@ arrayp(const char *label, size_t count, const size_t *array)
 #endif
 
 
-#line 107
 
 /*
  * Next 6 type specific functions
@@ -81,284 +78,151 @@ arrayp(const char *label, size_t count, const size_t *array)
 NC_arrayfill()
  */
 static int
-#line 114
 NC_fill_schar(
-#line 114
 	void **xpp,
-#line 114
 	size_t nelems)	/* how many */
-#line 114
 {
-#line 114
 	schar fillp[NFILL * sizeof(double)/X_SIZEOF_CHAR];
-#line 114
 
-#line 114
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 114
 
-#line 114
 	{
-#line 114
 		schar *vp = fillp;	/* lower bound of area to be filled */
-#line 114
 		const schar *const end = vp + nelems;
-#line 114
 		while(vp < end)
-#line 114
 		{
-#line 114
 			*vp++ = NC_FILL_BYTE;
-#line 114
 		}
-#line 114
 	}
-#line 114
 	return ncx_putn_schar_schar(xpp, nelems, fillp);
-#line 114
 }
-#line 114
 
 static int
-#line 115
 NC_fill_char(
-#line 115
 	void **xpp,
-#line 115
 	size_t nelems)	/* how many */
-#line 115
 {
-#line 115
 	char fillp[NFILL * sizeof(double)/X_SIZEOF_CHAR];
-#line 115
 
-#line 115
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 115
 
-#line 115
 	{
-#line 115
 		char *vp = fillp;	/* lower bound of area to be filled */
-#line 115
 		const char *const end = vp + nelems;
-#line 115
 		while(vp < end)
-#line 115
 		{
-#line 115
 			*vp++ = NC_FILL_CHAR;
-#line 115
 		}
-#line 115
 	}
-#line 115
 	return ncx_putn_char_char(xpp, nelems, fillp);
-#line 115
 }
-#line 115
 
 static int
-#line 116
 NC_fill_short(
-#line 116
 	void **xpp,
-#line 116
 	size_t nelems)	/* how many */
-#line 116
 {
-#line 116
 	short fillp[NFILL * sizeof(double)/X_SIZEOF_SHORT];
-#line 116
 
-#line 116
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 116
 
-#line 116
 	{
-#line 116
 		short *vp = fillp;	/* lower bound of area to be filled */
-#line 116
 		const short *const end = vp + nelems;
-#line 116
 		while(vp < end)
-#line 116
 		{
-#line 116
 			*vp++ = NC_FILL_SHORT;
-#line 116
 		}
-#line 116
 	}
-#line 116
 	return ncx_putn_short_short(xpp, nelems, fillp);
-#line 116
 }
-#line 116
 
 
 #if (SIZEOF_INT >= X_SIZEOF_INT)
 static int
-#line 119
 NC_fill_int(
-#line 119
 	void **xpp,
-#line 119
 	size_t nelems)	/* how many */
-#line 119
 {
-#line 119
 	int fillp[NFILL * sizeof(double)/X_SIZEOF_INT];
-#line 119
 
-#line 119
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 119
 
-#line 119
 	{
-#line 119
 		int *vp = fillp;	/* lower bound of area to be filled */
-#line 119
 		const int *const end = vp + nelems;
-#line 119
 		while(vp < end)
-#line 119
 		{
-#line 119
 			*vp++ = NC_FILL_INT;
-#line 119
 		}
-#line 119
 	}
-#line 119
 	return ncx_putn_int_int(xpp, nelems, fillp);
-#line 119
 }
-#line 119
 
 #elif SIZEOF_LONG == X_SIZEOF_INT
 static int
-#line 121
 NC_fill_int(
-#line 121
 	void **xpp,
-#line 121
 	size_t nelems)	/* how many */
-#line 121
 {
-#line 121
 	long fillp[NFILL * sizeof(double)/X_SIZEOF_INT];
-#line 121
 
-#line 121
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 121
 
-#line 121
 	{
-#line 121
 		long *vp = fillp;	/* lower bound of area to be filled */
-#line 121
 		const long *const end = vp + nelems;
-#line 121
 		while(vp < end)
-#line 121
 		{
-#line 121
 			*vp++ = NC_FILL_INT;
-#line 121
 		}
-#line 121
 	}
-#line 121
 	return ncx_putn_int_long(xpp, nelems, fillp);
-#line 121
 }
-#line 121
 
 #else
 #error "NC_fill_int implementation"
 #endif
 
 static int
-#line 126
 NC_fill_float(
-#line 126
 	void **xpp,
-#line 126
 	size_t nelems)	/* how many */
-#line 126
 {
-#line 126
 	float fillp[NFILL * sizeof(double)/X_SIZEOF_FLOAT];
-#line 126
 
-#line 126
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 126
 
-#line 126
 	{
-#line 126
 		float *vp = fillp;	/* lower bound of area to be filled */
-#line 126
 		const float *const end = vp + nelems;
-#line 126
 		while(vp < end)
-#line 126
 		{
-#line 126
 			*vp++ = NC_FILL_FLOAT;
-#line 126
 		}
-#line 126
 	}
-#line 126
 	return ncx_putn_float_float(xpp, nelems, fillp);
-#line 126
 }
-#line 126
 
 static int
-#line 127
 NC_fill_double(
-#line 127
 	void **xpp,
-#line 127
 	size_t nelems)	/* how many */
-#line 127
 {
-#line 127
 	double fillp[NFILL * sizeof(double)/X_SIZEOF_DOUBLE];
-#line 127
 
-#line 127
 	assert(nelems <= sizeof(fillp)/sizeof(fillp[0]));
-#line 127
 
-#line 127
 	{
-#line 127
 		double *vp = fillp;	/* lower bound of area to be filled */
-#line 127
 		const double *const end = vp + nelems;
-#line 127
 		while(vp < end)
-#line 127
 		{
-#line 127
 			*vp++ = NC_FILL_DOUBLE;
-#line 127
 		}
-#line 127
 	}
-#line 127
 	return ncx_putn_double_double(xpp, nelems, fillp);
-#line 127
 }
-#line 127
 
 
 
@@ -877,7755 +741,3933 @@ NC_varoffset(const NC3_INFO* ncp, const NC_var *varp, const size_t *coord)
 }
 
 
-#line 700
 
 static int
-#line 701
 putNCvx_char_char(NC3_INFO* ncp, const NC_var *varp,
-#line 701
 		 const size_t *start, size_t nelems, const char *value)
-#line 701
 {
-#line 701
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 701
 	size_t remaining = varp->xsz * nelems;
-#line 701
 	int status = NC_NOERR;
-#line 701
 	void *xp;
-#line 701
 
-#line 701
 	if(nelems == 0)
-#line 701
 		return NC_NOERR;
-#line 701
 
-#line 701
 	assert(value != NULL);
-#line 701
 
-#line 701
 	for(;;)
-#line 701
 	{
-#line 701
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 701
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 701
 
-#line 701
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 701
 				 RGN_WRITE, &xp);	
-#line 701
 		if(lstatus != NC_NOERR)
-#line 701
 			return lstatus;
-#line 701
 		
-#line 701
 		lstatus = ncx_putn_char_char(&xp, nput, value);
-#line 701
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 701
 		{
-#line 701
 			/* not fatal to the loop */
-#line 701
 			status = lstatus;
-#line 701
 		}
-#line 701
 
-#line 701
 		(void) ncio_rel(ncp->nciop, offset,
-#line 701
 				 RGN_MODIFIED);	
-#line 701
 
-#line 701
 		remaining -= extent;
-#line 701
 		if(remaining == 0)
-#line 701
 			break; /* normal loop exit */
-#line 701
 		offset += extent;
-#line 701
 		value += nput;
-#line 701
 
-#line 701
 	}
-#line 701
 
-#line 701
 	return status;
-#line 701
 }
-#line 701
 
 
 static int
-#line 703
 putNCvx_schar_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 703
 		 const size_t *start, size_t nelems, const schar *value)
-#line 703
 {
-#line 703
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 703
 	size_t remaining = varp->xsz * nelems;
-#line 703
 	int status = NC_NOERR;
-#line 703
 	void *xp;
-#line 703
 
-#line 703
 	if(nelems == 0)
-#line 703
 		return NC_NOERR;
-#line 703
 
-#line 703
 	assert(value != NULL);
-#line 703
 
-#line 703
 	for(;;)
-#line 703
 	{
-#line 703
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 703
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 703
 
-#line 703
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 703
 				 RGN_WRITE, &xp);	
-#line 703
 		if(lstatus != NC_NOERR)
-#line 703
 			return lstatus;
-#line 703
 		
-#line 703
 		lstatus = ncx_putn_schar_schar(&xp, nput, value);
-#line 703
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 703
 		{
-#line 703
 			/* not fatal to the loop */
-#line 703
 			status = lstatus;
-#line 703
 		}
-#line 703
 
-#line 703
 		(void) ncio_rel(ncp->nciop, offset,
-#line 703
 				 RGN_MODIFIED);	
-#line 703
 
-#line 703
 		remaining -= extent;
-#line 703
 		if(remaining == 0)
-#line 703
 			break; /* normal loop exit */
-#line 703
 		offset += extent;
-#line 703
 		value += nput;
-#line 703
 
-#line 703
 	}
-#line 703
 
-#line 703
 	return status;
-#line 703
 }
-#line 703
 
 static int
-#line 704
 putNCvx_schar_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 704
 		 const size_t *start, size_t nelems, const uchar *value)
-#line 704
 {
-#line 704
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 704
 	size_t remaining = varp->xsz * nelems;
-#line 704
 	int status = NC_NOERR;
-#line 704
 	void *xp;
-#line 704
 
-#line 704
 	if(nelems == 0)
-#line 704
 		return NC_NOERR;
-#line 704
 
-#line 704
 	assert(value != NULL);
-#line 704
 
-#line 704
 	for(;;)
-#line 704
 	{
-#line 704
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 704
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 704
 
-#line 704
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 704
 				 RGN_WRITE, &xp);	
-#line 704
 		if(lstatus != NC_NOERR)
-#line 704
 			return lstatus;
-#line 704
 		
-#line 704
 		lstatus = ncx_putn_schar_uchar(&xp, nput, value);
-#line 704
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 704
 		{
-#line 704
 			/* not fatal to the loop */
-#line 704
 			status = lstatus;
-#line 704
 		}
-#line 704
 
-#line 704
 		(void) ncio_rel(ncp->nciop, offset,
-#line 704
 				 RGN_MODIFIED);	
-#line 704
 
-#line 704
 		remaining -= extent;
-#line 704
 		if(remaining == 0)
-#line 704
 			break; /* normal loop exit */
-#line 704
 		offset += extent;
-#line 704
 		value += nput;
-#line 704
 
-#line 704
 	}
-#line 704
 
-#line 704
 	return status;
-#line 704
 }
-#line 704
 
 static int
-#line 705
 putNCvx_schar_short(NC3_INFO* ncp, const NC_var *varp,
-#line 705
 		 const size_t *start, size_t nelems, const short *value)
-#line 705
 {
-#line 705
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 705
 	size_t remaining = varp->xsz * nelems;
-#line 705
 	int status = NC_NOERR;
-#line 705
 	void *xp;
-#line 705
 
-#line 705
 	if(nelems == 0)
-#line 705
 		return NC_NOERR;
-#line 705
 
-#line 705
 	assert(value != NULL);
-#line 705
 
-#line 705
 	for(;;)
-#line 705
 	{
-#line 705
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 705
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 705
 
-#line 705
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 705
 				 RGN_WRITE, &xp);	
-#line 705
 		if(lstatus != NC_NOERR)
-#line 705
 			return lstatus;
-#line 705
 		
-#line 705
 		lstatus = ncx_putn_schar_short(&xp, nput, value);
-#line 705
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 705
 		{
-#line 705
 			/* not fatal to the loop */
-#line 705
 			status = lstatus;
-#line 705
 		}
-#line 705
 
-#line 705
 		(void) ncio_rel(ncp->nciop, offset,
-#line 705
 				 RGN_MODIFIED);	
-#line 705
 
-#line 705
 		remaining -= extent;
-#line 705
 		if(remaining == 0)
-#line 705
 			break; /* normal loop exit */
-#line 705
 		offset += extent;
-#line 705
 		value += nput;
-#line 705
 
-#line 705
 	}
-#line 705
 
-#line 705
 	return status;
-#line 705
 }
-#line 705
 
 static int
-#line 706
 putNCvx_schar_int(NC3_INFO* ncp, const NC_var *varp,
-#line 706
 		 const size_t *start, size_t nelems, const int *value)
-#line 706
 {
-#line 706
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 706
 	size_t remaining = varp->xsz * nelems;
-#line 706
 	int status = NC_NOERR;
-#line 706
 	void *xp;
-#line 706
 
-#line 706
 	if(nelems == 0)
-#line 706
 		return NC_NOERR;
-#line 706
 
-#line 706
 	assert(value != NULL);
-#line 706
 
-#line 706
 	for(;;)
-#line 706
 	{
-#line 706
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 706
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 706
 
-#line 706
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 706
 				 RGN_WRITE, &xp);	
-#line 706
 		if(lstatus != NC_NOERR)
-#line 706
 			return lstatus;
-#line 706
 		
-#line 706
 		lstatus = ncx_putn_schar_int(&xp, nput, value);
-#line 706
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 706
 		{
-#line 706
 			/* not fatal to the loop */
-#line 706
 			status = lstatus;
-#line 706
 		}
-#line 706
 
-#line 706
 		(void) ncio_rel(ncp->nciop, offset,
-#line 706
 				 RGN_MODIFIED);	
-#line 706
 
-#line 706
 		remaining -= extent;
-#line 706
 		if(remaining == 0)
-#line 706
 			break; /* normal loop exit */
-#line 706
 		offset += extent;
-#line 706
 		value += nput;
-#line 706
 
-#line 706
 	}
-#line 706
 
-#line 706
 	return status;
-#line 706
 }
-#line 706
 
 static int
-#line 707
 putNCvx_schar_float(NC3_INFO* ncp, const NC_var *varp,
-#line 707
 		 const size_t *start, size_t nelems, const float *value)
-#line 707
 {
-#line 707
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 707
 	size_t remaining = varp->xsz * nelems;
-#line 707
 	int status = NC_NOERR;
-#line 707
 	void *xp;
-#line 707
 
-#line 707
 	if(nelems == 0)
-#line 707
 		return NC_NOERR;
-#line 707
 
-#line 707
 	assert(value != NULL);
-#line 707
 
-#line 707
 	for(;;)
-#line 707
 	{
-#line 707
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 707
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 707
 
-#line 707
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 707
 				 RGN_WRITE, &xp);	
-#line 707
 		if(lstatus != NC_NOERR)
-#line 707
 			return lstatus;
-#line 707
 		
-#line 707
 		lstatus = ncx_putn_schar_float(&xp, nput, value);
-#line 707
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 707
 		{
-#line 707
 			/* not fatal to the loop */
-#line 707
 			status = lstatus;
-#line 707
 		}
-#line 707
 
-#line 707
 		(void) ncio_rel(ncp->nciop, offset,
-#line 707
 				 RGN_MODIFIED);	
-#line 707
 
-#line 707
 		remaining -= extent;
-#line 707
 		if(remaining == 0)
-#line 707
 			break; /* normal loop exit */
-#line 707
 		offset += extent;
-#line 707
 		value += nput;
-#line 707
 
-#line 707
 	}
-#line 707
 
-#line 707
 	return status;
-#line 707
 }
-#line 707
 
 static int
-#line 708
 putNCvx_schar_double(NC3_INFO* ncp, const NC_var *varp,
-#line 708
 		 const size_t *start, size_t nelems, const double *value)
-#line 708
 {
-#line 708
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 708
 	size_t remaining = varp->xsz * nelems;
-#line 708
 	int status = NC_NOERR;
-#line 708
 	void *xp;
-#line 708
 
-#line 708
 	if(nelems == 0)
-#line 708
 		return NC_NOERR;
-#line 708
 
-#line 708
 	assert(value != NULL);
-#line 708
 
-#line 708
 	for(;;)
-#line 708
 	{
-#line 708
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 708
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 708
 
-#line 708
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 708
 				 RGN_WRITE, &xp);	
-#line 708
 		if(lstatus != NC_NOERR)
-#line 708
 			return lstatus;
-#line 708
 		
-#line 708
 		lstatus = ncx_putn_schar_double(&xp, nput, value);
-#line 708
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 708
 		{
-#line 708
 			/* not fatal to the loop */
-#line 708
 			status = lstatus;
-#line 708
 		}
-#line 708
 
-#line 708
 		(void) ncio_rel(ncp->nciop, offset,
-#line 708
 				 RGN_MODIFIED);	
-#line 708
 
-#line 708
 		remaining -= extent;
-#line 708
 		if(remaining == 0)
-#line 708
 			break; /* normal loop exit */
-#line 708
 		offset += extent;
-#line 708
 		value += nput;
-#line 708
 
-#line 708
 	}
-#line 708
 
-#line 708
 	return status;
-#line 708
 }
-#line 708
 
 static int
-#line 709
 putNCvx_schar_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 709
 		 const size_t *start, size_t nelems, const longlong *value)
-#line 709
 {
-#line 709
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 709
 	size_t remaining = varp->xsz * nelems;
-#line 709
 	int status = NC_NOERR;
-#line 709
 	void *xp;
-#line 709
 
-#line 709
 	if(nelems == 0)
-#line 709
 		return NC_NOERR;
-#line 709
 
-#line 709
 	assert(value != NULL);
-#line 709
 
-#line 709
 	for(;;)
-#line 709
 	{
-#line 709
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 709
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 709
 
-#line 709
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 709
 				 RGN_WRITE, &xp);	
-#line 709
 		if(lstatus != NC_NOERR)
-#line 709
 			return lstatus;
-#line 709
 		
-#line 709
 		lstatus = ncx_putn_schar_longlong(&xp, nput, value);
-#line 709
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 709
 		{
-#line 709
 			/* not fatal to the loop */
-#line 709
 			status = lstatus;
-#line 709
 		}
-#line 709
 
-#line 709
 		(void) ncio_rel(ncp->nciop, offset,
-#line 709
 				 RGN_MODIFIED);	
-#line 709
 
-#line 709
 		remaining -= extent;
-#line 709
 		if(remaining == 0)
-#line 709
 			break; /* normal loop exit */
-#line 709
 		offset += extent;
-#line 709
 		value += nput;
-#line 709
 
-#line 709
 	}
-#line 709
 
-#line 709
 	return status;
-#line 709
 }
-#line 709
 
 
 static int
-#line 711
 putNCvx_short_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 711
 		 const size_t *start, size_t nelems, const schar *value)
-#line 711
 {
-#line 711
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 711
 	size_t remaining = varp->xsz * nelems;
-#line 711
 	int status = NC_NOERR;
-#line 711
 	void *xp;
-#line 711
 
-#line 711
 	if(nelems == 0)
-#line 711
 		return NC_NOERR;
-#line 711
 
-#line 711
 	assert(value != NULL);
-#line 711
 
-#line 711
 	for(;;)
-#line 711
 	{
-#line 711
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 711
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 711
 
-#line 711
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 711
 				 RGN_WRITE, &xp);	
-#line 711
 		if(lstatus != NC_NOERR)
-#line 711
 			return lstatus;
-#line 711
 		
-#line 711
 		lstatus = ncx_putn_short_schar(&xp, nput, value);
-#line 711
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 711
 		{
-#line 711
 			/* not fatal to the loop */
-#line 711
 			status = lstatus;
-#line 711
 		}
-#line 711
 
-#line 711
 		(void) ncio_rel(ncp->nciop, offset,
-#line 711
 				 RGN_MODIFIED);	
-#line 711
 
-#line 711
 		remaining -= extent;
-#line 711
 		if(remaining == 0)
-#line 711
 			break; /* normal loop exit */
-#line 711
 		offset += extent;
-#line 711
 		value += nput;
-#line 711
 
-#line 711
 	}
-#line 711
 
-#line 711
 	return status;
-#line 711
 }
-#line 711
 
 static int
-#line 712
 putNCvx_short_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 712
 		 const size_t *start, size_t nelems, const uchar *value)
-#line 712
 {
-#line 712
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 712
 	size_t remaining = varp->xsz * nelems;
-#line 712
 	int status = NC_NOERR;
-#line 712
 	void *xp;
-#line 712
 
-#line 712
 	if(nelems == 0)
-#line 712
 		return NC_NOERR;
-#line 712
 
-#line 712
 	assert(value != NULL);
-#line 712
 
-#line 712
 	for(;;)
-#line 712
 	{
-#line 712
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 712
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 712
 
-#line 712
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 712
 				 RGN_WRITE, &xp);	
-#line 712
 		if(lstatus != NC_NOERR)
-#line 712
 			return lstatus;
-#line 712
 		
-#line 712
 		lstatus = ncx_putn_short_uchar(&xp, nput, value);
-#line 712
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 712
 		{
-#line 712
 			/* not fatal to the loop */
-#line 712
 			status = lstatus;
-#line 712
 		}
-#line 712
 
-#line 712
 		(void) ncio_rel(ncp->nciop, offset,
-#line 712
 				 RGN_MODIFIED);	
-#line 712
 
-#line 712
 		remaining -= extent;
-#line 712
 		if(remaining == 0)
-#line 712
 			break; /* normal loop exit */
-#line 712
 		offset += extent;
-#line 712
 		value += nput;
-#line 712
 
-#line 712
 	}
-#line 712
 
-#line 712
 	return status;
-#line 712
 }
-#line 712
 
 static int
-#line 713
 putNCvx_short_short(NC3_INFO* ncp, const NC_var *varp,
-#line 713
 		 const size_t *start, size_t nelems, const short *value)
-#line 713
 {
-#line 713
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 713
 	size_t remaining = varp->xsz * nelems;
-#line 713
 	int status = NC_NOERR;
-#line 713
 	void *xp;
-#line 713
 
-#line 713
 	if(nelems == 0)
-#line 713
 		return NC_NOERR;
-#line 713
 
-#line 713
 	assert(value != NULL);
-#line 713
 
-#line 713
 	for(;;)
-#line 713
 	{
-#line 713
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 713
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 713
 
-#line 713
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 713
 				 RGN_WRITE, &xp);	
-#line 713
 		if(lstatus != NC_NOERR)
-#line 713
 			return lstatus;
-#line 713
 		
-#line 713
 		lstatus = ncx_putn_short_short(&xp, nput, value);
-#line 713
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 713
 		{
-#line 713
 			/* not fatal to the loop */
-#line 713
 			status = lstatus;
-#line 713
 		}
-#line 713
 
-#line 713
 		(void) ncio_rel(ncp->nciop, offset,
-#line 713
 				 RGN_MODIFIED);	
-#line 713
 
-#line 713
 		remaining -= extent;
-#line 713
 		if(remaining == 0)
-#line 713
 			break; /* normal loop exit */
-#line 713
 		offset += extent;
-#line 713
 		value += nput;
-#line 713
 
-#line 713
 	}
-#line 713
 
-#line 713
 	return status;
-#line 713
 }
-#line 713
 
 static int
-#line 714
 putNCvx_short_int(NC3_INFO* ncp, const NC_var *varp,
-#line 714
 		 const size_t *start, size_t nelems, const int *value)
-#line 714
 {
-#line 714
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 714
 	size_t remaining = varp->xsz * nelems;
-#line 714
 	int status = NC_NOERR;
-#line 714
 	void *xp;
-#line 714
 
-#line 714
 	if(nelems == 0)
-#line 714
 		return NC_NOERR;
-#line 714
 
-#line 714
 	assert(value != NULL);
-#line 714
 
-#line 714
 	for(;;)
-#line 714
 	{
-#line 714
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 714
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 714
 
-#line 714
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 714
 				 RGN_WRITE, &xp);	
-#line 714
 		if(lstatus != NC_NOERR)
-#line 714
 			return lstatus;
-#line 714
 		
-#line 714
 		lstatus = ncx_putn_short_int(&xp, nput, value);
-#line 714
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 714
 		{
-#line 714
 			/* not fatal to the loop */
-#line 714
 			status = lstatus;
-#line 714
 		}
-#line 714
 
-#line 714
 		(void) ncio_rel(ncp->nciop, offset,
-#line 714
 				 RGN_MODIFIED);	
-#line 714
 
-#line 714
 		remaining -= extent;
-#line 714
 		if(remaining == 0)
-#line 714
 			break; /* normal loop exit */
-#line 714
 		offset += extent;
-#line 714
 		value += nput;
-#line 714
 
-#line 714
 	}
-#line 714
 
-#line 714
 	return status;
-#line 714
 }
-#line 714
 
 static int
-#line 715
 putNCvx_short_float(NC3_INFO* ncp, const NC_var *varp,
-#line 715
 		 const size_t *start, size_t nelems, const float *value)
-#line 715
 {
-#line 715
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 715
 	size_t remaining = varp->xsz * nelems;
-#line 715
 	int status = NC_NOERR;
-#line 715
 	void *xp;
-#line 715
 
-#line 715
 	if(nelems == 0)
-#line 715
 		return NC_NOERR;
-#line 715
 
-#line 715
 	assert(value != NULL);
-#line 715
 
-#line 715
 	for(;;)
-#line 715
 	{
-#line 715
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 715
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 715
 
-#line 715
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 715
 				 RGN_WRITE, &xp);	
-#line 715
 		if(lstatus != NC_NOERR)
-#line 715
 			return lstatus;
-#line 715
 		
-#line 715
 		lstatus = ncx_putn_short_float(&xp, nput, value);
-#line 715
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 715
 		{
-#line 715
 			/* not fatal to the loop */
-#line 715
 			status = lstatus;
-#line 715
 		}
-#line 715
 
-#line 715
 		(void) ncio_rel(ncp->nciop, offset,
-#line 715
 				 RGN_MODIFIED);	
-#line 715
 
-#line 715
 		remaining -= extent;
-#line 715
 		if(remaining == 0)
-#line 715
 			break; /* normal loop exit */
-#line 715
 		offset += extent;
-#line 715
 		value += nput;
-#line 715
 
-#line 715
 	}
-#line 715
 
-#line 715
 	return status;
-#line 715
 }
-#line 715
 
 static int
-#line 716
 putNCvx_short_double(NC3_INFO* ncp, const NC_var *varp,
-#line 716
 		 const size_t *start, size_t nelems, const double *value)
-#line 716
 {
-#line 716
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 716
 	size_t remaining = varp->xsz * nelems;
-#line 716
 	int status = NC_NOERR;
-#line 716
 	void *xp;
-#line 716
 
-#line 716
 	if(nelems == 0)
-#line 716
 		return NC_NOERR;
-#line 716
 
-#line 716
 	assert(value != NULL);
-#line 716
 
-#line 716
 	for(;;)
-#line 716
 	{
-#line 716
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 716
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 716
 
-#line 716
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 716
 				 RGN_WRITE, &xp);	
-#line 716
 		if(lstatus != NC_NOERR)
-#line 716
 			return lstatus;
-#line 716
 		
-#line 716
 		lstatus = ncx_putn_short_double(&xp, nput, value);
-#line 716
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 716
 		{
-#line 716
 			/* not fatal to the loop */
-#line 716
 			status = lstatus;
-#line 716
 		}
-#line 716
 
-#line 716
 		(void) ncio_rel(ncp->nciop, offset,
-#line 716
 				 RGN_MODIFIED);	
-#line 716
 
-#line 716
 		remaining -= extent;
-#line 716
 		if(remaining == 0)
-#line 716
 			break; /* normal loop exit */
-#line 716
 		offset += extent;
-#line 716
 		value += nput;
-#line 716
 
-#line 716
 	}
-#line 716
 
-#line 716
 	return status;
-#line 716
 }
-#line 716
 
 static int
-#line 717
 putNCvx_short_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 717
 		 const size_t *start, size_t nelems, const longlong *value)
-#line 717
 {
-#line 717
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 717
 	size_t remaining = varp->xsz * nelems;
-#line 717
 	int status = NC_NOERR;
-#line 717
 	void *xp;
-#line 717
 
-#line 717
 	if(nelems == 0)
-#line 717
 		return NC_NOERR;
-#line 717
 
-#line 717
 	assert(value != NULL);
-#line 717
 
-#line 717
 	for(;;)
-#line 717
 	{
-#line 717
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 717
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 717
 
-#line 717
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 717
 				 RGN_WRITE, &xp);	
-#line 717
 		if(lstatus != NC_NOERR)
-#line 717
 			return lstatus;
-#line 717
 		
-#line 717
 		lstatus = ncx_putn_short_longlong(&xp, nput, value);
-#line 717
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 717
 		{
-#line 717
 			/* not fatal to the loop */
-#line 717
 			status = lstatus;
-#line 717
 		}
-#line 717
 
-#line 717
 		(void) ncio_rel(ncp->nciop, offset,
-#line 717
 				 RGN_MODIFIED);	
-#line 717
 
-#line 717
 		remaining -= extent;
-#line 717
 		if(remaining == 0)
-#line 717
 			break; /* normal loop exit */
-#line 717
 		offset += extent;
-#line 717
 		value += nput;
-#line 717
 
-#line 717
 	}
-#line 717
 
-#line 717
 	return status;
-#line 717
 }
-#line 717
 
 
 static int
-#line 719
 putNCvx_int_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 719
 		 const size_t *start, size_t nelems, const schar *value)
-#line 719
 {
-#line 719
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 719
 	size_t remaining = varp->xsz * nelems;
-#line 719
 	int status = NC_NOERR;
-#line 719
 	void *xp;
-#line 719
 
-#line 719
 	if(nelems == 0)
-#line 719
 		return NC_NOERR;
-#line 719
 
-#line 719
 	assert(value != NULL);
-#line 719
 
-#line 719
 	for(;;)
-#line 719
 	{
-#line 719
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 719
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 719
 
-#line 719
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 719
 				 RGN_WRITE, &xp);	
-#line 719
 		if(lstatus != NC_NOERR)
-#line 719
 			return lstatus;
-#line 719
 		
-#line 719
 		lstatus = ncx_putn_int_schar(&xp, nput, value);
-#line 719
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 719
 		{
-#line 719
 			/* not fatal to the loop */
-#line 719
 			status = lstatus;
-#line 719
 		}
-#line 719
 
-#line 719
 		(void) ncio_rel(ncp->nciop, offset,
-#line 719
 				 RGN_MODIFIED);	
-#line 719
 
-#line 719
 		remaining -= extent;
-#line 719
 		if(remaining == 0)
-#line 719
 			break; /* normal loop exit */
-#line 719
 		offset += extent;
-#line 719
 		value += nput;
-#line 719
 
-#line 719
 	}
-#line 719
 
-#line 719
 	return status;
-#line 719
 }
-#line 719
 
 static int
-#line 720
 putNCvx_int_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 720
 		 const size_t *start, size_t nelems, const uchar *value)
-#line 720
 {
-#line 720
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 720
 	size_t remaining = varp->xsz * nelems;
-#line 720
 	int status = NC_NOERR;
-#line 720
 	void *xp;
-#line 720
 
-#line 720
 	if(nelems == 0)
-#line 720
 		return NC_NOERR;
-#line 720
 
-#line 720
 	assert(value != NULL);
-#line 720
 
-#line 720
 	for(;;)
-#line 720
 	{
-#line 720
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 720
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 720
 
-#line 720
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 720
 				 RGN_WRITE, &xp);	
-#line 720
 		if(lstatus != NC_NOERR)
-#line 720
 			return lstatus;
-#line 720
 		
-#line 720
 		lstatus = ncx_putn_int_uchar(&xp, nput, value);
-#line 720
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 720
 		{
-#line 720
 			/* not fatal to the loop */
-#line 720
 			status = lstatus;
-#line 720
 		}
-#line 720
 
-#line 720
 		(void) ncio_rel(ncp->nciop, offset,
-#line 720
 				 RGN_MODIFIED);	
-#line 720
 
-#line 720
 		remaining -= extent;
-#line 720
 		if(remaining == 0)
-#line 720
 			break; /* normal loop exit */
-#line 720
 		offset += extent;
-#line 720
 		value += nput;
-#line 720
 
-#line 720
 	}
-#line 720
 
-#line 720
 	return status;
-#line 720
 }
-#line 720
 
 static int
-#line 721
 putNCvx_int_short(NC3_INFO* ncp, const NC_var *varp,
-#line 721
 		 const size_t *start, size_t nelems, const short *value)
-#line 721
 {
-#line 721
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 721
 	size_t remaining = varp->xsz * nelems;
-#line 721
 	int status = NC_NOERR;
-#line 721
 	void *xp;
-#line 721
 
-#line 721
 	if(nelems == 0)
-#line 721
 		return NC_NOERR;
-#line 721
 
-#line 721
 	assert(value != NULL);
-#line 721
 
-#line 721
 	for(;;)
-#line 721
 	{
-#line 721
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 721
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 721
 
-#line 721
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 721
 				 RGN_WRITE, &xp);	
-#line 721
 		if(lstatus != NC_NOERR)
-#line 721
 			return lstatus;
-#line 721
 		
-#line 721
 		lstatus = ncx_putn_int_short(&xp, nput, value);
-#line 721
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 721
 		{
-#line 721
 			/* not fatal to the loop */
-#line 721
 			status = lstatus;
-#line 721
 		}
-#line 721
 
-#line 721
 		(void) ncio_rel(ncp->nciop, offset,
-#line 721
 				 RGN_MODIFIED);	
-#line 721
 
-#line 721
 		remaining -= extent;
-#line 721
 		if(remaining == 0)
-#line 721
 			break; /* normal loop exit */
-#line 721
 		offset += extent;
-#line 721
 		value += nput;
-#line 721
 
-#line 721
 	}
-#line 721
 
-#line 721
 	return status;
-#line 721
 }
-#line 721
 
 static int
-#line 722
 putNCvx_int_int(NC3_INFO* ncp, const NC_var *varp,
-#line 722
 		 const size_t *start, size_t nelems, const int *value)
-#line 722
 {
-#line 722
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 722
 	size_t remaining = varp->xsz * nelems;
-#line 722
 	int status = NC_NOERR;
-#line 722
 	void *xp;
-#line 722
 
-#line 722
 	if(nelems == 0)
-#line 722
 		return NC_NOERR;
-#line 722
 
-#line 722
 	assert(value != NULL);
-#line 722
 
-#line 722
 	for(;;)
-#line 722
 	{
-#line 722
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 722
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 722
 
-#line 722
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 722
 				 RGN_WRITE, &xp);	
-#line 722
 		if(lstatus != NC_NOERR)
-#line 722
 			return lstatus;
-#line 722
 		
-#line 722
 		lstatus = ncx_putn_int_int(&xp, nput, value);
-#line 722
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 722
 		{
-#line 722
 			/* not fatal to the loop */
-#line 722
 			status = lstatus;
-#line 722
 		}
-#line 722
 
-#line 722
 		(void) ncio_rel(ncp->nciop, offset,
-#line 722
 				 RGN_MODIFIED);	
-#line 722
 
-#line 722
 		remaining -= extent;
-#line 722
 		if(remaining == 0)
-#line 722
 			break; /* normal loop exit */
-#line 722
 		offset += extent;
-#line 722
 		value += nput;
-#line 722
 
-#line 722
 	}
-#line 722
 
-#line 722
 	return status;
-#line 722
 }
-#line 722
 
 static int
-#line 723
 putNCvx_int_float(NC3_INFO* ncp, const NC_var *varp,
-#line 723
 		 const size_t *start, size_t nelems, const float *value)
-#line 723
 {
-#line 723
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 723
 	size_t remaining = varp->xsz * nelems;
-#line 723
 	int status = NC_NOERR;
-#line 723
 	void *xp;
-#line 723
 
-#line 723
 	if(nelems == 0)
-#line 723
 		return NC_NOERR;
-#line 723
 
-#line 723
 	assert(value != NULL);
-#line 723
 
-#line 723
 	for(;;)
-#line 723
 	{
-#line 723
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 723
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 723
 
-#line 723
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 723
 				 RGN_WRITE, &xp);	
-#line 723
 		if(lstatus != NC_NOERR)
-#line 723
 			return lstatus;
-#line 723
 		
-#line 723
 		lstatus = ncx_putn_int_float(&xp, nput, value);
-#line 723
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 723
 		{
-#line 723
 			/* not fatal to the loop */
-#line 723
 			status = lstatus;
-#line 723
 		}
-#line 723
 
-#line 723
 		(void) ncio_rel(ncp->nciop, offset,
-#line 723
 				 RGN_MODIFIED);	
-#line 723
 
-#line 723
 		remaining -= extent;
-#line 723
 		if(remaining == 0)
-#line 723
 			break; /* normal loop exit */
-#line 723
 		offset += extent;
-#line 723
 		value += nput;
-#line 723
 
-#line 723
 	}
-#line 723
 
-#line 723
 	return status;
-#line 723
 }
-#line 723
 
 static int
-#line 724
 putNCvx_int_double(NC3_INFO* ncp, const NC_var *varp,
-#line 724
 		 const size_t *start, size_t nelems, const double *value)
-#line 724
 {
-#line 724
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 724
 	size_t remaining = varp->xsz * nelems;
-#line 724
 	int status = NC_NOERR;
-#line 724
 	void *xp;
-#line 724
 
-#line 724
 	if(nelems == 0)
-#line 724
 		return NC_NOERR;
-#line 724
 
-#line 724
 	assert(value != NULL);
-#line 724
 
-#line 724
 	for(;;)
-#line 724
 	{
-#line 724
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 724
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 724
 
-#line 724
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 724
 				 RGN_WRITE, &xp);	
-#line 724
 		if(lstatus != NC_NOERR)
-#line 724
 			return lstatus;
-#line 724
 		
-#line 724
 		lstatus = ncx_putn_int_double(&xp, nput, value);
-#line 724
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 724
 		{
-#line 724
 			/* not fatal to the loop */
-#line 724
 			status = lstatus;
-#line 724
 		}
-#line 724
 
-#line 724
 		(void) ncio_rel(ncp->nciop, offset,
-#line 724
 				 RGN_MODIFIED);	
-#line 724
 
-#line 724
 		remaining -= extent;
-#line 724
 		if(remaining == 0)
-#line 724
 			break; /* normal loop exit */
-#line 724
 		offset += extent;
-#line 724
 		value += nput;
-#line 724
 
-#line 724
 	}
-#line 724
 
-#line 724
 	return status;
-#line 724
 }
-#line 724
 
 static int
-#line 725
 putNCvx_int_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 725
 		 const size_t *start, size_t nelems, const longlong *value)
-#line 725
 {
-#line 725
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 725
 	size_t remaining = varp->xsz * nelems;
-#line 725
 	int status = NC_NOERR;
-#line 725
 	void *xp;
-#line 725
 
-#line 725
 	if(nelems == 0)
-#line 725
 		return NC_NOERR;
-#line 725
 
-#line 725
 	assert(value != NULL);
-#line 725
 
-#line 725
 	for(;;)
-#line 725
 	{
-#line 725
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 725
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 725
 
-#line 725
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 725
 				 RGN_WRITE, &xp);	
-#line 725
 		if(lstatus != NC_NOERR)
-#line 725
 			return lstatus;
-#line 725
 		
-#line 725
 		lstatus = ncx_putn_int_longlong(&xp, nput, value);
-#line 725
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 725
 		{
-#line 725
 			/* not fatal to the loop */
-#line 725
 			status = lstatus;
-#line 725
 		}
-#line 725
 
-#line 725
 		(void) ncio_rel(ncp->nciop, offset,
-#line 725
 				 RGN_MODIFIED);	
-#line 725
 
-#line 725
 		remaining -= extent;
-#line 725
 		if(remaining == 0)
-#line 725
 			break; /* normal loop exit */
-#line 725
 		offset += extent;
-#line 725
 		value += nput;
-#line 725
 
-#line 725
 	}
-#line 725
 
-#line 725
 	return status;
-#line 725
 }
-#line 725
 
 
 static int
-#line 727
 putNCvx_float_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 727
 		 const size_t *start, size_t nelems, const schar *value)
-#line 727
 {
-#line 727
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 727
 	size_t remaining = varp->xsz * nelems;
-#line 727
 	int status = NC_NOERR;
-#line 727
 	void *xp;
-#line 727
 
-#line 727
 	if(nelems == 0)
-#line 727
 		return NC_NOERR;
-#line 727
 
-#line 727
 	assert(value != NULL);
-#line 727
 
-#line 727
 	for(;;)
-#line 727
 	{
-#line 727
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 727
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 727
 
-#line 727
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 727
 				 RGN_WRITE, &xp);	
-#line 727
 		if(lstatus != NC_NOERR)
-#line 727
 			return lstatus;
-#line 727
 		
-#line 727
 		lstatus = ncx_putn_float_schar(&xp, nput, value);
-#line 727
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 727
 		{
-#line 727
 			/* not fatal to the loop */
-#line 727
 			status = lstatus;
-#line 727
 		}
-#line 727
 
-#line 727
 		(void) ncio_rel(ncp->nciop, offset,
-#line 727
 				 RGN_MODIFIED);	
-#line 727
 
-#line 727
 		remaining -= extent;
-#line 727
 		if(remaining == 0)
-#line 727
 			break; /* normal loop exit */
-#line 727
 		offset += extent;
-#line 727
 		value += nput;
-#line 727
 
-#line 727
 	}
-#line 727
 
-#line 727
 	return status;
-#line 727
 }
-#line 727
 
 static int
-#line 728
 putNCvx_float_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 728
 		 const size_t *start, size_t nelems, const uchar *value)
-#line 728
 {
-#line 728
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 728
 	size_t remaining = varp->xsz * nelems;
-#line 728
 	int status = NC_NOERR;
-#line 728
 	void *xp;
-#line 728
 
-#line 728
 	if(nelems == 0)
-#line 728
 		return NC_NOERR;
-#line 728
 
-#line 728
 	assert(value != NULL);
-#line 728
 
-#line 728
 	for(;;)
-#line 728
 	{
-#line 728
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 728
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 728
 
-#line 728
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 728
 				 RGN_WRITE, &xp);	
-#line 728
 		if(lstatus != NC_NOERR)
-#line 728
 			return lstatus;
-#line 728
 		
-#line 728
 		lstatus = ncx_putn_float_uchar(&xp, nput, value);
-#line 728
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 728
 		{
-#line 728
 			/* not fatal to the loop */
-#line 728
 			status = lstatus;
-#line 728
 		}
-#line 728
 
-#line 728
 		(void) ncio_rel(ncp->nciop, offset,
-#line 728
 				 RGN_MODIFIED);	
-#line 728
 
-#line 728
 		remaining -= extent;
-#line 728
 		if(remaining == 0)
-#line 728
 			break; /* normal loop exit */
-#line 728
 		offset += extent;
-#line 728
 		value += nput;
-#line 728
 
-#line 728
 	}
-#line 728
 
-#line 728
 	return status;
-#line 728
 }
-#line 728
 
 static int
-#line 729
 putNCvx_float_short(NC3_INFO* ncp, const NC_var *varp,
-#line 729
 		 const size_t *start, size_t nelems, const short *value)
-#line 729
 {
-#line 729
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 729
 	size_t remaining = varp->xsz * nelems;
-#line 729
 	int status = NC_NOERR;
-#line 729
 	void *xp;
-#line 729
 
-#line 729
 	if(nelems == 0)
-#line 729
 		return NC_NOERR;
-#line 729
 
-#line 729
 	assert(value != NULL);
-#line 729
 
-#line 729
 	for(;;)
-#line 729
 	{
-#line 729
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 729
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 729
 
-#line 729
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 729
 				 RGN_WRITE, &xp);	
-#line 729
 		if(lstatus != NC_NOERR)
-#line 729
 			return lstatus;
-#line 729
 		
-#line 729
 		lstatus = ncx_putn_float_short(&xp, nput, value);
-#line 729
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 729
 		{
-#line 729
 			/* not fatal to the loop */
-#line 729
 			status = lstatus;
-#line 729
 		}
-#line 729
 
-#line 729
 		(void) ncio_rel(ncp->nciop, offset,
-#line 729
 				 RGN_MODIFIED);	
-#line 729
 
-#line 729
 		remaining -= extent;
-#line 729
 		if(remaining == 0)
-#line 729
 			break; /* normal loop exit */
-#line 729
 		offset += extent;
-#line 729
 		value += nput;
-#line 729
 
-#line 729
 	}
-#line 729
 
-#line 729
 	return status;
-#line 729
 }
-#line 729
 
 static int
-#line 730
 putNCvx_float_int(NC3_INFO* ncp, const NC_var *varp,
-#line 730
 		 const size_t *start, size_t nelems, const int *value)
-#line 730
 {
-#line 730
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 730
 	size_t remaining = varp->xsz * nelems;
-#line 730
 	int status = NC_NOERR;
-#line 730
 	void *xp;
-#line 730
 
-#line 730
 	if(nelems == 0)
-#line 730
 		return NC_NOERR;
-#line 730
 
-#line 730
 	assert(value != NULL);
-#line 730
 
-#line 730
 	for(;;)
-#line 730
 	{
-#line 730
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 730
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 730
 
-#line 730
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 730
 				 RGN_WRITE, &xp);	
-#line 730
 		if(lstatus != NC_NOERR)
-#line 730
 			return lstatus;
-#line 730
 		
-#line 730
 		lstatus = ncx_putn_float_int(&xp, nput, value);
-#line 730
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 730
 		{
-#line 730
 			/* not fatal to the loop */
-#line 730
 			status = lstatus;
-#line 730
 		}
-#line 730
 
-#line 730
 		(void) ncio_rel(ncp->nciop, offset,
-#line 730
 				 RGN_MODIFIED);	
-#line 730
 
-#line 730
 		remaining -= extent;
-#line 730
 		if(remaining == 0)
-#line 730
 			break; /* normal loop exit */
-#line 730
 		offset += extent;
-#line 730
 		value += nput;
-#line 730
 
-#line 730
 	}
-#line 730
 
-#line 730
 	return status;
-#line 730
 }
-#line 730
 
 static int
-#line 731
 putNCvx_float_float(NC3_INFO* ncp, const NC_var *varp,
-#line 731
 		 const size_t *start, size_t nelems, const float *value)
-#line 731
 {
-#line 731
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 731
 	size_t remaining = varp->xsz * nelems;
-#line 731
 	int status = NC_NOERR;
-#line 731
 	void *xp;
-#line 731
 
-#line 731
 	if(nelems == 0)
-#line 731
 		return NC_NOERR;
-#line 731
 
-#line 731
 	assert(value != NULL);
-#line 731
 
-#line 731
 	for(;;)
-#line 731
 	{
-#line 731
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 731
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 731
 
-#line 731
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 731
 				 RGN_WRITE, &xp);	
-#line 731
 		if(lstatus != NC_NOERR)
-#line 731
 			return lstatus;
-#line 731
 		
-#line 731
 		lstatus = ncx_putn_float_float(&xp, nput, value);
-#line 731
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 731
 		{
-#line 731
 			/* not fatal to the loop */
-#line 731
 			status = lstatus;
-#line 731
 		}
-#line 731
 
-#line 731
 		(void) ncio_rel(ncp->nciop, offset,
-#line 731
 				 RGN_MODIFIED);	
-#line 731
 
-#line 731
 		remaining -= extent;
-#line 731
 		if(remaining == 0)
-#line 731
 			break; /* normal loop exit */
-#line 731
 		offset += extent;
-#line 731
 		value += nput;
-#line 731
 
-#line 731
 	}
-#line 731
 
-#line 731
 	return status;
-#line 731
 }
-#line 731
 
 static int
-#line 732
 putNCvx_float_double(NC3_INFO* ncp, const NC_var *varp,
-#line 732
 		 const size_t *start, size_t nelems, const double *value)
-#line 732
 {
-#line 732
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 732
 	size_t remaining = varp->xsz * nelems;
-#line 732
 	int status = NC_NOERR;
-#line 732
 	void *xp;
-#line 732
 
-#line 732
 	if(nelems == 0)
-#line 732
 		return NC_NOERR;
-#line 732
 
-#line 732
 	assert(value != NULL);
-#line 732
 
-#line 732
 	for(;;)
-#line 732
 	{
-#line 732
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 732
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 732
 
-#line 732
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 732
 				 RGN_WRITE, &xp);	
-#line 732
 		if(lstatus != NC_NOERR)
-#line 732
 			return lstatus;
-#line 732
 		
-#line 732
 		lstatus = ncx_putn_float_double(&xp, nput, value);
-#line 732
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 732
 		{
-#line 732
 			/* not fatal to the loop */
-#line 732
 			status = lstatus;
-#line 732
 		}
-#line 732
 
-#line 732
 		(void) ncio_rel(ncp->nciop, offset,
-#line 732
 				 RGN_MODIFIED);	
-#line 732
 
-#line 732
 		remaining -= extent;
-#line 732
 		if(remaining == 0)
-#line 732
 			break; /* normal loop exit */
-#line 732
 		offset += extent;
-#line 732
 		value += nput;
-#line 732
 
-#line 732
 	}
-#line 732
 
-#line 732
 	return status;
-#line 732
 }
-#line 732
 
 static int
-#line 733
 putNCvx_float_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 733
 		 const size_t *start, size_t nelems, const longlong *value)
-#line 733
 {
-#line 733
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 733
 	size_t remaining = varp->xsz * nelems;
-#line 733
 	int status = NC_NOERR;
-#line 733
 	void *xp;
-#line 733
 
-#line 733
 	if(nelems == 0)
-#line 733
 		return NC_NOERR;
-#line 733
 
-#line 733
 	assert(value != NULL);
-#line 733
 
-#line 733
 	for(;;)
-#line 733
 	{
-#line 733
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 733
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 733
 
-#line 733
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 733
 				 RGN_WRITE, &xp);	
-#line 733
 		if(lstatus != NC_NOERR)
-#line 733
 			return lstatus;
-#line 733
 		
-#line 733
 		lstatus = ncx_putn_float_longlong(&xp, nput, value);
-#line 733
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 733
 		{
-#line 733
 			/* not fatal to the loop */
-#line 733
 			status = lstatus;
-#line 733
 		}
-#line 733
 
-#line 733
 		(void) ncio_rel(ncp->nciop, offset,
-#line 733
 				 RGN_MODIFIED);	
-#line 733
 
-#line 733
 		remaining -= extent;
-#line 733
 		if(remaining == 0)
-#line 733
 			break; /* normal loop exit */
-#line 733
 		offset += extent;
-#line 733
 		value += nput;
-#line 733
 
-#line 733
 	}
-#line 733
 
-#line 733
 	return status;
-#line 733
 }
-#line 733
 
 
 static int
-#line 735
 putNCvx_double_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 735
 		 const size_t *start, size_t nelems, const schar *value)
-#line 735
 {
-#line 735
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 735
 	size_t remaining = varp->xsz * nelems;
-#line 735
 	int status = NC_NOERR;
-#line 735
 	void *xp;
-#line 735
 
-#line 735
 	if(nelems == 0)
-#line 735
 		return NC_NOERR;
-#line 735
 
-#line 735
 	assert(value != NULL);
-#line 735
 
-#line 735
 	for(;;)
-#line 735
 	{
-#line 735
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 735
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 735
 
-#line 735
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 735
 				 RGN_WRITE, &xp);	
-#line 735
 		if(lstatus != NC_NOERR)
-#line 735
 			return lstatus;
-#line 735
 		
-#line 735
 		lstatus = ncx_putn_double_schar(&xp, nput, value);
-#line 735
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 735
 		{
-#line 735
 			/* not fatal to the loop */
-#line 735
 			status = lstatus;
-#line 735
 		}
-#line 735
 
-#line 735
 		(void) ncio_rel(ncp->nciop, offset,
-#line 735
 				 RGN_MODIFIED);	
-#line 735
 
-#line 735
 		remaining -= extent;
-#line 735
 		if(remaining == 0)
-#line 735
 			break; /* normal loop exit */
-#line 735
 		offset += extent;
-#line 735
 		value += nput;
-#line 735
 
-#line 735
 	}
-#line 735
 
-#line 735
 	return status;
-#line 735
 }
-#line 735
 
 static int
-#line 736
 putNCvx_double_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 736
 		 const size_t *start, size_t nelems, const uchar *value)
-#line 736
 {
-#line 736
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 736
 	size_t remaining = varp->xsz * nelems;
-#line 736
 	int status = NC_NOERR;
-#line 736
 	void *xp;
-#line 736
 
-#line 736
 	if(nelems == 0)
-#line 736
 		return NC_NOERR;
-#line 736
 
-#line 736
 	assert(value != NULL);
-#line 736
 
-#line 736
 	for(;;)
-#line 736
 	{
-#line 736
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 736
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 736
 
-#line 736
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 736
 				 RGN_WRITE, &xp);	
-#line 736
 		if(lstatus != NC_NOERR)
-#line 736
 			return lstatus;
-#line 736
 		
-#line 736
 		lstatus = ncx_putn_double_uchar(&xp, nput, value);
-#line 736
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 736
 		{
-#line 736
 			/* not fatal to the loop */
-#line 736
 			status = lstatus;
-#line 736
 		}
-#line 736
 
-#line 736
 		(void) ncio_rel(ncp->nciop, offset,
-#line 736
 				 RGN_MODIFIED);	
-#line 736
 
-#line 736
 		remaining -= extent;
-#line 736
 		if(remaining == 0)
-#line 736
 			break; /* normal loop exit */
-#line 736
 		offset += extent;
-#line 736
 		value += nput;
-#line 736
 
-#line 736
 	}
-#line 736
 
-#line 736
 	return status;
-#line 736
 }
-#line 736
 
 static int
-#line 737
 putNCvx_double_short(NC3_INFO* ncp, const NC_var *varp,
-#line 737
 		 const size_t *start, size_t nelems, const short *value)
-#line 737
 {
-#line 737
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 737
 	size_t remaining = varp->xsz * nelems;
-#line 737
 	int status = NC_NOERR;
-#line 737
 	void *xp;
-#line 737
 
-#line 737
 	if(nelems == 0)
-#line 737
 		return NC_NOERR;
-#line 737
 
-#line 737
 	assert(value != NULL);
-#line 737
 
-#line 737
 	for(;;)
-#line 737
 	{
-#line 737
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 737
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 737
 
-#line 737
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 737
 				 RGN_WRITE, &xp);	
-#line 737
 		if(lstatus != NC_NOERR)
-#line 737
 			return lstatus;
-#line 737
 		
-#line 737
 		lstatus = ncx_putn_double_short(&xp, nput, value);
-#line 737
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 737
 		{
-#line 737
 			/* not fatal to the loop */
-#line 737
 			status = lstatus;
-#line 737
 		}
-#line 737
 
-#line 737
 		(void) ncio_rel(ncp->nciop, offset,
-#line 737
 				 RGN_MODIFIED);	
-#line 737
 
-#line 737
 		remaining -= extent;
-#line 737
 		if(remaining == 0)
-#line 737
 			break; /* normal loop exit */
-#line 737
 		offset += extent;
-#line 737
 		value += nput;
-#line 737
 
-#line 737
 	}
-#line 737
 
-#line 737
 	return status;
-#line 737
 }
-#line 737
 
 static int
-#line 738
 putNCvx_double_int(NC3_INFO* ncp, const NC_var *varp,
-#line 738
 		 const size_t *start, size_t nelems, const int *value)
-#line 738
 {
-#line 738
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 738
 	size_t remaining = varp->xsz * nelems;
-#line 738
 	int status = NC_NOERR;
-#line 738
 	void *xp;
-#line 738
 
-#line 738
 	if(nelems == 0)
-#line 738
 		return NC_NOERR;
-#line 738
 
-#line 738
 	assert(value != NULL);
-#line 738
 
-#line 738
 	for(;;)
-#line 738
 	{
-#line 738
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 738
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 738
 
-#line 738
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 738
 				 RGN_WRITE, &xp);	
-#line 738
 		if(lstatus != NC_NOERR)
-#line 738
 			return lstatus;
-#line 738
 		
-#line 738
 		lstatus = ncx_putn_double_int(&xp, nput, value);
-#line 738
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 738
 		{
-#line 738
 			/* not fatal to the loop */
-#line 738
 			status = lstatus;
-#line 738
 		}
-#line 738
 
-#line 738
 		(void) ncio_rel(ncp->nciop, offset,
-#line 738
 				 RGN_MODIFIED);	
-#line 738
 
-#line 738
 		remaining -= extent;
-#line 738
 		if(remaining == 0)
-#line 738
 			break; /* normal loop exit */
-#line 738
 		offset += extent;
-#line 738
 		value += nput;
-#line 738
 
-#line 738
 	}
-#line 738
 
-#line 738
 	return status;
-#line 738
 }
-#line 738
 
 static int
-#line 739
 putNCvx_double_float(NC3_INFO* ncp, const NC_var *varp,
-#line 739
 		 const size_t *start, size_t nelems, const float *value)
-#line 739
 {
-#line 739
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 739
 	size_t remaining = varp->xsz * nelems;
-#line 739
 	int status = NC_NOERR;
-#line 739
 	void *xp;
-#line 739
 
-#line 739
 	if(nelems == 0)
-#line 739
 		return NC_NOERR;
-#line 739
 
-#line 739
 	assert(value != NULL);
-#line 739
 
-#line 739
 	for(;;)
-#line 739
 	{
-#line 739
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 739
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 739
 
-#line 739
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 739
 				 RGN_WRITE, &xp);	
-#line 739
 		if(lstatus != NC_NOERR)
-#line 739
 			return lstatus;
-#line 739
 		
-#line 739
 		lstatus = ncx_putn_double_float(&xp, nput, value);
-#line 739
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 739
 		{
-#line 739
 			/* not fatal to the loop */
-#line 739
 			status = lstatus;
-#line 739
 		}
-#line 739
 
-#line 739
 		(void) ncio_rel(ncp->nciop, offset,
-#line 739
 				 RGN_MODIFIED);	
-#line 739
 
-#line 739
 		remaining -= extent;
-#line 739
 		if(remaining == 0)
-#line 739
 			break; /* normal loop exit */
-#line 739
 		offset += extent;
-#line 739
 		value += nput;
-#line 739
 
-#line 739
 	}
-#line 739
 
-#line 739
 	return status;
-#line 739
 }
-#line 739
 
 static int
-#line 740
 putNCvx_double_double(NC3_INFO* ncp, const NC_var *varp,
-#line 740
 		 const size_t *start, size_t nelems, const double *value)
-#line 740
 {
-#line 740
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 740
 	size_t remaining = varp->xsz * nelems;
-#line 740
 	int status = NC_NOERR;
-#line 740
 	void *xp;
-#line 740
 
-#line 740
 	if(nelems == 0)
-#line 740
 		return NC_NOERR;
-#line 740
 
-#line 740
 	assert(value != NULL);
-#line 740
 
-#line 740
 	for(;;)
-#line 740
 	{
-#line 740
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 740
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 740
 
-#line 740
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 740
 				 RGN_WRITE, &xp);	
-#line 740
 		if(lstatus != NC_NOERR)
-#line 740
 			return lstatus;
-#line 740
 		
-#line 740
 		lstatus = ncx_putn_double_double(&xp, nput, value);
-#line 740
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 740
 		{
-#line 740
 			/* not fatal to the loop */
-#line 740
 			status = lstatus;
-#line 740
 		}
-#line 740
 
-#line 740
 		(void) ncio_rel(ncp->nciop, offset,
-#line 740
 				 RGN_MODIFIED);	
-#line 740
 
-#line 740
 		remaining -= extent;
-#line 740
 		if(remaining == 0)
-#line 740
 			break; /* normal loop exit */
-#line 740
 		offset += extent;
-#line 740
 		value += nput;
-#line 740
 
-#line 740
 	}
-#line 740
 
-#line 740
 	return status;
-#line 740
 }
-#line 740
 
 static int
-#line 741
 putNCvx_double_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 741
 		 const size_t *start, size_t nelems, const longlong *value)
-#line 741
 {
-#line 741
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 741
 	size_t remaining = varp->xsz * nelems;
-#line 741
 	int status = NC_NOERR;
-#line 741
 	void *xp;
-#line 741
 
-#line 741
 	if(nelems == 0)
-#line 741
 		return NC_NOERR;
-#line 741
 
-#line 741
 	assert(value != NULL);
-#line 741
 
-#line 741
 	for(;;)
-#line 741
 	{
-#line 741
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 741
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 741
 
-#line 741
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 741
 				 RGN_WRITE, &xp);	
-#line 741
 		if(lstatus != NC_NOERR)
-#line 741
 			return lstatus;
-#line 741
 		
-#line 741
 		lstatus = ncx_putn_double_longlong(&xp, nput, value);
-#line 741
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 741
 		{
-#line 741
 			/* not fatal to the loop */
-#line 741
 			status = lstatus;
-#line 741
 		}
-#line 741
 
-#line 741
 		(void) ncio_rel(ncp->nciop, offset,
-#line 741
 				 RGN_MODIFIED);	
-#line 741
 
-#line 741
 		remaining -= extent;
-#line 741
 		if(remaining == 0)
-#line 741
 			break; /* normal loop exit */
-#line 741
 		offset += extent;
-#line 741
 		value += nput;
-#line 741
 
-#line 741
 	}
-#line 741
 
-#line 741
 	return status;
-#line 741
 }
-#line 741
 
 
-#line 744
 #ifdef NOTUSED
 static int
-#line 745
 putNCvx_schar_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 745
 		 const size_t *start, size_t nelems, const uint *value)
-#line 745
 {
-#line 745
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 745
 	size_t remaining = varp->xsz * nelems;
-#line 745
 	int status = NC_NOERR;
-#line 745
 	void *xp;
-#line 745
 
-#line 745
 	if(nelems == 0)
-#line 745
 		return NC_NOERR;
-#line 745
 
-#line 745
 	assert(value != NULL);
-#line 745
 
-#line 745
 	for(;;)
-#line 745
 	{
-#line 745
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 745
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 745
 
-#line 745
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 745
 				 RGN_WRITE, &xp);	
-#line 745
 		if(lstatus != NC_NOERR)
-#line 745
 			return lstatus;
-#line 745
 		
-#line 745
 		lstatus = ncx_putn_schar_uint(&xp, nput, value);
-#line 745
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 745
 		{
-#line 745
 			/* not fatal to the loop */
-#line 745
 			status = lstatus;
-#line 745
 		}
-#line 745
 
-#line 745
 		(void) ncio_rel(ncp->nciop, offset,
-#line 745
 				 RGN_MODIFIED);	
-#line 745
 
-#line 745
 		remaining -= extent;
-#line 745
 		if(remaining == 0)
-#line 745
 			break; /* normal loop exit */
-#line 745
 		offset += extent;
-#line 745
 		value += nput;
-#line 745
 
-#line 745
 	}
-#line 745
 
-#line 745
 	return status;
-#line 745
 }
-#line 745
 
 static int
-#line 746
 putNCvx_schar_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 746
 		 const size_t *start, size_t nelems, const ulonglong *value)
-#line 746
 {
-#line 746
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 746
 	size_t remaining = varp->xsz * nelems;
-#line 746
 	int status = NC_NOERR;
-#line 746
 	void *xp;
-#line 746
 
-#line 746
 	if(nelems == 0)
-#line 746
 		return NC_NOERR;
-#line 746
 
-#line 746
 	assert(value != NULL);
-#line 746
 
-#line 746
 	for(;;)
-#line 746
 	{
-#line 746
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 746
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 746
 
-#line 746
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 746
 				 RGN_WRITE, &xp);	
-#line 746
 		if(lstatus != NC_NOERR)
-#line 746
 			return lstatus;
-#line 746
 		
-#line 746
 		lstatus = ncx_putn_schar_ulonglong(&xp, nput, value);
-#line 746
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 746
 		{
-#line 746
 			/* not fatal to the loop */
-#line 746
 			status = lstatus;
-#line 746
 		}
-#line 746
 
-#line 746
 		(void) ncio_rel(ncp->nciop, offset,
-#line 746
 				 RGN_MODIFIED);	
-#line 746
 
-#line 746
 		remaining -= extent;
-#line 746
 		if(remaining == 0)
-#line 746
 			break; /* normal loop exit */
-#line 746
 		offset += extent;
-#line 746
 		value += nput;
-#line 746
 
-#line 746
 	}
-#line 746
 
-#line 746
 	return status;
-#line 746
 }
-#line 746
 
 static int
-#line 747
 putNCvx_short_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 747
 		 const size_t *start, size_t nelems, const uint *value)
-#line 747
 {
-#line 747
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 747
 	size_t remaining = varp->xsz * nelems;
-#line 747
 	int status = NC_NOERR;
-#line 747
 	void *xp;
-#line 747
 
-#line 747
 	if(nelems == 0)
-#line 747
 		return NC_NOERR;
-#line 747
 
-#line 747
 	assert(value != NULL);
-#line 747
 
-#line 747
 	for(;;)
-#line 747
 	{
-#line 747
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 747
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 747
 
-#line 747
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 747
 				 RGN_WRITE, &xp);	
-#line 747
 		if(lstatus != NC_NOERR)
-#line 747
 			return lstatus;
-#line 747
 		
-#line 747
 		lstatus = ncx_putn_short_uint(&xp, nput, value);
-#line 747
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 747
 		{
-#line 747
 			/* not fatal to the loop */
-#line 747
 			status = lstatus;
-#line 747
 		}
-#line 747
 
-#line 747
 		(void) ncio_rel(ncp->nciop, offset,
-#line 747
 				 RGN_MODIFIED);	
-#line 747
 
-#line 747
 		remaining -= extent;
-#line 747
 		if(remaining == 0)
-#line 747
 			break; /* normal loop exit */
-#line 747
 		offset += extent;
-#line 747
 		value += nput;
-#line 747
 
-#line 747
 	}
-#line 747
 
-#line 747
 	return status;
-#line 747
 }
-#line 747
 
 static int
-#line 748
 putNCvx_short_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 748
 		 const size_t *start, size_t nelems, const ulonglong *value)
-#line 748
 {
-#line 748
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 748
 	size_t remaining = varp->xsz * nelems;
-#line 748
 	int status = NC_NOERR;
-#line 748
 	void *xp;
-#line 748
 
-#line 748
 	if(nelems == 0)
-#line 748
 		return NC_NOERR;
-#line 748
 
-#line 748
 	assert(value != NULL);
-#line 748
 
-#line 748
 	for(;;)
-#line 748
 	{
-#line 748
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 748
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 748
 
-#line 748
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 748
 				 RGN_WRITE, &xp);	
-#line 748
 		if(lstatus != NC_NOERR)
-#line 748
 			return lstatus;
-#line 748
 		
-#line 748
 		lstatus = ncx_putn_short_ulonglong(&xp, nput, value);
-#line 748
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 748
 		{
-#line 748
 			/* not fatal to the loop */
-#line 748
 			status = lstatus;
-#line 748
 		}
-#line 748
 
-#line 748
 		(void) ncio_rel(ncp->nciop, offset,
-#line 748
 				 RGN_MODIFIED);	
-#line 748
 
-#line 748
 		remaining -= extent;
-#line 748
 		if(remaining == 0)
-#line 748
 			break; /* normal loop exit */
-#line 748
 		offset += extent;
-#line 748
 		value += nput;
-#line 748
 
-#line 748
 	}
-#line 748
 
-#line 748
 	return status;
-#line 748
 }
-#line 748
 
 static int
-#line 749
 putNCvx_int_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 749
 		 const size_t *start, size_t nelems, const uint *value)
-#line 749
 {
-#line 749
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 749
 	size_t remaining = varp->xsz * nelems;
-#line 749
 	int status = NC_NOERR;
-#line 749
 	void *xp;
-#line 749
 
-#line 749
 	if(nelems == 0)
-#line 749
 		return NC_NOERR;
-#line 749
 
-#line 749
 	assert(value != NULL);
-#line 749
 
-#line 749
 	for(;;)
-#line 749
 	{
-#line 749
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 749
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 749
 
-#line 749
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 749
 				 RGN_WRITE, &xp);	
-#line 749
 		if(lstatus != NC_NOERR)
-#line 749
 			return lstatus;
-#line 749
 		
-#line 749
 		lstatus = ncx_putn_int_uint(&xp, nput, value);
-#line 749
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 749
 		{
-#line 749
 			/* not fatal to the loop */
-#line 749
 			status = lstatus;
-#line 749
 		}
-#line 749
 
-#line 749
 		(void) ncio_rel(ncp->nciop, offset,
-#line 749
 				 RGN_MODIFIED);	
-#line 749
 
-#line 749
 		remaining -= extent;
-#line 749
 		if(remaining == 0)
-#line 749
 			break; /* normal loop exit */
-#line 749
 		offset += extent;
-#line 749
 		value += nput;
-#line 749
 
-#line 749
 	}
-#line 749
 
-#line 749
 	return status;
-#line 749
 }
-#line 749
 
 static int
-#line 750
 putNCvx_int_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 750
 		 const size_t *start, size_t nelems, const ulonglong *value)
-#line 750
 {
-#line 750
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 750
 	size_t remaining = varp->xsz * nelems;
-#line 750
 	int status = NC_NOERR;
-#line 750
 	void *xp;
-#line 750
 
-#line 750
 	if(nelems == 0)
-#line 750
 		return NC_NOERR;
-#line 750
 
-#line 750
 	assert(value != NULL);
-#line 750
 
-#line 750
 	for(;;)
-#line 750
 	{
-#line 750
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 750
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 750
 
-#line 750
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 750
 				 RGN_WRITE, &xp);	
-#line 750
 		if(lstatus != NC_NOERR)
-#line 750
 			return lstatus;
-#line 750
 		
-#line 750
 		lstatus = ncx_putn_int_ulonglong(&xp, nput, value);
-#line 750
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 750
 		{
-#line 750
 			/* not fatal to the loop */
-#line 750
 			status = lstatus;
-#line 750
 		}
-#line 750
 
-#line 750
 		(void) ncio_rel(ncp->nciop, offset,
-#line 750
 				 RGN_MODIFIED);	
-#line 750
 
-#line 750
 		remaining -= extent;
-#line 750
 		if(remaining == 0)
-#line 750
 			break; /* normal loop exit */
-#line 750
 		offset += extent;
-#line 750
 		value += nput;
-#line 750
 
-#line 750
 	}
-#line 750
 
-#line 750
 	return status;
-#line 750
 }
-#line 750
 
 static int
-#line 751
 putNCvx_float_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 751
 		 const size_t *start, size_t nelems, const uint *value)
-#line 751
 {
-#line 751
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 751
 	size_t remaining = varp->xsz * nelems;
-#line 751
 	int status = NC_NOERR;
-#line 751
 	void *xp;
-#line 751
 
-#line 751
 	if(nelems == 0)
-#line 751
 		return NC_NOERR;
-#line 751
 
-#line 751
 	assert(value != NULL);
-#line 751
 
-#line 751
 	for(;;)
-#line 751
 	{
-#line 751
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 751
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 751
 
-#line 751
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 751
 				 RGN_WRITE, &xp);	
-#line 751
 		if(lstatus != NC_NOERR)
-#line 751
 			return lstatus;
-#line 751
 		
-#line 751
 		lstatus = ncx_putn_float_uint(&xp, nput, value);
-#line 751
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 751
 		{
-#line 751
 			/* not fatal to the loop */
-#line 751
 			status = lstatus;
-#line 751
 		}
-#line 751
 
-#line 751
 		(void) ncio_rel(ncp->nciop, offset,
-#line 751
 				 RGN_MODIFIED);	
-#line 751
 
-#line 751
 		remaining -= extent;
-#line 751
 		if(remaining == 0)
-#line 751
 			break; /* normal loop exit */
-#line 751
 		offset += extent;
-#line 751
 		value += nput;
-#line 751
 
-#line 751
 	}
-#line 751
 
-#line 751
 	return status;
-#line 751
 }
-#line 751
 
 static int
-#line 752
 putNCvx_float_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 752
 		 const size_t *start, size_t nelems, const ulonglong *value)
-#line 752
 {
-#line 752
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 752
 	size_t remaining = varp->xsz * nelems;
-#line 752
 	int status = NC_NOERR;
-#line 752
 	void *xp;
-#line 752
 
-#line 752
 	if(nelems == 0)
-#line 752
 		return NC_NOERR;
-#line 752
 
-#line 752
 	assert(value != NULL);
-#line 752
 
-#line 752
 	for(;;)
-#line 752
 	{
-#line 752
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 752
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 752
 
-#line 752
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 752
 				 RGN_WRITE, &xp);	
-#line 752
 		if(lstatus != NC_NOERR)
-#line 752
 			return lstatus;
-#line 752
 		
-#line 752
 		lstatus = ncx_putn_float_ulonglong(&xp, nput, value);
-#line 752
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 752
 		{
-#line 752
 			/* not fatal to the loop */
-#line 752
 			status = lstatus;
-#line 752
 		}
-#line 752
 
-#line 752
 		(void) ncio_rel(ncp->nciop, offset,
-#line 752
 				 RGN_MODIFIED);	
-#line 752
 
-#line 752
 		remaining -= extent;
-#line 752
 		if(remaining == 0)
-#line 752
 			break; /* normal loop exit */
-#line 752
 		offset += extent;
-#line 752
 		value += nput;
-#line 752
 
-#line 752
 	}
-#line 752
 
-#line 752
 	return status;
-#line 752
 }
-#line 752
 
 static int
-#line 753
 putNCvx_double_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 753
 		 const size_t *start, size_t nelems, const uint *value)
-#line 753
 {
-#line 753
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 753
 	size_t remaining = varp->xsz * nelems;
-#line 753
 	int status = NC_NOERR;
-#line 753
 	void *xp;
-#line 753
 
-#line 753
 	if(nelems == 0)
-#line 753
 		return NC_NOERR;
-#line 753
 
-#line 753
 	assert(value != NULL);
-#line 753
 
-#line 753
 	for(;;)
-#line 753
 	{
-#line 753
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 753
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 753
 
-#line 753
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 753
 				 RGN_WRITE, &xp);	
-#line 753
 		if(lstatus != NC_NOERR)
-#line 753
 			return lstatus;
-#line 753
 		
-#line 753
 		lstatus = ncx_putn_double_uint(&xp, nput, value);
-#line 753
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 753
 		{
-#line 753
 			/* not fatal to the loop */
-#line 753
 			status = lstatus;
-#line 753
 		}
-#line 753
 
-#line 753
 		(void) ncio_rel(ncp->nciop, offset,
-#line 753
 				 RGN_MODIFIED);	
-#line 753
 
-#line 753
 		remaining -= extent;
-#line 753
 		if(remaining == 0)
-#line 753
 			break; /* normal loop exit */
-#line 753
 		offset += extent;
-#line 753
 		value += nput;
-#line 753
 
-#line 753
 	}
-#line 753
 
-#line 753
 	return status;
-#line 753
 }
-#line 753
 
 static int
-#line 754
 putNCvx_double_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 754
 		 const size_t *start, size_t nelems, const ulonglong *value)
-#line 754
 {
-#line 754
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 754
 	size_t remaining = varp->xsz * nelems;
-#line 754
 	int status = NC_NOERR;
-#line 754
 	void *xp;
-#line 754
 
-#line 754
 	if(nelems == 0)
-#line 754
 		return NC_NOERR;
-#line 754
 
-#line 754
 	assert(value != NULL);
-#line 754
 
-#line 754
 	for(;;)
-#line 754
 	{
-#line 754
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 754
 		size_t nput = ncx_howmany(varp->type, extent);
-#line 754
 
-#line 754
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 754
 				 RGN_WRITE, &xp);	
-#line 754
 		if(lstatus != NC_NOERR)
-#line 754
 			return lstatus;
-#line 754
 		
-#line 754
 		lstatus = ncx_putn_double_ulonglong(&xp, nput, value);
-#line 754
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 754
 		{
-#line 754
 			/* not fatal to the loop */
-#line 754
 			status = lstatus;
-#line 754
 		}
-#line 754
 
-#line 754
 		(void) ncio_rel(ncp->nciop, offset,
-#line 754
 				 RGN_MODIFIED);	
-#line 754
 
-#line 754
 		remaining -= extent;
-#line 754
 		if(remaining == 0)
-#line 754
 			break; /* normal loop exit */
-#line 754
 		offset += extent;
-#line 754
 		value += nput;
-#line 754
 
-#line 754
 	}
-#line 754
 
-#line 754
 	return status;
-#line 754
 }
-#line 754
 
 #endif /*NOTUSED*/
 
-#line 802
 
 static int
-#line 803
 getNCvx_char_char(const NC3_INFO* ncp, const NC_var *varp,
-#line 803
 		 const size_t *start, size_t nelems, char *value)
-#line 803
 {
-#line 803
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 803
 	size_t remaining = varp->xsz * nelems;
-#line 803
 	int status = NC_NOERR;
-#line 803
 	const void *xp;
-#line 803
 
-#line 803
 	if(nelems == 0)
-#line 803
 		return NC_NOERR;
-#line 803
 
-#line 803
 	assert(value != NULL);
-#line 803
 
-#line 803
 	for(;;)
-#line 803
 	{
-#line 803
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 803
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 803
 
-#line 803
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 803
 				 0, (void **)&xp);	/* cast away const */
-#line 803
 		if(lstatus != NC_NOERR)
-#line 803
 			return lstatus;
-#line 803
 		
-#line 803
 		lstatus = ncx_getn_char_char(&xp, nget, value);
-#line 803
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 803
 			status = lstatus;
-#line 803
 
-#line 803
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 803
 
-#line 803
 		remaining -= extent;
-#line 803
 		if(remaining == 0)
-#line 803
 			break; /* normal loop exit */
-#line 803
 		offset += extent;
-#line 803
 		value += nget;
-#line 803
 	}
-#line 803
 
-#line 803
 	return status;
-#line 803
 }
-#line 803
 
 
 static int
-#line 805
 getNCvx_schar_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 805
 		 const size_t *start, size_t nelems, schar *value)
-#line 805
 {
-#line 805
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 805
 	size_t remaining = varp->xsz * nelems;
-#line 805
 	int status = NC_NOERR;
-#line 805
 	const void *xp;
-#line 805
 
-#line 805
 	if(nelems == 0)
-#line 805
 		return NC_NOERR;
-#line 805
 
-#line 805
 	assert(value != NULL);
-#line 805
 
-#line 805
 	for(;;)
-#line 805
 	{
-#line 805
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 805
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 805
 
-#line 805
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 805
 				 0, (void **)&xp);	/* cast away const */
-#line 805
 		if(lstatus != NC_NOERR)
-#line 805
 			return lstatus;
-#line 805
 		
-#line 805
 		lstatus = ncx_getn_schar_schar(&xp, nget, value);
-#line 805
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 805
 			status = lstatus;
-#line 805
 
-#line 805
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 805
 
-#line 805
 		remaining -= extent;
-#line 805
 		if(remaining == 0)
-#line 805
 			break; /* normal loop exit */
-#line 805
 		offset += extent;
-#line 805
 		value += nget;
-#line 805
 	}
-#line 805
 
-#line 805
 	return status;
-#line 805
 }
-#line 805
 
 static int
-#line 806
 getNCvx_schar_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 806
 		 const size_t *start, size_t nelems, short *value)
-#line 806
 {
-#line 806
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 806
 	size_t remaining = varp->xsz * nelems;
-#line 806
 	int status = NC_NOERR;
-#line 806
 	const void *xp;
-#line 806
 
-#line 806
 	if(nelems == 0)
-#line 806
 		return NC_NOERR;
-#line 806
 
-#line 806
 	assert(value != NULL);
-#line 806
 
-#line 806
 	for(;;)
-#line 806
 	{
-#line 806
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 806
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 806
 
-#line 806
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 806
 				 0, (void **)&xp);	/* cast away const */
-#line 806
 		if(lstatus != NC_NOERR)
-#line 806
 			return lstatus;
-#line 806
 		
-#line 806
 		lstatus = ncx_getn_schar_short(&xp, nget, value);
-#line 806
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 806
 			status = lstatus;
-#line 806
 
-#line 806
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 806
 
-#line 806
 		remaining -= extent;
-#line 806
 		if(remaining == 0)
-#line 806
 			break; /* normal loop exit */
-#line 806
 		offset += extent;
-#line 806
 		value += nget;
-#line 806
 	}
-#line 806
 
-#line 806
 	return status;
-#line 806
 }
-#line 806
 
 static int
-#line 807
 getNCvx_schar_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 807
 		 const size_t *start, size_t nelems, int *value)
-#line 807
 {
-#line 807
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 807
 	size_t remaining = varp->xsz * nelems;
-#line 807
 	int status = NC_NOERR;
-#line 807
 	const void *xp;
-#line 807
 
-#line 807
 	if(nelems == 0)
-#line 807
 		return NC_NOERR;
-#line 807
 
-#line 807
 	assert(value != NULL);
-#line 807
 
-#line 807
 	for(;;)
-#line 807
 	{
-#line 807
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 807
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 807
 
-#line 807
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 807
 				 0, (void **)&xp);	/* cast away const */
-#line 807
 		if(lstatus != NC_NOERR)
-#line 807
 			return lstatus;
-#line 807
 		
-#line 807
 		lstatus = ncx_getn_schar_int(&xp, nget, value);
-#line 807
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 807
 			status = lstatus;
-#line 807
 
-#line 807
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 807
 
-#line 807
 		remaining -= extent;
-#line 807
 		if(remaining == 0)
-#line 807
 			break; /* normal loop exit */
-#line 807
 		offset += extent;
-#line 807
 		value += nget;
-#line 807
 	}
-#line 807
 
-#line 807
 	return status;
-#line 807
 }
-#line 807
 
 static int
-#line 808
 getNCvx_schar_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 808
 		 const size_t *start, size_t nelems, float *value)
-#line 808
 {
-#line 808
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 808
 	size_t remaining = varp->xsz * nelems;
-#line 808
 	int status = NC_NOERR;
-#line 808
 	const void *xp;
-#line 808
 
-#line 808
 	if(nelems == 0)
-#line 808
 		return NC_NOERR;
-#line 808
 
-#line 808
 	assert(value != NULL);
-#line 808
 
-#line 808
 	for(;;)
-#line 808
 	{
-#line 808
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 808
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 808
 
-#line 808
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 808
 				 0, (void **)&xp);	/* cast away const */
-#line 808
 		if(lstatus != NC_NOERR)
-#line 808
 			return lstatus;
-#line 808
 		
-#line 808
 		lstatus = ncx_getn_schar_float(&xp, nget, value);
-#line 808
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 808
 			status = lstatus;
-#line 808
 
-#line 808
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 808
 
-#line 808
 		remaining -= extent;
-#line 808
 		if(remaining == 0)
-#line 808
 			break; /* normal loop exit */
-#line 808
 		offset += extent;
-#line 808
 		value += nget;
-#line 808
 	}
-#line 808
 
-#line 808
 	return status;
-#line 808
 }
-#line 808
 
 static int
-#line 809
 getNCvx_schar_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 809
 		 const size_t *start, size_t nelems, double *value)
-#line 809
 {
-#line 809
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 809
 	size_t remaining = varp->xsz * nelems;
-#line 809
 	int status = NC_NOERR;
-#line 809
 	const void *xp;
-#line 809
 
-#line 809
 	if(nelems == 0)
-#line 809
 		return NC_NOERR;
-#line 809
 
-#line 809
 	assert(value != NULL);
-#line 809
 
-#line 809
 	for(;;)
-#line 809
 	{
-#line 809
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 809
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 809
 
-#line 809
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 809
 				 0, (void **)&xp);	/* cast away const */
-#line 809
 		if(lstatus != NC_NOERR)
-#line 809
 			return lstatus;
-#line 809
 		
-#line 809
 		lstatus = ncx_getn_schar_double(&xp, nget, value);
-#line 809
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 809
 			status = lstatus;
-#line 809
 
-#line 809
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 809
 
-#line 809
 		remaining -= extent;
-#line 809
 		if(remaining == 0)
-#line 809
 			break; /* normal loop exit */
-#line 809
 		offset += extent;
-#line 809
 		value += nget;
-#line 809
 	}
-#line 809
 
-#line 809
 	return status;
-#line 809
 }
-#line 809
 
 static int
-#line 810
 getNCvx_schar_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 810
 		 const size_t *start, size_t nelems, longlong *value)
-#line 810
 {
-#line 810
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 810
 	size_t remaining = varp->xsz * nelems;
-#line 810
 	int status = NC_NOERR;
-#line 810
 	const void *xp;
-#line 810
 
-#line 810
 	if(nelems == 0)
-#line 810
 		return NC_NOERR;
-#line 810
 
-#line 810
 	assert(value != NULL);
-#line 810
 
-#line 810
 	for(;;)
-#line 810
 	{
-#line 810
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 810
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 810
 
-#line 810
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 810
 				 0, (void **)&xp);	/* cast away const */
-#line 810
 		if(lstatus != NC_NOERR)
-#line 810
 			return lstatus;
-#line 810
 		
-#line 810
 		lstatus = ncx_getn_schar_longlong(&xp, nget, value);
-#line 810
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 810
 			status = lstatus;
-#line 810
 
-#line 810
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 810
 
-#line 810
 		remaining -= extent;
-#line 810
 		if(remaining == 0)
-#line 810
 			break; /* normal loop exit */
-#line 810
 		offset += extent;
-#line 810
 		value += nget;
-#line 810
 	}
-#line 810
 
-#line 810
 	return status;
-#line 810
 }
-#line 810
 
 static int
-#line 811
 getNCvx_schar_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 811
 		 const size_t *start, size_t nelems, uint *value)
-#line 811
 {
-#line 811
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 811
 	size_t remaining = varp->xsz * nelems;
-#line 811
 	int status = NC_NOERR;
-#line 811
 	const void *xp;
-#line 811
 
-#line 811
 	if(nelems == 0)
-#line 811
 		return NC_NOERR;
-#line 811
 
-#line 811
 	assert(value != NULL);
-#line 811
 
-#line 811
 	for(;;)
-#line 811
 	{
-#line 811
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 811
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 811
 
-#line 811
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 811
 				 0, (void **)&xp);	/* cast away const */
-#line 811
 		if(lstatus != NC_NOERR)
-#line 811
 			return lstatus;
-#line 811
 		
-#line 811
 		lstatus = ncx_getn_schar_uint(&xp, nget, value);
-#line 811
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 811
 			status = lstatus;
-#line 811
 
-#line 811
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 811
 
-#line 811
 		remaining -= extent;
-#line 811
 		if(remaining == 0)
-#line 811
 			break; /* normal loop exit */
-#line 811
 		offset += extent;
-#line 811
 		value += nget;
-#line 811
 	}
-#line 811
 
-#line 811
 	return status;
-#line 811
 }
-#line 811
 
 static int
-#line 812
 getNCvx_schar_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 812
 		 const size_t *start, size_t nelems, ulonglong *value)
-#line 812
 {
-#line 812
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 812
 	size_t remaining = varp->xsz * nelems;
-#line 812
 	int status = NC_NOERR;
-#line 812
 	const void *xp;
-#line 812
 
-#line 812
 	if(nelems == 0)
-#line 812
 		return NC_NOERR;
-#line 812
 
-#line 812
 	assert(value != NULL);
-#line 812
 
-#line 812
 	for(;;)
-#line 812
 	{
-#line 812
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 812
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 812
 
-#line 812
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 812
 				 0, (void **)&xp);	/* cast away const */
-#line 812
 		if(lstatus != NC_NOERR)
-#line 812
 			return lstatus;
-#line 812
 		
-#line 812
 		lstatus = ncx_getn_schar_ulonglong(&xp, nget, value);
-#line 812
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 812
 			status = lstatus;
-#line 812
 
-#line 812
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 812
 
-#line 812
 		remaining -= extent;
-#line 812
 		if(remaining == 0)
-#line 812
 			break; /* normal loop exit */
-#line 812
 		offset += extent;
-#line 812
 		value += nget;
-#line 812
 	}
-#line 812
 
-#line 812
 	return status;
-#line 812
 }
-#line 812
 
 
 static int
-#line 814
 getNCvx_short_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 814
 		 const size_t *start, size_t nelems, schar *value)
-#line 814
 {
-#line 814
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 814
 	size_t remaining = varp->xsz * nelems;
-#line 814
 	int status = NC_NOERR;
-#line 814
 	const void *xp;
-#line 814
 
-#line 814
 	if(nelems == 0)
-#line 814
 		return NC_NOERR;
-#line 814
 
-#line 814
 	assert(value != NULL);
-#line 814
 
-#line 814
 	for(;;)
-#line 814
 	{
-#line 814
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 814
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 814
 
-#line 814
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 814
 				 0, (void **)&xp);	/* cast away const */
-#line 814
 		if(lstatus != NC_NOERR)
-#line 814
 			return lstatus;
-#line 814
 		
-#line 814
 		lstatus = ncx_getn_short_schar(&xp, nget, value);
-#line 814
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 814
 			status = lstatus;
-#line 814
 
-#line 814
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 814
 
-#line 814
 		remaining -= extent;
-#line 814
 		if(remaining == 0)
-#line 814
 			break; /* normal loop exit */
-#line 814
 		offset += extent;
-#line 814
 		value += nget;
-#line 814
 	}
-#line 814
 
-#line 814
 	return status;
-#line 814
 }
-#line 814
 
 static int
-#line 815
 getNCvx_short_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 815
 		 const size_t *start, size_t nelems, uchar *value)
-#line 815
 {
-#line 815
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 815
 	size_t remaining = varp->xsz * nelems;
-#line 815
 	int status = NC_NOERR;
-#line 815
 	const void *xp;
-#line 815
 
-#line 815
 	if(nelems == 0)
-#line 815
 		return NC_NOERR;
-#line 815
 
-#line 815
 	assert(value != NULL);
-#line 815
 
-#line 815
 	for(;;)
-#line 815
 	{
-#line 815
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 815
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 815
 
-#line 815
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 815
 				 0, (void **)&xp);	/* cast away const */
-#line 815
 		if(lstatus != NC_NOERR)
-#line 815
 			return lstatus;
-#line 815
 		
-#line 815
 		lstatus = ncx_getn_short_uchar(&xp, nget, value);
-#line 815
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 815
 			status = lstatus;
-#line 815
 
-#line 815
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 815
 
-#line 815
 		remaining -= extent;
-#line 815
 		if(remaining == 0)
-#line 815
 			break; /* normal loop exit */
-#line 815
 		offset += extent;
-#line 815
 		value += nget;
-#line 815
 	}
-#line 815
 
-#line 815
 	return status;
-#line 815
 }
-#line 815
 
 static int
-#line 816
 getNCvx_short_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 816
 		 const size_t *start, size_t nelems, short *value)
-#line 816
 {
-#line 816
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 816
 	size_t remaining = varp->xsz * nelems;
-#line 816
 	int status = NC_NOERR;
-#line 816
 	const void *xp;
-#line 816
 
-#line 816
 	if(nelems == 0)
-#line 816
 		return NC_NOERR;
-#line 816
 
-#line 816
 	assert(value != NULL);
-#line 816
 
-#line 816
 	for(;;)
-#line 816
 	{
-#line 816
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 816
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 816
 
-#line 816
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 816
 				 0, (void **)&xp);	/* cast away const */
-#line 816
 		if(lstatus != NC_NOERR)
-#line 816
 			return lstatus;
-#line 816
 		
-#line 816
 		lstatus = ncx_getn_short_short(&xp, nget, value);
-#line 816
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 816
 			status = lstatus;
-#line 816
 
-#line 816
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 816
 
-#line 816
 		remaining -= extent;
-#line 816
 		if(remaining == 0)
-#line 816
 			break; /* normal loop exit */
-#line 816
 		offset += extent;
-#line 816
 		value += nget;
-#line 816
 	}
-#line 816
 
-#line 816
 	return status;
-#line 816
 }
-#line 816
 
 static int
-#line 817
 getNCvx_short_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 817
 		 const size_t *start, size_t nelems, int *value)
-#line 817
 {
-#line 817
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 817
 	size_t remaining = varp->xsz * nelems;
-#line 817
 	int status = NC_NOERR;
-#line 817
 	const void *xp;
-#line 817
 
-#line 817
 	if(nelems == 0)
-#line 817
 		return NC_NOERR;
-#line 817
 
-#line 817
 	assert(value != NULL);
-#line 817
 
-#line 817
 	for(;;)
-#line 817
 	{
-#line 817
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 817
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 817
 
-#line 817
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 817
 				 0, (void **)&xp);	/* cast away const */
-#line 817
 		if(lstatus != NC_NOERR)
-#line 817
 			return lstatus;
-#line 817
 		
-#line 817
 		lstatus = ncx_getn_short_int(&xp, nget, value);
-#line 817
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 817
 			status = lstatus;
-#line 817
 
-#line 817
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 817
 
-#line 817
 		remaining -= extent;
-#line 817
 		if(remaining == 0)
-#line 817
 			break; /* normal loop exit */
-#line 817
 		offset += extent;
-#line 817
 		value += nget;
-#line 817
 	}
-#line 817
 
-#line 817
 	return status;
-#line 817
 }
-#line 817
 
 static int
-#line 818
 getNCvx_short_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 818
 		 const size_t *start, size_t nelems, float *value)
-#line 818
 {
-#line 818
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 818
 	size_t remaining = varp->xsz * nelems;
-#line 818
 	int status = NC_NOERR;
-#line 818
 	const void *xp;
-#line 818
 
-#line 818
 	if(nelems == 0)
-#line 818
 		return NC_NOERR;
-#line 818
 
-#line 818
 	assert(value != NULL);
-#line 818
 
-#line 818
 	for(;;)
-#line 818
 	{
-#line 818
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 818
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 818
 
-#line 818
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 818
 				 0, (void **)&xp);	/* cast away const */
-#line 818
 		if(lstatus != NC_NOERR)
-#line 818
 			return lstatus;
-#line 818
 		
-#line 818
 		lstatus = ncx_getn_short_float(&xp, nget, value);
-#line 818
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 818
 			status = lstatus;
-#line 818
 
-#line 818
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 818
 
-#line 818
 		remaining -= extent;
-#line 818
 		if(remaining == 0)
-#line 818
 			break; /* normal loop exit */
-#line 818
 		offset += extent;
-#line 818
 		value += nget;
-#line 818
 	}
-#line 818
 
-#line 818
 	return status;
-#line 818
 }
-#line 818
 
 static int
-#line 819
 getNCvx_short_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 819
 		 const size_t *start, size_t nelems, double *value)
-#line 819
 {
-#line 819
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 819
 	size_t remaining = varp->xsz * nelems;
-#line 819
 	int status = NC_NOERR;
-#line 819
 	const void *xp;
-#line 819
 
-#line 819
 	if(nelems == 0)
-#line 819
 		return NC_NOERR;
-#line 819
 
-#line 819
 	assert(value != NULL);
-#line 819
 
-#line 819
 	for(;;)
-#line 819
 	{
-#line 819
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 819
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 819
 
-#line 819
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 819
 				 0, (void **)&xp);	/* cast away const */
-#line 819
 		if(lstatus != NC_NOERR)
-#line 819
 			return lstatus;
-#line 819
 		
-#line 819
 		lstatus = ncx_getn_short_double(&xp, nget, value);
-#line 819
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 819
 			status = lstatus;
-#line 819
 
-#line 819
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 819
 
-#line 819
 		remaining -= extent;
-#line 819
 		if(remaining == 0)
-#line 819
 			break; /* normal loop exit */
-#line 819
 		offset += extent;
-#line 819
 		value += nget;
-#line 819
 	}
-#line 819
 
-#line 819
 	return status;
-#line 819
 }
-#line 819
 
 static int
-#line 820
 getNCvx_short_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 820
 		 const size_t *start, size_t nelems, longlong *value)
-#line 820
 {
-#line 820
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 820
 	size_t remaining = varp->xsz * nelems;
-#line 820
 	int status = NC_NOERR;
-#line 820
 	const void *xp;
-#line 820
 
-#line 820
 	if(nelems == 0)
-#line 820
 		return NC_NOERR;
-#line 820
 
-#line 820
 	assert(value != NULL);
-#line 820
 
-#line 820
 	for(;;)
-#line 820
 	{
-#line 820
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 820
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 820
 
-#line 820
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 820
 				 0, (void **)&xp);	/* cast away const */
-#line 820
 		if(lstatus != NC_NOERR)
-#line 820
 			return lstatus;
-#line 820
 		
-#line 820
 		lstatus = ncx_getn_short_longlong(&xp, nget, value);
-#line 820
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 820
 			status = lstatus;
-#line 820
 
-#line 820
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 820
 
-#line 820
 		remaining -= extent;
-#line 820
 		if(remaining == 0)
-#line 820
 			break; /* normal loop exit */
-#line 820
 		offset += extent;
-#line 820
 		value += nget;
-#line 820
 	}
-#line 820
 
-#line 820
 	return status;
-#line 820
 }
-#line 820
 
 static int
-#line 821
 getNCvx_short_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 821
 		 const size_t *start, size_t nelems, uint *value)
-#line 821
 {
-#line 821
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 821
 	size_t remaining = varp->xsz * nelems;
-#line 821
 	int status = NC_NOERR;
-#line 821
 	const void *xp;
-#line 821
 
-#line 821
 	if(nelems == 0)
-#line 821
 		return NC_NOERR;
-#line 821
 
-#line 821
 	assert(value != NULL);
-#line 821
 
-#line 821
 	for(;;)
-#line 821
 	{
-#line 821
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 821
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 821
 
-#line 821
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 821
 				 0, (void **)&xp);	/* cast away const */
-#line 821
 		if(lstatus != NC_NOERR)
-#line 821
 			return lstatus;
-#line 821
 		
-#line 821
 		lstatus = ncx_getn_short_uint(&xp, nget, value);
-#line 821
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 821
 			status = lstatus;
-#line 821
 
-#line 821
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 821
 
-#line 821
 		remaining -= extent;
-#line 821
 		if(remaining == 0)
-#line 821
 			break; /* normal loop exit */
-#line 821
 		offset += extent;
-#line 821
 		value += nget;
-#line 821
 	}
-#line 821
 
-#line 821
 	return status;
-#line 821
 }
-#line 821
 
 static int
-#line 822
 getNCvx_short_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 822
 		 const size_t *start, size_t nelems, ulonglong *value)
-#line 822
 {
-#line 822
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 822
 	size_t remaining = varp->xsz * nelems;
-#line 822
 	int status = NC_NOERR;
-#line 822
 	const void *xp;
-#line 822
 
-#line 822
 	if(nelems == 0)
-#line 822
 		return NC_NOERR;
-#line 822
 
-#line 822
 	assert(value != NULL);
-#line 822
 
-#line 822
 	for(;;)
-#line 822
 	{
-#line 822
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 822
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 822
 
-#line 822
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 822
 				 0, (void **)&xp);	/* cast away const */
-#line 822
 		if(lstatus != NC_NOERR)
-#line 822
 			return lstatus;
-#line 822
 		
-#line 822
 		lstatus = ncx_getn_short_ulonglong(&xp, nget, value);
-#line 822
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 822
 			status = lstatus;
-#line 822
 
-#line 822
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 822
 
-#line 822
 		remaining -= extent;
-#line 822
 		if(remaining == 0)
-#line 822
 			break; /* normal loop exit */
-#line 822
 		offset += extent;
-#line 822
 		value += nget;
-#line 822
 	}
-#line 822
 
-#line 822
 	return status;
-#line 822
 }
-#line 822
 
 
 static int
-#line 824
 getNCvx_int_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 824
 		 const size_t *start, size_t nelems, schar *value)
-#line 824
 {
-#line 824
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 824
 	size_t remaining = varp->xsz * nelems;
-#line 824
 	int status = NC_NOERR;
-#line 824
 	const void *xp;
-#line 824
 
-#line 824
 	if(nelems == 0)
-#line 824
 		return NC_NOERR;
-#line 824
 
-#line 824
 	assert(value != NULL);
-#line 824
 
-#line 824
 	for(;;)
-#line 824
 	{
-#line 824
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 824
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 824
 
-#line 824
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 824
 				 0, (void **)&xp);	/* cast away const */
-#line 824
 		if(lstatus != NC_NOERR)
-#line 824
 			return lstatus;
-#line 824
 		
-#line 824
 		lstatus = ncx_getn_int_schar(&xp, nget, value);
-#line 824
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 824
 			status = lstatus;
-#line 824
 
-#line 824
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 824
 
-#line 824
 		remaining -= extent;
-#line 824
 		if(remaining == 0)
-#line 824
 			break; /* normal loop exit */
-#line 824
 		offset += extent;
-#line 824
 		value += nget;
-#line 824
 	}
-#line 824
 
-#line 824
 	return status;
-#line 824
 }
-#line 824
 
 static int
-#line 825
 getNCvx_int_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 825
 		 const size_t *start, size_t nelems, uchar *value)
-#line 825
 {
-#line 825
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 825
 	size_t remaining = varp->xsz * nelems;
-#line 825
 	int status = NC_NOERR;
-#line 825
 	const void *xp;
-#line 825
 
-#line 825
 	if(nelems == 0)
-#line 825
 		return NC_NOERR;
-#line 825
 
-#line 825
 	assert(value != NULL);
-#line 825
 
-#line 825
 	for(;;)
-#line 825
 	{
-#line 825
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 825
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 825
 
-#line 825
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 825
 				 0, (void **)&xp);	/* cast away const */
-#line 825
 		if(lstatus != NC_NOERR)
-#line 825
 			return lstatus;
-#line 825
 		
-#line 825
 		lstatus = ncx_getn_int_uchar(&xp, nget, value);
-#line 825
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 825
 			status = lstatus;
-#line 825
 
-#line 825
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 825
 
-#line 825
 		remaining -= extent;
-#line 825
 		if(remaining == 0)
-#line 825
 			break; /* normal loop exit */
-#line 825
 		offset += extent;
-#line 825
 		value += nget;
-#line 825
 	}
-#line 825
 
-#line 825
 	return status;
-#line 825
 }
-#line 825
 
 static int
-#line 826
 getNCvx_int_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 826
 		 const size_t *start, size_t nelems, short *value)
-#line 826
 {
-#line 826
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 826
 	size_t remaining = varp->xsz * nelems;
-#line 826
 	int status = NC_NOERR;
-#line 826
 	const void *xp;
-#line 826
 
-#line 826
 	if(nelems == 0)
-#line 826
 		return NC_NOERR;
-#line 826
 
-#line 826
 	assert(value != NULL);
-#line 826
 
-#line 826
 	for(;;)
-#line 826
 	{
-#line 826
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 826
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 826
 
-#line 826
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 826
 				 0, (void **)&xp);	/* cast away const */
-#line 826
 		if(lstatus != NC_NOERR)
-#line 826
 			return lstatus;
-#line 826
 		
-#line 826
 		lstatus = ncx_getn_int_short(&xp, nget, value);
-#line 826
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 826
 			status = lstatus;
-#line 826
 
-#line 826
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 826
 
-#line 826
 		remaining -= extent;
-#line 826
 		if(remaining == 0)
-#line 826
 			break; /* normal loop exit */
-#line 826
 		offset += extent;
-#line 826
 		value += nget;
-#line 826
 	}
-#line 826
 
-#line 826
 	return status;
-#line 826
 }
-#line 826
 
 static int
-#line 827
 getNCvx_int_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 827
 		 const size_t *start, size_t nelems, int *value)
-#line 827
 {
-#line 827
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 827
 	size_t remaining = varp->xsz * nelems;
-#line 827
 	int status = NC_NOERR;
-#line 827
 	const void *xp;
-#line 827
 
-#line 827
 	if(nelems == 0)
-#line 827
 		return NC_NOERR;
-#line 827
 
-#line 827
 	assert(value != NULL);
-#line 827
 
-#line 827
 	for(;;)
-#line 827
 	{
-#line 827
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 827
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 827
 
-#line 827
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 827
 				 0, (void **)&xp);	/* cast away const */
-#line 827
 		if(lstatus != NC_NOERR)
-#line 827
 			return lstatus;
-#line 827
 		
-#line 827
 		lstatus = ncx_getn_int_int(&xp, nget, value);
-#line 827
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 827
 			status = lstatus;
-#line 827
 
-#line 827
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 827
 
-#line 827
 		remaining -= extent;
-#line 827
 		if(remaining == 0)
-#line 827
 			break; /* normal loop exit */
-#line 827
 		offset += extent;
-#line 827
 		value += nget;
-#line 827
 	}
-#line 827
 
-#line 827
 	return status;
-#line 827
 }
-#line 827
 
 static int
-#line 828
 getNCvx_int_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 828
 		 const size_t *start, size_t nelems, float *value)
-#line 828
 {
-#line 828
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 828
 	size_t remaining = varp->xsz * nelems;
-#line 828
 	int status = NC_NOERR;
-#line 828
 	const void *xp;
-#line 828
 
-#line 828
 	if(nelems == 0)
-#line 828
 		return NC_NOERR;
-#line 828
 
-#line 828
 	assert(value != NULL);
-#line 828
 
-#line 828
 	for(;;)
-#line 828
 	{
-#line 828
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 828
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 828
 
-#line 828
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 828
 				 0, (void **)&xp);	/* cast away const */
-#line 828
 		if(lstatus != NC_NOERR)
-#line 828
 			return lstatus;
-#line 828
 		
-#line 828
 		lstatus = ncx_getn_int_float(&xp, nget, value);
-#line 828
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 828
 			status = lstatus;
-#line 828
 
-#line 828
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 828
 
-#line 828
 		remaining -= extent;
-#line 828
 		if(remaining == 0)
-#line 828
 			break; /* normal loop exit */
-#line 828
 		offset += extent;
-#line 828
 		value += nget;
-#line 828
 	}
-#line 828
 
-#line 828
 	return status;
-#line 828
 }
-#line 828
 
 static int
-#line 829
 getNCvx_int_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 829
 		 const size_t *start, size_t nelems, double *value)
-#line 829
 {
-#line 829
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 829
 	size_t remaining = varp->xsz * nelems;
-#line 829
 	int status = NC_NOERR;
-#line 829
 	const void *xp;
-#line 829
 
-#line 829
 	if(nelems == 0)
-#line 829
 		return NC_NOERR;
-#line 829
 
-#line 829
 	assert(value != NULL);
-#line 829
 
-#line 829
 	for(;;)
-#line 829
 	{
-#line 829
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 829
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 829
 
-#line 829
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 829
 				 0, (void **)&xp);	/* cast away const */
-#line 829
 		if(lstatus != NC_NOERR)
-#line 829
 			return lstatus;
-#line 829
 		
-#line 829
 		lstatus = ncx_getn_int_double(&xp, nget, value);
-#line 829
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 829
 			status = lstatus;
-#line 829
 
-#line 829
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 829
 
-#line 829
 		remaining -= extent;
-#line 829
 		if(remaining == 0)
-#line 829
 			break; /* normal loop exit */
-#line 829
 		offset += extent;
-#line 829
 		value += nget;
-#line 829
 	}
-#line 829
 
-#line 829
 	return status;
-#line 829
 }
-#line 829
 
 static int
-#line 830
 getNCvx_int_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 830
 		 const size_t *start, size_t nelems, longlong *value)
-#line 830
 {
-#line 830
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 830
 	size_t remaining = varp->xsz * nelems;
-#line 830
 	int status = NC_NOERR;
-#line 830
 	const void *xp;
-#line 830
 
-#line 830
 	if(nelems == 0)
-#line 830
 		return NC_NOERR;
-#line 830
 
-#line 830
 	assert(value != NULL);
-#line 830
 
-#line 830
 	for(;;)
-#line 830
 	{
-#line 830
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 830
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 830
 
-#line 830
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 830
 				 0, (void **)&xp);	/* cast away const */
-#line 830
 		if(lstatus != NC_NOERR)
-#line 830
 			return lstatus;
-#line 830
 		
-#line 830
 		lstatus = ncx_getn_int_longlong(&xp, nget, value);
-#line 830
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 830
 			status = lstatus;
-#line 830
 
-#line 830
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 830
 
-#line 830
 		remaining -= extent;
-#line 830
 		if(remaining == 0)
-#line 830
 			break; /* normal loop exit */
-#line 830
 		offset += extent;
-#line 830
 		value += nget;
-#line 830
 	}
-#line 830
 
-#line 830
 	return status;
-#line 830
 }
-#line 830
 
 static int
-#line 831
 getNCvx_int_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 831
 		 const size_t *start, size_t nelems, uint *value)
-#line 831
 {
-#line 831
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 831
 	size_t remaining = varp->xsz * nelems;
-#line 831
 	int status = NC_NOERR;
-#line 831
 	const void *xp;
-#line 831
 
-#line 831
 	if(nelems == 0)
-#line 831
 		return NC_NOERR;
-#line 831
 
-#line 831
 	assert(value != NULL);
-#line 831
 
-#line 831
 	for(;;)
-#line 831
 	{
-#line 831
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 831
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 831
 
-#line 831
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 831
 				 0, (void **)&xp);	/* cast away const */
-#line 831
 		if(lstatus != NC_NOERR)
-#line 831
 			return lstatus;
-#line 831
 		
-#line 831
 		lstatus = ncx_getn_int_uint(&xp, nget, value);
-#line 831
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 831
 			status = lstatus;
-#line 831
 
-#line 831
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 831
 
-#line 831
 		remaining -= extent;
-#line 831
 		if(remaining == 0)
-#line 831
 			break; /* normal loop exit */
-#line 831
 		offset += extent;
-#line 831
 		value += nget;
-#line 831
 	}
-#line 831
 
-#line 831
 	return status;
-#line 831
 }
-#line 831
 
 static int
-#line 832
 getNCvx_int_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 832
 		 const size_t *start, size_t nelems, ulonglong *value)
-#line 832
 {
-#line 832
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 832
 	size_t remaining = varp->xsz * nelems;
-#line 832
 	int status = NC_NOERR;
-#line 832
 	const void *xp;
-#line 832
 
-#line 832
 	if(nelems == 0)
-#line 832
 		return NC_NOERR;
-#line 832
 
-#line 832
 	assert(value != NULL);
-#line 832
 
-#line 832
 	for(;;)
-#line 832
 	{
-#line 832
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 832
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 832
 
-#line 832
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 832
 				 0, (void **)&xp);	/* cast away const */
-#line 832
 		if(lstatus != NC_NOERR)
-#line 832
 			return lstatus;
-#line 832
 		
-#line 832
 		lstatus = ncx_getn_int_ulonglong(&xp, nget, value);
-#line 832
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 832
 			status = lstatus;
-#line 832
 
-#line 832
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 832
 
-#line 832
 		remaining -= extent;
-#line 832
 		if(remaining == 0)
-#line 832
 			break; /* normal loop exit */
-#line 832
 		offset += extent;
-#line 832
 		value += nget;
-#line 832
 	}
-#line 832
 
-#line 832
 	return status;
-#line 832
 }
-#line 832
 
 
 static int
-#line 834
 getNCvx_float_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 834
 		 const size_t *start, size_t nelems, schar *value)
-#line 834
 {
-#line 834
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 834
 	size_t remaining = varp->xsz * nelems;
-#line 834
 	int status = NC_NOERR;
-#line 834
 	const void *xp;
-#line 834
 
-#line 834
 	if(nelems == 0)
-#line 834
 		return NC_NOERR;
-#line 834
 
-#line 834
 	assert(value != NULL);
-#line 834
 
-#line 834
 	for(;;)
-#line 834
 	{
-#line 834
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 834
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 834
 
-#line 834
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 834
 				 0, (void **)&xp);	/* cast away const */
-#line 834
 		if(lstatus != NC_NOERR)
-#line 834
 			return lstatus;
-#line 834
 		
-#line 834
 		lstatus = ncx_getn_float_schar(&xp, nget, value);
-#line 834
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 834
 			status = lstatus;
-#line 834
 
-#line 834
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 834
 
-#line 834
 		remaining -= extent;
-#line 834
 		if(remaining == 0)
-#line 834
 			break; /* normal loop exit */
-#line 834
 		offset += extent;
-#line 834
 		value += nget;
-#line 834
 	}
-#line 834
 
-#line 834
 	return status;
-#line 834
 }
-#line 834
 
 static int
-#line 835
 getNCvx_float_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 835
 		 const size_t *start, size_t nelems, uchar *value)
-#line 835
 {
-#line 835
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 835
 	size_t remaining = varp->xsz * nelems;
-#line 835
 	int status = NC_NOERR;
-#line 835
 	const void *xp;
-#line 835
 
-#line 835
 	if(nelems == 0)
-#line 835
 		return NC_NOERR;
-#line 835
 
-#line 835
 	assert(value != NULL);
-#line 835
 
-#line 835
 	for(;;)
-#line 835
 	{
-#line 835
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 835
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 835
 
-#line 835
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 835
 				 0, (void **)&xp);	/* cast away const */
-#line 835
 		if(lstatus != NC_NOERR)
-#line 835
 			return lstatus;
-#line 835
 		
-#line 835
 		lstatus = ncx_getn_float_uchar(&xp, nget, value);
-#line 835
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 835
 			status = lstatus;
-#line 835
 
-#line 835
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 835
 
-#line 835
 		remaining -= extent;
-#line 835
 		if(remaining == 0)
-#line 835
 			break; /* normal loop exit */
-#line 835
 		offset += extent;
-#line 835
 		value += nget;
-#line 835
 	}
-#line 835
 
-#line 835
 	return status;
-#line 835
 }
-#line 835
 
 static int
-#line 836
 getNCvx_float_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 836
 		 const size_t *start, size_t nelems, short *value)
-#line 836
 {
-#line 836
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 836
 	size_t remaining = varp->xsz * nelems;
-#line 836
 	int status = NC_NOERR;
-#line 836
 	const void *xp;
-#line 836
 
-#line 836
 	if(nelems == 0)
-#line 836
 		return NC_NOERR;
-#line 836
 
-#line 836
 	assert(value != NULL);
-#line 836
 
-#line 836
 	for(;;)
-#line 836
 	{
-#line 836
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 836
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 836
 
-#line 836
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 836
 				 0, (void **)&xp);	/* cast away const */
-#line 836
 		if(lstatus != NC_NOERR)
-#line 836
 			return lstatus;
-#line 836
 		
-#line 836
 		lstatus = ncx_getn_float_short(&xp, nget, value);
-#line 836
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 836
 			status = lstatus;
-#line 836
 
-#line 836
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 836
 
-#line 836
 		remaining -= extent;
-#line 836
 		if(remaining == 0)
-#line 836
 			break; /* normal loop exit */
-#line 836
 		offset += extent;
-#line 836
 		value += nget;
-#line 836
 	}
-#line 836
 
-#line 836
 	return status;
-#line 836
 }
-#line 836
 
 static int
-#line 837
 getNCvx_float_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 837
 		 const size_t *start, size_t nelems, int *value)
-#line 837
 {
-#line 837
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 837
 	size_t remaining = varp->xsz * nelems;
-#line 837
 	int status = NC_NOERR;
-#line 837
 	const void *xp;
-#line 837
 
-#line 837
 	if(nelems == 0)
-#line 837
 		return NC_NOERR;
-#line 837
 
-#line 837
 	assert(value != NULL);
-#line 837
 
-#line 837
 	for(;;)
-#line 837
 	{
-#line 837
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 837
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 837
 
-#line 837
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 837
 				 0, (void **)&xp);	/* cast away const */
-#line 837
 		if(lstatus != NC_NOERR)
-#line 837
 			return lstatus;
-#line 837
 		
-#line 837
 		lstatus = ncx_getn_float_int(&xp, nget, value);
-#line 837
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 837
 			status = lstatus;
-#line 837
 
-#line 837
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 837
 
-#line 837
 		remaining -= extent;
-#line 837
 		if(remaining == 0)
-#line 837
 			break; /* normal loop exit */
-#line 837
 		offset += extent;
-#line 837
 		value += nget;
-#line 837
 	}
-#line 837
 
-#line 837
 	return status;
-#line 837
 }
-#line 837
 
 static int
-#line 838
 getNCvx_float_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 838
 		 const size_t *start, size_t nelems, float *value)
-#line 838
 {
-#line 838
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 838
 	size_t remaining = varp->xsz * nelems;
-#line 838
 	int status = NC_NOERR;
-#line 838
 	const void *xp;
-#line 838
 
-#line 838
 	if(nelems == 0)
-#line 838
 		return NC_NOERR;
-#line 838
 
-#line 838
 	assert(value != NULL);
-#line 838
 
-#line 838
 	for(;;)
-#line 838
 	{
-#line 838
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 838
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 838
 
-#line 838
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 838
 				 0, (void **)&xp);	/* cast away const */
-#line 838
 		if(lstatus != NC_NOERR)
-#line 838
 			return lstatus;
-#line 838
 		
-#line 838
 		lstatus = ncx_getn_float_float(&xp, nget, value);
-#line 838
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 838
 			status = lstatus;
-#line 838
 
-#line 838
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 838
 
-#line 838
 		remaining -= extent;
-#line 838
 		if(remaining == 0)
-#line 838
 			break; /* normal loop exit */
-#line 838
 		offset += extent;
-#line 838
 		value += nget;
-#line 838
 	}
-#line 838
 
-#line 838
 	return status;
-#line 838
 }
-#line 838
 
 static int
-#line 839
 getNCvx_float_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 839
 		 const size_t *start, size_t nelems, double *value)
-#line 839
 {
-#line 839
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 839
 	size_t remaining = varp->xsz * nelems;
-#line 839
 	int status = NC_NOERR;
-#line 839
 	const void *xp;
-#line 839
 
-#line 839
 	if(nelems == 0)
-#line 839
 		return NC_NOERR;
-#line 839
 
-#line 839
 	assert(value != NULL);
-#line 839
 
-#line 839
 	for(;;)
-#line 839
 	{
-#line 839
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 839
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 839
 
-#line 839
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 839
 				 0, (void **)&xp);	/* cast away const */
-#line 839
 		if(lstatus != NC_NOERR)
-#line 839
 			return lstatus;
-#line 839
 		
-#line 839
 		lstatus = ncx_getn_float_double(&xp, nget, value);
-#line 839
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 839
 			status = lstatus;
-#line 839
 
-#line 839
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 839
 
-#line 839
 		remaining -= extent;
-#line 839
 		if(remaining == 0)
-#line 839
 			break; /* normal loop exit */
-#line 839
 		offset += extent;
-#line 839
 		value += nget;
-#line 839
 	}
-#line 839
 
-#line 839
 	return status;
-#line 839
 }
-#line 839
 
 static int
-#line 840
 getNCvx_float_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 840
 		 const size_t *start, size_t nelems, longlong *value)
-#line 840
 {
-#line 840
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 840
 	size_t remaining = varp->xsz * nelems;
-#line 840
 	int status = NC_NOERR;
-#line 840
 	const void *xp;
-#line 840
 
-#line 840
 	if(nelems == 0)
-#line 840
 		return NC_NOERR;
-#line 840
 
-#line 840
 	assert(value != NULL);
-#line 840
 
-#line 840
 	for(;;)
-#line 840
 	{
-#line 840
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 840
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 840
 
-#line 840
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 840
 				 0, (void **)&xp);	/* cast away const */
-#line 840
 		if(lstatus != NC_NOERR)
-#line 840
 			return lstatus;
-#line 840
 		
-#line 840
 		lstatus = ncx_getn_float_longlong(&xp, nget, value);
-#line 840
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 840
 			status = lstatus;
-#line 840
 
-#line 840
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 840
 
-#line 840
 		remaining -= extent;
-#line 840
 		if(remaining == 0)
-#line 840
 			break; /* normal loop exit */
-#line 840
 		offset += extent;
-#line 840
 		value += nget;
-#line 840
 	}
-#line 840
 
-#line 840
 	return status;
-#line 840
 }
-#line 840
 
 static int
-#line 841
 getNCvx_float_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 841
 		 const size_t *start, size_t nelems, uint *value)
-#line 841
 {
-#line 841
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 841
 	size_t remaining = varp->xsz * nelems;
-#line 841
 	int status = NC_NOERR;
-#line 841
 	const void *xp;
-#line 841
 
-#line 841
 	if(nelems == 0)
-#line 841
 		return NC_NOERR;
-#line 841
 
-#line 841
 	assert(value != NULL);
-#line 841
 
-#line 841
 	for(;;)
-#line 841
 	{
-#line 841
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 841
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 841
 
-#line 841
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 841
 				 0, (void **)&xp);	/* cast away const */
-#line 841
 		if(lstatus != NC_NOERR)
-#line 841
 			return lstatus;
-#line 841
 		
-#line 841
 		lstatus = ncx_getn_float_uint(&xp, nget, value);
-#line 841
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 841
 			status = lstatus;
-#line 841
 
-#line 841
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 841
 
-#line 841
 		remaining -= extent;
-#line 841
 		if(remaining == 0)
-#line 841
 			break; /* normal loop exit */
-#line 841
 		offset += extent;
-#line 841
 		value += nget;
-#line 841
 	}
-#line 841
 
-#line 841
 	return status;
-#line 841
 }
-#line 841
 
 static int
-#line 842
 getNCvx_float_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 842
 		 const size_t *start, size_t nelems, ulonglong *value)
-#line 842
 {
-#line 842
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 842
 	size_t remaining = varp->xsz * nelems;
-#line 842
 	int status = NC_NOERR;
-#line 842
 	const void *xp;
-#line 842
 
-#line 842
 	if(nelems == 0)
-#line 842
 		return NC_NOERR;
-#line 842
 
-#line 842
 	assert(value != NULL);
-#line 842
 
-#line 842
 	for(;;)
-#line 842
 	{
-#line 842
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 842
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 842
 
-#line 842
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 842
 				 0, (void **)&xp);	/* cast away const */
-#line 842
 		if(lstatus != NC_NOERR)
-#line 842
 			return lstatus;
-#line 842
 		
-#line 842
 		lstatus = ncx_getn_float_ulonglong(&xp, nget, value);
-#line 842
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 842
 			status = lstatus;
-#line 842
 
-#line 842
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 842
 
-#line 842
 		remaining -= extent;
-#line 842
 		if(remaining == 0)
-#line 842
 			break; /* normal loop exit */
-#line 842
 		offset += extent;
-#line 842
 		value += nget;
-#line 842
 	}
-#line 842
 
-#line 842
 	return status;
-#line 842
 }
-#line 842
 
 
 static int
-#line 844
 getNCvx_double_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 844
 		 const size_t *start, size_t nelems, schar *value)
-#line 844
 {
-#line 844
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 844
 	size_t remaining = varp->xsz * nelems;
-#line 844
 	int status = NC_NOERR;
-#line 844
 	const void *xp;
-#line 844
 
-#line 844
 	if(nelems == 0)
-#line 844
 		return NC_NOERR;
-#line 844
 
-#line 844
 	assert(value != NULL);
-#line 844
 
-#line 844
 	for(;;)
-#line 844
 	{
-#line 844
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 844
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 844
 
-#line 844
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 844
 				 0, (void **)&xp);	/* cast away const */
-#line 844
 		if(lstatus != NC_NOERR)
-#line 844
 			return lstatus;
-#line 844
 		
-#line 844
 		lstatus = ncx_getn_double_schar(&xp, nget, value);
-#line 844
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 844
 			status = lstatus;
-#line 844
 
-#line 844
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 844
 
-#line 844
 		remaining -= extent;
-#line 844
 		if(remaining == 0)
-#line 844
 			break; /* normal loop exit */
-#line 844
 		offset += extent;
-#line 844
 		value += nget;
-#line 844
 	}
-#line 844
 
-#line 844
 	return status;
-#line 844
 }
-#line 844
 
 static int
-#line 845
 getNCvx_double_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 845
 		 const size_t *start, size_t nelems, uchar *value)
-#line 845
 {
-#line 845
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 845
 	size_t remaining = varp->xsz * nelems;
-#line 845
 	int status = NC_NOERR;
-#line 845
 	const void *xp;
-#line 845
 
-#line 845
 	if(nelems == 0)
-#line 845
 		return NC_NOERR;
-#line 845
 
-#line 845
 	assert(value != NULL);
-#line 845
 
-#line 845
 	for(;;)
-#line 845
 	{
-#line 845
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 845
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 845
 
-#line 845
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 845
 				 0, (void **)&xp);	/* cast away const */
-#line 845
 		if(lstatus != NC_NOERR)
-#line 845
 			return lstatus;
-#line 845
 		
-#line 845
 		lstatus = ncx_getn_double_uchar(&xp, nget, value);
-#line 845
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 845
 			status = lstatus;
-#line 845
 
-#line 845
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 845
 
-#line 845
 		remaining -= extent;
-#line 845
 		if(remaining == 0)
-#line 845
 			break; /* normal loop exit */
-#line 845
 		offset += extent;
-#line 845
 		value += nget;
-#line 845
 	}
-#line 845
 
-#line 845
 	return status;
-#line 845
 }
-#line 845
 
 static int
-#line 846
 getNCvx_double_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 846
 		 const size_t *start, size_t nelems, short *value)
-#line 846
 {
-#line 846
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 846
 	size_t remaining = varp->xsz * nelems;
-#line 846
 	int status = NC_NOERR;
-#line 846
 	const void *xp;
-#line 846
 
-#line 846
 	if(nelems == 0)
-#line 846
 		return NC_NOERR;
-#line 846
 
-#line 846
 	assert(value != NULL);
-#line 846
 
-#line 846
 	for(;;)
-#line 846
 	{
-#line 846
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 846
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 846
 
-#line 846
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 846
 				 0, (void **)&xp);	/* cast away const */
-#line 846
 		if(lstatus != NC_NOERR)
-#line 846
 			return lstatus;
-#line 846
 		
-#line 846
 		lstatus = ncx_getn_double_short(&xp, nget, value);
-#line 846
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 846
 			status = lstatus;
-#line 846
 
-#line 846
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 846
 
-#line 846
 		remaining -= extent;
-#line 846
 		if(remaining == 0)
-#line 846
 			break; /* normal loop exit */
-#line 846
 		offset += extent;
-#line 846
 		value += nget;
-#line 846
 	}
-#line 846
 
-#line 846
 	return status;
-#line 846
 }
-#line 846
 
 static int
-#line 847
 getNCvx_double_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 847
 		 const size_t *start, size_t nelems, int *value)
-#line 847
 {
-#line 847
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 847
 	size_t remaining = varp->xsz * nelems;
-#line 847
 	int status = NC_NOERR;
-#line 847
 	const void *xp;
-#line 847
 
-#line 847
 	if(nelems == 0)
-#line 847
 		return NC_NOERR;
-#line 847
 
-#line 847
 	assert(value != NULL);
-#line 847
 
-#line 847
 	for(;;)
-#line 847
 	{
-#line 847
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 847
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 847
 
-#line 847
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 847
 				 0, (void **)&xp);	/* cast away const */
-#line 847
 		if(lstatus != NC_NOERR)
-#line 847
 			return lstatus;
-#line 847
 		
-#line 847
 		lstatus = ncx_getn_double_int(&xp, nget, value);
-#line 847
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 847
 			status = lstatus;
-#line 847
 
-#line 847
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 847
 
-#line 847
 		remaining -= extent;
-#line 847
 		if(remaining == 0)
-#line 847
 			break; /* normal loop exit */
-#line 847
 		offset += extent;
-#line 847
 		value += nget;
-#line 847
 	}
-#line 847
 
-#line 847
 	return status;
-#line 847
 }
-#line 847
 
 static int
-#line 848
 getNCvx_double_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 848
 		 const size_t *start, size_t nelems, float *value)
-#line 848
 {
-#line 848
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 848
 	size_t remaining = varp->xsz * nelems;
-#line 848
 	int status = NC_NOERR;
-#line 848
 	const void *xp;
-#line 848
 
-#line 848
 	if(nelems == 0)
-#line 848
 		return NC_NOERR;
-#line 848
 
-#line 848
 	assert(value != NULL);
-#line 848
 
-#line 848
 	for(;;)
-#line 848
 	{
-#line 848
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 848
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 848
 
-#line 848
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 848
 				 0, (void **)&xp);	/* cast away const */
-#line 848
 		if(lstatus != NC_NOERR)
-#line 848
 			return lstatus;
-#line 848
 		
-#line 848
 		lstatus = ncx_getn_double_float(&xp, nget, value);
-#line 848
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 848
 			status = lstatus;
-#line 848
 
-#line 848
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 848
 
-#line 848
 		remaining -= extent;
-#line 848
 		if(remaining == 0)
-#line 848
 			break; /* normal loop exit */
-#line 848
 		offset += extent;
-#line 848
 		value += nget;
-#line 848
 	}
-#line 848
 
-#line 848
 	return status;
-#line 848
 }
-#line 848
 
 static int
-#line 849
 getNCvx_double_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 849
 		 const size_t *start, size_t nelems, double *value)
-#line 849
 {
-#line 849
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 849
 	size_t remaining = varp->xsz * nelems;
-#line 849
 	int status = NC_NOERR;
-#line 849
 	const void *xp;
-#line 849
 
-#line 849
 	if(nelems == 0)
-#line 849
 		return NC_NOERR;
-#line 849
 
-#line 849
 	assert(value != NULL);
-#line 849
 
-#line 849
 	for(;;)
-#line 849
 	{
-#line 849
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 849
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 849
 
-#line 849
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 849
 				 0, (void **)&xp);	/* cast away const */
-#line 849
 		if(lstatus != NC_NOERR)
-#line 849
 			return lstatus;
-#line 849
 		
-#line 849
 		lstatus = ncx_getn_double_double(&xp, nget, value);
-#line 849
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 849
 			status = lstatus;
-#line 849
 
-#line 849
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 849
 
-#line 849
 		remaining -= extent;
-#line 849
 		if(remaining == 0)
-#line 849
 			break; /* normal loop exit */
-#line 849
 		offset += extent;
-#line 849
 		value += nget;
-#line 849
 	}
-#line 849
 
-#line 849
 	return status;
-#line 849
 }
-#line 849
 
 static int
-#line 850
 getNCvx_double_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 850
 		 const size_t *start, size_t nelems, longlong *value)
-#line 850
 {
-#line 850
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 850
 	size_t remaining = varp->xsz * nelems;
-#line 850
 	int status = NC_NOERR;
-#line 850
 	const void *xp;
-#line 850
 
-#line 850
 	if(nelems == 0)
-#line 850
 		return NC_NOERR;
-#line 850
 
-#line 850
 	assert(value != NULL);
-#line 850
 
-#line 850
 	for(;;)
-#line 850
 	{
-#line 850
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 850
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 850
 
-#line 850
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 850
 				 0, (void **)&xp);	/* cast away const */
-#line 850
 		if(lstatus != NC_NOERR)
-#line 850
 			return lstatus;
-#line 850
 		
-#line 850
 		lstatus = ncx_getn_double_longlong(&xp, nget, value);
-#line 850
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 850
 			status = lstatus;
-#line 850
 
-#line 850
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 850
 
-#line 850
 		remaining -= extent;
-#line 850
 		if(remaining == 0)
-#line 850
 			break; /* normal loop exit */
-#line 850
 		offset += extent;
-#line 850
 		value += nget;
-#line 850
 	}
-#line 850
 
-#line 850
 	return status;
-#line 850
 }
-#line 850
 
 static int
-#line 851
 getNCvx_double_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 851
 		 const size_t *start, size_t nelems, uint *value)
-#line 851
 {
-#line 851
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 851
 	size_t remaining = varp->xsz * nelems;
-#line 851
 	int status = NC_NOERR;
-#line 851
 	const void *xp;
-#line 851
 
-#line 851
 	if(nelems == 0)
-#line 851
 		return NC_NOERR;
-#line 851
 
-#line 851
 	assert(value != NULL);
-#line 851
 
-#line 851
 	for(;;)
-#line 851
 	{
-#line 851
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 851
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 851
 
-#line 851
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 851
 				 0, (void **)&xp);	/* cast away const */
-#line 851
 		if(lstatus != NC_NOERR)
-#line 851
 			return lstatus;
-#line 851
 		
-#line 851
 		lstatus = ncx_getn_double_uint(&xp, nget, value);
-#line 851
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 851
 			status = lstatus;
-#line 851
 
-#line 851
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 851
 
-#line 851
 		remaining -= extent;
-#line 851
 		if(remaining == 0)
-#line 851
 			break; /* normal loop exit */
-#line 851
 		offset += extent;
-#line 851
 		value += nget;
-#line 851
 	}
-#line 851
 
-#line 851
 	return status;
-#line 851
 }
-#line 851
 
 static int
-#line 852
 getNCvx_double_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 852
 		 const size_t *start, size_t nelems, ulonglong *value)
-#line 852
 {
-#line 852
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 852
 	size_t remaining = varp->xsz * nelems;
-#line 852
 	int status = NC_NOERR;
-#line 852
 	const void *xp;
-#line 852
 
-#line 852
 	if(nelems == 0)
-#line 852
 		return NC_NOERR;
-#line 852
 
-#line 852
 	assert(value != NULL);
-#line 852
 
-#line 852
 	for(;;)
-#line 852
 	{
-#line 852
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 852
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 852
 
-#line 852
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 852
 				 0, (void **)&xp);	/* cast away const */
-#line 852
 		if(lstatus != NC_NOERR)
-#line 852
 			return lstatus;
-#line 852
 		
-#line 852
 		lstatus = ncx_getn_double_ulonglong(&xp, nget, value);
-#line 852
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 852
 			status = lstatus;
-#line 852
 
-#line 852
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 852
 
-#line 852
 		remaining -= extent;
-#line 852
 		if(remaining == 0)
-#line 852
 			break; /* normal loop exit */
-#line 852
 		offset += extent;
-#line 852
 		value += nget;
-#line 852
 	}
-#line 852
 
-#line 852
 	return status;
-#line 852
 }
-#line 852
 
 
-#line 855
 #ifdef NOTUSED
 static int
-#line 856
 getNCvx_schar_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 856
 		 const size_t *start, size_t nelems, uchar *value)
-#line 856
 {
-#line 856
 	off_t offset = NC_varoffset(ncp, varp, start);
-#line 856
 	size_t remaining = varp->xsz * nelems;
-#line 856
 	int status = NC_NOERR;
-#line 856
 	const void *xp;
-#line 856
 
-#line 856
 	if(nelems == 0)
-#line 856
 		return NC_NOERR;
-#line 856
 
-#line 856
 	assert(value != NULL);
-#line 856
 
-#line 856
 	for(;;)
-#line 856
 	{
-#line 856
 		size_t extent = MIN(remaining, ncp->chunk);
-#line 856
 		size_t nget = ncx_howmany(varp->type, extent);
-#line 856
 
-#line 856
 		int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 856
 				 0, (void **)&xp);	/* cast away const */
-#line 856
 		if(lstatus != NC_NOERR)
-#line 856
 			return lstatus;
-#line 856
 		
-#line 856
 		lstatus = ncx_getn_schar_uchar(&xp, nget, value);
-#line 856
 		if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 856
 			status = lstatus;
-#line 856
 
-#line 856
 		(void) ncio_rel(ncp->nciop, offset, 0);	
-#line 856
 
-#line 856
 		remaining -= extent;
-#line 856
 		if(remaining == 0)
-#line 856
 			break; /* normal loop exit */
-#line 856
 		offset += extent;
-#line 856
 		value += nget;
-#line 856
 	}
-#line 856
 
-#line 856
 	return status;
-#line 856
 }
-#line 856
 
 #endif /*NOTUSED*/
 
@@ -8772,7 +4814,6 @@ odo1(const size_t *const start, const size_t *const upper,
 #endif
 
 
-#line 1018
 
 /* Define a macro to allow hash on two type values */
 #define CASE(nc1,nc2) (nc1*256+nc2)
diff --git a/libsrc/winceio.c b/libsrc/winceio.c
index 56fcf1c..0dda5b9 100644
--- a/libsrc/winceio.c
+++ b/libsrc/winceio.c
@@ -475,6 +475,7 @@ int
 ncio_create(const char *path, int ioflags,
 	size_t initialsz,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+	void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
@@ -576,6 +577,7 @@ int
 ncio_open(const char *path,
 	int ioflags,
 	off_t igeto, size_t igetsz, size_t *sizehintp,
+	void* parameters,
 	ncio **nciopp, void **const igetvpp)
 {
 	ncio *nciop;
diff --git a/libsrc4/Makefile.in b/libsrc4/Makefile.in
index 8e05e24..3e95b86 100644
--- a/libsrc4/Makefile.in
+++ b/libsrc4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -92,8 +102,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -109,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -186,6 +195,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -234,6 +245,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -249,10 +261,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -287,8 +301,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -373,7 +389,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libsrc4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign libsrc4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -382,7 +397,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -735,6 +750,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libsrc4/nc4file.c b/libsrc4/nc4file.c
index 35a8ccb..5976237 100644
--- a/libsrc4/nc4file.c
+++ b/libsrc4/nc4file.c
@@ -12,18 +12,20 @@ COPYRIGHT file for copying and redistribution conditions.
 #include "config.h"
 #include <errno.h>  /* netcdf functions sometimes return system errors */
 
+
 #include "nc.h"
 #include "nc4internal.h"
 #include "nc4dispatch.h"
 
-#include "H5DSpublic.h"
+/* must be after nc4internal.h */
+#include <H5DSpublic.h>
 
 #ifdef USE_HDF4
 #include <mfhdf.h>
 #endif
 
-#if 0 /*def USE_PNETCDF*/
-#include <pnetcdf.h>
+#ifdef USE_DISKLESS
+#include <hdf5_hl.h>
 #endif
 
 /* This is to track opened HDF5 objects to make sure they are
@@ -43,6 +45,11 @@ extern int num_spaces;
 #define DIMENSION_LIST "DIMENSION_LIST"
 #define NAME "NAME"
 
+/* Define the illegal mode flags */
+#define ILLEGAL_OPEN_FLAGS (NC_MMAP|NC_64BIT_OFFSET)
+
+#define ILLEGAL_CREATE_FLAGS (NC_NOWRITE|NC_MMAP|NC_INMEMORY|NC_64BIT_OFFSET|NC_PNETCDF)
+
 /*! Struct to track information about objects in a group, for nc4_rec_read_metadata()
 
  \internal
@@ -183,16 +190,32 @@ nc4typelen(nc_type type)
 #define NC_HDF5_FILE 1
 #define NC_HDF4_FILE 2
 static int
-nc_check_for_hdf(const char *path, int use_parallel, MPI_Comm comm, MPI_Info info,
-		 int *hdf_file)
+nc_check_for_hdf(const char *path, int flags, void* parameters, int *hdf_file)
 {
    char blob[MAGIC_NUMBER_LEN];
+#ifdef USE_PARALLEL
+   int use_parallel = ((flags & NC_MPIIO) == NC_MPIIO);
+   NC_MPI_INFO* mpiinfo = (NC_MPI_INFO*)parameters;
+   MPI_Comm comm = MPI_COMM_WORLD;
+   MPI_Info info = MPI_INFO_NULL;
+#endif
+   int inmemory = ((flags & NC_INMEMORY) == NC_INMEMORY);
+#ifdef USE_DISKLESS
+   NC_MEM_INFO* meminfo = (NC_MEM_INFO*)parameters;
+#endif
+
+#ifdef USE_PARALLEL
+   if(use_parallel) {
+       comm = mpiinfo->comm;
+       info = mpiinfo->info;
+   }
+#endif
 
-   assert(hdf_file && path);
+   assert(hdf_file);
    LOG((3, "%s: path %s", __func__, path));
 
    /* HDF5 function handles possible user block at beginning of file */
-   if(H5Fis_hdf5(path))
+   if(!inmemory && H5Fis_hdf5(path))
    {
        *hdf_file = NC_HDF5_FILE;
    } else {
@@ -200,7 +223,7 @@ nc_check_for_hdf(const char *path, int use_parallel, MPI_Comm comm, MPI_Info inf
 /* Get the 4-byte blob from the beginning of the file. Don't use posix
  * for parallel, use the MPI functions instead. */
 #ifdef USE_PARALLEL
-       if (use_parallel)
+       if (!inmemory && use_parallel)
        {
 	   MPI_File fh;
 	   MPI_Status status;
@@ -216,7 +239,7 @@ nc_check_for_hdf(const char *path, int use_parallel, MPI_Comm comm, MPI_Info inf
        }
        else
 #endif /* USE_PARALLEL */
-       {
+       if(!inmemory) {
 	   FILE *fp;
 	   if (!(fp = fopen(path, "r")) ||
 	       fread(blob, MAGIC_NUMBER_LEN, 1, fp) != 1) {
@@ -225,11 +248,17 @@ nc_check_for_hdf(const char *path, int use_parallel, MPI_Comm comm, MPI_Info inf
 	     return errno;
 	   }
 	   fclose(fp);
+       } else { /*inmemory*/
+	  if(meminfo->size < MAGIC_NUMBER_LEN)
+	    return NC_ENOTNC;
+	  memcpy(blob,meminfo->memory,MAGIC_NUMBER_LEN);
        }
 
        /* Check for HDF4. */
-       if (!strncmp(blob, "\016\003\023\001", MAGIC_NUMBER_LEN))
+       if (memcmp(blob, "\016\003\023\001", 4)==0)
 	   *hdf_file = NC_HDF4_FILE;
+       else if (memcmp(blob, "HDF", 3)==0)
+	   *hdf_file = NC_HDF5_FILE;
        else
 	   *hdf_file = 0;
    }
@@ -433,7 +462,7 @@ Create a netCDF-4/HDF5 file.
 \param basepe Ignored by this function.
 \param chunksizehintp Ignored by this function.
 \param use_parallel 0 for sequential, non-zero for parallel I/O.
-\param mpidata pointer to struct holdind data for parallel I/O
+\param parameters pointer to struct holding extra data (e.g. for parallel I/O)
 layer. Ignored if NULL.
 \param dispatch Pointer to the dispatch table for this file.
 \param nc_file Pointer to an instance of NC.
@@ -441,7 +470,7 @@ layer. Ignored if NULL.
 */
 int
 NC4_create(const char* path, int cmode, size_t initialsz, int basepe,
-	   size_t *chunksizehintp, int use_parallel, void *mpidata,
+	   size_t *chunksizehintp, int use_parallel, void *parameters,
 	   NC_Dispatch *dispatch, NC* nc_file)
 {
    MPI_Comm comm = MPI_COMM_WORLD;
@@ -454,10 +483,10 @@ NC4_create(const char* path, int cmode, size_t initialsz, int basepe,
 	__func__, path, cmode, comm, info));
 
 #ifdef USE_PARALLEL
-   if (mpidata)
+   if (parameters)
    {
-      comm = ((NC_MPI_INFO *)mpidata)->comm;
-      info = ((NC_MPI_INFO *)mpidata)->info;
+      comm = ((NC_MPI_INFO *)parameters)->comm;
+      info = ((NC_MPI_INFO *)parameters)->info;
    }
 #endif /* USE_PARALLEL */
 
@@ -471,16 +500,15 @@ NC4_create(const char* path, int cmode, size_t initialsz, int basepe,
    }
 
    /* Check the cmode for validity. */
-   if (cmode & ~(NC_NOCLOBBER | NC_64BIT_OFFSET
-                 | NC_NETCDF4 | NC_CLASSIC_MODEL
-                 | NC_SHARE | NC_MPIIO | NC_MPIPOSIX | NC_LOCK | NC_PNETCDF
-		 | NC_DISKLESS
-		 | NC_WRITE /* to support diskless persistence */
-                 )
-       || (cmode & NC_MPIIO && cmode & NC_MPIPOSIX)
-       || (cmode & NC_64BIT_OFFSET && cmode & NC_NETCDF4)
-       || (cmode & (NC_MPIIO | NC_MPIPOSIX) && cmode & NC_DISKLESS)
-      )
+   if((cmode & ILLEGAL_CREATE_FLAGS) != 0)
+      return NC_EINVAL;
+
+   /* Cannot have both */
+   if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
+      return NC_EINVAL;
+
+   /* Currently no parallel diskless io */
+   if((cmode & (NC_MPIIO | NC_MPIPOSIX)) && (cmode & NC_DISKLESS))
       return NC_EINVAL;
 
 #ifndef USE_PARALLEL_POSIX
@@ -895,31 +923,27 @@ get_type_info2(NC_HDF5_FILE_INFO_T *h5, hid_t datasetid,
 	       break;
 	 }
 
-	 /* Find out about endianness. */
-	 if (class == H5T_INTEGER)
-	 {
-	    if ((order = H5Tget_order(hdf_typeid)) < 0)
-	       return NC_EHDFERR;
+     /* Find out about endianness.
+      * As of HDF 1.8.6, this works with all data types
+      * Not just H5T_INTEGER.
+      *
+      * See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOrder
+      */
+     if((order = H5Tget_order(hdf_typeid)) < 0)
+         return NC_EHDFERR;
 
-	    /* Copy this into the type_info struct. */
-	    if (order == H5T_ORDER_LE)
-               (*type_info)->endianness = NC_ENDIAN_LITTLE;
-	    else if (order == H5T_ORDER_BE)
-               (*type_info)->endianness = NC_ENDIAN_BIG;
-	    else /* don't support H5T_ORDER_VAX, H5T_ORDER_MIXED, H5T_ORDER_NONE */
-		return NC_EBADTYPE;
+     if(order == H5T_ORDER_LE)
+         (*type_info)->endianness = NC_ENDIAN_LITTLE;
+     else if(order == H5T_ORDER_BE)
+         (*type_info)->endianness = NC_ENDIAN_BIG;
+     else
+         return NC_EBADTYPE;
 
-            /* Set a class for the type */
-            /* (Note use of 'NC_INT' for all integer types) */
-            (*type_info)->nc_type_class = NC_INT;
-	 }
-         else
-         {
-            /* Set a class for the type */
-            /* (Note use of 'NC_FLOAT' for all floating-point types) */
-            (*type_info)->nc_type_class = NC_FLOAT;
-         }
-      }
+     if(class == H5T_INTEGER)
+          (*type_info)->nc_type_class = NC_INT;
+     else
+        (*type_info)->nc_type_class = NC_FLOAT;
+    }
       (*type_info)->nc_typeid = nc_type_constant_g[t];
       (*type_info)->size = nc_type_size_g[t];
       if (!((*type_info)->name = strdup(nc_type_name_g[t])))
@@ -1284,13 +1308,20 @@ read_type(NC_GRP_INFO_T *grp, hid_t hdf_typeid, char *type_name)
                }
 
 #ifndef JNA
+
                /* Free the member name (which HDF5 allocated for us). */
 			   /* On Windows using the microsoft runtime, it is an error
-				  for one library to free memory allocated by a different library. */
+				  for one library to free memory allocated by a different library.
+                  IF it is available, we should use H5free_memory*/
+
+#ifdef HDF5_HAS_H5FREE
+               if(member_name != NULL) H5free_memory(member_name);
+#else
 #ifndef _MSC_VER
                if(member_name != NULL) free(member_name);
 #endif
 #endif
+#endif
 	       member_name = NULL;
             }
 #ifndef JNA
@@ -2151,24 +2182,25 @@ exit:
  * ncfunc.c in nc_open, but here the netCDF-4 part of opening a file
  * is handled. */
 static int
-nc4_open_file(const char *path, int mode, MPI_Comm comm,
-	      MPI_Info info, NC *nc)
+nc4_open_file(const char *path, int mode, void* parameters, NC *nc)
 {
    hid_t fapl_id = H5P_DEFAULT;
    unsigned flags = (mode & NC_WRITE) ?
       H5F_ACC_RDWR : H5F_ACC_RDONLY;
    int retval;
    NC_HDF5_FILE_INFO_T* nc4_info = NULL;
+   int inmemory = ((mode & NC_INMEMORY) == NC_INMEMORY);
+#ifdef USE_DISKLESS
+   NC_MEM_INFO* meminfo = (NC_MEM_INFO*)parameters;
+#endif
 #ifdef USE_PARALLEL
+   NC_MPI_INFO* mpiinfo = (NC_MPI_INFO*)parameters;
    int comm_duped = 0;          /* Whether the MPI Communicator was duplicated */
    int info_duped = 0;          /* Whether the MPI Info object was duplicated */
 #endif /* !USE_PARALLEL */
 
    LOG((3, "%s: path %s mode %d", __func__, path, mode));
    assert(path && nc);
-   /* Stop diskless open in its tracks */
-   if(mode & NC_DISKLESS)
-	return NC_EDISKLESS;
 
    /* Add necessary structs to hold netcdf-4 file data. */
    if ((retval = nc4_nc4f_list_add(nc, path, mode)))
@@ -2176,7 +2208,7 @@ nc4_open_file(const char *path, int mode, MPI_Comm comm,
    nc4_info = NC4_DATA(nc);
    assert(nc4_info && nc4_info->root_grp);
 
-   /* Need this access plist to control how HDF5 handles open onjects
+   /* Need this access plist to control how HDF5 handles open objects
     * on file close. (Setting H5F_CLOSE_SEMI will cause H5Fclose to
     * fail if there are any open objects in the file. */
    if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -2201,14 +2233,14 @@ nc4_open_file(const char *path, int mode, MPI_Comm comm,
       if (mode & NC_MPIIO)  /* MPI/IO */
       {
 	 LOG((4, "opening parallel file with MPI/IO"));
-	 if (H5Pset_fapl_mpio(fapl_id, comm, info) < 0)
+	 if (H5Pset_fapl_mpio(fapl_id, mpiinfo->comm, mpiinfo->info) < 0)
 	    BAIL(NC_EPARINIT);
       }
 #ifdef USE_PARALLEL_POSIX
       else /* MPI/POSIX */
       {
 	 LOG((4, "opening parallel file with MPI/posix"));
-	 if (H5Pset_fapl_mpiposix(fapl_id, comm, 0) < 0)
+	 if (H5Pset_fapl_mpiposix(fapl_id, mpiinfo->comm, 0) < 0)
 	    BAIL(NC_EPARINIT);
       }
 #else /* USE_PARALLEL_POSIX */
@@ -2221,19 +2253,19 @@ nc4_open_file(const char *path, int mode, MPI_Comm comm,
 #endif /* USE_PARALLEL_POSIX */
 
       /* Keep copies of the MPI Comm & Info objects */
-      if (MPI_SUCCESS != MPI_Comm_dup(comm, &nc4_info->comm))
+      if (MPI_SUCCESS != MPI_Comm_dup(mpiinfo->comm, &nc4_info->comm))
          BAIL(NC_EMPI);
       comm_duped++;
-      if (MPI_INFO_NULL != info)
+      if (MPI_INFO_NULL != mpiinfo->info)
       {
-         if (MPI_SUCCESS != MPI_Info_dup(info, &nc4_info->info))
+         if (MPI_SUCCESS != MPI_Info_dup(mpiinfo->info, &nc4_info->info))
             BAIL(NC_EMPI);
          info_duped++;
       }
       else
       {
          /* No dup, just copy it. */
-         nc4_info->info = info;
+         nc4_info->info = mpiinfo->info;
       }
    }
 #else /* only set cache for non-parallel. */
@@ -2247,7 +2279,13 @@ nc4_open_file(const char *path, int mode, MPI_Comm comm,
    /* The NetCDF-3.x prototype contains an mode option NC_SHARE for
       multiple processes accessing the dataset concurrently.  As there
       is no HDF5 equivalent, NC_SHARE is treated as NC_NOWRITE. */
-   if ((nc4_info->hdfid = H5Fopen(path, flags, fapl_id)) < 0)
+   if(inmemory) {
+       if((nc4_info->hdfid = H5LTopen_file_image(meminfo->memory,meminfo->size,
+			H5LT_FILE_IMAGE_DONT_COPY|H5LT_FILE_IMAGE_DONT_RELEASE
+			)) < 0)
+           BAIL(NC_EHDFERR);
+       nc4_info->no_write = NC_TRUE;
+   } else if ((nc4_info->hdfid = H5Fopen(path, flags, fapl_id)) < 0)
       BAIL(NC_EHDFERR);
 
    /* Does the mode specify that this file is read-only? */
@@ -2295,57 +2333,118 @@ exit:
    return retval;
 }
 
-/* Given an HDF4 type, set a pointer to netcdf type. */
 #ifdef USE_HDF4
+/*! Given an HDF4 type, set a pointer to netcdf type.
+ *
+ * Given an HDF4 type, set a pointer to a netcdf type.
+ * See http://www.hdfgroup.org/training/HDFtraining/UsersGuide/Fundmtls.fm3.html
+ * for more information re: HDF4 types.
+ *
+ * \param NC_HDF5_FILE_INFO_T* Pointer to h5
+ * \param int32 TypeID for hdf4 datatype.
+ * \param nc_type* Pointer to netcdf type, where result will be stored.
+ * \param NC_TYPE_INFO_T* (Optiona) Type info for the variable.
+ * \return Error code, 0 on success.
+ *
+ */
 static int
 get_netcdf_type_from_hdf4(NC_HDF5_FILE_INFO_T *h5, int32 hdf4_typeid,
 			  nc_type *xtype, NC_TYPE_INFO_T *type_info)
 {
-   int t;
+   int t = 0;
+
+   /* Added this variable in the course of fixing NCF-332.
+    * Prior to the fix, all data types were assigned
+    * NC_ENDIAN_BIG, so I am preserving that here for now.
+    * Not sure why it wouldn't be NC_ENDIAN_NATIVE, although
+    * I can hazard a guess or two.
+    */
+
+   int endianness = NC_ENDIAN_BIG;
    assert(h5 && xtype);
 
    switch(hdf4_typeid)
    {
-      case DFNT_CHAR:
-	 *xtype = NC_CHAR;
-	 t = 0;
-	 break;
-      case DFNT_UCHAR:
-      case DFNT_UINT8:
-	 *xtype = NC_UBYTE;
-	 t = 6;
-	 break;
-      case DFNT_INT8:
-	 *xtype = NC_BYTE;
-	 t = 1;
-	 break;
-      case DFNT_INT16:
-	 *xtype = NC_SHORT;
-	 t = 2;
-	 break;
-      case DFNT_UINT16:
-	 *xtype = NC_USHORT;
-	 t = 7;
-	 break;
-      case DFNT_INT32:
-	 *xtype = NC_INT;
-	 t = 3;
-	 break;
-      case DFNT_UINT32:
-	 *xtype = NC_UINT;
-	 t = 8;
-	 break;
-      case DFNT_FLOAT32:
-	 *xtype = NC_FLOAT;
-	 t = 4;
-	 break;
-      case DFNT_FLOAT64:
-	 *xtype = NC_DOUBLE;
-	 t = 5;
-	 break;
-      default:
-	 *xtype = NC_NAT;
-	 return NC_EBADTYPID;
+   case DFNT_CHAR:
+       *xtype = NC_CHAR;
+       t = 0;
+       break;
+   case DFNT_UCHAR:
+   case DFNT_UINT8:
+       *xtype = NC_UBYTE;
+       t = 6;
+       break;
+   case DFNT_LUINT8:
+       *xtype = NC_UBYTE;
+       t = 6;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_INT8:
+       *xtype = NC_BYTE;
+       t = 1;
+       break;
+   case DFNT_LINT8:
+       *xtype = NC_BYTE;
+       t = 1;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_INT16:
+       *xtype = NC_SHORT;
+       t = 2;
+       break;
+   case DFNT_LINT16:
+       *xtype = NC_SHORT;
+       t = 2;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_UINT16:
+       *xtype = NC_USHORT;
+       t = 7;
+       break;
+   case DFNT_LUINT16:
+       *xtype = NC_USHORT;
+       t = 7;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_INT32:
+       *xtype = NC_INT;
+       t = 3;
+       break;
+   case DFNT_LINT32:
+        *xtype = NC_INT;
+       t = 3;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_UINT32:
+       *xtype = NC_UINT;
+       t = 8;
+       break;
+   case DFNT_LUINT32:
+        *xtype = NC_UINT;
+       t = 8;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_FLOAT32:
+       *xtype = NC_FLOAT;
+       t = 4;
+       break;
+   case DFNT_LFLOAT32:
+       *xtype = NC_FLOAT;
+       t = 4;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   case DFNT_FLOAT64:
+       *xtype = NC_DOUBLE;
+       t = 5;
+       break;
+   case DFNT_LFLOAT64:
+       *xtype = NC_DOUBLE;
+       t = 5;
+       endianness = NC_ENDIAN_LITTLE;
+       break;
+   default:
+       *xtype = NC_NAT;
+       return NC_EBADTYPID;
    }
 
    if (type_info)
@@ -2358,11 +2457,11 @@ get_netcdf_type_from_hdf4(NC_HDF5_FILE_INFO_T *h5, int32 hdf4_typeid,
 	 type_info->nc_type_class = NC_STRING;
       else
 	 type_info->nc_type_class = NC_INT;
-      type_info->endianness = NC_ENDIAN_BIG;
+      type_info->endianness = endianness;
       type_info->nc_typeid = *xtype;
       type_info->size = nc_type_size_g[t];
       if (!(type_info->name = strdup(nc_type_name_g[t])))
-	 return NC_ENOMEM;
+        return NC_ENOMEM;
    }
 
    return NC_NOERR;
@@ -2667,24 +2766,25 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
 
 int
 NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
-	 int use_parallel, void *mpidata, NC_Dispatch *dispatch, NC *nc_file)
+	 int use_parallel, void *parameters, NC_Dispatch *dispatch, NC *nc_file)
 {
-   int hdf_file = 0;
-   MPI_Comm comm = MPI_COMM_WORLD;
-   MPI_Info info = MPI_INFO_NULL;
    int res;
+   int hdf_file = 0;
+#ifdef USE_PARALLEL
+   NC_MPI_INFO mpidfalt = {MPI_COMM_WORLD, MPI_INFO_NULL};
+#endif
+#if defined USE_PARALLEL || defined USE_HDF4
+   int inmemory = ((mode & NC_INMEMORY) == NC_INMEMORY);
+#endif
 
    assert(nc_file && path);
 
-   LOG((1, "%s: path %s mode %d comm %d info %d",
-	__func__, path, mode, comm, info));
+   LOG((1, "%s: path %s mode %d params %x",
+	__func__, path, mode, parameters));
 
 #ifdef USE_PARALLEL
-   if (mpidata)
-   {
-      comm = ((NC_MPI_INFO *)mpidata)->comm;
-      info = ((NC_MPI_INFO *)mpidata)->info;
-   }
+   if (!inmemory && use_parallel && parameters == NULL)
+	parameters = &mpidfalt;
 #endif /* USE_PARALLEL */
 
    /* If this is our first file, turn off HDF5 error messages. */
@@ -2696,12 +2796,13 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
       virgin = 0;
    }
 
-   /* Check the mode for validity. First make sure only certain bits
-    * are turned on. Also MPI I/O and MPI POSIX cannot both be
-    * selected at once. */
-   if (mode & ~(NC_WRITE | NC_SHARE | NC_MPIIO | NC_MPIPOSIX |
-		NC_PNETCDF | NC_NOCLOBBER | NC_NETCDF4 | NC_CLASSIC_MODEL) ||
-       (mode & NC_MPIIO && mode & NC_MPIPOSIX))
+
+   /* Check the mode for validity */
+   if((mode & ILLEGAL_OPEN_FLAGS) != 0)
+      return NC_EINVAL;
+
+   /* Cannot have both */
+   if((mode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
       return NC_EINVAL;
 
 #ifndef USE_PARALLEL_POSIX
@@ -2715,62 +2816,22 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
    }
 #endif /* USE_PARALLEL_POSIX */
 
+   /* Figure out if this is a hdf4 or hdf5 file. */
+   if ((res = nc_check_for_hdf(path, use_parallel, parameters, &hdf_file)))
+	return res;
 
    /* Depending on the type of file, open it. */
-
-#if 0 /*def USE_PNETCDF*/
-   if(mode & NC_PNETCDF) {
-	/* this is not really an hdf file */
-      int pnetcdf_nvars, i;
-      NC_HDF5_FILE_INFO_T* nc4_info;
-
-      /* Create the fake nc4_info data */
-      res = nc4_nc4f_list_add(nc_file, path, mode);
-
-      nc4_info = NC4_DATA(nc_file);
-      assert(nc4_info);
-
-      res = ncmpi_open(comm, path, mode, info, &(nc_file->int_ncid));
-      nc4_info->pnetcdf_file++;
-
-      /* Default to independent access, like netCDF-4/HDF5 files. */
-      if (!res)
-	 res = ncmpi_begin_indep_data(nc_file->int_ncid);
-
-      /* I need to keep track of the ndims of each var to translate
-       * start, count, and stride arrays to MPI_Offset type. */
-      if (!res)
-      {
-	 res = ncmpi_inq_nvars(nc_file->int_ncid, &pnetcdf_nvars);
-	 for (i = 0; i < pnetcdf_nvars; i++)
-	    res = ncmpi_inq_varndims(nc_file->int_ncid, i,
-				     &(nc4_info->pnetcdf_ndims[i]));
-
-      }
-   } else
-#endif
-   {
-      /* Figure out if this is a hdf4 or hdf5 file. */
-     if ((res = nc_check_for_hdf(path, use_parallel, comm, info, &hdf_file)))
-         return res;
-
-      if (hdf_file == NC_HDF5_FILE)
-      {
-         nc_file->int_ncid = nc_file->ext_ncid;
-         res = nc4_open_file(path, mode, comm, info, nc_file);
-      }
+   nc_file->int_ncid = nc_file->ext_ncid;
+   if (hdf_file == NC_HDF5_FILE)
+       res = nc4_open_file(path, mode, parameters, nc_file);
 #ifdef USE_HDF4
-      else if (hdf_file == NC_HDF4_FILE)
-      {
-         nc_file->int_ncid = nc_file->ext_ncid;
-         res = nc4_open_hdf4_file(path, mode, nc_file);
-      }
+   else if (hdf_file == NC_HDF4_FILE && inmemory)
+	return NC_EDISKLESS;
+   else if (hdf_file == NC_HDF4_FILE)
+       res = nc4_open_hdf4_file(path, mode, nc_file);
 #endif /* USE_HDF4 */
-      else /* netcdf */
-      {
+   else
          assert(0); /* should never happen */
-      }
-   }
 
    return res;
 }
@@ -3204,6 +3265,35 @@ NC4_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
    return NC_NOERR;
 }
 
+#if 0
+int
+NC4_set_content(int ncid, size_t size, void* memory)
+{
+    int retval = NC_NOERR;
+    herr_t herr;
+    NC *nc;
+    NC_HDF5_FILE_INFO_T *h5;
+    NC_GRP_INFO_T *grp;
+
+    LOG((4,"%s: ncid 0x%x size %ld memory 0x%x", __func__, ncid, size, memory));
+
+    /* Find file metadata. */
+    if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
+	return retval;
+    assert(h5 && grp && nc);
+
+#ifdef USE_DISKLESS
+    herr = H5Pset_file_image(h5->hdfid,memory,size);
+    if(herr)
+	BAIL(NC_EHDFERR);
+#else
+    retval = NC_EDISKLESS;
+#endif    				
+
+done:
+    return retval;
+}
+#endif
 
 /* This function will do the enddef stuff for a netcdf-4 file. */
 int
diff --git a/libsrc4/nc4hdf.c b/libsrc4/nc4hdf.c
index 69e70b1..81de2b4 100644
--- a/libsrc4/nc4hdf.c
+++ b/libsrc4/nc4hdf.c
@@ -657,8 +657,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
       /* If we're reading, we need bufr to have enough memory to store
        * the data in the file. If we're writing, we need bufr to be
        * big enough to hold all the data in the file's type. */
-      if (!(bufr = malloc(len * file_type_size)))
-        BAIL(NC_ENOMEM);
+      if(len > 0)
+        if (!(bufr = malloc(len * file_type_size)))
+          BAIL(NC_ENOMEM);
     }
   else
 #endif /* ifndef HDF5_CONVERT */
@@ -823,7 +824,7 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
   num_plists--;
 #endif
 #ifndef HDF5_CONVERT
-  if (need_to_convert) free(bufr);
+  if (need_to_convert && bufr) free(bufr);
 #endif
 
   /* If there was an error return it, otherwise return any potential
@@ -1039,8 +1040,9 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
           /* If we're reading, we need bufr to have enough memory to store
            * the data in the file. If we're writing, we need bufr to be
            * big enough to hold all the data in the file's type. */
-          if (!(bufr = malloc(len * file_type_size)))
-            BAIL(NC_ENOMEM);
+          if(len > 0)
+            if (!(bufr = malloc(len * file_type_size)))
+              BAIL(NC_ENOMEM);
         }
       else
 #endif /* ifndef HDF5_CONVERT */
@@ -1187,7 +1189,7 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
 #endif
     }
 #ifndef HDF5_CONVERT
-  if (need_to_convert)
+  if (need_to_convert && bufr != NULL)
     free(bufr);
 #endif
   if (xtend_size)
@@ -1553,9 +1555,13 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, nc_bool_t write_dimid
       int unlimdim = 0;
 
       /* Check to see if any unlimited dimensions are used in this var. */
-      for (d = 0; d < var->ndims; d++)
-        if (var->dim[d]->unlimited)
-          unlimdim++;
+      for (d = 0; d < var->ndims; d++) {
+	for (g = grp; g; g = g->parent)
+	  for (dim = g->dim; dim; dim = dim->l.next)
+	    if (dim->dimid == var->dimids[d])
+	      if (dim->unlimited)
+		unlimdim++;
+      }
 
       /* If there are no unlimited dims, and no filters, and the user
        * has not specified chunksizes, use contiguous variable for
@@ -1658,7 +1664,7 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, nc_bool_t write_dimid
 
   /* At long last, create the dataset. */
   name_to_use = var->hdf5_name ? var->hdf5_name : var->name;
-  LOG((4, "%s: about to H5Dcreate dataset %s of type 0x%x", __func__,
+  LOG((4, "%s: about to H5Dcreate2 dataset %s of type 0x%x", __func__,
        name_to_use, typeid));
   if ((var->hdf_datasetid = H5Dcreate2(grp->hdf_grpid, name_to_use, typeid,
                                        spaceid, H5P_DEFAULT, plistid, access_plistid)) < 0)
@@ -2291,7 +2297,7 @@ write_var(NC_VAR_INFO_T *var, NC_GRP_INFO_T *grp, nc_bool_t write_dimid)
   /* Clear coord. var state transition flags */
   var->was_coord_var = NC_FALSE;
   var->became_coord_var = NC_FALSE;
-      
+
   /* Now check the attributes for this var. */
   if (var->attr_dirty)
     {
@@ -2360,7 +2366,7 @@ write_dim(NC_DIM_INFO_T *dim, NC_GRP_INFO_T *grp, nc_bool_t write_dimid)
         BAIL(NC_EHDFERR);
 
       /* Create the dataset that will be the dimension scale. */
-      LOG((4, "%s: about to H5Dcreate a dimscale dataset %s", __func__, dim->name));
+      LOG((4, "%s: about to H5Dcreate1 a dimscale dataset %s", __func__, dim->name));
       if ((dim->hdf_dimscaleid = H5Dcreate1(grp->hdf_grpid, dim->name, H5T_IEEE_F32BE,
                                             spaceid, create_propid)) < 0)
         BAIL(NC_EHDFERR);
diff --git a/libsrc4/nc4internal.c b/libsrc4/nc4internal.c
index d979a98..a078a80 100644
--- a/libsrc4/nc4internal.c
+++ b/libsrc4/nc4internal.c
@@ -1454,9 +1454,9 @@ rec_print_metadata(NC_GRP_INFO_T *grp, int tab_count)
              strcat(dims_string, temp_string);
            }
       }
-      LOG((2, "%s VARIABLE - varid: %d name: %s type: %d ndims: %d dimscale: %d dimids:%s",
+      LOG((2, "%s VARIABLE - varid: %d name: %s type: %d ndims: %d dimscale: %d dimids:%s endianness: %d, hdf_typeid: %d",
 	   tabs, var->varid, var->name, var->type_info->nc_typeid, var->ndims, (int)var->dimscale,
-	   (dims_string ? dims_string : " -")));
+       (dims_string ? dims_string : " -"),var->type_info->endianness, var->type_info->native_hdf_typeid));
       for(att = var->att; att; att = att->l.next)
 	 LOG((2, "%s VAR ATTRIBUTE - attnum: %d name: %s type: %d len: %d",
 	      tabs, att->attnum, att->name, att->nc_typeid, att->len));
diff --git a/libsrc5/Makefile.in b/libsrc5/Makefile.in
index 13858d7..d723787 100644
--- a/libsrc5/Makefile.in
+++ b/libsrc5/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -92,8 +102,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -112,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -184,6 +193,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -232,6 +243,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -247,10 +259,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -285,8 +299,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -369,7 +385,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libsrc5/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign libsrc5/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -378,7 +393,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -651,6 +666,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ljna b/ljna
deleted file mode 100644
index 4b6b039..0000000
--- a/ljna
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-# Define where the installation will be
-PREFIX=/home/dmh/opt/jna
-#PREFIX=/opt/netcdf
-
-# Define where to look for e.g. libz or libhdf5
-LIBDIR=/usr/local/lib
-
-CFLAGS=""
-CPPFLAGS="-I${PREFIX}/include"
-
-LDFLAGS="-L${LIBDIR} -lhdf5_hl -lhdf5 -lz $LDFLAGS"
-LD_LIBRARY_PATH="${LIBDIR}:$LD_LIBRARY_PATH"
-
-MAKE=make
-
-FLAGS="--prefix ${PREFIX}"
-FLAGS="$FLAGS --disable-examples"
-FLAGS="$FLAGS --disable-utilities"
-FLAGS="$FLAGS --enable-shared"
-#FLAGS="$FLAGS --enable-jna"
-
-export PATH
-export CC
-export CPPFLAGS
-export CFLAGS
-export LDFLAGS
-export LD_LIBRARY_PATH
-
-if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
-sh ./configure ${FLAGS}
-
diff --git a/ltmain.sh b/ltmain.sh
index a356aca..0f0a2da 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,12 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 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.
 
@@ -23,881 +26,2112 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing 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/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
-TIMESTAMP=""
-package_revision=1.3337
+VERSION=2.4.6
+package_revision=2.4.6
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 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.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES 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, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
 
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
 
 
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
 
 : ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
 
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
 
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
 
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
 
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
 
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
 
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
 case $progpath in
   [\\/]*|[A-Za-z]:\\*) ;;
   *[\\/]*)
-     progdir=$func_dirname_result
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
      progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
   *)
-     save_IFS="$IFS"
+     _G_IFS=$IFS
      IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
-       IFS="$save_IFS"
+       IFS=$_G_IFS
        test -x "$progdir/$progname" && break
      done
-     IFS="$save_IFS"
+     IFS=$_G_IFS
      test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
 
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
 
-# Standard options:
 opt_dry_run=false
-opt_help=false
 opt_quiet=false
 opt_verbose=false
-opt_warning=:
 
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
 
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
 
-    # bash bug again:
-    :
-}
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
 {
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
+    require_term_colors=:
 }
-help="Try \`$progname --help' for more information."  ## default
 
 
-# func_grep expression filename
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
 # Check whether EXPRESSION matches any line of FILENAME, without output.
 func_grep ()
 {
+    $debug_cmd
+
     $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
 # Make sure the entire path to DIRECTORY-PATH is available.
 func_mkdir_p ()
 {
-    my_directory_path="$1"
-    my_dir_list=
+    $debug_cmd
+
+    _G_directory_path=$1
+    _G_dir_list=
 
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
 
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
       esac
 
       # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
+      while test ! -d "$_G_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
 	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
+        _G_dir_list=$_G_directory_path:$_G_dir_list
 
         # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
+        case $_G_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
       done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
 
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
         # try to create one of the directories concurrently.  Don't
         # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
+        $MKDIR "$_G_dir" 2>/dev/null || :
       done
-      IFS="$save_mkdir_p_IFS"
+      IFS=$func_mkdir_p_IFS
 
       # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
 }
 
 
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
 # Make a temporary directory that won't clash with other running
 # libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
 func_mktempdir ()
 {
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-    if test "$opt_dry_run" = ":"; then
+    if test : = "$opt_dry_run"; then
       # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
+      _G_tmpdir=$_G_template-$$
     else
 
       # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
 
-      if test ! -d "$my_tmpdir"; then
+      if test ! -d "$_G_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
 
-        save_mktempdir_umask=`umask`
+        func_mktempdir_umask=`umask`
         umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
     fi
 
-    $ECHO "$my_tmpdir"
+    $ECHO "$_G_tmpdir"
 }
 
 
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
 {
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
+    $debug_cmd
 
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
         ;;
       *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
     esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
 }
 
 
-# func_quote_for_expand arg
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
 # Aesthetically quote ARG to be evaled later; same as above,
 # but do not quote variable references.
 func_quote_for_expand ()
 {
+    $debug_cmd
+
     case $1 in
       *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-        my_arg="$1" ;;
+        _G_arg=$1 ;;
     esac
 
-    case $my_arg in
+    case $_G_arg in
       # Double-quote args containing shell metacharacters to delay
       # word splitting and command substitution for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
       # in scan sets, so we specify it separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
+        _G_arg=\"$_G_arg\"
         ;;
     esac
 
-    func_quote_for_expand_result="$my_arg"
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
 }
 
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 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.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
 }
 
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
 {
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+    $debug_cmd
+
+    func_parse_options_result=
+
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
+
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
 }
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+    $debug_cmd
 
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
+    $debug_cmd
 
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
 
-exit_cmd=:
 
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
 
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
 
+    exit $?
+}
 
 
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
 
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+    $debug_cmd
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
 
-# func_arith arithmetic-term...
-func_arith ()
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+    $debug_cmd
+
+    $warning_func ${1+"$@"}
+}
+
 
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
 {
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
 
 
-# func_lo2o object
-func_lo2o ()
-{
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
 
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
 
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -915,17 +2149,19 @@ func_config ()
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -934,289 +2170,297 @@ func_features ()
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
 
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
+    nonopt=
+    preserve_args=
 
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
 
 
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
+    $debug_cmd
 
-  # Validate options:
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
 
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
 
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
 
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
 
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
 
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
     fi
 
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
 
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
 
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
 
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
+
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
+
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options libtool_validate_options
+
 
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
 
 
 
@@ -1224,24 +2468,52 @@ func_enable_tag "$optarg"
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1249,13 +2521,13 @@ func_lalib_unsafe_p ()
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@ func_lalib_unsafe_p ()
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    func_lalib_p "$1"
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname ()
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1308,11 +2581,13 @@ func_ltwrapper_p ()
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1324,10 +2599,11 @@ func_execute_cmds ()
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1354,10 +2630,10 @@ func_resolve_sysroot ()
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1374,7 +2650,8 @@ func_replace_sysroot ()
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1393,7 +2670,7 @@ func_infer_tag ()
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@ func_infer_tag ()
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1434,15 +2711,15 @@ func_infer_tag ()
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1450,7 +2727,7 @@ func_write_libtool_object ()
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1462,7 +2739,7 @@ pic_object=$write_lobj
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1482,8 +2759,9 @@ EOF
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@ func_convert_core_file_wine_to_w32 ()
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 ()
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 ()
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@ func_cygpath ()
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1574,10 +2854,11 @@ func_cygpath ()
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 ()
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -1606,10 +2888,11 @@ func_convert_file_check ()
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -1618,7 +2901,7 @@ func_convert_path_check ()
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -1630,9 +2913,10 @@ func_convert_path_check ()
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
@@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep ()
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep ()
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -1669,7 +2954,8 @@ func_to_host_file ()
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@ func_to_tool_file ()
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -1698,11 +2984,12 @@ func_convert_file_noop ()
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 ()
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin ()
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin ()
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin ()
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd ()
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -1829,7 +3122,7 @@ func_to_host_path ()
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -1840,8 +3133,9 @@ func_convert_path_noop ()
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 ()
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 ()
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin ()
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin ()
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin ()
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -1965,12 +3281,12 @@ func_mode_compile ()
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -1980,7 +3296,7 @@ func_mode_compile ()
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -2009,12 +3325,12 @@ func_mode_compile ()
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -2027,8 +3343,8 @@ func_mode_compile ()
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2043,13 +3359,13 @@ func_mode_compile ()
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2069,7 +3385,7 @@ func_mode_compile ()
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2078,8 +3394,8 @@ func_mode_compile ()
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2105,17 +3421,17 @@ func_mode_compile ()
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3443,16 @@ func_mode_compile ()
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2145,12 +3461,12 @@ func_mode_compile ()
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@ func_mode_compile ()
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2180,11 +3496,11 @@ compiler."
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2201,7 +3517,7 @@ compiler."
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2228,20 +3544,20 @@ compiler."
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
+      if test yes = "$compiler_c_o"; then
 	func_append command " -o $obj"
       fi
 
@@ -2250,7 +3566,7 @@ compiler."
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2281,7 +3597,7 @@ compiler."
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2291,7 +3607,7 @@ compiler."
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2311,7 +3627,7 @@ func_mode_help ()
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@ This mode accepts the following additional options:
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2352,7 +3668,7 @@ This mode accepts the following additional options:
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries.
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed."
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially:
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially:
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created."
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2491,7 +3808,7 @@ if $opt_help; then
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@ if $opt_help; then
 	func_mode_help
       done
     } |
-    sed '1d
+    $SED '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -2516,16 +3833,17 @@ fi
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2535,7 +3853,7 @@ func_mode_execute ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2546,18 +3864,18 @@ func_mode_execute ()
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2565,18 +3883,18 @@ func_mode_execute ()
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@ func_mode_execute ()
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -2601,12 +3919,12 @@ func_mode_execute ()
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -2614,7 +3932,15 @@ func_mode_execute ()
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -2631,25 +3957,18 @@ func_mode_execute ()
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -2663,11 +3982,11 @@ func_mode_finish ()
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -2682,12 +4001,12 @@ func_mode_finish ()
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -2712,7 +4031,7 @@ func_mode_finish ()
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -2723,27 +4042,27 @@ func_mode_finish ()
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -2762,18 +4081,20 @@ func_mode_finish ()
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@ func_mode_install ()
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
@@ -2813,7 +4134,7 @@ func_mode_install ()
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -2831,7 +4152,7 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -2856,7 +4177,7 @@ func_mode_install ()
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -2878,19 +4199,19 @@ func_mode_install ()
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@ func_mode_install ()
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -2908,7 +4229,7 @@ func_mode_install ()
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -2928,7 +4249,7 @@ func_mode_install ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -2950,7 +4271,7 @@ func_mode_install ()
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@ func_mode_install ()
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4294,36 @@ func_mode_install ()
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3006,7 +4334,7 @@ func_mode_install ()
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3017,14 +4345,14 @@ func_mode_install ()
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -3036,11 +4364,11 @@ func_mode_install ()
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@ func_mode_install ()
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3063,7 +4391,7 @@ func_mode_install ()
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@ func_mode_install ()
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3119,19 +4447,19 @@ func_mode_install ()
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3139,29 +4467,29 @@ func_mode_install ()
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3198,10 +4526,10 @@ func_mode_install ()
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3216,18 +4544,18 @@ func_mode_install ()
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3255,7 +4584,7 @@ func_generate_dlsyms ()
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3263,34 +4592,36 @@ func_generate_dlsyms ()
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3298,7 +4629,7 @@ extern \"C\" {
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3318,10 +4649,10 @@ extern \"C\" {
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@ extern \"C\" {
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3345,22 +4676,22 @@ extern \"C\" {
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@ extern \"C\" {
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@ extern \"C\" {
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3432,11 +4768,30 @@ typedef struct {
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() {
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() {
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() {
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() {
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() {
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@ func_win32_libid ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib ()
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core ()
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core ()
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback ()
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@ func_extract_an_archive ()
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@ func_extract_an_archive ()
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -3765,7 +5139,7 @@ func_extract_archives ()
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -3778,22 +5152,23 @@ func_extract_archives ()
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@ func_extract_archives ()
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -3830,7 +5205,7 @@ func_extract_archives ()
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -3841,7 +5216,7 @@ func_emit_wrapper ()
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@ _LTECHO_EOF'
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@ func_parse_lt_options ()
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -3944,7 +5319,7 @@ func_lt_dump_args ()
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -3958,7 +5333,7 @@ func_exec_program_core ()
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@ func_exec_program_core ()
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@ func_exec_program ()
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@ func_exec_program ()
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	$ECHO \"\$relink_command_output\" >&2
+	\$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -4101,7 +5476,7 @@ func_exec_program ()
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@ func_exec_program ()
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src ()
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4175,47 +5550,45 @@ EOF
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f);
 EOF
 
 	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@ const char * EXE_PATH_VALUE   = "";
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4357,12 +5735,12 @@ main (int argc, char *argv[])
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@ EOF
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@ EOF
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4569,7 +5947,7 @@ base_name (const char *name)
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -4628,7 +6006,7 @@ find_executable (const char *wrapper)
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@ find_executable (const char *wrapper)
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@ find_executable (const char *wrapper)
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -4679,7 +6057,7 @@ find_executable (const char *wrapper)
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -4798,7 +6176,7 @@ strendzap (char *str, const char *pat)
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -4863,7 +6241,7 @@ lt_setenv (const char *name, const char *value)
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -4912,10 +6290,10 @@ lt_update_exe_path (const char *name, const char *value)
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5082,27 +6460,47 @@ EOF
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5161,7 +6560,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5169,15 +6568,15 @@ func_mode_link ()
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@ func_mode_link ()
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@ func_mode_link ()
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5249,9 +6648,9 @@ func_mode_link ()
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5261,7 +6660,7 @@ func_mode_link ()
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
+	    if test dlfiles = "$prev"; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@ func_mode_link ()
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5297,7 +6696,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5321,21 +6726,21 @@ func_mode_link ()
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -5346,7 +6751,7 @@ func_mode_link ()
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -5354,23 +6759,23 @@ func_mode_link ()
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
+		  non_pic_object=$pic_object
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -5378,7 +6783,7 @@ func_mode_link ()
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@ func_mode_link ()
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5415,7 +6825,7 @@ func_mode_link ()
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@ func_mode_link ()
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5470,7 +6880,7 @@ func_mode_link ()
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
@@ -5484,7 +6894,7 @@ func_mode_link ()
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5516,7 +6926,7 @@ func_mode_link ()
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5550,9 +6960,9 @@ func_mode_link ()
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@ func_mode_link ()
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5599,7 +7009,7 @@ func_mode_link ()
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@ func_mode_link ()
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@ func_mode_link ()
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -5639,6 +7049,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
       -module)
 	module=yes
 	continue
@@ -5668,7 +7083,7 @@ func_mode_link ()
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -5682,8 +7097,8 @@ func_mode_link ()
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -5701,6 +7116,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -5788,14 +7208,14 @@ func_mode_link ()
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5804,15 +7224,15 @@ func_mode_link ()
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5835,7 +7255,7 @@ func_mode_link ()
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -5847,25 +7267,46 @@ func_mode_link ()
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
         continue
         ;;
 
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
@@ -5886,21 +7327,21 @@ func_mode_link ()
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -5911,7 +7352,7 @@ func_mode_link ()
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -5919,23 +7360,23 @@ func_mode_link ()
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
+	    non_pic_object=$pic_object
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -5943,7 +7384,7 @@ func_mode_link ()
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7392,7 @@ func_mode_link ()
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -5967,11 +7408,11 @@ func_mode_link ()
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -5986,7 +7427,7 @@ func_mode_link ()
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
@@ -5998,9 +7439,9 @@ func_mode_link ()
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -6009,20 +7450,23 @@ func_mode_link ()
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6045,7 +7489,7 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -6053,7 +7497,7 @@ func_mode_link ()
       func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7529,7 @@ func_mode_link ()
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6093,7 +7537,7 @@ func_mode_link ()
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6105,32 +7549,29 @@ func_mode_link ()
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link)
-	  libs="$deplibs %DEPLIBS%"
-	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
-	  ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6151,26 +7592,26 @@ func_mode_link ()
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6180,13 +7621,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6194,31 +7635,22 @@ func_mode_link ()
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6226,19 +7658,19 @@ func_mode_link ()
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6247,15 +7679,25 @@ func_mode_link ()
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6268,18 +7710,18 @@ func_mode_link ()
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6290,13 +7732,13 @@ func_mode_link ()
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -6314,7 +7756,7 @@ func_mode_link ()
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6325,21 +7767,26 @@ func_mode_link ()
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6347,18 +7794,13 @@ func_mode_link ()
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6369,10 +7811,10 @@ func_mode_link ()
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -6385,22 +7827,20 @@ func_mode_link ()
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6430,36 +7870,36 @@ func_mode_link ()
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-	      if $opt_preserve_dup_deps ; then
-		case "$tmp_libs " in
-		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
-		esac
-	      fi
-	      func_append tmp_libs " $deplib"
-	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done
 	  continue
 	fi # $pass = conv
 
@@ -6467,26 +7907,26 @@ func_mode_link ()
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -6500,40 +7940,40 @@ func_mode_link ()
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -6542,11 +7982,11 @@ func_mode_link ()
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6590,9 +8030,9 @@ func_mode_link ()
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -6602,14 +8042,14 @@ func_mode_link ()
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
+	if test prog = "$linkmode" && test link != "$pass"; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -6621,14 +8061,14 @@ func_mode_link ()
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6638,15 +8078,15 @@ func_mode_link ()
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -6675,9 +8115,9 @@ func_mode_link ()
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -6686,19 +8126,19 @@ func_mode_link ()
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
 	      # No point in relinking DLLs because paths are not encoded
 	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
+	    if test no = "$installed"; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -6708,24 +8148,24 @@ func_mode_link ()
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -6753,43 +8193,43 @@ func_mode_link ()
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
+	      *cygwin* | mingw* | *cegcc* | *os2*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -6797,58 +8237,58 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -6857,10 +8297,10 @@ func_mode_link ()
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -6868,7 +8308,7 @@ func_mode_link ()
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -6878,15 +8318,15 @@ func_mode_link ()
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6895,33 +8335,33 @@ func_mode_link ()
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -6930,10 +8370,10 @@ func_mode_link ()
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -6941,43 +8381,43 @@ func_mode_link ()
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -6990,11 +8430,11 @@ func_mode_link ()
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7008,12 +8448,12 @@ func_mode_link ()
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7023,7 +8463,7 @@ func_mode_link ()
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7032,12 +8472,12 @@ func_mode_link ()
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7045,12 +8485,12 @@ func_mode_link ()
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7058,35 +8498,35 @@ func_mode_link ()
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7098,23 +8538,23 @@ func_mode_link ()
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -7124,12 +8564,12 @@ func_mode_link ()
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7187,62 +8627,93 @@ func_mode_link ()
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
+	if test -n "$i"; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
+      oldlibs=$output
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7251,10 +8722,10 @@ func_mode_link ()
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7268,8 +8739,8 @@ func_mode_link ()
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7278,21 +8749,21 @@ func_mode_link ()
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7301,20 +8772,20 @@ func_mode_link ()
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7322,45 +8793,42 @@ func_mode_link ()
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
+	  darwin|freebsd-elf|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
-	  *)
-	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
-	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7368,30 +8836,30 @@ func_mode_link ()
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7406,26 +8874,36 @@ func_mode_link ()
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7436,69 +8914,74 @@ func_mode_link ()
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7512,42 +8995,45 @@ func_mode_link ()
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_generate_dlsyms "$libname" "$libname" :
       func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7556,8 +9042,8 @@ func_mode_link ()
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -7573,11 +9059,11 @@ func_mode_link ()
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -7598,13 +9084,13 @@ func_mode_link ()
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -7614,7 +9100,7 @@ func_mode_link ()
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -7623,7 +9109,7 @@ func_mode_link ()
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7647,7 +9133,7 @@ func_mode_link ()
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
+	    if test yes = "$build_libtool_need_lc"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -7663,9 +9149,9 @@ func_mode_link ()
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -7694,20 +9180,20 @@ EOF
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=""
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -7737,20 +9223,20 @@ EOF
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=""
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -7787,24 +9273,24 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -7822,25 +9308,25 @@ EOF
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=""
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7848,7 +9334,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7871,30 +9357,30 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7902,7 +9388,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7918,18 +9404,18 @@ EOF
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7953,8 +9439,8 @@ EOF
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -7963,12 +9449,12 @@ EOF
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -7979,14 +9465,14 @@ EOF
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8032,7 +9518,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8040,25 +9526,25 @@ EOF
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8083,7 +9569,7 @@ EOF
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8097,8 +9583,8 @@ EOF
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8108,19 +9594,19 @@ EOF
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
@@ -8134,7 +9620,7 @@ EOF
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -8143,31 +9629,31 @@ EOF
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8181,7 +9667,7 @@ EOF
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8192,7 +9678,7 @@ EOF
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -8215,8 +9701,8 @@ EOF
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8224,16 +9710,16 @@ EOF
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -8252,11 +9738,11 @@ EOF
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8267,7 +9753,7 @@ EOF
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
+	    gentop=$output_objdir/${outputname}x
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -8276,18 +9762,18 @@ EOF
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8305,7 +9791,7 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8338,8 +9824,8 @@ EOF
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8351,14 +9837,14 @@ EOF
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8373,7 +9859,7 @@ EOF
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8385,13 +9871,13 @@ EOF
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8401,10 +9887,10 @@ EOF
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8416,9 +9902,9 @@ EOF
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -8426,9 +9912,9 @@ EOF
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8437,16 +9923,16 @@ EOF
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8454,7 +9940,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8463,7 +9949,7 @@ EOF
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8471,18 +9957,18 @@ EOF
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -8491,7 +9977,7 @@ EOF
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8505,7 +9991,7 @@ EOF
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8527,7 +10013,7 @@ EOF
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -8535,11 +10021,12 @@ EOF
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8547,7 +10034,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8556,10 +10043,10 @@ EOF
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8579,39 +10066,39 @@ EOF
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -8619,7 +10106,7 @@ EOF
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -8632,17 +10119,19 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 	else
-	  gentop="$output_objdir/${obj}x"
+	  gentop=$output_objdir/${obj}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -8651,12 +10140,12 @@ EOF
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -8668,7 +10157,7 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -8678,12 +10167,12 @@ EOF
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -8700,16 +10189,14 @@ EOF
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -8723,11 +10210,11 @@ EOF
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -8763,7 +10250,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
       func_append compile_command " $compile_deplibs"
@@ -8787,7 +10274,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8810,7 +10297,7 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -8827,10 +10314,10 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -8838,7 +10325,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8863,45 +10350,43 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -8914,12 +10399,12 @@ EOF
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8949,9 +10434,9 @@ EOF
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -8968,27 +10453,28 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9045,8 +10531,8 @@ EOF
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9067,7 +10553,7 @@ EOF
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9090,25 +10576,27 @@ EOF
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
+	gentop=$output_objdir/${outputname}x
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -9116,13 +10604,13 @@ EOF
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -9143,7 +10631,7 @@ EOF
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -9152,7 +10640,7 @@ EOF
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9221,18 +10709,18 @@ EOF
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9249,7 +10737,7 @@ EOF
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9264,31 +10752,31 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -9304,23 +10792,23 @@ EOF
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9330,34 +10818,34 @@ EOF
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9373,10 +10861,9 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9385,7 +10872,7 @@ EOF
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9399,7 +10886,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9425,7 +10912,7 @@ dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9440,27 +10927,29 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -9473,18 +10962,18 @@ func_mode_uninstall ()
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -9499,11 +10988,11 @@ func_mode_uninstall ()
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9517,7 +11006,7 @@ func_mode_uninstall ()
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -9528,12 +11017,12 @@ func_mode_uninstall ()
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9549,21 +11038,19 @@ func_mode_uninstall ()
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
+	  if test -n "$pic_object" && test none != "$pic_object"; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9590,12 +11077,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -9604,7 +11091,7 @@ func_mode_uninstall ()
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9614,16 +11101,17 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -9634,7 +11122,7 @@ exit $exit_status
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -9657,5 +11145,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index d7c043f..a3bc337 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,8 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,36 +8,30 @@
 # modifications, as long as this notice is preserved.
 
 m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
+# Copyright (C) 2014 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.
+
+# GNU Libtool 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 of the License, or
+# (at your option) any later version.
 #
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing 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/>.
 ])
 
-# serial 57 LT_INIT
+# serial 58 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -67,7 +59,7 @@ esac
 # LT_INIT([OPTIONS])
 # ------------------
 AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -91,7 +83,7 @@ dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -111,26 +103,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
 
 
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
 # _LT_CC_BASENAME(CC)
 # -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
 m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
 ])
 
 
 # _LT_FILEUTILS_DEFAULTS
 # ----------------------
 # It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
 m4_defun([_LT_FILEUTILS_DEFAULTS],
 [: ${CP="cp -f"}
 : ${MV="mv -f"}
@@ -177,15 +186,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
 m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 ])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -198,7 +208,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -209,14 +219,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -269,14 +279,14 @@ no_glob_subst='s/\*/\\\*/g'
 
 # _LT_PROG_LTMAIN
 # ---------------
-# Note that this code is called both from `configure', and `config.status'
+# Note that this code is called both from 'configure', and 'config.status'
 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
 # so we pass a copy along to make sure it has a sensible value anyway.
 m4_defun([_LT_PROG_LTMAIN],
 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 ])# _LT_PROG_LTMAIN
 
 
@@ -286,7 +296,7 @@ ltmain="$ac_aux_dir/ltmain.sh"
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
 # label.
 
 
@@ -421,8 +431,8 @@ m4_define([_lt_decl_all_varnames],
 
 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
 # ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -446,7 +456,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
 # Output comment and list of tags supported by the script
 m4_defun([_LT_LIBTOOL_TAGS],
 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
+available_tags='_LT_TAGS'dnl
 ])
 
 
@@ -474,7 +484,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
 # _LT_LIBTOOL_CONFIG_VARS
 # -----------------------
 # Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
 # section) are produced by _LT_LIBTOOL_TAG_VARS.
 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -500,8 +510,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
 # variables for single and double quote escaping we saved from calls
 # to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'.  Finally, any additional code accumulated
 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
 m4_defun([_LT_CONFIG_COMMANDS],
 [AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -547,7 +557,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -560,7 +570,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -576,7 +586,7 @@ _LT_OUTPUT_LIBTOOL_INIT
 # Generate a child script FILE with all initialization necessary to
 # reuse the environment learned by the parent script, and make the
 # file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
+# '#!' sequence but before initialization text begins.  After this
 # macro, additional text can be appended to FILE to form the body of
 # the child script.  The macro ends with non-zero status if the
 # file could not be fully written (such as if the disk is full).
@@ -598,7 +608,7 @@ AS_SHELL_SANITIZE
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 _ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
@@ -621,7 +631,7 @@ exec AS_MESSAGE_LOG_FD>>config.log
 } >&AS_MESSAGE_LOG_FD
 
 lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
 for use in further configure time tests before the real libtool is
 generated.
 
@@ -643,7 +653,7 @@ Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
-while test $[#] != 0
+while test 0 != $[#]
 do
   case $[1] in
     --version | --v* | -V )
@@ -656,10 +666,10 @@ do
       lt_cl_silent=: ;;
 
     -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
 
     *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
   esac
   shift
 done
@@ -685,7 +695,7 @@ chmod +x "$CONFIG_LT"
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
 lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
   lt_config_lt_args="$lt_config_lt_args --quiet"
 exec AS_MESSAGE_LOG_FD>/dev/null
 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -705,27 +715,31 @@ m4_defun([_LT_CONFIG],
 _LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
 _LT_COPYING
 _LT_LIBTOOL_TAGS
 
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
 _LT_LIBTOOL_TAG_VARS
@@ -733,13 +747,24 @@ _LT_LIBTOOL_TAG_VARS
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -756,8 +781,6 @@ _LT_EOF
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  _LT_PROG_REPLACE_SHELLFNS
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -775,7 +798,6 @@ _LT_EOF
 [m4_if([$1], [], [
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'], [])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -974,7 +996,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -992,7 +1014,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1010,7 +1032,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
 	[lt_cv_ld_exported_symbols_list=yes],
 	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
     ])
 
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1032,7 +1054,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1042,32 +1064,32 @@ _LT_EOF
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]][[,.]]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1087,29 +1109,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
     m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 ],[])
   else
@@ -1129,7 +1151,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
 # Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
+if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1147,7 +1169,7 @@ else
     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi],[])
   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
   fi
   ])
   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1167,8 +1189,8 @@ m4_define([_LT_SHELL_INIT],
 # -----------------------
 # Find how we can fake an echo command that does not interpret backslash.
 # In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1196,10 +1218,10 @@ fi
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-    $ECHO "$*" 
+    $ECHO "$*"
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) AC_MSG_RESULT([printf]) ;;
   print*) AC_MSG_RESULT([print -r]) ;;
   *) AC_MSG_RESULT([cat]) ;;
@@ -1225,16 +1247,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
 AC_DEFUN([_LT_WITH_SYSROOT],
 [AC_MSG_CHECKING([for sysroot])
 AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
 [], [with_sysroot=no])
 
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -1244,14 +1267,14 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_RESULT([$with_sysroot])
    AC_MSG_ERROR([The sysroot must be an absolute path.])
    ;;
 esac
 
  AC_MSG_RESULT([${lt_sysroot:-no}])
 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+[dependent libraries, and where our libraries should be installed.])])
 
 # _LT_ENABLE_LOCK
 # ---------------
@@ -1259,31 +1282,33 @@ m4_defun([_LT_ENABLE_LOCK],
 [AC_ARG_ENABLE([libtool-lock],
   [AS_HELP_STRING([--disable-libtool-lock],
     [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -1312,9 +1337,46 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1333,10 +1395,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1355,10 +1417,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1376,19 +1438,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1396,7 +1459,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -1405,7 +1468,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -1421,7 +1484,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 ])# _LT_ENABLE_LOCK
 
 
@@ -1440,11 +1503,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      [echo conftest.$ac_objext > conftest.lst
       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
       AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	AC_TRY_EVAL([lt_ar_try])
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -1452,7 +1515,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      ])
   ])
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -1483,7 +1546,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -1519,7 +1582,7 @@ AC_CACHE_CHECK([$1], [$2],
   [$2=no
    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -1546,7 +1609,7 @@ AC_CACHE_CHECK([$1], [$2],
    $RM conftest*
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$5], , :, [$5])
 else
     m4_if([$6], , :, [$6])
@@ -1568,7 +1631,7 @@ AC_DEFUN([_LT_LINKER_OPTION],
 m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $3"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1587,10 +1650,10 @@ AC_CACHE_CHECK([$1], [$2],
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$4], , :, [$4])
 else
     m4_if([$5], , :, [$5])
@@ -1611,7 +1674,7 @@ AC_DEFUN([LT_CMD_MAX_LEN],
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -1651,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1702,22 +1765,22 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -1733,7 +1796,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   esac
 ])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 else
   AC_MSG_RESULT(none)
@@ -1761,7 +1824,7 @@ m4_defun([_LT_HEADER_DLFCN],
 # ----------------------------------------------------------------
 m4_defun([_LT_TRY_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1808,9 +1871,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -1836,7 +1899,7 @@ int main ()
   return status;
 }]
 _LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -1857,7 +1920,7 @@ rm -fr conftest*
 # ------------------
 AC_DEFUN([LT_SYS_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -1867,44 +1930,52 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
+	  [lt_cv_dlopen=shl_load],
       [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
 	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
+	      [lt_cv_dlopen=dlopen],
 	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
 	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
 	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
 	      ])
 	    ])
 	  ])
@@ -1913,21 +1984,21 @@ else
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1937,7 +2008,7 @@ else
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 	  lt_cv_dlopen_self_static, [dnl
@@ -1947,9 +2018,9 @@ else
       ])
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -2041,8 +2112,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS],
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 _LT_COMPILER_C_O([$1])
 
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
@@ -2052,8 +2123,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" !=
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
     need_locks=warn
   fi
 else
@@ -2080,8 +2151,8 @@ objdir=$lt_cv_objdir
 _LT_DECL([], [objdir], [0],
          [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
 
@@ -2093,15 +2164,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
 _LT_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
 
   # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
   else
@@ -2115,12 +2186,12 @@ else
 fi
 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -2144,7 +2215,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       AC_MSG_RESULT([yes])
@@ -2162,6 +2233,47 @@ _LT_DECL([], [striplib], [1])
 ])# _LT_CMD_STRIPLIB
 
 
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x at S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
 # _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
@@ -2172,17 +2284,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -2198,28 +2311,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -2233,7 +2353,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -2242,7 +2362,7 @@ fi])
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -2259,14 +2379,17 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[[4-9]]*)
@@ -2274,41 +2397,91 @@ aix[[4-9]]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -2318,18 +2491,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -2337,8 +2510,8 @@ beos*)
 bsdi[[45]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2350,7 +2523,7 @@ bsdi[[45]]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -2359,8 +2532,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -2376,17 +2549,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -2395,8 +2568,8 @@ m4_if([$1], [],[
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -2423,7 +2596,7 @@ m4_if([$1], [],[
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2436,8 +2609,8 @@ m4_if([$1], [],[
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -2450,7 +2623,7 @@ m4_if([$1], [],[
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -2463,8 +2636,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2477,8 +2650,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2496,12 +2669,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -2531,10 +2705,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -2552,14 +2726,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -2567,8 +2742,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -2577,8 +2752,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2591,8 +2766,8 @@ interix[[3-9]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2603,7 +2778,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -2611,8 +2786,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -2631,8 +2806,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -2641,13 +2816,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2672,7 +2867,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -2687,29 +2887,17 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -2719,7 +2907,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -2728,58 +2916,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -2790,8 +2988,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -2801,11 +2999,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -2813,8 +3011,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -2835,24 +3033,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -2870,7 +3068,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -2878,8 +3076,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2888,20 +3086,30 @@ uts4*)
   ;;
 esac
 AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
 _LT_DECL([], [variables_saved_for_relink], [1],
     [Variables whose values should be saved in libtool wrapper scripts and
     restored at link time])
@@ -2934,39 +3142,41 @@ _LT_DECL([], [hardcode_into_libs], [0],
     [Whether we should hardcode library paths into libraries])
 _LT_DECL([], [sys_lib_search_path_spec], [2],
     [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
 ])# _LT_SYS_DYNAMIC_LINKER
 
 
 # _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# find a file program which can recognize shared library
+# find a file program that can recognize shared library
 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
 [m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
 [[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -2989,11 +3199,11 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   AC_MSG_RESULT($MAGIC_CMD)
 else
@@ -3011,7 +3221,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
 
 # _LT_PATH_MAGIC
 # --------------
-# find a file program which can recognize a shared library
+# find a file program that can recognize a shared library
 m4_defun([_LT_PATH_MAGIC],
 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3038,16 +3248,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
 	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
+    [test no = "$withval" || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by $CC])
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3061,7 +3271,7 @@ if test "$GCC" = yes; then
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -3072,37 +3282,37 @@ if test "$GCC" = yes; then
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
 AC_CACHE_VAL(lt_cv_path_LD,
 [if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi])
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   AC_MSG_RESULT($LD)
 else
@@ -3156,13 +3366,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -3173,6 +3383,43 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+  [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
 # _LT_CHECK_MAGIC_METHOD
 # ----------------------
 # how to check for library dependencies
@@ -3188,13 +3435,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[[4-9]]*)
@@ -3221,8 +3468,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -3300,7 +3546,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -3318,8 +3564,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3372,6 +3618,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 ])
 
@@ -3412,33 +3661,38 @@ AC_DEFUN([LT_PATH_NM],
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3449,21 +3703,21 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -3471,8 +3725,8 @@ else
     esac
   fi
   AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -3518,8 +3772,8 @@ lt_cv_sharedlib_from_linklib_cmd,
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3531,7 +3785,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 ])
@@ -3558,13 +3812,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool
     lt_cv_path_mainfest_tool=yes
   fi
   rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
 ])# _LT_PATH_MANIFEST_TOOL
 
 
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -3576,11 +3845,11 @@ case $host in
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
   ;;
 *)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
   ;;
 esac
 AC_SUBST([LIBM])
@@ -3599,7 +3868,7 @@ m4_defun([_LT_COMPILER_NO_RTTI],
 
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3651,7 +3920,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[[ABCDGISTW]]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[[ABCDEGRST]]'
   fi
   ;;
@@ -3684,14 +3953,44 @@ case `$NM -V 2>&1` in
   symcode='[[ABCDGIRSTW]]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3709,21 +4008,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx]"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -3763,11 +4065,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@&t at _DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT@&t at _DLSYM_CONST
 #else
@@ -3793,7 +4095,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -3813,9 +4115,9 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -3836,7 +4138,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -3863,12 +4165,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
     [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
 _LT_DECL([global_symbol_to_c_name_address],
     [lt_cv_sys_global_symbol_to_c_name_address], [1],
     [Transform the output of nm in a C name address pair])
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
 _LT_DECL([], [nm_file_list_spec], [1],
     [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3884,17 +4190,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)=
 
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -3905,8 +4212,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -3922,6 +4229,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -3971,7 +4283,7 @@ m4_if([$1], [CXX], [
     case $host_os in
       aix[[4-9]]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
@@ -4012,14 +4324,14 @@ m4_if([$1], [CXX], [
 	case $cc_basename in
 	  CC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -4056,7 +4368,7 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4112,7 +4424,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      netbsd* | netbsdelf*-gnu)
+      netbsd*)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4201,17 +4513,18 @@ m4_if([$1], [CXX], [
   fi
 ],
 [
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4222,8 +4535,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4240,6 +4553,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4310,7 +4628,7 @@ m4_if([$1], [CXX], [
     case $host_os in
     aix*)
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
@@ -4318,11 +4636,30 @@ m4_if([$1], [CXX], [
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -4338,7 +4675,7 @@ m4_if([$1], [CXX], [
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -4349,7 +4686,7 @@ m4_if([$1], [CXX], [
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4374,6 +4711,12 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -4471,7 +4814,7 @@ m4_if([$1], [CXX], [
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
@@ -4500,7 +4843,7 @@ m4_if([$1], [CXX], [
   fi
 ])
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
@@ -4566,17 +4909,21 @@ m4_if([$1], [CXX], [
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
     else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -4589,9 +4936,6 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4625,9 +4969,9 @@ m4_if([$1], [CXX], [
   # included in the symbol list
   _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4643,7 +4987,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -4651,12 +4995,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4664,7 +5005,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -4686,24 +5027,24 @@ dnl Note also adjust exclude_expsyms for C++ above.
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4716,7 +5057,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     case $host_os in
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -4735,7 +5076,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -4751,7 +5092,7 @@ _LT_EOF
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4761,7 +5102,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -4769,61 +5110,89 @@ _LT_EOF
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4834,42 +5203,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4878,13 +5252,13 @@ _LT_EOF
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4902,8 +5276,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4915,7 +5289,7 @@ _LT_EOF
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -4930,9 +5304,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -4949,15 +5323,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
       runpath_var=
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4973,7 +5347,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -4981,34 +5355,57 @@ _LT_EOF
       ;;
 
     aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -5027,13 +5424,21 @@ _LT_EOF
       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -5052,62 +5457,80 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	_LT_TAGVAR(link_all_deplibs, $1)=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
         _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
 	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 3 [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -5116,7 +5539,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5146,16 +5569,17 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5164,18 +5588,18 @@ _LT_EOF
 	# Don't use ranlib
 	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -5184,7 +5608,7 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -5234,33 +5658,33 @@ _LT_EOF
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5268,25 +5692,25 @@ _LT_EOF
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	m4_if($1, [], [
@@ -5294,14 +5718,14 @@ _LT_EOF
 	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
 	  _LT_LINKER_OPTION([if $CC understands -b],
 	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
 	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
@@ -5312,7 +5736,7 @@ _LT_EOF
 	*)
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -5323,16 +5747,16 @@ _LT_EOF
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
 	# This should be the same for all languages, so no per-tag cache variable.
 	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
 	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	  [save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   AC_LINK_IFELSE(
 	     [AC_LANG_SOURCE(
 	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5345,22 +5769,32 @@ _LT_EOF
       end]])])],
 	      [lt_cv_irix_exported_symbol=yes],
 	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+           LDFLAGS=$save_LDFLAGS])
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(inherit_rpath, $1)=yes
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -5374,7 +5808,7 @@ _LT_EOF
     newsos6)
       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
@@ -5382,27 +5816,19 @@ _LT_EOF
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	fi
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5413,33 +5839,53 @@ _LT_EOF
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5450,24 +5896,24 @@ _LT_EOF
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -5477,11 +5923,11 @@ _LT_EOF
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
@@ -5491,10 +5937,10 @@ _LT_EOF
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -5543,43 +5989,43 @@ _LT_EOF
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -5594,17 +6040,17 @@ _LT_EOF
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
 	;;
       esac
     fi
   fi
 ])
 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
 
@@ -5621,7 +6067,7 @@ x|xyes)
   # Assume -lc should be added
   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -5701,12 +6147,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary])
 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
     library is relocated])
 _LT_TAGDECL([], [hardcode_minus_L], [0],
     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -5747,10 +6193,10 @@ dnl    [Compiler flag to generate thread safe objects])
 # ------------------------
 # Ensure that the configuration variables for a C compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_C_CONFIG],
 [m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
 AC_LANG_PUSH(C)
 
 # Source file extension for C test sources.
@@ -5790,18 +6236,18 @@ if test -n "$compiler"; then
   LT_SYS_DLOPEN_SELF
   _LT_CMD_STRIPLIB
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   AC_MSG_CHECKING([if libtool supports shared libraries])
   AC_MSG_RESULT([$can_build_shared])
 
   AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -5809,8 +6255,12 @@ if test -n "$compiler"; then
     ;;
 
   aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -5818,13 +6268,13 @@ if test -n "$compiler"; then
 
   AC_MSG_CHECKING([whether to build static libraries])
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   AC_MSG_RESULT([$enable_static])
 
   _LT_CONFIG($1)
 fi
 AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
@@ -5832,14 +6282,14 @@ CC="$lt_save_CC"
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   AC_PROG_CXXCPP
 else
   _lt_caught_CXX_error=yes
@@ -5881,7 +6331,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -5923,35 +6373,35 @@ if test "$_lt_caught_CXX_error" != yes; then
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
     else
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
       LT_PATH_LD
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=
         fi
@@ -5987,18 +6437,30 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=no
         ;;
       aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -6008,6 +6470,13 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        ;;
 	      esac
 	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
 	    ;;
           esac
 
@@ -6026,13 +6495,21 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          _LT_TAGVAR(hardcode_direct, $1)=no
+          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+          ;;
+        esac
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[[012]]|aix4.[[012]].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -6050,64 +6527,84 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # The "-G" linker flag allows undefined symbols.
+          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
           _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
 	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# [...]
+	    else
+	      # used by -dlpreopen to get the symbols
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
           fi
         fi
         ;;
@@ -6117,7 +6614,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6145,57 +6642,58 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 	  # Don't use ranlib
 	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  _LT_TAGVAR(always_export_symbols, $1)=no
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -6206,6 +6704,34 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
 
+      os2*)
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	shrext_cmds=.dll
+	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+
       dgux*)
         case $cc_basename in
           ec++*)
@@ -6241,14 +6767,14 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
         _LT_TAGVAR(hardcode_direct, $1)=yes
         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 				             # but as the default
@@ -6260,7 +6786,7 @@ if test "$_lt_caught_CXX_error" != yes; then
             _LT_TAGVAR(ld_shlibs, $1)=no
             ;;
           aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -6269,11 +6795,11 @@ if test "$_lt_caught_CXX_error" != yes; then
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6283,15 +6809,15 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
               ;;
           esac
         fi
@@ -6317,13 +6843,13 @@ if test "$_lt_caught_CXX_error" != yes; then
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -6334,20 +6860,20 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -6362,22 +6888,22 @@ if test "$_lt_caught_CXX_error" != yes; then
       interix[[3-9]]*)
 	_LT_TAGVAR(hardcode_direct, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -6386,17 +6912,17 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 	    ;;
         esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
@@ -6409,8 +6935,8 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -6419,10 +6945,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6436,59 +6962,59 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6502,18 +7028,18 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -6521,10 +7047,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
@@ -6582,22 +7108,17 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -6613,9 +7134,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	    # Archives containing C++ object files must be created using
@@ -6633,17 +7154,17 @@ if test "$_lt_caught_CXX_error" != yes; then
           cxx*)
 	    case $host in
 	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
 	    esac
@@ -6658,21 +7179,21 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -6718,9 +7239,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6728,7 +7249,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -6745,30 +7266,30 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -6776,11 +7297,11 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -6789,52 +7310,52 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
 	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
 	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
 	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-	      '"$_LT_TAGVAR(reload_cmds, $1)"
+              '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -6865,10 +7386,10 @@ if test "$_lt_caught_CXX_error" != yes; then
     esac
 
     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -6895,7 +7416,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
@@ -6917,13 +7438,14 @@ AC_REQUIRE([_LT_DECL_SED])
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
   esac
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
 
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -7007,13 +7529,13 @@ if AC_TRY_EVAL(ac_compile); then
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -7029,16 +7551,16 @@ if AC_TRY_EVAL(ac_compile); then
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
 	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -7046,9 +7568,9 @@ if AC_TRY_EVAL(ac_compile); then
 	 esac
        else
 	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)=$prev$p
 	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
 	 fi
        fi
        prev=
@@ -7063,15 +7585,15 @@ if AC_TRY_EVAL(ac_compile); then
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
+	   _LT_TAGVAR(predep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
 	 fi
        else
 	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	   _LT_TAGVAR(postdep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
 	 fi
@@ -7102,51 +7624,6 @@ interix[[3-9]]*)
   _LT_TAGVAR(postdep_objects,$1)=
   _LT_TAGVAR(postdeps,$1)=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 ])
 
@@ -7155,7 +7632,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in
 esac
  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
     [The directories searched by this compiler when creating a shared library])
@@ -7175,10 +7652,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
 [AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
   _lt_disable_F77=yes
 fi
 
@@ -7215,7 +7692,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the F77 compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
+if test yes != "$_lt_disable_F77"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7237,7 +7714,7 @@ if test "$_lt_disable_F77" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
@@ -7251,21 +7728,25 @@ if test "$_lt_disable_F77" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7273,11 +7754,11 @@ if test "$_lt_disable_F77" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7294,9 +7775,9 @@ if test "$_lt_disable_F77" != yes; then
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
@@ -7306,11 +7787,11 @@ AC_LANG_POP
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
 [AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
   _lt_disable_FC=yes
 fi
 
@@ -7347,7 +7828,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the FC compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
+if test yes != "$_lt_disable_FC"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7369,7 +7850,7 @@ if test "$_lt_disable_FC" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
@@ -7385,21 +7866,25 @@ if test "$_lt_disable_FC" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7407,11 +7892,11 @@ if test "$_lt_disable_FC" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7431,7 +7916,7 @@ if test "$_lt_disable_FC" != yes; then
   GCC=$lt_save_GCC
   CC=$lt_save_CC
   CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
+fi # test yes != "$_lt_disable_FC"
 
 AC_LANG_POP
 ])# _LT_LANG_FC_CONFIG
@@ -7441,7 +7926,7 @@ AC_LANG_POP
 # --------------------------
 # Ensure that the configuration variables for the GNU Java Compiler compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
@@ -7475,7 +7960,7 @@ CC=${GCJ-"gcj"}
 CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7512,7 +7997,7 @@ CFLAGS=$lt_save_CFLAGS
 # --------------------------
 # Ensure that the configuration variables for the GNU Go compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
@@ -7546,7 +8031,7 @@ CC=${GOC-"gccgo"}
 CFLAGS=$GOFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # Go did not exist at the time GCC didn't implicitly link libc in.
@@ -7583,7 +8068,7 @@ CFLAGS=$lt_save_CFLAGS
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
 AC_LANG_SAVE
@@ -7599,7 +8084,7 @@ _LT_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code=$lt_simple_compile_test_code
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -7609,7 +8094,7 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
 lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
@@ -7638,7 +8123,7 @@ AC_DEFUN([LT_PROG_GCJ],
 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
     [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
       AC_SUBST(GCJFLAGS)])])[]dnl
 ])
 
@@ -7749,7 +8234,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
+  test ! -f "$lt_ac_sed" && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7766,9 +8251,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
     cmp -s conftest.out conftest.nl || break
     # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
+    test 10 -lt "$lt_ac_count" && break
     lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
       lt_ac_max=$lt_ac_count
       lt_cv_path_SED=$lt_ac_sed
     fi
@@ -7792,27 +8277,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], [])
 # Find out whether the shell is Bourne or XSI compatible,
 # or has some other useful features.
 m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
   lt_unset=false
@@ -7836,102 +8301,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
 # _LT_PATH_CONVERSION_FUNCTIONS
 # -----------------------------
-# Determine which file name conversion functions should be used by
+# Determine what file name conversion functions should be used by
 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
 # for certain cross-compile configurations and native mingw.
 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 5d9acd8..94b0829 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # 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 ltoptions.m4
+# serial 8 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
 ])
 
 
@@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
+		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+		   [_LT_WITH_AIX_SONAME([aix])])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
@@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared],
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
@@ -226,14 +228,14 @@ AC_ARG_ENABLE([static],
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
@@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install],
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
 ])
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
 # _LT_WITH_PIC([MODE])
 # --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
 # LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC],
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+    [pic_mode=m4_default([$1], [default])])
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
@@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
index 9000a05..48bc934 100644
--- a/m4/ltsugar.m4
+++ b/m4/ltsugar.m4
@@ -1,6 +1,7 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -33,7 +34,7 @@ m4_define([_lt_join],
 # ------------
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -44,7 +45,7 @@ m4_define([lt_unquote], $1)
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index 07a8602..fa04b52 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
-#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3337 ltversion.m4
+# serial 4179 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
index c573da9..c6b26f8 100644
--- a/m4/lt~obsolete.m4
+++ b/m4/lt~obsolete.m4
@@ -1,6 +1,7 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,7 +12,7 @@
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 #
@@ -25,7 +26,7 @@
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
diff --git a/mclean b/mclean
deleted file mode 100755
index dbaa9ca..0000000
--- a/mclean
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-set -x
-find . -name Makefile -exec rm '{}' \;
-find . -name Makefile.in -exec rm '{}' \;
-rm m4/*
-cp /dev/null m4/empty
-rm configure config.guess config.sub config.h.in
-rm depcomp ltmain.sh compile missing install-sh
-rm 1
-rm ncdump/1
diff --git a/missing b/missing
index db98974..f62bbae 100755
--- a/missing
+++ b/missing
@@ -3,7 +3,7 @@
 
 scriptversion=2013-10-28.13; # UTC
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 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
diff --git a/nc-config.in b/nc-config.in
index 4a243a3..c9345fe 100644
--- a/nc-config.in
+++ b/nc-config.in
@@ -6,12 +6,10 @@
 
 prefix=@prefix@
 exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
 includedir=${prefix}/include
 
 cc="@CC@"
 cflags=" -I${includedir} @CPPFLAGS@" 
-libs="-L${libdir} @NC_LIBS@"
 has_dap="@HAS_DAP@"
 has_nc2="@HAS_NC2@"
 has_nc4="@HAS_NC4@"
@@ -182,7 +180,7 @@ while test $# -gt 0; do
        	;;
 
      --libs)
-       	echo $libs
+       	pkg-config netcdf --libs
        	;;
 
     --prefix)
diff --git a/nc_test/CMakeLists.txt b/nc_test/CMakeLists.txt
index 8cecb2a..00d4f82 100644
--- a/nc_test/CMakeLists.txt
+++ b/nc_test/CMakeLists.txt
@@ -30,6 +30,7 @@ ENDIF()
 
 IF(USE_NETCDF4)
   SET(TESTS ${TESTS} tst_atts)
+  SET(TESTS ${TESTS} tst_put_vars)
 ENDIF()
 
 IF(USE_PNETCDF)
diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am
index 40b1324..612d1ca 100644
--- a/nc_test/Makefile.am
+++ b/nc_test/Makefile.am
@@ -12,14 +12,14 @@ CLEANFILES = nc_test_classic.nc nc_test_64bit.nc nc_test_netcdf4.nc	\
 tst_*.nc t_nc.nc large_files.nc quick_large_files.nc \
 tst_diskless.nc tst_diskless2.nc \
 tst_diskless3.nc tst_diskless3_file.cdl tst_diskless3_memory.cdl \
-tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc
+tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc unlim.nc
 
 # These are the tests which are always run.
 TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names	\
 tst_nofill tst_nofill2 tst_nofill3 tst_atts3 tst_meta
 
 if USE_NETCDF4
-TESTPROGRAMS += tst_atts
+TESTPROGRAMS += tst_atts tst_put_vars
 endif
 
 if USE_PNETCDF
diff --git a/nc_test/Makefile.in b/nc_test/Makefile.in
index 80fe923..c964905 100644
--- a/nc_test/Makefile.in
+++ b/nc_test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,17 @@
 # libraries for netCDF-4.
 #
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -91,14 +101,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
 @BUILD_DLL_TRUE at am__append_2 = -DDLL_NETCDF
- at USE_NETCDF4_TRUE@am__append_3 = tst_atts
+ at USE_NETCDF4_TRUE@am__append_3 = tst_atts tst_put_vars
 @USE_PNETCDF_TRUE at am__append_4 = tst_parallel2 tst_pnetcdf tst_formatx_pnetcdf
 
 # If the user asked for large file tests, then add them.
@@ -127,11 +134,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
- at USE_NETCDF4_TRUE@am__EXEEXT_1 = tst_atts$(EXEEXT)
+ at USE_NETCDF4_TRUE@am__EXEEXT_1 = tst_atts$(EXEEXT) \
+ at USE_NETCDF4_TRUE@	tst_put_vars$(EXEEXT)
 @USE_PNETCDF_TRUE at am__EXEEXT_2 = tst_parallel2$(EXEEXT) \
 @USE_PNETCDF_TRUE@	tst_pnetcdf$(EXEEXT) \
 @USE_PNETCDF_TRUE@	tst_formatx_pnetcdf$(EXEEXT)
@@ -264,6 +273,10 @@ tst_pnetcdf_SOURCES = tst_pnetcdf.c
 tst_pnetcdf_OBJECTS = tst_pnetcdf.$(OBJEXT)
 tst_pnetcdf_LDADD = $(LDADD)
 tst_pnetcdf_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+tst_put_vars_SOURCES = tst_put_vars.c
+tst_put_vars_OBJECTS = tst_put_vars.$(OBJEXT)
+tst_put_vars_LDADD = $(LDADD)
+tst_put_vars_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
 tst_small_SOURCES = tst_small.c
 tst_small_OBJECTS = tst_small.$(OBJEXT)
 tst_small_LDADD = $(LDADD)
@@ -308,14 +321,16 @@ SOURCES = large_files.c $(nc_test_SOURCES) quick_large_files.c t_nc.c \
 	tst_diskless2.c tst_diskless3.c tst_diskless4.c \
 	tst_formatx_pnetcdf.c tst_large.c tst_meta.c tst_misc.c \
 	tst_names.c tst_nofill.c tst_nofill2.c tst_nofill3.c \
-	tst_norm.c tst_parallel2.c tst_pnetcdf.c tst_small.c
+	tst_norm.c tst_parallel2.c tst_pnetcdf.c tst_put_vars.c \
+	tst_small.c
 DIST_SOURCES = large_files.c $(nc_test_SOURCES) quick_large_files.c \
 	t_nc.c $(am__testnc3perf_SOURCES_DIST) tst_atts.c tst_atts3.c \
 	tst_big_rvar.c tst_big_var.c tst_big_var2.c tst_big_var6.c \
 	tst_diskless.c tst_diskless2.c tst_diskless3.c tst_diskless4.c \
 	tst_formatx_pnetcdf.c tst_large.c tst_meta.c tst_misc.c \
 	tst_names.c tst_nofill.c tst_nofill2.c tst_nofill3.c \
-	tst_norm.c tst_parallel2.c tst_pnetcdf.c tst_small.c
+	tst_norm.c tst_parallel2.c tst_pnetcdf.c tst_put_vars.c \
+	tst_small.c
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -544,6 +559,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -593,6 +610,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -608,10 +626,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -646,8 +666,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -716,7 +738,7 @@ CLEANFILES = nc_test_classic.nc nc_test_64bit.nc nc_test_netcdf4.nc \
 	tst_*.nc t_nc.nc large_files.nc quick_large_files.nc \
 	tst_diskless.nc tst_diskless2.nc tst_diskless3.nc \
 	tst_diskless3_file.cdl tst_diskless3_memory.cdl \
-	tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc \
+	tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc unlim.nc \
 	$(am__append_7)
 
 # These are the tests which are always run.
@@ -765,7 +787,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign nc_test/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign nc_test/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -774,7 +795,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -898,6 +919,10 @@ tst_pnetcdf$(EXEEXT): $(tst_pnetcdf_OBJECTS) $(tst_pnetcdf_DEPENDENCIES) $(EXTRA
 	@rm -f tst_pnetcdf$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tst_pnetcdf_OBJECTS) $(tst_pnetcdf_LDADD) $(LIBS)
 
+tst_put_vars$(EXEEXT): $(tst_put_vars_OBJECTS) $(tst_put_vars_DEPENDENCIES) $(EXTRA_tst_put_vars_DEPENDENCIES) 
+	@rm -f tst_put_vars$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tst_put_vars_OBJECTS) $(tst_put_vars_LDADD) $(LIBS)
+
 tst_small$(EXEEXT): $(tst_small_OBJECTS) $(tst_small_DEPENDENCIES) $(EXTRA_tst_small_DEPENDENCIES) 
 	@rm -f tst_small$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tst_small_OBJECTS) $(tst_small_LDADD) $(LIBS)
@@ -939,6 +964,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_norm.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_parallel2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_pnetcdf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_put_vars.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_small.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util.Po at am__quote@
 
@@ -1054,7 +1080,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1249,6 +1275,13 @@ tst_atts.log: tst_atts$(EXEEXT)
 	--log-file $$b.log --trs-file $$b.trs \
 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
 	"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_put_vars.log: tst_put_vars$(EXEEXT)
+	@p='tst_put_vars$(EXEEXT)'; \
+	b='tst_put_vars'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 tst_parallel2.log: tst_parallel2$(EXEEXT)
 	@p='tst_parallel2$(EXEEXT)'; \
 	b='tst_parallel2'; \
@@ -1533,6 +1566,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	recheck tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 #EXTRA_DIST += ${nc_test_SOURCES}
 
diff --git a/nc_test/test_get.c b/nc_test/test_get.c
index 0395438..d22a990 100644
--- a/nc_test/test_get.c
+++ b/nc_test/test_get.c
@@ -1,12388 +1,6227 @@
-#line 5 "test_get.m4"
 /* Do not edit this file. It is produced from the corresponding .m4 source */
-#line 7
 /*********************************************************************
  *   Copyright 1996, UCAR/Unidata
  *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
  *   $Id: test_get.m4,v 1.16 2005/03/08 03:04:19 ed Exp $
  *********************************************************************/
 
-#line 31
 
 #include "tests.h"
 
-#line 116
 
 void
-#line 117
 test_nc_get_var1_text(void)
-#line 117
 {
-#line 117
     int ncid;
-#line 117
     int i;
-#line 117
     int j;
-#line 117
     int err;
-#line 117
     int nok = 0;      /* count of valid comparisons */
-#line 117
     size_t index[MAX_RANK];
-#line 117
     double expect;
-#line 117
     int canConvert;     /* Both text or both numeric */
-#line 117
     text value;
-#line 117
 
-#line 117
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 117
     IF (err)
-#line 117
 	error("nc_open: %s", nc_strerror(err));
-#line 117
     for (i = 0; i < NVARS; i++) {
-#line 117
         canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 117
 	for (j = 0; j < var_rank[i]; j++)
-#line 117
 	    index[j] = 0;
-#line 117
         err = nc_get_var1_text(BAD_ID, i, index, &value);
-#line 117
         IF (err != NC_EBADID)
-#line 117
 	    error("bad ncid: status = %d", err);
-#line 117
         err = nc_get_var1_text(ncid, BAD_VARID, index, &value);
-#line 117
         IF (err != NC_ENOTVAR)
-#line 117
 	    error("bad var id: status = %d", err);
-#line 117
 	for (j = 0; j < var_rank[i]; j++) {
-#line 117
 	    index[j] = var_shape[i][j];
-#line 117
 	    err = nc_get_var1_text(ncid, i, index, &value);
-#line 117
 	    if(!canConvert) {
-#line 117
 		IF(err != NC_ECHAR)
-#line 117
 			error("conversion: status = %d", err);
-#line 117
 	    } else IF (err != NC_EINVALCOORDS)
-#line 117
 		error("bad index: status = %d", err);
-#line 117
 	    index[j] = 0;
-#line 117
 	}
-#line 117
 	for (j = 0; j < var_nels[i]; j++) {
-#line 117
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 117
 	    IF (err)
-#line 117
 		error("error in toMixedBase 1");
-#line 117
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_TEXT );
-#line 117
 	    if (var_rank[i] == 0 && i%2 )
-#line 117
 		err = nc_get_var1_text(ncid, i, NULL, &value);
-#line 117
 	    else
-#line 117
 		err = nc_get_var1_text(ncid, i, index, &value);
-#line 117
             if (canConvert) {
-#line 117
 		if (inRange3(expect,var_type[i], NCT_TEXT)) {
-#line 117
 		    if (expect >= text_min && expect <= text_max) {
-#line 117
 			IF (err) {
-#line 117
 			    error("%s", nc_strerror(err));
-#line 117
 			} else {
-#line 117
 			    IF (!equal(value,expect,var_type[i],NCT_TEXT)) {
-#line 117
 				error("expected: %G, got: %G", expect,
-#line 117
 				    (double) value);
-#line 117
 			    } else {
-#line 117
 				nok++;
-#line 117
 			    }
-#line 117
 			}
-#line 117
 		    } else {
-#line 117
 			IF (err != NC_ERANGE)
-#line 117
 			    error("Range error: status = %d", err);
-#line 117
 		    }
-#line 117
                 } else {
-#line 117
                     IF (err != 0 && err != NC_ERANGE)
-#line 117
                         error("OK or Range error: status = %d", err);
-#line 117
 		}
-#line 117
 	    } else {
-#line 117
 		IF (err != NC_ECHAR)
-#line 117
 		    error("wrong type: status = %d", err);
-#line 117
 	    }
-#line 117
 	}
-#line 117
     }
-#line 117
     err = nc_close(ncid);
-#line 117
     IF (err)
-#line 117
 	error("nc_close: %s", nc_strerror(err));
-#line 117
     print_nok(nok);
-#line 117
 }
-#line 117
 
 void
-#line 118
 test_nc_get_var1_uchar(void)
-#line 118
 {
-#line 118
     int ncid;
-#line 118
     int i;
-#line 118
     int j;
-#line 118
     int err;
-#line 118
     int nok = 0;      /* count of valid comparisons */
-#line 118
     size_t index[MAX_RANK];
-#line 118
     double expect;
-#line 118
     int canConvert;     /* Both text or both numeric */
-#line 118
     uchar value;
-#line 118
 
-#line 118
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 118
     IF (err)
-#line 118
 	error("nc_open: %s", nc_strerror(err));
-#line 118
     for (i = 0; i < NVARS; i++) {
-#line 118
         canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 118
 	for (j = 0; j < var_rank[i]; j++)
-#line 118
 	    index[j] = 0;
-#line 118
         err = nc_get_var1_uchar(BAD_ID, i, index, &value);
-#line 118
         IF (err != NC_EBADID)
-#line 118
 	    error("bad ncid: status = %d", err);
-#line 118
         err = nc_get_var1_uchar(ncid, BAD_VARID, index, &value);
-#line 118
         IF (err != NC_ENOTVAR)
-#line 118
 	    error("bad var id: status = %d", err);
-#line 118
 	for (j = 0; j < var_rank[i]; j++) {
-#line 118
 	    index[j] = var_shape[i][j];
-#line 118
 	    err = nc_get_var1_uchar(ncid, i, index, &value);
-#line 118
 	    if(!canConvert) {
-#line 118
 		IF(err != NC_ECHAR)
-#line 118
 			error("conversion: status = %d", err);
-#line 118
 	    } else IF (err != NC_EINVALCOORDS)
-#line 118
 		error("bad index: status = %d", err);
-#line 118
 	    index[j] = 0;
-#line 118
 	}
-#line 118
 	for (j = 0; j < var_nels[i]; j++) {
-#line 118
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 118
 	    IF (err)
-#line 118
 		error("error in toMixedBase 1");
-#line 118
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_UCHAR );
-#line 118
 	    if (var_rank[i] == 0 && i%2 )
-#line 118
 		err = nc_get_var1_uchar(ncid, i, NULL, &value);
-#line 118
 	    else
-#line 118
 		err = nc_get_var1_uchar(ncid, i, index, &value);
-#line 118
             if (canConvert) {
-#line 118
 		if (inRange3(expect,var_type[i], NCT_UCHAR)) {
-#line 118
 		    if (expect >= uchar_min && expect <= uchar_max) {
-#line 118
 			IF (err) {
-#line 118
 			    error("%s", nc_strerror(err));
-#line 118
 			} else {
-#line 118
 			    IF (!equal(value,expect,var_type[i],NCT_UCHAR)) {
-#line 118
 				error("expected: %G, got: %G", expect,
-#line 118
 				    (double) value);
-#line 118
 			    } else {
-#line 118
 				nok++;
-#line 118
 			    }
-#line 118
 			}
-#line 118
 		    } else {
-#line 118
 			IF (err != NC_ERANGE)
-#line 118
 			    error("Range error: status = %d", err);
-#line 118
 		    }
-#line 118
                 } else {
-#line 118
                     IF (err != 0 && err != NC_ERANGE)
-#line 118
                         error("OK or Range error: status = %d", err);
-#line 118
 		}
-#line 118
 	    } else {
-#line 118
 		IF (err != NC_ECHAR)
-#line 118
 		    error("wrong type: status = %d", err);
-#line 118
 	    }
-#line 118
 	}
-#line 118
     }
-#line 118
     err = nc_close(ncid);
-#line 118
     IF (err)
-#line 118
 	error("nc_close: %s", nc_strerror(err));
-#line 118
     print_nok(nok);
-#line 118
 }
-#line 118
 
 void
-#line 119
 test_nc_get_var1_schar(void)
-#line 119
 {
-#line 119
     int ncid;
-#line 119
     int i;
-#line 119
     int j;
-#line 119
     int err;
-#line 119
     int nok = 0;      /* count of valid comparisons */
-#line 119
     size_t index[MAX_RANK];
-#line 119
     double expect;
-#line 119
     int canConvert;     /* Both text or both numeric */
-#line 119
     schar value;
-#line 119
 
-#line 119
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 119
     IF (err)
-#line 119
 	error("nc_open: %s", nc_strerror(err));
-#line 119
     for (i = 0; i < NVARS; i++) {
-#line 119
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 119
 	for (j = 0; j < var_rank[i]; j++)
-#line 119
 	    index[j] = 0;
-#line 119
         err = nc_get_var1_schar(BAD_ID, i, index, &value);
-#line 119
         IF (err != NC_EBADID)
-#line 119
 	    error("bad ncid: status = %d", err);
-#line 119
         err = nc_get_var1_schar(ncid, BAD_VARID, index, &value);
-#line 119
         IF (err != NC_ENOTVAR)
-#line 119
 	    error("bad var id: status = %d", err);
-#line 119
 	for (j = 0; j < var_rank[i]; j++) {
-#line 119
 	    index[j] = var_shape[i][j];
-#line 119
 	    err = nc_get_var1_schar(ncid, i, index, &value);
-#line 119
 	    if(!canConvert) {
-#line 119
 		IF(err != NC_ECHAR)
-#line 119
 			error("conversion: status = %d", err);
-#line 119
 	    } else IF (err != NC_EINVALCOORDS)
-#line 119
 		error("bad index: status = %d", err);
-#line 119
 	    index[j] = 0;
-#line 119
 	}
-#line 119
 	for (j = 0; j < var_nels[i]; j++) {
-#line 119
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 119
 	    IF (err)
-#line 119
 		error("error in toMixedBase 1");
-#line 119
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_SCHAR );
-#line 119
 	    if (var_rank[i] == 0 && i%2 )
-#line 119
 		err = nc_get_var1_schar(ncid, i, NULL, &value);
-#line 119
 	    else
-#line 119
 		err = nc_get_var1_schar(ncid, i, index, &value);
-#line 119
             if (canConvert) {
-#line 119
 		if (inRange3(expect,var_type[i], NCT_SCHAR)) {
-#line 119
 		    if (expect >= schar_min && expect <= schar_max) {
-#line 119
 			IF (err) {
-#line 119
 			    error("%s", nc_strerror(err));
-#line 119
 			} else {
-#line 119
 			    IF (!equal(value,expect,var_type[i],NCT_SCHAR)) {
-#line 119
 				error("expected: %G, got: %G", expect,
-#line 119
 				    (double) value);
-#line 119
 			    } else {
-#line 119
 				nok++;
-#line 119
 			    }
-#line 119
 			}
-#line 119
 		    } else {
-#line 119
 			IF (err != NC_ERANGE)
-#line 119
 			    error("Range error: status = %d", err);
-#line 119
 		    }
-#line 119
                 } else {
-#line 119
                     IF (err != 0 && err != NC_ERANGE)
-#line 119
                         error("OK or Range error: status = %d", err);
-#line 119
 		}
-#line 119
 	    } else {
-#line 119
 		IF (err != NC_ECHAR)
-#line 119
 		    error("wrong type: status = %d", err);
-#line 119
 	    }
-#line 119
 	}
-#line 119
     }
-#line 119
     err = nc_close(ncid);
-#line 119
     IF (err)
-#line 119
 	error("nc_close: %s", nc_strerror(err));
-#line 119
     print_nok(nok);
-#line 119
 }
-#line 119
 
 void
-#line 120
 test_nc_get_var1_short(void)
-#line 120
 {
-#line 120
     int ncid;
-#line 120
     int i;
-#line 120
     int j;
-#line 120
     int err;
-#line 120
     int nok = 0;      /* count of valid comparisons */
-#line 120
     size_t index[MAX_RANK];
-#line 120
     double expect;
-#line 120
     int canConvert;     /* Both text or both numeric */
-#line 120
     short value;
-#line 120
 
-#line 120
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 120
     IF (err)
-#line 120
 	error("nc_open: %s", nc_strerror(err));
-#line 120
     for (i = 0; i < NVARS; i++) {
-#line 120
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 120
 	for (j = 0; j < var_rank[i]; j++)
-#line 120
 	    index[j] = 0;
-#line 120
         err = nc_get_var1_short(BAD_ID, i, index, &value);
-#line 120
         IF (err != NC_EBADID)
-#line 120
 	    error("bad ncid: status = %d", err);
-#line 120
         err = nc_get_var1_short(ncid, BAD_VARID, index, &value);
-#line 120
         IF (err != NC_ENOTVAR)
-#line 120
 	    error("bad var id: status = %d", err);
-#line 120
 	for (j = 0; j < var_rank[i]; j++) {
-#line 120
 	    index[j] = var_shape[i][j];
-#line 120
 	    err = nc_get_var1_short(ncid, i, index, &value);
-#line 120
 	    if(!canConvert) {
-#line 120
 		IF(err != NC_ECHAR)
-#line 120
 			error("conversion: status = %d", err);
-#line 120
 	    } else IF (err != NC_EINVALCOORDS)
-#line 120
 		error("bad index: status = %d", err);
-#line 120
 	    index[j] = 0;
-#line 120
 	}
-#line 120
 	for (j = 0; j < var_nels[i]; j++) {
-#line 120
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 120
 	    IF (err)
-#line 120
 		error("error in toMixedBase 1");
-#line 120
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_SHORT );
-#line 120
 	    if (var_rank[i] == 0 && i%2 )
-#line 120
 		err = nc_get_var1_short(ncid, i, NULL, &value);
-#line 120
 	    else
-#line 120
 		err = nc_get_var1_short(ncid, i, index, &value);
-#line 120
             if (canConvert) {
-#line 120
 		if (inRange3(expect,var_type[i], NCT_SHORT)) {
-#line 120
 		    if (expect >= short_min && expect <= short_max) {
-#line 120
 			IF (err) {
-#line 120
 			    error("%s", nc_strerror(err));
-#line 120
 			} else {
-#line 120
 			    IF (!equal(value,expect,var_type[i],NCT_SHORT)) {
-#line 120
 				error("expected: %G, got: %G", expect,
-#line 120
 				    (double) value);
-#line 120
 			    } else {
-#line 120
 				nok++;
-#line 120
 			    }
-#line 120
 			}
-#line 120
 		    } else {
-#line 120
 			IF (err != NC_ERANGE)
-#line 120
 			    error("Range error: status = %d", err);
-#line 120
 		    }
-#line 120
                 } else {
-#line 120
                     IF (err != 0 && err != NC_ERANGE)
-#line 120
                         error("OK or Range error: status = %d", err);
-#line 120
 		}
-#line 120
 	    } else {
-#line 120
 		IF (err != NC_ECHAR)
-#line 120
 		    error("wrong type: status = %d", err);
-#line 120
 	    }
-#line 120
 	}
-#line 120
     }
-#line 120
     err = nc_close(ncid);
-#line 120
     IF (err)
-#line 120
 	error("nc_close: %s", nc_strerror(err));
-#line 120
     print_nok(nok);
-#line 120
 }
-#line 120
 
 void
-#line 121
 test_nc_get_var1_int(void)
-#line 121
 {
-#line 121
     int ncid;
-#line 121
     int i;
-#line 121
     int j;
-#line 121
     int err;
-#line 121
     int nok = 0;      /* count of valid comparisons */
-#line 121
     size_t index[MAX_RANK];
-#line 121
     double expect;
-#line 121
     int canConvert;     /* Both text or both numeric */
-#line 121
     int value;
-#line 121
 
-#line 121
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 121
     IF (err)
-#line 121
 	error("nc_open: %s", nc_strerror(err));
-#line 121
     for (i = 0; i < NVARS; i++) {
-#line 121
         canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 121
 	for (j = 0; j < var_rank[i]; j++)
-#line 121
 	    index[j] = 0;
-#line 121
         err = nc_get_var1_int(BAD_ID, i, index, &value);
-#line 121
         IF (err != NC_EBADID)
-#line 121
 	    error("bad ncid: status = %d", err);
-#line 121
         err = nc_get_var1_int(ncid, BAD_VARID, index, &value);
-#line 121
         IF (err != NC_ENOTVAR)
-#line 121
 	    error("bad var id: status = %d", err);
-#line 121
 	for (j = 0; j < var_rank[i]; j++) {
-#line 121
 	    index[j] = var_shape[i][j];
-#line 121
 	    err = nc_get_var1_int(ncid, i, index, &value);
-#line 121
 	    if(!canConvert) {
-#line 121
 		IF(err != NC_ECHAR)
-#line 121
 			error("conversion: status = %d", err);
-#line 121
 	    } else IF (err != NC_EINVALCOORDS)
-#line 121
 		error("bad index: status = %d", err);
-#line 121
 	    index[j] = 0;
-#line 121
 	}
-#line 121
 	for (j = 0; j < var_nels[i]; j++) {
-#line 121
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 121
 	    IF (err)
-#line 121
 		error("error in toMixedBase 1");
-#line 121
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_INT );
-#line 121
 	    if (var_rank[i] == 0 && i%2 )
-#line 121
 		err = nc_get_var1_int(ncid, i, NULL, &value);
-#line 121
 	    else
-#line 121
 		err = nc_get_var1_int(ncid, i, index, &value);
-#line 121
             if (canConvert) {
-#line 121
 		if (inRange3(expect,var_type[i], NCT_INT)) {
-#line 121
 		    if (expect >= int_min && expect <= int_max) {
-#line 121
 			IF (err) {
-#line 121
 			    error("%s", nc_strerror(err));
-#line 121
 			} else {
-#line 121
 			    IF (!equal(value,expect,var_type[i],NCT_INT)) {
-#line 121
 				error("expected: %G, got: %G", expect,
-#line 121
 				    (double) value);
-#line 121
 			    } else {
-#line 121
 				nok++;
-#line 121
 			    }
-#line 121
 			}
-#line 121
 		    } else {
-#line 121
 			IF (err != NC_ERANGE)
-#line 121
 			    error("Range error: status = %d", err);
-#line 121
 		    }
-#line 121
                 } else {
-#line 121
                     IF (err != 0 && err != NC_ERANGE)
-#line 121
                         error("OK or Range error: status = %d", err);
-#line 121
 		}
-#line 121
 	    } else {
-#line 121
 		IF (err != NC_ECHAR)
-#line 121
 		    error("wrong type: status = %d", err);
-#line 121
 	    }
-#line 121
 	}
-#line 121
     }
-#line 121
     err = nc_close(ncid);
-#line 121
     IF (err)
-#line 121
 	error("nc_close: %s", nc_strerror(err));
-#line 121
     print_nok(nok);
-#line 121
 }
-#line 121
 
 void
-#line 122
 test_nc_get_var1_long(void)
-#line 122
 {
-#line 122
     int ncid;
-#line 122
     int i;
-#line 122
     int j;
-#line 122
     int err;
-#line 122
     int nok = 0;      /* count of valid comparisons */
-#line 122
     size_t index[MAX_RANK];
-#line 122
     double expect;
-#line 122
     int canConvert;     /* Both text or both numeric */
-#line 122
     long value;
-#line 122
 
-#line 122
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 122
     IF (err)
-#line 122
 	error("nc_open: %s", nc_strerror(err));
-#line 122
     for (i = 0; i < NVARS; i++) {
-#line 122
         canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 122
 	for (j = 0; j < var_rank[i]; j++)
-#line 122
 	    index[j] = 0;
-#line 122
         err = nc_get_var1_long(BAD_ID, i, index, &value);
-#line 122
         IF (err != NC_EBADID)
-#line 122
 	    error("bad ncid: status = %d", err);
-#line 122
         err = nc_get_var1_long(ncid, BAD_VARID, index, &value);
-#line 122
         IF (err != NC_ENOTVAR)
-#line 122
 	    error("bad var id: status = %d", err);
-#line 122
 	for (j = 0; j < var_rank[i]; j++) {
-#line 122
 	    index[j] = var_shape[i][j];
-#line 122
 	    err = nc_get_var1_long(ncid, i, index, &value);
-#line 122
 	    if(!canConvert) {
-#line 122
 		IF(err != NC_ECHAR)
-#line 122
 			error("conversion: status = %d", err);
-#line 122
 	    } else IF (err != NC_EINVALCOORDS)
-#line 122
 		error("bad index: status = %d", err);
-#line 122
 	    index[j] = 0;
-#line 122
 	}
-#line 122
 	for (j = 0; j < var_nels[i]; j++) {
-#line 122
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 122
 	    IF (err)
-#line 122
 		error("error in toMixedBase 1");
-#line 122
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_LONG );
-#line 122
 	    if (var_rank[i] == 0 && i%2 )
-#line 122
 		err = nc_get_var1_long(ncid, i, NULL, &value);
-#line 122
 	    else
-#line 122
 		err = nc_get_var1_long(ncid, i, index, &value);
-#line 122
             if (canConvert) {
-#line 122
 		if (inRange3(expect,var_type[i], NCT_LONG)) {
-#line 122
 		    if (expect >= long_min && expect <= long_max) {
-#line 122
 			IF (err) {
-#line 122
 			    error("%s", nc_strerror(err));
-#line 122
 			} else {
-#line 122
 			    IF (!equal(value,expect,var_type[i],NCT_LONG)) {
-#line 122
 				error("expected: %G, got: %G", expect,
-#line 122
 				    (double) value);
-#line 122
 			    } else {
-#line 122
 				nok++;
-#line 122
 			    }
-#line 122
 			}
-#line 122
 		    } else {
-#line 122
 			IF (err != NC_ERANGE)
-#line 122
 			    error("Range error: status = %d", err);
-#line 122
 		    }
-#line 122
                 } else {
-#line 122
                     IF (err != 0 && err != NC_ERANGE)
-#line 122
                         error("OK or Range error: status = %d", err);
-#line 122
 		}
-#line 122
 	    } else {
-#line 122
 		IF (err != NC_ECHAR)
-#line 122
 		    error("wrong type: status = %d", err);
-#line 122
 	    }
-#line 122
 	}
-#line 122
     }
-#line 122
     err = nc_close(ncid);
-#line 122
     IF (err)
-#line 122
 	error("nc_close: %s", nc_strerror(err));
-#line 122
     print_nok(nok);
-#line 122
 }
-#line 122
 
 void
-#line 123
 test_nc_get_var1_float(void)
-#line 123
 {
-#line 123
     int ncid;
-#line 123
     int i;
-#line 123
     int j;
-#line 123
     int err;
-#line 123
     int nok = 0;      /* count of valid comparisons */
-#line 123
     size_t index[MAX_RANK];
-#line 123
     double expect;
-#line 123
     int canConvert;     /* Both text or both numeric */
-#line 123
     float value;
-#line 123
 
-#line 123
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 123
     IF (err)
-#line 123
 	error("nc_open: %s", nc_strerror(err));
-#line 123
     for (i = 0; i < NVARS; i++) {
-#line 123
         canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 123
 	for (j = 0; j < var_rank[i]; j++)
-#line 123
 	    index[j] = 0;
-#line 123
         err = nc_get_var1_float(BAD_ID, i, index, &value);
-#line 123
         IF (err != NC_EBADID)
-#line 123
 	    error("bad ncid: status = %d", err);
-#line 123
         err = nc_get_var1_float(ncid, BAD_VARID, index, &value);
-#line 123
         IF (err != NC_ENOTVAR)
-#line 123
 	    error("bad var id: status = %d", err);
-#line 123
 	for (j = 0; j < var_rank[i]; j++) {
-#line 123
 	    index[j] = var_shape[i][j];
-#line 123
 	    err = nc_get_var1_float(ncid, i, index, &value);
-#line 123
 	    if(!canConvert) {
-#line 123
 		IF(err != NC_ECHAR)
-#line 123
 			error("conversion: status = %d", err);
-#line 123
 	    } else IF (err != NC_EINVALCOORDS)
-#line 123
 		error("bad index: status = %d", err);
-#line 123
 	    index[j] = 0;
-#line 123
 	}
-#line 123
 	for (j = 0; j < var_nels[i]; j++) {
-#line 123
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 123
 	    IF (err)
-#line 123
 		error("error in toMixedBase 1");
-#line 123
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_FLOAT );
-#line 123
 	    if (var_rank[i] == 0 && i%2 )
-#line 123
 		err = nc_get_var1_float(ncid, i, NULL, &value);
-#line 123
 	    else
-#line 123
 		err = nc_get_var1_float(ncid, i, index, &value);
-#line 123
             if (canConvert) {
-#line 123
 		if (inRange3(expect,var_type[i], NCT_FLOAT)) {
-#line 123
 		    if (expect >= float_min && expect <= float_max) {
-#line 123
 			IF (err) {
-#line 123
 			    error("%s", nc_strerror(err));
-#line 123
 			} else {
-#line 123
 			    IF (!equal(value,expect,var_type[i],NCT_FLOAT)) {
-#line 123
 				error("expected: %G, got: %G", expect,
-#line 123
 				    (double) value);
-#line 123
 			    } else {
-#line 123
 				nok++;
-#line 123
 			    }
-#line 123
 			}
-#line 123
 		    } else {
-#line 123
 			IF (err != NC_ERANGE)
-#line 123
 			    error("Range error: status = %d", err);
-#line 123
 		    }
-#line 123
                 } else {
-#line 123
                     IF (err != 0 && err != NC_ERANGE)
-#line 123
                         error("OK or Range error: status = %d", err);
-#line 123
 		}
-#line 123
 	    } else {
-#line 123
 		IF (err != NC_ECHAR)
-#line 123
 		    error("wrong type: status = %d", err);
-#line 123
 	    }
-#line 123
 	}
-#line 123
     }
-#line 123
     err = nc_close(ncid);
-#line 123
     IF (err)
-#line 123
 	error("nc_close: %s", nc_strerror(err));
-#line 123
     print_nok(nok);
-#line 123
 }
-#line 123
 
 void
-#line 124
 test_nc_get_var1_double(void)
-#line 124
 {
-#line 124
     int ncid;
-#line 124
     int i;
-#line 124
     int j;
-#line 124
     int err;
-#line 124
     int nok = 0;      /* count of valid comparisons */
-#line 124
     size_t index[MAX_RANK];
-#line 124
     double expect;
-#line 124
     int canConvert;     /* Both text or both numeric */
-#line 124
     double value;
-#line 124
 
-#line 124
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 124
     IF (err)
-#line 124
 	error("nc_open: %s", nc_strerror(err));
-#line 124
     for (i = 0; i < NVARS; i++) {
-#line 124
         canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 124
 	for (j = 0; j < var_rank[i]; j++)
-#line 124
 	    index[j] = 0;
-#line 124
         err = nc_get_var1_double(BAD_ID, i, index, &value);
-#line 124
         IF (err != NC_EBADID)
-#line 124
 	    error("bad ncid: status = %d", err);
-#line 124
         err = nc_get_var1_double(ncid, BAD_VARID, index, &value);
-#line 124
         IF (err != NC_ENOTVAR)
-#line 124
 	    error("bad var id: status = %d", err);
-#line 124
 	for (j = 0; j < var_rank[i]; j++) {
-#line 124
 	    index[j] = var_shape[i][j];
-#line 124
 	    err = nc_get_var1_double(ncid, i, index, &value);
-#line 124
 	    if(!canConvert) {
-#line 124
 		IF(err != NC_ECHAR)
-#line 124
 			error("conversion: status = %d", err);
-#line 124
 	    } else IF (err != NC_EINVALCOORDS)
-#line 124
 		error("bad index: status = %d", err);
-#line 124
 	    index[j] = 0;
-#line 124
 	}
-#line 124
 	for (j = 0; j < var_nels[i]; j++) {
-#line 124
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 124
 	    IF (err)
-#line 124
 		error("error in toMixedBase 1");
-#line 124
 	    expect = hash4( var_type[i], var_rank[i], index, NCT_DOUBLE );
-#line 124
 	    if (var_rank[i] == 0 && i%2 )
-#line 124
 		err = nc_get_var1_double(ncid, i, NULL, &value);
-#line 124
 	    else
-#line 124
 		err = nc_get_var1_double(ncid, i, index, &value);
-#line 124
             if (canConvert) {
-#line 124
 		if (inRange3(expect,var_type[i], NCT_DOUBLE)) {
-#line 124
 		    if (expect >= double_min && expect <= double_max) {
-#line 124
 			IF (err) {
-#line 124
 			    error("%s", nc_strerror(err));
-#line 124
 			} else {
-#line 124
 			    IF (!equal(value,expect,var_type[i],NCT_DOUBLE)) {
-#line 124
 				error("expected: %G, got: %G", expect,
-#line 124
 				    (double) value);
-#line 124
 			    } else {
-#line 124
 				nok++;
-#line 124
 			    }
-#line 124
 			}
-#line 124
 		    } else {
-#line 124
 			IF (err != NC_ERANGE)
-#line 124
 			    error("Range error: status = %d", err);
-#line 124
 		    }
-#line 124
                 } else {
-#line 124
                     IF (err != 0 && err != NC_ERANGE)
-#line 124
                         error("OK or Range error: status = %d", err);
-#line 124
 		}
-#line 124
 	    } else {
-#line 124
 		IF (err != NC_ECHAR)
-#line 124
 		    error("wrong type: status = %d", err);
-#line 124
 	    }
-#line 124
 	}
-#line 124
     }
-#line 124
     err = nc_close(ncid);
-#line 124
     IF (err)
-#line 124
 	error("nc_close: %s", nc_strerror(err));
-#line 124
     print_nok(nok);
-#line 124
 }
-#line 124
 
 
 
-#line 221
 
 void
-#line 222
 test_nc_get_var_text(void)
-#line 222
 {
-#line 222
     int ncid;
-#line 222
     int i;
-#line 222
     int j;
-#line 222
     int err;
-#line 222
     int allInExtRange;	/* all values within external range? */
-#line 222
     int allInIntRange;	/* all values within internal range? */
-#line 222
     int nels;
-#line 222
     int nok = 0;      /* count of valid comparisons */
-#line 222
     size_t index[MAX_RANK];
-#line 222
     int canConvert;     /* Both text or both numeric */
-#line 222
     text value[MAX_NELS];
-#line 222
     double expect[MAX_NELS];
-#line 222
 
-#line 222
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 222
     IF (err)
-#line 222
 	error("nc_open: %s", nc_strerror(err));
-#line 222
     for (i = 0; i < NVARS; i++) {
-#line 222
         canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 222
         assert(var_rank[i] <= MAX_RANK);
-#line 222
         assert(var_nels[i] <= MAX_NELS);
-#line 222
         err = nc_get_var_text(BAD_ID, i, value);
-#line 222
         IF (err != NC_EBADID)
-#line 222
 	    error("bad ncid: status = %d", err);
-#line 222
         err = nc_get_var_text(ncid, BAD_VARID, value);
-#line 222
         IF (err != NC_ENOTVAR)
-#line 222
 	    error("bad var id: status = %d", err);
-#line 222
 
-#line 222
 	nels = 1;
-#line 222
 	for (j = 0; j < var_rank[i]; j++) {
-#line 222
 	    nels *= var_shape[i][j];
-#line 222
 	}
-#line 222
 	allInExtRange = allInIntRange = 1;
-#line 222
 	for (j = 0; j < nels; j++) {
-#line 222
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 222
 	    IF (err)
-#line 222
 		error("error in toMixedBase 1");
-#line 222
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_TEXT);
-#line 222
 	    if (inRange3(expect[j],var_type[i], NCT_TEXT)) {
-#line 222
 		allInIntRange = allInIntRange && expect[j] >= text_min
-#line 222
 			    && expect[j] <= text_max;
-#line 222
 	    } else {
-#line 222
 		allInExtRange = 0;
-#line 222
 	    }
-#line 222
 	}
-#line 222
 	err = nc_get_var_text(ncid, i, value);
-#line 222
 	if (canConvert) {
-#line 222
 	    if (allInExtRange) {
-#line 222
 		if (allInIntRange) {
-#line 222
 		    IF (err)
-#line 222
 			error("%s", nc_strerror(err));
-#line 222
 		} else {
-#line 222
 		    IF (err != NC_ERANGE)
-#line 222
 			error("Range error: status = %d", err);
-#line 222
 		}
-#line 222
 	    } else {
-#line 222
 		IF (err != 0 && err != NC_ERANGE)
-#line 222
 		    error("OK or Range error: status = %d", err);
-#line 222
 	    }
-#line 222
 	    for (j = 0; j < nels; j++) {
-#line 222
 		if (inRange3(expect[j],var_type[i],NCT_TEXT)
-#line 222
 			&& expect[j] >= text_min && expect[j] <= text_max) {
-#line 222
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_TEXT)){
-#line 222
 			error("value read not that expected");
-#line 222
 			if (verbose) {
-#line 222
 			    error("\n");
-#line 222
 			    error("varid: %d, ", i);
-#line 222
 			    error("var_name: %s, ", var_name[i]);
-#line 222
 			    error("element number: %d ", j);
-#line 222
 			    error("expect: %g", expect[j]);
-#line 222
 			    error("got: %g", (double) value[j]);
-#line 222
 			}
-#line 222
 		    } else {
-#line 222
 			nok++;
-#line 222
 		    }
-#line 222
 		}
-#line 222
 	    }
-#line 222
 	} else {
-#line 222
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 222
 		error("wrong type: status = %d", err);
-#line 222
 	}
-#line 222
     }
-#line 222
     err = nc_close(ncid);
-#line 222
     IF (err)
-#line 222
 	error("nc_close: %s", nc_strerror(err));
-#line 222
     print_nok(nok);
-#line 222
 }
-#line 222
 
 void
-#line 223
 test_nc_get_var_uchar(void)
-#line 223
 {
-#line 223
     int ncid;
-#line 223
     int i;
-#line 223
     int j;
-#line 223
     int err;
-#line 223
     int allInExtRange;	/* all values within external range? */
-#line 223
     int allInIntRange;	/* all values within internal range? */
-#line 223
     int nels;
-#line 223
     int nok = 0;      /* count of valid comparisons */
-#line 223
     size_t index[MAX_RANK];
-#line 223
     int canConvert;     /* Both text or both numeric */
-#line 223
     uchar value[MAX_NELS];
-#line 223
     double expect[MAX_NELS];
-#line 223
 
-#line 223
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 223
     IF (err)
-#line 223
 	error("nc_open: %s", nc_strerror(err));
-#line 223
     for (i = 0; i < NVARS; i++) {
-#line 223
         canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 223
         assert(var_rank[i] <= MAX_RANK);
-#line 223
         assert(var_nels[i] <= MAX_NELS);
-#line 223
         err = nc_get_var_uchar(BAD_ID, i, value);
-#line 223
         IF (err != NC_EBADID)
-#line 223
 	    error("bad ncid: status = %d", err);
-#line 223
         err = nc_get_var_uchar(ncid, BAD_VARID, value);
-#line 223
         IF (err != NC_ENOTVAR)
-#line 223
 	    error("bad var id: status = %d", err);
-#line 223
 
-#line 223
 	nels = 1;
-#line 223
 	for (j = 0; j < var_rank[i]; j++) {
-#line 223
 	    nels *= var_shape[i][j];
-#line 223
 	}
-#line 223
 	allInExtRange = allInIntRange = 1;
-#line 223
 	for (j = 0; j < nels; j++) {
-#line 223
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 223
 	    IF (err)
-#line 223
 		error("error in toMixedBase 1");
-#line 223
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 223
 	    if (inRange3(expect[j],var_type[i], NCT_UCHAR)) {
-#line 223
 		allInIntRange = allInIntRange && expect[j] >= uchar_min
-#line 223
 			    && expect[j] <= uchar_max;
-#line 223
 	    } else {
-#line 223
 		allInExtRange = 0;
-#line 223
 	    }
-#line 223
 	}
-#line 223
 	err = nc_get_var_uchar(ncid, i, value);
-#line 223
 	if (canConvert) {
-#line 223
 	    if (allInExtRange) {
-#line 223
 		if (allInIntRange) {
-#line 223
 		    IF (err)
-#line 223
 			error("%s", nc_strerror(err));
-#line 223
 		} else {
-#line 223
 		    IF (err != NC_ERANGE)
-#line 223
 			error("Range error: status = %d", err);
-#line 223
 		}
-#line 223
 	    } else {
-#line 223
 		IF (err != 0 && err != NC_ERANGE)
-#line 223
 		    error("OK or Range error: status = %d", err);
-#line 223
 	    }
-#line 223
 	    for (j = 0; j < nels; j++) {
-#line 223
 		if (inRange3(expect[j],var_type[i],NCT_UCHAR)
-#line 223
 			&& expect[j] >= uchar_min && expect[j] <= uchar_max) {
-#line 223
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_UCHAR)){
-#line 223
 			error("value read not that expected");
-#line 223
 			if (verbose) {
-#line 223
 			    error("\n");
-#line 223
 			    error("varid: %d, ", i);
-#line 223
 			    error("var_name: %s, ", var_name[i]);
-#line 223
 			    error("element number: %d ", j);
-#line 223
 			    error("expect: %g", expect[j]);
-#line 223
 			    error("got: %g", (double) value[j]);
-#line 223
 			}
-#line 223
 		    } else {
-#line 223
 			nok++;
-#line 223
 		    }
-#line 223
 		}
-#line 223
 	    }
-#line 223
 	} else {
-#line 223
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 223
 		error("wrong type: status = %d", err);
-#line 223
 	}
-#line 223
     }
-#line 223
     err = nc_close(ncid);
-#line 223
     IF (err)
-#line 223
 	error("nc_close: %s", nc_strerror(err));
-#line 223
     print_nok(nok);
-#line 223
 }
-#line 223
 
 void
-#line 224
 test_nc_get_var_schar(void)
-#line 224
 {
-#line 224
     int ncid;
-#line 224
     int i;
-#line 224
     int j;
-#line 224
     int err;
-#line 224
     int allInExtRange;	/* all values within external range? */
-#line 224
     int allInIntRange;	/* all values within internal range? */
-#line 224
     int nels;
-#line 224
     int nok = 0;      /* count of valid comparisons */
-#line 224
     size_t index[MAX_RANK];
-#line 224
     int canConvert;     /* Both text or both numeric */
-#line 224
     schar value[MAX_NELS];
-#line 224
     double expect[MAX_NELS];
-#line 224
 
-#line 224
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 224
     IF (err)
-#line 224
 	error("nc_open: %s", nc_strerror(err));
-#line 224
     for (i = 0; i < NVARS; i++) {
-#line 224
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 224
         assert(var_rank[i] <= MAX_RANK);
-#line 224
         assert(var_nels[i] <= MAX_NELS);
-#line 224
         err = nc_get_var_schar(BAD_ID, i, value);
-#line 224
         IF (err != NC_EBADID)
-#line 224
 	    error("bad ncid: status = %d", err);
-#line 224
         err = nc_get_var_schar(ncid, BAD_VARID, value);
-#line 224
         IF (err != NC_ENOTVAR)
-#line 224
 	    error("bad var id: status = %d", err);
-#line 224
 
-#line 224
 	nels = 1;
-#line 224
 	for (j = 0; j < var_rank[i]; j++) {
-#line 224
 	    nels *= var_shape[i][j];
-#line 224
 	}
-#line 224
 	allInExtRange = allInIntRange = 1;
-#line 224
 	for (j = 0; j < nels; j++) {
-#line 224
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 224
 	    IF (err)
-#line 224
 		error("error in toMixedBase 1");
-#line 224
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 224
 	    if (inRange3(expect[j],var_type[i], NCT_SCHAR)) {
-#line 224
 		allInIntRange = allInIntRange && expect[j] >= schar_min
-#line 224
 			    && expect[j] <= schar_max;
-#line 224
 	    } else {
-#line 224
 		allInExtRange = 0;
-#line 224
 	    }
-#line 224
 	}
-#line 224
 	err = nc_get_var_schar(ncid, i, value);
-#line 224
 	if (canConvert) {
-#line 224
 	    if (allInExtRange) {
-#line 224
 		if (allInIntRange) {
-#line 224
 		    IF (err)
-#line 224
 			error("%s", nc_strerror(err));
-#line 224
 		} else {
-#line 224
 		    IF (err != NC_ERANGE)
-#line 224
 			error("Range error: status = %d", err);
-#line 224
 		}
-#line 224
 	    } else {
-#line 224
 		IF (err != 0 && err != NC_ERANGE)
-#line 224
 		    error("OK or Range error: status = %d", err);
-#line 224
 	    }
-#line 224
 	    for (j = 0; j < nels; j++) {
-#line 224
 		if (inRange3(expect[j],var_type[i],NCT_SCHAR)
-#line 224
 			&& expect[j] >= schar_min && expect[j] <= schar_max) {
-#line 224
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_SCHAR)){
-#line 224
 			error("value read not that expected");
-#line 224
 			if (verbose) {
-#line 224
 			    error("\n");
-#line 224
 			    error("varid: %d, ", i);
-#line 224
 			    error("var_name: %s, ", var_name[i]);
-#line 224
 			    error("element number: %d ", j);
-#line 224
 			    error("expect: %g", expect[j]);
-#line 224
 			    error("got: %g", (double) value[j]);
-#line 224
 			}
-#line 224
 		    } else {
-#line 224
 			nok++;
-#line 224
 		    }
-#line 224
 		}
-#line 224
 	    }
-#line 224
 	} else {
-#line 224
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 224
 		error("wrong type: status = %d", err);
-#line 224
 	}
-#line 224
     }
-#line 224
     err = nc_close(ncid);
-#line 224
     IF (err)
-#line 224
 	error("nc_close: %s", nc_strerror(err));
-#line 224
     print_nok(nok);
-#line 224
 }
-#line 224
 
 void
-#line 225
 test_nc_get_var_short(void)
-#line 225
 {
-#line 225
     int ncid;
-#line 225
     int i;
-#line 225
     int j;
-#line 225
     int err;
-#line 225
     int allInExtRange;	/* all values within external range? */
-#line 225
     int allInIntRange;	/* all values within internal range? */
-#line 225
     int nels;
-#line 225
     int nok = 0;      /* count of valid comparisons */
-#line 225
     size_t index[MAX_RANK];
-#line 225
     int canConvert;     /* Both text or both numeric */
-#line 225
     short value[MAX_NELS];
-#line 225
     double expect[MAX_NELS];
-#line 225
 
-#line 225
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 225
     IF (err)
-#line 225
 	error("nc_open: %s", nc_strerror(err));
-#line 225
     for (i = 0; i < NVARS; i++) {
-#line 225
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 225
         assert(var_rank[i] <= MAX_RANK);
-#line 225
         assert(var_nels[i] <= MAX_NELS);
-#line 225
         err = nc_get_var_short(BAD_ID, i, value);
-#line 225
         IF (err != NC_EBADID)
-#line 225
 	    error("bad ncid: status = %d", err);
-#line 225
         err = nc_get_var_short(ncid, BAD_VARID, value);
-#line 225
         IF (err != NC_ENOTVAR)
-#line 225
 	    error("bad var id: status = %d", err);
-#line 225
 
-#line 225
 	nels = 1;
-#line 225
 	for (j = 0; j < var_rank[i]; j++) {
-#line 225
 	    nels *= var_shape[i][j];
-#line 225
 	}
-#line 225
 	allInExtRange = allInIntRange = 1;
-#line 225
 	for (j = 0; j < nels; j++) {
-#line 225
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 225
 	    IF (err)
-#line 225
 		error("error in toMixedBase 1");
-#line 225
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_SHORT);
-#line 225
 	    if (inRange3(expect[j],var_type[i], NCT_SHORT)) {
-#line 225
 		allInIntRange = allInIntRange && expect[j] >= short_min
-#line 225
 			    && expect[j] <= short_max;
-#line 225
 	    } else {
-#line 225
 		allInExtRange = 0;
-#line 225
 	    }
-#line 225
 	}
-#line 225
 	err = nc_get_var_short(ncid, i, value);
-#line 225
 	if (canConvert) {
-#line 225
 	    if (allInExtRange) {
-#line 225
 		if (allInIntRange) {
-#line 225
 		    IF (err)
-#line 225
 			error("%s", nc_strerror(err));
-#line 225
 		} else {
-#line 225
 		    IF (err != NC_ERANGE)
-#line 225
 			error("Range error: status = %d", err);
-#line 225
 		}
-#line 225
 	    } else {
-#line 225
 		IF (err != 0 && err != NC_ERANGE)
-#line 225
 		    error("OK or Range error: status = %d", err);
-#line 225
 	    }
-#line 225
 	    for (j = 0; j < nels; j++) {
-#line 225
 		if (inRange3(expect[j],var_type[i],NCT_SHORT)
-#line 225
 			&& expect[j] >= short_min && expect[j] <= short_max) {
-#line 225
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_SHORT)){
-#line 225
 			error("value read not that expected");
-#line 225
 			if (verbose) {
-#line 225
 			    error("\n");
-#line 225
 			    error("varid: %d, ", i);
-#line 225
 			    error("var_name: %s, ", var_name[i]);
-#line 225
 			    error("element number: %d ", j);
-#line 225
 			    error("expect: %g", expect[j]);
-#line 225
 			    error("got: %g", (double) value[j]);
-#line 225
 			}
-#line 225
 		    } else {
-#line 225
 			nok++;
-#line 225
 		    }
-#line 225
 		}
-#line 225
 	    }
-#line 225
 	} else {
-#line 225
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 225
 		error("wrong type: status = %d", err);
-#line 225
 	}
-#line 225
     }
-#line 225
     err = nc_close(ncid);
-#line 225
     IF (err)
-#line 225
 	error("nc_close: %s", nc_strerror(err));
-#line 225
     print_nok(nok);
-#line 225
 }
-#line 225
 
 void
-#line 226
 test_nc_get_var_int(void)
-#line 226
 {
-#line 226
     int ncid;
-#line 226
     int i;
-#line 226
     int j;
-#line 226
     int err;
-#line 226
     int allInExtRange;	/* all values within external range? */
-#line 226
     int allInIntRange;	/* all values within internal range? */
-#line 226
     int nels;
-#line 226
     int nok = 0;      /* count of valid comparisons */
-#line 226
     size_t index[MAX_RANK];
-#line 226
     int canConvert;     /* Both text or both numeric */
-#line 226
     int value[MAX_NELS];
-#line 226
     double expect[MAX_NELS];
-#line 226
 
-#line 226
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 226
     IF (err)
-#line 226
 	error("nc_open: %s", nc_strerror(err));
-#line 226
     for (i = 0; i < NVARS; i++) {
-#line 226
         canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 226
         assert(var_rank[i] <= MAX_RANK);
-#line 226
         assert(var_nels[i] <= MAX_NELS);
-#line 226
         err = nc_get_var_int(BAD_ID, i, value);
-#line 226
         IF (err != NC_EBADID)
-#line 226
 	    error("bad ncid: status = %d", err);
-#line 226
         err = nc_get_var_int(ncid, BAD_VARID, value);
-#line 226
         IF (err != NC_ENOTVAR)
-#line 226
 	    error("bad var id: status = %d", err);
-#line 226
 
-#line 226
 	nels = 1;
-#line 226
 	for (j = 0; j < var_rank[i]; j++) {
-#line 226
 	    nels *= var_shape[i][j];
-#line 226
 	}
-#line 226
 	allInExtRange = allInIntRange = 1;
-#line 226
 	for (j = 0; j < nels; j++) {
-#line 226
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 226
 	    IF (err)
-#line 226
 		error("error in toMixedBase 1");
-#line 226
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_INT);
-#line 226
 	    if (inRange3(expect[j],var_type[i], NCT_INT)) {
-#line 226
 		allInIntRange = allInIntRange && expect[j] >= int_min
-#line 226
 			    && expect[j] <= int_max;
-#line 226
 	    } else {
-#line 226
 		allInExtRange = 0;
-#line 226
 	    }
-#line 226
 	}
-#line 226
 	err = nc_get_var_int(ncid, i, value);
-#line 226
 	if (canConvert) {
-#line 226
 	    if (allInExtRange) {
-#line 226
 		if (allInIntRange) {
-#line 226
 		    IF (err)
-#line 226
 			error("%s", nc_strerror(err));
-#line 226
 		} else {
-#line 226
 		    IF (err != NC_ERANGE)
-#line 226
 			error("Range error: status = %d", err);
-#line 226
 		}
-#line 226
 	    } else {
-#line 226
 		IF (err != 0 && err != NC_ERANGE)
-#line 226
 		    error("OK or Range error: status = %d", err);
-#line 226
 	    }
-#line 226
 	    for (j = 0; j < nels; j++) {
-#line 226
 		if (inRange3(expect[j],var_type[i],NCT_INT)
-#line 226
 			&& expect[j] >= int_min && expect[j] <= int_max) {
-#line 226
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_INT)){
-#line 226
 			error("value read not that expected");
-#line 226
 			if (verbose) {
-#line 226
 			    error("\n");
-#line 226
 			    error("varid: %d, ", i);
-#line 226
 			    error("var_name: %s, ", var_name[i]);
-#line 226
 			    error("element number: %d ", j);
-#line 226
 			    error("expect: %g", expect[j]);
-#line 226
 			    error("got: %g", (double) value[j]);
-#line 226
 			}
-#line 226
 		    } else {
-#line 226
 			nok++;
-#line 226
 		    }
-#line 226
 		}
-#line 226
 	    }
-#line 226
 	} else {
-#line 226
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 226
 		error("wrong type: status = %d", err);
-#line 226
 	}
-#line 226
     }
-#line 226
     err = nc_close(ncid);
-#line 226
     IF (err)
-#line 226
 	error("nc_close: %s", nc_strerror(err));
-#line 226
     print_nok(nok);
-#line 226
 }
-#line 226
 
 void
-#line 227
 test_nc_get_var_long(void)
-#line 227
 {
-#line 227
     int ncid;
-#line 227
     int i;
-#line 227
     int j;
-#line 227
     int err;
-#line 227
     int allInExtRange;	/* all values within external range? */
-#line 227
     int allInIntRange;	/* all values within internal range? */
-#line 227
     int nels;
-#line 227
     int nok = 0;      /* count of valid comparisons */
-#line 227
     size_t index[MAX_RANK];
-#line 227
     int canConvert;     /* Both text or both numeric */
-#line 227
     long value[MAX_NELS];
-#line 227
     double expect[MAX_NELS];
-#line 227
 
-#line 227
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 227
     IF (err)
-#line 227
 	error("nc_open: %s", nc_strerror(err));
-#line 227
     for (i = 0; i < NVARS; i++) {
-#line 227
         canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 227
         assert(var_rank[i] <= MAX_RANK);
-#line 227
         assert(var_nels[i] <= MAX_NELS);
-#line 227
         err = nc_get_var_long(BAD_ID, i, value);
-#line 227
         IF (err != NC_EBADID)
-#line 227
 	    error("bad ncid: status = %d", err);
-#line 227
         err = nc_get_var_long(ncid, BAD_VARID, value);
-#line 227
         IF (err != NC_ENOTVAR)
-#line 227
 	    error("bad var id: status = %d", err);
-#line 227
 
-#line 227
 	nels = 1;
-#line 227
 	for (j = 0; j < var_rank[i]; j++) {
-#line 227
 	    nels *= var_shape[i][j];
-#line 227
 	}
-#line 227
 	allInExtRange = allInIntRange = 1;
-#line 227
 	for (j = 0; j < nels; j++) {
-#line 227
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 227
 	    IF (err)
-#line 227
 		error("error in toMixedBase 1");
-#line 227
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_LONG);
-#line 227
 	    if (inRange3(expect[j],var_type[i], NCT_LONG)) {
-#line 227
 		allInIntRange = allInIntRange && expect[j] >= long_min
-#line 227
 			    && expect[j] <= long_max;
-#line 227
 	    } else {
-#line 227
 		allInExtRange = 0;
-#line 227
 	    }
-#line 227
 	}
-#line 227
 	err = nc_get_var_long(ncid, i, value);
-#line 227
 	if (canConvert) {
-#line 227
 	    if (allInExtRange) {
-#line 227
 		if (allInIntRange) {
-#line 227
 		    IF (err)
-#line 227
 			error("%s", nc_strerror(err));
-#line 227
 		} else {
-#line 227
 		    IF (err != NC_ERANGE)
-#line 227
 			error("Range error: status = %d", err);
-#line 227
 		}
-#line 227
 	    } else {
-#line 227
 		IF (err != 0 && err != NC_ERANGE)
-#line 227
 		    error("OK or Range error: status = %d", err);
-#line 227
 	    }
-#line 227
 	    for (j = 0; j < nels; j++) {
-#line 227
 		if (inRange3(expect[j],var_type[i],NCT_LONG)
-#line 227
 			&& expect[j] >= long_min && expect[j] <= long_max) {
-#line 227
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_LONG)){
-#line 227
 			error("value read not that expected");
-#line 227
 			if (verbose) {
-#line 227
 			    error("\n");
-#line 227
 			    error("varid: %d, ", i);
-#line 227
 			    error("var_name: %s, ", var_name[i]);
-#line 227
 			    error("element number: %d ", j);
-#line 227
 			    error("expect: %g", expect[j]);
-#line 227
 			    error("got: %g", (double) value[j]);
-#line 227
 			}
-#line 227
 		    } else {
-#line 227
 			nok++;
-#line 227
 		    }
-#line 227
 		}
-#line 227
 	    }
-#line 227
 	} else {
-#line 227
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 227
 		error("wrong type: status = %d", err);
-#line 227
 	}
-#line 227
     }
-#line 227
     err = nc_close(ncid);
-#line 227
     IF (err)
-#line 227
 	error("nc_close: %s", nc_strerror(err));
-#line 227
     print_nok(nok);
-#line 227
 }
-#line 227
 
 void
-#line 228
 test_nc_get_var_float(void)
-#line 228
 {
-#line 228
     int ncid;
-#line 228
     int i;
-#line 228
     int j;
-#line 228
     int err;
-#line 228
     int allInExtRange;	/* all values within external range? */
-#line 228
     int allInIntRange;	/* all values within internal range? */
-#line 228
     int nels;
-#line 228
     int nok = 0;      /* count of valid comparisons */
-#line 228
     size_t index[MAX_RANK];
-#line 228
     int canConvert;     /* Both text or both numeric */
-#line 228
     float value[MAX_NELS];
-#line 228
     double expect[MAX_NELS];
-#line 228
 
-#line 228
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 228
     IF (err)
-#line 228
 	error("nc_open: %s", nc_strerror(err));
-#line 228
     for (i = 0; i < NVARS; i++) {
-#line 228
         canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 228
         assert(var_rank[i] <= MAX_RANK);
-#line 228
         assert(var_nels[i] <= MAX_NELS);
-#line 228
         err = nc_get_var_float(BAD_ID, i, value);
-#line 228
         IF (err != NC_EBADID)
-#line 228
 	    error("bad ncid: status = %d", err);
-#line 228
         err = nc_get_var_float(ncid, BAD_VARID, value);
-#line 228
         IF (err != NC_ENOTVAR)
-#line 228
 	    error("bad var id: status = %d", err);
-#line 228
 
-#line 228
 	nels = 1;
-#line 228
 	for (j = 0; j < var_rank[i]; j++) {
-#line 228
 	    nels *= var_shape[i][j];
-#line 228
 	}
-#line 228
 	allInExtRange = allInIntRange = 1;
-#line 228
 	for (j = 0; j < nels; j++) {
-#line 228
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 228
 	    IF (err)
-#line 228
 		error("error in toMixedBase 1");
-#line 228
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 228
 	    if (inRange3(expect[j],var_type[i], NCT_FLOAT)) {
-#line 228
 		allInIntRange = allInIntRange && expect[j] >= float_min
-#line 228
 			    && expect[j] <= float_max;
-#line 228
 	    } else {
-#line 228
 		allInExtRange = 0;
-#line 228
 	    }
-#line 228
 	}
-#line 228
 	err = nc_get_var_float(ncid, i, value);
-#line 228
 	if (canConvert) {
-#line 228
 	    if (allInExtRange) {
-#line 228
 		if (allInIntRange) {
-#line 228
 		    IF (err)
-#line 228
 			error("%s", nc_strerror(err));
-#line 228
 		} else {
-#line 228
 		    IF (err != NC_ERANGE)
-#line 228
 			error("Range error: status = %d", err);
-#line 228
 		}
-#line 228
 	    } else {
-#line 228
 		IF (err != 0 && err != NC_ERANGE)
-#line 228
 		    error("OK or Range error: status = %d", err);
-#line 228
 	    }
-#line 228
 	    for (j = 0; j < nels; j++) {
-#line 228
 		if (inRange3(expect[j],var_type[i],NCT_FLOAT)
-#line 228
 			&& expect[j] >= float_min && expect[j] <= float_max) {
-#line 228
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_FLOAT)){
-#line 228
 			error("value read not that expected");
-#line 228
 			if (verbose) {
-#line 228
 			    error("\n");
-#line 228
 			    error("varid: %d, ", i);
-#line 228
 			    error("var_name: %s, ", var_name[i]);
-#line 228
 			    error("element number: %d ", j);
-#line 228
 			    error("expect: %g", expect[j]);
-#line 228
 			    error("got: %g", (double) value[j]);
-#line 228
 			}
-#line 228
 		    } else {
-#line 228
 			nok++;
-#line 228
 		    }
-#line 228
 		}
-#line 228
 	    }
-#line 228
 	} else {
-#line 228
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 228
 		error("wrong type: status = %d", err);
-#line 228
 	}
-#line 228
     }
-#line 228
     err = nc_close(ncid);
-#line 228
     IF (err)
-#line 228
 	error("nc_close: %s", nc_strerror(err));
-#line 228
     print_nok(nok);
-#line 228
 }
-#line 228
 
 void
-#line 229
 test_nc_get_var_double(void)
-#line 229
 {
-#line 229
     int ncid;
-#line 229
     int i;
-#line 229
     int j;
-#line 229
     int err;
-#line 229
     int allInExtRange;	/* all values within external range? */
-#line 229
     int allInIntRange;	/* all values within internal range? */
-#line 229
     int nels;
-#line 229
     int nok = 0;      /* count of valid comparisons */
-#line 229
     size_t index[MAX_RANK];
-#line 229
     int canConvert;     /* Both text or both numeric */
-#line 229
     double value[MAX_NELS];
-#line 229
     double expect[MAX_NELS];
-#line 229
 
-#line 229
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 229
     IF (err)
-#line 229
 	error("nc_open: %s", nc_strerror(err));
-#line 229
     for (i = 0; i < NVARS; i++) {
-#line 229
         canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 229
         assert(var_rank[i] <= MAX_RANK);
-#line 229
         assert(var_nels[i] <= MAX_NELS);
-#line 229
         err = nc_get_var_double(BAD_ID, i, value);
-#line 229
         IF (err != NC_EBADID)
-#line 229
 	    error("bad ncid: status = %d", err);
-#line 229
         err = nc_get_var_double(ncid, BAD_VARID, value);
-#line 229
         IF (err != NC_ENOTVAR)
-#line 229
 	    error("bad var id: status = %d", err);
-#line 229
 
-#line 229
 	nels = 1;
-#line 229
 	for (j = 0; j < var_rank[i]; j++) {
-#line 229
 	    nels *= var_shape[i][j];
-#line 229
 	}
-#line 229
 	allInExtRange = allInIntRange = 1;
-#line 229
 	for (j = 0; j < nels; j++) {
-#line 229
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 229
 	    IF (err)
-#line 229
 		error("error in toMixedBase 1");
-#line 229
 	    expect[j] = hash4(var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 229
 	    if (inRange3(expect[j],var_type[i], NCT_DOUBLE)) {
-#line 229
 		allInIntRange = allInIntRange && expect[j] >= double_min
-#line 229
 			    && expect[j] <= double_max;
-#line 229
 	    } else {
-#line 229
 		allInExtRange = 0;
-#line 229
 	    }
-#line 229
 	}
-#line 229
 	err = nc_get_var_double(ncid, i, value);
-#line 229
 	if (canConvert) {
-#line 229
 	    if (allInExtRange) {
-#line 229
 		if (allInIntRange) {
-#line 229
 		    IF (err)
-#line 229
 			error("%s", nc_strerror(err));
-#line 229
 		} else {
-#line 229
 		    IF (err != NC_ERANGE)
-#line 229
 			error("Range error: status = %d", err);
-#line 229
 		}
-#line 229
 	    } else {
-#line 229
 		IF (err != 0 && err != NC_ERANGE)
-#line 229
 		    error("OK or Range error: status = %d", err);
-#line 229
 	    }
-#line 229
 	    for (j = 0; j < nels; j++) {
-#line 229
 		if (inRange3(expect[j],var_type[i],NCT_DOUBLE)
-#line 229
 			&& expect[j] >= double_min && expect[j] <= double_max) {
-#line 229
 		    IF (!equal(value[j],expect[j],var_type[i],NCT_DOUBLE)){
-#line 229
 			error("value read not that expected");
-#line 229
 			if (verbose) {
-#line 229
 			    error("\n");
-#line 229
 			    error("varid: %d, ", i);
-#line 229
 			    error("var_name: %s, ", var_name[i]);
-#line 229
 			    error("element number: %d ", j);
-#line 229
 			    error("expect: %g", expect[j]);
-#line 229
 			    error("got: %g", (double) value[j]);
-#line 229
 			}
-#line 229
 		    } else {
-#line 229
 			nok++;
-#line 229
 		    }
-#line 229
 		}
-#line 229
 	    }
-#line 229
 	} else {
-#line 229
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 229
 		error("wrong type: status = %d", err);
-#line 229
 	}
-#line 229
     }
-#line 229
     err = nc_close(ncid);
-#line 229
     IF (err)
-#line 229
 	error("nc_close: %s", nc_strerror(err));
-#line 229
     print_nok(nok);
-#line 229
 }
-#line 229
 
 
 
-#line 401
 
 void
-#line 402
 test_nc_get_vara_text(void)
-#line 402
 {
-#line 402
     int ncid;
-#line 402
     int d;
-#line 402
     int i;
-#line 402
     int j;
-#line 402
     int k;
-#line 402
     int err;
-#line 402
     int allInExtRange;	/* all values within external range? */
-#line 402
     int allInIntRange;	/* all values within internal range? */
-#line 402
     int nels;
-#line 402
     int nslabs;
-#line 402
     int nok = 0;      /* count of valid comparisons */
-#line 402
     size_t start[MAX_RANK];
-#line 402
     size_t edge[MAX_RANK];
-#line 402
     size_t index[MAX_RANK];
-#line 402
     size_t mid[MAX_RANK];
-#line 402
     int canConvert;     /* Both text or both numeric */
-#line 402
     text value[MAX_NELS];
-#line 402
     double expect[MAX_NELS];
-#line 402
 
-#line 402
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 402
     IF (err)
-#line 402
 	error("nc_open: %s", nc_strerror(err));
-#line 402
     for (i = 0; i < NVARS; i++) {
-#line 402
         canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 402
         assert(var_rank[i] <= MAX_RANK);
-#line 402
         assert(var_nels[i] <= MAX_NELS);
-#line 402
 	for (j = 0; j < var_rank[i]; j++) {
-#line 402
 	    start[j] = 0;
-#line 402
 	    edge[j] = 1;
-#line 402
 	}
-#line 402
         err = nc_get_vara_text(BAD_ID, i, start, edge, value);
-#line 402
         IF (err != NC_EBADID)
-#line 402
 	    error("bad ncid: status = %d", err);
-#line 402
         err = nc_get_vara_text(ncid, BAD_VARID, start, edge, value);
-#line 402
         IF (err != NC_ENOTVAR)
-#line 402
 	    error("bad var id: status = %d", err);
-#line 402
 	for (j = 0; j < var_rank[i]; j++) {
-#line 402
 	    start[j] = var_shape[i][j];
-#line 402
 	    err = nc_get_vara_text(ncid, i, start, edge, value);
-#line 402
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 402
                 error("bad index: status = %d", err);
-#line 402
 	    start[j] = 0;
-#line 402
 	    edge[j] = var_shape[i][j] + 1;
-#line 402
 	    err = nc_get_vara_text(ncid, i, start, edge, value);
-#line 402
             IF (canConvert && err != NC_EEDGE)
-#line 402
 		error("bad edge: status = %d", err);
-#line 402
 	    edge[j] = 1;
-#line 402
 	}
-#line 402
             /* Check non-scalars for correct error returned even when */
-#line 402
             /* there is nothing to get (edge[j]==0) */
-#line 402
 	if(var_rank[i] > 0) {
-#line 402
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 402
 		edge[j] = 0;
-#line 402
 	    }
-#line 402
 	    err = nc_get_vara_text(BAD_ID, i, start, edge, value);
-#line 402
 	    IF (err != NC_EBADID) 
-#line 402
 		error("bad ncid: status = %d", err);
-#line 402
 	    err = nc_get_vara_text(ncid, BAD_VARID, start, edge, value);
-#line 402
 	    IF (err != NC_ENOTVAR) 
-#line 402
 		error("bad var id: status = %d", err);
-#line 402
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 402
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 402
 		    start[j] = var_shape[i][j];
-#line 402
 		    err = nc_get_vara_text(ncid, i, start, edge, value);
-#line 402
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 402
 			error("bad start: status = %d", err);
-#line 402
 		    start[j] = 0;
-#line 402
 		}
-#line 402
 	    }
-#line 402
 	    err = nc_get_vara_text(ncid, i, start, edge, value);
-#line 402
 	    if (canConvert) {
-#line 402
 		IF (err) 
-#line 402
 		    error("%s", nc_strerror(err));
-#line 402
 	    } else {
-#line 402
 		IF (err != NC_ECHAR)
-#line 402
 		    error("wrong type: status = %d", err);
-#line 402
 	    }
-#line 402
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 402
 		edge[j] = 1;
-#line 402
 	    }
-#line 402
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 402
             /* get 2^rank (nslabs) slabs so defined */
-#line 402
         nslabs = 1;
-#line 402
         for (j = 0; j < var_rank[i]; j++) {
-#line 402
             mid[j] = roll( var_shape[i][j] );
-#line 402
             nslabs *= 2;
-#line 402
         }
-#line 402
             /* bits of k determine whether to get lower or upper part of dim */
-#line 402
         for (k = 0; k < nslabs; k++) {
-#line 402
             nels = 1;
-#line 402
             for (j = 0; j < var_rank[i]; j++) {
-#line 402
                 if ((k >> j) & 1) {
-#line 402
                     start[j] = 0;
-#line 402
                     edge[j] = mid[j];
-#line 402
                 }else{
-#line 402
                     start[j] = mid[j];
-#line 402
                     edge[j] = var_shape[i][j] - mid[j];
-#line 402
                 }
-#line 402
                 nels *= edge[j];
-#line 402
             }
-#line 402
 	    allInExtRange = allInIntRange = 1;
-#line 402
             for (j = 0; j < nels; j++) {
-#line 402
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 402
                 IF (err)
-#line 402
                     error("error in toMixedBase 1");
-#line 402
                 for (d = 0; d < var_rank[i]; d++)
-#line 402
                     index[d] += start[d];
-#line 402
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_TEXT);
-#line 402
 		if (inRange3(expect[j],var_type[i], NCT_TEXT)) {
-#line 402
 		    allInIntRange = allInIntRange && expect[j] >= text_min
-#line 402
 				&& expect[j] <= text_max;
-#line 402
 		} else {
-#line 402
 		    allInExtRange = 0;
-#line 402
 		}
-#line 402
 	    }
-#line 402
             if (var_rank[i] == 0 && i%2)
-#line 402
 		err = nc_get_vara_text(ncid, i, NULL, NULL, value);
-#line 402
 	    else
-#line 402
 		err = nc_get_vara_text(ncid, i, start, edge, value);
-#line 402
             if (canConvert) {
-#line 402
 		if (allInExtRange) {
-#line 402
 		    if (allInIntRange) {
-#line 402
 			IF (err)
-#line 402
 			    error("%s", nc_strerror(err));
-#line 402
 		    } else {
-#line 402
 			IF (err != NC_ERANGE)
-#line 402
 			    error("Range error: status = %d", err);
-#line 402
 		    }
-#line 402
 		} else {
-#line 402
 		    IF (err != 0 && err != NC_ERANGE)
-#line 402
 			error("OK or Range error: status = %d", err);
-#line 402
 		}
-#line 402
 		for (j = 0; j < nels; j++) {
-#line 402
 		    if (inRange3(expect[j],var_type[i],NCT_TEXT)
-#line 402
 			    && expect[j] >= text_min && expect[j] <= text_max) {
-#line 402
 			IF (!equal(value[j],expect[j],var_type[i],NCT_TEXT)){
-#line 402
 			    error("value read not that expected");
-#line 402
 			    if (verbose) {
-#line 402
 				error("\n");
-#line 402
 				error("varid: %d, ", i);
-#line 402
 				error("var_name: %s, ", var_name[i]);
-#line 402
 				error("element number: %d ", j);
-#line 402
 				error("expect: %g", expect[j]);
-#line 402
 				error("got: %g", (double) value[j]);
-#line 402
 			    }
-#line 402
 			} else {
-#line 402
 			    nok++;
-#line 402
 			}
-#line 402
 		    }
-#line 402
 		}
-#line 402
             } else {
-#line 402
                 IF (nels > 0 && err != NC_ECHAR)
-#line 402
                     error("wrong type: status = %d", err);
-#line 402
             }
-#line 402
         }
-#line 402
     }
-#line 402
     err = nc_close(ncid);
-#line 402
     IF (err)
-#line 402
 	error("nc_close: %s", nc_strerror(err));
-#line 402
     print_nok(nok);
-#line 402
 }
-#line 402
 
 void
-#line 403
 test_nc_get_vara_uchar(void)
-#line 403
 {
-#line 403
     int ncid;
-#line 403
     int d;
-#line 403
     int i;
-#line 403
     int j;
-#line 403
     int k;
-#line 403
     int err;
-#line 403
     int allInExtRange;	/* all values within external range? */
-#line 403
     int allInIntRange;	/* all values within internal range? */
-#line 403
     int nels;
-#line 403
     int nslabs;
-#line 403
     int nok = 0;      /* count of valid comparisons */
-#line 403
     size_t start[MAX_RANK];
-#line 403
     size_t edge[MAX_RANK];
-#line 403
     size_t index[MAX_RANK];
-#line 403
     size_t mid[MAX_RANK];
-#line 403
     int canConvert;     /* Both text or both numeric */
-#line 403
     uchar value[MAX_NELS];
-#line 403
     double expect[MAX_NELS];
-#line 403
 
-#line 403
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 403
     IF (err)
-#line 403
 	error("nc_open: %s", nc_strerror(err));
-#line 403
     for (i = 0; i < NVARS; i++) {
-#line 403
         canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 403
         assert(var_rank[i] <= MAX_RANK);
-#line 403
         assert(var_nels[i] <= MAX_NELS);
-#line 403
 	for (j = 0; j < var_rank[i]; j++) {
-#line 403
 	    start[j] = 0;
-#line 403
 	    edge[j] = 1;
-#line 403
 	}
-#line 403
         err = nc_get_vara_uchar(BAD_ID, i, start, edge, value);
-#line 403
         IF (err != NC_EBADID)
-#line 403
 	    error("bad ncid: status = %d", err);
-#line 403
         err = nc_get_vara_uchar(ncid, BAD_VARID, start, edge, value);
-#line 403
         IF (err != NC_ENOTVAR)
-#line 403
 	    error("bad var id: status = %d", err);
-#line 403
 	for (j = 0; j < var_rank[i]; j++) {
-#line 403
 	    start[j] = var_shape[i][j];
-#line 403
 	    err = nc_get_vara_uchar(ncid, i, start, edge, value);
-#line 403
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 403
                 error("bad index: status = %d", err);
-#line 403
 	    start[j] = 0;
-#line 403
 	    edge[j] = var_shape[i][j] + 1;
-#line 403
 	    err = nc_get_vara_uchar(ncid, i, start, edge, value);
-#line 403
             IF (canConvert && err != NC_EEDGE)
-#line 403
 		error("bad edge: status = %d", err);
-#line 403
 	    edge[j] = 1;
-#line 403
 	}
-#line 403
             /* Check non-scalars for correct error returned even when */
-#line 403
             /* there is nothing to get (edge[j]==0) */
-#line 403
 	if(var_rank[i] > 0) {
-#line 403
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 403
 		edge[j] = 0;
-#line 403
 	    }
-#line 403
 	    err = nc_get_vara_uchar(BAD_ID, i, start, edge, value);
-#line 403
 	    IF (err != NC_EBADID) 
-#line 403
 		error("bad ncid: status = %d", err);
-#line 403
 	    err = nc_get_vara_uchar(ncid, BAD_VARID, start, edge, value);
-#line 403
 	    IF (err != NC_ENOTVAR) 
-#line 403
 		error("bad var id: status = %d", err);
-#line 403
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 403
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 403
 		    start[j] = var_shape[i][j];
-#line 403
 		    err = nc_get_vara_uchar(ncid, i, start, edge, value);
-#line 403
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 403
 			error("bad start: status = %d", err);
-#line 403
 		    start[j] = 0;
-#line 403
 		}
-#line 403
 	    }
-#line 403
 	    err = nc_get_vara_uchar(ncid, i, start, edge, value);
-#line 403
 	    if (canConvert) {
-#line 403
 		IF (err) 
-#line 403
 		    error("%s", nc_strerror(err));
-#line 403
 	    } else {
-#line 403
 		IF (err != NC_ECHAR)
-#line 403
 		    error("wrong type: status = %d", err);
-#line 403
 	    }
-#line 403
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 403
 		edge[j] = 1;
-#line 403
 	    }
-#line 403
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 403
             /* get 2^rank (nslabs) slabs so defined */
-#line 403
         nslabs = 1;
-#line 403
         for (j = 0; j < var_rank[i]; j++) {
-#line 403
             mid[j] = roll( var_shape[i][j] );
-#line 403
             nslabs *= 2;
-#line 403
         }
-#line 403
             /* bits of k determine whether to get lower or upper part of dim */
-#line 403
         for (k = 0; k < nslabs; k++) {
-#line 403
             nels = 1;
-#line 403
             for (j = 0; j < var_rank[i]; j++) {
-#line 403
                 if ((k >> j) & 1) {
-#line 403
                     start[j] = 0;
-#line 403
                     edge[j] = mid[j];
-#line 403
                 }else{
-#line 403
                     start[j] = mid[j];
-#line 403
                     edge[j] = var_shape[i][j] - mid[j];
-#line 403
                 }
-#line 403
                 nels *= edge[j];
-#line 403
             }
-#line 403
 	    allInExtRange = allInIntRange = 1;
-#line 403
             for (j = 0; j < nels; j++) {
-#line 403
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 403
                 IF (err)
-#line 403
                     error("error in toMixedBase 1");
-#line 403
                 for (d = 0; d < var_rank[i]; d++)
-#line 403
                     index[d] += start[d];
-#line 403
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 403
 		if (inRange3(expect[j],var_type[i], NCT_UCHAR)) {
-#line 403
 		    allInIntRange = allInIntRange && expect[j] >= uchar_min
-#line 403
 				&& expect[j] <= uchar_max;
-#line 403
 		} else {
-#line 403
 		    allInExtRange = 0;
-#line 403
 		}
-#line 403
 	    }
-#line 403
             if (var_rank[i] == 0 && i%2)
-#line 403
 		err = nc_get_vara_uchar(ncid, i, NULL, NULL, value);
-#line 403
 	    else
-#line 403
 		err = nc_get_vara_uchar(ncid, i, start, edge, value);
-#line 403
             if (canConvert) {
-#line 403
 		if (allInExtRange) {
-#line 403
 		    if (allInIntRange) {
-#line 403
 			IF (err)
-#line 403
 			    error("%s", nc_strerror(err));
-#line 403
 		    } else {
-#line 403
 			IF (err != NC_ERANGE)
-#line 403
 			    error("Range error: status = %d", err);
-#line 403
 		    }
-#line 403
 		} else {
-#line 403
 		    IF (err != 0 && err != NC_ERANGE)
-#line 403
 			error("OK or Range error: status = %d", err);
-#line 403
 		}
-#line 403
 		for (j = 0; j < nels; j++) {
-#line 403
 		    if (inRange3(expect[j],var_type[i],NCT_UCHAR)
-#line 403
 			    && expect[j] >= uchar_min && expect[j] <= uchar_max) {
-#line 403
 			IF (!equal(value[j],expect[j],var_type[i],NCT_UCHAR)){
-#line 403
 			    error("value read not that expected");
-#line 403
 			    if (verbose) {
-#line 403
 				error("\n");
-#line 403
 				error("varid: %d, ", i);
-#line 403
 				error("var_name: %s, ", var_name[i]);
-#line 403
 				error("element number: %d ", j);
-#line 403
 				error("expect: %g", expect[j]);
-#line 403
 				error("got: %g", (double) value[j]);
-#line 403
 			    }
-#line 403
 			} else {
-#line 403
 			    nok++;
-#line 403
 			}
-#line 403
 		    }
-#line 403
 		}
-#line 403
             } else {
-#line 403
                 IF (nels > 0 && err != NC_ECHAR)
-#line 403
                     error("wrong type: status = %d", err);
-#line 403
             }
-#line 403
         }
-#line 403
     }
-#line 403
     err = nc_close(ncid);
-#line 403
     IF (err)
-#line 403
 	error("nc_close: %s", nc_strerror(err));
-#line 403
     print_nok(nok);
-#line 403
 }
-#line 403
 
 void
-#line 404
 test_nc_get_vara_schar(void)
-#line 404
 {
-#line 404
     int ncid;
-#line 404
     int d;
-#line 404
     int i;
-#line 404
     int j;
-#line 404
     int k;
-#line 404
     int err;
-#line 404
     int allInExtRange;	/* all values within external range? */
-#line 404
     int allInIntRange;	/* all values within internal range? */
-#line 404
     int nels;
-#line 404
     int nslabs;
-#line 404
     int nok = 0;      /* count of valid comparisons */
-#line 404
     size_t start[MAX_RANK];
-#line 404
     size_t edge[MAX_RANK];
-#line 404
     size_t index[MAX_RANK];
-#line 404
     size_t mid[MAX_RANK];
-#line 404
     int canConvert;     /* Both text or both numeric */
-#line 404
     schar value[MAX_NELS];
-#line 404
     double expect[MAX_NELS];
-#line 404
 
-#line 404
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 404
     IF (err)
-#line 404
 	error("nc_open: %s", nc_strerror(err));
-#line 404
     for (i = 0; i < NVARS; i++) {
-#line 404
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 404
         assert(var_rank[i] <= MAX_RANK);
-#line 404
         assert(var_nels[i] <= MAX_NELS);
-#line 404
 	for (j = 0; j < var_rank[i]; j++) {
-#line 404
 	    start[j] = 0;
-#line 404
 	    edge[j] = 1;
-#line 404
 	}
-#line 404
         err = nc_get_vara_schar(BAD_ID, i, start, edge, value);
-#line 404
         IF (err != NC_EBADID)
-#line 404
 	    error("bad ncid: status = %d", err);
-#line 404
         err = nc_get_vara_schar(ncid, BAD_VARID, start, edge, value);
-#line 404
         IF (err != NC_ENOTVAR)
-#line 404
 	    error("bad var id: status = %d", err);
-#line 404
 	for (j = 0; j < var_rank[i]; j++) {
-#line 404
 	    start[j] = var_shape[i][j];
-#line 404
 	    err = nc_get_vara_schar(ncid, i, start, edge, value);
-#line 404
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 404
                 error("bad index: status = %d", err);
-#line 404
 	    start[j] = 0;
-#line 404
 	    edge[j] = var_shape[i][j] + 1;
-#line 404
 	    err = nc_get_vara_schar(ncid, i, start, edge, value);
-#line 404
             IF (canConvert && err != NC_EEDGE)
-#line 404
 		error("bad edge: status = %d", err);
-#line 404
 	    edge[j] = 1;
-#line 404
 	}
-#line 404
             /* Check non-scalars for correct error returned even when */
-#line 404
             /* there is nothing to get (edge[j]==0) */
-#line 404
 	if(var_rank[i] > 0) {
-#line 404
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 404
 		edge[j] = 0;
-#line 404
 	    }
-#line 404
 	    err = nc_get_vara_schar(BAD_ID, i, start, edge, value);
-#line 404
 	    IF (err != NC_EBADID) 
-#line 404
 		error("bad ncid: status = %d", err);
-#line 404
 	    err = nc_get_vara_schar(ncid, BAD_VARID, start, edge, value);
-#line 404
 	    IF (err != NC_ENOTVAR) 
-#line 404
 		error("bad var id: status = %d", err);
-#line 404
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 404
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 404
 		    start[j] = var_shape[i][j];
-#line 404
 		    err = nc_get_vara_schar(ncid, i, start, edge, value);
-#line 404
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 404
 			error("bad start: status = %d", err);
-#line 404
 		    start[j] = 0;
-#line 404
 		}
-#line 404
 	    }
-#line 404
 	    err = nc_get_vara_schar(ncid, i, start, edge, value);
-#line 404
 	    if (canConvert) {
-#line 404
 		IF (err) 
-#line 404
 		    error("%s", nc_strerror(err));
-#line 404
 	    } else {
-#line 404
 		IF (err != NC_ECHAR)
-#line 404
 		    error("wrong type: status = %d", err);
-#line 404
 	    }
-#line 404
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 404
 		edge[j] = 1;
-#line 404
 	    }
-#line 404
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 404
             /* get 2^rank (nslabs) slabs so defined */
-#line 404
         nslabs = 1;
-#line 404
         for (j = 0; j < var_rank[i]; j++) {
-#line 404
             mid[j] = roll( var_shape[i][j] );
-#line 404
             nslabs *= 2;
-#line 404
         }
-#line 404
             /* bits of k determine whether to get lower or upper part of dim */
-#line 404
         for (k = 0; k < nslabs; k++) {
-#line 404
             nels = 1;
-#line 404
             for (j = 0; j < var_rank[i]; j++) {
-#line 404
                 if ((k >> j) & 1) {
-#line 404
                     start[j] = 0;
-#line 404
                     edge[j] = mid[j];
-#line 404
                 }else{
-#line 404
                     start[j] = mid[j];
-#line 404
                     edge[j] = var_shape[i][j] - mid[j];
-#line 404
                 }
-#line 404
                 nels *= edge[j];
-#line 404
             }
-#line 404
 	    allInExtRange = allInIntRange = 1;
-#line 404
             for (j = 0; j < nels; j++) {
-#line 404
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 404
                 IF (err)
-#line 404
                     error("error in toMixedBase 1");
-#line 404
                 for (d = 0; d < var_rank[i]; d++)
-#line 404
                     index[d] += start[d];
-#line 404
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 404
 		if (inRange3(expect[j],var_type[i], NCT_SCHAR)) {
-#line 404
 		    allInIntRange = allInIntRange && expect[j] >= schar_min
-#line 404
 				&& expect[j] <= schar_max;
-#line 404
 		} else {
-#line 404
 		    allInExtRange = 0;
-#line 404
 		}
-#line 404
 	    }
-#line 404
             if (var_rank[i] == 0 && i%2)
-#line 404
 		err = nc_get_vara_schar(ncid, i, NULL, NULL, value);
-#line 404
 	    else
-#line 404
 		err = nc_get_vara_schar(ncid, i, start, edge, value);
-#line 404
             if (canConvert) {
-#line 404
 		if (allInExtRange) {
-#line 404
 		    if (allInIntRange) {
-#line 404
 			IF (err)
-#line 404
 			    error("%s", nc_strerror(err));
-#line 404
 		    } else {
-#line 404
 			IF (err != NC_ERANGE)
-#line 404
 			    error("Range error: status = %d", err);
-#line 404
 		    }
-#line 404
 		} else {
-#line 404
 		    IF (err != 0 && err != NC_ERANGE)
-#line 404
 			error("OK or Range error: status = %d", err);
-#line 404
 		}
-#line 404
 		for (j = 0; j < nels; j++) {
-#line 404
 		    if (inRange3(expect[j],var_type[i],NCT_SCHAR)
-#line 404
 			    && expect[j] >= schar_min && expect[j] <= schar_max) {
-#line 404
 			IF (!equal(value[j],expect[j],var_type[i],NCT_SCHAR)){
-#line 404
 			    error("value read not that expected");
-#line 404
 			    if (verbose) {
-#line 404
 				error("\n");
-#line 404
 				error("varid: %d, ", i);
-#line 404
 				error("var_name: %s, ", var_name[i]);
-#line 404
 				error("element number: %d ", j);
-#line 404
 				error("expect: %g", expect[j]);
-#line 404
 				error("got: %g", (double) value[j]);
-#line 404
 			    }
-#line 404
 			} else {
-#line 404
 			    nok++;
-#line 404
 			}
-#line 404
 		    }
-#line 404
 		}
-#line 404
             } else {
-#line 404
                 IF (nels > 0 && err != NC_ECHAR)
-#line 404
                     error("wrong type: status = %d", err);
-#line 404
             }
-#line 404
         }
-#line 404
     }
-#line 404
     err = nc_close(ncid);
-#line 404
     IF (err)
-#line 404
 	error("nc_close: %s", nc_strerror(err));
-#line 404
     print_nok(nok);
-#line 404
 }
-#line 404
 
 void
-#line 405
 test_nc_get_vara_short(void)
-#line 405
 {
-#line 405
     int ncid;
-#line 405
     int d;
-#line 405
     int i;
-#line 405
     int j;
-#line 405
     int k;
-#line 405
     int err;
-#line 405
     int allInExtRange;	/* all values within external range? */
-#line 405
     int allInIntRange;	/* all values within internal range? */
-#line 405
     int nels;
-#line 405
     int nslabs;
-#line 405
     int nok = 0;      /* count of valid comparisons */
-#line 405
     size_t start[MAX_RANK];
-#line 405
     size_t edge[MAX_RANK];
-#line 405
     size_t index[MAX_RANK];
-#line 405
     size_t mid[MAX_RANK];
-#line 405
     int canConvert;     /* Both text or both numeric */
-#line 405
     short value[MAX_NELS];
-#line 405
     double expect[MAX_NELS];
-#line 405
 
-#line 405
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 405
     IF (err)
-#line 405
 	error("nc_open: %s", nc_strerror(err));
-#line 405
     for (i = 0; i < NVARS; i++) {
-#line 405
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 405
         assert(var_rank[i] <= MAX_RANK);
-#line 405
         assert(var_nels[i] <= MAX_NELS);
-#line 405
 	for (j = 0; j < var_rank[i]; j++) {
-#line 405
 	    start[j] = 0;
-#line 405
 	    edge[j] = 1;
-#line 405
 	}
-#line 405
         err = nc_get_vara_short(BAD_ID, i, start, edge, value);
-#line 405
         IF (err != NC_EBADID)
-#line 405
 	    error("bad ncid: status = %d", err);
-#line 405
         err = nc_get_vara_short(ncid, BAD_VARID, start, edge, value);
-#line 405
         IF (err != NC_ENOTVAR)
-#line 405
 	    error("bad var id: status = %d", err);
-#line 405
 	for (j = 0; j < var_rank[i]; j++) {
-#line 405
 	    start[j] = var_shape[i][j];
-#line 405
 	    err = nc_get_vara_short(ncid, i, start, edge, value);
-#line 405
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 405
                 error("bad index: status = %d", err);
-#line 405
 	    start[j] = 0;
-#line 405
 	    edge[j] = var_shape[i][j] + 1;
-#line 405
 	    err = nc_get_vara_short(ncid, i, start, edge, value);
-#line 405
             IF (canConvert && err != NC_EEDGE)
-#line 405
 		error("bad edge: status = %d", err);
-#line 405
 	    edge[j] = 1;
-#line 405
 	}
-#line 405
             /* Check non-scalars for correct error returned even when */
-#line 405
             /* there is nothing to get (edge[j]==0) */
-#line 405
 	if(var_rank[i] > 0) {
-#line 405
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 405
 		edge[j] = 0;
-#line 405
 	    }
-#line 405
 	    err = nc_get_vara_short(BAD_ID, i, start, edge, value);
-#line 405
 	    IF (err != NC_EBADID) 
-#line 405
 		error("bad ncid: status = %d", err);
-#line 405
 	    err = nc_get_vara_short(ncid, BAD_VARID, start, edge, value);
-#line 405
 	    IF (err != NC_ENOTVAR) 
-#line 405
 		error("bad var id: status = %d", err);
-#line 405
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 405
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 405
 		    start[j] = var_shape[i][j];
-#line 405
 		    err = nc_get_vara_short(ncid, i, start, edge, value);
-#line 405
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 405
 			error("bad start: status = %d", err);
-#line 405
 		    start[j] = 0;
-#line 405
 		}
-#line 405
 	    }
-#line 405
 	    err = nc_get_vara_short(ncid, i, start, edge, value);
-#line 405
 	    if (canConvert) {
-#line 405
 		IF (err) 
-#line 405
 		    error("%s", nc_strerror(err));
-#line 405
 	    } else {
-#line 405
 		IF (err != NC_ECHAR)
-#line 405
 		    error("wrong type: status = %d", err);
-#line 405
 	    }
-#line 405
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 405
 		edge[j] = 1;
-#line 405
 	    }
-#line 405
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 405
             /* get 2^rank (nslabs) slabs so defined */
-#line 405
         nslabs = 1;
-#line 405
         for (j = 0; j < var_rank[i]; j++) {
-#line 405
             mid[j] = roll( var_shape[i][j] );
-#line 405
             nslabs *= 2;
-#line 405
         }
-#line 405
             /* bits of k determine whether to get lower or upper part of dim */
-#line 405
         for (k = 0; k < nslabs; k++) {
-#line 405
             nels = 1;
-#line 405
             for (j = 0; j < var_rank[i]; j++) {
-#line 405
                 if ((k >> j) & 1) {
-#line 405
                     start[j] = 0;
-#line 405
                     edge[j] = mid[j];
-#line 405
                 }else{
-#line 405
                     start[j] = mid[j];
-#line 405
                     edge[j] = var_shape[i][j] - mid[j];
-#line 405
                 }
-#line 405
                 nels *= edge[j];
-#line 405
             }
-#line 405
 	    allInExtRange = allInIntRange = 1;
-#line 405
             for (j = 0; j < nels; j++) {
-#line 405
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 405
                 IF (err)
-#line 405
                     error("error in toMixedBase 1");
-#line 405
                 for (d = 0; d < var_rank[i]; d++)
-#line 405
                     index[d] += start[d];
-#line 405
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_SHORT);
-#line 405
 		if (inRange3(expect[j],var_type[i], NCT_SHORT)) {
-#line 405
 		    allInIntRange = allInIntRange && expect[j] >= short_min
-#line 405
 				&& expect[j] <= short_max;
-#line 405
 		} else {
-#line 405
 		    allInExtRange = 0;
-#line 405
 		}
-#line 405
 	    }
-#line 405
             if (var_rank[i] == 0 && i%2)
-#line 405
 		err = nc_get_vara_short(ncid, i, NULL, NULL, value);
-#line 405
 	    else
-#line 405
 		err = nc_get_vara_short(ncid, i, start, edge, value);
-#line 405
             if (canConvert) {
-#line 405
 		if (allInExtRange) {
-#line 405
 		    if (allInIntRange) {
-#line 405
 			IF (err)
-#line 405
 			    error("%s", nc_strerror(err));
-#line 405
 		    } else {
-#line 405
 			IF (err != NC_ERANGE)
-#line 405
 			    error("Range error: status = %d", err);
-#line 405
 		    }
-#line 405
 		} else {
-#line 405
 		    IF (err != 0 && err != NC_ERANGE)
-#line 405
 			error("OK or Range error: status = %d", err);
-#line 405
 		}
-#line 405
 		for (j = 0; j < nels; j++) {
-#line 405
 		    if (inRange3(expect[j],var_type[i],NCT_SHORT)
-#line 405
 			    && expect[j] >= short_min && expect[j] <= short_max) {
-#line 405
 			IF (!equal(value[j],expect[j],var_type[i],NCT_SHORT)){
-#line 405
 			    error("value read not that expected");
-#line 405
 			    if (verbose) {
-#line 405
 				error("\n");
-#line 405
 				error("varid: %d, ", i);
-#line 405
 				error("var_name: %s, ", var_name[i]);
-#line 405
 				error("element number: %d ", j);
-#line 405
 				error("expect: %g", expect[j]);
-#line 405
 				error("got: %g", (double) value[j]);
-#line 405
 			    }
-#line 405
 			} else {
-#line 405
 			    nok++;
-#line 405
 			}
-#line 405
 		    }
-#line 405
 		}
-#line 405
             } else {
-#line 405
                 IF (nels > 0 && err != NC_ECHAR)
-#line 405
                     error("wrong type: status = %d", err);
-#line 405
             }
-#line 405
         }
-#line 405
     }
-#line 405
     err = nc_close(ncid);
-#line 405
     IF (err)
-#line 405
 	error("nc_close: %s", nc_strerror(err));
-#line 405
     print_nok(nok);
-#line 405
 }
-#line 405
 
 void
-#line 406
 test_nc_get_vara_int(void)
-#line 406
 {
-#line 406
     int ncid;
-#line 406
     int d;
-#line 406
     int i;
-#line 406
     int j;
-#line 406
     int k;
-#line 406
     int err;
-#line 406
     int allInExtRange;	/* all values within external range? */
-#line 406
     int allInIntRange;	/* all values within internal range? */
-#line 406
     int nels;
-#line 406
     int nslabs;
-#line 406
     int nok = 0;      /* count of valid comparisons */
-#line 406
     size_t start[MAX_RANK];
-#line 406
     size_t edge[MAX_RANK];
-#line 406
     size_t index[MAX_RANK];
-#line 406
     size_t mid[MAX_RANK];
-#line 406
     int canConvert;     /* Both text or both numeric */
-#line 406
     int value[MAX_NELS];
-#line 406
     double expect[MAX_NELS];
-#line 406
 
-#line 406
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 406
     IF (err)
-#line 406
 	error("nc_open: %s", nc_strerror(err));
-#line 406
     for (i = 0; i < NVARS; i++) {
-#line 406
         canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 406
         assert(var_rank[i] <= MAX_RANK);
-#line 406
         assert(var_nels[i] <= MAX_NELS);
-#line 406
 	for (j = 0; j < var_rank[i]; j++) {
-#line 406
 	    start[j] = 0;
-#line 406
 	    edge[j] = 1;
-#line 406
 	}
-#line 406
         err = nc_get_vara_int(BAD_ID, i, start, edge, value);
-#line 406
         IF (err != NC_EBADID)
-#line 406
 	    error("bad ncid: status = %d", err);
-#line 406
         err = nc_get_vara_int(ncid, BAD_VARID, start, edge, value);
-#line 406
         IF (err != NC_ENOTVAR)
-#line 406
 	    error("bad var id: status = %d", err);
-#line 406
 	for (j = 0; j < var_rank[i]; j++) {
-#line 406
 	    start[j] = var_shape[i][j];
-#line 406
 	    err = nc_get_vara_int(ncid, i, start, edge, value);
-#line 406
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 406
                 error("bad index: status = %d", err);
-#line 406
 	    start[j] = 0;
-#line 406
 	    edge[j] = var_shape[i][j] + 1;
-#line 406
 	    err = nc_get_vara_int(ncid, i, start, edge, value);
-#line 406
             IF (canConvert && err != NC_EEDGE)
-#line 406
 		error("bad edge: status = %d", err);
-#line 406
 	    edge[j] = 1;
-#line 406
 	}
-#line 406
             /* Check non-scalars for correct error returned even when */
-#line 406
             /* there is nothing to get (edge[j]==0) */
-#line 406
 	if(var_rank[i] > 0) {
-#line 406
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 406
 		edge[j] = 0;
-#line 406
 	    }
-#line 406
 	    err = nc_get_vara_int(BAD_ID, i, start, edge, value);
-#line 406
 	    IF (err != NC_EBADID) 
-#line 406
 		error("bad ncid: status = %d", err);
-#line 406
 	    err = nc_get_vara_int(ncid, BAD_VARID, start, edge, value);
-#line 406
 	    IF (err != NC_ENOTVAR) 
-#line 406
 		error("bad var id: status = %d", err);
-#line 406
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 406
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 406
 		    start[j] = var_shape[i][j];
-#line 406
 		    err = nc_get_vara_int(ncid, i, start, edge, value);
-#line 406
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 406
 			error("bad start: status = %d", err);
-#line 406
 		    start[j] = 0;
-#line 406
 		}
-#line 406
 	    }
-#line 406
 	    err = nc_get_vara_int(ncid, i, start, edge, value);
-#line 406
 	    if (canConvert) {
-#line 406
 		IF (err) 
-#line 406
 		    error("%s", nc_strerror(err));
-#line 406
 	    } else {
-#line 406
 		IF (err != NC_ECHAR)
-#line 406
 		    error("wrong type: status = %d", err);
-#line 406
 	    }
-#line 406
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 406
 		edge[j] = 1;
-#line 406
 	    }
-#line 406
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 406
             /* get 2^rank (nslabs) slabs so defined */
-#line 406
         nslabs = 1;
-#line 406
         for (j = 0; j < var_rank[i]; j++) {
-#line 406
             mid[j] = roll( var_shape[i][j] );
-#line 406
             nslabs *= 2;
-#line 406
         }
-#line 406
             /* bits of k determine whether to get lower or upper part of dim */
-#line 406
         for (k = 0; k < nslabs; k++) {
-#line 406
             nels = 1;
-#line 406
             for (j = 0; j < var_rank[i]; j++) {
-#line 406
                 if ((k >> j) & 1) {
-#line 406
                     start[j] = 0;
-#line 406
                     edge[j] = mid[j];
-#line 406
                 }else{
-#line 406
                     start[j] = mid[j];
-#line 406
                     edge[j] = var_shape[i][j] - mid[j];
-#line 406
                 }
-#line 406
                 nels *= edge[j];
-#line 406
             }
-#line 406
 	    allInExtRange = allInIntRange = 1;
-#line 406
             for (j = 0; j < nels; j++) {
-#line 406
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 406
                 IF (err)
-#line 406
                     error("error in toMixedBase 1");
-#line 406
                 for (d = 0; d < var_rank[i]; d++)
-#line 406
                     index[d] += start[d];
-#line 406
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_INT);
-#line 406
 		if (inRange3(expect[j],var_type[i], NCT_INT)) {
-#line 406
 		    allInIntRange = allInIntRange && expect[j] >= int_min
-#line 406
 				&& expect[j] <= int_max;
-#line 406
 		} else {
-#line 406
 		    allInExtRange = 0;
-#line 406
 		}
-#line 406
 	    }
-#line 406
             if (var_rank[i] == 0 && i%2)
-#line 406
 		err = nc_get_vara_int(ncid, i, NULL, NULL, value);
-#line 406
 	    else
-#line 406
 		err = nc_get_vara_int(ncid, i, start, edge, value);
-#line 406
             if (canConvert) {
-#line 406
 		if (allInExtRange) {
-#line 406
 		    if (allInIntRange) {
-#line 406
 			IF (err)
-#line 406
 			    error("%s", nc_strerror(err));
-#line 406
 		    } else {
-#line 406
 			IF (err != NC_ERANGE)
-#line 406
 			    error("Range error: status = %d", err);
-#line 406
 		    }
-#line 406
 		} else {
-#line 406
 		    IF (err != 0 && err != NC_ERANGE)
-#line 406
 			error("OK or Range error: status = %d", err);
-#line 406
 		}
-#line 406
 		for (j = 0; j < nels; j++) {
-#line 406
 		    if (inRange3(expect[j],var_type[i],NCT_INT)
-#line 406
 			    && expect[j] >= int_min && expect[j] <= int_max) {
-#line 406
 			IF (!equal(value[j],expect[j],var_type[i],NCT_INT)){
-#line 406
 			    error("value read not that expected");
-#line 406
 			    if (verbose) {
-#line 406
 				error("\n");
-#line 406
 				error("varid: %d, ", i);
-#line 406
 				error("var_name: %s, ", var_name[i]);
-#line 406
 				error("element number: %d ", j);
-#line 406
 				error("expect: %g", expect[j]);
-#line 406
 				error("got: %g", (double) value[j]);
-#line 406
 			    }
-#line 406
 			} else {
-#line 406
 			    nok++;
-#line 406
 			}
-#line 406
 		    }
-#line 406
 		}
-#line 406
             } else {
-#line 406
                 IF (nels > 0 && err != NC_ECHAR)
-#line 406
                     error("wrong type: status = %d", err);
-#line 406
             }
-#line 406
         }
-#line 406
     }
-#line 406
     err = nc_close(ncid);
-#line 406
     IF (err)
-#line 406
 	error("nc_close: %s", nc_strerror(err));
-#line 406
     print_nok(nok);
-#line 406
 }
-#line 406
 
 void
-#line 407
 test_nc_get_vara_long(void)
-#line 407
 {
-#line 407
     int ncid;
-#line 407
     int d;
-#line 407
     int i;
-#line 407
     int j;
-#line 407
     int k;
-#line 407
     int err;
-#line 407
     int allInExtRange;	/* all values within external range? */
-#line 407
     int allInIntRange;	/* all values within internal range? */
-#line 407
     int nels;
-#line 407
     int nslabs;
-#line 407
     int nok = 0;      /* count of valid comparisons */
-#line 407
     size_t start[MAX_RANK];
-#line 407
     size_t edge[MAX_RANK];
-#line 407
     size_t index[MAX_RANK];
-#line 407
     size_t mid[MAX_RANK];
-#line 407
     int canConvert;     /* Both text or both numeric */
-#line 407
     long value[MAX_NELS];
-#line 407
     double expect[MAX_NELS];
-#line 407
 
-#line 407
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 407
     IF (err)
-#line 407
 	error("nc_open: %s", nc_strerror(err));
-#line 407
     for (i = 0; i < NVARS; i++) {
-#line 407
         canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 407
         assert(var_rank[i] <= MAX_RANK);
-#line 407
         assert(var_nels[i] <= MAX_NELS);
-#line 407
 	for (j = 0; j < var_rank[i]; j++) {
-#line 407
 	    start[j] = 0;
-#line 407
 	    edge[j] = 1;
-#line 407
 	}
-#line 407
         err = nc_get_vara_long(BAD_ID, i, start, edge, value);
-#line 407
         IF (err != NC_EBADID)
-#line 407
 	    error("bad ncid: status = %d", err);
-#line 407
         err = nc_get_vara_long(ncid, BAD_VARID, start, edge, value);
-#line 407
         IF (err != NC_ENOTVAR)
-#line 407
 	    error("bad var id: status = %d", err);
-#line 407
 	for (j = 0; j < var_rank[i]; j++) {
-#line 407
 	    start[j] = var_shape[i][j];
-#line 407
 	    err = nc_get_vara_long(ncid, i, start, edge, value);
-#line 407
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 407
                 error("bad index: status = %d", err);
-#line 407
 	    start[j] = 0;
-#line 407
 	    edge[j] = var_shape[i][j] + 1;
-#line 407
 	    err = nc_get_vara_long(ncid, i, start, edge, value);
-#line 407
             IF (canConvert && err != NC_EEDGE)
-#line 407
 		error("bad edge: status = %d", err);
-#line 407
 	    edge[j] = 1;
-#line 407
 	}
-#line 407
             /* Check non-scalars for correct error returned even when */
-#line 407
             /* there is nothing to get (edge[j]==0) */
-#line 407
 	if(var_rank[i] > 0) {
-#line 407
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 407
 		edge[j] = 0;
-#line 407
 	    }
-#line 407
 	    err = nc_get_vara_long(BAD_ID, i, start, edge, value);
-#line 407
 	    IF (err != NC_EBADID) 
-#line 407
 		error("bad ncid: status = %d", err);
-#line 407
 	    err = nc_get_vara_long(ncid, BAD_VARID, start, edge, value);
-#line 407
 	    IF (err != NC_ENOTVAR) 
-#line 407
 		error("bad var id: status = %d", err);
-#line 407
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 407
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 407
 		    start[j] = var_shape[i][j];
-#line 407
 		    err = nc_get_vara_long(ncid, i, start, edge, value);
-#line 407
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 407
 			error("bad start: status = %d", err);
-#line 407
 		    start[j] = 0;
-#line 407
 		}
-#line 407
 	    }
-#line 407
 	    err = nc_get_vara_long(ncid, i, start, edge, value);
-#line 407
 	    if (canConvert) {
-#line 407
 		IF (err) 
-#line 407
 		    error("%s", nc_strerror(err));
-#line 407
 	    } else {
-#line 407
 		IF (err != NC_ECHAR)
-#line 407
 		    error("wrong type: status = %d", err);
-#line 407
 	    }
-#line 407
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 407
 		edge[j] = 1;
-#line 407
 	    }
-#line 407
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 407
             /* get 2^rank (nslabs) slabs so defined */
-#line 407
         nslabs = 1;
-#line 407
         for (j = 0; j < var_rank[i]; j++) {
-#line 407
             mid[j] = roll( var_shape[i][j] );
-#line 407
             nslabs *= 2;
-#line 407
         }
-#line 407
             /* bits of k determine whether to get lower or upper part of dim */
-#line 407
         for (k = 0; k < nslabs; k++) {
-#line 407
             nels = 1;
-#line 407
             for (j = 0; j < var_rank[i]; j++) {
-#line 407
                 if ((k >> j) & 1) {
-#line 407
                     start[j] = 0;
-#line 407
                     edge[j] = mid[j];
-#line 407
                 }else{
-#line 407
                     start[j] = mid[j];
-#line 407
                     edge[j] = var_shape[i][j] - mid[j];
-#line 407
                 }
-#line 407
                 nels *= edge[j];
-#line 407
             }
-#line 407
 	    allInExtRange = allInIntRange = 1;
-#line 407
             for (j = 0; j < nels; j++) {
-#line 407
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 407
                 IF (err)
-#line 407
                     error("error in toMixedBase 1");
-#line 407
                 for (d = 0; d < var_rank[i]; d++)
-#line 407
                     index[d] += start[d];
-#line 407
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_LONG);
-#line 407
 		if (inRange3(expect[j],var_type[i], NCT_LONG)) {
-#line 407
 		    allInIntRange = allInIntRange && expect[j] >= long_min
-#line 407
 				&& expect[j] <= long_max;
-#line 407
 		} else {
-#line 407
 		    allInExtRange = 0;
-#line 407
 		}
-#line 407
 	    }
-#line 407
             if (var_rank[i] == 0 && i%2)
-#line 407
 		err = nc_get_vara_long(ncid, i, NULL, NULL, value);
-#line 407
 	    else
-#line 407
 		err = nc_get_vara_long(ncid, i, start, edge, value);
-#line 407
             if (canConvert) {
-#line 407
 		if (allInExtRange) {
-#line 407
 		    if (allInIntRange) {
-#line 407
 			IF (err)
-#line 407
 			    error("%s", nc_strerror(err));
-#line 407
 		    } else {
-#line 407
 			IF (err != NC_ERANGE)
-#line 407
 			    error("Range error: status = %d", err);
-#line 407
 		    }
-#line 407
 		} else {
-#line 407
 		    IF (err != 0 && err != NC_ERANGE)
-#line 407
 			error("OK or Range error: status = %d", err);
-#line 407
 		}
-#line 407
 		for (j = 0; j < nels; j++) {
-#line 407
 		    if (inRange3(expect[j],var_type[i],NCT_LONG)
-#line 407
 			    && expect[j] >= long_min && expect[j] <= long_max) {
-#line 407
 			IF (!equal(value[j],expect[j],var_type[i],NCT_LONG)){
-#line 407
 			    error("value read not that expected");
-#line 407
 			    if (verbose) {
-#line 407
 				error("\n");
-#line 407
 				error("varid: %d, ", i);
-#line 407
 				error("var_name: %s, ", var_name[i]);
-#line 407
 				error("element number: %d ", j);
-#line 407
 				error("expect: %g", expect[j]);
-#line 407
 				error("got: %g", (double) value[j]);
-#line 407
 			    }
-#line 407
 			} else {
-#line 407
 			    nok++;
-#line 407
 			}
-#line 407
 		    }
-#line 407
 		}
-#line 407
             } else {
-#line 407
                 IF (nels > 0 && err != NC_ECHAR)
-#line 407
                     error("wrong type: status = %d", err);
-#line 407
             }
-#line 407
         }
-#line 407
     }
-#line 407
     err = nc_close(ncid);
-#line 407
     IF (err)
-#line 407
 	error("nc_close: %s", nc_strerror(err));
-#line 407
     print_nok(nok);
-#line 407
 }
-#line 407
 
 void
-#line 408
 test_nc_get_vara_float(void)
-#line 408
 {
-#line 408
     int ncid;
-#line 408
     int d;
-#line 408
     int i;
-#line 408
     int j;
-#line 408
     int k;
-#line 408
     int err;
-#line 408
     int allInExtRange;	/* all values within external range? */
-#line 408
     int allInIntRange;	/* all values within internal range? */
-#line 408
     int nels;
-#line 408
     int nslabs;
-#line 408
     int nok = 0;      /* count of valid comparisons */
-#line 408
     size_t start[MAX_RANK];
-#line 408
     size_t edge[MAX_RANK];
-#line 408
     size_t index[MAX_RANK];
-#line 408
     size_t mid[MAX_RANK];
-#line 408
     int canConvert;     /* Both text or both numeric */
-#line 408
     float value[MAX_NELS];
-#line 408
     double expect[MAX_NELS];
-#line 408
 
-#line 408
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 408
     IF (err)
-#line 408
 	error("nc_open: %s", nc_strerror(err));
-#line 408
     for (i = 0; i < NVARS; i++) {
-#line 408
         canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 408
         assert(var_rank[i] <= MAX_RANK);
-#line 408
         assert(var_nels[i] <= MAX_NELS);
-#line 408
 	for (j = 0; j < var_rank[i]; j++) {
-#line 408
 	    start[j] = 0;
-#line 408
 	    edge[j] = 1;
-#line 408
 	}
-#line 408
         err = nc_get_vara_float(BAD_ID, i, start, edge, value);
-#line 408
         IF (err != NC_EBADID)
-#line 408
 	    error("bad ncid: status = %d", err);
-#line 408
         err = nc_get_vara_float(ncid, BAD_VARID, start, edge, value);
-#line 408
         IF (err != NC_ENOTVAR)
-#line 408
 	    error("bad var id: status = %d", err);
-#line 408
 	for (j = 0; j < var_rank[i]; j++) {
-#line 408
 	    start[j] = var_shape[i][j];
-#line 408
 	    err = nc_get_vara_float(ncid, i, start, edge, value);
-#line 408
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 408
                 error("bad index: status = %d", err);
-#line 408
 	    start[j] = 0;
-#line 408
 	    edge[j] = var_shape[i][j] + 1;
-#line 408
 	    err = nc_get_vara_float(ncid, i, start, edge, value);
-#line 408
             IF (canConvert && err != NC_EEDGE)
-#line 408
 		error("bad edge: status = %d", err);
-#line 408
 	    edge[j] = 1;
-#line 408
 	}
-#line 408
             /* Check non-scalars for correct error returned even when */
-#line 408
             /* there is nothing to get (edge[j]==0) */
-#line 408
 	if(var_rank[i] > 0) {
-#line 408
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 408
 		edge[j] = 0;
-#line 408
 	    }
-#line 408
 	    err = nc_get_vara_float(BAD_ID, i, start, edge, value);
-#line 408
 	    IF (err != NC_EBADID) 
-#line 408
 		error("bad ncid: status = %d", err);
-#line 408
 	    err = nc_get_vara_float(ncid, BAD_VARID, start, edge, value);
-#line 408
 	    IF (err != NC_ENOTVAR) 
-#line 408
 		error("bad var id: status = %d", err);
-#line 408
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 408
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 408
 		    start[j] = var_shape[i][j];
-#line 408
 		    err = nc_get_vara_float(ncid, i, start, edge, value);
-#line 408
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 408
 			error("bad start: status = %d", err);
-#line 408
 		    start[j] = 0;
-#line 408
 		}
-#line 408
 	    }
-#line 408
 	    err = nc_get_vara_float(ncid, i, start, edge, value);
-#line 408
 	    if (canConvert) {
-#line 408
 		IF (err) 
-#line 408
 		    error("%s", nc_strerror(err));
-#line 408
 	    } else {
-#line 408
 		IF (err != NC_ECHAR)
-#line 408
 		    error("wrong type: status = %d", err);
-#line 408
 	    }
-#line 408
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 408
 		edge[j] = 1;
-#line 408
 	    }
-#line 408
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 408
             /* get 2^rank (nslabs) slabs so defined */
-#line 408
         nslabs = 1;
-#line 408
         for (j = 0; j < var_rank[i]; j++) {
-#line 408
             mid[j] = roll( var_shape[i][j] );
-#line 408
             nslabs *= 2;
-#line 408
         }
-#line 408
             /* bits of k determine whether to get lower or upper part of dim */
-#line 408
         for (k = 0; k < nslabs; k++) {
-#line 408
             nels = 1;
-#line 408
             for (j = 0; j < var_rank[i]; j++) {
-#line 408
                 if ((k >> j) & 1) {
-#line 408
                     start[j] = 0;
-#line 408
                     edge[j] = mid[j];
-#line 408
                 }else{
-#line 408
                     start[j] = mid[j];
-#line 408
                     edge[j] = var_shape[i][j] - mid[j];
-#line 408
                 }
-#line 408
                 nels *= edge[j];
-#line 408
             }
-#line 408
 	    allInExtRange = allInIntRange = 1;
-#line 408
             for (j = 0; j < nels; j++) {
-#line 408
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 408
                 IF (err)
-#line 408
                     error("error in toMixedBase 1");
-#line 408
                 for (d = 0; d < var_rank[i]; d++)
-#line 408
                     index[d] += start[d];
-#line 408
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 408
 		if (inRange3(expect[j],var_type[i], NCT_FLOAT)) {
-#line 408
 		    allInIntRange = allInIntRange && expect[j] >= float_min
-#line 408
 				&& expect[j] <= float_max;
-#line 408
 		} else {
-#line 408
 		    allInExtRange = 0;
-#line 408
 		}
-#line 408
 	    }
-#line 408
             if (var_rank[i] == 0 && i%2)
-#line 408
 		err = nc_get_vara_float(ncid, i, NULL, NULL, value);
-#line 408
 	    else
-#line 408
 		err = nc_get_vara_float(ncid, i, start, edge, value);
-#line 408
             if (canConvert) {
-#line 408
 		if (allInExtRange) {
-#line 408
 		    if (allInIntRange) {
-#line 408
 			IF (err)
-#line 408
 			    error("%s", nc_strerror(err));
-#line 408
 		    } else {
-#line 408
 			IF (err != NC_ERANGE)
-#line 408
 			    error("Range error: status = %d", err);
-#line 408
 		    }
-#line 408
 		} else {
-#line 408
 		    IF (err != 0 && err != NC_ERANGE)
-#line 408
 			error("OK or Range error: status = %d", err);
-#line 408
 		}
-#line 408
 		for (j = 0; j < nels; j++) {
-#line 408
 		    if (inRange3(expect[j],var_type[i],NCT_FLOAT)
-#line 408
 			    && expect[j] >= float_min && expect[j] <= float_max) {
-#line 408
 			IF (!equal(value[j],expect[j],var_type[i],NCT_FLOAT)){
-#line 408
 			    error("value read not that expected");
-#line 408
 			    if (verbose) {
-#line 408
 				error("\n");
-#line 408
 				error("varid: %d, ", i);
-#line 408
 				error("var_name: %s, ", var_name[i]);
-#line 408
 				error("element number: %d ", j);
-#line 408
 				error("expect: %g", expect[j]);
-#line 408
 				error("got: %g", (double) value[j]);
-#line 408
 			    }
-#line 408
 			} else {
-#line 408
 			    nok++;
-#line 408
 			}
-#line 408
 		    }
-#line 408
 		}
-#line 408
             } else {
-#line 408
                 IF (nels > 0 && err != NC_ECHAR)
-#line 408
                     error("wrong type: status = %d", err);
-#line 408
             }
-#line 408
         }
-#line 408
     }
-#line 408
     err = nc_close(ncid);
-#line 408
     IF (err)
-#line 408
 	error("nc_close: %s", nc_strerror(err));
-#line 408
     print_nok(nok);
-#line 408
 }
-#line 408
 
 void
-#line 409
 test_nc_get_vara_double(void)
-#line 409
 {
-#line 409
     int ncid;
-#line 409
     int d;
-#line 409
     int i;
-#line 409
     int j;
-#line 409
     int k;
-#line 409
     int err;
-#line 409
     int allInExtRange;	/* all values within external range? */
-#line 409
     int allInIntRange;	/* all values within internal range? */
-#line 409
     int nels;
-#line 409
     int nslabs;
-#line 409
     int nok = 0;      /* count of valid comparisons */
-#line 409
     size_t start[MAX_RANK];
-#line 409
     size_t edge[MAX_RANK];
-#line 409
     size_t index[MAX_RANK];
-#line 409
     size_t mid[MAX_RANK];
-#line 409
     int canConvert;     /* Both text or both numeric */
-#line 409
     double value[MAX_NELS];
-#line 409
     double expect[MAX_NELS];
-#line 409
 
-#line 409
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 409
     IF (err)
-#line 409
 	error("nc_open: %s", nc_strerror(err));
-#line 409
     for (i = 0; i < NVARS; i++) {
-#line 409
         canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 409
         assert(var_rank[i] <= MAX_RANK);
-#line 409
         assert(var_nels[i] <= MAX_NELS);
-#line 409
 	for (j = 0; j < var_rank[i]; j++) {
-#line 409
 	    start[j] = 0;
-#line 409
 	    edge[j] = 1;
-#line 409
 	}
-#line 409
         err = nc_get_vara_double(BAD_ID, i, start, edge, value);
-#line 409
         IF (err != NC_EBADID)
-#line 409
 	    error("bad ncid: status = %d", err);
-#line 409
         err = nc_get_vara_double(ncid, BAD_VARID, start, edge, value);
-#line 409
         IF (err != NC_ENOTVAR)
-#line 409
 	    error("bad var id: status = %d", err);
-#line 409
 	for (j = 0; j < var_rank[i]; j++) {
-#line 409
 	    start[j] = var_shape[i][j];
-#line 409
 	    err = nc_get_vara_double(ncid, i, start, edge, value);
-#line 409
             IF (canConvert && err != NC_EINVALCOORDS)
-#line 409
                 error("bad index: status = %d", err);
-#line 409
 	    start[j] = 0;
-#line 409
 	    edge[j] = var_shape[i][j] + 1;
-#line 409
 	    err = nc_get_vara_double(ncid, i, start, edge, value);
-#line 409
             IF (canConvert && err != NC_EEDGE)
-#line 409
 		error("bad edge: status = %d", err);
-#line 409
 	    edge[j] = 1;
-#line 409
 	}
-#line 409
             /* Check non-scalars for correct error returned even when */
-#line 409
             /* there is nothing to get (edge[j]==0) */
-#line 409
 	if(var_rank[i] > 0) {
-#line 409
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 409
 		edge[j] = 0;
-#line 409
 	    }
-#line 409
 	    err = nc_get_vara_double(BAD_ID, i, start, edge, value);
-#line 409
 	    IF (err != NC_EBADID) 
-#line 409
 		error("bad ncid: status = %d", err);
-#line 409
 	    err = nc_get_vara_double(ncid, BAD_VARID, start, edge, value);
-#line 409
 	    IF (err != NC_ENOTVAR) 
-#line 409
 		error("bad var id: status = %d", err);
-#line 409
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 409
 		if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 409
 		    start[j] = var_shape[i][j];
-#line 409
 		    err = nc_get_vara_double(ncid, i, start, edge, value);
-#line 409
 		    IF (canConvert && err != NC_EINVALCOORDS)
-#line 409
 			error("bad start: status = %d", err);
-#line 409
 		    start[j] = 0;
-#line 409
 		}
-#line 409
 	    }
-#line 409
 	    err = nc_get_vara_double(ncid, i, start, edge, value);
-#line 409
 	    if (canConvert) {
-#line 409
 		IF (err) 
-#line 409
 		    error("%s", nc_strerror(err));
-#line 409
 	    } else {
-#line 409
 		IF (err != NC_ECHAR)
-#line 409
 		    error("wrong type: status = %d", err);
-#line 409
 	    }
-#line 409
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 409
 		edge[j] = 1;
-#line 409
 	    }
-#line 409
 	}            /* Choose a random point dividing each dim into 2 parts */
-#line 409
             /* get 2^rank (nslabs) slabs so defined */
-#line 409
         nslabs = 1;
-#line 409
         for (j = 0; j < var_rank[i]; j++) {
-#line 409
             mid[j] = roll( var_shape[i][j] );
-#line 409
             nslabs *= 2;
-#line 409
         }
-#line 409
             /* bits of k determine whether to get lower or upper part of dim */
-#line 409
         for (k = 0; k < nslabs; k++) {
-#line 409
             nels = 1;
-#line 409
             for (j = 0; j < var_rank[i]; j++) {
-#line 409
                 if ((k >> j) & 1) {
-#line 409
                     start[j] = 0;
-#line 409
                     edge[j] = mid[j];
-#line 409
                 }else{
-#line 409
                     start[j] = mid[j];
-#line 409
                     edge[j] = var_shape[i][j] - mid[j];
-#line 409
                 }
-#line 409
                 nels *= edge[j];
-#line 409
             }
-#line 409
 	    allInExtRange = allInIntRange = 1;
-#line 409
             for (j = 0; j < nels; j++) {
-#line 409
                 err = toMixedBase(j, var_rank[i], edge, index);
-#line 409
                 IF (err)
-#line 409
                     error("error in toMixedBase 1");
-#line 409
                 for (d = 0; d < var_rank[i]; d++)
-#line 409
                     index[d] += start[d];
-#line 409
                 expect[j] = hash4(var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 409
 		if (inRange3(expect[j],var_type[i], NCT_DOUBLE)) {
-#line 409
 		    allInIntRange = allInIntRange && expect[j] >= double_min
-#line 409
 				&& expect[j] <= double_max;
-#line 409
 		} else {
-#line 409
 		    allInExtRange = 0;
-#line 409
 		}
-#line 409
 	    }
-#line 409
             if (var_rank[i] == 0 && i%2)
-#line 409
 		err = nc_get_vara_double(ncid, i, NULL, NULL, value);
-#line 409
 	    else
-#line 409
 		err = nc_get_vara_double(ncid, i, start, edge, value);
-#line 409
             if (canConvert) {
-#line 409
 		if (allInExtRange) {
-#line 409
 		    if (allInIntRange) {
-#line 409
 			IF (err)
-#line 409
 			    error("%s", nc_strerror(err));
-#line 409
 		    } else {
-#line 409
 			IF (err != NC_ERANGE)
-#line 409
 			    error("Range error: status = %d", err);
-#line 409
 		    }
-#line 409
 		} else {
-#line 409
 		    IF (err != 0 && err != NC_ERANGE)
-#line 409
 			error("OK or Range error: status = %d", err);
-#line 409
 		}
-#line 409
 		for (j = 0; j < nels; j++) {
-#line 409
 		    if (inRange3(expect[j],var_type[i],NCT_DOUBLE)
-#line 409
 			    && expect[j] >= double_min && expect[j] <= double_max) {
-#line 409
 			IF (!equal(value[j],expect[j],var_type[i],NCT_DOUBLE)){
-#line 409
 			    error("value read not that expected");
-#line 409
 			    if (verbose) {
-#line 409
 				error("\n");
-#line 409
 				error("varid: %d, ", i);
-#line 409
 				error("var_name: %s, ", var_name[i]);
-#line 409
 				error("element number: %d ", j);
-#line 409
 				error("expect: %g", expect[j]);
-#line 409
 				error("got: %g", (double) value[j]);
-#line 409
 			    }
-#line 409
 			} else {
-#line 409
 			    nok++;
-#line 409
 			}
-#line 409
 		    }
-#line 409
 		}
-#line 409
             } else {
-#line 409
                 IF (nels > 0 && err != NC_ECHAR)
-#line 409
                     error("wrong type: status = %d", err);
-#line 409
             }
-#line 409
         }
-#line 409
     }
-#line 409
     err = nc_close(ncid);
-#line 409
     IF (err)
-#line 409
 	error("nc_close: %s", nc_strerror(err));
-#line 409
     print_nok(nok);
-#line 409
 }
-#line 409
 
 
 
-#line 590
 
 void
-#line 591
 test_nc_get_vars_text(void)
-#line 591
 {
-#line 591
     int ncid;
-#line 591
     int d;
-#line 591
     int i;
-#line 591
     int j;
-#line 591
     int k;
-#line 591
     int m;
-#line 591
     int err;
-#line 591
     int allInExtRange;	/* all values within external range? */
-#line 591
     int allInIntRange;	/* all values within internal range? */
-#line 591
     int nels;
-#line 591
     int nslabs;
-#line 591
     int nstarts;        /* number of different starts */
-#line 591
     int nok = 0;      /* count of valid comparisons */
-#line 591
     size_t start[MAX_RANK];
-#line 591
     size_t edge[MAX_RANK];
-#line 591
     size_t index[MAX_RANK];
-#line 591
     size_t index2[MAX_RANK];
-#line 591
     size_t mid[MAX_RANK];
-#line 591
     size_t count[MAX_RANK];
-#line 591
     size_t sstride[MAX_RANK];
-#line 591
     ptrdiff_t stride[MAX_RANK];
-#line 591
     int canConvert;     /* Both text or both numeric */
-#line 591
     text value[MAX_NELS];
-#line 591
     double expect[MAX_NELS];
-#line 591
 
-#line 591
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 591
     IF (err)
-#line 591
         error("nc_open: %s", nc_strerror(err));
-#line 591
     for (i = 0; i < NVARS; i++) {
-#line 591
         canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 591
         assert(var_rank[i] <= MAX_RANK);
-#line 591
         assert(var_nels[i] <= MAX_NELS);
-#line 591
         for (j = 0; j < var_rank[i]; j++) {
-#line 591
             start[j] = 0;
-#line 591
             edge[j] = 1;
-#line 591
             stride[j] = 1;
-#line 591
         }
-#line 591
         err = nc_get_vars_text(BAD_ID, i, start, edge, stride, value);
-#line 591
         IF (err != NC_EBADID)
-#line 591
             error("bad ncid: status = %d", err);
-#line 591
         err = nc_get_vars_text(ncid, BAD_VARID, start, edge, stride, value);
-#line 591
         IF (err != NC_ENOTVAR)
-#line 591
             error("bad var id: status = %d", err);
-#line 591
         for (j = 0; j < var_rank[i]; j++) {
-#line 591
             start[j] = var_shape[i][j];
-#line 591
             err = nc_get_vars_text(ncid, i, start, edge, stride, value);
-#line 591
 	  if(!canConvert) {
-#line 591
 		IF (err != NC_ECHAR)
-#line 591
                	    error("conversion: status = %d", err);
-#line 591
 	  } else {
-#line 591
             IF (err != NC_EINVALCOORDS)
-#line 591
                 error("bad index: status = %d", err);
-#line 591
             start[j] = 0;
-#line 591
             edge[j] = var_shape[i][j] + 1;
-#line 591
             err = nc_get_vars_text(ncid, i, start, edge, stride, value);
-#line 591
             IF (err != NC_EEDGE)
-#line 591
                 error("bad edge: status = %d", err);
-#line 591
             edge[j] = 1;
-#line 591
             stride[j] = 0;
-#line 591
             err = nc_get_vars_text(ncid, i, start, edge, stride, value);
-#line 591
             IF (err != NC_ESTRIDE)
-#line 591
                 error("bad stride: status = %d", err);
-#line 591
             stride[j] = 1;
-#line 591
 	  }
-#line 591
         }
-#line 591
             /* Choose a random point dividing each dim into 2 parts */
-#line 591
             /* get 2^rank (nslabs) slabs so defined */
-#line 591
         nslabs = 1;
-#line 591
         for (j = 0; j < var_rank[i]; j++) {
-#line 591
             mid[j] = roll( var_shape[i][j] );
-#line 591
             nslabs *= 2;
-#line 591
         }
-#line 591
             /* bits of k determine whether to get lower or upper part of dim */
-#line 591
             /* choose random stride from 1 to edge */
-#line 591
         for (k = 0; k < nslabs; k++) {
-#line 591
             nstarts = 1;
-#line 591
             for (j = 0; j < var_rank[i]; j++) {
-#line 591
                 if ((k >> j) & 1) {
-#line 591
                     start[j] = 0;
-#line 591
                     edge[j] = mid[j];
-#line 591
                 }else{
-#line 591
                     start[j] = mid[j];
-#line 591
                     edge[j] = var_shape[i][j] - mid[j];
-#line 591
                 }
-#line 591
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 591
                 nstarts *= stride[j];
-#line 591
             }
-#line 591
             for (m = 0; m < nstarts; m++) {
-#line 591
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 591
                 IF (err)
-#line 591
                     error("error in toMixedBase");
-#line 591
                 nels = 1;
-#line 591
                 for (j = 0; j < var_rank[i]; j++) {
-#line 591
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 591
                     nels *= count[j];
-#line 591
                     index[j] += start[j];
-#line 591
                 }
-#line 591
                         /* Random choice of forward or backward */
-#line 591
 /* TODO
-#line 591
                 if ( roll(2) ) {
-#line 591
                     for (j = 0; j < var_rank[i]; j++) {
-#line 591
                         index[j] += (count[j] - 1) * stride[j];
-#line 591
                         stride[j] = -stride[j];
-#line 591
                     }
-#line 591
                 }
-#line 591
 */
-#line 591
 		allInExtRange = allInIntRange = 1;
-#line 591
 		for (j = 0; j < nels; j++) {
-#line 591
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 591
 		    IF (err)
-#line 591
 			error("error in toMixedBase 1");
-#line 591
 		    for (d = 0; d < var_rank[i]; d++)
-#line 591
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 591
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 591
 			NCT_TEXT);
-#line 591
 		    if (inRange3(expect[j],var_type[i],NCT_TEXT)) {
-#line 591
 			allInIntRange = allInIntRange && expect[j] >= text_min
-#line 591
 			    && expect[j] <= text_max;
-#line 591
 		    } else {
-#line 591
 			allInExtRange = 0;
-#line 591
 		    }
-#line 591
 		}
-#line 591
                 if (var_rank[i] == 0 && i%2 )
-#line 591
                     err = nc_get_vars_text(ncid, i, NULL, NULL, NULL, value);
-#line 591
                 else
-#line 591
                     err = nc_get_vars_text(ncid, i, index, count, stride, value);
-#line 591
 		if (canConvert) {
-#line 591
 		    if (allInExtRange) {
-#line 591
 			if (allInIntRange) {
-#line 591
 			    IF (err)
-#line 591
 				error("%s", nc_strerror(err));
-#line 591
 			} else {
-#line 591
 			    IF (err != NC_ERANGE)
-#line 591
 				error("Range error: status = %d", err);
-#line 591
 			}
-#line 591
 		    } else {
-#line 591
 			IF (err != 0 && err != NC_ERANGE)
-#line 591
 			    error("OK or Range error: status = %d", err);
-#line 591
 		    }
-#line 591
 		    for (j = 0; j < nels; j++) {
-#line 591
 			if (inRange3(expect[j],var_type[i],NCT_TEXT)
-#line 591
 				&& expect[j] >= text_min && expect[j] <= text_max) {
-#line 591
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_TEXT)){
-#line 591
 				error("value read not that expected");
-#line 591
 				if (verbose) {
-#line 591
 				    error("\n");
-#line 591
 				    error("varid: %d, ", i);
-#line 591
 				    error("var_name: %s, ", var_name[i]);
-#line 591
 				    error("element number: %d ", j);
-#line 591
                                     error("expect: %g, ", expect[j]);
-#line 591
 				    error("got: %g", (double) value[j]);
-#line 591
 				}
-#line 591
 			    } else {
-#line 591
 				nok++;
-#line 591
 			    }
-#line 591
 			}
-#line 591
 		    }
-#line 591
 		} else {
-#line 591
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 591
 			error("wrong type: status = %d", err);
-#line 591
 		}
-#line 591
 	    }
-#line 591
 	}
-#line 591
 
-#line 591
     }
-#line 591
     err = nc_close(ncid);
-#line 591
     IF (err)
-#line 591
         error("nc_close: %s", nc_strerror(err));
-#line 591
     print_nok(nok);
-#line 591
 }
-#line 591
 
 void
-#line 592
 test_nc_get_vars_uchar(void)
-#line 592
 {
-#line 592
     int ncid;
-#line 592
     int d;
-#line 592
     int i;
-#line 592
     int j;
-#line 592
     int k;
-#line 592
     int m;
-#line 592
     int err;
-#line 592
     int allInExtRange;	/* all values within external range? */
-#line 592
     int allInIntRange;	/* all values within internal range? */
-#line 592
     int nels;
-#line 592
     int nslabs;
-#line 592
     int nstarts;        /* number of different starts */
-#line 592
     int nok = 0;      /* count of valid comparisons */
-#line 592
     size_t start[MAX_RANK];
-#line 592
     size_t edge[MAX_RANK];
-#line 592
     size_t index[MAX_RANK];
-#line 592
     size_t index2[MAX_RANK];
-#line 592
     size_t mid[MAX_RANK];
-#line 592
     size_t count[MAX_RANK];
-#line 592
     size_t sstride[MAX_RANK];
-#line 592
     ptrdiff_t stride[MAX_RANK];
-#line 592
     int canConvert;     /* Both text or both numeric */
-#line 592
     uchar value[MAX_NELS];
-#line 592
     double expect[MAX_NELS];
-#line 592
 
-#line 592
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 592
     IF (err)
-#line 592
         error("nc_open: %s", nc_strerror(err));
-#line 592
     for (i = 0; i < NVARS; i++) {
-#line 592
         canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 592
         assert(var_rank[i] <= MAX_RANK);
-#line 592
         assert(var_nels[i] <= MAX_NELS);
-#line 592
         for (j = 0; j < var_rank[i]; j++) {
-#line 592
             start[j] = 0;
-#line 592
             edge[j] = 1;
-#line 592
             stride[j] = 1;
-#line 592
         }
-#line 592
         err = nc_get_vars_uchar(BAD_ID, i, start, edge, stride, value);
-#line 592
         IF (err != NC_EBADID)
-#line 592
             error("bad ncid: status = %d", err);
-#line 592
         err = nc_get_vars_uchar(ncid, BAD_VARID, start, edge, stride, value);
-#line 592
         IF (err != NC_ENOTVAR)
-#line 592
             error("bad var id: status = %d", err);
-#line 592
         for (j = 0; j < var_rank[i]; j++) {
-#line 592
             start[j] = var_shape[i][j];
-#line 592
             err = nc_get_vars_uchar(ncid, i, start, edge, stride, value);
-#line 592
 	  if(!canConvert) {
-#line 592
 		IF (err != NC_ECHAR)
-#line 592
                	    error("conversion: status = %d", err);
-#line 592
 	  } else {
-#line 592
             IF (err != NC_EINVALCOORDS)
-#line 592
                 error("bad index: status = %d", err);
-#line 592
             start[j] = 0;
-#line 592
             edge[j] = var_shape[i][j] + 1;
-#line 592
             err = nc_get_vars_uchar(ncid, i, start, edge, stride, value);
-#line 592
             IF (err != NC_EEDGE)
-#line 592
                 error("bad edge: status = %d", err);
-#line 592
             edge[j] = 1;
-#line 592
             stride[j] = 0;
-#line 592
             err = nc_get_vars_uchar(ncid, i, start, edge, stride, value);
-#line 592
             IF (err != NC_ESTRIDE)
-#line 592
                 error("bad stride: status = %d", err);
-#line 592
             stride[j] = 1;
-#line 592
 	  }
-#line 592
         }
-#line 592
             /* Choose a random point dividing each dim into 2 parts */
-#line 592
             /* get 2^rank (nslabs) slabs so defined */
-#line 592
         nslabs = 1;
-#line 592
         for (j = 0; j < var_rank[i]; j++) {
-#line 592
             mid[j] = roll( var_shape[i][j] );
-#line 592
             nslabs *= 2;
-#line 592
         }
-#line 592
             /* bits of k determine whether to get lower or upper part of dim */
-#line 592
             /* choose random stride from 1 to edge */
-#line 592
         for (k = 0; k < nslabs; k++) {
-#line 592
             nstarts = 1;
-#line 592
             for (j = 0; j < var_rank[i]; j++) {
-#line 592
                 if ((k >> j) & 1) {
-#line 592
                     start[j] = 0;
-#line 592
                     edge[j] = mid[j];
-#line 592
                 }else{
-#line 592
                     start[j] = mid[j];
-#line 592
                     edge[j] = var_shape[i][j] - mid[j];
-#line 592
                 }
-#line 592
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 592
                 nstarts *= stride[j];
-#line 592
             }
-#line 592
             for (m = 0; m < nstarts; m++) {
-#line 592
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 592
                 IF (err)
-#line 592
                     error("error in toMixedBase");
-#line 592
                 nels = 1;
-#line 592
                 for (j = 0; j < var_rank[i]; j++) {
-#line 592
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 592
                     nels *= count[j];
-#line 592
                     index[j] += start[j];
-#line 592
                 }
-#line 592
                         /* Random choice of forward or backward */
-#line 592
 /* TODO
-#line 592
                 if ( roll(2) ) {
-#line 592
                     for (j = 0; j < var_rank[i]; j++) {
-#line 592
                         index[j] += (count[j] - 1) * stride[j];
-#line 592
                         stride[j] = -stride[j];
-#line 592
                     }
-#line 592
                 }
-#line 592
 */
-#line 592
 		allInExtRange = allInIntRange = 1;
-#line 592
 		for (j = 0; j < nels; j++) {
-#line 592
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 592
 		    IF (err)
-#line 592
 			error("error in toMixedBase 1");
-#line 592
 		    for (d = 0; d < var_rank[i]; d++)
-#line 592
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 592
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 592
 			NCT_UCHAR);
-#line 592
 		    if (inRange3(expect[j],var_type[i],NCT_UCHAR)) {
-#line 592
 			allInIntRange = allInIntRange && expect[j] >= uchar_min
-#line 592
 			    && expect[j] <= uchar_max;
-#line 592
 		    } else {
-#line 592
 			allInExtRange = 0;
-#line 592
 		    }
-#line 592
 		}
-#line 592
                 if (var_rank[i] == 0 && i%2 )
-#line 592
                     err = nc_get_vars_uchar(ncid, i, NULL, NULL, NULL, value);
-#line 592
                 else
-#line 592
                     err = nc_get_vars_uchar(ncid, i, index, count, stride, value);
-#line 592
 		if (canConvert) {
-#line 592
 		    if (allInExtRange) {
-#line 592
 			if (allInIntRange) {
-#line 592
 			    IF (err)
-#line 592
 				error("%s", nc_strerror(err));
-#line 592
 			} else {
-#line 592
 			    IF (err != NC_ERANGE)
-#line 592
 				error("Range error: status = %d", err);
-#line 592
 			}
-#line 592
 		    } else {
-#line 592
 			IF (err != 0 && err != NC_ERANGE)
-#line 592
 			    error("OK or Range error: status = %d", err);
-#line 592
 		    }
-#line 592
 		    for (j = 0; j < nels; j++) {
-#line 592
 			if (inRange3(expect[j],var_type[i],NCT_UCHAR)
-#line 592
 				&& expect[j] >= uchar_min && expect[j] <= uchar_max) {
-#line 592
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_UCHAR)){
-#line 592
 				error("value read not that expected");
-#line 592
 				if (verbose) {
-#line 592
 				    error("\n");
-#line 592
 				    error("varid: %d, ", i);
-#line 592
 				    error("var_name: %s, ", var_name[i]);
-#line 592
 				    error("element number: %d ", j);
-#line 592
                                     error("expect: %g, ", expect[j]);
-#line 592
 				    error("got: %g", (double) value[j]);
-#line 592
 				}
-#line 592
 			    } else {
-#line 592
 				nok++;
-#line 592
 			    }
-#line 592
 			}
-#line 592
 		    }
-#line 592
 		} else {
-#line 592
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 592
 			error("wrong type: status = %d", err);
-#line 592
 		}
-#line 592
 	    }
-#line 592
 	}
-#line 592
 
-#line 592
     }
-#line 592
     err = nc_close(ncid);
-#line 592
     IF (err)
-#line 592
         error("nc_close: %s", nc_strerror(err));
-#line 592
     print_nok(nok);
-#line 592
 }
-#line 592
 
 void
-#line 593
 test_nc_get_vars_schar(void)
-#line 593
 {
-#line 593
     int ncid;
-#line 593
     int d;
-#line 593
     int i;
-#line 593
     int j;
-#line 593
     int k;
-#line 593
     int m;
-#line 593
     int err;
-#line 593
     int allInExtRange;	/* all values within external range? */
-#line 593
     int allInIntRange;	/* all values within internal range? */
-#line 593
     int nels;
-#line 593
     int nslabs;
-#line 593
     int nstarts;        /* number of different starts */
-#line 593
     int nok = 0;      /* count of valid comparisons */
-#line 593
     size_t start[MAX_RANK];
-#line 593
     size_t edge[MAX_RANK];
-#line 593
     size_t index[MAX_RANK];
-#line 593
     size_t index2[MAX_RANK];
-#line 593
     size_t mid[MAX_RANK];
-#line 593
     size_t count[MAX_RANK];
-#line 593
     size_t sstride[MAX_RANK];
-#line 593
     ptrdiff_t stride[MAX_RANK];
-#line 593
     int canConvert;     /* Both text or both numeric */
-#line 593
     schar value[MAX_NELS];
-#line 593
     double expect[MAX_NELS];
-#line 593
 
-#line 593
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 593
     IF (err)
-#line 593
         error("nc_open: %s", nc_strerror(err));
-#line 593
     for (i = 0; i < NVARS; i++) {
-#line 593
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 593
         assert(var_rank[i] <= MAX_RANK);
-#line 593
         assert(var_nels[i] <= MAX_NELS);
-#line 593
         for (j = 0; j < var_rank[i]; j++) {
-#line 593
             start[j] = 0;
-#line 593
             edge[j] = 1;
-#line 593
             stride[j] = 1;
-#line 593
         }
-#line 593
         err = nc_get_vars_schar(BAD_ID, i, start, edge, stride, value);
-#line 593
         IF (err != NC_EBADID)
-#line 593
             error("bad ncid: status = %d", err);
-#line 593
         err = nc_get_vars_schar(ncid, BAD_VARID, start, edge, stride, value);
-#line 593
         IF (err != NC_ENOTVAR)
-#line 593
             error("bad var id: status = %d", err);
-#line 593
         for (j = 0; j < var_rank[i]; j++) {
-#line 593
             start[j] = var_shape[i][j];
-#line 593
             err = nc_get_vars_schar(ncid, i, start, edge, stride, value);
-#line 593
 	  if(!canConvert) {
-#line 593
 		IF (err != NC_ECHAR)
-#line 593
                	    error("conversion: status = %d", err);
-#line 593
 	  } else {
-#line 593
             IF (err != NC_EINVALCOORDS)
-#line 593
                 error("bad index: status = %d", err);
-#line 593
             start[j] = 0;
-#line 593
             edge[j] = var_shape[i][j] + 1;
-#line 593
             err = nc_get_vars_schar(ncid, i, start, edge, stride, value);
-#line 593
             IF (err != NC_EEDGE)
-#line 593
                 error("bad edge: status = %d", err);
-#line 593
             edge[j] = 1;
-#line 593
             stride[j] = 0;
-#line 593
             err = nc_get_vars_schar(ncid, i, start, edge, stride, value);
-#line 593
             IF (err != NC_ESTRIDE)
-#line 593
                 error("bad stride: status = %d", err);
-#line 593
             stride[j] = 1;
-#line 593
 	  }
-#line 593
         }
-#line 593
             /* Choose a random point dividing each dim into 2 parts */
-#line 593
             /* get 2^rank (nslabs) slabs so defined */
-#line 593
         nslabs = 1;
-#line 593
         for (j = 0; j < var_rank[i]; j++) {
-#line 593
             mid[j] = roll( var_shape[i][j] );
-#line 593
             nslabs *= 2;
-#line 593
         }
-#line 593
             /* bits of k determine whether to get lower or upper part of dim */
-#line 593
             /* choose random stride from 1 to edge */
-#line 593
         for (k = 0; k < nslabs; k++) {
-#line 593
             nstarts = 1;
-#line 593
             for (j = 0; j < var_rank[i]; j++) {
-#line 593
                 if ((k >> j) & 1) {
-#line 593
                     start[j] = 0;
-#line 593
                     edge[j] = mid[j];
-#line 593
                 }else{
-#line 593
                     start[j] = mid[j];
-#line 593
                     edge[j] = var_shape[i][j] - mid[j];
-#line 593
                 }
-#line 593
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 593
                 nstarts *= stride[j];
-#line 593
             }
-#line 593
             for (m = 0; m < nstarts; m++) {
-#line 593
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 593
                 IF (err)
-#line 593
                     error("error in toMixedBase");
-#line 593
                 nels = 1;
-#line 593
                 for (j = 0; j < var_rank[i]; j++) {
-#line 593
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 593
                     nels *= count[j];
-#line 593
                     index[j] += start[j];
-#line 593
                 }
-#line 593
                         /* Random choice of forward or backward */
-#line 593
 /* TODO
-#line 593
                 if ( roll(2) ) {
-#line 593
                     for (j = 0; j < var_rank[i]; j++) {
-#line 593
                         index[j] += (count[j] - 1) * stride[j];
-#line 593
                         stride[j] = -stride[j];
-#line 593
                     }
-#line 593
                 }
-#line 593
 */
-#line 593
 		allInExtRange = allInIntRange = 1;
-#line 593
 		for (j = 0; j < nels; j++) {
-#line 593
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 593
 		    IF (err)
-#line 593
 			error("error in toMixedBase 1");
-#line 593
 		    for (d = 0; d < var_rank[i]; d++)
-#line 593
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 593
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 593
 			NCT_SCHAR);
-#line 593
 		    if (inRange3(expect[j],var_type[i],NCT_SCHAR)) {
-#line 593
 			allInIntRange = allInIntRange && expect[j] >= schar_min
-#line 593
 			    && expect[j] <= schar_max;
-#line 593
 		    } else {
-#line 593
 			allInExtRange = 0;
-#line 593
 		    }
-#line 593
 		}
-#line 593
                 if (var_rank[i] == 0 && i%2 )
-#line 593
                     err = nc_get_vars_schar(ncid, i, NULL, NULL, NULL, value);
-#line 593
                 else
-#line 593
                     err = nc_get_vars_schar(ncid, i, index, count, stride, value);
-#line 593
 		if (canConvert) {
-#line 593
 		    if (allInExtRange) {
-#line 593
 			if (allInIntRange) {
-#line 593
 			    IF (err)
-#line 593
 				error("%s", nc_strerror(err));
-#line 593
 			} else {
-#line 593
 			    IF (err != NC_ERANGE)
-#line 593
 				error("Range error: status = %d", err);
-#line 593
 			}
-#line 593
 		    } else {
-#line 593
 			IF (err != 0 && err != NC_ERANGE)
-#line 593
 			    error("OK or Range error: status = %d", err);
-#line 593
 		    }
-#line 593
 		    for (j = 0; j < nels; j++) {
-#line 593
 			if (inRange3(expect[j],var_type[i],NCT_SCHAR)
-#line 593
 				&& expect[j] >= schar_min && expect[j] <= schar_max) {
-#line 593
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_SCHAR)){
-#line 593
 				error("value read not that expected");
-#line 593
 				if (verbose) {
-#line 593
 				    error("\n");
-#line 593
 				    error("varid: %d, ", i);
-#line 593
 				    error("var_name: %s, ", var_name[i]);
-#line 593
 				    error("element number: %d ", j);
-#line 593
                                     error("expect: %g, ", expect[j]);
-#line 593
 				    error("got: %g", (double) value[j]);
-#line 593
 				}
-#line 593
 			    } else {
-#line 593
 				nok++;
-#line 593
 			    }
-#line 593
 			}
-#line 593
 		    }
-#line 593
 		} else {
-#line 593
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 593
 			error("wrong type: status = %d", err);
-#line 593
 		}
-#line 593
 	    }
-#line 593
 	}
-#line 593
 
-#line 593
     }
-#line 593
     err = nc_close(ncid);
-#line 593
     IF (err)
-#line 593
         error("nc_close: %s", nc_strerror(err));
-#line 593
     print_nok(nok);
-#line 593
 }
-#line 593
 
 void
-#line 594
 test_nc_get_vars_short(void)
-#line 594
 {
-#line 594
     int ncid;
-#line 594
     int d;
-#line 594
     int i;
-#line 594
     int j;
-#line 594
     int k;
-#line 594
     int m;
-#line 594
     int err;
-#line 594
     int allInExtRange;	/* all values within external range? */
-#line 594
     int allInIntRange;	/* all values within internal range? */
-#line 594
     int nels;
-#line 594
     int nslabs;
-#line 594
     int nstarts;        /* number of different starts */
-#line 594
     int nok = 0;      /* count of valid comparisons */
-#line 594
     size_t start[MAX_RANK];
-#line 594
     size_t edge[MAX_RANK];
-#line 594
     size_t index[MAX_RANK];
-#line 594
     size_t index2[MAX_RANK];
-#line 594
     size_t mid[MAX_RANK];
-#line 594
     size_t count[MAX_RANK];
-#line 594
     size_t sstride[MAX_RANK];
-#line 594
     ptrdiff_t stride[MAX_RANK];
-#line 594
     int canConvert;     /* Both text or both numeric */
-#line 594
     short value[MAX_NELS];
-#line 594
     double expect[MAX_NELS];
-#line 594
 
-#line 594
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 594
     IF (err)
-#line 594
         error("nc_open: %s", nc_strerror(err));
-#line 594
     for (i = 0; i < NVARS; i++) {
-#line 594
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 594
         assert(var_rank[i] <= MAX_RANK);
-#line 594
         assert(var_nels[i] <= MAX_NELS);
-#line 594
         for (j = 0; j < var_rank[i]; j++) {
-#line 594
             start[j] = 0;
-#line 594
             edge[j] = 1;
-#line 594
             stride[j] = 1;
-#line 594
         }
-#line 594
         err = nc_get_vars_short(BAD_ID, i, start, edge, stride, value);
-#line 594
         IF (err != NC_EBADID)
-#line 594
             error("bad ncid: status = %d", err);
-#line 594
         err = nc_get_vars_short(ncid, BAD_VARID, start, edge, stride, value);
-#line 594
         IF (err != NC_ENOTVAR)
-#line 594
             error("bad var id: status = %d", err);
-#line 594
         for (j = 0; j < var_rank[i]; j++) {
-#line 594
             start[j] = var_shape[i][j];
-#line 594
             err = nc_get_vars_short(ncid, i, start, edge, stride, value);
-#line 594
 	  if(!canConvert) {
-#line 594
 		IF (err != NC_ECHAR)
-#line 594
                	    error("conversion: status = %d", err);
-#line 594
 	  } else {
-#line 594
             IF (err != NC_EINVALCOORDS)
-#line 594
                 error("bad index: status = %d", err);
-#line 594
             start[j] = 0;
-#line 594
             edge[j] = var_shape[i][j] + 1;
-#line 594
             err = nc_get_vars_short(ncid, i, start, edge, stride, value);
-#line 594
             IF (err != NC_EEDGE)
-#line 594
                 error("bad edge: status = %d", err);
-#line 594
             edge[j] = 1;
-#line 594
             stride[j] = 0;
-#line 594
             err = nc_get_vars_short(ncid, i, start, edge, stride, value);
-#line 594
             IF (err != NC_ESTRIDE)
-#line 594
                 error("bad stride: status = %d", err);
-#line 594
             stride[j] = 1;
-#line 594
 	  }
-#line 594
         }
-#line 594
             /* Choose a random point dividing each dim into 2 parts */
-#line 594
             /* get 2^rank (nslabs) slabs so defined */
-#line 594
         nslabs = 1;
-#line 594
         for (j = 0; j < var_rank[i]; j++) {
-#line 594
             mid[j] = roll( var_shape[i][j] );
-#line 594
             nslabs *= 2;
-#line 594
         }
-#line 594
             /* bits of k determine whether to get lower or upper part of dim */
-#line 594
             /* choose random stride from 1 to edge */
-#line 594
         for (k = 0; k < nslabs; k++) {
-#line 594
             nstarts = 1;
-#line 594
             for (j = 0; j < var_rank[i]; j++) {
-#line 594
                 if ((k >> j) & 1) {
-#line 594
                     start[j] = 0;
-#line 594
                     edge[j] = mid[j];
-#line 594
                 }else{
-#line 594
                     start[j] = mid[j];
-#line 594
                     edge[j] = var_shape[i][j] - mid[j];
-#line 594
                 }
-#line 594
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 594
                 nstarts *= stride[j];
-#line 594
             }
-#line 594
             for (m = 0; m < nstarts; m++) {
-#line 594
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 594
                 IF (err)
-#line 594
                     error("error in toMixedBase");
-#line 594
                 nels = 1;
-#line 594
                 for (j = 0; j < var_rank[i]; j++) {
-#line 594
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 594
                     nels *= count[j];
-#line 594
                     index[j] += start[j];
-#line 594
                 }
-#line 594
                         /* Random choice of forward or backward */
-#line 594
 /* TODO
-#line 594
                 if ( roll(2) ) {
-#line 594
                     for (j = 0; j < var_rank[i]; j++) {
-#line 594
                         index[j] += (count[j] - 1) * stride[j];
-#line 594
                         stride[j] = -stride[j];
-#line 594
                     }
-#line 594
                 }
-#line 594
 */
-#line 594
 		allInExtRange = allInIntRange = 1;
-#line 594
 		for (j = 0; j < nels; j++) {
-#line 594
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 594
 		    IF (err)
-#line 594
 			error("error in toMixedBase 1");
-#line 594
 		    for (d = 0; d < var_rank[i]; d++)
-#line 594
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 594
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 594
 			NCT_SHORT);
-#line 594
 		    if (inRange3(expect[j],var_type[i],NCT_SHORT)) {
-#line 594
 			allInIntRange = allInIntRange && expect[j] >= short_min
-#line 594
 			    && expect[j] <= short_max;
-#line 594
 		    } else {
-#line 594
 			allInExtRange = 0;
-#line 594
 		    }
-#line 594
 		}
-#line 594
                 if (var_rank[i] == 0 && i%2 )
-#line 594
                     err = nc_get_vars_short(ncid, i, NULL, NULL, NULL, value);
-#line 594
                 else
-#line 594
                     err = nc_get_vars_short(ncid, i, index, count, stride, value);
-#line 594
 		if (canConvert) {
-#line 594
 		    if (allInExtRange) {
-#line 594
 			if (allInIntRange) {
-#line 594
 			    IF (err)
-#line 594
 				error("%s", nc_strerror(err));
-#line 594
 			} else {
-#line 594
 			    IF (err != NC_ERANGE)
-#line 594
 				error("Range error: status = %d", err);
-#line 594
 			}
-#line 594
 		    } else {
-#line 594
 			IF (err != 0 && err != NC_ERANGE)
-#line 594
 			    error("OK or Range error: status = %d", err);
-#line 594
 		    }
-#line 594
 		    for (j = 0; j < nels; j++) {
-#line 594
 			if (inRange3(expect[j],var_type[i],NCT_SHORT)
-#line 594
 				&& expect[j] >= short_min && expect[j] <= short_max) {
-#line 594
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_SHORT)){
-#line 594
 				error("value read not that expected");
-#line 594
 				if (verbose) {
-#line 594
 				    error("\n");
-#line 594
 				    error("varid: %d, ", i);
-#line 594
 				    error("var_name: %s, ", var_name[i]);
-#line 594
 				    error("element number: %d ", j);
-#line 594
                                     error("expect: %g, ", expect[j]);
-#line 594
 				    error("got: %g", (double) value[j]);
-#line 594
 				}
-#line 594
 			    } else {
-#line 594
 				nok++;
-#line 594
 			    }
-#line 594
 			}
-#line 594
 		    }
-#line 594
 		} else {
-#line 594
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 594
 			error("wrong type: status = %d", err);
-#line 594
 		}
-#line 594
 	    }
-#line 594
 	}
-#line 594
 
-#line 594
     }
-#line 594
     err = nc_close(ncid);
-#line 594
     IF (err)
-#line 594
         error("nc_close: %s", nc_strerror(err));
-#line 594
     print_nok(nok);
-#line 594
 }
-#line 594
 
 void
-#line 595
 test_nc_get_vars_int(void)
-#line 595
 {
-#line 595
     int ncid;
-#line 595
     int d;
-#line 595
     int i;
-#line 595
     int j;
-#line 595
     int k;
-#line 595
     int m;
-#line 595
     int err;
-#line 595
     int allInExtRange;	/* all values within external range? */
-#line 595
     int allInIntRange;	/* all values within internal range? */
-#line 595
     int nels;
-#line 595
     int nslabs;
-#line 595
     int nstarts;        /* number of different starts */
-#line 595
     int nok = 0;      /* count of valid comparisons */
-#line 595
     size_t start[MAX_RANK];
-#line 595
     size_t edge[MAX_RANK];
-#line 595
     size_t index[MAX_RANK];
-#line 595
     size_t index2[MAX_RANK];
-#line 595
     size_t mid[MAX_RANK];
-#line 595
     size_t count[MAX_RANK];
-#line 595
     size_t sstride[MAX_RANK];
-#line 595
     ptrdiff_t stride[MAX_RANK];
-#line 595
     int canConvert;     /* Both text or both numeric */
-#line 595
     int value[MAX_NELS];
-#line 595
     double expect[MAX_NELS];
-#line 595
 
-#line 595
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 595
     IF (err)
-#line 595
         error("nc_open: %s", nc_strerror(err));
-#line 595
     for (i = 0; i < NVARS; i++) {
-#line 595
         canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 595
         assert(var_rank[i] <= MAX_RANK);
-#line 595
         assert(var_nels[i] <= MAX_NELS);
-#line 595
         for (j = 0; j < var_rank[i]; j++) {
-#line 595
             start[j] = 0;
-#line 595
             edge[j] = 1;
-#line 595
             stride[j] = 1;
-#line 595
         }
-#line 595
         err = nc_get_vars_int(BAD_ID, i, start, edge, stride, value);
-#line 595
         IF (err != NC_EBADID)
-#line 595
             error("bad ncid: status = %d", err);
-#line 595
         err = nc_get_vars_int(ncid, BAD_VARID, start, edge, stride, value);
-#line 595
         IF (err != NC_ENOTVAR)
-#line 595
             error("bad var id: status = %d", err);
-#line 595
         for (j = 0; j < var_rank[i]; j++) {
-#line 595
             start[j] = var_shape[i][j];
-#line 595
             err = nc_get_vars_int(ncid, i, start, edge, stride, value);
-#line 595
 	  if(!canConvert) {
-#line 595
 		IF (err != NC_ECHAR)
-#line 595
                	    error("conversion: status = %d", err);
-#line 595
 	  } else {
-#line 595
             IF (err != NC_EINVALCOORDS)
-#line 595
                 error("bad index: status = %d", err);
-#line 595
             start[j] = 0;
-#line 595
             edge[j] = var_shape[i][j] + 1;
-#line 595
             err = nc_get_vars_int(ncid, i, start, edge, stride, value);
-#line 595
             IF (err != NC_EEDGE)
-#line 595
                 error("bad edge: status = %d", err);
-#line 595
             edge[j] = 1;
-#line 595
             stride[j] = 0;
-#line 595
             err = nc_get_vars_int(ncid, i, start, edge, stride, value);
-#line 595
             IF (err != NC_ESTRIDE)
-#line 595
                 error("bad stride: status = %d", err);
-#line 595
             stride[j] = 1;
-#line 595
 	  }
-#line 595
         }
-#line 595
             /* Choose a random point dividing each dim into 2 parts */
-#line 595
             /* get 2^rank (nslabs) slabs so defined */
-#line 595
         nslabs = 1;
-#line 595
         for (j = 0; j < var_rank[i]; j++) {
-#line 595
             mid[j] = roll( var_shape[i][j] );
-#line 595
             nslabs *= 2;
-#line 595
         }
-#line 595
             /* bits of k determine whether to get lower or upper part of dim */
-#line 595
             /* choose random stride from 1 to edge */
-#line 595
         for (k = 0; k < nslabs; k++) {
-#line 595
             nstarts = 1;
-#line 595
             for (j = 0; j < var_rank[i]; j++) {
-#line 595
                 if ((k >> j) & 1) {
-#line 595
                     start[j] = 0;
-#line 595
                     edge[j] = mid[j];
-#line 595
                 }else{
-#line 595
                     start[j] = mid[j];
-#line 595
                     edge[j] = var_shape[i][j] - mid[j];
-#line 595
                 }
-#line 595
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 595
                 nstarts *= stride[j];
-#line 595
             }
-#line 595
             for (m = 0; m < nstarts; m++) {
-#line 595
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 595
                 IF (err)
-#line 595
                     error("error in toMixedBase");
-#line 595
                 nels = 1;
-#line 595
                 for (j = 0; j < var_rank[i]; j++) {
-#line 595
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 595
                     nels *= count[j];
-#line 595
                     index[j] += start[j];
-#line 595
                 }
-#line 595
                         /* Random choice of forward or backward */
-#line 595
 /* TODO
-#line 595
                 if ( roll(2) ) {
-#line 595
                     for (j = 0; j < var_rank[i]; j++) {
-#line 595
                         index[j] += (count[j] - 1) * stride[j];
-#line 595
                         stride[j] = -stride[j];
-#line 595
                     }
-#line 595
                 }
-#line 595
 */
-#line 595
 		allInExtRange = allInIntRange = 1;
-#line 595
 		for (j = 0; j < nels; j++) {
-#line 595
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 595
 		    IF (err)
-#line 595
 			error("error in toMixedBase 1");
-#line 595
 		    for (d = 0; d < var_rank[i]; d++)
-#line 595
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 595
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 595
 			NCT_INT);
-#line 595
 		    if (inRange3(expect[j],var_type[i],NCT_INT)) {
-#line 595
 			allInIntRange = allInIntRange && expect[j] >= int_min
-#line 595
 			    && expect[j] <= int_max;
-#line 595
 		    } else {
-#line 595
 			allInExtRange = 0;
-#line 595
 		    }
-#line 595
 		}
-#line 595
                 if (var_rank[i] == 0 && i%2 )
-#line 595
                     err = nc_get_vars_int(ncid, i, NULL, NULL, NULL, value);
-#line 595
                 else
-#line 595
                     err = nc_get_vars_int(ncid, i, index, count, stride, value);
-#line 595
 		if (canConvert) {
-#line 595
 		    if (allInExtRange) {
-#line 595
 			if (allInIntRange) {
-#line 595
 			    IF (err)
-#line 595
 				error("%s", nc_strerror(err));
-#line 595
 			} else {
-#line 595
 			    IF (err != NC_ERANGE)
-#line 595
 				error("Range error: status = %d", err);
-#line 595
 			}
-#line 595
 		    } else {
-#line 595
 			IF (err != 0 && err != NC_ERANGE)
-#line 595
 			    error("OK or Range error: status = %d", err);
-#line 595
 		    }
-#line 595
 		    for (j = 0; j < nels; j++) {
-#line 595
 			if (inRange3(expect[j],var_type[i],NCT_INT)
-#line 595
 				&& expect[j] >= int_min && expect[j] <= int_max) {
-#line 595
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_INT)){
-#line 595
 				error("value read not that expected");
-#line 595
 				if (verbose) {
-#line 595
 				    error("\n");
-#line 595
 				    error("varid: %d, ", i);
-#line 595
 				    error("var_name: %s, ", var_name[i]);
-#line 595
 				    error("element number: %d ", j);
-#line 595
                                     error("expect: %g, ", expect[j]);
-#line 595
 				    error("got: %g", (double) value[j]);
-#line 595
 				}
-#line 595
 			    } else {
-#line 595
 				nok++;
-#line 595
 			    }
-#line 595
 			}
-#line 595
 		    }
-#line 595
 		} else {
-#line 595
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 595
 			error("wrong type: status = %d", err);
-#line 595
 		}
-#line 595
 	    }
-#line 595
 	}
-#line 595
 
-#line 595
     }
-#line 595
     err = nc_close(ncid);
-#line 595
     IF (err)
-#line 595
         error("nc_close: %s", nc_strerror(err));
-#line 595
     print_nok(nok);
-#line 595
 }
-#line 595
 
 void
-#line 596
 test_nc_get_vars_long(void)
-#line 596
 {
-#line 596
     int ncid;
-#line 596
     int d;
-#line 596
     int i;
-#line 596
     int j;
-#line 596
     int k;
-#line 596
     int m;
-#line 596
     int err;
-#line 596
     int allInExtRange;	/* all values within external range? */
-#line 596
     int allInIntRange;	/* all values within internal range? */
-#line 596
     int nels;
-#line 596
     int nslabs;
-#line 596
     int nstarts;        /* number of different starts */
-#line 596
     int nok = 0;      /* count of valid comparisons */
-#line 596
     size_t start[MAX_RANK];
-#line 596
     size_t edge[MAX_RANK];
-#line 596
     size_t index[MAX_RANK];
-#line 596
     size_t index2[MAX_RANK];
-#line 596
     size_t mid[MAX_RANK];
-#line 596
     size_t count[MAX_RANK];
-#line 596
     size_t sstride[MAX_RANK];
-#line 596
     ptrdiff_t stride[MAX_RANK];
-#line 596
     int canConvert;     /* Both text or both numeric */
-#line 596
     long value[MAX_NELS];
-#line 596
     double expect[MAX_NELS];
-#line 596
 
-#line 596
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 596
     IF (err)
-#line 596
         error("nc_open: %s", nc_strerror(err));
-#line 596
     for (i = 0; i < NVARS; i++) {
-#line 596
         canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 596
         assert(var_rank[i] <= MAX_RANK);
-#line 596
         assert(var_nels[i] <= MAX_NELS);
-#line 596
         for (j = 0; j < var_rank[i]; j++) {
-#line 596
             start[j] = 0;
-#line 596
             edge[j] = 1;
-#line 596
             stride[j] = 1;
-#line 596
         }
-#line 596
         err = nc_get_vars_long(BAD_ID, i, start, edge, stride, value);
-#line 596
         IF (err != NC_EBADID)
-#line 596
             error("bad ncid: status = %d", err);
-#line 596
         err = nc_get_vars_long(ncid, BAD_VARID, start, edge, stride, value);
-#line 596
         IF (err != NC_ENOTVAR)
-#line 596
             error("bad var id: status = %d", err);
-#line 596
         for (j = 0; j < var_rank[i]; j++) {
-#line 596
             start[j] = var_shape[i][j];
-#line 596
             err = nc_get_vars_long(ncid, i, start, edge, stride, value);
-#line 596
 	  if(!canConvert) {
-#line 596
 		IF (err != NC_ECHAR)
-#line 596
                	    error("conversion: status = %d", err);
-#line 596
 	  } else {
-#line 596
             IF (err != NC_EINVALCOORDS)
-#line 596
                 error("bad index: status = %d", err);
-#line 596
             start[j] = 0;
-#line 596
             edge[j] = var_shape[i][j] + 1;
-#line 596
             err = nc_get_vars_long(ncid, i, start, edge, stride, value);
-#line 596
             IF (err != NC_EEDGE)
-#line 596
                 error("bad edge: status = %d", err);
-#line 596
             edge[j] = 1;
-#line 596
             stride[j] = 0;
-#line 596
             err = nc_get_vars_long(ncid, i, start, edge, stride, value);
-#line 596
             IF (err != NC_ESTRIDE)
-#line 596
                 error("bad stride: status = %d", err);
-#line 596
             stride[j] = 1;
-#line 596
 	  }
-#line 596
         }
-#line 596
             /* Choose a random point dividing each dim into 2 parts */
-#line 596
             /* get 2^rank (nslabs) slabs so defined */
-#line 596
         nslabs = 1;
-#line 596
         for (j = 0; j < var_rank[i]; j++) {
-#line 596
             mid[j] = roll( var_shape[i][j] );
-#line 596
             nslabs *= 2;
-#line 596
         }
-#line 596
             /* bits of k determine whether to get lower or upper part of dim */
-#line 596
             /* choose random stride from 1 to edge */
-#line 596
         for (k = 0; k < nslabs; k++) {
-#line 596
             nstarts = 1;
-#line 596
             for (j = 0; j < var_rank[i]; j++) {
-#line 596
                 if ((k >> j) & 1) {
-#line 596
                     start[j] = 0;
-#line 596
                     edge[j] = mid[j];
-#line 596
                 }else{
-#line 596
                     start[j] = mid[j];
-#line 596
                     edge[j] = var_shape[i][j] - mid[j];
-#line 596
                 }
-#line 596
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 596
                 nstarts *= stride[j];
-#line 596
             }
-#line 596
             for (m = 0; m < nstarts; m++) {
-#line 596
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 596
                 IF (err)
-#line 596
                     error("error in toMixedBase");
-#line 596
                 nels = 1;
-#line 596
                 for (j = 0; j < var_rank[i]; j++) {
-#line 596
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 596
                     nels *= count[j];
-#line 596
                     index[j] += start[j];
-#line 596
                 }
-#line 596
                         /* Random choice of forward or backward */
-#line 596
 /* TODO
-#line 596
                 if ( roll(2) ) {
-#line 596
                     for (j = 0; j < var_rank[i]; j++) {
-#line 596
                         index[j] += (count[j] - 1) * stride[j];
-#line 596
                         stride[j] = -stride[j];
-#line 596
                     }
-#line 596
                 }
-#line 596
 */
-#line 596
 		allInExtRange = allInIntRange = 1;
-#line 596
 		for (j = 0; j < nels; j++) {
-#line 596
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 596
 		    IF (err)
-#line 596
 			error("error in toMixedBase 1");
-#line 596
 		    for (d = 0; d < var_rank[i]; d++)
-#line 596
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 596
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 596
 			NCT_LONG);
-#line 596
 		    if (inRange3(expect[j],var_type[i],NCT_LONG)) {
-#line 596
 			allInIntRange = allInIntRange && expect[j] >= long_min
-#line 596
 			    && expect[j] <= long_max;
-#line 596
 		    } else {
-#line 596
 			allInExtRange = 0;
-#line 596
 		    }
-#line 596
 		}
-#line 596
                 if (var_rank[i] == 0 && i%2 )
-#line 596
                     err = nc_get_vars_long(ncid, i, NULL, NULL, NULL, value);
-#line 596
                 else
-#line 596
                     err = nc_get_vars_long(ncid, i, index, count, stride, value);
-#line 596
 		if (canConvert) {
-#line 596
 		    if (allInExtRange) {
-#line 596
 			if (allInIntRange) {
-#line 596
 			    IF (err)
-#line 596
 				error("%s", nc_strerror(err));
-#line 596
 			} else {
-#line 596
 			    IF (err != NC_ERANGE)
-#line 596
 				error("Range error: status = %d", err);
-#line 596
 			}
-#line 596
 		    } else {
-#line 596
 			IF (err != 0 && err != NC_ERANGE)
-#line 596
 			    error("OK or Range error: status = %d", err);
-#line 596
 		    }
-#line 596
 		    for (j = 0; j < nels; j++) {
-#line 596
 			if (inRange3(expect[j],var_type[i],NCT_LONG)
-#line 596
 				&& expect[j] >= long_min && expect[j] <= long_max) {
-#line 596
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_LONG)){
-#line 596
 				error("value read not that expected");
-#line 596
 				if (verbose) {
-#line 596
 				    error("\n");
-#line 596
 				    error("varid: %d, ", i);
-#line 596
 				    error("var_name: %s, ", var_name[i]);
-#line 596
 				    error("element number: %d ", j);
-#line 596
                                     error("expect: %g, ", expect[j]);
-#line 596
 				    error("got: %g", (double) value[j]);
-#line 596
 				}
-#line 596
 			    } else {
-#line 596
 				nok++;
-#line 596
 			    }
-#line 596
 			}
-#line 596
 		    }
-#line 596
 		} else {
-#line 596
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 596
 			error("wrong type: status = %d", err);
-#line 596
 		}
-#line 596
 	    }
-#line 596
 	}
-#line 596
 
-#line 596
     }
-#line 596
     err = nc_close(ncid);
-#line 596
     IF (err)
-#line 596
         error("nc_close: %s", nc_strerror(err));
-#line 596
     print_nok(nok);
-#line 596
 }
-#line 596
 
 void
-#line 597
 test_nc_get_vars_float(void)
-#line 597
 {
-#line 597
     int ncid;
-#line 597
     int d;
-#line 597
     int i;
-#line 597
     int j;
-#line 597
     int k;
-#line 597
     int m;
-#line 597
     int err;
-#line 597
     int allInExtRange;	/* all values within external range? */
-#line 597
     int allInIntRange;	/* all values within internal range? */
-#line 597
     int nels;
-#line 597
     int nslabs;
-#line 597
     int nstarts;        /* number of different starts */
-#line 597
     int nok = 0;      /* count of valid comparisons */
-#line 597
     size_t start[MAX_RANK];
-#line 597
     size_t edge[MAX_RANK];
-#line 597
     size_t index[MAX_RANK];
-#line 597
     size_t index2[MAX_RANK];
-#line 597
     size_t mid[MAX_RANK];
-#line 597
     size_t count[MAX_RANK];
-#line 597
     size_t sstride[MAX_RANK];
-#line 597
     ptrdiff_t stride[MAX_RANK];
-#line 597
     int canConvert;     /* Both text or both numeric */
-#line 597
     float value[MAX_NELS];
-#line 597
     double expect[MAX_NELS];
-#line 597
 
-#line 597
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 597
     IF (err)
-#line 597
         error("nc_open: %s", nc_strerror(err));
-#line 597
     for (i = 0; i < NVARS; i++) {
-#line 597
         canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 597
         assert(var_rank[i] <= MAX_RANK);
-#line 597
         assert(var_nels[i] <= MAX_NELS);
-#line 597
         for (j = 0; j < var_rank[i]; j++) {
-#line 597
             start[j] = 0;
-#line 597
             edge[j] = 1;
-#line 597
             stride[j] = 1;
-#line 597
         }
-#line 597
         err = nc_get_vars_float(BAD_ID, i, start, edge, stride, value);
-#line 597
         IF (err != NC_EBADID)
-#line 597
             error("bad ncid: status = %d", err);
-#line 597
         err = nc_get_vars_float(ncid, BAD_VARID, start, edge, stride, value);
-#line 597
         IF (err != NC_ENOTVAR)
-#line 597
             error("bad var id: status = %d", err);
-#line 597
         for (j = 0; j < var_rank[i]; j++) {
-#line 597
             start[j] = var_shape[i][j];
-#line 597
             err = nc_get_vars_float(ncid, i, start, edge, stride, value);
-#line 597
 	  if(!canConvert) {
-#line 597
 		IF (err != NC_ECHAR)
-#line 597
                	    error("conversion: status = %d", err);
-#line 597
 	  } else {
-#line 597
             IF (err != NC_EINVALCOORDS)
-#line 597
                 error("bad index: status = %d", err);
-#line 597
             start[j] = 0;
-#line 597
             edge[j] = var_shape[i][j] + 1;
-#line 597
             err = nc_get_vars_float(ncid, i, start, edge, stride, value);
-#line 597
             IF (err != NC_EEDGE)
-#line 597
                 error("bad edge: status = %d", err);
-#line 597
             edge[j] = 1;
-#line 597
             stride[j] = 0;
-#line 597
             err = nc_get_vars_float(ncid, i, start, edge, stride, value);
-#line 597
             IF (err != NC_ESTRIDE)
-#line 597
                 error("bad stride: status = %d", err);
-#line 597
             stride[j] = 1;
-#line 597
 	  }
-#line 597
         }
-#line 597
             /* Choose a random point dividing each dim into 2 parts */
-#line 597
             /* get 2^rank (nslabs) slabs so defined */
-#line 597
         nslabs = 1;
-#line 597
         for (j = 0; j < var_rank[i]; j++) {
-#line 597
             mid[j] = roll( var_shape[i][j] );
-#line 597
             nslabs *= 2;
-#line 597
         }
-#line 597
             /* bits of k determine whether to get lower or upper part of dim */
-#line 597
             /* choose random stride from 1 to edge */
-#line 597
         for (k = 0; k < nslabs; k++) {
-#line 597
             nstarts = 1;
-#line 597
             for (j = 0; j < var_rank[i]; j++) {
-#line 597
                 if ((k >> j) & 1) {
-#line 597
                     start[j] = 0;
-#line 597
                     edge[j] = mid[j];
-#line 597
                 }else{
-#line 597
                     start[j] = mid[j];
-#line 597
                     edge[j] = var_shape[i][j] - mid[j];
-#line 597
                 }
-#line 597
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 597
                 nstarts *= stride[j];
-#line 597
             }
-#line 597
             for (m = 0; m < nstarts; m++) {
-#line 597
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 597
                 IF (err)
-#line 597
                     error("error in toMixedBase");
-#line 597
                 nels = 1;
-#line 597
                 for (j = 0; j < var_rank[i]; j++) {
-#line 597
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 597
                     nels *= count[j];
-#line 597
                     index[j] += start[j];
-#line 597
                 }
-#line 597
                         /* Random choice of forward or backward */
-#line 597
 /* TODO
-#line 597
                 if ( roll(2) ) {
-#line 597
                     for (j = 0; j < var_rank[i]; j++) {
-#line 597
                         index[j] += (count[j] - 1) * stride[j];
-#line 597
                         stride[j] = -stride[j];
-#line 597
                     }
-#line 597
                 }
-#line 597
 */
-#line 597
 		allInExtRange = allInIntRange = 1;
-#line 597
 		for (j = 0; j < nels; j++) {
-#line 597
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 597
 		    IF (err)
-#line 597
 			error("error in toMixedBase 1");
-#line 597
 		    for (d = 0; d < var_rank[i]; d++)
-#line 597
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 597
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 597
 			NCT_FLOAT);
-#line 597
 		    if (inRange3(expect[j],var_type[i],NCT_FLOAT)) {
-#line 597
 			allInIntRange = allInIntRange && expect[j] >= float_min
-#line 597
 			    && expect[j] <= float_max;
-#line 597
 		    } else {
-#line 597
 			allInExtRange = 0;
-#line 597
 		    }
-#line 597
 		}
-#line 597
                 if (var_rank[i] == 0 && i%2 )
-#line 597
                     err = nc_get_vars_float(ncid, i, NULL, NULL, NULL, value);
-#line 597
                 else
-#line 597
                     err = nc_get_vars_float(ncid, i, index, count, stride, value);
-#line 597
 		if (canConvert) {
-#line 597
 		    if (allInExtRange) {
-#line 597
 			if (allInIntRange) {
-#line 597
 			    IF (err)
-#line 597
 				error("%s", nc_strerror(err));
-#line 597
 			} else {
-#line 597
 			    IF (err != NC_ERANGE)
-#line 597
 				error("Range error: status = %d", err);
-#line 597
 			}
-#line 597
 		    } else {
-#line 597
 			IF (err != 0 && err != NC_ERANGE)
-#line 597
 			    error("OK or Range error: status = %d", err);
-#line 597
 		    }
-#line 597
 		    for (j = 0; j < nels; j++) {
-#line 597
 			if (inRange3(expect[j],var_type[i],NCT_FLOAT)
-#line 597
 				&& expect[j] >= float_min && expect[j] <= float_max) {
-#line 597
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_FLOAT)){
-#line 597
 				error("value read not that expected");
-#line 597
 				if (verbose) {
-#line 597
 				    error("\n");
-#line 597
 				    error("varid: %d, ", i);
-#line 597
 				    error("var_name: %s, ", var_name[i]);
-#line 597
 				    error("element number: %d ", j);
-#line 597
                                     error("expect: %g, ", expect[j]);
-#line 597
 				    error("got: %g", (double) value[j]);
-#line 597
 				}
-#line 597
 			    } else {
-#line 597
 				nok++;
-#line 597
 			    }
-#line 597
 			}
-#line 597
 		    }
-#line 597
 		} else {
-#line 597
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 597
 			error("wrong type: status = %d", err);
-#line 597
 		}
-#line 597
 	    }
-#line 597
 	}
-#line 597
 
-#line 597
     }
-#line 597
     err = nc_close(ncid);
-#line 597
     IF (err)
-#line 597
         error("nc_close: %s", nc_strerror(err));
-#line 597
     print_nok(nok);
-#line 597
 }
-#line 597
 
 void
-#line 598
 test_nc_get_vars_double(void)
-#line 598
 {
-#line 598
     int ncid;
-#line 598
     int d;
-#line 598
     int i;
-#line 598
     int j;
-#line 598
     int k;
-#line 598
     int m;
-#line 598
     int err;
-#line 598
     int allInExtRange;	/* all values within external range? */
-#line 598
     int allInIntRange;	/* all values within internal range? */
-#line 598
     int nels;
-#line 598
     int nslabs;
-#line 598
     int nstarts;        /* number of different starts */
-#line 598
     int nok = 0;      /* count of valid comparisons */
-#line 598
     size_t start[MAX_RANK];
-#line 598
     size_t edge[MAX_RANK];
-#line 598
     size_t index[MAX_RANK];
-#line 598
     size_t index2[MAX_RANK];
-#line 598
     size_t mid[MAX_RANK];
-#line 598
     size_t count[MAX_RANK];
-#line 598
     size_t sstride[MAX_RANK];
-#line 598
     ptrdiff_t stride[MAX_RANK];
-#line 598
     int canConvert;     /* Both text or both numeric */
-#line 598
     double value[MAX_NELS];
-#line 598
     double expect[MAX_NELS];
-#line 598
 
-#line 598
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 598
     IF (err)
-#line 598
         error("nc_open: %s", nc_strerror(err));
-#line 598
     for (i = 0; i < NVARS; i++) {
-#line 598
         canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 598
         assert(var_rank[i] <= MAX_RANK);
-#line 598
         assert(var_nels[i] <= MAX_NELS);
-#line 598
         for (j = 0; j < var_rank[i]; j++) {
-#line 598
             start[j] = 0;
-#line 598
             edge[j] = 1;
-#line 598
             stride[j] = 1;
-#line 598
         }
-#line 598
         err = nc_get_vars_double(BAD_ID, i, start, edge, stride, value);
-#line 598
         IF (err != NC_EBADID)
-#line 598
             error("bad ncid: status = %d", err);
-#line 598
         err = nc_get_vars_double(ncid, BAD_VARID, start, edge, stride, value);
-#line 598
         IF (err != NC_ENOTVAR)
-#line 598
             error("bad var id: status = %d", err);
-#line 598
         for (j = 0; j < var_rank[i]; j++) {
-#line 598
             start[j] = var_shape[i][j];
-#line 598
             err = nc_get_vars_double(ncid, i, start, edge, stride, value);
-#line 598
 	  if(!canConvert) {
-#line 598
 		IF (err != NC_ECHAR)
-#line 598
                	    error("conversion: status = %d", err);
-#line 598
 	  } else {
-#line 598
             IF (err != NC_EINVALCOORDS)
-#line 598
                 error("bad index: status = %d", err);
-#line 598
             start[j] = 0;
-#line 598
             edge[j] = var_shape[i][j] + 1;
-#line 598
             err = nc_get_vars_double(ncid, i, start, edge, stride, value);
-#line 598
             IF (err != NC_EEDGE)
-#line 598
                 error("bad edge: status = %d", err);
-#line 598
             edge[j] = 1;
-#line 598
             stride[j] = 0;
-#line 598
             err = nc_get_vars_double(ncid, i, start, edge, stride, value);
-#line 598
             IF (err != NC_ESTRIDE)
-#line 598
                 error("bad stride: status = %d", err);
-#line 598
             stride[j] = 1;
-#line 598
 	  }
-#line 598
         }
-#line 598
             /* Choose a random point dividing each dim into 2 parts */
-#line 598
             /* get 2^rank (nslabs) slabs so defined */
-#line 598
         nslabs = 1;
-#line 598
         for (j = 0; j < var_rank[i]; j++) {
-#line 598
             mid[j] = roll( var_shape[i][j] );
-#line 598
             nslabs *= 2;
-#line 598
         }
-#line 598
             /* bits of k determine whether to get lower or upper part of dim */
-#line 598
             /* choose random stride from 1 to edge */
-#line 598
         for (k = 0; k < nslabs; k++) {
-#line 598
             nstarts = 1;
-#line 598
             for (j = 0; j < var_rank[i]; j++) {
-#line 598
                 if ((k >> j) & 1) {
-#line 598
                     start[j] = 0;
-#line 598
                     edge[j] = mid[j];
-#line 598
                 }else{
-#line 598
                     start[j] = mid[j];
-#line 598
                     edge[j] = var_shape[i][j] - mid[j];
-#line 598
                 }
-#line 598
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 598
                 nstarts *= stride[j];
-#line 598
             }
-#line 598
             for (m = 0; m < nstarts; m++) {
-#line 598
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 598
                 IF (err)
-#line 598
                     error("error in toMixedBase");
-#line 598
                 nels = 1;
-#line 598
                 for (j = 0; j < var_rank[i]; j++) {
-#line 598
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 598
                     nels *= count[j];
-#line 598
                     index[j] += start[j];
-#line 598
                 }
-#line 598
                         /* Random choice of forward or backward */
-#line 598
 /* TODO
-#line 598
                 if ( roll(2) ) {
-#line 598
                     for (j = 0; j < var_rank[i]; j++) {
-#line 598
                         index[j] += (count[j] - 1) * stride[j];
-#line 598
                         stride[j] = -stride[j];
-#line 598
                     }
-#line 598
                 }
-#line 598
 */
-#line 598
 		allInExtRange = allInIntRange = 1;
-#line 598
 		for (j = 0; j < nels; j++) {
-#line 598
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 598
 		    IF (err)
-#line 598
 			error("error in toMixedBase 1");
-#line 598
 		    for (d = 0; d < var_rank[i]; d++)
-#line 598
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 598
 		    expect[j] = hash4(var_type[i], var_rank[i], index2, 
-#line 598
 			NCT_DOUBLE);
-#line 598
 		    if (inRange3(expect[j],var_type[i],NCT_DOUBLE)) {
-#line 598
 			allInIntRange = allInIntRange && expect[j] >= double_min
-#line 598
 			    && expect[j] <= double_max;
-#line 598
 		    } else {
-#line 598
 			allInExtRange = 0;
-#line 598
 		    }
-#line 598
 		}
-#line 598
                 if (var_rank[i] == 0 && i%2 )
-#line 598
                     err = nc_get_vars_double(ncid, i, NULL, NULL, NULL, value);
-#line 598
                 else
-#line 598
                     err = nc_get_vars_double(ncid, i, index, count, stride, value);
-#line 598
 		if (canConvert) {
-#line 598
 		    if (allInExtRange) {
-#line 598
 			if (allInIntRange) {
-#line 598
 			    IF (err)
-#line 598
 				error("%s", nc_strerror(err));
-#line 598
 			} else {
-#line 598
 			    IF (err != NC_ERANGE)
-#line 598
 				error("Range error: status = %d", err);
-#line 598
 			}
-#line 598
 		    } else {
-#line 598
 			IF (err != 0 && err != NC_ERANGE)
-#line 598
 			    error("OK or Range error: status = %d", err);
-#line 598
 		    }
-#line 598
 		    for (j = 0; j < nels; j++) {
-#line 598
 			if (inRange3(expect[j],var_type[i],NCT_DOUBLE)
-#line 598
 				&& expect[j] >= double_min && expect[j] <= double_max) {
-#line 598
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_DOUBLE)){
-#line 598
 				error("value read not that expected");
-#line 598
 				if (verbose) {
-#line 598
 				    error("\n");
-#line 598
 				    error("varid: %d, ", i);
-#line 598
 				    error("var_name: %s, ", var_name[i]);
-#line 598
 				    error("element number: %d ", j);
-#line 598
                                     error("expect: %g, ", expect[j]);
-#line 598
 				    error("got: %g", (double) value[j]);
-#line 598
 				}
-#line 598
 			    } else {
-#line 598
 				nok++;
-#line 598
 			    }
-#line 598
 			}
-#line 598
 		    }
-#line 598
 		} else {
-#line 598
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 598
 			error("wrong type: status = %d", err);
-#line 598
 		}
-#line 598
 	    }
-#line 598
 	}
-#line 598
 
-#line 598
     }
-#line 598
     err = nc_close(ncid);
-#line 598
     IF (err)
-#line 598
         error("nc_close: %s", nc_strerror(err));
-#line 598
     print_nok(nok);
-#line 598
 }
-#line 598
 
 
 
-#line 787
 
 void
-#line 788
 test_nc_get_varm_text(void)
-#line 788
 {
-#line 788
     int ncid;
-#line 788
     int d;
-#line 788
     int i;
-#line 788
     int j;
-#line 788
     int k;
-#line 788
     int m;
-#line 788
     int err;
-#line 788
     int allInExtRange;	/* all values within external range? */
-#line 788
     int allInIntRange;	/* all values within internal range? */
-#line 788
     int nels;
-#line 788
     int nslabs;
-#line 788
     int nstarts;        /* number of different starts */
-#line 788
     int nok = 0;      /* count of valid comparisons */
-#line 788
     size_t start[MAX_RANK];
-#line 788
     size_t edge[MAX_RANK];
-#line 788
     size_t index[MAX_RANK];
-#line 788
     size_t index2[MAX_RANK];
-#line 788
     size_t mid[MAX_RANK];
-#line 788
     size_t count[MAX_RANK];
-#line 788
     size_t sstride[MAX_RANK];
-#line 788
     ptrdiff_t stride[MAX_RANK];
-#line 788
     ptrdiff_t imap[MAX_RANK];
-#line 788
     int canConvert;     /* Both text or both numeric */
-#line 788
     text value[MAX_NELS];
-#line 788
     double expect[MAX_NELS];
-#line 788
 
-#line 788
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 788
     IF (err)
-#line 788
         error("nc_open: %s", nc_strerror(err));
-#line 788
     for (i = 0; i < NVARS; i++) {
-#line 788
         canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 788
         assert(var_rank[i] <= MAX_RANK);
-#line 788
         assert(var_nels[i] <= MAX_NELS);
-#line 788
         for (j = 0; j < var_rank[i]; j++) {
-#line 788
             start[j] = 0;
-#line 788
             edge[j] = 1;
-#line 788
             stride[j] = 1;
-#line 788
             imap[j] = 1;
-#line 788
         }
-#line 788
         err = nc_get_varm_text(BAD_ID, i, start, edge, stride, imap, value);
-#line 788
         IF (err != NC_EBADID)
-#line 788
             error("bad ncid: status = %d", err);
-#line 788
         err = nc_get_varm_text(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 788
         IF (err != NC_ENOTVAR)
-#line 788
             error("bad var id: status = %d", err);
-#line 788
         for (j = 0; j < var_rank[i]; j++) {
-#line 788
             start[j] = var_shape[i][j];
-#line 788
             err = nc_get_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 788
 	  if(!canConvert) {
-#line 788
 		IF (err != NC_ECHAR)
-#line 788
                	    error("conversion: status = %d", err);
-#line 788
 	  } else {
-#line 788
 	    IF (err != NC_EINVALCOORDS)
-#line 788
                 error("bad index: status = %d", err);
-#line 788
             start[j] = 0;
-#line 788
             edge[j] = var_shape[i][j] + 1;
-#line 788
             err = nc_get_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 788
             IF (err != NC_EEDGE)
-#line 788
                 error("bad edge: status = %d", err);
-#line 788
             edge[j] = 1;
-#line 788
             stride[j] = 0;
-#line 788
             err = nc_get_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 788
             IF (err != NC_ESTRIDE)
-#line 788
                 error("bad stride: status = %d", err);
-#line 788
             stride[j] = 1;
-#line 788
            }
-#line 788
         }
-#line 788
             /* Choose a random point dividing each dim into 2 parts */
-#line 788
             /* get 2^rank (nslabs) slabs so defined */
-#line 788
         nslabs = 1;
-#line 788
         for (j = 0; j < var_rank[i]; j++) {
-#line 788
             mid[j] = roll( var_shape[i][j] );
-#line 788
             nslabs *= 2;
-#line 788
         }
-#line 788
             /* bits of k determine whether to get lower or upper part of dim */
-#line 788
             /* choose random stride from 1 to edge */
-#line 788
         for (k = 0; k < nslabs; k++) {
-#line 788
             nstarts = 1;
-#line 788
             for (j = 0; j < var_rank[i]; j++) {
-#line 788
                 if ((k >> j) & 1) {
-#line 788
                     start[j] = 0;
-#line 788
                     edge[j] = mid[j];
-#line 788
                 }else{
-#line 788
                     start[j] = mid[j];
-#line 788
                     edge[j] = var_shape[i][j] - mid[j];
-#line 788
                 }
-#line 788
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 788
                 nstarts *= stride[j];
-#line 788
             }
-#line 788
             for (m = 0; m < nstarts; m++) {
-#line 788
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 788
                 IF (err)
-#line 788
                     error("error in toMixedBase");
-#line 788
                 nels = 1;
-#line 788
                 for (j = 0; j < var_rank[i]; j++) {
-#line 788
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 788
                     nels *= count[j];
-#line 788
                     index[j] += start[j];
-#line 788
                 }
-#line 788
 		    /* Random choice of forward or backward */
-#line 788
 /* TODO
-#line 788
 		if ( roll(2) ) {
-#line 788
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 788
 			index[j] += (count[j] - 1) * stride[j];
-#line 788
 			stride[j] = -stride[j];
-#line 788
 		    }
-#line 788
 		}
-#line 788
  */
-#line 788
 		if (var_rank[i] > 0) {
-#line 788
 		    j = var_rank[i] - 1;
-#line 788
 		    imap[j] = 1;
-#line 788
 		    for (; j > 0; j--)
-#line 788
 			imap[j-1] = imap[j] * count[j];
-#line 788
 		}
-#line 788
                 allInExtRange = allInIntRange = 1;
-#line 788
                 for (j = 0; j < nels; j++) {
-#line 788
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 788
                     IF (err)
-#line 788
                         error("error in toMixedBase 1");
-#line 788
                     for (d = 0; d < var_rank[i]; d++)
-#line 788
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 788
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 788
                         NCT_TEXT);
-#line 788
                     if (inRange3(expect[j],var_type[i],NCT_TEXT)) {
-#line 788
                         allInIntRange = allInIntRange && expect[j] >= text_min
-#line 788
                             && expect[j] <= text_max;
-#line 788
                     } else {
-#line 788
                         allInExtRange = 0;
-#line 788
                     }
-#line 788
                 }
-#line 788
                 if (var_rank[i] == 0 && i%2 )
-#line 788
                     err = nc_get_varm_text(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 788
                 else
-#line 788
                     err = nc_get_varm_text(ncid,i,index,count,stride,imap,value);
-#line 788
                 if (canConvert) {
-#line 788
                     if (allInExtRange) {
-#line 788
                         if (allInIntRange) {
-#line 788
                             IF (err)
-#line 788
                                 error("%s", nc_strerror(err));
-#line 788
                         } else {
-#line 788
                             IF (err != NC_ERANGE)
-#line 788
                                 error("Range error: status = %d", err);
-#line 788
                         }
-#line 788
                     } else {
-#line 788
                         IF (err != 0 && err != NC_ERANGE)
-#line 788
                             error("OK or Range error: status = %d", err);
-#line 788
                     }
-#line 788
                     for (j = 0; j < nels; j++) {
-#line 788
                         if (inRange3(expect[j],var_type[i],NCT_TEXT)
-#line 788
                                 && expect[j] >= text_min 
-#line 788
 				&& expect[j] <= text_max) {
-#line 788
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_TEXT)){
-#line 788
                                 error("value read not that expected");
-#line 788
                                 if (verbose) {
-#line 788
                                     error("\n");
-#line 788
                                     error("varid: %d, ", i);
-#line 788
                                     error("var_name: %s, ", var_name[i]);
-#line 788
                                     error("element number: %d ", j);
-#line 788
                                     error("expect: %g, ", expect[j]);
-#line 788
                                     error("got: %g", (double) value[j]);
-#line 788
                                 }
-#line 788
                             } else {
-#line 788
                                 nok++;
-#line 788
                             }
-#line 788
                         }
-#line 788
                     }
-#line 788
                 } else {
-#line 788
                     IF (nels > 0 && err != NC_ECHAR)
-#line 788
                         error("wrong type: status = %d", err);
-#line 788
                 }
-#line 788
             }
-#line 788
         }
-#line 788
     }
-#line 788
     err = nc_close(ncid);
-#line 788
     IF (err)
-#line 788
         error("nc_close: %s", nc_strerror(err));
-#line 788
     print_nok(nok);
-#line 788
 }
-#line 788
 
 void
-#line 789
 test_nc_get_varm_uchar(void)
-#line 789
 {
-#line 789
     int ncid;
-#line 789
     int d;
-#line 789
     int i;
-#line 789
     int j;
-#line 789
     int k;
-#line 789
     int m;
-#line 789
     int err;
-#line 789
     int allInExtRange;	/* all values within external range? */
-#line 789
     int allInIntRange;	/* all values within internal range? */
-#line 789
     int nels;
-#line 789
     int nslabs;
-#line 789
     int nstarts;        /* number of different starts */
-#line 789
     int nok = 0;      /* count of valid comparisons */
-#line 789
     size_t start[MAX_RANK];
-#line 789
     size_t edge[MAX_RANK];
-#line 789
     size_t index[MAX_RANK];
-#line 789
     size_t index2[MAX_RANK];
-#line 789
     size_t mid[MAX_RANK];
-#line 789
     size_t count[MAX_RANK];
-#line 789
     size_t sstride[MAX_RANK];
-#line 789
     ptrdiff_t stride[MAX_RANK];
-#line 789
     ptrdiff_t imap[MAX_RANK];
-#line 789
     int canConvert;     /* Both text or both numeric */
-#line 789
     uchar value[MAX_NELS];
-#line 789
     double expect[MAX_NELS];
-#line 789
 
-#line 789
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 789
     IF (err)
-#line 789
         error("nc_open: %s", nc_strerror(err));
-#line 789
     for (i = 0; i < NVARS; i++) {
-#line 789
         canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 789
         assert(var_rank[i] <= MAX_RANK);
-#line 789
         assert(var_nels[i] <= MAX_NELS);
-#line 789
         for (j = 0; j < var_rank[i]; j++) {
-#line 789
             start[j] = 0;
-#line 789
             edge[j] = 1;
-#line 789
             stride[j] = 1;
-#line 789
             imap[j] = 1;
-#line 789
         }
-#line 789
         err = nc_get_varm_uchar(BAD_ID, i, start, edge, stride, imap, value);
-#line 789
         IF (err != NC_EBADID)
-#line 789
             error("bad ncid: status = %d", err);
-#line 789
         err = nc_get_varm_uchar(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 789
         IF (err != NC_ENOTVAR)
-#line 789
             error("bad var id: status = %d", err);
-#line 789
         for (j = 0; j < var_rank[i]; j++) {
-#line 789
             start[j] = var_shape[i][j];
-#line 789
             err = nc_get_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 789
 	  if(!canConvert) {
-#line 789
 		IF (err != NC_ECHAR)
-#line 789
                	    error("conversion: status = %d", err);
-#line 789
 	  } else {
-#line 789
 	    IF (err != NC_EINVALCOORDS)
-#line 789
                 error("bad index: status = %d", err);
-#line 789
             start[j] = 0;
-#line 789
             edge[j] = var_shape[i][j] + 1;
-#line 789
             err = nc_get_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 789
             IF (err != NC_EEDGE)
-#line 789
                 error("bad edge: status = %d", err);
-#line 789
             edge[j] = 1;
-#line 789
             stride[j] = 0;
-#line 789
             err = nc_get_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 789
             IF (err != NC_ESTRIDE)
-#line 789
                 error("bad stride: status = %d", err);
-#line 789
             stride[j] = 1;
-#line 789
            }
-#line 789
         }
-#line 789
             /* Choose a random point dividing each dim into 2 parts */
-#line 789
             /* get 2^rank (nslabs) slabs so defined */
-#line 789
         nslabs = 1;
-#line 789
         for (j = 0; j < var_rank[i]; j++) {
-#line 789
             mid[j] = roll( var_shape[i][j] );
-#line 789
             nslabs *= 2;
-#line 789
         }
-#line 789
             /* bits of k determine whether to get lower or upper part of dim */
-#line 789
             /* choose random stride from 1 to edge */
-#line 789
         for (k = 0; k < nslabs; k++) {
-#line 789
             nstarts = 1;
-#line 789
             for (j = 0; j < var_rank[i]; j++) {
-#line 789
                 if ((k >> j) & 1) {
-#line 789
                     start[j] = 0;
-#line 789
                     edge[j] = mid[j];
-#line 789
                 }else{
-#line 789
                     start[j] = mid[j];
-#line 789
                     edge[j] = var_shape[i][j] - mid[j];
-#line 789
                 }
-#line 789
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 789
                 nstarts *= stride[j];
-#line 789
             }
-#line 789
             for (m = 0; m < nstarts; m++) {
-#line 789
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 789
                 IF (err)
-#line 789
                     error("error in toMixedBase");
-#line 789
                 nels = 1;
-#line 789
                 for (j = 0; j < var_rank[i]; j++) {
-#line 789
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 789
                     nels *= count[j];
-#line 789
                     index[j] += start[j];
-#line 789
                 }
-#line 789
 		    /* Random choice of forward or backward */
-#line 789
 /* TODO
-#line 789
 		if ( roll(2) ) {
-#line 789
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 789
 			index[j] += (count[j] - 1) * stride[j];
-#line 789
 			stride[j] = -stride[j];
-#line 789
 		    }
-#line 789
 		}
-#line 789
  */
-#line 789
 		if (var_rank[i] > 0) {
-#line 789
 		    j = var_rank[i] - 1;
-#line 789
 		    imap[j] = 1;
-#line 789
 		    for (; j > 0; j--)
-#line 789
 			imap[j-1] = imap[j] * count[j];
-#line 789
 		}
-#line 789
                 allInExtRange = allInIntRange = 1;
-#line 789
                 for (j = 0; j < nels; j++) {
-#line 789
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 789
                     IF (err)
-#line 789
                         error("error in toMixedBase 1");
-#line 789
                     for (d = 0; d < var_rank[i]; d++)
-#line 789
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 789
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 789
                         NCT_UCHAR);
-#line 789
                     if (inRange3(expect[j],var_type[i],NCT_UCHAR)) {
-#line 789
                         allInIntRange = allInIntRange && expect[j] >= uchar_min
-#line 789
                             && expect[j] <= uchar_max;
-#line 789
                     } else {
-#line 789
                         allInExtRange = 0;
-#line 789
                     }
-#line 789
                 }
-#line 789
                 if (var_rank[i] == 0 && i%2 )
-#line 789
                     err = nc_get_varm_uchar(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 789
                 else
-#line 789
                     err = nc_get_varm_uchar(ncid,i,index,count,stride,imap,value);
-#line 789
                 if (canConvert) {
-#line 789
                     if (allInExtRange) {
-#line 789
                         if (allInIntRange) {
-#line 789
                             IF (err)
-#line 789
                                 error("%s", nc_strerror(err));
-#line 789
                         } else {
-#line 789
                             IF (err != NC_ERANGE)
-#line 789
                                 error("Range error: status = %d", err);
-#line 789
                         }
-#line 789
                     } else {
-#line 789
                         IF (err != 0 && err != NC_ERANGE)
-#line 789
                             error("OK or Range error: status = %d", err);
-#line 789
                     }
-#line 789
                     for (j = 0; j < nels; j++) {
-#line 789
                         if (inRange3(expect[j],var_type[i],NCT_UCHAR)
-#line 789
                                 && expect[j] >= uchar_min 
-#line 789
 				&& expect[j] <= uchar_max) {
-#line 789
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_UCHAR)){
-#line 789
                                 error("value read not that expected");
-#line 789
                                 if (verbose) {
-#line 789
                                     error("\n");
-#line 789
                                     error("varid: %d, ", i);
-#line 789
                                     error("var_name: %s, ", var_name[i]);
-#line 789
                                     error("element number: %d ", j);
-#line 789
                                     error("expect: %g, ", expect[j]);
-#line 789
                                     error("got: %g", (double) value[j]);
-#line 789
                                 }
-#line 789
                             } else {
-#line 789
                                 nok++;
-#line 789
                             }
-#line 789
                         }
-#line 789
                     }
-#line 789
                 } else {
-#line 789
                     IF (nels > 0 && err != NC_ECHAR)
-#line 789
                         error("wrong type: status = %d", err);
-#line 789
                 }
-#line 789
             }
-#line 789
         }
-#line 789
     }
-#line 789
     err = nc_close(ncid);
-#line 789
     IF (err)
-#line 789
         error("nc_close: %s", nc_strerror(err));
-#line 789
     print_nok(nok);
-#line 789
 }
-#line 789
 
 void
-#line 790
 test_nc_get_varm_schar(void)
-#line 790
 {
-#line 790
     int ncid;
-#line 790
     int d;
-#line 790
     int i;
-#line 790
     int j;
-#line 790
     int k;
-#line 790
     int m;
-#line 790
     int err;
-#line 790
     int allInExtRange;	/* all values within external range? */
-#line 790
     int allInIntRange;	/* all values within internal range? */
-#line 790
     int nels;
-#line 790
     int nslabs;
-#line 790
     int nstarts;        /* number of different starts */
-#line 790
     int nok = 0;      /* count of valid comparisons */
-#line 790
     size_t start[MAX_RANK];
-#line 790
     size_t edge[MAX_RANK];
-#line 790
     size_t index[MAX_RANK];
-#line 790
     size_t index2[MAX_RANK];
-#line 790
     size_t mid[MAX_RANK];
-#line 790
     size_t count[MAX_RANK];
-#line 790
     size_t sstride[MAX_RANK];
-#line 790
     ptrdiff_t stride[MAX_RANK];
-#line 790
     ptrdiff_t imap[MAX_RANK];
-#line 790
     int canConvert;     /* Both text or both numeric */
-#line 790
     schar value[MAX_NELS];
-#line 790
     double expect[MAX_NELS];
-#line 790
 
-#line 790
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 790
     IF (err)
-#line 790
         error("nc_open: %s", nc_strerror(err));
-#line 790
     for (i = 0; i < NVARS; i++) {
-#line 790
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 790
         assert(var_rank[i] <= MAX_RANK);
-#line 790
         assert(var_nels[i] <= MAX_NELS);
-#line 790
         for (j = 0; j < var_rank[i]; j++) {
-#line 790
             start[j] = 0;
-#line 790
             edge[j] = 1;
-#line 790
             stride[j] = 1;
-#line 790
             imap[j] = 1;
-#line 790
         }
-#line 790
         err = nc_get_varm_schar(BAD_ID, i, start, edge, stride, imap, value);
-#line 790
         IF (err != NC_EBADID)
-#line 790
             error("bad ncid: status = %d", err);
-#line 790
         err = nc_get_varm_schar(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 790
         IF (err != NC_ENOTVAR)
-#line 790
             error("bad var id: status = %d", err);
-#line 790
         for (j = 0; j < var_rank[i]; j++) {
-#line 790
             start[j] = var_shape[i][j];
-#line 790
             err = nc_get_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 790
 	  if(!canConvert) {
-#line 790
 		IF (err != NC_ECHAR)
-#line 790
                	    error("conversion: status = %d", err);
-#line 790
 	  } else {
-#line 790
 	    IF (err != NC_EINVALCOORDS)
-#line 790
                 error("bad index: status = %d", err);
-#line 790
             start[j] = 0;
-#line 790
             edge[j] = var_shape[i][j] + 1;
-#line 790
             err = nc_get_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 790
             IF (err != NC_EEDGE)
-#line 790
                 error("bad edge: status = %d", err);
-#line 790
             edge[j] = 1;
-#line 790
             stride[j] = 0;
-#line 790
             err = nc_get_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 790
             IF (err != NC_ESTRIDE)
-#line 790
                 error("bad stride: status = %d", err);
-#line 790
             stride[j] = 1;
-#line 790
            }
-#line 790
         }
-#line 790
             /* Choose a random point dividing each dim into 2 parts */
-#line 790
             /* get 2^rank (nslabs) slabs so defined */
-#line 790
         nslabs = 1;
-#line 790
         for (j = 0; j < var_rank[i]; j++) {
-#line 790
             mid[j] = roll( var_shape[i][j] );
-#line 790
             nslabs *= 2;
-#line 790
         }
-#line 790
             /* bits of k determine whether to get lower or upper part of dim */
-#line 790
             /* choose random stride from 1 to edge */
-#line 790
         for (k = 0; k < nslabs; k++) {
-#line 790
             nstarts = 1;
-#line 790
             for (j = 0; j < var_rank[i]; j++) {
-#line 790
                 if ((k >> j) & 1) {
-#line 790
                     start[j] = 0;
-#line 790
                     edge[j] = mid[j];
-#line 790
                 }else{
-#line 790
                     start[j] = mid[j];
-#line 790
                     edge[j] = var_shape[i][j] - mid[j];
-#line 790
                 }
-#line 790
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 790
                 nstarts *= stride[j];
-#line 790
             }
-#line 790
             for (m = 0; m < nstarts; m++) {
-#line 790
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 790
                 IF (err)
-#line 790
                     error("error in toMixedBase");
-#line 790
                 nels = 1;
-#line 790
                 for (j = 0; j < var_rank[i]; j++) {
-#line 790
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 790
                     nels *= count[j];
-#line 790
                     index[j] += start[j];
-#line 790
                 }
-#line 790
 		    /* Random choice of forward or backward */
-#line 790
 /* TODO
-#line 790
 		if ( roll(2) ) {
-#line 790
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 790
 			index[j] += (count[j] - 1) * stride[j];
-#line 790
 			stride[j] = -stride[j];
-#line 790
 		    }
-#line 790
 		}
-#line 790
  */
-#line 790
 		if (var_rank[i] > 0) {
-#line 790
 		    j = var_rank[i] - 1;
-#line 790
 		    imap[j] = 1;
-#line 790
 		    for (; j > 0; j--)
-#line 790
 			imap[j-1] = imap[j] * count[j];
-#line 790
 		}
-#line 790
                 allInExtRange = allInIntRange = 1;
-#line 790
                 for (j = 0; j < nels; j++) {
-#line 790
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 790
                     IF (err)
-#line 790
                         error("error in toMixedBase 1");
-#line 790
                     for (d = 0; d < var_rank[i]; d++)
-#line 790
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 790
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 790
                         NCT_SCHAR);
-#line 790
                     if (inRange3(expect[j],var_type[i],NCT_SCHAR)) {
-#line 790
                         allInIntRange = allInIntRange && expect[j] >= schar_min
-#line 790
                             && expect[j] <= schar_max;
-#line 790
                     } else {
-#line 790
                         allInExtRange = 0;
-#line 790
                     }
-#line 790
                 }
-#line 790
                 if (var_rank[i] == 0 && i%2 )
-#line 790
                     err = nc_get_varm_schar(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 790
                 else
-#line 790
                     err = nc_get_varm_schar(ncid,i,index,count,stride,imap,value);
-#line 790
                 if (canConvert) {
-#line 790
                     if (allInExtRange) {
-#line 790
                         if (allInIntRange) {
-#line 790
                             IF (err)
-#line 790
                                 error("%s", nc_strerror(err));
-#line 790
                         } else {
-#line 790
                             IF (err != NC_ERANGE)
-#line 790
                                 error("Range error: status = %d", err);
-#line 790
                         }
-#line 790
                     } else {
-#line 790
                         IF (err != 0 && err != NC_ERANGE)
-#line 790
                             error("OK or Range error: status = %d", err);
-#line 790
                     }
-#line 790
                     for (j = 0; j < nels; j++) {
-#line 790
                         if (inRange3(expect[j],var_type[i],NCT_SCHAR)
-#line 790
                                 && expect[j] >= schar_min 
-#line 790
 				&& expect[j] <= schar_max) {
-#line 790
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_SCHAR)){
-#line 790
                                 error("value read not that expected");
-#line 790
                                 if (verbose) {
-#line 790
                                     error("\n");
-#line 790
                                     error("varid: %d, ", i);
-#line 790
                                     error("var_name: %s, ", var_name[i]);
-#line 790
                                     error("element number: %d ", j);
-#line 790
                                     error("expect: %g, ", expect[j]);
-#line 790
                                     error("got: %g", (double) value[j]);
-#line 790
                                 }
-#line 790
                             } else {
-#line 790
                                 nok++;
-#line 790
                             }
-#line 790
                         }
-#line 790
                     }
-#line 790
                 } else {
-#line 790
                     IF (nels > 0 && err != NC_ECHAR)
-#line 790
                         error("wrong type: status = %d", err);
-#line 790
                 }
-#line 790
             }
-#line 790
         }
-#line 790
     }
-#line 790
     err = nc_close(ncid);
-#line 790
     IF (err)
-#line 790
         error("nc_close: %s", nc_strerror(err));
-#line 790
     print_nok(nok);
-#line 790
 }
-#line 790
 
 void
-#line 791
 test_nc_get_varm_short(void)
-#line 791
 {
-#line 791
     int ncid;
-#line 791
     int d;
-#line 791
     int i;
-#line 791
     int j;
-#line 791
     int k;
-#line 791
     int m;
-#line 791
     int err;
-#line 791
     int allInExtRange;	/* all values within external range? */
-#line 791
     int allInIntRange;	/* all values within internal range? */
-#line 791
     int nels;
-#line 791
     int nslabs;
-#line 791
     int nstarts;        /* number of different starts */
-#line 791
     int nok = 0;      /* count of valid comparisons */
-#line 791
     size_t start[MAX_RANK];
-#line 791
     size_t edge[MAX_RANK];
-#line 791
     size_t index[MAX_RANK];
-#line 791
     size_t index2[MAX_RANK];
-#line 791
     size_t mid[MAX_RANK];
-#line 791
     size_t count[MAX_RANK];
-#line 791
     size_t sstride[MAX_RANK];
-#line 791
     ptrdiff_t stride[MAX_RANK];
-#line 791
     ptrdiff_t imap[MAX_RANK];
-#line 791
     int canConvert;     /* Both text or both numeric */
-#line 791
     short value[MAX_NELS];
-#line 791
     double expect[MAX_NELS];
-#line 791
 
-#line 791
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 791
     IF (err)
-#line 791
         error("nc_open: %s", nc_strerror(err));
-#line 791
     for (i = 0; i < NVARS; i++) {
-#line 791
         canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 791
         assert(var_rank[i] <= MAX_RANK);
-#line 791
         assert(var_nels[i] <= MAX_NELS);
-#line 791
         for (j = 0; j < var_rank[i]; j++) {
-#line 791
             start[j] = 0;
-#line 791
             edge[j] = 1;
-#line 791
             stride[j] = 1;
-#line 791
             imap[j] = 1;
-#line 791
         }
-#line 791
         err = nc_get_varm_short(BAD_ID, i, start, edge, stride, imap, value);
-#line 791
         IF (err != NC_EBADID)
-#line 791
             error("bad ncid: status = %d", err);
-#line 791
         err = nc_get_varm_short(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 791
         IF (err != NC_ENOTVAR)
-#line 791
             error("bad var id: status = %d", err);
-#line 791
         for (j = 0; j < var_rank[i]; j++) {
-#line 791
             start[j] = var_shape[i][j];
-#line 791
             err = nc_get_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 791
 	  if(!canConvert) {
-#line 791
 		IF (err != NC_ECHAR)
-#line 791
                	    error("conversion: status = %d", err);
-#line 791
 	  } else {
-#line 791
 	    IF (err != NC_EINVALCOORDS)
-#line 791
                 error("bad index: status = %d", err);
-#line 791
             start[j] = 0;
-#line 791
             edge[j] = var_shape[i][j] + 1;
-#line 791
             err = nc_get_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 791
             IF (err != NC_EEDGE)
-#line 791
                 error("bad edge: status = %d", err);
-#line 791
             edge[j] = 1;
-#line 791
             stride[j] = 0;
-#line 791
             err = nc_get_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 791
             IF (err != NC_ESTRIDE)
-#line 791
                 error("bad stride: status = %d", err);
-#line 791
             stride[j] = 1;
-#line 791
            }
-#line 791
         }
-#line 791
             /* Choose a random point dividing each dim into 2 parts */
-#line 791
             /* get 2^rank (nslabs) slabs so defined */
-#line 791
         nslabs = 1;
-#line 791
         for (j = 0; j < var_rank[i]; j++) {
-#line 791
             mid[j] = roll( var_shape[i][j] );
-#line 791
             nslabs *= 2;
-#line 791
         }
-#line 791
             /* bits of k determine whether to get lower or upper part of dim */
-#line 791
             /* choose random stride from 1 to edge */
-#line 791
         for (k = 0; k < nslabs; k++) {
-#line 791
             nstarts = 1;
-#line 791
             for (j = 0; j < var_rank[i]; j++) {
-#line 791
                 if ((k >> j) & 1) {
-#line 791
                     start[j] = 0;
-#line 791
                     edge[j] = mid[j];
-#line 791
                 }else{
-#line 791
                     start[j] = mid[j];
-#line 791
                     edge[j] = var_shape[i][j] - mid[j];
-#line 791
                 }
-#line 791
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 791
                 nstarts *= stride[j];
-#line 791
             }
-#line 791
             for (m = 0; m < nstarts; m++) {
-#line 791
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 791
                 IF (err)
-#line 791
                     error("error in toMixedBase");
-#line 791
                 nels = 1;
-#line 791
                 for (j = 0; j < var_rank[i]; j++) {
-#line 791
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 791
                     nels *= count[j];
-#line 791
                     index[j] += start[j];
-#line 791
                 }
-#line 791
 		    /* Random choice of forward or backward */
-#line 791
 /* TODO
-#line 791
 		if ( roll(2) ) {
-#line 791
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 791
 			index[j] += (count[j] - 1) * stride[j];
-#line 791
 			stride[j] = -stride[j];
-#line 791
 		    }
-#line 791
 		}
-#line 791
  */
-#line 791
 		if (var_rank[i] > 0) {
-#line 791
 		    j = var_rank[i] - 1;
-#line 791
 		    imap[j] = 1;
-#line 791
 		    for (; j > 0; j--)
-#line 791
 			imap[j-1] = imap[j] * count[j];
-#line 791
 		}
-#line 791
                 allInExtRange = allInIntRange = 1;
-#line 791
                 for (j = 0; j < nels; j++) {
-#line 791
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 791
                     IF (err)
-#line 791
                         error("error in toMixedBase 1");
-#line 791
                     for (d = 0; d < var_rank[i]; d++)
-#line 791
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 791
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 791
                         NCT_SHORT);
-#line 791
                     if (inRange3(expect[j],var_type[i],NCT_SHORT)) {
-#line 791
                         allInIntRange = allInIntRange && expect[j] >= short_min
-#line 791
                             && expect[j] <= short_max;
-#line 791
                     } else {
-#line 791
                         allInExtRange = 0;
-#line 791
                     }
-#line 791
                 }
-#line 791
                 if (var_rank[i] == 0 && i%2 )
-#line 791
                     err = nc_get_varm_short(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 791
                 else
-#line 791
                     err = nc_get_varm_short(ncid,i,index,count,stride,imap,value);
-#line 791
                 if (canConvert) {
-#line 791
                     if (allInExtRange) {
-#line 791
                         if (allInIntRange) {
-#line 791
                             IF (err)
-#line 791
                                 error("%s", nc_strerror(err));
-#line 791
                         } else {
-#line 791
                             IF (err != NC_ERANGE)
-#line 791
                                 error("Range error: status = %d", err);
-#line 791
                         }
-#line 791
                     } else {
-#line 791
                         IF (err != 0 && err != NC_ERANGE)
-#line 791
                             error("OK or Range error: status = %d", err);
-#line 791
                     }
-#line 791
                     for (j = 0; j < nels; j++) {
-#line 791
                         if (inRange3(expect[j],var_type[i],NCT_SHORT)
-#line 791
                                 && expect[j] >= short_min 
-#line 791
 				&& expect[j] <= short_max) {
-#line 791
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_SHORT)){
-#line 791
                                 error("value read not that expected");
-#line 791
                                 if (verbose) {
-#line 791
                                     error("\n");
-#line 791
                                     error("varid: %d, ", i);
-#line 791
                                     error("var_name: %s, ", var_name[i]);
-#line 791
                                     error("element number: %d ", j);
-#line 791
                                     error("expect: %g, ", expect[j]);
-#line 791
                                     error("got: %g", (double) value[j]);
-#line 791
                                 }
-#line 791
                             } else {
-#line 791
                                 nok++;
-#line 791
                             }
-#line 791
                         }
-#line 791
                     }
-#line 791
                 } else {
-#line 791
                     IF (nels > 0 && err != NC_ECHAR)
-#line 791
                         error("wrong type: status = %d", err);
-#line 791
                 }
-#line 791
             }
-#line 791
         }
-#line 791
     }
-#line 791
     err = nc_close(ncid);
-#line 791
     IF (err)
-#line 791
         error("nc_close: %s", nc_strerror(err));
-#line 791
     print_nok(nok);
-#line 791
 }
-#line 791
 
 void
-#line 792
 test_nc_get_varm_int(void)
-#line 792
 {
-#line 792
     int ncid;
-#line 792
     int d;
-#line 792
     int i;
-#line 792
     int j;
-#line 792
     int k;
-#line 792
     int m;
-#line 792
     int err;
-#line 792
     int allInExtRange;	/* all values within external range? */
-#line 792
     int allInIntRange;	/* all values within internal range? */
-#line 792
     int nels;
-#line 792
     int nslabs;
-#line 792
     int nstarts;        /* number of different starts */
-#line 792
     int nok = 0;      /* count of valid comparisons */
-#line 792
     size_t start[MAX_RANK];
-#line 792
     size_t edge[MAX_RANK];
-#line 792
     size_t index[MAX_RANK];
-#line 792
     size_t index2[MAX_RANK];
-#line 792
     size_t mid[MAX_RANK];
-#line 792
     size_t count[MAX_RANK];
-#line 792
     size_t sstride[MAX_RANK];
-#line 792
     ptrdiff_t stride[MAX_RANK];
-#line 792
     ptrdiff_t imap[MAX_RANK];
-#line 792
     int canConvert;     /* Both text or both numeric */
-#line 792
     int value[MAX_NELS];
-#line 792
     double expect[MAX_NELS];
-#line 792
 
-#line 792
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 792
     IF (err)
-#line 792
         error("nc_open: %s", nc_strerror(err));
-#line 792
     for (i = 0; i < NVARS; i++) {
-#line 792
         canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 792
         assert(var_rank[i] <= MAX_RANK);
-#line 792
         assert(var_nels[i] <= MAX_NELS);
-#line 792
         for (j = 0; j < var_rank[i]; j++) {
-#line 792
             start[j] = 0;
-#line 792
             edge[j] = 1;
-#line 792
             stride[j] = 1;
-#line 792
             imap[j] = 1;
-#line 792
         }
-#line 792
         err = nc_get_varm_int(BAD_ID, i, start, edge, stride, imap, value);
-#line 792
         IF (err != NC_EBADID)
-#line 792
             error("bad ncid: status = %d", err);
-#line 792
         err = nc_get_varm_int(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 792
         IF (err != NC_ENOTVAR)
-#line 792
             error("bad var id: status = %d", err);
-#line 792
         for (j = 0; j < var_rank[i]; j++) {
-#line 792
             start[j] = var_shape[i][j];
-#line 792
             err = nc_get_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 792
 	  if(!canConvert) {
-#line 792
 		IF (err != NC_ECHAR)
-#line 792
                	    error("conversion: status = %d", err);
-#line 792
 	  } else {
-#line 792
 	    IF (err != NC_EINVALCOORDS)
-#line 792
                 error("bad index: status = %d", err);
-#line 792
             start[j] = 0;
-#line 792
             edge[j] = var_shape[i][j] + 1;
-#line 792
             err = nc_get_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 792
             IF (err != NC_EEDGE)
-#line 792
                 error("bad edge: status = %d", err);
-#line 792
             edge[j] = 1;
-#line 792
             stride[j] = 0;
-#line 792
             err = nc_get_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 792
             IF (err != NC_ESTRIDE)
-#line 792
                 error("bad stride: status = %d", err);
-#line 792
             stride[j] = 1;
-#line 792
            }
-#line 792
         }
-#line 792
             /* Choose a random point dividing each dim into 2 parts */
-#line 792
             /* get 2^rank (nslabs) slabs so defined */
-#line 792
         nslabs = 1;
-#line 792
         for (j = 0; j < var_rank[i]; j++) {
-#line 792
             mid[j] = roll( var_shape[i][j] );
-#line 792
             nslabs *= 2;
-#line 792
         }
-#line 792
             /* bits of k determine whether to get lower or upper part of dim */
-#line 792
             /* choose random stride from 1 to edge */
-#line 792
         for (k = 0; k < nslabs; k++) {
-#line 792
             nstarts = 1;
-#line 792
             for (j = 0; j < var_rank[i]; j++) {
-#line 792
                 if ((k >> j) & 1) {
-#line 792
                     start[j] = 0;
-#line 792
                     edge[j] = mid[j];
-#line 792
                 }else{
-#line 792
                     start[j] = mid[j];
-#line 792
                     edge[j] = var_shape[i][j] - mid[j];
-#line 792
                 }
-#line 792
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 792
                 nstarts *= stride[j];
-#line 792
             }
-#line 792
             for (m = 0; m < nstarts; m++) {
-#line 792
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 792
                 IF (err)
-#line 792
                     error("error in toMixedBase");
-#line 792
                 nels = 1;
-#line 792
                 for (j = 0; j < var_rank[i]; j++) {
-#line 792
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 792
                     nels *= count[j];
-#line 792
                     index[j] += start[j];
-#line 792
                 }
-#line 792
 		    /* Random choice of forward or backward */
-#line 792
 /* TODO
-#line 792
 		if ( roll(2) ) {
-#line 792
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 792
 			index[j] += (count[j] - 1) * stride[j];
-#line 792
 			stride[j] = -stride[j];
-#line 792
 		    }
-#line 792
 		}
-#line 792
  */
-#line 792
 		if (var_rank[i] > 0) {
-#line 792
 		    j = var_rank[i] - 1;
-#line 792
 		    imap[j] = 1;
-#line 792
 		    for (; j > 0; j--)
-#line 792
 			imap[j-1] = imap[j] * count[j];
-#line 792
 		}
-#line 792
                 allInExtRange = allInIntRange = 1;
-#line 792
                 for (j = 0; j < nels; j++) {
-#line 792
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 792
                     IF (err)
-#line 792
                         error("error in toMixedBase 1");
-#line 792
                     for (d = 0; d < var_rank[i]; d++)
-#line 792
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 792
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 792
                         NCT_INT);
-#line 792
                     if (inRange3(expect[j],var_type[i],NCT_INT)) {
-#line 792
                         allInIntRange = allInIntRange && expect[j] >= int_min
-#line 792
                             && expect[j] <= int_max;
-#line 792
                     } else {
-#line 792
                         allInExtRange = 0;
-#line 792
                     }
-#line 792
                 }
-#line 792
                 if (var_rank[i] == 0 && i%2 )
-#line 792
                     err = nc_get_varm_int(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 792
                 else
-#line 792
                     err = nc_get_varm_int(ncid,i,index,count,stride,imap,value);
-#line 792
                 if (canConvert) {
-#line 792
                     if (allInExtRange) {
-#line 792
                         if (allInIntRange) {
-#line 792
                             IF (err)
-#line 792
                                 error("%s", nc_strerror(err));
-#line 792
                         } else {
-#line 792
                             IF (err != NC_ERANGE)
-#line 792
                                 error("Range error: status = %d", err);
-#line 792
                         }
-#line 792
                     } else {
-#line 792
                         IF (err != 0 && err != NC_ERANGE)
-#line 792
                             error("OK or Range error: status = %d", err);
-#line 792
                     }
-#line 792
                     for (j = 0; j < nels; j++) {
-#line 792
                         if (inRange3(expect[j],var_type[i],NCT_INT)
-#line 792
                                 && expect[j] >= int_min 
-#line 792
 				&& expect[j] <= int_max) {
-#line 792
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_INT)){
-#line 792
                                 error("value read not that expected");
-#line 792
                                 if (verbose) {
-#line 792
                                     error("\n");
-#line 792
                                     error("varid: %d, ", i);
-#line 792
                                     error("var_name: %s, ", var_name[i]);
-#line 792
                                     error("element number: %d ", j);
-#line 792
                                     error("expect: %g, ", expect[j]);
-#line 792
                                     error("got: %g", (double) value[j]);
-#line 792
                                 }
-#line 792
                             } else {
-#line 792
                                 nok++;
-#line 792
                             }
-#line 792
                         }
-#line 792
                     }
-#line 792
                 } else {
-#line 792
                     IF (nels > 0 && err != NC_ECHAR)
-#line 792
                         error("wrong type: status = %d", err);
-#line 792
                 }
-#line 792
             }
-#line 792
         }
-#line 792
     }
-#line 792
     err = nc_close(ncid);
-#line 792
     IF (err)
-#line 792
         error("nc_close: %s", nc_strerror(err));
-#line 792
     print_nok(nok);
-#line 792
 }
-#line 792
 
 void
-#line 793
 test_nc_get_varm_long(void)
-#line 793
 {
-#line 793
     int ncid;
-#line 793
     int d;
-#line 793
     int i;
-#line 793
     int j;
-#line 793
     int k;
-#line 793
     int m;
-#line 793
     int err;
-#line 793
     int allInExtRange;	/* all values within external range? */
-#line 793
     int allInIntRange;	/* all values within internal range? */
-#line 793
     int nels;
-#line 793
     int nslabs;
-#line 793
     int nstarts;        /* number of different starts */
-#line 793
     int nok = 0;      /* count of valid comparisons */
-#line 793
     size_t start[MAX_RANK];
-#line 793
     size_t edge[MAX_RANK];
-#line 793
     size_t index[MAX_RANK];
-#line 793
     size_t index2[MAX_RANK];
-#line 793
     size_t mid[MAX_RANK];
-#line 793
     size_t count[MAX_RANK];
-#line 793
     size_t sstride[MAX_RANK];
-#line 793
     ptrdiff_t stride[MAX_RANK];
-#line 793
     ptrdiff_t imap[MAX_RANK];
-#line 793
     int canConvert;     /* Both text or both numeric */
-#line 793
     long value[MAX_NELS];
-#line 793
     double expect[MAX_NELS];
-#line 793
 
-#line 793
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 793
     IF (err)
-#line 793
         error("nc_open: %s", nc_strerror(err));
-#line 793
     for (i = 0; i < NVARS; i++) {
-#line 793
         canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 793
         assert(var_rank[i] <= MAX_RANK);
-#line 793
         assert(var_nels[i] <= MAX_NELS);
-#line 793
         for (j = 0; j < var_rank[i]; j++) {
-#line 793
             start[j] = 0;
-#line 793
             edge[j] = 1;
-#line 793
             stride[j] = 1;
-#line 793
             imap[j] = 1;
-#line 793
         }
-#line 793
         err = nc_get_varm_long(BAD_ID, i, start, edge, stride, imap, value);
-#line 793
         IF (err != NC_EBADID)
-#line 793
             error("bad ncid: status = %d", err);
-#line 793
         err = nc_get_varm_long(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 793
         IF (err != NC_ENOTVAR)
-#line 793
             error("bad var id: status = %d", err);
-#line 793
         for (j = 0; j < var_rank[i]; j++) {
-#line 793
             start[j] = var_shape[i][j];
-#line 793
             err = nc_get_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 793
 	  if(!canConvert) {
-#line 793
 		IF (err != NC_ECHAR)
-#line 793
                	    error("conversion: status = %d", err);
-#line 793
 	  } else {
-#line 793
 	    IF (err != NC_EINVALCOORDS)
-#line 793
                 error("bad index: status = %d", err);
-#line 793
             start[j] = 0;
-#line 793
             edge[j] = var_shape[i][j] + 1;
-#line 793
             err = nc_get_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 793
             IF (err != NC_EEDGE)
-#line 793
                 error("bad edge: status = %d", err);
-#line 793
             edge[j] = 1;
-#line 793
             stride[j] = 0;
-#line 793
             err = nc_get_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 793
             IF (err != NC_ESTRIDE)
-#line 793
                 error("bad stride: status = %d", err);
-#line 793
             stride[j] = 1;
-#line 793
            }
-#line 793
         }
-#line 793
             /* Choose a random point dividing each dim into 2 parts */
-#line 793
             /* get 2^rank (nslabs) slabs so defined */
-#line 793
         nslabs = 1;
-#line 793
         for (j = 0; j < var_rank[i]; j++) {
-#line 793
             mid[j] = roll( var_shape[i][j] );
-#line 793
             nslabs *= 2;
-#line 793
         }
-#line 793
             /* bits of k determine whether to get lower or upper part of dim */
-#line 793
             /* choose random stride from 1 to edge */
-#line 793
         for (k = 0; k < nslabs; k++) {
-#line 793
             nstarts = 1;
-#line 793
             for (j = 0; j < var_rank[i]; j++) {
-#line 793
                 if ((k >> j) & 1) {
-#line 793
                     start[j] = 0;
-#line 793
                     edge[j] = mid[j];
-#line 793
                 }else{
-#line 793
                     start[j] = mid[j];
-#line 793
                     edge[j] = var_shape[i][j] - mid[j];
-#line 793
                 }
-#line 793
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 793
                 nstarts *= stride[j];
-#line 793
             }
-#line 793
             for (m = 0; m < nstarts; m++) {
-#line 793
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 793
                 IF (err)
-#line 793
                     error("error in toMixedBase");
-#line 793
                 nels = 1;
-#line 793
                 for (j = 0; j < var_rank[i]; j++) {
-#line 793
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 793
                     nels *= count[j];
-#line 793
                     index[j] += start[j];
-#line 793
                 }
-#line 793
 		    /* Random choice of forward or backward */
-#line 793
 /* TODO
-#line 793
 		if ( roll(2) ) {
-#line 793
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 793
 			index[j] += (count[j] - 1) * stride[j];
-#line 793
 			stride[j] = -stride[j];
-#line 793
 		    }
-#line 793
 		}
-#line 793
  */
-#line 793
 		if (var_rank[i] > 0) {
-#line 793
 		    j = var_rank[i] - 1;
-#line 793
 		    imap[j] = 1;
-#line 793
 		    for (; j > 0; j--)
-#line 793
 			imap[j-1] = imap[j] * count[j];
-#line 793
 		}
-#line 793
                 allInExtRange = allInIntRange = 1;
-#line 793
                 for (j = 0; j < nels; j++) {
-#line 793
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 793
                     IF (err)
-#line 793
                         error("error in toMixedBase 1");
-#line 793
                     for (d = 0; d < var_rank[i]; d++)
-#line 793
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 793
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 793
                         NCT_LONG);
-#line 793
                     if (inRange3(expect[j],var_type[i],NCT_LONG)) {
-#line 793
                         allInIntRange = allInIntRange && expect[j] >= long_min
-#line 793
                             && expect[j] <= long_max;
-#line 793
                     } else {
-#line 793
                         allInExtRange = 0;
-#line 793
                     }
-#line 793
                 }
-#line 793
                 if (var_rank[i] == 0 && i%2 )
-#line 793
                     err = nc_get_varm_long(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 793
                 else
-#line 793
                     err = nc_get_varm_long(ncid,i,index,count,stride,imap,value);
-#line 793
                 if (canConvert) {
-#line 793
                     if (allInExtRange) {
-#line 793
                         if (allInIntRange) {
-#line 793
                             IF (err)
-#line 793
                                 error("%s", nc_strerror(err));
-#line 793
                         } else {
-#line 793
                             IF (err != NC_ERANGE)
-#line 793
                                 error("Range error: status = %d", err);
-#line 793
                         }
-#line 793
                     } else {
-#line 793
                         IF (err != 0 && err != NC_ERANGE)
-#line 793
                             error("OK or Range error: status = %d", err);
-#line 793
                     }
-#line 793
                     for (j = 0; j < nels; j++) {
-#line 793
                         if (inRange3(expect[j],var_type[i],NCT_LONG)
-#line 793
                                 && expect[j] >= long_min 
-#line 793
 				&& expect[j] <= long_max) {
-#line 793
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_LONG)){
-#line 793
                                 error("value read not that expected");
-#line 793
                                 if (verbose) {
-#line 793
                                     error("\n");
-#line 793
                                     error("varid: %d, ", i);
-#line 793
                                     error("var_name: %s, ", var_name[i]);
-#line 793
                                     error("element number: %d ", j);
-#line 793
                                     error("expect: %g, ", expect[j]);
-#line 793
                                     error("got: %g", (double) value[j]);
-#line 793
                                 }
-#line 793
                             } else {
-#line 793
                                 nok++;
-#line 793
                             }
-#line 793
                         }
-#line 793
                     }
-#line 793
                 } else {
-#line 793
                     IF (nels > 0 && err != NC_ECHAR)
-#line 793
                         error("wrong type: status = %d", err);
-#line 793
                 }
-#line 793
             }
-#line 793
         }
-#line 793
     }
-#line 793
     err = nc_close(ncid);
-#line 793
     IF (err)
-#line 793
         error("nc_close: %s", nc_strerror(err));
-#line 793
     print_nok(nok);
-#line 793
 }
-#line 793
 
 void
-#line 794
 test_nc_get_varm_float(void)
-#line 794
 {
-#line 794
     int ncid;
-#line 794
     int d;
-#line 794
     int i;
-#line 794
     int j;
-#line 794
     int k;
-#line 794
     int m;
-#line 794
     int err;
-#line 794
     int allInExtRange;	/* all values within external range? */
-#line 794
     int allInIntRange;	/* all values within internal range? */
-#line 794
     int nels;
-#line 794
     int nslabs;
-#line 794
     int nstarts;        /* number of different starts */
-#line 794
     int nok = 0;      /* count of valid comparisons */
-#line 794
     size_t start[MAX_RANK];
-#line 794
     size_t edge[MAX_RANK];
-#line 794
     size_t index[MAX_RANK];
-#line 794
     size_t index2[MAX_RANK];
-#line 794
     size_t mid[MAX_RANK];
-#line 794
     size_t count[MAX_RANK];
-#line 794
     size_t sstride[MAX_RANK];
-#line 794
     ptrdiff_t stride[MAX_RANK];
-#line 794
     ptrdiff_t imap[MAX_RANK];
-#line 794
     int canConvert;     /* Both text or both numeric */
-#line 794
     float value[MAX_NELS];
-#line 794
     double expect[MAX_NELS];
-#line 794
 
-#line 794
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 794
     IF (err)
-#line 794
         error("nc_open: %s", nc_strerror(err));
-#line 794
     for (i = 0; i < NVARS; i++) {
-#line 794
         canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 794
         assert(var_rank[i] <= MAX_RANK);
-#line 794
         assert(var_nels[i] <= MAX_NELS);
-#line 794
         for (j = 0; j < var_rank[i]; j++) {
-#line 794
             start[j] = 0;
-#line 794
             edge[j] = 1;
-#line 794
             stride[j] = 1;
-#line 794
             imap[j] = 1;
-#line 794
         }
-#line 794
         err = nc_get_varm_float(BAD_ID, i, start, edge, stride, imap, value);
-#line 794
         IF (err != NC_EBADID)
-#line 794
             error("bad ncid: status = %d", err);
-#line 794
         err = nc_get_varm_float(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 794
         IF (err != NC_ENOTVAR)
-#line 794
             error("bad var id: status = %d", err);
-#line 794
         for (j = 0; j < var_rank[i]; j++) {
-#line 794
             start[j] = var_shape[i][j];
-#line 794
             err = nc_get_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 794
 	  if(!canConvert) {
-#line 794
 		IF (err != NC_ECHAR)
-#line 794
                	    error("conversion: status = %d", err);
-#line 794
 	  } else {
-#line 794
 	    IF (err != NC_EINVALCOORDS)
-#line 794
                 error("bad index: status = %d", err);
-#line 794
             start[j] = 0;
-#line 794
             edge[j] = var_shape[i][j] + 1;
-#line 794
             err = nc_get_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 794
             IF (err != NC_EEDGE)
-#line 794
                 error("bad edge: status = %d", err);
-#line 794
             edge[j] = 1;
-#line 794
             stride[j] = 0;
-#line 794
             err = nc_get_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 794
             IF (err != NC_ESTRIDE)
-#line 794
                 error("bad stride: status = %d", err);
-#line 794
             stride[j] = 1;
-#line 794
            }
-#line 794
         }
-#line 794
             /* Choose a random point dividing each dim into 2 parts */
-#line 794
             /* get 2^rank (nslabs) slabs so defined */
-#line 794
         nslabs = 1;
-#line 794
         for (j = 0; j < var_rank[i]; j++) {
-#line 794
             mid[j] = roll( var_shape[i][j] );
-#line 794
             nslabs *= 2;
-#line 794
         }
-#line 794
             /* bits of k determine whether to get lower or upper part of dim */
-#line 794
             /* choose random stride from 1 to edge */
-#line 794
         for (k = 0; k < nslabs; k++) {
-#line 794
             nstarts = 1;
-#line 794
             for (j = 0; j < var_rank[i]; j++) {
-#line 794
                 if ((k >> j) & 1) {
-#line 794
                     start[j] = 0;
-#line 794
                     edge[j] = mid[j];
-#line 794
                 }else{
-#line 794
                     start[j] = mid[j];
-#line 794
                     edge[j] = var_shape[i][j] - mid[j];
-#line 794
                 }
-#line 794
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 794
                 nstarts *= stride[j];
-#line 794
             }
-#line 794
             for (m = 0; m < nstarts; m++) {
-#line 794
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 794
                 IF (err)
-#line 794
                     error("error in toMixedBase");
-#line 794
                 nels = 1;
-#line 794
                 for (j = 0; j < var_rank[i]; j++) {
-#line 794
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 794
                     nels *= count[j];
-#line 794
                     index[j] += start[j];
-#line 794
                 }
-#line 794
 		    /* Random choice of forward or backward */
-#line 794
 /* TODO
-#line 794
 		if ( roll(2) ) {
-#line 794
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 794
 			index[j] += (count[j] - 1) * stride[j];
-#line 794
 			stride[j] = -stride[j];
-#line 794
 		    }
-#line 794
 		}
-#line 794
  */
-#line 794
 		if (var_rank[i] > 0) {
-#line 794
 		    j = var_rank[i] - 1;
-#line 794
 		    imap[j] = 1;
-#line 794
 		    for (; j > 0; j--)
-#line 794
 			imap[j-1] = imap[j] * count[j];
-#line 794
 		}
-#line 794
                 allInExtRange = allInIntRange = 1;
-#line 794
                 for (j = 0; j < nels; j++) {
-#line 794
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 794
                     IF (err)
-#line 794
                         error("error in toMixedBase 1");
-#line 794
                     for (d = 0; d < var_rank[i]; d++)
-#line 794
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 794
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 794
                         NCT_FLOAT);
-#line 794
                     if (inRange3(expect[j],var_type[i],NCT_FLOAT)) {
-#line 794
                         allInIntRange = allInIntRange && expect[j] >= float_min
-#line 794
                             && expect[j] <= float_max;
-#line 794
                     } else {
-#line 794
                         allInExtRange = 0;
-#line 794
                     }
-#line 794
                 }
-#line 794
                 if (var_rank[i] == 0 && i%2 )
-#line 794
                     err = nc_get_varm_float(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 794
                 else
-#line 794
                     err = nc_get_varm_float(ncid,i,index,count,stride,imap,value);
-#line 794
                 if (canConvert) {
-#line 794
                     if (allInExtRange) {
-#line 794
                         if (allInIntRange) {
-#line 794
                             IF (err)
-#line 794
                                 error("%s", nc_strerror(err));
-#line 794
                         } else {
-#line 794
                             IF (err != NC_ERANGE)
-#line 794
                                 error("Range error: status = %d", err);
-#line 794
                         }
-#line 794
                     } else {
-#line 794
                         IF (err != 0 && err != NC_ERANGE)
-#line 794
                             error("OK or Range error: status = %d", err);
-#line 794
                     }
-#line 794
                     for (j = 0; j < nels; j++) {
-#line 794
                         if (inRange3(expect[j],var_type[i],NCT_FLOAT)
-#line 794
                                 && expect[j] >= float_min 
-#line 794
 				&& expect[j] <= float_max) {
-#line 794
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_FLOAT)){
-#line 794
                                 error("value read not that expected");
-#line 794
                                 if (verbose) {
-#line 794
                                     error("\n");
-#line 794
                                     error("varid: %d, ", i);
-#line 794
                                     error("var_name: %s, ", var_name[i]);
-#line 794
                                     error("element number: %d ", j);
-#line 794
                                     error("expect: %g, ", expect[j]);
-#line 794
                                     error("got: %g", (double) value[j]);
-#line 794
                                 }
-#line 794
                             } else {
-#line 794
                                 nok++;
-#line 794
                             }
-#line 794
                         }
-#line 794
                     }
-#line 794
                 } else {
-#line 794
                     IF (nels > 0 && err != NC_ECHAR)
-#line 794
                         error("wrong type: status = %d", err);
-#line 794
                 }
-#line 794
             }
-#line 794
         }
-#line 794
     }
-#line 794
     err = nc_close(ncid);
-#line 794
     IF (err)
-#line 794
         error("nc_close: %s", nc_strerror(err));
-#line 794
     print_nok(nok);
-#line 794
 }
-#line 794
 
 void
-#line 795
 test_nc_get_varm_double(void)
-#line 795
 {
-#line 795
     int ncid;
-#line 795
     int d;
-#line 795
     int i;
-#line 795
     int j;
-#line 795
     int k;
-#line 795
     int m;
-#line 795
     int err;
-#line 795
     int allInExtRange;	/* all values within external range? */
-#line 795
     int allInIntRange;	/* all values within internal range? */
-#line 795
     int nels;
-#line 795
     int nslabs;
-#line 795
     int nstarts;        /* number of different starts */
-#line 795
     int nok = 0;      /* count of valid comparisons */
-#line 795
     size_t start[MAX_RANK];
-#line 795
     size_t edge[MAX_RANK];
-#line 795
     size_t index[MAX_RANK];
-#line 795
     size_t index2[MAX_RANK];
-#line 795
     size_t mid[MAX_RANK];
-#line 795
     size_t count[MAX_RANK];
-#line 795
     size_t sstride[MAX_RANK];
-#line 795
     ptrdiff_t stride[MAX_RANK];
-#line 795
     ptrdiff_t imap[MAX_RANK];
-#line 795
     int canConvert;     /* Both text or both numeric */
-#line 795
     double value[MAX_NELS];
-#line 795
     double expect[MAX_NELS];
-#line 795
 
-#line 795
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 795
     IF (err)
-#line 795
         error("nc_open: %s", nc_strerror(err));
-#line 795
     for (i = 0; i < NVARS; i++) {
-#line 795
         canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 795
         assert(var_rank[i] <= MAX_RANK);
-#line 795
         assert(var_nels[i] <= MAX_NELS);
-#line 795
         for (j = 0; j < var_rank[i]; j++) {
-#line 795
             start[j] = 0;
-#line 795
             edge[j] = 1;
-#line 795
             stride[j] = 1;
-#line 795
             imap[j] = 1;
-#line 795
         }
-#line 795
         err = nc_get_varm_double(BAD_ID, i, start, edge, stride, imap, value);
-#line 795
         IF (err != NC_EBADID)
-#line 795
             error("bad ncid: status = %d", err);
-#line 795
         err = nc_get_varm_double(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 795
         IF (err != NC_ENOTVAR)
-#line 795
             error("bad var id: status = %d", err);
-#line 795
         for (j = 0; j < var_rank[i]; j++) {
-#line 795
             start[j] = var_shape[i][j];
-#line 795
             err = nc_get_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 795
 	  if(!canConvert) {
-#line 795
 		IF (err != NC_ECHAR)
-#line 795
                	    error("conversion: status = %d", err);
-#line 795
 	  } else {
-#line 795
 	    IF (err != NC_EINVALCOORDS)
-#line 795
                 error("bad index: status = %d", err);
-#line 795
             start[j] = 0;
-#line 795
             edge[j] = var_shape[i][j] + 1;
-#line 795
             err = nc_get_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 795
             IF (err != NC_EEDGE)
-#line 795
                 error("bad edge: status = %d", err);
-#line 795
             edge[j] = 1;
-#line 795
             stride[j] = 0;
-#line 795
             err = nc_get_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 795
             IF (err != NC_ESTRIDE)
-#line 795
                 error("bad stride: status = %d", err);
-#line 795
             stride[j] = 1;
-#line 795
            }
-#line 795
         }
-#line 795
             /* Choose a random point dividing each dim into 2 parts */
-#line 795
             /* get 2^rank (nslabs) slabs so defined */
-#line 795
         nslabs = 1;
-#line 795
         for (j = 0; j < var_rank[i]; j++) {
-#line 795
             mid[j] = roll( var_shape[i][j] );
-#line 795
             nslabs *= 2;
-#line 795
         }
-#line 795
             /* bits of k determine whether to get lower or upper part of dim */
-#line 795
             /* choose random stride from 1 to edge */
-#line 795
         for (k = 0; k < nslabs; k++) {
-#line 795
             nstarts = 1;
-#line 795
             for (j = 0; j < var_rank[i]; j++) {
-#line 795
                 if ((k >> j) & 1) {
-#line 795
                     start[j] = 0;
-#line 795
                     edge[j] = mid[j];
-#line 795
                 }else{
-#line 795
                     start[j] = mid[j];
-#line 795
                     edge[j] = var_shape[i][j] - mid[j];
-#line 795
                 }
-#line 795
                 sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 795
                 nstarts *= stride[j];
-#line 795
             }
-#line 795
             for (m = 0; m < nstarts; m++) {
-#line 795
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 795
                 IF (err)
-#line 795
                     error("error in toMixedBase");
-#line 795
                 nels = 1;
-#line 795
                 for (j = 0; j < var_rank[i]; j++) {
-#line 795
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 795
                     nels *= count[j];
-#line 795
                     index[j] += start[j];
-#line 795
                 }
-#line 795
 		    /* Random choice of forward or backward */
-#line 795
 /* TODO
-#line 795
 		if ( roll(2) ) {
-#line 795
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 795
 			index[j] += (count[j] - 1) * stride[j];
-#line 795
 			stride[j] = -stride[j];
-#line 795
 		    }
-#line 795
 		}
-#line 795
  */
-#line 795
 		if (var_rank[i] > 0) {
-#line 795
 		    j = var_rank[i] - 1;
-#line 795
 		    imap[j] = 1;
-#line 795
 		    for (; j > 0; j--)
-#line 795
 			imap[j-1] = imap[j] * count[j];
-#line 795
 		}
-#line 795
                 allInExtRange = allInIntRange = 1;
-#line 795
                 for (j = 0; j < nels; j++) {
-#line 795
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 795
                     IF (err)
-#line 795
                         error("error in toMixedBase 1");
-#line 795
                     for (d = 0; d < var_rank[i]; d++)
-#line 795
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 795
                     expect[j] = hash4(var_type[i], var_rank[i], index2,
-#line 795
                         NCT_DOUBLE);
-#line 795
                     if (inRange3(expect[j],var_type[i],NCT_DOUBLE)) {
-#line 795
                         allInIntRange = allInIntRange && expect[j] >= double_min
-#line 795
                             && expect[j] <= double_max;
-#line 795
                     } else {
-#line 795
                         allInExtRange = 0;
-#line 795
                     }
-#line 795
                 }
-#line 795
                 if (var_rank[i] == 0 && i%2 )
-#line 795
                     err = nc_get_varm_double(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 795
                 else
-#line 795
                     err = nc_get_varm_double(ncid,i,index,count,stride,imap,value);
-#line 795
                 if (canConvert) {
-#line 795
                     if (allInExtRange) {
-#line 795
                         if (allInIntRange) {
-#line 795
                             IF (err)
-#line 795
                                 error("%s", nc_strerror(err));
-#line 795
                         } else {
-#line 795
                             IF (err != NC_ERANGE)
-#line 795
                                 error("Range error: status = %d", err);
-#line 795
                         }
-#line 795
                     } else {
-#line 795
                         IF (err != 0 && err != NC_ERANGE)
-#line 795
                             error("OK or Range error: status = %d", err);
-#line 795
                     }
-#line 795
                     for (j = 0; j < nels; j++) {
-#line 795
                         if (inRange3(expect[j],var_type[i],NCT_DOUBLE)
-#line 795
                                 && expect[j] >= double_min 
-#line 795
 				&& expect[j] <= double_max) {
-#line 795
 			    IF (!equal(value[j],expect[j],var_type[i], NCT_DOUBLE)){
-#line 795
                                 error("value read not that expected");
-#line 795
                                 if (verbose) {
-#line 795
                                     error("\n");
-#line 795
                                     error("varid: %d, ", i);
-#line 795
                                     error("var_name: %s, ", var_name[i]);
-#line 795
                                     error("element number: %d ", j);
-#line 795
                                     error("expect: %g, ", expect[j]);
-#line 795
                                     error("got: %g", (double) value[j]);
-#line 795
                                 }
-#line 795
                             } else {
-#line 795
                                 nok++;
-#line 795
                             }
-#line 795
                         }
-#line 795
                     }
-#line 795
                 } else {
-#line 795
                     IF (nels > 0 && err != NC_ECHAR)
-#line 795
                         error("wrong type: status = %d", err);
-#line 795
                 }
-#line 795
             }
-#line 795
         }
-#line 795
     }
-#line 795
     err = nc_close(ncid);
-#line 795
     IF (err)
-#line 795
         error("nc_close: %s", nc_strerror(err));
-#line 795
     print_nok(nok);
-#line 795
 }
-#line 795
 
 
 
-#line 888
 
 void
-#line 889
 test_nc_get_att_text(void)
-#line 889
 {
-#line 889
     int ncid;
-#line 889
     int i;
-#line 889
     int j;
-#line 889
     size_t k;
-#line 889
     int err;
-#line 889
     int allInExtRange;
-#line 889
     int allInIntRange;
-#line 889
     int canConvert;     /* Both text or both numeric */
-#line 889
     text value[MAX_NELS];
-#line 889
     double expect[MAX_NELS];
-#line 889
     int nok = 0;      /* count of valid comparisons */
-#line 889
 
-#line 889
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 889
     IF (err) 
-#line 889
 	error("nc_open: %s", nc_strerror(err));
-#line 889
 
-#line 889
     for (i = -1; i < NVARS; i++) {
-#line 889
         for (j = 0; j < NATTS(i); j++) {
-#line 889
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 889
 	    err = nc_get_att_text(BAD_ID, i, ATT_NAME(i,j), value);
-#line 889
 	    IF (err != NC_EBADID) 
-#line 889
 		error("bad ncid: status = %d", err);
-#line 889
 	    err = nc_get_att_text(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 889
 	    IF (err != NC_ENOTVAR) 
-#line 889
 		error("bad var id: status = %d", err);
-#line 889
 	    err = nc_get_att_text(ncid, i, "noSuch", value);
-#line 889
 	    IF (err != NC_ENOTATT) 
-#line 889
 		error("Bad attribute name: status = %d", err);
-#line 889
 	    allInExtRange = allInIntRange = 1;
-#line 889
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 889
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_TEXT);
-#line 889
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_TEXT)) {
-#line 889
                     allInIntRange = allInIntRange && expect[k] >= text_min
-#line 889
                                 && expect[k] <= text_max;
-#line 889
                 } else {
-#line 889
                     allInExtRange = 0;
-#line 889
                 }
-#line 889
 	    }
-#line 889
 	    err = nc_get_att_text(ncid, i, ATT_NAME(i,j), value);
-#line 889
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 889
                 if (allInExtRange) {
-#line 889
                     if (allInIntRange) {
-#line 889
                         IF (err)
-#line 889
                             error("%s", nc_strerror(err));
-#line 889
                     } else {
-#line 889
                         IF (err != NC_ERANGE)
-#line 889
                             error("Range error: status = %d", err);
-#line 889
                     }
-#line 889
                 } else {
-#line 889
                     IF (err != 0 && err != NC_ERANGE)
-#line 889
                         error("OK or Range error: status = %d", err);
-#line 889
                 }
-#line 889
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 889
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_TEXT)
-#line 889
                             && expect[k] >= text_min && expect[k] <= text_max) {
-#line 889
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_TEXT)){
-#line 889
 			    error("value read not that expected");
-#line 889
                             if (verbose) {
-#line 889
                                 error("\n");
-#line 889
                                 error("varid: %d, ", i);
-#line 889
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 889
                                 error("element number: %d ", k);
-#line 889
                                 error("expect: %g", expect[k]);
-#line 889
                                 error("got: %g", (double) value[k]);
-#line 889
                             }
-#line 889
 			} else {
-#line 889
 			    nok++;
-#line 889
                         }
-#line 889
 		    }
-#line 889
 		}
-#line 889
 	    } else {
-#line 889
 		IF (err != NC_ECHAR)
-#line 889
 		    error("wrong type: status = %d", err);
-#line 889
 	    }
-#line 889
 	}
-#line 889
     }
-#line 889
 
-#line 889
     err = nc_close(ncid);
-#line 889
     IF (err)
-#line 889
 	error("nc_close: %s", nc_strerror(err));
-#line 889
     print_nok(nok);
-#line 889
 }
-#line 889
 
 void
-#line 890
 test_nc_get_att_uchar(void)
-#line 890
 {
-#line 890
     int ncid;
-#line 890
     int i;
-#line 890
     int j;
-#line 890
     size_t k;
-#line 890
     int err;
-#line 890
     int allInExtRange;
-#line 890
     int allInIntRange;
-#line 890
     int canConvert;     /* Both text or both numeric */
-#line 890
     uchar value[MAX_NELS];
-#line 890
     double expect[MAX_NELS];
-#line 890
     int nok = 0;      /* count of valid comparisons */
-#line 890
 
-#line 890
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 890
     IF (err) 
-#line 890
 	error("nc_open: %s", nc_strerror(err));
-#line 890
 
-#line 890
     for (i = -1; i < NVARS; i++) {
-#line 890
         for (j = 0; j < NATTS(i); j++) {
-#line 890
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 890
 	    err = nc_get_att_uchar(BAD_ID, i, ATT_NAME(i,j), value);
-#line 890
 	    IF (err != NC_EBADID) 
-#line 890
 		error("bad ncid: status = %d", err);
-#line 890
 	    err = nc_get_att_uchar(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 890
 	    IF (err != NC_ENOTVAR) 
-#line 890
 		error("bad var id: status = %d", err);
-#line 890
 	    err = nc_get_att_uchar(ncid, i, "noSuch", value);
-#line 890
 	    IF (err != NC_ENOTATT) 
-#line 890
 		error("Bad attribute name: status = %d", err);
-#line 890
 	    allInExtRange = allInIntRange = 1;
-#line 890
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 890
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_UCHAR);
-#line 890
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_UCHAR)) {
-#line 890
                     allInIntRange = allInIntRange && expect[k] >= uchar_min
-#line 890
                                 && expect[k] <= uchar_max;
-#line 890
                 } else {
-#line 890
                     allInExtRange = 0;
-#line 890
                 }
-#line 890
 	    }
-#line 890
 	    err = nc_get_att_uchar(ncid, i, ATT_NAME(i,j), value);
-#line 890
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 890
                 if (allInExtRange) {
-#line 890
                     if (allInIntRange) {
-#line 890
                         IF (err)
-#line 890
                             error("%s", nc_strerror(err));
-#line 890
                     } else {
-#line 890
                         IF (err != NC_ERANGE)
-#line 890
                             error("Range error: status = %d", err);
-#line 890
                     }
-#line 890
                 } else {
-#line 890
                     IF (err != 0 && err != NC_ERANGE)
-#line 890
                         error("OK or Range error: status = %d", err);
-#line 890
                 }
-#line 890
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 890
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_UCHAR)
-#line 890
                             && expect[k] >= uchar_min && expect[k] <= uchar_max) {
-#line 890
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_UCHAR)){
-#line 890
 			    error("value read not that expected");
-#line 890
                             if (verbose) {
-#line 890
                                 error("\n");
-#line 890
                                 error("varid: %d, ", i);
-#line 890
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 890
                                 error("element number: %d ", k);
-#line 890
                                 error("expect: %g", expect[k]);
-#line 890
                                 error("got: %g", (double) value[k]);
-#line 890
                             }
-#line 890
 			} else {
-#line 890
 			    nok++;
-#line 890
                         }
-#line 890
 		    }
-#line 890
 		}
-#line 890
 	    } else {
-#line 890
 		IF (err != NC_ECHAR)
-#line 890
 		    error("wrong type: status = %d", err);
-#line 890
 	    }
-#line 890
 	}
-#line 890
     }
-#line 890
 
-#line 890
     err = nc_close(ncid);
-#line 890
     IF (err)
-#line 890
 	error("nc_close: %s", nc_strerror(err));
-#line 890
     print_nok(nok);
-#line 890
 }
-#line 890
 
 void
-#line 891
 test_nc_get_att_schar(void)
-#line 891
 {
-#line 891
     int ncid;
-#line 891
     int i;
-#line 891
     int j;
-#line 891
     size_t k;
-#line 891
     int err;
-#line 891
     int allInExtRange;
-#line 891
     int allInIntRange;
-#line 891
     int canConvert;     /* Both text or both numeric */
-#line 891
     schar value[MAX_NELS];
-#line 891
     double expect[MAX_NELS];
-#line 891
     int nok = 0;      /* count of valid comparisons */
-#line 891
 
-#line 891
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 891
     IF (err) 
-#line 891
 	error("nc_open: %s", nc_strerror(err));
-#line 891
 
-#line 891
     for (i = -1; i < NVARS; i++) {
-#line 891
         for (j = 0; j < NATTS(i); j++) {
-#line 891
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 891
 	    err = nc_get_att_schar(BAD_ID, i, ATT_NAME(i,j), value);
-#line 891
 	    IF (err != NC_EBADID) 
-#line 891
 		error("bad ncid: status = %d", err);
-#line 891
 	    err = nc_get_att_schar(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 891
 	    IF (err != NC_ENOTVAR) 
-#line 891
 		error("bad var id: status = %d", err);
-#line 891
 	    err = nc_get_att_schar(ncid, i, "noSuch", value);
-#line 891
 	    IF (err != NC_ENOTATT) 
-#line 891
 		error("Bad attribute name: status = %d", err);
-#line 891
 	    allInExtRange = allInIntRange = 1;
-#line 891
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 891
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_SCHAR);
-#line 891
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_SCHAR)) {
-#line 891
                     allInIntRange = allInIntRange && expect[k] >= schar_min
-#line 891
                                 && expect[k] <= schar_max;
-#line 891
                 } else {
-#line 891
                     allInExtRange = 0;
-#line 891
                 }
-#line 891
 	    }
-#line 891
 	    err = nc_get_att_schar(ncid, i, ATT_NAME(i,j), value);
-#line 891
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 891
                 if (allInExtRange) {
-#line 891
                     if (allInIntRange) {
-#line 891
                         IF (err)
-#line 891
                             error("%s", nc_strerror(err));
-#line 891
                     } else {
-#line 891
                         IF (err != NC_ERANGE)
-#line 891
                             error("Range error: status = %d", err);
-#line 891
                     }
-#line 891
                 } else {
-#line 891
                     IF (err != 0 && err != NC_ERANGE)
-#line 891
                         error("OK or Range error: status = %d", err);
-#line 891
                 }
-#line 891
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 891
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_SCHAR)
-#line 891
                             && expect[k] >= schar_min && expect[k] <= schar_max) {
-#line 891
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_SCHAR)){
-#line 891
 			    error("value read not that expected");
-#line 891
                             if (verbose) {
-#line 891
                                 error("\n");
-#line 891
                                 error("varid: %d, ", i);
-#line 891
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 891
                                 error("element number: %d ", k);
-#line 891
                                 error("expect: %g", expect[k]);
-#line 891
                                 error("got: %g", (double) value[k]);
-#line 891
                             }
-#line 891
 			} else {
-#line 891
 			    nok++;
-#line 891
                         }
-#line 891
 		    }
-#line 891
 		}
-#line 891
 	    } else {
-#line 891
 		IF (err != NC_ECHAR)
-#line 891
 		    error("wrong type: status = %d", err);
-#line 891
 	    }
-#line 891
 	}
-#line 891
     }
-#line 891
 
-#line 891
     err = nc_close(ncid);
-#line 891
     IF (err)
-#line 891
 	error("nc_close: %s", nc_strerror(err));
-#line 891
     print_nok(nok);
-#line 891
 }
-#line 891
 
 void
-#line 892
 test_nc_get_att_short(void)
-#line 892
 {
-#line 892
     int ncid;
-#line 892
     int i;
-#line 892
     int j;
-#line 892
     size_t k;
-#line 892
     int err;
-#line 892
     int allInExtRange;
-#line 892
     int allInIntRange;
-#line 892
     int canConvert;     /* Both text or both numeric */
-#line 892
     short value[MAX_NELS];
-#line 892
     double expect[MAX_NELS];
-#line 892
     int nok = 0;      /* count of valid comparisons */
-#line 892
 
-#line 892
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 892
     IF (err) 
-#line 892
 	error("nc_open: %s", nc_strerror(err));
-#line 892
 
-#line 892
     for (i = -1; i < NVARS; i++) {
-#line 892
         for (j = 0; j < NATTS(i); j++) {
-#line 892
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 892
 	    err = nc_get_att_short(BAD_ID, i, ATT_NAME(i,j), value);
-#line 892
 	    IF (err != NC_EBADID) 
-#line 892
 		error("bad ncid: status = %d", err);
-#line 892
 	    err = nc_get_att_short(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 892
 	    IF (err != NC_ENOTVAR) 
-#line 892
 		error("bad var id: status = %d", err);
-#line 892
 	    err = nc_get_att_short(ncid, i, "noSuch", value);
-#line 892
 	    IF (err != NC_ENOTATT) 
-#line 892
 		error("Bad attribute name: status = %d", err);
-#line 892
 	    allInExtRange = allInIntRange = 1;
-#line 892
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 892
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_SHORT);
-#line 892
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_SHORT)) {
-#line 892
                     allInIntRange = allInIntRange && expect[k] >= short_min
-#line 892
                                 && expect[k] <= short_max;
-#line 892
                 } else {
-#line 892
                     allInExtRange = 0;
-#line 892
                 }
-#line 892
 	    }
-#line 892
 	    err = nc_get_att_short(ncid, i, ATT_NAME(i,j), value);
-#line 892
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 892
                 if (allInExtRange) {
-#line 892
                     if (allInIntRange) {
-#line 892
                         IF (err)
-#line 892
                             error("%s", nc_strerror(err));
-#line 892
                     } else {
-#line 892
                         IF (err != NC_ERANGE)
-#line 892
                             error("Range error: status = %d", err);
-#line 892
                     }
-#line 892
                 } else {
-#line 892
                     IF (err != 0 && err != NC_ERANGE)
-#line 892
                         error("OK or Range error: status = %d", err);
-#line 892
                 }
-#line 892
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 892
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_SHORT)
-#line 892
                             && expect[k] >= short_min && expect[k] <= short_max) {
-#line 892
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_SHORT)){
-#line 892
 			    error("value read not that expected");
-#line 892
                             if (verbose) {
-#line 892
                                 error("\n");
-#line 892
                                 error("varid: %d, ", i);
-#line 892
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 892
                                 error("element number: %d ", k);
-#line 892
                                 error("expect: %g", expect[k]);
-#line 892
                                 error("got: %g", (double) value[k]);
-#line 892
                             }
-#line 892
 			} else {
-#line 892
 			    nok++;
-#line 892
                         }
-#line 892
 		    }
-#line 892
 		}
-#line 892
 	    } else {
-#line 892
 		IF (err != NC_ECHAR)
-#line 892
 		    error("wrong type: status = %d", err);
-#line 892
 	    }
-#line 892
 	}
-#line 892
     }
-#line 892
 
-#line 892
     err = nc_close(ncid);
-#line 892
     IF (err)
-#line 892
 	error("nc_close: %s", nc_strerror(err));
-#line 892
     print_nok(nok);
-#line 892
 }
-#line 892
 
 void
-#line 893
 test_nc_get_att_int(void)
-#line 893
 {
-#line 893
     int ncid;
-#line 893
     int i;
-#line 893
     int j;
-#line 893
     size_t k;
-#line 893
     int err;
-#line 893
     int allInExtRange;
-#line 893
     int allInIntRange;
-#line 893
     int canConvert;     /* Both text or both numeric */
-#line 893
     int value[MAX_NELS];
-#line 893
     double expect[MAX_NELS];
-#line 893
     int nok = 0;      /* count of valid comparisons */
-#line 893
 
-#line 893
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 893
     IF (err) 
-#line 893
 	error("nc_open: %s", nc_strerror(err));
-#line 893
 
-#line 893
     for (i = -1; i < NVARS; i++) {
-#line 893
         for (j = 0; j < NATTS(i); j++) {
-#line 893
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 893
 	    err = nc_get_att_int(BAD_ID, i, ATT_NAME(i,j), value);
-#line 893
 	    IF (err != NC_EBADID) 
-#line 893
 		error("bad ncid: status = %d", err);
-#line 893
 	    err = nc_get_att_int(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 893
 	    IF (err != NC_ENOTVAR) 
-#line 893
 		error("bad var id: status = %d", err);
-#line 893
 	    err = nc_get_att_int(ncid, i, "noSuch", value);
-#line 893
 	    IF (err != NC_ENOTATT) 
-#line 893
 		error("Bad attribute name: status = %d", err);
-#line 893
 	    allInExtRange = allInIntRange = 1;
-#line 893
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 893
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_INT);
-#line 893
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_INT)) {
-#line 893
                     allInIntRange = allInIntRange && expect[k] >= int_min
-#line 893
                                 && expect[k] <= int_max;
-#line 893
                 } else {
-#line 893
                     allInExtRange = 0;
-#line 893
                 }
-#line 893
 	    }
-#line 893
 	    err = nc_get_att_int(ncid, i, ATT_NAME(i,j), value);
-#line 893
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 893
                 if (allInExtRange) {
-#line 893
                     if (allInIntRange) {
-#line 893
                         IF (err)
-#line 893
                             error("%s", nc_strerror(err));
-#line 893
                     } else {
-#line 893
                         IF (err != NC_ERANGE)
-#line 893
                             error("Range error: status = %d", err);
-#line 893
                     }
-#line 893
                 } else {
-#line 893
                     IF (err != 0 && err != NC_ERANGE)
-#line 893
                         error("OK or Range error: status = %d", err);
-#line 893
                 }
-#line 893
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 893
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_INT)
-#line 893
                             && expect[k] >= int_min && expect[k] <= int_max) {
-#line 893
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_INT)){
-#line 893
 			    error("value read not that expected");
-#line 893
                             if (verbose) {
-#line 893
                                 error("\n");
-#line 893
                                 error("varid: %d, ", i);
-#line 893
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 893
                                 error("element number: %d ", k);
-#line 893
                                 error("expect: %g", expect[k]);
-#line 893
                                 error("got: %g", (double) value[k]);
-#line 893
                             }
-#line 893
 			} else {
-#line 893
 			    nok++;
-#line 893
                         }
-#line 893
 		    }
-#line 893
 		}
-#line 893
 	    } else {
-#line 893
 		IF (err != NC_ECHAR)
-#line 893
 		    error("wrong type: status = %d", err);
-#line 893
 	    }
-#line 893
 	}
-#line 893
     }
-#line 893
 
-#line 893
     err = nc_close(ncid);
-#line 893
     IF (err)
-#line 893
 	error("nc_close: %s", nc_strerror(err));
-#line 893
     print_nok(nok);
-#line 893
 }
-#line 893
 
 void
-#line 894
 test_nc_get_att_long(void)
-#line 894
 {
-#line 894
     int ncid;
-#line 894
     int i;
-#line 894
     int j;
-#line 894
     size_t k;
-#line 894
     int err;
-#line 894
     int allInExtRange;
-#line 894
     int allInIntRange;
-#line 894
     int canConvert;     /* Both text or both numeric */
-#line 894
     long value[MAX_NELS];
-#line 894
     double expect[MAX_NELS];
-#line 894
     int nok = 0;      /* count of valid comparisons */
-#line 894
 
-#line 894
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 894
     IF (err) 
-#line 894
 	error("nc_open: %s", nc_strerror(err));
-#line 894
 
-#line 894
     for (i = -1; i < NVARS; i++) {
-#line 894
         for (j = 0; j < NATTS(i); j++) {
-#line 894
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 894
 	    err = nc_get_att_long(BAD_ID, i, ATT_NAME(i,j), value);
-#line 894
 	    IF (err != NC_EBADID) 
-#line 894
 		error("bad ncid: status = %d", err);
-#line 894
 	    err = nc_get_att_long(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 894
 	    IF (err != NC_ENOTVAR) 
-#line 894
 		error("bad var id: status = %d", err);
-#line 894
 	    err = nc_get_att_long(ncid, i, "noSuch", value);
-#line 894
 	    IF (err != NC_ENOTATT) 
-#line 894
 		error("Bad attribute name: status = %d", err);
-#line 894
 	    allInExtRange = allInIntRange = 1;
-#line 894
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 894
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_LONG);
-#line 894
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_LONG)) {
-#line 894
                     allInIntRange = allInIntRange && expect[k] >= long_min
-#line 894
                                 && expect[k] <= long_max;
-#line 894
                 } else {
-#line 894
                     allInExtRange = 0;
-#line 894
                 }
-#line 894
 	    }
-#line 894
 	    err = nc_get_att_long(ncid, i, ATT_NAME(i,j), value);
-#line 894
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 894
                 if (allInExtRange) {
-#line 894
                     if (allInIntRange) {
-#line 894
                         IF (err)
-#line 894
                             error("%s", nc_strerror(err));
-#line 894
                     } else {
-#line 894
                         IF (err != NC_ERANGE)
-#line 894
                             error("Range error: status = %d", err);
-#line 894
                     }
-#line 894
                 } else {
-#line 894
                     IF (err != 0 && err != NC_ERANGE)
-#line 894
                         error("OK or Range error: status = %d", err);
-#line 894
                 }
-#line 894
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 894
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_LONG)
-#line 894
                             && expect[k] >= long_min && expect[k] <= long_max) {
-#line 894
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_LONG)){
-#line 894
 			    error("value read not that expected");
-#line 894
                             if (verbose) {
-#line 894
                                 error("\n");
-#line 894
                                 error("varid: %d, ", i);
-#line 894
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 894
                                 error("element number: %d ", k);
-#line 894
                                 error("expect: %g", expect[k]);
-#line 894
                                 error("got: %g", (double) value[k]);
-#line 894
                             }
-#line 894
 			} else {
-#line 894
 			    nok++;
-#line 894
                         }
-#line 894
 		    }
-#line 894
 		}
-#line 894
 	    } else {
-#line 894
 		IF (err != NC_ECHAR)
-#line 894
 		    error("wrong type: status = %d", err);
-#line 894
 	    }
-#line 894
 	}
-#line 894
     }
-#line 894
 
-#line 894
     err = nc_close(ncid);
-#line 894
     IF (err)
-#line 894
 	error("nc_close: %s", nc_strerror(err));
-#line 894
     print_nok(nok);
-#line 894
 }
-#line 894
 
 void
-#line 895
 test_nc_get_att_float(void)
-#line 895
 {
-#line 895
     int ncid;
-#line 895
     int i;
-#line 895
     int j;
-#line 895
     size_t k;
-#line 895
     int err;
-#line 895
     int allInExtRange;
-#line 895
     int allInIntRange;
-#line 895
     int canConvert;     /* Both text or both numeric */
-#line 895
     float value[MAX_NELS];
-#line 895
     double expect[MAX_NELS];
-#line 895
     int nok = 0;      /* count of valid comparisons */
-#line 895
 
-#line 895
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 895
     IF (err) 
-#line 895
 	error("nc_open: %s", nc_strerror(err));
-#line 895
 
-#line 895
     for (i = -1; i < NVARS; i++) {
-#line 895
         for (j = 0; j < NATTS(i); j++) {
-#line 895
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 895
 	    err = nc_get_att_float(BAD_ID, i, ATT_NAME(i,j), value);
-#line 895
 	    IF (err != NC_EBADID) 
-#line 895
 		error("bad ncid: status = %d", err);
-#line 895
 	    err = nc_get_att_float(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 895
 	    IF (err != NC_ENOTVAR) 
-#line 895
 		error("bad var id: status = %d", err);
-#line 895
 	    err = nc_get_att_float(ncid, i, "noSuch", value);
-#line 895
 	    IF (err != NC_ENOTATT) 
-#line 895
 		error("Bad attribute name: status = %d", err);
-#line 895
 	    allInExtRange = allInIntRange = 1;
-#line 895
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 895
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_FLOAT);
-#line 895
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_FLOAT)) {
-#line 895
                     allInIntRange = allInIntRange && expect[k] >= float_min
-#line 895
                                 && expect[k] <= float_max;
-#line 895
                 } else {
-#line 895
                     allInExtRange = 0;
-#line 895
                 }
-#line 895
 	    }
-#line 895
 	    err = nc_get_att_float(ncid, i, ATT_NAME(i,j), value);
-#line 895
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 895
                 if (allInExtRange) {
-#line 895
                     if (allInIntRange) {
-#line 895
                         IF (err)
-#line 895
                             error("%s", nc_strerror(err));
-#line 895
                     } else {
-#line 895
                         IF (err != NC_ERANGE)
-#line 895
                             error("Range error: status = %d", err);
-#line 895
                     }
-#line 895
                 } else {
-#line 895
                     IF (err != 0 && err != NC_ERANGE)
-#line 895
                         error("OK or Range error: status = %d", err);
-#line 895
                 }
-#line 895
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 895
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_FLOAT)
-#line 895
                             && expect[k] >= float_min && expect[k] <= float_max) {
-#line 895
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_FLOAT)){
-#line 895
 			    error("value read not that expected");
-#line 895
                             if (verbose) {
-#line 895
                                 error("\n");
-#line 895
                                 error("varid: %d, ", i);
-#line 895
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 895
                                 error("element number: %d ", k);
-#line 895
                                 error("expect: %g", expect[k]);
-#line 895
                                 error("got: %g", (double) value[k]);
-#line 895
                             }
-#line 895
 			} else {
-#line 895
 			    nok++;
-#line 895
                         }
-#line 895
 		    }
-#line 895
 		}
-#line 895
 	    } else {
-#line 895
 		IF (err != NC_ECHAR)
-#line 895
 		    error("wrong type: status = %d", err);
-#line 895
 	    }
-#line 895
 	}
-#line 895
     }
-#line 895
 
-#line 895
     err = nc_close(ncid);
-#line 895
     IF (err)
-#line 895
 	error("nc_close: %s", nc_strerror(err));
-#line 895
     print_nok(nok);
-#line 895
 }
-#line 895
 
 void
-#line 896
 test_nc_get_att_double(void)
-#line 896
 {
-#line 896
     int ncid;
-#line 896
     int i;
-#line 896
     int j;
-#line 896
     size_t k;
-#line 896
     int err;
-#line 896
     int allInExtRange;
-#line 896
     int allInIntRange;
-#line 896
     int canConvert;     /* Both text or both numeric */
-#line 896
     double value[MAX_NELS];
-#line 896
     double expect[MAX_NELS];
-#line 896
     int nok = 0;      /* count of valid comparisons */
-#line 896
 
-#line 896
     err = nc_open(testfile, NC_NOWRITE, &ncid);
-#line 896
     IF (err) 
-#line 896
 	error("nc_open: %s", nc_strerror(err));
-#line 896
 
-#line 896
     for (i = -1; i < NVARS; i++) {
-#line 896
         for (j = 0; j < NATTS(i); j++) {
-#line 896
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 896
 	    err = nc_get_att_double(BAD_ID, i, ATT_NAME(i,j), value);
-#line 896
 	    IF (err != NC_EBADID) 
-#line 896
 		error("bad ncid: status = %d", err);
-#line 896
 	    err = nc_get_att_double(ncid, BAD_VARID, ATT_NAME(i,j), value);
-#line 896
 	    IF (err != NC_ENOTVAR) 
-#line 896
 		error("bad var id: status = %d", err);
-#line 896
 	    err = nc_get_att_double(ncid, i, "noSuch", value);
-#line 896
 	    IF (err != NC_ENOTATT) 
-#line 896
 		error("Bad attribute name: status = %d", err);
-#line 896
 	    allInExtRange = allInIntRange = 1;
-#line 896
             for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 896
 		expect[k] = hash4(ATT_TYPE(i,j), -1, &k, NCT_DOUBLE);
-#line 896
                 if (inRange3(expect[k],ATT_TYPE(i,j),NCT_DOUBLE)) {
-#line 896
                     allInIntRange = allInIntRange && expect[k] >= double_min
-#line 896
                                 && expect[k] <= double_max;
-#line 896
                 } else {
-#line 896
                     allInExtRange = 0;
-#line 896
                 }
-#line 896
 	    }
-#line 896
 	    err = nc_get_att_double(ncid, i, ATT_NAME(i,j), value);
-#line 896
             if (canConvert || ATT_LEN(i,j) == 0) {
-#line 896
                 if (allInExtRange) {
-#line 896
                     if (allInIntRange) {
-#line 896
                         IF (err)
-#line 896
                             error("%s", nc_strerror(err));
-#line 896
                     } else {
-#line 896
                         IF (err != NC_ERANGE)
-#line 896
                             error("Range error: status = %d", err);
-#line 896
                     }
-#line 896
                 } else {
-#line 896
                     IF (err != 0 && err != NC_ERANGE)
-#line 896
                         error("OK or Range error: status = %d", err);
-#line 896
                 }
-#line 896
 		for (k = 0; k < ATT_LEN(i,j); k++) {
-#line 896
 		    if (inRange3(expect[k],ATT_TYPE(i,j),NCT_DOUBLE)
-#line 896
                             && expect[k] >= double_min && expect[k] <= double_max) {
-#line 896
 			IF (!equal(value[k],expect[k],ATT_TYPE(i,j), NCT_DOUBLE)){
-#line 896
 			    error("value read not that expected");
-#line 896
                             if (verbose) {
-#line 896
                                 error("\n");
-#line 896
                                 error("varid: %d, ", i);
-#line 896
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 896
                                 error("element number: %d ", k);
-#line 896
                                 error("expect: %g", expect[k]);
-#line 896
                                 error("got: %g", (double) value[k]);
-#line 896
                             }
-#line 896
 			} else {
-#line 896
 			    nok++;
-#line 896
                         }
-#line 896
 		    }
-#line 896
 		}
-#line 896
 	    } else {
-#line 896
 		IF (err != NC_ECHAR)
-#line 896
 		    error("wrong type: status = %d", err);
-#line 896
 	    }
-#line 896
 	}
-#line 896
     }
-#line 896
 
-#line 896
     err = nc_close(ncid);
-#line 896
     IF (err)
-#line 896
 	error("nc_close: %s", nc_strerror(err));
-#line 896
     print_nok(nok);
-#line 896
 }
-#line 896
 
 
diff --git a/nc_test/test_put.c b/nc_test/test_put.c
index a40e3be..d24cc12 100644
--- a/nc_test/test_put.c
+++ b/nc_test/test_put.c
@@ -1,13629 +1,6858 @@
-#line 5 "../../nc_test/test_put.m4"
 /* Do not edit this file. It is produced from the corresponding .m4 source */
-#line 7
 /*********************************************************************
  *   Copyright 1996, UCAR/Unidata
  *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
  *   $Id: test_put.m4,v 1.25 2005/03/08 03:04:19 ed Exp $
  *********************************************************************/
 
-#line 31
 
 #include "tests.h"
 
-#line 55
 
 /*
-#line 56
  *  ensure hash value within range for internal TYPE
-#line 56
  */
-#line 56
 static
-#line 56
 double
-#line 56
 hash_text(
-#line 56
     const nc_type type,
-#line 56
     const int rank,
-#line 56
     const size_t *index,
-#line 56
     const nct_itype itype)
-#line 56
 {
-#line 56
     const double min = text_min;
-#line 56
     const double max = text_max;
-#line 56
 
-#line 56
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 56
 }
-#line 56
 
 /*
-#line 57
  *  ensure hash value within range for internal TYPE
-#line 57
  */
-#line 57
 static
-#line 57
 double
-#line 57
 hash_uchar(
-#line 57
     const nc_type type,
-#line 57
     const int rank,
-#line 57
     const size_t *index,
-#line 57
     const nct_itype itype)
-#line 57
 {
-#line 57
     const double min = uchar_min;
-#line 57
     const double max = uchar_max;
-#line 57
 
-#line 57
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 57
 }
-#line 57
 
 /*
-#line 58
  *  ensure hash value within range for internal TYPE
-#line 58
  */
-#line 58
 static
-#line 58
 double
-#line 58
 hash_schar(
-#line 58
     const nc_type type,
-#line 58
     const int rank,
-#line 58
     const size_t *index,
-#line 58
     const nct_itype itype)
-#line 58
 {
-#line 58
     const double min = schar_min;
-#line 58
     const double max = schar_max;
-#line 58
 
-#line 58
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 58
 }
-#line 58
 
 /*
-#line 59
  *  ensure hash value within range for internal TYPE
-#line 59
  */
-#line 59
 static
-#line 59
 double
-#line 59
 hash_short(
-#line 59
     const nc_type type,
-#line 59
     const int rank,
-#line 59
     const size_t *index,
-#line 59
     const nct_itype itype)
-#line 59
 {
-#line 59
     const double min = short_min;
-#line 59
     const double max = short_max;
-#line 59
 
-#line 59
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 59
 }
-#line 59
 
 /*
-#line 60
  *  ensure hash value within range for internal TYPE
-#line 60
  */
-#line 60
 static
-#line 60
 double
-#line 60
 hash_int(
-#line 60
     const nc_type type,
-#line 60
     const int rank,
-#line 60
     const size_t *index,
-#line 60
     const nct_itype itype)
-#line 60
 {
-#line 60
     const double min = int_min;
-#line 60
     const double max = int_max;
-#line 60
 
-#line 60
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 60
 }
-#line 60
 
 /*
-#line 61
  *  ensure hash value within range for internal TYPE
-#line 61
  */
-#line 61
 static
-#line 61
 double
-#line 61
 hash_long(
-#line 61
     const nc_type type,
-#line 61
     const int rank,
-#line 61
     const size_t *index,
-#line 61
     const nct_itype itype)
-#line 61
 {
-#line 61
     const double min = long_min;
-#line 61
     const double max = long_max;
-#line 61
 
-#line 61
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 61
 }
-#line 61
 
 /*
-#line 62
  *  ensure hash value within range for internal TYPE
-#line 62
  */
-#line 62
 static
-#line 62
 double
-#line 62
 hash_float(
-#line 62
     const nc_type type,
-#line 62
     const int rank,
-#line 62
     const size_t *index,
-#line 62
     const nct_itype itype)
-#line 62
 {
-#line 62
     const double min = float_min;
-#line 62
     const double max = float_max;
-#line 62
 
-#line 62
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 62
 }
-#line 62
 
 /*
-#line 63
  *  ensure hash value within range for internal TYPE
-#line 63
  */
-#line 63
 static
-#line 63
 double
-#line 63
 hash_double(
-#line 63
     const nc_type type,
-#line 63
     const int rank,
-#line 63
     const size_t *index,
-#line 63
     const nct_itype itype)
-#line 63
 {
-#line 63
     const double min = double_min;
-#line 63
     const double max = double_max;
-#line 63
 
-#line 63
     return MAX(min, MIN(max, hash4( type, rank, index, itype)));
-#line 63
 }
-#line 63
 
 
 
-#line 154
 
 /* 
-#line 155
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 155
  */
-#line 155
 static
-#line 155
 void
-#line 155
 check_vars_text(const char *filename)
-#line 155
 {
-#line 155
     int  ncid;                  /* netCDF id */
-#line 155
     size_t index[MAX_RANK];
-#line 155
     int  err;           /* status */
-#line 155
     int  d;
-#line 155
     int  i;
-#line 155
     size_t  j;
-#line 155
     text value;
-#line 155
     nc_type datatype;
-#line 155
     int ndims;
-#line 155
     int dimids[MAX_RANK];
-#line 155
     double expect;
-#line 155
     char name[NC_MAX_NAME];
-#line 155
     size_t length;
-#line 155
     int canConvert;     /* Both text or both numeric */
-#line 155
     int nok = 0;      /* count of valid comparisons */
-#line 155
 
-#line 155
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 155
     IF (err)
-#line 155
         error("nc_open: %s", nc_strerror(err));
-#line 155
 
-#line 155
     for (i = 0; i < NVARS; i++) {
-#line 155
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 155
 	if (canConvert) {
-#line 155
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 155
 	    IF (err)
-#line 155
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 155
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 155
 		error("Unexpected var_name");
-#line 155
 	    IF (datatype != var_type[i])
-#line 155
 		error("Unexpected type");
-#line 155
 	    IF (ndims != var_rank[i])
-#line 155
 		error("Unexpected rank");
-#line 155
 	    for (j = 0; j < ndims; j++) {
-#line 155
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 155
 		IF (err)
-#line 155
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 155
 		IF (length != var_shape[i][j])
-#line 155
 		    error("Unexpected shape");
-#line 155
 	    }
-#line 155
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 155
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 155
 		IF (err)
-#line 155
 		    error("error in toMixedBase 2");
-#line 155
 		expect = hash4( var_type[i], var_rank[i], index, NCT_TEXT);
-#line 155
 		err = nc_get_var1_text(ncid, i, index, &value);
-#line 155
 		if (inRange3(expect,datatype,NCT_TEXT)) {
-#line 155
                     if (expect >= text_min && expect <= text_max) {
-#line 155
 			IF (err) {
-#line 155
 			    error("nc_get_var1_text: %s", nc_strerror(err));
-#line 155
 			} else {
-#line 155
                             IF (!equal(value,expect,var_type[i],NCT_TEXT)) {
-#line 155
 				error("Var value read not that expected");
-#line 155
 				if (verbose) {
-#line 155
 				    error("\n");
-#line 155
 				    error("varid: %d, ", i);
-#line 155
 				    error("var_name: %s, ", var_name[i]);
-#line 155
 				    error("index:");
-#line 155
 				    for (d = 0; d < var_rank[i]; d++)
-#line 155
 					error(" %d", index[d]);
-#line 155
 				    error(", expect: %g, ", expect);
-#line 155
 				    error("got: %g", (double) value);
-#line 155
 				}
-#line 155
 			    } else {
-#line 155
 				++nok;
-#line 155
 			    }
-#line 155
 			}
-#line 155
 		    }
-#line 155
 		}
-#line 155
 	    }
-#line 155
 	}
-#line 155
     }
-#line 155
     err = nc_close (ncid);
-#line 155
     IF (err)
-#line 155
         error("nc_close: %s", nc_strerror(err));
-#line 155
     print_nok(nok);
-#line 155
 }
-#line 155
 
 /* 
-#line 156
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 156
  */
-#line 156
 static
-#line 156
 void
-#line 156
 check_vars_uchar(const char *filename)
-#line 156
 {
-#line 156
     int  ncid;                  /* netCDF id */
-#line 156
     size_t index[MAX_RANK];
-#line 156
     int  err;           /* status */
-#line 156
     int  d;
-#line 156
     int  i;
-#line 156
     size_t  j;
-#line 156
     uchar value;
-#line 156
     nc_type datatype;
-#line 156
     int ndims;
-#line 156
     int dimids[MAX_RANK];
-#line 156
     double expect;
-#line 156
     char name[NC_MAX_NAME];
-#line 156
     size_t length;
-#line 156
     int canConvert;     /* Both text or both numeric */
-#line 156
     int nok = 0;      /* count of valid comparisons */
-#line 156
 
-#line 156
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 156
     IF (err)
-#line 156
         error("nc_open: %s", nc_strerror(err));
-#line 156
 
-#line 156
     for (i = 0; i < NVARS; i++) {
-#line 156
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 156
 	if (canConvert) {
-#line 156
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 156
 	    IF (err)
-#line 156
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 156
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 156
 		error("Unexpected var_name");
-#line 156
 	    IF (datatype != var_type[i])
-#line 156
 		error("Unexpected type");
-#line 156
 	    IF (ndims != var_rank[i])
-#line 156
 		error("Unexpected rank");
-#line 156
 	    for (j = 0; j < ndims; j++) {
-#line 156
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 156
 		IF (err)
-#line 156
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 156
 		IF (length != var_shape[i][j])
-#line 156
 		    error("Unexpected shape");
-#line 156
 	    }
-#line 156
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 156
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 156
 		IF (err)
-#line 156
 		    error("error in toMixedBase 2");
-#line 156
 		expect = hash4( var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 156
 		err = nc_get_var1_uchar(ncid, i, index, &value);
-#line 156
 		if (inRange3(expect,datatype,NCT_UCHAR)) {
-#line 156
                     if (expect >= uchar_min && expect <= uchar_max) {
-#line 156
 			IF (err) {
-#line 156
 			    error("nc_get_var1_uchar: %s", nc_strerror(err));
-#line 156
 			} else {
-#line 156
                             IF (!equal(value,expect,var_type[i],NCT_UCHAR)) {
-#line 156
 				error("Var value read not that expected");
-#line 156
 				if (verbose) {
-#line 156
 				    error("\n");
-#line 156
 				    error("varid: %d, ", i);
-#line 156
 				    error("var_name: %s, ", var_name[i]);
-#line 156
 				    error("index:");
-#line 156
 				    for (d = 0; d < var_rank[i]; d++)
-#line 156
 					error(" %d", index[d]);
-#line 156
 				    error(", expect: %g, ", expect);
-#line 156
 				    error("got: %g", (double) value);
-#line 156
 				}
-#line 156
 			    } else {
-#line 156
 				++nok;
-#line 156
 			    }
-#line 156
 			}
-#line 156
 		    }
-#line 156
 		}
-#line 156
 	    }
-#line 156
 	}
-#line 156
     }
-#line 156
     err = nc_close (ncid);
-#line 156
     IF (err)
-#line 156
         error("nc_close: %s", nc_strerror(err));
-#line 156
     print_nok(nok);
-#line 156
 }
-#line 156
 
 /* 
-#line 157
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 157
  */
-#line 157
 static
-#line 157
 void
-#line 157
 check_vars_schar(const char *filename)
-#line 157
 {
-#line 157
     int  ncid;                  /* netCDF id */
-#line 157
     size_t index[MAX_RANK];
-#line 157
     int  err;           /* status */
-#line 157
     int  d;
-#line 157
     int  i;
-#line 157
     size_t  j;
-#line 157
     schar value;
-#line 157
     nc_type datatype;
-#line 157
     int ndims;
-#line 157
     int dimids[MAX_RANK];
-#line 157
     double expect;
-#line 157
     char name[NC_MAX_NAME];
-#line 157
     size_t length;
-#line 157
     int canConvert;     /* Both text or both numeric */
-#line 157
     int nok = 0;      /* count of valid comparisons */
-#line 157
 
-#line 157
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 157
     IF (err)
-#line 157
         error("nc_open: %s", nc_strerror(err));
-#line 157
 
-#line 157
     for (i = 0; i < NVARS; i++) {
-#line 157
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 157
 	if (canConvert) {
-#line 157
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 157
 	    IF (err)
-#line 157
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 157
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 157
 		error("Unexpected var_name");
-#line 157
 	    IF (datatype != var_type[i])
-#line 157
 		error("Unexpected type");
-#line 157
 	    IF (ndims != var_rank[i])
-#line 157
 		error("Unexpected rank");
-#line 157
 	    for (j = 0; j < ndims; j++) {
-#line 157
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 157
 		IF (err)
-#line 157
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 157
 		IF (length != var_shape[i][j])
-#line 157
 		    error("Unexpected shape");
-#line 157
 	    }
-#line 157
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 157
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 157
 		IF (err)
-#line 157
 		    error("error in toMixedBase 2");
-#line 157
 		expect = hash4( var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 157
 		err = nc_get_var1_schar(ncid, i, index, &value);
-#line 157
 		if (inRange3(expect,datatype,NCT_SCHAR)) {
-#line 157
                     if (expect >= schar_min && expect <= schar_max) {
-#line 157
 			IF (err) {
-#line 157
 			    error("nc_get_var1_schar: %s", nc_strerror(err));
-#line 157
 			} else {
-#line 157
                             IF (!equal(value,expect,var_type[i],NCT_SCHAR)) {
-#line 157
 				error("Var value read not that expected");
-#line 157
 				if (verbose) {
-#line 157
 				    error("\n");
-#line 157
 				    error("varid: %d, ", i);
-#line 157
 				    error("var_name: %s, ", var_name[i]);
-#line 157
 				    error("index:");
-#line 157
 				    for (d = 0; d < var_rank[i]; d++)
-#line 157
 					error(" %d", index[d]);
-#line 157
 				    error(", expect: %g, ", expect);
-#line 157
 				    error("got: %g", (double) value);
-#line 157
 				}
-#line 157
 			    } else {
-#line 157
 				++nok;
-#line 157
 			    }
-#line 157
 			}
-#line 157
 		    }
-#line 157
 		}
-#line 157
 	    }
-#line 157
 	}
-#line 157
     }
-#line 157
     err = nc_close (ncid);
-#line 157
     IF (err)
-#line 157
         error("nc_close: %s", nc_strerror(err));
-#line 157
     print_nok(nok);
-#line 157
 }
-#line 157
 
 /* 
-#line 158
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 158
  */
-#line 158
 static
-#line 158
 void
-#line 158
 check_vars_short(const char *filename)
-#line 158
 {
-#line 158
     int  ncid;                  /* netCDF id */
-#line 158
     size_t index[MAX_RANK];
-#line 158
     int  err;           /* status */
-#line 158
     int  d;
-#line 158
     int  i;
-#line 158
     size_t  j;
-#line 158
     short value;
-#line 158
     nc_type datatype;
-#line 158
     int ndims;
-#line 158
     int dimids[MAX_RANK];
-#line 158
     double expect;
-#line 158
     char name[NC_MAX_NAME];
-#line 158
     size_t length;
-#line 158
     int canConvert;     /* Both text or both numeric */
-#line 158
     int nok = 0;      /* count of valid comparisons */
-#line 158
 
-#line 158
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 158
     IF (err)
-#line 158
         error("nc_open: %s", nc_strerror(err));
-#line 158
 
-#line 158
     for (i = 0; i < NVARS; i++) {
-#line 158
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 158
 	if (canConvert) {
-#line 158
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 158
 	    IF (err)
-#line 158
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 158
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 158
 		error("Unexpected var_name");
-#line 158
 	    IF (datatype != var_type[i])
-#line 158
 		error("Unexpected type");
-#line 158
 	    IF (ndims != var_rank[i])
-#line 158
 		error("Unexpected rank");
-#line 158
 	    for (j = 0; j < ndims; j++) {
-#line 158
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 158
 		IF (err)
-#line 158
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 158
 		IF (length != var_shape[i][j])
-#line 158
 		    error("Unexpected shape");
-#line 158
 	    }
-#line 158
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 158
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 158
 		IF (err)
-#line 158
 		    error("error in toMixedBase 2");
-#line 158
 		expect = hash4( var_type[i], var_rank[i], index, NCT_SHORT);
-#line 158
 		err = nc_get_var1_short(ncid, i, index, &value);
-#line 158
 		if (inRange3(expect,datatype,NCT_SHORT)) {
-#line 158
                     if (expect >= short_min && expect <= short_max) {
-#line 158
 			IF (err) {
-#line 158
 			    error("nc_get_var1_short: %s", nc_strerror(err));
-#line 158
 			} else {
-#line 158
                             IF (!equal(value,expect,var_type[i],NCT_SHORT)) {
-#line 158
 				error("Var value read not that expected");
-#line 158
 				if (verbose) {
-#line 158
 				    error("\n");
-#line 158
 				    error("varid: %d, ", i);
-#line 158
 				    error("var_name: %s, ", var_name[i]);
-#line 158
 				    error("index:");
-#line 158
 				    for (d = 0; d < var_rank[i]; d++)
-#line 158
 					error(" %d", index[d]);
-#line 158
 				    error(", expect: %g, ", expect);
-#line 158
 				    error("got: %g", (double) value);
-#line 158
 				}
-#line 158
 			    } else {
-#line 158
 				++nok;
-#line 158
 			    }
-#line 158
 			}
-#line 158
 		    }
-#line 158
 		}
-#line 158
 	    }
-#line 158
 	}
-#line 158
     }
-#line 158
     err = nc_close (ncid);
-#line 158
     IF (err)
-#line 158
         error("nc_close: %s", nc_strerror(err));
-#line 158
     print_nok(nok);
-#line 158
 }
-#line 158
 
 /* 
-#line 159
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 159
  */
-#line 159
 static
-#line 159
 void
-#line 159
 check_vars_int(const char *filename)
-#line 159
 {
-#line 159
     int  ncid;                  /* netCDF id */
-#line 159
     size_t index[MAX_RANK];
-#line 159
     int  err;           /* status */
-#line 159
     int  d;
-#line 159
     int  i;
-#line 159
     size_t  j;
-#line 159
     int value;
-#line 159
     nc_type datatype;
-#line 159
     int ndims;
-#line 159
     int dimids[MAX_RANK];
-#line 159
     double expect;
-#line 159
     char name[NC_MAX_NAME];
-#line 159
     size_t length;
-#line 159
     int canConvert;     /* Both text or both numeric */
-#line 159
     int nok = 0;      /* count of valid comparisons */
-#line 159
 
-#line 159
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 159
     IF (err)
-#line 159
         error("nc_open: %s", nc_strerror(err));
-#line 159
 
-#line 159
     for (i = 0; i < NVARS; i++) {
-#line 159
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 159
 	if (canConvert) {
-#line 159
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 159
 	    IF (err)
-#line 159
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 159
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 159
 		error("Unexpected var_name");
-#line 159
 	    IF (datatype != var_type[i])
-#line 159
 		error("Unexpected type");
-#line 159
 	    IF (ndims != var_rank[i])
-#line 159
 		error("Unexpected rank");
-#line 159
 	    for (j = 0; j < ndims; j++) {
-#line 159
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 159
 		IF (err)
-#line 159
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 159
 		IF (length != var_shape[i][j])
-#line 159
 		    error("Unexpected shape");
-#line 159
 	    }
-#line 159
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 159
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 159
 		IF (err)
-#line 159
 		    error("error in toMixedBase 2");
-#line 159
 		expect = hash4( var_type[i], var_rank[i], index, NCT_INT);
-#line 159
 		err = nc_get_var1_int(ncid, i, index, &value);
-#line 159
 		if (inRange3(expect,datatype,NCT_INT)) {
-#line 159
                     if (expect >= int_min && expect <= int_max) {
-#line 159
 			IF (err) {
-#line 159
 			    error("nc_get_var1_int: %s", nc_strerror(err));
-#line 159
 			} else {
-#line 159
                             IF (!equal(value,expect,var_type[i],NCT_INT)) {
-#line 159
 				error("Var value read not that expected");
-#line 159
 				if (verbose) {
-#line 159
 				    error("\n");
-#line 159
 				    error("varid: %d, ", i);
-#line 159
 				    error("var_name: %s, ", var_name[i]);
-#line 159
 				    error("index:");
-#line 159
 				    for (d = 0; d < var_rank[i]; d++)
-#line 159
 					error(" %d", index[d]);
-#line 159
 				    error(", expect: %g, ", expect);
-#line 159
 				    error("got: %g", (double) value);
-#line 159
 				}
-#line 159
 			    } else {
-#line 159
 				++nok;
-#line 159
 			    }
-#line 159
 			}
-#line 159
 		    }
-#line 159
 		}
-#line 159
 	    }
-#line 159
 	}
-#line 159
     }
-#line 159
     err = nc_close (ncid);
-#line 159
     IF (err)
-#line 159
         error("nc_close: %s", nc_strerror(err));
-#line 159
     print_nok(nok);
-#line 159
 }
-#line 159
 
 /* 
-#line 160
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 160
  */
-#line 160
 static
-#line 160
 void
-#line 160
 check_vars_long(const char *filename)
-#line 160
 {
-#line 160
     int  ncid;                  /* netCDF id */
-#line 160
     size_t index[MAX_RANK];
-#line 160
     int  err;           /* status */
-#line 160
     int  d;
-#line 160
     int  i;
-#line 160
     size_t  j;
-#line 160
     long value;
-#line 160
     nc_type datatype;
-#line 160
     int ndims;
-#line 160
     int dimids[MAX_RANK];
-#line 160
     double expect;
-#line 160
     char name[NC_MAX_NAME];
-#line 160
     size_t length;
-#line 160
     int canConvert;     /* Both text or both numeric */
-#line 160
     int nok = 0;      /* count of valid comparisons */
-#line 160
 
-#line 160
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 160
     IF (err)
-#line 160
         error("nc_open: %s", nc_strerror(err));
-#line 160
 
-#line 160
     for (i = 0; i < NVARS; i++) {
-#line 160
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 160
 	if (canConvert) {
-#line 160
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 160
 	    IF (err)
-#line 160
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 160
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 160
 		error("Unexpected var_name");
-#line 160
 	    IF (datatype != var_type[i])
-#line 160
 		error("Unexpected type");
-#line 160
 	    IF (ndims != var_rank[i])
-#line 160
 		error("Unexpected rank");
-#line 160
 	    for (j = 0; j < ndims; j++) {
-#line 160
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 160
 		IF (err)
-#line 160
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 160
 		IF (length != var_shape[i][j])
-#line 160
 		    error("Unexpected shape");
-#line 160
 	    }
-#line 160
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 160
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 160
 		IF (err)
-#line 160
 		    error("error in toMixedBase 2");
-#line 160
 		expect = hash4( var_type[i], var_rank[i], index, NCT_LONG);
-#line 160
 		err = nc_get_var1_long(ncid, i, index, &value);
-#line 160
 		if (inRange3(expect,datatype,NCT_LONG)) {
-#line 160
                     if (expect >= long_min && expect <= long_max) {
-#line 160
 			IF (err) {
-#line 160
 			    error("nc_get_var1_long: %s", nc_strerror(err));
-#line 160
 			} else {
-#line 160
                             IF (!equal(value,expect,var_type[i],NCT_LONG)) {
-#line 160
 				error("Var value read not that expected");
-#line 160
 				if (verbose) {
-#line 160
 				    error("\n");
-#line 160
 				    error("varid: %d, ", i);
-#line 160
 				    error("var_name: %s, ", var_name[i]);
-#line 160
 				    error("index:");
-#line 160
 				    for (d = 0; d < var_rank[i]; d++)
-#line 160
 					error(" %d", index[d]);
-#line 160
 				    error(", expect: %g, ", expect);
-#line 160
 				    error("got: %g", (double) value);
-#line 160
 				}
-#line 160
 			    } else {
-#line 160
 				++nok;
-#line 160
 			    }
-#line 160
 			}
-#line 160
 		    }
-#line 160
 		}
-#line 160
 	    }
-#line 160
 	}
-#line 160
     }
-#line 160
     err = nc_close (ncid);
-#line 160
     IF (err)
-#line 160
         error("nc_close: %s", nc_strerror(err));
-#line 160
     print_nok(nok);
-#line 160
 }
-#line 160
 
 /* 
-#line 161
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 161
  */
-#line 161
 static
-#line 161
 void
-#line 161
 check_vars_float(const char *filename)
-#line 161
 {
-#line 161
     int  ncid;                  /* netCDF id */
-#line 161
     size_t index[MAX_RANK];
-#line 161
     int  err;           /* status */
-#line 161
     int  d;
-#line 161
     int  i;
-#line 161
     size_t  j;
-#line 161
     float value;
-#line 161
     nc_type datatype;
-#line 161
     int ndims;
-#line 161
     int dimids[MAX_RANK];
-#line 161
     double expect;
-#line 161
     char name[NC_MAX_NAME];
-#line 161
     size_t length;
-#line 161
     int canConvert;     /* Both text or both numeric */
-#line 161
     int nok = 0;      /* count of valid comparisons */
-#line 161
 
-#line 161
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 161
     IF (err)
-#line 161
         error("nc_open: %s", nc_strerror(err));
-#line 161
 
-#line 161
     for (i = 0; i < NVARS; i++) {
-#line 161
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 161
 	if (canConvert) {
-#line 161
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 161
 	    IF (err)
-#line 161
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 161
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 161
 		error("Unexpected var_name");
-#line 161
 	    IF (datatype != var_type[i])
-#line 161
 		error("Unexpected type");
-#line 161
 	    IF (ndims != var_rank[i])
-#line 161
 		error("Unexpected rank");
-#line 161
 	    for (j = 0; j < ndims; j++) {
-#line 161
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 161
 		IF (err)
-#line 161
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 161
 		IF (length != var_shape[i][j])
-#line 161
 		    error("Unexpected shape");
-#line 161
 	    }
-#line 161
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 161
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 161
 		IF (err)
-#line 161
 		    error("error in toMixedBase 2");
-#line 161
 		expect = hash4( var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 161
 		err = nc_get_var1_float(ncid, i, index, &value);
-#line 161
 		if (inRange3(expect,datatype,NCT_FLOAT)) {
-#line 161
                     if (expect >= float_min && expect <= float_max) {
-#line 161
 			IF (err) {
-#line 161
 			    error("nc_get_var1_float: %s", nc_strerror(err));
-#line 161
 			} else {
-#line 161
                             IF (!equal(value,expect,var_type[i],NCT_FLOAT)) {
-#line 161
 				error("Var value read not that expected");
-#line 161
 				if (verbose) {
-#line 161
 				    error("\n");
-#line 161
 				    error("varid: %d, ", i);
-#line 161
 				    error("var_name: %s, ", var_name[i]);
-#line 161
 				    error("index:");
-#line 161
 				    for (d = 0; d < var_rank[i]; d++)
-#line 161
 					error(" %d", index[d]);
-#line 161
 				    error(", expect: %g, ", expect);
-#line 161
 				    error("got: %g", (double) value);
-#line 161
 				}
-#line 161
 			    } else {
-#line 161
 				++nok;
-#line 161
 			    }
-#line 161
 			}
-#line 161
 		    }
-#line 161
 		}
-#line 161
 	    }
-#line 161
 	}
-#line 161
     }
-#line 161
     err = nc_close (ncid);
-#line 161
     IF (err)
-#line 161
         error("nc_close: %s", nc_strerror(err));
-#line 161
     print_nok(nok);
-#line 161
 }
-#line 161
 
 /* 
-#line 162
  *  check all vars in file which are (text/numeric) compatible with TYPE
-#line 162
  */
-#line 162
 static
-#line 162
 void
-#line 162
 check_vars_double(const char *filename)
-#line 162
 {
-#line 162
     int  ncid;                  /* netCDF id */
-#line 162
     size_t index[MAX_RANK];
-#line 162
     int  err;           /* status */
-#line 162
     int  d;
-#line 162
     int  i;
-#line 162
     size_t  j;
-#line 162
     double value;
-#line 162
     nc_type datatype;
-#line 162
     int ndims;
-#line 162
     int dimids[MAX_RANK];
-#line 162
     double expect;
-#line 162
     char name[NC_MAX_NAME];
-#line 162
     size_t length;
-#line 162
     int canConvert;     /* Both text or both numeric */
-#line 162
     int nok = 0;      /* count of valid comparisons */
-#line 162
 
-#line 162
     err = nc_open(filename, NC_NOWRITE, &ncid);
-#line 162
     IF (err)
-#line 162
         error("nc_open: %s", nc_strerror(err));
-#line 162
 
-#line 162
     for (i = 0; i < NVARS; i++) {
-#line 162
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 162
 	if (canConvert) {
-#line 162
 	    err = nc_inq_var(ncid, i, name, &datatype, &ndims, dimids, NULL);
-#line 162
 	    IF (err)
-#line 162
 		error("nc_inq_var: %s", nc_strerror(err));
-#line 162
 	    IF (strcmp(name, var_name[i]) != 0)
-#line 162
 		error("Unexpected var_name");
-#line 162
 	    IF (datatype != var_type[i])
-#line 162
 		error("Unexpected type");
-#line 162
 	    IF (ndims != var_rank[i])
-#line 162
 		error("Unexpected rank");
-#line 162
 	    for (j = 0; j < ndims; j++) {
-#line 162
 		err = nc_inq_dim(ncid, dimids[j], 0, &length);
-#line 162
 		IF (err)
-#line 162
 		    error("nc_inq_dim: %s", nc_strerror(err));
-#line 162
 		IF (length != var_shape[i][j])
-#line 162
 		    error("Unexpected shape");
-#line 162
 	    }
-#line 162
 	    for (j = 0; j < var_nels[i]; j++) {
-#line 162
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 162
 		IF (err)
-#line 162
 		    error("error in toMixedBase 2");
-#line 162
 		expect = hash4( var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 162
 		err = nc_get_var1_double(ncid, i, index, &value);
-#line 162
 		if (inRange3(expect,datatype,NCT_DOUBLE)) {
-#line 162
                     if (expect >= double_min && expect <= double_max) {
-#line 162
 			IF (err) {
-#line 162
 			    error("nc_get_var1_double: %s", nc_strerror(err));
-#line 162
 			} else {
-#line 162
                             IF (!equal(value,expect,var_type[i],NCT_DOUBLE)) {
-#line 162
 				error("Var value read not that expected");
-#line 162
 				if (verbose) {
-#line 162
 				    error("\n");
-#line 162
 				    error("varid: %d, ", i);
-#line 162
 				    error("var_name: %s, ", var_name[i]);
-#line 162
 				    error("index:");
-#line 162
 				    for (d = 0; d < var_rank[i]; d++)
-#line 162
 					error(" %d", index[d]);
-#line 162
 				    error(", expect: %g, ", expect);
-#line 162
 				    error("got: %g", (double) value);
-#line 162
 				}
-#line 162
 			    } else {
-#line 162
 				++nok;
-#line 162
 			    }
-#line 162
 			}
-#line 162
 		    }
-#line 162
 		}
-#line 162
 	    }
-#line 162
 	}
-#line 162
     }
-#line 162
     err = nc_close (ncid);
-#line 162
     IF (err)
-#line 162
         error("nc_close: %s", nc_strerror(err));
-#line 162
     print_nok(nok);
-#line 162
 }
-#line 162
 
 
 
-#line 244
 
 /* 
-#line 245
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 245
  *  ignore any attributes containing values outside range of TYPE
-#line 245
  */
-#line 245
 static
-#line 245
 void
-#line 245
 check_atts_text(int  ncid)
-#line 245
 {
-#line 245
     int  err;           /* status */
-#line 245
     int  i;
-#line 245
     int  j;
-#line 245
     size_t  k;
-#line 245
     text value[MAX_NELS];
-#line 245
     nc_type datatype;
-#line 245
     double expect[MAX_NELS];
-#line 245
     size_t length;
-#line 245
     size_t nInExtRange;  /* number values within external range */
-#line 245
     size_t nInIntRange;  /* number values within internal range */
-#line 245
     int canConvert;     /* Both text or both numeric */
-#line 245
     int nok = 0;      /* count of valid comparisons */
-#line 245
 
-#line 245
     for (i = -1; i < NVARS; i++) {
-#line 245
         for (j = 0; j < NATTS(i); j++) {
-#line 245
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 245
 	    if (canConvert) {
-#line 245
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 245
 		IF (err)
-#line 245
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 245
 		IF (datatype != ATT_TYPE(i,j))
-#line 245
 		error("nc_inq_att: unexpected type");
-#line 245
 		IF (length != ATT_LEN(i,j))
-#line 245
 		    error("nc_inq_att: unexpected length");
-#line 245
 		assert(length <= MAX_NELS);
-#line 245
 		nInIntRange = nInExtRange = 0;
-#line 245
 		for (k = 0; k < length; k++) {
-#line 245
 		    expect[k] = hash4( datatype, -1, &k, NCT_TEXT);
-#line 245
 		    if (inRange3(expect[k], datatype, NCT_TEXT)) {
-#line 245
 			++nInExtRange;
-#line 245
 			if (expect[k] >= text_min && expect[k] <= text_max)
-#line 245
 			    ++nInIntRange;
-#line 245
 		    }
-#line 245
 		}
-#line 245
 		err = nc_get_att_text(ncid, i, ATT_NAME(i,j), value);
-#line 245
                 if (nInExtRange == length && nInIntRange == length) {
-#line 245
 		    IF (err)
-#line 245
 			error("%s", nc_strerror(err));
-#line 245
                 } else {
-#line 245
                     IF (err != 0 && err != NC_ERANGE)
-#line 245
                         error("OK or Range error: status = %d", err);
-#line 245
                 }
-#line 245
 		for (k = 0; k < length; k++) {
-#line 245
                     if (inRange3(expect[k],datatype,NCT_TEXT)
-#line 245
                             && expect[k] >= text_min && expect[k] <= text_max) {
-#line 245
                         IF (!equal(value[k],expect[k],datatype,NCT_TEXT)) {
-#line 245
                             error("att. value read not that expected");
-#line 245
                             if (verbose) {
-#line 245
                                 error("\n");
-#line 245
                                 error("varid: %d, ", i);
-#line 245
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 245
                                 error("element number: %d ", k);
-#line 245
                                 error("expect: %g, ", expect[k]);
-#line 245
                                 error("got: %g", (double) value[k]);
-#line 245
                             }
-#line 245
                         } else {
-#line 245
                             nok++;
-#line 245
                         }
-#line 245
                     }
-#line 245
                 }
-#line 245
             }                                               
-#line 245
         }
-#line 245
     }
-#line 245
 
-#line 245
     print_nok(nok);
-#line 245
 }
-#line 245
 
 /* 
-#line 246
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 246
  *  ignore any attributes containing values outside range of TYPE
-#line 246
  */
-#line 246
 static
-#line 246
 void
-#line 246
 check_atts_uchar(int  ncid)
-#line 246
 {
-#line 246
     int  err;           /* status */
-#line 246
     int  i;
-#line 246
     int  j;
-#line 246
     size_t  k;
-#line 246
     uchar value[MAX_NELS];
-#line 246
     nc_type datatype;
-#line 246
     double expect[MAX_NELS];
-#line 246
     size_t length;
-#line 246
     size_t nInExtRange;  /* number values within external range */
-#line 246
     size_t nInIntRange;  /* number values within internal range */
-#line 246
     int canConvert;     /* Both text or both numeric */
-#line 246
     int nok = 0;      /* count of valid comparisons */
-#line 246
 
-#line 246
     for (i = -1; i < NVARS; i++) {
-#line 246
         for (j = 0; j < NATTS(i); j++) {
-#line 246
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 246
 	    if (canConvert) {
-#line 246
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 246
 		IF (err)
-#line 246
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 246
 		IF (datatype != ATT_TYPE(i,j))
-#line 246
 		error("nc_inq_att: unexpected type");
-#line 246
 		IF (length != ATT_LEN(i,j))
-#line 246
 		    error("nc_inq_att: unexpected length");
-#line 246
 		assert(length <= MAX_NELS);
-#line 246
 		nInIntRange = nInExtRange = 0;
-#line 246
 		for (k = 0; k < length; k++) {
-#line 246
 		    expect[k] = hash4( datatype, -1, &k, NCT_UCHAR);
-#line 246
 		    if (inRange3(expect[k], datatype, NCT_UCHAR)) {
-#line 246
 			++nInExtRange;
-#line 246
 			if (expect[k] >= uchar_min && expect[k] <= uchar_max)
-#line 246
 			    ++nInIntRange;
-#line 246
 		    }
-#line 246
 		}
-#line 246
 		err = nc_get_att_uchar(ncid, i, ATT_NAME(i,j), value);
-#line 246
                 if (nInExtRange == length && nInIntRange == length) {
-#line 246
 		    IF (err)
-#line 246
 			error("%s", nc_strerror(err));
-#line 246
                 } else {
-#line 246
                     IF (err != 0 && err != NC_ERANGE)
-#line 246
                         error("OK or Range error: status = %d", err);
-#line 246
                 }
-#line 246
 		for (k = 0; k < length; k++) {
-#line 246
                     if (inRange3(expect[k],datatype,NCT_UCHAR)
-#line 246
                             && expect[k] >= uchar_min && expect[k] <= uchar_max) {
-#line 246
                         IF (!equal(value[k],expect[k],datatype,NCT_UCHAR)) {
-#line 246
                             error("att. value read not that expected");
-#line 246
                             if (verbose) {
-#line 246
                                 error("\n");
-#line 246
                                 error("varid: %d, ", i);
-#line 246
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 246
                                 error("element number: %d ", k);
-#line 246
                                 error("expect: %g, ", expect[k]);
-#line 246
                                 error("got: %g", (double) value[k]);
-#line 246
                             }
-#line 246
                         } else {
-#line 246
                             nok++;
-#line 246
                         }
-#line 246
                     }
-#line 246
                 }
-#line 246
             }                                               
-#line 246
         }
-#line 246
     }
-#line 246
 
-#line 246
     print_nok(nok);
-#line 246
 }
-#line 246
 
 /* 
-#line 247
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 247
  *  ignore any attributes containing values outside range of TYPE
-#line 247
  */
-#line 247
 static
-#line 247
 void
-#line 247
 check_atts_schar(int  ncid)
-#line 247
 {
-#line 247
     int  err;           /* status */
-#line 247
     int  i;
-#line 247
     int  j;
-#line 247
     size_t  k;
-#line 247
     schar value[MAX_NELS];
-#line 247
     nc_type datatype;
-#line 247
     double expect[MAX_NELS];
-#line 247
     size_t length;
-#line 247
     size_t nInExtRange;  /* number values within external range */
-#line 247
     size_t nInIntRange;  /* number values within internal range */
-#line 247
     int canConvert;     /* Both text or both numeric */
-#line 247
     int nok = 0;      /* count of valid comparisons */
-#line 247
 
-#line 247
     for (i = -1; i < NVARS; i++) {
-#line 247
         for (j = 0; j < NATTS(i); j++) {
-#line 247
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 247
 	    if (canConvert) {
-#line 247
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 247
 		IF (err)
-#line 247
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 247
 		IF (datatype != ATT_TYPE(i,j))
-#line 247
 		error("nc_inq_att: unexpected type");
-#line 247
 		IF (length != ATT_LEN(i,j))
-#line 247
 		    error("nc_inq_att: unexpected length");
-#line 247
 		assert(length <= MAX_NELS);
-#line 247
 		nInIntRange = nInExtRange = 0;
-#line 247
 		for (k = 0; k < length; k++) {
-#line 247
 		    expect[k] = hash4( datatype, -1, &k, NCT_SCHAR);
-#line 247
 		    if (inRange3(expect[k], datatype, NCT_SCHAR)) {
-#line 247
 			++nInExtRange;
-#line 247
 			if (expect[k] >= schar_min && expect[k] <= schar_max)
-#line 247
 			    ++nInIntRange;
-#line 247
 		    }
-#line 247
 		}
-#line 247
 		err = nc_get_att_schar(ncid, i, ATT_NAME(i,j), value);
-#line 247
                 if (nInExtRange == length && nInIntRange == length) {
-#line 247
 		    IF (err)
-#line 247
 			error("%s", nc_strerror(err));
-#line 247
                 } else {
-#line 247
                     IF (err != 0 && err != NC_ERANGE)
-#line 247
                         error("OK or Range error: status = %d", err);
-#line 247
                 }
-#line 247
 		for (k = 0; k < length; k++) {
-#line 247
                     if (inRange3(expect[k],datatype,NCT_SCHAR)
-#line 247
                             && expect[k] >= schar_min && expect[k] <= schar_max) {
-#line 247
                         IF (!equal(value[k],expect[k],datatype,NCT_SCHAR)) {
-#line 247
                             error("att. value read not that expected");
-#line 247
                             if (verbose) {
-#line 247
                                 error("\n");
-#line 247
                                 error("varid: %d, ", i);
-#line 247
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 247
                                 error("element number: %d ", k);
-#line 247
                                 error("expect: %g, ", expect[k]);
-#line 247
                                 error("got: %g", (double) value[k]);
-#line 247
                             }
-#line 247
                         } else {
-#line 247
                             nok++;
-#line 247
                         }
-#line 247
                     }
-#line 247
                 }
-#line 247
             }                                               
-#line 247
         }
-#line 247
     }
-#line 247
 
-#line 247
     print_nok(nok);
-#line 247
 }
-#line 247
 
 /* 
-#line 248
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 248
  *  ignore any attributes containing values outside range of TYPE
-#line 248
  */
-#line 248
 static
-#line 248
 void
-#line 248
 check_atts_short(int  ncid)
-#line 248
 {
-#line 248
     int  err;           /* status */
-#line 248
     int  i;
-#line 248
     int  j;
-#line 248
     size_t  k;
-#line 248
     short value[MAX_NELS];
-#line 248
     nc_type datatype;
-#line 248
     double expect[MAX_NELS];
-#line 248
     size_t length;
-#line 248
     size_t nInExtRange;  /* number values within external range */
-#line 248
     size_t nInIntRange;  /* number values within internal range */
-#line 248
     int canConvert;     /* Both text or both numeric */
-#line 248
     int nok = 0;      /* count of valid comparisons */
-#line 248
 
-#line 248
     for (i = -1; i < NVARS; i++) {
-#line 248
         for (j = 0; j < NATTS(i); j++) {
-#line 248
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 248
 	    if (canConvert) {
-#line 248
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 248
 		IF (err)
-#line 248
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 248
 		IF (datatype != ATT_TYPE(i,j))
-#line 248
 		error("nc_inq_att: unexpected type");
-#line 248
 		IF (length != ATT_LEN(i,j))
-#line 248
 		    error("nc_inq_att: unexpected length");
-#line 248
 		assert(length <= MAX_NELS);
-#line 248
 		nInIntRange = nInExtRange = 0;
-#line 248
 		for (k = 0; k < length; k++) {
-#line 248
 		    expect[k] = hash4( datatype, -1, &k, NCT_SHORT);
-#line 248
 		    if (inRange3(expect[k], datatype, NCT_SHORT)) {
-#line 248
 			++nInExtRange;
-#line 248
 			if (expect[k] >= short_min && expect[k] <= short_max)
-#line 248
 			    ++nInIntRange;
-#line 248
 		    }
-#line 248
 		}
-#line 248
 		err = nc_get_att_short(ncid, i, ATT_NAME(i,j), value);
-#line 248
                 if (nInExtRange == length && nInIntRange == length) {
-#line 248
 		    IF (err)
-#line 248
 			error("%s", nc_strerror(err));
-#line 248
                 } else {
-#line 248
                     IF (err != 0 && err != NC_ERANGE)
-#line 248
                         error("OK or Range error: status = %d", err);
-#line 248
                 }
-#line 248
 		for (k = 0; k < length; k++) {
-#line 248
                     if (inRange3(expect[k],datatype,NCT_SHORT)
-#line 248
                             && expect[k] >= short_min && expect[k] <= short_max) {
-#line 248
                         IF (!equal(value[k],expect[k],datatype,NCT_SHORT)) {
-#line 248
                             error("att. value read not that expected");
-#line 248
                             if (verbose) {
-#line 248
                                 error("\n");
-#line 248
                                 error("varid: %d, ", i);
-#line 248
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 248
                                 error("element number: %d ", k);
-#line 248
                                 error("expect: %g, ", expect[k]);
-#line 248
                                 error("got: %g", (double) value[k]);
-#line 248
                             }
-#line 248
                         } else {
-#line 248
                             nok++;
-#line 248
                         }
-#line 248
                     }
-#line 248
                 }
-#line 248
             }                                               
-#line 248
         }
-#line 248
     }
-#line 248
 
-#line 248
     print_nok(nok);
-#line 248
 }
-#line 248
 
 /* 
-#line 249
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 249
  *  ignore any attributes containing values outside range of TYPE
-#line 249
  */
-#line 249
 static
-#line 249
 void
-#line 249
 check_atts_int(int  ncid)
-#line 249
 {
-#line 249
     int  err;           /* status */
-#line 249
     int  i;
-#line 249
     int  j;
-#line 249
     size_t  k;
-#line 249
     int value[MAX_NELS];
-#line 249
     nc_type datatype;
-#line 249
     double expect[MAX_NELS];
-#line 249
     size_t length;
-#line 249
     size_t nInExtRange;  /* number values within external range */
-#line 249
     size_t nInIntRange;  /* number values within internal range */
-#line 249
     int canConvert;     /* Both text or both numeric */
-#line 249
     int nok = 0;      /* count of valid comparisons */
-#line 249
 
-#line 249
     for (i = -1; i < NVARS; i++) {
-#line 249
         for (j = 0; j < NATTS(i); j++) {
-#line 249
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 249
 	    if (canConvert) {
-#line 249
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 249
 		IF (err)
-#line 249
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 249
 		IF (datatype != ATT_TYPE(i,j))
-#line 249
 		error("nc_inq_att: unexpected type");
-#line 249
 		IF (length != ATT_LEN(i,j))
-#line 249
 		    error("nc_inq_att: unexpected length");
-#line 249
 		assert(length <= MAX_NELS);
-#line 249
 		nInIntRange = nInExtRange = 0;
-#line 249
 		for (k = 0; k < length; k++) {
-#line 249
 		    expect[k] = hash4( datatype, -1, &k, NCT_INT);
-#line 249
 		    if (inRange3(expect[k], datatype, NCT_INT)) {
-#line 249
 			++nInExtRange;
-#line 249
 			if (expect[k] >= int_min && expect[k] <= int_max)
-#line 249
 			    ++nInIntRange;
-#line 249
 		    }
-#line 249
 		}
-#line 249
 		err = nc_get_att_int(ncid, i, ATT_NAME(i,j), value);
-#line 249
                 if (nInExtRange == length && nInIntRange == length) {
-#line 249
 		    IF (err)
-#line 249
 			error("%s", nc_strerror(err));
-#line 249
                 } else {
-#line 249
                     IF (err != 0 && err != NC_ERANGE)
-#line 249
                         error("OK or Range error: status = %d", err);
-#line 249
                 }
-#line 249
 		for (k = 0; k < length; k++) {
-#line 249
                     if (inRange3(expect[k],datatype,NCT_INT)
-#line 249
                             && expect[k] >= int_min && expect[k] <= int_max) {
-#line 249
                         IF (!equal(value[k],expect[k],datatype,NCT_INT)) {
-#line 249
                             error("att. value read not that expected");
-#line 249
                             if (verbose) {
-#line 249
                                 error("\n");
-#line 249
                                 error("varid: %d, ", i);
-#line 249
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 249
                                 error("element number: %d ", k);
-#line 249
                                 error("expect: %g, ", expect[k]);
-#line 249
                                 error("got: %g", (double) value[k]);
-#line 249
                             }
-#line 249
                         } else {
-#line 249
                             nok++;
-#line 249
                         }
-#line 249
                     }
-#line 249
                 }
-#line 249
             }                                               
-#line 249
         }
-#line 249
     }
-#line 249
 
-#line 249
     print_nok(nok);
-#line 249
 }
-#line 249
 
 /* 
-#line 250
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 250
  *  ignore any attributes containing values outside range of TYPE
-#line 250
  */
-#line 250
 static
-#line 250
 void
-#line 250
 check_atts_long(int  ncid)
-#line 250
 {
-#line 250
     int  err;           /* status */
-#line 250
     int  i;
-#line 250
     int  j;
-#line 250
     size_t  k;
-#line 250
     long value[MAX_NELS];
-#line 250
     nc_type datatype;
-#line 250
     double expect[MAX_NELS];
-#line 250
     size_t length;
-#line 250
     size_t nInExtRange;  /* number values within external range */
-#line 250
     size_t nInIntRange;  /* number values within internal range */
-#line 250
     int canConvert;     /* Both text or both numeric */
-#line 250
     int nok = 0;      /* count of valid comparisons */
-#line 250
 
-#line 250
     for (i = -1; i < NVARS; i++) {
-#line 250
         for (j = 0; j < NATTS(i); j++) {
-#line 250
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 250
 	    if (canConvert) {
-#line 250
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 250
 		IF (err)
-#line 250
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 250
 		IF (datatype != ATT_TYPE(i,j))
-#line 250
 		error("nc_inq_att: unexpected type");
-#line 250
 		IF (length != ATT_LEN(i,j))
-#line 250
 		    error("nc_inq_att: unexpected length");
-#line 250
 		assert(length <= MAX_NELS);
-#line 250
 		nInIntRange = nInExtRange = 0;
-#line 250
 		for (k = 0; k < length; k++) {
-#line 250
 		    expect[k] = hash4( datatype, -1, &k, NCT_LONG);
-#line 250
 		    if (inRange3(expect[k], datatype, NCT_LONG)) {
-#line 250
 			++nInExtRange;
-#line 250
 			if (expect[k] >= long_min && expect[k] <= long_max)
-#line 250
 			    ++nInIntRange;
-#line 250
 		    }
-#line 250
 		}
-#line 250
 		err = nc_get_att_long(ncid, i, ATT_NAME(i,j), value);
-#line 250
                 if (nInExtRange == length && nInIntRange == length) {
-#line 250
 		    IF (err)
-#line 250
 			error("%s", nc_strerror(err));
-#line 250
                 } else {
-#line 250
                     IF (err != 0 && err != NC_ERANGE)
-#line 250
                         error("OK or Range error: status = %d", err);
-#line 250
                 }
-#line 250
 		for (k = 0; k < length; k++) {
-#line 250
                     if (inRange3(expect[k],datatype,NCT_LONG)
-#line 250
                             && expect[k] >= long_min && expect[k] <= long_max) {
-#line 250
                         IF (!equal(value[k],expect[k],datatype,NCT_LONG)) {
-#line 250
                             error("att. value read not that expected");
-#line 250
                             if (verbose) {
-#line 250
                                 error("\n");
-#line 250
                                 error("varid: %d, ", i);
-#line 250
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 250
                                 error("element number: %d ", k);
-#line 250
                                 error("expect: %g, ", expect[k]);
-#line 250
                                 error("got: %g", (double) value[k]);
-#line 250
                             }
-#line 250
                         } else {
-#line 250
                             nok++;
-#line 250
                         }
-#line 250
                     }
-#line 250
                 }
-#line 250
             }                                               
-#line 250
         }
-#line 250
     }
-#line 250
 
-#line 250
     print_nok(nok);
-#line 250
 }
-#line 250
 
 /* 
-#line 251
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 251
  *  ignore any attributes containing values outside range of TYPE
-#line 251
  */
-#line 251
 static
-#line 251
 void
-#line 251
 check_atts_float(int  ncid)
-#line 251
 {
-#line 251
     int  err;           /* status */
-#line 251
     int  i;
-#line 251
     int  j;
-#line 251
     size_t  k;
-#line 251
     float value[MAX_NELS];
-#line 251
     nc_type datatype;
-#line 251
     double expect[MAX_NELS];
-#line 251
     size_t length;
-#line 251
     size_t nInExtRange;  /* number values within external range */
-#line 251
     size_t nInIntRange;  /* number values within internal range */
-#line 251
     int canConvert;     /* Both text or both numeric */
-#line 251
     int nok = 0;      /* count of valid comparisons */
-#line 251
 
-#line 251
     for (i = -1; i < NVARS; i++) {
-#line 251
         for (j = 0; j < NATTS(i); j++) {
-#line 251
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 251
 	    if (canConvert) {
-#line 251
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 251
 		IF (err)
-#line 251
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 251
 		IF (datatype != ATT_TYPE(i,j))
-#line 251
 		error("nc_inq_att: unexpected type");
-#line 251
 		IF (length != ATT_LEN(i,j))
-#line 251
 		    error("nc_inq_att: unexpected length");
-#line 251
 		assert(length <= MAX_NELS);
-#line 251
 		nInIntRange = nInExtRange = 0;
-#line 251
 		for (k = 0; k < length; k++) {
-#line 251
 		    expect[k] = hash4( datatype, -1, &k, NCT_FLOAT);
-#line 251
 		    if (inRange3(expect[k], datatype, NCT_FLOAT)) {
-#line 251
 			++nInExtRange;
-#line 251
 			if (expect[k] >= float_min && expect[k] <= float_max)
-#line 251
 			    ++nInIntRange;
-#line 251
 		    }
-#line 251
 		}
-#line 251
 		err = nc_get_att_float(ncid, i, ATT_NAME(i,j), value);
-#line 251
                 if (nInExtRange == length && nInIntRange == length) {
-#line 251
 		    IF (err)
-#line 251
 			error("%s", nc_strerror(err));
-#line 251
                 } else {
-#line 251
                     IF (err != 0 && err != NC_ERANGE)
-#line 251
                         error("OK or Range error: status = %d", err);
-#line 251
                 }
-#line 251
 		for (k = 0; k < length; k++) {
-#line 251
                     if (inRange3(expect[k],datatype,NCT_FLOAT)
-#line 251
                             && expect[k] >= float_min && expect[k] <= float_max) {
-#line 251
                         IF (!equal(value[k],expect[k],datatype,NCT_FLOAT)) {
-#line 251
                             error("att. value read not that expected");
-#line 251
                             if (verbose) {
-#line 251
                                 error("\n");
-#line 251
                                 error("varid: %d, ", i);
-#line 251
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 251
                                 error("element number: %d ", k);
-#line 251
                                 error("expect: %g, ", expect[k]);
-#line 251
                                 error("got: %g", (double) value[k]);
-#line 251
                             }
-#line 251
                         } else {
-#line 251
                             nok++;
-#line 251
                         }
-#line 251
                     }
-#line 251
                 }
-#line 251
             }                                               
-#line 251
         }
-#line 251
     }
-#line 251
 
-#line 251
     print_nok(nok);
-#line 251
 }
-#line 251
 
 /* 
-#line 252
  *  check all attributes in file which are (text/numeric) compatible with TYPE
-#line 252
  *  ignore any attributes containing values outside range of TYPE
-#line 252
  */
-#line 252
 static
-#line 252
 void
-#line 252
 check_atts_double(int  ncid)
-#line 252
 {
-#line 252
     int  err;           /* status */
-#line 252
     int  i;
-#line 252
     int  j;
-#line 252
     size_t  k;
-#line 252
     double value[MAX_NELS];
-#line 252
     nc_type datatype;
-#line 252
     double expect[MAX_NELS];
-#line 252
     size_t length;
-#line 252
     size_t nInExtRange;  /* number values within external range */
-#line 252
     size_t nInIntRange;  /* number values within internal range */
-#line 252
     int canConvert;     /* Both text or both numeric */
-#line 252
     int nok = 0;      /* count of valid comparisons */
-#line 252
 
-#line 252
     for (i = -1; i < NVARS; i++) {
-#line 252
         for (j = 0; j < NATTS(i); j++) {
-#line 252
 	    canConvert = (ATT_TYPE(i,j) == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 252
 	    if (canConvert) {
-#line 252
 		err = nc_inq_att(ncid, i, ATT_NAME(i,j), &datatype, &length);
-#line 252
 		IF (err)
-#line 252
 		    error("nc_inq_att: %s", nc_strerror(err));
-#line 252
 		IF (datatype != ATT_TYPE(i,j))
-#line 252
 		error("nc_inq_att: unexpected type");
-#line 252
 		IF (length != ATT_LEN(i,j))
-#line 252
 		    error("nc_inq_att: unexpected length");
-#line 252
 		assert(length <= MAX_NELS);
-#line 252
 		nInIntRange = nInExtRange = 0;
-#line 252
 		for (k = 0; k < length; k++) {
-#line 252
 		    expect[k] = hash4( datatype, -1, &k, NCT_DOUBLE);
-#line 252
 		    if (inRange3(expect[k], datatype, NCT_DOUBLE)) {
-#line 252
 			++nInExtRange;
-#line 252
 			if (expect[k] >= double_min && expect[k] <= double_max)
-#line 252
 			    ++nInIntRange;
-#line 252
 		    }
-#line 252
 		}
-#line 252
 		err = nc_get_att_double(ncid, i, ATT_NAME(i,j), value);
-#line 252
                 if (nInExtRange == length && nInIntRange == length) {
-#line 252
 		    IF (err)
-#line 252
 			error("%s", nc_strerror(err));
-#line 252
                 } else {
-#line 252
                     IF (err != 0 && err != NC_ERANGE)
-#line 252
                         error("OK or Range error: status = %d", err);
-#line 252
                 }
-#line 252
 		for (k = 0; k < length; k++) {
-#line 252
                     if (inRange3(expect[k],datatype,NCT_DOUBLE)
-#line 252
                             && expect[k] >= double_min && expect[k] <= double_max) {
-#line 252
                         IF (!equal(value[k],expect[k],datatype,NCT_DOUBLE)) {
-#line 252
                             error("att. value read not that expected");
-#line 252
                             if (verbose) {
-#line 252
                                 error("\n");
-#line 252
                                 error("varid: %d, ", i);
-#line 252
                                 error("att_name: %s, ", ATT_NAME(i,j));
-#line 252
                                 error("element number: %d ", k);
-#line 252
                                 error("expect: %g, ", expect[k]);
-#line 252
                                 error("got: %g", (double) value[k]);
-#line 252
                             }
-#line 252
                         } else {
-#line 252
                             nok++;
-#line 252
                         }
-#line 252
                     }
-#line 252
                 }
-#line 252
             }                                               
-#line 252
         }
-#line 252
     }
-#line 252
 
-#line 252
     print_nok(nok);
-#line 252
 }
-#line 252
 
 
 
-#line 339
 
 void
-#line 340
 test_nc_put_var1_text(void)
-#line 340
 {
-#line 340
     int ncid;
-#line 340
     int i;
-#line 340
     int j;
-#line 340
     int err;
-#line 340
     size_t index[MAX_RANK];
-#line 340
     int canConvert;	/* Both text or both numeric */
-#line 340
     text value = 5;	/* any value would do - only for error cases */
-#line 340
 
-#line 340
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 340
     IF (err) {
-#line 340
         error("nc_create: %s", nc_strerror(err));
-#line 340
         return;
-#line 340
     }
-#line 340
     def_dims(ncid);
-#line 340
     def_vars(ncid);
-#line 340
     err = nc_enddef(ncid);
-#line 340
     IF (err)
-#line 340
         error("nc_enddef: %s", nc_strerror(err));
-#line 340
 
-#line 340
     for (i = 0; i < NVARS; i++) {
-#line 340
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 340
         for (j = 0; j < var_rank[i]; j++)
-#line 340
             index[j] = 0;
-#line 340
         err = nc_put_var1_text(BAD_ID, i, index, &value);
-#line 340
         IF (err != NC_EBADID) 
-#line 340
 	    error("bad ncid: status = %d", err);
-#line 340
         err = nc_put_var1_text(ncid, BAD_VARID, index, &value);
-#line 340
         IF (err != NC_ENOTVAR) 
-#line 340
 	    error("bad var id: status = %d", err);
-#line 340
         for (j = 0; j < var_rank[i]; j++) {
-#line 340
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 340
 		index[j] = var_shape[i][j];
-#line 340
 		err = nc_put_var1_text(ncid, i, index, &value);
-#line 340
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 340
 		    error("bad index: status = %d", err);
-#line 340
 		index[j] = 0;
-#line 340
 	    }
-#line 340
         }
-#line 340
         for (j = 0; j < var_nels[i]; j++) {
-#line 340
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 340
             IF (err) 
-#line 340
 		error("error in toMixedBase 1");
-#line 340
             value = hash_text( var_type[i], var_rank[i], index, NCT_TEXT);
-#line 340
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 340
 		err = nc_put_var1_text(ncid, i, NULL, &value);
-#line 340
 	    else
-#line 340
 		err = nc_put_var1_text(ncid, i, index, &value);
-#line 340
 	    if (canConvert) {
-#line 340
 		if (inRange3(value, var_type[i],NCT_TEXT)) {
-#line 340
 		    IF (err)
-#line 340
 			error("%s", nc_strerror(err));
-#line 340
 		} else {
-#line 340
 		    IF (err != NC_ERANGE) {
-#line 340
 			error("Range error: status = %d", err);
-#line 340
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 340
 				s_nc_type(var_type[i]),
-#line 340
 				(double)value, (long)value);
-#line 340
 		    }
-#line 340
 		}
-#line 340
 	    } else {
-#line 340
 		IF (err != NC_ECHAR)
-#line 340
 		    error("wrong type: status = %d", err);
-#line 340
             }
-#line 340
         }
-#line 340
     }
-#line 340
 
-#line 340
     err = nc_close(ncid);
-#line 340
     IF (err) 
-#line 340
 	error("nc_close: %s", nc_strerror(err));
-#line 340
 
-#line 340
     check_vars_text(scratch);
-#line 340
 
-#line 340
     err = remove(scratch);
-#line 340
     IF (err)
-#line 340
         error("remove of %s failed", scratch);
-#line 340
 }
-#line 340
 
 void
-#line 341
 test_nc_put_var1_uchar(void)
-#line 341
 {
-#line 341
     int ncid;
-#line 341
     int i;
-#line 341
     int j;
-#line 341
     int err;
-#line 341
     size_t index[MAX_RANK];
-#line 341
     int canConvert;	/* Both text or both numeric */
-#line 341
     uchar value = 5;	/* any value would do - only for error cases */
-#line 341
 
-#line 341
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 341
     IF (err) {
-#line 341
         error("nc_create: %s", nc_strerror(err));
-#line 341
         return;
-#line 341
     }
-#line 341
     def_dims(ncid);
-#line 341
     def_vars(ncid);
-#line 341
     err = nc_enddef(ncid);
-#line 341
     IF (err)
-#line 341
         error("nc_enddef: %s", nc_strerror(err));
-#line 341
 
-#line 341
     for (i = 0; i < NVARS; i++) {
-#line 341
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 341
         for (j = 0; j < var_rank[i]; j++)
-#line 341
             index[j] = 0;
-#line 341
         err = nc_put_var1_uchar(BAD_ID, i, index, &value);
-#line 341
         IF (err != NC_EBADID) 
-#line 341
 	    error("bad ncid: status = %d", err);
-#line 341
         err = nc_put_var1_uchar(ncid, BAD_VARID, index, &value);
-#line 341
         IF (err != NC_ENOTVAR) 
-#line 341
 	    error("bad var id: status = %d", err);
-#line 341
         for (j = 0; j < var_rank[i]; j++) {
-#line 341
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 341
 		index[j] = var_shape[i][j];
-#line 341
 		err = nc_put_var1_uchar(ncid, i, index, &value);
-#line 341
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 341
 		    error("bad index: status = %d", err);
-#line 341
 		index[j] = 0;
-#line 341
 	    }
-#line 341
         }
-#line 341
         for (j = 0; j < var_nels[i]; j++) {
-#line 341
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 341
             IF (err) 
-#line 341
 		error("error in toMixedBase 1");
-#line 341
             value = hash_uchar( var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 341
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 341
 		err = nc_put_var1_uchar(ncid, i, NULL, &value);
-#line 341
 	    else
-#line 341
 		err = nc_put_var1_uchar(ncid, i, index, &value);
-#line 341
 	    if (canConvert) {
-#line 341
 		if (inRange3(value, var_type[i],NCT_UCHAR)) {
-#line 341
 		    IF (err)
-#line 341
 			error("%s", nc_strerror(err));
-#line 341
 		} else {
-#line 341
 		    IF (err != NC_ERANGE) {
-#line 341
 			error("Range error: status = %d", err);
-#line 341
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 341
 				s_nc_type(var_type[i]),
-#line 341
 				(double)value, (long)value);
-#line 341
 		    }
-#line 341
 		}
-#line 341
 	    } else {
-#line 341
 		IF (err != NC_ECHAR)
-#line 341
 		    error("wrong type: status = %d", err);
-#line 341
             }
-#line 341
         }
-#line 341
     }
-#line 341
 
-#line 341
     err = nc_close(ncid);
-#line 341
     IF (err) 
-#line 341
 	error("nc_close: %s", nc_strerror(err));
-#line 341
 
-#line 341
     check_vars_uchar(scratch);
-#line 341
 
-#line 341
     err = remove(scratch);
-#line 341
     IF (err)
-#line 341
         error("remove of %s failed", scratch);
-#line 341
 }
-#line 341
 
 void
-#line 342
 test_nc_put_var1_schar(void)
-#line 342
 {
-#line 342
     int ncid;
-#line 342
     int i;
-#line 342
     int j;
-#line 342
     int err;
-#line 342
     size_t index[MAX_RANK];
-#line 342
     int canConvert;	/* Both text or both numeric */
-#line 342
     schar value = 5;	/* any value would do - only for error cases */
-#line 342
 
-#line 342
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 342
     IF (err) {
-#line 342
         error("nc_create: %s", nc_strerror(err));
-#line 342
         return;
-#line 342
     }
-#line 342
     def_dims(ncid);
-#line 342
     def_vars(ncid);
-#line 342
     err = nc_enddef(ncid);
-#line 342
     IF (err)
-#line 342
         error("nc_enddef: %s", nc_strerror(err));
-#line 342
 
-#line 342
     for (i = 0; i < NVARS; i++) {
-#line 342
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 342
         for (j = 0; j < var_rank[i]; j++)
-#line 342
             index[j] = 0;
-#line 342
         err = nc_put_var1_schar(BAD_ID, i, index, &value);
-#line 342
         IF (err != NC_EBADID) 
-#line 342
 	    error("bad ncid: status = %d", err);
-#line 342
         err = nc_put_var1_schar(ncid, BAD_VARID, index, &value);
-#line 342
         IF (err != NC_ENOTVAR) 
-#line 342
 	    error("bad var id: status = %d", err);
-#line 342
         for (j = 0; j < var_rank[i]; j++) {
-#line 342
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 342
 		index[j] = var_shape[i][j];
-#line 342
 		err = nc_put_var1_schar(ncid, i, index, &value);
-#line 342
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 342
 		    error("bad index: status = %d", err);
-#line 342
 		index[j] = 0;
-#line 342
 	    }
-#line 342
         }
-#line 342
         for (j = 0; j < var_nels[i]; j++) {
-#line 342
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 342
             IF (err) 
-#line 342
 		error("error in toMixedBase 1");
-#line 342
             value = hash_schar( var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 342
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 342
 		err = nc_put_var1_schar(ncid, i, NULL, &value);
-#line 342
 	    else
-#line 342
 		err = nc_put_var1_schar(ncid, i, index, &value);
-#line 342
 	    if (canConvert) {
-#line 342
 		if (inRange3(value, var_type[i],NCT_SCHAR)) {
-#line 342
 		    IF (err)
-#line 342
 			error("%s", nc_strerror(err));
-#line 342
 		} else {
-#line 342
 		    IF (err != NC_ERANGE) {
-#line 342
 			error("Range error: status = %d", err);
-#line 342
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 342
 				s_nc_type(var_type[i]),
-#line 342
 				(double)value, (long)value);
-#line 342
 		    }
-#line 342
 		}
-#line 342
 	    } else {
-#line 342
 		IF (err != NC_ECHAR)
-#line 342
 		    error("wrong type: status = %d", err);
-#line 342
             }
-#line 342
         }
-#line 342
     }
-#line 342
 
-#line 342
     err = nc_close(ncid);
-#line 342
     IF (err) 
-#line 342
 	error("nc_close: %s", nc_strerror(err));
-#line 342
 
-#line 342
     check_vars_schar(scratch);
-#line 342
 
-#line 342
     err = remove(scratch);
-#line 342
     IF (err)
-#line 342
         error("remove of %s failed", scratch);
-#line 342
 }
-#line 342
 
 void
-#line 343
 test_nc_put_var1_short(void)
-#line 343
 {
-#line 343
     int ncid;
-#line 343
     int i;
-#line 343
     int j;
-#line 343
     int err;
-#line 343
     size_t index[MAX_RANK];
-#line 343
     int canConvert;	/* Both text or both numeric */
-#line 343
     short value = 5;	/* any value would do - only for error cases */
-#line 343
 
-#line 343
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 343
     IF (err) {
-#line 343
         error("nc_create: %s", nc_strerror(err));
-#line 343
         return;
-#line 343
     }
-#line 343
     def_dims(ncid);
-#line 343
     def_vars(ncid);
-#line 343
     err = nc_enddef(ncid);
-#line 343
     IF (err)
-#line 343
         error("nc_enddef: %s", nc_strerror(err));
-#line 343
 
-#line 343
     for (i = 0; i < NVARS; i++) {
-#line 343
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 343
         for (j = 0; j < var_rank[i]; j++)
-#line 343
             index[j] = 0;
-#line 343
         err = nc_put_var1_short(BAD_ID, i, index, &value);
-#line 343
         IF (err != NC_EBADID) 
-#line 343
 	    error("bad ncid: status = %d", err);
-#line 343
         err = nc_put_var1_short(ncid, BAD_VARID, index, &value);
-#line 343
         IF (err != NC_ENOTVAR) 
-#line 343
 	    error("bad var id: status = %d", err);
-#line 343
         for (j = 0; j < var_rank[i]; j++) {
-#line 343
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 343
 		index[j] = var_shape[i][j];
-#line 343
 		err = nc_put_var1_short(ncid, i, index, &value);
-#line 343
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 343
 		    error("bad index: status = %d", err);
-#line 343
 		index[j] = 0;
-#line 343
 	    }
-#line 343
         }
-#line 343
         for (j = 0; j < var_nels[i]; j++) {
-#line 343
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 343
             IF (err) 
-#line 343
 		error("error in toMixedBase 1");
-#line 343
             value = hash_short( var_type[i], var_rank[i], index, NCT_SHORT);
-#line 343
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 343
 		err = nc_put_var1_short(ncid, i, NULL, &value);
-#line 343
 	    else
-#line 343
 		err = nc_put_var1_short(ncid, i, index, &value);
-#line 343
 	    if (canConvert) {
-#line 343
 		if (inRange3(value, var_type[i],NCT_SHORT)) {
-#line 343
 		    IF (err)
-#line 343
 			error("%s", nc_strerror(err));
-#line 343
 		} else {
-#line 343
 		    IF (err != NC_ERANGE) {
-#line 343
 			error("Range error: status = %d", err);
-#line 343
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 343
 				s_nc_type(var_type[i]),
-#line 343
 				(double)value, (long)value);
-#line 343
 		    }
-#line 343
 		}
-#line 343
 	    } else {
-#line 343
 		IF (err != NC_ECHAR)
-#line 343
 		    error("wrong type: status = %d", err);
-#line 343
             }
-#line 343
         }
-#line 343
     }
-#line 343
 
-#line 343
     err = nc_close(ncid);
-#line 343
     IF (err) 
-#line 343
 	error("nc_close: %s", nc_strerror(err));
-#line 343
 
-#line 343
     check_vars_short(scratch);
-#line 343
 
-#line 343
     err = remove(scratch);
-#line 343
     IF (err)
-#line 343
         error("remove of %s failed", scratch);
-#line 343
 }
-#line 343
 
 void
-#line 344
 test_nc_put_var1_int(void)
-#line 344
 {
-#line 344
     int ncid;
-#line 344
     int i;
-#line 344
     int j;
-#line 344
     int err;
-#line 344
     size_t index[MAX_RANK];
-#line 344
     int canConvert;	/* Both text or both numeric */
-#line 344
     int value = 5;	/* any value would do - only for error cases */
-#line 344
 
-#line 344
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 344
     IF (err) {
-#line 344
         error("nc_create: %s", nc_strerror(err));
-#line 344
         return;
-#line 344
     }
-#line 344
     def_dims(ncid);
-#line 344
     def_vars(ncid);
-#line 344
     err = nc_enddef(ncid);
-#line 344
     IF (err)
-#line 344
         error("nc_enddef: %s", nc_strerror(err));
-#line 344
 
-#line 344
     for (i = 0; i < NVARS; i++) {
-#line 344
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 344
         for (j = 0; j < var_rank[i]; j++)
-#line 344
             index[j] = 0;
-#line 344
         err = nc_put_var1_int(BAD_ID, i, index, &value);
-#line 344
         IF (err != NC_EBADID) 
-#line 344
 	    error("bad ncid: status = %d", err);
-#line 344
         err = nc_put_var1_int(ncid, BAD_VARID, index, &value);
-#line 344
         IF (err != NC_ENOTVAR) 
-#line 344
 	    error("bad var id: status = %d", err);
-#line 344
         for (j = 0; j < var_rank[i]; j++) {
-#line 344
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 344
 		index[j] = var_shape[i][j];
-#line 344
 		err = nc_put_var1_int(ncid, i, index, &value);
-#line 344
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 344
 		    error("bad index: status = %d", err);
-#line 344
 		index[j] = 0;
-#line 344
 	    }
-#line 344
         }
-#line 344
         for (j = 0; j < var_nels[i]; j++) {
-#line 344
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 344
             IF (err) 
-#line 344
 		error("error in toMixedBase 1");
-#line 344
             value = hash_int( var_type[i], var_rank[i], index, NCT_INT);
-#line 344
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 344
 		err = nc_put_var1_int(ncid, i, NULL, &value);
-#line 344
 	    else
-#line 344
 		err = nc_put_var1_int(ncid, i, index, &value);
-#line 344
 	    if (canConvert) {
-#line 344
 		if (inRange3(value, var_type[i],NCT_INT)) {
-#line 344
 		    IF (err)
-#line 344
 			error("%s", nc_strerror(err));
-#line 344
 		} else {
-#line 344
 		    IF (err != NC_ERANGE) {
-#line 344
 			error("Range error: status = %d", err);
-#line 344
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 344
 				s_nc_type(var_type[i]),
-#line 344
 				(double)value, (long)value);
-#line 344
 		    }
-#line 344
 		}
-#line 344
 	    } else {
-#line 344
 		IF (err != NC_ECHAR)
-#line 344
 		    error("wrong type: status = %d", err);
-#line 344
             }
-#line 344
         }
-#line 344
     }
-#line 344
 
-#line 344
     err = nc_close(ncid);
-#line 344
     IF (err) 
-#line 344
 	error("nc_close: %s", nc_strerror(err));
-#line 344
 
-#line 344
     check_vars_int(scratch);
-#line 344
 
-#line 344
     err = remove(scratch);
-#line 344
     IF (err)
-#line 344
         error("remove of %s failed", scratch);
-#line 344
 }
-#line 344
 
 void
-#line 345
 test_nc_put_var1_long(void)
-#line 345
 {
-#line 345
     int ncid;
-#line 345
     int i;
-#line 345
     int j;
-#line 345
     int err;
-#line 345
     size_t index[MAX_RANK];
-#line 345
     int canConvert;	/* Both text or both numeric */
-#line 345
     long value = 5;	/* any value would do - only for error cases */
-#line 345
 
-#line 345
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 345
     IF (err) {
-#line 345
         error("nc_create: %s", nc_strerror(err));
-#line 345
         return;
-#line 345
     }
-#line 345
     def_dims(ncid);
-#line 345
     def_vars(ncid);
-#line 345
     err = nc_enddef(ncid);
-#line 345
     IF (err)
-#line 345
         error("nc_enddef: %s", nc_strerror(err));
-#line 345
 
-#line 345
     for (i = 0; i < NVARS; i++) {
-#line 345
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 345
         for (j = 0; j < var_rank[i]; j++)
-#line 345
             index[j] = 0;
-#line 345
         err = nc_put_var1_long(BAD_ID, i, index, &value);
-#line 345
         IF (err != NC_EBADID) 
-#line 345
 	    error("bad ncid: status = %d", err);
-#line 345
         err = nc_put_var1_long(ncid, BAD_VARID, index, &value);
-#line 345
         IF (err != NC_ENOTVAR) 
-#line 345
 	    error("bad var id: status = %d", err);
-#line 345
         for (j = 0; j < var_rank[i]; j++) {
-#line 345
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 345
 		index[j] = var_shape[i][j];
-#line 345
 		err = nc_put_var1_long(ncid, i, index, &value);
-#line 345
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 345
 		    error("bad index: status = %d", err);
-#line 345
 		index[j] = 0;
-#line 345
 	    }
-#line 345
         }
-#line 345
         for (j = 0; j < var_nels[i]; j++) {
-#line 345
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 345
             IF (err) 
-#line 345
 		error("error in toMixedBase 1");
-#line 345
             value = hash_long( var_type[i], var_rank[i], index, NCT_LONG);
-#line 345
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 345
 		err = nc_put_var1_long(ncid, i, NULL, &value);
-#line 345
 	    else
-#line 345
 		err = nc_put_var1_long(ncid, i, index, &value);
-#line 345
 	    if (canConvert) {
-#line 345
 		if (inRange3(value, var_type[i],NCT_LONG)) {
-#line 345
 		    IF (err)
-#line 345
 			error("%s", nc_strerror(err));
-#line 345
 		} else {
-#line 345
 		    IF (err != NC_ERANGE) {
-#line 345
 			error("Range error: status = %d", err);
-#line 345
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 345
 				s_nc_type(var_type[i]),
-#line 345
 				(double)value, (long)value);
-#line 345
 		    }
-#line 345
 		}
-#line 345
 	    } else {
-#line 345
 		IF (err != NC_ECHAR)
-#line 345
 		    error("wrong type: status = %d", err);
-#line 345
             }
-#line 345
         }
-#line 345
     }
-#line 345
 
-#line 345
     err = nc_close(ncid);
-#line 345
     IF (err) 
-#line 345
 	error("nc_close: %s", nc_strerror(err));
-#line 345
 
-#line 345
     check_vars_long(scratch);
-#line 345
 
-#line 345
     err = remove(scratch);
-#line 345
     IF (err)
-#line 345
         error("remove of %s failed", scratch);
-#line 345
 }
-#line 345
 
 void
-#line 346
 test_nc_put_var1_float(void)
-#line 346
 {
-#line 346
     int ncid;
-#line 346
     int i;
-#line 346
     int j;
-#line 346
     int err;
-#line 346
     size_t index[MAX_RANK];
-#line 346
     int canConvert;	/* Both text or both numeric */
-#line 346
     float value = 5;	/* any value would do - only for error cases */
-#line 346
 
-#line 346
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 346
     IF (err) {
-#line 346
         error("nc_create: %s", nc_strerror(err));
-#line 346
         return;
-#line 346
     }
-#line 346
     def_dims(ncid);
-#line 346
     def_vars(ncid);
-#line 346
     err = nc_enddef(ncid);
-#line 346
     IF (err)
-#line 346
         error("nc_enddef: %s", nc_strerror(err));
-#line 346
 
-#line 346
     for (i = 0; i < NVARS; i++) {
-#line 346
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 346
         for (j = 0; j < var_rank[i]; j++)
-#line 346
             index[j] = 0;
-#line 346
         err = nc_put_var1_float(BAD_ID, i, index, &value);
-#line 346
         IF (err != NC_EBADID) 
-#line 346
 	    error("bad ncid: status = %d", err);
-#line 346
         err = nc_put_var1_float(ncid, BAD_VARID, index, &value);
-#line 346
         IF (err != NC_ENOTVAR) 
-#line 346
 	    error("bad var id: status = %d", err);
-#line 346
         for (j = 0; j < var_rank[i]; j++) {
-#line 346
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 346
 		index[j] = var_shape[i][j];
-#line 346
 		err = nc_put_var1_float(ncid, i, index, &value);
-#line 346
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 346
 		    error("bad index: status = %d", err);
-#line 346
 		index[j] = 0;
-#line 346
 	    }
-#line 346
         }
-#line 346
         for (j = 0; j < var_nels[i]; j++) {
-#line 346
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 346
             IF (err) 
-#line 346
 		error("error in toMixedBase 1");
-#line 346
             value = hash_float( var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 346
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 346
 		err = nc_put_var1_float(ncid, i, NULL, &value);
-#line 346
 	    else
-#line 346
 		err = nc_put_var1_float(ncid, i, index, &value);
-#line 346
 	    if (canConvert) {
-#line 346
 		if (inRange3(value, var_type[i],NCT_FLOAT)) {
-#line 346
 		    IF (err)
-#line 346
 			error("%s", nc_strerror(err));
-#line 346
 		} else {
-#line 346
 		    IF (err != NC_ERANGE) {
-#line 346
 			error("Range error: status = %d", err);
-#line 346
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 346
 				s_nc_type(var_type[i]),
-#line 346
 				(double)value, (long)value);
-#line 346
 		    }
-#line 346
 		}
-#line 346
 	    } else {
-#line 346
 		IF (err != NC_ECHAR)
-#line 346
 		    error("wrong type: status = %d", err);
-#line 346
             }
-#line 346
         }
-#line 346
     }
-#line 346
 
-#line 346
     err = nc_close(ncid);
-#line 346
     IF (err) 
-#line 346
 	error("nc_close: %s", nc_strerror(err));
-#line 346
 
-#line 346
     check_vars_float(scratch);
-#line 346
 
-#line 346
     err = remove(scratch);
-#line 346
     IF (err)
-#line 346
         error("remove of %s failed", scratch);
-#line 346
 }
-#line 346
 
 void
-#line 347
 test_nc_put_var1_double(void)
-#line 347
 {
-#line 347
     int ncid;
-#line 347
     int i;
-#line 347
     int j;
-#line 347
     int err;
-#line 347
     size_t index[MAX_RANK];
-#line 347
     int canConvert;	/* Both text or both numeric */
-#line 347
     double value = 5;	/* any value would do - only for error cases */
-#line 347
 
-#line 347
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 347
     IF (err) {
-#line 347
         error("nc_create: %s", nc_strerror(err));
-#line 347
         return;
-#line 347
     }
-#line 347
     def_dims(ncid);
-#line 347
     def_vars(ncid);
-#line 347
     err = nc_enddef(ncid);
-#line 347
     IF (err)
-#line 347
         error("nc_enddef: %s", nc_strerror(err));
-#line 347
 
-#line 347
     for (i = 0; i < NVARS; i++) {
-#line 347
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 347
         for (j = 0; j < var_rank[i]; j++)
-#line 347
             index[j] = 0;
-#line 347
         err = nc_put_var1_double(BAD_ID, i, index, &value);
-#line 347
         IF (err != NC_EBADID) 
-#line 347
 	    error("bad ncid: status = %d", err);
-#line 347
         err = nc_put_var1_double(ncid, BAD_VARID, index, &value);
-#line 347
         IF (err != NC_ENOTVAR) 
-#line 347
 	    error("bad var id: status = %d", err);
-#line 347
         for (j = 0; j < var_rank[i]; j++) {
-#line 347
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 347
 		index[j] = var_shape[i][j];
-#line 347
 		err = nc_put_var1_double(ncid, i, index, &value);
-#line 347
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 347
 		    error("bad index: status = %d", err);
-#line 347
 		index[j] = 0;
-#line 347
 	    }
-#line 347
         }
-#line 347
         for (j = 0; j < var_nels[i]; j++) {
-#line 347
             err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 347
             IF (err) 
-#line 347
 		error("error in toMixedBase 1");
-#line 347
             value = hash_double( var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 347
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 347
 		err = nc_put_var1_double(ncid, i, NULL, &value);
-#line 347
 	    else
-#line 347
 		err = nc_put_var1_double(ncid, i, index, &value);
-#line 347
 	    if (canConvert) {
-#line 347
 		if (inRange3(value, var_type[i],NCT_DOUBLE)) {
-#line 347
 		    IF (err)
-#line 347
 			error("%s", nc_strerror(err));
-#line 347
 		} else {
-#line 347
 		    IF (err != NC_ERANGE) {
-#line 347
 			error("Range error: status = %d", err);
-#line 347
 			error("\n\t\tfor type %s value %.17e %ld",
-#line 347
 				s_nc_type(var_type[i]),
-#line 347
 				(double)value, (long)value);
-#line 347
 		    }
-#line 347
 		}
-#line 347
 	    } else {
-#line 347
 		IF (err != NC_ECHAR)
-#line 347
 		    error("wrong type: status = %d", err);
-#line 347
             }
-#line 347
         }
-#line 347
     }
-#line 347
 
-#line 347
     err = nc_close(ncid);
-#line 347
     IF (err) 
-#line 347
 	error("nc_close: %s", nc_strerror(err));
-#line 347
 
-#line 347
     check_vars_double(scratch);
-#line 347
 
-#line 347
     err = remove(scratch);
-#line 347
     IF (err)
-#line 347
         error("remove of %s failed", scratch);
-#line 347
 }
-#line 347
 
 
 
-#line 477
 
 void
-#line 478
 test_nc_put_var_text(void)
-#line 478
 {
-#line 478
     int ncid;
-#line 478
     int varid;
-#line 478
     int i;
-#line 478
     int j;
-#line 478
     int err;
-#line 478
     int nels;
-#line 478
     size_t index[MAX_RANK];
-#line 478
     int canConvert;	/* Both text or both numeric */
-#line 478
     int allInExtRange;	/* all values within external range? */
-#line 478
     text value[MAX_NELS];
-#line 478
 
-#line 478
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 478
     IF (err) {
-#line 478
         error("nc_create: %s", nc_strerror(err));
-#line 478
         return;
-#line 478
     }
-#line 478
     def_dims(ncid);
-#line 478
     def_vars(ncid);
-#line 478
     err = nc_enddef(ncid);
-#line 478
     IF (err)
-#line 478
         error("nc_enddef: %s", nc_strerror(err));
-#line 478
 
-#line 478
     for (i = 0; i < NVARS; i++) {
-#line 478
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 478
         assert(var_rank[i] <= MAX_RANK);
-#line 478
         assert(var_nels[i] <= MAX_NELS);
-#line 478
         err = nc_put_var_text(BAD_ID, i, value);
-#line 478
         IF (err != NC_EBADID) 
-#line 478
 	    error("bad ncid: status = %d", err);
-#line 478
         err = nc_put_var_text(ncid, BAD_VARID, value);
-#line 478
         IF (err != NC_ENOTVAR) 
-#line 478
 	    error("bad var id: status = %d", err);
-#line 478
 
-#line 478
 	nels = 1;
-#line 478
 	for (j = 0; j < var_rank[i]; j++) {
-#line 478
 	    nels *= var_shape[i][j];
-#line 478
 	}
-#line 478
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 478
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 478
 	    IF (err) 
-#line 478
 		error("error in toMixedBase 1");
-#line 478
 	    value[j]= hash_text(var_type[i], var_rank[i], index, NCT_TEXT);
-#line 478
 	    allInExtRange = allInExtRange 
-#line 478
 		&& inRange3(value[j], var_type[i], NCT_TEXT);
-#line 478
 	}
-#line 478
         err = nc_put_var_text(ncid, i, value);
-#line 478
 	if (canConvert) {
-#line 478
 	    if (allInExtRange) {
-#line 478
 		IF (err) 
-#line 478
 		    error("%s", nc_strerror(err));
-#line 478
 	    } else {
-#line 478
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 478
 		    error("range error: status = %d", err);
-#line 478
 	    }
-#line 478
 	} else {       /* should flag wrong type even if nothing to write */
-#line 478
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 478
 		error("wrong type: status = %d", err);
-#line 478
 	}
-#line 478
     }
-#line 478
 
-#line 478
         /* Preceeding has written nothing for record variables, now try */
-#line 478
         /* again with more than 0 records */
-#line 478
 
-#line 478
 	/* Write record number NRECS to force writing of preceding records */
-#line 478
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 478
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 478
     IF (err)
-#line 478
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 478
     index[0] = NRECS-1;
-#line 478
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 478
     IF (err)
-#line 478
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 478
 
-#line 478
     for (i = 0; i < NVARS; i++) {
-#line 478
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 478
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 478
 	    assert(var_rank[i] <= MAX_RANK);
-#line 478
 	    assert(var_nels[i] <= MAX_NELS);
-#line 478
 	    err = nc_put_var_text(BAD_ID, i, value);
-#line 478
 	    IF (err != NC_EBADID) 
-#line 478
 	        error("bad ncid: status = %d", err);
-#line 478
 	    nels = 1;
-#line 478
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 478
 		nels *= var_shape[i][j];
-#line 478
 	    }
-#line 478
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 478
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 478
 		IF (err) 
-#line 478
 		    error("error in toMixedBase 1");
-#line 478
 		value[j]= hash_text(var_type[i], var_rank[i], index, NCT_TEXT);
-#line 478
 		allInExtRange = allInExtRange 
-#line 478
 		    && inRange3(value[j], var_type[i], NCT_TEXT);
-#line 478
 	    }
-#line 478
 	    err = nc_put_var_text(ncid, i, value);
-#line 478
 	    if (canConvert) {
-#line 478
 		if (allInExtRange) {
-#line 478
 		    IF (err) 
-#line 478
 			error("%s", nc_strerror(err));
-#line 478
 		} else {
-#line 478
 		    IF (err != NC_ERANGE)
-#line 478
 			error("range error: status = %d", err);
-#line 478
 		}
-#line 478
 	    } else {
-#line 478
 		IF (nels > 0 && err != NC_ECHAR)
-#line 478
 		    error("wrong type: status = %d", err);
-#line 478
 	    }
-#line 478
         }
-#line 478
     }
-#line 478
 
-#line 478
     err = nc_close(ncid);
-#line 478
     IF (err) 
-#line 478
 	error("nc_close: %s", nc_strerror(err));
-#line 478
 
-#line 478
     check_vars_text(scratch);
-#line 478
 
-#line 478
     err = remove(scratch);
-#line 478
     IF (err)
-#line 478
         error("remove of %s failed", scratch);
-#line 478
 }
-#line 478
 
 void
-#line 479
 test_nc_put_var_uchar(void)
-#line 479
 {
-#line 479
     int ncid;
-#line 479
     int varid;
-#line 479
     int i;
-#line 479
     int j;
-#line 479
     int err;
-#line 479
     int nels;
-#line 479
     size_t index[MAX_RANK];
-#line 479
     int canConvert;	/* Both text or both numeric */
-#line 479
     int allInExtRange;	/* all values within external range? */
-#line 479
     uchar value[MAX_NELS];
-#line 479
 
-#line 479
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 479
     IF (err) {
-#line 479
         error("nc_create: %s", nc_strerror(err));
-#line 479
         return;
-#line 479
     }
-#line 479
     def_dims(ncid);
-#line 479
     def_vars(ncid);
-#line 479
     err = nc_enddef(ncid);
-#line 479
     IF (err)
-#line 479
         error("nc_enddef: %s", nc_strerror(err));
-#line 479
 
-#line 479
     for (i = 0; i < NVARS; i++) {
-#line 479
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 479
         assert(var_rank[i] <= MAX_RANK);
-#line 479
         assert(var_nels[i] <= MAX_NELS);
-#line 479
         err = nc_put_var_uchar(BAD_ID, i, value);
-#line 479
         IF (err != NC_EBADID) 
-#line 479
 	    error("bad ncid: status = %d", err);
-#line 479
         err = nc_put_var_uchar(ncid, BAD_VARID, value);
-#line 479
         IF (err != NC_ENOTVAR) 
-#line 479
 	    error("bad var id: status = %d", err);
-#line 479
 
-#line 479
 	nels = 1;
-#line 479
 	for (j = 0; j < var_rank[i]; j++) {
-#line 479
 	    nels *= var_shape[i][j];
-#line 479
 	}
-#line 479
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 479
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 479
 	    IF (err) 
-#line 479
 		error("error in toMixedBase 1");
-#line 479
 	    value[j]= hash_uchar(var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 479
 	    allInExtRange = allInExtRange 
-#line 479
 		&& inRange3(value[j], var_type[i], NCT_UCHAR);
-#line 479
 	}
-#line 479
         err = nc_put_var_uchar(ncid, i, value);
-#line 479
 	if (canConvert) {
-#line 479
 	    if (allInExtRange) {
-#line 479
 		IF (err) 
-#line 479
 		    error("%s", nc_strerror(err));
-#line 479
 	    } else {
-#line 479
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 479
 		    error("range error: status = %d", err);
-#line 479
 	    }
-#line 479
 	} else {       /* should flag wrong type even if nothing to write */
-#line 479
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 479
 		error("wrong type: status = %d", err);
-#line 479
 	}
-#line 479
     }
-#line 479
 
-#line 479
         /* Preceeding has written nothing for record variables, now try */
-#line 479
         /* again with more than 0 records */
-#line 479
 
-#line 479
 	/* Write record number NRECS to force writing of preceding records */
-#line 479
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 479
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 479
     IF (err)
-#line 479
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 479
     index[0] = NRECS-1;
-#line 479
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 479
     IF (err)
-#line 479
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 479
 
-#line 479
     for (i = 0; i < NVARS; i++) {
-#line 479
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 479
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 479
 	    assert(var_rank[i] <= MAX_RANK);
-#line 479
 	    assert(var_nels[i] <= MAX_NELS);
-#line 479
 	    err = nc_put_var_uchar(BAD_ID, i, value);
-#line 479
 	    IF (err != NC_EBADID) 
-#line 479
 	        error("bad ncid: status = %d", err);
-#line 479
 	    nels = 1;
-#line 479
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 479
 		nels *= var_shape[i][j];
-#line 479
 	    }
-#line 479
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 479
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 479
 		IF (err) 
-#line 479
 		    error("error in toMixedBase 1");
-#line 479
 		value[j]= hash_uchar(var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 479
 		allInExtRange = allInExtRange 
-#line 479
 		    && inRange3(value[j], var_type[i], NCT_UCHAR);
-#line 479
 	    }
-#line 479
 	    err = nc_put_var_uchar(ncid, i, value);
-#line 479
 	    if (canConvert) {
-#line 479
 		if (allInExtRange) {
-#line 479
 		    IF (err) 
-#line 479
 			error("%s", nc_strerror(err));
-#line 479
 		} else {
-#line 479
 		    IF (err != NC_ERANGE)
-#line 479
 			error("range error: status = %d", err);
-#line 479
 		}
-#line 479
 	    } else {
-#line 479
 		IF (nels > 0 && err != NC_ECHAR)
-#line 479
 		    error("wrong type: status = %d", err);
-#line 479
 	    }
-#line 479
         }
-#line 479
     }
-#line 479
 
-#line 479
     err = nc_close(ncid);
-#line 479
     IF (err) 
-#line 479
 	error("nc_close: %s", nc_strerror(err));
-#line 479
 
-#line 479
     check_vars_uchar(scratch);
-#line 479
 
-#line 479
     err = remove(scratch);
-#line 479
     IF (err)
-#line 479
         error("remove of %s failed", scratch);
-#line 479
 }
-#line 479
 
 void
-#line 480
 test_nc_put_var_schar(void)
-#line 480
 {
-#line 480
     int ncid;
-#line 480
     int varid;
-#line 480
     int i;
-#line 480
     int j;
-#line 480
     int err;
-#line 480
     int nels;
-#line 480
     size_t index[MAX_RANK];
-#line 480
     int canConvert;	/* Both text or both numeric */
-#line 480
     int allInExtRange;	/* all values within external range? */
-#line 480
     schar value[MAX_NELS];
-#line 480
 
-#line 480
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 480
     IF (err) {
-#line 480
         error("nc_create: %s", nc_strerror(err));
-#line 480
         return;
-#line 480
     }
-#line 480
     def_dims(ncid);
-#line 480
     def_vars(ncid);
-#line 480
     err = nc_enddef(ncid);
-#line 480
     IF (err)
-#line 480
         error("nc_enddef: %s", nc_strerror(err));
-#line 480
 
-#line 480
     for (i = 0; i < NVARS; i++) {
-#line 480
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 480
         assert(var_rank[i] <= MAX_RANK);
-#line 480
         assert(var_nels[i] <= MAX_NELS);
-#line 480
         err = nc_put_var_schar(BAD_ID, i, value);
-#line 480
         IF (err != NC_EBADID) 
-#line 480
 	    error("bad ncid: status = %d", err);
-#line 480
         err = nc_put_var_schar(ncid, BAD_VARID, value);
-#line 480
         IF (err != NC_ENOTVAR) 
-#line 480
 	    error("bad var id: status = %d", err);
-#line 480
 
-#line 480
 	nels = 1;
-#line 480
 	for (j = 0; j < var_rank[i]; j++) {
-#line 480
 	    nels *= var_shape[i][j];
-#line 480
 	}
-#line 480
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 480
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 480
 	    IF (err) 
-#line 480
 		error("error in toMixedBase 1");
-#line 480
 	    value[j]= hash_schar(var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 480
 	    allInExtRange = allInExtRange 
-#line 480
 		&& inRange3(value[j], var_type[i], NCT_SCHAR);
-#line 480
 	}
-#line 480
         err = nc_put_var_schar(ncid, i, value);
-#line 480
 	if (canConvert) {
-#line 480
 	    if (allInExtRange) {
-#line 480
 		IF (err) 
-#line 480
 		    error("%s", nc_strerror(err));
-#line 480
 	    } else {
-#line 480
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 480
 		    error("range error: status = %d", err);
-#line 480
 	    }
-#line 480
 	} else {       /* should flag wrong type even if nothing to write */
-#line 480
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 480
 		error("wrong type: status = %d", err);
-#line 480
 	}
-#line 480
     }
-#line 480
 
-#line 480
         /* Preceeding has written nothing for record variables, now try */
-#line 480
         /* again with more than 0 records */
-#line 480
 
-#line 480
 	/* Write record number NRECS to force writing of preceding records */
-#line 480
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 480
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 480
     IF (err)
-#line 480
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 480
     index[0] = NRECS-1;
-#line 480
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 480
     IF (err)
-#line 480
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 480
 
-#line 480
     for (i = 0; i < NVARS; i++) {
-#line 480
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 480
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 480
 	    assert(var_rank[i] <= MAX_RANK);
-#line 480
 	    assert(var_nels[i] <= MAX_NELS);
-#line 480
 	    err = nc_put_var_schar(BAD_ID, i, value);
-#line 480
 	    IF (err != NC_EBADID) 
-#line 480
 	        error("bad ncid: status = %d", err);
-#line 480
 	    nels = 1;
-#line 480
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 480
 		nels *= var_shape[i][j];
-#line 480
 	    }
-#line 480
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 480
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 480
 		IF (err) 
-#line 480
 		    error("error in toMixedBase 1");
-#line 480
 		value[j]= hash_schar(var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 480
 		allInExtRange = allInExtRange 
-#line 480
 		    && inRange3(value[j], var_type[i], NCT_SCHAR);
-#line 480
 	    }
-#line 480
 	    err = nc_put_var_schar(ncid, i, value);
-#line 480
 	    if (canConvert) {
-#line 480
 		if (allInExtRange) {
-#line 480
 		    IF (err) 
-#line 480
 			error("%s", nc_strerror(err));
-#line 480
 		} else {
-#line 480
 		    IF (err != NC_ERANGE)
-#line 480
 			error("range error: status = %d", err);
-#line 480
 		}
-#line 480
 	    } else {
-#line 480
 		IF (nels > 0 && err != NC_ECHAR)
-#line 480
 		    error("wrong type: status = %d", err);
-#line 480
 	    }
-#line 480
         }
-#line 480
     }
-#line 480
 
-#line 480
     err = nc_close(ncid);
-#line 480
     IF (err) 
-#line 480
 	error("nc_close: %s", nc_strerror(err));
-#line 480
 
-#line 480
     check_vars_schar(scratch);
-#line 480
 
-#line 480
     err = remove(scratch);
-#line 480
     IF (err)
-#line 480
         error("remove of %s failed", scratch);
-#line 480
 }
-#line 480
 
 void
-#line 481
 test_nc_put_var_short(void)
-#line 481
 {
-#line 481
     int ncid;
-#line 481
     int varid;
-#line 481
     int i;
-#line 481
     int j;
-#line 481
     int err;
-#line 481
     int nels;
-#line 481
     size_t index[MAX_RANK];
-#line 481
     int canConvert;	/* Both text or both numeric */
-#line 481
     int allInExtRange;	/* all values within external range? */
-#line 481
     short value[MAX_NELS];
-#line 481
 
-#line 481
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 481
     IF (err) {
-#line 481
         error("nc_create: %s", nc_strerror(err));
-#line 481
         return;
-#line 481
     }
-#line 481
     def_dims(ncid);
-#line 481
     def_vars(ncid);
-#line 481
     err = nc_enddef(ncid);
-#line 481
     IF (err)
-#line 481
         error("nc_enddef: %s", nc_strerror(err));
-#line 481
 
-#line 481
     for (i = 0; i < NVARS; i++) {
-#line 481
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 481
         assert(var_rank[i] <= MAX_RANK);
-#line 481
         assert(var_nels[i] <= MAX_NELS);
-#line 481
         err = nc_put_var_short(BAD_ID, i, value);
-#line 481
         IF (err != NC_EBADID) 
-#line 481
 	    error("bad ncid: status = %d", err);
-#line 481
         err = nc_put_var_short(ncid, BAD_VARID, value);
-#line 481
         IF (err != NC_ENOTVAR) 
-#line 481
 	    error("bad var id: status = %d", err);
-#line 481
 
-#line 481
 	nels = 1;
-#line 481
 	for (j = 0; j < var_rank[i]; j++) {
-#line 481
 	    nels *= var_shape[i][j];
-#line 481
 	}
-#line 481
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 481
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 481
 	    IF (err) 
-#line 481
 		error("error in toMixedBase 1");
-#line 481
 	    value[j]= hash_short(var_type[i], var_rank[i], index, NCT_SHORT);
-#line 481
 	    allInExtRange = allInExtRange 
-#line 481
 		&& inRange3(value[j], var_type[i], NCT_SHORT);
-#line 481
 	}
-#line 481
         err = nc_put_var_short(ncid, i, value);
-#line 481
 	if (canConvert) {
-#line 481
 	    if (allInExtRange) {
-#line 481
 		IF (err) 
-#line 481
 		    error("%s", nc_strerror(err));
-#line 481
 	    } else {
-#line 481
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 481
 		    error("range error: status = %d", err);
-#line 481
 	    }
-#line 481
 	} else {       /* should flag wrong type even if nothing to write */
-#line 481
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 481
 		error("wrong type: status = %d", err);
-#line 481
 	}
-#line 481
     }
-#line 481
 
-#line 481
         /* Preceeding has written nothing for record variables, now try */
-#line 481
         /* again with more than 0 records */
-#line 481
 
-#line 481
 	/* Write record number NRECS to force writing of preceding records */
-#line 481
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 481
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 481
     IF (err)
-#line 481
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 481
     index[0] = NRECS-1;
-#line 481
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 481
     IF (err)
-#line 481
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 481
 
-#line 481
     for (i = 0; i < NVARS; i++) {
-#line 481
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 481
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 481
 	    assert(var_rank[i] <= MAX_RANK);
-#line 481
 	    assert(var_nels[i] <= MAX_NELS);
-#line 481
 	    err = nc_put_var_short(BAD_ID, i, value);
-#line 481
 	    IF (err != NC_EBADID) 
-#line 481
 	        error("bad ncid: status = %d", err);
-#line 481
 	    nels = 1;
-#line 481
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 481
 		nels *= var_shape[i][j];
-#line 481
 	    }
-#line 481
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 481
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 481
 		IF (err) 
-#line 481
 		    error("error in toMixedBase 1");
-#line 481
 		value[j]= hash_short(var_type[i], var_rank[i], index, NCT_SHORT);
-#line 481
 		allInExtRange = allInExtRange 
-#line 481
 		    && inRange3(value[j], var_type[i], NCT_SHORT);
-#line 481
 	    }
-#line 481
 	    err = nc_put_var_short(ncid, i, value);
-#line 481
 	    if (canConvert) {
-#line 481
 		if (allInExtRange) {
-#line 481
 		    IF (err) 
-#line 481
 			error("%s", nc_strerror(err));
-#line 481
 		} else {
-#line 481
 		    IF (err != NC_ERANGE)
-#line 481
 			error("range error: status = %d", err);
-#line 481
 		}
-#line 481
 	    } else {
-#line 481
 		IF (nels > 0 && err != NC_ECHAR)
-#line 481
 		    error("wrong type: status = %d", err);
-#line 481
 	    }
-#line 481
         }
-#line 481
     }
-#line 481
 
-#line 481
     err = nc_close(ncid);
-#line 481
     IF (err) 
-#line 481
 	error("nc_close: %s", nc_strerror(err));
-#line 481
 
-#line 481
     check_vars_short(scratch);
-#line 481
 
-#line 481
     err = remove(scratch);
-#line 481
     IF (err)
-#line 481
         error("remove of %s failed", scratch);
-#line 481
 }
-#line 481
 
 void
-#line 482
 test_nc_put_var_int(void)
-#line 482
 {
-#line 482
     int ncid;
-#line 482
     int varid;
-#line 482
     int i;
-#line 482
     int j;
-#line 482
     int err;
-#line 482
     int nels;
-#line 482
     size_t index[MAX_RANK];
-#line 482
     int canConvert;	/* Both text or both numeric */
-#line 482
     int allInExtRange;	/* all values within external range? */
-#line 482
     int value[MAX_NELS];
-#line 482
 
-#line 482
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 482
     IF (err) {
-#line 482
         error("nc_create: %s", nc_strerror(err));
-#line 482
         return;
-#line 482
     }
-#line 482
     def_dims(ncid);
-#line 482
     def_vars(ncid);
-#line 482
     err = nc_enddef(ncid);
-#line 482
     IF (err)
-#line 482
         error("nc_enddef: %s", nc_strerror(err));
-#line 482
 
-#line 482
     for (i = 0; i < NVARS; i++) {
-#line 482
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 482
         assert(var_rank[i] <= MAX_RANK);
-#line 482
         assert(var_nels[i] <= MAX_NELS);
-#line 482
         err = nc_put_var_int(BAD_ID, i, value);
-#line 482
         IF (err != NC_EBADID) 
-#line 482
 	    error("bad ncid: status = %d", err);
-#line 482
         err = nc_put_var_int(ncid, BAD_VARID, value);
-#line 482
         IF (err != NC_ENOTVAR) 
-#line 482
 	    error("bad var id: status = %d", err);
-#line 482
 
-#line 482
 	nels = 1;
-#line 482
 	for (j = 0; j < var_rank[i]; j++) {
-#line 482
 	    nels *= var_shape[i][j];
-#line 482
 	}
-#line 482
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 482
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 482
 	    IF (err) 
-#line 482
 		error("error in toMixedBase 1");
-#line 482
 	    value[j]= hash_int(var_type[i], var_rank[i], index, NCT_INT);
-#line 482
 	    allInExtRange = allInExtRange 
-#line 482
 		&& inRange3(value[j], var_type[i], NCT_INT);
-#line 482
 	}
-#line 482
         err = nc_put_var_int(ncid, i, value);
-#line 482
 	if (canConvert) {
-#line 482
 	    if (allInExtRange) {
-#line 482
 		IF (err) 
-#line 482
 		    error("%s", nc_strerror(err));
-#line 482
 	    } else {
-#line 482
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 482
 		    error("range error: status = %d", err);
-#line 482
 	    }
-#line 482
 	} else {       /* should flag wrong type even if nothing to write */
-#line 482
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 482
 		error("wrong type: status = %d", err);
-#line 482
 	}
-#line 482
     }
-#line 482
 
-#line 482
         /* Preceeding has written nothing for record variables, now try */
-#line 482
         /* again with more than 0 records */
-#line 482
 
-#line 482
 	/* Write record number NRECS to force writing of preceding records */
-#line 482
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 482
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 482
     IF (err)
-#line 482
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 482
     index[0] = NRECS-1;
-#line 482
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 482
     IF (err)
-#line 482
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 482
 
-#line 482
     for (i = 0; i < NVARS; i++) {
-#line 482
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 482
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 482
 	    assert(var_rank[i] <= MAX_RANK);
-#line 482
 	    assert(var_nels[i] <= MAX_NELS);
-#line 482
 	    err = nc_put_var_int(BAD_ID, i, value);
-#line 482
 	    IF (err != NC_EBADID) 
-#line 482
 	        error("bad ncid: status = %d", err);
-#line 482
 	    nels = 1;
-#line 482
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 482
 		nels *= var_shape[i][j];
-#line 482
 	    }
-#line 482
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 482
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 482
 		IF (err) 
-#line 482
 		    error("error in toMixedBase 1");
-#line 482
 		value[j]= hash_int(var_type[i], var_rank[i], index, NCT_INT);
-#line 482
 		allInExtRange = allInExtRange 
-#line 482
 		    && inRange3(value[j], var_type[i], NCT_INT);
-#line 482
 	    }
-#line 482
 	    err = nc_put_var_int(ncid, i, value);
-#line 482
 	    if (canConvert) {
-#line 482
 		if (allInExtRange) {
-#line 482
 		    IF (err) 
-#line 482
 			error("%s", nc_strerror(err));
-#line 482
 		} else {
-#line 482
 		    IF (err != NC_ERANGE)
-#line 482
 			error("range error: status = %d", err);
-#line 482
 		}
-#line 482
 	    } else {
-#line 482
 		IF (nels > 0 && err != NC_ECHAR)
-#line 482
 		    error("wrong type: status = %d", err);
-#line 482
 	    }
-#line 482
         }
-#line 482
     }
-#line 482
 
-#line 482
     err = nc_close(ncid);
-#line 482
     IF (err) 
-#line 482
 	error("nc_close: %s", nc_strerror(err));
-#line 482
 
-#line 482
     check_vars_int(scratch);
-#line 482
 
-#line 482
     err = remove(scratch);
-#line 482
     IF (err)
-#line 482
         error("remove of %s failed", scratch);
-#line 482
 }
-#line 482
 
 void
-#line 483
 test_nc_put_var_long(void)
-#line 483
 {
-#line 483
     int ncid;
-#line 483
     int varid;
-#line 483
     int i;
-#line 483
     int j;
-#line 483
     int err;
-#line 483
     int nels;
-#line 483
     size_t index[MAX_RANK];
-#line 483
     int canConvert;	/* Both text or both numeric */
-#line 483
     int allInExtRange;	/* all values within external range? */
-#line 483
     long value[MAX_NELS];
-#line 483
 
-#line 483
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 483
     IF (err) {
-#line 483
         error("nc_create: %s", nc_strerror(err));
-#line 483
         return;
-#line 483
     }
-#line 483
     def_dims(ncid);
-#line 483
     def_vars(ncid);
-#line 483
     err = nc_enddef(ncid);
-#line 483
     IF (err)
-#line 483
         error("nc_enddef: %s", nc_strerror(err));
-#line 483
 
-#line 483
     for (i = 0; i < NVARS; i++) {
-#line 483
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 483
         assert(var_rank[i] <= MAX_RANK);
-#line 483
         assert(var_nels[i] <= MAX_NELS);
-#line 483
         err = nc_put_var_long(BAD_ID, i, value);
-#line 483
         IF (err != NC_EBADID) 
-#line 483
 	    error("bad ncid: status = %d", err);
-#line 483
         err = nc_put_var_long(ncid, BAD_VARID, value);
-#line 483
         IF (err != NC_ENOTVAR) 
-#line 483
 	    error("bad var id: status = %d", err);
-#line 483
 
-#line 483
 	nels = 1;
-#line 483
 	for (j = 0; j < var_rank[i]; j++) {
-#line 483
 	    nels *= var_shape[i][j];
-#line 483
 	}
-#line 483
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 483
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 483
 	    IF (err) 
-#line 483
 		error("error in toMixedBase 1");
-#line 483
 	    value[j]= hash_long(var_type[i], var_rank[i], index, NCT_LONG);
-#line 483
 	    allInExtRange = allInExtRange 
-#line 483
 		&& inRange3(value[j], var_type[i], NCT_LONG);
-#line 483
 	}
-#line 483
         err = nc_put_var_long(ncid, i, value);
-#line 483
 	if (canConvert) {
-#line 483
 	    if (allInExtRange) {
-#line 483
 		IF (err) 
-#line 483
 		    error("%s", nc_strerror(err));
-#line 483
 	    } else {
-#line 483
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 483
 		    error("range error: status = %d", err);
-#line 483
 	    }
-#line 483
 	} else {       /* should flag wrong type even if nothing to write */
-#line 483
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 483
 		error("wrong type: status = %d", err);
-#line 483
 	}
-#line 483
     }
-#line 483
 
-#line 483
         /* Preceeding has written nothing for record variables, now try */
-#line 483
         /* again with more than 0 records */
-#line 483
 
-#line 483
 	/* Write record number NRECS to force writing of preceding records */
-#line 483
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 483
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 483
     IF (err)
-#line 483
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 483
     index[0] = NRECS-1;
-#line 483
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 483
     IF (err)
-#line 483
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 483
 
-#line 483
     for (i = 0; i < NVARS; i++) {
-#line 483
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 483
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 483
 	    assert(var_rank[i] <= MAX_RANK);
-#line 483
 	    assert(var_nels[i] <= MAX_NELS);
-#line 483
 	    err = nc_put_var_long(BAD_ID, i, value);
-#line 483
 	    IF (err != NC_EBADID) 
-#line 483
 	        error("bad ncid: status = %d", err);
-#line 483
 	    nels = 1;
-#line 483
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 483
 		nels *= var_shape[i][j];
-#line 483
 	    }
-#line 483
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 483
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 483
 		IF (err) 
-#line 483
 		    error("error in toMixedBase 1");
-#line 483
 		value[j]= hash_long(var_type[i], var_rank[i], index, NCT_LONG);
-#line 483
 		allInExtRange = allInExtRange 
-#line 483
 		    && inRange3(value[j], var_type[i], NCT_LONG);
-#line 483
 	    }
-#line 483
 	    err = nc_put_var_long(ncid, i, value);
-#line 483
 	    if (canConvert) {
-#line 483
 		if (allInExtRange) {
-#line 483
 		    IF (err) 
-#line 483
 			error("%s", nc_strerror(err));
-#line 483
 		} else {
-#line 483
 		    IF (err != NC_ERANGE)
-#line 483
 			error("range error: status = %d", err);
-#line 483
 		}
-#line 483
 	    } else {
-#line 483
 		IF (nels > 0 && err != NC_ECHAR)
-#line 483
 		    error("wrong type: status = %d", err);
-#line 483
 	    }
-#line 483
         }
-#line 483
     }
-#line 483
 
-#line 483
     err = nc_close(ncid);
-#line 483
     IF (err) 
-#line 483
 	error("nc_close: %s", nc_strerror(err));
-#line 483
 
-#line 483
     check_vars_long(scratch);
-#line 483
 
-#line 483
     err = remove(scratch);
-#line 483
     IF (err)
-#line 483
         error("remove of %s failed", scratch);
-#line 483
 }
-#line 483
 
 void
-#line 484
 test_nc_put_var_float(void)
-#line 484
 {
-#line 484
     int ncid;
-#line 484
     int varid;
-#line 484
     int i;
-#line 484
     int j;
-#line 484
     int err;
-#line 484
     int nels;
-#line 484
     size_t index[MAX_RANK];
-#line 484
     int canConvert;	/* Both text or both numeric */
-#line 484
     int allInExtRange;	/* all values within external range? */
-#line 484
     float value[MAX_NELS];
-#line 484
 
-#line 484
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 484
     IF (err) {
-#line 484
         error("nc_create: %s", nc_strerror(err));
-#line 484
         return;
-#line 484
     }
-#line 484
     def_dims(ncid);
-#line 484
     def_vars(ncid);
-#line 484
     err = nc_enddef(ncid);
-#line 484
     IF (err)
-#line 484
         error("nc_enddef: %s", nc_strerror(err));
-#line 484
 
-#line 484
     for (i = 0; i < NVARS; i++) {
-#line 484
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 484
         assert(var_rank[i] <= MAX_RANK);
-#line 484
         assert(var_nels[i] <= MAX_NELS);
-#line 484
         err = nc_put_var_float(BAD_ID, i, value);
-#line 484
         IF (err != NC_EBADID) 
-#line 484
 	    error("bad ncid: status = %d", err);
-#line 484
         err = nc_put_var_float(ncid, BAD_VARID, value);
-#line 484
         IF (err != NC_ENOTVAR) 
-#line 484
 	    error("bad var id: status = %d", err);
-#line 484
 
-#line 484
 	nels = 1;
-#line 484
 	for (j = 0; j < var_rank[i]; j++) {
-#line 484
 	    nels *= var_shape[i][j];
-#line 484
 	}
-#line 484
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 484
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 484
 	    IF (err) 
-#line 484
 		error("error in toMixedBase 1");
-#line 484
 	    value[j]= hash_float(var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 484
 	    allInExtRange = allInExtRange 
-#line 484
 		&& inRange3(value[j], var_type[i], NCT_FLOAT);
-#line 484
 	}
-#line 484
         err = nc_put_var_float(ncid, i, value);
-#line 484
 	if (canConvert) {
-#line 484
 	    if (allInExtRange) {
-#line 484
 		IF (err) 
-#line 484
 		    error("%s", nc_strerror(err));
-#line 484
 	    } else {
-#line 484
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 484
 		    error("range error: status = %d", err);
-#line 484
 	    }
-#line 484
 	} else {       /* should flag wrong type even if nothing to write */
-#line 484
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 484
 		error("wrong type: status = %d", err);
-#line 484
 	}
-#line 484
     }
-#line 484
 
-#line 484
         /* Preceeding has written nothing for record variables, now try */
-#line 484
         /* again with more than 0 records */
-#line 484
 
-#line 484
 	/* Write record number NRECS to force writing of preceding records */
-#line 484
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 484
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 484
     IF (err)
-#line 484
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 484
     index[0] = NRECS-1;
-#line 484
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 484
     IF (err)
-#line 484
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 484
 
-#line 484
     for (i = 0; i < NVARS; i++) {
-#line 484
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 484
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 484
 	    assert(var_rank[i] <= MAX_RANK);
-#line 484
 	    assert(var_nels[i] <= MAX_NELS);
-#line 484
 	    err = nc_put_var_float(BAD_ID, i, value);
-#line 484
 	    IF (err != NC_EBADID) 
-#line 484
 	        error("bad ncid: status = %d", err);
-#line 484
 	    nels = 1;
-#line 484
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 484
 		nels *= var_shape[i][j];
-#line 484
 	    }
-#line 484
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 484
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 484
 		IF (err) 
-#line 484
 		    error("error in toMixedBase 1");
-#line 484
 		value[j]= hash_float(var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 484
 		allInExtRange = allInExtRange 
-#line 484
 		    && inRange3(value[j], var_type[i], NCT_FLOAT);
-#line 484
 	    }
-#line 484
 	    err = nc_put_var_float(ncid, i, value);
-#line 484
 	    if (canConvert) {
-#line 484
 		if (allInExtRange) {
-#line 484
 		    IF (err) 
-#line 484
 			error("%s", nc_strerror(err));
-#line 484
 		} else {
-#line 484
 		    IF (err != NC_ERANGE)
-#line 484
 			error("range error: status = %d", err);
-#line 484
 		}
-#line 484
 	    } else {
-#line 484
 		IF (nels > 0 && err != NC_ECHAR)
-#line 484
 		    error("wrong type: status = %d", err);
-#line 484
 	    }
-#line 484
         }
-#line 484
     }
-#line 484
 
-#line 484
     err = nc_close(ncid);
-#line 484
     IF (err) 
-#line 484
 	error("nc_close: %s", nc_strerror(err));
-#line 484
 
-#line 484
     check_vars_float(scratch);
-#line 484
 
-#line 484
     err = remove(scratch);
-#line 484
     IF (err)
-#line 484
         error("remove of %s failed", scratch);
-#line 484
 }
-#line 484
 
 void
-#line 485
 test_nc_put_var_double(void)
-#line 485
 {
-#line 485
     int ncid;
-#line 485
     int varid;
-#line 485
     int i;
-#line 485
     int j;
-#line 485
     int err;
-#line 485
     int nels;
-#line 485
     size_t index[MAX_RANK];
-#line 485
     int canConvert;	/* Both text or both numeric */
-#line 485
     int allInExtRange;	/* all values within external range? */
-#line 485
     double value[MAX_NELS];
-#line 485
 
-#line 485
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 485
     IF (err) {
-#line 485
         error("nc_create: %s", nc_strerror(err));
-#line 485
         return;
-#line 485
     }
-#line 485
     def_dims(ncid);
-#line 485
     def_vars(ncid);
-#line 485
     err = nc_enddef(ncid);
-#line 485
     IF (err)
-#line 485
         error("nc_enddef: %s", nc_strerror(err));
-#line 485
 
-#line 485
     for (i = 0; i < NVARS; i++) {
-#line 485
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 485
         assert(var_rank[i] <= MAX_RANK);
-#line 485
         assert(var_nels[i] <= MAX_NELS);
-#line 485
         err = nc_put_var_double(BAD_ID, i, value);
-#line 485
         IF (err != NC_EBADID) 
-#line 485
 	    error("bad ncid: status = %d", err);
-#line 485
         err = nc_put_var_double(ncid, BAD_VARID, value);
-#line 485
         IF (err != NC_ENOTVAR) 
-#line 485
 	    error("bad var id: status = %d", err);
-#line 485
 
-#line 485
 	nels = 1;
-#line 485
 	for (j = 0; j < var_rank[i]; j++) {
-#line 485
 	    nels *= var_shape[i][j];
-#line 485
 	}
-#line 485
 	for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 485
 	    err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 485
 	    IF (err) 
-#line 485
 		error("error in toMixedBase 1");
-#line 485
 	    value[j]= hash_double(var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 485
 	    allInExtRange = allInExtRange 
-#line 485
 		&& inRange3(value[j], var_type[i], NCT_DOUBLE);
-#line 485
 	}
-#line 485
         err = nc_put_var_double(ncid, i, value);
-#line 485
 	if (canConvert) {
-#line 485
 	    if (allInExtRange) {
-#line 485
 		IF (err) 
-#line 485
 		    error("%s", nc_strerror(err));
-#line 485
 	    } else {
-#line 485
 		IF (err != NC_ERANGE && var_dimid[i][0] != RECDIM)
-#line 485
 		    error("range error: status = %d", err);
-#line 485
 	    }
-#line 485
 	} else {       /* should flag wrong type even if nothing to write */
-#line 485
 	    IF (nels > 0 && err != NC_ECHAR)
-#line 485
 		error("wrong type: status = %d", err);
-#line 485
 	}
-#line 485
     }
-#line 485
 
-#line 485
         /* Preceeding has written nothing for record variables, now try */
-#line 485
         /* again with more than 0 records */
-#line 485
 
-#line 485
 	/* Write record number NRECS to force writing of preceding records */
-#line 485
 	/* Assumes variable cr is char vector with UNLIMITED dimension */
-#line 485
     err = nc_inq_varid(ncid, "cr", &varid);
-#line 485
     IF (err)
-#line 485
         error("nc_inq_varid: %s", nc_strerror(err));
-#line 485
     index[0] = NRECS-1;
-#line 485
     err = nc_put_var1_text(ncid, varid, index, "x");
-#line 485
     IF (err)
-#line 485
         error("nc_put_var1_text: %s", nc_strerror(err));
-#line 485
 
-#line 485
     for (i = 0; i < NVARS; i++) {
-#line 485
         if (var_dimid[i][0] == RECDIM) {  /* only test record variables here */
-#line 485
 	    canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 485
 	    assert(var_rank[i] <= MAX_RANK);
-#line 485
 	    assert(var_nels[i] <= MAX_NELS);
-#line 485
 	    err = nc_put_var_double(BAD_ID, i, value);
-#line 485
 	    IF (err != NC_EBADID) 
-#line 485
 	        error("bad ncid: status = %d", err);
-#line 485
 	    nels = 1;
-#line 485
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 485
 		nels *= var_shape[i][j];
-#line 485
 	    }
-#line 485
 	    for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 485
 		err = toMixedBase(j, var_rank[i], var_shape[i], index);
-#line 485
 		IF (err) 
-#line 485
 		    error("error in toMixedBase 1");
-#line 485
 		value[j]= hash_double(var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 485
 		allInExtRange = allInExtRange 
-#line 485
 		    && inRange3(value[j], var_type[i], NCT_DOUBLE);
-#line 485
 	    }
-#line 485
 	    err = nc_put_var_double(ncid, i, value);
-#line 485
 	    if (canConvert) {
-#line 485
 		if (allInExtRange) {
-#line 485
 		    IF (err) 
-#line 485
 			error("%s", nc_strerror(err));
-#line 485
 		} else {
-#line 485
 		    IF (err != NC_ERANGE)
-#line 485
 			error("range error: status = %d", err);
-#line 485
 		}
-#line 485
 	    } else {
-#line 485
 		IF (nels > 0 && err != NC_ECHAR)
-#line 485
 		    error("wrong type: status = %d", err);
-#line 485
 	    }
-#line 485
         }
-#line 485
     }
-#line 485
 
-#line 485
     err = nc_close(ncid);
-#line 485
     IF (err) 
-#line 485
 	error("nc_close: %s", nc_strerror(err));
-#line 485
 
-#line 485
     check_vars_double(scratch);
-#line 485
 
-#line 485
     err = remove(scratch);
-#line 485
     IF (err)
-#line 485
         error("remove of %s failed", scratch);
-#line 485
 }
-#line 485
 
 
 
-#line 642
 
 void
-#line 643
 test_nc_put_vara_text(void)
-#line 643
 {
-#line 643
     int ncid;
-#line 643
     int d;
-#line 643
     int i;
-#line 643
     int j;
-#line 643
     int k;
-#line 643
     int err;
-#line 643
     int nslabs;
-#line 643
     int nels;
-#line 643
     size_t start[MAX_RANK];
-#line 643
     size_t edge[MAX_RANK];
-#line 643
     size_t mid[MAX_RANK];
-#line 643
     size_t index[MAX_RANK];
-#line 643
     int canConvert;	/* Both text or both numeric */
-#line 643
     int allInExtRange;	/* all values within external range? */
-#line 643
     text value[MAX_NELS];
-#line 643
 
-#line 643
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 643
     IF (err) {
-#line 643
         error("nc_create: %s", nc_strerror(err));
-#line 643
         return;
-#line 643
     }
-#line 643
     def_dims(ncid);
-#line 643
     def_vars(ncid);
-#line 643
     err = nc_enddef(ncid);
-#line 643
     IF (err)
-#line 643
         error("nc_enddef: %s", nc_strerror(err));
-#line 643
 
-#line 643
     value[0] = 0;
-#line 643
     for (i = 0; i < NVARS; i++) {
-#line 643
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 643
         assert(var_rank[i] <= MAX_RANK);
-#line 643
         assert(var_nels[i] <= MAX_NELS);
-#line 643
         for (j = 0; j < var_rank[i]; j++) {
-#line 643
             start[j] = 0;
-#line 643
             edge[j] = 1;
-#line 643
 	}
-#line 643
         err = nc_put_vara_text(BAD_ID, i, start, edge, value);
-#line 643
         IF (err != NC_EBADID) 
-#line 643
 	    error("bad ncid: status = %d", err);
-#line 643
         err = nc_put_vara_text(ncid, BAD_VARID, start, edge, value);
-#line 643
         IF (err != NC_ENOTVAR) 
-#line 643
 	    error("bad var id: status = %d", err);
-#line 643
         for (j = 0; j < var_rank[i]; j++) {
-#line 643
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 643
 		start[j] = var_shape[i][j];
-#line 643
 		err = nc_put_vara_text(ncid, i, start, edge, value);
-#line 643
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 643
 		    error("bad start: status = %d", err);
-#line 643
 		start[j] = 0;
-#line 643
 		edge[j] = var_shape[i][j] + 1;
-#line 643
 		err = nc_put_vara_text(ncid, i, start, edge, value);
-#line 643
 		IF (canConvert && err != NC_EEDGE)
-#line 643
 		    error("bad edge: status = %d", err);
-#line 643
 		edge[j] = 1;
-#line 643
 	    }
-#line 643
         }
-#line 643
             /* Check correct error returned even when nothing to put */
-#line 643
         for (j = 0; j < var_rank[i]; j++) {
-#line 643
             edge[j] = 0;
-#line 643
 	}
-#line 643
         err = nc_put_vara_text(BAD_ID, i, start, edge, value);
-#line 643
         IF (err != NC_EBADID) 
-#line 643
 	    error("bad ncid: status = %d", err);
-#line 643
         err = nc_put_vara_text(ncid, BAD_VARID, start, edge, value);
-#line 643
         IF (err != NC_ENOTVAR) 
-#line 643
 	    error("bad var id: status = %d", err);
-#line 643
         for (j = 0; j < var_rank[i]; j++) {
-#line 643
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 643
 		start[j] = var_shape[i][j];
-#line 643
 		err = nc_put_vara_text(ncid, i, start, edge, value);
-#line 643
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 643
 		    error("bad start: status = %d", err);
-#line 643
 		start[j] = 0;
-#line 643
 	    }
-#line 643
         }
-#line 643
 	err = nc_put_vara_text(ncid, i, start, edge, value);
-#line 643
 	if (canConvert) {
-#line 643
 	    IF (err) 
-#line 643
 		error("%s", nc_strerror(err));
-#line 643
 	} else {
-#line 643
 	    IF (err != NC_ECHAR)
-#line 643
 		error("wrong type: status = %d", err);
-#line 643
         }
-#line 643
         for (j = 0; j < var_rank[i]; j++) {
-#line 643
             edge[j] = 1;
-#line 643
 	}
-#line 643
 
-#line 643
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 643
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 643
 	nslabs = 1;
-#line 643
 	for (j = 0; j < var_rank[i]; j++) {
-#line 643
             mid[j] = roll( var_shape[i][j] );
-#line 643
 	    nslabs *= 2;
-#line 643
 	}
-#line 643
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 643
 	for (k = 0; k < nslabs; k++) {
-#line 643
 	    nels = 1;
-#line 643
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 643
 		if ((k >> j) & 1) {
-#line 643
 		    start[j] = 0;
-#line 643
 		    edge[j] = mid[j];
-#line 643
 		}else{
-#line 643
 		    start[j] = mid[j];
-#line 643
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 643
 		}
-#line 643
 		nels *= edge[j];
-#line 643
 	    }
-#line 643
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 643
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 643
 		IF (err) 
-#line 643
 		    error("error in toMixedBase 1");
-#line 643
 		for (d = 0; d < var_rank[i]; d++) 
-#line 643
 		    index[d] += start[d];
-#line 643
 		value[j]= hash_text(var_type[i], var_rank[i], index, NCT_TEXT);
-#line 643
 		allInExtRange = allInExtRange 
-#line 643
 		    && inRange3(value[j], var_type[i], NCT_TEXT);
-#line 643
 	    }
-#line 643
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 643
 		err = nc_put_vara_text(ncid, i, NULL, NULL, value);
-#line 643
 	    else
-#line 643
 		err = nc_put_vara_text(ncid, i, start, edge, value);
-#line 643
 	    if (canConvert) {
-#line 643
 		if (allInExtRange) {
-#line 643
 		    IF (err) 
-#line 643
 			error("%s", nc_strerror(err));
-#line 643
 		} else {
-#line 643
 		    IF (err != NC_ERANGE)
-#line 643
 			error("range error: status = %d", err);
-#line 643
 		}
-#line 643
 	    } else {
-#line 643
 		IF (nels > 0 && err != NC_ECHAR)
-#line 643
 		    error("wrong type: status = %d", err);
-#line 643
             }
-#line 643
         }
-#line 643
     }
-#line 643
 
-#line 643
     err = nc_close(ncid);
-#line 643
     IF (err) 
-#line 643
 	error("nc_close: %s", nc_strerror(err));
-#line 643
 
-#line 643
     check_vars_text(scratch);
-#line 643
 
-#line 643
     err = remove(scratch);
-#line 643
     IF (err)
-#line 643
         error("remove of %s failed", scratch);
-#line 643
 }
-#line 643
 
 void
-#line 644
 test_nc_put_vara_uchar(void)
-#line 644
 {
-#line 644
     int ncid;
-#line 644
     int d;
-#line 644
     int i;
-#line 644
     int j;
-#line 644
     int k;
-#line 644
     int err;
-#line 644
     int nslabs;
-#line 644
     int nels;
-#line 644
     size_t start[MAX_RANK];
-#line 644
     size_t edge[MAX_RANK];
-#line 644
     size_t mid[MAX_RANK];
-#line 644
     size_t index[MAX_RANK];
-#line 644
     int canConvert;	/* Both text or both numeric */
-#line 644
     int allInExtRange;	/* all values within external range? */
-#line 644
     uchar value[MAX_NELS];
-#line 644
 
-#line 644
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 644
     IF (err) {
-#line 644
         error("nc_create: %s", nc_strerror(err));
-#line 644
         return;
-#line 644
     }
-#line 644
     def_dims(ncid);
-#line 644
     def_vars(ncid);
-#line 644
     err = nc_enddef(ncid);
-#line 644
     IF (err)
-#line 644
         error("nc_enddef: %s", nc_strerror(err));
-#line 644
 
-#line 644
     value[0] = 0;
-#line 644
     for (i = 0; i < NVARS; i++) {
-#line 644
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 644
         assert(var_rank[i] <= MAX_RANK);
-#line 644
         assert(var_nels[i] <= MAX_NELS);
-#line 644
         for (j = 0; j < var_rank[i]; j++) {
-#line 644
             start[j] = 0;
-#line 644
             edge[j] = 1;
-#line 644
 	}
-#line 644
         err = nc_put_vara_uchar(BAD_ID, i, start, edge, value);
-#line 644
         IF (err != NC_EBADID) 
-#line 644
 	    error("bad ncid: status = %d", err);
-#line 644
         err = nc_put_vara_uchar(ncid, BAD_VARID, start, edge, value);
-#line 644
         IF (err != NC_ENOTVAR) 
-#line 644
 	    error("bad var id: status = %d", err);
-#line 644
         for (j = 0; j < var_rank[i]; j++) {
-#line 644
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 644
 		start[j] = var_shape[i][j];
-#line 644
 		err = nc_put_vara_uchar(ncid, i, start, edge, value);
-#line 644
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 644
 		    error("bad start: status = %d", err);
-#line 644
 		start[j] = 0;
-#line 644
 		edge[j] = var_shape[i][j] + 1;
-#line 644
 		err = nc_put_vara_uchar(ncid, i, start, edge, value);
-#line 644
 		IF (canConvert && err != NC_EEDGE)
-#line 644
 		    error("bad edge: status = %d", err);
-#line 644
 		edge[j] = 1;
-#line 644
 	    }
-#line 644
         }
-#line 644
             /* Check correct error returned even when nothing to put */
-#line 644
         for (j = 0; j < var_rank[i]; j++) {
-#line 644
             edge[j] = 0;
-#line 644
 	}
-#line 644
         err = nc_put_vara_uchar(BAD_ID, i, start, edge, value);
-#line 644
         IF (err != NC_EBADID) 
-#line 644
 	    error("bad ncid: status = %d", err);
-#line 644
         err = nc_put_vara_uchar(ncid, BAD_VARID, start, edge, value);
-#line 644
         IF (err != NC_ENOTVAR) 
-#line 644
 	    error("bad var id: status = %d", err);
-#line 644
         for (j = 0; j < var_rank[i]; j++) {
-#line 644
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 644
 		start[j] = var_shape[i][j];
-#line 644
 		err = nc_put_vara_uchar(ncid, i, start, edge, value);
-#line 644
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 644
 		    error("bad start: status = %d", err);
-#line 644
 		start[j] = 0;
-#line 644
 	    }
-#line 644
         }
-#line 644
 	err = nc_put_vara_uchar(ncid, i, start, edge, value);
-#line 644
 	if (canConvert) {
-#line 644
 	    IF (err) 
-#line 644
 		error("%s", nc_strerror(err));
-#line 644
 	} else {
-#line 644
 	    IF (err != NC_ECHAR)
-#line 644
 		error("wrong type: status = %d", err);
-#line 644
         }
-#line 644
         for (j = 0; j < var_rank[i]; j++) {
-#line 644
             edge[j] = 1;
-#line 644
 	}
-#line 644
 
-#line 644
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 644
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 644
 	nslabs = 1;
-#line 644
 	for (j = 0; j < var_rank[i]; j++) {
-#line 644
             mid[j] = roll( var_shape[i][j] );
-#line 644
 	    nslabs *= 2;
-#line 644
 	}
-#line 644
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 644
 	for (k = 0; k < nslabs; k++) {
-#line 644
 	    nels = 1;
-#line 644
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 644
 		if ((k >> j) & 1) {
-#line 644
 		    start[j] = 0;
-#line 644
 		    edge[j] = mid[j];
-#line 644
 		}else{
-#line 644
 		    start[j] = mid[j];
-#line 644
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 644
 		}
-#line 644
 		nels *= edge[j];
-#line 644
 	    }
-#line 644
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 644
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 644
 		IF (err) 
-#line 644
 		    error("error in toMixedBase 1");
-#line 644
 		for (d = 0; d < var_rank[i]; d++) 
-#line 644
 		    index[d] += start[d];
-#line 644
 		value[j]= hash_uchar(var_type[i], var_rank[i], index, NCT_UCHAR);
-#line 644
 		allInExtRange = allInExtRange 
-#line 644
 		    && inRange3(value[j], var_type[i], NCT_UCHAR);
-#line 644
 	    }
-#line 644
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 644
 		err = nc_put_vara_uchar(ncid, i, NULL, NULL, value);
-#line 644
 	    else
-#line 644
 		err = nc_put_vara_uchar(ncid, i, start, edge, value);
-#line 644
 	    if (canConvert) {
-#line 644
 		if (allInExtRange) {
-#line 644
 		    IF (err) 
-#line 644
 			error("%s", nc_strerror(err));
-#line 644
 		} else {
-#line 644
 		    IF (err != NC_ERANGE)
-#line 644
 			error("range error: status = %d", err);
-#line 644
 		}
-#line 644
 	    } else {
-#line 644
 		IF (nels > 0 && err != NC_ECHAR)
-#line 644
 		    error("wrong type: status = %d", err);
-#line 644
             }
-#line 644
         }
-#line 644
     }
-#line 644
 
-#line 644
     err = nc_close(ncid);
-#line 644
     IF (err) 
-#line 644
 	error("nc_close: %s", nc_strerror(err));
-#line 644
 
-#line 644
     check_vars_uchar(scratch);
-#line 644
 
-#line 644
     err = remove(scratch);
-#line 644
     IF (err)
-#line 644
         error("remove of %s failed", scratch);
-#line 644
 }
-#line 644
 
 void
-#line 645
 test_nc_put_vara_schar(void)
-#line 645
 {
-#line 645
     int ncid;
-#line 645
     int d;
-#line 645
     int i;
-#line 645
     int j;
-#line 645
     int k;
-#line 645
     int err;
-#line 645
     int nslabs;
-#line 645
     int nels;
-#line 645
     size_t start[MAX_RANK];
-#line 645
     size_t edge[MAX_RANK];
-#line 645
     size_t mid[MAX_RANK];
-#line 645
     size_t index[MAX_RANK];
-#line 645
     int canConvert;	/* Both text or both numeric */
-#line 645
     int allInExtRange;	/* all values within external range? */
-#line 645
     schar value[MAX_NELS];
-#line 645
 
-#line 645
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 645
     IF (err) {
-#line 645
         error("nc_create: %s", nc_strerror(err));
-#line 645
         return;
-#line 645
     }
-#line 645
     def_dims(ncid);
-#line 645
     def_vars(ncid);
-#line 645
     err = nc_enddef(ncid);
-#line 645
     IF (err)
-#line 645
         error("nc_enddef: %s", nc_strerror(err));
-#line 645
 
-#line 645
     value[0] = 0;
-#line 645
     for (i = 0; i < NVARS; i++) {
-#line 645
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 645
         assert(var_rank[i] <= MAX_RANK);
-#line 645
         assert(var_nels[i] <= MAX_NELS);
-#line 645
         for (j = 0; j < var_rank[i]; j++) {
-#line 645
             start[j] = 0;
-#line 645
             edge[j] = 1;
-#line 645
 	}
-#line 645
         err = nc_put_vara_schar(BAD_ID, i, start, edge, value);
-#line 645
         IF (err != NC_EBADID) 
-#line 645
 	    error("bad ncid: status = %d", err);
-#line 645
         err = nc_put_vara_schar(ncid, BAD_VARID, start, edge, value);
-#line 645
         IF (err != NC_ENOTVAR) 
-#line 645
 	    error("bad var id: status = %d", err);
-#line 645
         for (j = 0; j < var_rank[i]; j++) {
-#line 645
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 645
 		start[j] = var_shape[i][j];
-#line 645
 		err = nc_put_vara_schar(ncid, i, start, edge, value);
-#line 645
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 645
 		    error("bad start: status = %d", err);
-#line 645
 		start[j] = 0;
-#line 645
 		edge[j] = var_shape[i][j] + 1;
-#line 645
 		err = nc_put_vara_schar(ncid, i, start, edge, value);
-#line 645
 		IF (canConvert && err != NC_EEDGE)
-#line 645
 		    error("bad edge: status = %d", err);
-#line 645
 		edge[j] = 1;
-#line 645
 	    }
-#line 645
         }
-#line 645
             /* Check correct error returned even when nothing to put */
-#line 645
         for (j = 0; j < var_rank[i]; j++) {
-#line 645
             edge[j] = 0;
-#line 645
 	}
-#line 645
         err = nc_put_vara_schar(BAD_ID, i, start, edge, value);
-#line 645
         IF (err != NC_EBADID) 
-#line 645
 	    error("bad ncid: status = %d", err);
-#line 645
         err = nc_put_vara_schar(ncid, BAD_VARID, start, edge, value);
-#line 645
         IF (err != NC_ENOTVAR) 
-#line 645
 	    error("bad var id: status = %d", err);
-#line 645
         for (j = 0; j < var_rank[i]; j++) {
-#line 645
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 645
 		start[j] = var_shape[i][j];
-#line 645
 		err = nc_put_vara_schar(ncid, i, start, edge, value);
-#line 645
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 645
 		    error("bad start: status = %d", err);
-#line 645
 		start[j] = 0;
-#line 645
 	    }
-#line 645
         }
-#line 645
 	err = nc_put_vara_schar(ncid, i, start, edge, value);
-#line 645
 	if (canConvert) {
-#line 645
 	    IF (err) 
-#line 645
 		error("%s", nc_strerror(err));
-#line 645
 	} else {
-#line 645
 	    IF (err != NC_ECHAR)
-#line 645
 		error("wrong type: status = %d", err);
-#line 645
         }
-#line 645
         for (j = 0; j < var_rank[i]; j++) {
-#line 645
             edge[j] = 1;
-#line 645
 	}
-#line 645
 
-#line 645
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 645
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 645
 	nslabs = 1;
-#line 645
 	for (j = 0; j < var_rank[i]; j++) {
-#line 645
             mid[j] = roll( var_shape[i][j] );
-#line 645
 	    nslabs *= 2;
-#line 645
 	}
-#line 645
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 645
 	for (k = 0; k < nslabs; k++) {
-#line 645
 	    nels = 1;
-#line 645
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 645
 		if ((k >> j) & 1) {
-#line 645
 		    start[j] = 0;
-#line 645
 		    edge[j] = mid[j];
-#line 645
 		}else{
-#line 645
 		    start[j] = mid[j];
-#line 645
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 645
 		}
-#line 645
 		nels *= edge[j];
-#line 645
 	    }
-#line 645
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 645
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 645
 		IF (err) 
-#line 645
 		    error("error in toMixedBase 1");
-#line 645
 		for (d = 0; d < var_rank[i]; d++) 
-#line 645
 		    index[d] += start[d];
-#line 645
 		value[j]= hash_schar(var_type[i], var_rank[i], index, NCT_SCHAR);
-#line 645
 		allInExtRange = allInExtRange 
-#line 645
 		    && inRange3(value[j], var_type[i], NCT_SCHAR);
-#line 645
 	    }
-#line 645
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 645
 		err = nc_put_vara_schar(ncid, i, NULL, NULL, value);
-#line 645
 	    else
-#line 645
 		err = nc_put_vara_schar(ncid, i, start, edge, value);
-#line 645
 	    if (canConvert) {
-#line 645
 		if (allInExtRange) {
-#line 645
 		    IF (err) 
-#line 645
 			error("%s", nc_strerror(err));
-#line 645
 		} else {
-#line 645
 		    IF (err != NC_ERANGE)
-#line 645
 			error("range error: status = %d", err);
-#line 645
 		}
-#line 645
 	    } else {
-#line 645
 		IF (nels > 0 && err != NC_ECHAR)
-#line 645
 		    error("wrong type: status = %d", err);
-#line 645
             }
-#line 645
         }
-#line 645
     }
-#line 645
 
-#line 645
     err = nc_close(ncid);
-#line 645
     IF (err) 
-#line 645
 	error("nc_close: %s", nc_strerror(err));
-#line 645
 
-#line 645
     check_vars_schar(scratch);
-#line 645
 
-#line 645
     err = remove(scratch);
-#line 645
     IF (err)
-#line 645
         error("remove of %s failed", scratch);
-#line 645
 }
-#line 645
 
 void
-#line 646
 test_nc_put_vara_short(void)
-#line 646
 {
-#line 646
     int ncid;
-#line 646
     int d;
-#line 646
     int i;
-#line 646
     int j;
-#line 646
     int k;
-#line 646
     int err;
-#line 646
     int nslabs;
-#line 646
     int nels;
-#line 646
     size_t start[MAX_RANK];
-#line 646
     size_t edge[MAX_RANK];
-#line 646
     size_t mid[MAX_RANK];
-#line 646
     size_t index[MAX_RANK];
-#line 646
     int canConvert;	/* Both text or both numeric */
-#line 646
     int allInExtRange;	/* all values within external range? */
-#line 646
     short value[MAX_NELS];
-#line 646
 
-#line 646
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 646
     IF (err) {
-#line 646
         error("nc_create: %s", nc_strerror(err));
-#line 646
         return;
-#line 646
     }
-#line 646
     def_dims(ncid);
-#line 646
     def_vars(ncid);
-#line 646
     err = nc_enddef(ncid);
-#line 646
     IF (err)
-#line 646
         error("nc_enddef: %s", nc_strerror(err));
-#line 646
 
-#line 646
     value[0] = 0;
-#line 646
     for (i = 0; i < NVARS; i++) {
-#line 646
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 646
         assert(var_rank[i] <= MAX_RANK);
-#line 646
         assert(var_nels[i] <= MAX_NELS);
-#line 646
         for (j = 0; j < var_rank[i]; j++) {
-#line 646
             start[j] = 0;
-#line 646
             edge[j] = 1;
-#line 646
 	}
-#line 646
         err = nc_put_vara_short(BAD_ID, i, start, edge, value);
-#line 646
         IF (err != NC_EBADID) 
-#line 646
 	    error("bad ncid: status = %d", err);
-#line 646
         err = nc_put_vara_short(ncid, BAD_VARID, start, edge, value);
-#line 646
         IF (err != NC_ENOTVAR) 
-#line 646
 	    error("bad var id: status = %d", err);
-#line 646
         for (j = 0; j < var_rank[i]; j++) {
-#line 646
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 646
 		start[j] = var_shape[i][j];
-#line 646
 		err = nc_put_vara_short(ncid, i, start, edge, value);
-#line 646
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 646
 		    error("bad start: status = %d", err);
-#line 646
 		start[j] = 0;
-#line 646
 		edge[j] = var_shape[i][j] + 1;
-#line 646
 		err = nc_put_vara_short(ncid, i, start, edge, value);
-#line 646
 		IF (canConvert && err != NC_EEDGE)
-#line 646
 		    error("bad edge: status = %d", err);
-#line 646
 		edge[j] = 1;
-#line 646
 	    }
-#line 646
         }
-#line 646
             /* Check correct error returned even when nothing to put */
-#line 646
         for (j = 0; j < var_rank[i]; j++) {
-#line 646
             edge[j] = 0;
-#line 646
 	}
-#line 646
         err = nc_put_vara_short(BAD_ID, i, start, edge, value);
-#line 646
         IF (err != NC_EBADID) 
-#line 646
 	    error("bad ncid: status = %d", err);
-#line 646
         err = nc_put_vara_short(ncid, BAD_VARID, start, edge, value);
-#line 646
         IF (err != NC_ENOTVAR) 
-#line 646
 	    error("bad var id: status = %d", err);
-#line 646
         for (j = 0; j < var_rank[i]; j++) {
-#line 646
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 646
 		start[j] = var_shape[i][j];
-#line 646
 		err = nc_put_vara_short(ncid, i, start, edge, value);
-#line 646
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 646
 		    error("bad start: status = %d", err);
-#line 646
 		start[j] = 0;
-#line 646
 	    }
-#line 646
         }
-#line 646
 	err = nc_put_vara_short(ncid, i, start, edge, value);
-#line 646
 	if (canConvert) {
-#line 646
 	    IF (err) 
-#line 646
 		error("%s", nc_strerror(err));
-#line 646
 	} else {
-#line 646
 	    IF (err != NC_ECHAR)
-#line 646
 		error("wrong type: status = %d", err);
-#line 646
         }
-#line 646
         for (j = 0; j < var_rank[i]; j++) {
-#line 646
             edge[j] = 1;
-#line 646
 	}
-#line 646
 
-#line 646
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 646
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 646
 	nslabs = 1;
-#line 646
 	for (j = 0; j < var_rank[i]; j++) {
-#line 646
             mid[j] = roll( var_shape[i][j] );
-#line 646
 	    nslabs *= 2;
-#line 646
 	}
-#line 646
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 646
 	for (k = 0; k < nslabs; k++) {
-#line 646
 	    nels = 1;
-#line 646
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 646
 		if ((k >> j) & 1) {
-#line 646
 		    start[j] = 0;
-#line 646
 		    edge[j] = mid[j];
-#line 646
 		}else{
-#line 646
 		    start[j] = mid[j];
-#line 646
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 646
 		}
-#line 646
 		nels *= edge[j];
-#line 646
 	    }
-#line 646
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 646
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 646
 		IF (err) 
-#line 646
 		    error("error in toMixedBase 1");
-#line 646
 		for (d = 0; d < var_rank[i]; d++) 
-#line 646
 		    index[d] += start[d];
-#line 646
 		value[j]= hash_short(var_type[i], var_rank[i], index, NCT_SHORT);
-#line 646
 		allInExtRange = allInExtRange 
-#line 646
 		    && inRange3(value[j], var_type[i], NCT_SHORT);
-#line 646
 	    }
-#line 646
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 646
 		err = nc_put_vara_short(ncid, i, NULL, NULL, value);
-#line 646
 	    else
-#line 646
 		err = nc_put_vara_short(ncid, i, start, edge, value);
-#line 646
 	    if (canConvert) {
-#line 646
 		if (allInExtRange) {
-#line 646
 		    IF (err) 
-#line 646
 			error("%s", nc_strerror(err));
-#line 646
 		} else {
-#line 646
 		    IF (err != NC_ERANGE)
-#line 646
 			error("range error: status = %d", err);
-#line 646
 		}
-#line 646
 	    } else {
-#line 646
 		IF (nels > 0 && err != NC_ECHAR)
-#line 646
 		    error("wrong type: status = %d", err);
-#line 646
             }
-#line 646
         }
-#line 646
     }
-#line 646
 
-#line 646
     err = nc_close(ncid);
-#line 646
     IF (err) 
-#line 646
 	error("nc_close: %s", nc_strerror(err));
-#line 646
 
-#line 646
     check_vars_short(scratch);
-#line 646
 
-#line 646
     err = remove(scratch);
-#line 646
     IF (err)
-#line 646
         error("remove of %s failed", scratch);
-#line 646
 }
-#line 646
 
 void
-#line 647
 test_nc_put_vara_int(void)
-#line 647
 {
-#line 647
     int ncid;
-#line 647
     int d;
-#line 647
     int i;
-#line 647
     int j;
-#line 647
     int k;
-#line 647
     int err;
-#line 647
     int nslabs;
-#line 647
     int nels;
-#line 647
     size_t start[MAX_RANK];
-#line 647
     size_t edge[MAX_RANK];
-#line 647
     size_t mid[MAX_RANK];
-#line 647
     size_t index[MAX_RANK];
-#line 647
     int canConvert;	/* Both text or both numeric */
-#line 647
     int allInExtRange;	/* all values within external range? */
-#line 647
     int value[MAX_NELS];
-#line 647
 
-#line 647
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 647
     IF (err) {
-#line 647
         error("nc_create: %s", nc_strerror(err));
-#line 647
         return;
-#line 647
     }
-#line 647
     def_dims(ncid);
-#line 647
     def_vars(ncid);
-#line 647
     err = nc_enddef(ncid);
-#line 647
     IF (err)
-#line 647
         error("nc_enddef: %s", nc_strerror(err));
-#line 647
 
-#line 647
     value[0] = 0;
-#line 647
     for (i = 0; i < NVARS; i++) {
-#line 647
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 647
         assert(var_rank[i] <= MAX_RANK);
-#line 647
         assert(var_nels[i] <= MAX_NELS);
-#line 647
         for (j = 0; j < var_rank[i]; j++) {
-#line 647
             start[j] = 0;
-#line 647
             edge[j] = 1;
-#line 647
 	}
-#line 647
         err = nc_put_vara_int(BAD_ID, i, start, edge, value);
-#line 647
         IF (err != NC_EBADID) 
-#line 647
 	    error("bad ncid: status = %d", err);
-#line 647
         err = nc_put_vara_int(ncid, BAD_VARID, start, edge, value);
-#line 647
         IF (err != NC_ENOTVAR) 
-#line 647
 	    error("bad var id: status = %d", err);
-#line 647
         for (j = 0; j < var_rank[i]; j++) {
-#line 647
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 647
 		start[j] = var_shape[i][j];
-#line 647
 		err = nc_put_vara_int(ncid, i, start, edge, value);
-#line 647
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 647
 		    error("bad start: status = %d", err);
-#line 647
 		start[j] = 0;
-#line 647
 		edge[j] = var_shape[i][j] + 1;
-#line 647
 		err = nc_put_vara_int(ncid, i, start, edge, value);
-#line 647
 		IF (canConvert && err != NC_EEDGE)
-#line 647
 		    error("bad edge: status = %d", err);
-#line 647
 		edge[j] = 1;
-#line 647
 	    }
-#line 647
         }
-#line 647
             /* Check correct error returned even when nothing to put */
-#line 647
         for (j = 0; j < var_rank[i]; j++) {
-#line 647
             edge[j] = 0;
-#line 647
 	}
-#line 647
         err = nc_put_vara_int(BAD_ID, i, start, edge, value);
-#line 647
         IF (err != NC_EBADID) 
-#line 647
 	    error("bad ncid: status = %d", err);
-#line 647
         err = nc_put_vara_int(ncid, BAD_VARID, start, edge, value);
-#line 647
         IF (err != NC_ENOTVAR) 
-#line 647
 	    error("bad var id: status = %d", err);
-#line 647
         for (j = 0; j < var_rank[i]; j++) {
-#line 647
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 647
 		start[j] = var_shape[i][j];
-#line 647
 		err = nc_put_vara_int(ncid, i, start, edge, value);
-#line 647
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 647
 		    error("bad start: status = %d", err);
-#line 647
 		start[j] = 0;
-#line 647
 	    }
-#line 647
         }
-#line 647
 	err = nc_put_vara_int(ncid, i, start, edge, value);
-#line 647
 	if (canConvert) {
-#line 647
 	    IF (err) 
-#line 647
 		error("%s", nc_strerror(err));
-#line 647
 	} else {
-#line 647
 	    IF (err != NC_ECHAR)
-#line 647
 		error("wrong type: status = %d", err);
-#line 647
         }
-#line 647
         for (j = 0; j < var_rank[i]; j++) {
-#line 647
             edge[j] = 1;
-#line 647
 	}
-#line 647
 
-#line 647
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 647
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 647
 	nslabs = 1;
-#line 647
 	for (j = 0; j < var_rank[i]; j++) {
-#line 647
             mid[j] = roll( var_shape[i][j] );
-#line 647
 	    nslabs *= 2;
-#line 647
 	}
-#line 647
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 647
 	for (k = 0; k < nslabs; k++) {
-#line 647
 	    nels = 1;
-#line 647
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 647
 		if ((k >> j) & 1) {
-#line 647
 		    start[j] = 0;
-#line 647
 		    edge[j] = mid[j];
-#line 647
 		}else{
-#line 647
 		    start[j] = mid[j];
-#line 647
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 647
 		}
-#line 647
 		nels *= edge[j];
-#line 647
 	    }
-#line 647
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 647
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 647
 		IF (err) 
-#line 647
 		    error("error in toMixedBase 1");
-#line 647
 		for (d = 0; d < var_rank[i]; d++) 
-#line 647
 		    index[d] += start[d];
-#line 647
 		value[j]= hash_int(var_type[i], var_rank[i], index, NCT_INT);
-#line 647
 		allInExtRange = allInExtRange 
-#line 647
 		    && inRange3(value[j], var_type[i], NCT_INT);
-#line 647
 	    }
-#line 647
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 647
 		err = nc_put_vara_int(ncid, i, NULL, NULL, value);
-#line 647
 	    else
-#line 647
 		err = nc_put_vara_int(ncid, i, start, edge, value);
-#line 647
 	    if (canConvert) {
-#line 647
 		if (allInExtRange) {
-#line 647
 		    IF (err) 
-#line 647
 			error("%s", nc_strerror(err));
-#line 647
 		} else {
-#line 647
 		    IF (err != NC_ERANGE)
-#line 647
 			error("range error: status = %d", err);
-#line 647
 		}
-#line 647
 	    } else {
-#line 647
 		IF (nels > 0 && err != NC_ECHAR)
-#line 647
 		    error("wrong type: status = %d", err);
-#line 647
             }
-#line 647
         }
-#line 647
     }
-#line 647
 
-#line 647
     err = nc_close(ncid);
-#line 647
     IF (err) 
-#line 647
 	error("nc_close: %s", nc_strerror(err));
-#line 647
 
-#line 647
     check_vars_int(scratch);
-#line 647
 
-#line 647
     err = remove(scratch);
-#line 647
     IF (err)
-#line 647
         error("remove of %s failed", scratch);
-#line 647
 }
-#line 647
 
 void
-#line 648
 test_nc_put_vara_long(void)
-#line 648
 {
-#line 648
     int ncid;
-#line 648
     int d;
-#line 648
     int i;
-#line 648
     int j;
-#line 648
     int k;
-#line 648
     int err;
-#line 648
     int nslabs;
-#line 648
     int nels;
-#line 648
     size_t start[MAX_RANK];
-#line 648
     size_t edge[MAX_RANK];
-#line 648
     size_t mid[MAX_RANK];
-#line 648
     size_t index[MAX_RANK];
-#line 648
     int canConvert;	/* Both text or both numeric */
-#line 648
     int allInExtRange;	/* all values within external range? */
-#line 648
     long value[MAX_NELS];
-#line 648
 
-#line 648
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 648
     IF (err) {
-#line 648
         error("nc_create: %s", nc_strerror(err));
-#line 648
         return;
-#line 648
     }
-#line 648
     def_dims(ncid);
-#line 648
     def_vars(ncid);
-#line 648
     err = nc_enddef(ncid);
-#line 648
     IF (err)
-#line 648
         error("nc_enddef: %s", nc_strerror(err));
-#line 648
 
-#line 648
     value[0] = 0;
-#line 648
     for (i = 0; i < NVARS; i++) {
-#line 648
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 648
         assert(var_rank[i] <= MAX_RANK);
-#line 648
         assert(var_nels[i] <= MAX_NELS);
-#line 648
         for (j = 0; j < var_rank[i]; j++) {
-#line 648
             start[j] = 0;
-#line 648
             edge[j] = 1;
-#line 648
 	}
-#line 648
         err = nc_put_vara_long(BAD_ID, i, start, edge, value);
-#line 648
         IF (err != NC_EBADID) 
-#line 648
 	    error("bad ncid: status = %d", err);
-#line 648
         err = nc_put_vara_long(ncid, BAD_VARID, start, edge, value);
-#line 648
         IF (err != NC_ENOTVAR) 
-#line 648
 	    error("bad var id: status = %d", err);
-#line 648
         for (j = 0; j < var_rank[i]; j++) {
-#line 648
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 648
 		start[j] = var_shape[i][j];
-#line 648
 		err = nc_put_vara_long(ncid, i, start, edge, value);
-#line 648
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 648
 		    error("bad start: status = %d", err);
-#line 648
 		start[j] = 0;
-#line 648
 		edge[j] = var_shape[i][j] + 1;
-#line 648
 		err = nc_put_vara_long(ncid, i, start, edge, value);
-#line 648
 		IF (canConvert && err != NC_EEDGE)
-#line 648
 		    error("bad edge: status = %d", err);
-#line 648
 		edge[j] = 1;
-#line 648
 	    }
-#line 648
         }
-#line 648
             /* Check correct error returned even when nothing to put */
-#line 648
         for (j = 0; j < var_rank[i]; j++) {
-#line 648
             edge[j] = 0;
-#line 648
 	}
-#line 648
         err = nc_put_vara_long(BAD_ID, i, start, edge, value);
-#line 648
         IF (err != NC_EBADID) 
-#line 648
 	    error("bad ncid: status = %d", err);
-#line 648
         err = nc_put_vara_long(ncid, BAD_VARID, start, edge, value);
-#line 648
         IF (err != NC_ENOTVAR) 
-#line 648
 	    error("bad var id: status = %d", err);
-#line 648
         for (j = 0; j < var_rank[i]; j++) {
-#line 648
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 648
 		start[j] = var_shape[i][j];
-#line 648
 		err = nc_put_vara_long(ncid, i, start, edge, value);
-#line 648
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 648
 		    error("bad start: status = %d", err);
-#line 648
 		start[j] = 0;
-#line 648
 	    }
-#line 648
         }
-#line 648
 	err = nc_put_vara_long(ncid, i, start, edge, value);
-#line 648
 	if (canConvert) {
-#line 648
 	    IF (err) 
-#line 648
 		error("%s", nc_strerror(err));
-#line 648
 	} else {
-#line 648
 	    IF (err != NC_ECHAR)
-#line 648
 		error("wrong type: status = %d", err);
-#line 648
         }
-#line 648
         for (j = 0; j < var_rank[i]; j++) {
-#line 648
             edge[j] = 1;
-#line 648
 	}
-#line 648
 
-#line 648
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 648
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 648
 	nslabs = 1;
-#line 648
 	for (j = 0; j < var_rank[i]; j++) {
-#line 648
             mid[j] = roll( var_shape[i][j] );
-#line 648
 	    nslabs *= 2;
-#line 648
 	}
-#line 648
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 648
 	for (k = 0; k < nslabs; k++) {
-#line 648
 	    nels = 1;
-#line 648
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 648
 		if ((k >> j) & 1) {
-#line 648
 		    start[j] = 0;
-#line 648
 		    edge[j] = mid[j];
-#line 648
 		}else{
-#line 648
 		    start[j] = mid[j];
-#line 648
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 648
 		}
-#line 648
 		nels *= edge[j];
-#line 648
 	    }
-#line 648
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 648
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 648
 		IF (err) 
-#line 648
 		    error("error in toMixedBase 1");
-#line 648
 		for (d = 0; d < var_rank[i]; d++) 
-#line 648
 		    index[d] += start[d];
-#line 648
 		value[j]= hash_long(var_type[i], var_rank[i], index, NCT_LONG);
-#line 648
 		allInExtRange = allInExtRange 
-#line 648
 		    && inRange3(value[j], var_type[i], NCT_LONG);
-#line 648
 	    }
-#line 648
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 648
 		err = nc_put_vara_long(ncid, i, NULL, NULL, value);
-#line 648
 	    else
-#line 648
 		err = nc_put_vara_long(ncid, i, start, edge, value);
-#line 648
 	    if (canConvert) {
-#line 648
 		if (allInExtRange) {
-#line 648
 		    IF (err) 
-#line 648
 			error("%s", nc_strerror(err));
-#line 648
 		} else {
-#line 648
 		    IF (err != NC_ERANGE)
-#line 648
 			error("range error: status = %d", err);
-#line 648
 		}
-#line 648
 	    } else {
-#line 648
 		IF (nels > 0 && err != NC_ECHAR)
-#line 648
 		    error("wrong type: status = %d", err);
-#line 648
             }
-#line 648
         }
-#line 648
     }
-#line 648
 
-#line 648
     err = nc_close(ncid);
-#line 648
     IF (err) 
-#line 648
 	error("nc_close: %s", nc_strerror(err));
-#line 648
 
-#line 648
     check_vars_long(scratch);
-#line 648
 
-#line 648
     err = remove(scratch);
-#line 648
     IF (err)
-#line 648
         error("remove of %s failed", scratch);
-#line 648
 }
-#line 648
 
 void
-#line 649
 test_nc_put_vara_float(void)
-#line 649
 {
-#line 649
     int ncid;
-#line 649
     int d;
-#line 649
     int i;
-#line 649
     int j;
-#line 649
     int k;
-#line 649
     int err;
-#line 649
     int nslabs;
-#line 649
     int nels;
-#line 649
     size_t start[MAX_RANK];
-#line 649
     size_t edge[MAX_RANK];
-#line 649
     size_t mid[MAX_RANK];
-#line 649
     size_t index[MAX_RANK];
-#line 649
     int canConvert;	/* Both text or both numeric */
-#line 649
     int allInExtRange;	/* all values within external range? */
-#line 649
     float value[MAX_NELS];
-#line 649
 
-#line 649
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 649
     IF (err) {
-#line 649
         error("nc_create: %s", nc_strerror(err));
-#line 649
         return;
-#line 649
     }
-#line 649
     def_dims(ncid);
-#line 649
     def_vars(ncid);
-#line 649
     err = nc_enddef(ncid);
-#line 649
     IF (err)
-#line 649
         error("nc_enddef: %s", nc_strerror(err));
-#line 649
 
-#line 649
     value[0] = 0;
-#line 649
     for (i = 0; i < NVARS; i++) {
-#line 649
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 649
         assert(var_rank[i] <= MAX_RANK);
-#line 649
         assert(var_nels[i] <= MAX_NELS);
-#line 649
         for (j = 0; j < var_rank[i]; j++) {
-#line 649
             start[j] = 0;
-#line 649
             edge[j] = 1;
-#line 649
 	}
-#line 649
         err = nc_put_vara_float(BAD_ID, i, start, edge, value);
-#line 649
         IF (err != NC_EBADID) 
-#line 649
 	    error("bad ncid: status = %d", err);
-#line 649
         err = nc_put_vara_float(ncid, BAD_VARID, start, edge, value);
-#line 649
         IF (err != NC_ENOTVAR) 
-#line 649
 	    error("bad var id: status = %d", err);
-#line 649
         for (j = 0; j < var_rank[i]; j++) {
-#line 649
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 649
 		start[j] = var_shape[i][j];
-#line 649
 		err = nc_put_vara_float(ncid, i, start, edge, value);
-#line 649
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 649
 		    error("bad start: status = %d", err);
-#line 649
 		start[j] = 0;
-#line 649
 		edge[j] = var_shape[i][j] + 1;
-#line 649
 		err = nc_put_vara_float(ncid, i, start, edge, value);
-#line 649
 		IF (canConvert && err != NC_EEDGE)
-#line 649
 		    error("bad edge: status = %d", err);
-#line 649
 		edge[j] = 1;
-#line 649
 	    }
-#line 649
         }
-#line 649
             /* Check correct error returned even when nothing to put */
-#line 649
         for (j = 0; j < var_rank[i]; j++) {
-#line 649
             edge[j] = 0;
-#line 649
 	}
-#line 649
         err = nc_put_vara_float(BAD_ID, i, start, edge, value);
-#line 649
         IF (err != NC_EBADID) 
-#line 649
 	    error("bad ncid: status = %d", err);
-#line 649
         err = nc_put_vara_float(ncid, BAD_VARID, start, edge, value);
-#line 649
         IF (err != NC_ENOTVAR) 
-#line 649
 	    error("bad var id: status = %d", err);
-#line 649
         for (j = 0; j < var_rank[i]; j++) {
-#line 649
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 649
 		start[j] = var_shape[i][j];
-#line 649
 		err = nc_put_vara_float(ncid, i, start, edge, value);
-#line 649
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 649
 		    error("bad start: status = %d", err);
-#line 649
 		start[j] = 0;
-#line 649
 	    }
-#line 649
         }
-#line 649
 	err = nc_put_vara_float(ncid, i, start, edge, value);
-#line 649
 	if (canConvert) {
-#line 649
 	    IF (err) 
-#line 649
 		error("%s", nc_strerror(err));
-#line 649
 	} else {
-#line 649
 	    IF (err != NC_ECHAR)
-#line 649
 		error("wrong type: status = %d", err);
-#line 649
         }
-#line 649
         for (j = 0; j < var_rank[i]; j++) {
-#line 649
             edge[j] = 1;
-#line 649
 	}
-#line 649
 
-#line 649
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 649
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 649
 	nslabs = 1;
-#line 649
 	for (j = 0; j < var_rank[i]; j++) {
-#line 649
             mid[j] = roll( var_shape[i][j] );
-#line 649
 	    nslabs *= 2;
-#line 649
 	}
-#line 649
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 649
 	for (k = 0; k < nslabs; k++) {
-#line 649
 	    nels = 1;
-#line 649
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 649
 		if ((k >> j) & 1) {
-#line 649
 		    start[j] = 0;
-#line 649
 		    edge[j] = mid[j];
-#line 649
 		}else{
-#line 649
 		    start[j] = mid[j];
-#line 649
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 649
 		}
-#line 649
 		nels *= edge[j];
-#line 649
 	    }
-#line 649
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 649
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 649
 		IF (err) 
-#line 649
 		    error("error in toMixedBase 1");
-#line 649
 		for (d = 0; d < var_rank[i]; d++) 
-#line 649
 		    index[d] += start[d];
-#line 649
 		value[j]= hash_float(var_type[i], var_rank[i], index, NCT_FLOAT);
-#line 649
 		allInExtRange = allInExtRange 
-#line 649
 		    && inRange3(value[j], var_type[i], NCT_FLOAT);
-#line 649
 	    }
-#line 649
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 649
 		err = nc_put_vara_float(ncid, i, NULL, NULL, value);
-#line 649
 	    else
-#line 649
 		err = nc_put_vara_float(ncid, i, start, edge, value);
-#line 649
 	    if (canConvert) {
-#line 649
 		if (allInExtRange) {
-#line 649
 		    IF (err) 
-#line 649
 			error("%s", nc_strerror(err));
-#line 649
 		} else {
-#line 649
 		    IF (err != NC_ERANGE)
-#line 649
 			error("range error: status = %d", err);
-#line 649
 		}
-#line 649
 	    } else {
-#line 649
 		IF (nels > 0 && err != NC_ECHAR)
-#line 649
 		    error("wrong type: status = %d", err);
-#line 649
             }
-#line 649
         }
-#line 649
     }
-#line 649
 
-#line 649
     err = nc_close(ncid);
-#line 649
     IF (err) 
-#line 649
 	error("nc_close: %s", nc_strerror(err));
-#line 649
 
-#line 649
     check_vars_float(scratch);
-#line 649
 
-#line 649
     err = remove(scratch);
-#line 649
     IF (err)
-#line 649
         error("remove of %s failed", scratch);
-#line 649
 }
-#line 649
 
 void
-#line 650
 test_nc_put_vara_double(void)
-#line 650
 {
-#line 650
     int ncid;
-#line 650
     int d;
-#line 650
     int i;
-#line 650
     int j;
-#line 650
     int k;
-#line 650
     int err;
-#line 650
     int nslabs;
-#line 650
     int nels;
-#line 650
     size_t start[MAX_RANK];
-#line 650
     size_t edge[MAX_RANK];
-#line 650
     size_t mid[MAX_RANK];
-#line 650
     size_t index[MAX_RANK];
-#line 650
     int canConvert;	/* Both text or both numeric */
-#line 650
     int allInExtRange;	/* all values within external range? */
-#line 650
     double value[MAX_NELS];
-#line 650
 
-#line 650
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 650
     IF (err) {
-#line 650
         error("nc_create: %s", nc_strerror(err));
-#line 650
         return;
-#line 650
     }
-#line 650
     def_dims(ncid);
-#line 650
     def_vars(ncid);
-#line 650
     err = nc_enddef(ncid);
-#line 650
     IF (err)
-#line 650
         error("nc_enddef: %s", nc_strerror(err));
-#line 650
 
-#line 650
     value[0] = 0;
-#line 650
     for (i = 0; i < NVARS; i++) {
-#line 650
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 650
         assert(var_rank[i] <= MAX_RANK);
-#line 650
         assert(var_nels[i] <= MAX_NELS);
-#line 650
         for (j = 0; j < var_rank[i]; j++) {
-#line 650
             start[j] = 0;
-#line 650
             edge[j] = 1;
-#line 650
 	}
-#line 650
         err = nc_put_vara_double(BAD_ID, i, start, edge, value);
-#line 650
         IF (err != NC_EBADID) 
-#line 650
 	    error("bad ncid: status = %d", err);
-#line 650
         err = nc_put_vara_double(ncid, BAD_VARID, start, edge, value);
-#line 650
         IF (err != NC_ENOTVAR) 
-#line 650
 	    error("bad var id: status = %d", err);
-#line 650
         for (j = 0; j < var_rank[i]; j++) {
-#line 650
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 650
 		start[j] = var_shape[i][j];
-#line 650
 		err = nc_put_vara_double(ncid, i, start, edge, value);
-#line 650
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 650
 		    error("bad start: status = %d", err);
-#line 650
 		start[j] = 0;
-#line 650
 		edge[j] = var_shape[i][j] + 1;
-#line 650
 		err = nc_put_vara_double(ncid, i, start, edge, value);
-#line 650
 		IF (canConvert && err != NC_EEDGE)
-#line 650
 		    error("bad edge: status = %d", err);
-#line 650
 		edge[j] = 1;
-#line 650
 	    }
-#line 650
         }
-#line 650
             /* Check correct error returned even when nothing to put */
-#line 650
         for (j = 0; j < var_rank[i]; j++) {
-#line 650
             edge[j] = 0;
-#line 650
 	}
-#line 650
         err = nc_put_vara_double(BAD_ID, i, start, edge, value);
-#line 650
         IF (err != NC_EBADID) 
-#line 650
 	    error("bad ncid: status = %d", err);
-#line 650
         err = nc_put_vara_double(ncid, BAD_VARID, start, edge, value);
-#line 650
         IF (err != NC_ENOTVAR) 
-#line 650
 	    error("bad var id: status = %d", err);
-#line 650
         for (j = 0; j < var_rank[i]; j++) {
-#line 650
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 650
 		start[j] = var_shape[i][j];
-#line 650
 		err = nc_put_vara_double(ncid, i, start, edge, value);
-#line 650
 		IF (canConvert && err != NC_EINVALCOORDS)
-#line 650
 		    error("bad start: status = %d", err);
-#line 650
 		start[j] = 0;
-#line 650
 	    }
-#line 650
         }
-#line 650
 	err = nc_put_vara_double(ncid, i, start, edge, value);
-#line 650
 	if (canConvert) {
-#line 650
 	    IF (err) 
-#line 650
 		error("%s", nc_strerror(err));
-#line 650
 	} else {
-#line 650
 	    IF (err != NC_ECHAR)
-#line 650
 		error("wrong type: status = %d", err);
-#line 650
         }
-#line 650
         for (j = 0; j < var_rank[i]; j++) {
-#line 650
             edge[j] = 1;
-#line 650
 	}
-#line 650
 
-#line 650
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 650
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 650
 	nslabs = 1;
-#line 650
 	for (j = 0; j < var_rank[i]; j++) {
-#line 650
             mid[j] = roll( var_shape[i][j] );
-#line 650
 	    nslabs *= 2;
-#line 650
 	}
-#line 650
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 650
 	for (k = 0; k < nslabs; k++) {
-#line 650
 	    nels = 1;
-#line 650
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 650
 		if ((k >> j) & 1) {
-#line 650
 		    start[j] = 0;
-#line 650
 		    edge[j] = mid[j];
-#line 650
 		}else{
-#line 650
 		    start[j] = mid[j];
-#line 650
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 650
 		}
-#line 650
 		nels *= edge[j];
-#line 650
 	    }
-#line 650
             for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 650
 		err = toMixedBase(j, var_rank[i], edge, index);
-#line 650
 		IF (err) 
-#line 650
 		    error("error in toMixedBase 1");
-#line 650
 		for (d = 0; d < var_rank[i]; d++) 
-#line 650
 		    index[d] += start[d];
-#line 650
 		value[j]= hash_double(var_type[i], var_rank[i], index, NCT_DOUBLE);
-#line 650
 		allInExtRange = allInExtRange 
-#line 650
 		    && inRange3(value[j], var_type[i], NCT_DOUBLE);
-#line 650
 	    }
-#line 650
 	    if (var_rank[i] == 0 && i%2 == 0)
-#line 650
 		err = nc_put_vara_double(ncid, i, NULL, NULL, value);
-#line 650
 	    else
-#line 650
 		err = nc_put_vara_double(ncid, i, start, edge, value);
-#line 650
 	    if (canConvert) {
-#line 650
 		if (allInExtRange) {
-#line 650
 		    IF (err) 
-#line 650
 			error("%s", nc_strerror(err));
-#line 650
 		} else {
-#line 650
 		    IF (err != NC_ERANGE)
-#line 650
 			error("range error: status = %d", err);
-#line 650
 		}
-#line 650
 	    } else {
-#line 650
 		IF (nels > 0 && err != NC_ECHAR)
-#line 650
 		    error("wrong type: status = %d", err);
-#line 650
             }
-#line 650
         }
-#line 650
     }
-#line 650
 
-#line 650
     err = nc_close(ncid);
-#line 650
     IF (err) 
-#line 650
 	error("nc_close: %s", nc_strerror(err));
-#line 650
 
-#line 650
     check_vars_double(scratch);
-#line 650
 
-#line 650
     err = remove(scratch);
-#line 650
     IF (err)
-#line 650
         error("remove of %s failed", scratch);
-#line 650
 }
-#line 650
 
 
 
-#line 815
 
 void
-#line 816
 test_nc_put_vars_text(void)
-#line 816
 {
-#line 816
     int ncid;
-#line 816
     int d;
-#line 816
     int i;
-#line 816
     int j;
-#line 816
     int k;
-#line 816
     int m;
-#line 816
     int err;
-#line 816
     int nels;
-#line 816
     int nslabs;
-#line 816
     int nstarts;        /* number of different starts */
-#line 816
     size_t start[MAX_RANK];
-#line 816
     size_t edge[MAX_RANK];
-#line 816
     size_t index[MAX_RANK];
-#line 816
     size_t index2[MAX_RANK];
-#line 816
     size_t mid[MAX_RANK];
-#line 816
     size_t count[MAX_RANK];
-#line 816
     size_t sstride[MAX_RANK];
-#line 816
     ptrdiff_t stride[MAX_RANK];
-#line 816
     int canConvert;	/* Both text or both numeric */
-#line 816
     int allInExtRange;	/* all values within external range? */
-#line 816
     text value[MAX_NELS];
-#line 816
 
-#line 816
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 816
     IF (err) {
-#line 816
 	error("nc_create: %s", nc_strerror(err));
-#line 816
 	return;
-#line 816
     }
-#line 816
     def_dims(ncid);
-#line 816
     def_vars(ncid);
-#line 816
     err = nc_enddef(ncid);
-#line 816
     IF (err)
-#line 816
 	error("nc_enddef: %s", nc_strerror(err));
-#line 816
 
-#line 816
     for (i = 0; i < NVARS; i++) {
-#line 816
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 816
 	assert(var_rank[i] <= MAX_RANK);
-#line 816
 	assert(var_nels[i] <= MAX_NELS);
-#line 816
 	for (j = 0; j < var_rank[i]; j++) {
-#line 816
 	    start[j] = 0;
-#line 816
 	    edge[j] = 1;
-#line 816
 	    stride[j] = 1;
-#line 816
 	}
-#line 816
 	err = nc_put_vars_text(BAD_ID, i, start, edge, stride, value);
-#line 816
 	IF (err != NC_EBADID) 
-#line 816
 	    error("bad ncid: status = %d", err);
-#line 816
 	err = nc_put_vars_text(ncid, BAD_VARID, start, edge, stride, value);
-#line 816
 	IF (err != NC_ENOTVAR) 
-#line 816
 	    error("bad var id: status = %d", err);
-#line 816
 	for (j = 0; j < var_rank[i]; j++) {
-#line 816
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 816
 		start[j] = var_shape[i][j] + 1;
-#line 816
 		err = nc_put_vars_text(ncid, i, start, edge, stride, value);
-#line 816
 	      if(!canConvert) {
-#line 816
 		IF(err != NC_ECHAR)
-#line 816
 			error("conversion: status = %d", err);
-#line 816
 	      } else {
-#line 816
 		IF(err != NC_EINVALCOORDS)
-#line 816
 		    error("bad start: status = %d", err);
-#line 816
 		start[j] = 0;
-#line 816
 		edge[j] = var_shape[i][j] + 1;
-#line 816
 		err = nc_put_vars_text(ncid, i, start, edge, stride, value);
-#line 816
 		IF (err != NC_EEDGE)
-#line 816
 		    error("bad edge: status = %d", err);
-#line 816
 		edge[j] = 1;
-#line 816
 		stride[j] = 0;
-#line 816
 		err = nc_put_vars_text(ncid, i, start, edge, stride, value);
-#line 816
 		IF (err != NC_ESTRIDE)
-#line 816
 		    error("bad stride: status = %d", err);
-#line 816
 		stride[j] = 1;
-#line 816
               }
-#line 816
 	    }
-#line 816
 	}
-#line 816
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 816
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 816
 	nslabs = 1;
-#line 816
 	for (j = 0; j < var_rank[i]; j++) {
-#line 816
 	    mid[j] = roll( var_shape[i][j] );
-#line 816
 	    nslabs *= 2;
-#line 816
 	}
-#line 816
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 816
 	    /* choose random stride from 1 to edge */
-#line 816
 	for (k = 0; k < nslabs; k++) {
-#line 816
 	    nstarts = 1;
-#line 816
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 816
 		if ((k >> j) & 1) {
-#line 816
 		    start[j] = 0;
-#line 816
 		    edge[j] = mid[j];
-#line 816
 		}else{
-#line 816
 		    start[j] = mid[j];
-#line 816
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 816
 		}
-#line 816
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 816
 		nstarts *= stride[j];
-#line 816
 	    }
-#line 816
 	    for (m = 0; m < nstarts; m++) {
-#line 816
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 816
 		IF (err)
-#line 816
 		    error("error in toMixedBase");
-#line 816
 		nels = 1;
-#line 816
 		for (j = 0; j < var_rank[i]; j++) {
-#line 816
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 816
 		    nels *= count[j];
-#line 816
 		    index[j] += start[j];
-#line 816
 		}
-#line 816
 		    /* Random choice of forward or backward */
-#line 816
 /* TODO
-#line 816
 		if ( roll(2) ) {
-#line 816
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 816
 			index[j] += (count[j] - 1) * stride[j];
-#line 816
 			stride[j] = -stride[j];
-#line 816
 		    }
-#line 816
 		}
-#line 816
 */
-#line 816
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 816
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 816
 		    IF (err)
-#line 816
 			error("error in toMixedBase");
-#line 816
 		    for (d = 0; d < var_rank[i]; d++)
-#line 816
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 816
 		    value[j] = hash_text(var_type[i], var_rank[i], index2, 
-#line 816
 			NCT_TEXT);
-#line 816
 		    allInExtRange = allInExtRange 
-#line 816
 			&& inRange3(value[j], var_type[i], NCT_TEXT);
-#line 816
 		}
-#line 816
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 816
 		    err = nc_put_vars_text(ncid, i, NULL, NULL, stride, value);
-#line 816
 		else
-#line 816
 		    err = nc_put_vars_text(ncid, i, index, count, stride, value);
-#line 816
 		if (canConvert) {
-#line 816
 		    if (allInExtRange) {
-#line 816
 			IF (err) 
-#line 816
 			    error("%s", nc_strerror(err));
-#line 816
 		    } else {
-#line 816
 			IF (err != NC_ERANGE)
-#line 816
 			    error("range error: status = %d", err);
-#line 816
 		    }
-#line 816
 		} else {
-#line 816
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 816
 			error("wrong type: status = %d", err);
-#line 816
 		}
-#line 816
 	    }
-#line 816
 	}
-#line 816
     }
-#line 816
 
-#line 816
     err = nc_close(ncid);
-#line 816
     IF (err) 
-#line 816
 	error("nc_close: %s", nc_strerror(err));
-#line 816
 
-#line 816
     check_vars_text(scratch);
-#line 816
 
-#line 816
     err = remove(scratch);
-#line 816
     IF (err)
-#line 816
 	error("remove of %s failed", scratch);
-#line 816
 }
-#line 816
 
 void
-#line 817
 test_nc_put_vars_uchar(void)
-#line 817
 {
-#line 817
     int ncid;
-#line 817
     int d;
-#line 817
     int i;
-#line 817
     int j;
-#line 817
     int k;
-#line 817
     int m;
-#line 817
     int err;
-#line 817
     int nels;
-#line 817
     int nslabs;
-#line 817
     int nstarts;        /* number of different starts */
-#line 817
     size_t start[MAX_RANK];
-#line 817
     size_t edge[MAX_RANK];
-#line 817
     size_t index[MAX_RANK];
-#line 817
     size_t index2[MAX_RANK];
-#line 817
     size_t mid[MAX_RANK];
-#line 817
     size_t count[MAX_RANK];
-#line 817
     size_t sstride[MAX_RANK];
-#line 817
     ptrdiff_t stride[MAX_RANK];
-#line 817
     int canConvert;	/* Both text or both numeric */
-#line 817
     int allInExtRange;	/* all values within external range? */
-#line 817
     uchar value[MAX_NELS];
-#line 817
 
-#line 817
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 817
     IF (err) {
-#line 817
 	error("nc_create: %s", nc_strerror(err));
-#line 817
 	return;
-#line 817
     }
-#line 817
     def_dims(ncid);
-#line 817
     def_vars(ncid);
-#line 817
     err = nc_enddef(ncid);
-#line 817
     IF (err)
-#line 817
 	error("nc_enddef: %s", nc_strerror(err));
-#line 817
 
-#line 817
     for (i = 0; i < NVARS; i++) {
-#line 817
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 817
 	assert(var_rank[i] <= MAX_RANK);
-#line 817
 	assert(var_nels[i] <= MAX_NELS);
-#line 817
 	for (j = 0; j < var_rank[i]; j++) {
-#line 817
 	    start[j] = 0;
-#line 817
 	    edge[j] = 1;
-#line 817
 	    stride[j] = 1;
-#line 817
 	}
-#line 817
 	err = nc_put_vars_uchar(BAD_ID, i, start, edge, stride, value);
-#line 817
 	IF (err != NC_EBADID) 
-#line 817
 	    error("bad ncid: status = %d", err);
-#line 817
 	err = nc_put_vars_uchar(ncid, BAD_VARID, start, edge, stride, value);
-#line 817
 	IF (err != NC_ENOTVAR) 
-#line 817
 	    error("bad var id: status = %d", err);
-#line 817
 	for (j = 0; j < var_rank[i]; j++) {
-#line 817
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 817
 		start[j] = var_shape[i][j] + 1;
-#line 817
 		err = nc_put_vars_uchar(ncid, i, start, edge, stride, value);
-#line 817
 	      if(!canConvert) {
-#line 817
 		IF(err != NC_ECHAR)
-#line 817
 			error("conversion: status = %d", err);
-#line 817
 	      } else {
-#line 817
 		IF(err != NC_EINVALCOORDS)
-#line 817
 		    error("bad start: status = %d", err);
-#line 817
 		start[j] = 0;
-#line 817
 		edge[j] = var_shape[i][j] + 1;
-#line 817
 		err = nc_put_vars_uchar(ncid, i, start, edge, stride, value);
-#line 817
 		IF (err != NC_EEDGE)
-#line 817
 		    error("bad edge: status = %d", err);
-#line 817
 		edge[j] = 1;
-#line 817
 		stride[j] = 0;
-#line 817
 		err = nc_put_vars_uchar(ncid, i, start, edge, stride, value);
-#line 817
 		IF (err != NC_ESTRIDE)
-#line 817
 		    error("bad stride: status = %d", err);
-#line 817
 		stride[j] = 1;
-#line 817
               }
-#line 817
 	    }
-#line 817
 	}
-#line 817
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 817
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 817
 	nslabs = 1;
-#line 817
 	for (j = 0; j < var_rank[i]; j++) {
-#line 817
 	    mid[j] = roll( var_shape[i][j] );
-#line 817
 	    nslabs *= 2;
-#line 817
 	}
-#line 817
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 817
 	    /* choose random stride from 1 to edge */
-#line 817
 	for (k = 0; k < nslabs; k++) {
-#line 817
 	    nstarts = 1;
-#line 817
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 817
 		if ((k >> j) & 1) {
-#line 817
 		    start[j] = 0;
-#line 817
 		    edge[j] = mid[j];
-#line 817
 		}else{
-#line 817
 		    start[j] = mid[j];
-#line 817
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 817
 		}
-#line 817
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 817
 		nstarts *= stride[j];
-#line 817
 	    }
-#line 817
 	    for (m = 0; m < nstarts; m++) {
-#line 817
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 817
 		IF (err)
-#line 817
 		    error("error in toMixedBase");
-#line 817
 		nels = 1;
-#line 817
 		for (j = 0; j < var_rank[i]; j++) {
-#line 817
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 817
 		    nels *= count[j];
-#line 817
 		    index[j] += start[j];
-#line 817
 		}
-#line 817
 		    /* Random choice of forward or backward */
-#line 817
 /* TODO
-#line 817
 		if ( roll(2) ) {
-#line 817
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 817
 			index[j] += (count[j] - 1) * stride[j];
-#line 817
 			stride[j] = -stride[j];
-#line 817
 		    }
-#line 817
 		}
-#line 817
 */
-#line 817
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 817
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 817
 		    IF (err)
-#line 817
 			error("error in toMixedBase");
-#line 817
 		    for (d = 0; d < var_rank[i]; d++)
-#line 817
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 817
 		    value[j] = hash_uchar(var_type[i], var_rank[i], index2, 
-#line 817
 			NCT_UCHAR);
-#line 817
 		    allInExtRange = allInExtRange 
-#line 817
 			&& inRange3(value[j], var_type[i], NCT_UCHAR);
-#line 817
 		}
-#line 817
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 817
 		    err = nc_put_vars_uchar(ncid, i, NULL, NULL, stride, value);
-#line 817
 		else
-#line 817
 		    err = nc_put_vars_uchar(ncid, i, index, count, stride, value);
-#line 817
 		if (canConvert) {
-#line 817
 		    if (allInExtRange) {
-#line 817
 			IF (err) 
-#line 817
 			    error("%s", nc_strerror(err));
-#line 817
 		    } else {
-#line 817
 			IF (err != NC_ERANGE)
-#line 817
 			    error("range error: status = %d", err);
-#line 817
 		    }
-#line 817
 		} else {
-#line 817
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 817
 			error("wrong type: status = %d", err);
-#line 817
 		}
-#line 817
 	    }
-#line 817
 	}
-#line 817
     }
-#line 817
 
-#line 817
     err = nc_close(ncid);
-#line 817
     IF (err) 
-#line 817
 	error("nc_close: %s", nc_strerror(err));
-#line 817
 
-#line 817
     check_vars_uchar(scratch);
-#line 817
 
-#line 817
     err = remove(scratch);
-#line 817
     IF (err)
-#line 817
 	error("remove of %s failed", scratch);
-#line 817
 }
-#line 817
 
 void
-#line 818
 test_nc_put_vars_schar(void)
-#line 818
 {
-#line 818
     int ncid;
-#line 818
     int d;
-#line 818
     int i;
-#line 818
     int j;
-#line 818
     int k;
-#line 818
     int m;
-#line 818
     int err;
-#line 818
     int nels;
-#line 818
     int nslabs;
-#line 818
     int nstarts;        /* number of different starts */
-#line 818
     size_t start[MAX_RANK];
-#line 818
     size_t edge[MAX_RANK];
-#line 818
     size_t index[MAX_RANK];
-#line 818
     size_t index2[MAX_RANK];
-#line 818
     size_t mid[MAX_RANK];
-#line 818
     size_t count[MAX_RANK];
-#line 818
     size_t sstride[MAX_RANK];
-#line 818
     ptrdiff_t stride[MAX_RANK];
-#line 818
     int canConvert;	/* Both text or both numeric */
-#line 818
     int allInExtRange;	/* all values within external range? */
-#line 818
     schar value[MAX_NELS];
-#line 818
 
-#line 818
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 818
     IF (err) {
-#line 818
 	error("nc_create: %s", nc_strerror(err));
-#line 818
 	return;
-#line 818
     }
-#line 818
     def_dims(ncid);
-#line 818
     def_vars(ncid);
-#line 818
     err = nc_enddef(ncid);
-#line 818
     IF (err)
-#line 818
 	error("nc_enddef: %s", nc_strerror(err));
-#line 818
 
-#line 818
     for (i = 0; i < NVARS; i++) {
-#line 818
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 818
 	assert(var_rank[i] <= MAX_RANK);
-#line 818
 	assert(var_nels[i] <= MAX_NELS);
-#line 818
 	for (j = 0; j < var_rank[i]; j++) {
-#line 818
 	    start[j] = 0;
-#line 818
 	    edge[j] = 1;
-#line 818
 	    stride[j] = 1;
-#line 818
 	}
-#line 818
 	err = nc_put_vars_schar(BAD_ID, i, start, edge, stride, value);
-#line 818
 	IF (err != NC_EBADID) 
-#line 818
 	    error("bad ncid: status = %d", err);
-#line 818
 	err = nc_put_vars_schar(ncid, BAD_VARID, start, edge, stride, value);
-#line 818
 	IF (err != NC_ENOTVAR) 
-#line 818
 	    error("bad var id: status = %d", err);
-#line 818
 	for (j = 0; j < var_rank[i]; j++) {
-#line 818
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 818
 		start[j] = var_shape[i][j] + 1;
-#line 818
 		err = nc_put_vars_schar(ncid, i, start, edge, stride, value);
-#line 818
 	      if(!canConvert) {
-#line 818
 		IF(err != NC_ECHAR)
-#line 818
 			error("conversion: status = %d", err);
-#line 818
 	      } else {
-#line 818
 		IF(err != NC_EINVALCOORDS)
-#line 818
 		    error("bad start: status = %d", err);
-#line 818
 		start[j] = 0;
-#line 818
 		edge[j] = var_shape[i][j] + 1;
-#line 818
 		err = nc_put_vars_schar(ncid, i, start, edge, stride, value);
-#line 818
 		IF (err != NC_EEDGE)
-#line 818
 		    error("bad edge: status = %d", err);
-#line 818
 		edge[j] = 1;
-#line 818
 		stride[j] = 0;
-#line 818
 		err = nc_put_vars_schar(ncid, i, start, edge, stride, value);
-#line 818
 		IF (err != NC_ESTRIDE)
-#line 818
 		    error("bad stride: status = %d", err);
-#line 818
 		stride[j] = 1;
-#line 818
               }
-#line 818
 	    }
-#line 818
 	}
-#line 818
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 818
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 818
 	nslabs = 1;
-#line 818
 	for (j = 0; j < var_rank[i]; j++) {
-#line 818
 	    mid[j] = roll( var_shape[i][j] );
-#line 818
 	    nslabs *= 2;
-#line 818
 	}
-#line 818
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 818
 	    /* choose random stride from 1 to edge */
-#line 818
 	for (k = 0; k < nslabs; k++) {
-#line 818
 	    nstarts = 1;
-#line 818
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 818
 		if ((k >> j) & 1) {
-#line 818
 		    start[j] = 0;
-#line 818
 		    edge[j] = mid[j];
-#line 818
 		}else{
-#line 818
 		    start[j] = mid[j];
-#line 818
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 818
 		}
-#line 818
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 818
 		nstarts *= stride[j];
-#line 818
 	    }
-#line 818
 	    for (m = 0; m < nstarts; m++) {
-#line 818
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 818
 		IF (err)
-#line 818
 		    error("error in toMixedBase");
-#line 818
 		nels = 1;
-#line 818
 		for (j = 0; j < var_rank[i]; j++) {
-#line 818
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 818
 		    nels *= count[j];
-#line 818
 		    index[j] += start[j];
-#line 818
 		}
-#line 818
 		    /* Random choice of forward or backward */
-#line 818
 /* TODO
-#line 818
 		if ( roll(2) ) {
-#line 818
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 818
 			index[j] += (count[j] - 1) * stride[j];
-#line 818
 			stride[j] = -stride[j];
-#line 818
 		    }
-#line 818
 		}
-#line 818
 */
-#line 818
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 818
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 818
 		    IF (err)
-#line 818
 			error("error in toMixedBase");
-#line 818
 		    for (d = 0; d < var_rank[i]; d++)
-#line 818
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 818
 		    value[j] = hash_schar(var_type[i], var_rank[i], index2, 
-#line 818
 			NCT_SCHAR);
-#line 818
 		    allInExtRange = allInExtRange 
-#line 818
 			&& inRange3(value[j], var_type[i], NCT_SCHAR);
-#line 818
 		}
-#line 818
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 818
 		    err = nc_put_vars_schar(ncid, i, NULL, NULL, stride, value);
-#line 818
 		else
-#line 818
 		    err = nc_put_vars_schar(ncid, i, index, count, stride, value);
-#line 818
 		if (canConvert) {
-#line 818
 		    if (allInExtRange) {
-#line 818
 			IF (err) 
-#line 818
 			    error("%s", nc_strerror(err));
-#line 818
 		    } else {
-#line 818
 			IF (err != NC_ERANGE)
-#line 818
 			    error("range error: status = %d", err);
-#line 818
 		    }
-#line 818
 		} else {
-#line 818
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 818
 			error("wrong type: status = %d", err);
-#line 818
 		}
-#line 818
 	    }
-#line 818
 	}
-#line 818
     }
-#line 818
 
-#line 818
     err = nc_close(ncid);
-#line 818
     IF (err) 
-#line 818
 	error("nc_close: %s", nc_strerror(err));
-#line 818
 
-#line 818
     check_vars_schar(scratch);
-#line 818
 
-#line 818
     err = remove(scratch);
-#line 818
     IF (err)
-#line 818
 	error("remove of %s failed", scratch);
-#line 818
 }
-#line 818
 
 void
-#line 819
 test_nc_put_vars_short(void)
-#line 819
 {
-#line 819
     int ncid;
-#line 819
     int d;
-#line 819
     int i;
-#line 819
     int j;
-#line 819
     int k;
-#line 819
     int m;
-#line 819
     int err;
-#line 819
     int nels;
-#line 819
     int nslabs;
-#line 819
     int nstarts;        /* number of different starts */
-#line 819
     size_t start[MAX_RANK];
-#line 819
     size_t edge[MAX_RANK];
-#line 819
     size_t index[MAX_RANK];
-#line 819
     size_t index2[MAX_RANK];
-#line 819
     size_t mid[MAX_RANK];
-#line 819
     size_t count[MAX_RANK];
-#line 819
     size_t sstride[MAX_RANK];
-#line 819
     ptrdiff_t stride[MAX_RANK];
-#line 819
     int canConvert;	/* Both text or both numeric */
-#line 819
     int allInExtRange;	/* all values within external range? */
-#line 819
     short value[MAX_NELS];
-#line 819
 
-#line 819
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 819
     IF (err) {
-#line 819
 	error("nc_create: %s", nc_strerror(err));
-#line 819
 	return;
-#line 819
     }
-#line 819
     def_dims(ncid);
-#line 819
     def_vars(ncid);
-#line 819
     err = nc_enddef(ncid);
-#line 819
     IF (err)
-#line 819
 	error("nc_enddef: %s", nc_strerror(err));
-#line 819
 
-#line 819
     for (i = 0; i < NVARS; i++) {
-#line 819
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 819
 	assert(var_rank[i] <= MAX_RANK);
-#line 819
 	assert(var_nels[i] <= MAX_NELS);
-#line 819
 	for (j = 0; j < var_rank[i]; j++) {
-#line 819
 	    start[j] = 0;
-#line 819
 	    edge[j] = 1;
-#line 819
 	    stride[j] = 1;
-#line 819
 	}
-#line 819
 	err = nc_put_vars_short(BAD_ID, i, start, edge, stride, value);
-#line 819
 	IF (err != NC_EBADID) 
-#line 819
 	    error("bad ncid: status = %d", err);
-#line 819
 	err = nc_put_vars_short(ncid, BAD_VARID, start, edge, stride, value);
-#line 819
 	IF (err != NC_ENOTVAR) 
-#line 819
 	    error("bad var id: status = %d", err);
-#line 819
 	for (j = 0; j < var_rank[i]; j++) {
-#line 819
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 819
 		start[j] = var_shape[i][j] + 1;
-#line 819
 		err = nc_put_vars_short(ncid, i, start, edge, stride, value);
-#line 819
 	      if(!canConvert) {
-#line 819
 		IF(err != NC_ECHAR)
-#line 819
 			error("conversion: status = %d", err);
-#line 819
 	      } else {
-#line 819
 		IF(err != NC_EINVALCOORDS)
-#line 819
 		    error("bad start: status = %d", err);
-#line 819
 		start[j] = 0;
-#line 819
 		edge[j] = var_shape[i][j] + 1;
-#line 819
 		err = nc_put_vars_short(ncid, i, start, edge, stride, value);
-#line 819
 		IF (err != NC_EEDGE)
-#line 819
 		    error("bad edge: status = %d", err);
-#line 819
 		edge[j] = 1;
-#line 819
 		stride[j] = 0;
-#line 819
 		err = nc_put_vars_short(ncid, i, start, edge, stride, value);
-#line 819
 		IF (err != NC_ESTRIDE)
-#line 819
 		    error("bad stride: status = %d", err);
-#line 819
 		stride[j] = 1;
-#line 819
               }
-#line 819
 	    }
-#line 819
 	}
-#line 819
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 819
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 819
 	nslabs = 1;
-#line 819
 	for (j = 0; j < var_rank[i]; j++) {
-#line 819
 	    mid[j] = roll( var_shape[i][j] );
-#line 819
 	    nslabs *= 2;
-#line 819
 	}
-#line 819
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 819
 	    /* choose random stride from 1 to edge */
-#line 819
 	for (k = 0; k < nslabs; k++) {
-#line 819
 	    nstarts = 1;
-#line 819
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 819
 		if ((k >> j) & 1) {
-#line 819
 		    start[j] = 0;
-#line 819
 		    edge[j] = mid[j];
-#line 819
 		}else{
-#line 819
 		    start[j] = mid[j];
-#line 819
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 819
 		}
-#line 819
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 819
 		nstarts *= stride[j];
-#line 819
 	    }
-#line 819
 	    for (m = 0; m < nstarts; m++) {
-#line 819
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 819
 		IF (err)
-#line 819
 		    error("error in toMixedBase");
-#line 819
 		nels = 1;
-#line 819
 		for (j = 0; j < var_rank[i]; j++) {
-#line 819
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 819
 		    nels *= count[j];
-#line 819
 		    index[j] += start[j];
-#line 819
 		}
-#line 819
 		    /* Random choice of forward or backward */
-#line 819
 /* TODO
-#line 819
 		if ( roll(2) ) {
-#line 819
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 819
 			index[j] += (count[j] - 1) * stride[j];
-#line 819
 			stride[j] = -stride[j];
-#line 819
 		    }
-#line 819
 		}
-#line 819
 */
-#line 819
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 819
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 819
 		    IF (err)
-#line 819
 			error("error in toMixedBase");
-#line 819
 		    for (d = 0; d < var_rank[i]; d++)
-#line 819
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 819
 		    value[j] = hash_short(var_type[i], var_rank[i], index2, 
-#line 819
 			NCT_SHORT);
-#line 819
 		    allInExtRange = allInExtRange 
-#line 819
 			&& inRange3(value[j], var_type[i], NCT_SHORT);
-#line 819
 		}
-#line 819
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 819
 		    err = nc_put_vars_short(ncid, i, NULL, NULL, stride, value);
-#line 819
 		else
-#line 819
 		    err = nc_put_vars_short(ncid, i, index, count, stride, value);
-#line 819
 		if (canConvert) {
-#line 819
 		    if (allInExtRange) {
-#line 819
 			IF (err) 
-#line 819
 			    error("%s", nc_strerror(err));
-#line 819
 		    } else {
-#line 819
 			IF (err != NC_ERANGE)
-#line 819
 			    error("range error: status = %d", err);
-#line 819
 		    }
-#line 819
 		} else {
-#line 819
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 819
 			error("wrong type: status = %d", err);
-#line 819
 		}
-#line 819
 	    }
-#line 819
 	}
-#line 819
     }
-#line 819
 
-#line 819
     err = nc_close(ncid);
-#line 819
     IF (err) 
-#line 819
 	error("nc_close: %s", nc_strerror(err));
-#line 819
 
-#line 819
     check_vars_short(scratch);
-#line 819
 
-#line 819
     err = remove(scratch);
-#line 819
     IF (err)
-#line 819
 	error("remove of %s failed", scratch);
-#line 819
 }
-#line 819
 
 void
-#line 820
 test_nc_put_vars_int(void)
-#line 820
 {
-#line 820
     int ncid;
-#line 820
     int d;
-#line 820
     int i;
-#line 820
     int j;
-#line 820
     int k;
-#line 820
     int m;
-#line 820
     int err;
-#line 820
     int nels;
-#line 820
     int nslabs;
-#line 820
     int nstarts;        /* number of different starts */
-#line 820
     size_t start[MAX_RANK];
-#line 820
     size_t edge[MAX_RANK];
-#line 820
     size_t index[MAX_RANK];
-#line 820
     size_t index2[MAX_RANK];
-#line 820
     size_t mid[MAX_RANK];
-#line 820
     size_t count[MAX_RANK];
-#line 820
     size_t sstride[MAX_RANK];
-#line 820
     ptrdiff_t stride[MAX_RANK];
-#line 820
     int canConvert;	/* Both text or both numeric */
-#line 820
     int allInExtRange;	/* all values within external range? */
-#line 820
     int value[MAX_NELS];
-#line 820
 
-#line 820
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 820
     IF (err) {
-#line 820
 	error("nc_create: %s", nc_strerror(err));
-#line 820
 	return;
-#line 820
     }
-#line 820
     def_dims(ncid);
-#line 820
     def_vars(ncid);
-#line 820
     err = nc_enddef(ncid);
-#line 820
     IF (err)
-#line 820
 	error("nc_enddef: %s", nc_strerror(err));
-#line 820
 
-#line 820
     for (i = 0; i < NVARS; i++) {
-#line 820
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 820
 	assert(var_rank[i] <= MAX_RANK);
-#line 820
 	assert(var_nels[i] <= MAX_NELS);
-#line 820
 	for (j = 0; j < var_rank[i]; j++) {
-#line 820
 	    start[j] = 0;
-#line 820
 	    edge[j] = 1;
-#line 820
 	    stride[j] = 1;
-#line 820
 	}
-#line 820
 	err = nc_put_vars_int(BAD_ID, i, start, edge, stride, value);
-#line 820
 	IF (err != NC_EBADID) 
-#line 820
 	    error("bad ncid: status = %d", err);
-#line 820
 	err = nc_put_vars_int(ncid, BAD_VARID, start, edge, stride, value);
-#line 820
 	IF (err != NC_ENOTVAR) 
-#line 820
 	    error("bad var id: status = %d", err);
-#line 820
 	for (j = 0; j < var_rank[i]; j++) {
-#line 820
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 820
 		start[j] = var_shape[i][j] + 1;
-#line 820
 		err = nc_put_vars_int(ncid, i, start, edge, stride, value);
-#line 820
 	      if(!canConvert) {
-#line 820
 		IF(err != NC_ECHAR)
-#line 820
 			error("conversion: status = %d", err);
-#line 820
 	      } else {
-#line 820
 		IF(err != NC_EINVALCOORDS)
-#line 820
 		    error("bad start: status = %d", err);
-#line 820
 		start[j] = 0;
-#line 820
 		edge[j] = var_shape[i][j] + 1;
-#line 820
 		err = nc_put_vars_int(ncid, i, start, edge, stride, value);
-#line 820
 		IF (err != NC_EEDGE)
-#line 820
 		    error("bad edge: status = %d", err);
-#line 820
 		edge[j] = 1;
-#line 820
 		stride[j] = 0;
-#line 820
 		err = nc_put_vars_int(ncid, i, start, edge, stride, value);
-#line 820
 		IF (err != NC_ESTRIDE)
-#line 820
 		    error("bad stride: status = %d", err);
-#line 820
 		stride[j] = 1;
-#line 820
               }
-#line 820
 	    }
-#line 820
 	}
-#line 820
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 820
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 820
 	nslabs = 1;
-#line 820
 	for (j = 0; j < var_rank[i]; j++) {
-#line 820
 	    mid[j] = roll( var_shape[i][j] );
-#line 820
 	    nslabs *= 2;
-#line 820
 	}
-#line 820
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 820
 	    /* choose random stride from 1 to edge */
-#line 820
 	for (k = 0; k < nslabs; k++) {
-#line 820
 	    nstarts = 1;
-#line 820
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 820
 		if ((k >> j) & 1) {
-#line 820
 		    start[j] = 0;
-#line 820
 		    edge[j] = mid[j];
-#line 820
 		}else{
-#line 820
 		    start[j] = mid[j];
-#line 820
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 820
 		}
-#line 820
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 820
 		nstarts *= stride[j];
-#line 820
 	    }
-#line 820
 	    for (m = 0; m < nstarts; m++) {
-#line 820
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 820
 		IF (err)
-#line 820
 		    error("error in toMixedBase");
-#line 820
 		nels = 1;
-#line 820
 		for (j = 0; j < var_rank[i]; j++) {
-#line 820
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 820
 		    nels *= count[j];
-#line 820
 		    index[j] += start[j];
-#line 820
 		}
-#line 820
 		    /* Random choice of forward or backward */
-#line 820
 /* TODO
-#line 820
 		if ( roll(2) ) {
-#line 820
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 820
 			index[j] += (count[j] - 1) * stride[j];
-#line 820
 			stride[j] = -stride[j];
-#line 820
 		    }
-#line 820
 		}
-#line 820
 */
-#line 820
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 820
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 820
 		    IF (err)
-#line 820
 			error("error in toMixedBase");
-#line 820
 		    for (d = 0; d < var_rank[i]; d++)
-#line 820
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 820
 		    value[j] = hash_int(var_type[i], var_rank[i], index2, 
-#line 820
 			NCT_INT);
-#line 820
 		    allInExtRange = allInExtRange 
-#line 820
 			&& inRange3(value[j], var_type[i], NCT_INT);
-#line 820
 		}
-#line 820
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 820
 		    err = nc_put_vars_int(ncid, i, NULL, NULL, stride, value);
-#line 820
 		else
-#line 820
 		    err = nc_put_vars_int(ncid, i, index, count, stride, value);
-#line 820
 		if (canConvert) {
-#line 820
 		    if (allInExtRange) {
-#line 820
 			IF (err) 
-#line 820
 			    error("%s", nc_strerror(err));
-#line 820
 		    } else {
-#line 820
 			IF (err != NC_ERANGE)
-#line 820
 			    error("range error: status = %d", err);
-#line 820
 		    }
-#line 820
 		} else {
-#line 820
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 820
 			error("wrong type: status = %d", err);
-#line 820
 		}
-#line 820
 	    }
-#line 820
 	}
-#line 820
     }
-#line 820
 
-#line 820
     err = nc_close(ncid);
-#line 820
     IF (err) 
-#line 820
 	error("nc_close: %s", nc_strerror(err));
-#line 820
 
-#line 820
     check_vars_int(scratch);
-#line 820
 
-#line 820
     err = remove(scratch);
-#line 820
     IF (err)
-#line 820
 	error("remove of %s failed", scratch);
-#line 820
 }
-#line 820
 
 void
-#line 821
 test_nc_put_vars_long(void)
-#line 821
 {
-#line 821
     int ncid;
-#line 821
     int d;
-#line 821
     int i;
-#line 821
     int j;
-#line 821
     int k;
-#line 821
     int m;
-#line 821
     int err;
-#line 821
     int nels;
-#line 821
     int nslabs;
-#line 821
     int nstarts;        /* number of different starts */
-#line 821
     size_t start[MAX_RANK];
-#line 821
     size_t edge[MAX_RANK];
-#line 821
     size_t index[MAX_RANK];
-#line 821
     size_t index2[MAX_RANK];
-#line 821
     size_t mid[MAX_RANK];
-#line 821
     size_t count[MAX_RANK];
-#line 821
     size_t sstride[MAX_RANK];
-#line 821
     ptrdiff_t stride[MAX_RANK];
-#line 821
     int canConvert;	/* Both text or both numeric */
-#line 821
     int allInExtRange;	/* all values within external range? */
-#line 821
     long value[MAX_NELS];
-#line 821
 
-#line 821
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 821
     IF (err) {
-#line 821
 	error("nc_create: %s", nc_strerror(err));
-#line 821
 	return;
-#line 821
     }
-#line 821
     def_dims(ncid);
-#line 821
     def_vars(ncid);
-#line 821
     err = nc_enddef(ncid);
-#line 821
     IF (err)
-#line 821
 	error("nc_enddef: %s", nc_strerror(err));
-#line 821
 
-#line 821
     for (i = 0; i < NVARS; i++) {
-#line 821
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 821
 	assert(var_rank[i] <= MAX_RANK);
-#line 821
 	assert(var_nels[i] <= MAX_NELS);
-#line 821
 	for (j = 0; j < var_rank[i]; j++) {
-#line 821
 	    start[j] = 0;
-#line 821
 	    edge[j] = 1;
-#line 821
 	    stride[j] = 1;
-#line 821
 	}
-#line 821
 	err = nc_put_vars_long(BAD_ID, i, start, edge, stride, value);
-#line 821
 	IF (err != NC_EBADID) 
-#line 821
 	    error("bad ncid: status = %d", err);
-#line 821
 	err = nc_put_vars_long(ncid, BAD_VARID, start, edge, stride, value);
-#line 821
 	IF (err != NC_ENOTVAR) 
-#line 821
 	    error("bad var id: status = %d", err);
-#line 821
 	for (j = 0; j < var_rank[i]; j++) {
-#line 821
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 821
 		start[j] = var_shape[i][j] + 1;
-#line 821
 		err = nc_put_vars_long(ncid, i, start, edge, stride, value);
-#line 821
 	      if(!canConvert) {
-#line 821
 		IF(err != NC_ECHAR)
-#line 821
 			error("conversion: status = %d", err);
-#line 821
 	      } else {
-#line 821
 		IF(err != NC_EINVALCOORDS)
-#line 821
 		    error("bad start: status = %d", err);
-#line 821
 		start[j] = 0;
-#line 821
 		edge[j] = var_shape[i][j] + 1;
-#line 821
 		err = nc_put_vars_long(ncid, i, start, edge, stride, value);
-#line 821
 		IF (err != NC_EEDGE)
-#line 821
 		    error("bad edge: status = %d", err);
-#line 821
 		edge[j] = 1;
-#line 821
 		stride[j] = 0;
-#line 821
 		err = nc_put_vars_long(ncid, i, start, edge, stride, value);
-#line 821
 		IF (err != NC_ESTRIDE)
-#line 821
 		    error("bad stride: status = %d", err);
-#line 821
 		stride[j] = 1;
-#line 821
               }
-#line 821
 	    }
-#line 821
 	}
-#line 821
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 821
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 821
 	nslabs = 1;
-#line 821
 	for (j = 0; j < var_rank[i]; j++) {
-#line 821
 	    mid[j] = roll( var_shape[i][j] );
-#line 821
 	    nslabs *= 2;
-#line 821
 	}
-#line 821
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 821
 	    /* choose random stride from 1 to edge */
-#line 821
 	for (k = 0; k < nslabs; k++) {
-#line 821
 	    nstarts = 1;
-#line 821
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 821
 		if ((k >> j) & 1) {
-#line 821
 		    start[j] = 0;
-#line 821
 		    edge[j] = mid[j];
-#line 821
 		}else{
-#line 821
 		    start[j] = mid[j];
-#line 821
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 821
 		}
-#line 821
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 821
 		nstarts *= stride[j];
-#line 821
 	    }
-#line 821
 	    for (m = 0; m < nstarts; m++) {
-#line 821
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 821
 		IF (err)
-#line 821
 		    error("error in toMixedBase");
-#line 821
 		nels = 1;
-#line 821
 		for (j = 0; j < var_rank[i]; j++) {
-#line 821
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 821
 		    nels *= count[j];
-#line 821
 		    index[j] += start[j];
-#line 821
 		}
-#line 821
 		    /* Random choice of forward or backward */
-#line 821
 /* TODO
-#line 821
 		if ( roll(2) ) {
-#line 821
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 821
 			index[j] += (count[j] - 1) * stride[j];
-#line 821
 			stride[j] = -stride[j];
-#line 821
 		    }
-#line 821
 		}
-#line 821
 */
-#line 821
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 821
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 821
 		    IF (err)
-#line 821
 			error("error in toMixedBase");
-#line 821
 		    for (d = 0; d < var_rank[i]; d++)
-#line 821
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 821
 		    value[j] = hash_long(var_type[i], var_rank[i], index2, 
-#line 821
 			NCT_LONG);
-#line 821
 		    allInExtRange = allInExtRange 
-#line 821
 			&& inRange3(value[j], var_type[i], NCT_LONG);
-#line 821
 		}
-#line 821
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 821
 		    err = nc_put_vars_long(ncid, i, NULL, NULL, stride, value);
-#line 821
 		else
-#line 821
 		    err = nc_put_vars_long(ncid, i, index, count, stride, value);
-#line 821
 		if (canConvert) {
-#line 821
 		    if (allInExtRange) {
-#line 821
 			IF (err) 
-#line 821
 			    error("%s", nc_strerror(err));
-#line 821
 		    } else {
-#line 821
 			IF (err != NC_ERANGE)
-#line 821
 			    error("range error: status = %d", err);
-#line 821
 		    }
-#line 821
 		} else {
-#line 821
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 821
 			error("wrong type: status = %d", err);
-#line 821
 		}
-#line 821
 	    }
-#line 821
 	}
-#line 821
     }
-#line 821
 
-#line 821
     err = nc_close(ncid);
-#line 821
     IF (err) 
-#line 821
 	error("nc_close: %s", nc_strerror(err));
-#line 821
 
-#line 821
     check_vars_long(scratch);
-#line 821
 
-#line 821
     err = remove(scratch);
-#line 821
     IF (err)
-#line 821
 	error("remove of %s failed", scratch);
-#line 821
 }
-#line 821
 
 void
-#line 822
 test_nc_put_vars_float(void)
-#line 822
 {
-#line 822
     int ncid;
-#line 822
     int d;
-#line 822
     int i;
-#line 822
     int j;
-#line 822
     int k;
-#line 822
     int m;
-#line 822
     int err;
-#line 822
     int nels;
-#line 822
     int nslabs;
-#line 822
     int nstarts;        /* number of different starts */
-#line 822
     size_t start[MAX_RANK];
-#line 822
     size_t edge[MAX_RANK];
-#line 822
     size_t index[MAX_RANK];
-#line 822
     size_t index2[MAX_RANK];
-#line 822
     size_t mid[MAX_RANK];
-#line 822
     size_t count[MAX_RANK];
-#line 822
     size_t sstride[MAX_RANK];
-#line 822
     ptrdiff_t stride[MAX_RANK];
-#line 822
     int canConvert;	/* Both text or both numeric */
-#line 822
     int allInExtRange;	/* all values within external range? */
-#line 822
     float value[MAX_NELS];
-#line 822
 
-#line 822
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 822
     IF (err) {
-#line 822
 	error("nc_create: %s", nc_strerror(err));
-#line 822
 	return;
-#line 822
     }
-#line 822
     def_dims(ncid);
-#line 822
     def_vars(ncid);
-#line 822
     err = nc_enddef(ncid);
-#line 822
     IF (err)
-#line 822
 	error("nc_enddef: %s", nc_strerror(err));
-#line 822
 
-#line 822
     for (i = 0; i < NVARS; i++) {
-#line 822
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 822
 	assert(var_rank[i] <= MAX_RANK);
-#line 822
 	assert(var_nels[i] <= MAX_NELS);
-#line 822
 	for (j = 0; j < var_rank[i]; j++) {
-#line 822
 	    start[j] = 0;
-#line 822
 	    edge[j] = 1;
-#line 822
 	    stride[j] = 1;
-#line 822
 	}
-#line 822
 	err = nc_put_vars_float(BAD_ID, i, start, edge, stride, value);
-#line 822
 	IF (err != NC_EBADID) 
-#line 822
 	    error("bad ncid: status = %d", err);
-#line 822
 	err = nc_put_vars_float(ncid, BAD_VARID, start, edge, stride, value);
-#line 822
 	IF (err != NC_ENOTVAR) 
-#line 822
 	    error("bad var id: status = %d", err);
-#line 822
 	for (j = 0; j < var_rank[i]; j++) {
-#line 822
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 822
 		start[j] = var_shape[i][j] + 1;
-#line 822
 		err = nc_put_vars_float(ncid, i, start, edge, stride, value);
-#line 822
 	      if(!canConvert) {
-#line 822
 		IF(err != NC_ECHAR)
-#line 822
 			error("conversion: status = %d", err);
-#line 822
 	      } else {
-#line 822
 		IF(err != NC_EINVALCOORDS)
-#line 822
 		    error("bad start: status = %d", err);
-#line 822
 		start[j] = 0;
-#line 822
 		edge[j] = var_shape[i][j] + 1;
-#line 822
 		err = nc_put_vars_float(ncid, i, start, edge, stride, value);
-#line 822
 		IF (err != NC_EEDGE)
-#line 822
 		    error("bad edge: status = %d", err);
-#line 822
 		edge[j] = 1;
-#line 822
 		stride[j] = 0;
-#line 822
 		err = nc_put_vars_float(ncid, i, start, edge, stride, value);
-#line 822
 		IF (err != NC_ESTRIDE)
-#line 822
 		    error("bad stride: status = %d", err);
-#line 822
 		stride[j] = 1;
-#line 822
               }
-#line 822
 	    }
-#line 822
 	}
-#line 822
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 822
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 822
 	nslabs = 1;
-#line 822
 	for (j = 0; j < var_rank[i]; j++) {
-#line 822
 	    mid[j] = roll( var_shape[i][j] );
-#line 822
 	    nslabs *= 2;
-#line 822
 	}
-#line 822
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 822
 	    /* choose random stride from 1 to edge */
-#line 822
 	for (k = 0; k < nslabs; k++) {
-#line 822
 	    nstarts = 1;
-#line 822
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 822
 		if ((k >> j) & 1) {
-#line 822
 		    start[j] = 0;
-#line 822
 		    edge[j] = mid[j];
-#line 822
 		}else{
-#line 822
 		    start[j] = mid[j];
-#line 822
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 822
 		}
-#line 822
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 822
 		nstarts *= stride[j];
-#line 822
 	    }
-#line 822
 	    for (m = 0; m < nstarts; m++) {
-#line 822
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 822
 		IF (err)
-#line 822
 		    error("error in toMixedBase");
-#line 822
 		nels = 1;
-#line 822
 		for (j = 0; j < var_rank[i]; j++) {
-#line 822
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 822
 		    nels *= count[j];
-#line 822
 		    index[j] += start[j];
-#line 822
 		}
-#line 822
 		    /* Random choice of forward or backward */
-#line 822
 /* TODO
-#line 822
 		if ( roll(2) ) {
-#line 822
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 822
 			index[j] += (count[j] - 1) * stride[j];
-#line 822
 			stride[j] = -stride[j];
-#line 822
 		    }
-#line 822
 		}
-#line 822
 */
-#line 822
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 822
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 822
 		    IF (err)
-#line 822
 			error("error in toMixedBase");
-#line 822
 		    for (d = 0; d < var_rank[i]; d++)
-#line 822
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 822
 		    value[j] = hash_float(var_type[i], var_rank[i], index2, 
-#line 822
 			NCT_FLOAT);
-#line 822
 		    allInExtRange = allInExtRange 
-#line 822
 			&& inRange3(value[j], var_type[i], NCT_FLOAT);
-#line 822
 		}
-#line 822
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 822
 		    err = nc_put_vars_float(ncid, i, NULL, NULL, stride, value);
-#line 822
 		else
-#line 822
 		    err = nc_put_vars_float(ncid, i, index, count, stride, value);
-#line 822
 		if (canConvert) {
-#line 822
 		    if (allInExtRange) {
-#line 822
 			IF (err) 
-#line 822
 			    error("%s", nc_strerror(err));
-#line 822
 		    } else {
-#line 822
 			IF (err != NC_ERANGE)
-#line 822
 			    error("range error: status = %d", err);
-#line 822
 		    }
-#line 822
 		} else {
-#line 822
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 822
 			error("wrong type: status = %d", err);
-#line 822
 		}
-#line 822
 	    }
-#line 822
 	}
-#line 822
     }
-#line 822
 
-#line 822
     err = nc_close(ncid);
-#line 822
     IF (err) 
-#line 822
 	error("nc_close: %s", nc_strerror(err));
-#line 822
 
-#line 822
     check_vars_float(scratch);
-#line 822
 
-#line 822
     err = remove(scratch);
-#line 822
     IF (err)
-#line 822
 	error("remove of %s failed", scratch);
-#line 822
 }
-#line 822
 
 void
-#line 823
 test_nc_put_vars_double(void)
-#line 823
 {
-#line 823
     int ncid;
-#line 823
     int d;
-#line 823
     int i;
-#line 823
     int j;
-#line 823
     int k;
-#line 823
     int m;
-#line 823
     int err;
-#line 823
     int nels;
-#line 823
     int nslabs;
-#line 823
     int nstarts;        /* number of different starts */
-#line 823
     size_t start[MAX_RANK];
-#line 823
     size_t edge[MAX_RANK];
-#line 823
     size_t index[MAX_RANK];
-#line 823
     size_t index2[MAX_RANK];
-#line 823
     size_t mid[MAX_RANK];
-#line 823
     size_t count[MAX_RANK];
-#line 823
     size_t sstride[MAX_RANK];
-#line 823
     ptrdiff_t stride[MAX_RANK];
-#line 823
     int canConvert;	/* Both text or both numeric */
-#line 823
     int allInExtRange;	/* all values within external range? */
-#line 823
     double value[MAX_NELS];
-#line 823
 
-#line 823
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 823
     IF (err) {
-#line 823
 	error("nc_create: %s", nc_strerror(err));
-#line 823
 	return;
-#line 823
     }
-#line 823
     def_dims(ncid);
-#line 823
     def_vars(ncid);
-#line 823
     err = nc_enddef(ncid);
-#line 823
     IF (err)
-#line 823
 	error("nc_enddef: %s", nc_strerror(err));
-#line 823
 
-#line 823
     for (i = 0; i < NVARS; i++) {
-#line 823
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 823
 	assert(var_rank[i] <= MAX_RANK);
-#line 823
 	assert(var_nels[i] <= MAX_NELS);
-#line 823
 	for (j = 0; j < var_rank[i]; j++) {
-#line 823
 	    start[j] = 0;
-#line 823
 	    edge[j] = 1;
-#line 823
 	    stride[j] = 1;
-#line 823
 	}
-#line 823
 	err = nc_put_vars_double(BAD_ID, i, start, edge, stride, value);
-#line 823
 	IF (err != NC_EBADID) 
-#line 823
 	    error("bad ncid: status = %d", err);
-#line 823
 	err = nc_put_vars_double(ncid, BAD_VARID, start, edge, stride, value);
-#line 823
 	IF (err != NC_ENOTVAR) 
-#line 823
 	    error("bad var id: status = %d", err);
-#line 823
 	for (j = 0; j < var_rank[i]; j++) {
-#line 823
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 823
 		start[j] = var_shape[i][j] + 1;
-#line 823
 		err = nc_put_vars_double(ncid, i, start, edge, stride, value);
-#line 823
 	      if(!canConvert) {
-#line 823
 		IF(err != NC_ECHAR)
-#line 823
 			error("conversion: status = %d", err);
-#line 823
 	      } else {
-#line 823
 		IF(err != NC_EINVALCOORDS)
-#line 823
 		    error("bad start: status = %d", err);
-#line 823
 		start[j] = 0;
-#line 823
 		edge[j] = var_shape[i][j] + 1;
-#line 823
 		err = nc_put_vars_double(ncid, i, start, edge, stride, value);
-#line 823
 		IF (err != NC_EEDGE)
-#line 823
 		    error("bad edge: status = %d", err);
-#line 823
 		edge[j] = 1;
-#line 823
 		stride[j] = 0;
-#line 823
 		err = nc_put_vars_double(ncid, i, start, edge, stride, value);
-#line 823
 		IF (err != NC_ESTRIDE)
-#line 823
 		    error("bad stride: status = %d", err);
-#line 823
 		stride[j] = 1;
-#line 823
               }
-#line 823
 	    }
-#line 823
 	}
-#line 823
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 823
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 823
 	nslabs = 1;
-#line 823
 	for (j = 0; j < var_rank[i]; j++) {
-#line 823
 	    mid[j] = roll( var_shape[i][j] );
-#line 823
 	    nslabs *= 2;
-#line 823
 	}
-#line 823
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 823
 	    /* choose random stride from 1 to edge */
-#line 823
 	for (k = 0; k < nslabs; k++) {
-#line 823
 	    nstarts = 1;
-#line 823
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 823
 		if ((k >> j) & 1) {
-#line 823
 		    start[j] = 0;
-#line 823
 		    edge[j] = mid[j];
-#line 823
 		}else{
-#line 823
 		    start[j] = mid[j];
-#line 823
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 823
 		}
-#line 823
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 823
 		nstarts *= stride[j];
-#line 823
 	    }
-#line 823
 	    for (m = 0; m < nstarts; m++) {
-#line 823
 		err = toMixedBase(m, var_rank[i], sstride, index);
-#line 823
 		IF (err)
-#line 823
 		    error("error in toMixedBase");
-#line 823
 		nels = 1;
-#line 823
 		for (j = 0; j < var_rank[i]; j++) {
-#line 823
 		    count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 823
 		    nels *= count[j];
-#line 823
 		    index[j] += start[j];
-#line 823
 		}
-#line 823
 		    /* Random choice of forward or backward */
-#line 823
 /* TODO
-#line 823
 		if ( roll(2) ) {
-#line 823
 		    for (j = 0; j < var_rank[i]; j++) {
-#line 823
 			index[j] += (count[j] - 1) * stride[j];
-#line 823
 			stride[j] = -stride[j];
-#line 823
 		    }
-#line 823
 		}
-#line 823
 */
-#line 823
 		for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 823
 		    err = toMixedBase(j, var_rank[i], count, index2);
-#line 823
 		    IF (err)
-#line 823
 			error("error in toMixedBase");
-#line 823
 		    for (d = 0; d < var_rank[i]; d++)
-#line 823
 			index2[d] = index[d] + index2[d] * stride[d];
-#line 823
 		    value[j] = hash_double(var_type[i], var_rank[i], index2, 
-#line 823
 			NCT_DOUBLE);
-#line 823
 		    allInExtRange = allInExtRange 
-#line 823
 			&& inRange3(value[j], var_type[i], NCT_DOUBLE);
-#line 823
 		}
-#line 823
 		if (var_rank[i] == 0 && i%2 == 0)
-#line 823
 		    err = nc_put_vars_double(ncid, i, NULL, NULL, stride, value);
-#line 823
 		else
-#line 823
 		    err = nc_put_vars_double(ncid, i, index, count, stride, value);
-#line 823
 		if (canConvert) {
-#line 823
 		    if (allInExtRange) {
-#line 823
 			IF (err) 
-#line 823
 			    error("%s", nc_strerror(err));
-#line 823
 		    } else {
-#line 823
 			IF (err != NC_ERANGE)
-#line 823
 			    error("range error: status = %d", err);
-#line 823
 		    }
-#line 823
 		} else {
-#line 823
 		    IF (nels > 0 && err != NC_ECHAR)
-#line 823
 			error("wrong type: status = %d", err);
-#line 823
 		}
-#line 823
 	    }
-#line 823
 	}
-#line 823
     }
-#line 823
 
-#line 823
     err = nc_close(ncid);
-#line 823
     IF (err) 
-#line 823
 	error("nc_close: %s", nc_strerror(err));
-#line 823
 
-#line 823
     check_vars_double(scratch);
-#line 823
 
-#line 823
     err = remove(scratch);
-#line 823
     IF (err)
-#line 823
 	error("remove of %s failed", scratch);
-#line 823
 }
-#line 823
 
 
 
-#line 996
 
 void
-#line 997
 test_nc_put_varm_text(void)
-#line 997
 {
-#line 997
     int ncid;
-#line 997
     int d;
-#line 997
     int i;
-#line 997
     int j;
-#line 997
     int k;
-#line 997
     int m;
-#line 997
     int err;
-#line 997
     int nels;
-#line 997
     int nslabs;
-#line 997
     int nstarts;        /* number of different starts */
-#line 997
     size_t start[MAX_RANK];
-#line 997
     size_t edge[MAX_RANK];
-#line 997
     size_t index[MAX_RANK];
-#line 997
     size_t index2[MAX_RANK];
-#line 997
     size_t mid[MAX_RANK];
-#line 997
     size_t count[MAX_RANK];
-#line 997
     size_t sstride[MAX_RANK];
-#line 997
     ptrdiff_t stride[MAX_RANK];
-#line 997
     ptrdiff_t imap[MAX_RANK];
-#line 997
     int canConvert;	/* Both text or both numeric */
-#line 997
     int allInExtRange;	/* all values within external range? */
-#line 997
     text value[MAX_NELS];
-#line 997
 
-#line 997
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 997
     IF (err) {
-#line 997
 	error("nc_create: %s", nc_strerror(err));
-#line 997
 	return;
-#line 997
     }
-#line 997
     def_dims(ncid);
-#line 997
     def_vars(ncid);
-#line 997
     err = nc_enddef(ncid);
-#line 997
     IF (err)
-#line 997
 	error("nc_enddef: %s", nc_strerror(err));
-#line 997
 
-#line 997
     for (i = 0; i < NVARS; i++) {
-#line 997
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_TEXT == NCT_TEXT);
-#line 997
 	assert(var_rank[i] <= MAX_RANK);
-#line 997
 	assert(var_nels[i] <= MAX_NELS);
-#line 997
 	for (j = 0; j < var_rank[i]; j++) {
-#line 997
 	    start[j] = 0;
-#line 997
 	    edge[j] = 1;
-#line 997
 	    stride[j] = 1;
-#line 997
 	    imap[j] = 1;
-#line 997
 	}
-#line 997
 	err = nc_put_varm_text(BAD_ID, i, start, edge, stride, imap, value);
-#line 997
 	IF (err != NC_EBADID) 
-#line 997
 	    error("bad ncid: status = %d", err);
-#line 997
 	err = nc_put_varm_text(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 997
 	IF (err != NC_ENOTVAR) 
-#line 997
 	    error("bad var id: status = %d", err);
-#line 997
 	for (j = 0; j < var_rank[i]; j++) {
-#line 997
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 997
 		start[j] = var_shape[i][j] + 1;
-#line 997
 		err = nc_put_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 997
 	      if (!canConvert) {
-#line 997
 		IF(err != NC_ECHAR)
-#line 997
 			error("conversion: status = %d", err);
-#line 997
 	      } else {
-#line 997
 		IF (err != NC_EINVALCOORDS)
-#line 997
 		    error("bad start: status = %d", err);
-#line 997
 		start[j] = 0;
-#line 997
 		edge[j] = var_shape[i][j] + 1;
-#line 997
 		err = nc_put_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 997
 		IF (err != NC_EEDGE)
-#line 997
 		    error("bad edge: status = %d", err);
-#line 997
 		edge[j] = 1;
-#line 997
 		stride[j] = 0;
-#line 997
 		err = nc_put_varm_text(ncid, i, start, edge, stride, imap, value);
-#line 997
 		IF (err != NC_ESTRIDE)
-#line 997
 		    error("bad stride: status = %d", err);
-#line 997
 		stride[j] = 1;
-#line 997
 	      }
-#line 997
 	    }
-#line 997
 	}
-#line 997
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 997
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 997
 	nslabs = 1;
-#line 997
 	for (j = 0; j < var_rank[i]; j++) {
-#line 997
 	    mid[j] = roll( var_shape[i][j] );
-#line 997
 	    nslabs *= 2;
-#line 997
 	}
-#line 997
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 997
 	    /* choose random stride from 1 to edge */
-#line 997
 	for (k = 0; k < nslabs; k++) {
-#line 997
 	    nstarts = 1;
-#line 997
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 997
 		if ((k >> j) & 1) {
-#line 997
 		    start[j] = 0;
-#line 997
 		    edge[j] = mid[j];
-#line 997
 		}else{
-#line 997
 		    start[j] = mid[j];
-#line 997
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 997
 		}
-#line 997
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 997
 		nstarts *= stride[j];
-#line 997
 	    }
-#line 997
             for (m = 0; m < nstarts; m++) {
-#line 997
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 997
                 IF (err)
-#line 997
                     error("error in toMixedBase");
-#line 997
                 nels = 1;
-#line 997
                 for (j = 0; j < var_rank[i]; j++) {
-#line 997
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 997
                     nels *= count[j];
-#line 997
                     index[j] += start[j];
-#line 997
                 }
-#line 997
                     /* Random choice of forward or backward */
-#line 997
 /* TODO
-#line 997
                 if ( roll(2) ) {
-#line 997
                     for (j = 0; j < var_rank[i]; j++) {
-#line 997
                         index[j] += (count[j] - 1) * stride[j];
-#line 997
                         stride[j] = -stride[j];
-#line 997
                     }
-#line 997
                 }
-#line 997
 */
-#line 997
                 if (var_rank[i] > 0) {
-#line 997
                     j = var_rank[i] - 1;
-#line 997
                     imap[j] = 1;
-#line 997
                     for (; j > 0; j--)
-#line 997
                         imap[j-1] = imap[j] * count[j];
-#line 997
                 }
-#line 997
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 997
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 997
                     IF (err)
-#line 997
                         error("error in toMixedBase");
-#line 997
                     for (d = 0; d < var_rank[i]; d++)
-#line 997
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 997
                     value[j] = hash_text(var_type[i], var_rank[i], index2,
-#line 997
                         NCT_TEXT);
-#line 997
                     allInExtRange = allInExtRange
-#line 997
                         && inRange3(value[j], var_type[i], NCT_TEXT);
-#line 997
                 }
-#line 997
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 997
                     err = nc_put_varm_text(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 997
                 else
-#line 997
                     err = nc_put_varm_text(ncid,i,index,count,stride,imap,value);
-#line 997
                 if (canConvert) {
-#line 997
                     if (allInExtRange) {
-#line 997
                         IF (err)
-#line 997
                             error("%s", nc_strerror(err));
-#line 997
                     } else {
-#line 997
                         IF (err != NC_ERANGE)
-#line 997
                             error("range error: status = %d", err);
-#line 997
                     }
-#line 997
                 } else {
-#line 997
                     IF (nels > 0 && err != NC_ECHAR)
-#line 997
                         error("wrong type: status = %d", err);
-#line 997
 		}
-#line 997
 	    }
-#line 997
 	}
-#line 997
     }
-#line 997
 
-#line 997
     err = nc_close(ncid);
-#line 997
     IF (err) 
-#line 997
 	error("nc_close: %s", nc_strerror(err));
-#line 997
 
-#line 997
     check_vars_text(scratch);
-#line 997
 
-#line 997
     err = remove(scratch);
-#line 997
     IF (err)
-#line 997
         error("remove of %s failed", scratch);
-#line 997
 }
-#line 997
 
 void
-#line 998
 test_nc_put_varm_uchar(void)
-#line 998
 {
-#line 998
     int ncid;
-#line 998
     int d;
-#line 998
     int i;
-#line 998
     int j;
-#line 998
     int k;
-#line 998
     int m;
-#line 998
     int err;
-#line 998
     int nels;
-#line 998
     int nslabs;
-#line 998
     int nstarts;        /* number of different starts */
-#line 998
     size_t start[MAX_RANK];
-#line 998
     size_t edge[MAX_RANK];
-#line 998
     size_t index[MAX_RANK];
-#line 998
     size_t index2[MAX_RANK];
-#line 998
     size_t mid[MAX_RANK];
-#line 998
     size_t count[MAX_RANK];
-#line 998
     size_t sstride[MAX_RANK];
-#line 998
     ptrdiff_t stride[MAX_RANK];
-#line 998
     ptrdiff_t imap[MAX_RANK];
-#line 998
     int canConvert;	/* Both text or both numeric */
-#line 998
     int allInExtRange;	/* all values within external range? */
-#line 998
     uchar value[MAX_NELS];
-#line 998
 
-#line 998
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 998
     IF (err) {
-#line 998
 	error("nc_create: %s", nc_strerror(err));
-#line 998
 	return;
-#line 998
     }
-#line 998
     def_dims(ncid);
-#line 998
     def_vars(ncid);
-#line 998
     err = nc_enddef(ncid);
-#line 998
     IF (err)
-#line 998
 	error("nc_enddef: %s", nc_strerror(err));
-#line 998
 
-#line 998
     for (i = 0; i < NVARS; i++) {
-#line 998
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_UCHAR == NCT_TEXT);
-#line 998
 	assert(var_rank[i] <= MAX_RANK);
-#line 998
 	assert(var_nels[i] <= MAX_NELS);
-#line 998
 	for (j = 0; j < var_rank[i]; j++) {
-#line 998
 	    start[j] = 0;
-#line 998
 	    edge[j] = 1;
-#line 998
 	    stride[j] = 1;
-#line 998
 	    imap[j] = 1;
-#line 998
 	}
-#line 998
 	err = nc_put_varm_uchar(BAD_ID, i, start, edge, stride, imap, value);
-#line 998
 	IF (err != NC_EBADID) 
-#line 998
 	    error("bad ncid: status = %d", err);
-#line 998
 	err = nc_put_varm_uchar(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 998
 	IF (err != NC_ENOTVAR) 
-#line 998
 	    error("bad var id: status = %d", err);
-#line 998
 	for (j = 0; j < var_rank[i]; j++) {
-#line 998
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 998
 		start[j] = var_shape[i][j] + 1;
-#line 998
 		err = nc_put_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 998
 	      if (!canConvert) {
-#line 998
 		IF(err != NC_ECHAR)
-#line 998
 			error("conversion: status = %d", err);
-#line 998
 	      } else {
-#line 998
 		IF (err != NC_EINVALCOORDS)
-#line 998
 		    error("bad start: status = %d", err);
-#line 998
 		start[j] = 0;
-#line 998
 		edge[j] = var_shape[i][j] + 1;
-#line 998
 		err = nc_put_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 998
 		IF (err != NC_EEDGE)
-#line 998
 		    error("bad edge: status = %d", err);
-#line 998
 		edge[j] = 1;
-#line 998
 		stride[j] = 0;
-#line 998
 		err = nc_put_varm_uchar(ncid, i, start, edge, stride, imap, value);
-#line 998
 		IF (err != NC_ESTRIDE)
-#line 998
 		    error("bad stride: status = %d", err);
-#line 998
 		stride[j] = 1;
-#line 998
 	      }
-#line 998
 	    }
-#line 998
 	}
-#line 998
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 998
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 998
 	nslabs = 1;
-#line 998
 	for (j = 0; j < var_rank[i]; j++) {
-#line 998
 	    mid[j] = roll( var_shape[i][j] );
-#line 998
 	    nslabs *= 2;
-#line 998
 	}
-#line 998
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 998
 	    /* choose random stride from 1 to edge */
-#line 998
 	for (k = 0; k < nslabs; k++) {
-#line 998
 	    nstarts = 1;
-#line 998
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 998
 		if ((k >> j) & 1) {
-#line 998
 		    start[j] = 0;
-#line 998
 		    edge[j] = mid[j];
-#line 998
 		}else{
-#line 998
 		    start[j] = mid[j];
-#line 998
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 998
 		}
-#line 998
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 998
 		nstarts *= stride[j];
-#line 998
 	    }
-#line 998
             for (m = 0; m < nstarts; m++) {
-#line 998
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 998
                 IF (err)
-#line 998
                     error("error in toMixedBase");
-#line 998
                 nels = 1;
-#line 998
                 for (j = 0; j < var_rank[i]; j++) {
-#line 998
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 998
                     nels *= count[j];
-#line 998
                     index[j] += start[j];
-#line 998
                 }
-#line 998
                     /* Random choice of forward or backward */
-#line 998
 /* TODO
-#line 998
                 if ( roll(2) ) {
-#line 998
                     for (j = 0; j < var_rank[i]; j++) {
-#line 998
                         index[j] += (count[j] - 1) * stride[j];
-#line 998
                         stride[j] = -stride[j];
-#line 998
                     }
-#line 998
                 }
-#line 998
 */
-#line 998
                 if (var_rank[i] > 0) {
-#line 998
                     j = var_rank[i] - 1;
-#line 998
                     imap[j] = 1;
-#line 998
                     for (; j > 0; j--)
-#line 998
                         imap[j-1] = imap[j] * count[j];
-#line 998
                 }
-#line 998
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 998
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 998
                     IF (err)
-#line 998
                         error("error in toMixedBase");
-#line 998
                     for (d = 0; d < var_rank[i]; d++)
-#line 998
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 998
                     value[j] = hash_uchar(var_type[i], var_rank[i], index2,
-#line 998
                         NCT_UCHAR);
-#line 998
                     allInExtRange = allInExtRange
-#line 998
                         && inRange3(value[j], var_type[i], NCT_UCHAR);
-#line 998
                 }
-#line 998
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 998
                     err = nc_put_varm_uchar(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 998
                 else
-#line 998
                     err = nc_put_varm_uchar(ncid,i,index,count,stride,imap,value);
-#line 998
                 if (canConvert) {
-#line 998
                     if (allInExtRange) {
-#line 998
                         IF (err)
-#line 998
                             error("%s", nc_strerror(err));
-#line 998
                     } else {
-#line 998
                         IF (err != NC_ERANGE)
-#line 998
                             error("range error: status = %d", err);
-#line 998
                     }
-#line 998
                 } else {
-#line 998
                     IF (nels > 0 && err != NC_ECHAR)
-#line 998
                         error("wrong type: status = %d", err);
-#line 998
 		}
-#line 998
 	    }
-#line 998
 	}
-#line 998
     }
-#line 998
 
-#line 998
     err = nc_close(ncid);
-#line 998
     IF (err) 
-#line 998
 	error("nc_close: %s", nc_strerror(err));
-#line 998
 
-#line 998
     check_vars_uchar(scratch);
-#line 998
 
-#line 998
     err = remove(scratch);
-#line 998
     IF (err)
-#line 998
         error("remove of %s failed", scratch);
-#line 998
 }
-#line 998
 
 void
-#line 999
 test_nc_put_varm_schar(void)
-#line 999
 {
-#line 999
     int ncid;
-#line 999
     int d;
-#line 999
     int i;
-#line 999
     int j;
-#line 999
     int k;
-#line 999
     int m;
-#line 999
     int err;
-#line 999
     int nels;
-#line 999
     int nslabs;
-#line 999
     int nstarts;        /* number of different starts */
-#line 999
     size_t start[MAX_RANK];
-#line 999
     size_t edge[MAX_RANK];
-#line 999
     size_t index[MAX_RANK];
-#line 999
     size_t index2[MAX_RANK];
-#line 999
     size_t mid[MAX_RANK];
-#line 999
     size_t count[MAX_RANK];
-#line 999
     size_t sstride[MAX_RANK];
-#line 999
     ptrdiff_t stride[MAX_RANK];
-#line 999
     ptrdiff_t imap[MAX_RANK];
-#line 999
     int canConvert;	/* Both text or both numeric */
-#line 999
     int allInExtRange;	/* all values within external range? */
-#line 999
     schar value[MAX_NELS];
-#line 999
 
-#line 999
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 999
     IF (err) {
-#line 999
 	error("nc_create: %s", nc_strerror(err));
-#line 999
 	return;
-#line 999
     }
-#line 999
     def_dims(ncid);
-#line 999
     def_vars(ncid);
-#line 999
     err = nc_enddef(ncid);
-#line 999
     IF (err)
-#line 999
 	error("nc_enddef: %s", nc_strerror(err));
-#line 999
 
-#line 999
     for (i = 0; i < NVARS; i++) {
-#line 999
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SCHAR == NCT_TEXT);
-#line 999
 	assert(var_rank[i] <= MAX_RANK);
-#line 999
 	assert(var_nels[i] <= MAX_NELS);
-#line 999
 	for (j = 0; j < var_rank[i]; j++) {
-#line 999
 	    start[j] = 0;
-#line 999
 	    edge[j] = 1;
-#line 999
 	    stride[j] = 1;
-#line 999
 	    imap[j] = 1;
-#line 999
 	}
-#line 999
 	err = nc_put_varm_schar(BAD_ID, i, start, edge, stride, imap, value);
-#line 999
 	IF (err != NC_EBADID) 
-#line 999
 	    error("bad ncid: status = %d", err);
-#line 999
 	err = nc_put_varm_schar(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 999
 	IF (err != NC_ENOTVAR) 
-#line 999
 	    error("bad var id: status = %d", err);
-#line 999
 	for (j = 0; j < var_rank[i]; j++) {
-#line 999
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 999
 		start[j] = var_shape[i][j] + 1;
-#line 999
 		err = nc_put_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 999
 	      if (!canConvert) {
-#line 999
 		IF(err != NC_ECHAR)
-#line 999
 			error("conversion: status = %d", err);
-#line 999
 	      } else {
-#line 999
 		IF (err != NC_EINVALCOORDS)
-#line 999
 		    error("bad start: status = %d", err);
-#line 999
 		start[j] = 0;
-#line 999
 		edge[j] = var_shape[i][j] + 1;
-#line 999
 		err = nc_put_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 999
 		IF (err != NC_EEDGE)
-#line 999
 		    error("bad edge: status = %d", err);
-#line 999
 		edge[j] = 1;
-#line 999
 		stride[j] = 0;
-#line 999
 		err = nc_put_varm_schar(ncid, i, start, edge, stride, imap, value);
-#line 999
 		IF (err != NC_ESTRIDE)
-#line 999
 		    error("bad stride: status = %d", err);
-#line 999
 		stride[j] = 1;
-#line 999
 	      }
-#line 999
 	    }
-#line 999
 	}
-#line 999
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 999
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 999
 	nslabs = 1;
-#line 999
 	for (j = 0; j < var_rank[i]; j++) {
-#line 999
 	    mid[j] = roll( var_shape[i][j] );
-#line 999
 	    nslabs *= 2;
-#line 999
 	}
-#line 999
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 999
 	    /* choose random stride from 1 to edge */
-#line 999
 	for (k = 0; k < nslabs; k++) {
-#line 999
 	    nstarts = 1;
-#line 999
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 999
 		if ((k >> j) & 1) {
-#line 999
 		    start[j] = 0;
-#line 999
 		    edge[j] = mid[j];
-#line 999
 		}else{
-#line 999
 		    start[j] = mid[j];
-#line 999
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 999
 		}
-#line 999
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 999
 		nstarts *= stride[j];
-#line 999
 	    }
-#line 999
             for (m = 0; m < nstarts; m++) {
-#line 999
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 999
                 IF (err)
-#line 999
                     error("error in toMixedBase");
-#line 999
                 nels = 1;
-#line 999
                 for (j = 0; j < var_rank[i]; j++) {
-#line 999
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 999
                     nels *= count[j];
-#line 999
                     index[j] += start[j];
-#line 999
                 }
-#line 999
                     /* Random choice of forward or backward */
-#line 999
 /* TODO
-#line 999
                 if ( roll(2) ) {
-#line 999
                     for (j = 0; j < var_rank[i]; j++) {
-#line 999
                         index[j] += (count[j] - 1) * stride[j];
-#line 999
                         stride[j] = -stride[j];
-#line 999
                     }
-#line 999
                 }
-#line 999
 */
-#line 999
                 if (var_rank[i] > 0) {
-#line 999
                     j = var_rank[i] - 1;
-#line 999
                     imap[j] = 1;
-#line 999
                     for (; j > 0; j--)
-#line 999
                         imap[j-1] = imap[j] * count[j];
-#line 999
                 }
-#line 999
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 999
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 999
                     IF (err)
-#line 999
                         error("error in toMixedBase");
-#line 999
                     for (d = 0; d < var_rank[i]; d++)
-#line 999
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 999
                     value[j] = hash_schar(var_type[i], var_rank[i], index2,
-#line 999
                         NCT_SCHAR);
-#line 999
                     allInExtRange = allInExtRange
-#line 999
                         && inRange3(value[j], var_type[i], NCT_SCHAR);
-#line 999
                 }
-#line 999
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 999
                     err = nc_put_varm_schar(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 999
                 else
-#line 999
                     err = nc_put_varm_schar(ncid,i,index,count,stride,imap,value);
-#line 999
                 if (canConvert) {
-#line 999
                     if (allInExtRange) {
-#line 999
                         IF (err)
-#line 999
                             error("%s", nc_strerror(err));
-#line 999
                     } else {
-#line 999
                         IF (err != NC_ERANGE)
-#line 999
                             error("range error: status = %d", err);
-#line 999
                     }
-#line 999
                 } else {
-#line 999
                     IF (nels > 0 && err != NC_ECHAR)
-#line 999
                         error("wrong type: status = %d", err);
-#line 999
 		}
-#line 999
 	    }
-#line 999
 	}
-#line 999
     }
-#line 999
 
-#line 999
     err = nc_close(ncid);
-#line 999
     IF (err) 
-#line 999
 	error("nc_close: %s", nc_strerror(err));
-#line 999
 
-#line 999
     check_vars_schar(scratch);
-#line 999
 
-#line 999
     err = remove(scratch);
-#line 999
     IF (err)
-#line 999
         error("remove of %s failed", scratch);
-#line 999
 }
-#line 999
 
 void
-#line 1000
 test_nc_put_varm_short(void)
-#line 1000
 {
-#line 1000
     int ncid;
-#line 1000
     int d;
-#line 1000
     int i;
-#line 1000
     int j;
-#line 1000
     int k;
-#line 1000
     int m;
-#line 1000
     int err;
-#line 1000
     int nels;
-#line 1000
     int nslabs;
-#line 1000
     int nstarts;        /* number of different starts */
-#line 1000
     size_t start[MAX_RANK];
-#line 1000
     size_t edge[MAX_RANK];
-#line 1000
     size_t index[MAX_RANK];
-#line 1000
     size_t index2[MAX_RANK];
-#line 1000
     size_t mid[MAX_RANK];
-#line 1000
     size_t count[MAX_RANK];
-#line 1000
     size_t sstride[MAX_RANK];
-#line 1000
     ptrdiff_t stride[MAX_RANK];
-#line 1000
     ptrdiff_t imap[MAX_RANK];
-#line 1000
     int canConvert;	/* Both text or both numeric */
-#line 1000
     int allInExtRange;	/* all values within external range? */
-#line 1000
     short value[MAX_NELS];
-#line 1000
 
-#line 1000
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 1000
     IF (err) {
-#line 1000
 	error("nc_create: %s", nc_strerror(err));
-#line 1000
 	return;
-#line 1000
     }
-#line 1000
     def_dims(ncid);
-#line 1000
     def_vars(ncid);
-#line 1000
     err = nc_enddef(ncid);
-#line 1000
     IF (err)
-#line 1000
 	error("nc_enddef: %s", nc_strerror(err));
-#line 1000
 
-#line 1000
     for (i = 0; i < NVARS; i++) {
-#line 1000
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_SHORT == NCT_TEXT);
-#line 1000
 	assert(var_rank[i] <= MAX_RANK);
-#line 1000
 	assert(var_nels[i] <= MAX_NELS);
-#line 1000
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1000
 	    start[j] = 0;
-#line 1000
 	    edge[j] = 1;
-#line 1000
 	    stride[j] = 1;
-#line 1000
 	    imap[j] = 1;
-#line 1000
 	}
-#line 1000
 	err = nc_put_varm_short(BAD_ID, i, start, edge, stride, imap, value);
-#line 1000
 	IF (err != NC_EBADID) 
-#line 1000
 	    error("bad ncid: status = %d", err);
-#line 1000
 	err = nc_put_varm_short(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 1000
 	IF (err != NC_ENOTVAR) 
-#line 1000
 	    error("bad var id: status = %d", err);
-#line 1000
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1000
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 1000
 		start[j] = var_shape[i][j] + 1;
-#line 1000
 		err = nc_put_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 1000
 	      if (!canConvert) {
-#line 1000
 		IF(err != NC_ECHAR)
-#line 1000
 			error("conversion: status = %d", err);
-#line 1000
 	      } else {
-#line 1000
 		IF (err != NC_EINVALCOORDS)
-#line 1000
 		    error("bad start: status = %d", err);
-#line 1000
 		start[j] = 0;
-#line 1000
 		edge[j] = var_shape[i][j] + 1;
-#line 1000
 		err = nc_put_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 1000
 		IF (err != NC_EEDGE)
-#line 1000
 		    error("bad edge: status = %d", err);
-#line 1000
 		edge[j] = 1;
-#line 1000
 		stride[j] = 0;
-#line 1000
 		err = nc_put_varm_short(ncid, i, start, edge, stride, imap, value);
-#line 1000
 		IF (err != NC_ESTRIDE)
-#line 1000
 		    error("bad stride: status = %d", err);
-#line 1000
 		stride[j] = 1;
-#line 1000
 	      }
-#line 1000
 	    }
-#line 1000
 	}
-#line 1000
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 1000
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 1000
 	nslabs = 1;
-#line 1000
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1000
 	    mid[j] = roll( var_shape[i][j] );
-#line 1000
 	    nslabs *= 2;
-#line 1000
 	}
-#line 1000
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 1000
 	    /* choose random stride from 1 to edge */
-#line 1000
 	for (k = 0; k < nslabs; k++) {
-#line 1000
 	    nstarts = 1;
-#line 1000
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 1000
 		if ((k >> j) & 1) {
-#line 1000
 		    start[j] = 0;
-#line 1000
 		    edge[j] = mid[j];
-#line 1000
 		}else{
-#line 1000
 		    start[j] = mid[j];
-#line 1000
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 1000
 		}
-#line 1000
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 1000
 		nstarts *= stride[j];
-#line 1000
 	    }
-#line 1000
             for (m = 0; m < nstarts; m++) {
-#line 1000
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 1000
                 IF (err)
-#line 1000
                     error("error in toMixedBase");
-#line 1000
                 nels = 1;
-#line 1000
                 for (j = 0; j < var_rank[i]; j++) {
-#line 1000
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 1000
                     nels *= count[j];
-#line 1000
                     index[j] += start[j];
-#line 1000
                 }
-#line 1000
                     /* Random choice of forward or backward */
-#line 1000
 /* TODO
-#line 1000
                 if ( roll(2) ) {
-#line 1000
                     for (j = 0; j < var_rank[i]; j++) {
-#line 1000
                         index[j] += (count[j] - 1) * stride[j];
-#line 1000
                         stride[j] = -stride[j];
-#line 1000
                     }
-#line 1000
                 }
-#line 1000
 */
-#line 1000
                 if (var_rank[i] > 0) {
-#line 1000
                     j = var_rank[i] - 1;
-#line 1000
                     imap[j] = 1;
-#line 1000
                     for (; j > 0; j--)
-#line 1000
                         imap[j-1] = imap[j] * count[j];
-#line 1000
                 }
-#line 1000
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 1000
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 1000
                     IF (err)
-#line 1000
                         error("error in toMixedBase");
-#line 1000
                     for (d = 0; d < var_rank[i]; d++)
-#line 1000
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 1000
                     value[j] = hash_short(var_type[i], var_rank[i], index2,
-#line 1000
                         NCT_SHORT);
-#line 1000
                     allInExtRange = allInExtRange
-#line 1000
                         && inRange3(value[j], var_type[i], NCT_SHORT);
-#line 1000
                 }
-#line 1000
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 1000
                     err = nc_put_varm_short(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 1000
                 else
-#line 1000
                     err = nc_put_varm_short(ncid,i,index,count,stride,imap,value);
-#line 1000
                 if (canConvert) {
-#line 1000
                     if (allInExtRange) {
-#line 1000
                         IF (err)
-#line 1000
                             error("%s", nc_strerror(err));
-#line 1000
                     } else {
-#line 1000
                         IF (err != NC_ERANGE)
-#line 1000
                             error("range error: status = %d", err);
-#line 1000
                     }
-#line 1000
                 } else {
-#line 1000
                     IF (nels > 0 && err != NC_ECHAR)
-#line 1000
                         error("wrong type: status = %d", err);
-#line 1000
 		}
-#line 1000
 	    }
-#line 1000
 	}
-#line 1000
     }
-#line 1000
 
-#line 1000
     err = nc_close(ncid);
-#line 1000
     IF (err) 
-#line 1000
 	error("nc_close: %s", nc_strerror(err));
-#line 1000
 
-#line 1000
     check_vars_short(scratch);
-#line 1000
 
-#line 1000
     err = remove(scratch);
-#line 1000
     IF (err)
-#line 1000
         error("remove of %s failed", scratch);
-#line 1000
 }
-#line 1000
 
 void
-#line 1001
 test_nc_put_varm_int(void)
-#line 1001
 {
-#line 1001
     int ncid;
-#line 1001
     int d;
-#line 1001
     int i;
-#line 1001
     int j;
-#line 1001
     int k;
-#line 1001
     int m;
-#line 1001
     int err;
-#line 1001
     int nels;
-#line 1001
     int nslabs;
-#line 1001
     int nstarts;        /* number of different starts */
-#line 1001
     size_t start[MAX_RANK];
-#line 1001
     size_t edge[MAX_RANK];
-#line 1001
     size_t index[MAX_RANK];
-#line 1001
     size_t index2[MAX_RANK];
-#line 1001
     size_t mid[MAX_RANK];
-#line 1001
     size_t count[MAX_RANK];
-#line 1001
     size_t sstride[MAX_RANK];
-#line 1001
     ptrdiff_t stride[MAX_RANK];
-#line 1001
     ptrdiff_t imap[MAX_RANK];
-#line 1001
     int canConvert;	/* Both text or both numeric */
-#line 1001
     int allInExtRange;	/* all values within external range? */
-#line 1001
     int value[MAX_NELS];
-#line 1001
 
-#line 1001
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 1001
     IF (err) {
-#line 1001
 	error("nc_create: %s", nc_strerror(err));
-#line 1001
 	return;
-#line 1001
     }
-#line 1001
     def_dims(ncid);
-#line 1001
     def_vars(ncid);
-#line 1001
     err = nc_enddef(ncid);
-#line 1001
     IF (err)
-#line 1001
 	error("nc_enddef: %s", nc_strerror(err));
-#line 1001
 
-#line 1001
     for (i = 0; i < NVARS; i++) {
-#line 1001
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_INT == NCT_TEXT);
-#line 1001
 	assert(var_rank[i] <= MAX_RANK);
-#line 1001
 	assert(var_nels[i] <= MAX_NELS);
-#line 1001
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1001
 	    start[j] = 0;
-#line 1001
 	    edge[j] = 1;
-#line 1001
 	    stride[j] = 1;
-#line 1001
 	    imap[j] = 1;
-#line 1001
 	}
-#line 1001
 	err = nc_put_varm_int(BAD_ID, i, start, edge, stride, imap, value);
-#line 1001
 	IF (err != NC_EBADID) 
-#line 1001
 	    error("bad ncid: status = %d", err);
-#line 1001
 	err = nc_put_varm_int(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 1001
 	IF (err != NC_ENOTVAR) 
-#line 1001
 	    error("bad var id: status = %d", err);
-#line 1001
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1001
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 1001
 		start[j] = var_shape[i][j] + 1;
-#line 1001
 		err = nc_put_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 1001
 	      if (!canConvert) {
-#line 1001
 		IF(err != NC_ECHAR)
-#line 1001
 			error("conversion: status = %d", err);
-#line 1001
 	      } else {
-#line 1001
 		IF (err != NC_EINVALCOORDS)
-#line 1001
 		    error("bad start: status = %d", err);
-#line 1001
 		start[j] = 0;
-#line 1001
 		edge[j] = var_shape[i][j] + 1;
-#line 1001
 		err = nc_put_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 1001
 		IF (err != NC_EEDGE)
-#line 1001
 		    error("bad edge: status = %d", err);
-#line 1001
 		edge[j] = 1;
-#line 1001
 		stride[j] = 0;
-#line 1001
 		err = nc_put_varm_int(ncid, i, start, edge, stride, imap, value);
-#line 1001
 		IF (err != NC_ESTRIDE)
-#line 1001
 		    error("bad stride: status = %d", err);
-#line 1001
 		stride[j] = 1;
-#line 1001
 	      }
-#line 1001
 	    }
-#line 1001
 	}
-#line 1001
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 1001
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 1001
 	nslabs = 1;
-#line 1001
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1001
 	    mid[j] = roll( var_shape[i][j] );
-#line 1001
 	    nslabs *= 2;
-#line 1001
 	}
-#line 1001
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 1001
 	    /* choose random stride from 1 to edge */
-#line 1001
 	for (k = 0; k < nslabs; k++) {
-#line 1001
 	    nstarts = 1;
-#line 1001
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 1001
 		if ((k >> j) & 1) {
-#line 1001
 		    start[j] = 0;
-#line 1001
 		    edge[j] = mid[j];
-#line 1001
 		}else{
-#line 1001
 		    start[j] = mid[j];
-#line 1001
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 1001
 		}
-#line 1001
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 1001
 		nstarts *= stride[j];
-#line 1001
 	    }
-#line 1001
             for (m = 0; m < nstarts; m++) {
-#line 1001
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 1001
                 IF (err)
-#line 1001
                     error("error in toMixedBase");
-#line 1001
                 nels = 1;
-#line 1001
                 for (j = 0; j < var_rank[i]; j++) {
-#line 1001
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 1001
                     nels *= count[j];
-#line 1001
                     index[j] += start[j];
-#line 1001
                 }
-#line 1001
                     /* Random choice of forward or backward */
-#line 1001
 /* TODO
-#line 1001
                 if ( roll(2) ) {
-#line 1001
                     for (j = 0; j < var_rank[i]; j++) {
-#line 1001
                         index[j] += (count[j] - 1) * stride[j];
-#line 1001
                         stride[j] = -stride[j];
-#line 1001
                     }
-#line 1001
                 }
-#line 1001
 */
-#line 1001
                 if (var_rank[i] > 0) {
-#line 1001
                     j = var_rank[i] - 1;
-#line 1001
                     imap[j] = 1;
-#line 1001
                     for (; j > 0; j--)
-#line 1001
                         imap[j-1] = imap[j] * count[j];
-#line 1001
                 }
-#line 1001
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 1001
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 1001
                     IF (err)
-#line 1001
                         error("error in toMixedBase");
-#line 1001
                     for (d = 0; d < var_rank[i]; d++)
-#line 1001
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 1001
                     value[j] = hash_int(var_type[i], var_rank[i], index2,
-#line 1001
                         NCT_INT);
-#line 1001
                     allInExtRange = allInExtRange
-#line 1001
                         && inRange3(value[j], var_type[i], NCT_INT);
-#line 1001
                 }
-#line 1001
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 1001
                     err = nc_put_varm_int(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 1001
                 else
-#line 1001
                     err = nc_put_varm_int(ncid,i,index,count,stride,imap,value);
-#line 1001
                 if (canConvert) {
-#line 1001
                     if (allInExtRange) {
-#line 1001
                         IF (err)
-#line 1001
                             error("%s", nc_strerror(err));
-#line 1001
                     } else {
-#line 1001
                         IF (err != NC_ERANGE)
-#line 1001
                             error("range error: status = %d", err);
-#line 1001
                     }
-#line 1001
                 } else {
-#line 1001
                     IF (nels > 0 && err != NC_ECHAR)
-#line 1001
                         error("wrong type: status = %d", err);
-#line 1001
 		}
-#line 1001
 	    }
-#line 1001
 	}
-#line 1001
     }
-#line 1001
 
-#line 1001
     err = nc_close(ncid);
-#line 1001
     IF (err) 
-#line 1001
 	error("nc_close: %s", nc_strerror(err));
-#line 1001
 
-#line 1001
     check_vars_int(scratch);
-#line 1001
 
-#line 1001
     err = remove(scratch);
-#line 1001
     IF (err)
-#line 1001
         error("remove of %s failed", scratch);
-#line 1001
 }
-#line 1001
 
 void
-#line 1002
 test_nc_put_varm_long(void)
-#line 1002
 {
-#line 1002
     int ncid;
-#line 1002
     int d;
-#line 1002
     int i;
-#line 1002
     int j;
-#line 1002
     int k;
-#line 1002
     int m;
-#line 1002
     int err;
-#line 1002
     int nels;
-#line 1002
     int nslabs;
-#line 1002
     int nstarts;        /* number of different starts */
-#line 1002
     size_t start[MAX_RANK];
-#line 1002
     size_t edge[MAX_RANK];
-#line 1002
     size_t index[MAX_RANK];
-#line 1002
     size_t index2[MAX_RANK];
-#line 1002
     size_t mid[MAX_RANK];
-#line 1002
     size_t count[MAX_RANK];
-#line 1002
     size_t sstride[MAX_RANK];
-#line 1002
     ptrdiff_t stride[MAX_RANK];
-#line 1002
     ptrdiff_t imap[MAX_RANK];
-#line 1002
     int canConvert;	/* Both text or both numeric */
-#line 1002
     int allInExtRange;	/* all values within external range? */
-#line 1002
     long value[MAX_NELS];
-#line 1002
 
-#line 1002
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 1002
     IF (err) {
-#line 1002
 	error("nc_create: %s", nc_strerror(err));
-#line 1002
 	return;
-#line 1002
     }
-#line 1002
     def_dims(ncid);
-#line 1002
     def_vars(ncid);
-#line 1002
     err = nc_enddef(ncid);
-#line 1002
     IF (err)
-#line 1002
 	error("nc_enddef: %s", nc_strerror(err));
-#line 1002
 
-#line 1002
     for (i = 0; i < NVARS; i++) {
-#line 1002
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_LONG == NCT_TEXT);
-#line 1002
 	assert(var_rank[i] <= MAX_RANK);
-#line 1002
 	assert(var_nels[i] <= MAX_NELS);
-#line 1002
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1002
 	    start[j] = 0;
-#line 1002
 	    edge[j] = 1;
-#line 1002
 	    stride[j] = 1;
-#line 1002
 	    imap[j] = 1;
-#line 1002
 	}
-#line 1002
 	err = nc_put_varm_long(BAD_ID, i, start, edge, stride, imap, value);
-#line 1002
 	IF (err != NC_EBADID) 
-#line 1002
 	    error("bad ncid: status = %d", err);
-#line 1002
 	err = nc_put_varm_long(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 1002
 	IF (err != NC_ENOTVAR) 
-#line 1002
 	    error("bad var id: status = %d", err);
-#line 1002
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1002
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 1002
 		start[j] = var_shape[i][j] + 1;
-#line 1002
 		err = nc_put_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 1002
 	      if (!canConvert) {
-#line 1002
 		IF(err != NC_ECHAR)
-#line 1002
 			error("conversion: status = %d", err);
-#line 1002
 	      } else {
-#line 1002
 		IF (err != NC_EINVALCOORDS)
-#line 1002
 		    error("bad start: status = %d", err);
-#line 1002
 		start[j] = 0;
-#line 1002
 		edge[j] = var_shape[i][j] + 1;
-#line 1002
 		err = nc_put_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 1002
 		IF (err != NC_EEDGE)
-#line 1002
 		    error("bad edge: status = %d", err);
-#line 1002
 		edge[j] = 1;
-#line 1002
 		stride[j] = 0;
-#line 1002
 		err = nc_put_varm_long(ncid, i, start, edge, stride, imap, value);
-#line 1002
 		IF (err != NC_ESTRIDE)
-#line 1002
 		    error("bad stride: status = %d", err);
-#line 1002
 		stride[j] = 1;
-#line 1002
 	      }
-#line 1002
 	    }
-#line 1002
 	}
-#line 1002
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 1002
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 1002
 	nslabs = 1;
-#line 1002
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1002
 	    mid[j] = roll( var_shape[i][j] );
-#line 1002
 	    nslabs *= 2;
-#line 1002
 	}
-#line 1002
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 1002
 	    /* choose random stride from 1 to edge */
-#line 1002
 	for (k = 0; k < nslabs; k++) {
-#line 1002
 	    nstarts = 1;
-#line 1002
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 1002
 		if ((k >> j) & 1) {
-#line 1002
 		    start[j] = 0;
-#line 1002
 		    edge[j] = mid[j];
-#line 1002
 		}else{
-#line 1002
 		    start[j] = mid[j];
-#line 1002
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 1002
 		}
-#line 1002
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 1002
 		nstarts *= stride[j];
-#line 1002
 	    }
-#line 1002
             for (m = 0; m < nstarts; m++) {
-#line 1002
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 1002
                 IF (err)
-#line 1002
                     error("error in toMixedBase");
-#line 1002
                 nels = 1;
-#line 1002
                 for (j = 0; j < var_rank[i]; j++) {
-#line 1002
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 1002
                     nels *= count[j];
-#line 1002
                     index[j] += start[j];
-#line 1002
                 }
-#line 1002
                     /* Random choice of forward or backward */
-#line 1002
 /* TODO
-#line 1002
                 if ( roll(2) ) {
-#line 1002
                     for (j = 0; j < var_rank[i]; j++) {
-#line 1002
                         index[j] += (count[j] - 1) * stride[j];
-#line 1002
                         stride[j] = -stride[j];
-#line 1002
                     }
-#line 1002
                 }
-#line 1002
 */
-#line 1002
                 if (var_rank[i] > 0) {
-#line 1002
                     j = var_rank[i] - 1;
-#line 1002
                     imap[j] = 1;
-#line 1002
                     for (; j > 0; j--)
-#line 1002
                         imap[j-1] = imap[j] * count[j];
-#line 1002
                 }
-#line 1002
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 1002
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 1002
                     IF (err)
-#line 1002
                         error("error in toMixedBase");
-#line 1002
                     for (d = 0; d < var_rank[i]; d++)
-#line 1002
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 1002
                     value[j] = hash_long(var_type[i], var_rank[i], index2,
-#line 1002
                         NCT_LONG);
-#line 1002
                     allInExtRange = allInExtRange
-#line 1002
                         && inRange3(value[j], var_type[i], NCT_LONG);
-#line 1002
                 }
-#line 1002
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 1002
                     err = nc_put_varm_long(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 1002
                 else
-#line 1002
                     err = nc_put_varm_long(ncid,i,index,count,stride,imap,value);
-#line 1002
                 if (canConvert) {
-#line 1002
                     if (allInExtRange) {
-#line 1002
                         IF (err)
-#line 1002
                             error("%s", nc_strerror(err));
-#line 1002
                     } else {
-#line 1002
                         IF (err != NC_ERANGE)
-#line 1002
                             error("range error: status = %d", err);
-#line 1002
                     }
-#line 1002
                 } else {
-#line 1002
                     IF (nels > 0 && err != NC_ECHAR)
-#line 1002
                         error("wrong type: status = %d", err);
-#line 1002
 		}
-#line 1002
 	    }
-#line 1002
 	}
-#line 1002
     }
-#line 1002
 
-#line 1002
     err = nc_close(ncid);
-#line 1002
     IF (err) 
-#line 1002
 	error("nc_close: %s", nc_strerror(err));
-#line 1002
 
-#line 1002
     check_vars_long(scratch);
-#line 1002
 
-#line 1002
     err = remove(scratch);
-#line 1002
     IF (err)
-#line 1002
         error("remove of %s failed", scratch);
-#line 1002
 }
-#line 1002
 
 void
-#line 1003
 test_nc_put_varm_float(void)
-#line 1003
 {
-#line 1003
     int ncid;
-#line 1003
     int d;
-#line 1003
     int i;
-#line 1003
     int j;
-#line 1003
     int k;
-#line 1003
     int m;
-#line 1003
     int err;
-#line 1003
     int nels;
-#line 1003
     int nslabs;
-#line 1003
     int nstarts;        /* number of different starts */
-#line 1003
     size_t start[MAX_RANK];
-#line 1003
     size_t edge[MAX_RANK];
-#line 1003
     size_t index[MAX_RANK];
-#line 1003
     size_t index2[MAX_RANK];
-#line 1003
     size_t mid[MAX_RANK];
-#line 1003
     size_t count[MAX_RANK];
-#line 1003
     size_t sstride[MAX_RANK];
-#line 1003
     ptrdiff_t stride[MAX_RANK];
-#line 1003
     ptrdiff_t imap[MAX_RANK];
-#line 1003
     int canConvert;	/* Both text or both numeric */
-#line 1003
     int allInExtRange;	/* all values within external range? */
-#line 1003
     float value[MAX_NELS];
-#line 1003
 
-#line 1003
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 1003
     IF (err) {
-#line 1003
 	error("nc_create: %s", nc_strerror(err));
-#line 1003
 	return;
-#line 1003
     }
-#line 1003
     def_dims(ncid);
-#line 1003
     def_vars(ncid);
-#line 1003
     err = nc_enddef(ncid);
-#line 1003
     IF (err)
-#line 1003
 	error("nc_enddef: %s", nc_strerror(err));
-#line 1003
 
-#line 1003
     for (i = 0; i < NVARS; i++) {
-#line 1003
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_FLOAT == NCT_TEXT);
-#line 1003
 	assert(var_rank[i] <= MAX_RANK);
-#line 1003
 	assert(var_nels[i] <= MAX_NELS);
-#line 1003
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1003
 	    start[j] = 0;
-#line 1003
 	    edge[j] = 1;
-#line 1003
 	    stride[j] = 1;
-#line 1003
 	    imap[j] = 1;
-#line 1003
 	}
-#line 1003
 	err = nc_put_varm_float(BAD_ID, i, start, edge, stride, imap, value);
-#line 1003
 	IF (err != NC_EBADID) 
-#line 1003
 	    error("bad ncid: status = %d", err);
-#line 1003
 	err = nc_put_varm_float(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 1003
 	IF (err != NC_ENOTVAR) 
-#line 1003
 	    error("bad var id: status = %d", err);
-#line 1003
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1003
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 1003
 		start[j] = var_shape[i][j] + 1;
-#line 1003
 		err = nc_put_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 1003
 	      if (!canConvert) {
-#line 1003
 		IF(err != NC_ECHAR)
-#line 1003
 			error("conversion: status = %d", err);
-#line 1003
 	      } else {
-#line 1003
 		IF (err != NC_EINVALCOORDS)
-#line 1003
 		    error("bad start: status = %d", err);
-#line 1003
 		start[j] = 0;
-#line 1003
 		edge[j] = var_shape[i][j] + 1;
-#line 1003
 		err = nc_put_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 1003
 		IF (err != NC_EEDGE)
-#line 1003
 		    error("bad edge: status = %d", err);
-#line 1003
 		edge[j] = 1;
-#line 1003
 		stride[j] = 0;
-#line 1003
 		err = nc_put_varm_float(ncid, i, start, edge, stride, imap, value);
-#line 1003
 		IF (err != NC_ESTRIDE)
-#line 1003
 		    error("bad stride: status = %d", err);
-#line 1003
 		stride[j] = 1;
-#line 1003
 	      }
-#line 1003
 	    }
-#line 1003
 	}
-#line 1003
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 1003
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 1003
 	nslabs = 1;
-#line 1003
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1003
 	    mid[j] = roll( var_shape[i][j] );
-#line 1003
 	    nslabs *= 2;
-#line 1003
 	}
-#line 1003
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 1003
 	    /* choose random stride from 1 to edge */
-#line 1003
 	for (k = 0; k < nslabs; k++) {
-#line 1003
 	    nstarts = 1;
-#line 1003
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 1003
 		if ((k >> j) & 1) {
-#line 1003
 		    start[j] = 0;
-#line 1003
 		    edge[j] = mid[j];
-#line 1003
 		}else{
-#line 1003
 		    start[j] = mid[j];
-#line 1003
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 1003
 		}
-#line 1003
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 1003
 		nstarts *= stride[j];
-#line 1003
 	    }
-#line 1003
             for (m = 0; m < nstarts; m++) {
-#line 1003
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 1003
                 IF (err)
-#line 1003
                     error("error in toMixedBase");
-#line 1003
                 nels = 1;
-#line 1003
                 for (j = 0; j < var_rank[i]; j++) {
-#line 1003
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 1003
                     nels *= count[j];
-#line 1003
                     index[j] += start[j];
-#line 1003
                 }
-#line 1003
                     /* Random choice of forward or backward */
-#line 1003
 /* TODO
-#line 1003
                 if ( roll(2) ) {
-#line 1003
                     for (j = 0; j < var_rank[i]; j++) {
-#line 1003
                         index[j] += (count[j] - 1) * stride[j];
-#line 1003
                         stride[j] = -stride[j];
-#line 1003
                     }
-#line 1003
                 }
-#line 1003
 */
-#line 1003
                 if (var_rank[i] > 0) {
-#line 1003
                     j = var_rank[i] - 1;
-#line 1003
                     imap[j] = 1;
-#line 1003
                     for (; j > 0; j--)
-#line 1003
                         imap[j-1] = imap[j] * count[j];
-#line 1003
                 }
-#line 1003
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 1003
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 1003
                     IF (err)
-#line 1003
                         error("error in toMixedBase");
-#line 1003
                     for (d = 0; d < var_rank[i]; d++)
-#line 1003
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 1003
                     value[j] = hash_float(var_type[i], var_rank[i], index2,
-#line 1003
                         NCT_FLOAT);
-#line 1003
                     allInExtRange = allInExtRange
-#line 1003
                         && inRange3(value[j], var_type[i], NCT_FLOAT);
-#line 1003
                 }
-#line 1003
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 1003
                     err = nc_put_varm_float(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 1003
                 else
-#line 1003
                     err = nc_put_varm_float(ncid,i,index,count,stride,imap,value);
-#line 1003
                 if (canConvert) {
-#line 1003
                     if (allInExtRange) {
-#line 1003
                         IF (err)
-#line 1003
                             error("%s", nc_strerror(err));
-#line 1003
                     } else {
-#line 1003
                         IF (err != NC_ERANGE)
-#line 1003
                             error("range error: status = %d", err);
-#line 1003
                     }
-#line 1003
                 } else {
-#line 1003
                     IF (nels > 0 && err != NC_ECHAR)
-#line 1003
                         error("wrong type: status = %d", err);
-#line 1003
 		}
-#line 1003
 	    }
-#line 1003
 	}
-#line 1003
     }
-#line 1003
 
-#line 1003
     err = nc_close(ncid);
-#line 1003
     IF (err) 
-#line 1003
 	error("nc_close: %s", nc_strerror(err));
-#line 1003
 
-#line 1003
     check_vars_float(scratch);
-#line 1003
 
-#line 1003
     err = remove(scratch);
-#line 1003
     IF (err)
-#line 1003
         error("remove of %s failed", scratch);
-#line 1003
 }
-#line 1003
 
 void
-#line 1004
 test_nc_put_varm_double(void)
-#line 1004
 {
-#line 1004
     int ncid;
-#line 1004
     int d;
-#line 1004
     int i;
-#line 1004
     int j;
-#line 1004
     int k;
-#line 1004
     int m;
-#line 1004
     int err;
-#line 1004
     int nels;
-#line 1004
     int nslabs;
-#line 1004
     int nstarts;        /* number of different starts */
-#line 1004
     size_t start[MAX_RANK];
-#line 1004
     size_t edge[MAX_RANK];
-#line 1004
     size_t index[MAX_RANK];
-#line 1004
     size_t index2[MAX_RANK];
-#line 1004
     size_t mid[MAX_RANK];
-#line 1004
     size_t count[MAX_RANK];
-#line 1004
     size_t sstride[MAX_RANK];
-#line 1004
     ptrdiff_t stride[MAX_RANK];
-#line 1004
     ptrdiff_t imap[MAX_RANK];
-#line 1004
     int canConvert;	/* Both text or both numeric */
-#line 1004
     int allInExtRange;	/* all values within external range? */
-#line 1004
     double value[MAX_NELS];
-#line 1004
 
-#line 1004
     err = nc_create(scratch, NC_CLOBBER, &ncid);
-#line 1004
     IF (err) {
-#line 1004
 	error("nc_create: %s", nc_strerror(err));
-#line 1004
 	return;
-#line 1004
     }
-#line 1004
     def_dims(ncid);
-#line 1004
     def_vars(ncid);
-#line 1004
     err = nc_enddef(ncid);
-#line 1004
     IF (err)
-#line 1004
 	error("nc_enddef: %s", nc_strerror(err));
-#line 1004
 
-#line 1004
     for (i = 0; i < NVARS; i++) {
-#line 1004
 	canConvert = (var_type[i] == NC_CHAR) == (NCT_DOUBLE == NCT_TEXT);
-#line 1004
 	assert(var_rank[i] <= MAX_RANK);
-#line 1004
 	assert(var_nels[i] <= MAX_NELS);
-#line 1004
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1004
 	    start[j] = 0;
-#line 1004
 	    edge[j] = 1;
-#line 1004
 	    stride[j] = 1;
-#line 1004
 	    imap[j] = 1;
-#line 1004
 	}
-#line 1004
 	err = nc_put_varm_double(BAD_ID, i, start, edge, stride, imap, value);
-#line 1004
 	IF (err != NC_EBADID) 
-#line 1004
 	    error("bad ncid: status = %d", err);
-#line 1004
 	err = nc_put_varm_double(ncid, BAD_VARID, start, edge, stride, imap, value);
-#line 1004
 	IF (err != NC_ENOTVAR) 
-#line 1004
 	    error("bad var id: status = %d", err);
-#line 1004
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1004
 	    if (var_dimid[i][j] > 0) {		/* skip record dim */
-#line 1004
 		start[j] = var_shape[i][j] + 1;
-#line 1004
 		err = nc_put_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 1004
 	      if (!canConvert) {
-#line 1004
 		IF(err != NC_ECHAR)
-#line 1004
 			error("conversion: status = %d", err);
-#line 1004
 	      } else {
-#line 1004
 		IF (err != NC_EINVALCOORDS)
-#line 1004
 		    error("bad start: status = %d", err);
-#line 1004
 		start[j] = 0;
-#line 1004
 		edge[j] = var_shape[i][j] + 1;
-#line 1004
 		err = nc_put_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 1004
 		IF (err != NC_EEDGE)
-#line 1004
 		    error("bad edge: status = %d", err);
-#line 1004
 		edge[j] = 1;
-#line 1004
 		stride[j] = 0;
-#line 1004
 		err = nc_put_varm_double(ncid, i, start, edge, stride, imap, value);
-#line 1004
 		IF (err != NC_ESTRIDE)
-#line 1004
 		    error("bad stride: status = %d", err);
-#line 1004
 		stride[j] = 1;
-#line 1004
 	      }
-#line 1004
 	    }
-#line 1004
 	}
-#line 1004
 	    /* Choose a random point dividing each dim into 2 parts */
-#line 1004
 	    /* Put 2^rank (nslabs) slabs so defined */
-#line 1004
 	nslabs = 1;
-#line 1004
 	for (j = 0; j < var_rank[i]; j++) {
-#line 1004
 	    mid[j] = roll( var_shape[i][j] );
-#line 1004
 	    nslabs *= 2;
-#line 1004
 	}
-#line 1004
 	    /* bits of k determine whether to put lower or upper part of dim */
-#line 1004
 	    /* choose random stride from 1 to edge */
-#line 1004
 	for (k = 0; k < nslabs; k++) {
-#line 1004
 	    nstarts = 1;
-#line 1004
 	    for (j = 0; j < var_rank[i]; j++) {
-#line 1004
 		if ((k >> j) & 1) {
-#line 1004
 		    start[j] = 0;
-#line 1004
 		    edge[j] = mid[j];
-#line 1004
 		}else{
-#line 1004
 		    start[j] = mid[j];
-#line 1004
 		    edge[j] = var_shape[i][j] - mid[j];
-#line 1004
 		}
-#line 1004
 		sstride[j] = stride[j] = edge[j] > 0 ? 1+roll(edge[j]) : 1;
-#line 1004
 		nstarts *= stride[j];
-#line 1004
 	    }
-#line 1004
             for (m = 0; m < nstarts; m++) {
-#line 1004
                 err = toMixedBase(m, var_rank[i], sstride, index);
-#line 1004
                 IF (err)
-#line 1004
                     error("error in toMixedBase");
-#line 1004
                 nels = 1;
-#line 1004
                 for (j = 0; j < var_rank[i]; j++) {
-#line 1004
                     count[j] = 1 + (edge[j] - index[j] - 1) / stride[j];
-#line 1004
                     nels *= count[j];
-#line 1004
                     index[j] += start[j];
-#line 1004
                 }
-#line 1004
                     /* Random choice of forward or backward */
-#line 1004
 /* TODO
-#line 1004
                 if ( roll(2) ) {
-#line 1004
                     for (j = 0; j < var_rank[i]; j++) {
-#line 1004
                         index[j] += (count[j] - 1) * stride[j];
-#line 1004
                         stride[j] = -stride[j];
-#line 1004
                     }
-#line 1004
                 }
-#line 1004
 */
-#line 1004
                 if (var_rank[i] > 0) {
-#line 1004
                     j = var_rank[i] - 1;
-#line 1004
                     imap[j] = 1;
-#line 1004
                     for (; j > 0; j--)
-#line 1004
                         imap[j-1] = imap[j] * count[j];
-#line 1004
                 }
-#line 1004
                 for (allInExtRange = 1, j = 0; j < nels; j++) {
-#line 1004
                     err = toMixedBase(j, var_rank[i], count, index2);
-#line 1004
                     IF (err)
-#line 1004
                         error("error in toMixedBase");
-#line 1004
                     for (d = 0; d < var_rank[i]; d++)
-#line 1004
                         index2[d] = index[d] + index2[d] * stride[d];
-#line 1004
                     value[j] = hash_double(var_type[i], var_rank[i], index2,
-#line 1004
                         NCT_DOUBLE);
-#line 1004
                     allInExtRange = allInExtRange
-#line 1004
                         && inRange3(value[j], var_type[i], NCT_DOUBLE);
-#line 1004
                 }
-#line 1004
                 if (var_rank[i] == 0 && i%2 == 0)
-#line 1004
                     err = nc_put_varm_double(ncid,i,NULL,NULL,NULL,NULL,value);
-#line 1004
                 else
-#line 1004
                     err = nc_put_varm_double(ncid,i,index,count,stride,imap,value);
-#line 1004
                 if (canConvert) {
-#line 1004
                     if (allInExtRange) {
-#line 1004
                         IF (err)
-#line 1004
                             error("%s", nc_strerror(err));
-#line 1004
                     } else {
-#line 1004
                         IF (err != NC_ERANGE)
-#line 1004
                             error("range error: status = %d", err);
-#line 1004
                     }
-#line 1004
                 } else {
-#line 1004
                     IF (nels > 0 && err != NC_ECHAR)
-#line 1004
                         error("wrong type: status = %d", err);
-#line 1004
 		}
-#line 1004
 	    }
-#line 1004
 	}
-#line 1004
     }
-#line 1004
 
-#line 1004
     err = nc_close(ncid);
-#line 1004
     IF (err) 
-#line 1004
 	error("nc_close: %s", nc_strerror(err));
-#line 1004
 
-#line 1004
     check_vars_double(scratch);
-#line 1004
 
-#line 1004
     err = remove(scratch);
-#line 1004
     IF (err)
-#line 1004
         error("remove of %s failed", scratch);
-#line 1004
 }
-#line 1004
 
 
 
@@ -13688,881 +6917,446 @@ test_nc_put_att_text(void)
 }
 
 
-#line 1135
 
 void
-#line 1136
 test_nc_put_att_uchar(void)
-#line 1136
 {
-#line 1136
     int ncid;
-#line 1136
     int i;
-#line 1136
     int j;
-#line 1136
     size_t k;
-#line 1136
     int err;
-#line 1136
     uchar value[MAX_NELS];
-#line 1136
     int allInExtRange;  /* all values within external range? */
-#line 1136
 
-#line 1136
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1136
     IF (err) {
-#line 1136
         error("nc_create: %s", nc_strerror(err));
-#line 1136
         return;
-#line 1136
     }
-#line 1136
     def_dims(ncid);
-#line 1136
     def_vars(ncid);
-#line 1136
 
-#line 1136
     for (i = -1; i < NVARS; i++) {
-#line 1136
         for (j = 0; j < NATTS(i); j++) {
-#line 1136
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1136
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1136
 		err = nc_put_att_uchar(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1136
 		    ATT_LEN(i,j), value);
-#line 1136
 		IF (err != NC_EBADID)
-#line 1136
 		    error("bad ncid: status = %d", err);
-#line 1136
 		err = nc_put_att_uchar(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1136
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1136
 		IF (err != NC_ENOTVAR)
-#line 1136
 		    error("bad var id: status = %d", err);
-#line 1136
 		err = nc_put_att_uchar(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1136
 		    ATT_LEN(i,j), value);
-#line 1136
 		IF (err != NC_EBADTYPE)
-#line 1136
 		    error("bad type: status = %d", err);
-#line 1136
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1136
 		    value[k] = hash_uchar(ATT_TYPE(i,j), -1, &k, NCT_UCHAR);
-#line 1136
 		    allInExtRange = allInExtRange
-#line 1136
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_UCHAR);
-#line 1136
 		}
-#line 1136
 		err = nc_put_att_uchar(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1136
 		    ATT_LEN(i,j), value);
-#line 1136
 		if (allInExtRange) {
-#line 1136
 		    IF (err)
-#line 1136
 			error("%s", nc_strerror(err));
-#line 1136
 		} else {
-#line 1136
                     IF (err != NC_ERANGE)
-#line 1136
                         error("range error: status = %d", err);
-#line 1136
 		}
-#line 1136
 	    }
-#line 1136
         }
-#line 1136
     }
-#line 1136
 
-#line 1136
     check_atts_uchar(ncid);
-#line 1136
     err = nc_close(ncid);
-#line 1136
     IF (err)
-#line 1136
         error("nc_close: %s", nc_strerror(err));
-#line 1136
 
-#line 1136
     err = remove(scratch);
-#line 1136
     IF (err)
-#line 1136
         error("remove of %s failed", scratch);
-#line 1136
 }
-#line 1136
 
 void
-#line 1137
 test_nc_put_att_schar(void)
-#line 1137
 {
-#line 1137
     int ncid;
-#line 1137
     int i;
-#line 1137
     int j;
-#line 1137
     size_t k;
-#line 1137
     int err;
-#line 1137
     schar value[MAX_NELS];
-#line 1137
     int allInExtRange;  /* all values within external range? */
-#line 1137
 
-#line 1137
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1137
     IF (err) {
-#line 1137
         error("nc_create: %s", nc_strerror(err));
-#line 1137
         return;
-#line 1137
     }
-#line 1137
     def_dims(ncid);
-#line 1137
     def_vars(ncid);
-#line 1137
 
-#line 1137
     for (i = -1; i < NVARS; i++) {
-#line 1137
         for (j = 0; j < NATTS(i); j++) {
-#line 1137
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1137
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1137
 		err = nc_put_att_schar(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1137
 		    ATT_LEN(i,j), value);
-#line 1137
 		IF (err != NC_EBADID)
-#line 1137
 		    error("bad ncid: status = %d", err);
-#line 1137
 		err = nc_put_att_schar(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1137
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1137
 		IF (err != NC_ENOTVAR)
-#line 1137
 		    error("bad var id: status = %d", err);
-#line 1137
 		err = nc_put_att_schar(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1137
 		    ATT_LEN(i,j), value);
-#line 1137
 		IF (err != NC_EBADTYPE)
-#line 1137
 		    error("bad type: status = %d", err);
-#line 1137
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1137
 		    value[k] = hash_schar(ATT_TYPE(i,j), -1, &k, NCT_SCHAR);
-#line 1137
 		    allInExtRange = allInExtRange
-#line 1137
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_SCHAR);
-#line 1137
 		}
-#line 1137
 		err = nc_put_att_schar(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1137
 		    ATT_LEN(i,j), value);
-#line 1137
 		if (allInExtRange) {
-#line 1137
 		    IF (err)
-#line 1137
 			error("%s", nc_strerror(err));
-#line 1137
 		} else {
-#line 1137
                     IF (err != NC_ERANGE)
-#line 1137
                         error("range error: status = %d", err);
-#line 1137
 		}
-#line 1137
 	    }
-#line 1137
         }
-#line 1137
     }
-#line 1137
 
-#line 1137
     check_atts_schar(ncid);
-#line 1137
     err = nc_close(ncid);
-#line 1137
     IF (err)
-#line 1137
         error("nc_close: %s", nc_strerror(err));
-#line 1137
 
-#line 1137
     err = remove(scratch);
-#line 1137
     IF (err)
-#line 1137
         error("remove of %s failed", scratch);
-#line 1137
 }
-#line 1137
 
 void
-#line 1138
 test_nc_put_att_short(void)
-#line 1138
 {
-#line 1138
     int ncid;
-#line 1138
     int i;
-#line 1138
     int j;
-#line 1138
     size_t k;
-#line 1138
     int err;
-#line 1138
     short value[MAX_NELS];
-#line 1138
     int allInExtRange;  /* all values within external range? */
-#line 1138
 
-#line 1138
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1138
     IF (err) {
-#line 1138
         error("nc_create: %s", nc_strerror(err));
-#line 1138
         return;
-#line 1138
     }
-#line 1138
     def_dims(ncid);
-#line 1138
     def_vars(ncid);
-#line 1138
 
-#line 1138
     for (i = -1; i < NVARS; i++) {
-#line 1138
         for (j = 0; j < NATTS(i); j++) {
-#line 1138
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1138
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1138
 		err = nc_put_att_short(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1138
 		    ATT_LEN(i,j), value);
-#line 1138
 		IF (err != NC_EBADID)
-#line 1138
 		    error("bad ncid: status = %d", err);
-#line 1138
 		err = nc_put_att_short(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1138
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1138
 		IF (err != NC_ENOTVAR)
-#line 1138
 		    error("bad var id: status = %d", err);
-#line 1138
 		err = nc_put_att_short(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1138
 		    ATT_LEN(i,j), value);
-#line 1138
 		IF (err != NC_EBADTYPE)
-#line 1138
 		    error("bad type: status = %d", err);
-#line 1138
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1138
 		    value[k] = hash_short(ATT_TYPE(i,j), -1, &k, NCT_SHORT);
-#line 1138
 		    allInExtRange = allInExtRange
-#line 1138
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_SHORT);
-#line 1138
 		}
-#line 1138
 		err = nc_put_att_short(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1138
 		    ATT_LEN(i,j), value);
-#line 1138
 		if (allInExtRange) {
-#line 1138
 		    IF (err)
-#line 1138
 			error("%s", nc_strerror(err));
-#line 1138
 		} else {
-#line 1138
                     IF (err != NC_ERANGE)
-#line 1138
                         error("range error: status = %d", err);
-#line 1138
 		}
-#line 1138
 	    }
-#line 1138
         }
-#line 1138
     }
-#line 1138
 
-#line 1138
     check_atts_short(ncid);
-#line 1138
     err = nc_close(ncid);
-#line 1138
     IF (err)
-#line 1138
         error("nc_close: %s", nc_strerror(err));
-#line 1138
 
-#line 1138
     err = remove(scratch);
-#line 1138
     IF (err)
-#line 1138
         error("remove of %s failed", scratch);
-#line 1138
 }
-#line 1138
 
 void
-#line 1139
 test_nc_put_att_int(void)
-#line 1139
 {
-#line 1139
     int ncid;
-#line 1139
     int i;
-#line 1139
     int j;
-#line 1139
     size_t k;
-#line 1139
     int err;
-#line 1139
     int value[MAX_NELS];
-#line 1139
     int allInExtRange;  /* all values within external range? */
-#line 1139
 
-#line 1139
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1139
     IF (err) {
-#line 1139
         error("nc_create: %s", nc_strerror(err));
-#line 1139
         return;
-#line 1139
     }
-#line 1139
     def_dims(ncid);
-#line 1139
     def_vars(ncid);
-#line 1139
 
-#line 1139
     for (i = -1; i < NVARS; i++) {
-#line 1139
         for (j = 0; j < NATTS(i); j++) {
-#line 1139
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1139
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1139
 		err = nc_put_att_int(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1139
 		    ATT_LEN(i,j), value);
-#line 1139
 		IF (err != NC_EBADID)
-#line 1139
 		    error("bad ncid: status = %d", err);
-#line 1139
 		err = nc_put_att_int(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1139
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1139
 		IF (err != NC_ENOTVAR)
-#line 1139
 		    error("bad var id: status = %d", err);
-#line 1139
 		err = nc_put_att_int(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1139
 		    ATT_LEN(i,j), value);
-#line 1139
 		IF (err != NC_EBADTYPE)
-#line 1139
 		    error("bad type: status = %d", err);
-#line 1139
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1139
 		    value[k] = hash_int(ATT_TYPE(i,j), -1, &k, NCT_INT);
-#line 1139
 		    allInExtRange = allInExtRange
-#line 1139
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_INT);
-#line 1139
 		}
-#line 1139
 		err = nc_put_att_int(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1139
 		    ATT_LEN(i,j), value);
-#line 1139
 		if (allInExtRange) {
-#line 1139
 		    IF (err)
-#line 1139
 			error("%s", nc_strerror(err));
-#line 1139
 		} else {
-#line 1139
                     IF (err != NC_ERANGE)
-#line 1139
                         error("range error: status = %d", err);
-#line 1139
 		}
-#line 1139
 	    }
-#line 1139
         }
-#line 1139
     }
-#line 1139
 
-#line 1139
     check_atts_int(ncid);
-#line 1139
     err = nc_close(ncid);
-#line 1139
     IF (err)
-#line 1139
         error("nc_close: %s", nc_strerror(err));
-#line 1139
 
-#line 1139
     err = remove(scratch);
-#line 1139
     IF (err)
-#line 1139
         error("remove of %s failed", scratch);
-#line 1139
 }
-#line 1139
 
 void
-#line 1140
 test_nc_put_att_long(void)
-#line 1140
 {
-#line 1140
     int ncid;
-#line 1140
     int i;
-#line 1140
     int j;
-#line 1140
     size_t k;
-#line 1140
     int err;
-#line 1140
     long value[MAX_NELS];
-#line 1140
     int allInExtRange;  /* all values within external range? */
-#line 1140
 
-#line 1140
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1140
     IF (err) {
-#line 1140
         error("nc_create: %s", nc_strerror(err));
-#line 1140
         return;
-#line 1140
     }
-#line 1140
     def_dims(ncid);
-#line 1140
     def_vars(ncid);
-#line 1140
 
-#line 1140
     for (i = -1; i < NVARS; i++) {
-#line 1140
         for (j = 0; j < NATTS(i); j++) {
-#line 1140
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1140
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1140
 		err = nc_put_att_long(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1140
 		    ATT_LEN(i,j), value);
-#line 1140
 		IF (err != NC_EBADID)
-#line 1140
 		    error("bad ncid: status = %d", err);
-#line 1140
 		err = nc_put_att_long(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1140
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1140
 		IF (err != NC_ENOTVAR)
-#line 1140
 		    error("bad var id: status = %d", err);
-#line 1140
 		err = nc_put_att_long(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1140
 		    ATT_LEN(i,j), value);
-#line 1140
 		IF (err != NC_EBADTYPE)
-#line 1140
 		    error("bad type: status = %d", err);
-#line 1140
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1140
 		    value[k] = hash_long(ATT_TYPE(i,j), -1, &k, NCT_LONG);
-#line 1140
 		    allInExtRange = allInExtRange
-#line 1140
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_LONG);
-#line 1140
 		}
-#line 1140
 		err = nc_put_att_long(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1140
 		    ATT_LEN(i,j), value);
-#line 1140
 		if (allInExtRange) {
-#line 1140
 		    IF (err)
-#line 1140
 			error("%s", nc_strerror(err));
-#line 1140
 		} else {
-#line 1140
                     IF (err != NC_ERANGE)
-#line 1140
                         error("range error: status = %d", err);
-#line 1140
 		}
-#line 1140
 	    }
-#line 1140
         }
-#line 1140
     }
-#line 1140
 
-#line 1140
     check_atts_long(ncid);
-#line 1140
     err = nc_close(ncid);
-#line 1140
     IF (err)
-#line 1140
         error("nc_close: %s", nc_strerror(err));
-#line 1140
 
-#line 1140
     err = remove(scratch);
-#line 1140
     IF (err)
-#line 1140
         error("remove of %s failed", scratch);
-#line 1140
 }
-#line 1140
 
 void
-#line 1141
 test_nc_put_att_float(void)
-#line 1141
 {
-#line 1141
     int ncid;
-#line 1141
     int i;
-#line 1141
     int j;
-#line 1141
     size_t k;
-#line 1141
     int err;
-#line 1141
     float value[MAX_NELS];
-#line 1141
     int allInExtRange;  /* all values within external range? */
-#line 1141
 
-#line 1141
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1141
     IF (err) {
-#line 1141
         error("nc_create: %s", nc_strerror(err));
-#line 1141
         return;
-#line 1141
     }
-#line 1141
     def_dims(ncid);
-#line 1141
     def_vars(ncid);
-#line 1141
 
-#line 1141
     for (i = -1; i < NVARS; i++) {
-#line 1141
         for (j = 0; j < NATTS(i); j++) {
-#line 1141
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1141
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1141
 		err = nc_put_att_float(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1141
 		    ATT_LEN(i,j), value);
-#line 1141
 		IF (err != NC_EBADID)
-#line 1141
 		    error("bad ncid: status = %d", err);
-#line 1141
 		err = nc_put_att_float(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1141
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1141
 		IF (err != NC_ENOTVAR)
-#line 1141
 		    error("bad var id: status = %d", err);
-#line 1141
 		err = nc_put_att_float(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1141
 		    ATT_LEN(i,j), value);
-#line 1141
 		IF (err != NC_EBADTYPE)
-#line 1141
 		    error("bad type: status = %d", err);
-#line 1141
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1141
 		    value[k] = hash_float(ATT_TYPE(i,j), -1, &k, NCT_FLOAT);
-#line 1141
 		    allInExtRange = allInExtRange
-#line 1141
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_FLOAT);
-#line 1141
 		}
-#line 1141
 		err = nc_put_att_float(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1141
 		    ATT_LEN(i,j), value);
-#line 1141
 		if (allInExtRange) {
-#line 1141
 		    IF (err)
-#line 1141
 			error("%s", nc_strerror(err));
-#line 1141
 		} else {
-#line 1141
                     IF (err != NC_ERANGE)
-#line 1141
                         error("range error: status = %d", err);
-#line 1141
 		}
-#line 1141
 	    }
-#line 1141
         }
-#line 1141
     }
-#line 1141
 
-#line 1141
     check_atts_float(ncid);
-#line 1141
     err = nc_close(ncid);
-#line 1141
     IF (err)
-#line 1141
         error("nc_close: %s", nc_strerror(err));
-#line 1141
 
-#line 1141
     err = remove(scratch);
-#line 1141
     IF (err)
-#line 1141
         error("remove of %s failed", scratch);
-#line 1141
 }
-#line 1141
 
 void
-#line 1142
 test_nc_put_att_double(void)
-#line 1142
 {
-#line 1142
     int ncid;
-#line 1142
     int i;
-#line 1142
     int j;
-#line 1142
     size_t k;
-#line 1142
     int err;
-#line 1142
     double value[MAX_NELS];
-#line 1142
     int allInExtRange;  /* all values within external range? */
-#line 1142
 
-#line 1142
     err = nc_create(scratch, NC_NOCLOBBER, &ncid);
-#line 1142
     IF (err) {
-#line 1142
         error("nc_create: %s", nc_strerror(err));
-#line 1142
         return;
-#line 1142
     }
-#line 1142
     def_dims(ncid);
-#line 1142
     def_vars(ncid);
-#line 1142
 
-#line 1142
     for (i = -1; i < NVARS; i++) {
-#line 1142
         for (j = 0; j < NATTS(i); j++) {
-#line 1142
             if (!(ATT_TYPE(i,j) == NC_CHAR)) {
-#line 1142
 		assert(ATT_LEN(i,j) <= MAX_NELS);
-#line 1142
 		err = nc_put_att_double(BAD_ID, i, ATT_NAME(i,j), ATT_TYPE(i,j), 
-#line 1142
 		    ATT_LEN(i,j), value);
-#line 1142
 		IF (err != NC_EBADID)
-#line 1142
 		    error("bad ncid: status = %d", err);
-#line 1142
 		err = nc_put_att_double(ncid, BAD_VARID, ATT_NAME(i,j), 
-#line 1142
 		    ATT_TYPE(i,j), ATT_LEN(i,j), value);
-#line 1142
 		IF (err != NC_ENOTVAR)
-#line 1142
 		    error("bad var id: status = %d", err);
-#line 1142
 		err = nc_put_att_double(ncid, i, ATT_NAME(i,j), BAD_TYPE, 
-#line 1142
 		    ATT_LEN(i,j), value);
-#line 1142
 		IF (err != NC_EBADTYPE)
-#line 1142
 		    error("bad type: status = %d", err);
-#line 1142
 		for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
-#line 1142
 		    value[k] = hash_double(ATT_TYPE(i,j), -1, &k, NCT_DOUBLE);
-#line 1142
 		    allInExtRange = allInExtRange
-#line 1142
 			&& inRange3(value[k], ATT_TYPE(i,j), NCT_DOUBLE);
-#line 1142
 		}
-#line 1142
 		err = nc_put_att_double(ncid, i, ATT_NAME(i,j), ATT_TYPE(i,j),
-#line 1142
 		    ATT_LEN(i,j), value);
-#line 1142
 		if (allInExtRange) {
-#line 1142
 		    IF (err)
-#line 1142
 			error("%s", nc_strerror(err));
-#line 1142
 		} else {
-#line 1142
                     IF (err != NC_ERANGE)
-#line 1142
                         error("range error: status = %d", err);
-#line 1142
 		}
-#line 1142
 	    }
-#line 1142
         }
-#line 1142
     }
-#line 1142
 
-#line 1142
     check_atts_double(ncid);
-#line 1142
     err = nc_close(ncid);
-#line 1142
     IF (err)
-#line 1142
         error("nc_close: %s", nc_strerror(err));
-#line 1142
 
-#line 1142
     err = remove(scratch);
-#line 1142
     IF (err)
-#line 1142
         error("remove of %s failed", scratch);
-#line 1142
 }
-#line 1142
 
 
diff --git a/nc_test/tst_put_vars.c b/nc_test/tst_put_vars.c
new file mode 100644
index 0000000..4855e2a
--- /dev/null
+++ b/nc_test/tst_put_vars.c
@@ -0,0 +1,69 @@
+/*! Test added as part of JIRA ticket NCF-326.
+
+  The test was provided by Ellen Johnson at Mathworks.
+
+  See https://bugtracking.unidata.ucar.edu/browse/NCF-326
+  for more information.
+*/
+#include <stdio.h>
+#include <string.h>
+#include <netcdf.h>
+
+#define FILE_NAME "unlim.nc"
+
+/* 3D matrix, 6 x 4 x 3 */
+
+#define NDIMS 3
+#define X_LEN 6
+#define Y_LEN 4
+#define Z_LEN 3
+
+/* Handle errors by printing an error message */
+#define ERR(e) {printf("Error: %s\n", nc_strerror(e)); return 2;}
+int
+main()
+{
+    size_t start[NDIMS] = {0, 0, 0};
+    size_t count[NDIMS] = {X_LEN, Y_LEN, Z_LEN};
+    ptrdiff_t stride[NDIMS] = {1, 1, 1};
+    float mydata[X_LEN * Y_LEN * Z_LEN];
+    int i;
+    int retval;
+
+    int ncid, varid;
+    int dimids[NDIMS];
+
+    for (i = 0; i < (X_LEN * Y_LEN * Z_LEN); i++)
+        mydata[i] = i;
+
+    /* create the file in NetCDF-4 format */
+    if ((retval = nc_create(FILE_NAME, NC_NETCDF4, &ncid)))
+        ERR(retval);
+
+    /* define dimensions */
+    if ((retval = nc_def_dim(ncid, "time", X_LEN, &dimids[0])))
+        ERR(retval);
+    if ((retval = nc_def_dim(ncid, "lat", Y_LEN, &dimids[1])))
+        ERR(retval);
+    if ((retval = nc_def_dim(ncid, "lon", NC_UNLIMITED, &dimids[2])))
+        ERR(retval);
+
+   /* define the variable */
+    if ((retval = nc_def_var(ncid, "data", NC_FLOAT, NDIMS, dimids, &varid)))
+        ERR(retval);
+
+    /* end define mode */
+    if ((retval = nc_enddef(ncid)))
+        ERR(retval);
+
+    /* write data */
+    if ((retval = nc_put_vars_float(ncid, varid, start, count, stride, mydata)))
+        ERR(retval);
+
+    /* close the file */
+    if ((retval = nc_close(ncid)))
+        ERR(retval);
+
+    printf("\n\n*** SUCCESS writing example file %s!\n", FILE_NAME);
+    return 0;
+}
diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt
index 4e84109..475289a 100644
--- a/nc_test4/CMakeLists.txt
+++ b/nc_test4/CMakeLists.txt
@@ -1,14 +1,14 @@
 # Some extra tests
-SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars 
+SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars
   tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps tst_grps2
   tst_compounds tst_compounds2 tst_compounds3 tst_opaques tst_strings
   tst_strings2 tst_interops tst_interops4 tst_interops6
   tst_enums tst_coords tst_coords2 tst_coords3 tst_vars3 tst_vars4
   tst_chunks tst_chunks2 tst_utf8 tst_fills tst_fills2 tst_fillbug
-  tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts 
+  tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts
   t_type cdm_sea_soundings tst_vl tst_atts1 tst_atts2
   tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs
-  tst_h_scalar tst_rename)
+  tst_h_scalar tst_rename tst_h5_endians)
 
 # Note, renamegroup needs to be compiled before run_grp_rename
 build_bin_test(renamegroup)
@@ -67,6 +67,8 @@ IF(USE_HDF4_FILE_TESTS AND NOT MSVC)
     add_sh_test(nc_test4 tst_formatx_hdf4)
     build_bin_test(tst_chunk_hdf4)
     add_sh_test(nc_test4 run_chunk_hdf4)
+    add_bin_test(nc_test4 tst_h4_lendian)
+
 ENDIF()
 
 
diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am
index b6d3a07..7757330 100644
--- a/nc_test4/Makefile.am
+++ b/nc_test4/Makefile.am
@@ -1,7 +1,7 @@
 # This is part of the netCDF package.
 # Copyright 2005 University Corporation for Atmospheric Research/Unidata
 # See COPYRIGHT file for conditions of use.
-# 
+#
 # This entire directory will be skipped if netCDF-4 is not enabled.
 #
 
@@ -21,7 +21,7 @@ tst_chunks tst_chunks2 tst_utf8 tst_fills tst_fills2 tst_fillbug	\
 tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts	\
 t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2		\
 tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs        \
-tst_h_scalar tst_rename
+tst_h_scalar tst_rename tst_h5_endians
 
 check_PROGRAMS = $(NC4_TESTS) renamegroup
 
@@ -36,7 +36,7 @@ TESTS += run_grp_rename.sh
 
 # If the v2 API was built, add its test program.
 if BUILD_V2
-check_PROGRAMS += tst_v2 
+check_PROGRAMS += tst_v2
 TESTS += tst_v2
 endif # BUILD_V2
 
@@ -76,8 +76,8 @@ TESTS += run_par_bm_test.sh
 endif # TEST_PARALLEL
 
 benchmarks: check
-	./run_bm_radar_2D.sh	
-	./run_bm_radar_2D_compression1.sh	
+	./run_bm_radar_2D.sh
+	./run_bm_radar_2D_compression1.sh
 	./run_bm.sh
 	./run_tst_chunks.sh
 	./run_bm_ar4.sh
@@ -85,8 +85,8 @@ endif # BUILD_BENCHMARKS
 
 # These are the tests for HDF4.
 if USE_HDF4
-check_PROGRAMS += tst_interops2 tst_chunk_hdf4
-TESTS += tst_interops2  tst_formatx_hdf4.sh run_chunk_hdf4.sh
+check_PROGRAMS += tst_interops2 tst_chunk_hdf4 tst_h4_lendian
+TESTS += tst_interops2  tst_formatx_hdf4.sh run_chunk_hdf4.sh tst_h4_lendian
 if USE_HDF4_FILE_TESTS
 check_PROGRAMS += tst_interops3
 TESTS += run_get_hdf4_files.sh tst_interops3
@@ -121,7 +121,8 @@ run_bm_ar4.sh ref_tst_compounds.nc run_hdf4_valgrind_tests.sh		\
 ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc		\
 ref_tst_interops4.nc run_get_knmi_files.sh CMakeLists.txt               \
 run_grp_rename.sh tst_formatx_hdf4.sh                                   \
-run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4
+run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4 \
+tst_h5_endians.c tst_h4_lendian.c
 
 CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc	\
 bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt			\
@@ -131,7 +132,7 @@ tst_*.nc tst_floats2_*.cdl tst_ints2_*.cdl tst_shorts2_*.cdl		\
 tst_elena_*.cdl tst_simple*.cdl tst_chunks.cdl pr_A1.* tauu_A1.*	\
 usi_01.* thetau_01.* tst_*.nc tst_*.h5                                  \
 tst_grp_rename.cdl tst_grp_rename.nc tst_grp_rename.dmp ref_grp_rename.cdl \
-foo1.nc tst_interops2.h4
+foo1.nc tst_interops2.h4 tst_h5_endians.nc tst_h4_lendian.h4
 
 if USE_HDF4_FILE_TESTS
 DISTCLEANFILES = AMSR_E_L2_Rain_V10_200905312326_A.hdf	\
@@ -140,9 +141,3 @@ MYD29.A2009152.0000.005.2009153124331.hdf		\
 MYD29.A2002185.0000.005.2007160150627.hdf		\
 MOD29.A2000055.0005.005.2006267200024.hdf
 endif # HDF4_FILE_TESTS
-
-
-
-
-
-
diff --git a/nc_test4/Makefile.in b/nc_test4/Makefile.in
index 895717d..6511873 100644
--- a/nc_test4/Makefile.in
+++ b/nc_test4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@
 # This is part of the netCDF package.
 # Copyright 2005 University Corporation for Atmospheric Research/Unidata
 # See COPYRIGHT file for conditions of use.
-# 
+#
 # This entire directory will be skipped if netCDF-4 is not enabled.
 #
 
@@ -29,7 +29,17 @@
 # libraries for netCDF-4.
 #
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -93,9 +103,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -112,7 +119,7 @@ TESTS = $(am__EXEEXT_1) run_grp_rename.sh $(am__EXEEXT_3) \
 	$(am__append_16) $(am__append_18)
 
 # If the v2 API was built, add its test program.
- at BUILD_V2_TRUE@am__append_4 = tst_v2 
+ at BUILD_V2_TRUE@am__append_4 = tst_v2
 @BUILD_V2_TRUE at am__append_5 = tst_v2
 @LARGE_FILE_TESTS_TRUE at am__append_6 = tst_large
 @LARGE_FILE_TESTS_TRUE at am__append_7 = tst_large
@@ -136,8 +143,8 @@ TESTS = $(am__EXEEXT_1) run_grp_rename.sh $(am__EXEEXT_3) \
 @BUILD_BENCHMARKS_TRUE@@TEST_PARALLEL_TRUE at am__append_10 = run_par_bm_test.sh
 
 # These are the tests for HDF4.
- at USE_HDF4_TRUE@am__append_11 = tst_interops2 tst_chunk_hdf4
- at USE_HDF4_TRUE@am__append_12 = tst_interops2  tst_formatx_hdf4.sh run_chunk_hdf4.sh
+ at USE_HDF4_TRUE@am__append_11 = tst_interops2 tst_chunk_hdf4 tst_h4_lendian
+ at USE_HDF4_TRUE@am__append_12 = tst_interops2  tst_formatx_hdf4.sh run_chunk_hdf4.sh tst_h4_lendian
 @USE_HDF4_FILE_TESTS_TRUE@@USE_HDF4_TRUE at am__append_13 = tst_interops3
 @USE_HDF4_FILE_TESTS_TRUE@@USE_HDF4_TRUE at am__append_14 = run_get_hdf4_files.sh tst_interops3
 #tst_interops2_LDADD = ${lib_LTLIBRARIES} -lmfhdf -ldf -ljpeg -lhdf5_hl	\
@@ -162,6 +169,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -186,7 +194,8 @@ am__EXEEXT_1 = tst_dims$(EXEEXT) tst_dims2$(EXEEXT) tst_dims3$(EXEEXT) \
 	tst_atts1$(EXEEXT) tst_atts2$(EXEEXT) tst_vars2$(EXEEXT) \
 	tst_files5$(EXEEXT) tst_files6$(EXEEXT) tst_sync$(EXEEXT) \
 	tst_h_strbug$(EXEEXT) tst_h_refs$(EXEEXT) \
-	tst_h_scalar$(EXEEXT) tst_rename$(EXEEXT)
+	tst_h_scalar$(EXEEXT) tst_rename$(EXEEXT) \
+	tst_h5_endians$(EXEEXT)
 @LARGE_FILE_TESTS_TRUE at am__EXEEXT_2 = tst_large$(EXEEXT) \
 @LARGE_FILE_TESTS_TRUE@	tst_large2$(EXEEXT)
 @BUILD_V2_TRUE at am__EXEEXT_3 = tst_v2$(EXEEXT)
@@ -203,7 +212,7 @@ am__EXEEXT_1 = tst_dims$(EXEEXT) tst_dims2$(EXEEXT) tst_dims3$(EXEEXT) \
 @BUILD_BENCHMARKS_TRUE@	tst_mem$(EXEEXT) tst_knmi$(EXEEXT) \
 @BUILD_BENCHMARKS_TRUE@	bm_netcdf4_recs$(EXEEXT)
 @USE_HDF4_TRUE at am__EXEEXT_6 = tst_interops2$(EXEEXT) \
- at USE_HDF4_TRUE@	tst_chunk_hdf4$(EXEEXT)
+ at USE_HDF4_TRUE@	tst_chunk_hdf4$(EXEEXT) tst_h4_lendian$(EXEEXT)
 @USE_HDF4_FILE_TESTS_TRUE@@USE_HDF4_TRUE at am__EXEEXT_7 = tst_interops3$(EXEEXT)
 @TEST_PARALLEL_TRUE at am__EXEEXT_8 = tst_mpi_parallel$(EXEEXT) \
 @TEST_PARALLEL_TRUE@	tst_parallel$(EXEEXT) \
@@ -365,6 +374,12 @@ tst_grps_LDADD = $(LDADD)
 tst_grps2_SOURCES = tst_grps2.c
 tst_grps2_OBJECTS = tst_grps2.$(OBJEXT)
 tst_grps2_LDADD = $(LDADD)
+tst_h4_lendian_SOURCES = tst_h4_lendian.c
+tst_h4_lendian_OBJECTS = tst_h4_lendian.$(OBJEXT)
+tst_h4_lendian_LDADD = $(LDADD)
+tst_h5_endians_SOURCES = tst_h5_endians.c
+tst_h5_endians_OBJECTS = tst_h5_endians.$(OBJEXT)
+tst_h5_endians_LDADD = $(LDADD)
 tst_h_atts2_SOURCES = tst_h_atts2.c
 tst_h_atts2_OBJECTS = tst_h_atts2.$(OBJEXT)
 tst_h_atts2_LDADD = $(LDADD)
@@ -527,16 +542,17 @@ SOURCES = $(bm_file_SOURCES) $(bm_many_atts_SOURCES) \
 	tst_dims3.c tst_endian_fill.c tst_enums.c tst_files.c \
 	$(tst_files2_SOURCES) tst_files3.c tst_files4.c tst_files5.c \
 	tst_files6.c tst_fillbug.c tst_fills.c tst_fills2.c tst_grps.c \
-	tst_grps2.c tst_h_atts2.c tst_h_files3.c \
-	$(tst_h_many_atts_SOURCES) tst_h_refs.c tst_h_scalar.c \
-	tst_h_strbug.c tst_interops.c tst_interops2.c tst_interops3.c \
-	tst_interops4.c tst_interops5.c tst_interops6.c \
-	$(tst_knmi_SOURCES) tst_large.c tst_large2.c tst_mem.c \
-	tst_mpi_parallel.c tst_nc4perf.c tst_opaques.c tst_parallel.c \
-	tst_parallel3.c tst_parallel4.c tst_rename.c tst_strings.c \
-	tst_strings2.c tst_sync.c tst_unlim_vars.c tst_utf8.c tst_v2.c \
-	tst_varms.c tst_vars.c tst_vars2.c tst_vars3.c tst_vars4.c \
-	tst_vl.c tst_xplatform.c tst_xplatform2.c
+	tst_grps2.c tst_h4_lendian.c tst_h5_endians.c tst_h_atts2.c \
+	tst_h_files3.c $(tst_h_many_atts_SOURCES) tst_h_refs.c \
+	tst_h_scalar.c tst_h_strbug.c tst_interops.c tst_interops2.c \
+	tst_interops3.c tst_interops4.c tst_interops5.c \
+	tst_interops6.c $(tst_knmi_SOURCES) tst_large.c tst_large2.c \
+	tst_mem.c tst_mpi_parallel.c tst_nc4perf.c tst_opaques.c \
+	tst_parallel.c tst_parallel3.c tst_parallel4.c tst_rename.c \
+	tst_strings.c tst_strings2.c tst_sync.c tst_unlim_vars.c \
+	tst_utf8.c tst_v2.c tst_varms.c tst_vars.c tst_vars2.c \
+	tst_vars3.c tst_vars4.c tst_vl.c tst_xplatform.c \
+	tst_xplatform2.c
 DIST_SOURCES = $(am__bm_file_SOURCES_DIST) \
 	$(am__bm_many_atts_SOURCES_DIST) \
 	$(am__bm_many_objs_SOURCES_DIST) \
@@ -551,17 +567,18 @@ DIST_SOURCES = $(am__bm_file_SOURCES_DIST) \
 	tst_dims3.c tst_endian_fill.c tst_enums.c tst_files.c \
 	$(am__tst_files2_SOURCES_DIST) tst_files3.c tst_files4.c \
 	tst_files5.c tst_files6.c tst_fillbug.c tst_fills.c \
-	tst_fills2.c tst_grps.c tst_grps2.c tst_h_atts2.c \
-	tst_h_files3.c $(am__tst_h_many_atts_SOURCES_DIST) \
-	tst_h_refs.c tst_h_scalar.c tst_h_strbug.c tst_interops.c \
-	tst_interops2.c tst_interops3.c tst_interops4.c \
-	tst_interops5.c tst_interops6.c $(am__tst_knmi_SOURCES_DIST) \
-	tst_large.c tst_large2.c tst_mem.c tst_mpi_parallel.c \
-	tst_nc4perf.c tst_opaques.c tst_parallel.c tst_parallel3.c \
-	tst_parallel4.c tst_rename.c tst_strings.c tst_strings2.c \
-	tst_sync.c tst_unlim_vars.c tst_utf8.c tst_v2.c tst_varms.c \
-	tst_vars.c tst_vars2.c tst_vars3.c tst_vars4.c tst_vl.c \
-	tst_xplatform.c tst_xplatform2.c
+	tst_fills2.c tst_grps.c tst_grps2.c tst_h4_lendian.c \
+	tst_h5_endians.c tst_h_atts2.c tst_h_files3.c \
+	$(am__tst_h_many_atts_SOURCES_DIST) tst_h_refs.c \
+	tst_h_scalar.c tst_h_strbug.c tst_interops.c tst_interops2.c \
+	tst_interops3.c tst_interops4.c tst_interops5.c \
+	tst_interops6.c $(am__tst_knmi_SOURCES_DIST) tst_large.c \
+	tst_large2.c tst_mem.c tst_mpi_parallel.c tst_nc4perf.c \
+	tst_opaques.c tst_parallel.c tst_parallel3.c tst_parallel4.c \
+	tst_rename.c tst_strings.c tst_strings2.c tst_sync.c \
+	tst_unlim_vars.c tst_utf8.c tst_v2.c tst_varms.c tst_vars.c \
+	tst_vars2.c tst_vars3.c tst_vars4.c tst_vl.c tst_xplatform.c \
+	tst_xplatform2.c
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -779,7 +796,8 @@ AM_RECURSIVE_TARGETS = check recheck
 @BUILD_BENCHMARKS_TRUE@	tst_h_files3$(EXEEXT) tst_mem$(EXEEXT) \
 @BUILD_BENCHMARKS_TRUE@	run_get_knmi_files.sh tst_knmi$(EXEEXT)
 @USE_HDF4_TRUE at am__EXEEXT_10 = tst_interops2$(EXEEXT) \
- at USE_HDF4_TRUE@	tst_formatx_hdf4.sh run_chunk_hdf4.sh
+ at USE_HDF4_TRUE@	tst_formatx_hdf4.sh run_chunk_hdf4.sh \
+ at USE_HDF4_TRUE@	tst_h4_lendian$(EXEEXT)
 @USE_HDF4_FILE_TESTS_TRUE@@USE_HDF4_TRUE at am__EXEEXT_11 = run_get_hdf4_files.sh \
 @USE_HDF4_FILE_TESTS_TRUE@@USE_HDF4_TRUE@	tst_interops3$(EXEEXT)
 TEST_SUITE_LOG = test-suite.log
@@ -802,6 +820,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -854,6 +874,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -869,10 +890,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -907,8 +930,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -980,7 +1005,7 @@ tst_chunks tst_chunks2 tst_utf8 tst_fills tst_fills2 tst_fillbug	\
 tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts	\
 t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2		\
 tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs        \
-tst_h_scalar tst_rename
+tst_h_scalar tst_rename tst_h5_endians
 
 @BUILD_BENCHMARKS_TRUE at bm_netcdf4_recs_SOURCES = bm_netcdf4_recs.c tst_utils.c
 @BUILD_BENCHMARKS_TRUE at bm_many_atts_SOURCES = bm_many_atts.c tst_utils.c
@@ -1001,7 +1026,8 @@ run_bm_ar4.sh ref_tst_compounds.nc run_hdf4_valgrind_tests.sh		\
 ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc		\
 ref_tst_interops4.nc run_get_knmi_files.sh CMakeLists.txt               \
 run_grp_rename.sh tst_formatx_hdf4.sh                                   \
-run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4
+run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4 \
+tst_h5_endians.c tst_h4_lendian.c
 
 CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc	\
 bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt			\
@@ -1011,7 +1037,7 @@ tst_*.nc tst_floats2_*.cdl tst_ints2_*.cdl tst_shorts2_*.cdl		\
 tst_elena_*.cdl tst_simple*.cdl tst_chunks.cdl pr_A1.* tauu_A1.*	\
 usi_01.* thetau_01.* tst_*.nc tst_*.h5                                  \
 tst_grp_rename.cdl tst_grp_rename.nc tst_grp_rename.dmp ref_grp_rename.cdl \
-foo1.nc tst_interops2.h4
+foo1.nc tst_interops2.h4 tst_h5_endians.nc tst_h4_lendian.h4
 
 @USE_HDF4_FILE_TESTS_TRUE at DISTCLEANFILES = AMSR_E_L2_Rain_V10_200905312326_A.hdf	\
 @USE_HDF4_FILE_TESTS_TRUE at AMSR_E_L3_DailyLand_V06_20020619.hdf			\
@@ -1035,7 +1061,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign nc_test4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign nc_test4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -1044,7 +1069,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1240,6 +1265,14 @@ tst_grps2$(EXEEXT): $(tst_grps2_OBJECTS) $(tst_grps2_DEPENDENCIES) $(EXTRA_tst_g
 	@rm -f tst_grps2$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tst_grps2_OBJECTS) $(tst_grps2_LDADD) $(LIBS)
 
+tst_h4_lendian$(EXEEXT): $(tst_h4_lendian_OBJECTS) $(tst_h4_lendian_DEPENDENCIES) $(EXTRA_tst_h4_lendian_DEPENDENCIES) 
+	@rm -f tst_h4_lendian$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tst_h4_lendian_OBJECTS) $(tst_h4_lendian_LDADD) $(LIBS)
+
+tst_h5_endians$(EXEEXT): $(tst_h5_endians_OBJECTS) $(tst_h5_endians_DEPENDENCIES) $(EXTRA_tst_h5_endians_DEPENDENCIES) 
+	@rm -f tst_h5_endians$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tst_h5_endians_OBJECTS) $(tst_h5_endians_LDADD) $(LIBS)
+
 tst_h_atts2$(EXEEXT): $(tst_h_atts2_OBJECTS) $(tst_h_atts2_DEPENDENCIES) $(EXTRA_tst_h_atts2_DEPENDENCIES) 
 	@rm -f tst_h_atts2$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tst_h_atts2_OBJECTS) $(tst_h_atts2_LDADD) $(LIBS)
@@ -1438,6 +1471,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_fills2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_grps.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_grps2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_h4_lendian.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_h5_endians.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_h_atts2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_h_files3.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tst_h_many_atts.Po at am__quote@
@@ -1589,7 +1624,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -2071,6 +2106,13 @@ tst_rename.log: tst_rename$(EXEEXT)
 	--log-file $$b.log --trs-file $$b.trs \
 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
 	"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_h5_endians.log: tst_h5_endians$(EXEEXT)
+	@p='tst_h5_endians$(EXEEXT)'; \
+	b='tst_h5_endians'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 run_grp_rename.sh.log: run_grp_rename.sh
 	@p='run_grp_rename.sh'; \
 	b='run_grp_rename.sh'; \
@@ -2218,6 +2260,13 @@ run_chunk_hdf4.sh.log: run_chunk_hdf4.sh
 	--log-file $$b.log --trs-file $$b.trs \
 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
 	"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_h4_lendian.log: tst_h4_lendian$(EXEEXT)
+	@p='tst_h4_lendian$(EXEEXT)'; \
+	b='tst_h4_lendian'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 run_get_hdf4_files.sh.log: run_get_hdf4_files.sh
 	@p='run_get_hdf4_files.sh'; \
 	b='run_get_hdf4_files.sh'; \
@@ -2433,10 +2482,12 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	recheck tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 @BUILD_BENCHMARKS_TRUE at benchmarks: check
- at BUILD_BENCHMARKS_TRUE@	./run_bm_radar_2D.sh	
- at BUILD_BENCHMARKS_TRUE@	./run_bm_radar_2D_compression1.sh	
+ at BUILD_BENCHMARKS_TRUE@	./run_bm_radar_2D.sh
+ at BUILD_BENCHMARKS_TRUE@	./run_bm_radar_2D_compression1.sh
 @BUILD_BENCHMARKS_TRUE@	./run_bm.sh
 @BUILD_BENCHMARKS_TRUE@	./run_tst_chunks.sh
 @BUILD_BENCHMARKS_TRUE@	./run_bm_ar4.sh
diff --git a/nc_test4/tst_fills2.c b/nc_test4/tst_fills2.c
index af1f950..de3c051 100644
--- a/nc_test4/tst_fills2.c
+++ b/nc_test4/tst_fills2.c
@@ -364,6 +364,20 @@ main(int argc, char **argv)
    }
    SUMMARIZE_ERR;
 
+   printf("*** Testing fix for netCDF-4 fill-value bug...");
+   {
+      int  ncid, varid, dimids[1];
+      double fillval = -9999;
+
+      /* Test case for NCF-187 bug, thanks to Alexander Barth for fix */
+      if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLASSIC_MODEL, &ncid)) ERR;
+      if (nc_def_dim(ncid, "x", 182, &dimids[0])) ERR;
+      if (nc_def_var(ncid, "u_obs", NC_FLOAT, 1, dimids, &varid)) ERR;
+      if (nc_put_att_double (ncid, varid, "_FillValue", NC_FLOAT, 1, &fillval)) ERR;
+      if (nc_close(ncid)) ERR;
+      SUMMARIZE_ERR;
+   }
+
    FINAL_RESULTS;
 }
 
diff --git a/nc_test4/tst_h4_lendian.c b/nc_test4/tst_h4_lendian.c
new file mode 100644
index 0000000..c81602b
--- /dev/null
+++ b/nc_test4/tst_h4_lendian.c
@@ -0,0 +1,167 @@
+/*! Testing for proper read of little-endian variables in an hdf4 file.
+ *
+ * Added to debug issue NCF-332. Based on code submitted by
+ * https://github.com/Unidata/netcdf-c/issues/113.
+ */
+
+#include <stdio.h>
+#include <config.h>
+#include <nc_tests.h>
+#include <hdf5.h>
+#include <H5DSpublic.h>
+#include "mfhdf.h"
+
+#define DIM1 5
+#define DIM0 5
+#define RANK 2
+#define FILENAME "tst_h4_lendian.h4"
+#define SDSNAME "data"
+
+int read_hdf_file(int dtype) {
+
+  int ncid = 0;
+  int le_int16_varid = 0;
+  int retval = 0;
+  int ed = 0;
+
+  printf("\to Reading hdf4 file with a little-endian datatype %d\n",dtype);
+
+  printf("\t\to Opening file....\t\t\t\t\t");
+  retval = nc_open(FILENAME, NC_NETCDF4 | NC_NOWRITE, &ncid);
+  if(retval) {printf("Failure [%d]\n",retval); return retval;}
+  else {printf("Success\n");}
+
+  printf("\t\to Getting varid....\t\t\t\t\t");
+  retval = nc_inq_varid(ncid,SDSNAME,&le_int16_varid);
+  if(retval) {printf("Failure [%d]\n",retval); return retval;}
+  else {printf("Success\n");}
+
+  printf("\t\to Querying endianness of the variable....\t\t");
+  retval = nc_inq_var_endian(ncid,le_int16_varid,&ed);
+  if(retval) {printf("Failure [%d]\n",retval); return retval;}
+  else {printf("Success\n");}
+
+  printf("\t\to Checking that endianness is NC_ENDIAN_LITTLE....\t");
+  if (ed == NC_ENDIAN_LITTLE) printf("Success\n");
+  else {printf("Failure [%d]\n\n",ed); nc_close(ncid); return -1;}
+
+  printf("\t\to Closing file....\t\t\t\t\t");
+  retval = nc_close(ncid);
+  if(retval) {printf("Failure [%d]\n\n",retval); return retval;}
+  else {printf("Success\n\n");}
+
+  return 0;
+}
+
+int create_hdf_file(int dtype) {
+
+    int32 sd_id, sds_id, istat, sd_index;
+    int32 dims[2], start[2], edges[2], rank;
+    int16 array_data[DIM0][DIM1];
+    intn i, j, count;
+
+    start[0] = 0;
+    start[1] = 0;
+    edges[0] = DIM1;
+    edges[1] = DIM0;
+
+    // populate data array
+    count = 0;
+    for (j = 0; j < DIM0; j++)
+      {
+        for (i = 0; i < DIM1; i++)
+          array_data[j][i] = count++;
+      }
+
+    printf("\to Creating hdf4 file with little-endian datatype %d....\t",dtype);
+
+    sd_id = SDstart(FILENAME, DFACC_CREATE);
+    //sds_id = SDcreate(sd_id, SDSNAME, DFNT_LITEND|dtype, RANK, edges);
+    sds_id = SDcreate(sd_id, SDSNAME, dtype, RANK, edges);
+
+    istat = SDendaccess(sds_id);
+    if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
+
+    istat = SDend(sd_id);
+    if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
+
+    sd_id = SDstart(FILENAME, DFACC_WRITE);
+
+    sd_index = 0;
+    sds_id = SDselect(sd_id, sd_index);
+
+    istat = SDwritedata(sds_id, start, NULL, edges, (VOIDP)array_data);
+    if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
+
+    istat = SDendaccess(sds_id);
+    if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
+
+    istat = SDend(sd_id);
+    if(istat) {printf("Failure %d\n"); return istat;}
+
+    printf("Success\n");
+    return 0;
+}
+
+
+int test_read_write(int dtype) {
+
+  int res = 0;
+
+  res = create_hdf_file(dtype);
+  if(res) {unlink(FILENAME); return res;}
+
+  res = read_hdf_file(dtype);
+
+  unlink(FILENAME);
+  return res;
+}
+
+/*! Standard main function.
+ *
+ */
+int main() {
+
+  int res = 0;
+
+  printf("Test reading from an hdf4 file with a little-endian datatype.\n");
+
+  /* True Positives. */
+  res = test_read_write(DFNT_LINT8);
+  res = test_read_write(DFNT_LUINT8);
+  res = test_read_write(DFNT_LINT16);
+  res = test_read_write(DFNT_LUINT16);
+  res = test_read_write(DFNT_LINT32);
+  res = test_read_write(DFNT_LUINT32);
+  res = test_read_write(DFNT_LFLOAT32);
+  res = test_read_write(DFNT_LFLOAT64);
+
+  /* True Negatives. */
+  printf("\t**** Testing for True Negatives. THESE SHOULD FAIL.****\n\n");
+  res = test_read_write(DFNT_INT8);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_UINT8);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_INT16);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_UINT16);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_INT32);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_UINT32);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_FLOAT32);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  res = test_read_write(DFNT_FLOAT64);
+  if(!res) {printf("Should have failed. Error!\n"); return -1;}
+
+  printf("Finished.\n");
+  return 0;
+}
diff --git a/nc_test4/tst_h5_endians.c b/nc_test4/tst_h5_endians.c
new file mode 100644
index 0000000..3b167f0
--- /dev/null
+++ b/nc_test4/tst_h5_endians.c
@@ -0,0 +1,136 @@
+/*! Test for NCF-331. Added May 11, 2015.
+ *  See the following links for more information:
+ *
+ *  o Issue on GitHub: https://github.com/Unidata/netcdf-c/issues/112
+ *  o Issue in JIRA:   https://bugtracking.unidata.ucar.edu/browse/NCF-331
+ *
+ * Test contributed by Jeff Whitaker
+ */
+
+#include <string.h>
+#include <netcdf.h>
+#include <stdio.h>
+#include <nc_tests.h>
+#include "nc_logging.h"
+
+#define FILE_NAME_NC "tst_h5_endians.nc"
+
+#define NDIM 10
+#define NLON 20
+#define DIM_NAME "x"
+#define DIM_LEN 4
+#define GRP_NAME "grp"
+#define LE_FLOAT_VARNAME "fl_le"
+#define BE_FLOAT_VARNAME "fl_be"
+#define LE_INT_VARNAME "int_le"
+#define BE_INT_VARNAME "int_be"
+#define LE_DBL_VARNAME "dbl_le"
+#define BE_DBL_VARNAME "dbl_be"
+
+int main() {
+
+  int ncid, dimid;
+  int le_float_varid;
+  int be_float_varid;
+  int le_int_varid;
+  int be_int_varid;
+  int le_dbl_varid;
+  int be_dbl_varid;
+  int ed;
+  int failures = 0;
+  int retval = 0;
+
+  printf("* Checking that endianness is properly read from file.\n");
+  printf("** Generating test files.\n");
+  /*
+   * 1. Create a netcdf file with endianness as desired.
+   */
+  {
+
+    printf("*** Creating a file via netcdf API: %s.\n",FILE_NAME_NC);
+    retval = nc_create(FILE_NAME_NC, NC_NETCDF4 | NC_CLOBBER, &ncid);
+
+    retval = nc_def_dim(ncid, DIM_NAME, NDIM, &dimid);
+
+    /* Little-Endian Float */
+    retval = nc_def_var(ncid, LE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &le_float_varid);
+    retval = nc_def_var_endian(ncid, le_float_varid, NC_ENDIAN_LITTLE);
+
+    /* Big-Endian Float */
+    retval = nc_def_var(ncid, BE_FLOAT_VARNAME, NC_FLOAT, 1, &dimid, &be_float_varid);
+    retval = nc_def_var_endian(ncid, be_float_varid, NC_ENDIAN_BIG);
+
+    /* Little-Endian Int */
+    retval = nc_def_var(ncid, LE_INT_VARNAME, NC_INT, 1, &dimid, &le_int_varid);
+    retval = nc_def_var_endian(ncid, le_int_varid, NC_ENDIAN_LITTLE);
+
+    /* Big-Endian Int */
+    retval = nc_def_var(ncid, BE_INT_VARNAME, NC_INT, 1, &dimid, &be_int_varid);
+    retval = nc_def_var_endian(ncid, be_int_varid, NC_ENDIAN_BIG);
+
+    /* Little-Endian Double */
+    retval = nc_def_var(ncid, LE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &le_dbl_varid);
+    retval = nc_def_var_endian(ncid, le_dbl_varid, NC_ENDIAN_LITTLE);
+
+    /* Big-Endian Double */
+    retval = nc_def_var(ncid, BE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &be_dbl_varid);
+    retval = nc_def_var_endian(ncid, be_dbl_varid, NC_ENDIAN_BIG);
+
+
+    retval = nc_close(ncid);
+  }
+
+  /*
+   * 2. Reopen netcdf-generated file, check to see if the endianness attribute
+   *    exists.
+   */
+  printf("** Checking test files.\n");
+  {
+    ncid = 0;
+    le_float_varid = 0;
+    be_float_varid = 0;
+    le_int_varid = 0;
+    be_int_varid = 0;
+    le_dbl_varid = 0;
+    be_dbl_varid = 0;
+
+    printf("*** %s\n",FILE_NAME_NC);
+    retval = nc_open(FILE_NAME_NC, NC_NETCDF4 | NC_NOWRITE, &ncid);
+
+    retval = nc_inq_varid(ncid,LE_FLOAT_VARNAME,&le_float_varid);
+    retval = nc_inq_varid(ncid,BE_FLOAT_VARNAME,&be_float_varid);
+    retval = nc_inq_varid(ncid,LE_INT_VARNAME,&le_int_varid);
+    retval = nc_inq_varid(ncid,BE_INT_VARNAME,&be_int_varid);
+    retval = nc_inq_varid(ncid,LE_DBL_VARNAME,&le_dbl_varid);
+    retval = nc_inq_varid(ncid,BE_DBL_VARNAME,&be_dbl_varid);
+
+    printf("\tLittle-Endian Float...\t");
+    retval = nc_inq_var_endian(ncid,le_float_varid,&ed);
+    if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tBig-Endian Float...\t");
+    retval = nc_inq_var_endian(ncid,be_float_varid,&ed);
+    if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tLittle-Endian Int...\t");
+    retval = nc_inq_var_endian(ncid,le_int_varid,&ed);
+    if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tBig-Endian Int...\t");
+    retval = nc_inq_var_endian(ncid,be_int_varid,&ed);
+    if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tLittle-Endian Double...\t");
+    retval = nc_inq_var_endian(ncid,le_dbl_varid,&ed);
+    if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    printf("\tBig-Endian Double...\t");
+    retval = nc_inq_var_endian(ncid,be_dbl_varid,&ed);
+    if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
+
+    retval = nc_close(ncid);
+  }
+
+  printf("** Failures Returned: [%d]\n",failures);
+  return failures;
+}
diff --git a/ncdap_test/CMakeLists.txt b/ncdap_test/CMakeLists.txt
index a019e07..1294fa6 100644
--- a/ncdap_test/CMakeLists.txt
+++ b/ncdap_test/CMakeLists.txt
@@ -5,22 +5,22 @@ add_definitions(-D"TOPSRCDIR=${CMAKE_SOURCE_DIR}")
 
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 
-FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE) 
+FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
 
 IF(ENABLE_DAP_REMOTE_TESTS)
   ADD_EXECUTABLE(nctestserver nctestserver.c)
   TARGET_LINK_LIBRARIES(nctestserver netcdf ${ALL_TLL_LIBS})
 
-  ####				     
-  # We have to do a little tweaking    
+  ####
+  # We have to do a little tweaking
   # to remove the Release/ and Debug/ directories
   # in MSVC builds.  This is required to get
   # test scripts to work.
   ####
   IF(MSVC)
-    SET_TARGET_PROPERTIES(nctestserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
+    SET_TARGET_PROPERTIES(nctestserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY
       ${CMAKE_CURRENT_BINARY_DIR})
-    SET_TARGET_PROPERTIES(nctestserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG 
+    SET_TARGET_PROPERTIES(nctestserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
       ${CMAKE_CURRENT_BINARY_DIR})
     SET_TARGET_PROPERTIES(nctestserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
       ${CMAKE_CURRENT_BINARY_DIR})
@@ -33,7 +33,7 @@ IF(ENABLE_TESTS)
   # must be run in a particular order. It is painful but will use macros to help
   # keep it from being too bad.
   # Binary Test Macro
-  
+
   add_sh_test(ncdap tst_ncdap3)
 
   IF(NOT MSVC)
@@ -50,17 +50,23 @@ IF(ENABLE_TESTS)
       add_sh_test(ncdap tst_longremote3)
     ENDIF()
     add_sh_test(ncdap testurl)
-    
+
     add_bin_test(ncdap test_nstride_cached)
     add_bin_test(ncdap t_misc)
-    
+
     IF(ENABLE_DAP_AUTH_TESTS)
-      add_bin_test(ncdap t_auth)
+##obsolete      add_bin_test(ncdap t_auth)
       add_sh_test(ncdap testauth)
     ENDIF()
-    
+
     add_bin_test(ncdap test_varm3)
-    
+
+    ###
+    # This test relates to NCF-330 in
+    # the Unidata JIRA system.
+    ###
+    #add_bin_test(ncdap t_ncf330)
+
   ENDIF()
 ENDIF()
 
diff --git a/ncdap_test/Makefile.am b/ncdap_test/Makefile.am
index be9b45f..b4e0a9f 100644
--- a/ncdap_test/Makefile.am
+++ b/ncdap_test/Makefile.am
@@ -6,12 +6,12 @@
 # Put together AM_CPPFLAGS and AM_LDFLAGS.
 include $(top_srcdir)/lib_flags.am
 
-LDADD = ${top_builddir}/liblib/libnetcdf.la 
+LDADD = ${top_builddir}/liblib/libnetcdf.la
 AM_CPPFLAGS += -I$(top_builddir)/liblib
 
 # Set up the tests; do the .sh first, then .c
-check_PROGRAMS = 
-TESTS = 
+check_PROGRAMS =
+TESTS =
 TESTS_ENVIRONMENT=TOPSRCDIR=${abs_top_srcdir}
 
 TESTS += tst_ncdap3.sh
@@ -20,7 +20,7 @@ t_dap3a_SOURCES = t_dap3a.c
 test_cvt3_SOURCES = test_cvt.c
 test_vara_SOURCES = test_vara.c
 
-check_PROGRAMS += t_dap3a test_cvt3 test_vara 
+check_PROGRAMS += t_dap3a test_cvt3 test_vara
 
 TESTS += t_dap3a test_cvt3 test_vara
 
@@ -45,8 +45,10 @@ test_nstride_cached_SOURCE = test_nstride_cached.c
 #t_auth1_SOURCES = t_auth1.c
 t_misc_SOURCES = t_misc.c
 test_varm3_SOURCES = test_varm3.c
+#t_ncf330_SOURCES = t_ncf330.c
 
 TESTS += test_varm3
+#TESTS += t_ncf330
 TESTS += test_nstride_cached
 TESTS += t_misc
 
@@ -54,6 +56,7 @@ check_PROGRAMS += test_partvar
 check_PROGRAMS += test_nstride_cached
 check_PROGRAMS += t_misc
 check_PROGRAMS += test_varm3
+check_PROGRAMS += t_ncf330
 
 if ENABLE_DAP_AUTH_TESTS
 #check_PROGRAMS += t_auth t_auth1
@@ -93,7 +96,8 @@ EXTRA_DIST = tst_ncdap3.sh tst_ncdap4.sh \
              tst_remote3.sh tst_remote4.sh \
              tst_longremote3.sh tst_longremote4.sh \
              tst_ncdap.sh tst_ncdap_shared.sh tst_remote.sh \
-	     t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh
+	     t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh \
+			t_ncf330.c
 
 CLEANFILES = test_varm3 test_cvt3 results/*.dmp results/*.das results/*.dds datadds* t_dap3a test_nstride_cached
 
diff --git a/ncdap_test/Makefile.in b/ncdap_test/Makefile.in
index fffbb7c..4629832 100644
--- a/ncdap_test/Makefile.in
+++ b/ncdap_test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,17 @@
 # libraries for netCDF-4.
 #
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -90,9 +100,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -109,9 +116,11 @@ TESTS = tst_ncdap3.sh t_dap3a$(EXEEXT) test_cvt3$(EXEEXT) \
 # Make nctestserver be the first test to be built
 @ENABLE_DAP_REMOTE_TESTS_TRUE at am__append_3 = nctestserver test_partvar \
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	test_nstride_cached t_misc \
- at ENABLE_DAP_REMOTE_TESTS_TRUE@	test_varm3
+ at ENABLE_DAP_REMOTE_TESTS_TRUE@	test_varm3 t_ncf330
 @ENABLE_DAP_REMOTE_TESTS_TRUE at am__append_4 = tst_remote3.sh tst_formatx.sh test_partvar testurl.sh
 @ENABLE_DAP_LONG_TESTS_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE at am__append_5 = tst_longremote3.sh
+#t_ncf330_SOURCES = t_ncf330.c
+#TESTS += t_ncf330
 @ENABLE_DAP_REMOTE_TESTS_TRUE at am__append_6 = test_varm3 \
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	test_nstride_cached t_misc
 
@@ -127,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -135,7 +145,8 @@ CONFIG_CLEAN_VPATH_FILES =
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	test_partvar$(EXEEXT) \
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	test_nstride_cached$(EXEEXT) \
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	t_misc$(EXEEXT) \
- at ENABLE_DAP_REMOTE_TESTS_TRUE@	test_varm3$(EXEEXT)
+ at ENABLE_DAP_REMOTE_TESTS_TRUE@	test_varm3$(EXEEXT) \
+ at ENABLE_DAP_REMOTE_TESTS_TRUE@	t_ncf330$(EXEEXT)
 am__nctestserver_SOURCES_DIST = nctestserver.c
 @ENABLE_DAP_REMOTE_TESTS_TRUE at am_nctestserver_OBJECTS =  \
 @ENABLE_DAP_REMOTE_TESTS_TRUE@	nctestserver.$(OBJEXT)
@@ -155,6 +166,10 @@ am__t_misc_SOURCES_DIST = t_misc.c
 t_misc_OBJECTS = $(am_t_misc_OBJECTS)
 t_misc_LDADD = $(LDADD)
 t_misc_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+t_ncf330_SOURCES = t_ncf330.c
+t_ncf330_OBJECTS = t_ncf330.$(OBJEXT)
+t_ncf330_LDADD = $(LDADD)
+t_ncf330_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
 am_test_cvt3_OBJECTS = test_cvt.$(OBJEXT)
 test_cvt3_OBJECTS = $(am_test_cvt3_OBJECTS)
 test_cvt3_LDADD = $(LDADD)
@@ -215,11 +230,11 @@ am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(nctestserver_SOURCES) $(t_dap3a_SOURCES) $(t_misc_SOURCES) \
-	$(test_cvt3_SOURCES) test_nstride_cached.c \
+	t_ncf330.c $(test_cvt3_SOURCES) test_nstride_cached.c \
 	$(test_partvar_SOURCES) $(test_vara_SOURCES) \
 	$(test_varm3_SOURCES)
 DIST_SOURCES = $(am__nctestserver_SOURCES_DIST) $(t_dap3a_SOURCES) \
-	$(am__t_misc_SOURCES_DIST) $(test_cvt3_SOURCES) \
+	$(am__t_misc_SOURCES_DIST) t_ncf330.c $(test_cvt3_SOURCES) \
 	test_nstride_cached.c $(am__test_partvar_SOURCES_DIST) \
 	$(test_vara_SOURCES) $(am__test_varm3_SOURCES_DIST)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
@@ -472,6 +487,8 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -546,6 +563,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -561,10 +579,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -599,8 +619,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -663,7 +685,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # Put together AM_CPPFLAGS and AM_LDFLAGS.
-LDADD = ${top_builddir}/liblib/libnetcdf.la 
+LDADD = ${top_builddir}/liblib/libnetcdf.la
 TESTS_ENVIRONMENT = TOPSRCDIR=${abs_top_srcdir}
 t_dap3a_SOURCES = t_dap3a.c
 test_cvt3_SOURCES = test_cvt.c
@@ -695,7 +717,8 @@ EXTRA_DIST = tst_ncdap3.sh tst_ncdap4.sh \
              tst_remote3.sh tst_remote4.sh \
              tst_longremote3.sh tst_longremote4.sh \
              tst_ncdap.sh tst_ncdap_shared.sh tst_remote.sh \
-	     t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh
+	     t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh \
+			t_ncf330.c
 
 CLEANFILES = test_varm3 test_cvt3 results/*.dmp results/*.das \
 	results/*.dds datadds* t_dap3a test_nstride_cached \
@@ -721,7 +744,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -730,7 +752,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -762,6 +784,10 @@ t_misc$(EXEEXT): $(t_misc_OBJECTS) $(t_misc_DEPENDENCIES) $(EXTRA_t_misc_DEPENDE
 	@rm -f t_misc$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(t_misc_OBJECTS) $(t_misc_LDADD) $(LIBS)
 
+t_ncf330$(EXEEXT): $(t_ncf330_OBJECTS) $(t_ncf330_DEPENDENCIES) $(EXTRA_t_ncf330_DEPENDENCIES) 
+	@rm -f t_ncf330$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(t_ncf330_OBJECTS) $(t_ncf330_LDADD) $(LIBS)
+
 test_cvt3$(EXEEXT): $(test_cvt3_OBJECTS) $(test_cvt3_DEPENDENCIES) $(EXTRA_test_cvt3_DEPENDENCIES) 
 	@rm -f test_cvt3$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(test_cvt3_OBJECTS) $(test_cvt3_LDADD) $(LIBS)
@@ -791,6 +817,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nctestserver.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/t_dap3a.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/t_misc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/t_ncf330.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_cvt.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_nstride_cached.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_partvar.Po at am__quote@
@@ -956,7 +983,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1362,6 +1389,8 @@ uninstall-am:
 	mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \
 	uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # This rule are used if someone wants to rebuild t_dap3a.c
 # Otherwise never invoked, but records how to do it.
diff --git a/ncdap_test/expected3/Makefile.in b/ncdap_test/expected3/Makefile.in
index b842cd6..8e10af1 100644
--- a/ncdap_test/expected3/Makefile.in
+++ b/ncdap_test/expected3/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.9 2009/11/20 03:06:32 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdap_test/expected3
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -117,6 +127,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -165,6 +176,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -180,10 +192,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -218,8 +232,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -327,7 +343,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/expected3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/expected3/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -502,6 +517,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdap_test/expected4/Makefile.in b/ncdap_test/expected4/Makefile.in
index db55aab..4484007 100644
--- a/ncdap_test/expected4/Makefile.in
+++ b/ncdap_test/expected4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,17 @@
 
 # This is to include the libnc-dap test comparison files
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -83,7 +93,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdap_test/expected4
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -91,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -115,6 +125,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -163,6 +174,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -178,10 +190,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -216,8 +230,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -325,7 +341,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/expected4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/expected4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -500,6 +515,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdap_test/expectremote3/Makefile.in b/ncdap_test/expectremote3/Makefile.in
index 7795ae9..d504641 100644
--- a/ncdap_test/expectremote3/Makefile.in
+++ b/ncdap_test/expectremote3/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.7 2009/11/22 06:17:54 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdap_test/expectremote3
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -117,6 +127,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -165,6 +176,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -180,10 +192,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -218,8 +232,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -321,7 +337,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/expectremote3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/expectremote3/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -496,6 +511,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdap_test/expectremote4/Makefile.in b/ncdap_test/expectremote4/Makefile.in
index 61103c6..37f37d5 100644
--- a/ncdap_test/expectremote4/Makefile.in
+++ b/ncdap_test/expectremote4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.7 2009/11/22 06:17:54 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdap_test/expectremote4
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -117,6 +127,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -165,6 +176,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -180,10 +192,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -218,8 +232,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -320,7 +336,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/expectremote4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/expectremote4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -495,6 +510,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdap_test/t_ncf330.c b/ncdap_test/t_ncf330.c
new file mode 100644
index 0000000..e557572
--- /dev/null
+++ b/ncdap_test/t_ncf330.c
@@ -0,0 +1,72 @@
+/*! Test program for netcdf issue NCF-330
+ *
+ * This test was provided by Ellen Johnson at Mathworks and
+ * illustrates an issue currently only seen on Windows.
+ *
+ * See https://bugtracking.unidata.ucar.edu/browse/NCF-330
+ */
+
+#include <netcdf.h>
+
+#ifdef _MSC_VER
+#include <malloc.h>
+#include <crtdbg.h>
+#endif
+
+static char* URL="http://data.nodc.noaa.gov/thredds/dodsC/testdata/pathfinderAgg/pathFinderV5.2_night.ncml";
+
+int
+main()
+{
+     int ncid;
+     int ncstatus;
+     int lat_id;
+     nc_type lat_type;
+     int lat_ndims;
+     int lat_dimids[NC_MAX_VAR_DIMS];
+     int lat_natts;
+     int format_p;
+     float lat_data[4320];
+
+#ifdef _MSC_VER
+	 /* See https://msdn.microsoft.com/en-us/library/5at7yxcs(v=vs.120).aspx
+	    for more information re: these. */
+	 //int tmpFlag = _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
+     printf(" \n");
+     printf("********************\n");
+     printf("open URL %s\n",URL);
+     printf(" \n");
+     ncstatus = nc_open(URL, NC_NOWRITE, &ncid);
+     if(ncstatus != NC_NOERR) {
+         printf("Could not open: %s; server may be down; test ignored\n",URL);
+         exit(0);
+     }
+     printf("status after open = %d\n", ncstatus);
+
+     // get the format
+     ncstatus = nc_inq_format(ncid, &format_p);
+     printf("lat id = %d\n", format_p);
+
+     // get varid for latitude
+     ncstatus = nc_inq_varid(ncid,"lat",&lat_id);
+     printf("status after inq lat id = %d\n", ncstatus);
+     printf("lat id = %d\n", lat_id);
+
+     ncstatus = nc_inq_var(ncid, lat_id, 0, &lat_type, &lat_ndims, lat_dimids, &lat_natts);
+     printf("status after inq lat var = %d\n", ncstatus);
+     printf("lat type = %d\n", lat_type);
+
+     // extract the first latitude value
+     ncstatus = nc_get_var_float(ncid, lat_id, &lat_data[0]);
+     printf("status after get = %d\n", ncstatus);
+     printf("my datum = %f\n", lat_data[0]);
+
+     // This code works okay in Linux and Mac
+     // Everything works okay up until here in Windows then an exception occurs
+     ncstatus = nc_close(ncid);
+     printf("status after close = %d\n", ncstatus);
+     printf("End of test.\n\n");
+
+     return 0;
+}
diff --git a/ncdap_test/testauth.old b/ncdap_test/testauth.old
new file mode 100755
index 0000000..c64d1e6
--- /dev/null
+++ b/ncdap_test/testauth.old
@@ -0,0 +1,213 @@
+#!/bin/sh
+
+#NOEMBED=1
+#NOLOCAL=1
+#NOHOME=1
+#NOENV=1
+
+#DBG=1
+#SHOW=1
+
+# Choose at most 1
+#GDB=1
+#VG=1
+
+NFL=1
+
+WD=`pwd`
+
+NETRCFILE=$WD/test_auth_netrc
+# This is the control variable
+NETRC=$NETRCFILE
+
+COOKIES="${WD}/test_auth_cookies"
+
+RC=.daprc
+
+NCLOGFILE=stderr
+if test "x$DBG" = x1 ; then
+SHOW=1
+fi
+
+# Major parameters
+
+BASICCOMBO="tiggeUser:tigge"
+URLSERVER="remotetest.unidata.ucar.edu"
+URLPATH="thredds/dodsC/restrict/testData.nc"
+
+# See if we need to override
+if test "x$URS" != "x" ; then
+#https://54.86.135.31/opendap/data/nc/fnoc1.nc.dds
+URLSERVER="54.86.135.31"
+URLPATH="opendap/data/nc/fnoc1.nc"
+BASICCOMBO="$URS"
+NOEMBED=1
+NETRC=$NETRCFILE
+else
+NETRC=
+fi
+
+if test "x$DBG" = x1 ; then
+URLPATH="${URLPATH}#log&show=fetch"
+fi
+
+# Split the combo
+BASICUSER=`echo $BASICCOMBO | cut -d: -f1`
+BASICPWD=`echo $BASICCOMBO | cut -d: -f2`
+
+NCDUMP=
+for o in ./.libs/ncdump.exe ./.libs/ncdump ./ncdump.exe ./ncdump ; do
+  if test -f $o ; then
+  NCDUMP=$o
+  break;
+  fi
+done
+if test "x$NCDUMP" = x ; then
+echo "no ncdump"
+exit 1
+fi
+
+if test "x$SHOW" = x ; then
+OUTPUT="> /dev/null"
+else
+OUTPUT=
+fi
+
+if test "x$TEMP" = x ; then
+  TEMP="/tmp"
+fi
+TEMP=`echo "$TEMP" | sed -e "s|/$||"`
+
+LOCALRC=./$RC
+HOMERC=${HOME}/$RC
+HOMERC=`echo "$HOMERC" | sed -e "s|//|/|g"`
+ENVRC="$TEMP/$RC"
+
+cd `pwd`
+builddir=`pwd`
+# Hack for CYGWIN
+cd $srcdir
+srcdir=`pwd`
+cd ${builddir}
+
+function createrc {
+if test "x$1" != x ; then
+RCP=$1
+
+rm -f $RCP
+echo "Creating rc file $RCP"
+if test "x${DBG}" != x ; then
+echo "HTTP.VERBOSE=1" >>$RCP
+fi	
+echo "HTTP.COOKIEJAR=${COOKIES}" >>$RCP
+if test "x${URS}" = x ; then
+echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
+fi
+if test "x${NETRC}" != x && test "x$NFL" = x ; then
+echo "HTTP.NETRC=${NETRC}" >>$RCP
+fi
+fi
+}
+
+function createnetrc {
+if test "x$1" != x ; then
+rm -f $1
+echo "Creating netrc file $1"
+echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$1
+#echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
+fi
+}
+
+# Forcibly remove all and do not restore with save
+function reset {
+    for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
+      rm -f ${f}
+    done      
+}
+
+# Restore from .save files
+function restore {
+  for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
+    rm -f ${f}
+    if test -f ${f}.save ; then
+      echo "restoring old ${f}"
+      cp ${f}.save ${f}
+    fi      
+  done      
+}
+
+function save {
+  for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
+    if test -f $f ; then
+      if test -f ${f}.save ; then
+        ignore=1
+      else
+        echo "saving $f"
+        cp ${f} ${f}.save
+      fi
+    fi      
+  done      
+}
+
+export LD_LIBRARY_PATH="../liblib/.libs:/usr/local/lib:/usr/lib64:$LD_LIBRARY_PATH"
+
+if test "x$GDB" = x1 ; then
+NCDUMP="gdb --args $NCDUMP"
+fi
+if test "x$VG" = x1 ; then
+NCDUMP="valgrind --leak-check=full $NCDUMP"
+fi
+
+# Initialize
+save
+reset
+
+if test "x$NOEMBED" != x1 ; then
+echo "***Testing rc file with embedded user:pwd"
+URL="https://${BASICCOMBO}@${URLSERVER}/$URLPATH"
+# Invoke ncdump to extract a file from the URL
+echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
+${NCDUMP} -h "$URL" ${OUTPUT}
+fi
+
+URL="https://${URLSERVER}/$URLPATH"
+if test "x$NOLOCAL" != x1 ; then
+echo "***Testing rc file in local directory"
+# Create the rc file and (optional) netrc file in ./
+reset
+createnetrc $NETRC
+createrc $LOCALRC
+
+# Invoke ncdump to extract a file the URL
+echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
+${NCDUMP} -h "$URL" ${OUTPUT}
+fi
+
+if test "x$NOHOME" != x1 ; then
+echo "***Testing rc file in home directory"
+# Create the rc file and (optional) netrc fil in ./
+reset
+createnetrc $NETRC
+createrc $HOMERC
+
+# Invoke ncdump to extract a file the URL
+echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
+${NCDUMP} -h "$URL" ${OUTPUT}
+fi
+
+if test "x$NOENV" != x1 ; then
+echo "*** Testing rc file from env variable"
+# Create the rc file and (optional) netrc file
+reset
+createnetrc $NETRC
+export NCRCFILE=$ENVRC
+createrc $NCRCFILE
+
+# Invoke ncdump to extract a file the URL
+echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
+${NCDUMP} -h "$URL" ${OUTPUT} 
+fi
+
+set +x
+#restore
+
diff --git a/ncdap_test/testauth.sh b/ncdap_test/testauth.sh
index afee4e0..224de42 100755
--- a/ncdap_test/testauth.sh
+++ b/ncdap_test/testauth.sh
@@ -1,55 +1,46 @@
 #!/bin/sh
-#set -x
 
-#NOEMBED=1
-#NOLOCAL=1
-#NOHOME=1
+RCEMBED=1
+RCLOCAL=1
+RCHOME=1
+RCENV=1
+RCPREC=1
 
-SHOW=1
+# Not currently testable in netcdf
+#RCSPEC=1
+
+#SHOW=1
 #DBG=1
+
+# Choose at most 1
 #GDB=1
+#VG=1
 
-CMP=1
+NFL=1
 
 WD=`pwd`
 
-# if this is part of a distcheck action, then this script
-# will be executed in a different directory
-# than the one containing it; so capture the path to this script
-# as the location of the source directory.
+NETRCFILE=$WD/test_auth_netrc
+# This is the control variable; set when needed
+unset NETRC
 
-# capture the build directory
-builddir=`pwd`/..
-if test "x$TOPSRCDIR" != x ; then
-srcdir="$TOPSRCDIR/ncdap_test"
-else
-srcdir=`dirname $0`
-fi
-# canonical
-cd $srcdir
-srcdir=`pwd`
+COOKIES="${WD}/test_auth_cookies"
 
-# Hack for CYGWIN
-if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
-    srcdir=`echo $srcdir | sed 's/\/c\//c:\//g'`
-    builddir=`echo $builddir | sed 's/\/c\//c:\//g'`
-fi
-cd ${builddir}/ncdap_test
+RC=.daprc
 
-NETRCFILE=$WD/test_auth_netrc
-# This is the control variable
-NETRC=$NETRCFILE
-COOKIES="${WD}/test_auth_cookies"
-RC=.ocrc
-EXPECT=$srcdir/expected3/testData.nc.dmp
 OCLOGFILE=stderr
-
+if test "x$DBG" = x1 ; then
+SHOW=1
+fi
 
 # Major parameters
 
 BASICCOMBO="tiggeUser:tigge"
+BADCOMBO="tiggeUser:xxxxx"
 URLSERVER="remotetest.unidata.ucar.edu"
+#http://remotetest.unidata.ucar.edu/thredds/dodsC/restrict/testData.nc.html
 URLPATH="thredds/dodsC/restrict/testData.nc"
+PROTO=http
 
 # See if we need to override
 if test "x$URS" != "x" ; then
@@ -57,141 +48,280 @@ if test "x$URS" != "x" ; then
 URLSERVER="54.86.135.31"
 URLPATH="opendap/data/nc/fnoc1.nc"
 BASICCOMBO="$URS"
-NOEMBED=1
+RCEMBED=0
 NETRC=$NETRCFILE
-CMP=
-else
-NETRC=
+PROTO=https
 fi
 
-if test "x$CMP" = x1 ; then SHOW= ; else SHOW=1; fi
-if test "x$DBG" = x1 ; then SHOW=1; fi
+if test "x$DBG" = x1 ; then
+URLPATH="${URLPATH}#log&show=fetch"
+fi
 
 # Split the combo
 BASICUSER=`echo $BASICCOMBO | cut -d: -f1`
 BASICPWD=`echo $BASICCOMBO | cut -d: -f2`
 
-NCDUMP=$builddir/ncdump/ncdump
+xf() { case $- in *[x]*) set +x; XP=1;; *) XP=0;; esac }
+xo() { case $XP in 1) set -x;; *) set +x;; esac }
+
+xf
+NCDUMP=
+for d in "$WD/../ncdump" "$WD" ; do
+  for o in $d/.libs/ncdump.exe $d/.libs/ncdump $d/ncdump.exe $d/ncdump ; do
+    if test -f $o ; then
+    NCDUMP=$o
+    break;
+    fi
+  done
+  if test "x$NCDUMP" != x; then break; fi
+done
+xo
+
+if test "x$NCDUMP" = x ; then
+echo "no ncdump"
+exit 1
+else
+echo "NCDUMP=$NCDUMP"
+fi
+
+OUTPUT="./.output"
+
+if test "x$TEMP" = x ; then
+  TEMP="/tmp"
+fi
+TEMP=`echo "$TEMP" | sed -e "s|/$||"`
 
 LOCALRC=./$RC
 HOMERC=${HOME}/$RC
 HOMERC=`echo "$HOMERC" | sed -e "s|//|/|g"`
-SPECRC=$TEMP
-if test "x$TEMP" = x ; then
-  SPECRC="/tmp"
-fi
-SPECRC="$SPECRC/temprc"
+SPECRC="$TEMP/temprc"
+ENVRC="$WD/envrc"
 
-function createrc {
-  if test "x$1" = x ; then
-    echo "createrc: no rc file specified"
+cd `pwd`
+builddir=`pwd`
+# Hack for CYGWIN
+cd $srcdir
+srcdir=`pwd`
+cd ${builddir}
+
+createrc() {
+  xf
+  RCP="$1" ; shift
+  unset NOPWD
+  unset BADPWD
+  while [[ $# > 0 ]] ; do
+    case "$1" in
+    nopwd) NOPWD=1 ;;
+    badpwd) BADPWD=1 ;;
+    *) ;;
+    esac
+    shift
+  done
+  xo
+  if test "x$RCP" != x ; then
+    rm -f $RCP
+    echo "Creating rc file $RCP"
   else
-  rm -f $1
-  RCP=$1
-  NRC=$2
-  echo "Creating rc file $RCP"
+    echo "createrc: no rc specified"
+    exit 1
+  fi
   if test "x${DBG}" != x ; then
     echo "HTTP.VERBOSE=1" >>$RCP
   fi	
   echo "HTTP.COOKIEJAR=${COOKIES}" >>$RCP
   if test "x${URS}" = x ; then
-    echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
-  fi
-  if test "x${NRC}" != x ; then
-    echo "HTTP.NETRC=${NRC}" >>$RCP
+    if test "x${NOPWD}" = x ; then
+      if test "x${BADPWD}" = x ; then
+        echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
+      else
+        echo "HTTP.CREDENTIALS.USERPASSWORD=${BADCOMBO}" >>$RCP
+      fi
+    fi
   fi
+  if test "x${NETRC}" != x && test "x$NFL" = x ; then
+    echo "HTTP.NETRC=${NETRC}" >>$RCP
   fi
 }
 
-function createnetrc {
-  if test "x$1" != x ; then
-    rm -f $1
-    echo "Creating netrc file $1"
-    echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$1
-#   echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
+createnetrc() {
+  xf
+  NCP="$1" ; shift
+  unset NOPWD
+  unset BADPWD
+  while [[ $# > 0 ]] ; do
+    case "$1" in
+    nopwd) NOPWD=1 ;;
+    badpwd) BADPWD=1 ;;
+    *) ;;
+    esac
+    shift
+  done
+  xo
+  if test "x$NCP" != x ; then
+    rm -f $NCP
+    echo "Creating netrc file $NCP"
+  else
+    echo "createnetrc: no rc specified"
+    exit 1
+  fi
+  if test "x$URS" != x ; then
+    echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$NCP
+    #echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
+  else
+    echo -n "${PROTO}://$URLSERVER/$URLPATH" >>$NCP
+    if test "x$NOPWD" = x ; then
+      if test "x$BADPWD" = x ; then
+        echo -n " login $BASICUSER password $BASICPWD" >>$NCP
+      else
+        echo -n " login $BASICUSER password xxxxxx" >>$NCP
+      fi
+    fi
+    echo "" >>$NCP
   fi
 }
 
-function reset {
-  for f in ./$RC $HOME/$RC $SPECRC $COOKIES $NETRC ; do
-    if test "x$DBG" = x1 ; then echo "Deleting $f"; fi
+reset() {
+  for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC $OUTPUT ; do
     rm -f ${f}
+  done      
+  unset DAPRCFILE
+}
+
+restore() {
+  reset
+  for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC ; do
     if test -f ${f}.save ; then
-        if test "x$DBG" = x1 ; then echo "restoring old ${f}" ; fi
+      echo "restoring old ${f}"
       cp ${f}.save ${f}
     fi      
   done      
-  # unconditional
-  rm -f ./tmp
 }
 
-function save {
-  for f in ./$RC $HOME/$RC $SPECRC $COOKIES $NETRC ; do
+save() {
+  for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC ; do
     if test -f $f ; then
       if test -f ${f}.save ; then
         ignore=1
       else
-        if test "x$DBG" = x1 ; then echo "saving $f"; fi
+        echo "saving $f"
         cp ${f} ${f}.save
       fi
     fi      
   done      
 }
 
-function compare {
-  if test "x$CMP" = x1 ; then
-    if diff -w ./tmp $EXPECT ; then
-      echo "***Pass"
-    else
-      echo "***FAIL"
-      pass=1
-    fi
-  fi
+show() {
+  if test "x$SHOW" = x1 ; then cat $OUTPUT; fi
+  if test "x$OUTPUT" != "x"; then rm -f $OUTPUT; fi
 }
 
-# Invoke ncdump to extract the URL
-function doit {
-  reset
-  createnetrc $2
-  createrc $1 $2
-  echo "command: ${NCDUMP} -h $URL"
-  ${NCDUMP} -h "$URL" >./tmp
-  if test "x$CMP" = x1 ; then compare ; fi
-  if test "x${SHOW}" = x1 ; then cat ./tmp ; fi
-}
-
-pass=0
-
 # Assemble the ncdump command
+if test "x$DBG" = x1; then
+NCDUMP="$NCDUMP -D1"
+fi
+
 if test "x$GDB" = x1 ; then
   NCDUMP="gdb --args $NCDUMP"
 fi
+if test "x$VG" = x1 ; then
+NCDUMP="valgrind --leak-check=full $NCDUMP"
+fi
 
 # Initialize
+xf
 save
 reset
+xo
 
-if test "x$NOEMBED" != x1 ; then
-echo "***Testing rc file with embedded user:pwd"
-URL="https://${BASICCOMBO}@${URLSERVER}/$URLPATH"
-# Invoke ncdump to extract the URL
-doit
+if test "x$RCEMBED" = x1 ; then
+  echo "***Testing rc file with embedded user:pwd"
+  URL="${PROTO}://${BASICCOMBO}@${URLSERVER}/$URLPATH"
+  unset NETRC
+  # Invoke ncdump to extract a file the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
 fi
 
-URL="https://${URLSERVER}/$URLPATH"
-if test "x$NOLOCAL" != x1 ; then
-  URL="https://${URLSERVER}/$URLPATH"
+# Rest of tests assume these defaults
+URL="${PROTO}://${URLSERVER}/$URLPATH"
+NETRC=$NETRCFILE
+
+if test "x$RCLOCAL" = x1 ; then
   echo "***Testing rc file in local directory"
-  doit $LOCALRC $NETRC
+  # Create the rc file and (optional) netrc fil in ./
+  xf; reset; xo
+  createnetrc $NETRC
+  createrc $LOCALRC
+
+  # Invoke ncdump to extract a file using the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
 fi
 
-if test "x$NOHOME" != x1 ; then
-  URL="https://${URLSERVER}/$URLPATH"
+if test "x$RCHOME" = x1 ; then
   echo "***Testing rc file in home directory"
-  doit $HOMERC $NETRC
+  # Create the rc file and (optional) netrc file in ./
+  xf; reset; xo
+  createnetrc $NETRC
+  createrc $HOMERC
+
+  # Invoke ncdump to extract a file the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
+fi
+
+if test "x$RCSPEC" == x1 ; then
+  echo "*** Testing rc file in specified directory"
+  # Create the rc file and (optional) netrc file
+  xf; reset; xo
+  createnetrc $NETRC
+  createrc $SPECRC
+
+  # Invoke ncdump to extract a file the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
 fi
 
-#cleanup
+if test "x$RCENV" = x1 ; then
+  echo "*** Testing rc file using env variable"
+  # Create the rc file and (optional) netrc file
+  xf; reset; xo
+  createnetrc $NETRC
+  echo "ENV: export DAPRCFILE=$ENVRC"
+  export DAPRCFILE=$ENVRC
+  createrc $DAPRCFILE
+
+  # Invoke ncdump to extract a file the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
+  export DAPRCFILE=
+fi
+
+# Test that .daprc overrides netcrc for password
+URL="${PROTO}://${URLSERVER}/$URLPATH"
+NETRC=$NETRCFILE
+if test "x$RCPREC" = x1 ; then
+  echo "***Testing rc vs netrc file precedence"
+  # Create the rc file and (optional) netrc file in ./
+  xf; reset; xo
+  createnetrc $NETRC badpwd
+  createrc $LOCALRC
+
+  # Invoke ncdump to extract a file using the URL
+  echo "command: ${NCDUMP} -h $URL > $OUTPUT"
+  ${NCDUMP} -h "$URL" > $OUTPUT
+  show
+fi
+
+xf
 reset
+restore
+xo
+
+exit
 
-exit $pass
diff --git a/ncdap_test/testauth.sh b/ncdap_test/testauth.sh.old
similarity index 100%
copy from ncdap_test/testauth.sh
copy to ncdap_test/testauth.sh.old
diff --git a/ncdap_test/testdata3/Makefile.in b/ncdap_test/testdata3/Makefile.in
index ae10f09..83ac591 100644
--- a/ncdap_test/testdata3/Makefile.in
+++ b/ncdap_test/testdata3/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.7 2009/05/30 21:28:53 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdap_test/testdata3
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -117,6 +127,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -165,6 +176,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -180,10 +192,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -218,8 +232,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -387,7 +403,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdap_test/testdata3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdap_test/testdata3/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -562,6 +577,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdap_test/tst_ncdap.sh b/ncdap_test/tst_ncdap.sh
index 7669db5..42ba0e7 100755
--- a/ncdap_test/tst_ncdap.sh
+++ b/ncdap_test/tst_ncdap.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+set -e
 #set -x
 quiet=0
 leakcheck=0
diff --git a/ncdap_test/tst_ncdap3.sh b/ncdap_test/tst_ncdap3.sh
index b73bee1..3b0f3b1 100755
--- a/ncdap_test/tst_ncdap3.sh
+++ b/ncdap_test/tst_ncdap3.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 #X="-x"
 #grind="checkleaks"
 
diff --git a/ncdap_test/tst_ncdap4.sh b/ncdap_test/tst_ncdap4.sh
index 76cfe58..c421e3a 100755
--- a/ncdap_test/tst_ncdap4.sh
+++ b/ncdap_test/tst_ncdap4.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 #X="-x"
 #grind="checkleaks"
 
diff --git a/ncdap_test/tst_nocache3.sh b/ncdap_test/tst_nocache3.sh
index fddda97..238edeb 100755
--- a/ncdap_test/tst_nocache3.sh
+++ b/ncdap_test/tst_nocache3.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
diff --git a/ncdap_test/tst_nocache4.sh b/ncdap_test/tst_nocache4.sh
index 8f80ef8..6d02f0f 100755
--- a/ncdap_test/tst_nocache4.sh
+++ b/ncdap_test/tst_nocache4.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
diff --git a/ncdap_test/tst_remote.sh b/ncdap_test/tst_remote.sh
index 1840626..7034bf6 100755
--- a/ncdap_test/tst_remote.sh
+++ b/ncdap_test/tst_remote.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-#set -x
+set -e
+
 quiet=0
 leakcheck=0
 timing=0
@@ -244,7 +245,7 @@ for i in $WHICHTESTS ; do
   *) echo "Unknown which test: $i" ;;
   esac
 
-rm -f ./.dodsrc ./.ocrc
+rm -f ./.dodsrc ./.ocrc ./.daprc
 cd ${RESULTSDIR}
 
 for t in ${TESTSET} ; do
@@ -252,24 +253,20 @@ for t in ${TESTSET} ; do
   #index=`expr index "${t}" ";"`
   
   #echo index: $index
-  
   if [ "$myplatform" = "Darwin" ]; then
-      index=`echo "${t}" | sed -n "s/;.*//p" | wc -c`    
+      index=`echo "${t}" | sed -n "s/;.*//p" | wc -c` 
       if (( $index == 0 )) ; then
 	  constrained=0
       else
 	  constrained=1
       fi
-
   else
-      index=`expr index "${t}" ";"`
-
+      if index=`expr index "${t}" ";"` ; then ignore=1; fi # avoid set -e
       if test "x$index" = "x0" ; then
 	  constrained=0
       else
 	  constrained=1
       fi
-
   fi
 
   if test "x$constrained" = "x0" ; then # No constraint
diff --git a/ncdap_test/tst_remote3.sh b/ncdap_test/tst_remote3.sh
index 10620ad..2ad2693 100755
--- a/ncdap_test/tst_remote3.sh
+++ b/ncdap_test/tst_remote3.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
@@ -17,5 +19,5 @@ if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
 fi
 cd ${builddir}/ncdap_test
 
-sh ${srcdir}/tst_remote.sh "$srcdir" "$builddir" "3" "" ""
+sh  ${srcdir}/tst_remote.sh "$srcdir" "$builddir" "3" "" ""
 exit
diff --git a/ncdap_test/tst_remote4.sh b/ncdap_test/tst_remote4.sh
index ec8d97e..6aba70b 100755
--- a/ncdap_test/tst_remote4.sh
+++ b/ncdap_test/tst_remote4.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
diff --git a/ncdap_test/tst_special.sh b/ncdap_test/tst_special.sh
index aa6f894..0bd59e7 100755
--- a/ncdap_test/tst_special.sh
+++ b/ncdap_test/tst_special.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
diff --git a/ncdap_test/tst_tds.sh b/ncdap_test/tst_tds.sh
index b81a253..f83dc21 100755
--- a/ncdap_test/tst_tds.sh
+++ b/ncdap_test/tst_tds.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 # if this is part of a distcheck action, then this script
 # will be executed in a different directory
 # than the one containing it; so capture the path to this script
diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt
index 8ce434f..3038e28 100644
--- a/ncdump/CMakeLists.txt
+++ b/ncdump/CMakeLists.txt
@@ -3,7 +3,6 @@ IF(BUILD_SHARED_LIBS AND WIN32)
   remove_definitions(-DDLL_NETCDF)
 ENDIF()
 
-#IF(EXTRA_TESTS)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ctest.c
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest.c"
@@ -14,7 +13,6 @@ ADD_CUSTOM_COMMAND(
   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest64.c"
   "${CMAKE_CURRENT_SOURCE_DIR}/ctest64.c"
   )
-#ENDIF()
 
 SET(ncdump_FILES ncdump.c vardata.c dumplib.c indent.c nctime0.c utils.c nciter.c)
 SET(nccopy_FILES nccopy.c nciter.c chunkspec.c utils.c dimmap.c)
@@ -93,13 +91,23 @@ ENDIF()
   add_sh_test(ncdump tst_nccopy3)
   add_sh_test(ncdump tst_charfill)
 
-IF(NOT MSVC)
-  add_sh_test(ncdump tst_iter)
-ENDIF()
+
 
   add_sh_test(ncdump tst_formatx3)
   add_sh_test(ncdump tst_bom)
 
+  # The following test script invokes
+  # gcc directly.
+  IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
+    IF(ENABLE_LARGE_FILE_TESTS)
+      add_sh_test(ncdump tst_iter)
+    ENDIF(ENABLE_LARGE_FILE_TESTS)
+  ENDIF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
+
+  IF(BUILD_DISKLESS)
+    add_sh_test(ncdump tst_inmemory)
+  ENDIF()
+
   ###
   # This test fails on Visual Studio builds with bash.
   # It passes, but technically fails because the scientific
@@ -122,41 +130,32 @@ ENDIF()
     add_bin_test(ncdump tst_h_scalar)
     add_bin_test(ncdump tst_bug324)
     add_sh_test(ncdump tst_formatx4)
-    #add_bin_test(ncdump tst_special_atts)
     # Add this test by hand, as it is also called from a script.
     # Editing the script would break autotools compatibility.
-    set(MANUAL_TESTS tst_special_atts tst_compress tst_chunking)
-    FOREACH (MTEST ${MANUAL_TESTS})
-      ADD_EXECUTABLE(${MTEST} ${MTEST}.c)
-      TARGET_LINK_LIBRARIES(${MTEST} netcdf)
-      IF(MSVC)
-	SET_TARGET_PROPERTIES(${MTEST}
-	  PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
-	  )
-      ENDIF()
-      #ADD_TEST(${MTEST} ${EXECUTABLE_OUTPUT_PATH}/${MTEST})
-    ENDFOREACH()
-
-    IF(NOT WIN32)
-      # tst_netcdf4 depends on the output from other scripts
-      # that don't currently run. So for time being, leave
-      # it disabled.
-
-      #add_sh_test(ncdump tst_netcdf4)
-      #add_bin_test(ncdump tst_h_rdc0)
-    ENDIF()
+    add_bin_test_no_prefix(tst_special_atts)
+    add_bin_test_no_prefix(tst_compress)
+    add_bin_test_no_prefix(tst_chunking)
+
+    # Known failure on MSVC; the number of 0's padding
+    # is different, but the result is actually correct.
+    #IF(NOT MSVC)
+      add_sh_test(ncdump tst_netcdf4)
+      add_bin_test(ncdump tst_h_rdc0)
+    #ENDIF()
+
     add_bin_test(ncdump tst_unicode)
-    if(NOT MSVC)
-      #add_bin_test(ncdump tst_fillbug)
-      #add_sh_test(ncdump tst_fillbug)
-    ENDIF()
+
+    add_bin_test(ncdump tst_fillbug)
+    add_sh_test(ncdump_sh tst_fillbug)
+
     IF(NOT MSVC)
       add_sh_test(ncdump tst_netcdf4_4)
     ENDIF()
 
     IF(NOT MSVC)
-      #add_sh_test(ncdump tst_nccopy4)
+      add_sh_test(ncdump tst_nccopy4)
     ENDIF()
+
     add_sh_test(ncdump tst_grp_spec)
     add_sh_test(ncdump tst_mud)
     add_sh_test(ncdump_shell tst_h_scalar)
@@ -193,13 +192,6 @@ FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSION
 ADD_SUBDIRECTORY(cdl)
 ADD_SUBDIRECTORY(expected)
 
-## Specify files to be distributed by 'make dist'
-FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
-SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} test0.cdl ref_ctest1_nc4.cdl ref_ctest1_nc4c.cdl ref_tst_solar_1.cdl ref_tst_solar_2.cdl ref_tst_small.cdl tst_ncml.cdl ref1.ncml ref_tst_group_data.cdl ref_tst_enum_data.cdl ref_tst_opaque_data.cdl ref_tst_string_data.cdl ref_tst_vlen_data.cdl ref_tst_comp.cdl ref_tst_unicode.cdl ref_tst_nans.cdl small.cdl small2.cdl ref_tst_utf8.cdl ref_tst_fillbug.cdl tst_calendars.cdl ref_times.cdl ref_tst_special_atts.cdl ref_tst_noncoord.cdl ref_tst_compounds2.n [...]
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
-
-SET(CLEANFILES test0.nc test1.cdl test1.nc test2.cdl ctest1.cdl ctest.c ctest64.c ctest0.nc  ctest0_64.nc c1.cdl c1_4.cdl ctest1_64.cdl c0.nc c0_4.nc small.nc small2.nc c0tmp.nc c1.ncml utf8.cdl utf8_64.cdl utf8.nc utf8_64.nc tmp.cdl tst_vlen_data.nc tst_utf8.nc tst_special_atts.nc tst_unicode.nc tst_solar_2.nc tst_string_data.nc tst_calendars.nc tst_nans.nc tst_opaque_data.nc tst_solar_cmp.nc tst_enum_data.nc tst_solar_1.nc tst_mslp_64.nc tst_mslp.nc tst_bug321.nc tst_comp2.nc tst_ncml. [...]
-
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
 
 IF(NOT MSVC)
diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am
index 7bfc670..395e840 100644
--- a/ncdump/Makefile.am
+++ b/ncdump/Makefile.am
@@ -37,6 +37,10 @@ if LARGE_FILE_TESTS
 TESTS += tst_iter.sh
 endif
 
+if BUILD_DISKLESS
+TESTS += tst_inmemory.sh
+endif
+
 if USE_NETCDF4
 # NetCDF-4 has some extra tests.
 check_PROGRAMS += tst_create_files tst_h_rdc0 tst_group_data		\
@@ -128,7 +132,7 @@ tst_iter.sh tst_mud.sh ref_tst_mud4.cdl ref_tst_mud4-bc.cdl             \
 ref_tst_mud4_chars.cdl \
 ref_tst_ncf213.cdl tst_h_scalar.sh                                      \
 tst_formatx3.sh tst_formatx4.sh                                         \
-CMakeLists.txt XGetopt.c tst_bom.sh
+CMakeLists.txt XGetopt.c tst_bom.sh tst_inmemory.sh
 
 # CDL files and Expected results
 SUBDIRS=cdl expected
diff --git a/ncdump/Makefile.in b/ncdump/Makefile.in
index 3d6818a..1a3b5dd 100644
--- a/ncdump/Makefile.in
+++ b/ncdump/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -92,9 +102,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -110,26 +117,27 @@ bin_PROGRAMS = ncdump$(EXEEXT) nccopy$(EXEEXT)
 @BUILD_TESTSETS_TRUE@	tst_utf8$(EXEEXT) run_utf8_tests.sh \
 @BUILD_TESTSETS_TRUE@	tst_nccopy3.sh tst_charfill.sh \
 @BUILD_TESTSETS_TRUE@	tst_iter.sh tst_formatx3.sh tst_bom.sh \
- at BUILD_TESTSETS_TRUE@	$(am__append_3) $(am__EXEEXT_2) \
- at BUILD_TESTSETS_TRUE@	$(am__append_6) tst_ncgen4_classic.sh \
- at BUILD_TESTSETS_TRUE@	$(am__append_7)
+ at BUILD_TESTSETS_TRUE@	$(am__append_3) $(am__append_4) \
+ at BUILD_TESTSETS_TRUE@	$(am__EXEEXT_2) $(am__append_7) \
+ at BUILD_TESTSETS_TRUE@	tst_ncgen4_classic.sh $(am__append_8)
 @BUILD_TESTSETS_TRUE@@LARGE_FILE_TESTS_TRUE at am__append_3 = tst_iter.sh
+ at BUILD_DISKLESS_TRUE@@BUILD_TESTSETS_TRUE at am__append_4 = tst_inmemory.sh
 
 # NetCDF-4 has some extra tests.
- at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_4 = tst_create_files tst_h_rdc0 tst_group_data		\
+ at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_5 = tst_create_files tst_h_rdc0 tst_group_data		\
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_enum_data tst_opaque_data tst_string_data tst_vlen_data tst_comp	\
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_comp2 tst_nans tst_special_atts tst_unicode tst_fillbug tst_compress \
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_chunking tst_h_scalar tst_bug324
 
- at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_5 = tst_create_files tst_group_data tst_enum_data tst_opaque_data	\
+ at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_6 = tst_create_files tst_group_data tst_enum_data tst_opaque_data	\
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_string_data tst_vlen_data tst_comp tst_comp2 tst_nans		\
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_special_atts tst_netcdf4.sh tst_h_rdc0 tst_unicode tst_fillbug	\
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_fillbug.sh tst_netcdf4_4.sh tst_compress tst_nccopy4.sh             \
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_grp_spec.sh tst_mud.sh tst_h_scalar tst_h_scalar.sh tst_formatx4.sh \
 @BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at tst_bug324
 
- at BUILD_TESTSETS_TRUE@@EXTRA_TESTS_TRUE@@USE_NETCDF4_TRUE at am__append_6 = run_back_comp_tests.sh
- at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_7 = tst_ncgen4.sh
+ at BUILD_TESTSETS_TRUE@@EXTRA_TESTS_TRUE@@USE_NETCDF4_TRUE at am__append_7 = run_back_comp_tests.sh
+ at BUILD_TESTSETS_TRUE@@USE_NETCDF4_TRUE at am__append_8 = tst_ncgen4.sh
 subdir = ncdump
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -138,6 +146,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -581,6 +590,8 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -654,6 +665,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -669,10 +681,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -707,8 +721,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -839,9 +855,9 @@ EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \
 	ref_tst_mud4.cdl ref_tst_mud4-bc.cdl ref_tst_mud4_chars.cdl \
 	ref_tst_ncf213.cdl tst_h_scalar.sh tst_formatx3.sh \
 	tst_formatx4.sh CMakeLists.txt XGetopt.c tst_bom.sh \
-	tst_ncgen_shared.sh tst_ncgen4.sh tst_ncgen4_classic.sh \
-	tst_ncgen4_diff.sh tst_ncgen4_cycle.sh ref_ctest.c \
-	ref_ctest64.c ctest.c ctest64.c
+	tst_inmemory.sh tst_ncgen_shared.sh tst_ncgen4.sh \
+	tst_ncgen4_classic.sh tst_ncgen4_diff.sh tst_ncgen4_cycle.sh \
+	ref_ctest.c ref_ctest64.c ctest.c ctest64.c
 
 # CDL files and Expected results
 SUBDIRS = cdl expected
@@ -863,7 +879,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdump/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdump/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -872,7 +887,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1292,7 +1307,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1501,6 +1516,13 @@ tst_bom.sh.log: tst_bom.sh
 	--log-file $$b.log --trs-file $$b.trs \
 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
 	"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_inmemory.sh.log: tst_inmemory.sh
+	@p='tst_inmemory.sh'; \
+	b='tst_inmemory.sh'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 tst_create_files.log: tst_create_files$(EXEEXT)
 	@p='tst_create_files$(EXEEXT)'; \
 	b='tst_create_files'; \
@@ -1901,6 +1923,8 @@ uninstall-man: uninstall-man1
 	uninstall uninstall-am uninstall-binPROGRAMS uninstall-man \
 	uninstall-man1
 
+.PRECIOUS: Makefile
+
 @BUILD_TESTSETS_TRUE@@EXTRA_TESTS_TRUE at ctest.c:
 @BUILD_TESTSETS_TRUE@@EXTRA_TESTS_TRUE@	$(top_builddir)/ncgen/ncgen -lc -o ctest0.nc $(top_srcdir)/ncgen/c0.cdl >$(srcdir)/ctest.c
 
diff --git a/ncdump/cdl/Makefile.in b/ncdump/cdl/Makefile.in
index 0d54de9..12f7774 100644
--- a/ncdump/cdl/Makefile.in
+++ b/ncdump/cdl/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,17 @@
 
 # $Id: Makefile.am,v 1.5 2010/04/27 18:50:44 dmh Exp $
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -85,7 +95,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdump/cdl
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -117,6 +127,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -165,6 +176,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -180,10 +192,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -218,8 +232,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -317,7 +333,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdump/cdl/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdump/cdl/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -492,6 +507,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/ncdump/expected/Makefile.in b/ncdump/expected/Makefile.in
index cb76722..9d2f949 100644
--- a/ncdump/expected/Makefile.in
+++ b/ncdump/expected/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,17 @@
 
 # This is to include the test comparison files
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -83,7 +93,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = ncdump/expected
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -91,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -115,6 +125,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -163,6 +174,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -178,10 +190,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -216,8 +230,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -313,7 +329,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncdump/expected/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncdump/expected/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -488,6 +503,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # These do not exist because they are not run as usual tests
 # bigf1.dmp bigf2.dmp bigf3.dmp bigr1.dmp bigr2.dmp bigr3.dmp gfs1.dmp
diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c
index 5a089ad..b0eab18 100644
--- a/ncdump/ncdump.c
+++ b/ncdump/ncdump.c
@@ -8,9 +8,15 @@ Research/Unidata. See \ref copyright file for more info.  */
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
-#ifndef _WIN32
+#ifdef _MSC_VER /* Microsoft Compilers */
+#include <io.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
 
 #ifdef _MSC_VER
 #define snprintf _snprintf
@@ -19,6 +25,10 @@ int opterr;
 int optind;
 #endif
 
+#ifndef HAVE_SSIZE_T
+typedef int ssize_t;
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
@@ -28,6 +38,7 @@ int optind;
 #include <locale.h>
 #endif	/* HAVE_LOCALE_H */
 #include <netcdf.h>
+#include <netcdf_mem.h>
 #include "utils.h"
 #include "nccomps.h"
 #include "nctime0.h"		/* new iso time and calendar stuff */
@@ -38,6 +49,7 @@ int optind;
 #include "isnan.h"
 #include "cdl.h"
 
+
 #define int64_t long long
 #define uint64_t unsigned long long
 
@@ -277,6 +289,72 @@ kind_string_extended(int kind, int mode)
     return text;
 }
 
+#ifdef USE_DISKLESS
+static int
+fileopen(const char* path, void** memp, size_t* sizep)
+{
+    int status = NC_NOERR;
+    int fd = -1;
+    int oflags = 0;
+    size_t size = 0;
+    void* mem = NULL;
+    off_t red = 0;
+    char* pos = NULL;
+
+    /* Open the file, but make sure we can write it if needed */
+    oflags = O_RDONLY;
+#ifdef O_BINARY
+    oflags |= O_BINARY;
+#endif
+    oflags |= O_EXCL;
+#ifdef vms
+    fd = open(path, oflags, 0, "ctx=stm");
+#else
+    fd  = open(path, oflags);
+#endif
+    if(fd < 0) {
+	status = errno;
+	goto done;
+    }
+    /* get current filesize  = max(|file|,initialize)*/
+    size = lseek(fd,0,SEEK_END);
+    if(size < 0) {status = errno; goto done;}
+    /* move pointer back to beginning of file */
+    (void)lseek(fd,0,SEEK_SET);
+    mem = malloc(size);
+    if(mem == NULL) {status = NC_ENOMEM; goto done;}
+    /* Read the file into memory */
+    /* We need to do multiple reads because there is no
+       guarantee that the amount read will be the full amount */
+    red = size;
+    pos = (char*)mem;
+    while(red > 0) {
+	ssize_t count = read(fd, pos, red);
+	if(count < 0) {status = errno; goto done;}
+        if(count == 0) {status = NC_ENOTNC; goto done;}
+	/* assert(count > 0) */
+	red -= count;
+	pos += count;
+    }
+
+done:
+    if(fd >= 0)
+	(void)close(fd);
+    if(status != NC_NOERR) {
+#ifndef DEBUG
+        fprintf(stderr,"open failed: file=%s err=%d\n",path,status);
+	fflush(stderr);
+#endif
+    }
+    if(status != NC_NOERR && mem != NULL)
+	free(mem);
+    else {
+	if(sizep) *sizep = size;
+	if(memp) *memp = mem;
+    }
+    return status;
+}
+#endif
 
 /* 
  * Emit initial line of output for NcML
@@ -288,7 +366,6 @@ pr_initx(int ncid, const char *path)
 	   path);
 }
 
-
 /*
  * Print attribute string, for text attributes.
  */
@@ -1927,7 +2004,7 @@ main(int argc, char *argv[])
        exit(EXIT_SUCCESS);
     }
 
-    while ((c = getopt(argc, argv, "b:cd:f:g:hikl:n:p:stv:xwK")) != EOF)
+    while ((c = getopt(argc, argv, "b:cd:f:g:hikl:n:p:stv:xwKX:")) != EOF)
       switch(c) {
 	case 'h':		/* dump header only, no data */
 	  formatting_specs.header_only = true;
@@ -2015,6 +2092,16 @@ main(int argc, char *argv[])
         case 'w':		/* with client-side cache for DAP URLs */
 	  formatting_specs.with_cache = true;
 	  break;
+        case 'X':		/* special options */
+	  switch (tolower((int)optarg[0])) {
+	    case 'm':
+	      formatting_specs.xopt_inmemory = 1;
+	      break;
+	    default: 
+	      error("invalid value for -X option: %s", optarg);
+	      break;
+	  }
+	  break;
         case '?':
 	  usage();
 	  exit(EXIT_FAILURE);
@@ -2057,7 +2144,16 @@ main(int argc, char *argv[])
 		/* else fall thru and treat like a file path */
 	    }
 #endif /*USE_DAP*/
-	    nc_status = nc_open(path, NC_NOWRITE, &ncid);
+#ifdef USE_DISKLESS
+	    if(formatting_specs.xopt_inmemory) {
+		size_t size = 0;
+		void* mem = NULL;
+		nc_status = fileopen(path,&mem,&size);
+		if(nc_status == NC_NOERR)
+	            nc_status = nc_open_mem(path,NC_DISKLESS|NC_INMEMORY,size,mem,&ncid);
+	    } else 
+#endif
+	        nc_status = nc_open(path, NC_NOWRITE, &ncid);
 	    if (nc_status != NC_NOERR) {
 		error("%s: %s", path, nc_strerror(nc_status));
 	    }
@@ -2100,4 +2196,6 @@ main(int argc, char *argv[])
     }
     exit(EXIT_SUCCESS);
 }
+
+
 END_OF_MAIN();
diff --git a/ncdump/ncdump.h b/ncdump/ncdump.h
index 75c7a54..2805d5e 100644
--- a/ncdump/ncdump.h
+++ b/ncdump/ncdump.h
@@ -75,6 +75,8 @@ typedef struct {			/* specification for how to format dump */
 				 * on command line.
                                  */
     int nc_mode;                /* mode as reported by inq_format_extended */
+
+    int xopt_inmemory;      /* Use in-memory option; testing only */
 } fspec_t;
 
 #endif	/*_NCDUMP_H_ */
diff --git a/ncdump/tst_fillbug.sh b/ncdump/tst_fillbug.sh
index 3a98803..5a85200 100755
--- a/ncdump/tst_fillbug.sh
+++ b/ncdump/tst_fillbug.sh
@@ -3,6 +3,13 @@
 # $Id: tst_fillbug.sh,v 1.1 2008/10/02 19:49:52 russ Exp $
 
 set -e
+if test "x$srcdir" = "x"; then
+    srcdir=`dirname $0`;
+fi
+export srcdir
+
+
+
 echo ""
 echo "*** Running ncdump bug test."
 
diff --git a/ncdump/tst_inmemory.sh b/ncdump/tst_inmemory.sh
new file mode 100755
index 0000000..66b17a7
--- /dev/null
+++ b/ncdump/tst_inmemory.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+verbose=1
+set -e
+set -x
+if test "x$builddir" = "x"; then builddir=`pwd`; fi
+if test "x$srcdir" = "x"; then srcdir=`dirname $0`; fi
+
+# Make buildir absolute
+cd $builddir
+builddir=`pwd`
+
+# Make srcdir be absolute
+cd $srcdir
+srcdir=`pwd`
+cd $builddir
+
+# Setup
+PASS=1
+
+# Define the .cdl files to test
+CLASSIC="small ref_tst_nans ref_tst_utf8"
+EXTENDED="ref_nc_test_netcdf4 ref_tst_comp ref_tst_opaque_data"
+
+rm -fr ./results
+mkdir ./results
+
+# Dump classic files two ways and compare
+dotest() {
+K=$1
+for f in $2 ; do
+  echo "Testing ${f}"
+  ${builddir}/../ncgen/ncgen -$K -o ./results/${f}.nc ${srcdir}/${f}.cdl
+  ./ncdump ./results/${f}.nc > ./results/${f}.cdl
+  ./ncdump -Xm ./results/${f}.nc > ./results/${f}.cdx
+  diff -w ./results/${f}.cdl ./results/${f}.cdx &> ./results/${f}.diff
+  if test -s ./results/${f}.diff ; then
+    echo "***FAIL: $f"
+    PASS=0
+  fi
+done
+}
+
+dotest "3" "$CLASSIC"
+dotest "4" "$EXTENDED"
+
+# Cleanup
+rm -fr results
+
+if test "x$PASS" = x1 ; then
+  echo "*** PASS all tests"
+  CODE=0
+else
+  CODE=1
+fi
+exit $CODE
+
+
diff --git a/ncdump/tst_nccopy4.sh b/ncdump/tst_nccopy4.sh
index 012e4ba..d861927 100755
--- a/ncdump/tst_nccopy4.sh
+++ b/ncdump/tst_nccopy4.sh
@@ -2,12 +2,16 @@
 # For a netCDF-4 build, test nccopy on netCDF files in this directory
 
 set -e
+if test "x$srcdir" = "x"; then
+    srcdir=`dirname $0`;
+fi
+export srcdir
 echo ""
 
 # These files are actually in $srcdir in distcheck builds, so they
 # need to be handled differently.
-# ref_tst_compounds2 ref_tst_compounds3 ref_tst_compounds4 
-TESTFILES='tst_comp tst_comp2 tst_enum_data tst_fillbug 
+# ref_tst_compounds2 ref_tst_compounds3 ref_tst_compounds4
+TESTFILES='tst_comp tst_comp2 tst_enum_data tst_fillbug
  tst_group_data tst_nans tst_opaque_data tst_solar_1 tst_solar_2
  tst_solar_cmp tst_special_atts tst_string_data tst_unicode
  tst_vlen_data'
diff --git a/ncdump/tst_output.sh b/ncdump/tst_output.sh
index 0ec4a74..f47102d 100755
--- a/ncdump/tst_output.sh
+++ b/ncdump/tst_output.sh
@@ -10,11 +10,11 @@ fi
 echo ""
 echo "*** Testing ncgen and ncdump test output for classic format."
 echo "*** creating ctest1.cdl from ctest0.nc..."
-./ncdump -n c1 ctest0.nc > ctest1.cdl
+./ncdump -n c1 ctest0.nc | sed 's/e+0/e+/g' > ctest1.cdl
 echo "*** creating c0.nc from c0.cdl..."
 ../ncgen/ncgen -b -o c0.nc $srcdir/../ncgen/c0.cdl
 echo "*** creating c1.cdl from c0.nc..."
-./ncdump -n c1 c0.nc > c1.cdl
+./ncdump -n c1 c0.nc | sed 's/e+0/e+/g' > c1.cdl
 echo "*** comparing ncdump of C program output (ctest1.cdl) with c1.cdl..."
 diff -b c1.cdl ctest1.cdl
 echo "*** test output for ncdump -k"
@@ -42,11 +42,11 @@ echo "*** All ncgen and ncdump test output for classic format passed!"
 
 echo "*** Testing ncgen and ncdump test output for 64-bit offset format."
 echo "*** creating ctest1.cdl from test0_64.nc..."
-./ncdump -n c1 ctest0_64.nc > ctest1_64.cdl
+./ncdump -n c1 ctest0_64.nc | sed 's/e+0/e+/g' > ctest1_64.cdl
 echo "*** creating c0.nc from c0.cdl..."
 ../ncgen/ncgen -k nc6 -b -o c0.nc $srcdir/../ncgen/c0.cdl
 echo "*** creating c1.cdl from c0.nc..."
-./ncdump -n c1 c0.nc > c1.cdl
+./ncdump -n c1 c0.nc | sed 's/e+0/e+/g' > c1.cdl
 echo "*** comparing ncdump of C program output (ctest1_64.cdl) with c1.cdl..."
 diff -b c1.cdl ctest1_64.cdl
 echo "*** test output for ncdump -k"
@@ -58,7 +58,7 @@ echo "*** test output for ncdump -s"
 echo "*** creating tst_mslp_64.nc from tst_mslp.cdl"
 ../ncgen/ncgen -k nc6 -b -o tst_mslp_64.nc $srcdir/tst_mslp.cdl
 echo "*** creating tst_format_att_64.cdl from tst_mslp_64.nc"
-./ncdump -s tst_mslp_64.nc > tst_format_att_64.cdl
+./ncdump -s tst_mslp_64.nc | sed 's/e+0/e+/g' > tst_format_att_64.cdl
 echo "*** comparing ncdump -s of generated file with ref_tst_format_att_64.cdl ..."
 diff -b tst_format_att_64.cdl $srcdir/ref_tst_format_att_64.cdl
 
diff --git a/ncgen/Makefile.in b/ncgen/Makefile.in
index 5355da7..6c60745 100644
--- a/ncgen/Makefile.in
+++ b/ncgen/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -90,9 +100,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -107,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -397,6 +405,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -445,6 +455,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -460,10 +471,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -498,8 +511,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -604,7 +619,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncgen/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncgen/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -613,7 +627,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -867,7 +881,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1169,6 +1183,8 @@ uninstall-man: uninstall-man1
 	uninstall-am uninstall-binPROGRAMS uninstall-man \
 	uninstall-man1
 
+.PRECIOUS: Makefile
+
 
 # These rules are used if someone wants to rebuild ncgenyy.c or ncgentab.c
 # Otherwise never invoked, but records how to do it.
diff --git a/ncgen/main.c b/ncgen/main.c
index daec68a..d9fbb91 100644
--- a/ncgen/main.c
+++ b/ncgen/main.c
@@ -69,13 +69,13 @@ struct Kvalues legalkinds[NKVALUES] = {
     {"classic", NC_FORMAT_CLASSIC}, /* canonical format name */
     {"nc3", NC_FORMAT_CLASSIC},	    /* short format name */
     {"1", NC_FORMAT_CLASSIC},	/* deprecated, use "-3" or "-k nc3" instead */
-	
+
     /* NetCDF-3 64-bit offset format */
     {"64-bit offset", NC_FORMAT_64BIT}, /* canonical format name */
     {"nc6", NC_FORMAT_64BIT},		/* short format name */
     {"2", NC_FORMAT_64BIT},     /* deprecated, use "-6" or "-k nc6" instead */
     {"64-bit-offset", NC_FORMAT_64BIT}, /* aliases */
-	
+
     /* NetCDF-4 HDF5-based format */
     {"netCDF-4", NC_FORMAT_NETCDF4}, /* canonical format name */
     {"nc4", NC_FORMAT_NETCDF4},	     /* short format name */
@@ -313,12 +313,13 @@ main(
 		    derror ("%s: out of memory", progname);
 		    return(1);
 		}
-		(void)strcpy(kind_name, optarg);
-	        for(kvalue=legalkinds;kvalue->name;kvalue++) {
-		    if(strcmp(kind_name,kvalue->name) == 0) {
-		        k_flag = kvalue->k_flag;
+        if(optarg != NULL)
+          (void)strcpy(kind_name, optarg);
+        for(kvalue=legalkinds;kvalue->name;kvalue++) {
+          if(strcmp(kind_name,kvalue->name) == 0) {
+            k_flag = kvalue->k_flag;
 			break;
-		    }
+          }
 		}
 		if(kvalue->name == NULL) {
 		   derror("Invalid format: %s",kind_name);
diff --git a/ncgen3/Makefile.in b/ncgen3/Makefile.in
index f6e1ce6..3c1012e 100644
--- a/ncgen3/Makefile.in
+++ b/ncgen3/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,17 @@
 #
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -91,9 +101,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -108,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -390,6 +398,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -438,6 +448,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -453,10 +464,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -491,8 +504,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -590,7 +605,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ncgen3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign ncgen3/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -599,7 +613,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -832,7 +846,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1134,6 +1148,8 @@ uninstall-man: uninstall-man1
 	uninstall-am uninstall-binPROGRAMS uninstall-man \
 	uninstall-man1
 
+.PRECIOUS: Makefile
+
 
 # This is used if someone wants to rebuild ncgenyy.c or ncgentab.c
 # Otherwise never invoked, but records how to do it. Don't forget to
diff --git a/ncgen3/load.c b/ncgen3/load.c
index 401dd3d..c02c4b4 100644
--- a/ncgen3/load.c
+++ b/ncgen3/load.c
@@ -15,6 +15,10 @@
 #include "ncgen.h"
 #include "genlib.h"
 
+#ifndef HAVE_STRLCAT
+extern size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
+
 extern int netcdf_flag;
 extern int c_flag;
 extern int fortran_flag;
diff --git a/nctest/Makefile.in b/nctest/Makefile.in
index 2d63c15..cc22016 100644
--- a/nctest/Makefile.in
+++ b/nctest/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,17 @@
 # libraries for netCDF-4.
 #
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -91,9 +101,6 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-DIST_COMMON = $(top_srcdir)/lib_flags.am $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/depcomp \
-	$(top_srcdir)/test-driver README
 @USE_DAP_TRUE at am__append_1 = -I${top_srcdir}/oc2
 
 # This turns on declspec magic in netcdf.h for windows DLLs.
@@ -112,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -397,6 +405,8 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -447,6 +457,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -462,10 +473,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -500,8 +513,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -602,7 +617,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign nctest/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign nctest/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -611,7 +625,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
-$(top_srcdir)/lib_flags.am:
+$(top_srcdir)/lib_flags.am $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -778,7 +792,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	if test -n "$$am__remaking_logs"; then \
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
 	       "recursion detected" >&2; \
-	else \
+	elif test -n "$$redo_logs"; then \
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
 	fi; \
 	if $(am__make_dryrun); then :; else \
@@ -1089,6 +1103,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	recheck tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt
index bb03816..de38840 100644
--- a/oc2/CMakeLists.txt
+++ b/oc2/CMakeLists.txt
@@ -6,4 +6,5 @@ add_library(oc2 OBJECT ${oc_SOURCES})
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} dap.y)
+SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ocauth.html)
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/oc2/Make0 b/oc2/Make0
index 08ba1d8..206a919 100755
--- a/oc2/Make0
+++ b/oc2/Make0
@@ -1,5 +1,6 @@
-OCDIR=/home/dmh/git/oc
-#OCDIR=f:/git/oc
+# OCDIR is assumed to have been set
+TST=`if test "x$OCDIR" = x ; then echo "OCDIR not defined"; exit 1 fi`
+TST=`echo "OCDIR=$OCDIR"`
 
 THISDIR=../oc2
 
@@ -24,7 +25,11 @@ ochttp.h ocread.h ocutil.h \
 ocbytes.h oclist.h ocuri.h oclog.h \
 xxdr.h
 
-FILES=${HDRS} ${SRC} dap.y
+DOCS=docs/ocauth.html
+
+MISC=dap.y
+
+FILES=${HDRS} ${SRC} ${MISC} ${DOCS}
 
 all::
 
@@ -45,6 +50,23 @@ makeoc::
 	mv dap.tab.c daptab.c; mv dap.tab.h daptab.h
 
 diffoc::
+	@if ! test -e ${OCDIR} ; then echo "${OCDIR} not found"; exit ; fi
+	@for file in ${FILES} ; do \
+	    f="${OCDIR}/$$file" ; \
+	    x=`basename $$f|tr -d '
' ` ; \
+	    if test "x$${x}" = "xdaptab.c" -o "x$${x}" = "xdaptab.h" ; then echo "ignore: $${x}"; continue; fi ;\
+	    if ! test -e ${THISDIR}/$$x ; then \
+		echo "Missing file: $$x"; \
+	    fi ; \
+	    if test -e ${THISDIR}/$$x -a -e ${OCDIR}/$$x ; then \
+		if ! diff --brief -wBb ${THISDIR}/$$x $$f > /dev/null ; then \
+		echo diff -wBb ${THISDIR}/$$x $$f ;\
+		diff -w ${THISDIR}/$$x $$f ; \
+		fi; \
+	    fi; \
+	done
+
+olddiff::
 	if ! test -e ${OCDIR} ; then echo "${OCDIR} not found"; exit ; fi
 	for file in ${FILES} ; do \
 	    f="${OCDIR}/$$file" ; \
diff --git a/oc2/Makefile.am b/oc2/Makefile.am
index 4675816..26e515e 100755
--- a/oc2/Makefile.am
+++ b/oc2/Makefile.am
@@ -31,7 +31,7 @@ ochttp.h ocread.h ocutil.h \
 ocbytes.h oclist.h ocuri.h oclog.h \
 xxdr.h
 
-EXTRA_DIST = dap.y CMakeLists.txt
+EXTRA_DIST = dap.y CMakeLists.txt ocauth.html
 
 if BUILD_DAP
 noinst_LTLIBRARIES = liboc.la
diff --git a/oc2/Makefile.in b/oc2/Makefile.in
index 197cc1f..1d3dd05 100644
--- a/oc2/Makefile.in
+++ b/oc2/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,17 @@
 # $Id: Makefile.am,v 1.1 2010/05/23 21:05:33 dmh Exp $
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -88,8 +98,6 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = oc2
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -97,6 +105,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -189,6 +198,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -239,6 +249,7 @@ HAS_NC2 = @HAS_NC2@
 HAS_NC4 = @HAS_NC4@
 HAS_PARALLEL = @HAS_PARALLEL@
 HAS_PNETCDF = @HAS_PNETCDF@
+HAS_SZIP = @HAS_SZIP@
 HAS_SZLIB = @HAS_SZLIB@
 HAVE_DOT = @HAVE_DOT@
 INSTALL = @INSTALL@
@@ -254,10 +265,12 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NC_ENABLE_DOXYGEN_PDF_OUTPUT = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
 NC_HAS_DAP = @NC_HAS_DAP@
 NC_HAS_DISKLESS = @NC_HAS_DISKLESS@
 NC_HAS_HDF4 = @NC_HAS_HDF4@
@@ -292,8 +305,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
 SED = @SED@
+SERVER_SIDE_SEARCH = @SERVER_SIDE_SEARCH@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHOW_DOXYGEN_TAG_LIST = @SHOW_DOXYGEN_TAG_LIST@
 STRIP = @STRIP@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
@@ -376,7 +391,7 @@ ochttp.h ocread.h ocutil.h \
 ocbytes.h oclist.h ocuri.h oclog.h \
 xxdr.h
 
-EXTRA_DIST = dap.y CMakeLists.txt
+EXTRA_DIST = dap.y CMakeLists.txt ocauth.html
 @BUILD_DAP_TRUE at noinst_LTLIBRARIES = liboc.la
 @BUILD_DAP_TRUE at liboc_la_SOURCES = $(SRC) $(HDRS) 
 @BUILD_DAP_TRUE at liboc_la_CPPFLAGS = $(AM_CPPFLAGS)
@@ -396,7 +411,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign oc2/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign oc2/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -845,6 +859,8 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # These rule are used if someone wants to rebuild the grammar files.
 # Otherwise never invoked, but records how to do it.
diff --git a/oc2/daptab.c b/oc2/daptab.c
index 1014c72..da689cd 100644
--- a/oc2/daptab.c
+++ b/oc2/daptab.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.0"
+#define YYBISON_VERSION "3.0.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -77,11 +77,11 @@ int dapdebug = 0;
 
 #line 79 "dap.tab.c" /* yacc.c:339  */
 
-# ifndef YY_NULL
+# ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULL nullptr
+#   define YY_NULLPTR nullptr
 #  else
-#   define YY_NULL 0
+#   define YY_NULLPTR 0
 #  endif
 # endif
 
@@ -210,11 +210,30 @@ typedef short int yytype_int16;
 # endif
 #endif
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
-      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-#  define __attribute__(Spec) /* empty */
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
@@ -464,7 +483,7 @@ static const char *const yytname[] =
   "array_decl", "datasetname", "var_name", "attributebody", "attr_list",
   "attribute", "bytes", "int16", "uint16", "int32", "uint32", "float32",
   "float64", "strs", "urls", "url", "str_or_id", "alias", "errorbody",
-  "errorcode", "errormsg", "errorptype", "errorprog", "name", YY_NULL
+  "errorcode", "errormsg", "errorptype", "errorprog", "name", YY_NULLPTR
 };
 #endif
 
@@ -989,11 +1008,11 @@ static int
 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = YY_NULL;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
   /* Number of reported tokens (one for the "unexpected", one per
@@ -1050,7 +1069,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                   }
                 yyarg[yycount++] = yytname[yyx];
                 {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
                   if (! (yysize <= yysize1
                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
                     return 2;
@@ -1389,611 +1408,611 @@ yyreduce:
         case 6:
 #line 58 "dap.y" /* yacc.c:1646  */
     {dap_unrecognizedresponse(parsestate); YYABORT;}
-#line 1393 "dap.tab.c" /* yacc.c:1646  */
+#line 1412 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 7:
 #line 63 "dap.y" /* yacc.c:1646  */
     {dap_tagparse(parsestate,SCAN_DATASET);}
-#line 1399 "dap.tab.c" /* yacc.c:1646  */
+#line 1418 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 8:
 #line 67 "dap.y" /* yacc.c:1646  */
     {dap_tagparse(parsestate,SCAN_ATTR);}
-#line 1405 "dap.tab.c" /* yacc.c:1646  */
+#line 1424 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 9:
 #line 71 "dap.y" /* yacc.c:1646  */
     {dap_tagparse(parsestate,SCAN_ERROR);}
-#line 1411 "dap.tab.c" /* yacc.c:1646  */
+#line 1430 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 10:
 #line 76 "dap.y" /* yacc.c:1646  */
     {dap_datasetbody(parsestate,(yyvsp[-1]),(yyvsp[-3]));}
-#line 1417 "dap.tab.c" /* yacc.c:1646  */
+#line 1436 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 11:
 #line 81 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_declarations(parsestate,null,null);}
-#line 1423 "dap.tab.c" /* yacc.c:1646  */
+#line 1442 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 12:
 #line 82 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_declarations(parsestate,(yyvsp[-1]),(yyvsp[0]));}
-#line 1429 "dap.tab.c" /* yacc.c:1646  */
+#line 1448 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 13:
 #line 89 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_makebase(parsestate,(yyvsp[-2]),(yyvsp[-3]),(yyvsp[-1]));}
-#line 1435 "dap.tab.c" /* yacc.c:1646  */
+#line 1454 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 14:
 #line 91 "dap.y" /* yacc.c:1646  */
     {if(((yyval)=dap_makestructure(parsestate,(yyvsp[-2]),(yyvsp[-1]),(yyvsp[-4])))==null) {YYABORT;}}
-#line 1441 "dap.tab.c" /* yacc.c:1646  */
+#line 1460 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 15:
 #line 93 "dap.y" /* yacc.c:1646  */
     {if(((yyval)=dap_makesequence(parsestate,(yyvsp[-1]),(yyvsp[-3])))==null) {YYABORT;}}
-#line 1447 "dap.tab.c" /* yacc.c:1646  */
+#line 1466 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 16:
 #line 96 "dap.y" /* yacc.c:1646  */
     {if(((yyval)=dap_makegrid(parsestate,(yyvsp[-1]),(yyvsp[-6]),(yyvsp[-3])))==null) {YYABORT;}}
-#line 1453 "dap.tab.c" /* yacc.c:1646  */
+#line 1472 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 17:
 #line 98 "dap.y" /* yacc.c:1646  */
     {dapsemanticerror(parsestate,OC_EBADTYPE,"Unrecognized type"); YYABORT;}
-#line 1459 "dap.tab.c" /* yacc.c:1646  */
+#line 1478 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 18:
 #line 103 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_BYTE;}
-#line 1465 "dap.tab.c" /* yacc.c:1646  */
+#line 1484 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 19:
 #line 104 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_INT16;}
-#line 1471 "dap.tab.c" /* yacc.c:1646  */
+#line 1490 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 20:
 #line 105 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_UINT16;}
-#line 1477 "dap.tab.c" /* yacc.c:1646  */
+#line 1496 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 21:
 #line 106 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_INT32;}
-#line 1483 "dap.tab.c" /* yacc.c:1646  */
+#line 1502 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 22:
 #line 107 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_UINT32;}
-#line 1489 "dap.tab.c" /* yacc.c:1646  */
+#line 1508 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 23:
 #line 108 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_FLOAT32;}
-#line 1495 "dap.tab.c" /* yacc.c:1646  */
+#line 1514 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 24:
 #line 109 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_FLOAT64;}
-#line 1501 "dap.tab.c" /* yacc.c:1646  */
+#line 1520 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 25:
 #line 110 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_URL;}
-#line 1507 "dap.tab.c" /* yacc.c:1646  */
+#line 1526 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 26:
 #line 111 "dap.y" /* yacc.c:1646  */
     {(yyval)=(Object)SCAN_STRING;}
-#line 1513 "dap.tab.c" /* yacc.c:1646  */
+#line 1532 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 27:
 #line 115 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_arraydecls(parsestate,null,null);}
-#line 1519 "dap.tab.c" /* yacc.c:1646  */
+#line 1538 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 28:
 #line 116 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_arraydecls(parsestate,(yyvsp[-1]),(yyvsp[0]));}
-#line 1525 "dap.tab.c" /* yacc.c:1646  */
+#line 1544 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 29:
 #line 120 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[-1]));}
-#line 1531 "dap.tab.c" /* yacc.c:1646  */
+#line 1550 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 30:
 #line 121 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[-1]));}
-#line 1537 "dap.tab.c" /* yacc.c:1646  */
+#line 1556 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 31:
 #line 122 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_arraydecl(parsestate,(yyvsp[-3]),(yyvsp[-1]));}
-#line 1543 "dap.tab.c" /* yacc.c:1646  */
+#line 1562 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 32:
 #line 124 "dap.y" /* yacc.c:1646  */
     {dapsemanticerror(parsestate,OC_EDIMSIZE,"Illegal dimension declaration"); YYABORT;}
-#line 1549 "dap.tab.c" /* yacc.c:1646  */
+#line 1568 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 33:
 #line 128 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[0]);}
-#line 1555 "dap.tab.c" /* yacc.c:1646  */
+#line 1574 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 34:
 #line 130 "dap.y" /* yacc.c:1646  */
     {dapsemanticerror(parsestate,OC_EDDS,"Illegal dataset declaration"); YYABORT;}
-#line 1561 "dap.tab.c" /* yacc.c:1646  */
+#line 1580 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 35:
 #line 133 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[0]);}
-#line 1567 "dap.tab.c" /* yacc.c:1646  */
+#line 1586 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 36:
 #line 136 "dap.y" /* yacc.c:1646  */
     {dap_attributebody(parsestate,(yyvsp[-1]));}
-#line 1573 "dap.tab.c" /* yacc.c:1646  */
+#line 1592 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 37:
 #line 138 "dap.y" /* yacc.c:1646  */
     {dapsemanticerror(parsestate,OC_EDAS,"Illegal DAS body"); YYABORT;}
-#line 1579 "dap.tab.c" /* yacc.c:1646  */
+#line 1598 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 38:
 #line 142 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrlist(parsestate,null,null);}
-#line 1585 "dap.tab.c" /* yacc.c:1646  */
+#line 1604 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 39:
 #line 143 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrlist(parsestate,(yyvsp[-1]),(yyvsp[0]));}
-#line 1591 "dap.tab.c" /* yacc.c:1646  */
+#line 1610 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 40:
 #line 147 "dap.y" /* yacc.c:1646  */
     {(yyval)=null;}
-#line 1597 "dap.tab.c" /* yacc.c:1646  */
+#line 1616 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 41:
 #line 149 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_BYTE);}
-#line 1603 "dap.tab.c" /* yacc.c:1646  */
+#line 1622 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 42:
 #line 151 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_INT16);}
-#line 1609 "dap.tab.c" /* yacc.c:1646  */
+#line 1628 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 43:
 #line 153 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_UINT16);}
-#line 1615 "dap.tab.c" /* yacc.c:1646  */
+#line 1634 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 44:
 #line 155 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_INT32);}
-#line 1621 "dap.tab.c" /* yacc.c:1646  */
+#line 1640 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 45:
 #line 157 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_UINT32);}
-#line 1627 "dap.tab.c" /* yacc.c:1646  */
+#line 1646 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 46:
 #line 159 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_FLOAT32);}
-#line 1633 "dap.tab.c" /* yacc.c:1646  */
+#line 1652 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 47:
 #line 161 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_FLOAT64);}
-#line 1639 "dap.tab.c" /* yacc.c:1646  */
+#line 1658 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 48:
 #line 163 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_STRING);}
-#line 1645 "dap.tab.c" /* yacc.c:1646  */
+#line 1664 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 49:
 #line 165 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attribute(parsestate,(yyvsp[-2]),(yyvsp[-1]),(Object)SCAN_URL);}
-#line 1651 "dap.tab.c" /* yacc.c:1646  */
+#line 1670 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 50:
 #line 166 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrset(parsestate,(yyvsp[-3]),(yyvsp[-1]));}
-#line 1657 "dap.tab.c" /* yacc.c:1646  */
+#line 1676 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 51:
 #line 168 "dap.y" /* yacc.c:1646  */
     {dapsemanticerror(parsestate,OC_EDAS,"Illegal attribute"); YYABORT;}
-#line 1663 "dap.tab.c" /* yacc.c:1646  */
+#line 1682 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 52:
 #line 172 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_BYTE);}
-#line 1669 "dap.tab.c" /* yacc.c:1646  */
+#line 1688 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 53:
 #line 174 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_BYTE);}
-#line 1675 "dap.tab.c" /* yacc.c:1646  */
+#line 1694 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 54:
 #line 177 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_INT16);}
-#line 1681 "dap.tab.c" /* yacc.c:1646  */
+#line 1700 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 55:
 #line 179 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_INT16);}
-#line 1687 "dap.tab.c" /* yacc.c:1646  */
+#line 1706 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 56:
 #line 182 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_UINT16);}
-#line 1693 "dap.tab.c" /* yacc.c:1646  */
+#line 1712 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 57:
 #line 184 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_UINT16);}
-#line 1699 "dap.tab.c" /* yacc.c:1646  */
+#line 1718 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 58:
 #line 187 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_INT32);}
-#line 1705 "dap.tab.c" /* yacc.c:1646  */
+#line 1724 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 59:
 #line 189 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_INT32);}
-#line 1711 "dap.tab.c" /* yacc.c:1646  */
+#line 1730 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 60:
 #line 192 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_UINT32);}
-#line 1717 "dap.tab.c" /* yacc.c:1646  */
+#line 1736 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 61:
 #line 193 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_UINT32);}
-#line 1723 "dap.tab.c" /* yacc.c:1646  */
+#line 1742 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 62:
 #line 196 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_FLOAT32);}
-#line 1729 "dap.tab.c" /* yacc.c:1646  */
+#line 1748 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 63:
 #line 197 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_FLOAT32);}
-#line 1735 "dap.tab.c" /* yacc.c:1646  */
+#line 1754 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 64:
 #line 200 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_FLOAT64);}
-#line 1741 "dap.tab.c" /* yacc.c:1646  */
+#line 1760 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 65:
 #line 201 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_FLOAT64);}
-#line 1747 "dap.tab.c" /* yacc.c:1646  */
+#line 1766 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 66:
 #line 204 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_STRING);}
-#line 1753 "dap.tab.c" /* yacc.c:1646  */
+#line 1772 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 67:
 #line 205 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_STRING);}
-#line 1759 "dap.tab.c" /* yacc.c:1646  */
+#line 1778 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 68:
 #line 209 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[0]),(Object)SCAN_URL);}
-#line 1765 "dap.tab.c" /* yacc.c:1646  */
+#line 1784 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 69:
 #line 210 "dap.y" /* yacc.c:1646  */
     {(yyval)=dap_attrvalue(parsestate,(yyvsp[-2]),(yyvsp[0]),(Object)SCAN_URL);}
-#line 1771 "dap.tab.c" /* yacc.c:1646  */
+#line 1790 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 70:
 #line 214 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[0]);}
-#line 1777 "dap.tab.c" /* yacc.c:1646  */
+#line 1796 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 71:
 #line 218 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[0]);}
-#line 1783 "dap.tab.c" /* yacc.c:1646  */
+#line 1802 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 72:
 #line 219 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[0]);}
-#line 1789 "dap.tab.c" /* yacc.c:1646  */
+#line 1808 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 73:
 #line 230 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[-1]); (yyval)=(yyvsp[0]); (yyval)=null;}
-#line 1795 "dap.tab.c" /* yacc.c:1646  */
+#line 1814 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 74:
 #line 235 "dap.y" /* yacc.c:1646  */
     {dap_errorbody(parsestate,(yyvsp[-5]),(yyvsp[-4]),(yyvsp[-3]),(yyvsp[-2]));}
-#line 1801 "dap.tab.c" /* yacc.c:1646  */
+#line 1820 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 75:
 #line 238 "dap.y" /* yacc.c:1646  */
     {(yyval)=null;}
-#line 1807 "dap.tab.c" /* yacc.c:1646  */
+#line 1826 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 76:
 #line 238 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[-1]);}
-#line 1813 "dap.tab.c" /* yacc.c:1646  */
+#line 1832 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 77:
 #line 239 "dap.y" /* yacc.c:1646  */
     {(yyval)=null;}
-#line 1819 "dap.tab.c" /* yacc.c:1646  */
+#line 1838 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 78:
 #line 239 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[-1]);}
-#line 1825 "dap.tab.c" /* yacc.c:1646  */
+#line 1844 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 79:
 #line 240 "dap.y" /* yacc.c:1646  */
     {(yyval)=null;}
-#line 1831 "dap.tab.c" /* yacc.c:1646  */
+#line 1850 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 80:
 #line 240 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[-1]);}
-#line 1837 "dap.tab.c" /* yacc.c:1646  */
+#line 1856 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 81:
 #line 241 "dap.y" /* yacc.c:1646  */
     {(yyval)=null;}
-#line 1843 "dap.tab.c" /* yacc.c:1646  */
+#line 1862 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 82:
 #line 241 "dap.y" /* yacc.c:1646  */
     {(yyval)=(yyvsp[-1]);}
-#line 1849 "dap.tab.c" /* yacc.c:1646  */
+#line 1868 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 83:
 #line 247 "dap.y" /* yacc.c:1646  */
     {(yyval)=dapdecode(parsestate->lexstate,(yyvsp[0]));}
-#line 1855 "dap.tab.c" /* yacc.c:1646  */
+#line 1874 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 84:
 #line 248 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("alias");}
-#line 1861 "dap.tab.c" /* yacc.c:1646  */
+#line 1880 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 85:
 #line 249 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("array");}
-#line 1867 "dap.tab.c" /* yacc.c:1646  */
+#line 1886 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 86:
 #line 250 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("attributes");}
-#line 1873 "dap.tab.c" /* yacc.c:1646  */
+#line 1892 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 87:
 #line 251 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("byte");}
-#line 1879 "dap.tab.c" /* yacc.c:1646  */
+#line 1898 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 88:
 #line 252 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("dataset");}
-#line 1885 "dap.tab.c" /* yacc.c:1646  */
+#line 1904 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 89:
 #line 253 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("data");}
-#line 1891 "dap.tab.c" /* yacc.c:1646  */
+#line 1910 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 90:
 #line 254 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("error");}
-#line 1897 "dap.tab.c" /* yacc.c:1646  */
+#line 1916 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 91:
 #line 255 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("float32");}
-#line 1903 "dap.tab.c" /* yacc.c:1646  */
+#line 1922 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 92:
 #line 256 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("float64");}
-#line 1909 "dap.tab.c" /* yacc.c:1646  */
+#line 1928 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 93:
 #line 257 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("grid");}
-#line 1915 "dap.tab.c" /* yacc.c:1646  */
+#line 1934 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 94:
 #line 258 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("int16");}
-#line 1921 "dap.tab.c" /* yacc.c:1646  */
+#line 1940 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 95:
 #line 259 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("int32");}
-#line 1927 "dap.tab.c" /* yacc.c:1646  */
+#line 1946 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 96:
 #line 260 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("maps");}
-#line 1933 "dap.tab.c" /* yacc.c:1646  */
+#line 1952 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 97:
 #line 261 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("sequence");}
-#line 1939 "dap.tab.c" /* yacc.c:1646  */
+#line 1958 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 98:
 #line 262 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("string");}
-#line 1945 "dap.tab.c" /* yacc.c:1646  */
+#line 1964 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 99:
 #line 263 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("structure");}
-#line 1951 "dap.tab.c" /* yacc.c:1646  */
+#line 1970 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 100:
 #line 264 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("uint16");}
-#line 1957 "dap.tab.c" /* yacc.c:1646  */
+#line 1976 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 101:
 #line 265 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("uint32");}
-#line 1963 "dap.tab.c" /* yacc.c:1646  */
+#line 1982 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 102:
 #line 266 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("url");}
-#line 1969 "dap.tab.c" /* yacc.c:1646  */
+#line 1988 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 103:
 #line 267 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("code");}
-#line 1975 "dap.tab.c" /* yacc.c:1646  */
+#line 1994 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 104:
 #line 268 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("message");}
-#line 1981 "dap.tab.c" /* yacc.c:1646  */
+#line 2000 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 105:
 #line 269 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("program");}
-#line 1987 "dap.tab.c" /* yacc.c:1646  */
+#line 2006 "dap.tab.c" /* yacc.c:1646  */
     break;
 
   case 106:
 #line 270 "dap.y" /* yacc.c:1646  */
     {(yyval)=strdup("program_type");}
-#line 1993 "dap.tab.c" /* yacc.c:1646  */
+#line 2012 "dap.tab.c" /* yacc.c:1646  */
     break;
 
 
-#line 1997 "dap.tab.c" /* yacc.c:1646  */
+#line 2016 "dap.tab.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
diff --git a/oc2/daptab.h b/oc2/daptab.h
index d015b33..97d6518 100644
--- a/oc2/daptab.h
+++ b/oc2/daptab.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
diff --git a/oc2/ocauth.html b/oc2/ocauth.html
new file mode 100644
index 0000000..d8e2537
--- /dev/null
+++ b/oc2/ocauth.html
@@ -0,0 +1,434 @@
+<!- Copyright 2014, UCAR/Unidata and OPeNDAP, Inc. --> 
+<!- See the COPYRIGHT file for more information. --> 
+<html> 
+<style> 
+.break { page-break-before: always; } 
+body { counter-reset: H2; font-size: 12pt; } 
+h2:before { 
+  content: counter(H2) " "; 
+  counter-increment: H2; 
+} 
+h2 { counter-reset: H3; } 
+h3:before { 
+  content: counter(H2) "." counter(H3) " "; 
+  counter-increment:H3; 
+} 
+h3 { counter-reset: H4; } 
+h4:before { 
+  content: counter(H2) "." counter(H3) "." counter(H4) " "; 
+  counter-increment:H4; 
+} 
+h5 {font-size: 14pt; } /* For Appendices */ 
+h6 {font-size: 16pt; } /* For Subtitles */ 
+</style> 
+<body> 
+ 
+<center> 
+<h1>OC Authorization Support</h1> 
+<h6>Author: Dennis Heimbigner<br>
+dmh at ucar dot edu</h6>
+<h6>Draft: 11/21/2014<br> 
+Last Revised: 12/23/2014<br> 
+OC Version 2.1</h6> 
+</center> 
+ 
+<h6 class="break"><u>Table of Contents</u></h6> 
+<ol> 
+<li> <a href="#Introduction">Introduction</a> 
+<li> <a href="#URL-AUTH">URL-Based Authentication</a> 
+<li> <a href="#DODSRC">RC File Authentication</a> 
+<li> <a href="#REDIR">Redirection-Based Authentication</a> 
+<li> <a href="#URLCONS">URL Constrained RC File Entries</a> 
+<li> <a href="#CLIENTCERTS">Client-Side Certificates</a> 
+<li> <a href="#allkeys">Appendix A. All RC-File Keys</a>
+<li> <a href="#ESGDETAIL">Appendix B. ESG Access in Detail</a>
+</ol> 
+ 
+<h2 class="break"><a name="Introduction"><u>Introduction</u></a></h2> 
+OC can support user authorization using those provided by the curl
+library. This includes basic password authentication as well as
+certificate-based authorization.
+<p>
+With some exceptions (e.g. see the section on <a href="#REDIR">redirection</a>)
+The libcurl authorization mechanisms can be accessed in two ways
+<ol>
+<li> Inserting the username and password into the url, or
+<li> Accessing information from a so-called <i>rc</i> file named either
+<i>.daprc</i> or <i>.dodsrc</i>
+</ol>
+
+<h2 class="break"><a name="URL-AUTH"><u>URL-Based Authentication</u></a></h2> 
+For simple password based authentication, it is possible to
+directly insert the username and the password into a url in this form.
+<pre>
+    http://username:password@host/...
+</pre>
+This username and password will be used if the server asks for
+authentication. Note that only simple password authentication
+is supported in this format.
+Specifically note that <a href="#REDIR">redirection</a> based
+authorization will not work with this.
+
+<h2 class="break"><a name="DODSRC"><u>RC File Authentication</u></a></h2> 
+The oc library supports an <i>rc</i> file mechanism to allow the passing
+of a number of parameters to liboc and libcurl.
+<p>
+The file must be called one of the following names:
+".daprc", ".dodsrc"
+If both .daprc and .dodsrc exist, then
+the .daprc file will take precedence.
+<p>
+Searching for the rc file first looks in the current directory
+and then in the home directory (as defined by the HOME environment
+variable). It is also possible to specify a direct path using
+the <i>-R</i> option to ocprint or using the <i>oc_set_rcfile</i>
+procedure (see oc.h). Note that for these latter cases, the path
+must be to the file itself, not to the containing directory.
+<p>
+The rc file format is a series of lines of the general form:
+<pre>
+[<host:port>]<key>=<value>
+</pre>
+where the bracket-enclosed host:port is optional and will be discussed 
+subsequently.
+<p>
+The currently defined set of authorization-related keys are as follows.
+The second column is the affected curl_easy_setopt option(s).
+<table>
+<tr><th>Key<th>curl_easy_setopt Option
+<tr><td>HTTP.COOKIEJAR<td>CURLOPT_COOKIEJAR, CURLOPT_COOKIEFILE
+<tr><td>HTTP.PROXY_SERVER<td>CURLOPT_PROXY, CURLOPT_PROXYPORT, CURLOPT_PROXYUSERPWD
+<tr><td>HTTP.SSL.CERTIFICATE<td>CURLOPT_SSLCERT
+<tr><td>HTTP.SSL.KEY<td>CURLOPT_SSLKEY
+<tr><td>HTTP.SSL.KEYPASSWORD<td>CURLOPT_KEYPASSWORD
+<tr><td>HTTP.SSL.CAINFO<td>CURLOPT_SSLCAINFO
+<tr><td>HTTP.SSL.CAPATH<td>CURLOPT_SSLCAPATH
+<tr><td>HTTP.SSL.VERIFYPEER<td>CURLOPT_SSL_VERIFYPEER
+<tr><td>HTTP.CREDENTIALS.USERPASSWORD<td>CURLOPT_USERPASSWORD
+</table>
+</ul>
+
+<h3><u>Password Authentication</u></h3> 
+The key
+HTTP.CREDENTIALS.USERPASSWORD
+can be used to set the simple password authentication.
+This is an alternative to setting it in the url. 
+The value must be of the form "username:password".
+
+<h3><u>Cookie Jar</u></h3> 
+The HTTP.COOKIEJAR key
+specifies the name of file from which
+to read cookies (CURLOPT_COOKIEJAR) and also
+the file into which to store cookies (CURLOPT_COOKIEFILE).
+The same value is used for both CURLOPT values.
+It defaults to in-memory storage.
+
+<h3><u>Certificate Authentication</u></h3> 
+HTTP.SSL.CERTIFICATE
+specifies a file path for a file containing a PEM cerficate.
+This is typically used for client-side authentication.
+<p>
+HTTP.SSL.KEY is essentially the same as HTTP.SSL.CERTIFICATE
+and should usually have the same value.
+<p>
+HTTP.SSL.KEYPASSWORD
+specifies the password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
+file.
+<p>
+HTTP.SSL.CAPATH
+specifies the path to a directory containing
+trusted certificates for validating server sertificates.
+<p>
+HTTP.SSL.VALIDATE
+is a boolean (1/0) value that if true (1)
+specifies that the client should verify the server's presented certificate.
+<p>
+HTTP.PROXY_SERVER
+specified the url for accessing the proxy:
+(e.g.http://[username:password@]host[:port])
+
+<h2 class="break"><a name="REDIR"><u>Redirection-Based Authentication</u></a> </h2>
+Some sites provide authentication by using a third party site
+to to the authentication. One example is
+<a href="https://uat.urs.earthdata.nasa.gov">URS</a>,
+the EOSDIS User Registration System.
+<p>
+The process is usually as follows.
+<ol>
+<li>The client contacts the server of interest (SOI), the actual data provider.
+<li>The SOI sends a redirect to the client to connect to the URS system.
+<li>The client authenticates with URS.
+<li>URS sends a redirect (with authorization information) to send
+the client back to the SOI to actually obtain the data.
+</ol>
+<p>
+In order for this to work with libcurl, the client will usually need
+to provide a .netrc file so that the redirection will work correctly.
+The format of this .netrc file will contain content that
+typically look like this.
+<pre>
+machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
+</pre>
+where the machine is the one to which the client is redirected
+for authorization, and the login and password are those
+needed to authenticate.
+<p>
+The .netrc file can be specified in two ways.
+<ol>
+<li> Specify the netrc file to liboc using the procedure in oc.h:
+<pre>
+oc_set_netrc(OClink* link, const char* file)
+</pre>
+(This is equivalent to the -N flag to ocprint). 
+<p>
+<li> Put the following line in your .daprc/.dodsrc file.
+<pre>
+HTTP.NETRC=<path to netrc file>
+</pre>
+</ol>
+<p>
+One final note. In using this, it is probable that you will
+need to specify a cookie jar (HTTP.COOKIEJAR) so that the
+redirect site can pass back authorization information.
+
+<h2 class="break"><a name="URLCONS"><u>URL Constrained RC File Entries</u></a></h2> 
+Each line of the rc file can begin with
+a host+port enclosed in square brackets.
+The form is "host:port". If the port is not specified
+then the form is just "host".
+The reason that more of the url is not used is that
+libcurl's authorization grain is not any finer than host level.
+<p>
+Examples.
+<pre>
+[remotetest.unidata.ucar.edu]HTTP.VERBOSE=1
+or
+[fake.ucar.edu:9090]HTTP.VERBOSE=0
+</pre>
+If the url request from, say, the <i>oc_open</i> method
+has a host+port matchine one of the prefixes in the rc file, then
+the corresponding entry will be used, otherwise ignored.
+<p>
+For example, the URL
+<pre>
+http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
+</pre>
+will have HTTP.VERBOSE set to 1.
+<p>
+Similarly, 
+<pre>
+http://fake.ucar.edu:9090/dts/test.01
+</pre>
+will have HTTP.VERBOSE set to 0.
+
+<h2 class="break"><a name="CLIENTCERTS"><u>Client-Side Certificates</u></a></h2> 
+Some systems, notably ESG (Earth System Grid), requires
+the use of client-side certificates, as well as being
+<a href="#REDIR">re-direction based</a>.
+This requires setting the following entries:
+<ul>
+<li>HTTP.COOKIEJAR — a file path for storing cookies across re-direction.
+<li>HTTP.NETRC — the path to the netrc file.
+<li>HTTP.SSL.CERTIFICATE — the file path for the client side certificate file.
+<li>HTTP.SSL.KEY — this should have the same value as HTTP.SSL.CERTIFICATE.
+<li>HTTP.SSL.CAPATH — the path to a "certificates" directory.
+<li>HTTP.SSL.VALIDATE — force validation of the server certificate.
+</ul>
+Note that the first two are to support re-direction based authentication.
+
+<h5 class="break"><a name="allkeys"><u>Appendix A. All RC-File Keys</u></a></h5> 
+For completeness, this is the list of all rc-file keys.
+<table>
+<tr><th>Key<th>curl_easy_setopt Option
+<tr valign="top"><td>HTTP.DEFLATE<td>CUROPT_DEFLATE<br>with value "deflate,gzip"
+<tr><td>HTTP.VERBOSE <td>CUROPT_VERBOSE 
+<tr><td>HTTP.TIMEOUT<td>CUROPT_TIMEOUT
+<tr><td>HTTP.USERAGENT<td>CUROPT_USERAGENT
+<tr><td>HTTP.COOKIEJAR<td>CUROPT_COOKIEJAR
+<tr><td>HTTP.COOKIE_JAR<td>CUROPT_COOKIEJAR
+<tr valign="top"><td>HTTP.PROXY_SERVER<td>CURLOPT_PROXY,<br>CURLOPT_PROXYPORT,<br>CURLOPT_PROXYUSERPWD
+<tr><td>HTTP.SSL.CERTIFICATE<td>CUROPT_SSLCERT
+<tr><td>HTTP.SSL.KEY<td>CUROPT_SSLKEY
+<tr><td>HTTP.SSL.KEYPASSWORD<td>CUROPT_KEYPASSWORD
+<tr><td>HTTP.SSL.CAINFO<td>CUROPT_SSLCAINFO
+<tr><td>HTTP.SSL.CAPATH<td>CUROPT_SSLCAPATH
+<tr><td>HTTP.SSL.VERIFYPEER<td>CUROPT_SSL_VERIFYPEER
+<tr><td>HTTP.CREDENTIALS.USERPASSWORD<td>CUROPT_USERPASSWORD
+<tr><td>HTTP.NETRC<td>CURLOPT_NETRC,CURLOPT_NETRC_FILE
+</table>
+</ul>
+
+<h5 class="break"><a name="ESGDETAIL"><u>Appendix B. ESG Access in Detail</u></a></h5> 
+It is possible to access Earth Systems Grid (ESG) datasets
+from ESG servers through the OC API using the techniques
+described in the section on <a href="#CLIENTCERTS">Client-Side Certificates</a>.
+<p>
+In order to access ESG datasets, however, it is necessary to
+register as a user with ESG and to setup your environment
+so that proper authentication is established between an oc
+client program and the ESG data server.  Specifically, it
+is necessary to use what is called "client-side keys" to
+enable this authentication. Normally, when a client accesses
+a server in a secure fashion (using "https"), the server
+provides an authentication certificate to the client.
+With client-side keys, the client must also provide a
+certificate to the server so that the server can know with
+whom it is communicating.
+<p>
+The oc library uses the <i>curl</i> library and it is that
+underlying library that must be properly configured.
+
+<h3><u>Terminology</u></h3>
+The key elements for client-side keys requires the constructions of
+two "stores" on the client side.
+<ul>
+<li> Keystore - a repository to hold the client side key.
+<li> Truststore - a repository to hold a chain of certificates
+                  that can be used to validate the certificate
+		  sent by the server to the client.
+</ul>
+The server actually has a similar set of stores, but the client
+need not be concerned with those.
+
+<h3><u>Initial Steps</u></h3>
+
+The first step is to obtain authorization from ESG.
+Note that this information may evolve over time, and
+may be out of date.
+This discussion is in terms of BADC and NCSA. You will need
+to substitute as necessary.
+<ol>
+<li> Register at http://badc.nerc.ac.uk/register
+   to obtain access to badc and to obtain an openid,
+   which will looks something like:
+   <pre>https://ceda.ac.uk/openid/Firstname.Lastname</pre>
+<li> Ask BADC for access to whatever datasets are of interest.
+<p>
+<li> Obtain short term credentials at
+   http://grid.ncsa.illinois.edu/myproxy/MyProxyLogon/
+   You will need to download and run the MyProxyLogon
+   program.
+   This will create a keyfile in, typically, the directory ".globus".
+   The keyfile will have a name similar to this: "x509up_u13615"
+   The other elements in ".globus" are certificates to use in
+   validating the certificate your client gets from the server.
+<p>
+<li> Obtain the program source ImportKey.java
+   from this location: http://www.agentbob.info/agentbob/79-AB.html
+   (read the whole page, it will help you understand the remaining steps).
+</ol>
+
+<h3><u>Building the KeyStore</u></h3>
+You will have to modify the keyfile in the previous step
+and then create a keystore and install the key and a certificate.
+The commands are these:
+<pre>
+    openssl pkcs8 -topk8 -nocrypt -in x509up_u13615 -inform PEM -out key.der -outform DER
+
+    openssl x509 -in x509up_u13615 -inform PEM -out cert.der -outform DER
+
+    java -classpath <path to ImportKey.class> -Dkeypassword="<password>" -Dkeystore=./<keystorefilename> key.der cert.der
+</pre>     
+Note, the file names "key.der" and "cert.der" can be whatever you choose.
+It is probably best to leave the .der extension, though.
+
+<h3><u>Building the TrustStore</u></h3>
+Building the truststore is a bit tricky because as provided, the
+certificates in ".globus" need some massaging. See the script below
+for the details. The primary command is this, which is executed for every
+certificate, c, in globus. It sticks the certificate into the file
+named "truststore"
+<pre>
+  keytool -trustcacerts -storepass "password" -v -keystore "truststore"  -importcert -file "${c}"
+</pre>
+
+<h3><u>Running the C Client</u></h3>
+
+Refer to the section on <a href="#CLIENTCERTS">Client-Side Certificates</a>.
+The keys specified there  must be set in the rc file to support
+ESG access.
+<ul>
+<li> HTTP.COOKIEJAR=~/.dods_cookies
+<li> HTTP.NETRC=~/.netrc
+<li> HTTP.SSL.CERTIFICATE=~/esgkeystore
+<li> HTTP.SSL.KEY=~/esgkeystore
+<li> HTTP.SSL.CAPATH=~/.globus
+<li> HTTP.SSL.VALIDATE=1
+</ul>
+Of course, the file paths above are suggestions only;
+you can modify as needed.
+The HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY
+entries should have same value, which is the file path for the
+certificate produced by MyProxyLogon.  The HTTP.SSL.CAPATH entry
+should be the path to the "certificates" directory produced by
+MyProxyLogon.
+<p>
+As noted, also uses re-direction based authentication.
+So, when it receives an initial connection from a client, it
+redirects to a separate authentication server. When that
+server has authenticated the client, it redirects back to
+the original url to complete the request.
+
+<h3><u>Script for creating Stores</u></h3>
+The following script shows in detail how to actually construct the key
+and trust stores. It is specific to the format of the globus file
+as it was when ESG support was first added. It may have changed
+since then, in which case, you will need to seek some help
+in fixing this script. It would help if you communicated
+what you changed to the author so this document can be updated.
+<pre>
+#!/bin/sh -x
+KEYSTORE="esgkeystore"
+TRUSTSTORE="esgtruststore"
+GLOBUS="globus"
+TRUSTROOT="certificates"
+CERT="x509up_u13615"
+TRUSTROOTPATH="$GLOBUS/$TRUSTROOT"
+CERTFILE="$GLOBUS/$CERT"
+PWD="password"
+
+D="-Dglobus=$GLOBUS"
+CCP="bcprov-jdk16-145.jar" 
+CP="./build:${CCP}" 
+JAR="myproxy.jar"
+
+# Initialize needed directories
+rm -fr build
+mkdir build
+rm -fr $GLOBUS
+mkdir $GLOBUS
+rm -f $KEYSTORE
+rm -f $TRUSTSTORE
+
+# Compile MyProxyCmd and ImportKey
+javac -d ./build -classpath "$CCP" *.java
+javac -d ./build ImportKey.java
+
+# Execute MyProxyCmd
+java -cp "$CP myproxy.MyProxyCmd
+
+# Build the keystore
+openssl pkcs8 -topk8 -nocrypt -in $CERTFILE -inform PEM -out key.der -outform DER
+openssl x509 -in $CERTFILE -inform PEM -out cert.der -outform DER
+java -Dkeypassword=$PWD -Dkeystore=./${KEYSTORE} -cp ./build ImportKey key.der cert.der
+
+# Clean up the certificates in the globus directory
+for c in ${TRUSTROOTPATH}/*.0 ; do
+    alias=`basename $c .0`
+    sed -e '0,/---/d' <$c >/tmp/${alias}
+    echo "-----BEGIN CERTIFICATE-----" >$c       
+    cat /tmp/${alias} >>$c
+done
+ 
+# Build the truststore
+for c in ${TRUSTROOTPATH}/*.0 ; do
+    alias=`basename $c .0`
+    echo "adding: $TRUSTROOTPATH/${c}"
+    echo "alias: $alias"
+    yes | keytool -trustcacerts -storepass "$PWD" -v -keystore ./$TRUSTSTORE -alias $alias -importcert -file "${c}"
+done
+exit
+</pre>
+
+</body> 
+</html> 
diff --git a/oc2/occurlfunctions.c b/oc2/occurlfunctions.c
index 10ebdff..29fee70 100644
--- a/oc2/occurlfunctions.c
+++ b/oc2/occurlfunctions.c
@@ -252,10 +252,10 @@ oc_set_curl_options(OCstate* state)
     hostport = occombinehostport(state->uri);
     if(hostport == NULL) {
       hostport = (char*)malloc(sizeof(char)*1);
-      *hostport = "";
+      *hostport = '\0';
     }
 
-    store = &ocglobalstate.rc.ocrc;
+    store = &ocglobalstate.rc.daprc;
     triple = store->triples;
 
     /* Assume that the triple store has been properly sorted */
@@ -275,7 +275,7 @@ oc_set_curl_options(OCstate* state)
         stat = ocset_curlopt(state,ocflag->flag,cvt(triple->value,ocflag->type));
     }
  done:
-    if(hostport && strcmp(hostport,"") != 0) free(hostport);
+    if(hostport && strlen(hostport) > 0) free(hostport);
     return stat;
 }
 
diff --git a/oc2/ocdata.c b/oc2/ocdata.c
index 6344420..cec5880 100644
--- a/oc2/ocdata.c
+++ b/oc2/ocdata.c
@@ -238,7 +238,7 @@ ocdata_read(OCstate* state, OCdata* data, size_t start, size_t count,
 {
     int stat = OC_NOERR;
     XXDR* xdrs;
-    OCtype etype, octype;
+    OCtype etype;
     int isscalar;
     size_t elemsize, totalsize, countsize;
     OCnode* pattern;
@@ -251,8 +251,7 @@ ocdata_read(OCstate* state, OCdata* data, size_t start, size_t count,
     assert(memsize > 0);
 
     pattern = data->pattern;
-    octype = pattern->octype;
-    assert(octype == OC_Atomic);
+    assert(pattern->octype == OC_Atomic);
     etype = pattern->etype;
 
     isscalar = (pattern->array.rank == 0 ? 1 : 0);
diff --git a/oc2/ocdata.h b/oc2/ocdata.h
index ffdb6bb..0711ac3 100644
--- a/oc2/ocdata.h
+++ b/oc2/ocdata.h
@@ -17,8 +17,8 @@ struct OCdata {
     OCnode*   pattern;
     OCdata*   container; /* link back to container instance */
     size_t    index;     /* WRT to the container */
-    off_t     xdroffset;	/* Of this instance wrt xxdr_getpos() */
-    off_t     xdrsize;   /* for leafs, and as defined by xdr; if known else 0*/
+    off_t  xdroffset;	/* Of this instance wrt xxdr_getpos() */
+    off_t  xdrsize;   /* for leafs, and as defined by xdr; if known else 0*/
     size_t    ninstances;/* |instances| */
     OCdata**  instances;	/* vector of instances; if rank > 0, then
                                    it captures the array elements, else
diff --git a/oc2/ocinternal.c b/oc2/ocinternal.c
index 0623e6a..7d2a67c 100644
--- a/oc2/ocinternal.c
+++ b/oc2/ocinternal.c
@@ -12,6 +12,10 @@
 #endif
 #include <errno.h>
 
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
+
 #include "ocinternal.h"
 #include "ocdebug.h"
 #include "occlientparams.h"
@@ -69,12 +73,14 @@ ocinternalinitialize(void)
 {
     int stat = OC_NOERR;
 
+#if 0
     if(sizeof(off_t) != sizeof(void*)) {
       fprintf(stderr,"OC xxdr depends on the assumption that sizeof(off_t) == sizeof(void*)\n");
       //Commenting out for now, as this does not hold true on 32-bit
       //linux systems.
       //OCASSERT(sizeof(off_t) == sizeof(void*));
     }
+#endif
 
     if(!ocglobalstate.initialized) {
       memset((void*)&ocglobalstate,0,sizeof(ocglobalstate));
@@ -609,7 +615,8 @@ ocset_curlproperties(OCstate* state)
 	/* If no cookie file was defined, define a default */
 	char tmp[OCPATHMAX+1];
         int stat;
-	snprintf(tmp,sizeof(tmp)-1,"%s/%s/",ocglobalstate.tempdir,OCDIR);
+	pid_t pid = getpid();
+	snprintf(tmp,sizeof(tmp)-1,"%s/%s.%ld/",ocglobalstate.tempdir,OCDIR,(long)pid);
 #ifdef _MSC_VER
 	stat = mkdir(tmp);
 #else
@@ -627,7 +634,7 @@ ocset_curlproperties(OCstate* state)
 	    fprintf(stderr,"Cannot create cookie file\n");
 	    goto fail;
 	}
-		errno = 0;
+	errno = 0;
     }
     OCASSERT(state->curlflags.cookiejar != NULL);
 
diff --git a/oc2/ocinternal.h b/oc2/ocinternal.h
index 7f72e78..be20ac0 100644
--- a/oc2/ocinternal.h
+++ b/oc2/ocinternal.h
@@ -167,7 +167,7 @@ extern struct OCGLOBALSTATE {
     struct {
 	int ignore; /* if 1, then do not use any rc file */
 	int loaded;
-        struct OCTriplestore ocrc; /* the rc file triple store fields*/
+        struct OCTriplestore daprc; /* the rc file triple store fields*/
         char* rcfile; /* specified rcfile; overrides anything else */
     } rc;
 } ocglobalstate;
diff --git a/oc2/ocrc.c b/oc2/ocrc.c
index f387f0f..042e8fe 100644
--- a/oc2/ocrc.c
+++ b/oc2/ocrc.c
@@ -13,6 +13,8 @@
 #include "ocdebug.h"
 #include "oclog.h"
 
+#define OCRCFILEENV "DAPRCFILE"
+
 #define RTAG ']'
 #define LTAG '['
 
@@ -27,7 +29,7 @@ static char* combinecredentials(const char* user, const char* pwd);
 static void storedump(char* msg, struct OCTriple*, int ntriples);
 
 /* Define default rc files and aliases, also defines search order*/
-static char* rcfilenames[] = {".ocrc",".dodsrc",NULL};
+static char* rcfilenames[] = {".daprc",".dodsrc",NULL};
 
 /* The Username and password are in the URL if the URL is of the form:
  * http://<name>:<passwd>@<host>/....
@@ -123,7 +125,7 @@ static void
 rctrim(char* text)
 {
     char* p = text;
-    size_t len = 0;
+    size_t len = strlen(text);
     int i;
     /* locate first non-trimchar */
     for(;*p;p++) {
@@ -270,7 +272,7 @@ ocrc_compile(const char* path)
     char line0[MAXRCLINESIZE+1];
     FILE *in_file = NULL;
     int linecount = 0;
-    struct OCTriplestore* ocrc = &ocglobalstate.rc.ocrc;
+    struct OCTriplestore* ocrc = &ocglobalstate.rc.daprc;
 
     ocrc->ntriples = 0; /* reset; nothing to free */
 
@@ -347,7 +349,7 @@ ocrc_compile(const char* path)
         ocrc->ntriples++;
     }
     fclose(in_file);
-    sorttriplestore(&ocglobalstate.rc.ocrc);
+    sorttriplestore(&ocglobalstate.rc.daprc);
     return 1;
 }
 
@@ -364,10 +366,16 @@ ocrc_load(void)
     }
     if(ocglobalstate.rc.loaded) return OC_NOERR;
 
-    /* locate the configuration files: first if specified,
-       then '.',  then $HOME */
+    /* locate the configuration files in the following order:
+       1. specified by set_rcfile
+       2. set by DAPRCFILE env variable
+       3. '.'
+       4. $HOME
+    */  
     if(ocglobalstate.rc.rcfile != NULL) { /* always use this */
-	path = ocglobalstate.rc.rcfile;
+	path = strdup(ocglobalstate.rc.rcfile);
+    } else if(getenv(OCRCFILEENV) != NULL && strlen(getenv(OCRCFILEENV)) > 0) {
+        path = strdup(getenv(OCRCFILEENV));
     } else {
 	char** rcname;
 	int found = 0;
@@ -559,7 +567,7 @@ static struct OCTriple*
 ocrc_locate(char* key, char* hostport)
 {
     int i,found;
-    struct OCTriplestore* ocrc = &ocglobalstate.rc.ocrc;
+    struct OCTriplestore* ocrc = &ocglobalstate.rc.daprc;
     struct OCTriple* triple;
 
     if(ocglobalstate.rc.ignore)
@@ -601,7 +609,7 @@ static void
 storedump(char* msg, struct OCTriple* triples, int ntriples)
 {
     int i;
-    struct OCTriplestore* ocrc = &ocglobalstate.rc.ocrc;
+    struct OCTriplestore* ocrc = &ocglobalstate.rc.daprc;
 
     if(msg != NULL) fprintf(stderr,"%s\n",msg);
     if(ocrc == NULL) {
diff --git a/oc2/ocuri.c b/oc2/ocuri.c
index 985ee2d..3f18a55 100644
--- a/oc2/ocuri.c
+++ b/oc2/ocuri.c
@@ -593,12 +593,10 @@ ocuridecodeparams(OCURI* ocuri)
     int nparams;
     char* params = NULL;
     char** plist;
-    size_t len;
 
     if(ocuri == NULL) return 0;
     if(ocuri->params == NULL) return 1;
 
-    len = strlen(ocuri->params);
     params = strdup(ocuri->params);
     if(params == NULL)
 	return 0; /* no memory */
diff --git a/oc2/xxdr.h b/oc2/xxdr.h
index b4f5ecb..8139892 100644
--- a/oc2/xxdr.h
+++ b/oc2/xxdr.h
@@ -116,8 +116,7 @@ typedef struct XXDR XXDR; /* forward */
 /* Assume |off_t| == |void*| */
 struct XXDR {
   char* data;
-  off_t pos; /* relative to data;
-                 may be a cache of underlying stream pos */
+  off_t pos; /* relative to data; may be a cache of underlying stream pos */
   int valid;         /* 1=>underlying stream pos == pos */
   off_t base; /* beginning of data in case bod != 0*/
   off_t length; /* total size of available data (relative to base)*/
@@ -126,7 +125,7 @@ struct XXDR {
   int (*setpos)(XXDR*,off_t);
   off_t (*getpos)(XXDR*);
   off_t (*getavail)(XXDR*);
-  void (*free)(XXDR*);		  /* xdr kind specific free function */
+  void (*free)(XXDR*); /* xdr kind specific free function */
 };
 
 /* Track network order */
diff --git a/test-driver b/test-driver
index d306056..8e575b0 100755
--- a/test-driver
+++ b/test-driver
@@ -3,7 +3,7 @@
 
 scriptversion=2013-07-13.22; # UTC
 
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 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
@@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15
 # Test script is run here.
 "$@" >$log_file 2>&1
 estatus=$?
+
 if test $enable_hard_errors = no && test $estatus -eq 99; then
-  estatus=1
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
 fi
 
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
   0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
   0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
   77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
@@ -119,6 +122,12 @@ case $estatus:$expect_failure in
   *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
 esac
 
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
 # Report outcome to console.
 echo "${col}${res}${std}: $test_name"
 
diff --git a/wjna b/wjna
deleted file mode 100644
index 82e3aa3..0000000
--- a/wjna
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-REBUILD=1
-
-#VS=12
-VS=10
-
-JNADIR="c:/opt/jna"
-
-PREFIX="${JNADIR}"
-
-CPP="${JNADIR}/deps/shared"
-
-FLAGS=""
-
-FLAGS="-DCMAKE_INSTALL_PREFIX=${PREFIX} ${FLAGS}"
-FLAGS="-DCMAKE_PREFIX_PATH=${CPP} ${FLAGS}"
-
-FLAGS="-DHDF5_DIR=${CPP}/cmake/hdf5 ${FLAGS}"
-
-FLAGS="-DENABLE_CONVERSION_WARNINGS=OFF ${FLAGS}"
-FLAGS="-DBUILD_UTILITIES=OFF ${FLAGS}"
-FLAGS="-DENABLE_EXAMPLES=OFF ${FLAGS}"
-FLAGS="-DENABLE_V2_API=OFF ${FLAGS}"
-FLAGS="-DENABLE_JNA=ON ${FLAGS}"
-
-if test "x${REBUILD}" = x1 ; then
-  rm -fr ./build
-  mkdir build
-fi
-pushd build
-if test "x${REBUILD}" = x1 ; then
-cmake -G"Visual Studio ${VS}" ${FLAGS} ..
-fi
-cmake --build . --config Release
-cmake --build . --target INSTALL
-popd
-
-pushd ${PREFIX}
-sh ../setup
-popd
-
-exit

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/netcdf.git



More information about the Pkg-grass-devel mailing list