summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 40a97f17fbe79c9461bbb49ffdaed65548cde29d (plain)
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
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([Dummy X.org Testing Environment for Google Test],
        [0.1.1],
        [],
        [xorg-gtest])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])

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

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

# Initialize libtool
AC_PROG_LIBTOOL


# Checks for programs.
AC_PROG_CXX
AC_PROG_RANLIB

AC_LANG([C++])

# Require X.Org macros 1.17 or later for XORG_ENABLE_INTEGRATION_TESTS
m4_ifndef([XORG_MACROS_VERSION],
	  [m4_fatal([must install xorg-macros 1.17 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.17)
XORG_DEFAULT_OPTIONS
XORG_ENABLE_INTEGRATION_TESTS([yes])

PKG_CHECK_MODULES(XSERVER, x11)
 
# Check for Google Test
CHECK_GTEST

AS_IF([test "x$have_gtest" != xyes],
      AC_MSG_ERROR([package 'gtest' not found]))

AC_SUBST([GTEST_CPPFLAGS])

# Check if we should include support for utouch-evemu
AC_ARG_WITH([evemu],
            [AS_HELP_STRING([--with-evemu],
                            [support Linux input device recording playback (default: enabled if available)])],
            [],
            [with_evemu=check])

AS_IF([test "x$with_evemu" == xyes],
      [PKG_CHECK_MODULES(EVEMU, utouch-evemu, [have_evemu=yes])],
      [test "x$with_evemu" == xcheck],
      [PKG_CHECK_MODULES(EVEMU, utouch-evemu, [have_evemu=yes], [:])])
AM_CONDITIONAL([HAVE_EVEMU], [test "x$have_evemu" = "xyes"])
AS_IF([test "x$have_evemu" = xyes], [AC_DEFINE([HAVE_EVEMU])])

# Check if we can build integration tests
AS_IF([test "x$enable_integration_tests" != xno],
      [AC_MSG_CHECKING([for X.org server])]
      [PKG_CHECK_EXISTS([xorg-server],
                        [have_xorg_server=yes],
                        [have_xorg_server=no])]
      [AC_MSG_RESULT([$have_xorg_server])])
AS_IF([test "x$enable_integration_tests" = xyes -a \
       "x$have_xorg_server" != xyes],
      [AC_MSG_ERROR([X.org server required for integration tests])])

AS_IF([test "x$have_xorg_server" = xyes],
      [MODULES=`$PKG_CONFIG --variable=moduledir --print-errors xorg-server`
       test "x$?" = "x0" && have_modules=yes])
AS_IF([test "x$have_modules" = xyes],
      [AC_CHECK_FILE([$MODULES/drivers/dummy_drv.so], [have_dummy_module=yes])])
AS_IF([test "x$enable_integration_tests" = xyes -a \
       "x$have_dummy_module" != xyes],
      [AC_MSG_ERROR([X.org Dummy video driver required for integration tests])])

AM_CONDITIONAL(ENABLE_XORG_GTEST_TESTS, [test "x$have_dummy_module" = xyes ])

AC_CONFIG_FILES([Makefile
                 data/Makefile
                 doc/Makefile
                 examples/Makefile
                 include/Makefile
                 src/Makefile
                 xorg-gtest.pc])

AC_OUTPUT