[PATCH:libX11] Merge X11, XKBPROTO, & XPROTO pkg-config lists

Peter Hutterer peter.hutterer at who-t.net
Tue Jan 5 22:59:09 PST 2010


On Tue, Jan 05, 2010 at 06:31:57PM -0800, Alan Coopersmith wrote:
> Since the XPROTO_CFLAGS & XKBPROTO_CFLAGS are just merged into X11_CFLAGS
> in configure.ac anyway, might as well combine the lists passed to
> PKG_CHECK_MODULES to reduce duplication in the flags.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
> ---
>  configure.ac |   19 ++++++++-----------
>  1 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 7f69726..58eae70 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -58,12 +58,13 @@ AC_CACHE_CHECK([whether to use XCB], [ac_cv_use_xcb], [ac_cv_use_xcb=yes])
>  AM_CONDITIONAL(XCB, test x$ac_cv_use_xcb != xno)
>  
>  # Checks for pkg-config packages
> -PKG_CHECK_MODULES(XPROTO, [xproto >= 7.0.13])
> -AC_SUBST(XPROTO_CFLAGS)
> +
> +# Always required
> +X11_REQUIRES='xproto >= 7.0.13 xextproto xtrans'
>  
>  case "$ac_cv_use_xcb" in
>  no)
> -	X11_REQUIRES="xau xcmiscproto bigreqsproto"
> +	X11_REQUIRES="${X11_REQUIRES} xau xcmiscproto bigreqsproto"
>  	X11_EXTRA_DEPS="xau"
>  	PKG_CHECK_MODULES(XDMCP, xdmcp,
>  		AC_CHECK_LIB(Xdmcp, XdmcpWrap,
> @@ -79,14 +80,13 @@ no)
>  	AC_DEFINE(USE_XCB, 0, [Use XCB for low-level protocol implementation])
>  	;;
>  *)
> -	X11_REQUIRES="xcb >= 1.1.92"
> +	X11_REQUIRES="${X11_REQUIRES} xcb >= 1.1.92"
>  	X11_EXTRA_DEPS="xcb >= 1.1.92"
>  	xdmauth="no" # XCB handles all auth
>  	AC_DEFINE(USE_XCB, 1, [Use XCB for low-level protocol implementation])
>  	;;
>  esac
>  AC_SUBST(X11_EXTRA_DEPS)
> -PKG_CHECK_MODULES(X11, xextproto xtrans $X11_REQUIRES)
>  
>  dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
>  dnl was not expanded, since libX11 with no transport types is rather useless.
> @@ -262,7 +262,6 @@ if test x$xthreads = xyes ; then
>  fi
>  AC_SUBST(XTHREADLIB)
>  AC_SUBST(XTHREAD_CFLAGS)
> -X11_CFLAGS="$X11_CFLAGS $XTHREAD_CFLAGS"
>  
>  case x$xdmauth in
>  xyes)
> @@ -354,10 +353,8 @@ AM_CONDITIONAL(MANPAGES, [ test x$LIBMAN '!=' xno ])
>  AM_CONDITIONAL(XKB, [ test x$XKB = xyes ])
>  if test x"$XKB" = "xyes"; then
>     XKBPROTO_REQUIRES="kbproto"
> -   PKG_CHECK_MODULES(XKBPROTO, kbproto inputproto)
> +   X11_REQUIRES="${X11_REQUIRES} kbproto inputproto"
>     AC_DEFINE(XKB,1,[Use XKB])
> -   X11_CFLAGS="$X11_CFLAGS $XKBPROTO_CFLAGS"
> -   X11_LIBS="$X11_LIBS $XKBPROTO_LIBS"
>  else
>     XKBPROTO_REQUIRES=""
>  fi
> @@ -377,7 +374,6 @@ fi
>  dnl Allow checking code with lint, sparse, etc.
>  XORG_WITH_LINT
>  XORG_LINT_LIBRARY([X11])
> -LINT_FLAGS="${LINT_FLAGS} ${X11_CFLAGS} ${XPROTO_CFLAGS}"
>  
>  X11_DATADIR="${datadir}/X11"
>  AC_DEFINE_DIR(X11_DATADIR, X11_DATADIR, [Location of libX11 data])
> @@ -387,7 +383,8 @@ X11_LIBDIR="${libdir}/X11"
>  AC_DEFINE_DIR(X11_LIBDIR, X11_LIBDIR, [Location of libX11 library data])
>  AC_SUBST(X11_LIBDIR)
>  
> -X11_CFLAGS="$CWARNFLAGS $X11_CFLAGS $XPROTO_CFLAGS"
> +PKG_CHECK_MODULES(X11, [$X11_REQUIRES])
> +X11_CFLAGS="$CWARNFLAGS $X11_CFLAGS $XTHREAD_CFLAGS"
>  AC_SUBST(X11_CFLAGS)
>  AC_SUBST(X11_LIBS)
>  
> -- 
> 1.5.6.5

Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter


More information about the xorg-devel mailing list