aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-27 14:21:41 +0100
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-27 14:21:41 +0100
commit612921445008f1af46e330aa842522dde7d1a887 (patch)
tree2b9ca665f82f763d57bd7eb6e4976ab2f22e95a9
parentc511b4b725b1288a93f7cd0229708e01c194df81 (diff)
downloadembedlog-612921445008f1af46e330aa842522dde7d1a887.tar.gz
embedlog-612921445008f1af46e330aa842522dde7d1a887.tar.bz2
embedlog-612921445008f1af46e330aa842522dde7d1a887.zip
fix: enable analyzer only with --enable-analyzer
enabling it always caused error on some old version of make
-rw-r--r--configure.ac11
-rw-r--r--src/Makefile.am4
2 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e5a7f67..2435ed1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -278,6 +278,17 @@ AC_DEFINE_UNQUOTED([MAX_PATH], [$MAX_PATH],
[Maximum length of path to open when printing to file])
+###
+# --enable-analyzer
+#
+
+
+AC_ARG_ENABLE([analyzer],
+ AS_HELP_STRING([--enable-analyzer], [Enable static code analyzer]),
+ [enable_analyzer="yes"], [enable_analyzer="no"])
+AM_CONDITIONAL([ENABLE_ANALYZER], [test "x$enable_analyzer" = "xyes"])
+
+
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 9119189..1185fdf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,6 +12,8 @@ libembedlog_la_CFLAGS = -I$(top_srcdir)/include
# static code analyzer
+if ENABLE_ANALYZER
+
analyze_plists = $(embedlog_sources:%.c=%.plist)
MOSTLYCLEANFILES = $(analyze_plists)
@@ -20,3 +22,5 @@ $(analyze_plists): %.plist: %.c
@clang --analyze -I.. $< -o $@
analyze: $(analyze_plists)
+
+endif