From d6ccd4439044978a6dcc01b8c1ab880b6164f9d1 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 17 Dec 2011 21:42:35 -0500 Subject: include config.h via Makefiles Ensures that config.h is always ordered correctly (first) in the includes. Also means that new source files get this for free without having to remember to add it. We opt for -imacros over -include as its more portable, and the added constraint by -imacros doesn't bother us for config.h. This also touches the HACKING file to remove the explicit mention of config.h as part of the includes. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- src/util/Makefile.am | 5 ++++- src/util/cleanupdelta.c | 2 -- src/util/pacsort.c | 2 -- src/util/pactree.c | 2 -- src/util/testdb.c | 2 -- 5 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src/util') diff --git a/src/util/Makefile.am b/src/util/Makefile.am index e4af56cf..2110781b 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -11,7 +11,10 @@ DEFS = -DLOCALEDIR=\"@localedir@\" \ -DDBPATH=\"$(dbpath)\" \ -DCACHEDIR=\"$(cachedir)\" \ @DEFS@ -INCLUDES = -I$(top_srcdir)/lib/libalpm + +AM_CPPFLAGS = \ + -imacros $(top_builddir)/config.h \ + -I$(top_srcdir)/lib/libalpm AM_CFLAGS = -pedantic -D_GNU_SOURCE diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index d6bd0e86..ea34fe7f 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 0eedf59d..7275cc77 100644 --- a/src/util/pacsort.c +++ b/src/util/pacsort.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/src/util/pactree.c b/src/util/pactree.c index f95c5e89..55d63d7c 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/src/util/testdb.c b/src/util/testdb.c index b15bbe5e..4f6bfed5 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include -- cgit v1.2.3-70-g09d2