summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-08-23 21:21:57 -0700
committerSage Weil <sage@inktank.com>2013-08-23 21:21:57 -0700
commit14a483745f104bf8bd75344e755adca3637198e1 (patch)
treecfd7f7b4ce9a563ed42ffb9756d3aeafdb799368
parent2e1ddbc4a3e07453a13f7416474aaab16861035f (diff)
parent8e53301840378a754d8807c1aac0d3a8fd5312b1 (diff)
downloadceph-14a483745f104bf8bd75344e755adca3637198e1.tar.gz
Merge pull request #514 from kri5/wip-clang-compilation
Do not use some compilation flag invalid for clang Reviewed-by: Loic Dachary <loic@dachary.org> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--configure.ac2
-rwxr-xr-xdo_autogen.sh6
-rw-r--r--src/Makefile.am11
3 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 5dba606cf3c..38b6782a46a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,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 e895b74a0cc..4b09c23e872 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1319,7 +1319,6 @@ AM_COMMON_FLAGS = \
-D_THREAD_SAFE \
-D__STDC_FORMAT_MACROS \
-D_GNU_SOURCE \
- -rdynamic \
-Wall \
${WARN_TYPE_LIMITS} \
${WARN_IGNORED_QUALIFIERS} \
@@ -1328,6 +1327,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 = \
@@ -1335,8 +1337,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