summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile.am5
-rw-r--r--examples/Makefile.in25
-rwxr-xr-xexamples/run-all-ex.sh18
-rwxr-xr-xexamples/run-c-ex.sh.in3
4 files changed, 35 insertions, 16 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 92830df..8a428ae 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -69,8 +69,9 @@ $(EXTLINK_DIRS):
CHECK_CLEANFILES+=$(EXTLINK_DIRS)
# Example directory
-EXAMPLEDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c
-EXAMPLETOPDIR=${DESTDIR}/$(exec_prefix)/share/hdf5_examples
+# Note: no '/' after DESTDIR. Explanation in commence.am
+EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c
+EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
# List dependencies for each program. Normally, automake would take
# care of this for us, but if we tell automake about the programs it
diff --git a/examples/Makefile.in b/examples/Makefile.in
index ceabee8..4e16fa4 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -315,14 +315,24 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
+
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
# shared libraries instead of static libraries
-H5CC = $(bindir)/h5cc
-H5CC_PP = $(bindir)/h5pcc
-H5FC = $(bindir)/h5fc
-H5FC_PP = $(bindir)/h5pfc
-H5CPP = $(bindir)/h5c++
+H5CC = ${DESTDIR}$(bindir)/h5cc
+H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
+H5FC = ${DESTDIR}$(bindir)/h5fc
+H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
+H5CPP = ${DESTDIR}$(bindir)/h5c++
ACLOCAL_AMFLAGS = "-I m4"
# The trace script; this is used on source files from the C library to
@@ -360,8 +370,9 @@ INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh
EXTLINK_DIRS = red blue u2w
# Example directory
-EXAMPLEDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples/c
-EXAMPLETOPDIR = ${DESTDIR}/$(exec_prefix)/share/hdf5_examples
+# Note: no '/' after DESTDIR. Explanation in commence.am
+EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c
+EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples
# Assume that all tests in this directory are examples, and tell
# conclude.am when to build them.
diff --git a/examples/run-all-ex.sh b/examples/run-all-ex.sh
index e96b86f..6837c7e 100755
--- a/examples/run-all-ex.sh
+++ b/examples/run-all-ex.sh
@@ -26,12 +26,18 @@
if (echo "Run c examples" && \
(cd c; sh ./run-c-ex.sh) && \
- echo "Run fortran examples" && \
- (cd fortran; sh ./run-fortran-ex.sh) && \
- echo "Run c++ examples" && \
- (cd c++; sh ./run-c++-ex.sh) && \
- echo "Run hl examples." && \
- (cd hl; sh ./run-hl-ex.sh)); then
+ (if test -d fortran; then
+ echo "Run fortran examples"
+ cd fortran; sh ./run-fortran-ex.sh
+ fi)
+ (if test -d c++; then
+ echo "Run c++ examples"
+ cd c++; sh ./run-c++-ex.sh
+ fi)
+ (if test -d hl; then
+ echo "Run hl examples."
+ cd hl; sh ./run-hl-ex.sh
+ fi)); then
echo "Done"
exit 0
else
diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in
index 09ff2fc..2bc1cd4 100755
--- a/examples/run-c-ex.sh.in
+++ b/examples/run-c-ex.sh.in
@@ -32,7 +32,8 @@ EXIT_SUCCESS=0
EXIT_FAILURE=1
# Where the tool is installed.
-prefix="${prefix:-${DESTDIR}/@prefix@}"
+# Note: no '/' after DESTDIR. Explanation in commence.am
+prefix="${prefix:-${DESTDIR}@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"