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

Gaetan Nadon memsize at videotron.ca
Thu Apr 3 16:33:16 PDT 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.

Reviewed-by: Josh Triplett <josh at joshtriplett.org>
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 1606bdb..f3a9364 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