summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-03-18 18:05:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-03-18 18:05:13 (GMT)
commita60882019308257ff1da09196f0d3b9129e70346 (patch)
tree5aebcd5d1808cf1452f05773fd62cfbd8fbed12c
parent0e58a80e89c70902d65e6163c539fbebe11bfa28 (diff)
downloadhdf5-a60882019308257ff1da09196f0d3b9129e70346.zip
hdf5-a60882019308257ff1da09196f0d3b9129e70346.tar.gz
hdf5-a60882019308257ff1da09196f0d3b9129e70346.tar.bz2
[svn-r18422] Description:
Bring r18413:18420 from trunk to 1.8 branch: - unify srcdir query, etc. - Move libhdf5.settings string out of H5Tinit.c Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
-rw-r--r--MANIFEST8
-rw-r--r--c++/test/H5srcdir_str.h.in22
-rw-r--r--c++/test/Makefile.in8
-rw-r--r--c++/test/th5s.cpp1
-rwxr-xr-xconfigure7
-rw-r--r--configure.in3
-rw-r--r--hl/test/H5srcdir_str.h.in22
-rw-r--r--hl/test/Makefile.in8
-rw-r--r--hl/test/test_ds.c1
-rw-r--r--hl/test/test_image.c1
-rw-r--r--hl/test/test_lite.c1
-rw-r--r--hl/test/test_table.c1
-rw-r--r--src/H5.c2
-rw-r--r--src/H5detect.c101
-rw-r--r--src/H5make_libsettings.c278
-rw-r--r--src/H5private.h1
-rwxr-xr-xsrc/Makefile.am18
-rw-r--r--src/Makefile.in29
-rw-r--r--test/H5srcdir.h74
-rw-r--r--test/H5srcdir_str.h.in22
-rw-r--r--test/Makefile.in12
-rwxr-xr-xtest/cross_read.c1
-rw-r--r--test/dsets.c1
-rw-r--r--test/external.c1
-rw-r--r--test/fillval.c1
-rw-r--r--test/h5test.c1
-rw-r--r--test/links.c1
-rw-r--r--test/mtime.c1
-rwxr-xr-xtest/objcopy.c1
-rw-r--r--test/ohdr.c2
-rw-r--r--test/tarray.c1
-rw-r--r--test/tfile.c1
-rw-r--r--test/th5s.c1
-rw-r--r--test/tmisc.c1
-rw-r--r--windows/c++/test/H5srcdir_str.h22
-rw-r--r--windows/hl/test/H5srcdir_str.h22
-rw-r--r--windows/test/H5srcdir_str.h22
37 files changed, 582 insertions, 118 deletions
diff --git a/MANIFEST b/MANIFEST
index 7ea7193..8995d62 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -339,6 +339,7 @@
./c++/src/header_files/image001.jpg
./c++/src/header_files/image002.jpg
+./c++/test/H5srcdir_str.h.in
./c++/test/Makefile.am
./c++/test/Makefile.in
./c++/test/dsets.cpp
@@ -417,6 +418,7 @@
./src/H5err.txt
./src/H5config.h.in
./src/H5detect.c
+./src/H5make_libsettings.c
./src/H5overflow.txt
./src/H5overflow.h
./src/H5private.h
@@ -761,6 +763,8 @@
./src/H5win32defs.h
./test/COPYING
+./test/H5srcdir.h
+./test/H5srcdir_str.h.in
./test/Makefile.am
./test/Makefile.in
./test/app_ref.c
@@ -1666,6 +1670,7 @@
./hl/src/H5TBpublic.h
./hl/src/hdf5_hl.h
./hl/test/COPYING
+./hl/test/H5srcdir_str.h.in
./hl/test/Makefile.am
./hl/test/Makefile.in
./hl/test/dsdata.txt
@@ -1836,6 +1841,7 @@
./windows/c++/examples/writedatatestdll/writedatatestdll.vcproj
# C++ Tests
+./windows/c++/test/H5srcdir_str.h
./windows/c++/test/checkcpptests.bat
./windows/c++/test/dsets_cpp/dsets_cpp.vcproj
./windows/c++/test/dsets_cppdll/dsets_cppdll.vcproj
@@ -1980,6 +1986,7 @@
./windows/hl/fortran/test/hl_test_table_fortrandll/hl_test_table_fortrandll.vfproj
# High-Level Library Tests
+./windows/hl/test/H5srcdir_str.h
./windows/hl/test/checkhltests.bat
./windows/hl/test/hl_test_ds/hl_test_ds.vcproj
./windows/hl/test/hl_test_dsdll/hl_test_dsdll.vcproj
@@ -2039,6 +2046,7 @@
./windows/src/H5pubconf.h
# Library Test Projects
+./windows/test/H5srcdir_str.h
./windows/test/checktests.bat
./windows/test/testerror.bat
./windows/test/app_ref/app_ref.vcproj
diff --git a/c++/test/H5srcdir_str.h.in b/c++/test/H5srcdir_str.h.in
new file mode 100644
index 0000000..d472124
--- /dev/null
+++ b/c++/test/H5srcdir_str.h.in
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = "@srcdir@";
+
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 9598e3c..03c8ff7 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -50,8 +50,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am
# Shared C++ libraries aren't universally supported.
@@ -65,7 +65,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = H5srcdir_str.h
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = testhdf5$(EXEEXT)
am_testhdf5_OBJECTS = testhdf5.$(OBJEXT) dsets.$(OBJEXT) \
@@ -420,6 +420,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index 58f26f0..7e9c9c3 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -43,6 +43,7 @@
#endif
#include "h5cpputil.h" // C++ utilility header file
+#include "H5srcdir.h" // srcdir querying header file
const H5std_string TESTFILE("th5s.h5");
const H5std_string DATAFILE("th5s1.h5");
diff --git a/configure b/configure
index ca71afc..2edd79c 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Id: configure.in 18351 2010-02-28 23:56:20Z hdftest .
+# From configure.in Id: configure.in 18408 2010-03-15 04:27:59Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.64 for HDF5 1.8.4-snap16.
#
@@ -28267,7 +28267,7 @@ if test -n "$TESTPARALLEL"; then
fi
fi
-ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/testlibinfo.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/examples/Makefile c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile"
+ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile"
cat >confcache <<\_ACEOF
@@ -29479,6 +29479,7 @@ do
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
"test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;;
"test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;;
+ "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;;
"test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;;
"testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;;
"testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;;
@@ -29508,6 +29509,7 @@ do
"c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;;
"c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;;
"c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES c++/test/Makefile" ;;
+ "c++/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES c++/test/H5srcdir_str.h" ;;
"c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES c++/examples/Makefile" ;;
"c++/examples/testh5c++.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/testh5c++.sh" ;;
"fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;;
@@ -29520,6 +29522,7 @@ do
"hl/Makefile") CONFIG_FILES="$CONFIG_FILES hl/Makefile" ;;
"hl/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/src/Makefile" ;;
"hl/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/test/Makefile" ;;
+ "hl/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES hl/test/H5srcdir_str.h" ;;
"hl/tools/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/Makefile" ;;
"hl/tools/gif2h5/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/Makefile" ;;
"hl/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/examples/Makefile" ;;
diff --git a/configure.in b/configure.in
index 9af766d..5148477 100644
--- a/configure.in
+++ b/configure.in
@@ -4058,6 +4058,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
test/Makefile
test/testcheck_version.sh
test/testerror.sh
+ test/H5srcdir_str.h
test/testlibinfo.sh
testpar/Makefile
testpar/testph5.sh
@@ -4087,6 +4088,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
c++/src/Makefile
c++/src/h5c++
c++/test/Makefile
+ c++/test/H5srcdir_str.h
c++/examples/Makefile
c++/examples/testh5c++.sh
fortran/Makefile
@@ -4099,6 +4101,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
hl/Makefile
hl/src/Makefile
hl/test/Makefile
+ hl/test/H5srcdir_str.h
hl/tools/Makefile
hl/tools/gif2h5/Makefile
hl/examples/Makefile
diff --git a/hl/test/H5srcdir_str.h.in b/hl/test/H5srcdir_str.h.in
new file mode 100644
index 0000000..d472124
--- /dev/null
+++ b/hl/test/H5srcdir_str.h.in
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = "@srcdir@";
+
diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in
index a364c75..4f86240 100644
--- a/hl/test/Makefile.in
+++ b/hl/test/Makefile.in
@@ -53,8 +53,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
check_PROGRAMS = $(am__EXEEXT_1)
@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2)
@@ -66,7 +66,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = H5srcdir_str.h
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = test_lite$(EXEEXT) test_image$(EXEEXT) \
test_table$(EXEEXT) test_ds$(EXEEXT) test_packet$(EXEEXT)
@@ -448,6 +448,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index ae4bf97..20baa2d 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5DSpublic.h"
#include "H5LTpublic.h"
#include "H5IMpublic.h"
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 426ae1d..29799e5 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5LTpublic.h"
#include "H5IMpublic.h"
#include "pal_rgb.h"
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 2012e8f..9fa2f83 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5LTpublic.h"
#define FILE_NAME "test_lite1.h5"
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 3438f15..a3d5f77 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5TBpublic.h"
#define TEST_FILE_BE "test_table_be.hdf5"
diff --git a/src/H5.c b/src/H5.c
index f4125e3..e94b1b4 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -22,6 +22,8 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5lib_settings.h" /* Library build setings */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free lists */
diff --git a/src/H5detect.c b/src/H5detect.c
index ebd042d..8fc1690 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -109,7 +109,6 @@ static void detect_C99_integers32(void);
static void detect_C99_integers64(void);
static void detect_alignments(void);
static void insert_libhdf5_settings(FILE *flibinfo);
-static void make_libinfo(void);
static size_t align_g[] = {1, 2, 4, 8, 16};
static jmp_buf jbuf_g;
@@ -504,99 +503,6 @@ sigbus_handler(int UNUSED signo)
/*-------------------------------------------------------------------------
- * Function: insert_libhdf5_settings
- *
- * Purpose: insert the contents of libhdf5.settings into a file
- * represented by flibinfo.
- * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
- * defined, i.e., not enabled.
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * Apr 20, 2009
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-#define LIBSETTINGSFNAME "libhdf5.settings"
-static void
-insert_libhdf5_settings(FILE *flibinfo)
-{
-#ifdef H5_HAVE_EMBEDDED_LIBINFO
- FILE *fsettings; /* for files libhdf5.settings */
- int inchar;
- int bol=0; /* indicates the beginning of a new line */
-
- if (NULL==(fsettings=HDfopen(LIBSETTINGSFNAME, "r"))){
- perror(LIBSETTINGSFNAME);
- exit(1);
- }
- /* print variable definition and the string */
- fprintf(flibinfo, "char H5libhdf5_settings[]=\n");
- bol++;
- while (EOF != (inchar = getc(fsettings))){
- if (bol){
- /* Start a new line */
- fprintf(flibinfo, "\t\"");
- bol = 0;
- }
- if (inchar == '\n'){
- /* end of a line */
- fprintf(flibinfo, "\\n\"\n");
- bol++;
- }else{
- putc(inchar, flibinfo);
- }
- }
- if (feof(fsettings)){
- /* wrap up */
- if (!bol){
- /* EOF found without a new line */
- fprintf(flibinfo, "\\n\"\n");
- };
- fprintf(flibinfo, ";\n\n");
- }else{
- fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
- exit(1);
- }
- if (0 != fclose(fsettings)){
- perror(LIBSETTINGSFNAME);
- exit(1);
- }
-#else
- /* print variable definition and an empty string */
- fprintf(flibinfo, "char H5libhdf5_settings[]=\"\";\n");
-#endif
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: make_libinfo
- *
- * Purpose: Create the embedded library information definition.
- * This sets up for a potential extension that the declaration
- * is printed to a file different from stdout.
- *
- * Return: void
- *
- * Programmer: Albert Cheng
- * Sep 15, 2009
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-make_libinfo(void)
-{
- /* print variable definition and then the string as a macro. */
- insert_libhdf5_settings(stdout);
-}
-
-
-/*-------------------------------------------------------------------------
* Function: print_results
*
* Purpose: Prints information about the detected data types.
@@ -677,9 +583,6 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align)
/*******************/\n\
\n");
- /* Generate embedded library information variable definition */
- make_libinfo();
-
/* The interface initialization function */
printf("\n\
\n\
@@ -1154,8 +1057,8 @@ find_bias(int epos, int esize, int *perm, void *_a)
/*-------------------------------------------------------------------------
* Function: print_header
- *
- * Purpose: Prints the C file header for the generated file.
+ *
+ * Purpose: Prints the C file header for the generated file.
*
* Return: void
*
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
new file mode 100644
index 0000000..771c510
--- /dev/null
+++ b/src/H5make_libsettings.c
@@ -0,0 +1,278 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*keep this declaration near the top of this file -RPM*/
+static const char *FileHeader = "\n\
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\
+ * Copyright by The HDF Group. *\n\
+ * Copyright by the Board of Trustees of the University of Illinois. *\n\
+ * All rights reserved. *\n\
+ * *\n\
+ * This file is part of HDF5. The full HDF5 copyright notice, including *\n\
+ * terms governing use, modification, and redistribution, is contained in *\n\
+ * the files COPYING and Copyright.html. COPYING can be found at the root *\n\
+ * of the source code distribution tree; Copyright.html can be found at the *\n\
+ * root level of an installed copy of the electronic HDF5 document set and *\n\
+ * is linked from the top-level documents page. It can also be found at *\n\
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\
+ * access to either file, you may request a copy from help@hdfgroup.org. *\n\
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *";
+/*
+ *
+ * Created: H5make_libsettings.c
+ * 17 Mar 2010
+ * Quincey Koziol
+ *
+ * Purpose: Generate the H5libsettings.h header file from the
+ * libhdf5.settings file.
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <stdio.h>
+#include <time.h>
+#include "H5private.h"
+
+#define LIBSETTINGSFNAME "libhdf5.settings"
+
+
+/*-------------------------------------------------------------------------
+ * Function: insert_libhdf5_settings
+ *
+ * Purpose: insert the contents of libhdf5.settings into a file
+ * represented by flibinfo.
+ * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not
+ * defined, i.e., not enabled.
+ *
+ * Return: void
+ *
+ * Programmer: Albert Cheng
+ * Apr 20, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+insert_libhdf5_settings(FILE *flibinfo)
+{
+#ifdef H5_HAVE_EMBEDDED_LIBINFO
+ FILE *fsettings; /* for files libhdf5.settings */
+ int inchar;
+ int bol=0; /* indicates the beginning of a new line */
+
+ if (NULL==(fsettings=HDfopen(LIBSETTINGSFNAME, "r"))){
+ perror(LIBSETTINGSFNAME);
+ exit(1);
+ }
+ /* print variable definition and the string */
+ fprintf(flibinfo, "static const char H5libhdf5_settings[]=\n");
+ bol++;
+ while (EOF != (inchar = getc(fsettings))){
+ if (bol){
+ /* Start a new line */
+ fprintf(flibinfo, "\t\"");
+ bol = 0;
+ }
+ if (inchar == '\n'){
+ /* end of a line */
+ fprintf(flibinfo, "\\n\"\n");
+ bol++;
+ }else{
+ putc(inchar, flibinfo);
+ }
+ }
+ if (feof(fsettings)){
+ /* wrap up */
+ if (!bol){
+ /* EOF found without a new line */
+ fprintf(flibinfo, "\\n\"\n");
+ };
+ fprintf(flibinfo, ";\n\n");
+ }else{
+ fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
+ exit(1);
+ }
+ if (0 != fclose(fsettings)){
+ perror(LIBSETTINGSFNAME);
+ exit(1);
+ }
+#else
+ /* print variable definition and an empty string */
+ fprintf(flibinfo, "static const char H5libhdf5_settings[]=\"\";\n");
+#endif
+} /* insert_libhdf5_settings() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: make_libinfo
+ *
+ * Purpose: Create the embedded library information definition.
+ * This sets up for a potential extension that the declaration
+ * is printed to a file different from stdout.
+ *
+ * Return: void
+ *
+ * Programmer: Albert Cheng
+ * Sep 15, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+make_libinfo(void)
+{
+ /* print variable definition and then the string as a macro. */
+ insert_libhdf5_settings(stdout);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: print_header
+ *
+ * Purpose: Prints the C file header for the generated file.
+ *
+ * Return: void
+ *
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Mar 12 1997
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+print_header(void)
+{
+ time_t now = time(NULL);
+ struct tm *tm = localtime(&now);
+ char real_name[30];
+ char host_name[256];
+ int i;
+ const char *s;
+#ifdef H5_HAVE_GETPWUID
+ struct passwd *pwd = NULL;
+#else
+ int pwd = 1;
+#endif
+ static const char *month_name[] =
+ {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ static const char *purpose = "\
+This machine-generated source code contains\n\
+information about the library build configuration\n";
+
+ /*
+ * The real name is the first item from the passwd gecos field.
+ */
+#ifdef H5_HAVE_GETPWUID
+ {
+ size_t n;
+ char *comma;
+ if ((pwd = getpwuid(getuid()))) {
+ if ((comma = strchr(pwd->pw_gecos, ','))) {
+ n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos));
+ strncpy(real_name, pwd->pw_gecos, n);
+ real_name[n] = '\0';
+ } else {
+ strncpy(real_name, pwd->pw_gecos, sizeof(real_name));
+ real_name[sizeof(real_name) - 1] = '\0';
+ }
+ } else {
+ real_name[0] = '\0';
+ }
+ }
+#else
+ real_name[0] = '\0';
+#endif
+
+ /*
+ * The FQDM of this host or the empty string.
+ */
+#ifdef H5_HAVE_GETHOSTNAME
+ if (gethostname(host_name, sizeof(host_name)) < 0) {
+ host_name[0] = '\0';
+ }
+#else
+ host_name[0] = '\0';
+#endif
+
+ /*
+ * The file header: warning, copyright notice, build information.
+ */
+ printf("/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
+ puts(FileHeader); /*the copyright notice--see top of this file */
+
+ printf(" *\n * Created:\t\t%s %2d, %4d\n",
+ month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year);
+ if (pwd || real_name[0] || host_name[0]) {
+ printf(" *\t\t\t");
+ if (real_name[0]) printf("%s <", real_name);
+#ifdef H5_HAVE_GETPWUID
+ if (pwd) fputs(pwd->pw_name, stdout);
+#endif
+ if (host_name[0]) printf("@%s", host_name);
+ if (real_name[0]) printf(">");
+ putchar('\n');
+ }
+ printf(" *\n * Purpose:\t\t");
+ for (s = purpose; *s; s++) {
+ putchar(*s);
+ if ('\n' == *s && s[1]) printf(" *\t\t\t");
+ }
+
+ printf(" *\n * Modifications:\n *\n");
+ printf(" *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
+ printf(" *\tIt was generated by code in `H5make_libsettings.c'.\n");
+
+ printf(" *\n *");
+ for (i = 0; i < 73; i++) putchar('-');
+ printf("\n */\n\n");
+
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Main entry point.
+ *
+ * Return: Success: exit(0)
+ *
+ * Failure: exit(1)
+ *
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 12, 1996
+ *
+ * Modifications:
+ * Albert Cheng, 2004/05/20
+ * Some compilers, e.g., Intel C v7.0, took a long time to compile
+ * with optimization when a module routine contains many code lines.
+ * Divide up all those types detections macros into subroutines, both
+ * to avoid the compiler optimization error and cleaner codes.
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+
+ print_header();
+
+ /* Generate embedded library information variable definition */
+ make_libinfo();
+
+ return 0;
+}
+
diff --git a/src/H5private.h b/src/H5private.h
index 09ae4ab..71892a4 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1529,7 +1529,6 @@ typedef struct H5_debug_t {
extern H5_debug_t H5_debug_g;
#define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream)
-extern char H5libhdf5_settings[]; /* embedded library information */
/*-------------------------------------------------------------------------
* Purpose: These macros are inserted automatically just after the
diff --git a/src/Makefile.am b/src/Makefile.am
index 3da599b..4d36f21 100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,7 @@ include $(top_srcdir)/config/lt_vers.am
# Use -g to force no optimization since many compilers (e.g., Intel) takes
# a long time to compile it with any optimization on. H5detect is used
# to generate H5Tinit.c once. So, optimization is not critical.
-noinst_PROGRAMS = H5detect
+noinst_PROGRAMS = H5detect H5make_libsettings
H5detect_CFLAGS = -g $(AM_CFLAGS)
# Our main target, the HDF5 library
@@ -36,7 +36,7 @@ lib_LTLIBRARIES=libhdf5.la
libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
# H5Tinit.c is a generated file, and should be cleaned.
-MOSTLYCLEANFILES=H5Tinit.c
+MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.h
# H5pubconf.h is generated by configure, and should be cleaned.
DISTCLEANFILES=H5pubconf.h
@@ -129,6 +129,20 @@ H5Tinit.c: H5detect$(EXEEXT)
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
+H5.o H5.lo: H5lib_settings.h
+
+# Build configuration header file generation
+# The LD_LIBRARY_PATH setting is a kludge.
+# Things should have been all set during H5make_libsettings making.
+# Remove the generated .h file if errors occur unless HDF5_Make_Ignore
+# is set to ignore the error.
+H5lib_settings.h: H5make_libsettings$(EXEEXT) libhdf5.settings
+ LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
+ sed -e 's/-L/:/g' -e 's/ //g'`" \
+ $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > H5lib_settings.h || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ ($(RM) $@ ; exit 1)
+
# Error header generation
#
# Actually, H5Einit.h, H5Eterm.h, H5Edefin.h and H5Epubgen.h all
diff --git a/src/Makefile.in b/src/Makefile.in
index f3ac0eb..e77e877 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -59,7 +59,7 @@ DIST_COMMON = $(include_HEADERS) $(srcdir)/H5config.h.in \
$(srcdir)/libhdf5.settings.in $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am \
$(top_srcdir)/config/lt_vers.am COPYING
-noinst_PROGRAMS = H5detect$(EXEEXT)
+noinst_PROGRAMS = H5detect$(EXEEXT) H5make_libsettings$(EXEEXT)
TESTS =
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -153,6 +153,9 @@ H5detect_LDADD = $(LDADD)
H5detect_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(H5detect_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
+H5make_libsettings_SOURCES = H5make_libsettings.c
+H5make_libsettings_OBJECTS = H5make_libsettings.$(OBJEXT)
+H5make_libsettings_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
@@ -166,8 +169,8 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(libhdf5_la_SOURCES) H5detect.c
-DIST_SOURCES = $(libhdf5_la_SOURCES) H5detect.c
+SOURCES = $(libhdf5_la_SOURCES) H5detect.c H5make_libsettings.c
+DIST_SOURCES = $(libhdf5_la_SOURCES) H5detect.c H5make_libsettings.c
DATA = $(settings_DATA)
HEADERS = $(include_HEADERS)
ETAGS = etags
@@ -447,7 +450,7 @@ lib_LTLIBRARIES = libhdf5.la
libhdf5_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
# H5Tinit.c is a generated file, and should be cleaned.
-MOSTLYCLEANFILES = H5Tinit.c
+MOSTLYCLEANFILES = H5Tinit.c H5lib_settings.h
# H5pubconf.h is generated by configure, and should be cleaned.
DISTCLEANFILES = H5pubconf.h
@@ -643,6 +646,9 @@ clean-noinstPROGRAMS:
H5detect$(EXEEXT): $(H5detect_OBJECTS) $(H5detect_DEPENDENCIES)
@rm -f H5detect$(EXEEXT)
$(H5detect_LINK) $(H5detect_OBJECTS) $(H5detect_LDADD) $(LIBS)
+H5make_libsettings$(EXEEXT): $(H5make_libsettings_OBJECTS) $(H5make_libsettings_DEPENDENCIES)
+ @rm -f H5make_libsettings$(EXEEXT)
+ $(LINK) $(H5make_libsettings_OBJECTS) $(H5make_libsettings_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -881,6 +887,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5checksum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5dbg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5detect-H5detect.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5make_libsettings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5system.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5timer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5trace.Plo@am__quote@
@@ -1212,6 +1219,20 @@ H5Tinit.c: H5detect$(EXEEXT)
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
+H5.o H5.lo: H5lib_settings.h
+
+# Build configuration header file generation
+# The LD_LIBRARY_PATH setting is a kludge.
+# Things should have been all set during H5make_libsettings making.
+# Remove the generated .h file if errors occur unless HDF5_Make_Ignore
+# is set to ignore the error.
+H5lib_settings.h: H5make_libsettings$(EXEEXT) libhdf5.settings
+ LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
+ sed -e 's/-L/:/g' -e 's/ //g'`" \
+ $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > H5lib_settings.h || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ ($(RM) $@ ; exit 1)
+
# Error header generation
#
# Actually, H5Einit.h, H5Eterm.h, H5Edefin.h and H5Epubgen.h all
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
new file mode 100644
index 0000000..55700cb
--- /dev/null
+++ b/test/H5srcdir.h
@@ -0,0 +1,74 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Wednesday, March 17, 2010
+ *
+ * Purpose: srcdir querying support.
+ */
+#ifndef _H5SRCDIR_H
+#define _H5SRCDIR_H
+
+/* Include the header file with the correct relative path for the srcdir string */
+#include "H5srcdir_str.h"
+
+/* Buffer to construct path in and return pointer to */
+static char srcdir_path[1024] = "";
+
+/* Buffer to construct file in and return pointer to */
+static char srcdir_testpath[1024] = "";
+
+/* Append the test file name to the srcdir path and return the whole string */
+static const char *H5_get_srcdir_filename(const char *filename)
+{
+ const char *srcdir = HDgetenv("srcdir");
+
+ /* Check for using the srcdir from configure time */
+ if(NULL == srcdir)
+ srcdir = config_srcdir;
+
+ /* Build path to test file */
+ if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) {
+ HDstrcpy(srcdir_testpath, srcdir);
+ HDstrcat(srcdir_testpath, "/");
+ HDstrcat(srcdir_testpath, filename);
+ return(srcdir_testpath);
+ } /* end if */
+ else
+ return(NULL);
+}
+
+/* Just return the srcdir path */
+static const char *H5_get_srcdir(void)
+{
+ const char *srcdir = HDgetenv("srcdir");
+
+ /* Check for using the srcdir from configure time */
+ if(NULL == srcdir)
+ srcdir = config_srcdir;
+
+ /* Build path to all test files */
+ if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
+ HDstrcpy(srcdir_path, srcdir);
+ HDstrcat(srcdir_path, "/");
+ return(srcdir_path);
+ } /* end if */
+ else
+ return(NULL);
+}
+#endif /* _H5SRCDIR_H */
+
+
diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in
new file mode 100644
index 0000000..d472124
--- /dev/null
+++ b/test/H5srcdir_str.h.in
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = "@srcdir@";
+
diff --git a/test/Makefile.in b/test/Makefile.in
index 7a01edb..ad59f55 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -52,9 +52,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \
- $(srcdir)/testlibinfo.sh.in $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/testcheck_version.sh.in \
+ $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \
+ $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \
err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT)
@@ -67,7 +68,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
-CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh testlibinfo.sh
+CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \
+ testlibinfo.sh
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libh5test_la_LIBADD =
@@ -785,6 +787,8 @@ testcheck_version.sh: $(top_builddir)/config.status $(srcdir)/testcheck_version.
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
diff --git a/test/cross_read.c b/test/cross_read.c
index b036217..3c64f26 100755
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -22,6 +22,7 @@
*/
#include "h5test.h"
+#include "H5srcdir.h"
const char *FILENAME[] = {
"vms_data",
diff --git a/test/dsets.c b/test/dsets.c
index f430897..a269545 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -24,6 +24,7 @@
#include <time.h>
#include "h5test.h"
+#include "H5srcdir.h"
#ifdef H5_HAVE_SZLIB_H
# include "szlib.h"
#endif
diff --git a/test/external.c b/test/external.c
index c2614d5..7c859d4 100644
--- a/test/external.c
+++ b/test/external.c
@@ -20,6 +20,7 @@
* Purpose: Tests datasets stored in external raw files.
*/
#include "h5test.h"
+#include "H5srcdir.h"
/* File for external link test. Created with gen_udlinks.c */
#define LINKED_FILE "be_extlink2.h5"
diff --git a/test/fillval.c b/test/fillval.c
index 2f58380..8584816 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -20,6 +20,7 @@
* Purpose: Tests dataset fill values.
*/
#include "h5test.h"
+#include "H5srcdir.h"
/*
* Define NO_FILLING if you want to compare how this test works when there is
diff --git a/test/h5test.c b/test/h5test.c
index b9f3221..236b9be 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "h5test.h"
+#include "H5srcdir.h"
#ifdef _WIN32
#include <process.h>
diff --git a/test/links.c b/test/links.c
index c58d3af..3cfc959 100644
--- a/test/links.c
+++ b/test/links.c
@@ -28,6 +28,7 @@
#define H5G_TESTING
#include "h5test.h"
+#include "H5srcdir.h"
#include "H5Gpkg.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
diff --git a/test/mtime.c b/test/mtime.c
index 741f09a..f28c3e4 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -23,6 +23,7 @@
* working properly.
*/
#include "h5test.h"
+#include "H5srcdir.h"
const char *FILENAME[] = {
"mtime",
diff --git a/test/objcopy.c b/test/objcopy.c
index 854006e..aad08d9 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -22,6 +22,7 @@
#include <time.h>
#include "h5test.h"
+#include "H5srcdir.h"
/*
* This file needs to access private information from the H5S package.
diff --git a/test/ohdr.c b/test/ohdr.c
index c3b8f8b..e26afef 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -17,7 +17,9 @@
* Tuesday, November 24, 1998
*/
#include "h5test.h"
+#include "H5srcdir.h"
#include "H5Iprivate.h"
+
/*
* This file needs to access private datatypes from the H5O package.
* This file also needs to access the object header testing code.
diff --git a/test/tarray.c b/test/tarray.c
index 590d48c..63f98b1 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -22,6 +22,7 @@
*************************************************************/
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "hdf5.h"
diff --git a/test/tfile.c b/test/tfile.c
index 3992c47..dda5422 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -23,6 +23,7 @@
#include "hdf5.h"
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5Bprivate.h"
#include "H5Pprivate.h"
diff --git a/test/th5s.c b/test/th5s.c
index a38e384..a57cd80 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -22,6 +22,7 @@
*************************************************************/
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5private.h"
#include "H5Bprivate.h"
diff --git a/test/tmisc.c b/test/tmisc.c
index 3a009c5..b2dd2c7 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -30,6 +30,7 @@
#include "hdf5.h"
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5Dpkg.h" /* Datasets */
/* Definitions for misc. test #1 */
diff --git a/windows/c++/test/H5srcdir_str.h b/windows/c++/test/H5srcdir_str.h
new file mode 100644
index 0000000..4d32264
--- /dev/null
+++ b/windows/c++/test/H5srcdir_str.h
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = ".";
+
diff --git a/windows/hl/test/H5srcdir_str.h b/windows/hl/test/H5srcdir_str.h
new file mode 100644
index 0000000..4d32264
--- /dev/null
+++ b/windows/hl/test/H5srcdir_str.h
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = ".";
+
diff --git a/windows/test/H5srcdir_str.h b/windows/test/H5srcdir_str.h
new file mode 100644
index 0000000..4d32264
--- /dev/null
+++ b/windows/test/H5srcdir_str.h
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = ".";
+