-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
209 lines (161 loc) · 7.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
AC_INIT([budgie-indicator-applet], 0.7.2, [[email protected]], [budgie-indicator-applet], [https://github.com/ubuntubudgie/budgie-indicator-applet])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wno-portability no-dist-gzip dist-xz foreign subdir-objects])
AC_PROG_CC
AC_PROG_CC_STDC
LT_PREREQ(2.2)
AC_CONFIG_HEADERS([config.h])
AC_PREFIX_DEFAULT(/usr/local)
AM_SILENT_RULES([yes])
LT_INIT([disable-static])
AC_CONFIG_MACRO_DIR([m4])
m4_define([budgie_required_version], [1])
# Note budgie-1.0 depends on peas, gtk, etc. Sorta your package managers
# business to make sure those deps are satisfied.
# Also note this is just for the C and Vala subprojects!
PKG_CHECK_MODULES(BUDGIE_PLUGIN,
budgie-1.0 >= budgie_required_version
)
UBUNTU_INDICATOR_API_VERSION=3
UBUNTU_INDICATOR_REQUIRED_VERSION=0.3.90
UBUNTU_INDICATOR_NG_VERSION=0.5
UBUNTU_INDICATOR_PKG=indicator$INDICATOR_API_VERSION-0.4
AYATANA_INDICATOR_API_VERSION=3
AYATANA_INDICATOR_REQUIRED_VERSION=0.6.0
AYATANA_INDICATOR_NG_VERSION=0.6.0
AYATANA_INDICATOR_PKG=ayatana-indicator$INDICATOR_API_VERSION-0.4
AC_ARG_WITH([ayatana-indicators],
[AS_HELP_STRING([--with-ayatana-indicators],
[build against Ayatana Indicators])],
[with_ayatana_indicators='yes'],
[with_ayatana_indicators='no']
)
AC_ARG_WITH([ubuntu-indicators],
[AS_HELP_STRING([--with-ubuntu-indicators],
[build against Ubuntu Indicators])],
[with_ubuntu_indicators='yes'],
[with_ubuntu_indicators='no']
)
###
### Look for Ayatana Indicators
###
PKG_CHECK_EXISTS(ayatana-indicator3-0.4,
[have_ayatanaindicator="yes"],
[have_ayatanaindicator="no"])
PKG_CHECK_EXISTS(ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_NG_VERSION,
[have_ayatanaindicator_ng="yes"],
[have_ayatanaindicator_ng="no"])
###
### Look for Ubuntu Indicators
###
PKG_CHECK_EXISTS(indicator3-0.4,
[have_ubuntuindicator="yes"],
[have_ubuntuindicator="no"])
PKG_CHECK_EXISTS(indicator3-0.4 >= $UBUNTU_INDICATOR_NG_VERSION,
[have_ubuntuindicator_ng="yes"],
[have_ubuntuindicator_ng="no"])
### decide on what Indicators implementation to use...
if test "x$have_ayatanaindicator" = "xyes" &&
test "x$have_ubuntuindicator" != "xyes" &&
test "x$with_ubuntu_indicators" != "xyes"; then
# use Ayatana Indicators (because they are present, and noone is enforcing Ubuntu Indicators)
use_ayatanaindicator="yes";
indicator_enforced="no";
elif test "x$have_ubuntuindicator" = "xyes" &&
test "x$have_ayatanaindicator" != "xyes" &&
test "x$with_ayatana_indicators" != "xyes"; then
# use Ubuntu Indicators (because they are present, and noone is enforcing Ayatana Indicators)
use_ubuntuindicator="yes";
indicator_enforced="no";
elif test "x$have_ubuntuindicator" = "xyes" &&
test "x$have_ayatanaindicator" = "xyes" &&
test "x$with_ayatana_indicators" = "xyes"; then
# both Indicator implementations are present, and we are asked to use Ayatana Indicators
use_ayatanaindicator=yes;
indicator_enforced=yes;
elif test "x$have_ubuntuindicator" = "xyes" &&
test "x$have_ayatanaindicator" = "xyes" &&
test "x$with_ubuntu_indicators" = "xyes"; then
# both Indicator implementations are present, and we are asked to use Ubuntu Indicators
use_ubuntuindicator=yes;
indicator_enforced=yes;
elif test "x$have_ubuntuindicator" = "xyes" &&
test "x$have_ayatanaindicator" != "xyes" &&
test "x$with_ayatana_indicators" = "xyes"; then
AC_MSG_ERROR([Ubuntu Indicators are present, but you want to build budgie-indicator-applet against Ayatana Indicators. This does not match.])
elif test "x$have_ubuntuindicator" != "xyes" &&
test "x$have_ayatanaindicator" = "xyes" &&
test "x$with_ubuntu_indicators" = "xyes"; then
AC_MSG_ERROR([Ayatana Indicators are present, but you want to build budgie-indicator-applet against Ubuntu Indicators. This does not match.])
else
AC_MSG_ERROR([Either Ayatana Indicators or Ubuntu Indicators are required to build budgie-indicator-applet.])
fi
### prepare Ayatana or Ubuntu Indicators implementation for the build, regarding to the decision reached above...
if test "x$use_ayatanaindicator" = "xyes"; then
AM_CONDITIONAL(WITH_AYATANA_INDICATOR, true)
AM_CONDITIONAL(WITH_UBUNTU_INDICATOR, false)
AC_DEFINE(HAVE_AYATANA_INDICATOR, 1, "Ayatana Indicators Support")
AC_DEFINE(HAVE_UBUNTU_INDICATOR, 0, "DISABLED: Ubuntu Indicators Support")
AC_DEFINE(HAVE_UBUNTU_INDICATOR_NG, 0, "DISABLED: Ubuntu Indicators NG Support")
if test "x$indicator_enforced" = "xyes"; then
AC_MSG_NOTICE([Using Ayatana Indicators for this build (as requested via configure option).])
else
AC_MSG_NOTICE([Using Ayatana Indicators for this build.])
fi
if test "x$have_ayatanaindicator_ng" = "xyes"; then
PKG_CHECK_MODULES(AYATANA_INDICATOR_NG, ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_NG_VERSION
libayatana-ido3-0.4 >= 0.4.0,
[AC_DEFINE(HAVE_AYATANA_INDICATOR_NG, 1, "New style indicators support")])
elif test "x$have_ayatanaindicator" = "xyes"; then
PKG_CHECK_MODULES(AYATANA_INDICATOR, ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_REQUIRED_VERSION)
fi
AC_SUBST(AYATANA_INDICATOR_CFLAGS)
AC_SUBST(AYATANA_INDICATOR_LIBS)
elif test "x$use_ubuntuindicator" = "xyes"; then
# both Indicator implementations are present, and we are asked to use Ubuntu Indicators
AM_CONDITIONAL(WITH_UBUNTU_INDICATOR, true)
AM_CONDITIONAL(WITH_AYATANA_INDICATOR, false)
AC_DEFINE(HAVE_UBUNTU_INDICATOR, 1, "Ubuntu Indicators Support")
AC_DEFINE(HAVE_AYATANA_INDICATOR, 0, "No Ayatana Indicators Support")
AC_DEFINE(HAVE_AYATANA_INDICATOR_NG, 0, "No Ayatana Indicators NG Support")
if test "x$indicator_enforced" = "xyes"; then
AC_MSG_NOTICE([Using Ubuntu Indicators for this build (as requested via configure option).])
else
AC_MSG_NOTICE([Using Ubuntu Indicators for this build.])
fi
if test "x$have_ubuntuindicator_ng" = "xyes"; then
PKG_CHECK_MODULES(UBUNTU_INDICATOR_NG, indicator3-0.4 >= $UBUNTU_INDICATOR_NG_VERSION
libido3-0.1 >= 13.10,
[AC_DEFINE(HAVE_UBUNTU_INDICATOR_NG, 1, "New style indicators support")])
elif test "x$have_ubuntuindicator" = "xyes"; then
PKG_CHECK_MODULES(UBUNTU_INDICATOR, indicator3-0.4 >= $UBUNTU_INDICATOR_REQUIRED_VERSION)
fi
AC_SUBST(UBUNTU_INDICATOR_CFLAGS)
AC_SUBST(UBUNTU_INDICATOR_LIBS)
fi
if test "x$use_ubuntuindicator" = "xyes"; then
INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4`
fi
if test "x$use_ayatanaindicator" = "xyes"; then
INDICATORDIR=`$PKG_CONFIG --variable=indicatordir ayatana-indicator3-0.4`
INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir ayatana-indicator3-0.4`
fi
AC_SUBST(INDICATORDIR)
AC_SUBST(INDICATORICONSDIR)
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
AC_MSG_RESULT([
budgie-indicator-applet $VERSION
========
prefix: ${prefix}
libdir: ${libdir}
sysconfdir: ${sysconfdir}
exec_prefix: ${exec_prefix}
bindir: ${bindir}
datarootdir: ${datarootdir}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
])