summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2014-02-09 10:41:18 -0500
committerGaetan Nadon <memsize@videotron.ca>2014-02-09 10:41:18 -0500
commit370f65e302c0d51ffa8ca0075f690cd0a427cb72 (patch)
tree1baf943bea6639d44b7eddb554b0429d59e0fdf7
parent6201c8bac766ce92bff09e8956a4b6c2d1286881 (diff)
config: use AC_CONFIG_HEADERS to create a config.h file
This file contains C preprocessor #define statements which replace the current -Ds added to each compilation invocation. This makes the gcc output command easier to read and prevents exceeding the max line limits on some computers. This is the preferred method in al the xorg modules. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r--configure.ac1
-rw-r--r--src/atoms.c5
-rw-r--r--src/event.c4
-rw-r--r--src/xcb_aux.c4
4 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7693872..5e66d01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,6 +3,7 @@ AC_INIT([xcb-util],[0.3.9],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xcb&component=Utils],
[xcb-util])
AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
diff --git a/src/atoms.c b/src/atoms.c
index e9133a6..e5c33e5 100644
--- a/src/atoms.c
+++ b/src/atoms.c
@@ -1,3 +1,8 @@
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/* Rely on vasprintf (GNU extension) instead of vsnprintf if
possible... */
#define _GNU_SOURCE
diff --git a/src/event.c b/src/event.c
index de8899a..b868252 100644
--- a/src/event.c
+++ b/src/event.c
@@ -26,6 +26,10 @@
* prior written authorization from the authors.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/xcb_aux.c b/src/xcb_aux.c
index 4efb5cb..b6f64f8 100644
--- a/src/xcb_aux.c
+++ b/src/xcb_aux.c
@@ -29,6 +29,10 @@
* prior written authorization from the authors.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>