summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-05-09 18:55:46 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-05-09 18:55:46 (GMT)
commit44640ecf685cfbd15fe176a1b96c6a7105288678 (patch)
treed812c113ba801562f0e9a607456bf8daa14a5c9e /bin
parent45b57227d47476490cd720dc65e9c2fbfc94cd9f (diff)
parent57b7130acf69256ddaee7c6295a65c6ba16e3096 (diff)
downloadhdf5-44640ecf685cfbd15fe176a1b96c6a7105288678.zip
hdf5-44640ecf685cfbd15fe176a1b96c6a7105288678.tar.gz
hdf5-44640ecf685cfbd15fe176a1b96c6a7105288678.tar.bz2
[svn-r29903] merge from trunk.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmakehdf5247
-rwxr-xr-xbin/h5vers18
-rwxr-xr-xbin/make_err12
-rwxr-xr-xbin/switch_maint_mode83
4 files changed, 239 insertions, 121 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index 48869cf..7f6453a 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -29,7 +29,7 @@ exit_code=0
# 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
+if [ "$0" = "bin/${progname}" ]; then
srcdir="." # current directory
else
# $0 is $srdir/bin/$progname
@@ -46,6 +46,7 @@ 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_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF # Threadsafe feature default off
build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
@@ -82,6 +83,8 @@ Usage: $progname [<options>]
enable or disable c++ API. Default is off.
--enable-hl | --disable-hl:
enable or disable high level API. Default is on.
+ --enable-threadsafe | --disable-threadsafe:
+ enable or disable threadsafe feature. Default is off
--enable-shared | --disable-shared:
enable or disable shared lib. Default is on.
--enable-tools | --disable-tools:
@@ -124,12 +127,12 @@ STEP()
echo "$banner" with output saved in $logfile
(TIMESTAMP; nerror=0 ;
- echo "eval $command"
- eval $command || nerror=1 ;
- TIMESTAMP; exit $nerror) < /dev/null > "$logfile" 2>&1
+ echo "eval $command"
+ eval $command || nerror=1 ;
+ TIMESTAMP; exit $nerror) < /dev/null > "$logfile" 2>&1
if [ $? -ne 0 ]; then
- echo "error in '$banner'. $progname aborted."
- exit 1
+ echo "error in '$banner'. $progname aborted."
+ exit 1
fi
}
@@ -143,26 +146,30 @@ INSTALL_HDF5()
{
myos="`uname -s`"
case "$myos" in
- Linux)
- install_file=./HDF5-${version}-Linux.sh
- $install_file --skip-license $*
- ;;
- Darwin) # Mac OSX DMG file
- install_file=HDF5-${version}-Darwin.dmg
- test -d hdf5 || mkdir hdf5
- basename=`basename $install_file .dmg`
- # mount the DMG file as /Volumes/$basename
- # echo 'Y' as yes for license.
- echo Y | hdiutil mount $install_file
- # copy the contents to the install location
- cp -R "/Volumes/$basename/HDF_Group" hdf5
- # unmount the DMG file
- hdiutil unmount /Volumes/$basename
- ;;
- *) # unknown/unsupported OS.
- echo "INSTALL_HDF5: Error--unknown/unsupported OS($myos)"
- return 1
- ;;
+ Linux)
+ install_file=./HDF5-${version}-Linux.sh
+ $install_file --skip-license $*
+ ;;
+ Darwin) # Mac OSX DMG file
+ # These steps were a kludge. Need proper support from Cmake engineering.
+ echo Darwin install step needs proper implementation. Quit.
+ return 1
+ #
+ install_file=HDF5-${version}-Darwin.dmg
+ test -d hdf5 || mkdir hdf5
+ basename=`basename $install_file .dmg`
+ # mount the DMG file as /Volumes/$basename
+ # echo 'Y' as yes for license.
+ echo Y | hdiutil mount $install_file
+ # copy the contents to the install location
+ cp -R "/Volumes/$basename/HDF_Group" hdf5
+ # unmount the DMG file
+ hdiutil unmount /Volumes/$basename
+ ;;
+ *) # unknown/unsupported OS.
+ echo "INSTALL_HDF5: Error--unknown/unsupported OS($myos)"
+ return 1
+ ;;
esac
}
@@ -172,14 +179,14 @@ INSTALL_HDF5()
DUMP_LOGFILE()
{
for x in $*; do
- if [ -f $x ]; then
- echo "=================================="
- echo "Dumping $x"
- echo "=================================="
- cat $x
- echo "==== END $x ====="
- echo
- fi
+ if [ -f $x ]; then
+ echo "=================================="
+ echo "Dumping $x"
+ echo "=================================="
+ cat $x
+ echo "==== END $x ====="
+ echo
+ fi
done
}
@@ -207,84 +214,90 @@ fi
# 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-shared)
- shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON
- ;;
- --disable-shared)
- shared_lib=-DBUILD_SHARED_LIBS: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
- ;;
- --with-zlib)
- with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
- ;;
- --with-zlib=*)
- xarg=`echo $1 | cut -d= -f2-`
- with_zlib="-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_ROOT=$xarg"
- ;;
- --without-zlib)
- with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
- ;;
- --with-szlib)
- with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
- szlib_path="" # szlib is in default paths
- ;;
- --with-szlib=*)
- xarg=`echo $1 | cut -d= -f2-`
- with_szlib="-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON"
- szlib_path="SZIP_INSTALL=$xarg"
- ;;
- --without-szlib)
- with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
- szlib_path="" # reset the path
- ;;
- --njobs=*)
- njobs=`echo $1 | cut -d= -f2-`
- ;;
- --enable-verbose)
- vflag=1
- ;;
- --disable-verbose)
- vflag=0
- ;;
- --help)
- # print the detail help page and exit
- HELP
- exit 0
- ;;
- *)
- echo "Unknown options: $1"
- HELP
- exit 1
- ;;
+ --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-threadsafe)
+ build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=ON
+ ;;
+ --disable-threadsafe)
+ build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF
+ ;;
+ --enable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON
+ ;;
+ --disable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS: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
+ ;;
+ --with-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
+ ;;
+ --with-zlib=*)
+ xarg=`echo $1 | cut -d= -f2-`
+ with_zlib="-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_ROOT=$xarg"
+ ;;
+ --without-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
+ ;;
+ --with-szlib)
+ with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
+ szlib_path="" # szlib is in default paths
+ ;;
+ --with-szlib=*)
+ xarg=`echo $1 | cut -d= -f2-`
+ with_szlib="-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON"
+ szlib_path="SZIP_INSTALL=$xarg"
+ ;;
+ --without-szlib)
+ with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
+ szlib_path="" # reset the path
+ ;;
+ --njobs=*)
+ njobs=`echo $1 | cut -d= -f2-`
+ ;;
+ --enable-verbose)
+ vflag=1
+ ;;
+ --disable-verbose)
+ vflag=0
+ ;;
+ --help)
+ # print the detail help page and exit
+ HELP
+ exit 0
+ ;;
+ *)
+ echo "Unknown options: $1"
+ HELP
+ exit 1
+ ;;
esac
shift
done
@@ -313,8 +326,8 @@ fi
# setup output of all the log files if verbose is on upon exit
trap \
-"if [ $vflag -ne 0 ]; then DUMP_LOGFILE \$configlog \$makelog \$testlog \$packlog \$installlog; fi" \
-0
+ "if [ $vflag -ne 0 ]; then DUMP_LOGFILE \$configlog \$makelog \$testlog \$packlog \$installlog; fi" \
+ 0
echo Running Cmake for HDF5-${version} ...
# 4. Configure the C library, tools and tests with this command:
@@ -326,6 +339,7 @@ STEP "Configure..." \
$build_cpp_lib \
$build_fortran \
$build_hl_lib \
+ $build_threadsafe \
$shared_lib \
$build_testing \
$build_tools \
@@ -343,8 +357,13 @@ STEP "Test the library and tools..." "ctest . -C Release $njobs" $testlog
# 7. Create an install image with this command:
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
+# The implementation of installation is imcomplete (only works for linux).
+# Screen it out for now till it is completed.
+if false; then
# 8. Install with this command:
STEP "Install..." "INSTALL_HDF5" $installlog
+fi
+
# save the last exit code
exit_code=$?
diff --git a/bin/h5vers b/bin/h5vers
index 7e61dc8..e9df387 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -277,13 +277,17 @@ if ($LT_VERS && $version_increased) {
local($_) = $contentsy;
- my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m;
- my $new_lt_revision = $lt_revision+1;
- ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m;
-
- open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n";
- print FILE $contentsy;
- close FILE;
+# As of the HDF5 v1.8.16 release, h5vers should not increment
+# the LT_VERS numbers, so the next 6 lines are commented out.
+# A future version may copy the numbers to H5public.h, so this
+# section is retained for future reference.
+# my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m;
+# my $new_lt_revision = $lt_revision+1;
+# ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m;
+
+# open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n";
+# print FILE $contentsy;
+# close FILE;
}
# Update the README.txt file
diff --git a/bin/make_err b/bin/make_err
index 4b1f474..1b39d53fb 100755
--- a/bin/make_err
+++ b/bin/make_err
@@ -175,6 +175,12 @@ sub create_public ($) {
print_warning(*HEADER);
print_startprotect(*HEADER, $file);
+ # Begin extern C block
+ print HEADER "\n";
+ print HEADER "#ifdef __cplusplus\n";
+ print HEADER "extern \"C\" {\n";
+ print HEADER "#endif\n";
+
# Iterate over all the major errors
print HEADER "\n/*********************/\n";
print HEADER "/* Major error codes */\n";
@@ -202,6 +208,12 @@ sub create_public ($) {
}
}
+ # End extern C block
+ print HEADER "\n";
+ print HEADER "#ifdef __cplusplus\n";
+ print HEADER "}\n";
+ print HEADER "#endif\n";
+
print_endprotect(*HEADER, $file);
# Close header file
diff --git a/bin/switch_maint_mode b/bin/switch_maint_mode
new file mode 100755
index 0000000..2b62545
--- /dev/null
+++ b/bin/switch_maint_mode
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic HDF5 document set and
+# is linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+# access to either file, you may request a copy from help@hdfgroup.org.
+#
+# Switch AM_MAINTAINER_MODE value in configure.ac
+# Usage: See USAGE()
+# Programmer: Dana Robinson
+# Creation date: January 2016
+
+USAGE()
+{
+cat <<EOF
+
+switch_maint_mode reverses the status of AM_MAINTAINER_MODE in
+configure.ac from enable to disable or vice-versa. When enabled,
+this feature forces the autotools to run when the input files are
+older than the output files. This is the default for development
+branches. When disabled, the autotools will NOT be re-run regardless
+of their timestamps or any modifications. This is the default for
+tarballs and release branches since it avoids having end-users
+requiring the autotools.
+
+Command Syntax
+==============
+switch_maint_mode [-help] [-enable|disable] <path-to-configure.ac>
+
+EOF
+}
+
+MODE="notset"
+CONFIG_AC_PATH=
+
+# Display help/usage if any options were passed in
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -enable)
+ MODE="enable"
+ ;;
+ -disable)
+ MODE="disable"
+ ;;
+ -help)
+ USAGE
+ exit 0
+ ;;
+ *)
+ CONFIG_AC_PATH="$1"
+ ;;
+ esac
+ shift
+done
+
+# Did we get a file path?
+if test -z $CONFIG_AC_PATH ; then
+ USAGE
+ exit 1
+fi
+
+# Did we get a mode?
+if test -z $MODE ; then
+ USAGE
+ exit 1
+fi
+
+# Run perl over configure.ac
+if test "X-$MODE" = "X-enable" ; then
+ perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1enable$3/g' $CONFIG_AC_PATH
+fi
+if test "X-$MODE" = "X-disable" ; then
+ perl -pi -e 's/^(AM_MAINTAINER_MODE\(\[)([a-z]+)(\]\))/$1disable$3/g' $CONFIG_AC_PATH
+fi
+