On Tue, 2011-01-04 at 16:15 +0100, Wolfram Sang wrote:

> Similar to 97a4e747bfac14f34646c55ddf639e8fe22f2f55 in xf86-video-ati.
> 
> Signed-off-by: Wolfram Sang <[email protected]>
> ---
>  configure.ac |   20 +++++++++++++-------
>  1 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 0116265..7884b28 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -78,12 +78,19 @@ sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
>  # Checks for libraries.
>  
>  if test "x$DRI" = xauto; then
> -        AC_CHECK_FILE([${sdkdir}/dri.h],
> -                      [have_dri_h="yes"], [have_dri_h="no"])
> -        AC_CHECK_FILE([${sdkdir}/sarea.h],
> -                      [have_sarea_h="yes"], [have_sarea_h="no"])
> -        AC_CHECK_FILE([${sdkdir}/dristruct.h],
> -                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
> +     PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto glproto])

With this line, the configuration will always fail on a system where
libdrm is not installed or at a version less than 2.0.
The current code is probably not correct either. It checks if headers
are in the server and will fail if libdrm is not installed. 

You can use something similar to:

PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])

The macro will not abort if the required package is missing, it will
just set the variables.
I did notice some drivers are not buildable with a server configured
without mesa.


> +     save_CPPFLAGS="$CPPFLAGS"
> +     CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
> +     AC_CHECK_HEADER([dri.h],
> +                      [have_dri_h="yes"], [have_dri_h="no"],[-])
> +     AC_CHECK_HEADER([sarea.h],
> +                      [have_sarea_h="yes"], [have_sarea_h="no"],[-])
> +     AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
> +#include <xorg-server.h>
> +#include <dristruct.h>
> +                      ]])],
> +                      [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
> +     CPPFLAGS="$save_CPPFLAGS"
>  fi
>  
>  AC_MSG_CHECKING([whether to include DRI support])
> @@ -100,7 +107,6 @@ AC_MSG_RESULT([$DRI])
>  
>  AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
>  if test "x$DRI" = xyes; then
> -        PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto glproto])
>          AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
>          AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
>  fi

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to