Hook up gcov
[platform/upstream/libevdev.git] / configure.ac
1 AC_PREREQ([2.64])
2
3 AC_INIT([libevdev],
4         [0.1],
5         [],
6         [libevdev],
7         [])
8
9 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_MACRO_DIR([m4])
11
12 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
13
14 # Before making a release, the LIBEVDEV_LT_VERSION string should be
15 # modified.
16 # The string is of the form C:R:A.
17 # - If interfaces have been changed or added, but binary compatibility has
18 #   been preserved, change to C+1:0:A+1
19 # - If binary compatibility has been broken (eg removed or changed interfaces)
20 #   change to C+1:0:0
21 # - If the interface is the same as the previous version, change to C:R+1:A
22 LIBEVDEV_LT_VERSION=1:0:0
23 AC_SUBST(LIBEVDEV_LT_VERSION)
24
25
26 AM_SILENT_RULES([yes])
27
28 # Check for programs
29 AC_PROG_CC
30
31 # Initialize libtool
32 LT_PREREQ([2.2])
33 LT_INIT
34
35 PKG_PROG_PKG_CONFIG()
36 PKG_CHECK_MODULES(CHECK, [check])
37
38 if test "x$GCC" = "xyes"; then
39         GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
40 fi
41 AC_SUBST(GCC_CFLAGS)
42
43 AC_PATH_PROG(ASCIIDOC, [a2x])
44 if test "x$ASCIIDOC" = "x"; then
45         AC_MSG_WARN([asciidoc not found - unable to build man pages])
46         have_asciidoc=no
47 else
48         have_asciidoc=yes
49 fi
50 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
51
52
53 AC_MSG_CHECKING([whether to build with gcov])
54 AC_ARG_ENABLE([gcov],
55               [AS_HELP_STRING([--enable-gcov],
56                               [Whether to enable coverage testing (default:enabled)])]
57               [],
58               [enable_gcov=yes],
59               )
60 AS_IF([test "x$enable_gcov" != "xno"],
61       [
62        GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
63        GCOV_LDFLAGS="-fprofile-arcs -ftest-coverage"
64        enable_gcov=yes
65        ],
66 )
67
68 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" != "xno"])
69 AC_SUBST([GCOV_CFLAGS])
70 AC_SUBST([GCOV_LDFLAGS])
71 AC_MSG_RESULT([$enable_gcov])
72
73 AC_CONFIG_FILES([Makefile
74                  libevdev/Makefile
75                  man/Makefile
76                  tools/Makefile
77                  test/Makefile
78                  libevdev.pc])
79 AC_OUTPUT