diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-09 14:51:34 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-09 14:51:34 (GMT) |
commit | acabad61facccea62d5d12c76ccb09d107e9062c (patch) | |
tree | a45b4d2c914786e341c403bd506890cde8e15861 /bin | |
parent | 992e79b58cf83a75f7567d73d7e7d534750c3d68 (diff) | |
parent | 50c5f1ab2c706e00ec546c4f5a415b4203a5db7e (diff) | |
download | hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.zip hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.tar.gz hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.tar.bz2 |
[svn-r25968] merge from trunk.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmakehdf5 | 112 | ||||
-rwxr-xr-x | bin/release | 5 |
2 files changed, 102 insertions, 15 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 68a550e..ec6357f 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -23,14 +23,28 @@ makelog="#${progname}_2build.log" testlog="#${progname}_3test.log" packlog="#${progname}_4pack.log" installlog="#${progname}_5install.log" -srcdir="../hdf5" # expected source directory exit_code=0 +# This command should be in the source directory's bin/ +# and should have invoked as "$srcdir/bin/$progname" or +# "bin/$progname". So, by striping bin/$program from $0, +# we can find $srcdir. +if [ $0 == bin/$progname ]; then + srcdir="." # current directory +else + # $0 is $srdir/bin/$progname + srcdir=`echo $0 | sed -e s%/bin/$progname\$%%` +fi +# Sanity check +if [ ! -r $srcdir/bin/$progname ]; then + echo "encountered error while trying to find srcdir($srdir)" + exit 1 +fi + # Cmake build options -hdf5_src=../hdf5 -cacheinit=$hdf5_src/config/cmake/cacheinit.cmake -build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON # C++ interface default on -build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=ON # Fortran interface default on +cacheinit=$srcdir/config/cmake/cacheinit.cmake +build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off +build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on @@ -40,12 +54,33 @@ build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on # Function definitions #============= -# Show user help page +# Show user brief help page +HELP_BRIEF() +{ +cat << EOF +Usage: $progname [options] + --help: shows details help page +EOF +} + +# Show user detail help page HELP() { - echo "Usage: $progname [--script]" - echo " --script: Use the ctest scripting method of $progname" - echo "" +cat << EOF +Usage: $progname [<options>] + where options are: + --enable-fortran | --disable-fortran: + enable or disable fortran API. Default is off. + --enable-cxx | --disable-cxx: + enable or disable c++ API. Default is off. + --enable-hl | --disable-hl: + enable or disable high level API. Default is on. + --enable-tools | --disable-tools: + enable or disable building tools. Default is on. + --enable-testing | --disable-testing: + enable or disable building tests. Default is on. + --help: shows details help page +EOF } # Display a time stamp @@ -86,8 +121,61 @@ STEP() # Show a start time stamp TIMESTAMP -# Always display the help page -HELP +# Parse Cmake configure options +# --enable-XXX or --disable-XXX will enable or disable feature XXX. +# XXX can be: +# fortran Fortran interface +# cxx C++ interface +# hl Highlevel interface +# testing Build tests +# tools Build tools +while [ $# -gt 0 ]; do + case "$1" in + --enable-fortran) + build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=ON + ;; + --disable-fortran) + build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF + ;; + --enable-cxx) + build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON + ;; + --disable-cxx) + build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF + ;; + --enable-hl) + build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON + ;; + --disable-hl) + build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF + ;; + --enable-tools) + build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON + ;; + --disable-tools) + build_tools=-DHDF5_BUILD_TOOLS:BOOL=OFF + ;; + --enable-testing) + build_testing=-DBUILD_TESTING:BOOL=ON + ;; + --disable-testing) + build_testing=-DBUILD_TESTING:BOOL=OFF + ;; + --help) + # print the detail help page and exit + HELP + exit 0 + ;; + *) + echo "Unknown options" + HELP + ;; + esac + shift +done + +# Always display the brief help page +HELP_BRIEF # Verify there is a valid hdf5 source directory present if [ ! -d $srcdir ]; then @@ -115,7 +203,7 @@ STEP "Configure..." "cmake \ $build_hl_lib \ $build_testing \ $build_tools \ - $hdf5_src" $configlog + $srcdir" $configlog # 5. Build the C library, tools and tests with this command: STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog diff --git a/bin/release b/bin/release index 68745ec..d771db6 100755 --- a/bin/release +++ b/bin/release @@ -40,12 +40,11 @@ USAGE() { cat << EOF -Usage: $0 [--nocheck] [-d <dir>] [-h] <methods> ... +Usage: $0 -d <dir> [-h] [--nocheck] [--private] <methods> ... -d DIR The name of the directory where the releas(es) should be placed. - + -h print the help page. --nocheck Ignore errors in MANIFEST file. - --private Make a private release with today's date in version information. This must be run at the top level of the source directory. |