summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-05-10 19:38:53 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-05-10 19:38:53 (GMT)
commit68a20c3f56f30e62e062eba2f4c8f782fa604cd3 (patch)
treedb86db14954362b093891cf311ce514cf87fe051 /tools/misc
parent0a3191e36d4ee22c383de9b0917990149c1f2df2 (diff)
parent5ecebe5b9bc161153a3391bf32eb64687f675172 (diff)
downloadhdf5-68a20c3f56f30e62e062eba2f4c8f782fa604cd3.zip
hdf5-68a20c3f56f30e62e062eba2f4c8f782fa604cd3.tar.gz
hdf5-68a20c3f56f30e62e062eba2f4c8f782fa604cd3.tar.bz2
[svn-r23694] merge from trunk
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5cc.in19
-rw-r--r--[-rwxr-xr-x]tools/misc/h5perf_gentest.c0
-rw-r--r--tools/misc/h5redeploy.in96
3 files changed, 70 insertions, 45 deletions
diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in
index fe11c26..f62c66f 100644
--- a/tools/misc/h5cc.in
+++ b/tools/misc/h5cc.in
@@ -132,8 +132,9 @@ usage() {
echo " subdirectories [default: $prefix]"
echo " -show Show the commands without executing them"
echo " -showconfig Show the HDF5 library configuration summary"
- echo " -shlib Compile with shared HDF5 libraries"
- echo " -noshlib Compile with static HDF5 libraries [default]"
+ echo " -shlib Compile with shared HDF5 libraries [default when built with"
+ echo " disable-static]"
+ echo " -noshlib Compile with static HDF5 libraries [default when static available]"
echo " "
echo " <compile line> - the normal compile line options for your compiler."
echo " $prog_name uses the same compiler you used to compile"
@@ -350,20 +351,6 @@ if test "x$do_link" = "xyes"; then
if test -n "$flag"; then
shared_link="${flag}${libdir}"
- # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded
- # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH).
- if test -n "$LDFLAGS"; then
- for entry in $LDFLAGS; do
- extdir=`echo $entry | sed '/^-L/ s/^-L//'`
- shared_link="${shared_link} ${flag}${extdir}"
- done
- fi
- if test -n "$H5BLD_LDFLAGS"; then
- for entry in $H5BLD_LDFLAGS; do
- extdir=`echo $entry | sed '/^-L/ s/^-L//'`
- shared_link="${shared_link} ${flag}${extdir}"
- done
- fi
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c
index 6a080d0..6a080d0 100755..100644
--- a/tools/misc/h5perf_gentest.c
+++ b/tools/misc/h5perf_gentest.c
diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in
index ae79b70..6b6ef87 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
@@ -29,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
}
@@ -70,17 +77,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=
+exec_prefix=
+libdir=
+includedir=
# Parse options
for arg in $@ ; do
case "$arg" in
-prefix=*)
- prefix="`expr "$arg" : '-prefix=\(.*\)'`"
+ prefix="`echo $arg | cut -f2 -d=`"
+ ;;
+ -exec-prefix=*)
+ exec_prefix="`echo $arg | cut -f2 -d=`"
+ ;;
+ -libdir=*)
+ libdir="`echo $arg | cut -f2 -d=`"
+ ;;
+ -includedir=*)
+ includedir="`echo $arg | cut -f2 -d=`"
;;
-echo)
set -x
@@ -89,7 +117,7 @@ for arg in $@ ; do
SHOW="echo"
;;
-tool=*)
- h5tools="`expr "$arg" : '-tool=\(.*\)'`"
+ h5tools="`echo $arg | cut -f2 -d=`"
;;
-help|help)
usage
@@ -105,10 +133,18 @@ for arg in $@ ; do
esac
done
-# Sanity checks
-if [ ! -d $prefix ]; then
- ERROR "prefix($prefix) is not an existing directory"
- exit $EXIT_FAILURE
+# Set to default value, one above where i am, if not given by user
+if [ -z "$prefix" ]; then
+ prefix=`(cd ..;pwd)`
+fi
+if [ -z "$exec_prefix" ]; then
+ exec_prefix='${prefix}' # use single quotes to prevent expansion of $
+fi
+if [ -z "$libdir" ]; then
+ libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $
+fi
+if [ -z "$includedir" ]; then
+ includedir='${prefix}'/include # use single quotes to prevent expansion of $
fi
for x in $h5tools; do
@@ -144,10 +180,19 @@ fi
CMDFILE=/tmp/h5redeploy.$$
touch $CMDFILE
chmod 0600 $CMDFILE
-echo "/^prefix/c" >> $CMDFILE
-echo prefix=\""$prefix"\" >> $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
@@ -171,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