summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/misc/h5redeploy.in89
1 files changed, 35 insertions, 54 deletions
diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in
index f90ff13..6b6ef87 100644
--- a/tools/misc/h5redeploy.in
+++ b/tools/misc/h5redeploy.in
@@ -30,14 +30,20 @@ usage() {
# A wonderfully informative "usage" message.
echo "usage: $prog_name [OPTIONS]"
echo " OPTIONS:"
- echo " -help|help This help message"
- echo " -echo Show all the shell commands executed"
- echo " -force No prompt, just do it"
- echo " -prefix=DIR New directory to find HDF5 lib/ and include/"
- echo " subdirectories [default: current directory]"
- echo " -tool=TOOL Tool to update. TOOL must be in the current"
- echo " directory and writable. [default: $h5tools]"
- echo " -show Show the commands without executing them"
+ echo " -help|help This help message"
+ echo " -echo Show all the shell commands executed"
+ echo " -force No prompt, just do it"
+ echo " -prefix=DIR New directory to find HDF5 lib/ and include/"
+ echo " subdirectories [default: current directory]"
+ echo " -exec-prefix=DIR New directory to find HDF5 lib/"
+ echo " subdirectory [default: <prefix>]"
+ echo " -libdir=DIR New directory for the HDF5 lib directory"
+ echo " [default: <exec-prefix>/lib]"
+ echo " -includedir=DIR New directory for the HDF5 header files"
+ echo " [default: <prefix>/include]"
+ echo " -tool=TOOL Tool to update. TOOL must be in the current"
+ echo " directory and writable. [default: $h5tools]"
+ echo " -show Show the commands without executing them"
echo " "
exit $EXIT_FAILURE
}
@@ -85,7 +91,7 @@ h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools
foundtools= # tools found and will be modified
fmode= # force mode, default is off
prefix=
-eprefix=
+exec_prefix=
libdir=
includedir=
@@ -95,8 +101,8 @@ for arg in $@ ; do
-prefix=*)
prefix="`echo $arg | cut -f2 -d=`"
;;
- -eprefix=*)
- eprefix="`echo $arg | cut -f2 -d=`"
+ -exec-prefix=*)
+ exec_prefix="`echo $arg | cut -f2 -d=`"
;;
-libdir=*)
libdir="`echo $arg | cut -f2 -d=`"
@@ -127,36 +133,18 @@ for arg in $@ ; do
esac
done
-# Set to default value if not given by user
+# Set to default value, one above where i am, if not given by user
if [ -z "$prefix" ]; then
prefix=`(cd ..;pwd)`
fi
-if [ -z "$eprefix" ]; then
- eprefix=$prefix
+if [ -z "$exec_prefix" ]; then
+ exec_prefix='${prefix}' # use single quotes to prevent expansion of $
fi
if [ -z "$libdir" ]; then
- libdir=$eprefix/lib
+ libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $
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
+ includedir='${prefix}'/include # use single quotes to prevent expansion of $
fi
for x in $h5tools; do
@@ -192,19 +180,19 @@ fi
CMDFILE=/tmp/h5redeploy.$$
touch $CMDFILE
chmod 0600 $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
+echo "/^prefix=/c" >> $CMDFILE
+echo prefix=\""$prefix"\" >> $CMDFILE
+echo . >> $CMDFILE
+echo "/^exec_prefix=/c" >> $CMDFILE
+echo exec_prefix=\""$exec_prefix"\" >> $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
# Update them
@@ -228,10 +216,3 @@ done
# Cleanup
rm -f $CMDFILE
exit $EXIT_SUCCESS
-
-# Some possible future features to add
-# CCBASE - Name of the alternative C compiler
-# CLINKERBASE - Name of the alternative linker
-# LDFLAGS - Path to different libraries your application will link with
-# (this path should include the path to the zlib library)
-# LIBS - Libraries your application will link with