~oif-team/grail/trunk

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
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([Gesture Recognition And Instantiation Library],
        [3.0.5],
        [],
        [utouch-grail])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config-aux])
AC_CONFIG_MACRO_DIR([m4])

# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

LIB_VERSION=5:0:0
AC_SUBST([LIB_VERSION])

# Initialize libtool
AC_PROG_LIBTOOL

# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL

PKG_CHECK_MODULES([MTDEV], [mtdev >= 1.1])
PKG_CHECK_MODULES([EVEMU], [utouch-evemu >= 1.0.5])
PKG_CHECK_MODULES([FRAME], [utouch-frame >= 2.2.0])

PKG_CHECK_MODULES([XINPUT],
                  [x11] [xext] [xi >= 1.5.99.1] [inputproto >= 2.1.99.6])

AC_ARG_ENABLE(debug,
              AC_HELP_STRING(--enable-debug, Enable debug assertions and other safeguards (default: disabled)),
              [],
              AC_DEFINE([NDEBUG], [], [No debug]))

# Check for TDD tools
AC_ARG_ENABLE([integration-tests],
              [AS_HELP_STRING([--enable-integration-tests],
                  [Enable building integration test cases (default: auto)])],
              [enable_integration_tests=$enableval],
              [enable_integration_tests=auto])

# Check for Google C++ Testing Framework
CHECK_GTEST()
AM_CONDITIONAL([HAVE_GTEST], [test "x$have_gtest" = xyes])

AS_IF([test "x$enable_integration_tests" != xno],
      [CHECK_XORG_GTEST(
          [AC_MSG_NOTICE([xorg-gtest is available, integration tests will be built])],
          [AS_IF([test "x$enable_integration_tests" = xyes],
                 [AC_MSG_ERROR(
                     [xorg-gtest is not available])],
                 [AC_MSG_WARN(
                     [xorg-gtest is not available, tests will not be built])])])])

AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$have_xorg_gtest" = xyes])
                 
# Enable coverage reports using gcov
AC_TDD_GCOV

AM_CONDITIONAL([HAVE_GCOV],[test "x$ac_cv_check_gcov" = xyes])
 
AC_CONFIG_FILES([Makefile
                 src/Makefile
                 tools/Makefile
                 test/Makefile
                 test/gtest/Makefile
                 test/integration/Makefile
                 test/regular/Makefile
                 utouch-grail.pc])

AC_SUBST(VISIBILITY_CFLAGS, "-fvisibility=hidden")
AC_SUBST(VISIBILITY_CXXFLAGS, "-fvisibility=hidden")
AC_SUBST(WARNING_CPPFLAGS, "-Wall -Werror")
AC_SUBST(CXX11_CXXFLAGS, "-std=c++0x")

AC_OUTPUT