summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-10-03 20:56:34 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-10-03 21:01:40 (GMT)
commitb8a93a7224114739e42f32aaf62ae64fd1aad33e (patch)
tree9e318d7ecc226320dbb98bdc40eecc94357d972a
parentbbc1264ea67f93eabe53c7b555933072231e108d (diff)
downloadhdf5-b8a93a7224114739e42f32aaf62ae64fd1aad33e.zip
hdf5-b8a93a7224114739e42f32aaf62ae64fd1aad33e.tar.gz
hdf5-b8a93a7224114739e42f32aaf62ae64fd1aad33e.tar.bz2
Let us override the examples directory using --with-examplesdir=DIR.
This is handy for NetBSD where HDF5 examples are installed by convention in $prefix/share/examples/hdf5/ rather than in ${prefix}/share/hdf5_examples/, which is the HDF5 default. Place hdf5_examples/ under ${datarootdir} which on most systems will be ${prefix}/share/, anyway.
-rw-r--r--c++/examples/Makefile.am4
-rw-r--r--c++/examples/run-c++-ex.sh.in2
-rw-r--r--configure.ac22
-rw-r--r--examples/Makefile.am4
-rw-r--r--examples/run-c-ex.sh.in2
-rw-r--r--fortran/examples/Makefile.am4
-rw-r--r--fortran/examples/run-fortran-ex.sh.in2
-rw-r--r--hl/c++/examples/Makefile.am4
-rw-r--r--hl/c++/examples/run-hlc++-ex.sh.in2
-rw-r--r--hl/examples/Makefile.am4
-rw-r--r--hl/examples/run-hlc-ex.sh.in2
-rw-r--r--hl/fortran/examples/Makefile.am4
-rw-r--r--hl/fortran/examples/run-hlfortran-ex.sh.in2
13 files changed, 40 insertions, 18 deletions
diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am
index 51ab8e3..0648504 100644
--- a/c++/examples/Makefile.am
+++ b/c++/examples/Makefile.am
@@ -49,8 +49,8 @@ CXX_API=yes
# Where to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
+EXAMPLEDIR=$(examplesdir)/c++
+EXAMPLETOPDIR=$(examplesdir)
# How to build programs using h5c++
$(EXTRA_PROG): $(H5CPP)
diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in
index f0d3e93..d01cb7f 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 #
diff --git a/configure.ac b/configure.ac
index 345c4bd..0eada60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2967,6 +2967,28 @@ fi
AC_CACHE_SAVE
## ----------------------------------------------------------------------
+## Use custom examples path.
+##
+AC_MSG_CHECKING([for custom examples path definition])
+AC_ARG_WITH([examplesdir],
+ [AS_HELP_STRING([--with-examplesdir=location],
+ [Specify path for examples
+ [default="DATAROOTDIR/hdf5_examples"]])],,
+ withval="${datarootdir}/hdf5_examples")
+
+if test "X$withval" = "X"; then
+ AC_MSG_RESULT([default])
+ examplesdir="${datarootdir}/hdf5_examples"
+else
+ AC_MSG_RESULT([$withval])
+ examplesdir=$withval
+fi
+
+AC_SUBST([examplesdir])
+AC_DEFINE_UNQUOTED([EXAMPLESDIR], ["$examplesdir"],
+ [Define the examples directory])
+
+## ----------------------------------------------------------------------
## Enable custom plugin default path for library. It requires SHARED support.
##
AC_MSG_CHECKING([for custom plugin default path definition])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 554ee44..a0d2b00 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -84,8 +84,8 @@ CHECK_CLEANFILES+=$(EXTLINK_DIRS)
# Example directory
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
+EXAMPLEDIR=$(examplesdir)/c
+EXAMPLETOPDIR=$(examplesdir)
# 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/run-c-ex.sh.in b/examples/run-c-ex.sh.in
index 4d5d594..ffb01bc 100644
--- a/examples/run-c-ex.sh.in
+++ b/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 h5cc or h5pc. The order for running #
+# in @examplesdir@/c using h5cc or h5pc. 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 be placed accordingly. #
diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am
index 6bf2edb..fb510bc 100644
--- a/fortran/examples/Makefile.am
+++ b/fortran/examples/Makefile.am
@@ -74,8 +74,8 @@ endif
# Tell automake how to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
+EXAMPLEDIR=$(examplesdir)/fortran
+EXAMPLETOPDIR=$(examplesdir)
# List dependencies for each example. Normally, automake would take
# care of this for us, but if we tell automake about the programs it
diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in
index ad14368..8ea4dc3 100644
--- a/fortran/examples/run-fortran-ex.sh.in
+++ b/fortran/examples/run-fortran-ex.sh.in
@@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the fortran examples from source files #
-# installed in .../share/hdf5_examples/fortran using h5fc or h5pfc. The #
+# installed in @examplesdir@/fortran using h5fc or h5pfc. 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 #
diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am
index ce719f5..592e8da 100644
--- a/hl/c++/examples/Makefile.am
+++ b/hl/c++/examples/Makefile.am
@@ -33,8 +33,8 @@ CXX_API=yes
# Where to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
+EXAMPLEDIR=$(examplesdir)/hl/c++
+EXAMPLETOPDIR=$(examplesdir)/hl
# How to build programs using h5c++
$(EXTRA_PROG): $(H5CPP)
diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in
index 9539724..1e7ce10 100644
--- a/hl/c++/examples/run-hlc++-ex.sh.in
+++ b/hl/c++/examples/run-hlc++-ex.sh.in
@@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c++ examples from source files #
-# installed in .../share/hdf5_examples/hl/c++ using h5c++. The #
+# installed in @examplesdir@/hl/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 #
diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am
index 29e1a48..cc2d671 100644
--- a/hl/examples/Makefile.am
+++ b/hl/examples/Makefile.am
@@ -25,8 +25,8 @@ endif
# Example directory
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
+EXAMPLEDIR=$(examplesdir)/hl/c
+EXAMPLETOPDIR=$(examplesdir)/hl
INSTALL_SCRIPT_FILES = run-hlc-ex.sh
INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh
diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in
index b12955f..1404fa4 100644
--- a/hl/examples/run-hlc-ex.sh.in
+++ b/hl/examples/run-hlc-ex.sh.in
@@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c examples from source files installed #
-# in .../share/hdf5_examples/hl/c using h5cc or h5pc. The order for running #
+# in @examplesdir@/hl/c using h5cc or h5pc. 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 be placed accordingly. #
diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am
index d383f9a..b81cc6f 100644
--- a/hl/fortran/examples/Makefile.am
+++ b/hl/fortran/examples/Makefile.am
@@ -51,8 +51,8 @@ endif
# Tell automake how to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
-EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran
-EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
+EXAMPLEDIR=$(examplesdir)/hl/fortran
+EXAMPLETOPDIR=$(examplesdir)/hl
# List dependencies for each example. Normally, automake would take
# care of this for us, but if we tell automake about the programs it
diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in
index c8f41f8..d7de8e3 100644
--- a/hl/fortran/examples/run-hlfortran-ex.sh.in
+++ b/hl/fortran/examples/run-hlfortran-ex.sh.in
@@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the fortran examples from source files #
-# installed in .../share/hdf5_examples/hl/fortran using h5fc or h5pfc. The #
+# installed in @examplesdir@/hl/fortran using h5fc or h5pfc. 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 #