Initial commit
[profile/ivi/xinput_calibrator.git] / configure.ac
1 #
2 # Copyright (c) 2010 Petr Stetiar <ynezz@true.cz>
3 # Copyright (c) 2010 Tias Guns <tias@ulyssis.org>
4 #
5 # Permission is hereby granted, free of charge, to any person
6 # obtaining a copy of this software and associated documentation
7 # files (the "Software"), to deal in the Software without
8 # restriction, including without limitation the rights to use,
9 # copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following
12 # conditions:
13
14 # The above copyright notice and this permission notice shall be
15 # included in all copies or substantial portions of the Software.
16
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 # OTHER DEALINGS IN THE SOFTWARE.
25 #
26
27 AC_PREREQ([2.57])
28 AC_INIT(xinput_calibrator,[0.7.5], [http://github.com/tias/xinput_calibrator/issues],, [http://www.freedesktop.org/wiki/Software/xinput_calibrator])
29 AM_INIT_AUTOMAKE([foreign dist-bzip2])
30 AM_MAINTAINER_MODE
31
32 AC_PROG_CC
33 AC_PROG_CXX
34 AC_PROG_LIBTOOL
35 AC_PROG_INSTALL
36
37 AC_PATH_X
38 AC_CHECK_HEADERS([stdlib.h string.h])
39 AC_HEADER_STDBOOL
40 AC_FUNC_STRTOD
41
42 PKG_CHECK_MODULES(XINPUT, x11 xext xi inputproto)
43 AC_SUBST(XINPUT_CFLAGS)
44 AC_SUBST(XINPUT_LIBS)
45
46 PKG_CHECK_MODULES(XI_PROP, [xi >= 1.2] [inputproto >= 1.5],
47                         AC_DEFINE(HAVE_XI_PROP, 1, [Xinput properties available]), foo="bar")
48
49
50 AC_ARG_WITH([gui], AS_HELP_STRING([--with-gui=default], [Use gtkmm GUI if available, x11 GUI otherwise (default)]),,[with_gui=default])
51 AC_ARG_WITH([gui], AS_HELP_STRING([--with-gui=gtkmm], [Use gtkmm GUI]))
52 AC_ARG_WITH([gui], AS_HELP_STRING([--with-gui=x11], [Use native x11 GUI]))
53 AC_MSG_CHECKING([gui])
54 AC_MSG_RESULT($with_gui)
55
56 AS_IF([test "x$with_gui" = xdefault || test "x$with_gui" = xgtkmm], [
57         PKG_CHECK_MODULES(GTKMM, [gtkmm-2.4], with_gui="gtkmm",
58         [if test "x$with_gui" = xgtkmm; then
59             AC_MSG_ERROR([GTKMM GUI requested, but gtkmm-2.4 not found])
60          fi])
61     AC_SUBST(GTKMM_CFLAGS)
62         AC_SUBST(GTKMM_LIBS)
63 ])
64 AM_CONDITIONAL([BUILD_GTKMM], [test "x$with_gui" = xgtkmm])
65
66 AS_IF([test "x$with_gui" = xdefault || test "x$with_gui" = xx11], [
67         PKG_CHECK_MODULES(X11, [x11], with_gui="x11", with_gui="no")
68     AC_SUBST(X11_CFLAGS)
69     AC_SUBST(X11_LIBS)
70
71     # check for xrandr too
72     PKG_CHECK_MODULES(XRANDR, [xrandr], AC_DEFINE(HAVE_X11_XRANDR, 1), foo="bar")
73     AC_SUBST(XRANDR_CFLAGS)
74     AC_SUBST(XRANDR_LIBS)
75 ])
76 AM_CONDITIONAL([BUILD_X11], [test "x$with_gui" = xx11])
77
78
79
80 AC_SUBST(VERSION)
81
82 AC_OUTPUT([Makefile
83            scripts/Makefile
84            src/Makefile
85            src/calibrator/Makefile
86            src/gui/Makefile
87            man/Makefile])