[Xcb] [PATCH util-image 4/8] config: use AC_CONFIG_HEADERS to create a config.h file

Gaetan Nadon memsize at videotron.ca
Fri Feb 21 10:18:18 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 +
 image/xcb_image.c |    4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 7a31623..314a039 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,6 +3,7 @@ AC_INIT([xcb-util-image],[0.3.9],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xcb&component=Utils],
 	[xcb-util-image])
 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/image/xcb_image.c b/image/xcb_image.c
index 5cfe383..4889c26 100644
--- a/image/xcb_image.c
+++ b/image/xcb_image.c
@@ -23,6 +23,10 @@
  * authorization from the authors.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-- 
1.7.9.5



More information about the Xcb mailing list