chiark / gitweb /
Button zones: Remove inexplicable pad_with/2 offset
[xf86-input-mtrack.git] / configure.ac
1 # Initialize Autoconf
2 AC_PREREQ([2.60])
3 AC_INIT([xf86-input-mtrack],
4         [0.2.0],
5         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
6         [xf86-input-mtrack])
7 AC_CONFIG_MACRO_DIR([m4])
8 AC_CONFIG_SRCDIR([Makefile.am])
9 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_AUX_DIR(.)
11
12 # Initialize Automake
13 AM_INIT_AUTOMAKE([foreign subdir-objects])
14 AM_MAINTAINER_MODE
15
16 # Initialize libtool
17 AC_DISABLE_STATIC
18 AC_PROG_LIBTOOL
19
20 # Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
21 m4_ifndef([XORG_MACROS_VERSION],
22           [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
23 XORG_MACROS_VERSION(1.8)
24 XORG_DEFAULT_OPTIONS
25
26 # Checks for libraries.
27 AC_CHECK_LIB([mtdev], [mtdev_open])
28 AC_CHECK_LIB([m], [atan2])
29
30 # Obtain compiler/linker options for the mtrack driver dependencies
31 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.7] xproto inputproto $REQUIRED_MODULES)
32
33 # Set driver name
34 DRIVER_NAME=mtrack
35 AC_SUBST([DRIVER_NAME])
36
37 # configure option for module install directory
38 AC_ARG_WITH(xorg-module-dir, AC_HELP_STRING([--with-xorg-module-dir=DIR],
39         [Default xorg module directory [[default=$libdir/xorg/modules]]]),
40         [moduledir="$withval"],
41         [moduledir="$libdir/xorg/modules"])
42 inputdir=${moduledir}/input
43 AC_SUBST(inputdir)
44
45 # configure option to build extra tools
46 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
47         [Build extra tools (default: disabled)]),
48         [ENABLE_TOOLS=yes],
49         [ENABLE_TOOLS=no])
50 AM_CONDITIONAL([BUILD_TOOLS], [test "x$ENABLE_TOOLS" = xyes])
51
52 # configure option to enable gesture ate debugging
53 AC_ARG_ENABLE(debug-gestures, AS_HELP_STRING([--enable-debug-gestures],
54                                     [Enable gesture debugging (default: disabled)]),
55                                     [DEBUG_GESTURES=yes],
56                                                                         [DEBUG_GESTURES=no])
57 if test "x$DEBUG_GESTURES" = xyes; then
58    AC_DEFINE(DEBUG_GESTURES, 1, [Enable gesture debugging.])
59 fi
60
61 # configure option to enable multitouch state debugging
62 AC_ARG_ENABLE(debug-mtstate, AS_HELP_STRING([--enable-debug-mtstate],
63                                     [Enable multitouch state debugging (default: disabled)]),
64                                     [DEBUG_MTSTATE=yes],
65                                                                         [DEBUG_MTSTATE=no])
66 if test "x$DEBUG_MTSTATE" = xyes; then
67    AC_DEFINE(DEBUG_MTSTATE, 1, [Enable multitouch state debugging.])
68 fi
69
70 # configure option to enable property debugging
71 AC_ARG_ENABLE(debug-props, AS_HELP_STRING([--enable-debug-props],
72                                     [Enable property debugging (default: disabled)]),
73                                     [DEBUG_PROPS=yes],
74                                                                         [DEBUG_PROPS=no])
75 if test "x$DEBUG_PROPS" = xyes; then
76    AC_DEFINE(DEBUG_PROPS, 1, [Enable property debugging.])
77 fi
78
79 # configure option to enable driver debugging
80 AC_ARG_ENABLE(debug-driver, AS_HELP_STRING([--enable-debug-driver],
81                                     [Enable property debugging (default: disabled)]),
82                                     [DEBUG_DRIVER=yes],
83                                                                         [DEBUG_DRIVER=no])
84 if test "x$DEBUG_DRIVER" = xyes; then
85    AC_DEFINE(DEBUG_DRIVER, 1, [Enable property debugging.])
86 fi
87
88
89 # configure option to enable all debugging
90 AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
91                                     [Enable all debugging (default: disabled)]),
92                                     [DEBUG_ALL=$enableval],
93                                                                         [DEBUG_ALL=no])
94 if test "x$DEBUG_ALL" = xyes; then
95    AC_DEFINE(DEBUG_GESTURES, 1, [Enable gesture debugging.])
96    AC_DEFINE(DEBUG_MTSTATE, 1, [Enable multitouch state debugging.])
97    AC_DEFINE(DEBUG_PROPS, 1, [Enable property debugging.])
98    AC_DEFINE(DEBUG_DRIVER, 1, [Enable driver debugging.])
99 fi
100
101 # Everything else
102 AC_PROG_CC
103 AC_PROG_INSTALL
104 AC_CONFIG_FILES([Makefile])
105 AC_OUTPUT
106