tools: specify width by height in the edge-detector help
[platform/upstream/libevdev.git] / configure.ac
1 # Copyright © 2013 Red Hat, Inc.
2 #
3 # Permission to use, copy, modify, distribute, and sell this software and its
4 # documentation for any purpose is hereby granted without fee, provided that
5 # the above copyright notice appear in all copies and that both that copyright
6 # notice and this permission notice appear in supporting documentation, and
7 # that the name of the copyright holders not be used in advertising or
8 # publicity pertaining to distribution of the software without specific,
9 # written prior permission.  The copyright holders make no representations
10 # about the suitability of this software for any purpose.  It is provided "as
11 # is" without express or implied warranty.
12 #
13 # THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 # EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
19 # OF THIS SOFTWARE.
20
21 AC_PREREQ([2.62])
22
23 # change meson version too
24 AC_INIT([libevdev],
25         [1.9.0],
26         [https://bugs.freedesktop.org/enter_bug.cgi?product=libevdev],
27         [libevdev],
28         [http://freedesktop.org/wiki/Software/libevdev/])
29
30 AC_CONFIG_SRCDIR([libevdev/libevdev.c])
31 AC_CONFIG_HEADERS([config.h])
32 AC_CONFIG_MACRO_DIR([m4])
33 AC_CONFIG_AUX_DIR([build-aux])
34 AC_USE_SYSTEM_EXTENSIONS
35
36 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
37
38 # DO NOT MODIFY THIS
39 # Use symbol versioning instead.
40 LIBEVDEV_LT_VERSION=5:0:3
41 AC_SUBST(LIBEVDEV_LT_VERSION)
42
43
44 AM_SILENT_RULES([yes])
45
46 # Check for programs
47 AC_PROG_CC_C99
48
49 # Initialize libtool
50 LT_PREREQ([2.2])
51 LT_INIT
52 LT_PATH_LD
53
54 with_ldflags=""
55 if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
56         CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
57                                 -Wl,--as-needed \
58                                 -Wl,--gc-sections \
59                                 -Wl,-z,relro \
60                                 -Wl,-z,now])
61 fi
62 AC_SUBST([GNU_LD_FLAGS], $with_ldflags)
63
64 AC_CHECK_LIB([m], [round])
65
66 PKG_PROG_PKG_CONFIG()
67 PKG_CHECK_MODULES(CHECK, [check >= 0.9.9], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
68 if test "x$HAVE_CHECK" = "xyes"; then
69         AC_PATH_PROG(VALGRIND, [valgrind])
70 else
71         AC_MSG_WARN([check not found - skipping building unit tests])
72 fi
73 AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
74 AM_CONDITIONAL(ENABLE_RUNTIME_TESTS, [test "x$HAVE_CHECK" = "xyes"])
75 AM_CONDITIONAL(ENABLE_STATIC_LINK_TEST, [test "x$enable_static" = "xyes"])
76
77 with_cflags=""
78 if test "x$GCC" = "xyes"; then
79         CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
80                                 -Wall \
81                                 -Wextra \
82                                 -Wno-unused-parameter \
83                                 -Wstrict-prototypes \
84                                 -Wmissing-prototypes \
85                                 -fvisibility=hidden \
86                                 -pipe \
87                                 -fno-strict-aliasing \
88                                 -ffunction-sections \
89                                 -fdata-sections \
90                                 -fno-strict-aliasing \
91                                 -fdiagnostics-show-option \
92                                 -fno-common])
93 fi
94 AC_SUBST([GCC_CFLAGS], $with_cflags)
95
96 AC_PATH_PROG(DOXYGEN, [doxygen])
97 if test "x$DOXYGEN" = "x"; then
98         AC_MSG_WARN([doxygen not found - required for documentation])
99         have_doxygen="no"
100 else
101         have_doxygen="yes"
102 fi
103 AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$have_doxygen" = "xyes"])
104
105 AC_MSG_CHECKING([whether to build with gcov])
106 AC_ARG_ENABLE([gcov],
107               [AS_HELP_STRING([--enable-gcov],
108                               [Whether to enable coverage testing (default:disabled)])],
109               [],
110               [enable_gcov=no],
111               )
112 AS_IF([test "x$enable_gcov" != "xno"],
113       [
114        GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
115        GCOV_LDFLAGS="-lgcov"
116        enable_gcov=yes
117        ],
118 )
119 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" != "xno"])
120 AC_SUBST([GCOV_CFLAGS])
121 AC_SUBST([GCOV_LDFLAGS])
122 AC_MSG_RESULT([$enable_gcov])
123
124 AC_MSG_CHECKING([whether to build with coverity support])
125 AC_ARG_ENABLE([coverity],
126               [AS_HELP_STRING([--enable-coverity],
127                               [Whether to build with coverity support (default: disabled)])],
128               [],
129               [enable_coverity=no],
130               )
131 AS_IF([test "x$enable_coverity" != "xno"],
132       [
133        AC_DEFINE([_Float128], [__uint128_t], [Override for coverity])
134        AC_DEFINE([_Float32], [int], [Override for coverity])
135        AC_DEFINE([_Float32x], [int], [Override for coverity])
136        AC_DEFINE([_Float64], [long], [Override for coverity])
137        AC_DEFINE([_Float64x], [long], [Override for coverity])
138        enable_coverity=yes
139        ],
140 )
141 AC_MSG_RESULT([$enable_coverity])
142
143
144 AM_PATH_PYTHON([2.6])
145
146 # nm to check for leaking symbols in the static library
147 AC_PATH_PROG(NM, [nm])
148 AM_CONDITIONAL(HAVE_NM, [test "x$NM" != "x"])
149 if test "x$enable_static" = "xno"; then
150         static_symbol_leaks_test="no - static build disabled"
151 else
152         if test "x$NM" = "x"; then
153                 AC_MSG_WARN([nm not found - skipping symbol leak test])
154                 have_nm="no"
155                 static_symbol_leaks_test="no - nm not found"
156         else
157                 have_nm="yes"
158                 static_symbol_leaks_test="yes"
159         fi
160 fi
161
162 AM_CONDITIONAL(ENABLE_STATIC_SYMBOL_LEAKS_TEST, [test "x$static_symbol_leaks_test" = "xyes"])
163
164 AC_CONFIG_FILES([Makefile
165                  libevdev/Makefile
166                  doc/Makefile
167                  doc/libevdev.doxygen
168                  doc/libevdev.man
169                  tools/Makefile
170                  test/Makefile
171                  libevdev.pc])
172 AC_OUTPUT
173
174 AC_MSG_RESULT([
175                Prefix                           ${prefix}
176                Libdir                           ${libdir}
177
178                Build documentation              ${have_doxygen}
179                Enable unit-tests                ${HAVE_CHECK}
180                Enable profiling                 ${enable_gcov}
181                Enable coverity support          ${enable_coverity}
182                Static library symbol check      ${static_symbol_leaks_test}
183                ])