[Xcb] [PATCH util-wm 3/7] config: use AC_CONFIG_HEADERS to create a config.h file

Gaetan Nadon memsize at videotron.ca
Sat Feb 1 10:20:59 PST 2014


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 at videotron.ca>
---
 configure.ac   |    1 +
 ewmh/ewmh.c.m4 |    5 +++++
 icccm/icccm.c  |    4 ++++
 3 files changed, 10 insertions(+)

diff --git a/configure.ac b/configure.ac
index 5262b91..621f15a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,6 +2,7 @@ dnl XCB_UTIL_M4_WITH_INCLUDE_PATH requires Autoconf >= 2.62
 AC_PREREQ(2.62)
 AC_INIT([xcb-util-wm],0.4.0,[xcb at lists.freedesktop.org])
 AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index d951208..769b36b 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -26,6 +26,11 @@
  * prior written authorization from the authors.
  */
 
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "xcb_ewmh.h"
 
 #include <string.h>
diff --git a/icccm/icccm.c b/icccm/icccm.c
index ed623d0..f6daf0d 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -27,6 +27,10 @@
  * prior written authorization from the authors.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <limits.h>
 #include <string.h>
-- 
1.7.9.5



More information about the Xcb mailing list