diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2020-06-08 16:42:37 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2020-06-08 16:42:37 (GMT) |
commit | 23d887dc22b71a10423a3206a9998ed87a18f482 (patch) | |
tree | 6be45438abca4d85206481043d1089db31adab69 /config/linux-gnulibc1 | |
parent | 56ab55be3fe5d519dd7933bdadb776b486f75708 (diff) | |
parent | c7626f79fdee4eee13925e240ef41e61f3367eab (diff) | |
download | hdf5-23d887dc22b71a10423a3206a9998ed87a18f482.zip hdf5-23d887dc22b71a10423a3206a9998ed87a18f482.tar.gz hdf5-23d887dc22b71a10423a3206a9998ed87a18f482.tar.bz2 |
Merge pull request #2623 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop
* commit 'c7626f79fdee4eee13925e240ef41e61f3367eab':
Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h.
Add files for adding warning flags for clang compilers in autotools configure.
Diffstat (limited to 'config/linux-gnulibc1')
-rw-r--r-- | config/linux-gnulibc1 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 39225e7..055b075 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,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" ;; |