-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
138 lines (121 loc) · 3.6 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
AC_PREREQ([2.71])
AC_INIT([page],[1.9.10])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([src/main.cxx])
AC_CONFIG_HEADERS([src/config.hxx])
dnl define custom macro to setup dir from datadir
dnl Check for required programs
AC_PROG_CXX
LT_INIT
# check for C++11
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
dnl Check for libs
PKG_CHECK_MODULES(X11, [
x11 >= 1.6.3
x11-xcb >= 1.6.3
])
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)
PKG_CHECK_MODULES(XCB, [
xcb >= 1.11
xcb-util >= 0.4.0
xcb-xfixes >= 1.11
xcb-damage >= 1.11
xcb-randr >= 1.11
xcb-shape >= 1.11
xcb-composite >= 1.11
xcb-sync >= 1.11
xcb-res >= 1.11
])
AC_SUBST(XCB_CFLAGS)
AC_SUBST(XCB_LIBS)
PKG_CHECK_MODULES(CAIRO, [
cairo >= 1.14.6
cairo-xlib >= 1.14.6
cairo-xcb >= 1.14.6
cairo-xcb-shm >= 1.14.6
cairo-xlib-xrender >= 1.14.6
])
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(PANGO, pangocairo >= 0.28)
AC_SUBST(PANGO_CFLAGS)
AC_SUBST(PANGO_LIBS)
dnl This adds the option of compiling without using the ctemplate library,
dnl which has proved troublesome for compilation on some platforms
dnl AC_ARG_ENABLE(pango,
dnl [ --disable-pango Disable pango code path],
dnl [case "${enableval}" in
dnl yes | no ) WITH_PANGO="${enableval}" ;;
dnl *) AC_MSG_ERROR(bad value ${enableval} for --disable-pango) ;;
dnl esac],
dnl [WITH_PANGO="yes"]
dnl )
dnl
dnl Make sure we register this option with Automake, so we know whether to
dnl descend into ctemplate for more configuration or not
dnl AM_CONDITIONAL([WITH_PANGO], [test "x$WITH_PANGO" = "xyes"])
dnl
dnl # Define CTEMPLATE in config.h if we're going to compile against it
dnl if test "x$WITH_PANGO" = "xyes"; then
dnl AC_DEFINE([WITH_PANGO], [], ["build using pango library"])
dnl AC_MSG_NOTICE([pango code path will be enabled])
dnl else
dnl AC_MSG_NOTICE([pango code path will be enabled])
dnl fi
dnl
dnl # This adds the option of compiling without using the ctemplate library,
dnl # which has proved troublesome for compilation on some platforms
dnl AC_ARG_ENABLE(compositor,
dnl [ --disable-compositor Disable compositor code path],
dnl [case "${enableval}" in
dnl yes | no ) WITH_COMPOSITOR="${enableval}" ;;
dnl *) AC_MSG_ERROR(bad value ${enableval} for --disable-compositor) ;;
dnl esac],
dnl [WITH_COMPOSITOR="yes"]
dnl )
dnl
dnl Make sure we register this option with Automake, so we know whether to
dnl descend into compositor for more configuration or not
dnl AM_CONDITIONAL([WITH_COMPOSITOR], [test "x$WITH_COMPOSITOR" = "xyes"])
dnl
dnl if test "x$WITH_COMPOSITOR" = "xyes"; then
dnl
dnl PKG_CHECK_MODULES(XCOMPOSITE, xcomposite >= 0.4.0)
dnl AC_SUBST(XCOMPOSITE_CFLAGS)
dnl AC_SUBST(XCOMPOSITE_LIBS)
dnl
dnl AC_DEFINE([WITH_COMPOSITOR], [], ["build compositor"])
dnl AC_MSG_NOTICE([compositor code path will be enabled])
dnl else
dnl AC_MSG_NOTICE([compositor code path will be disabled])
dnl fi
AC_CHECK_LIB(rt, clock_gettime,
[RT_LIBS="-lrt"
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define to 1 if you have the `clock_gettime` function.])])
AC_SUBST(RT_LIBS)
AC_DEFINE_DIR([DATA_DIR], [datadir], [Data directory (/usr/share)])
safe_CXXFLAGS="${CXXFLAGS}"
safe_LDFLAGS="${LDFLAGS}"
CXXFLAGS="${CXXFLAGS} -flto"
LDFLAGS="${LDFLAGS} -flto"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main () { return 0; }]])],[
dnl keep FLAGS
],[
CXXFLAGS="${safe_CXXFLAGS}"
LDFLAGS="${safe_LDFLAGS}"
])
unset safe_CXXFLAGS
unset safe_LDFLAGS
AC_CONFIG_FILES([
page.conf
page.desktop
Makefile
src/Makefile
])
AC_OUTPUT