diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-01-21 18:40:21 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-01-21 18:40:21 +0000 |
commit | 7ade1018c25e64d7db6d9888b4caecbfae8c209e (patch) | |
tree | ac9aab230e767c0d47cfe3abd0fa9db0848ec5b5 /driver/xf86-input-vmmouse | |
parent | 473738d7be6cd00b741c87b70766054719e1178b (diff) |
Update to xf86-input-vmmouse 13.1.0
Diffstat (limited to 'driver/xf86-input-vmmouse')
21 files changed, 1367 insertions, 940 deletions
diff --git a/driver/xf86-input-vmmouse/ChangeLog b/driver/xf86-input-vmmouse/ChangeLog index e2b272d71..33877a0a0 100644 --- a/driver/xf86-input-vmmouse/ChangeLog +++ b/driver/xf86-input-vmmouse/ChangeLog @@ -1,3 +1,269 @@ +commit bbe41fae444e58c98db64db20114418ec78b99d6 +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Thu Jun 25 03:20:34 2015 -0700 + + Bump version number for release + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + Reviewed-by: Trivial. + +commit d2040bd52d2dde08ce729dedabb350d3476e294a +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Wed Apr 8 23:26:34 2015 -0700 + + vmmouse: Bump version number for release + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + +commit 5b7d9cf15ae44361a3de506916f769d8dfec61d1 +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Wed Apr 8 18:25:41 2015 +0200 + + vmmouse: Fix vmmouse_detect build on BSD + + Tested with FreeBSD, but changes affect also OpenBSD and NetBSD to fix + compiling and linking with the relevant system libraries. + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + Reviewed-by: Brian Paul <brianp@vmware.com> + Acked-by: Sinclair Yeh <syeh@vmware.com> + +commit c8ec00f537a640db049a1afb44a31c2199859085 +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Thu Jan 15 10:59:46 2015 +0100 + + vmmouse: Add support for the access restrict command + + The access restrict command, if implemented, restricts vmmouse port + access to the indicated level. + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + Reviewed-by: Michael Banack <banackm@vmware.com> + +commit d5c1493b5fe0871f4f2823125f0d49f8e1edcda7 +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Thu Jan 15 10:14:30 2015 +0100 + + vmmouse: Run vmmouse_detect as an io privileged process + + Many distros already include patches to do this in various more or less + hackish ways. Since VMware now is about to restrict access to the VMmouse + backdoor, let's try to support it officially. + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + Acked-by: Sinclair Yeh <syeh@vmware.com> + +commit 1cbbc03c4b37d57760c57bd2e0b0f89d744a5795 +Author: Stefan Dirsch <sndirsch@suse.de> +Date: Tue Oct 7 11:32:01 2014 +0200 + + vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h + + xf86_OSproc.h cannot be included without first including xorg-server.h. + + Without this the build fails on systems with the latest glibc, + throwing this error: + + In file included from /usr/include/string.h:634:0, + from /usr/include/xorg/os.h:53, + from /usr/include/xorg/misc.h:115, + from /usr/include/xorg/window.h:50, + from /usr/include/xorg/globals.h:7, + from /usr/include/xorg/opaque.h:34, + from /usr/include/xorg/xf86_OSproc.h:127, + from vmmouse_client.h:42, + from vmmouse_client.c:38: + /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' + strndup(const char *str, size_t n); + + This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), + causing os.h to redefine it. + + Signed-off-by: Stefan Dirsch <sndirsch@suse.de> + Reviewed-by: Daniel Stone <daniels@collabora.com> + Acked-by: Thomas Hellstrom <thellstrom@vmware.com> + +commit 576e8123d9f9f01ef6041cdfb96ca811197d05d2 +Author: Thomas Hellstrom <thellstrom@vmware.com> +Date: Wed Oct 1 21:04:30 2014 +0200 + + Back off if we detect a vmmouse kernel driver v3 + + If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg + evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect + utility doesn't detect a vmmouse if a kernel driver is active. + + v2: Change the vmmouse kernel device name, fix comment. + v3: Fix up libudev error handling. + + Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> + Reviewed-by: Sinclair Yeh <syeh@vmware.com> + +commit de58228aaf226baac21f4bb31712f7257b221370 +Author: Loïc Yhuel <loic.yhuel@gmail.com> +Date: Sat Jul 12 07:29:24 2014 +0200 + + Fix wheel button labels + + Wheel is using buttons 4/5, but btn_labels array is 0-based. + It matches mouse and evdev drivers, and fixes wheel in Qt5.3. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 336f8633837abe4a1e5ba84b53ac8b9dac5d29a2 +Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com> +Date: Thu Nov 28 11:59:53 2013 -0800 + + Always include config.h first + + This fixes some build warnings about CSRG_BASED being redefined due to + incorrect header include ordering. + + Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> + +commit 05492b038e7773aa8f90449387cde89e10bc614c +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Sep 30 13:56:53 2013 -0400 + + tools: make install fails when user has no write permission in /lib + + The location of the udevdir is obtained from pkg-config. This is generally + /lib/udev. Most people run their build scripts as non-root and do not want to + overwrite or add files on their workstation system. + + This was not the behaviour in release 12.8.0. The code in configure.ac set + udevdir based on common installation prefixes /usr or /usr/local for which + the user would probably have root permission anyway. Other prefixes would + be assigned a udevdir value under the given $prefix. + + The patch proposes the default location $libdir/udev/rules.d and no longer + seeking it's value from pkg-config, just like what was done for hal. + + The expectation is that the xorg source tree can be built from top to bottom + out of the box without tweaks or workarounds. A developer need to + manually install a rule under development and run an admin command for it to + take effect. Unlike binaries or libraries, there is no "path" style + variable to append a rule in development from a different location. + + Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> + +commit 740f2cbcc0781109a6c898685b5200bdb55acac8 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Oct 21 14:09:04 2013 +1000 + + Drop AM_MAINTAINER_MODE + + Long writeup: + http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/ + + Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9a815289f9df5577f5fdf4c2463b614a93819b7d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Feb 11 15:27:26 2013 +1000 + + Don't de-reference pMse if it hasn't been initialised yet + + If the device fails PreInit, UnInit is still called by pMse may be NULL. + Dereferencing it is a bad idea. + + Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 3d5b85d62c11a9f816dbcc041cb2ac2150af666d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jan 30 10:54:11 2013 +1000 + + Handle DEVICE_ABORT on ABI 19.1 + + Called on server abort, so let's just do the absolute minimum. + + Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> + +commit eb23b149c176d1c735b4c658b33ce6686e47618b +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 22 18:09:27 2013 -0400 + + "make dist" fails when workstation has no udev package + + Unable to create a tar file for the vmmouse package or run distcheck for that + matter. In tools, when the dev package is not installed, the makefile code + under HAS_UDEV_RULES_DIR is commented out. That leaves $(udev_DATA) empty + which causes EXTRA_DIST to be missing a file. + + The solution is to spell out the file name. The name can never change as the + content of the tarball must be the same for everyone creating a tar file from + git, regardless of their workstation configuration. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 60a6e4ec6068f7b3f237ca0a044cd31d3bcf1aeb +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 22 17:07:14 2013 -0400 + + Autoconf: Fix deprecated use of AC_OUTPUT + + Use AC_CONFIG_FILES (once or more) and then AC_OUTPUT. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 64df5e5fdef9c34bad4edf90ee5f489a5c519405 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 22 16:58:27 2013 -0400 + + Autoconf: minimum level required is 2.60 + + The minimum for all X.Org modules. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit c37d1dcf76eb9c9df7c69fe6d4d082350553a1a0 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 22 16:55:42 2013 -0400 + + Autoconf: replace deprecated AC_HELP_STRING with AS_HELP_STRING + + Just a macro name change. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit d695372a7f8c54c0297c4dbd3513175417eade40 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 22 16:50:58 2013 -0400 + + Autoconf: remove AC_PROG_CC which overrides AC_PROG_CC_C99 from util-macros + + All other X.Org modules and mainly the server are using C99 compiler. + Currently the compiler gets initialized twice, once to C99 from + util-macros and once to C89 from configure.ac. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 8cb6254ad3068537e74faaf80b9e346e525ea92d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Feb 1 11:52:53 2013 +1000 + + Free the vmmouse data on UnInit + + xf86DeleteInput() will free pInfo->private, but not the one hanging off + that. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Tested-by: Zack Rusin <zackr@vmware.com> + commit a2e4aa9d2002dad6e976d9e4d3f129ad3127be81 Author: Zack Rusin <zackr@vmware.com> Date: Tue Jan 15 12:03:28 2013 -0800 diff --git a/driver/xf86-input-vmmouse/Makefile.in b/driver/xf86-input-vmmouse/Makefile.in index e7b47dc1b..bdd3b1688 100644 --- a/driver/xf86-input-vmmouse/Makefile.in +++ b/driver/xf86-input-vmmouse/Makefile.in @@ -213,6 +213,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -248,8 +250,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ diff --git a/driver/xf86-input-vmmouse/config.h.in b/driver/xf86-input-vmmouse/config.h.in index e724d50d8..98759ed88 100644 --- a/driver/xf86-input-vmmouse/config.h.in +++ b/driver/xf86-input-vmmouse/config.h.in @@ -14,6 +14,21 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `ioperm' function. */ +#undef HAVE_IOPERM + +/* Define to 1 if you have the `iopl' function. */ +#undef HAVE_IOPL + +/* Define to 1 if you have the `amd64' library (-lamd64). */ +#undef HAVE_LIBAMD64 + +/* Define to 1 if you have the `i386' library (-li386). */ +#undef HAVE_LIBI386 + +/* Has libudev installed */ +#undef HAVE_LIBUDEV + /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H @@ -84,5 +99,20 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* BSD /dev/io */ +#undef USE_DEV_IO + +/* BSD i386 iopl */ +#undef USE_I386_IOPL + /* Version number of package */ #undef VERSION + +/* Building for BSD flavour */ +#undef VMMOUSE_OS_BSD + +/* Building for iopl / ioperm capable OS */ +#undef VMMOUSE_OS_GENERIC + +/* Building for Solaris flavour */ +#undef VMMOUSE_OS_SOLARIS diff --git a/driver/xf86-input-vmmouse/configure b/driver/xf86-input-vmmouse/configure index 56bddc792..b73139511 100644 --- a/driver/xf86-input-vmmouse/configure +++ b/driver/xf86-input-vmmouse/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xf86-input-vmmouse 13.0.0. +# Generated by GNU Autoconf 2.69 for xf86-input-vmmouse 13.1.0. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-input-vmmouse' PACKAGE_TARNAME='xf86-input-vmmouse' -PACKAGE_VERSION='13.0.0' -PACKAGE_STRING='xf86-input-vmmouse 13.0.0' +PACKAGE_VERSION='13.1.0' +PACKAGE_STRING='xf86-input-vmmouse 13.1.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -639,11 +639,11 @@ LTLIBOBJS LIBOBJS XORG_LIBS XORG_CFLAGS +LIBUDEV_LIBS +LIBUDEV_CFLAGS HAS_UDEV_RULES_DIR_FALSE HAS_UDEV_RULES_DIR_TRUE UDEV_RULES_DIR -UDEV_LIBS -UDEV_CFLAGS HAL_FDI_DIR HAL_CALLOUTS_DIR HAL_BIN_DIR @@ -708,6 +708,9 @@ BASE_CFLAGS EGREP GREP CPP +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -725,9 +728,6 @@ CPPFLAGS LDFLAGS CFLAGS CC -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE am__untar am__tar AMTAR @@ -792,8 +792,8 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_maintainer_mode enable_dependency_tracking +enable_maintainer_mode enable_selective_werror enable_strict_compilation enable_silent_rules @@ -810,6 +810,7 @@ with_hal_bin_dir with_hal_callouts_dir with_hal_fdi_dir with_udev_rules_dir +with_libudev ' ac_precious_vars='build_alias host_alias @@ -823,8 +824,8 @@ CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR -UDEV_CFLAGS -UDEV_LIBS +LIBUDEV_CFLAGS +LIBUDEV_LIBS XORG_CFLAGS XORG_LIBS' @@ -1367,7 +1368,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-input-vmmouse 13.0.0 to adapt to many kinds of systems. +\`configure' configures xf86-input-vmmouse 13.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1439,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-input-vmmouse 13.0.0:";; + short | recursive ) echo "Configuration of xf86-input-vmmouse 13.1.0:";; esac cat <<\_ACEOF @@ -1446,13 +1447,13 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer --disable-selective-werror Turn off selective compiler errors. (default: enabled) @@ -1490,9 +1491,9 @@ Optional Packages: located [[default=$datadir/hal/fdi/policy/20thirdparty]] --with-udev-rules-dir=DIR - Default udev rules.d directory - [[default=($prefix)/lib/udev/rules.d on Linux, none - otherwise]] + Directory where udev expects its rules files + [[default=$libdir/udev/rules.d]] + --without-libudev Use to build without libudev on linux Some influential environment variables: CC C compiler command @@ -1508,8 +1509,10 @@ Some influential environment variables: directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path - UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config - UDEV_LIBS linker flags for UDEV, overriding pkg-config + LIBUDEV_CFLAGS + C compiler flags for LIBUDEV, overriding pkg-config + LIBUDEV_LIBS + linker flags for LIBUDEV, overriding pkg-config XORG_CFLAGS C compiler flags for XORG, overriding pkg-config XORG_LIBS linker flags for XORG, overriding pkg-config @@ -1579,7 +1582,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-input-vmmouse configure 13.0.0 +xf86-input-vmmouse configure 13.1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1903,7 +1906,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-input-vmmouse $as_me 13.0.0, which was +It was created by xf86-input-vmmouse $as_me 13.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2732,7 +2735,7 @@ fi # Define the identity of the package. PACKAGE='xf86-input-vmmouse' - VERSION='13.0.0' + VERSION='13.1.0' cat >>confdefs.h <<_ACEOF @@ -2779,128 +2782,7 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - +# XORG_DEFAULT_OPTIONS below forces C99. Solaris GCC doesn't like that. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3689,6 +3571,69 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + depcc="$CC" am_compiler_list= @@ -3818,6 +3763,134 @@ else fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + + +save_solaris_cc=$CC + +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : @@ -17660,413 +17733,138 @@ CC="$lt_save_CC" # Only expand once: -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +# Check whether --with-xorg-module-dir was given. +if test "${with_xorg_module_dir+set}" = set; then : + withval=$with_xorg_module_dir; moduledir="$withval" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + moduledir="$libdir/xorg/modules" fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi +inputdir=${moduledir}/input + + + +# Check whether --with-xorg-conf-dir was given. +if test "${with_xorg_conf_dir+set}" = set; then : + withval=$with_xorg_conf_dir; XORG_CONF_DIR="$withval" else - CC="$ac_cv_prog_CC" + XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir xorg-server`" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + if test "x$XORG_CONF_DIR" != "x" && test "x$XORG_CONF_DIR" != "xno"; then + HAS_XORG_CONF_DIR_TRUE= + HAS_XORG_CONF_DIR_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + HAS_XORG_CONF_DIR_TRUE='#' + HAS_XORG_CONF_DIR_FALSE= fi - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +# Check whether --with-hal-bin-dir was given. +if test "${with_hal_bin_dir+set}" = set; then : + withval=$with_hal_bin_dir; halbindir="$withval" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + halbindir="$bindir" fi +HAL_BIN_DIR=${halbindir} -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + +# Check whether --with-hal-callouts-dir was given. +if test "${with_hal_callouts_dir+set}" = set; then : + withval=$with_hal_callouts_dir; halcalloutsdir="$withval" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + halcalloutsdir="$libdir/hal" fi +HAL_CALLOUTS_DIR=${halcalloutsdir} - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + +# Check whether --with-hal-fdi-dir was given. +if test "${with_hal_fdi_dir+set}" = set; then : + withval=$with_hal_fdi_dir; halfdidir="$withval" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + halfdidir="$datadir/hal/fdi/policy/20thirdparty" fi +HAL_FDI_DIR=${halfdidir} - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi +# Udev location for rules directory + +# Check whether --with-udev-rules-dir was given. +if test "${with_udev_rules_dir+set}" = set; then : + withval=$with_udev_rules_dir; udevdir="$withval" +else + udevdir="$libdir/udev/rules.d" fi +UDEV_RULES_DIR=${udevdir} + + if test "x$UDEV_RULES_DIR" != "xno"; then + HAS_UDEV_RULES_DIR_TRUE= + HAS_UDEV_RULES_DIR_FALSE='#' +else + HAS_UDEV_RULES_DIR_TRUE='#' + HAS_UDEV_RULES_DIR_FALSE= fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +# Checks for extensions -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include "xorg-server.h" +#if !defined RANDR +#error RANDR not defined +#endif + int main () { -#ifndef __GNUC__ - choke me -#endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes + _EXT_CHECK=yes else - ac_compiler_gnu=no + _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu + CFLAGS="$SAVE_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RANDR is defined" >&5 +$as_echo_n "checking if RANDR is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 +$as_echo "$_EXT_CHECK" >&6; } + if test "$_EXT_CHECK" != no; then + REQUIRED_MODULES="$REQUIRED_MODULES randrproto" + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#include "xorg-server.h" +#if !defined XINPUT +#error XINPUT not defined +#endif int main () @@ -18077,337 +17875,49 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - - - - -# Check whether --with-xorg-module-dir was given. -if test "${with_xorg_module_dir+set}" = set; then : - withval=$with_xorg_module_dir; moduledir="$withval" -else - moduledir="$libdir/xorg/modules" -fi - -inputdir=${moduledir}/input - - - -# Check whether --with-xorg-conf-dir was given. -if test "${with_xorg_conf_dir+set}" = set; then : - withval=$with_xorg_conf_dir; XORG_CONF_DIR="$withval" -else - XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir xorg-server`" -fi - - - if test "x$XORG_CONF_DIR" != "x" && test "x$XORG_CONF_DIR" != "xno"; then - HAS_XORG_CONF_DIR_TRUE= - HAS_XORG_CONF_DIR_FALSE='#' -else - HAS_XORG_CONF_DIR_TRUE='#' - HAS_XORG_CONF_DIR_FALSE= -fi - - - -# Check whether --with-hal-bin-dir was given. -if test "${with_hal_bin_dir+set}" = set; then : - withval=$with_hal_bin_dir; halbindir="$withval" -else - halbindir="$bindir" -fi - -HAL_BIN_DIR=${halbindir} - - - -# Check whether --with-hal-callouts-dir was given. -if test "${with_hal_callouts_dir+set}" = set; then : - withval=$with_hal_callouts_dir; halcalloutsdir="$withval" + _EXT_CHECK=yes else - halcalloutsdir="$libdir/hal" + _EXT_CHECK=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$SAVE_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XINPUT is defined" >&5 +$as_echo_n "checking if XINPUT is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 +$as_echo "$_EXT_CHECK" >&6; } + if test "$_EXT_CHECK" != no; then + REQUIRED_MODULES="$REQUIRED_MODULES inputproto" + fi -HAL_CALLOUTS_DIR=${halcalloutsdir} +# Checks for pkg-config packages +libudev_check=yes +# Check whether --with-libudev was given. +if test "${with_libudev+set}" = set; then : + withval=$with_libudev; if test x$withval = xno; then libudev_check=no; fi -# Check whether --with-hal-fdi-dir was given. -if test "${with_hal_fdi_dir+set}" = set; then : - withval=$with_hal_fdi_dir; halfdidir="$withval" -else - halfdidir="$datadir/hal/fdi/policy/20thirdparty" fi -HAL_FDI_DIR=${halfdidir} - - +case $host_os in + linux*) + if test $libudev_check != no; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5 -$as_echo_n "checking for UDEV... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 +$as_echo_n "checking for LIBUDEV... " >&6; } -if test -n "$UDEV_CFLAGS"; then - pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" +if test -n "$LIBUDEV_CFLAGS"; then + pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udev\""; } >&5 - ($PKG_CONFIG --exists --print-errors "udev") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "udev" 2>/dev/null` + pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -18415,16 +17925,16 @@ fi else pkg_failed=untried fi -if test -n "$UDEV_LIBS"; then - pkg_cv_UDEV_LIBS="$UDEV_LIBS" +if test -n "$LIBUDEV_LIBS"; then + pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udev\""; } >&5 - ($PKG_CONFIG --exists --print-errors "udev") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "udev" 2>/dev/null` + pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -18445,115 +17955,227 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udev" 2>&1` + LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1` else - UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udev" 2>&1` + LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$UDEV_PKG_ERRORS" >&5 + echo "$LIBUDEV_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libudev) were not met: + +$LIBUDEV_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. - UDEV_RULES_DIR=no +Alternatively, you may set the environment variables LIBUDEV_CFLAGS +and LIBUDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - UDEV_RULES_DIR=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LIBUDEV_CFLAGS +and LIBUDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else - UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS - UDEV_LIBS=$pkg_cv_UDEV_LIBS + LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS + LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - UDEV_RULES_DIR="`$PKG_CONFIG --variable=udevdir udev`/rules.d" -fi +$as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h -# Check whether --with-udev-rules-dir was given. -if test "${with_udev_rules_dir+set}" = set; then : - withval=$with_udev_rules_dir; UDEV_RULES_DIR="$withval" +fi; + fi + for ac_func in ioperm iopl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + as_fn_error $? "" "$LINENO" 5 + (cannot determine how to elevate io permissions) fi +done - if test "x$UDEV_RULES_DIR" != "xno"; then - HAS_UDEV_RULES_DIR_TRUE= - HAS_UDEV_RULES_DIR_FALSE='#' +$as_echo "#define VMMOUSE_OS_GENERIC 1" >>confdefs.h + + ;; + *bsd*) + +$as_echo "#define VMMOUSE_OS_BSD 1" >>confdefs.h + + ;; + solaris*) + if test "x$GCC" == "xyes"; then + CC="$save_solaris_cc -fms-extensions" + fi + +$as_echo "#define VMMOUSE_OS_SOLARIS 1" >>confdefs.h + + ;; + *) + for ac_func in ioperm iopl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + else - HAS_UDEV_RULES_DIR_TRUE='#' - HAS_UDEV_RULES_DIR_FALSE= + as_fn_error $? "" "$LINENO" 5 + (cannot determine how to elevate io permissions) fi +done + $as_echo "#define VMMOUSE_OS_GENERIC 1" >>confdefs.h -# Checks for extensions + ;; +esac +case $host_cpu in + i*86) + case $host_os in + *freebsd*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h + ;; + *netbsd*) $as_echo "#define USE_I386_IOPL 1" >>confdefs.h - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + use_i386_iopl=yes ;; + *openbsd*) $as_echo "#define USE_I386_IOPL 1" >>confdefs.h + + use_i386_iopl=yes ;; + esac + ;; + x86_64*|amd64*) + case $host_os in + *freebsd*) +$as_echo "#define USE_DEV_IO 1" >>confdefs.h + ;; + *netbsd*) +$as_echo "#define USE_I386_IOPL 1" >>confdefs.h + + use_i386_iopl=yes ;; + esac + ;; +esac + +if test x$use_i386_iopl = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386_iopl in -li386" >&5 +$as_echo_n "checking for i386_iopl in -li386... " >&6; } +if ${ac_cv_lib_i386_i386_iopl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-li386 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "xorg-server.h" -#if !defined RANDR -#error RANDR not defined +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - +char i386_iopl (); int main () { - +return i386_iopl (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - _EXT_CHECK=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_i386_i386_iopl=yes else - _EXT_CHECK=no + ac_cv_lib_i386_i386_iopl=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$SAVE_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RANDR is defined" >&5 -$as_echo_n "checking if RANDR is defined... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 -$as_echo "$_EXT_CHECK" >&6; } - if test "$_EXT_CHECK" != no; then - REQUIRED_MODULES="$REQUIRED_MODULES randrproto" - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_i386_i386_iopl" >&5 +$as_echo "$ac_cv_lib_i386_i386_iopl" >&6; } +if test "x$ac_cv_lib_i386_i386_iopl" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBI386 1 +_ACEOF + LIBS="-li386 $LIBS" + +else + as_fn_error $? "cannot find library for i386_iopl" "$LINENO" 5 +fi +fi - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test x$use_amd64_iopl = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for amd64_iopl in -lamd64" >&5 +$as_echo_n "checking for amd64_iopl in -lamd64... " >&6; } +if ${ac_cv_lib_amd64_amd64_iopl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lamd64 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "xorg-server.h" -#if !defined XINPUT -#error XINPUT not defined +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - +char amd64_iopl (); int main () { - +return amd64_iopl (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - _EXT_CHECK=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_amd64_amd64_iopl=yes else - _EXT_CHECK=no + ac_cv_lib_amd64_amd64_iopl=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$SAVE_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XINPUT is defined" >&5 -$as_echo_n "checking if XINPUT is defined... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 -$as_echo "$_EXT_CHECK" >&6; } - if test "$_EXT_CHECK" != no; then - REQUIRED_MODULES="$REQUIRED_MODULES inputproto" - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_amd64_amd64_iopl" >&5 +$as_echo "$ac_cv_lib_amd64_amd64_iopl" >&6; } +if test "x$ac_cv_lib_amd64_amd64_iopl" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAMD64 1 +_ACEOF + LIBS="-lamd64 $LIBS" + +else + as_fn_error $? "cannot find library for amd64_iopl" "$LINENO" 5 +fi + +fi -# Checks for pkg-config packages pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XORG" >&5 @@ -18817,6 +18439,7 @@ fi ac_config_files="$ac_config_files Makefile shared/Makefile src/Makefile tools/Makefile fdi/Makefile man/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -18942,14 +18565,6 @@ else am__EXEEXT_FALSE= fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18958,8 +18573,8 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAS_XORG_CONF_DIR_TRUE}" && test -z "${HAS_XORG_CONF_DIR_FALSE}"; then @@ -19367,7 +18982,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-input-vmmouse $as_me 13.0.0, which was +This file was extended by xf86-input-vmmouse $as_me 13.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19433,7 +19048,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xf86-input-vmmouse config.status 13.0.0 +xf86-input-vmmouse config.status 13.1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/driver/xf86-input-vmmouse/configure.ac b/driver/xf86-input-vmmouse/configure.ac index 1ffc21997..d108946f9 100644 --- a/driver/xf86-input-vmmouse/configure.ac +++ b/driver/xf86-input-vmmouse/configure.ac @@ -20,9 +20,9 @@ # # Process this file with autoconf to produce a configure script -AC_PREREQ(2.57) +AC_PREREQ(2.60) AC_INIT([xf86-input-vmmouse], - [13.0.0], + [13.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-vmmouse) @@ -32,7 +32,10 @@ AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE +# XORG_DEFAULT_OPTIONS below forces C99. Solaris GCC doesn't like that. +AC_PROG_CC +AC_PROG_CC_C89 +save_solaris_cc=$CC # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], @@ -46,12 +49,11 @@ AC_SUBST([DRIVER_NAME]) # Checks for programs. AC_DISABLE_STATIC AC_PROG_LIBTOOL -AC_PROG_CC AH_TOP([#include "xorg-server.h"]) AC_ARG_WITH(xorg-module-dir, - AC_HELP_STRING([--with-xorg-module-dir=DIR], + AS_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) @@ -59,7 +61,7 @@ inputdir=${moduledir}/input AC_SUBST(inputdir) AC_ARG_WITH(xorg-conf-dir, - AC_HELP_STRING([--with-xorg-conf-dir=DIR], + AS_HELP_STRING([--with-xorg-conf-dir=DIR], [Default xorg.conf.d directory [[default=from $PKG_CONFIG xorg-server]]]), [XORG_CONF_DIR="$withval"], [XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir xorg-server`"]) @@ -67,7 +69,7 @@ AC_SUBST(XORG_CONF_DIR) AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$XORG_CONF_DIR" != "x" && test "x$XORG_CONF_DIR" != "xno"]) AC_ARG_WITH(hal-bin-dir, - AC_HELP_STRING([--with-hal-bin-dir=DIR], + AS_HELP_STRING([--with-hal-bin-dir=DIR], [Directory where HAL binaries where installed [[default=$bindir]]]), [halbindir="$withval"], [halbindir="$bindir"]) @@ -75,7 +77,7 @@ HAL_BIN_DIR=${halbindir} AC_SUBST(HAL_BIN_DIR) AC_ARG_WITH(hal-callouts-dir, - AC_HELP_STRING([--with-hal-callouts-dir=DIR], + AS_HELP_STRING([--with-hal-callouts-dir=DIR], [Directory where HAL expects its callout scripts to be located [[default=$libdir/hal]]]), [halcalloutsdir="$withval"], @@ -84,7 +86,7 @@ HAL_CALLOUTS_DIR=${halcalloutsdir} AC_SUBST(HAL_CALLOUTS_DIR) AC_ARG_WITH(hal-fdi-dir, - AC_HELP_STRING([--with-hal-fdi-dir=DIR], + AS_HELP_STRING([--with-hal-fdi-dir=DIR], [Directory where HAL expects its fdi files to be located [[default=$datadir/hal/fdi/policy/20thirdparty]]]), [halfdidir="$withval"], @@ -92,17 +94,14 @@ AC_ARG_WITH(hal-fdi-dir, HAL_FDI_DIR=${halfdidir} AC_SUBST(HAL_FDI_DIR) - -PKG_CHECK_MODULES(UDEV, udev, - [UDEV_RULES_DIR="`$PKG_CONFIG --variable=udevdir udev`/rules.d"], - [UDEV_RULES_DIR=no]) - +# Udev location for rules directory AC_ARG_WITH(udev-rules-dir, - AC_HELP_STRING([--with-udev-rules-dir=DIR], - [Default udev rules.d directory - [[default=($prefix)/lib/udev/rules.d on Linux, none otherwise]]]), - [UDEV_RULES_DIR="$withval"], - []) + AS_HELP_STRING([--with-udev-rules-dir=DIR], + [Directory where udev expects its rules files + [[default=$libdir/udev/rules.d]]]), + [udevdir="$withval"], + [udevdir="$libdir/udev/rules.d"]) +UDEV_RULES_DIR=${udevdir} AC_SUBST(UDEV_RULES_DIR) AM_CONDITIONAL(HAS_UDEV_RULES_DIR, [test "x$UDEV_RULES_DIR" != "xno"]) @@ -111,6 +110,73 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages +libudev_check=yes +AC_ARG_WITH([libudev], + [AS_HELP_STRING([--without-libudev], + [Use to build without libudev on linux])], + [if test x$withval = xno; then libudev_check=no; fi] + []) + +case $host_os in + linux*) + if test $libudev_check != no; then + PKG_CHECK_MODULES(LIBUDEV, [libudev], + [AC_DEFINE([HAVE_LIBUDEV], 1, + [Has libudev installed])], + []); + fi + AC_CHECK_FUNCS(ioperm iopl,[], + [AC_MSG_ERROR + ([cannot determine how to elevate io permissions)]],[1]) + AC_DEFINE(VMMOUSE_OS_GENERIC, 1, + [Building for iopl / ioperm capable OS]) + ;; + *bsd*) + AC_DEFINE(VMMOUSE_OS_BSD, 1, [Building for BSD flavour]) + ;; + solaris*) + if test "x$GCC" == "xyes"; then + CC="$save_solaris_cc -fms-extensions" + fi + AC_DEFINE(VMMOUSE_OS_SOLARIS, 1, [Building for Solaris flavour]) + ;; + *) + AC_CHECK_FUNCS(ioperm iopl,[], + [AC_MSG_ERROR + ([cannot determine how to elevate io permissions)]],[1]) + AC_DEFINE(VMMOUSE_OS_GENERIC, 1) + ;; +esac + +case $host_cpu in + i*86) + case $host_os in + *freebsd*) AC_DEFINE(USE_DEV_IO) ;; + *netbsd*) AC_DEFINE(USE_I386_IOPL) + use_i386_iopl=yes ;; + *openbsd*) AC_DEFINE(USE_I386_IOPL) + use_i386_iopl=yes ;; + esac + ;; + x86_64*|amd64*) + case $host_os in + *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; + *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) + use_i386_iopl=yes ;; + esac + ;; +esac + +if test x$use_i386_iopl = xyes; then + AC_CHECK_LIB(i386, i386_iopl,[], + [AC_MSG_ERROR([cannot find library for i386_iopl])]) +fi + +if test x$use_amd64_iopl = xyes; then + AC_CHECK_LIB(amd64, amd64_iopl,[], + [AC_MSG_ERROR([cannot find library for amd64_iopl])]) +fi + PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) PKG_CHECK_EXISTS([xorg-server >= 1.1.0], @@ -137,4 +203,11 @@ PKG_CHECK_EXISTS([xorg-server >= 1.6.0], # Checks for header files. AC_HEADER_STDC -AC_OUTPUT([Makefile shared/Makefile src/Makefile tools/Makefile fdi/Makefile man/Makefile]) +AC_CONFIG_FILES([Makefile + shared/Makefile + src/Makefile + tools/Makefile + fdi/Makefile + man/Makefile]) + +AC_OUTPUT diff --git a/driver/xf86-input-vmmouse/fdi/Makefile.in b/driver/xf86-input-vmmouse/fdi/Makefile.in index 88b58ab03..0d20b1f7d 100644 --- a/driver/xf86-input-vmmouse/fdi/Makefile.in +++ b/driver/xf86-input-vmmouse/fdi/Makefile.in @@ -181,6 +181,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -216,8 +218,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ diff --git a/driver/xf86-input-vmmouse/man/Makefile.in b/driver/xf86-input-vmmouse/man/Makefile.in index 49d36111a..7f5c0a3fb 100644 --- a/driver/xf86-input-vmmouse/man/Makefile.in +++ b/driver/xf86-input-vmmouse/man/Makefile.in @@ -184,6 +184,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -219,8 +221,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ diff --git a/driver/xf86-input-vmmouse/shared/Makefile.in b/driver/xf86-input-vmmouse/shared/Makefile.in index 2466bee42..ffb9dd502 100644 --- a/driver/xf86-input-vmmouse/shared/Makefile.in +++ b/driver/xf86-input-vmmouse/shared/Makefile.in @@ -186,6 +186,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -221,8 +223,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ diff --git a/driver/xf86-input-vmmouse/shared/vmmouse_client.c b/driver/xf86-input-vmmouse/shared/vmmouse_client.c index f34c223b9..c5d529e2b 100644 --- a/driver/xf86-input-vmmouse/shared/vmmouse_client.c +++ b/driver/xf86-input-vmmouse/shared/vmmouse_client.c @@ -35,6 +35,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "vmmouse_client.h" #include "vmmouse_proto.h" @@ -188,6 +192,13 @@ VMMouseClient_Enable(void) { } /* + * Restrict access to the VMMouse backdoor handler. + */ + vmpc.in.vEbx = VMMOUSE_RESTRICT_IOPL; + vmpc.in.command = VMMOUSE_PROTO_CMD_ABSPOINTER_RESTRICT; + VMMouseProto_SendCmd(&vmpc); + + /* * To quote Jeremy, "Go Go Go!" */ diff --git a/driver/xf86-input-vmmouse/shared/vmmouse_client.h b/driver/xf86-input-vmmouse/shared/vmmouse_client.h index b01bf087b..1de51e510 100644 --- a/driver/xf86-input-vmmouse/shared/vmmouse_client.h +++ b/driver/xf86-input-vmmouse/shared/vmmouse_client.h @@ -39,6 +39,7 @@ #ifndef _VMMOUSE_CLIENT_H_ #define _VMMOUSE_CLIENT_H_ +#include "xorg-server.h" #include "xf86_OSproc.h" /* diff --git a/driver/xf86-input-vmmouse/shared/vmmouse_defs.h b/driver/xf86-input-vmmouse/shared/vmmouse_defs.h index d256faf72..780d72d94 100644 --- a/driver/xf86-input-vmmouse/shared/vmmouse_defs.h +++ b/driver/xf86-input-vmmouse/shared/vmmouse_defs.h @@ -69,4 +69,11 @@ #define VMMOUSE_RIGHT_BUTTON 0x10 #define VMMOUSE_MIDDLE_BUTTON 0x08 +/* + * VMMouse Restrict command + */ +#define VMMOUSE_RESTRICT_ANY 0x00 +#define VMMOUSE_RESTRICT_CPL0 0x01 +#define VMMOUSE_RESTRICT_IOPL 0x02 + #endif diff --git a/driver/xf86-input-vmmouse/shared/vmmouse_proto.c b/driver/xf86-input-vmmouse/shared/vmmouse_proto.c index b50e0712b..635c522c2 100644 --- a/driver/xf86-input-vmmouse/shared/vmmouse_proto.c +++ b/driver/xf86-input-vmmouse/shared/vmmouse_proto.c @@ -33,6 +33,10 @@ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "vmmouse_proto.h" diff --git a/driver/xf86-input-vmmouse/shared/vmmouse_proto.h b/driver/xf86-input-vmmouse/shared/vmmouse_proto.h index 9d7cb22bf..6d144aed7 100644 --- a/driver/xf86-input-vmmouse/shared/vmmouse_proto.h +++ b/driver/xf86-input-vmmouse/shared/vmmouse_proto.h @@ -36,11 +36,6 @@ #ifndef _VMMOUSE_PROTO_H_ #define _VMMOUSE_PROTO_H_ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <stdint.h> #ifdef HAVE_XORG_SERVER_1_1_0 @@ -69,6 +64,7 @@ #define VMMOUSE_PROTO_CMD_ABSPOINTER_DATA 39 #define VMMOUSE_PROTO_CMD_ABSPOINTER_STATUS 40 #define VMMOUSE_PROTO_CMD_ABSPOINTER_COMMAND 41 +#define VMMOUSE_PROTO_CMD_ABSPOINTER_RESTRICT 86 #define DECLARE_REG32_STRUCT(_r) \ union { \ diff --git a/driver/xf86-input-vmmouse/src/Makefile.am b/driver/xf86-input-vmmouse/src/Makefile.am index 7e6ea3653..6d342ef4d 100644 --- a/driver/xf86-input-vmmouse/src/Makefile.am +++ b/driver/xf86-input-vmmouse/src/Makefile.am @@ -26,4 +26,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) @DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c xf86OSmouse.h - + diff --git a/driver/xf86-input-vmmouse/src/Makefile.in b/driver/xf86-input-vmmouse/src/Makefile.in index 8742fd967..46355ac65 100644 --- a/driver/xf86-input-vmmouse/src/Makefile.in +++ b/driver/xf86-input-vmmouse/src/Makefile.in @@ -218,6 +218,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -253,8 +255,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ diff --git a/driver/xf86-input-vmmouse/src/vmmouse.c b/driver/xf86-input-vmmouse/src/vmmouse.c index bb450ffa3..7ed94e9f5 100644 --- a/driver/xf86-input-vmmouse/src/vmmouse.c +++ b/driver/xf86-input-vmmouse/src/vmmouse.c @@ -807,7 +807,16 @@ MouseCommonOptions(InputInfoPtr pInfo) static void VMMouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { + MouseDevPtr pMse = pInfo->private; + xf86Msg(X_INFO, "VMWARE(0): VMMouseUnInit\n"); + + if (pMse) { + VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv; + free(mPriv); + } + + xf86DeleteInput(pInfo, flags); } @@ -859,10 +868,10 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); - btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); - btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); - btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); + btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); /* other buttons are unknown */ #ifdef ABS_VALUATOR_AXES @@ -1010,6 +1019,15 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) usleep(300000); break; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 100 + GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 1901 + case DEVICE_ABORT: + if (pInfo->fd != -1) { + VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv; + if( mPriv->vmmouseAvailable ) + VMMouseClient_Disable(); + break; + } +#endif } return Success; diff --git a/driver/xf86-input-vmmouse/tools/Makefile.am b/driver/xf86-input-vmmouse/tools/Makefile.am index ea7ba66ea..da0e782ff 100644 --- a/driver/xf86-input-vmmouse/tools/Makefile.am +++ b/driver/xf86-input-vmmouse/tools/Makefile.am @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME@_detect AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) -@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c -@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la +@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c vmmouse_iopl.c +@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la \ + @LIBUDEV_LIBS@ +@DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ + calloutsdir=$(HAL_CALLOUTS_DIR) callouts_SCRIPTS = hal-probe-vmmouse @@ -53,4 +56,4 @@ CLEANFILES += $(udev_DATA) endif # HAS_UDEV_RULES_DIR -EXTRA_DIST = $(udev_DATA).in hal-probe-vmmouse.in +EXTRA_DIST = 69-xorg-vmmouse.rules.in hal-probe-vmmouse.in diff --git a/driver/xf86-input-vmmouse/tools/Makefile.in b/driver/xf86-input-vmmouse/tools/Makefile.in index 7fc93d584..fce8b6971 100644 --- a/driver/xf86-input-vmmouse/tools/Makefile.in +++ b/driver/xf86-input-vmmouse/tools/Makefile.in @@ -88,7 +88,10 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(calloutsdir)" \ "$(DESTDIR)$(confdir)" "$(DESTDIR)$(udevdir)" PROGRAMS = $(bin_PROGRAMS) -am_@DRIVER_NAME@_detect_OBJECTS = vmmouse_detect.$(OBJEXT) +am_@DRIVER_NAME@_detect_OBJECTS = \ + @DRIVER_NAME@_detect-vmmouse_detect.$(OBJEXT) \ + @DRIVER_NAME@_detect-vmmouse_udev.$(OBJEXT) \ + @DRIVER_NAME@_detect-vmmouse_iopl.$(OBJEXT) @DRIVER_NAME@_detect_OBJECTS = $(am_@DRIVER_NAME@_detect_OBJECTS) @DRIVER_NAME@_detect_DEPENDENCIES = \ $(top_builddir)/shared/lib@DRIVER_NAME@.la @@ -96,6 +99,10 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +@DRIVER_NAME@_detect_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -222,6 +229,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ @@ -257,8 +266,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ UDEV_RULES_DIR = @UDEV_RULES_DIR@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ @@ -319,8 +326,11 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) -@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c -@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la +@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c vmmouse_iopl.c +@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la \ + @LIBUDEV_LIBS@ + +@DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ calloutsdir = $(HAL_CALLOUTS_DIR) callouts_SCRIPTS = hal-probe-vmmouse CLEANFILES = hal-probe-vmmouse $(am__append_1) @@ -328,7 +338,7 @@ CLEANFILES = hal-probe-vmmouse $(am__append_1) @HAS_XORG_CONF_DIR_TRUE@dist_conf_DATA = 50-vmmouse.conf @HAS_UDEV_RULES_DIR_TRUE@udevdir = $(UDEV_RULES_DIR) @HAS_UDEV_RULES_DIR_TRUE@udev_DATA = 69-xorg-vmmouse.rules -EXTRA_DIST = $(udev_DATA).in hal-probe-vmmouse.in +EXTRA_DIST = 69-xorg-vmmouse.rules.in hal-probe-vmmouse.in all: all-am .SUFFIXES: @@ -411,7 +421,7 @@ clean-binPROGRAMS: rm -f $$list @DRIVER_NAME@_detect$(EXEEXT): $(@DRIVER_NAME@_detect_OBJECTS) $(@DRIVER_NAME@_detect_DEPENDENCIES) $(EXTRA_@DRIVER_NAME@_detect_DEPENDENCIES) @rm -f @DRIVER_NAME@_detect$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(@DRIVER_NAME@_detect_OBJECTS) $(@DRIVER_NAME@_detect_LDADD) $(LIBS) + $(AM_V_CCLD)$(@DRIVER_NAME@_detect_LINK) $(@DRIVER_NAME@_detect_OBJECTS) $(@DRIVER_NAME@_detect_LDADD) $(LIBS) install-calloutsSCRIPTS: $(callouts_SCRIPTS) @$(NORMAL_INSTALL) @list='$(callouts_SCRIPTS)'; test -n "$(calloutsdir)" || list=; \ @@ -454,7 +464,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmmouse_detect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -477,6 +489,48 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@DRIVER_NAME@_detect-vmmouse_detect.o: vmmouse_detect.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_detect.o -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_detect.o `test -f 'vmmouse_detect.c' || echo '$(srcdir)/'`vmmouse_detect.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_detect.c' object='@DRIVER_NAME@_detect-vmmouse_detect.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_detect.o `test -f 'vmmouse_detect.c' || echo '$(srcdir)/'`vmmouse_detect.c + +@DRIVER_NAME@_detect-vmmouse_detect.obj: vmmouse_detect.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_detect.obj -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_detect.obj `if test -f 'vmmouse_detect.c'; then $(CYGPATH_W) 'vmmouse_detect.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_detect.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_detect.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_detect.c' object='@DRIVER_NAME@_detect-vmmouse_detect.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_detect.obj `if test -f 'vmmouse_detect.c'; then $(CYGPATH_W) 'vmmouse_detect.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_detect.c'; fi` + +@DRIVER_NAME@_detect-vmmouse_udev.o: vmmouse_udev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_udev.o -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_udev.o `test -f 'vmmouse_udev.c' || echo '$(srcdir)/'`vmmouse_udev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_udev.c' object='@DRIVER_NAME@_detect-vmmouse_udev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_udev.o `test -f 'vmmouse_udev.c' || echo '$(srcdir)/'`vmmouse_udev.c + +@DRIVER_NAME@_detect-vmmouse_udev.obj: vmmouse_udev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_udev.obj -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_udev.obj `if test -f 'vmmouse_udev.c'; then $(CYGPATH_W) 'vmmouse_udev.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_udev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_udev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_udev.c' object='@DRIVER_NAME@_detect-vmmouse_udev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_udev.obj `if test -f 'vmmouse_udev.c'; then $(CYGPATH_W) 'vmmouse_udev.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_udev.c'; fi` + +@DRIVER_NAME@_detect-vmmouse_iopl.o: vmmouse_iopl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_iopl.o -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_iopl.o `test -f 'vmmouse_iopl.c' || echo '$(srcdir)/'`vmmouse_iopl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_iopl.c' object='@DRIVER_NAME@_detect-vmmouse_iopl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_iopl.o `test -f 'vmmouse_iopl.c' || echo '$(srcdir)/'`vmmouse_iopl.c + +@DRIVER_NAME@_detect-vmmouse_iopl.obj: vmmouse_iopl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -MT @DRIVER_NAME@_detect-vmmouse_iopl.obj -MD -MP -MF $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Tpo -c -o @DRIVER_NAME@_detect-vmmouse_iopl.obj `if test -f 'vmmouse_iopl.c'; then $(CYGPATH_W) 'vmmouse_iopl.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_iopl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Tpo $(DEPDIR)/@DRIVER_NAME@_detect-vmmouse_iopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vmmouse_iopl.c' object='@DRIVER_NAME@_detect-vmmouse_iopl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(@DRIVER_NAME@_detect_CFLAGS) $(CFLAGS) -c -o @DRIVER_NAME@_detect-vmmouse_iopl.obj `if test -f 'vmmouse_iopl.c'; then $(CYGPATH_W) 'vmmouse_iopl.c'; else $(CYGPATH_W) '$(srcdir)/vmmouse_iopl.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/driver/xf86-input-vmmouse/tools/vmmouse_detect.c b/driver/xf86-input-vmmouse/tools/vmmouse_detect.c index ac238b4a1..1d28122b7 100644 --- a/driver/xf86-input-vmmouse/tools/vmmouse_detect.c +++ b/driver/xf86-input-vmmouse/tools/vmmouse_detect.c @@ -26,13 +26,15 @@ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <signal.h> #include "vmmouse_client.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +extern int vmmouse_uses_kernel_driver(void); void segvCB(int sig) @@ -46,6 +48,9 @@ segvCB(int sig) int main(void) { + if (vmmouse_uses_kernel_driver()) + return 1; + /* * If the vmmouse test is not run in a VMware virtual machine, it * will segfault instead of successfully accessing the port. @@ -53,6 +58,7 @@ main(void) signal(SIGSEGV, segvCB); #if defined __i386__ || defined __x86_64__ + (void) xf86EnableIO(); if (VMMouseClient_Enable()) { VMMouseClient_Disable(); return 0; diff --git a/driver/xf86-input-vmmouse/tools/vmmouse_iopl.c b/driver/xf86-input-vmmouse/tools/vmmouse_iopl.c new file mode 100644 index 000000000..8794622af --- /dev/null +++ b/driver/xf86-input-vmmouse/tools/vmmouse_iopl.c @@ -0,0 +1,239 @@ +/* + * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany + * Copyright 1992 by David Dawes <dawes@XFree86.org> + * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu> + * Copyright 1992 by Rich Murphey <Rich@Rice.edu> + * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu> + * Copyright 1992 by Orest Zborowski <obz@eskimo.com> + * Copyright 1993 by Vrije Universiteit, The Netherlands + * Copyright 1993 by David Wexelblat <dwex@XFree86.org> + * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de> + * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk> + * Copyright 1994-2003 by The XFree86 Project, Inc + * Copyright 1999 by David Holland <davidh@iquest.net> + * Copyright 2015 by VMware Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the above listed copyright holders + * not be used in advertising or publicity pertaining to distribution of + * the software without specific, written prior permission. The above listed + * copyright holders make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + * + * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE + * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif + +#include <stdbool.h> + +#if defined(VMMOUSE_OS_BSD) +#include <sys/types.h> +#ifdef USE_I386_IOPL +#include <machine/sysarch.h> +/***************************************************************************/ +/* I/O Permissions section */ +/***************************************************************************/ +static bool ExtendedEnabled = false; + +bool +xf86EnableIO() +{ + if (ExtendedEnabled) + return true; + + if (i386_iopl(1) < 0) + return false; + + ExtendedEnabled = true; + return true; +} + +void +xf86DisableIO() +{ + if (!ExtendedEnabled) + return; + + i386_iopl(0); + + ExtendedEnabled = false; + return; +} + +#endif /* USE_I386_IOPL */ + +#ifdef USE_AMD64_IOPL +#include <machine/sysarch.h> +/***************************************************************************/ +/* I/O Permissions section */ +/***************************************************************************/ + +static bool ExtendedEnabled = false; + +bool +xf86EnableIO() +{ + if (ExtendedEnabled) + return true; + + if (amd64_iopl(1) < 0) + return false; + + ExtendedEnabled = true; + return true; +} + +void +xf86DisableIO() +{ + if (!ExtendedEnabled) + return; + + if (amd64_iopl(0) == 0) + ExtendedEnabled = false; + + return; +} + +#endif /* USE_AMD64_IOPL */ + +#ifdef USE_DEV_IO +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +static int IoFd = -1; + +bool +xf86EnableIO() +{ + if (IoFd >= 0) + return true; + + if ((IoFd = open("/dev/io", O_RDWR)) == -1) + return false; + + return true; +} + +void +xf86DisableIO() +{ + if (IoFd < 0) + return; + + close(IoFd); + IoFd = -1; + return; +} +#endif + +#elif defined(VMMOUSE_OS_GENERIC) + +static bool ExtendedEnabled = false; + +extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on); +extern int iopl(int __level); + +bool xf86EnableIO(void) +{ + if (ExtendedEnabled) + return true; + + if (ioperm(0, 1024, 1) || iopl(3)) + return false; + + ExtendedEnabled = true; + return true; +} + +void +xf86DisableIO(void) +{ + if (!ExtendedEnabled) + return; + + iopl(0); + ioperm(0, 1024, 0); + ExtendedEnabled = false; + + return; +} + +#elif defined(VMMOUSE_OS_SOLARIS) + +#ifdef __GNUC__ +#if defined(__sun) && !defined(sun) +#define sun 1 +#endif +#if defined(__SVR4) && !defined(SVR4) +#define SVR4 1 +#endif +#endif +/* + * The below sequence of includes is stolen from Xserver. If it doesn't work + * for your setup, please propose a patch to fix it. + */ +#include <sys/types.h> +#include <errno.h> +#if !(defined (sun) && defined (SVR4)) +#include <sys/immu.h> +#include <sys/region.h> +#include <sys/proc.h> +#endif +#include <sys/tss.h> +#include <sys/sysi86.h> +#if defined(SVR4) && !defined(sun) +#include <sys/seg.h> +#endif /* SVR4 && !sun */ +/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */ +#if !defined(V86SC_IOPL) /* Solaris 7 or later? */ +#include <sys/v86.h> /* Nope */ +#endif +#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) +#include <sys/psw.h> +#endif + +static bool ExtendedEnabled = false; + +bool +xf86EnableIO(void) +{ + if (ExtendedEnabled) + return true; + + if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) + return false; + + ExtendedEnabled = true; + + return true; +} + +void +xf86DisableIO(void) +{ + if(!ExtendedEnabled) + return; + + sysi86(SI86V86, V86SC_IOPL, 0); + + ExtendedEnabled = false; +} + +#endif diff --git a/driver/xf86-input-vmmouse/tools/vmmouse_udev.c b/driver/xf86-input-vmmouse/tools/vmmouse_udev.c new file mode 100644 index 000000000..dc100aef8 --- /dev/null +++ b/driver/xf86-input-vmmouse/tools/vmmouse_udev.c @@ -0,0 +1,104 @@ +/* + * Copyright 2014 by VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_LIBUDEV +#include <libudev.h> +#include <stdlib.h> +#include <string.h> + +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" + +/** + * vmmouse_uses_kernel_driver - Check whether there's an active + * vmmouse driver in the kernel. + * + * Returns 0 if there was no kernel driver found. + * Returns non-zero on error or if there was an active driver found. + * + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These + * devices are assumed to be active vmmouse drivers. + */ +int vmmouse_uses_kernel_driver(void) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *dev_list_entry; + struct udev_device *dev; + + udev = udev_new(); + if (!udev) + return 1; + + /* + * Udev error return codes that are not caught immediately are + * typically caught in the input argument check in the udev + * function calls following the failing call! + */ + enumerate = udev_enumerate_new(udev); + if (udev_enumerate_add_match_subsystem(enumerate, "input")) + goto out_err; + if (udev_enumerate_scan_devices(enumerate)) + goto out_err; + + devices = udev_enumerate_get_list_entry(enumerate); + udev_list_entry_foreach(dev_list_entry, devices) { + const char *path, *name; + + path = udev_list_entry_get_name(dev_list_entry); + dev = udev_device_new_from_syspath(udev, path); + if (!dev) + goto out_err; + name = udev_device_get_sysattr_value(dev, "name"); + if (name && !strcasecmp(name, KERNEL_DEVNAME)) + goto out_found; + + udev_device_unref(dev); + } + + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 0; + + out_found: + udev_device_unref(dev); + out_err: + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 1; +} +#else +int vmmouse_uses_kernel_driver(void) +{ + return 0; +} +#endif |