!22 变更格式为eular:mtdev

Merge pull request !22 from mengweiwww/master
This commit is contained in:
openharmony_ci
2023-08-26 01:13:37 +00:00
committed by Gitee
43 changed files with 27 additions and 47604 deletions
+4
View File
@@ -1,6 +1,10 @@
import("//build/ohos.gni")
## Build libmtdev.so {{{
mtdev_path = rebase_path("//third_party/mtdev")
exec_script("install.sh", [ "$mtdev_path" ])
config("libmtdev_config") {
visibility = [ ":*" ]
-23
View File
@@ -1,23 +0,0 @@
mtdev - Multitouch Protocol Translation Library (MIT license)
Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
Copyright (C) 2010 Canonical Ltd.
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.
-814
View File
@@ -1,814 +0,0 @@
commit 25d541d2b0b526eba58fee99ceac202acca6d4a2
Author: Henrik Rydberg <rydberg@bitmath.se>
Date: Sun Jan 26 14:40:46 2020 +0100
Release mtdev-1.1.6
Signed-off-by: Henrik Rydberg <rydberg@bitmath.se>
commit 598e561881c687cea072375637aa08ac9230fabe
Author: Khem Raj <raj.khem@gmail.com>
Date: Sat Nov 23 18:45:32 2019 -0800
adjust for 64bit time_t for 32bit architectures
libc that has support for 32 bit applications to use 64 bit
time_t supplies __USE_TIME_BITS64 define [1]
[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.se>
commit 5a260fa95a5e7cebdd8f9da947c8d8eb244efae0
Author: Michael Forney <mforney@mforney.org>
Date: Fri Jun 7 11:29:01 2019 -0700
Use a macro for `nlongs` so it can be used in constant expression
This way, it can be used to specify the `absbits` array size (in
`mtdev_configure`) without making it a VLA.
VLAs are an optional feature in C11, and in this case we can determine
the array size statically.
This also matches the macros used in libevdev and libinput.
Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.se>
commit 5f9caa26b81155feede6ff71c9b14fa0e8980fbd
Author: Martin Kepplinger <martink@posteo.de>
Date: Tue Aug 22 11:12:13 2017 +0200
mtdev-matching.c: declare global variables static
n1 and n2 are only locally used and can thus be static.
Signed-off-by: Martin Kepplinger <martink@posteo.de>
commit d9f084c9384f99d3589cf51f8503b7aee4e9666c
Author: Martin Kepplinger <martink@posteo.de>
Date: Tue Aug 22 11:12:12 2017 +0200
mtdev-mapgen.c: declare init_caps() static
init_caps() is only locally used and can thus be static.
Signed-off-by: Martin Kepplinger <martink@posteo.de>
commit 8ba8d359392693f9882ea2d195fc1bebb8b3a29d
Author: Martin Kepplinger <martink@posteo.de>
Date: Tue Aug 22 11:12:11 2017 +0200
caps.c: declare mtdev_set_slots() static
mtdev_set_slots() is only used internally, so it should be static.
Signed-off-by: Martin Kepplinger <martink@posteo.de>
commit 4381b78fea54de0e775bf54952b2f95e5a06c57d
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Feb 28 19:57:15 2014 +0100
Release mtdev-1.1.5
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 88840fe45b49464642181007c5a6df1bc951bade
Author: Colin Walters <walters@verbum.org>
Date: Thu Feb 27 08:03:35 2014 -0500
build: Fix srcdir != builddir from git
Make it possible to build the source out-of-tree. The gnome-continuous
build system does this by default.
Signed-off-by: Colin Walters <walters@verbum.org>
[rydberg@euromail.se: Resolve merge conflict]
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 6d698f6dba4a024b5f3ccac2876465c60f780478
Author: Ross Burton <ross.burton@intel.com>
Date: Fri Nov 15 23:41:29 2013 +0000
test: fix out-of-tree builds
Some tests do #include relative to the top-level, so add top_srcdir to the
include path as otherwise out-of-tree builds can't find the files.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 25070dda4b1aaaf402db621d10fc901b82d78377
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sat Aug 3 22:01:06 2013 +0200
Release mtdev-1.1.4
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 72bbb5f42fe8e47d6314eb92a0ada6554644305c
Merge: b5d8e8e a9ea316
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Jul 31 19:25:50 2013 +0200
Merge more build fixes from Peter Hutterer, along with a more explicit
declaration of the backwards compatibility constraints on the API.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit a9ea3168615056360cdb21d6f1576d66be2a43fe
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Jul 24 14:24:43 2013 +1000
Enable silent rules by default
silent rules make it easier to spot compiler errors
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 0bccf8c5268826bdb0835dd9b7964bcc95bae35f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Jul 24 14:23:25 2013 +1000
test: silence compiler warning - implicit declaration of function atoi
mtdev-kernel.c:130:2: warning: implicit declaration of function atoi
[-Wimplicit-function-declaration]
eslot = atoi(argv[1]) + 1;
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 1ddaf0af41098d0a01eac162c6fe4d38f2fbbbad
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Jul 24 13:00:32 2013 +1000
Fix compiler warning - implicit declaration of function 'abs'
match_four.c:80:4: warning: implicit declaration of function 'abs'
[-Wimplicit-function-declaration]
*dist++ = abs(q->x - p->x) + abs(q->y - p->y);
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 6f7c5c558006bb69fdf0af73103097c012ccfed5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu Jul 25 13:21:09 2013 +1000
Replace hardcoded 11 with a define
The 11 comes from the legacy API that we need to be binary compatible with.
Make this clear with a define and a comment.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit b5d8e8e26c0116e4b6e556a0f6da8777bc55c590
Merge: e5eb274 f4fe569
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jul 25 10:05:20 2013 +0200
Merge build fixes from Peter Hutterer.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit f4fe56973a29265e22f049ceed1e299573f90ec4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Jul 3 15:49:21 2013 +1000
Rename INCLUDES to AM_CPPFLAGS
src/Makefile.am:22: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit e79f2b211830dec2bae35595c6dfd1d06f75d903
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Jul 3 15:45:12 2013 +1000
Drop maintainer mode - enable by default
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit e5eb27494cd237e60645db4d7be5b4acf41cb5e0
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Aug 22 22:20:16 2012 +0200
Release mtdev-1.1.3
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 656d5c9d7e37a301afa3af9c2382d6b869f57ebf
Author: David Kozub <zub@linux.fjfi.cvut.cz>
Date: Tue May 29 22:53:21 2012 +0200
Fix pc file to allow compiling with mtdev installed in non-std path.
The pkgconfig file does not specify the -I flag needed to be able to
compile with `pkg-config mtdev --cflags` when libmtdev is installed to
a directory that is not searched by the C compiler by default.
This patch fixes the issue.
Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 5a6773f85a77e78dbbb915e32768aa24e1c83124
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Feb 20 16:03:05 2012 +0100
Release mtdev-1.1.2
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 43ce27aab2d990e9a4f54d2050b851bd2da01875
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Feb 16 16:25:30 2012 +0100
Add support for kernel MT slot state retrieval
From kernel 3.4, extraction of the MT slot state is supported
via the EVIOGMTSLOTS ioctl. This patch initializes the slots
using that information.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 3ec66c3b21e45d6529567f5144ba24dcc4645591
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jan 12 20:05:28 2012 +0100
Add the missing distance event to the internal slot representation
The new distance value was missing from the internal representation,
leading to memory corruption for devices supporting the event. Fixed
with this patch.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 3aa3de4c19b80caaf93812fafff20acd5f5a4d12
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Apr 19 11:45:45 2011 +0200
Return EINVAL for invalid parameters on mtdev_init.
[rydberg@euromail.se: minor cleanup]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 61684cf0466200631b6a44af1c662eb760ad3f5d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Apr 19 11:41:04 2011 +0200
mtdev_close should ignore NULL devices.
Saves us one goto label in mtdev_init.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 9e3daba37d1d15c99a41a2d838bf683934cc7077
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Dec 22 18:55:09 2010 +0100
Release mtdev v1.1.0
This version includes backwards-compatible API changes,
while keeping the ABI stable. Applications that want to
migrate to the new API, compile with -DMTDEV_NO_LEGACY_API.
commit ecfc435c3742546e36ec4eefd76f02584fb54192
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Dec 22 18:49:41 2010 +0100
mtdev-test: output MT event support
At startup, output the MT events supported by the device.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit cff212dbe28487c14ab040829877d77378a61344
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Dec 22 18:35:53 2010 +0100
Add support for ABS_MT_DISTANCE
In the upcoming 2.6.38 kernel, support for hovering is introduced.
Add the ABS_MT_DISTANCE to the extended set of handled ABS_MT events.
The change is binary compatible with existing libraries.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 56a77e68fb91eef928d8a95c50ae14508e37ae0f
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Dec 22 18:29:00 2010 +0100
Introduce a stable ABI
The current mtdev is not ABI stable, and the upcoming additions
to the kernel api will break ABI. This patch starts the process
of keeping binary compatibility with old programs, by moving the
abi-specific parts under a special flag, MTDEV_NO_LEGACY_API,
and makes sure the internal parts compiles with MTDEV_NO_LEGACY_API
set. This way, older programs will still work, old programs will
still compile, and new programs will be able to use the additions.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 0e2ab3b5940e70493aaabdfe5e8da1c75db4db72
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Dec 20 16:49:53 2010 +0100
Allow use in c++ applications
Reported-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit db1fdc76ceb5d1bbe32c193e13eb4357da5d0b81
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sun Nov 7 18:07:07 2010 +0100
mtdev v1.0.11
commit 67fdae132708889ed89e302bd63a5cb91b2c75a7
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sun Nov 7 18:04:46 2010 +0100
Add and test a simple kernel matcher
This matcher is for up to four fingers, and has these properties:
* Approximately 1.4 times faster at 4 fingers
* Approximately 4.0 times faster at 2 fingers
* Roughly 100 lines of code
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 868f53c8a5684524bc6b1e7cd39aabed56fad9df
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sun Nov 7 17:56:56 2010 +0100
Generate kernel matcher data
This application generates the matcher tables of the tracking
library in the linux kernel.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 561af7f537b80f3952ab228bcc992ad75ced280b
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Oct 12 17:13:45 2010 +0200
Add mtdev-matching test program
Measures matching speed and provides some historically difficult
test cases.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 1390859adc7fd084c5c546984d415e44bfc44ccd
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Sep 7 16:22:30 2010 +0200
mtdev v1.0.10
commit 61632a31642ecaa7288624b0dc9887c4196cc165
Author: Henrik Rydberg <rydberg@bitmath.org>
Date: Tue Sep 7 15:54:27 2010 +0200
Fall back to single-touch position and pressure dimensions
In case mtdev is driving a non-MT device, basic dimensions are not set
properly. Fall back on ABS_X/Y and ABS_PRESSURE, such that basic
pointer operations can be supported through mtdev.
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
commit 9daa452e53d2b2f74f943bd0a50d17a311698b4f
Author: Henrik Rydberg <rydberg@bitmath.org>
Date: Tue Sep 7 15:46:31 2010 +0200
Install mapping and plumbing header files
Applications may need to know the property mapping, and the plumbing
interface is actually supported, so install both headers.
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
commit 676b4003302e025d10a0822357c55b97dbab3707
Author: Henrik Rydberg <rydberg@bitmath.org>
Date: Tue Sep 7 15:38:19 2010 +0200
Complete mtdev property mapping
Add the missing property values to the mapgen output, and insert the
result in the mtdev mapping header file.
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
commit a2ea1c9154c0d746f8c4e72425435fc017324d43
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Aug 18 11:06:34 2010 +0200
mtdev v1.0.9
commit 810cef87de0d65e505e68ad39c469c2e9ce6d0a1
Author: Henrik Rydberg <rydberg@bitmath.org>
Date: Wed Aug 18 11:01:28 2010 +0200
Correct logic for kernel MT slots devices
This patch fixes the broken logic to detect the kernel MT slots protocol,
such that MT slots devices may pass through mtdev properly.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit e91311dc01f970b687da4f00810cf40d3d37a5e4
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Aug 2 00:22:50 2010 +0200
mtdev v1.0.8
commit caa4aaafe48fce11f6826ba2d0b8f1ff4f8e49cf
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Aug 2 01:49:03 2010 +0200
Remove erroneous dependency on xorg macros
This package has no external dependencies and should not depend
on the xorg macros. This patch removes the dependency, adds a tailored
INSTALL file, and uses git to generate the ChangeLog.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit abfa51e422384d23ea0a253e5937063131fd4279
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Jul 21 10:09:12 2010 +0200
mtdev v1.0.7
commit ae5e172ee1e2d100bee6607ab66f318a62a2ebe3
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Wed Jul 21 10:08:40 2010 +0200
The forthcoming 2.6.36 kernel does not define the MT_SLOT_ABS_EVENTS
list, so make sure it is always defined in mtdev.h
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 926493b33a0836931ee454cba0761f021d078078
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Jul 19 13:09:51 2010 +0200
mtdev v1.0.6
commit d2a8e0bfda364730ba5c06be4adc783f9a889073
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Jul 19 13:09:10 2010 +0200
Change test program name to mtdev-test
In order to simplify packaging, rename the current mtdev
device test program to mtdev-test.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit a6f1a4dd2c14908c6602c4c2438ef4b5cb86de99
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jul 15 14:51:55 2010 +0200
mtdev v1.0.5
commit 16110e89a671067ee53cb7a8bce6b6a2690b97ae
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jul 15 14:51:04 2010 +0200
Add missing header files to sources directive
In order for make dist-gzip to work properly, all files needed
to build the system need to be listed. This patch adds the missing
header files to the sources directive.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 7de1f0b0bbfb4dd5b205ed74d2f8ad2ca5e663b6
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jul 13 09:14:35 2010 +0200
mtdev v1.0.4
commit 3557acb6a9eec0c0d752a1f3d783b5f50bc19e1b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon Jul 5 08:01:41 2010 +0200
Build test utilities unconditionally, do not install
The test programs in the package are command-line utilities which can
be used to generate MT code mappings for header files, and debug
hardware problems, and should not be installed. With this patch, tests
are built unconditionally, but not installed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 8da65965093ce2515dd0ce828a6512f24f5f5ca9
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri Jul 2 11:53:41 2010 +1000
README: add URL and email for patches.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit ad07aa12a19dea8324c2cc5e1d986c636c4b6593
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri Jul 2 11:51:08 2010 +1000
test: fix out-of-tree builds.
Libraries are in builddir, not sourcedir.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit e1c48e0763304ae58752c29c3afb85f68bdf32fa
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 24 21:03:42 2010 +0200
mtdev v1.0.3
commit c880548a2973a52070cb583923d5edae375b7b6d
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 24 11:39:08 2010 +0200
Add a CREDITS file
This patch adds a CREDITS file, which keeps track of historical
contributions affecting this library.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 1fed4b309cea8c7a0dc03f740174bd31b4b03ab5
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 23:25:58 2010 +0200
gitignore: Ignore the patches directory
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit a0dc5304a856158939b52980ce5eaf7d25b67bf1
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 22:42:22 2010 +0200
mtdev v1.0.2
commit 0acc1d3fbacf08543c46387ed5dba6a1e2b36ec0
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 22:38:58 2010 +0200
Update defuzz() credits
Correct the credits for the defuzz() function. Used under the MIT
license with permission from Vojtech Pavlik.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 451dbad007dc941fb7a4877238873d13245c0a65
Author: Chase Douglas <chase.douglas@canonical.com>
Date: Tue Jun 22 16:06:38 2010 -0400
Search for libmtdev in src/ directory during a clean build
If mtdev hasn't already been installed, the test binaries will fail to
compile because they can't find libmtdev. Point them to the src
directory build output.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
commit d29155e8436e084d925fc3ed5bb1fce94bc69949
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 11:55:38 2010 +0200
mtdev v1.0.1
commit d4d92de224681a260de81be44374649de2bfb485
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 11:55:04 2010 +0200
Apply new package title to all files
This patch changes the package description title in all relevant
files, and touches up the README. All systems go.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 7a5b2c37ea0b4ec81fbe8be7c1d7f9bf1731439e
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 11:45:17 2010 +0200
Build test tools also under autoconf
The tests can be disabled by using --enable-test=no in configure.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 9c5128866ea65ad300b40d47a9d43998dc8bc9f4
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 11:44:36 2010 +0200
janitor: fix compiler warnings
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 0647b37dfc35145d74822844ad7e54bf5c218369
Author: Chase Douglas <chase.douglas@canonical.com>
Date: Mon Jun 21 21:08:51 2010 -0400
Move to autotools
[rydberg@euromail.se: minor fixups]
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 172221f14fc91ebb37aa4c561ad733088cc3c3bf
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 09:19:50 2010 +0200
match: conform to mtdev namespace
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 925ad71be727ec8da3cd71a2c1c965d336ff856f
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Tue Jun 22 00:52:26 2010 +0200
mtdev v1.0.0
commit ba936eddbf88b6d8f650082f6e7d2694f8addac4
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Mon Jun 21 22:43:58 2010 +0200
Unused slot is denoted by MT_TRACKING_ID == -1
The current MT slot protocol allows any tracking id outside the range
specified by the device to denote an unused slot. This is difficult to
handle in userspace, since the valid range is unknown. This patch
tightens the definition of a valid tracking id to always lie in the
range [0, MT_ID_MAX], and uses the value -1 to denote an unused slot.
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit dbbf15a7fad8b76122061344aeddb652bd4fe442
Author: Chase Douglas <chase.douglas@canonical.com>
Date: Mon Jun 21 09:57:56 2010 -0400
mtdev_get: return number of retrieved events if error occurs
Otherwise, we pull events, but return -1. We should send the events we
were able to retrieve for now.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 922332131c329b9d444c434d68a2f21e3076ae0c
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sat Jun 19 14:21:55 2010 +0200
Install and uninstall all relevant files
Useful for testing as a standalong package.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 259b92a30280cdec2b7798df3c14da596c417ef1
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Sat Jun 19 12:10:27 2010 +0200
Restructure mtdev api
Split the api into plumbing and porcelain layers and move the
plumbing part to its own optional header file.
The main usecase is to fetch events from the device, route them
through the converter and extract the processed events. To simplify
the API, replace the intermediate mtdev_pull() function by the
higher-level mtdev_get(). This function does all the required steps,
and has the same semantics as read().
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 8087ac3d655c2b2835cf61e7a69611d81d4f303e
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 11:51:54 2010 +0200
Change the matching code to the MIT license
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit d7f96ade2801a712dbb532ab08ec93c9558870e1
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 11:28:55 2010 +0200
Use a non-blocking example in test/mtdev
The non-blocking case is more interesting for X applications.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 2752c003604e907f2a6776ff794a72845d1b5949
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 11:24:24 2010 +0200
Correct minor semantic documentation error in mtdev_close()
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 0463e0bcc262c7a4709b43312f15adaaaaaa88f9
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 01:41:14 2010 +0200
janitor: fix spelling error
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 309df849b8ad3772b912d498eacda9f38a6e4f1e
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 01:39:40 2010 +0200
Correct semantic error in mtdev_idle
The current semantics, that a non-empty conversion pipe means
the device is not idle, is not very useful. This patch changes
the semantics to simply checking if the fetch buffer is empty,
and if there are no events to fetch from the device.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit d62c625535494361b8ba0a004a1d24ce485f0b59
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 01:35:28 2010 +0200
Allow max_events to be zero in mtdev_pull()
When reading from non-blocking devices, it makes sense to read
all events available. This patch lets a zero max_events achieve that.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit c9c4f4cda362679567bc4bc04ffedc5d984e2329
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 01:32:43 2010 +0200
Rectify argument order in mtdev_fetch
The argument order in mtdev_fetch() differs from all other
usages involved the file descriptor. Fixed with this patch.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit d4704c0d6d70a2815c5ca12d74ba11cc7be69e20
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Fri Jun 18 01:28:43 2010 +0200
make: Correct bad library name
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit ba07cbb24bd226ead1f8f96b0e969822aa734076
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 17 21:41:26 2010 +0200
Output both a static and a dynamic library
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 7d392652bae52b76cb5fe907cc1e86e0e0c4ced9
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 17 20:15:44 2010 +0200
Add idle function
This patch adds the mtdev_idle() function, which checks the kernel
device for activity. Useful when implementing timing logic.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 6a8c74eb36ab93702c257f425832272cccb0cde8
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 17 18:18:22 2010 +0200
Name dynamic library correctly
To simplify dynamic library usage, name the libary correctly
and put it in /usr/lib/.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
commit 66e5de9eaefc33ffa6af3617f9ec7a50f10af50d
Author: Henrik Rydberg <rydberg@euromail.se>
Date: Thu Jun 17 18:12:58 2010 +0200
Initial load of mtdev project
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-25
View File
@@ -1,25 +0,0 @@
mtdev - Multitouch Protocol Translation Library (MIT license)
To build, you need to have the autoconf and libtool packages
installed. Then, do
./autogen.sh
./configure
make
To test an MT device at /dev/input/eventX, do
sudo ./test/mtdev-test /dev/input/eventX
You should be able to see MT events in the terminal. After five
seconds of inactivity, the program exits.
To install mtdev, do
sudo make install
By default, mtdev installs to /usr/local. To change, use the --prefix
configure option.
Enjoy,
Henrik
-14
View File
@@ -1,14 +0,0 @@
SUBDIRS = src test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = mtdev.pc
AM_CPPFLAGS = $(top_srcdir)/include/
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
git log > ChangeLog
dist-hook: ChangeLog INSTALL
-887
View File
@@ -1,887 +0,0 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = mtdev.pc
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/mtdev.pc.in $(top_srcdir)/config-aux/compile \
$(top_srcdir)/config-aux/config.guess \
$(top_srcdir)/config-aux/config.sub \
$(top_srcdir)/config-aux/install-sh \
$(top_srcdir)/config-aux/ltmain.sh \
$(top_srcdir)/config-aux/missing COPYING ChangeLog INSTALL \
README config-aux/compile config-aux/config.guess \
config-aux/config.sub config-aux/depcomp config-aux/install-sh \
config-aux/ltmain.sh config-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_VERSION = @LIB_VERSION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = mtdev.pc
AM_CPPFLAGS = $(top_srcdir)/include/
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mtdev.pc: $(top_builddir)/config.status $(srcdir)/mtdev.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-pkgconfigDATA
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-pkgconfigDATA
.PRECIOUS: Makefile
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
git log > 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:
-14
View File
@@ -1,14 +0,0 @@
mtdev - Multitouch Protocol Translation Library (MIT license)
The mtdev library transforms all variants of kernel MT events to the
slotted type B protocol. The events put into mtdev may be from any MT
device, specifically type A without contact tracking, type A with
contact tracking, or type B with contact tracking. See the kernel
documentation for further details.
http://bitmath.org/code/mtdev/
Please send patches to: patches@bitmath.org
---
Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
Copyright (C) 2010 Canonical Ltd.
Vendored
-10188
View File
File diff suppressed because it is too large Load Diff
-34
View File
@@ -1,34 +0,0 @@
{
"name": "@ohos/mtdev",
"description": "The mtdev library transforms all variants of kernel MT events to the slotted type B protocol",
"version": "3.1",
"license": "MIT",
"publishAs": "code-segment",
"segment": {
"destPath": "third_party/mtdev"
},
"dirs": {},
"scripts": {},
"licensePath": "COPYING",
"readmePath": {
"en": "README"
},
"component": {
"name": "mtdev",
"subsystem": "thirdparty",
"syscap": [],
"features": [],
"adapted_system_type": [ "standard" ],
"rom": "",
"ram": "",
"deps": {
"components": [],
"third_party": []
},
"build": {
"sub_component": [],
"inner_kits": [],
"test": []
}
}
}
-348
View File
@@ -1,348 +0,0 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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 2, 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 <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
-1502
View File
File diff suppressed because it is too large Load Diff
-1714
View File
File diff suppressed because it is too large Load Diff
-630
View File
@@ -1,630 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
# Software Foundation, Inc.
# 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 2, 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 to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g"
depmode=msvisualcpp
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-520
View File
@@ -1,520 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-11369
View File
File diff suppressed because it is too large Load Diff
-376
View File
@@ -1,376 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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 2, 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 to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-61
View File
@@ -1,61 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
Vendored
-14932
View File
File diff suppressed because it is too large Load Diff
-29
View File
@@ -1,29 +0,0 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([Multitouch Protocol Translation Library],
[1.1.6],
[],
[mtdev])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config-aux])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_SILENT_RULES([yes])
LIB_VERSION=1:0:0
AC_SUBST([LIB_VERSION])
# Initialize libtool
AC_PROG_LIBTOOL
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile
src/Makefile
test/Makefile
mtdev.pc])
AC_OUTPUT
-91
View File
@@ -1,91 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
/* Tables are automatically generated by mtdev-mapgen */
#ifndef _MTDEV_MAPPING_H
#define _MTDEV_MAPPING_H
#ifdef __cplusplus
extern "C" {
#endif
#include <mtdev.h>
#ifndef MTDEV_NO_LEGACY_API
#define MTDEV_TOUCH_MAJOR 0
#define MTDEV_TOUCH_MINOR 1
#define MTDEV_WIDTH_MAJOR 2
#define MTDEV_WIDTH_MINOR 3
#define MTDEV_ORIENTATION 4
#define MTDEV_POSITION_X 5
#define MTDEV_POSITION_Y 6
#define MTDEV_TOOL_TYPE 7
#define MTDEV_BLOB_ID 8
#define MTDEV_TRACKING_ID 9
#define MTDEV_PRESSURE 10
static const unsigned int mtdev_map_abs2mt[ABS_CNT] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
0x0009, 0x000a, 0x000b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
static const unsigned int mtdev_map_mt2abs[MT_ABS_SIZE] = {
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a,
};
static inline int mtdev_is_absmt(unsigned int code)
{
return mtdev_map_abs2mt[code];
}
static inline unsigned int mtdev_abs2mt(unsigned int code)
{
return mtdev_map_abs2mt[code] - 1;
}
static inline unsigned int mtdev_mt2abs(unsigned int mtcode)
{
return mtdev_map_mt2abs[mtcode];
}
#endif
#ifdef __cplusplus
}
#endif
#endif
-150
View File
@@ -1,150 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef _MTDEV_PLUMBING_H
#define _MTDEV_PLUMBING_H
#ifdef __cplusplus
extern "C" {
#endif
#include <mtdev.h>
/**
* mtdev_new - allocate a new mtdev
*
* Allocate a new mtdev.
*
* Returns zero in case of memory allocation failure.
*/
struct mtdev *mtdev_new(void);
/**
* mtdev_init - initialize mtdev converter
* @dev: the mtdev to initialize
*
* Sets up the internal data structures.
*
* Returns zero on success, negative error number otherwise.
*/
int mtdev_init(struct mtdev *dev);
/**
* mtdev_set_mt_event - set event type
* @dev: the mtdev in use
* @code: the ABS_MT code to set
* @value: boolean value
*
* Returns true if the given event code is present.
*/
void mtdev_set_mt_event(struct mtdev *dev, int code, int value);
/**
* mtdev_set_abs_<property> - set abs event property
* @dev: the mtdev in use
* @code: the ABS_MT code to set
*/
void mtdev_set_abs_minimum(struct mtdev *dev, int code, int value);
void mtdev_set_abs_maximum(struct mtdev *dev, int code, int value);
void mtdev_set_abs_fuzz(struct mtdev *dev, int code, int value);
void mtdev_set_abs_resolution(struct mtdev *dev, int code, int value);
/**
* mtdev_configure - configure the mtdev converter
* @dev: the mtdev to configure
* @fd: file descriptor of the kernel device
*
* Reads the device properties to set up the protocol capabilities.
* If preferred, this can be done by hand, omitting this call.
*
* Returns zero on success, negative error number otherwise.
*/
int mtdev_configure(struct mtdev *dev, int fd);
/**
* mtdev_fetch_event - fetch an event from the kernel device
* @dev: the mtdev in use
* @fd: file descriptor of the kernel device
* @ev: the kernel input event to fill
*
* Fetch a kernel event from the kernel device. The read operation
* behaves as dictated by the file descriptor; if O_NONBLOCK is not
* set, the read will block until an event is available.
*
* On success, returns the number of events read (0 or 1). Otherwise,
* a standard negative error number is returned.
*/
int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev);
/**
* mtdev_put_event - put an event into the converter
* @dev: the mtdev in use
* @ev: the kernel input event to put
*
* Put a kernel event into the mtdev converter. The event should
* come straight from the device.
*
* This call does not block; if the buffer becomes full, older events
* are dropped. The buffer is guaranteed to handle several complete MT
* packets.
*/
void mtdev_put_event(struct mtdev *dev, const struct input_event *ev);
/**
* mtdev_empty - check if there are events to get
* @dev: the mtdev in use
*
* Returns true if the processed event queue is empty, false otherwise.
*/
int mtdev_empty(struct mtdev *dev);
/**
* mtdev_get_event - get processed events from mtdev
* @dev: the mtdev in use
* @ev: the input event to fill
*
* Get a processed event from mtdev. The events appear as if they came
* from a type B device emitting MT slot events.
*
* The queue must be non-empty before calling this function.
*/
void mtdev_get_event(struct mtdev *dev, struct input_event* ev);
/**
* mtdev_delete - free a previously allocated mtdev
*
* Frees the memory associated with the mtdev and invalidates the
* mtdev pointer.
*/
void mtdev_delete(struct mtdev *dev);
#ifdef __cplusplus
}
#endif
#endif
-219
View File
@@ -1,219 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef _MTDEV_H
#define _MTDEV_H
#ifdef __cplusplus
extern "C" {
#endif
#include <linux/input.h>
/* includes available in 2.6.30-rc5 */
#ifndef BTN_TOOL_QUADTAP
#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
#define SYN_MT_REPORT 2
#define MT_TOOL_FINGER 0
#define MT_TOOL_PEN 1
#endif
/* includes available in 2.6.33 */
#ifndef ABS_MT_PRESSURE
#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
#endif
/* includes available in 2.6.36 */
#ifndef ABS_MT_SLOT
#define ABS_MT_SLOT 0x2f /* MT slot being modified */
#endif
/* includes available in 2.6.38 */
#ifndef ABS_MT_DISTANCE
#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
#endif
/* includes available in 3.4 */
#ifndef EVIOCGMTSLOTS
#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
#endif
#define MT_ID_NULL (-1)
#define MT_ID_MIN 0
#define MT_ID_MAX 65535
/**
* mtdev_new_open - create and open a new mtdev
* @fd: file descriptor of the kernel device
*
* Create a new mtdev and open the conversion.
*
* Returns zero in case of failure.
*
* This call combines the plumbing functions mtdev_new() and
* mtdev_open().
*/
struct mtdev *mtdev_new_open(int fd);
/**
* mtdev_open - open an mtdev converter
* @dev: the mtdev to open
* @fd: file descriptor of the kernel device
*
* Initialize the mtdev structure and configure it by reading
* the protocol capabilities through the file descriptor.
*
* Returns zero on success, negative error number otherwise.
*
* This call combines the plumbing functions mtdev_init() and
* mtdev_configure().
*/
int mtdev_open(struct mtdev *dev, int fd);
/**
* mtdev_has_mt_event - check for event type
* @dev: the mtdev in use
* @code: the ABS_MT code to look for
*
* Returns true if the given event code is present.
*/
int mtdev_has_mt_event(const struct mtdev *dev, int code);
/**
* mtdev_get_abs_<property> - get abs event property
* @dev: the mtdev in use
* @code: the ABS_MT code to look for
*
* Returns NULL if code is not a valid ABS_MT code.
*/
int mtdev_get_abs_minimum(const struct mtdev *dev, int code);
int mtdev_get_abs_maximum(const struct mtdev *dev, int code);
int mtdev_get_abs_fuzz(const struct mtdev *dev, int code);
int mtdev_get_abs_resolution(const struct mtdev *dev, int code);
/**
* mtdev_idle - check state of kernel device
* @dev: the mtdev in use
* @fd: file descriptor of the kernel device
* @ms: number of milliseconds to wait for activity
*
* Returns true if the device is idle, i.e., there are no fetched
* events in the pipe and there is nothing to fetch from the device.
*/
int mtdev_idle(struct mtdev *dev, int fd, int ms);
/**
* mtdev_get - get processed events from mtdev
* @dev: the mtdev in use
* @fd: file descriptor of the kernel device
* @ev: array of input events to fill
* @ev_max: maximum number of events to read
*
* Get a processed event from mtdev. The events appear as if they came
* from a type B device emitting MT slot events.
*
* The read operations involved behave as dictated by the file
* descriptor; if O_NONBLOCK is not set, mtdev_get() will block until
* the specified number of processed events are available.
*
* On success, returns the number of events read. Otherwise,
* a standard negative error number is returned.
*
* This call combines the plumbing functions mtdev_fetch_event(),
* mtdev_put_event() and mtdev_get_event().
*/
int mtdev_get(struct mtdev *dev, int fd, struct input_event* ev, int ev_max);
/**
* mtdev_close - close the mtdev converter
* @dev: the mtdev to close
*
* Deallocates all memory associated with mtdev, and clears the mtdev
* structure.
*/
void mtdev_close(struct mtdev *dev);
/**
* mtdev_close_delete - close conversion and delete mtdev
* @dev: the mtdev in use
*
* Flush pending buffers and deallocate all memory associated with
* mtdev. The device pointer is invalidated. This call combines the
* plumbing functions mtdev_close() and mtdev_delete().
*/
void mtdev_close_delete(struct mtdev *dev);
#ifndef MTDEV_NO_LEGACY_API
#define MT_ABS_SIZE 11
#ifndef MT_SLOT_ABS_EVENTS
#define MT_SLOT_ABS_EVENTS { \
ABS_MT_TOUCH_MAJOR, \
ABS_MT_TOUCH_MINOR, \
ABS_MT_WIDTH_MAJOR, \
ABS_MT_WIDTH_MINOR, \
ABS_MT_ORIENTATION, \
ABS_MT_POSITION_X, \
ABS_MT_POSITION_Y, \
ABS_MT_TOOL_TYPE, \
ABS_MT_BLOB_ID, \
ABS_MT_TRACKING_ID, \
ABS_MT_PRESSURE, \
}
#endif
struct mtdev_caps {
int has_mtdata;
int has_slot;
int has_abs[MT_ABS_SIZE];
struct input_absinfo slot;
struct input_absinfo abs[MT_ABS_SIZE];
};
struct mtdev {
struct mtdev_caps caps;
struct mtdev_state *state;
};
#endif
#ifdef __cplusplus
}
#endif
#endif
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
cd $1
if [ -d "mtdev-1.1.6" ];then
rm -rf mtdev-1.1.6
fi
tar xvf mtdev-1.1.6.tar.bz2
cp -rf mtdev-1.1.6/* ./
./configure
exit 0
Binary file not shown.
-10
View File
@@ -1,10 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: mtdev
Description: Multitouch Protocol Translation Library
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lmtdev
Cflags: -I${includedir}
-27
View File
@@ -1,27 +0,0 @@
lib_LTLIBRARIES = libmtdev.la
libmtdev_la_LDFLAGS = -version-info @LIB_VERSION@
libmtdev_la_SOURCES = \
$(top_srcdir)/include/mtdev-mapping.h \
$(top_srcdir)/include/mtdev-plumbing.h \
common.h \
evbuf.h \
iobuf.h \
match.h \
state.h \
caps.c \
core.c \
iobuf.c \
match.c \
match_four.c
AM_CFLAGS = $(CWARNFLAGS) #-DMTDEV_NO_LEGACY_ABI
AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(srcdir)
libmtdevincludedir = $(includedir)
libmtdevinclude_HEADERS = \
$(top_srcdir)/include/mtdev-mapping.h \
$(top_srcdir)/include/mtdev-plumbing.h \
$(top_srcdir)/include/mtdev.h
-714
View File
@@ -1,714 +0,0 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(libmtdevinclude_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(libmtdevincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libmtdev_la_LIBADD =
am_libmtdev_la_OBJECTS = caps.lo core.lo iobuf.lo match.lo \
match_four.lo
libmtdev_la_OBJECTS = $(am_libmtdev_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libmtdev_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libmtdev_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config-aux/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/caps.Plo ./$(DEPDIR)/core.Plo \
./$(DEPDIR)/iobuf.Plo ./$(DEPDIR)/match.Plo \
./$(DEPDIR)/match_four.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libmtdev_la_SOURCES)
DIST_SOURCES = $(libmtdev_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(libmtdevinclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_VERSION = @LIB_VERSION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libmtdev.la
libmtdev_la_LDFLAGS = -version-info @LIB_VERSION@
libmtdev_la_SOURCES = \
$(top_srcdir)/include/mtdev-mapping.h \
$(top_srcdir)/include/mtdev-plumbing.h \
common.h \
evbuf.h \
iobuf.h \
match.h \
state.h \
caps.c \
core.c \
iobuf.c \
match.c \
match_four.c
AM_CFLAGS = $(CWARNFLAGS) #-DMTDEV_NO_LEGACY_ABI
AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(srcdir)
libmtdevincludedir = $(includedir)
libmtdevinclude_HEADERS = \
$(top_srcdir)/include/mtdev-mapping.h \
$(top_srcdir)/include/mtdev-plumbing.h \
$(top_srcdir)/include/mtdev.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libmtdev.la: $(libmtdev_la_OBJECTS) $(libmtdev_la_DEPENDENCIES) $(EXTRA_libmtdev_la_DEPENDENCIES)
$(AM_V_CCLD)$(libmtdev_la_LINK) -rpath $(libdir) $(libmtdev_la_OBJECTS) $(libmtdev_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/core.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iobuf.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match_four.Plo@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-libmtdevincludeHEADERS: $(libmtdevinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(libmtdevinclude_HEADERS)'; test -n "$(libmtdevincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(libmtdevincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libmtdevincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libmtdevincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libmtdevincludedir)" || exit $$?; \
done
uninstall-libmtdevincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libmtdevinclude_HEADERS)'; test -n "$(libmtdevincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(libmtdevincludedir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libmtdevincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/caps.Plo
-rm -f ./$(DEPDIR)/core.Plo
-rm -f ./$(DEPDIR)/iobuf.Plo
-rm -f ./$(DEPDIR)/match.Plo
-rm -f ./$(DEPDIR)/match_four.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-libmtdevincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/caps.Plo
-rm -f ./$(DEPDIR)/core.Plo
-rm -f ./$(DEPDIR)/iobuf.Plo
-rm -f ./$(DEPDIR)/match.Plo
-rm -f ./$(DEPDIR)/match_four.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES \
uninstall-libmtdevincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES \
install-libmtdevincludeHEADERS install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
uninstall-libmtdevincludeHEADERS
.PRECIOUS: Makefile
# 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:
-228
View File
@@ -1,228 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include "state.h"
static const int SN_COORD = 250; /* coordinate signal-to-noise ratio */
static const int SN_WIDTH = 100; /* width signal-to-noise ratio */
static const int SN_ORIENT = 10; /* orientation signal-to-noise ratio */
#define LONG_BITS (sizeof(long) * 8)
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
static inline int getbit(const unsigned long *map, int key)
{
return (map[key / LONG_BITS] >> (key % LONG_BITS)) & 0x01;
}
static int getabs(struct input_absinfo *abs, int key, int fd)
{
int rc;
SYSCALL(rc = ioctl(fd, EVIOCGABS(key), abs));
return rc >= 0;
}
static struct input_absinfo *get_info(struct mtdev *dev, int code)
{
int ix;
if (code == ABS_MT_SLOT)
return &dev->slot;
if (!mtdev_is_absmt(code))
return NULL;
ix = mtdev_abs2mt(code);
if (ix < LEGACY_API_NUM_MT_AXES)
return &dev->abs[ix];
else
return &dev->state->ext_abs[ix - LEGACY_API_NUM_MT_AXES];
}
static void set_info(struct mtdev *dev, int code,
const unsigned long *bits, int fd)
{
int has = getbit(bits, code) && getabs(get_info(dev, code), code, fd);
mtdev_set_mt_event(dev, code, has);
}
static void default_fuzz(struct mtdev *dev, int code, int sn)
{
struct input_absinfo *abs = get_info(dev, code);
if (!mtdev_has_mt_event(dev, code) || abs->fuzz)
return;
abs->fuzz = (abs->maximum - abs->minimum) / sn;
}
static int mtdev_set_slots(struct mtdev *dev, int fd)
{
struct { unsigned code; int values[DIM_FINGER]; } req;
struct mtdev_state *state = dev->state;
int rc, i, s, nslot;
nslot = mtdev_get_abs_maximum(dev, ABS_MT_SLOT) + 1;
for (i = 0; i < MT_ABS_SIZE; i++) {
req.code = mtdev_mt2abs(i);
if (!mtdev_has_mt_event(dev, req.code))
continue;
SYSCALL(rc = ioctl(fd, EVIOCGMTSLOTS(sizeof(req)), &req));
if (rc < 0)
return rc;
for (s = 0; s < DIM_FINGER && s < nslot; s++)
set_sval(&state->data[s], i, req.values[s]);
}
return 0;
}
int mtdev_configure(struct mtdev *dev, int fd)
{
unsigned long absbits[NLONGS(ABS_MAX)];
int rc, i;
SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
if (rc < 0)
return rc;
set_info(dev, ABS_MT_SLOT, absbits, fd);
for (i = 0; i < MT_ABS_SIZE; i++)
set_info(dev, mtdev_mt2abs(i), absbits, fd);
dev->has_mtdata = mtdev_has_mt_event(dev, ABS_MT_POSITION_X) &&
mtdev_has_mt_event(dev, ABS_MT_POSITION_Y);
if (!mtdev_has_mt_event(dev, ABS_MT_POSITION_X))
getabs(get_info(dev, ABS_MT_POSITION_X), ABS_X, fd);
if (!mtdev_has_mt_event(dev, ABS_MT_POSITION_Y))
getabs(get_info(dev, ABS_MT_POSITION_Y), ABS_Y, fd);
if (!mtdev_has_mt_event(dev, ABS_MT_PRESSURE))
getabs(get_info(dev, ABS_MT_PRESSURE), ABS_PRESSURE, fd);
if (!mtdev_has_mt_event(dev, ABS_MT_TRACKING_ID)) {
mtdev_set_abs_minimum(dev, ABS_MT_TRACKING_ID, MT_ID_MIN);
mtdev_set_abs_maximum(dev, ABS_MT_TRACKING_ID, MT_ID_MAX);
}
default_fuzz(dev, ABS_MT_POSITION_X, SN_COORD);
default_fuzz(dev, ABS_MT_POSITION_Y, SN_COORD);
default_fuzz(dev, ABS_MT_TOUCH_MAJOR, SN_WIDTH);
default_fuzz(dev, ABS_MT_TOUCH_MINOR, SN_WIDTH);
default_fuzz(dev, ABS_MT_WIDTH_MAJOR, SN_WIDTH);
default_fuzz(dev, ABS_MT_WIDTH_MINOR, SN_WIDTH);
default_fuzz(dev, ABS_MT_ORIENTATION, SN_ORIENT);
if (dev->has_slot)
mtdev_set_slots(dev, fd);
return 0;
}
int mtdev_has_mt_event(const struct mtdev *dev, int code)
{
int ix;
if (code == ABS_MT_SLOT)
return dev->has_slot;
if (!mtdev_is_absmt(code))
return 0;
ix = mtdev_abs2mt(code);
if (ix < LEGACY_API_NUM_MT_AXES)
return dev->has_abs[ix];
else
return dev->state->has_ext_abs[ix - LEGACY_API_NUM_MT_AXES];
}
int mtdev_get_abs_minimum(const struct mtdev *dev, int code)
{
const struct input_absinfo *abs = get_info((struct mtdev *)dev, code);
return abs ? abs->minimum : 0;
}
int mtdev_get_abs_maximum(const struct mtdev *dev, int code)
{
const struct input_absinfo *abs = get_info((struct mtdev *)dev, code);
return abs ? abs->maximum : 0;
}
int mtdev_get_abs_fuzz(const struct mtdev *dev, int code)
{
const struct input_absinfo *abs = get_info((struct mtdev *)dev, code);
return abs ? abs->fuzz : 0;
}
int mtdev_get_abs_resolution(const struct mtdev *dev, int code)
{
const struct input_absinfo *abs = get_info((struct mtdev *)dev, code);
return abs ? abs->resolution : 0;
}
void mtdev_set_abs_minimum(struct mtdev *dev, int code, int value)
{
struct input_absinfo *abs = get_info(dev, code);
if (abs)
abs->minimum = value;
}
void mtdev_set_mt_event(struct mtdev *dev, int code, int value)
{
int ix;
if (code == ABS_MT_SLOT)
dev->has_slot = value;
if (!mtdev_is_absmt(code))
return;
ix = mtdev_abs2mt(code);
if (ix < LEGACY_API_NUM_MT_AXES)
dev->has_abs[ix] = value;
else
dev->state->has_ext_abs[ix - LEGACY_API_NUM_MT_AXES] = value;
}
void mtdev_set_abs_maximum(struct mtdev *dev, int code, int value)
{
struct input_absinfo *abs = get_info(dev, code);
if (abs)
abs->maximum = value;
}
void mtdev_set_abs_fuzz(struct mtdev *dev, int code, int value)
{
struct input_absinfo *abs = get_info(dev, code);
if (abs)
abs->fuzz = value;
}
void mtdev_set_abs_resolution(struct mtdev *dev, int code, int value)
{
struct input_absinfo *abs = get_info(dev, code);
if (abs)
abs->resolution = value;
}
-155
View File
@@ -1,155 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef COMMON_H
#define COMMON_H
#define MTDEV_NO_LEGACY_API
#include <mtdev-mapping.h>
#include <mtdev-plumbing.h>
#include <malloc.h>
#include <string.h>
#include <errno.h>
#define DIM_FINGER 32
#define DIM2_FINGER (DIM_FINGER * DIM_FINGER)
/* event buffer size (must be a power of two) */
#define DIM_EVENTS 512
/* all bit masks have this type */
typedef unsigned int bitmask_t;
#define BITMASK(x) (1U << (x))
#define BITONES(x) (BITMASK(x) - 1U)
#define GETBIT(m, x) (((m) >> (x)) & 1U)
#define SETBIT(m, x) (m |= BITMASK(x))
#define CLEARBIT(m, x) (m &= ~BITMASK(x))
#define MODBIT(m, x, b) ((b) ? SETBIT(m, x) : CLEARBIT(m, x))
static inline int maxval(int x, int y) { return x > y ? x : y; }
static inline int minval(int x, int y) { return x < y ? x : y; }
static inline int clamp15(int x)
{
return x < -32767 ? -32767 : x > 32767 ? 32767 : x;
}
/* absolute scale is assumed to fit in 15 bits */
static inline int dist2(int dx, int dy)
{
dx = clamp15(dx);
dy = clamp15(dy);
return dx * dx + dy * dy;
}
/* Count number of bits (Sean Eron Andersson's Bit Hacks) */
static inline int bitcount(unsigned v)
{
v -= ((v>>1) & 0x55555555);
v = (v&0x33333333) + ((v>>2) & 0x33333333);
return (((v + (v>>4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}
/* Return index of first bit [0-31], -1 on zero */
#define firstbit(v) (__builtin_ffs(v) - 1)
/* boost-style foreach bit */
#define foreach_bit(i, m) \
for (i = firstbit(m); i >= 0; i = firstbit((m) & (~0U << (i + 1))))
/* robust system ioctl calls */
#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
/* To be compatible to the original, non-opaque mtdev API, we can only use 11
* axes in the basic struct. Everything else is hidden in the state, see the
* use of dev->abs[idx] vs dev->state->ext_abs[idx]
*
* See MT_ABS_SIZE in include/mtdev.h
*/
#define LEGACY_API_NUM_MT_AXES 11
/**
* struct mtdev - represents an input MT device
* @has_mtdata: true if the device has MT capabilities
* @has_slot: true if the device sends MT slots
* @slot: slot event properties
* @abs: ABS_MT event properties
* @state: internal mtdev parsing state
*
* The mtdev structure represents a kernel MT device type B, emitting
* MT slot events. The events put into mtdev may be from any MT
* device, specifically type A without contact tracking, type A with
* contact tracking, or type B with contact tracking. See the kernel
* documentation for further details.
*
*/
struct mtdev {
int has_mtdata;
int has_slot;
int has_abs[LEGACY_API_NUM_MT_AXES];
struct input_absinfo slot;
struct input_absinfo abs[LEGACY_API_NUM_MT_AXES];
struct mtdev_state *state;
};
#define MT_ABS_SIZE 12
static const unsigned int mtdev_map_abs2mt[ABS_CNT] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
0x0009, 0x000a, 0x000b, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000,
};
static const unsigned int mtdev_map_mt2abs[MT_ABS_SIZE] = {
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a, 0x003b,
};
static inline int mtdev_is_absmt(unsigned int code)
{
return mtdev_map_abs2mt[code];
}
static inline unsigned int mtdev_abs2mt(unsigned int code)
{
return mtdev_map_abs2mt[code] - 1;
}
static inline unsigned int mtdev_mt2abs(unsigned int mtcode)
{
return mtdev_map_mt2abs[mtcode];
}
#endif
-432
View File
@@ -1,432 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include "state.h"
#include "iobuf.h"
#include "evbuf.h"
#include "match.h"
#ifndef input_event_sec
#define input_event_sec time.tv_sec
#define input_event_usec time.tv_usec
#endif
static inline int istouch(const struct mtdev_slot *data,
const struct mtdev *dev)
{
return data->touch_major ||
!mtdev_has_mt_event(dev, ABS_MT_TOUCH_MAJOR);
}
static inline int isfilled(unsigned int mask)
{
return GETBIT(mask, mtdev_abs2mt(ABS_MT_POSITION_X)) &&
GETBIT(mask, mtdev_abs2mt(ABS_MT_POSITION_Y));
}
/* Response-augmented EWMA filter, courtesy of Vojtech Pavlik */
static int defuzz(int value, int old_val, int fuzz)
{
if (fuzz) {
if (value > old_val - fuzz / 2 && value < old_val + fuzz / 2)
return old_val;
if (value > old_val - fuzz && value < old_val + fuzz)
return (old_val * 3 + value) / 4;
if (value > old_val - fuzz * 2 && value < old_val + fuzz * 2)
return (old_val + value) / 2;
}
return value;
}
/*
* solve - solve contact matching problem
* @state: mtdev state
* @dev: device capabilities
* @sid: array of current tracking ids
* @sx: array of current position x
* @sy: array of current position y
* @sn: number of current contacts
* @nid: array of new or matched tracking ids, to be filled
* @nx: array of new position x
* @ny: array of new position y
* @nn: number of new contacts
* @touch: which of the new contacts to fill
*/
static void solve(struct mtdev_state *state, const struct mtdev *dev,
const int *sid, const int *sx, const int *sy, int sn,
int *nid, const int *nx, const int *ny, int nn,
bitmask_t touch)
{
int A[DIM2_FINGER], *row;
int n2s[DIM_FINGER];
int id, i, j;
/* setup distance matrix for contact matching */
for (j = 0; j < sn; j++) {
row = A + nn * j;
for (i = 0; i < nn; i++)
row[i] = dist2(nx[i] - sx[j], ny[i] - sy[j]);
}
mtdev_match(n2s, A, nn, sn);
/* update matched contacts and create new ones */
foreach_bit(i, touch) {
j = n2s[i];
id = j >= 0 ? sid[j] : MT_ID_NULL;
if (id == MT_ID_NULL)
id = state->lastid++ & MT_ID_MAX;
nid[i] = id;
}
}
/*
* assign_tracking_id - assign tracking ids to all contacts
* @state: mtdev state
* @dev: device capabilities
* @data: array of all present contacts, to be filled
* @prop: array of all set contacts properties
* @size: number of contacts in array
* @touch: which of the contacts are actual touches
*/
static void assign_tracking_id(struct mtdev_state *state,
const struct mtdev *dev,
struct mtdev_slot *data, bitmask_t *prop,
int size, bitmask_t touch)
{
int sid[DIM_FINGER], sx[DIM_FINGER], sy[DIM_FINGER], sn = 0;
int nid[DIM_FINGER], nx[DIM_FINGER], ny[DIM_FINGER], i;
foreach_bit(i, state->used) {
sid[sn] = state->data[i].tracking_id;
sx[sn] = state->data[i].position_x;
sy[sn] = state->data[i].position_y;
sn++;
}
for (i = 0; i < size; i++) {
nx[i] = data[i].position_x;
ny[i] = data[i].position_y;
}
solve(state, dev, sid, sx, sy, sn, nid, nx, ny, size, touch);
for (i = 0; i < size; i++) {
data[i].tracking_id = GETBIT(touch, i) ? nid[i] : MT_ID_NULL;
SETBIT(prop[i], mtdev_abs2mt(ABS_MT_TRACKING_ID));
}
}
/*
* process_typeA - consume MT events and update mtdev state
* @state: mtdev state
* @data: array of all present contacts, to be filled
* @prop: array of all set contacts properties, to be filled
*
* This function is called when a SYN_REPORT is seen, right before
* that event is pushed to the queue.
*
* Returns -1 if the packet is not MT related and should not affect
* the current mtdev state.
*/
static int process_typeA(struct mtdev_state *state,
struct mtdev_slot *data, bitmask_t *prop)
{
struct input_event ev;
int consumed, mtcode;
int mtcnt = 0, size = 0;
prop[size] = 0;
while (!evbuf_empty(&state->inbuf)) {
evbuf_get(&state->inbuf, &ev);
consumed = 0;
switch (ev.type) {
case EV_SYN:
switch (ev.code) {
case SYN_MT_REPORT:
if (size < DIM_FINGER && isfilled(prop[size]))
size++;
if (size < DIM_FINGER)
prop[size] = 0;
mtcnt++;
consumed = 1;
break;
}
break;
case EV_KEY:
switch (ev.code) {
case BTN_TOUCH:
mtcnt++;
break;
}
break;
case EV_ABS:
if (size < DIM_FINGER && mtdev_is_absmt(ev.code)) {
mtcode = mtdev_abs2mt(ev.code);
set_sval(&data[size], mtcode, ev.value);
SETBIT(prop[size], mtcode);
mtcnt++;
consumed = 1;
}
break;
}
if (!consumed)
evbuf_put(&state->outbuf, &ev);
}
return mtcnt ? size : -1;
}
/*
* process_typeB - propagate events without parsing
* @state: mtdev state
*
* This function is called when a SYN_REPORT is seen, right before
* that event is pushed to the queue.
*/
static void process_typeB(struct mtdev_state *state)
{
struct input_event ev;
while (!evbuf_empty(&state->inbuf)) {
evbuf_get(&state->inbuf, &ev);
evbuf_put(&state->outbuf, &ev);
}
}
/*
* filter_data - apply input filtering on new incoming data
* @state: mtdev state
* @dev: device capabilities
* @data: the incoming data to filter
* @prop: the properties to filter
* @slot: the slot the data refers to
*/
static void filter_data(const struct mtdev_state *state,
const struct mtdev *dev,
struct mtdev_slot *data, bitmask_t prop,
int slot)
{
int i;
foreach_bit(i, prop) {
int fuzz = mtdev_get_abs_fuzz(dev, mtdev_mt2abs(i));
int oldval = get_sval(&state->data[slot], i);
int value = get_sval(data, i);
set_sval(data, i, defuzz(value, oldval, fuzz));
}
}
/*
* push_slot_changes - propagate state changes
* @state: mtdev state
* @data: the incoming data to propagate
* @prop: the properties to propagate
* @slot: the slot the data refers to
* @syn: reference to the SYN_REPORT event
*/
static void push_slot_changes(struct mtdev_state *state,
const struct mtdev_slot *data, bitmask_t prop,
int slot, const struct input_event *syn)
{
struct input_event ev;
int i, count = 0;
foreach_bit(i, prop)
if (get_sval(&state->data[slot], i) != get_sval(data, i))
count++;
if (!count)
return;
ev.input_event_sec = syn->input_event_sec;
ev.input_event_usec = syn->input_event_usec;
ev.type = EV_ABS;
ev.code = ABS_MT_SLOT;
ev.value = slot;
if (state->slot != ev.value) {
evbuf_put(&state->outbuf, &ev);
state->slot = ev.value;
}
foreach_bit(i, prop) {
ev.code = mtdev_mt2abs(i);
ev.value = get_sval(data, i);
if (get_sval(&state->data[slot], i) != ev.value) {
evbuf_put(&state->outbuf, &ev);
set_sval(&state->data[slot], i, ev.value);
}
}
}
/*
* apply_typeA_changes - parse and propagate state changes
* @state: mtdev state
* @dev: device capabilities
* @data: array of data to apply
* @prop: array of properties to apply
* @size: number of contacts in array
* @syn: reference to the SYN_REPORT event
*/
static void apply_typeA_changes(struct mtdev_state *state,
const struct mtdev *dev,
struct mtdev_slot *data, const bitmask_t *prop,
int size, const struct input_event *syn)
{
bitmask_t unused = ~state->used;
bitmask_t used = 0;
int i, slot, id;
for (i = 0; i < size; i++) {
id = data[i].tracking_id;
foreach_bit(slot, state->used) {
if (state->data[slot].tracking_id != id)
continue;
filter_data(state, dev, &data[i], prop[i], slot);
push_slot_changes(state, &data[i], prop[i], slot, syn);
SETBIT(used, slot);
id = MT_ID_NULL;
break;
}
if (id != MT_ID_NULL) {
slot = firstbit(unused);
push_slot_changes(state, &data[i], prop[i], slot, syn);
SETBIT(used, slot);
CLEARBIT(unused, slot);
}
}
/* clear unused slots and update slot usage */
foreach_bit(slot, state->used & ~used) {
struct mtdev_slot tdata = state->data[slot];
bitmask_t tprop = BITMASK(mtdev_abs2mt(ABS_MT_TRACKING_ID));
tdata.tracking_id = MT_ID_NULL;
push_slot_changes(state, &tdata, tprop, slot, syn);
}
state->used = used;
}
/*
* convert_A_to_B - propagate a type A packet as a type B packet
* @state: mtdev state
* @dev: device capabilities
* @syn: reference to the SYN_REPORT event
*/
static void convert_A_to_B(struct mtdev_state *state,
const struct mtdev *dev,
const struct input_event *syn)
{
struct mtdev_slot data[DIM_FINGER];
bitmask_t prop[DIM_FINGER];
int size = process_typeA(state, data, prop);
if (size < 0)
return;
if (!mtdev_has_mt_event(dev, ABS_MT_TRACKING_ID)) {
bitmask_t touch = 0;
int i;
for (i = 0; i < size; i++)
MODBIT(touch, i, istouch(&data[i], dev));
assign_tracking_id(state, dev, data, prop, size, touch);
}
apply_typeA_changes(state, dev, data, prop, size, syn);
}
struct mtdev *mtdev_new(void)
{
return calloc(1, sizeof(struct mtdev));
}
int mtdev_init(struct mtdev *dev)
{
int i;
memset(dev, 0, sizeof(struct mtdev));
dev->state = calloc(1, sizeof(struct mtdev_state));
if (!dev->state)
return -ENOMEM;
for (i = 0; i < DIM_FINGER; i++)
dev->state->data[i].tracking_id = MT_ID_NULL;
return 0;
}
int mtdev_open(struct mtdev *dev, int fd)
{
int ret = -EINVAL;
if (!dev || fd < 0)
goto error;
ret = mtdev_init(dev);
if (ret)
goto error;
ret = mtdev_configure(dev, fd);
if (ret)
goto error;
return 0;
error:
mtdev_close(dev);
return ret;
}
struct mtdev *mtdev_new_open(int fd)
{
struct mtdev *dev;
dev = mtdev_new();
if (!dev)
return NULL;
if (!mtdev_open(dev, fd))
return dev;
mtdev_delete(dev);
return NULL;
}
void mtdev_put_event(struct mtdev *dev, const struct input_event *ev)
{
struct mtdev_state *state = dev->state;
if (ev->type == EV_SYN && ev->code == SYN_REPORT) {
bitmask_t head = state->outbuf.head;
if (mtdev_has_mt_event(dev, ABS_MT_SLOT))
process_typeB(state);
else
convert_A_to_B(state, dev, ev);
if (state->outbuf.head != head)
evbuf_put(&state->outbuf, ev);
} else {
evbuf_put(&state->inbuf, ev);
}
}
void mtdev_close_delete(struct mtdev *dev)
{
mtdev_close(dev);
mtdev_delete(dev);
}
void mtdev_close(struct mtdev *dev)
{
if (dev) {
free(dev->state);
memset(dev, 0, sizeof(struct mtdev));
}
}
void mtdev_delete(struct mtdev *dev)
{
free(dev);
}
-59
View File
@@ -1,59 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef MTDEV_EVBUF_H
#define MTDEV_EVBUF_H
#include "common.h"
struct mtdev_evbuf {
int head;
int tail;
struct input_event buffer[DIM_EVENTS];
};
static inline int evbuf_empty(const struct mtdev_evbuf *evbuf)
{
return evbuf->head == evbuf->tail;
}
static inline void evbuf_put(struct mtdev_evbuf *evbuf,
const struct input_event *ev)
{
evbuf->buffer[evbuf->head++] = *ev;
evbuf->head &= DIM_EVENTS - 1;
}
static inline void evbuf_get(struct mtdev_evbuf *evbuf,
struct input_event *ev)
{
*ev = evbuf->buffer[evbuf->tail++];
evbuf->tail &= DIM_EVENTS - 1;
}
#endif
-87
View File
@@ -1,87 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include "iobuf.h"
#include "state.h"
#include <unistd.h>
#include <poll.h>
int mtdev_idle(struct mtdev *dev, int fd, int ms)
{
struct mtdev_iobuf *buf = &dev->state->iobuf;
struct pollfd fds = { fd, POLLIN, 0 };
return buf->head == buf->tail && poll(&fds, 1, ms) <= 0;
}
int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev)
{
struct mtdev_iobuf *buf = &dev->state->iobuf;
int n = buf->head - buf->tail;
if (n < EVENT_SIZE) {
if (buf->tail && n > 0)
memmove(buf->data, buf->data + buf->tail, n);
buf->head = n;
buf->tail = 0;
SYSCALL(n = read(fd, buf->data + buf->head,
DIM_BUFFER - buf->head));
if (n <= 0)
return n;
buf->head += n;
}
if (buf->head - buf->tail < EVENT_SIZE)
return 0;
memcpy(ev, buf->data + buf->tail, EVENT_SIZE);
buf->tail += EVENT_SIZE;
return 1;
}
int mtdev_empty(struct mtdev *dev)
{
return evbuf_empty(&dev->state->outbuf);
}
void mtdev_get_event(struct mtdev *dev, struct input_event* ev)
{
evbuf_get(&dev->state->outbuf, ev);
}
int mtdev_get(struct mtdev *dev, int fd, struct input_event* ev, int ev_max)
{
struct input_event kev;
int ret, count = 0;
while (count < ev_max) {
while (mtdev_empty(dev)) {
ret = mtdev_fetch_event(dev, fd, &kev);
if (ret <= 0)
return count > 0 ? count : ret;
mtdev_put_event(dev, &kev);
}
mtdev_get_event(dev, &ev[count++]);
}
return count;
}
-42
View File
@@ -1,42 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef MTDEV_IOBUF_H
#define MTDEV_IOBUF_H
#include "common.h"
#define EVENT_SIZE sizeof(struct input_event)
#define DIM_BUFFER (DIM_EVENTS * EVENT_SIZE)
struct mtdev_iobuf {
int head, tail;
char data[DIM_BUFFER];
};
#endif
-390
View File
@@ -1,390 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include "match.h"
#include <string.h>
#include <stdio.h>
/**
* Bitmap implementation of the hungarian algorithm (MIT license)
*
* Copyright (C) 2008 Henrik Rydberg <rydberg@euromail.se>
*
* Based on code released by Markus Buehren (2004) (BSD license)
*
* Copyright (C) 2004, Markus Buehren. All rights reserved.
*/
typedef unsigned col_t[1];
typedef unsigned mat_t[DIM_FINGER];
#define GET1(m, x) ((m[0] >> (x)) & 1U)
#define SET1(m, x) (m[0] |= (1U << (x)))
#define CLEAR1(m, x) (m[0] &= ~(1U << (x)))
#define GET2(m, row, col) ((m[col] >> (row)) & 1U)
#define SET2(m, row, col) (m[col] |= (1U << (row)))
#define CLEAR2(m, row, col) (m[col] &= ~(1U << (row)))
/********************************************************/
static void buildixvector(int *ix, mat_t mstar, int nrows, int ncols)
{
int row, col;
for (row = 0; row < nrows; row++) {
for (col = 0; col < ncols; col++) {
if (GET2(mstar, row, col)) {
ix[row] = col;
break;
}
}
}
}
/********************************************************/
static void step2a(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin);
static void step2b(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin);
static void step3(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin);
static void step4(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin, int row, int col);
static void step5(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin);
static void ixoptimal(int *ix, int *mdist, int nrows, int ncols)
{
int *mdistTemp, *mdistEnd, *columnEnd, value, minValue;
int dmin, row, col;
col_t ccol, crow;
mat_t mstar, mprime, nmstar;
memset(ccol, 0, sizeof(col_t));
memset(crow, 0, sizeof(col_t));
memset(mstar, 0, sizeof(mat_t));
memset(mprime, 0, sizeof(mat_t));
memset(nmstar, 0, sizeof(mat_t));
/* initialization */
for (row = 0; row < nrows; row++)
ix[row] = -1;
mdistEnd = mdist + nrows * ncols;
/* preliminary steps */
if (nrows <= ncols) {
dmin = nrows;
for (row = 0; row < nrows; row++) {
/* find the smallest element in the row */
mdistTemp = mdist + row;
minValue = *mdistTemp;
mdistTemp += nrows;
while (mdistTemp < mdistEnd) {
value = *mdistTemp;
if (value < minValue)
minValue = value;
mdistTemp += nrows;
}
/* subtract the smallest element from each element
of the row */
mdistTemp = mdist + row;
while (mdistTemp < mdistEnd) {
*mdistTemp -= minValue;
mdistTemp += nrows;
}
}
/* Steps 1 and 2a */
for (row = 0; row < nrows; row++) {
for (col = 0; col < ncols; col++) {
if (mdist[row + nrows * col] != 0)
continue;
if (GET1(ccol, col))
continue;
SET2(mstar, row, col);
SET1(ccol, col);
break;
}
}
} else {
dmin = ncols;
for (col = 0; col < ncols; col++) {
/* find the smallest element in the column */
mdistTemp = mdist + nrows*col;
columnEnd = mdistTemp + nrows;
minValue = *mdistTemp++;
while (mdistTemp < columnEnd) {
value = *mdistTemp++;
if (value < minValue)
minValue = value;
}
/* subtract the smallest element from each element
of the column */
mdistTemp = mdist + nrows*col;
while (mdistTemp < columnEnd)
*mdistTemp++ -= minValue;
}
/* Steps 1 and 2a */
for (col = 0; col < ncols; col++) {
for (row = 0; row < nrows; row++) {
if (mdist[row + nrows * col] != 0)
continue;
if (GET1(crow, row))
continue;
SET2(mstar, row, col);
SET1(ccol, col);
SET1(crow, row);
break;
}
}
memset(crow, 0, sizeof(col_t));
}
/* move to step 2b */
step2b(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
/********************************************************/
static void step2a(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin)
{
int col, row;
/* cover every column containing a starred zero */
for (col = 0; col < ncols; col++) {
for (row = 0; row < nrows; row++) {
if (!GET2(mstar, row, col))
continue;
SET1(ccol, col);
break;
}
}
/* move to step 3 */
step2b(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
/********************************************************/
static void step2b(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin)
{
int col, ncc;
/* count covered columns */
ncc = 0;
for (col = 0; col < ncols; col++)
if (GET1(ccol, col))
ncc++;
if (ncc == dmin) {
/* algorithm finished */
buildixvector(ix, mstar, nrows, ncols);
} else {
/* move to step 3 */
step3(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
}
/********************************************************/
static void step3(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin)
{
int zerosFound;
int row, col, cstar;
zerosFound = 1;
while (zerosFound) {
zerosFound = 0;
for (col = 0; col < ncols; col++) {
if (GET1(ccol, col))
continue;
for (row = 0; row < nrows; row++) {
if (mdist[row + nrows * col] != 0)
continue;
if (GET1(crow, row))
continue;
/* prime zero */
SET2(mprime, row, col);
/* find starred zero in current row */
for (cstar = 0; cstar < ncols; cstar++)
if (GET2(mstar, row, cstar))
break;
if (cstar == ncols) { /* no starred zero */
/* move to step 4 */
step4(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin, row, col);
return;
} else {
SET1(crow, row);
CLEAR1(ccol, cstar);
zerosFound = 1;
break;
}
}
}
}
/* move to step 5 */
step5(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
/********************************************************/
static void step4(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin, int row, int col)
{
int rstar, cstar, primeRow, primeCol;
/* generate temporary copy of mstar */
memcpy(nmstar, mstar, sizeof(mat_t));
/* star current zero */
SET2(nmstar, row, col);
/* find starred zero in current column */
cstar = col;
for (rstar = 0; rstar < nrows; rstar++)
if (GET2(mstar, rstar, cstar))
break;
while (rstar < nrows) {
/* unstar the starred zero */
CLEAR2(nmstar, rstar, cstar);
/* find primed zero in current row */
primeRow = rstar;
for (primeCol = 0; primeCol < ncols; primeCol++)
if (GET2(mprime, primeRow, primeCol))
break;
/* star the primed zero */
SET2(nmstar, primeRow, primeCol);
/* find starred zero in current column */
cstar = primeCol;
for (rstar = 0; rstar < nrows; rstar++)
if (GET2(mstar, rstar, cstar))
break;
}
/* use temporary copy as new mstar */
/* delete all primes, uncover all rows */
memcpy(mstar, nmstar, sizeof(mat_t));
memset(mprime, 0, sizeof(mat_t));
memset(crow, 0, sizeof(col_t));
/* move to step 2a */
step2a(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
/********************************************************/
static void step5(int *ix, int *mdist, mat_t mstar, mat_t nmstar,
mat_t mprime, col_t ccol, col_t crow, int nrows, int ncols,
int dmin)
{
int h = 0, value;
int row, col, found = 0;
/* find smallest uncovered element h */
for (row = 0; row < nrows; row++) {
if (GET1(crow, row))
continue;
for (col = 0; col < ncols; col++) {
if (GET1(ccol, col))
continue;
value = mdist[row + nrows * col];
if (!found || value < h) {
h = value;
found = 1;
}
}
}
/* where to go if nothing uncovered? */
if (!found)
return;
/* add h to each covered row */
for (row = 0; row < nrows; row++) {
if (!GET1(crow, row))
continue;
for (col = 0; col < ncols; col++)
mdist[row + nrows * col] += h;
}
/* subtract h from each uncovered column */
for (col = 0; col < ncols; col++) {
if (GET1(ccol, col))
continue;
for (row = 0; row < nrows; row++)
mdist[row + nrows * col] -= h;
}
/* move to step 3 */
step3(ix, mdist, mstar, nmstar,
mprime, ccol, crow, nrows, ncols,
dmin);
}
void mtdev_match(int ix[DIM_FINGER], int A[DIM2_FINGER], int nrow, int ncol)
{
ixoptimal(ix, A, nrow, ncol);
}
-51
View File
@@ -1,51 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef MATCHER_H
#define MATCHER_H
/**
* Special implementation of the hungarian algorithm.
* The maximum number of fingers matches a uint32.
* Bitmasks are used extensively.
*/
#include "common.h"
void mtdev_match(int index[DIM_FINGER], int A[DIM2_FINGER],
int nrow, int ncol);
struct trk_coord {
int x;
int y;
};
const unsigned char *mtdev_match_four(const struct trk_coord *old, int nslot,
const struct trk_coord *pos, int npos);
#endif
-130
View File
@@ -1,130 +0,0 @@
#include "match.h"
#include <limits.h>
#include <stdlib.h>
typedef unsigned char u8;
typedef unsigned int u32;
/* generated by mtdev-kernel - do not edit */
static const u8 match_data[] = {
0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 0, 0, 0, 1, 1,
1, 0, 0, 0, 1, 2, 1, 1, 0, 2, 2, 1, 2, 0, 0, 0,
1, 2, 3, 1, 1, 0, 2, 3, 2, 1, 2, 0, 3, 3, 1, 2,
3, 0, 0, 0, 1, 1, 1, 2, 1, 0, 0, 3, 0, 1, 1, 3,
1, 0, 2, 2, 3, 1, 2, 0, 0, 4, 0, 1, 2, 2, 4, 2,
1, 0, 0, 5, 0, 2, 1, 1, 5, 2, 0, 1, 1, 4, 1, 0,
2, 3, 2, 4, 1, 2, 0, 3, 3, 4, 1, 2, 3, 0, 0, 5,
0, 1, 2, 3, 2, 5, 2, 1, 0, 3, 3, 5, 2, 1, 3, 0,
0, 6, 0, 2, 1, 3, 1, 6, 2, 0, 1, 3, 3, 6, 2, 3,
1, 0, 0, 7, 0, 2, 3, 1, 1, 7, 2, 0, 3, 1, 2, 7,
2, 3, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 0, 0, 3,
0, 1, 1, 4, 2, 0, 3, 4, 2, 1, 0, 5, 0, 2, 2, 5,
1, 2, 2, 4, 6, 2, 1, 0, 1, 5, 6, 2, 0, 1, 2, 3,
7, 1, 2, 0, 0, 5, 7, 0, 2, 1, 1, 3, 8, 1, 0, 2,
0, 4, 8, 0, 1, 2, 2, 5, 8, 2, 1, 0, 3, 3, 5, 8,
2, 1, 3, 0, 1, 6, 8, 2, 0, 1, 3, 3, 6, 8, 2, 3,
1, 0, 1, 7, 8, 2, 0, 3, 1, 2, 7, 8, 2, 3, 0, 1,
2, 4, 9, 1, 2, 0, 3, 3, 4, 9, 1, 2, 3, 0, 0, 6,
9, 0, 2, 1, 3, 3, 6, 9, 3, 2, 1, 0, 0, 7, 9, 0,
2, 3, 1, 2, 7, 9, 3, 2, 0, 1, 1, 4, 10, 1, 0, 2,
3, 3, 4, 10, 1, 3, 2, 0, 0, 5, 10, 0, 1, 2, 3, 3,
5, 10, 3, 1, 2, 0, 0, 7, 10, 0, 3, 2, 1, 1, 7, 10,
3, 0, 2, 1, 1, 4, 11, 1, 0, 3, 2, 2, 4, 11, 1, 3,
0, 2, 0, 5, 11, 0, 1, 3, 2, 2, 5, 11, 3, 1, 0, 2,
0, 6, 11, 0, 3, 1, 2, 1, 6, 11, 3, 0, 1, 2, 0, 0,
1, 1, 2, 2, 3, 3, 1, 2, 1, 0, 0, 3, 0, 1, 1, 4,
2, 0, 3, 4, 2, 1, 0, 5, 0, 2, 2, 5, 1, 2, 1, 6,
3, 0, 3, 6, 3, 1, 5, 6, 3, 2, 0, 7, 0, 3, 2, 7,
1, 3, 4, 7, 2, 3, 2, 4, 6, 2, 1, 0, 1, 5, 6, 2,
0, 1, 2, 3, 7, 1, 2, 0, 0, 5, 7, 0, 2, 1, 1, 3,
8, 1, 0, 2, 0, 4, 8, 0, 1, 2, 2, 4, 9, 3, 1, 0,
1, 5, 9, 3, 0, 1, 2, 7, 9, 3, 2, 0, 5, 7, 9, 3,
2, 1, 1, 8, 9, 3, 0, 2, 4, 8, 9, 3, 1, 2, 2, 3,
10, 1, 3, 0, 0, 5, 10, 0, 3, 1, 2, 6, 10, 2, 3, 0,
5, 6, 10, 2, 3, 1, 0, 8, 10, 0, 3, 2, 3, 8, 10, 1,
3, 2, 1, 3, 11, 1, 0, 3, 0, 4, 11, 0, 1, 3, 1, 6,
11, 2, 0, 3, 4, 6, 11, 2, 1, 3, 0, 7, 11, 0, 2, 3,
3, 7, 11, 1, 2, 3, 3, 6, 9, 12, 3, 2, 1, 0, 2, 7,
9, 12, 3, 2, 0, 1, 3, 5, 10, 12, 3, 1, 2, 0, 1, 7,
10, 12, 3, 0, 2, 1, 2, 5, 11, 12, 3, 1, 0, 2, 1, 6,
11, 12, 3, 0, 1, 2, 3, 6, 8, 13, 2, 3, 1, 0, 2, 7,
8, 13, 2, 3, 0, 1, 3, 4, 10, 13, 1, 3, 2, 0, 0, 7,
10, 13, 0, 3, 2, 1, 2, 4, 11, 13, 1, 3, 0, 2, 0, 6,
11, 13, 0, 3, 1, 2, 3, 5, 8, 14, 2, 1, 3, 0, 1, 7,
8, 14, 2, 0, 3, 1, 3, 4, 9, 14, 1, 2, 3, 0, 0, 7,
9, 14, 0, 2, 3, 1, 1, 4, 11, 14, 1, 0, 3, 2, 0, 5,
11, 14, 0, 1, 3, 2, 2, 5, 8, 15, 2, 1, 0, 3, 1, 6,
8, 15, 2, 0, 1, 3, 2, 4, 9, 15, 1, 2, 0, 3, 0, 6,
9, 15, 0, 2, 1, 3, 1, 4, 10, 15, 1, 0, 2, 3, 0, 5,
10, 15, 0, 1, 2, 3,
};
/* generated by mtdev-kernel - do not edit */
static const int match_index[][5] = {
{ 0, 0, 1, 3, 6 },
{ 10, 10, 12, 18, 30 },
{ 50, 50, 54, 62, 92 },
{ 164, 164, 170, 194, 230 },
{ 398, 398, 406, 454, 598 },
{ 790 }
};
static void set_dist(u32 *dist,
const struct trk_coord *b1, const struct trk_coord *e1,
const struct trk_coord *b2, const struct trk_coord *e2)
{
const struct trk_coord *p, *q;
for (p = b1; p != e1; p++)
for (q = b2; q != e2; q++)
*dist++ = abs(q->x - p->x) + abs(q->y - p->y);
}
const u8 *mtdev_match_four(const struct trk_coord *old, int nslot,
const struct trk_coord *pos, int npos)
{
u32 d[16], obj, t;
const u8 *p, *b, *e;
const int *at;
set_dist(d, old, old + nslot, pos, pos + npos);
at = &match_index[nslot][npos];
b = &match_data[at[0]];
e = &match_data[at[1]];
obj = UINT_MAX, p = b;
switch (minval(nslot, npos)) {
case 1:
for (; b != e; b += npos) {
t = d[*b++];
if (t < obj)
obj = t, p = b;
}
break;
case 2:
for (; b != e; b += npos) {
t = d[*b++], t += d[*b++];
if (t < obj)
obj = t, p = b;
}
break;
case 3:
for (; b != e; b += npos) {
t = d[*b++], t += d[*b++], t += d[*b++];
if (t < obj)
obj = t, p = b;
}
break;
case 4:
for (; b != e; b += npos) {
t = d[*b++], t += d[*b++], t += d[*b++], t += d[*b++];
if (t < obj)
obj = t, p = b;
}
break;
}
return p;
}
-88
View File
@@ -1,88 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#ifndef MTDEV_STATE_H
#define MTDEV_STATE_H
#include "iobuf.h"
#include "evbuf.h"
/*
* struct mtdev_slot - represents the state of an input MT slot
* @abs: current values of ABS_MT axes for this slot
*/
struct mtdev_slot {
int touch_major;
int touch_minor;
int width_major;
int width_minor;
int orientation;
int position_x;
int position_y;
int tool_type;
int blob_id;
int tracking_id;
int pressure;
int distance;
};
static inline int get_sval(const struct mtdev_slot *slot, int ix)
{
return (&slot->touch_major)[ix];
}
static inline void set_sval(struct mtdev_slot *slot, int ix, int value)
{
(&slot->touch_major)[ix] = value;
}
/*
* struct mtdev_state - MT slot parsing
* @inbuf: input event buffer
* @outbuf: output event buffer
* @data: array of scratch slot data
* @used: bitmask of currently used slots
* @slot: slot currently being modified
* @lastid: last used tracking id
*/
struct mtdev_state {
int has_ext_abs[MT_ABS_SIZE - LEGACY_API_NUM_MT_AXES];
struct input_absinfo ext_abs[MT_ABS_SIZE - LEGACY_API_NUM_MT_AXES];
struct mtdev_iobuf iobuf;
struct mtdev_evbuf inbuf;
struct mtdev_evbuf outbuf;
struct mtdev_slot data[DIM_FINGER];
bitmask_t used;
bitmask_t slot;
bitmask_t lastid;
};
#endif
-15
View File
@@ -1,15 +0,0 @@
noinst_PROGRAMS = mtdev-mapgen mtdev-matching mtdev-kernel
bin_PROGRAMS = mtdev-test
AM_CPPFLAGS=-I$(top_srcdir) -I$(top_srcdir)/include/
mtdev_mapgen_SOURCES = mtdev-mapgen.c
mtdev_matching_SOURCES = mtdev-matching.c
mtdev_matching_LDFLAGS = -L$(top_builddir)/src/.libs/ -lmtdev
mtdev_test_SOURCES = mtdev-test.c
mtdev_test_LDFLAGS = -lmtdev -L$(top_builddir)/src/.libs/
mtdev_kernel_SOURCES = mtdev-kernel.c
mtdev_kernel_LDFLAGS = -L$(top_builddir)/src/.libs/ -lmtdev
-697
View File
@@ -1,697 +0,0 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = mtdev-mapgen$(EXEEXT) mtdev-matching$(EXEEXT) \
mtdev-kernel$(EXEEXT)
bin_PROGRAMS = mtdev-test$(EXEEXT)
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_mtdev_kernel_OBJECTS = mtdev-kernel.$(OBJEXT)
mtdev_kernel_OBJECTS = $(am_mtdev_kernel_OBJECTS)
mtdev_kernel_LDADD = $(LDADD)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
mtdev_kernel_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(mtdev_kernel_LDFLAGS) $(LDFLAGS) -o $@
am_mtdev_mapgen_OBJECTS = mtdev-mapgen.$(OBJEXT)
mtdev_mapgen_OBJECTS = $(am_mtdev_mapgen_OBJECTS)
mtdev_mapgen_LDADD = $(LDADD)
am_mtdev_matching_OBJECTS = mtdev-matching.$(OBJEXT)
mtdev_matching_OBJECTS = $(am_mtdev_matching_OBJECTS)
mtdev_matching_LDADD = $(LDADD)
mtdev_matching_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(mtdev_matching_LDFLAGS) $(LDFLAGS) -o \
$@
am_mtdev_test_OBJECTS = mtdev-test.$(OBJEXT)
mtdev_test_OBJECTS = $(am_mtdev_test_OBJECTS)
mtdev_test_LDADD = $(LDADD)
mtdev_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(mtdev_test_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config-aux/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/mtdev-kernel.Po \
./$(DEPDIR)/mtdev-mapgen.Po ./$(DEPDIR)/mtdev-matching.Po \
./$(DEPDIR)/mtdev-test.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(mtdev_kernel_SOURCES) $(mtdev_mapgen_SOURCES) \
$(mtdev_matching_SOURCES) $(mtdev_test_SOURCES)
DIST_SOURCES = $(mtdev_kernel_SOURCES) $(mtdev_mapgen_SOURCES) \
$(mtdev_matching_SOURCES) $(mtdev_test_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_VERSION = @LIB_VERSION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/
mtdev_mapgen_SOURCES = mtdev-mapgen.c
mtdev_matching_SOURCES = mtdev-matching.c
mtdev_matching_LDFLAGS = -L$(top_builddir)/src/.libs/ -lmtdev
mtdev_test_SOURCES = mtdev-test.c
mtdev_test_LDFLAGS = -lmtdev -L$(top_builddir)/src/.libs/
mtdev_kernel_SOURCES = mtdev-kernel.c
mtdev_kernel_LDFLAGS = -L$(top_builddir)/src/.libs/ -lmtdev
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign test/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
|| test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
mtdev-kernel$(EXEEXT): $(mtdev_kernel_OBJECTS) $(mtdev_kernel_DEPENDENCIES) $(EXTRA_mtdev_kernel_DEPENDENCIES)
@rm -f mtdev-kernel$(EXEEXT)
$(AM_V_CCLD)$(mtdev_kernel_LINK) $(mtdev_kernel_OBJECTS) $(mtdev_kernel_LDADD) $(LIBS)
mtdev-mapgen$(EXEEXT): $(mtdev_mapgen_OBJECTS) $(mtdev_mapgen_DEPENDENCIES) $(EXTRA_mtdev_mapgen_DEPENDENCIES)
@rm -f mtdev-mapgen$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(mtdev_mapgen_OBJECTS) $(mtdev_mapgen_LDADD) $(LIBS)
mtdev-matching$(EXEEXT): $(mtdev_matching_OBJECTS) $(mtdev_matching_DEPENDENCIES) $(EXTRA_mtdev_matching_DEPENDENCIES)
@rm -f mtdev-matching$(EXEEXT)
$(AM_V_CCLD)$(mtdev_matching_LINK) $(mtdev_matching_OBJECTS) $(mtdev_matching_LDADD) $(LIBS)
mtdev-test$(EXEEXT): $(mtdev_test_OBJECTS) $(mtdev_test_DEPENDENCIES) $(EXTRA_mtdev_test_DEPENDENCIES)
@rm -f mtdev-test$(EXEEXT)
$(AM_V_CCLD)$(mtdev_test_LINK) $(mtdev_test_OBJECTS) $(mtdev_test_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtdev-kernel.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtdev-mapgen.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtdev-matching.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtdev-test.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/mtdev-kernel.Po
-rm -f ./$(DEPDIR)/mtdev-mapgen.Po
-rm -f ./$(DEPDIR)/mtdev-matching.Po
-rm -f ./$(DEPDIR)/mtdev-test.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/mtdev-kernel.Po
-rm -f ./$(DEPDIR)/mtdev-mapgen.Po
-rm -f ./$(DEPDIR)/mtdev-matching.Po
-rm -f ./$(DEPDIR)/mtdev-test.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
.PRECIOUS: Makefile
# 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:
-159
View File
@@ -1,159 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include <../src/common.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*
* Combinatorial formulation
*
* x_ij = 1 if slot i and contact j are connected, zero otherwise
*
* sum_i x_ij <= 1 for all j; each contact picks at most one slot
*
* sum_j x_ij <= 1 for all i; each slot is picked by at most one contact
*
* sum_ij x_ij == min(nslot, npos); assign every contact possible
*
* Arrange x_ij as a bitmask; x_00 x_01 x_02.. x_10 x_11 x_12...
*
* Up to five slots, this is readily enumerable.
*/
#define SLOT_MAX 5
#define SLOT_CNT (SLOT_MAX + 1)
static int illegal(int nslot, int npos, unsigned x)
{
int i, j, sum;
for (j = 0; j < npos; j++) {
sum = 0;
for (i = 0; i < nslot; i++)
sum += GETBIT(x, i * npos + j);
if (sum > 1)
return 1;
}
for (i = 0; i < nslot; i++) {
sum = 0;
for (j = 0; j < npos; j++)
sum += GETBIT(x, i * npos + j);
if (sum > 1)
return 1;
}
sum = bitcount(x);
return sum != minval(nslot, npos);
}
static void get_slots(int *slots, int nslot, int npos, unsigned x)
{
int i;
memset(slots, -1, sizeof(slots[0]) * npos);
for (i = 0; i < nslot * npos; i++)
if (GETBIT(x, i))
slots[i % npos] = i / npos;
for (i = 0; i < npos; i++)
if (slots[i] < 0)
slots[i] = nslot++;
}
static int generate_assignments(int nslot, int npos)
{
static int ncol;
unsigned x, nx = BITMASK(nslot * npos);
int slots[SLOT_MAX];
int i, n = 0;
for (x = 0; x < nx; x++) {
if (illegal(nslot, npos, x))
continue;
for (i = 0; i < nslot * npos; i++) {
if (GETBIT(x, i)) {
if (ncol++ % 16 == 0)
printf("\n\t%d,", i);
else
printf(" %d,", i);
n++;
}
}
get_slots(slots, nslot, npos, x);
for (i = 0; i < npos; i++) {
if (ncol++ % 16 == 0)
printf("\n\t%d,", slots[i]);
else
printf(" %d,", slots[i]);
n++;
}
}
return n;
}
int main(int argc, char *argv[])
{
int ix[SLOT_CNT][SLOT_CNT], nix = 0;
int eslot, i, j;
if (argc < 2) {
fprintf(stderr, "usage: %s <num_slots>\n", argv[0]);
return 1;
}
eslot = atoi(argv[1]) + 1;
if (eslot > SLOT_CNT) {
fprintf(stderr, "allowed slot range: 2 - %d\n", SLOT_MAX);
return 1;
}
printf("\n/* generated by mtdev-kernel - do not edit */\n");
printf("static const u8 match_data[] = {");
for (i = 0; i < eslot; i++) {
for (j = 0; j < eslot; j++) {
ix[i][j] = nix;
nix += generate_assignments(i, j);
}
}
printf("\n};\n");
printf("\n/* generated by mtdev-kernel - do not edit */\n");
printf("static const int match_index[][%d] = {\n", eslot);
for (i = 0; i < eslot; i++) {
printf("\t{");
for (j = 0; j < eslot; j++)
printf(" %d%s", ix[i][j], j < eslot - 1 ? "," : "");
printf(" },\n");
}
printf("\t{ %d }\n", nix);
printf("};\n");
return 0;
}
-80
View File
@@ -1,80 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#define MTDEV_NO_LEGACY_API
#include <mtdev.h>
#include <stdio.h>
#define MT_ABS_SIZE 12
#define MT_SLOT_ABS_EVENTS { \
ABS_MT_TOUCH_MAJOR, \
ABS_MT_TOUCH_MINOR, \
ABS_MT_WIDTH_MAJOR, \
ABS_MT_WIDTH_MINOR, \
ABS_MT_ORIENTATION, \
ABS_MT_POSITION_X, \
ABS_MT_POSITION_Y, \
ABS_MT_TOOL_TYPE, \
ABS_MT_BLOB_ID, \
ABS_MT_TRACKING_ID, \
ABS_MT_PRESSURE, \
ABS_MT_DISTANCE, \
}
static unsigned int cabs2mt[ABS_CNT];
static unsigned int cmt2abs[MT_ABS_SIZE];
static void init_caps()
{
static const int init_abs_map[MT_ABS_SIZE] = MT_SLOT_ABS_EVENTS;
int i;
for (i = 0; i < MT_ABS_SIZE; i++) {
cabs2mt[init_abs_map[i]] = i + 1;
cmt2abs[i] = init_abs_map[i];
}
}
static inline const char *newln(int i, int n)
{
return i == n - 1 || i % 8 == 7 ? "\n" : "";
}
int main(int argc, char *argv[])
{
int i;
init_caps();
printf("static const unsigned int mtdev_map_abs2mt[ABS_CNT] = {\n");
for (i = 0; i < ABS_CNT; i++)
printf(" 0x%04x,%s", cabs2mt[i], newln(i, ABS_CNT));
printf("};\n\n");
printf("static const unsigned int mtdev_map_mt2abs[MT_ABS_SIZE] = {\n");
for (i = 0; i < MT_ABS_SIZE; i++)
printf(" 0x%04x,%s", cmt2abs[i], newln(i, MT_ABS_SIZE));
printf("};\n\n");
return 0;
}
-174
View File
@@ -1,174 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include <src/match.h>
#include <stdio.h>
#include <time.h>
#define ITS 4000000
static const int n1 = 4;
static const int n2 = 4;
static void test1()
{
int A[] = {
1013,
3030660,
3559354,
12505925,
19008450,
6946421,
6118613,
698020,
3021800,
1017,
37573,
3242018,
8152794,
1266053,
942941,
462820,
};
int index[DIM_FINGER], i;
mtdev_match(index, A, 4, 4);
for (i = 0; i < 4; i++)
printf("match[%d] = %d\n", i, index[i]);
}
static void test2()
{
int A[] = {
0,
4534330,
22653552,
12252500,
685352,
4534330,
0,
9619317,
28409530,
6710170,
22653552,
9619317,
0,
47015292,
29788572,
2809040,
10428866,
38615920,
17732500,
719528,
12113945,
28196220,
46778656,
405,
14175493,
};
int index[DIM_FINGER], i;
mtdev_match(index, A, 5, 5);
for (i = 0; i < 5; i++)
printf("match[%d] = %d\n", i, index[i]);
}
static void speed1()
{
/* column-by-column matrix */
int A[DIM2_FINGER];
int x1[DIM_FINGER] = { 1, 5, 2, 3, 4, 5, 6, 7, 8 };
int y1[DIM_FINGER] = { 1, 5, 2, 3, 4, 6, 6, 7, 8 };
int x2[DIM_FINGER] = { 1, 3, 2, 4, 5, 6, 7, 8 };
int y2[DIM_FINGER] = { 1, 3, 2, 4, 5, 6, 7, 8 };
int index[DIM_FINGER];
int i, j, k;
clock_t t1 = clock();
for (k = 0; k < ITS; k++) {
for (i = 0; i < n1; i++) {
for (j = 0; j < n2; j++) {
A[i + n1 * j] =
(x1[i] - x2[j]) * (x1[i] - x2[j]) +
(y1[i] - y2[j]) * (y1[i] - y2[j]);
}
}
mtdev_match(index, A, n1, n2);
}
clock_t t2 = clock();
printf("%lf matches per second\n",
ITS * ((float)CLOCKS_PER_SEC / (t2 - t1)));
for (i = 0; i < n1; i++)
printf("match[%d] = %d\n", i, index[i]);
}
static void speed2()
{
struct trk_coord p1[] = {
{ 1, 1 },
{ 5, 5 },
{ 2, 2 },
{ 3, 3 },
{ 4, 4 },
};
struct trk_coord p2[] = {
{ 1, 1 },
{ 3, 3 },
{ 2, 2 },
{ 4, 4 },
{ 5, 5 },
};
const unsigned char *p;
int i;
clock_t t1 = clock();
for (i = 0; i < ITS; i++)
p = mtdev_match_four(p1, n1, p2, n2);
clock_t t2 = clock();
printf("%lf matches per second\n",
ITS * ((float)CLOCKS_PER_SEC / (t2 - t1)));
for (i = 0; i < n2; i++)
printf("match[%d] = %d\n", i, p[i]);
}
int main(int argc, char *argv[])
{
printf("test1\n");
test1();
printf("test2\n");
test2();
printf("speed1\n");
speed1();
printf("speed2\n");
speed2();
printf("done\n");
return 0;
}
-126
View File
@@ -1,126 +0,0 @@
/*****************************************************************************
*
* mtdev - Multitouch Protocol Translation Library (MIT license)
*
* Copyright (C) 2010 Henrik Rydberg <rydberg@euromail.se>
* Copyright (C) 2010 Canonical Ltd.
*
* 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.
*
****************************************************************************/
#include <mtdev.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdint.h>
#ifndef input_event_sec
#define input_event_sec time.tv_sec
#define input_event_usec time.tv_usec
#endif
/* year-proof millisecond event time */
typedef uint64_t mstime_t;
static int use_event(const struct input_event *ev)
{
#if 0
return ev->type == EV_ABS && mtdev_is_absmt(ev->code);
#else
return 1;
#endif
}
static void print_event(const struct input_event *ev)
{
static const mstime_t ms = 1000;
static int slot;
mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms;
if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT)
slot = ev->value;
fprintf(stderr, "%012llx %02d %01d %04x %d\n",
evtime, slot, ev->type, ev->code, ev->value);
}
#define CHECK(dev, name) \
if (mtdev_has_mt_event(dev, name)) \
fprintf(stderr, " %s\n", #name)
static void show_props(const struct mtdev *dev)
{
fprintf(stderr, "supported mt events:\n");
CHECK(dev, ABS_MT_SLOT);
CHECK(dev, ABS_MT_TOUCH_MAJOR);
CHECK(dev, ABS_MT_TOUCH_MINOR);
CHECK(dev, ABS_MT_WIDTH_MAJOR);
CHECK(dev, ABS_MT_WIDTH_MINOR);
CHECK(dev, ABS_MT_ORIENTATION);
CHECK(dev, ABS_MT_POSITION_X);
CHECK(dev, ABS_MT_POSITION_Y);
CHECK(dev, ABS_MT_TOOL_TYPE);
CHECK(dev, ABS_MT_BLOB_ID);
CHECK(dev, ABS_MT_TRACKING_ID);
CHECK(dev, ABS_MT_PRESSURE);
CHECK(dev, ABS_MT_DISTANCE);
}
static void loop_device(int fd)
{
struct mtdev dev;
struct input_event ev;
int ret = mtdev_open(&dev, fd);
if (ret) {
fprintf(stderr, "error: could not open device: %d\n", ret);
return;
}
show_props(&dev);
/* while the device has not been inactive for five seconds */
while (!mtdev_idle(&dev, fd, 5000)) {
/* extract all available processed events */
while (mtdev_get(&dev, fd, &ev, 1) > 0) {
if (use_event(&ev))
print_event(&ev);
}
}
mtdev_close(&dev);
}
int main(int argc, char *argv[])
{
int fd;
if (argc < 2) {
fprintf(stderr, "Usage: mtdev <device>\n");
return -1;
}
fd = open(argv[1], O_RDONLY | O_NONBLOCK);
if (fd < 0) {
fprintf(stderr, "error: could not open device\n");
return -1;
}
if (ioctl(fd, EVIOCGRAB, 1)) {
fprintf(stderr, "error: could not grab the device\n");
return -1;
}
loop_device(fd);
ioctl(fd, EVIOCGRAB, 0);
close(fd);
return 0;
}