]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Do not use some compilation flag invalid for clang 514/head
authorChristophe Courtaut <christophe.courtaut@gmail.com>
Tue, 20 Aug 2013 09:37:51 +0000 (11:37 +0200)
committerChristophe Courtaut <christophe.courtaut@gmail.com>
Tue, 20 Aug 2013 09:42:19 +0000 (11:42 +0200)
-Wstrict-null-sentinel and -rdynamic are invalid flags
for clang compiler.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
configure.ac
do_autogen.sh
src/Makefile.am

index 6f3cc6a9f5f767275a6c5d755928bea79ee66be6..bcc455b7888d3395dc40db491b219f717cdd9cee 100644 (file)
@@ -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
index baf2dc1eba7e748abd706c8615d40e4127c63e90..32e9df4623bd54f4aadb6fc045a57fce4cde3586 100755 (executable)
@@ -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 \
index 5a0f3472080acebdcd7f2342ee7bd7358ef78df8..efc6f41c1c582259a06020989f5349ad11ef1ff8 100644 (file)
@@ -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