diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-07-02 21:03:44 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-07-02 21:03:44 +0000 |
commit | e6d41a75a2c945bcb7a2015aee3e1b704afaa3fe (patch) | |
tree | 94e1b382a6eb39de0a09129ba9d57158bf1b9377 /driver/xf86-input-joystick | |
parent | a6bef7241c3f005494bc833ddb226839552e7e76 (diff) |
Update to xf86-input-joystick 1.6.0
Diffstat (limited to 'driver/xf86-input-joystick')
30 files changed, 2855 insertions, 2169 deletions
diff --git a/driver/xf86-input-joystick/COPYING b/driver/xf86-input-joystick/COPYING index 7f33cbfd2..2f3bc01c2 100644 --- a/driver/xf86-input-joystick/COPYING +++ b/driver/xf86-input-joystick/COPYING @@ -1,12 +1,41 @@ -This is a stub file. This package has not yet had its complete licensing -information compiled. Please see the individual source files for details on -your rights to use and modify this software. +Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org> + +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 name of Sascha Hlusiak not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Sascha Hlusiak makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL SASCHA HLUSIAK 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. -Please submit updated COPYING files to the Xorg bugzilla: +Copyright 2007-2009 by Sascha Hlusiak. <saschahlusiak@freedesktop.org> +Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org> + +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 copyright holders not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. The 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 COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL THE 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. -https://bugs.freedesktop.org/enter_bug.cgi?product=xorg - -All licensing questions regarding this software should be directed at the -Xorg mailing list: - -http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/driver/xf86-input-joystick/ChangeLog b/driver/xf86-input-joystick/ChangeLog index cf568f269..6b0087f12 100644 --- a/driver/xf86-input-joystick/ChangeLog +++ b/driver/xf86-input-joystick/ChangeLog @@ -1,3 +1,429 @@ +commit bd6c54fe672a913334bfba1ca5dc0f2e0f1f1152 +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Wed Apr 20 20:55:24 2011 +0200 + + joystick 1.6.0 + + Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de> + +commit f1b8ef560049f1bb1bca9caa12c1529c9f992a09 +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Wed Apr 20 20:48:28 2011 +0200 + + Updated man page to reflect latest changes + +commit aa78e01edabb27d1b5dcd4ffe2be32878a45e342 +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Wed Apr 20 20:47:33 2011 +0200 + + Added xorg.conf.d example snipped + + Not installed by default, left for distributors. + + Copy 50-joystick-all.conf to /etc/X11/xorg.conf.d/ and modify to your needs. + +commit 29d3745e73d266db173828f40231cb78ec1c383a +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Wed Apr 20 19:48:28 2011 +0200 + + Revert "config: fdi file must be installed in $(datadir)/hal/fdi/policy/20thirdparty" + + The fdi file was never meant to be installed by default but exists merely as an + example and documentation for distributors who may decide to ship it by default or + install it in share/doc/... + + This reverts commit 1d67a2da26fa3ba0b8f5498da89c01aeaa551515. + +commit 4358209e7e4383b4ebdec93cc116bb1c21d373a7 +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Wed Apr 20 19:33:10 2011 +0200 + + Free pInfo->private only once to fix server crash on unplug (bug #35391) + + The hotplugged keyboard device and the main device share the same pInfo->private data + and the same jstkCoreUnInit, so the data is freed twice. Furthermore, since the keyboard + device will delete itself, we must not delete it from within the deletion of the main device. + + Freeing pInfo->private is done by the main device, hopefully done independently of the order + in which the two devices will be removed by the server. + + Should fix bug #35391 + +commit 3f03fa76f8fb152210c6ed80191f34e428af2c00 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Apr 6 21:02:49 2011 +1000 + + joystick 1.5.99.901 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 8c7ad54d6d869bb4202aee8408c72ed72bf929a7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 17:00:28 2010 +1000 + + Support input ABI 12 + + This commit adds support for input ABI 12, consisting of a number of + changes: + - requires an X server with an ABI of 12 + - valuators have a per-mode setting + - new PreInit prototype. + + Because of the new PreInit prototype, the hotplug system has been switched + around too (should have probably been done in a separate commit before, + but...). + + The old hotplug mechanism added a separate ModuleInfoRec for the keyboard + part of the driver. This isn't feasable for InputClass configurations, the + driver part may get overwritten. + + On entering the driver, after checking a few default values, hotplug the + keyboard device (wacom-style) and let it initialize. Because NIDR calls + DEVICE_INIT and DEVICE_ON the keyboard must initialise the private pointer + and pass it back to the original device. + + Call order is: + NewInputDeviceRequest + - jstkCorePreInit + - jstkKeyboardHotplug + - NewInputDeviceRequest + - jstkCorePreInit + immediately return jstkKeyboardPreInit() + - keyboard DEVICE_INIT + - keyboard DEVICE_ON + return keyboard device + - copy keyboard->priv to joystick->priv + - finish jstkCorePreInit as normal + - joystick DEVICE_INIT + - joystick DEVICE_ON + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit f2050e6be5b6b3f8c429060992cc3ead0cfe86c1 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 16:51:15 2010 +1000 + + Get the option values from pInfo instead of from the IDevRec. + + Doesn't matter which one we take, but ABI 12 dropped the IDevRec. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit df0567d2fa2d67a00dce78a89803e8925d20e324 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 16:48:50 2010 +1000 + + Don't call xf86OptionListReport() + + All options used by the driver will show up in the log anyway. + And new xserver versions will call this for debugging purposes for us. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 135aaf612bcb591ae1692ae47b2d36a814230cbe +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:19:08 2010 +1000 + + Purge use of XI_PRIVATE macro. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 29a486ba56bc6279297a716b018ba24880680e82 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:14:47 2010 +1000 + + Drop close_proc, conversion_proc, reverse_conversion_proc + + All three aren't called by the server. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 0674bdfdb67e9195af7cb5982ae2eda0fa03ce57 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:09:32 2010 +1000 + + Don't handle history_size in the driver. + + This has been handled in the server for quite a while now, just initialize + with the defaults and ignore it otherwise. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 39205d76cb45242ee9b47594ec5be7edc509edc7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:08:49 2010 +1000 + + Require server 1.9, drop pre-ABI 11 support. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 074dc4a2a06aebae144afc21de5c4f8bc365937d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:04:44 2010 +1000 + + Remove usage of XI86_POINTER_CAPABLE flag. + + Flag was write-only for a number of server generations already. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit 107e4b14d90d06864247c7878ee0cc5f59e4bc5a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 14:47:31 2010 +1000 + + Replace LocalDevicePtr with InputInfoPtr + + Both typedefs describe the same struct, LocalDevicePtr has been removed with + input ABI 12. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Trevor Woerner <twoerner@gmail.com> + +commit a23a4a77c7157c516a8194e05e9f07b64d8e8089 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Dec 14 15:03:45 2010 +1000 + + Bump to 1.5.99 + +commit cd6b81d377a5d541100996fa4e2ac2decffe65f1 +Author: Trevor Woerner <twoerner@gmail.com> +Date: Sun Oct 17 21:26:16 2010 -0400 + + Code cleanup, bad structure initialization. + + The InputDriverRec data structure in xserver/hw/xfree86/common/xf86Xinput.h + no longer contains an integer refCount member; as per commit + d568221710959cf7d783e6ff0fb80fb43a231124. + + Signed-off-by: Trevor Woerner <twoerner@gmail.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 38363bde5d94c9a8f163fde31ede067f6d0d1669 +Author: Trevor Woerner <twoerner@gmail.com> +Date: Sun Oct 17 21:25:56 2010 -0400 + + Deprecated code cleanup. + + Replace calls to deprecated functions (Xfree(), Xcalloc(), Xmalloc(), etc) + with calls to standard dynamic memory functions (free(), calloc(), malloc(), + etc) in driver code. + + Signed-off-by: Trevor Woerner <twoerner@gmail.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d209590c06e7a4df9d921ff53cb9792e9beb1aeb +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jun 11 22:00:45 2010 -0400 + + COPYING: replace stub file with Copyright notices + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 1d67a2da26fa3ba0b8f5498da89c01aeaa551515 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jun 11 21:50:34 2010 -0400 + + config: fdi file must be installed in $(datadir)/hal/fdi/policy/20thirdparty + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 09ca64e76568868e8f9c7bf48e8858669fc5aaa7 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jun 11 21:47:23 2010 -0400 + + config: EXTRA_DIST is redundant + + sdkdir provides the install path for sdk_HEADERS primary + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 55783bf0cd5e0ae29b008dd3fc3a47c66eabffbd +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jun 11 17:46:37 2010 -0400 + + config: upgrade to util-macros 1.8 for additional man page support + + Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS + The value of MAN_SUBST is the same for all X.Org packages. + Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS + Use $(AM_V_GEN)$(SED) to support silent rule + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 342908f4d06c8000789d659b9f8871e56812b78e +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jun 11 17:41:59 2010 -0400 + + config: fix warnings, m4 quoting and layout + + Fix some m4 quoting + Fix some autoconf warnings + Regroup statements per section + Add comments + Remove unused NDEBUG define + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit e98f0d0349222a4d981086f944398d32a548d953 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Apr 18 15:37:29 2010 -0400 + + config: remove AC_PROG_CC as it overrides AC_PROG_C_C99 + + XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls + AC_PROG_C_C99. This sets gcc with -std=gnu99. + If AC_PROG_CC macro is called afterwards, it resets CC to gcc. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit c6908579b56b7d8c478ebe8c07e2a68a30c5de44 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Apr 18 15:36:32 2010 -0400 + + config: remove unrequired AC_HEADER_STDC + + Autoconf says: + "This macro is obsolescent, as current systems have conforming + header files. New programs need not use this macro". + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit ab6308ed177fc341ba0cca3e4a9048f858d80007 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Apr 18 15:35:45 2010 -0400 + + config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Regroup AC statements at the top. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 2252c78fb11b09c688b1b2cc82a542fc2470b8e2 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Apr 18 15:26:16 2010 -0400 + + config: update AC_PREREQ statement to 2.60 + + Unrelated to the previous patches, the new value simply reflects + the reality that the minimum level for autoconf to configure + all x.org modules is 2.60 dated June 2006. + + ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 25722aa12bfbb5675a02d7d8520ae83fdc5735c8 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Apr 18 15:24:59 2010 -0400 + + config: remove AH_TOP autoheader statement + + The generated config.h does not need to include xorg-server.h + for the content it provides. + Add #include <xorg-server.h> in .[hc] files as needed. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 3de065d6822206695c0aee2fd68cd9db8b2f3063 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Feb 11 10:08:07 2010 -0500 + + config: move CWARNFLAGS from configure.ac to Makefile.am + + Compiler warning flags should be explicitly set in the makefile + rather than being merged with other packages compiler flags. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 30d1089cffc9afd9fd468a6c30989e77c7884248 +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Fri Jan 15 15:08:26 2010 -0800 + + Update Sun license notices to current X.Org standard form + + Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> + +commit efe94ccfb4505f18a44b39ada256df8ba16b3ec5 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Dec 28 15:05:39 2009 -0500 + + configure.ac: use backticks rather than $() for cmd subs + + Use "$PKG_CONFIG" rather than hard coded "pkg-config" + + Acked-by: Dan Nicholson <dbn.lists@gmail.com> + Acked-by: Daniel Stone <daniel@fooishbar.org> + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit ad0abb97a19e311988deffd385ca69e96bd106a4 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Nov 23 09:25:05 2009 -0500 + + Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES + + Now that the INSTALL file is generated. + Allows running make maintainer-clean. + +commit 260c441981c1fe1c6e076bde1a6a26328e6b5675 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Oct 28 14:41:41 2009 -0400 + + INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 + + Automake 'foreign' option is specified in configure.ac. + Remove from Makefile.am + +commit 877f13a6056cc8b17a73a5d4c839cd8b30065f9b +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Oct 28 14:09:09 2009 -0400 + + INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 + + Add missing INSTALL file. Use standard GNU file on building tarball + README may have been updated + Remove AUTHORS file as it is empty and no content available yet. + Remove NEWS file as it is empty and no content available yet. + +commit 9fc986bd5dc3bd1741b1ad4e4da152edfaf928d9 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Oct 26 12:54:20 2009 -0400 + + Several driver modules do not have a ChangeLog target in Makefile.am #23814 + + The git generated ChangeLog replaces the hand written one. + Update configure.ac to xorg-macros level 1.3. + Use XORG_DEFAULT_OPTIONS which replaces four XORG_* macros + Update Makefile.am to add ChangeLog target if missing + Remove ChangeLog from EXTRA_DIST or *CLEAN variables + This is a pre-req for the INSTALL_CMD + +commit cd4e5ab0c64f477c343ab161ec309c42b9737450 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Oct 22 12:34:16 2009 -0400 + + .gitignore: use common defaults with custom section # 24239 + + Using common defaults will reduce errors and maintenance. + Only the very small or inexistent custom section need periodic maintenance + when the structure of the component changes. Do not edit defaults. + +commit eaf8d1a1d87af9f67ca3e3d0436bb9d9a7cfc17a +Author: Sascha Hlusiak <saschahlusiak@arcor.de> +Date: Sat Oct 31 12:41:15 2009 +0100 + + Bump to 1.5.0 + + Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de> + commit 657c01c8ebb9e0571d498356e6d3d03917199328 Author: Sascha Hlusiak <saschahlusiak@arcor.de> Date: Wed Oct 7 09:24:39 2009 +0200 diff --git a/driver/xf86-input-joystick/INSTALL b/driver/xf86-input-joystick/INSTALL new file mode 100644 index 000000000..8b82ade08 --- /dev/null +++ b/driver/xf86-input-joystick/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/driver/xf86-input-joystick/Makefile.am b/driver/xf86-input-joystick/Makefile.am index be8812fc7..13946b88d 100644 --- a/driver/xf86-input-joystick/Makefile.am +++ b/driver/xf86-input-joystick/Makefile.am @@ -18,19 +18,19 @@ # 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. -AUTOMAKE_OPTIONS = foreign DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg SUBDIRS = src man config include +MAINTAINERCLEANFILES = ChangeLog INSTALL pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xorg-joystick.pc -EXTRA_DIST = ChangeLog -MAINTAINERCLEANFILES = ChangeLog +.PHONY: ChangeLog INSTALL -.PHONY: ChangeLog +INSTALL: + $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) -dist-hook: ChangeLog +dist-hook: ChangeLog INSTALL diff --git a/driver/xf86-input-joystick/Makefile.in b/driver/xf86-input-joystick/Makefile.in index 19467abe5..15957b607 100644 --- a/driver/xf86-input-joystick/Makefile.in +++ b/driver/xf86-input-joystick/Makefile.in @@ -43,9 +43,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -59,8 +59,8 @@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/xorg-joystick.pc.in $(top_srcdir)/configure COPYING \ - ChangeLog config.guess config.sub depcomp install-sh ltmain.sh \ - missing + ChangeLog INSTALL config.guess config.sub depcomp install-sh \ + ltmain.sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -101,12 +101,14 @@ am__remove_distdir = \ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -149,6 +151,7 @@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -167,6 +170,7 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ @@ -187,6 +191,7 @@ STRIP = @STRIP@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -207,7 +212,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -237,13 +241,11 @@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -AUTOMAKE_OPTIONS = foreign DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg SUBDIRS = src man config include +MAINTAINERCLEANFILES = ChangeLog INSTALL pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xorg-joystick.pc -EXTRA_DIST = ChangeLog -MAINTAINERCLEANFILES = ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -708,12 +710,15 @@ uninstall-info: uninstall-info-recursive uninstall-pkgconfigDATA -.PHONY: ChangeLog +.PHONY: ChangeLog INSTALL + +INSTALL: + $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) -dist-hook: ChangeLog +dist-hook: ChangeLog INSTALL # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-input-joystick/aclocal.m4 b/driver/xf86-input-joystick/aclocal.m4 index f5c20ec3e..50aad887e 100644 --- a/driver/xf86-input-joystick/aclocal.m4 +++ b/driver/xf86-input-joystick/aclocal.m4 @@ -7134,18 +7134,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 @@ -7633,32 +7621,26 @@ AC_SUBST([am__untar]) dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. +dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a -dnl copy of this software and associated documentation files (the -dnl "Software"), to deal in the Software without restriction, including -dnl without limitation the rights to use, copy, modify, merge, publish, -dnl distribute, and/or sell copies of the Software, and to permit persons -dnl to whom the Software is furnished to do so, provided that the above -dnl copyright notice(s) and this permission notice appear in all copies of -dnl the Software and that both the above copyright notice(s) and this -dnl permission notice appear in supporting documentation. +dnl copy of this software and associated documentation files (the "Software"), +dnl to deal in the Software without restriction, including without limitation +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, +dnl and/or sell copies of the Software, and to permit persons to whom the +dnl Software is furnished to do so, subject to the following conditions: dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL -dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING -dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +dnl The above copyright notice and this permission notice (including the next +dnl paragraph) shall be included in all copies or substantial portions of the +dnl Software. dnl -dnl Except as contained in this notice, the name of a copyright holder -dnl shall not be used in advertising or otherwise to promote the sale, use -dnl or other dealings in this Software without prior written authorization -dnl of the copyright holder. +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +dnl DEALINGS IN THE SOFTWARE. # XORG_MACROS_VERSION(required-version) # ------------------------------------- @@ -7676,7 +7658,7 @@ dnl of the copyright holder. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.3.0]) +m4_define([vers_have], [1.13.0]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -7744,9 +7726,12 @@ AC_SUBST(RAWCPPFLAGS) # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. # Override default settings by setting environment variables +# Added MAN_SUBSTS in version 1.8 +# Added AC_PROG_SED in version 1.8 AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_SED]) if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 @@ -7815,8 +7800,60 @@ AC_SUBST([FILE_MAN_DIR]) AC_SUBST([MISC_MAN_DIR]) AC_SUBST([DRIVER_MAN_DIR]) AC_SUBST([ADMIN_MAN_DIR]) + +XORG_MAN_PAGE="X Version 11" +AC_SUBST([XORG_MAN_PAGE]) +MAN_SUBSTS="\ + -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|\$(prefix)|g' \ + -e 's|__apploaddir__|\$(appdefaultdir)|g' \ + -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" +AC_SUBST([MAN_SUBSTS]) + ]) # XORG_MANPAGE_SECTIONS +# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) +# ------------------------ +# Minimum version: 1.7.0 +# +# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent +# provided by xorg-sgml-doctools, if installed. +AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ +AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) +XORG_SGML_PATH= +PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], + [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], + [m4_ifval([$1],[:], + [if test x"$cross_compiling" != x"yes" ; then + AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], + [XORG_SGML_PATH=$prefix/share/sgml]) + fi]) + ]) + +# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing +# the path and the name of the doc stylesheet +if test "x$XORG_SGML_PATH" != "x" ; then + AC_MSG_RESULT([$XORG_SGML_PATH]) + STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 + XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(XORG_SGML_PATH) +AC_SUBST(STYLESHEET_SRCDIR) +AC_SUBST(XSL_STYLESHEET) +AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) +]) # XORG_CHECK_SGML_DOCTOOLS + # XORG_CHECK_LINUXDOC # ------------------- # Minimum version: 1.0.0 @@ -7826,23 +7863,14 @@ AC_SUBST([ADMIN_MAN_DIR]) # Whether or not the necessary tools and files are found can be checked # with the AM_CONDITIONAL "BUILD_LINUXDOC" AC_DEFUN([XORG_CHECK_LINUXDOC],[ -if test x$XORG_SGML_PATH = x ; then - XORG_SGML_PATH=$prefix/share/sgml -fi -HAVE_DEFS_ENT= - -if test x"$cross_compiling" = x"yes" ; then - HAVE_DEFS_ENT=no -else - AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) -fi +AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) +AC_REQUIRE([XORG_WITH_PS2PDF]) AC_PATH_PROG(LINUXDOC, linuxdoc) -AC_PATH_PROG(PS2PDF, ps2pdf) -AC_MSG_CHECKING([Whether to build documentation]) +AC_MSG_CHECKING([whether to build documentation]) -if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then +if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then BUILDDOC=yes else BUILDDOC=no @@ -7852,9 +7880,9 @@ AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) AC_MSG_RESULT([$BUILDDOC]) -AC_MSG_CHECKING([Whether to build pdf documentation]) +AC_MSG_CHECKING([whether to build pdf documentation]) -if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then +if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes else BUILDPDFDOC=no @@ -7864,7 +7892,7 @@ AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) -MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" MAKE_PDF="$PS2PDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" @@ -7884,48 +7912,44 @@ AC_SUBST(MAKE_HTML) # indicates whether the necessary tools and files are found and, if set, # $(MAKE_XXX) blah.sgml will produce blah.xxx. AC_DEFUN([XORG_CHECK_DOCBOOK],[ -if test x$XORG_SGML_PATH = x ; then - XORG_SGML_PATH=$prefix/share/sgml -fi -HAVE_DEFS_ENT= +AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) + BUILDTXTDOC=no BUILDPDFDOC=no BUILDPSDOC=no BUILDHTMLDOC=no -AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) - AC_PATH_PROG(DOCBOOKPS, docbook2ps) AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) AC_PATH_PROG(DOCBOOKHTML, docbook2html) AC_PATH_PROG(DOCBOOKTXT, docbook2txt) -AC_MSG_CHECKING([Whether to build text documentation]) -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && +AC_MSG_CHECKING([whether to build text documentation]) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && test x$BUILD_TXTDOC != xno; then BUILDTXTDOC=yes fi AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) AC_MSG_RESULT([$BUILDTXTDOC]) -AC_MSG_CHECKING([Whether to build PDF documentation]) -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && +AC_MSG_CHECKING([whether to build PDF documentation]) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) -AC_MSG_CHECKING([Whether to build PostScript documentation]) -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && +AC_MSG_CHECKING([whether to build PostScript documentation]) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && test x$BUILD_PSDOC != xno; then BUILDPSDOC=yes fi AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) AC_MSG_RESULT([$BUILDPSDOC]) -AC_MSG_CHECKING([Whether to build HTML documentation]) -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && +AC_MSG_CHECKING([whether to build HTML documentation]) +if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && test x$BUILD_HTMLDOC != xno; then BUILDHTMLDOC=yes fi @@ -7943,6 +7967,799 @@ AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_DOCBOOK +# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) +# ---------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-xmlto option, it allows maximum flexibilty in making decisions +# as whether or not to use the xmlto package. When DEFAULT is not specified, +# --with-xmlto assumes 'auto'. +# +# Interface to module: +# HAVE_XMLTO: used in makefiles to conditionally generate documentation +# XMLTO: returns the path of the xmlto program found +# returns the path set by the user in the environment +# --with-xmlto: 'yes' user instructs the module to use xmlto +# 'no' user instructs the module not to use xmlto +# +# Added in version 1.10.0 +# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation +# xmlto for text output requires either lynx, links, or w3m browsers +# +# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_XMLTO],[ +AC_ARG_VAR([XMLTO], [Path to xmlto command]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(xmlto, + AS_HELP_STRING([--with-xmlto], + [Use xmlto to regenerate documentation (default: ]_defopt[)]), + [use_xmlto=$withval], [use_xmlto=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_xmlto" = x"auto"; then + AC_PATH_PROG([XMLTO], [xmlto]) + if test "x$XMLTO" = "x"; then + AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) + have_xmlto=no + else + have_xmlto=yes + fi +elif test "x$use_xmlto" = x"yes" ; then + AC_PATH_PROG([XMLTO], [xmlto]) + if test "x$XMLTO" = "x"; then + AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) + fi + have_xmlto=yes +elif test "x$use_xmlto" = x"no" ; then + if test "x$XMLTO" != "x"; then + AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) + fi + have_xmlto=no +else + AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) +fi + +# Test for a minimum version of xmlto, if provided. +m4_ifval([$1], +[if test "$have_xmlto" = yes; then + # scrape the xmlto version + AC_MSG_CHECKING([the xmlto version]) + xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` + AC_MSG_RESULT([$xmlto_version]) + AS_VERSION_COMPARE([$xmlto_version], [$1], + [if test "x$use_xmlto" = xauto; then + AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) + have_xmlto=no + else + AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) + fi]) +fi]) + +# Test for the ability of xmlto to generate a text target +have_xmlto_text=no +cat > conftest.xml << "EOF" +EOF +AS_IF([test "$have_xmlto" = yes], + [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], + [have_xmlto_text=yes], + [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) +rm -f conftest.xml +AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) +AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) +]) # XORG_WITH_XMLTO + +# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) +# -------------------------------------------- +# Minimum version: 1.12.0 +# Minimum version for optional DEFAULT argument: 1.12.0 +# +# XSLT (Extensible Stylesheet Language Transformations) is a declarative, +# XML-based language used for the transformation of XML documents. +# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. +# It is used under the cover by xmlto to generate html files from DocBook/XML. +# The XSLT processor is often used as a standalone tool for transformations. +# It should not be assumed that this tool is used only to work with documnetation. +# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. +# +# Interface to module: +# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation +# XSLTPROC: returns the path of the xsltproc program found +# returns the path set by the user in the environment +# --with-xsltproc: 'yes' user instructs the module to use xsltproc +# 'no' user instructs the module not to use xsltproc +# have_xsltproc: returns yes if xsltproc found in PATH or no +# +# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_XSLTPROC],[ +AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(xsltproc, + AS_HELP_STRING([--with-xsltproc], + [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), + [use_xsltproc=$withval], [use_xsltproc=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_xsltproc" = x"auto"; then + AC_PATH_PROG([XSLTPROC], [xsltproc]) + if test "x$XSLTPROC" = "x"; then + AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) + have_xsltproc=no + else + have_xsltproc=yes + fi +elif test "x$use_xsltproc" = x"yes" ; then + AC_PATH_PROG([XSLTPROC], [xsltproc]) + if test "x$XSLTPROC" = "x"; then + AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) + fi + have_xsltproc=yes +elif test "x$use_xsltproc" = x"no" ; then + if test "x$XSLTPROC" != "x"; then + AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) + fi + have_xsltproc=no +else + AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) +fi + +# Checking for minimum version is not implemented +# but we want to keep the interface consistent with other commands +m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)]) + +AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) +]) # XORG_WITH_XSLTPROC + + +# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) +# ---------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-asciidoc option, it allows maximum flexibilty in making decisions +# as whether or not to use the asciidoc package. When DEFAULT is not specified, +# --with-asciidoc assumes 'auto'. +# +# Interface to module: +# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation +# ASCIIDOC: returns the path of the asciidoc program found +# returns the path set by the user in the environment +# --with-asciidoc: 'yes' user instructs the module to use asciidoc +# 'no' user instructs the module not to use asciidoc +# +# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_ASCIIDOC],[ +AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(asciidoc, + AS_HELP_STRING([--with-asciidoc], + [Use asciidoc to regenerate documentation (default: ]_defopt[)]), + [use_asciidoc=$withval], [use_asciidoc=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_asciidoc" = x"auto"; then + AC_PATH_PROG([ASCIIDOC], [asciidoc]) + if test "x$ASCIIDOC" = "x"; then + AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) + have_asciidoc=no + else + have_asciidoc=yes + fi +elif test "x$use_asciidoc" = x"yes" ; then + AC_PATH_PROG([ASCIIDOC], [asciidoc]) + if test "x$ASCIIDOC" = "x"; then + AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) + fi + have_asciidoc=yes +elif test "x$use_asciidoc" = x"no" ; then + if test "x$ASCIIDOC" != "x"; then + AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) + fi + have_asciidoc=no +else + AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) +fi +m4_ifval([$1], +[if test "$have_asciidoc" = yes; then + # scrape the asciidoc version + AC_MSG_CHECKING([the asciidoc version]) + asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` + AC_MSG_RESULT([$asciidoc_version]) + AS_VERSION_COMPARE([$asciidoc_version], [$1], + [if test "x$use_asciidoc" = xauto; then + AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) + have_asciidoc=no + else + AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) + fi]) +fi]) +AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) +]) # XORG_WITH_ASCIIDOC + +# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) +# -------------------------------- +# Minimum version: 1.5.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-doxygen option, it allows maximum flexibilty in making decisions +# as whether or not to use the doxygen package. When DEFAULT is not specified, +# --with-doxygen assumes 'auto'. +# +# Interface to module: +# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation +# DOXYGEN: returns the path of the doxygen program found +# returns the path set by the user in the environment +# --with-doxygen: 'yes' user instructs the module to use doxygen +# 'no' user instructs the module not to use doxygen +# +# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_DOXYGEN],[ +AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(doxygen, + AS_HELP_STRING([--with-doxygen], + [Use doxygen to regenerate documentation (default: ]_defopt[)]), + [use_doxygen=$withval], [use_doxygen=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_doxygen" = x"auto"; then + AC_PATH_PROG([DOXYGEN], [doxygen]) + if test "x$DOXYGEN" = "x"; then + AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) + have_doxygen=no + else + have_doxygen=yes + fi +elif test "x$use_doxygen" = x"yes" ; then + AC_PATH_PROG([DOXYGEN], [doxygen]) + if test "x$DOXYGEN" = "x"; then + AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) + fi + have_doxygen=yes +elif test "x$use_doxygen" = x"no" ; then + if test "x$DOXYGEN" != "x"; then + AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) + fi + have_doxygen=no +else + AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) +fi +m4_ifval([$1], +[if test "$have_doxygen" = yes; then + # scrape the doxygen version + AC_MSG_CHECKING([the doxygen version]) + doxygen_version=`$DOXYGEN --version 2>/dev/null` + AC_MSG_RESULT([$doxygen_version]) + AS_VERSION_COMPARE([$doxygen_version], [$1], + [if test "x$use_doxygen" = xauto; then + AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) + have_doxygen=no + else + AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) + fi]) +fi]) +AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) +]) # XORG_WITH_DOXYGEN + +# XORG_WITH_GROFF([DEFAULT]) +# ---------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-groff option, it allows maximum flexibilty in making decisions +# as whether or not to use the groff package. When DEFAULT is not specified, +# --with-groff assumes 'auto'. +# +# Interface to module: +# HAVE_GROFF: used in makefiles to conditionally generate documentation +# HAVE_GROFF_MM: the memorandum macros (-mm) package +# HAVE_GROFF_MS: the -ms macros package +# GROFF: returns the path of the groff program found +# returns the path set by the user in the environment +# --with-groff: 'yes' user instructs the module to use groff +# 'no' user instructs the module not to use groff +# +# Added in version 1.9.0: +# HAVE_GROFF_HTML: groff has dependencies to output HTML format: +# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. +# psselect from the psutils package. +# the ghostcript package. Refer to the grohtml man pages +# +# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. +# +# OS and distros often splits groff in a basic and full package, the former +# having the groff program and the later having devices, fonts and macros +# Checking for the groff executable is not enough. +# +# If macros are missing, we cannot assume that groff is useless, so we don't +# unset HAVE_GROFF or GROFF env variables. +# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. +# +AC_DEFUN([XORG_WITH_GROFF],[ +AC_ARG_VAR([GROFF], [Path to groff command]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_WITH(groff, + AS_HELP_STRING([--with-groff], + [Use groff to regenerate documentation (default: ]_defopt[)]), + [use_groff=$withval], [use_groff=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_groff" = x"auto"; then + AC_PATH_PROG([GROFF], [groff]) + if test "x$GROFF" = "x"; then + AC_MSG_WARN([groff not found - documentation targets will be skipped]) + have_groff=no + else + have_groff=yes + fi +elif test "x$use_groff" = x"yes" ; then + AC_PATH_PROG([GROFF], [groff]) + if test "x$GROFF" = "x"; then + AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) + fi + have_groff=yes +elif test "x$use_groff" = x"no" ; then + if test "x$GROFF" != "x"; then + AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) + fi + have_groff=no +else + AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) +fi + +# We have groff, test for the presence of the macro packages +if test "x$have_groff" = x"yes"; then + AC_MSG_CHECKING([for ${GROFF} -ms macros]) + if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then + groff_ms_works=yes + else + groff_ms_works=no + fi + AC_MSG_RESULT([$groff_ms_works]) + AC_MSG_CHECKING([for ${GROFF} -mm macros]) + if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then + groff_mm_works=yes + else + groff_mm_works=no + fi + AC_MSG_RESULT([$groff_mm_works]) +fi + +# We have groff, test for HTML dependencies, one command per package +if test "x$have_groff" = x"yes"; then + AC_PATH_PROGS(GS_PATH, [gs gswin32c]) + AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) + AC_PATH_PROG(PSSELECT_PATH, [psselect]) + if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then + have_groff_html=yes + else + have_groff_html=no + AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) + fi +fi + +# Set Automake conditionals for Makefiles +AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) +AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) +AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) +AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) +]) # XORG_WITH_GROFF + +# XORG_WITH_FOP([DEFAULT]) +# ---------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-fop option, it allows maximum flexibilty in making decisions +# as whether or not to use the fop package. When DEFAULT is not specified, +# --with-fop assumes 'auto'. +# +# Interface to module: +# HAVE_FOP: used in makefiles to conditionally generate documentation +# FOP: returns the path of the fop program found +# returns the path set by the user in the environment +# --with-fop: 'yes' user instructs the module to use fop +# 'no' user instructs the module not to use fop +# +# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_FOP],[ +AC_ARG_VAR([FOP], [Path to fop command]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_WITH(fop, + AS_HELP_STRING([--with-fop], + [Use fop to regenerate documentation (default: ]_defopt[)]), + [use_fop=$withval], [use_fop=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_fop" = x"auto"; then + AC_PATH_PROG([FOP], [fop]) + if test "x$FOP" = "x"; then + AC_MSG_WARN([fop not found - documentation targets will be skipped]) + have_fop=no + else + have_fop=yes + fi +elif test "x$use_fop" = x"yes" ; then + AC_PATH_PROG([FOP], [fop]) + if test "x$FOP" = "x"; then + AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) + fi + have_fop=yes +elif test "x$use_fop" = x"no" ; then + if test "x$FOP" != "x"; then + AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) + fi + have_fop=no +else + AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) +fi +AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) +]) # XORG_WITH_FOP + +# XORG_WITH_PS2PDF([DEFAULT]) +# ---------------- +# Minimum version: 1.6.0 +# Minimum version for optional DEFAULT argument: 1.11.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a module to test for the +# presence of the tool and obtain it's path in separate variables. Coupled with +# the --with-ps2pdf option, it allows maximum flexibilty in making decisions +# as whether or not to use the ps2pdf package. When DEFAULT is not specified, +# --with-ps2pdf assumes 'auto'. +# +# Interface to module: +# HAVE_PS2PDF: used in makefiles to conditionally generate documentation +# PS2PDF: returns the path of the ps2pdf program found +# returns the path set by the user in the environment +# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf +# 'no' user instructs the module not to use ps2pdf +# +# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_PS2PDF],[ +AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_WITH(ps2pdf, + AS_HELP_STRING([--with-ps2pdf], + [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), + [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_ps2pdf" = x"auto"; then + AC_PATH_PROG([PS2PDF], [ps2pdf]) + if test "x$PS2PDF" = "x"; then + AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) + have_ps2pdf=no + else + have_ps2pdf=yes + fi +elif test "x$use_ps2pdf" = x"yes" ; then + AC_PATH_PROG([PS2PDF], [ps2pdf]) + if test "x$PS2PDF" = "x"; then + AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) + fi + have_ps2pdf=yes +elif test "x$use_ps2pdf" = x"no" ; then + if test "x$PS2PDF" != "x"; then + AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) + fi + have_ps2pdf=no +else + AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) +fi +AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) +]) # XORG_WITH_PS2PDF + +# XORG_ENABLE_DOCS (enable_docs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# Documentation tools are not always available on all platforms and sometimes +# not at the appropriate level. This macro enables a builder to skip all +# documentation targets except traditional man pages. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_DOCS: used in makefiles to conditionally generate documentation +# --enable-docs: 'yes' user instructs the module to generate docs +# 'no' user instructs the module not to generate docs +# parm1: specify the default value, yes or no. +# +AC_DEFUN([XORG_ENABLE_DOCS],[ +m4_define([docs_default], m4_default([$1], [yes])) +AC_ARG_ENABLE(docs, + AS_HELP_STRING([--enable-docs], + [Enable building the documentation (default: ]docs_default[)]), + [build_docs=$enableval], [build_docs=]docs_default) +m4_undefine([docs_default]) +AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) +AC_MSG_CHECKING([whether to build documentation]) +AC_MSG_RESULT([$build_docs]) +]) # XORG_ENABLE_DOCS + +# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# This macro enables a builder to skip all developer documentation. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs +# --enable-devel-docs: 'yes' user instructs the module to generate developer docs +# 'no' user instructs the module not to generate developer docs +# parm1: specify the default value, yes or no. +# +AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ +m4_define([devel_default], m4_default([$1], [yes])) +AC_ARG_ENABLE(devel-docs, + AS_HELP_STRING([--enable-devel-docs], + [Enable building the developer documentation (default: ]devel_default[)]), + [build_devel_docs=$enableval], [build_devel_docs=]devel_default) +m4_undefine([devel_default]) +AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) +AC_MSG_CHECKING([whether to build developer documentation]) +AC_MSG_RESULT([$build_devel_docs]) +]) # XORG_ENABLE_DEVEL_DOCS + +# XORG_ENABLE_SPECS (enable_specs=yes) +# ---------------- +# Minimum version: 1.6.0 +# +# This macro enables a builder to skip all functional specification targets. +# Combined with the specific tool checking macros XORG_WITH_*, it provides +# maximum flexibilty in controlling documentation building. +# Refer to: +# XORG_WITH_XMLTO --with-xmlto +# XORG_WITH_ASCIIDOC --with-asciidoc +# XORG_WITH_DOXYGEN --with-doxygen +# XORG_WITH_FOP --with-fop +# XORG_WITH_GROFF --with-groff +# XORG_WITH_PS2PDF --with-ps2pdf +# +# Interface to module: +# ENABLE_SPECS: used in makefiles to conditionally generate specs +# --enable-specs: 'yes' user instructs the module to generate specs +# 'no' user instructs the module not to generate specs +# parm1: specify the default value, yes or no. +# +AC_DEFUN([XORG_ENABLE_SPECS],[ +m4_define([spec_default], m4_default([$1], [yes])) +AC_ARG_ENABLE(specs, + AS_HELP_STRING([--enable-specs], + [Enable building the specs (default: ]spec_default[)]), + [build_specs=$enableval], [build_specs=]spec_default) +m4_undefine([spec_default]) +AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) +AC_MSG_CHECKING([whether to build functional specifications]) +AC_MSG_RESULT([$build_specs]) +]) # XORG_ENABLE_SPECS + +# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) +# ---------------------------------------------- +# Minimum version: 1.13.0 +# +# This macro enables a builder to enable/disable unit testing +# It makes no assumption about the test cases implementation +# Test cases may or may not use Automake "Support for test suites" +# They may or may not use the software utility library GLib +# +# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL +# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. +# The variable enable_unit_tests is used by other macros in this file. +# +# Interface to module: +# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests +# enable_unit_tests: used in configure.ac for additional configuration +# --enable-unit-tests: 'yes' user instructs the module to build tests +# 'no' user instructs the module not to build tests +# parm1: specify the default value, yes or no. +# +AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ +AC_BEFORE([$0], [XORG_WITH_GLIB]) +AC_BEFORE([$0], [XORG_LD_WRAP]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], + [Enable building unit test cases (default: ]_defopt[)]), + [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) +m4_undefine([_defopt]) +AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) +AC_MSG_CHECKING([whether to build unit test cases]) +AC_MSG_RESULT([$enable_unit_tests]) +]) # XORG_ENABLE_UNIT_TESTS + +# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) +# ---------------------------------------- +# Minimum version: 1.13.0 +# +# GLib is a library which provides advanced data structures and functions. +# This macro enables a module to test for the presence of Glib. +# +# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +# Interface to module: +# HAVE_GLIB: used in makefiles to conditionally build targets +# with_glib: used in configure.ac to know if GLib has been found +# --with-glib: 'yes' user instructs the module to use glib +# 'no' user instructs the module not to use glib +# +AC_DEFUN([XORG_WITH_GLIB],[ +AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], + [Use GLib library for unit testing (default: ]_defopt[)]), + [with_glib=$withval], [with_glib=]_defopt) +m4_undefine([_defopt]) + +have_glib=no +# Do not probe GLib if user explicitly disabled unit testing +if test "x$enable_unit_tests" != x"no"; then + # Do not probe GLib if user explicitly disabled it + if test "x$with_glib" != x"no"; then + m4_ifval( + [$1], + [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], + [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] + ) + fi +fi + +# Not having GLib when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) + fi +fi + +# Having unit testing disabled when GLib has been explicitly requested is an error +if test "x$enable_unit_tests" = x"no"; then + if test "x$with_glib" = x"yes"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) + fi +fi + +# Not having GLib when it has been explicitly requested is an error +if test "x$with_glib" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) + fi +fi + +AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) +]) # XORG_WITH_GLIB + +# XORG_LD_WRAP +# ------------ +# Minimum version: 1.13.0 +# +# Check if linker supports -wrap, passed via compiler flags +# +# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +AC_DEFUN([XORG_LD_WRAP],[ +XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no]) +# Not having ld wrap when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes"; then + if test "x$have_ld_wrap" = x"no"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) + fi +fi +AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) +# +]) # XORG_LD_WRAP + +# XORG_CHECK_LINKER_FLAGS +# ----------------------- +# SYNOPSIS +# +# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given linker FLAGS work with the current language's +# linker, or whether they give an error. +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# NOTE: Based on AX_CHECK_COMPILER_FLAGS. +# +# LICENSE +# +# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2009 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well.# +AC_DEFUN([XORG_CHECK_LINKER_FLAGS], +[AC_MSG_CHECKING([whether the linker accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ + ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, + AS_TR_SH(xorg_cv_linker_flags_[$1])=no) + LDFLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, + eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) + LDFLAGS=$ax_save_FLAGS]) +eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) +AC_MSG_RESULT($xorg_check_linker_flags) +if test "x$xorg_check_linker_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +]) # XORG_CHECK_LINKER_FLAGS + # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 @@ -7959,20 +8776,19 @@ AC_ARG_ENABLE(malloc0returnsnull, AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then - AC_RUN_IFELSE([ -char *malloc(); -char *realloc(); -char *calloc(); -main() { + AC_RUN_IFELSE([AC_LANG_PROGRAM([ +#include <stdlib.h> +],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); - c0 = calloc(0); - exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); -}], + c0 = calloc(0,10); + exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); +])], [MALLOC_ZERO_RETURNS_NULL=yes], - [MALLOC_ZERO_RETURNS_NULL=no]) + [MALLOC_ZERO_RETURNS_NULL=no], + [MALLOC_ZERO_RETURNS_NULL=yes]) fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) @@ -7995,38 +8811,69 @@ AC_SUBST([XTMALLOC_ZERO_CFLAGS]) # ---------------- # Minimum version: 1.1.0 # -# Sets up flags for source checkers such as lint and sparse if --with-lint -# is specified. (Use --with-lint=sparse for sparse.) -# Sets $LINT to name of source checker passed with --with-lint (default: lint) -# Sets $LINT_FLAGS to flags to pass to source checker -# Sets LINT automake conditional if enabled (default: disabled) +# This macro enables the use of a tool that flags some suspicious and +# non-portable constructs (likely to be bugs) in C language source code. +# It will attempt to locate the tool and use appropriate options. +# There are various lint type tools on different platforms. +# +# Interface to module: +# LINT: returns the path to the tool found on the platform +# or the value set to LINT on the configure cmd line +# also an Automake conditional +# LINT_FLAGS: an Automake variable with appropriate flags +# +# --with-lint: 'yes' user instructs the module to use lint +# 'no' user instructs the module not to use lint (default) +# +# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. +# If the user sets the value of LINT_FLAGS, they are used verbatim. # AC_DEFUN([XORG_WITH_LINT],[ -# Allow checking code with lint, sparse, etc. +AC_ARG_VAR([LINT], [Path to a lint-style command]) +AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], [Use a lint-style source code checker (default: disabled)])], [use_lint=$withval], [use_lint=no]) -if test "x$use_lint" = "xyes" ; then - LINT="lint" + +# Obtain platform specific info like program name and options +# The lint program on FreeBSD and NetBSD is different from the one on Solaris +case $host_os in + *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) + lint_name=splint + lint_options="-badflag" + ;; + *freebsd* | *netbsd*) + lint_name=lint + lint_options="-u -b" + ;; + *solaris*) + lint_name=lint + lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" + ;; +esac + +# Test for the presence of the program (either guessed by the code or spelled out by the user) +if test "x$use_lint" = x"yes" ; then + AC_PATH_PROG([LINT], [$lint_name]) + if test "x$LINT" = "x"; then + AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) + fi +elif test "x$use_lint" = x"no" ; then + if test "x$LINT" != "x"; then + AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) + fi else - LINT="$use_lint" + AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) fi -if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then - case $LINT in - lint|*/lint) - case $host_os in - solaris*) - LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" - ;; - esac - ;; - esac + +# User supplied flags override default flags +if test "x$LINT_FLAGS" != "x"; then + lint_options=$LINT_FLAGS fi -AC_SUBST(LINT) -AC_SUBST(LINT_FLAGS) -AM_CONDITIONAL(LINT, [test x$LINT != xno]) +AC_SUBST([LINT_FLAGS],[$lint_options]) +AM_CONDITIONAL(LINT, [test "x$LINT" != x]) ]) # XORG_WITH_LINT @@ -8036,28 +8883,29 @@ AM_CONDITIONAL(LINT, [test x$LINT != xno]) # # Sets up flags for building lint libraries for checking programs that call # functions in the library. -# Disabled by default, enable with --enable-lint-library -# Sets: -# @LINTLIB@ - name of lint library file to make -# MAKE_LINT_LIB - automake conditional # +# Interface to module: +# LINTLIB - Automake variable with the name of lint library file to make +# MAKE_LINT_LIB - Automake conditional +# +# --enable-lint-library: - 'yes' user instructs the module to created a lint library +# - 'no' user instructs the module not to create a lint library (default) AC_DEFUN([XORG_LINT_LIBRARY],[ AC_REQUIRE([XORG_WITH_LINT]) -# Build lint "library" for more indepth checks of programs calling this library AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], [Create lint library (default: disabled)])], [make_lint_lib=$enableval], [make_lint_lib=no]) -if test "x$make_lint_lib" != "xno" ; then - if test "x$LINT" = "xno" ; then - AC_MSG_ERROR([Cannot make lint library without --with-lint]) - fi - if test "x$make_lint_lib" = "xyes" ; then - LINTLIB=llib-l$1.ln - else - LINTLIB=$make_lint_lib - fi + +if test "x$make_lint_lib" = x"yes" ; then + LINTLIB=llib-l$1.ln + if test "x$LINT" = "x"; then + AC_MSG_ERROR([Cannot make lint library without --with-lint]) + fi +elif test "x$make_lint_lib" != x"no" ; then + AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) fi + AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) @@ -8070,11 +8918,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) # Defines CWARNFLAGS to enable C compiler warnings. # AC_DEFUN([XORG_CWARNFLAGS], [ -AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_CC_C99]) if test "x$GCC" = xyes ; then CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ --Wbad-function-cast" +-Wbad-function-cast -Wformat=2" case `$CC -dumpversion` in 3.4.* | 4.*) CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" @@ -8087,7 +8935,6 @@ else fi fi AC_SUBST(CWARNFLAGS) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) ]) # XORG_CWARNFLAGS # XORG_STRICT_OPTION @@ -8096,7 +8943,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # # Add configure option to enable strict compilation AC_DEFUN([XORG_STRICT_OPTION], [ -AC_REQUIRE([AC_PROG_CC]) +# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 AC_REQUIRE([AC_PROG_CC_C99]) AC_REQUIRE([XORG_CWARNFLAGS]) @@ -8126,12 +8973,33 @@ AC_SUBST([CWARNFLAGS]) # Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ +AC_REQUIRE([AC_PROG_INSTALL]) XORG_CWARNFLAGS XORG_STRICT_OPTION XORG_RELEASE_VERSION XORG_CHANGELOG +XORG_INSTALL XORG_MANPAGE_SECTIONS +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS + +# XORG_INSTALL() +# ---------------- +# Minimum version: 1.4.0 +# +# Defines the variable INSTALL_CMD as the command to copy +# INSTALL from $prefix/share/util-macros. +# +AC_DEFUN([XORG_INSTALL], [ +AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ +mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ +echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" +AC_SUBST([INSTALL_CMD]) +]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its @@ -8159,22 +9027,9 @@ dnl # XORG_RELEASE_VERSION # -------------------- -# Adds --with/without-release-string and changes the PACKAGE and -# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If -# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also -# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. +# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. AC_DEFUN([XORG_RELEASE_VERSION],[ - AC_ARG_WITH(release-version, - AS_HELP_STRING([--with-release-version=STRING], - [Use release version string in package name]), - [RELEASE_VERSION="$withval"], - [RELEASE_VERSION=""]) - if test "x$RELEASE_VERSION" != "x"; then - PACKAGE="$PACKAGE-$RELEASE_VERSION" - PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" - AC_MSG_NOTICE([Building with package name set to $PACKAGE]) - fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) @@ -8201,14 +9056,13 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ # Defines the variable CHANGELOG_CMD as the command to generate # ChangeLog from git. # -# Arrange that distcleancheck ignores ChangeLog left over by distclean. # AC_DEFUN([XORG_CHANGELOG], [ -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \ -mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \ +CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ +|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) -AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print']) ]) # XORG_CHANGELOG dnl Copyright 2005 Red Hat, Inc @@ -8242,8 +9096,9 @@ dnl # is defined, then add $1 to $REQUIRED_MODULES. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "xorg-server.h" #if !defined $1 diff --git a/driver/xf86-input-joystick/config.h.in b/driver/xf86-input-joystick/config.h.in index 5982cc09f..0cf43dd24 100644 --- a/driver/xf86-input-joystick/config.h.in +++ b/driver/xf86-input-joystick/config.h.in @@ -1,7 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -#include "xorg-server.h" - /* Compile BSD usbhid backend */ #undef BSD_BACKEND @@ -65,9 +63,6 @@ /* Compile Linux joystick backend */ #undef LINUX_BACKEND -/* Disable some debugging code */ -#undef NDEBUG - /* Name of package */ #undef PACKAGE diff --git a/driver/xf86-input-joystick/config/50-joystick-all.conf b/driver/xf86-input-joystick/config/50-joystick-all.conf new file mode 100644 index 000000000..ee03dd55f --- /dev/null +++ b/driver/xf86-input-joystick/config/50-joystick-all.conf @@ -0,0 +1,51 @@ +# Example xorg.conf.d snippet that assigns the joystick driver +# to all joysticks. See xorg.conf.d(5) for more information on +# InputClass. +# DO NOT EDIT THIS FILE, your distribution will likely overwrite +# it when updating. Copy (and rename) this file into +# /etc/X11/xorg.conf.d first. +# Additional options may be added in the form of +# Option "OptionName" "value" +# + +Section "InputClass" + Identifier "joystick-all" + + # UNCOMMENT TO ENABLE HOTPLUGGING OF JOYSTICKS +# Driver "joystick" +# MatchIsJoystick "on" +# MatchDevicePath "/dev/input/event*" + + Option "MapButton1" "button=1" + Option "MapButton2" "button=2" + Option "MapButton3" "button=3" + + Option "MapAxis1" "mode=relative axis=+1x deadzone=5000" + Option "MapAxis2" "mode=relative axis=+1y deadzone=5000" + Option "MapAxis3" "mode=relative axis=+1zx deadzone=5000" + Option "MapAxis4" "mode=relative axis=+1zy deadzone=5000" + Option "MapAxis5" "mode=accelerated axis=+1x deadzone=5000" + Option "MapAxis6" "mode=accelerated axis=+1y deadzone=5000" + + + # Map Alt+Tab to button #4 +# Option "MapButton4" "key=64+23" + + # Button 8 will slow down all movement to factor 0.3 +# Option "MapButton8" "amplify=0.3" + + # Button 9 will disable all events except button #9 itself +# Option "MapButton9" "disable-all" + + # Map button #10 to Space +# Option "MapButton10" "key=65" + + # Map axis #1 and #2 to the keycodes for Left, Right, Up and Down rather + # than pointer movement +# Option "MapAxis1" "mode=accelerated keylow=113 keyhigh=114" +# Option "MapAxis2" "mode=accelerated keylow=111 keyhigh=116" + +# Option "XkbLayout" "de" +# Option "XkbVariant" "nodeadkeys" +# Option "AutoRepeat" "400 25" +EndSection diff --git a/driver/xf86-input-joystick/config/Makefile.am b/driver/xf86-input-joystick/config/Makefile.am index c96ffeb54..2aef07118 100644 --- a/driver/xf86-input-joystick/config/Makefile.am +++ b/driver/xf86-input-joystick/config/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = 50-x11-input-joystick.fdi +EXTRA_DIST = 50-x11-input-joystick.fdi 50-joystick-all.conf diff --git a/driver/xf86-input-joystick/config/Makefile.in b/driver/xf86-input-joystick/config/Makefile.in index d50392124..180f2e03b 100644 --- a/driver/xf86-input-joystick/config/Makefile.in +++ b/driver/xf86-input-joystick/config/Makefile.in @@ -22,9 +22,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -53,6 +53,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -95,6 +96,7 @@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -113,6 +115,7 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ @@ -133,6 +136,7 @@ STRIP = @STRIP@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -153,7 +157,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -183,7 +186,7 @@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -EXTRA_DIST = 50-x11-input-joystick.fdi +EXTRA_DIST = 50-x11-input-joystick.fdi 50-joystick-all.conf all: all-am .SUFFIXES: @@ -196,9 +199,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu config/Makefile + $(AUTOMAKE) --foreign config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/driver/xf86-input-joystick/configure b/driver/xf86-input-joystick/configure index aeeb0315a..9b7d4458c 100644 --- a/driver/xf86-input-joystick/configure +++ b/driver/xf86-input-joystick/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.62 for xf86-input-joystick 1.5.0. +# Generated by GNU Autoconf 2.62 for xf86-input-joystick 1.6.0. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xf86-input-joystick' PACKAGE_TARNAME='xf86-input-joystick' -PACKAGE_VERSION='1.5.0' -PACKAGE_STRING='xf86-input-joystick 1.5.0' +PACKAGE_VERSION='1.6.0' +PACKAGE_STRING='xf86-input-joystick 1.6.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_unique_file="Makefile.am" @@ -898,20 +898,9 @@ FFLAGS ac_ct_F77 LIBTOOL CWARNFLAGS -DEBUG_TRUE -DEBUG_FALSE -inputdir +CHANGELOG_CMD PKG_CONFIG -XORG_CFLAGS -XORG_LIBS -sdkdir -LINUX_BACKEND_TRUE -LINUX_BACKEND_FALSE -BSD_BACKEND_TRUE -BSD_BACKEND_FALSE -EVDEV_BACKEND_TRUE -EVDEV_BACKEND_FALSE -DRIVER_NAME +INSTALL_CMD APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX @@ -924,8 +913,22 @@ FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR -CHANGELOG_CMD -distcleancheck_listfiles +XORG_MAN_PAGE +MAN_SUBSTS +AM_DEFAULT_VERBOSITY +XORG_CFLAGS +XORG_LIBS +DRIVER_NAME +inputdir +sdkdir +DEBUG_TRUE +DEBUG_FALSE +LINUX_BACKEND_TRUE +LINUX_BACKEND_FALSE +BSD_BACKEND_TRUE +BSD_BACKEND_FALSE +EVDEV_BACKEND_TRUE +EVDEV_BACKEND_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -940,10 +943,10 @@ with_gnu_ld enable_libtool_lock with_pic with_tags +enable_strict_compilation with_xorg_module_dir -enable_debug with_sdkdir -with_release_version +enable_debug ' ac_precious_vars='build_alias host_alias @@ -1515,7 +1518,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-joystick 1.5.0 to adapt to many kinds of systems. +\`configure' configures xf86-input-joystick 1.6.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1586,7 +1589,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-input-joystick 1.5.0:";; + short | recursive ) echo "Configuration of xf86-input-joystick 1.6.0:";; esac cat <<\_ACEOF @@ -1603,7 +1606,10 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) - --enable-debug Enable debugging (default: enabled) + --enable-strict-compilation + Enable all warnings from compiler and make them + errors (default: disabled) + --enable-debug Enable debugging (default: disabled) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1616,8 +1622,6 @@ Optional Packages: Default xorg module directory [default=$libdir/xorg/modules] --with-sdkdir=<path> Xorg X Server sdk headers (default is autodetected) - --with-release-version=STRING - Use release version string in package name Some influential environment variables: CC C compiler command @@ -1703,7 +1707,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-input-joystick configure 1.5.0 +xf86-input-joystick configure 1.6.0 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1717,7 +1721,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-joystick $as_me 1.5.0, which was +It was created by xf86-input-joystick $as_me 1.6.0, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ @@ -2084,6 +2088,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in . "$srcdir"/.; do @@ -2116,6 +2121,8 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + +# Initialize Automake am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2368,7 +2375,7 @@ fi # Define the identity of the package. PACKAGE='xf86-input-joystick' - VERSION='1.5.0' + VERSION='1.6.0' cat >>confdefs.h <<_ACEOF @@ -2514,7 +2521,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - { $as_echo "$as_me:$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. @@ -2540,22 +2546,7 @@ fi -# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG - - - - - - - - - - - -ac_config_headers="$ac_config_headers config.h" - - -# Checks for programs. +# Initialize libtool # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} @@ -4442,7 +4433,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4445 "configure"' > conftest.$ac_ext + echo '#line 4436 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7550,11 +7541,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7553: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7544: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7557: \$? = $ac_status" >&5 + echo "$as_me:7548: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7840,11 +7831,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7843: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7834: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7847: \$? = $ac_status" >&5 + echo "$as_me:7838: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7944,11 +7935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7947: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7938: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7951: \$? = $ac_status" >&5 + echo "$as_me:7942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10344,7 +10335,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10347 "configure" +#line 10338 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10444,7 +10435,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10447 "configure" +#line 10438 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12853,11 +12844,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12856: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12847: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12860: \$? = $ac_status" >&5 + echo "$as_me:12851: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12957,11 +12948,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12960: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12951: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12964: \$? = $ac_status" >&5 + echo "$as_me:12955: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14540,11 +14531,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14543: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14534: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14547: \$? = $ac_status" >&5 + echo "$as_me:14538: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14644,11 +14635,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14647: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14638: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14651: \$? = $ac_status" >&5 + echo "$as_me:14642: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16859,11 +16850,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16862: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16853: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16866: \$? = $ac_status" >&5 + echo "$as_me:16857: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17149,11 +17140,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17152: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17143: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17156: \$? = $ac_status" >&5 + echo "$as_me:17147: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17253,11 +17244,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17256: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17247: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17260: \$? = $ac_status" >&5 + echo "$as_me:17251: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19938,226 +19929,245 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' -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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS -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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - CC=$ac_ct_CC - fi +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c99=$ac_arg else - CC="$ac_cv_prog_CC" + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break done -IFS=$as_save_IFS +rm -f conftest.$ac_ext +CC=$ac_save_CC fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac - 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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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:$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:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi -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 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_path_PKG_CONFIG+set}" = set; 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 + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -20165,43 +20175,42 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi - 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 +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; 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 + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -20209,23 +20218,20 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -20237,60 +20243,115 @@ whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + PKG_CONFIG=$ac_pt_PKG_CONFIG fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} + $ac_path_SED_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi -# Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed -{ $as_echo "$as_me:$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 test "${ac_cv_c_compiler_gnu+set}" = set; then + + + + +if test "x$GCC" = xyes ; then + CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ +-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ +-Wbad-function-cast -Wformat=2" + case `$CC -dumpversion` in + 3.4.* | 4.*) + CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" + ;; + esac +else + { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5 +$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; } +if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20299,12 +20360,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +$ac_includes_default int main () { -#ifndef __GNUC__ - choke me +#ifndef __SUNPRO_C + (void) __SUNPRO_C; #endif ; @@ -20329,46 +20390,61 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes + ac_cv_have_decl___SUNPRO_C=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_compiler_gnu=no + ac_cv_have_decl___SUNPRO_C=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5 +$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; } +if test $ac_cv_have_decl___SUNPRO_C = yes; then + SUNCC="yes" +else + SUNCC="no" +fi + if test "x$SUNCC" = "xyes"; then + CWARNFLAGS="-v" + fi fi -{ $as_echo "$as_me:$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 + + + +# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 + + + +# Check whether --enable-strict-compilation was given. +if test "${enable_strict_compilation+set}" = set; then + enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval else - GCC= + STRICT_COMPILE=no fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then + +if test "x$STRICT_COMPILE" = "xyes"; then + { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5 +$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; } +if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; 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 >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +$ac_includes_default int main () { +#ifndef __SUNPRO_C + (void) __SUNPRO_C; +#endif ; return 0; @@ -20392,62 +20468,42 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes + ac_cv_have_decl___SUNPRO_C=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ + ac_cv_have_decl___SUNPRO_C=no +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5 +$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; } +if test $ac_cv_have_decl___SUNPRO_C = yes; then + SUNCC="yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + SUNCC="no" +fi - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5 +$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; } +if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +$ac_includes_default int main () { +#ifndef __INTEL_COMPILER + (void) __INTEL_COMPILER; +#endif ; return 0; @@ -20471,345 +20527,132 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes + ac_cv_have_decl___INTEL_COMPILER=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl___INTEL_COMPILER=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5 +$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; } +if test $ac_cv_have_decl___INTEL_COMPILER = yes; then + INTELCC="yes" +else + INTELCC="no" 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:$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 + if test "x$GCC" = xyes ; then + STRICT_CFLAGS="-pedantic -Werror" + elif test "x$SUNCC" = "xyes"; then + STRICT_CFLAGS="-errwarn" + elif test "x$INTELCC" = "xyes"; then + STRICT_CFLAGS="-Werror" + fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* 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; -} +CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" -/* 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; -} + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _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" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` + if test "x$PVM" = "x"; then + PVM="0" + fi -fi +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION_MINOR $PVM +_ACEOF -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 + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` + if test "x$PVP" = "x"; then + PVP="0" + fi -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION_PATCHLEVEL $PVP +_ACEOF -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= +CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ +|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ +echo 'git directory not found: installing possibly empty changelog.' >&2)" -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. - 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 - 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 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 +macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ +mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ +echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" -fi -{ $as_echo "$as_me:$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 +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi -if test "x$GCC" = xyes ; then - CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ --Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ --Wbad-function-cast" - case `$CC -dumpversion` in - 3.4.* | 4.*) - CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" - ;; +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac -else - { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5 -$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; } -if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef __SUNPRO_C - (void) __SUNPRO_C; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl___SUNPRO_C=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi - ac_cv_have_decl___SUNPRO_C=no +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5 -$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; } -if test $ac_cv_have_decl___SUNPRO_C = yes; then - SUNCC="yes" -else - SUNCC="no" +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi - if test "x$SUNCC" = "xyes"; then - CWARNFLAGS="-v" - fi +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi @@ -20819,52 +20662,40 @@ 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 -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then - enableval=$enable_debug; DEBUGGING=$enableval -else - DEBUGGING=yes -fi -if test "x$DEBUGGING" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define DEBUG 1 -_ACEOF -else -cat >>confdefs.h <<\_ACEOF -#define NDEBUG 1 -_ACEOF -fi +XORG_MAN_PAGE="X Version 11" +MAN_SUBSTS="\ + -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|\$(prefix)|g' \ + -e 's|__apploaddir__|\$(appdefaultdir)|g' \ + -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" -if test "x$DEBUGGING" = xyes; then - DEBUG_TRUE= - DEBUG_FALSE='#' -else - DEBUG_TRUE='#' - DEBUG_FALSE= -fi -inputdir=${moduledir}/input +AM_DEFAULT_VERBOSITY=1 + # Checks for extensions + SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20922,8 +20753,9 @@ $as_echo "$_EXT_CHECK" >&6; } fi + SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20983,126 +20815,6 @@ $as_echo "$_EXT_CHECK" >&6; } # Checks for pkg-config packages - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - pkg_failed=no { $as_echo "$as_me:$LINENO: checking for XORG" >&5 $as_echo_n "checking for XORG... " >&6; } @@ -21112,12 +20824,12 @@ if test -n "$PKG_CONFIG"; then pkg_cv_XORG_CFLAGS="$XORG_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.3.99.901 xproto \$REQUIRED_MODULES\"") >&5 - ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES") 2>&5 + { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.9.99.2 xproto \$REQUIRED_MODULES\"") >&5 + ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES" 2>/dev/null` + pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES" 2>/dev/null` else pkg_failed=yes fi @@ -21130,12 +20842,12 @@ if test -n "$PKG_CONFIG"; then pkg_cv_XORG_LIBS="$XORG_LIBS" else if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.3.99.901 xproto \$REQUIRED_MODULES\"") >&5 - ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES") 2>&5 + { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.9.99.2 xproto \$REQUIRED_MODULES\"") >&5 + ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES" 2>/dev/null` + pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES" 2>/dev/null` else pkg_failed=yes fi @@ -21154,14 +20866,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES"` + XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES"` else - XORG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES"` + XORG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES"` fi # Put the nasty error message in config.log where it belongs echo "$XORG_PKG_ERRORS" >&5 - { { $as_echo "$as_me:$LINENO: error: Package requirements (xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES) were not met: + { { $as_echo "$as_me:$LINENO: error: Package requirements (xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES) were not met: $XORG_PKG_ERRORS @@ -21172,7 +20884,7 @@ Alternatively, you may set the environment variables XORG_CFLAGS and XORG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 -$as_echo "$as_me: error: Package requirements (xorg-server >= 1.3.99.901 xproto $REQUIRED_MODULES) were not met: +$as_echo "$as_me: error: Package requirements (xorg-server >= 1.9.99.2 xproto $REQUIRED_MODULES) were not met: $XORG_PKG_ERRORS @@ -21213,21 +20925,66 @@ else $as_echo "yes" >&6; } : fi -XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" -xorg_sdkdir=$(pkg-config --variable=sdkdir xorg-server) + +DRIVER_NAME=joystick + + +# ----------------------------------------------------------------------------- +# Configuration options +# ----------------------------------------------------------------------------- +# Define a configure option for an alternate input module directory + +# 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 + + +# Define a configure option for an alternate X Server SDK Headers +# X Server SDK location is required to install joystick header files # Check whether --with-sdkdir was given. if test "${with_sdkdir+set}" = set; then withval=$with_sdkdir; sdkdir="$withval" else - sdkdir="${xorg_sdkdir}" + sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` +fi + + + +# Define a configure option to enable code debugging +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then + enableval=$enable_debug; DEBUGGING=$enableval +else + DEBUGGING=no fi +if test "x$DEBUGGING" = xyes; then +cat >>confdefs.h <<\_ACEOF +#define DEBUG 1 +_ACEOF + +fi + + +if test "x$DEBUGGING" = xyes; then + DEBUG_TRUE= + DEBUG_FALSE='#' +else + DEBUG_TRUE='#' + DEBUG_FALSE= +fi -# Checks for libraries. -# Checks for header files. +# ----------------------------------------------------------------------------- +# Determine which joystick backend to build +# ----------------------------------------------------------------------------- linux_backend=yes for ac_header in linux/joystick.h @@ -22032,307 +21789,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - -DRIVER_NAME=joystick - - - - - -if test x$APP_MAN_SUFFIX = x ; then - APP_MAN_SUFFIX=1 -fi -if test x$APP_MAN_DIR = x ; then - APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' -fi - -if test x$LIB_MAN_SUFFIX = x ; then - LIB_MAN_SUFFIX=3 -fi -if test x$LIB_MAN_DIR = x ; then - LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' -fi - -if test x$FILE_MAN_SUFFIX = x ; then - case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; - esac -fi -if test x$FILE_MAN_DIR = x ; then - FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' -fi - -if test x$MISC_MAN_SUFFIX = x ; then - case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; - esac -fi -if test x$MISC_MAN_DIR = x ; then - MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' -fi - -if test x$DRIVER_MAN_SUFFIX = x ; then - case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; - esac -fi -if test x$DRIVER_MAN_DIR = x ; then - DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' -fi - -if test x$ADMIN_MAN_SUFFIX = x ; then - case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; - esac -fi -if test x$ADMIN_MAN_DIR = x ; then - ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' -fi - - - - - - - - - - - - - - - - - -# Check whether --with-release-version was given. -if test "${with_release_version+set}" = set; then - withval=$with_release_version; RELEASE_VERSION="$withval" -else - RELEASE_VERSION="" -fi - - if test "x$RELEASE_VERSION" != "x"; then - PACKAGE="$PACKAGE-$RELEASE_VERSION" - PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" - { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 -$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;} - fi - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` -_ACEOF - - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` - if test "x$PVM" = "x"; then - PVM="0" - fi - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION_MINOR $PVM -_ACEOF - - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` - if test "x$PVP" = "x"; then - PVP="0" - fi - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION_PATCHLEVEL $PVP -_ACEOF - - - -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \ -mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" - -distcleancheck_listfiles='find . -type f ! -name ChangeLog -print' - - +# ----------------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile config/Makefile include/Makefile xorg-joystick.pc" @@ -22461,13 +21918,6 @@ $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -22818,7 +22268,7 @@ exec 6>&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-joystick $as_me 1.5.0, which was +This file was extended by xf86-input-joystick $as_me 1.6.0, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22871,7 +22321,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -xf86-input-joystick config.status 1.5.0 +xf86-input-joystick config.status 1.6.0 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -23812,10 +23262,12 @@ $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;} fi -echo -echo Building Linux joystick backend: $linux_backend -echo Building Linux evdev backend: $evdev_backend -echo Building BSD usbhid backend: $bsd_backend +# ----------------------------------------------------------------------------- + +$as_echo +$as_echo "Building Linux joystick backend: $linux_backend" +$as_echo "Building Linux evdev backend: $evdev_backend" +$as_echo "Building BSD usbhid backend: $bsd_backend" if test "x$linux_backend" != "xyes" -a \ "x$bsd_backend" != "xyes" -a \ diff --git a/driver/xf86-input-joystick/configure.ac b/driver/xf86-input-joystick/configure.ac index e0be56885..73afa9a68 100644 --- a/driver/xf86-input-joystick/configure.ac +++ b/driver/xf86-input-joystick/configure.ac @@ -20,70 +20,73 @@ # # Process this file with autoconf to produce a configure script -AC_PREREQ(2.57) +# Initialize Autoconf +AC_PREREQ([2.60]) AC_INIT([xf86-input-joystick], - 1.5.0, + [1.6.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], - xf86-input-joystick) - + [xf86-input-joystick]) AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) -AM_INIT_AUTOMAKE([dist-bzip2]) +# Initialize Automake +AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG -m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.2) -AM_CONFIG_HEADER([config.h]) - -# Checks for programs. +# Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL -AC_PROG_CC -XORG_CWARNFLAGS -AH_TOP([#include "xorg-server.h"]) +# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.8) +XORG_DEFAULT_OPTIONS + +# Checks for extensions +XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) +XORG_DRIVER_CHECK_EXT(XKB, kbproto) + +# Checks for pkg-config packages +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9.99.2] xproto $REQUIRED_MODULES) +DRIVER_NAME=joystick +AC_SUBST([DRIVER_NAME]) + +# ----------------------------------------------------------------------------- +# Configuration options +# ----------------------------------------------------------------------------- +# Define a configure option for an alternate input module directory AC_ARG_WITH(xorg-module-dir, - AC_HELP_STRING([--with-xorg-module-dir=DIR], - [Default xorg module directory - [[default=$libdir/xorg/modules]]]), + AS_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) - -AC_ARG_ENABLE(debug, - AS_HELP_STRING([--enable-debug], - [Enable debugging (default: enabled)]), - [DEBUGGING=$enableval], [DEBUGGING=yes]) -if test "x$DEBUGGING" = xyes; then - AC_DEFINE(DEBUG, 1, [Enable debugging code]) -else - AC_DEFINE(NDEBUG, 1, [Disable some debugging code]) -fi -AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) - inputdir=${moduledir}/input AC_SUBST(inputdir) -# Checks for extensions -XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) -XORG_DRIVER_CHECK_EXT(XKB, kbproto) - -# Checks for pkg-config packages -PKG_CHECK_MODULES(XORG, - [xorg-server >= 1.3.99.901] xproto $REQUIRED_MODULES) -XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" -xorg_sdkdir=$(pkg-config --variable=sdkdir xorg-server) +# Define a configure option for an alternate X Server SDK Headers +# X Server SDK location is required to install joystick header files AC_ARG_WITH(sdkdir, - AC_HELP_STRING([--with-sdkdir=<path>], - [Xorg X Server sdk headers (default is autodetected)]), - [sdkdir="$withval"], [sdkdir="${xorg_sdkdir}"]) + AS_HELP_STRING([--with-sdkdir=<path>], + [Xorg X Server sdk headers (default is autodetected)]), + [sdkdir="$withval"], + [sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`]) AC_SUBST(sdkdir) -# Checks for libraries. +# Define a configure option to enable code debugging +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], + [Enable debugging (default: disabled)]), + [DEBUGGING=$enableval], [DEBUGGING=no]) +if test "x$DEBUGGING" = xyes; then + AC_DEFINE(DEBUG, 1, [Enable debugging code]) +fi +AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) -# Checks for header files. +# ----------------------------------------------------------------------------- +# Determine which joystick backend to build +# ----------------------------------------------------------------------------- linux_backend=yes AC_CHECK_HEADERS([linux/joystick.h],, [linux_backend=no]) AM_CONDITIONAL(LINUX_BACKEND, [test "x$linux_backend" = xyes]) @@ -111,27 +114,22 @@ AM_CONDITIONAL(EVDEV_BACKEND, [test "x$evdev_backend" = xyes]) if test "x$evdev_backend" = xyes; then AC_DEFINE(EVDEV_BACKEND, 1, [Compile Linux evdev backend]) fi - -AC_HEADER_STDC - -DRIVER_NAME=joystick -AC_SUBST([DRIVER_NAME]) - -XORG_MANPAGE_SECTIONS -XORG_RELEASE_VERSION -XORG_CHANGELOG - -AC_OUTPUT([Makefile - src/Makefile - man/Makefile - config/Makefile - include/Makefile - xorg-joystick.pc]) - -echo -echo Building Linux joystick backend: $linux_backend -echo Building Linux evdev backend: $evdev_backend -echo Building BSD usbhid backend: $bsd_backend +# ----------------------------------------------------------------------------- + +AC_CONFIG_FILES([Makefile + src/Makefile + man/Makefile + config/Makefile + include/Makefile + xorg-joystick.pc]) +AC_OUTPUT + +# ----------------------------------------------------------------------------- + +AS_ECHO() +AS_ECHO("Building Linux joystick backend: $linux_backend") +AS_ECHO("Building Linux evdev backend: $evdev_backend") +AS_ECHO("Building BSD usbhid backend: $bsd_backend") if test "x$linux_backend" != "xyes" -a \ "x$bsd_backend" != "xyes" -a \ diff --git a/driver/xf86-input-joystick/include/Makefile.am b/driver/xf86-input-joystick/include/Makefile.am index 21916f730..ed618c228 100644 --- a/driver/xf86-input-joystick/include/Makefile.am +++ b/driver/xf86-input-joystick/include/Makefile.am @@ -18,6 +18,4 @@ # 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. -EXTRA_DIST = joystick-properties.h - sdk_HEADERS = joystick-properties.h diff --git a/driver/xf86-input-joystick/include/Makefile.in b/driver/xf86-input-joystick/include/Makefile.in index a06c7aff3..9a190be8d 100644 --- a/driver/xf86-input-joystick/include/Makefile.in +++ b/driver/xf86-input-joystick/include/Makefile.in @@ -43,9 +43,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -86,6 +86,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -128,6 +129,7 @@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -146,6 +148,7 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ @@ -166,6 +169,7 @@ STRIP = @STRIP@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -186,7 +190,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -216,7 +219,6 @@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -EXTRA_DIST = joystick-properties.h sdk_HEADERS = joystick-properties.h all: all-am @@ -230,9 +232,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile + $(AUTOMAKE) --foreign include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/driver/xf86-input-joystick/man/Makefile.am b/driver/xf86-input-joystick/man/Makefile.am index f0eb29b85..4e045d96b 100644 --- a/driver/xf86-input-joystick/man/Makefile.am +++ b/driver/xf86-input-joystick/man/Makefile.am @@ -1,27 +1,24 @@ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# -# 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. -# -# 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 OPEN GROUP 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 holders 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 holders. +# +# 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 (including the next +# paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. # drivermandir = $(DRIVER_MAN_DIR) @@ -34,25 +31,8 @@ EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) -SED = sed - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|$(prefix)|g' \ - -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ - -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' - SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(DRIVER_MAN_SUFFIX): - sed $(MAN_SUBSTS) < $< > $@ + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff --git a/driver/xf86-input-joystick/man/Makefile.in b/driver/xf86-input-joystick/man/Makefile.in index 332109535..6d20921fb 100644 --- a/driver/xf86-input-joystick/man/Makefile.in +++ b/driver/xf86-input-joystick/man/Makefile.in @@ -16,28 +16,25 @@ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# -# 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. -# -# 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 OPEN GROUP 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 holders 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 holders. +# +# 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 (including the next +# paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. # srcdir = @srcdir@ @@ -49,9 +46,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -89,6 +86,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -131,6 +129,7 @@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -149,6 +148,7 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ @@ -162,13 +162,14 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ -SED = sed +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -189,7 +190,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -224,22 +224,6 @@ driverman_PRE = @DRIVER_NAME@.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ -XORGMANNAME = X Version 11 -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|$(prefix)|g' \ - -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ - -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' - SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man all: all-am @@ -254,9 +238,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu man/Makefile + $(AUTOMAKE) --foreign man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -425,8 +409,9 @@ uninstall-am: uninstall-drivermanDATA uninstall-info-am uninstall-info-am +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(DRIVER_MAN_SUFFIX): - sed $(MAN_SUBSTS) < $< > $@ + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-input-joystick/man/joystick.man b/driver/xf86-input-joystick/man/joystick.man index 97e3ba384..da92ceb45 100644 --- a/driver/xf86-input-joystick/man/joystick.man +++ b/driver/xf86-input-joystick/man/joystick.man @@ -4,14 +4,19 @@ .SH NAME joystick \- Joystick input driver .SH SYNOPSIS +Snipped for xorg.conf.d(5): + .nf -.B "Section \*qInputDevice\*q" -.BI " Identifier \*q" devname \*q -.B " Driver \*qjoystick\*q" -.BI " Option \*qDevice\*q \*q" devpath \*q +.B "Section \*qInputClass\*q" +.BI " Identifier \*q" joystick-all \*q +.BI " Driver \*q" joystick \*q +.BI " Option \*qMatchIsJoystick\*q \*q" on \*q +.BI " Option \*qMatchDevicePath \*q" /dev/input/event* \*q \ \ ... .B EndSection .fi + + .SH DESCRIPTION .B joystick is an __xservername__ input driver for Joysticks. There are 3 backends available that are used in the following order, if support was found: @@ -314,33 +319,21 @@ The keys for the first two axes will be generated in an interval according to th The keys for the third and fourth axis are generated once when the axis moves out of the deadzone and when it moves back into the deadzone. X.Org will autorepeat those keys according to current keyboard settings. .SH "NOTES" -The driver does not do hotplugging on it's own. The joystick needs to be plugged in when the driver is loaded. -If the joystick is unplugged, the device will be automatically deactivated. -.P -There is an example hal policy in +Configuration through +.I InputClass +sections is recommended in X servers 1.8 and later. See xorg.conf.d(5) for more details. An example xorg.conf.d snipped is provided in +.I ${sourcecode}/config/50-joystick-all.conf + +Configuration through hal fdi files is recommended in X servers 1.5, +1.6 and 1.7. An example hal policy file is still provided in .I ${sourcecode}/config/50-x11-input-joystick.fdi -which will take care of hotplugging. Place it in -.I /etc/hal/fdi/policy -and customize it to your needs. Pass custom options to the driver using x11_options properties. This requires xorg-server-1.5 or -higher. -.P -Make sure you add the -.I \*qSendCoreEvents\*q -keyword to the device entry of your -.B ServerLayout -section of the -.I xorg.conf -file, otherwise the device won't report core pointer and core key events. - -Example: -.nf -.BI " InputDevice " "\*qJoystick1\*q \*qSendCoreEvents\*q" -.fi +to be placed in +.IR /etc/hal/fdi/policy . .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorg.conf.d(5), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1) .SH AUTHORS -Sascha Hlusiak (2007-2009), +Sascha Hlusiak (2007-2011), .fi Frederic Lepied (1995-1999) diff --git a/driver/xf86-input-joystick/src/Makefile.am b/driver/xf86-input-joystick/src/Makefile.am index 1f8898eb5..21cdf3235 100644 --- a/driver/xf86-input-joystick/src/Makefile.am +++ b/driver/xf86-input-joystick/src/Makefile.am @@ -24,7 +24,8 @@ # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -AM_CFLAGS = $(XORG_CFLAGS) + +AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) @DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version diff --git a/driver/xf86-input-joystick/src/Makefile.in b/driver/xf86-input-joystick/src/Makefile.in index 254804072..dac59c2f8 100644 --- a/driver/xf86-input-joystick/src/Makefile.in +++ b/driver/xf86-input-joystick/src/Makefile.in @@ -34,6 +34,12 @@ # 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. +# this is obnoxious: +# -module lets us name the module exactly how we want +# -avoid-version prevents gratuitous .0.0.0 version numbers on the end +# _ladir passes a dummy rpath to libtool so the thing will actually link +# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -43,9 +49,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -116,6 +122,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -158,6 +165,7 @@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -176,6 +184,7 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ @@ -196,6 +205,7 @@ STRIP = @STRIP@ VERSION = @VERSION@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -216,7 +226,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -246,13 +255,7 @@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ - -# this is obnoxious: -# -module lets us name the module exactly how we want -# -avoid-version prevents gratuitous .0.0.0 version numbers on the end -# _ladir passes a dummy rpath to libtool so the thing will actually link -# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) @DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version $(am__append_2) @DRIVER_NAME@_drv_ladir = @inputdir@ @@ -278,9 +281,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/driver/xf86-input-joystick/src/backend_bsd.c b/driver/xf86-input-joystick/src/backend_bsd.c index 71f4168dc..c6ce7b4c5 100644 --- a/driver/xf86-input-joystick/src/backend_bsd.c +++ b/driver/xf86-input-joystick/src/backend_bsd.c @@ -30,6 +30,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> diff --git a/driver/xf86-input-joystick/src/backend_evdev.c b/driver/xf86-input-joystick/src/backend_evdev.c index de061d3dc..c506167fd 100644 --- a/driver/xf86-input-joystick/src/backend_evdev.c +++ b/driver/xf86-input-joystick/src/backend_evdev.c @@ -29,6 +29,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> diff --git a/driver/xf86-input-joystick/src/backend_joystick.c b/driver/xf86-input-joystick/src/backend_joystick.c index b69f932c2..e61d90842 100644 --- a/driver/xf86-input-joystick/src/backend_joystick.c +++ b/driver/xf86-input-joystick/src/backend_joystick.c @@ -32,6 +32,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> diff --git a/driver/xf86-input-joystick/src/jstk.c b/driver/xf86-input-joystick/src/jstk.c index a2e927c08..ec6b79ad0 100644 --- a/driver/xf86-input-joystick/src/jstk.c +++ b/driver/xf86-input-joystick/src/jstk.c @@ -26,6 +26,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <stdio.h> #include <xorgVersion.h> @@ -44,9 +45,7 @@ #include "jstk_key.h" #include "jstk_options.h" #include "jstk_properties.h" -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 - #include <xserver-properties.h> -#endif +#include <xserver-properties.h> #ifdef LINUX_BACKEND #include "backend_joystick.h" @@ -63,40 +62,6 @@ char debug_level = 0; #endif - -/* - *************************************************************************** - * - * jstkConvertProc -- - * - * Convert valuators to X and Y. - * - *************************************************************************** - */ - -static Bool -jstkConvertProc(LocalDevicePtr local, - int first, - int num, - int v0, - int v1, - int v2, - int v3, - int v4, - int v5, - int* x, - int* y) -{ - if (first != 0 || num != 2) - return FALSE; - - *x = v0; - *y = v1; - - return TRUE; -} - - /* *************************************************************************** * @@ -147,21 +112,21 @@ jstkOpenDevice(JoystickDevPtr priv, BOOL probe) */ static void -jstkReadProc(LocalDevicePtr local) +jstkReadProc(InputInfoPtr pInfo) { JOYSTICKEVENT event; int number; int i, r; - JoystickDevPtr priv = local->private; + JoystickDevPtr priv = pInfo->private; do { if ((priv->read_proc == NULL) || ((r=priv->read_proc(priv, &event, &number))==0)) { xf86Msg(X_WARNING, "JOYSTICK: Read failed. Deactivating device.\n"); - if (local->fd >= 0) - RemoveEnabledDevice(local->fd); + if (pInfo->fd >= 0) + RemoveEnabledDevice(pInfo->fd); return; } @@ -174,7 +139,7 @@ jstkReadProc(LocalDevicePtr local) switch (priv->button[number].mapping) { case JSTK_MAPPING_BUTTON: if (priv->mouse_enabled == TRUE) { - xf86PostButtonEvent(local->dev, 0, + xf86PostButtonEvent(pInfo->dev, 0, priv->button[number].buttonnumber, priv->button[number].pressed, 0, 0); } @@ -187,7 +152,7 @@ jstkReadProc(LocalDevicePtr local) if (priv->button[number].pressed == 0) priv->button[number].currentspeed = 1.0; else if (priv->mouse_enabled == TRUE) - jstkStartButtonAxisTimer(local, number); + jstkStartButtonAxisTimer(pInfo, number); break; case JSTK_MAPPING_KEY: @@ -258,7 +223,7 @@ jstkReadProc(LocalDevicePtr local) priv->axis[number].mapping)); if (priv->axis[number].valuator != -1) - xf86PostMotionEvent(local->dev, 1, priv->axis[number].valuator, + xf86PostMotionEvent(pInfo->dev, 1, priv->axis[number].valuator, 1, priv->axis[number].value); switch (priv->axis[number].mapping) { @@ -272,12 +237,12 @@ jstkReadProc(LocalDevicePtr local) if (priv->axis[number].value == 0) priv->axis[number].currentspeed = 1.0; if (priv->mouse_enabled == TRUE) - jstkStartAxisTimer(local, number); + jstkStartAxisTimer(pInfo, number); break; case JSTK_TYPE_ABSOLUTE: if (priv->mouse_enabled == TRUE) - jstkHandleAbsoluteAxis(local, number); + jstkHandleAbsoluteAxis(pInfo, number); break; default: break; @@ -286,9 +251,9 @@ jstkReadProc(LocalDevicePtr local) case JSTK_MAPPING_KEY: if (priv->keys_enabled == TRUE) { if (priv->axis[number].type == JSTK_TYPE_ACCELERATED) { - jstkHandlePWMAxis(local, number); + jstkHandlePWMAxis(pInfo, number); } else if (priv->axis[number].type == JSTK_TYPE_BYVALUE) { - jstkStartAxisTimer(local, number); + jstkStartAxisTimer(pInfo, number); } break; } @@ -327,12 +292,10 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, int what) { int i; - LocalDevicePtr local = (LocalDevicePtr)pJstk->public.devicePrivate; - JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(pJstk); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + InputInfoPtr pInfo = (InputInfoPtr)pJstk->public.devicePrivate; + JoystickDevPtr priv = pInfo->private; Atom btn_labels[BUTTONMAP_SIZE+1] = {0}; /* TODO: fillme */ Atom axes_labels[MAXAXES] = {0}; /* TODO: fillme */ -#endif switch (what) { case DEVICE_INIT: { @@ -355,9 +318,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 btn_labels, -#endif buttonmap) == FALSE) { ErrorF("unable to allocate Button class device\n"); return !Success; @@ -373,71 +334,48 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, priv->axis[i].valuator = m++; } - if (InitValuatorClassDeviceStruct(pJstk, - m, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 - axes_labels, -#endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 - xf86GetMotionEvents, -#endif - local->history_size, + if (InitValuatorClassDeviceStruct(pJstk, m, axes_labels, + GetMotionHistorySize(), Relative) == FALSE) { ErrorF("unable to allocate Valuator class device\n"); return !Success; } else { InitValuatorAxisStruct(pJstk, 0, /* valuator num */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_REL_X), -#endif 0, /* min val */ screenInfo.screens[0]->width, /* max val */ 1, /* resolution */ 0, /* min_res */ - 1); /* max_res */ + 1, /* max_res */ + Absolute); InitValuatorAxisStruct(pJstk, 1, /* valuator num */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y), -#endif 0, /* min val */ screenInfo.screens[0]->height, /* max val */ 1, /* resolution */ 0, /* min_res */ - 1); /* max_res */ + 1, /* max_res */ + Absolute); for (i=0; i<MAXAXES; i++) if (priv->axis[i].valuator != -1) { InitValuatorAxisStruct(pJstk, priv->axis[i].valuator, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 axes_labels[i], -#endif -32768, /* min val */ 32767, /* max val */ 1, /* resolution */ 0, /* min_res */ - 1); /* max_res */ + 1, /* max_res */ + Absolute); } /* allocate the motion history buffer if needed */ - xf86MotionHistoryAllocate(local); + xf86MotionHistoryAllocate(pInfo); } - - if (priv->keyboard_device != NULL) - { - DBG(2, ErrorF("Activating keyboard device\n")); - xf86ActivateDevice(priv->keyboard_device); - priv->keyboard_device->dev->inited = - (priv->keyboard_device->device_control(priv->keyboard_device->dev, DEVICE_INIT) == Success); - xf86EnableDevice(priv->keyboard_device->dev); - DBG(2, ErrorF("Keyboard device activated\n")); - } - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 jstkInitProperties(pJstk, priv); -#endif break; } @@ -448,8 +386,8 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, if (jstkOpenDevice(priv, FALSE) != -1) { pJstk->public.on = TRUE; - local->fd = priv->fd; - AddEnabledDevice(local->fd); + pInfo->fd = priv->fd; + AddEnabledDevice(pInfo->fd); } else return !Success; break; @@ -471,9 +409,9 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, TimerCancel(priv->axis[i].timer); } - if (local->fd >= 0) - RemoveEnabledDevice(local->fd); - local->fd = -1; + if (pInfo->fd >= 0) + RemoveEnabledDevice(pInfo->fd); + pInfo->fd = -1; if (priv->close_proc) priv->close_proc(priv); pJstk->public.on = FALSE; @@ -487,19 +425,6 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, return Success; } - - - -_X_EXPORT InputDriverRec JSTK_KEYBOARD = { - 1, - "joystick_keyboard", - NULL, - jstkKeyboardPreInit, - jstkKeyboardUnInit, - NULL, - 0 -}; - /* *************************************************************************** * @@ -507,41 +432,41 @@ _X_EXPORT InputDriverRec JSTK_KEYBOARD = { * * Called when a device will be instantiated * + * This is a tad complicated. NewInputDeviceRequest(), which we use to + * hotplug a keyboard device,. enables the device, so we need to make sure + * that all options for the dependent device are set correctly. + * + * This means that we parse the keyboard-specific options into the + * keyboard device's PreInit, and re-use the keyboard's priv field. + * *************************************************************************** */ -static InputInfoPtr -jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) +static int +jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { - LocalDevicePtr local = NULL; + InputInfoPtr keyboard_device; JoystickDevPtr priv = NULL; char *s; int i, j; - local = xf86AllocateInput(drv, 0); - if (!local) { - goto SetupProc_fail; - } + s = xf86CheckStrOption(pInfo->options, "_source", ""); + if (strcmp(s, "_driver/joystick") == 0) + return jstkKeyboardPreInit(drv, pInfo, flags); + + pInfo->device_control = jstkDeviceControlProc; + pInfo->read_input = jstkReadProc; + pInfo->control_proc = NULL; + pInfo->switch_mode = NULL; + pInfo->fd = -1; + pInfo->dev = NULL; + pInfo->type_name = XI_JOYSTICK; + + keyboard_device = jstkKeyboardHotplug(pInfo, flags); + if (!keyboard_device) + return BadAlloc; - local->private = (JoystickDevPtr)xalloc(sizeof(JoystickDevRec)); - priv = (JoystickDevPtr)local->private; - - local->name = dev->identifier; - local->flags = XI86_POINTER_CAPABLE; - local->flags |= XI86_SEND_DRAG_EVENTS; - local->device_control = jstkDeviceControlProc; - local->read_input = jstkReadProc; - local->close_proc = NULL; - local->control_proc = NULL; - local->switch_mode = NULL; - local->conversion_proc = jstkConvertProc; - local->fd = -1; - local->dev = NULL; - local->private = priv; - local->type_name = XI_JOYSTICK; - local->history_size = 0; - local->always_core_feedback = NULL; - local->conf_idev = dev; + pInfo->private = priv = keyboard_device->private; priv->fd = -1; priv->open_proc = NULL; @@ -554,9 +479,7 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) priv->mouse_enabled = TRUE; priv->keys_enabled = TRUE; priv->amplify = 1.0f; - priv->keyboard_device = NULL; - priv->repeat_delay = 0; - priv->repeat_interval = 0; + priv->keyboard_device = keyboard_device; priv->num_axes = MAXAXES; priv->num_buttons = MAXBUTTONS; @@ -614,81 +537,39 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) priv->axis[5].type = JSTK_TYPE_ACCELERATED; priv->axis[5].mapping = JSTK_MAPPING_Y; - xf86CollectInputOptions(local, NULL, NULL); - xf86OptionListReport(local->options); - /* Joystick device is mandatory */ - priv->device = xf86SetStrOption(dev->commonOptions, "Device", NULL); + priv->device = xf86SetStrOption(pInfo->options, "Device", NULL); if (!priv->device) - priv->device = xf86SetStrOption(dev->commonOptions, "Path", NULL); + priv->device = xf86SetStrOption(pInfo->options, "Path", NULL); if (!priv->device) { - xf86Msg (X_ERROR, "%s: No Device specified.\n", local->name); + xf86Msg (X_ERROR, "%s: No Device specified.\n", pInfo->name); goto SetupProc_fail; } - xf86ProcessCommonOptions(local, local->options); - #if DEBUG - debug_level = xf86SetIntOption(dev->commonOptions, "DebugLevel", 0); + debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", 0); if (debug_level > 0) { xf86Msg(X_CONFIG, "%s: debug level set to %d\n", - local->name, debug_level); + pInfo->name, debug_level); } #else - if (xf86SetIntOption(dev->commonOptions, "DebugLevel", 0) != 0) { + if (xf86SetIntOption(pInfo->options, "DebugLevel", 0) != 0) { xf86Msg(X_WARNING, "%s: DebugLevel: Compiled without debugging support!\n", - local->name); + pInfo->name); } #endif - /* Parse option for autorepeat */ - if ((s = xf86SetStrOption(dev->commonOptions, "AutoRepeat", NULL))) { - int delay, rate; - if (sscanf(s, "%d %d", &delay, &rate) != 2) { - xf86Msg(X_ERROR, "%s: \"%s\" is not a valid AutoRepeat value", - local->name, s); - } else { - priv->repeat_delay = delay; - if (rate != 0) - priv->repeat_interval = 1000/rate; - else priv->repeat_interval = 0; - DBG(1, xf86Msg(X_CONFIG, "Autorepeat set to delay=%d, interval=%d\n", - priv->repeat_delay,priv->repeat_interval)); - } - xfree(s); - } - - priv->rmlvo.rules = xf86SetStrOption(dev->commonOptions, "xkb_rules", NULL); - if (!priv->rmlvo.rules) - priv->rmlvo.rules = xf86SetStrOption(dev->commonOptions, "XkbRules", "evdev"); - - priv->rmlvo.model = xf86SetStrOption(dev->commonOptions, "xkb_model", NULL); - if (!priv->rmlvo.model) - priv->rmlvo.model = xf86SetStrOption(dev->commonOptions, "XkbModel", "evdev"); - - priv->rmlvo.layout = xf86SetStrOption(dev->commonOptions, "xkb_layout", NULL); - if (!priv->rmlvo.layout) - priv->rmlvo.layout = xf86SetStrOption(dev->commonOptions, "XkbLayout", "us"); - - priv->rmlvo.variant = xf86SetStrOption(dev->commonOptions, "xkb_variant", NULL); - if (!priv->rmlvo.variant) - priv->rmlvo.variant = xf86SetStrOption(dev->commonOptions, "XkbVariant", ""); - - priv->rmlvo.options = xf86SetStrOption(dev->commonOptions, "xkb_options", NULL); - if (!priv->rmlvo.options) - priv->rmlvo.options = xf86SetStrOption(dev->commonOptions, "XkbOptions", ""); - - priv->mouse_enabled = xf86SetBoolOption(dev->commonOptions, "StartMouseEnabled", TRUE); - priv->keys_enabled = xf86SetBoolOption(dev->commonOptions, "StartKeysEnabled", TRUE); + priv->mouse_enabled = xf86SetBoolOption(pInfo->options, "StartMouseEnabled", TRUE); + priv->keys_enabled = xf86SetBoolOption(pInfo->options, "StartKeysEnabled", TRUE); /* Process button mapping options */ for (i=0; i<MAXBUTTONS; i++) { char p[64]; sprintf(p,"MapButton%d",i+1); - s = xf86SetStrOption(dev->commonOptions, p, NULL); + s = xf86SetStrOption(pInfo->options, p, NULL); if (s != NULL) { - jstkParseButtonOption(s, priv, i, local->name); + jstkParseButtonOption(s, priv, i, pInfo->name); } DBG(1, xf86Msg(X_CONFIG, "Button %d mapped to %d\n", i+1, priv->button[i].mapping)); @@ -698,9 +579,9 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) for (i=0; i<MAXAXES; i++) { char p[64]; sprintf(p,"MapAxis%d",i+1); - s = xf86SetStrOption(dev->commonOptions, p, NULL); + s = xf86SetStrOption(pInfo->options, p, NULL); if (s != NULL) { - jstkParseAxisOption(s, priv, &priv->axis[i], local->name); + jstkParseAxisOption(s, priv, &priv->axis[i], pInfo->name); } DBG(1, xf86Msg(X_CONFIG, "Axis %d type is %d, mapped to %d, amplify=%.3f\n", i+1, @@ -709,23 +590,17 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) priv->axis[i].amplify)); } - /* return the LocalDevice */ - local->flags |= XI86_CONFIGURED; - - priv->keyboard_device = jstkKeyboardPreInit(&JSTK_KEYBOARD, dev, flags); - if (priv->keyboard_device) { - priv->keyboard_device->private = priv; - } - - return (local); + return Success; SetupProc_fail: - if (priv) - xfree(priv); - if (local) - local->private = NULL; - return NULL; -/* return (local); */ /* Makes X segfault on error */ + if (priv) { + free(priv); + if (keyboard_device) + keyboard_device->private = NULL; + } + if (pInfo) + pInfo->private = NULL; + return BadValue; } @@ -736,26 +611,39 @@ SetupProc_fail: * jstkCoreUnInit -- * * Called when a device is unplugged and needs to be removed + * This is a bit tricky, because the keyboard device and the main device + * share the same private data, which must be freed only once, which is done + * by the main device. + * * *************************************************************************** */ static void jstkCoreUnInit(InputDriverPtr drv, - LocalDevicePtr local, + InputInfoPtr pInfo, int flags) { - JoystickDevPtr device = (JoystickDevPtr) local->private; - - if (device->keyboard_device != NULL) - { - xf86DisableDevice(device->keyboard_device->dev, TRUE); - device->keyboard_device = NULL; + if (pInfo->private) { + JoystickDevPtr priv = (JoystickDevPtr) pInfo->private; + if (priv->keyboard_device == pInfo) { + /* this is the keyboard device */ + /* Unlink from private data to notify that the + * keyboard device is no more, but don't free */ + priv->keyboard_device = NULL; + } else { + /* freeing main device + if keyboard still exists, notify keyboard device that it's + private data is gone */ + if (priv->keyboard_device) + priv->keyboard_device->private = NULL; + + free (priv); + } } - xfree (device); - local->private = NULL; - xf86DeleteInput(local, 0); + pInfo->private = NULL; + xf86DeleteInput(pInfo, 0); } @@ -767,11 +655,9 @@ _X_EXPORT InputDriverRec JOYSTICK = { NULL, jstkCorePreInit, jstkCoreUnInit, - NULL, - 0 + NULL }; - /* *************************************************************************** * @@ -789,7 +675,6 @@ jstkDriverPlug(pointer module, int *errmin) { xf86AddInputDriver(&JOYSTICK, module, 0); - xf86AddInputDriver(&JSTK_KEYBOARD, module, 0); return module; } diff --git a/driver/xf86-input-joystick/src/jstk.h b/driver/xf86-input-joystick/src/jstk.h index 78a1f83cf..ed5e4a7ba 100644 --- a/driver/xf86-input-joystick/src/jstk.h +++ b/driver/xf86-input-joystick/src/jstk.h @@ -55,17 +55,6 @@ #define XI_JOYSTICK "JOYSTICK" #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5 -typedef struct { - char *rules; - char *model; - char *layout; - char *variant; - char *options; -} XkbRMLVOSet; -#endif - - typedef enum _JOYSTICKEVENT { EVENT_NONE=0, @@ -117,7 +106,7 @@ typedef struct _JoystickDevRec { jstkReadDataProc read_proc; /* Callback for reading data from the backend */ void *devicedata; /* Extra platform device dependend data */ char *device; /* Name of the device */ - LocalDevicePtr keyboard_device; /* Slave device for keyboard events */ + InputInfoPtr keyboard_device; /* Slave device for keyboard events */ OsTimerPtr timer; /* Timer for axis movement */ Bool timerrunning; diff --git a/driver/xf86-input-joystick/src/jstk_axis.c b/driver/xf86-input-joystick/src/jstk_axis.c index b31412270..95ebfe974 100644 --- a/driver/xf86-input-joystick/src/jstk_axis.c +++ b/driver/xf86-input-joystick/src/jstk_axis.c @@ -27,6 +27,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <xf86Xinput.h> #include <xf86_OSproc.h> #include <math.h> @@ -55,7 +56,8 @@ jstkAxisTimer(OsTimerPtr timer, { #define NEXTTIMER 15 DeviceIntPtr device = (DeviceIntPtr)arg; - JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(device); + InputInfoPtr pInfo = device->public.devicePrivate; + JoystickDevPtr priv = pInfo->private; int sigstate, i; int nexttimer; @@ -266,7 +268,7 @@ jstkAxisTimer(OsTimerPtr timer, *********************************************************************** */ void -jstkStartAxisTimer(LocalDevicePtr device, int number) +jstkStartAxisTimer(InputInfoPtr device, int number) { int pixel; JoystickDevPtr priv = device->private; @@ -298,7 +300,7 @@ jstkStartAxisTimer(LocalDevicePtr device, int number) */ void -jstkStartButtonAxisTimer(LocalDevicePtr device, int number) +jstkStartButtonAxisTimer(InputInfoPtr device, int number) { int pixel; JoystickDevPtr priv = device->private; @@ -338,7 +340,7 @@ jstkStartButtonAxisTimer(LocalDevicePtr device, int number) *********************************************************************** */ void -jstkHandleAbsoluteAxis(LocalDevicePtr device, int number) +jstkHandleAbsoluteAxis(InputInfoPtr device, int number) { JoystickDevPtr priv = device->private; int i,x,y; @@ -406,7 +408,8 @@ jstkPWMAxisTimer(OsTimerPtr timer, pointer arg) { DeviceIntPtr device = (DeviceIntPtr)arg; - JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(device); + InputInfoPtr pInfo = device->public.devicePrivate; + JoystickDevPtr priv = pInfo->private; int sigstate, i; int nexttimer; @@ -535,7 +538,7 @@ jstkPWMAxisTimer(OsTimerPtr timer, *********************************************************************** */ void -jstkHandlePWMAxis(LocalDevicePtr device, int number) +jstkHandlePWMAxis(InputInfoPtr device, int number) { JoystickDevPtr priv = device->private; if (priv->axis[number].timerrunning) return; diff --git a/driver/xf86-input-joystick/src/jstk_axis.h b/driver/xf86-input-joystick/src/jstk_axis.h index 028c65fc0..0d672dbcf 100644 --- a/driver/xf86-input-joystick/src/jstk_axis.h +++ b/driver/xf86-input-joystick/src/jstk_axis.h @@ -24,9 +24,9 @@ #ifndef _XF86JSTK_AXIS_H_INCLUDED_ #define _XF86JSTK_AXIS_H_INCLUDED_ -void jstkStartAxisTimer(LocalDevicePtr device, int number); -void jstkStartButtonAxisTimer(LocalDevicePtr device, int number); -void jstkHandleAbsoluteAxis(LocalDevicePtr device, int number); -void jstkHandlePWMAxis(LocalDevicePtr device, int number); +void jstkStartAxisTimer(InputInfoPtr device, int number); +void jstkStartButtonAxisTimer(InputInfoPtr device, int number); +void jstkHandleAbsoluteAxis(InputInfoPtr device, int number); +void jstkHandlePWMAxis(InputInfoPtr device, int number); #endif diff --git a/driver/xf86-input-joystick/src/jstk_key.c b/driver/xf86-input-joystick/src/jstk_key.c index fb1f52e4a..3c471ce97 100644 --- a/driver/xf86-input-joystick/src/jstk_key.c +++ b/driver/xf86-input-joystick/src/jstk_key.c @@ -28,6 +28,7 @@ #endif +#include <xorg-server.h> #include <xf86.h> #include <xf86Xinput.h> #include <X11/extensions/XKBsrv.h> @@ -38,9 +39,7 @@ #include "jstk.h" #include "jstk_key.h" -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5 #include <xkbsrv.h> -#endif #define MIN_KEYCODE 8 #define GLYPHS_PER_KEY 2 @@ -51,280 +50,6 @@ #define KanaMask Mod4Mask #define ScrollLockMask Mod5Mask - - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5 -static KeySym map[] = { - /* 0x00 */ NoSymbol, NoSymbol, - /* 0x01 */ XK_Escape, NoSymbol, - /* 0x02 */ XK_1, XK_exclam, - /* 0x03 */ XK_2, XK_at, - /* 0x04 */ XK_3, XK_numbersign, - /* 0x05 */ XK_4, XK_dollar, - /* 0x06 */ XK_5, XK_percent, - /* 0x07 */ XK_6, XK_asciicircum, - /* 0x08 */ XK_7, XK_ampersand, - /* 0x09 */ XK_8, XK_asterisk, - /* 0x0a */ XK_9, XK_parenleft, - /* 0x0b */ XK_0, XK_parenright, - /* 0x0c */ XK_minus, XK_underscore, - /* 0x0d */ XK_equal, XK_plus, - /* 0x0e */ XK_BackSpace, NoSymbol, - /* 0x0f */ XK_Tab, XK_ISO_Left_Tab, - /* 0x10 */ XK_Q, NoSymbol, - /* 0x11 */ XK_W, NoSymbol, - /* 0x12 */ XK_E, NoSymbol, - /* 0x13 */ XK_R, NoSymbol, - /* 0x14 */ XK_T, NoSymbol, - /* 0x15 */ XK_Y, NoSymbol, - /* 0x16 */ XK_U, NoSymbol, - /* 0x17 */ XK_I, NoSymbol, - /* 0x18 */ XK_O, NoSymbol, - /* 0x19 */ XK_P, NoSymbol, - /* 0x1a */ XK_bracketleft, XK_braceleft, - /* 0x1b */ XK_bracketright,XK_braceright, - /* 0x1c */ XK_Return, NoSymbol, - /* 0x1d */ XK_Control_L, NoSymbol, - /* 0x1e */ XK_A, NoSymbol, - /* 0x1f */ XK_S, NoSymbol, - /* 0x20 */ XK_D, NoSymbol, - /* 0x21 */ XK_F, NoSymbol, - /* 0x22 */ XK_G, NoSymbol, - /* 0x23 */ XK_H, NoSymbol, - /* 0x24 */ XK_J, NoSymbol, - /* 0x25 */ XK_K, NoSymbol, - /* 0x26 */ XK_L, NoSymbol, - /* 0x27 */ XK_semicolon, XK_colon, - /* 0x28 */ XK_quoteright, XK_quotedbl, - /* 0x29 */ XK_quoteleft, XK_asciitilde, - /* 0x2a */ XK_Shift_L, NoSymbol, - /* 0x2b */ XK_backslash, XK_bar, - /* 0x2c */ XK_Z, NoSymbol, - /* 0x2d */ XK_X, NoSymbol, - /* 0x2e */ XK_C, NoSymbol, - /* 0x2f */ XK_V, NoSymbol, - /* 0x30 */ XK_B, NoSymbol, - /* 0x31 */ XK_N, NoSymbol, - /* 0x32 */ XK_M, NoSymbol, - /* 0x33 */ XK_comma, XK_less, - /* 0x34 */ XK_period, XK_greater, - /* 0x35 */ XK_slash, XK_question, - /* 0x36 */ XK_Shift_R, NoSymbol, - /* 0x37 */ XK_KP_Multiply, NoSymbol, - /* 0x38 */ XK_Alt_L, XK_Meta_L, - /* 0x39 */ XK_space, NoSymbol, - /* 0x3a */ XK_Caps_Lock, NoSymbol, - /* 0x3b */ XK_F1, NoSymbol, - /* 0x3c */ XK_F2, NoSymbol, - /* 0x3d */ XK_F3, NoSymbol, - /* 0x3e */ XK_F4, NoSymbol, - /* 0x3f */ XK_F5, NoSymbol, - /* 0x40 */ XK_F6, NoSymbol, - /* 0x41 */ XK_F7, NoSymbol, - /* 0x42 */ XK_F8, NoSymbol, - /* 0x43 */ XK_F9, NoSymbol, - /* 0x44 */ XK_F10, NoSymbol, - /* 0x45 */ XK_Num_Lock, NoSymbol, - /* 0x46 */ XK_Scroll_Lock, NoSymbol, - /* These KP keys should have the KP_7 keysyms in the numlock - * modifer... ? */ - /* 0x47 */ XK_KP_Home, XK_KP_7, - /* 0x48 */ XK_KP_Up, XK_KP_8, - /* 0x49 */ XK_KP_Prior, XK_KP_9, - /* 0x4a */ XK_KP_Subtract, NoSymbol, - /* 0x4b */ XK_KP_Left, XK_KP_4, - /* 0x4c */ XK_KP_Begin, XK_KP_5, - /* 0x4d */ XK_KP_Right, XK_KP_6, - /* 0x4e */ XK_KP_Add, NoSymbol, - /* 0x4f */ XK_KP_End, XK_KP_1, - /* 0x50 */ XK_KP_Down, XK_KP_2, - /* 0x51 */ XK_KP_Next, XK_KP_3, - /* 0x52 */ XK_KP_Insert, XK_KP_0, - /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, - /* 0x54 */ NoSymbol, NoSymbol, - /* 0x55 */ XK_F13, NoSymbol, - /* 0x56 */ XK_less, XK_greater, - /* 0x57 */ XK_F11, NoSymbol, - /* 0x58 */ XK_F12, NoSymbol, - /* 0x59 */ XK_F14, NoSymbol, - /* 0x5a */ XK_F15, NoSymbol, - /* 0x5b */ XK_F16, NoSymbol, - /* 0x5c */ XK_F17, NoSymbol, - /* 0x5d */ XK_F18, NoSymbol, - /* 0x5e */ XK_F19, NoSymbol, - /* 0x5f */ XK_F20, NoSymbol, - /* 0x60 */ XK_KP_Enter, NoSymbol, - /* 0x61 */ XK_Control_R, NoSymbol, - /* 0x62 */ XK_KP_Divide, NoSymbol, - /* 0x63 */ XK_Print, XK_Sys_Req, - /* 0x64 */ XK_Alt_R, XK_Meta_R, - /* 0x65 */ NoSymbol, NoSymbol, /* KEY_LINEFEED */ - /* 0x66 */ XK_Home, NoSymbol, - /* 0x67 */ XK_Up, NoSymbol, - /* 0x68 */ XK_Prior, NoSymbol, - /* 0x69 */ XK_Left, NoSymbol, - /* 0x6a */ XK_Right, NoSymbol, - /* 0x6b */ XK_End, NoSymbol, - /* 0x6c */ XK_Down, NoSymbol, - /* 0x6d */ XK_Next, NoSymbol, - /* 0x6e */ XK_Insert, NoSymbol, - /* 0x6f */ XK_Delete, NoSymbol, - /* 0x70 */ NoSymbol, NoSymbol, /* KEY_MACRO */ - /* 0x71 */ NoSymbol, NoSymbol, - /* 0x72 */ NoSymbol, NoSymbol, - /* 0x73 */ NoSymbol, NoSymbol, - /* 0x74 */ NoSymbol, NoSymbol, - /* 0x75 */ XK_KP_Equal, NoSymbol, - /* 0x76 */ NoSymbol, NoSymbol, - /* 0x77 */ NoSymbol, NoSymbol, - /* 0x78 */ XK_F21, NoSymbol, - /* 0x79 */ XK_F22, NoSymbol, - /* 0x7a */ XK_F23, NoSymbol, - /* 0x7b */ XK_F24, NoSymbol, - /* 0x7c */ XK_KP_Separator, NoSymbol, - /* 0x7d */ XK_Meta_L, NoSymbol, - /* 0x7e */ XK_Meta_R, NoSymbol, - /* 0x7f */ XK_Multi_key, NoSymbol, - /* 0x80 */ NoSymbol, NoSymbol, - /* 0x81 */ NoSymbol, NoSymbol, - /* 0x82 */ NoSymbol, NoSymbol, - /* 0x83 */ NoSymbol, NoSymbol, - /* 0x84 */ NoSymbol, NoSymbol, - /* 0x85 */ NoSymbol, NoSymbol, - /* 0x86 */ NoSymbol, NoSymbol, - /* 0x87 */ NoSymbol, NoSymbol, - /* 0x88 */ NoSymbol, NoSymbol, - /* 0x89 */ NoSymbol, NoSymbol, - /* 0x8a */ NoSymbol, NoSymbol, - /* 0x8b */ NoSymbol, NoSymbol, - /* 0x8c */ NoSymbol, NoSymbol, - /* 0x8d */ NoSymbol, NoSymbol, - /* 0x8e */ NoSymbol, NoSymbol, - /* 0x8f */ NoSymbol, NoSymbol, - /* 0x90 */ NoSymbol, NoSymbol, - /* 0x91 */ NoSymbol, NoSymbol, - /* 0x92 */ NoSymbol, NoSymbol, - /* 0x93 */ NoSymbol, NoSymbol, - /* 0x94 */ NoSymbol, NoSymbol, - /* 0x95 */ NoSymbol, NoSymbol, - /* 0x96 */ NoSymbol, NoSymbol, - /* 0x97 */ NoSymbol, NoSymbol, - /* 0x98 */ NoSymbol, NoSymbol, - /* 0x99 */ NoSymbol, NoSymbol, - /* 0x9a */ NoSymbol, NoSymbol, - /* 0x9b */ NoSymbol, NoSymbol, - /* 0x9c */ NoSymbol, NoSymbol, - /* 0x9d */ NoSymbol, NoSymbol, - /* 0x9e */ NoSymbol, NoSymbol, - /* 0x9f */ NoSymbol, NoSymbol, - /* 0xa0 */ NoSymbol, NoSymbol, - /* 0xa1 */ NoSymbol, NoSymbol, - /* 0xa2 */ NoSymbol, NoSymbol, - /* 0xa3 */ NoSymbol, NoSymbol, - /* 0xa4 */ NoSymbol, NoSymbol, - /* 0xa5 */ NoSymbol, NoSymbol, - /* 0xa6 */ NoSymbol, NoSymbol, - /* 0xa7 */ NoSymbol, NoSymbol, - /* 0xa8 */ NoSymbol, NoSymbol, - /* 0xa9 */ NoSymbol, NoSymbol, - /* 0xaa */ NoSymbol, NoSymbol, - /* 0xab */ NoSymbol, NoSymbol, - /* 0xac */ NoSymbol, NoSymbol, - /* 0xad */ NoSymbol, NoSymbol, - /* 0xae */ NoSymbol, NoSymbol, - /* 0xaf */ NoSymbol, NoSymbol, - /* 0xb0 */ NoSymbol, NoSymbol, - /* 0xb1 */ NoSymbol, NoSymbol, - /* 0xb2 */ NoSymbol, NoSymbol, - /* 0xb3 */ NoSymbol, NoSymbol, - /* 0xb4 */ NoSymbol, NoSymbol, - /* 0xb5 */ NoSymbol, NoSymbol, - /* 0xb6 */ NoSymbol, NoSymbol, - /* 0xb7 */ NoSymbol, NoSymbol, - /* 0xb8 */ NoSymbol, NoSymbol, - /* 0xb9 */ NoSymbol, NoSymbol, - /* 0xba */ NoSymbol, NoSymbol, - /* 0xbb */ NoSymbol, NoSymbol, - /* 0xbc */ NoSymbol, NoSymbol, - /* 0xbd */ NoSymbol, NoSymbol, - /* 0xbe */ NoSymbol, NoSymbol, - /* 0xbf */ NoSymbol, NoSymbol, - /* 0xc0 */ NoSymbol, NoSymbol, - /* 0xc1 */ NoSymbol, NoSymbol, - /* 0xc2 */ NoSymbol, NoSymbol, - /* 0xc3 */ NoSymbol, NoSymbol, - /* 0xc4 */ NoSymbol, NoSymbol, - /* 0xc5 */ NoSymbol, NoSymbol, - /* 0xc6 */ NoSymbol, NoSymbol, - /* 0xc7 */ NoSymbol, NoSymbol, - /* 0xc8 */ NoSymbol, NoSymbol, - /* 0xc9 */ NoSymbol, NoSymbol, - /* 0xca */ NoSymbol, NoSymbol, - /* 0xcb */ NoSymbol, NoSymbol, - /* 0xcc */ NoSymbol, NoSymbol, - /* 0xcd */ NoSymbol, NoSymbol, - /* 0xce */ NoSymbol, NoSymbol, - /* 0xcf */ NoSymbol, NoSymbol, - /* 0xd0 */ NoSymbol, NoSymbol, - /* 0xd1 */ NoSymbol, NoSymbol, - /* 0xd2 */ NoSymbol, NoSymbol, - /* 0xd3 */ NoSymbol, NoSymbol, - /* 0xd4 */ NoSymbol, NoSymbol, - /* 0xd5 */ NoSymbol, NoSymbol, - /* 0xd6 */ NoSymbol, NoSymbol, - /* 0xd7 */ NoSymbol, NoSymbol, - /* 0xd8 */ NoSymbol, NoSymbol, - /* 0xd9 */ NoSymbol, NoSymbol, - /* 0xda */ NoSymbol, NoSymbol, - /* 0xdb */ NoSymbol, NoSymbol, - /* 0xdc */ NoSymbol, NoSymbol, - /* 0xdd */ NoSymbol, NoSymbol, - /* 0xde */ NoSymbol, NoSymbol, - /* 0xdf */ NoSymbol, NoSymbol, - /* 0xe0 */ NoSymbol, NoSymbol, - /* 0xe1 */ NoSymbol, NoSymbol, - /* 0xe2 */ NoSymbol, NoSymbol, - /* 0xe3 */ NoSymbol, NoSymbol, - /* 0xe4 */ NoSymbol, NoSymbol, - /* 0xe5 */ NoSymbol, NoSymbol, - /* 0xe6 */ NoSymbol, NoSymbol, - /* 0xe7 */ NoSymbol, NoSymbol, - /* 0xe8 */ NoSymbol, NoSymbol, - /* 0xe9 */ NoSymbol, NoSymbol, - /* 0xea */ NoSymbol, NoSymbol, - /* 0xeb */ NoSymbol, NoSymbol, - /* 0xec */ NoSymbol, NoSymbol, - /* 0xed */ NoSymbol, NoSymbol, - /* 0xee */ NoSymbol, NoSymbol, - /* 0xef */ NoSymbol, NoSymbol, - /* 0xf0 */ NoSymbol, NoSymbol, - /* 0xf1 */ NoSymbol, NoSymbol, - /* 0xf2 */ NoSymbol, NoSymbol, - /* 0xf3 */ NoSymbol, NoSymbol, - /* 0xf4 */ NoSymbol, NoSymbol, - /* 0xf5 */ NoSymbol, NoSymbol, - /* 0xf6 */ NoSymbol, NoSymbol, - /* 0xf7 */ NoSymbol, NoSymbol, -}; - -static struct { KeySym keysym; CARD8 mask; } modifiers[] = { - { XK_Shift_L, ShiftMask }, - { XK_Shift_R, ShiftMask }, - { XK_Control_L, ControlMask }, - { XK_Control_R, ControlMask }, - { XK_Caps_Lock, LockMask }, - { XK_Alt_L, AltMask }, - { XK_Alt_R, AltMask }, - { XK_Meta_L, Mod4Mask }, - { XK_Meta_R, Mod4Mask }, - { XK_Num_Lock, NumLockMask }, - { XK_Scroll_Lock, ScrollLockMask }, - { XK_Mode_switch, AltLangMask } -}; -#endif - - - static void jstkKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl) { @@ -346,46 +71,11 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv) XkbSrvInfoPtr xkbi; XkbControlsPtr ctrls; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5 + if (!InitKeyboardDeviceStruct(pJstk, &priv->rmlvo, NULL, jstkKbdCtrl)) { - if (!InitKeyboardDeviceStruct(pJstk, &priv->rmlvo, NULL, jstkKbdCtrl)) - { - ErrorF("unable to init keyboard device\n"); - return !Success; - } - } -#else - KeySymsRec keySyms; - CARD8 modMap[MAP_LENGTH]; - KeySym sym; - int i, j; - XkbComponentNamesRec xkbnames; - - memset(modMap, 0, sizeof(modMap)); - memset(&xkbnames, 0, sizeof(xkbnames)); - - keySyms.map = map; - keySyms.mapWidth = GLYPHS_PER_KEY; - keySyms.minKeyCode = MIN_KEYCODE; - keySyms.maxKeyCode = MIN_KEYCODE + (sizeof(map) / sizeof(map[0])) / GLYPHS_PER_KEY - 1; - - for (i = 0; i < (sizeof(map) / sizeof(map[0])) / GLYPHS_PER_KEY; i++) { - sym = map[i * GLYPHS_PER_KEY]; - for (j = 0; j < sizeof(modifiers)/sizeof(modifiers[0]); j++) { - if (modifiers[j].keysym == sym) - modMap[i + MIN_KEYCODE] = modifiers[j].mask; - } - } - - ErrorF("%s, %s, %s, %s, %s\n", priv->rmlvo.rules, priv->rmlvo.model, priv->rmlvo.layout, priv->rmlvo.variant, priv->rmlvo.options); - XkbSetRulesDflts(priv->rmlvo.rules, priv->rmlvo.model, - priv->rmlvo.layout, priv->rmlvo.variant, - priv->rmlvo.options); - if (!XkbInitKeyboardDeviceStruct(pJstk, &xkbnames, - &keySyms, modMap, NULL, - jstkKbdCtrl)) + ErrorF("unable to init keyboard device\n"); return !Success; -#endif + } /* Set Autorepeat and Delay */ if ((priv->repeat_delay || priv->repeat_interval) && @@ -417,7 +107,7 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv) *************************************************************************** */ void -jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed) +jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed) { int i; unsigned int k; @@ -447,11 +137,12 @@ jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed) * *************************************************************************** */ -static Bool +Bool jstkKeyboardDeviceControlProc(DeviceIntPtr dev, int what) { - JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(dev); + InputInfoPtr pInfo = dev->public.devicePrivate; + JoystickDevPtr priv = pInfo->private; if (!priv) { DBG(2, ErrorF("jstkKeyboardDeviceControlProc: priv == NULL\n")); return !Success; @@ -489,65 +180,116 @@ jstkKeyboardDeviceControlProc(DeviceIntPtr dev, * * jstkKeyboardPreInit -- * - * Called manually to create a keyboard device for the joystick + * See comment in jstkCorePreInit() for details. * *************************************************************************** */ + +int jstkKeyboardPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) +{ + JoystickDevPtr priv = NULL; + char *s; + + pInfo->private = priv = calloc(1, sizeof(JoystickDevRec)); + if (!priv) + return BadAlloc; + + pInfo->device_control = jstkKeyboardDeviceControlProc; + pInfo->read_input = NULL; + pInfo->control_proc = NULL; + pInfo->switch_mode = NULL; + pInfo->fd = -1; + pInfo->type_name = XI_JOYSTICK; + + /* parse keyboard-related options */ + priv->repeat_delay = 0; + priv->repeat_interval = 0; + + /* Parse option for autorepeat */ + if ((s = xf86SetStrOption(pInfo->options, "AutoRepeat", NULL))) { + int delay, rate; + if (sscanf(s, "%d %d", &delay, &rate) != 2) { + xf86Msg(X_ERROR, "%s: \"%s\" is not a valid AutoRepeat value", + pInfo->name, s); + } else { + priv->repeat_delay = delay; + if (rate != 0) + priv->repeat_interval = 1000/rate; + else priv->repeat_interval = 0; + DBG(1, xf86Msg(X_CONFIG, "Autorepeat set to delay=%d, interval=%d\n", + priv->repeat_delay,priv->repeat_interval)); + } + free(s); + } + + priv->rmlvo.rules = xf86SetStrOption(pInfo->options, "xkb_rules", NULL); + if (!priv->rmlvo.rules) + priv->rmlvo.rules = xf86SetStrOption(pInfo->options, "XkbRules", "evdev"); + + priv->rmlvo.model = xf86SetStrOption(pInfo->options, "xkb_model", NULL); + if (!priv->rmlvo.model) + priv->rmlvo.model = xf86SetStrOption(pInfo->options, "XkbModel", "evdev"); + + priv->rmlvo.layout = xf86SetStrOption(pInfo->options, "xkb_layout", NULL); + if (!priv->rmlvo.layout) + priv->rmlvo.layout = xf86SetStrOption(pInfo->options, "XkbLayout", "us"); + + priv->rmlvo.variant = xf86SetStrOption(pInfo->options, "xkb_variant", NULL); + if (!priv->rmlvo.variant) + priv->rmlvo.variant = xf86SetStrOption(pInfo->options, "XkbVariant", ""); + + priv->rmlvo.options = xf86SetStrOption(pInfo->options, "xkb_options", NULL); + if (!priv->rmlvo.options) + priv->rmlvo.options = xf86SetStrOption(pInfo->options, "XkbOptions", ""); + + return Success; +} + InputInfoPtr -jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr _dev, int flags) +jstkKeyboardHotplug(InputInfoPtr pInfo, int flags) { - LocalDevicePtr local = NULL; - IDevPtr dev = NULL; + int rc; char name[512] = {0}; + InputAttributes *attrs = NULL; + InputOption *options; + InputOption *iopts = NULL, *tmp; + DeviceIntPtr dev; + + /* duplicate option list, append to name */ + options = xf86OptionListDuplicate(pInfo->options); + strcpy(name, pInfo->name); + strcat(name, " (keys)"); + options = xf86ReplaceStrOption(options, "Name", name); + options = xf86ReplaceStrOption(options, "_source", "_driver/joystick"); + + while(options) + { + tmp = calloc(1, sizeof(InputOption)); - local = xf86AllocateInput(drv, 0); - if (!local) { - goto SetupProc_fail; + tmp->key = xf86OptionName(options); + tmp->value = xf86OptionValue(options); + tmp->next = iopts; + iopts = tmp; + options = xf86NextOption(options); } - dev = xcalloc(sizeof(IDevRec), 1); - strcpy(name, _dev->identifier); - strcat(name, " (keys)"); - dev->identifier = xstrdup(name); - dev->driver = xstrdup(_dev->driver); - dev->commonOptions = (pointer)xf86optionListDup(_dev->commonOptions); - dev->extraOptions = (pointer)xf86optionListDup(_dev->extraOptions); - - local->name = dev->identifier; - local->flags = XI86_KEYBOARD_CAPABLE; - local->device_control = jstkKeyboardDeviceControlProc; - local->read_input = NULL; - local->close_proc = NULL; - local->control_proc = NULL; - local->switch_mode = NULL; - local->conversion_proc = NULL; - local->fd = -1; - local->dev = NULL; - local->private = NULL; - local->type_name = XI_JOYSTICK; - local->history_size = 0; - local->always_core_feedback = 0; - local->conf_idev = dev; - - xf86CollectInputOptions(local, NULL, NULL); - xf86OptionListReport(local->options); - xf86ProcessCommonOptions(local, local->options); - - - /* return the LocalDevice */ - local->flags |= XI86_CONFIGURED; - - return (local); - -SetupProc_fail: - if (local) - local->private = NULL; - if (dev) { - if (dev->identifier) xfree(dev->identifier); - if (dev->driver) xfree(dev->driver); - xfree(dev); + /* duplicate attribute list */ + attrs = DuplicateInputAttributes(pInfo->attrs); + + rc = NewInputDeviceRequest(iopts, attrs, &dev); + + while(iopts) + { + tmp = iopts->next; + free(iopts->key); + free(iopts->value); + free(iopts); + iopts = tmp; } - return NULL; + + FreeInputAttributes(attrs); + + return (rc == Success) ? dev->public.devicePrivate : NULL; } @@ -562,15 +304,15 @@ SetupProc_fail: */ void jstkKeyboardUnInit(InputDriverPtr drv, - LocalDevicePtr local, + InputInfoPtr pInfo, int flags) { - JoystickDevPtr device = (JoystickDevPtr) local->private; + JoystickDevPtr device = (JoystickDevPtr) pInfo->private; DBG(2, ErrorF("jstkKeyboardUnInit.\n")); device->keyboard_device = NULL; - local->private = NULL; + pInfo->private = NULL; - xf86DeleteInput(local, 0); + xf86DeleteInput(pInfo, 0); } diff --git a/driver/xf86-input-joystick/src/jstk_key.h b/driver/xf86-input-joystick/src/jstk_key.h index 1791c3518..fc0c7821a 100644 --- a/driver/xf86-input-joystick/src/jstk_key.h +++ b/driver/xf86-input-joystick/src/jstk_key.h @@ -25,9 +25,10 @@ #ifndef __JSTK_KEY_H_INCLUDED__ #define __JSTK_KEY_H_INCLUDED__ -void jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed); - -InputInfoPtr jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr dev, int flags); -void jstkKeyboardUnInit(InputDriverPtr drv, LocalDevicePtr local, int flags); +void jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed); +int jstkKeyboardPreInit(InputDriverPtr pInfo, InputInfoPtr dev, int flags); +void jstkKeyboardUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); +Bool jstkKeyboardDeviceControlProc(DeviceIntPtr dev, int what); +InputInfoPtr jstkKeyboardHotplug(InputInfoPtr dev, int flags); #endif diff --git a/driver/xf86-input-joystick/src/jstk_options.c b/driver/xf86-input-joystick/src/jstk_options.c index 42293a7a1..65f25f804 100644 --- a/driver/xf86-input-joystick/src/jstk_options.c +++ b/driver/xf86-input-joystick/src/jstk_options.c @@ -26,6 +26,7 @@ #include "config.h" #endif +#include <xorg-server.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -154,7 +155,7 @@ jstkParseButtonOption(const char* org, xf86Msg(X_WARNING, "%s: error parsing button parameter.\n", name); } - xfree(param); + free(param); } @@ -292,5 +293,5 @@ jstkParseAxisOption(const char* org, }else xf86Msg(X_WARNING, "%s: error parsing deadzone.\n", name); } - xfree(param); + free(param); } diff --git a/driver/xf86-input-joystick/src/jstk_properties.c b/driver/xf86-input-joystick/src/jstk_properties.c index 1ceeb061b..413822d10 100644 --- a/driver/xf86-input-joystick/src/jstk_properties.c +++ b/driver/xf86-input-joystick/src/jstk_properties.c @@ -25,12 +25,9 @@ #include "config.h" #endif +#include <xorg-server.h> #include <xf86Module.h> -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 - - - #include <misc.h> #include <xf86.h> #include <X11/Xatom.h> @@ -456,5 +453,3 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv) return TRUE; } - -#endif |