diff options
author | hdftest <hdftest@hdfgroup.org> | 2020-04-26 19:13:37 (GMT) |
---|---|---|
committer | hdftest <hdftest@hdfgroup.org> | 2020-04-26 19:13:37 (GMT) |
commit | 57b1f0b994bb90f5654093d90620bd7e36ebefa7 (patch) | |
tree | 3b09c2b4c7c53be66499854eaf710265c9503fe3 /c++/examples/run-c++-ex.sh.in | |
parent | 507d8f3cdf04ddad0fb7cdb92de033fa70d07f47 (diff) | |
parent | 7015ea5ec07e5bec11c6fed75dbe34d48428cf2b (diff) | |
download | hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.zip hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.tar.gz hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.tar.bz2 |
Merge branch 'hdf5_1_8' of ssh://bitbucket.hdfgroup.org:7999/~hdftest/hdf5_hft into hdf5_1_8
Diffstat (limited to 'c++/examples/run-c++-ex.sh.in')
-rw-r--r-- | c++/examples/run-c++-ex.sh.in | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 315010e..d05b120 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c++ examples from source files # -# installed in .../share/hdf5_examples/c++ using h5c++. The # +# installed in @examplesdir@/c++ using h5c++. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -30,9 +30,32 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobber it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../}" +prefix="${prefix:-../${prefix_relto_examplesdir}}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name |