-
-
Notifications
You must be signed in to change notification settings - Fork 292
/
configure.ac
209 lines (184 loc) · 7.25 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([tslib], [1.23+], [[email protected]], [tslib], [http://tslib.org])
# AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE([dist-bzip2 dist-xz subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) # use silent rules where available - automake 1.11
AC_CONFIG_SRCDIR([src/ts_close.c])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4/internal])
PACKAGE_DESCRIPTION="Touchscreen Access Library"
AC_SUBST(PACKAGE_DESCRIPTION)
# Set our default flags variables
TS_DEFAULT_FLAGS
if test "x${enable_dependency_tracking}" = "x"; then
enable_dependency_tracking=no
fi
# Check for host os
AC_CANONICAL_HOST
build_linux=no
build_freebsd=no
build_hurd=no
build_haiku=no
build_windows=no
build_unknown=no
case "${host_os}" in
linux*)
build_linux=yes
;;
freebsd*|k*bsd-gnu*)
build_freebsd=yes
;;
gnu*)
build_hurd=yes
;;
beos*|*haiku*)
build_haiku=yes
;;
mingw*)
build_windows=yes
;;
*)
build_unknown=yes
;;
esac
AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([FREEBSD], [test "$build_freebsd" = "yes"])
AM_CONDITIONAL([HURD], [test "$build_hurd" = "yes"])
AM_CONDITIONAL([HAIKU], [test "$build_haiku" = "yes"])
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
TS_CC_HIDDEN_VISIBILITY
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_DISABLE_STATIC
AC_ENABLE_SHARED
LT_INIT([dlopen])
# Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/time.h unistd.h stdint.h sys/types.h errno.h dirent.h])
AC_CHECK_HEADERS([linux/spi/cy8mrln.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MMAP
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memmove memset munmap select strcasecmp strchr strdup strtoul strtol strsep])
AM_CONDITIONAL(HAVE_STRSEP, test x$HAVE_STRSEP = xyes)
# filters
#########
TSLIB_CHECK_MODULE([debounce], [yes], [Enable building of debounce filter])
TSLIB_CHECK_MODULE([dejitter], [yes], [Enable building of dejitter filter])
TSLIB_CHECK_MODULE([evthres], [yes], [Enable building of evthres filter])
TSLIB_CHECK_MODULE([iir], [yes], [Enable building of IIR filter])
TSLIB_CHECK_MODULE([linear], [yes], [Enable building of linear scaling])
TSLIB_CHECK_MODULE([median], [yes], [Enable building of median filter])
TSLIB_CHECK_MODULE([pthres], [yes], [Enable building of pthres filter])
TSLIB_CHECK_MODULE([skip], [yes], [Enable building of skip filter])
TSLIB_CHECK_MODULE([lowpass], [yes], [Enable building of lowpass filter])
TSLIB_CHECK_MODULE([invert], [yes], [Enable building of invert filter])
TSLIB_CHECK_MODULE([variance], [yes], [Enable building of variance filter])
TSLIB_CHECK_MODULE([crop], [yes], [Enable building of crop filter])
# hardware access modules
#########################
# generic, recommended
TSLIB_CHECK_MODULE([input], [yes], [Enable building of generic input raw module (Linux /dev/input/eventN support)])
# userspace device drivers, enabled by default (may become disabled by default in the future)
TSLIB_CHECK_MODULE([touchkit], [yes], [Enable building of serial TouchKit raw module (Linux /dev/ttySX support)])
TSLIB_CHECK_MODULE([waveshare], [yes], [Enable building of WaveShare raw module (Linux /dev/hidrawN support)])
# userspace device drivers, disabled by default
TSLIB_CHECK_MODULE([input-evdev], [no], [Enable building of generic evdev input module (Linux /dev/input/eventN support)])
TSLIB_CHECK_MODULE([tatung], [no], [Enable building of tatung raw module (Tatung Webpad support)])
TSLIB_CHECK_MODULE([ucb1x00], [no], [Enable building of ucb1x00 raw module (UCB1x00 support)])
TSLIB_CHECK_MODULE([mk712], [no], [Enable building of mk712 raw module (Hi tachi support)])
TSLIB_CHECK_MODULE([h3600], [no], [Enable building of h3600 raw module (HP iPaq H3600 support)])
TSLIB_CHECK_MODULE([dmc], [no], [Enable building of dmc raw module (HP iPaq DMC support)])
TSLIB_CHECK_MODULE([linear-h2200], [no], [Enable building of linearizing filter for iPAQ h2200])
TSLIB_CHECK_MODULE([corgi], [no], [Enable building of corgi raw module (Sharp Zaurus sl-c7x0 support)])
TSLIB_CHECK_MODULE([collie], [no], [Enable building of collie raw module (Sharp Zaurus sl-5500/5000d support)])
TSLIB_CHECK_MODULE([arctic2], [no], [Enable building of arctic2 raw module (IBM Arctic II support)])
TSLIB_CHECK_MODULE([dmc_dus3000], [no], [Enable building of dmc_dus3000 raw module (DMC DUS Series support)])
TSLIB_CHECK_MODULE([cy8mrln-palmpre], [no], [Enable building of cy8mrln-palmpre raw module])
TSLIB_CHECK_MODULE([galax], [no], [Enable building of HID USB eGalax raw module (Linux /dev/hiddevN support)])
TSLIB_CHECK_MODULE([one-wire-ts-input], [no], [Enable building of FriendlyARM one-wire raw module])
AC_MSG_CHECKING([where to place modules])
AC_ARG_WITH(plugindir,
AS_HELP_STRING([--with-plugindir=ARG],
[Where to look for plugins (default=${libdir}/ts)]),
[PLUGIN_DIR=$withval],
[PLUGIN_DIR='${libdir}/ts'])
AC_MSG_RESULT($PLUGIN_DIR)
AC_SUBST(PLUGIN_DIR)
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
AS_HELP_STRING(--enable-debug
Enable debug messages from filters (default=no)),
,
[enable_debug="no"])
AC_MSG_RESULT($enable_debug)
if test "$enable_debug" = "yes"; then
DEBUGFLAGS="-g -ggdb -DDEBUG"
else
DEBUGFLAGS=""
fi
AC_SUBST(DEBUGFLAGS)
LIBFLAGS="-DTSLIB_INTERNAL"
AC_SUBST(LIBFLAGS)
TS_CONF='${sysconfdir}/ts.conf'
AC_SUBST(TS_CONF)
TS_POINTERCAL='${sysconfdir}/pointercal'
AC_SUBST(TS_POINTERCAL)
AC_MSG_CHECKING([whether to enable tools])
AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools], [Disable tools (ts_uinput)]), [], [enable_tools=yes])
AM_CONDITIONAL([ENABLE_TOOLS], [test "$enable_tools" = "yes"])
AC_MSG_RESULT($enable_tools)
AC_DEFUN([AX_DEFINE_SUBST], [
AC_DEFINE_UNQUOTED([$1], [$2], [$3])
AC_SUBST([$1], ['$2'])
])
AC_ARG_WITH(sdl2,
[AS_HELP_STRING([--with-sdl2], [build graphical tools like ts_calibrate using SDL2])],
[with_sdl2=$withval],
[with_sdl2=no])
AM_CONDITIONAL(SDL, test x"$with_sdl2" = "xyes")
AS_IF([test "x$with_sdl2" = "xyes"], [
AC_DEFINE(HAVE_SDL2,,[Use SDL2.])
AC_CHECK_LIB([SDL2], [SDL_Init], [], [exit 1])
])
# libts Library versioning
# increment if the interface changed
LT_CURRENT=10
# increment if anything changed. set to 0 if current was incremented!
LT_REVISION=5
# increment if the interface change is backwards compatible (an addition). set to 0 if not.
LT_AGE=10
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AX_DEFINE_SUBST([LIBTS_VERSION_CURRENT], [$LT_CURRENT], [library current number])
AX_DEFINE_SUBST([LIBTS_VERSION_REVISION], [$LT_REVISION], [library revision number])
AX_DEFINE_SUBST([LIBTS_VERSION_AGE], [$LT_AGE], [library age number])
AC_CONFIG_FILES([Makefile
etc/Makefile
plugins/Makefile
src/Makefile
tests/Makefile
tools/Makefile
doc/Makefile
tslib.pc:tslib.pc.in])
AC_OUTPUT