On Thu, Apr 01, 2010 at 07:45:02PM +0200, Giuseppe Bilotta wrote:
> The wacom_drv X driver does not build on Xorg >= 1.7, so we detect
> its presence during configure and disable wacom_drv if it's found.
> 
> Signed-off-by: Giuseppe Bilotta <[email protected]>
> ---
>  configure.in |   31 ++++++++++++++++++++++++++-----
>  1 files changed, 26 insertions(+), 5 deletions(-)
> 
> With this patch, I can finally run ./configure && make directly, without
> having to specify that the wacom_drv driver should not be built as my Xorg
> version is unsupported.
> 
> This is the first time I hack at an autoconf script, so feel free to
> suggest on how to improve this kind of hacks, I'm more than willing to
> learn 8-)

I think this would be easier using a PKG_CHECK_MODULES test similar to
http://lists.freedesktop.org/archives/xorg-devel/2010-March/006602.html
we're already using pkg-config anyway so we might as well make use of it :)
Also, maybe add a configure message that the X driver is superseeded by
xf86-input-wacom along with a pointer to the git repo?

Cheers,
  Peter
 
> diff --git a/configure.in b/configure.in
> index f7d86c0..da8f78d 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -494,6 +494,22 @@ if test "$WCM_ENV_XFREE86" != yes; then
>                       AC_DEFINE(WCM_XORG_XSERVER_1_6, 1,
>                               [Using version 1.6 or later of X.org])
>               fi
> +             AC_MSG_CHECKING([if Xorg server is version 1.7 or later])
> +             save_CFLAGS="$CFLAGS"
> +             CFLAGS="-I$WCM_XORGSDK_DIR $CFLAGS"
> +             AC_TRY_COMPILE([
> +#include <xorg-server.h>
> +#include <xorgVersion.h>
> +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 7, 0, 0, 0)
> +# error "X.org < 1.7 is not supported"
> +#endif
> +], , [WCM_XORG_XSERVER_1_7=yes], [WCM_XORG_XSERVER_1_7=no])
> +             CFLAGS="$save_CFLAGS"
> +             AC_MSG_RESULT($WCM_XORG_XSERVER_1_7)
> +             if test "$WCM_XORG_XSERVER_1_7" = "yes"; then
> +                     AC_DEFINE(WCM_XORG_XSERVER_1_7, 1,
> +                             [NOT using version 1.7 or later of X.org])
> +             fi
>               AC_MSG_CHECKING([if Xorg SDK defined IsXExtensionPointer])
>               save_CFLAGS="$CFLAGS"
>               CFLAGS="-I$WCM_XORGSDK_DIR $CFLAGS"
> @@ -928,12 +944,17 @@ if test "$WCM_OPTION_WACOMDRV" != "no"; then
>               AC_MSG_WARN([requires Xorg SDK or XFree86 build environment, 
> wacom_drv not built])
>               WCM_OPTION_WACOMDRV=no
>       else
> -             AC_MSG_RESULT(yes)
> -             WCM_OPTION_WACOMDRV=yes
> -             if test "$WCM_OPTION_DLLOADER" = "yes" ; then
> -                     WCM_XF86MODULES="wacom_drv.so"
> +             if test "$WCM_XORG_XSERVER_1_7" = "yes"; then
> +                     AC_MSG_WARN([requires Xorg version < 1.7, wacom_drv not 
> built])
> +                     WCM_OPTION_WACOMDRV=no
>               else
> -                     WCM_XF86MODULES="wacom_drv.o"
> +                     AC_MSG_RESULT(yes)
> +                     WCM_OPTION_WACOMDRV=yes
> +                     if test "$WCM_OPTION_DLLOADER" = "yes" ; then
> +                             WCM_XF86MODULES="wacom_drv.so"
> +                     else
> +                             WCM_XF86MODULES="wacom_drv.o"
> +                     fi
>               fi
>       fi
>  else
> -- 
> 1.7.0.3.513.gc8ed0

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to