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 --- lib/libalpm/Makefile.am | 3 +++ lib/libalpm/add.c | 2 -- lib/libalpm/alpm.c | 2 -- lib/libalpm/backup.c | 2 -- lib/libalpm/be_local.c | 2 -- lib/libalpm/be_package.c | 2 -- lib/libalpm/be_sync.c | 2 -- lib/libalpm/conflict.c | 2 -- lib/libalpm/db.c | 2 -- lib/libalpm/delta.c | 2 -- lib/libalpm/delta.h | 2 -- lib/libalpm/deps.c | 2 -- lib/libalpm/diskspace.c | 2 -- lib/libalpm/dload.c | 2 -- lib/libalpm/error.c | 2 -- lib/libalpm/graph.c | 2 -- lib/libalpm/graph.h | 2 -- lib/libalpm/group.c | 2 -- lib/libalpm/handle.c | 2 -- lib/libalpm/log.c | 2 -- lib/libalpm/package.c | 2 -- lib/libalpm/package.h | 2 -- lib/libalpm/remove.c | 2 -- lib/libalpm/signing.c | 2 -- lib/libalpm/sync.c | 2 -- lib/libalpm/trans.c | 2 -- lib/libalpm/util.c | 2 -- lib/libalpm/util.h | 2 -- lib/libalpm/version.c | 2 -- 29 files changed, 3 insertions(+), 56 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am index 99f9c1b7..61dcb877 100644 --- a/lib/libalpm/Makefile.am +++ b/lib/libalpm/Makefile.am @@ -7,6 +7,9 @@ include_HEADERS = alpm_list.h alpm.h DEFS = -DLOCALEDIR=\"@localedir@\" @DEFS@ +AM_CPPFLAGS = \ + -imacros $(top_builddir)/config.h + AM_CFLAGS = -pedantic -D_GNU_SOURCE if ENABLE_VISIBILITY_CC diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 78615bb1..014990d2 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index e957f1aa..3f7ab4ba 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -21,8 +21,6 @@ * along with this program. If not, see . */ -#include "config.h" - #ifdef HAVE_LIBCURL #include #endif diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index 728c1d05..68856deb 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -21,8 +21,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 606f9e1a..2deef22c 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 4f530e0b..41ecc75a 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 54c4f879..abc4a997 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 5703aba8..b5c55dc7 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -22,8 +22,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 7708d18f..3e534358 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -22,8 +22,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index 53c83657..1272558e 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include /* intmax_t */ diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h index 05df4207..42353f5f 100644 --- a/lib/libalpm/delta.h +++ b/lib/libalpm/delta.h @@ -20,8 +20,6 @@ #ifndef _ALPM_DELTA_H #define _ALPM_DELTA_H -#include "config.h" /* ensure off_t is correct length */ - #include /* off_t */ #include "alpm.h" diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 9f7e9028..9d7e5470 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -20,8 +20,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index cfd6402c..274aa676 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #if defined(HAVE_MNTENT_H) #include diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index bcbc8095..a3980d65 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 044dec7c..528a3dcf 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #ifdef HAVE_LIBCURL #include #endif diff --git a/lib/libalpm/graph.c b/lib/libalpm/graph.c index 3a7f24b8..d080e05b 100644 --- a/lib/libalpm/graph.c +++ b/lib/libalpm/graph.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include "graph.h" #include "util.h" #include "log.h" diff --git a/lib/libalpm/graph.h b/lib/libalpm/graph.h index d4d134b5..2910b7d6 100644 --- a/lib/libalpm/graph.h +++ b/lib/libalpm/graph.h @@ -19,8 +19,6 @@ #ifndef _ALPM_GRAPH_H #define _ALPM_GRAPH_H -#include "config.h" /* ensure off_t is correct length */ - #include /* off_t */ #include "alpm_list.h" diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c index 47458df2..8b407b26 100644 --- a/lib/libalpm/group.c +++ b/lib/libalpm/group.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 01f59555..6518b7d5 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -20,8 +20,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index 692ff79c..14b454e6 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -18,8 +18,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index e96177a2..68fec16a 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -21,8 +21,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 82a83264..172d2f36 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -24,8 +24,6 @@ #ifndef _ALPM_PACKAGE_H #define _ALPM_PACKAGE_H -#include "config.h" /* ensure off_t is correct length */ - #include /* off_t */ #include "alpm.h" diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index d7e06bc8..8967eff7 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -22,8 +22,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 0bef4451..fbb6b134 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -17,8 +17,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 0c6ec9ea..49a3f42d 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -21,8 +21,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include /* off_t */ #include #include diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index cb97a4aa..5ceaaa70 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -21,8 +21,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 4eeb0cd7..b2974a48 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -22,8 +22,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include #include diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 1e192747..54e69c19 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -24,8 +24,6 @@ #ifndef _ALPM_UTIL_H #define _ALPM_UTIL_H -#include "config.h" - #include "alpm_list.h" #include "alpm.h" #include "package.h" /* alpm_pkg_t */ diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c index 6b65a413..a88b8180 100644 --- a/lib/libalpm/version.c +++ b/lib/libalpm/version.c @@ -15,8 +15,6 @@ * along with this program. If not, see . */ -#include "config.h" - #include #include -- cgit v1.2.3-70-g09d2