This repository has been archived by the owner on Nov 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
84 lines (63 loc) · 2.16 KB
/
configure.ac
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
AC_PREREQ([2.64])
m4_define([wit_major_version], [0])
m4_define([wit_minor_version], [2])
m4_define([wit_micro_version], [0])
m4_define([wit_version],
[wit_major_version.wit_minor_version.wit_micro_version])
AC_INIT([wayland integration tests],
[wit_version],
[wit],
[https://github.com/mchalupa/wayland-integration-tests/])
AC_SUBST([WIT_VERSION_MAJOR], [wit_major_version])
AC_SUBST([WIT_VERSION_MINOR], [wit_minor_version])
AC_SUBST([WIT_VERSION_MICRO], [wit_micro_version])
AC_SUBST([WIT_VERSION], [wit_version])
# wayland minimal version
WAYLAND_MIN_VERSION=1.2.9
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AM_SILENT_RULES([yes])
# Check for programs
AC_PROG_CC
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT
PKG_PROG_PKG_CONFIG()
TESTS_CFLAGS=
TESTS_LIBS=
COMPILER_CFLAGS=
# check wayland's presence
PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server],\
[HAVE_WAYLAND_SERVER=yes], [HAVE_WAYLAND_SERVER=no])
PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client],\
[HAVE_WAYLAND_CLIENT=yes], [HAVE_WAYLAND_CLIENT=no])
if test "x$HAVE_WAYLAND_SERVER" != "xyes"; then
AC_MSG_ERROR([Need wayland-server libraries to compile])
fi
if test "x$HAVE_WAYLAND_CLIENT" != "xyes"; then
AC_MSG_ERROR([Need wayland-client libraries to compile])
fi
TESTS_CFLAGS="$WAYLAND_CLIENT_CFLAGS $WAYLAND_SERVER_CFLAGS"
TESTS_LIBS="$WAYLAND_CLIENT_LIBS $WAYLAND_SERVER_LIBS"
# check wayland's version
PKG_CHECK_MODULES([WAYLAND_VERSION], [wayland-server >= $WAYLAND_MIN_VERSION],\
[],\
[AC_MSG_WARN([Wayland version is lower than $WAYLAND_MIN_VERSION!])])
PKG_CHECK_MODULES([LIBUNWIND], [libunwind],\
[HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
if test "x$HAVE_LIBUNWIND" = "xyes"; then
AC_DEFINE(HAVE_LIBUNWIND, [1], [Allow use libunwind to printing backtrace])
TESTS_CFLAGS="$LIBUNWIND_CFLAGS $TESTS_CFLAGS"
TESTS_LIBS="$LIBUNWIND_LIBS $TESTS_LIBS"
fi
#export options to makefiles
AC_SUBST([TESTS_LIBS])
AC_SUBST([TESTS_CFLAGS])
AC_CONFIG_FILES([Makefile
src/Makefile
test/Makefile
test/test-runner/Makefile])
AC_OUTPUT