[PATCH app-sessreg] Add AC_GNU_SOURCE which provides needed WTMPX_FILE define

Alan Coopersmith Alan.Coopersmith at Sun.COM
Wed Feb 3 12:26:38 PST 2010


Any reason to not just use AC_USE_SYSTEM_EXTENSIONS?
I'm not aware of any problems we've hit in the other
modules that are using that.

	-alan-

Gaetan Nadon wrote:
> The WTMPX_FILE is only defined under __USE_GNU conditional
> compilation. Autoconf provides AC_GNU_SOURCE which is a subset of
> AC_USE_SYSTEM_EXTENSIONS.
> 
> It must be expanded before any other macros that uses the compiler.
> To reduce the risk of being misplaced, the statements have been
> grouped (mostly) as per the GNU standard layout.This macro
> requires Autoconf level 2.60 or later.
> 
> The compilation failed under a GNU-Linux OS.
> 
> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
>  configure.ac |   32 +++++++++++++++++++-------------
>  1 files changed, 19 insertions(+), 13 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index be1b4b4..6287a6b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -20,25 +20,34 @@ dnl  PERFORMANCE OF THIS SOFTWARE.
>  dnl
>  dnl Process this file with autoconf to create configure.
>  
> -AC_PREREQ([2.57])
> +# Initialize Autoconf
> +AC_PREREQ([2.60])
>  AC_INIT(sessreg, [1.0.5],
>  	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
>  	sessreg)
> +AC_CONFIG_SRCDIR([Makefile.am])
> +AC_CONFIG_HEADERS([config.h])
> +AC_CANONICAL_HOST
> +AC_GNU_SOURCE
> +AC_SYS_LARGEFILE
> +
> +# Initialize Automake
>  AM_INIT_AUTOMAKE([foreign dist-bzip2])
>  AM_MAINTAINER_MODE
>  
> -AM_CONFIG_HEADER(config.h)
> -
> -# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
> +# Require xorg-macros: XORG_DEFAULT_OPTIONS
>  m4_ifndef([XORG_MACROS_VERSION],
> -	  [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
> -XORG_MACROS_VERSION(1.3)
> +	  [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
> +XORG_MACROS_VERSION(1.4)
> +XORG_DEFAULT_OPTIONS
> +XORG_WITH_LINT
>  
> +# Checks for programs.
>  AC_PROG_CC
> +AC_PROG_CC_C99
>  AC_PROG_INSTALL
>  
> -XORG_DEFAULT_OPTIONS
> -
> +# Checks for header files.
>  AC_CHECK_HEADERS([lastlog.h utmp.h utmpx.h sys/param.h])
>  AC_CHECK_MEMBER([struct utmpx.ut_syslen],
>  		HAVE_SYSLEN=1,
> @@ -46,15 +55,12 @@ AC_CHECK_MEMBER([struct utmpx.ut_syslen],
>  		[#include <utmpx.h>])
>  AC_DEFINE_UNQUOTED(HAVE_UTMPX_UT_SYSLEN,$HAVE_SYSLEN,
>  		   [utmpx structure includes ut_syslen field])
> -AC_CHECK_FUNCS([updwtmpx utmpxname])
>  
> -AC_SYS_LARGEFILE
> +# Checks for typedefs, structures, and compiler characteristics.
> +AC_CHECK_FUNCS([updwtmpx utmpxname])
>  
>  # Checks for pkg-config packages
>  PKG_CHECK_MODULES(SESSREG, xproto)
>  AC_SUBST(SESSREG_CFLAGS)
>  
> -# Allow checking code with lint, sparse, etc.
> -XORG_WITH_LINT
> -
>  AC_OUTPUT([Makefile])

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list