summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-05-11 19:11:04 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-05-11 19:11:04 (GMT)
commit5520ff138ca79bb5aa46146908773c910f767554 (patch)
treec9ea17f4530c1eade235ea077f179d3557042233 /bin
parentc3218d9f39ec281506251c2c6ba0b395adfa9013 (diff)
parent67ba6cb57d84dd34c69930d469ae445697b49731 (diff)
downloadhdf5-5520ff138ca79bb5aa46146908773c910f767554.zip
hdf5-5520ff138ca79bb5aa46146908773c910f767554.tar.gz
hdf5-5520ff138ca79bb5aa46146908773c910f767554.tar.bz2
[svn-r27050] merge from trunk.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmakehdf567
-rwxr-xr-xbin/h5vers47
-rwxr-xr-xbin/snapshot4
3 files changed, 106 insertions, 12 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index 1f0fb7c..715d6d7 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -23,6 +23,7 @@ makelog="#${progname}_2build.log"
testlog="#${progname}_3test.log"
packlog="#${progname}_4pack.log"
installlog="#${progname}_5install.log"
+config_summary=libhdf5.settings
exit_code=0
# This command should be in the source directory's bin/
@@ -51,6 +52,7 @@ 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
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables zlib filter default off
+shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON # enables shared lib; default on
#=============
@@ -80,16 +82,14 @@ 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-shared | --disable-shared:
+ enable or disable shared lib. 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.
- --with-zlib=INC,LIB | --without-zlib:
+ --with-zlib | --without-zlib:
Use zlib library for external deflate I/O filter. Default is on.
- INC and LIB are the include and lib directories.
- --with-szlib=INC,LIB| --without-szlib:
- Use szip library for external szip library I/O filter. Default is off.
- INC and LIB are the include and lib directories.
--help: shows details help page
EOF
}
@@ -125,6 +125,40 @@ STEP()
}
+# Install the generated installation image file. Different platform uses
+# different image files.
+# Linux: HDF5-<version>-Linux.sh file
+# Mac OS X: Not implemented yet
+# Others: Not implemented yet
+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
+ ;;
+ esac
+ return 0
+}
+
+
#==========
# main
#==========
@@ -166,6 +200,12 @@ while [ $# -gt 0 ]; do
--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
;;
@@ -178,6 +218,12 @@ while [ $# -gt 0 ]; do
--disable-testing)
build_testing=-DBUILD_TESTING:BOOL=OFF
;;
+ --with-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
+ ;;
+ --without-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
+ ;;
--help)
# print the detail help page and exit
HELP
@@ -212,20 +258,22 @@ if [ $? != 0 ]; then
echo $vers failed. Aborted.
exit 1
fi
-echo Running Cmake for HDF5-${version} ...
-
+echo Running Cmake for HDF5-${version} ...
# 4. Configure the C library, tools and tests with this command:
+# If successful, append the configure summary to the configure logfile.
STEP "Configure..." "cmake \
-C $cacheinit \
$build_cpp_lib \
$build_fortran \
$enable_f2003 \
$build_hl_lib \
+ $shared_lib \
$build_testing \
$build_tools \
$with_zlib \
$with_szlib \
- $srcdir" $configlog
+ $srcdir" $configlog &&\
+ cat $config_summary >> $configlog
# 5. Build the C library, tools and tests with this command:
STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
@@ -237,7 +285,8 @@ STEP "Test the library and tools..." "ctest . -C Release" $testlog
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
# 8. Install with this command:
-STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+#STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+STEP "Install..." "INSTALL_HDF5" $installlog
# save the last exit code
exit_code=$?
diff --git a/bin/h5vers b/bin/h5vers
index cb4b9e0..2aa8023 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -187,6 +187,10 @@ die "unable to read file: $RELEASE\n" unless -r $file;
my $CONFIGURE = $file;
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
die "unable to read file: $CONFIGURE\n" unless -r $file;
+# cpp_doc_config
+my $CPP_DOC_CONFIG = $file;
+$CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/;
+die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@@ -234,7 +238,8 @@ if ($set) {
$README = "";
$RELEASE = "";
$CONFIGURE = "";
- $LT_VERS = "";
+ $CPP_DOC_CONFIG = "";
+ $LT_VERS = "";
@newver = @curver;
}
@@ -309,6 +314,46 @@ if ($RELEASE) {
close FILE;
}
+# Update the c++/src/cpp_doc_config file
+if ($CPP_DOC_CONFIG) {
+ my $data = read_file($CPP_DOC_CONFIG);
+ my $version_string = sprintf("HDF5 version %d.%d.%d%s %s",
+ @newver[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3],
+ "currently under development");
+
+ $data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
+
+ write_file($CPP_DOC_CONFIG, $data);
+}
+
+# helper function to read the file for updating c++/src/cpp_doc_config file.
+# The version string in that file is not at the top, so the string replacement
+# is not for the first line, and reading/writing the entire file as one string
+# facilitates the substring replacement.
+sub read_file {
+ my ($filename) = @_;
+
+ open my $in, $filename or die "Could not open '$filename' for reading $!";
+ local $/ = undef;
+ my $all = <$in>;
+ close $in;
+
+ return $all;
+}
+
+# helper function to write the file for updating c++/src/cpp_doc_config file.
+sub write_file {
+ my ($filename, $content) = @_;
+
+ open my $out, ">$filename" or die "Could not open '$filename' for writing $!";;
+ print $out $content;
+ close $out;
+
+ return;
+}
+
+
sub gen_configure {
my ($name, $conf) = @_;
diff --git a/bin/snapshot b/bin/snapshot
index b4adf5e..a496edd 100755
--- a/bin/snapshot
+++ b/bin/snapshot
@@ -67,8 +67,8 @@ ReleaseDir_default=release_dir
ZLIB_default=
ZLIB=$ZLIB_default
-# What compression methods to use? (md5 does checksum).
-METHODS="gzip zip bzip2 md5 doc"
+# What compression methods to use?
+METHODS="gzip zip bzip2 doc"
# Use User's MAKE if set. Else use generic make.
MAKE=${MAKE:-make}