[libgdata/clang: 8/8] [build] UNFINISHED work to add clang support to the build
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata/clang: 8/8] [build] UNFINISHED work to add clang support to the build
- Date: Sun, 8 Aug 2010 22:54:48 +0000 (UTC)
commit c02a5d67e8ebc64fa88a708fa2a054a50538f255
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sat Aug 7 23:19:38 2010 +0100
[build] UNFINISHED work to add clang support to the build
Makefile.am | 16 ++++++++++++++++
configure.ac | 10 ++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 52d4e45..9b7fe48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -476,6 +476,22 @@ gcov:
@echo "Need to reconfigure with --enable-gcov"
endif
+# Clang Static Analyzer support
+if CLANG_ANALYZER_ENABLED
+analyze: clean
+ $(AM_V_GEN)(if [! -d "$(top_builddir)/clang-analyzer" ]; then \
+ mkdir "$(top_builddir)/clang-analyzer"; \
+ fi; \
+ $(SCAN_BUILD) --experimental-checks -o "$(top_builddir)/clang-analyzer" make)
+
+maintainer-clean: analyze-clean
+analyze-clean:
+ @rm -rf "$(top_builddir)/clang-analyzer"
+else
+analyze:
+ @echo "Need to reconfigure with --enable-clang-analyzer"
+endif
+
# Cleaning
EXTRA_DIST += \
autogen.sh \
diff --git a/configure.ac b/configure.ac
index b61c93b..0b6f9be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,6 +109,16 @@ fi
AM_CONDITIONAL(GCOV_ENABLED, test x$enable_gcov = xyes)
AC_MSG_RESULT($enable_gcov)
+# Static code checking with Clang
+AC_MSG_CHECKING(whether to build with Clang Static Analyzer support)
+AC_ARG_ENABLE(clang-analyzer, AS_HELP_STRING([--enable-clang-analyzer], [Whether to enable Clang Static Analyzer support]),, enable_clang_analyzer=no)
+AM_CONDITIONAL(CLANG_ANALYZER_ENABLED, test "x$enable_clang_analyzer" = "xyes")
+AC_MSG_RESULT($enable_clang_analyzer)
+
+if test "x$enable_clang_analyzer" = "xyes"; then
+ AC_PATH_PROG([SCAN_BUILD],[scan-build])
+fi
+
# General GNOME macros
GNOME_COMMON_INIT
GNOME_DEBUG_CHECK
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]