summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2013-03-30 05:55:15 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2013-03-30 05:55:15 (GMT)
commit913b88d15b78e027bdcdcb5b9356d4b6dfe59b18 (patch)
tree2da1072ff7274ca05284bc28e4feda55645b8db3 /tools/misc
parentb6e0e867d07faac7edde726bf7ed2a5f01f6cdb6 (diff)
downloadhdf5-913b88d15b78e027bdcdcb5b9356d4b6dfe59b18.zip
hdf5-913b88d15b78e027bdcdcb5b9356d4b6dfe59b18.tar.gz
hdf5-913b88d15b78e027bdcdcb5b9356d4b6dfe59b18.tar.bz2
[svn-r23497] Bug fix: HDFFV-8358
Change h5redeploy to change all 4 lines, prefix=..., exec_prefix=..., libdir=..., and includedir=... This way, it reset all 4 lines. Should work for both version of h5cc created by configure or by rpm. Tested: hand tested in jam.
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5redeploy.in71
1 files changed, 64 insertions, 7 deletions
diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in
index ae79b70..f90ff13 100644
--- a/tools/misc/h5redeploy.in
+++ b/tools/misc/h5redeploy.in
@@ -14,9 +14,10 @@
# access to either file, you may request a copy from help@hdfgroup.org.
#
-## Update HDF5 compiler tools after the HDF5 software has been installed
-## in a new location.
-## For help page, use "h5redeploy -help"
+## Update HDF5 compiler tools after the HDF5 software has been installed ##
+## in a new location. ##
+## For help page, use "h5redeploy -help" ##
+## ##
# Constants definitions
EXIT_SUCCESS=0
@@ -70,17 +71,38 @@ ERROR()
# Main
#
+############################################################################
+## Installation directories: ##
+## prefix architecture-independent files. ##
+## exec_prefix architecture-dependent files, default is <prefix>. ##
+## libdir libraries, default is <exec_prefix>/lib. ##
+## includedir header files, default is <prefix/include>. ##
+## Not used here: ##
+## bindir executables, <exec_prefix/bin>. ##
+############################################################################
# Initialization
h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools
foundtools= # tools found and will be modified
fmode= # force mode, default is off
-prefix=`(cd ..;pwd)`
+prefix=
+eprefix=
+libdir=
+includedir=
# Parse options
for arg in $@ ; do
case "$arg" in
-prefix=*)
- prefix="`expr "$arg" : '-prefix=\(.*\)'`"
+ prefix="`echo $arg | cut -f2 -d=`"
+ ;;
+ -eprefix=*)
+ eprefix="`echo $arg | cut -f2 -d=`"
+ ;;
+ -libdir=*)
+ libdir="`echo $arg | cut -f2 -d=`"
+ ;;
+ -includedir=*)
+ includedir="`echo $arg | cut -f2 -d=`"
;;
-echo)
set -x
@@ -89,7 +111,7 @@ for arg in $@ ; do
SHOW="echo"
;;
-tool=*)
- h5tools="`expr "$arg" : '-tool=\(.*\)'`"
+ h5tools="`echo $arg | cut -f2 -d=`"
;;
-help|help)
usage
@@ -105,11 +127,37 @@ for arg in $@ ; do
esac
done
+# Set to default value if not given by user
+if [ -z "$prefix" ]; then
+ prefix=`(cd ..;pwd)`
+fi
+if [ -z "$eprefix" ]; then
+ eprefix=$prefix
+fi
+if [ -z "$libdir" ]; then
+ libdir=$eprefix/lib
+fi
+if [ -z "$includedir" ]; then
+ includedir=$prefix/include
+fi
+
# Sanity checks
if [ ! -d $prefix ]; then
ERROR "prefix($prefix) is not an existing directory"
exit $EXIT_FAILURE
fi
+if [ ! -d $prefix ]; then
+ ERROR "prefix($prefix) is not an existing directory"
+ exit $EXIT_FAILURE
+fi
+if [ ! -d $prefix ]; then
+ ERROR "prefix($prefix) is not an existing directory"
+ exit $EXIT_FAILURE
+fi
+if [ ! -d $prefix ]; then
+ ERROR "prefix($prefix) is not an existing directory"
+ exit $EXIT_FAILURE
+fi
for x in $h5tools; do
if [ -f $x ]; then
@@ -144,9 +192,18 @@ fi
CMDFILE=/tmp/h5redeploy.$$
touch $CMDFILE
chmod 0600 $CMDFILE
-echo "/^prefix/c" >> $CMDFILE
+echo "/^prefix=/c" >> $CMDFILE
echo prefix=\""$prefix"\" >> $CMDFILE
echo . >> $CMDFILE
+echo "/^exec_prefix=/c" >> $CMDFILE
+echo exec_prefix=\""$eprefix"\" >> $CMDFILE
+echo . >> $CMDFILE
+echo "/^libdir=/c" >> $CMDFILE
+echo libdir=\""$libdir"\" >> $CMDFILE
+echo . >> $CMDFILE
+echo "/^includedir=/c" >> $CMDFILE
+echo includedir=\""$includedir"\" >> $CMDFILE
+echo . >> $CMDFILE
(echo w; echo q) >> $CMDFILE