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

Uli Schlachter psychon at znc.in
Thu Apr 17 05:35:39 PDT 2014


On 04.04.2014 01:33, Gaetan Nadon wrote:
> 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(+)

What about the test cases? Shouldn't they include config.h, too?

> 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>
> 


-- 
Do Not Touch The Jellyfish! Get Me To The Hosp Immediately


More information about the Xcb mailing list