[Oisf-devel] [PATCH 3/7] Add coccinelle check to 'make check'

Eric Leblond eric at regit.org
Mon Jan 31 22:45:37 UTC 2011


This patch adds coccinelle checking to the autotools
'make check'.
---
 Makefile.am               |    2 +-
 configure.in              |   15 ++++++++++++++-
 qa/Makefile.am            |    1 +
 qa/coccinelle/Makefile.am |    4 ++++
 4 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 qa/Makefile.am
 create mode 100644 qa/coccinelle/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index ac3c9e6..3965e20 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,5 +10,5 @@ EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml \
 if BUILD_LIBHTP
  HTP_DIR = libhtp
 endif
-SUBDIRS = $(HTP_DIR) src
+SUBDIRS = $(HTP_DIR) src qa
 
diff --git a/configure.in b/configure.in
index 06b3879..f682e71 100644
--- a/configure.in
+++ b/configure.in
@@ -74,6 +74,19 @@ AC_INIT(configure.in)
     exit 1
     fi
 
+    AC_PATH_PROG(HAVE_COCCINELLE_CONFIG, spatch, "no")
+    if test "$HAVE_COCCINELLE_CONFIG" = "no"; then
+    echo
+    echo "   Warning! spatch not found, you will not be  "
+    echo "   able to run code checking with coccinelle "
+    echo "   get it from http://coccinelle.lip6.fr       "
+    echo "   or install from your distribution           "
+    echo
+    fi
+    AM_CONDITIONAL([HAVE_COCCINELLE], [test "$HAVE_COCCINELLE_CONFIG" != "no"])
+
+
+
 # Checks for libraries.
 
 # Checks for header files.
@@ -852,7 +865,7 @@ AC_SUBST(CFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(CPPFLAGS)
 
-AC_OUTPUT(Makefile src/Makefile)
+AC_OUTPUT(Makefile src/Makefile qa/Makefile qa/coccinelle/Makefile)
 
 echo "
 Suricata Configuration:
diff --git a/qa/Makefile.am b/qa/Makefile.am
new file mode 100644
index 0000000..63450a3
--- /dev/null
+++ b/qa/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = coccinelle
diff --git a/qa/coccinelle/Makefile.am b/qa/coccinelle/Makefile.am
new file mode 100644
index 0000000..51e3790
--- /dev/null
+++ b/qa/coccinelle/Makefile.am
@@ -0,0 +1,4 @@
+if HAVE_COCCINELLE
+check:
+	./run_check.sh
+endif
-- 
1.7.1




More information about the Oisf-devel mailing list