summaryrefslogtreecommitdiff
path: root/configure.ac
blob: e2032f277ccf96d05ef713dc384b2d5e425df292 (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.3.0],
        [],
        [xorg-gtest])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])

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

# 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])
XORG_WITH_DOXYGEN

PKG_CHECK_MODULES(X11, x11 xi)
 
# 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 evemu
AC_ARG_WITH([evemu],
            [AS_HELP_STRING([--with-evemu],
                            [support Linux input device recording playback (default: enabled if available)])],
            [],
            [with_evemu=check])

PKG_CHECK_MODULES(EVEMU, [evemu >= 1.0.10] , [have_evemu=yes], [have_evemu=no])

AS_IF([test "x$with_evemu" == xyes && test "x$have_evemu" != xyes],
      AC_MSG_ERROR([package 'evemu' not found]))

AM_CONDITIONAL([HAVE_EVEMU], [test "x$have_evemu" = "xyes"])
AS_IF([test "x$have_evemu" = xyes], [AC_DEFINE([HAVE_EVEMU])])

AC_SUBST(SOURCEDIR, ['${prefix}/src/xorg-gtest'])
AC_SUBST(DUMMY_CONF_PATH, ['${datarootdir}/xorg/gtest/dummy.conf'])

# 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
                 aclocal/Makefile
                 data/Makefile
                 doc/Doxyfile
                 doc/Makefile
                 examples/Makefile
                 include/Makefile
                 src/Makefile
                 xorg-gtest.pc])

AC_OUTPUT