[PATCH 7/9] [kdrive] Add option to compile out input drivers

Dan Nicholson dbn.lists at gmail.com
Mon Jan 4 06:39:23 PST 2010


On Sat, Jan 2, 2010 at 6:32 AM, Mikhail Gusarov <dottedmag at dottedmag.net> wrote:
> Add --without-kdrive-{kbd,mouse,evdev} configure options disabling
> Linux keyboard driver, Linux mouse drivers (ps2, bus,ms),
> and Linux evdev driver.
>
> Build all drivers by default as before.
>
> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
> ---
>  configure.ac                |   17 +++++++++++++++++
>  hw/kdrive/ephyr/ephyrinit.c |    9 +++++++--
>  hw/kdrive/linux/Makefile.am |   31 +++++++++++++++++--------------
>  hw/kdrive/linux/linux.c     |   24 +++++++++++++++++++++++-
>  hw/kdrive/src/kdrive.h      |   14 --------------
>  include/kdrive-config.h.in  |    9 +++++++++
>  6 files changed, 73 insertions(+), 31 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 7e2c6a5..ee9fa7c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -640,6 +640,10 @@ AC_ARG_ENABLE(kdrive,         AS_HELP_STRING([--enable-kdrive], [Build kdrive se
>  AC_ARG_ENABLE(xephyr,         AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
>  AC_ARG_ENABLE(xfake,          AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
>  AC_ARG_ENABLE(xfbdev,         AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
> +dnl kdrive options
> +AC_ARG_ENABLE(kdrive-kbd,     AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: enabled)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=yes])
> +AC_ARG_ENABLE(kdrive-mouse,   AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: enabled)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=yes])
> +AC_ARG_ENABLE(kdrive-evdev,   AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: enabled)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=yes])
>
>
>  dnl chown/chmod to be setuid root as part of build
> @@ -2023,6 +2027,19 @@ if test "$KDRIVE" = yes; then
>         fi
>     fi
>
> +    AM_CONDITIONAL(KDRIVE_KBD, test x$KDRIVE_KBD = xyes)
> +    if test x$KDRIVE_KBD = xyes; then
> +       AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver])
> +    fi
> +    AM_CONDITIONAL(KDRIVE_EVDEV, test x$KDRIVE_EVDEV = xyes)
> +    if test x$KDRIVE_EVDEV = xyes; then
> +       AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver])
> +    fi
> +    AM_CONDITIONAL(KDRIVE_MOUSE, test x$KDRIVE_MOUSE = xyes)
> +    if test x$KDRIVE_MOUSE = xyes; then
> +       AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
> +    fi

Since these variables come from user input, they can take any value
like --enable-kdrive-mouse="Hi Mom". It's safer to quote the variable
after that so we don't crash stupid shells:

AM_CONDITIONAL(KDRIVE_MOUSE, test "x$KDRIVE_MOUSE" = xyes)

Otherwise,

Acked-by: Dan Nicholson <dbn.lists at gmail.com>

--
Dan


More information about the xorg-devel mailing list