[lockdev-devel] [PATCH 22/22] conditionally enable silent rules
Ludwig Nussel
ludwig.nussel at suse.de
Fri Feb 26 10:37:22 UTC 2010
Older automake that don't support silent rules abort if the silent-rules
option is present.
Also automatically include config.h
Thanks Karel Zak for the hints.
---
configure.ac | 4 +++-
src/Makefile.am | 2 ++
src/lockdev.c | 4 ----
src/sample.c | 4 ----
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 72e50b0..895cde3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,9 @@ AC_CONFIG_MACRO_DIR([m4])
AC_PREREQ(2.53)
AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE([1.6 foreign no-dist-gzip dist-bzip2 silent-rules -Wall])
+AM_INIT_AUTOMAKE([1.6 foreign no-dist-gzip dist-bzip2 -Wall])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
dnl Checks for programs.
AC_PROG_CC
diff --git a/src/Makefile.am b/src/Makefile.am
index 350a56e..3b4adda 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,6 +3,8 @@ noinst_PROGRAMS = baudboy
include_HEADERS = lockdev.h baudboy.h ttylock.h
+AM_CPPFLAGS = -include $(top_builddir)/config.h
+
lockdev_SOURCES = sample.c
lockdev_LDADD = liblockdev.la
diff --git a/src/lockdev.c b/src/lockdev.c
index 148813d..f36cfb0 100644
--- a/src/lockdev.c
+++ b/src/lockdev.c
@@ -102,10 +102,6 @@
*
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <errno.h>
#include <signal.h>
#include <stdio.h>
diff --git a/src/sample.c b/src/sample.c
index a1a67e3..b2dd095 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1,7 +1,3 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
--
1.6.4.2
More information about the lockdev-devel
mailing list