diff options
author | Christophe Courtaut <christophe.courtaut@gmail.com> | 2013-08-20 11:37:51 +0200 |
---|---|---|
committer | Christophe Courtaut <christophe.courtaut@gmail.com> | 2013-08-20 11:42:19 +0200 |
commit | 8e53301840378a754d8807c1aac0d3a8fd5312b1 (patch) | |
tree | f79a0e4168898b9aa2af69500b3e0a8cfe4e022d | |
parent | 928a0d42707ca2aaa69cd47f686a2ad846bc7eeb (diff) | |
download | ceph-8e53301840378a754d8807c1aac0d3a8fd5312b1.tar.gz |
Do not use some compilation flag invalid for clang
-Wstrict-null-sentinel and -rdynamic are invalid flags
for clang compiler.
Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rwxr-xr-x | do_autogen.sh | 6 | ||||
-rw-r--r-- | src/Makefile.am | 11 |
3 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 6f3cc6a9f5f..bcc455b7888 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,8 @@ if test "$CXX" = no || test "$CXX:$GXX" = "g++:"; then AC_MSG_ERROR([no C++ compiler found]) fi +AM_CONDITIONAL(CLANG, test x"$CXX" = x"clang++") + #AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_LIBTOOL diff --git a/do_autogen.sh b/do_autogen.sh index baf2dc1eba7..32e9df4623b 100755 --- a/do_autogen.sh +++ b/do_autogen.sh @@ -82,7 +82,11 @@ if [ "${debug_level}" -ge 3 ]; then -Wno-missing-field-initializers -Wno-missing-declarations" fi if [ "${debug_level}" -ge 4 ]; then - CXXFLAGS="${CXXFLAGS} -Wstrict-null-sentinel -Woverloaded-virtual" + if [ "${CXX}" -ne "clang++" ]; then + CXXFLAGS="${CXXFLAGS} -Wstrict-null-sentinel -Woverloaded-virtual" + else + CXXFLAGS="${CXXFLAGS} -Woverloaded-virtual" + fi CFLAGS="${CFLAGS} \ -Wuninitialized -Winit-self \ -Wformat=2 -Wunused -Wfloat-equal \ diff --git a/src/Makefile.am b/src/Makefile.am index 5a0f3472080..efc6f41c1c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1318,7 +1318,6 @@ AM_COMMON_FLAGS = \ -D_THREAD_SAFE \ -D__STDC_FORMAT_MACROS \ -D_GNU_SOURCE \ - -rdynamic \ -Wall \ ${WARN_TYPE_LIMITS} \ ${WARN_IGNORED_QUALIFIERS} \ @@ -1327,6 +1326,9 @@ AM_COMMON_FLAGS = \ -Werror=format-security \ -fno-strict-aliasing \ -fsigned-char +if !CLANG + AM_COMMON_FLAGS += -rdynamic +endif AM_CFLAGS = $(AM_COMMON_FLAGS) AM_CXXFLAGS = \ @@ -1334,8 +1336,11 @@ AM_CXXFLAGS = \ $(AM_COMMON_FLAGS) \ -DCEPH_LIBDIR=\"${libdir}\" \ -Wnon-virtual-dtor \ - -Wno-invalid-offsetof \ - -Wstrict-null-sentinel + -Wno-invalid-offsetof + +if !CLANG + AM_CXXFLAGS += -Wstrict-null-sentinel +endif # note: this is position dependant, it affects the -l options that # come after it on the command line. when you use ${AM_LDFLAGS} in # later rules, take care where you place it. for more information, see |