summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-04-19 17:24:43 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-04-19 17:24:43 (GMT)
commit0e1e79f0e02606364018806d465d48eed8ffd153 (patch)
treec7bffe852a3f284a397638536558b2a198a8bfdb /tools/misc
parent14d8e1c2b5ecaf2e298984f269094dd5f2bd735f (diff)
downloadhdf5-0e1e79f0e02606364018806d465d48eed8ffd153.zip
hdf5-0e1e79f0e02606364018806d465d48eed8ffd153.tar.gz
hdf5-0e1e79f0e02606364018806d465d48eed8ffd153.tar.bz2
[svn-r23601] Bring revisions #23341 - 23597 from trunk to revise_chunks.
h5committtested.
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5cc.in39
-rw-r--r--tools/misc/h5mkgrp.c13
-rw-r--r--[-rwxr-xr-x]tools/misc/h5perf_gentest.c0
-rw-r--r--tools/misc/h5redeploy.in96
4 files changed, 104 insertions, 44 deletions
diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in
index 233c80a..f62c66f 100644
--- a/tools/misc/h5cc.in
+++ b/tools/misc/h5cc.in
@@ -85,11 +85,12 @@ CLINKERBASE="@CC@"
# CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
-# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override
-# them. User's LDFLAGS come just before clibpath, user's LIBS come after
-# $link_objs and before the hdf5 libraries in $link_args, followed by any
-# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
-# or LIBS carried in from the hdf5 build.
+# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
+# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
+# before the hdf5 libraries in $link_args, followed by any external library
+# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
+# from the hdf5 build. The order of the flags is intended to give precedence
+# to the user's flags.
H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@"
H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@"
H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
@@ -102,7 +103,17 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}"
LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
LIBS="${HDF5_LIBS:-$LIBSBASE}"
-USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+# If a static library is available, the default will be to use it. If the only
+# available library is shared, it will be used by default. The user can
+# override either default, although choosing an unavailable library will result
+# in link errors.
+STATIC_AVAILABLE="@enable_static@"
+if test "${STATIC_AVAILABLE}" = "yes"; then
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+else
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}"
+fi
+
usage() {
# A wonderfully informative "usage" message.
@@ -121,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"
@@ -374,11 +386,12 @@ if test "x$do_link" = "xyes"; then
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
- # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override
- # them. User's LDFLAGS come just before clibpath, user's LIBS come after
- # $link_objs and before the hdf5 libraries in $link_args, followed by any
- # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
- # or LIBS carried in from the hdf5 build.
+ # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
+ # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
+ # before the hdf5 libraries in $link_args, followed by any external library
+ # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
+ # from the hdf5 build. The order of the flags is intended to give precedence
+ # to the user's flags.
$SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link
status=$?
fi
diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c
index b4ac6f6..b9fb588 100644
--- a/tools/misc/h5mkgrp.c
+++ b/tools/misc/h5mkgrp.c
@@ -46,6 +46,7 @@ typedef struct {
size_t ngroups; /* Number of groups to create */
char **groups; /* Pointer to array of group names */
} param_t;
+param_t params; /* Command line parameter settings */
/*-------------------------------------------------------------------------
@@ -62,6 +63,15 @@ typedef struct {
static void
leave(int ret)
{
+ int curr_group;
+
+ if (params.fname)
+ HDfree (params.fname);
+ if (params.ngroups) {
+ for(curr_group = 0; curr_group < params.ngroups; curr_group++)
+ HDfree (params.groups[curr_group]);
+ HDfree (params.groups);
+ }
h5tools_close();
HDexit(ret);
} /* end leave() */
@@ -206,7 +216,6 @@ for(curr_group = 0; curr_group < params->ngroups; curr_group++)
int
main(int argc, const char *argv[])
{
- param_t params; /* Command line parameter settings */
hid_t fid; /* HDF5 file ID */
hid_t fapl_id; /* File access property list ID */
hid_t lcpl_id; /* Link creation property list ID */
@@ -322,6 +331,6 @@ main(int argc, const char *argv[])
/* Shut down h5tools lib */
h5tools_close();
- return EXIT_SUCCESS;
+ leave(EXIT_SUCCESS);
} /* end main() */
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