summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-08-04 15:22:47 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-08-04 15:22:47 (GMT)
commitdc97b9a16569e588dd6c112153b3136003b14ee1 (patch)
tree2ea651b76195b4c7ef803ae3a518e4f7a6b3daf7 /config
parentf28c92bb3661f43e9e05a15b78f748eb106adc18 (diff)
parent33c0016eb63a1d7894bd708cd020ba091a9a9857 (diff)
downloadhdf5-dc97b9a16569e588dd6c112153b3136003b14ee1.zip
hdf5-dc97b9a16569e588dd6c112153b3136003b14ee1.tar.gz
hdf5-dc97b9a16569e588dd6c112153b3136003b14ee1.tar.bz2
Merge branch 'aug-develop' into aug-merge-attempt/feature/vfd_swmr
Diffstat (limited to 'config')
-rw-r--r--config/apple3
-rw-r--r--config/clang-cxxflags200
-rw-r--r--config/clang-flags200
-rw-r--r--config/clang-warnings/developer-general1
-rw-r--r--config/clang-warnings/error-general5
-rw-r--r--config/clang-warnings/no-developer-general2
-rw-r--r--config/cmake/H5pubconf.h.in6
-rw-r--r--config/cmake/HDF5UseFortran.cmake2
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake142
-rw-r--r--config/cmake/HDFCompilerFlags.cmake100
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake21
-rw-r--r--config/cmake/cacheinit.cmake3
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake5
-rw-r--r--config/gnu-cxxflags67
-rw-r--r--config/gnu-fflags19
-rw-r--r--config/gnu-flags69
-rw-r--r--config/gnu-warnings/4.2-4.33
-rw-r--r--config/gnu-warnings/4.2-4.42
-rw-r--r--config/gnu-warnings/4.2-4.62
-rw-r--r--config/gnu-warnings/4.32
-rw-r--r--config/gnu-warnings/4.43
-rw-r--r--config/gnu-warnings/4.51
-rw-r--r--config/gnu-warnings/4.5-4.63
-rw-r--r--config/gnu-warnings/4.62
-rw-r--r--config/gnu-warnings/4.75
-rw-r--r--config/gnu-warnings/4.824
-rw-r--r--config/gnu-warnings/4.8-4.last (renamed from config/gnu-warnings/4.2-4.last)0
-rw-r--r--config/gnu-warnings/developer-4.57
-rw-r--r--config/gnu-warnings/developer-4.61
-rw-r--r--config/gnu-warnings/developer-4.77
-rw-r--r--config/gnu-warnings/developer-4.822
-rw-r--r--config/gnu-warnings/gfort-4.42
-rw-r--r--config/gnu-warnings/gfort-4.51
-rw-r--r--config/gnu-warnings/gfort-4.72
-rw-r--r--config/gnu-warnings/gfort-4.812
-rw-r--r--config/gnu-warnings/no-developer-4.51
-rw-r--r--config/gnu-warnings/no-developer-4.61
-rw-r--r--config/gnu-warnings/no-developer-4.72
-rw-r--r--config/gnu-warnings/no-developer-4.812
-rw-r--r--config/linux-gnulibc121
-rw-r--r--config/solaris21
-rw-r--r--config/toolchain/build32.cmake16
-rw-r--r--config/toolchain/mingw64.cmake4
43 files changed, 592 insertions, 432 deletions
diff --git a/config/apple b/config/apple
index 0b15dfe..aba48d1 100644
--- a/config/apple
+++ b/config/apple
@@ -49,6 +49,7 @@ fi
# Figure out compiler flags
. $srcdir/config/gnu-flags
+. $srcdir/config/clang-flags
# temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not
# use -O option as it causes failures in test/dt_arith.
case "$host_os" in
@@ -155,11 +156,13 @@ esac
# get c++ version info
case $CXX in
clang++)
+ . $srcdir/config/clang-cxxflags
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'Apple' | sed 's/(.*//'`
;;
*g++*)
+ . $srcdir/config/gnu-cxxflags
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'`
;;
diff --git a/config/clang-cxxflags b/config/clang-cxxflags
new file mode 100644
index 0000000..edd62e7
--- /dev/null
+++ b/config/clang-cxxflags
@@ -0,0 +1,200 @@
+# -*- shell-script -*-
+#
+# 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 COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+
+
+# This file should be sourced into configure if the compiler is the
+# Clang clang++ compiler or a derivative. It is careful not to do anything
+# if the compiler is not Clang; otherwise 'cxx_flags_set' is set to 'yes'
+#
+
+#
+# For now, do not promote any warnings to errors.
+#
+PROMOTE_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ sed 's,-Werror=,-W,g'
+ else
+ cat
+ fi
+}
+
+#
+# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_clang_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg}
+ done)
+ IFS=' ' echo "$*"
+}
+# Get the compiler version in a way that works for clang++
+# unless a compiler version is already known
+#
+# cxx_vendor: The compiler name: clang++
+# cxx_version: Version number: 6.0.0, 7.3.0, ... 10.0.1
+#
+if test "X-" = "X-$cxx_flags_set"; then
+ # clang++ -v will return version number following "clang" on Linux machines,
+ # but on Macs the version number will follow "Apple LLVM version"
+ cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ if test -n "$cxx_version"; then
+ cxx_vendor="clang"
+ else
+ cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\
+ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
+ if test -n "$cxx_version"; then
+ cxx_vendor="Apple LLVM"
+ fi
+ fi
+ if test "X-" != "X-$cxx_version"; then
+
+ # Get the compiler version numbers
+ cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
+ cxx_vers_minor=`echo $cxx_version | cut -f2 -d.`
+ cxx_vers_patch=`echo $cxx_version | cut -f3 -d.`
+ test -n "$cxx_vers_major" || cxx_vers_major=0
+ test -n "$cxx_vers_minor" || cxx_vers_minor=0
+ test -n "$cxx_vers_patch" || cxx_vers_patch=0
+ fi
+fi
+
+if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then
+ echo "compiler '$CXX' is $cxx_vendor-$cxx_version"
+ ###############################
+ # Architecture-specific flags #
+ ###############################
+
+ arch=
+ case "$host_os-$host_cpu" in
+ # FreeBSD sets the information from "uname -m" to the general machine
+ # architecture, not the specific CPU for the machine, so even our
+ # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD
+ # machine, use the "sysctl" command to get the CPU hardware model.
+ freebsd*-i386)
+ host_cpu_model=`sysctl -n hw.model`
+ case "$host_cpu_model" in
+ # Hmm.. this might not catch Celerons, but it won't hurt them either...
+ *Pro*|*II*|*III*|*IV*|*Athlon*)
+ # architecture-specific optimizations cause problems
+ # for some users who build binaries to be used on
+ # multiple architectures.
+ # arch="-march=i686"
+ ;;
+ esac
+ ;;
+
+ *-i686)
+ # architecture-specific optimizations cause problems
+ # for some users who build binaries to be used on
+ # multiple architectures.
+ # arch="-march=i686"
+ ;;
+ esac
+
+ case "$host_os-$host_cpu" in
+ # cygwin needs the "-std=c99" flag removed, so make
+ # a specific case for Cygwin without the flag and a default
+ # case to add the flag everywhere else
+ cygwin-*)
+ ;;
+
+ *)
+ H5_CXXFLAGS="$H5_CXXFLAGS -std=c++11"
+ ;;
+ esac
+
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch"
+
+ ##############
+ # Production #
+ ##############
+
+ # NDEBUG is handled explicitly by the configure script
+ PROD_CXXFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly by the configure script
+ # -g is handled by the symbols flags
+ DEBUG_CXXFLAGS="-ftrapv -fno-common"
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CXXFLAGS=
+ SYMBOLS_CXXFLAGS="-g -fno-omit-frame-pointer"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CXXFLAGS="-pg"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CXXFLAGS="-O3"
+ DEBUG_OPT_CXXFLAGS="-g"
+ NO_OPT_CXXFLAGS="-O0"
+
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)"
+
+ ######################
+ # Developer warnings #
+ ######################
+
+ NO_DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments no-developer-general)
+ DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments developer-general)
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
+
+# Clear cxx info if no flags set
+if test "X$cxx_flags_set" = "X"; then
+ cxx_vendor=
+ cxx_version=
+fi
+
diff --git a/config/clang-flags b/config/clang-flags
new file mode 100644
index 0000000..b4f5e2e
--- /dev/null
+++ b/config/clang-flags
@@ -0,0 +1,200 @@
+# -*- shell-script -*-
+#
+# 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 COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+
+
+# This file should be sourced into configure if the compiler is the
+# Clang compiler or a derivative. It is careful not to do anything
+# if the compiler is not Clang; otherwise 'cc_flags_set' is set to 'yes'
+#
+
+#
+# For now, do not promote any warnings to errors.
+#
+PROMOTE_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ sed 's,-Werror=,-W,g'
+ else
+ cat
+ fi
+}
+
+#
+# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_clang_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg}
+ done)
+ IFS=' ' echo "$*"
+}
+# Get the compiler version in a way that works for clang
+# unless a compiler version is already known
+#
+# cc_vendor: The compiler name: clang
+# cc_version: Version number: 6.0.0, 7.3.0, ... 10.0.1
+#
+if test "X-" = "X-$cc_flags_set"; then
+ # clang -v will return version number following "clang" on Linux machines,
+ # but on Macs the version number will follow "Apple LLVM version"
+ cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ if test -n "$cc_version"; then
+ cc_vendor="clang"
+ else
+ cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
+ if test -n "$cc_version"; then
+ cc_vendor="Apple LLVM"
+ fi
+ fi
+ if test "X-" != "X-$cc_version"; then
+
+ # Get the compiler version numbers
+ cc_vers_major=`echo $cc_version | cut -f1 -d.`
+ cc_vers_minor=`echo $cc_version | cut -f2 -d.`
+ cc_vers_patch=`echo $cc_version | cut -f3 -d.`
+ test -n "$cc_vers_major" || cc_vers_major=0
+ test -n "$cc_vers_minor" || cc_vers_minor=0
+ test -n "$cc_vers_patch" || cc_vers_patch=0
+ fi
+fi
+
+if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then
+ echo "compiler '$CC' is $cc_vendor-$cc_version"
+ ###############################
+ # Architecture-specific flags #
+ ###############################
+
+ arch=
+ case "$host_os-$host_cpu" in
+ # FreeBSD sets the information from "uname -m" to the general machine
+ # architecture, not the specific CPU for the machine, so even our
+ # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD
+ # machine, use the "sysctl" command to get the CPU hardware model.
+ freebsd*-i386)
+ host_cpu_model=`sysctl -n hw.model`
+ case "$host_cpu_model" in
+ # Hmm.. this might not catch Celerons, but it won't hurt them either...
+ *Pro*|*II*|*III*|*IV*|*Athlon*)
+ # architecture-specific optimizations cause problems
+ # for some users who build binaries to be used on
+ # multiple architectures.
+ # arch="-march=i686"
+ ;;
+ esac
+ ;;
+
+ *-i686)
+ # architecture-specific optimizations cause problems
+ # for some users who build binaries to be used on
+ # multiple architectures.
+ # arch="-march=i686"
+ ;;
+ esac
+
+ case "$host_os-$host_cpu" in
+ # cygwin needs the "-std=c99" flag removed, so make
+ # a specific case for Cygwin without the flag and a default
+ # case to add the flag everywhere else
+ cygwin-*)
+ ;;
+
+ *)
+ H5_CFLAGS="$H5_CFLAGS -std=c99"
+ ;;
+ esac
+
+ H5_CFLAGS="$H5_CFLAGS $arch"
+
+ ##############
+ # Production #
+ ##############
+
+ # NDEBUG is handled explicitly by the configure script
+ PROD_CFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly by the configure script
+ # -g is handled by the symbols flags
+ DEBUG_CFLAGS="-ftrapv -fno-common"
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CFLAGS=
+ SYMBOLS_CFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CFLAGS="-pg"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CFLAGS="-O3"
+ DEBUG_OPT_CFLAGS="-g"
+ NO_OPT_CFLAGS="-O0"
+
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)"
+
+ ######################
+ # Developer warnings #
+ ######################
+
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments developer-general)
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+
+ #################
+ # Flags are set #
+ #################
+ cc_flags_set=yes
+fi
+
+# Clear cc info if no flags set
+if test "X$cc_flags_set" = "X"; then
+ cc_vendor=
+ cc_version=
+fi
+
diff --git a/config/clang-warnings/developer-general b/config/clang-warnings/developer-general
index aa8c32e..74d8404 100644
--- a/config/clang-warnings/developer-general
+++ b/config/clang-warnings/developer-general
@@ -1,3 +1,4 @@
-Wformat-nonliteral
-Wmissing-noreturn
+-Wsometimes-uninitialized
-Wswitch-enum
diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general
index a9aa516..883dff7 100644
--- a/config/clang-warnings/error-general
+++ b/config/clang-warnings/error-general
@@ -8,10 +8,11 @@
-Werror=missing-declarations
-Werror=packed
-Werror=shadow
--Werror=sometimes-uninitialized
-Werror=switch
#
-#-Werror=discarded-qualifiers
+# NOTE: Following files are not compatible with incompatible-pointer-types as errors
+# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c
+-Wno-error=incompatible-pointer-types-discards-qualifiers
#
#
# NOTE: File Driver files are not compatible with these warnings as errors
diff --git a/config/clang-warnings/no-developer-general b/config/clang-warnings/no-developer-general
index 2f4e0c5..2bf1703 100644
--- a/config/clang-warnings/no-developer-general
+++ b/config/clang-warnings/no-developer-general
@@ -1 +1 @@
--Wmissing-noreturn
+-Wno-missing-noreturn
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 6edf6b4..64b4852 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -267,9 +267,6 @@
/* Define to 1 if you have the `lstat' function. */
#cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@
-/* Define to 1 if you have the <mach/mach_time.h> header file. */
-#cmakedefine H5_HAVE_MACH_MACH_TIME_H @H5_HAVE_MACH_MACH_TIME_H@
-
/* Define if the map API (H5M) should be compiled */
#cmakedefine H5_HAVE_MAP_API @H5_HAVE_MAP_API@
@@ -424,9 +421,6 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@
-
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index c5d8200..4350b7a 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -435,7 +435,7 @@ set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) ::
ENABLE_LANGUAGE (C)
if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
-include (CheckCSourceRuns)
+ include (CheckCSourceRuns)
else ()
#-----------------------------------------------------------------------------
# The provided CMake C macros don't provide a general compile/run function
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 4bc646a..7bbebbc 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -40,7 +40,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
# warning level is given, so remove it.
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
endif ()
@@ -51,7 +51,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
# Most compilers use -w to suppress warnings.
if (NOT HDF5_WARNINGS_BLOCKED)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif ()
endif ()
@@ -65,7 +65,7 @@ endif ()
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
-if (NOT MSVC)
+if (NOT MSVC AND NOT MINGW)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP")
else ()
@@ -85,10 +85,9 @@ if (NOT MSVC)
list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED
- AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- # autotools adds the C flags with the CXX flags for g++ compiler
- # versions 4.2 and above.
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ # add the general CXX flags for g++ compiler versions 4.8 and above.
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
endif ()
@@ -127,84 +126,9 @@ if (NOT MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... Only needed for gcc 4.X
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last")
- endif ()
-
- # Append warning flags for gcc 4.2-4.3
- # autotools always add the C flags with the CXX flags
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3")
- endif ()
-
- # Append warning flags for gcc 4.2-4.4
- # autotools always add the C flags with the CXX flags
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4")
- endif ()
-
- # Append warning flags that only gcc 4.3+ knows about
- # autotools always add the C flags with the CXX flags
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
- endif()
-
- # Append more extra warning flags that only gcc 4.4+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
- endif ()
-
- # Append more extra warning flags that only gcc 4.5+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
- else ()
- # autotools always add the C flags with the CXX flags
- #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5")
- endif ()
- endif ()
-
- # Append more extra warning flags that only gcc 4.6 and less know about
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6")
- endif ()
-
- # Append more extra warning flags that only gcc 4.5-4.6 know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6")
- endif ()
-
- # Append more extra warning flags that only gcc 4.6+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6")
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6")
- else ()
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6")
- endif ()
- endif ()
-
- # Append more extra warning flags that only gcc 4.7+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7")
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7")
- else ()
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7")
- endif ()
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
@@ -270,7 +194,9 @@ if (NOT MSVC)
endif ()
endif ()
else ()
+ if (NOT MINGW)
list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
@@ -280,21 +206,19 @@ if (HDF5_ENABLE_ALL_WARNINGS)
message (STATUS "....All Warnings are enabled")
if (MSVC)
if (HDF5_ENABLE_DEV_WARNINGS)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
endif ()
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
endif ()
endif ()
endif ()
@@ -305,15 +229,13 @@ endif ()
if (HDF5_ENABLE_GROUPZERO_WARNINGS)
message (STATUS "....Group Zero warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
endif ()
endif ()
endif ()
@@ -324,15 +246,13 @@ endif ()
if (HDF5_ENABLE_GROUPONE_WARNINGS)
message (STATUS "....Group One warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
endif ()
endif ()
endif ()
@@ -343,15 +263,13 @@ endif ()
if (HDF5_ENABLE_GROUPTWO_WARNINGS)
message (STATUS "....Group Two warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
endif ()
endif ()
endif ()
@@ -362,15 +280,13 @@ endif ()
if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
message (STATUS "....Group Three warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
endif ()
endif ()
endif ()
@@ -381,10 +297,8 @@ endif ()
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 6dbaa64..31af2f8 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -68,7 +68,7 @@ endif ()
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
-if (NOT MSVC)
+if (NOT MSVC AND NOT MINGW)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP")
else ()
@@ -93,11 +93,9 @@ if (NOT MSVC)
list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
endif()
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # Add general CFlags for GCC versions 4.2 and above
- if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
- endif ()
+ # Add general CFlags for GCC versions 4.8 and above
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
endif ()
# gcc automatically inlines based on the optimization level
@@ -121,13 +119,13 @@ if (NOT MSVC)
message (STATUS "....HDF5 developer group warnings are enabled")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
endif ()
else ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
@@ -138,68 +136,8 @@ if (NOT MSVC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... Only needed for gcc 4.X
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last")
- endif ()
-
- # Append warning flags for gcc 4.2-4.3
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3")
- endif ()
-
- # Append warning flags for gcc 4.2-4.4
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4")
- endif ()
-
- # Append warning flags that only gcc 4.3+ knows about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
- endif ()
-
- # Append more extra warning flags that only gcc 4.4+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
- endif ()
-
- # Append more extra warning flags that only gcc 4.5+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5")
- endif ()
- endif ()
-
- # Append more extra warning flags that only gcc 4.6 and less know about
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6")
- endif ()
-
- # Append more extra warning flags that only gcc 4.5-4.6 know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6")
- endif ()
-
- # Append more extra warning flags that only gcc 4.6+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6")
- endif ()
- endif ()
-
- # Append more extra warning flags that only gcc 4.7+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7")
- endif ()
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
@@ -271,9 +209,7 @@ if (HDF5_ENABLE_ALL_WARNINGS)
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
endif ()
endif ()
@@ -287,9 +223,7 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W1")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
endif ()
endif ()
@@ -303,9 +237,7 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W2")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
endif ()
endif ()
@@ -319,9 +251,7 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
endif ()
endif ()
@@ -335,9 +265,7 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W4")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
endif ()
endif ()
@@ -348,9 +276,7 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
endif ()
endif ()
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 495a0ca..2bbb35d 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -48,7 +48,7 @@ endif ()
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
-if (NOT MSVC)
+if (NOT MSVC AND NOT MINGW)
# General flags
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general")
@@ -67,23 +67,6 @@ if (NOT MSVC)
message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}")
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
- # Append warning flags that only gcc 4.4+ knows about
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4")
-
- # Append more extra warning flags that only gcc 4.5+ know about
- if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5)
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5")
- endif ()
-
- # Append more extra warning flags that only gcc 4.6+ know about
- #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6)
- # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6")
- #endif ()
-
- # Append more extra warning flags that only gcc 4.7+ know about
- if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7)
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7")
- endif ()
# Append more extra warning flags that only gcc 4.8+ know about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8)
@@ -95,7 +78,7 @@ if (NOT MSVC)
# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9")
#endif ()
- # Append more extra warning flags that only gcc 5.1+ know about
+ # Append more extra warning flags that only gcc 5.x+ know about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
endif ()
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index 4846997..64e8dcc 100644
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -23,6 +23,9 @@ set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
+set (HDF5_INSTALL_MOD_FORTRAN "NO" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" FORCE)
+set_property (CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC)
+
set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE)
set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 0875aad..0ddb6d0 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -137,15 +137,11 @@ CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
-# Darwin
-CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H)
-
# Windows
CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
endif ()
-CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H)
if (CMAKE_SYSTEM_NAME MATCHES "OSF")
CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
@@ -683,4 +679,3 @@ endif ()
# the cache value is set in it's config file)
#
set (${HDF_PREFIX}_CONVERT_DENORMAL_FLOAT 1)
-
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index b2ef36d..44cbc69 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -180,82 +180,33 @@ if test "X-g++" = "X-$cxx_vendor"; then
# General #
###########
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then
+ # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later.
+ if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)"
H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)"
- fi
######################
# Developer warnings #
######################
- NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
- DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
+ NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
+
+ fi
#######################
# gcc 4 special cases #
#######################
- # GCC 4.2 through 4.6
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)"
- fi
-
- # GCC 4.2 through 4.3
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 3; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)"
- fi
-
- # GCC 4.5 through 4.6
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)"
- fi
-
- # GCC 4.2 through 4.4
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -a $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 4; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)"
- fi
-
- # GCC 4.2 through the end of GCC 4 series
- if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)"
+ # GCC 4.8 through the end of GCC 4 series
+ if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8-4.last)"
fi
#############################
# Version-specific warnings #
#############################
- # gcc >= 4.3
- if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 3; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)"
- fi
-
- # gcc >= 4.4
- if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 4; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)"
- fi
-
- # gcc >= 4.5
- if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)"
- #DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)"
- #NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)"
- fi
-
- # gcc >= 4.6
- if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 6; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)"
- DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)"
- NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)"
- fi
-
- # gcc >= 4.7
- if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 7; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)"
- DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)"
- NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)"
- fi
-
# gcc >= 4.8
if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)"
diff --git a/config/gnu-fflags b/config/gnu-fflags
index eb3519c..105a990 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -145,25 +145,6 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# Version-specific warnings #
#############################
- # gfortran 4.3 (nothing new)
-
- # gfortran >= 4.4
- if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 4; then
- H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.4)"
- fi
-
- # gfortran >= 4.5
- if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.5)"
- fi
-
- # gfortran 4.6 (nothing new)
-
- # gfortran >= 4.7
- if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 7; then
- H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.7)"
- fi
-
# gfortran >= 4.8
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then
H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)"
diff --git a/config/gnu-flags b/config/gnu-flags
index a9e0d2b..9c0323c 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -188,12 +188,10 @@ if test "X-gcc" = "X-$cc_vendor"; then
# General #
###########
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)"
- fi
+ # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later.
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)"
H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)"
- fi
H5_CFLAGS="$H5_CFLAGS -Wno-c++-compat"
@@ -201,73 +199,24 @@ if test "X-gcc" = "X-$cc_vendor"; then
# Developer warnings #
######################
- NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
- DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
+
+ fi
#######################
# gcc 4 special cases #
#######################
- # GCC 4.2 through 4.6
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.6)"
- fi
-
- # GCC 4.2 through 4.3
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)"
- fi
-
- # GCC 4.5 through 4.6
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5-4.6)"
- fi
-
- # GCC 4.2 through 4.4
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.4)"
- fi
-
- # GCC 4.2 through the end of GCC 4 series
- if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.last)"
+ # GCC 4.8 through the end of GCC 4 series
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8-4.last)"
fi
#############################
# Version-specific warnings #
#############################
- # gcc >= 4.3
- if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)"
- fi
-
- # gcc >= 4.4
- if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.4)"
- fi
-
- # gcc >= 4.5
- if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.5)"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.5)"
- fi
-
- # gcc >= 4.6
- if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.6)"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.6)"
- fi
-
- # gcc >= 4.7
- if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
- H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.7)"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.7)"
- fi
-
# gcc >= 4.8
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)"
diff --git a/config/gnu-warnings/4.2-4.3 b/config/gnu-warnings/4.2-4.3
deleted file mode 100644
index 1881797..0000000
--- a/config/gnu-warnings/4.2-4.3
+++ /dev/null
@@ -1,3 +0,0 @@
-# -Wvolatile-register-var was later incorporated into -Wall and
-# only needs to be specified explicitly for gcc 4.2-4.3
--Wvolatile-register-var
diff --git a/config/gnu-warnings/4.2-4.4 b/config/gnu-warnings/4.2-4.4
deleted file mode 100644
index ec4876f..0000000
--- a/config/gnu-warnings/4.2-4.4
+++ /dev/null
@@ -1,2 +0,0 @@
-# The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4
--Wstrict-overflow
diff --git a/config/gnu-warnings/4.2-4.6 b/config/gnu-warnings/4.2-4.6
deleted file mode 100644
index 37df4ab..0000000
--- a/config/gnu-warnings/4.2-4.6
+++ /dev/null
@@ -1,2 +0,0 @@
-# Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier
--Wno-long-long
diff --git a/config/gnu-warnings/4.3 b/config/gnu-warnings/4.3
deleted file mode 100644
index 13d8558..0000000
--- a/config/gnu-warnings/4.3
+++ /dev/null
@@ -1,2 +0,0 @@
--Wlarger-than=2560
--Wlogical-op
diff --git a/config/gnu-warnings/4.4 b/config/gnu-warnings/4.4
deleted file mode 100644
index 42929b5..0000000
--- a/config/gnu-warnings/4.4
+++ /dev/null
@@ -1,3 +0,0 @@
--Wframe-larger-than=16384
--Wpacked-bitfield-compat
--Wsync-nand
diff --git a/config/gnu-warnings/4.5 b/config/gnu-warnings/4.5
deleted file mode 100644
index ddb96df..0000000
--- a/config/gnu-warnings/4.5
+++ /dev/null
@@ -1 +0,0 @@
--Wstrict-overflow=5
diff --git a/config/gnu-warnings/4.5-4.6 b/config/gnu-warnings/4.5-4.6
deleted file mode 100644
index d3035fe..0000000
--- a/config/gnu-warnings/4.5-4.6
+++ /dev/null
@@ -1,3 +0,0 @@
-# -Wstrict-aliasing was later incorporated into -Wall and
-# only needs to be specified explicitly for gcc 4.5-4.6
--Wstrict-aliasing
diff --git a/config/gnu-warnings/4.6 b/config/gnu-warnings/4.6
deleted file mode 100644
index 140a20c..0000000
--- a/config/gnu-warnings/4.6
+++ /dev/null
@@ -1,2 +0,0 @@
--Wdouble-promotion
--Wtrampolines
diff --git a/config/gnu-warnings/4.7 b/config/gnu-warnings/4.7
deleted file mode 100644
index c47fe4b..0000000
--- a/config/gnu-warnings/4.7
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# -Wstack-usage=8192 warnings need to be swept up on a branch so
-# that we can stop burdening the whole development team.
-#
--Wstack-usage=8192
diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8
index 5dc577f..c7e3dd1 100644
--- a/config/gnu-warnings/4.8
+++ b/config/gnu-warnings/4.8
@@ -1 +1,25 @@
+# warning flags added for GCC >= 4.3
+-Wlarger-than=2560
+-Wlogical-op
+
+# warning flags added for GCC >= 4.4
+-Wframe-larger-than=16384
+-Wpacked-bitfield-compat
+-Wsync-nand
+
+# warning flag added for GCC >= 4.5
+-Wstrict-overflow=5
+
+# warning flags added for GCC >= 4.6
+-Wdouble-promotion
+-Wtrampolines
+
+# warning flag added for GCC >= 4.7
+#
+# -Wstack-usage=8192 warnings need to be swept up on a branch so
+# that we can stop burdening the whole development team.
+#
+-Wstack-usage=8192
+
+# warning flag added for GCC >= 4.8
-Wmaybe-uninitialized
diff --git a/config/gnu-warnings/4.2-4.last b/config/gnu-warnings/4.8-4.last
index 2db90fb..2db90fb 100644
--- a/config/gnu-warnings/4.2-4.last
+++ b/config/gnu-warnings/4.8-4.last
diff --git a/config/gnu-warnings/developer-4.5 b/config/gnu-warnings/developer-4.5
deleted file mode 100644
index 48df846..0000000
--- a/config/gnu-warnings/developer-4.5
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# -Wjump-misses-init makes lots of noise for a questionable benefit.
-# Can jumping over an initialization in C cause any harm, if
-# the variable is never *used* before it has been initialized?
-#
--Wjump-misses-init
--Wunsuffixed-float-constants
diff --git a/config/gnu-warnings/developer-4.6 b/config/gnu-warnings/developer-4.6
deleted file mode 100644
index 2372fbf..0000000
--- a/config/gnu-warnings/developer-4.6
+++ /dev/null
@@ -1 +0,0 @@
--Wsuggest-attribute=const
diff --git a/config/gnu-warnings/developer-4.7 b/config/gnu-warnings/developer-4.7
deleted file mode 100644
index a3b0781..0000000
--- a/config/gnu-warnings/developer-4.7
+++ /dev/null
@@ -1,7 +0,0 @@
--Wsuggest-attribute=noreturn
--Wsuggest-attribute=pure
-#
-# It's not clear that -Wvector-operation-performance warnings are
-# actionable, so they are demoted to "developer" warnings.
-#
--Wvector-operation-performance
diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8
index b0109e2..fd76f6c 100644
--- a/config/gnu-warnings/developer-4.8
+++ b/config/gnu-warnings/developer-4.8
@@ -1 +1,23 @@
+# developer warning flags added for GCC >= 4.5
+#
+# -Wjump-misses-init makes lots of noise for a questionable benefit.
+# Can jumping over an initialization in C cause any harm, if
+# the variable is never *used* before it has been initialized?
+#
+-Wjump-misses-init
+-Wunsuffixed-float-constants
+
+# developer warning flag added for GCC >= 4.6
+-Wsuggest-attribute=const
+
+# developer warning flags added for GCC >= 4.7
+-Wsuggest-attribute=noreturn
+-Wsuggest-attribute=pure
+#
+# It's not clear that -Wvector-operation-performance warnings are
+# actionable, so they are demoted to "developer" warnings.
+#
+-Wvector-operation-performance
+
+# developer warning flag added for GCC >= 4.8
-Wsuggest-attribute=format
diff --git a/config/gnu-warnings/gfort-4.4 b/config/gnu-warnings/gfort-4.4
deleted file mode 100644
index 59fe9a2..0000000
--- a/config/gnu-warnings/gfort-4.4
+++ /dev/null
@@ -1,2 +0,0 @@
--Warray-temporaries
--Wintrinsics-std \ No newline at end of file
diff --git a/config/gnu-warnings/gfort-4.5 b/config/gnu-warnings/gfort-4.5
deleted file mode 100644
index 4490d4e..0000000
--- a/config/gnu-warnings/gfort-4.5
+++ /dev/null
@@ -1 +0,0 @@
--Wimplicit-procedure
diff --git a/config/gnu-warnings/gfort-4.7 b/config/gnu-warnings/gfort-4.7
deleted file mode 100644
index a7532bb..0000000
--- a/config/gnu-warnings/gfort-4.7
+++ /dev/null
@@ -1,2 +0,0 @@
--Wreal-q-constant
--Wfunction-elimination
diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8
index 1b96a51..9d880de 100644
--- a/config/gnu-warnings/gfort-4.8
+++ b/config/gnu-warnings/gfort-4.8
@@ -1,3 +1,15 @@
+# warning flags added for gfortran >= 4.4
+-Warray-temporaries
+-Wintrinsics-std
+
+# warning flag added for gfortran >= 4.5
+-Wimplicit-procedure
+
+# warning flags added for gfortran >= 4.7
+-Wreal-q-constant
+-Wfunction-elimination
+
+# warning flags added for gfortran >= 4.8
-Wrealloc-lhs
-Wrealloc-lhs-all
# Turn off warnings for passing non-ANSI types to BIND().
diff --git a/config/gnu-warnings/no-developer-4.5 b/config/gnu-warnings/no-developer-4.5
deleted file mode 100644
index ef7d38f..0000000
--- a/config/gnu-warnings/no-developer-4.5
+++ /dev/null
@@ -1 +0,0 @@
--Wno-unsuffixed-float-constants
diff --git a/config/gnu-warnings/no-developer-4.6 b/config/gnu-warnings/no-developer-4.6
deleted file mode 100644
index ea9cc66..0000000
--- a/config/gnu-warnings/no-developer-4.6
+++ /dev/null
@@ -1 +0,0 @@
--Wno-suggest-attribute=const
diff --git a/config/gnu-warnings/no-developer-4.7 b/config/gnu-warnings/no-developer-4.7
deleted file mode 100644
index 5b85e1f..0000000
--- a/config/gnu-warnings/no-developer-4.7
+++ /dev/null
@@ -1,2 +0,0 @@
--Wno-suggest-attribute=noreturn
--Wno-suggest-attribute=pure
diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8
index e42e09f..1e29c78 100644
--- a/config/gnu-warnings/no-developer-4.8
+++ b/config/gnu-warnings/no-developer-4.8
@@ -1 +1,13 @@
+# no-developer warning flag added for GCC >= 4.5
+-Wno-jump-misses-init
+-Wno-unsuffixed-float-constants
+
+# no-developer warning flag added for GCC >= 4.6
+-Wno-suggest-attribute=const
+
+# no-developer warning flags added for GCC >= 4.7
+-Wno-suggest-attribute=noreturn
+-Wno-suggest-attribute=pure
+
+# no-developer warning flag added for GCC >= 4.8
-Wno-suggest-attribute=format
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1
index 39225e7..a6f81ff 100644
--- a/config/linux-gnulibc1
+++ b/config/linux-gnulibc1
@@ -42,6 +42,9 @@ fi
# Figure out Intel C compiler flags
. $srcdir/config/intel-flags
+# Figure out Clang C compiler flags
+. $srcdir/config/clang-flags
+
# Use default Fortran 90 compiler according to what C compiler is used.
if test "X-" = "X-$FC"; then
case $CC_BASENAME in
@@ -61,6 +64,11 @@ if test "X-" = "X-$FC"; then
FC=mpif90
FC_BASENAME=mpif90
;;
+ clang*)
+ # clang has no fortran compiler. Use gfortran.
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
esac
else
case $FC in
@@ -194,6 +202,9 @@ fi
# Figure out GNU CXX compiler flags
. $srcdir/config/gnu-cxxflags
+# Figure out Clang CXX compiler flags
+. $srcdir/config/clang-cxxflags
+
# compiler version strings
# check if the compiler_version_info is already set
@@ -223,6 +234,11 @@ case $CC in
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
+ *clang*)
+ cc_version_info="`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ ;;
+
*)
echo "No match to get cc_version_info for $CC"
;;
@@ -317,6 +333,11 @@ case $CXX in
cxx_version_info=`echo $cxx_version_info`
;;
+ *clang++*)
+ cxx_version_info="`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ ;;
+
*)
echo "No match to get cxx_version_info for $CXX"
;;
diff --git a/config/solaris b/config/solaris
index 656fee1..a424503 100644
--- a/config/solaris
+++ b/config/solaris
@@ -29,7 +29,9 @@ fi
# Try solaris native compiler flags
if test "X-" = "X-$cc_flags_set"; then
- H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP"
+ # HDF5 must be built with a C99 compiler on Solaris
+ # -erroff=%none turns on all warnings
+ H5_CFLAGS="$H5_CFLAGS -xc99=all -erroff=%none"
# Production
# NDEBUG is handled explicitly by the configure script
@@ -41,17 +43,26 @@ if test "X-" = "X-$cc_flags_set"; then
DEBUG_CFLAGS=
# Symbols
+ # -g produces output for dbx, NOT gdb. You can use "gdb on" from
+ # inside gdb to use gdb commands if you need to debug.
+ # If you want a LOT of debugging information (at the expense of
+ # really slow code), try using -g3. That will even let you debug
+ # into macros.
+ # -s strips symbols, as in gcc
NO_SYMBOLS_CFLAGS="-s"
SYMBOLS_CFLAGS="-g"
# Profile
+ # This produces profiling output for gprof. If you want to use
+ # the Solaris profiler, use -xprofile instead.
PROFILE_CFLAGS="-xpg"
# Optimization
- # -g produces rather slow code. "-g -O" produces much faster code with some
- # loss of debugger functions such as not able to print local variables.
- HIGH_OPT_CFLAGS="-O"
- DEBUG_OPT_CFLAGS="-O"
+ # -O has switched to -xO{1|2|3|4|5}. -xO3 is probably a good compromise
+ # for the daily tests, but you might want to switch to -xO2 or lower
+ # if you are actively debugging.
+ HIGH_OPT_CFLAGS="-xO5"
+ DEBUG_OPT_CFLAGS="-xO3"
NO_OPT_CFLAGS=
cc_flags_set=yes
diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake
index 207d03e..a2566c3 100644
--- a/config/toolchain/build32.cmake
+++ b/config/toolchain/build32.cmake
@@ -5,10 +5,11 @@ elseif(APPLE)
set (CMAKE_OSX_ARCHITECTURES "i386")
elseif(MINGW)
set (CMAKE_SYSTEM_NAME Windows)
- set (CMAKE_C_COMPILER i686-w64-mingw32-gcc)
- set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
- set (CMAKE_RC_COMPILER i686-w64-mingw32-windres)
- set (CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran)
+ set (TOOLCHAIN_PREFIX i686-w64-mingw32)
+ set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+ set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+ set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+ set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
@@ -34,11 +35,14 @@ elseif(MINGW)
set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
endif ()
- set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+ set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
- set (CMAKE_CROSSCOMPILING_EMULATOR wine32)
+ set (CMAKE_CROSSCOMPILING_EMULATOR wine)
+
+ include_directories(/usr/${TOOLCHAIN_PREFIX}/include)
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols")
else ()
set (CMAKE_SYSTEM_NAME Linux)
diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake
index fde5e38..1830488 100644
--- a/config/toolchain/mingw64.cmake
+++ b/config/toolchain/mingw64.cmake
@@ -4,11 +4,11 @@ set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
-set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/local/${TOOLCHAIN_PREFIX})
+set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_CROSSCOMPILING_EMULATOR wine64)
-include_directories(/usr/local/${TOOLCHAIN_PREFIX}/include)
+include_directories(/usr/${TOOLCHAIN_PREFIX}/include)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols")