[PATCH] configure: introduce --{enable,disable}-libdrm

Gaetan Nadon memsize at videotron.ca
Mon Jan 25 11:05:44 PST 2010


On Mon, 2010-01-25 at 20:15 +0200, Tiago Vignatti wrote:

> On Fri, Jan 22, 2010 at 11:18:20PM +0100, ext Gaetan Nadon wrote:
> > On Fri, 2010-01-22 at 19:04 +0200, Tiago Vignatti wrote:
> > 
> >  if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
> > -       PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
> > -       AC_SUBST(LIBDRM_CFLAGS)
> > -       AC_SUBST(LIBDRM_LIBS)
> > +       if test "x$DRM" = xyes; then
> > +               AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
> > +               PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
> > +               AC_SUBST(LIBDRM_CFLAGS)
> > +               AC_SUBST(LIBDRM_LIBS)
> > 
> > 
> >                     nit:        AC_SUBST not required, already done by PKG_CHECK_MODULES
> > 
> 
> Are you sure about it? If so, we need to patch all configure.ac doing such
> correction.
> 

Yes, you can easily look in the generated Makefile. I tried both with
and without the AC_SUBST. 

LIBDRM_CFLAGS = -I/home/nadon/xorg/src/include
-I/home/nadon/xorg/src/include/drm  
LIBDRM_LIBS = -L/home/nadon/xorg/src/lib -ldrm  

Macro definitions:

        AC_DEFUN([PKG_CHECK_MODULES],
        [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
        AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
        AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
        ...
        
                AC_DEFUN([AC_ARG_VAR],
                ...
                AC_SUBST([$1])dnl
                _AC_ARG_VAR_PRECIOUS([$1])dnl
                ])# AC_ARG_VAR


The macro from pkg-config defines the LIBDRM_CFLAGS and LIBDRM_LIBS as
arguments to ./configure. In doing so, AC_ARG_VAR calls AC_SUBST so that
you are able to use it in your makefile.

I have a todo to clean them up, that would make one less to do. The
extra statements don't hurt, remove them only if you are satisfied.

> 
> Thanks,
>             Tiago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20100125/7129eb2b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20100125/7129eb2b/attachment.pgp 


More information about the xorg-devel mailing list