summaryrefslogtreecommitdiffstats
path: root/config/linux-gnulibc1
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-06-02 20:53:58 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-06-02 20:53:58 (GMT)
commitf7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8 (patch)
tree9d65d1c99634e6bdd9cdcc969f96a12127b7ed6f /config/linux-gnulibc1
parent0b9979f0752caf7283a0bc367d3bcd4d0b151480 (diff)
downloadhdf5-f7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8.zip
hdf5-f7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8.tar.gz
hdf5-f7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8.tar.bz2
Add files for adding warning flags for clang compilers in autotools
configure.
Diffstat (limited to 'config/linux-gnulibc1')
-rw-r--r--config/linux-gnulibc121
1 files changed, 21 insertions, 0 deletions
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1
index 39225e7..1a12006 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,10 @@ if test "X-" = "X-$FC"; then
FC=mpif90
FC_BASENAME=mpif90
;;
+ clang*)
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
esac
else
case $FC in
@@ -194,6 +201,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 +233,17 @@ case $CC in
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
+ *clang*)
+ # clang -v will return version number following "clang" on Linux machines,
+ # but on Macs the version number will follow "Apple LLVM version"
+ cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
+ else
+ cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
+ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
+ fi
+ ;;
+
*)
echo "No match to get cc_version_info for $CC"
;;