build: add lint option to configure script
authorAssaf Gordon <[email protected]>
Fri, 26 May 2017 00:43:00 +0000 (20:43 -0400)
committerAssaf Gordon <[email protected]>
Fri, 26 May 2017 00:43:00 +0000 (20:43 -0400)
Usage: ./configure --enable-lint

Use during development to supress non-critical warnings.

* configure.ac: Add --enable-lint option.
* HACKING: Mention this option.

HACKING.md
configure.ac

index eead16f..9d32280 100644 (file)
@@ -51,6 +51,10 @@ To disable code optimization (e.g. for easier debugging), run:
     # or during make
     make CFLAGS="-g -O0"
 
+To enable LINT mode:
+
+    ./configure --enable-lint
+
 To test Debian-hardening configuration, run:
 
     make deb-hard
index e2ca521..4c4f5da 100644 (file)
@@ -59,6 +59,23 @@ gl_WARN_ADD([-Wsuggest-attribute=const])
 gl_WARN_ADD([-Wsuggest-attribute=pure])
 AC_SUBST([WARN_CFLAGS])
 
+
+# Enable lint checks, for coverage/static-analyzers.
+AC_ARG_ENABLE([lint],
+              [AS_HELP_STRING([--enable-lint],[enable lint])],
+              [case $enableval in
+                 yes|no) ;;
+                 *)   AC_MSG_ERROR([bad value $enableval for lint option]) ;;
+               esac
+               use_lint=$enableval],
+              [use_lint=no]
+              )
+if test "$use_lint" = yes ; then
+  AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
+fi
+
+
+
 ## Add --enable-werror option to ./configure,
 ## To enable/disable treating compiler warnings as errors.
 ## If not specified AND we're compiling from .git repository,