From 4e7be9656bc3bdbb1377ee89eb72f3a0df98461a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 18 Jun 2010 17:47:56 -0500 Subject: [svn-r19020] Enhancements: Cleaned up the code a bit by: 1. It used to that -xxx options must be at the beginning such that "buildhdf5 --disable-shared -config" was an error. Now -xxx options can appear anywhere in the command options. 2. Eliminate the need of variables $CONFIG_CXX, $CONFIG_FORTRAN, $CONFIG_PARALLEL by appending their values to $CONFIG_OP directly. 3. Also append $WITH_SZLIB to $CONFIG_OP when it is defined, not later. 4. Call CONFIG directly instead of setting up $CONFIGURE. 5. Removed the last TIMESTAMP since "trap 0" will call QUIT which calls TIMESTAMP already. This eliminated the extra timestamp when it finishes normal. tested: Tested by hand since h5committest does not really test this command. --- bin/buildhdf5 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/bin/buildhdf5 b/bin/buildhdf5 index ac73df0..8ed4696 100755 --- a/bin/buildhdf5 +++ b/bin/buildhdf5 @@ -67,6 +67,7 @@ TIMESTAMP() QUIT() { + # print the closing time TIMESTAMP } @@ -234,7 +235,7 @@ trap QUIT 0 # MAKE=${MAKE:-'gmake'} export MAKE -CONFIGURE="CONFIG" +CONFIG_CMD="CONFIG" CONFIG_OP= # configure options CONFIG_ONLY=no # default is configure and build NOEXEC= # default to execute commands @@ -250,6 +251,7 @@ while [ $# -gt 0 ]; do ;; -szlib) LOCATE_SZLIB + CONFIG_OP="$CONFIG_OP $WITH_SZLIB" ;; -help) USAGE @@ -263,16 +265,16 @@ while [ $# -gt 0 ]; do SRCDIRLIST="$1" ;; -cxx) - CONFIG_CXX="--enable-cxx" + CONFIG_OP="$CONFIG_OP --enable-cxx" ;; -fortran) - CONFIG_FORTRAN="--enable-fortran" + CONFIG_OP="$CONFIG_OP --enable-fortran" ;; -pp) - CONFIG_PARALLEL="--enable-parallel" + CONFIG_OP="$CONFIG_OP --enable-parallel" ;; - *) # Quit parsing - break + *) # pass it as a configure option + CONFIG_OP="$CONFIG_OP $1" ;; esac shift @@ -296,14 +298,10 @@ if [ x-$SRCDIR = x-dummy ]; then exit 1 fi -# Setup Configure options -CONFIG_OP="$WITH_SZLIB $CONFIG_FORTRAN $CONFIG_CXX $CONFIG_PARALLEL" - # Configure # no configure if already done. if [ ! -f config.status ]; then - CONFIGURE="$CONFIGURE $CONFIG_OP $*" - STEP "Configure HDF5..." "$CONFIGURE" "#config" + STEP "Configure HDF5..." "$CONFIG_CMD $CONFIG_OP" "#config" else STEP "Configure Skipped" "echo Configure Skipped" "#config" fi @@ -324,4 +322,3 @@ STEP "Testing HDF5 parallel parts..." "$MAKE check-p" "#test-p" # all done echo "No Errors encountered" -TIMESTAMP -- cgit v0.12