forked from GNOME/gnome-online-accounts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
522 lines (456 loc) · 17.2 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
m4_define([goa_major_version], [3])
m4_define([goa_minor_version], [13])
m4_define([goa_micro_version], [1])
m4_define([goa_nano_version], [0])
m4_define([goa_base_version],
[goa_major_version.goa_minor_version.goa_micro_version])
m4_define([goa_version],
[m4_if(goa_nano_version, 0, [goa_base_version],
[goa_base_version].[goa_nano_version])])
AC_INIT([GNOME Online Accounts],
[goa_version],
[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-online-accounts],
[gnome-online-accounts])
AM_INIT_AUTOMAKE([1.9 foreign dist-xz no-dist-gzip tar-ustar])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AC_PROG_LIBTOOL
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
GOA_MAJOR_VERSION=goa_major_version
GOA_MINOR_VERSION=goa_minor_version
GOA_MICRO_VERSION=goa_micro_version
AC_SUBST(GOA_MAJOR_VERSION)
AC_SUBST(GOA_MINOR_VERSION)
AC_SUBST(GOA_MICRO_VERSION)
# Before making a release, the LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
GOA_LT_VERSION=0:0:0
GOA_BACKEND_LT_VERSION=1:0:0
AC_SUBST(GOA_LT_VERSION)
AC_SUBST(GOA_BACKEND_LT_VERSION)
AC_DEFINE(GOA_MAJOR_VERSION,
[goa_major_version],
[Define to the GOA major version])
AC_DEFINE(GOA_MINOR_VERSION,
[goa_minor_version],
[Define to the GOA minor version])
AC_DEFINE(GOA_MICRO_VERSION,
[goa_micro_version],
[Define to the GOA micro version])
# Initialization
#
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES
AC_ARG_ENABLE([documentation],
AS_HELP_STRING([--enable-documentation], [enable man pages and HTML]),
[], [enable_documentation=yes])
AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
if test x$enable_documentation = xyes; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([xsltproc is needed])
fi
fi
GTK_DOC_CHECK([1.3])
# Libraries
#
PKG_CHECK_MODULES(GLIB, [glib-2.0 gio-2.0 gio-unix-2.0 >= 2.35])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.11.1])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(WEBKIT_GTK, [webkitgtk-3.0 >= 2.1.90])
AC_SUBST(WEBKIT_GTK_CFLAGS)
AC_SUBST(WEBKIT_GTK_LIBS)
PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.41])
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0])
AC_SUBST(JSON_GLIB_CFLAGS)
AC_SUBST(JSON_GLIB_LIBS)
PKG_CHECK_MODULES(REST, [rest-0.7])
AC_SUBST(REST_CFLAGS)
AC_SUBST(REST_LIBS)
PKG_CHECK_MODULES(SECRET, [libsecret-1])
AC_SUBST(SECRET_CFLAGS)
AC_SUBST(SECRET_LIBS)
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.6.2])
# telepathy-account-widgets
prev_top_build_prefix=$ac_top_build_prefix
prev_ac_configure_args=$ac_configure_args
ac_configure_args="$ac_configure_args --with-cheese=no --disable-gudev"
# install the data together with the rest of GOA's data
ac_configure_args="$ac_configure_args --with-pkgdatadir=${datadir}/gnome-online-accounts"
# GOA ships its icons directly in ${datadir}/icons (usually /usr/share/icons/) and not
# in its own data directory
ac_configure_args="$ac_configure_args --with-icondir=${datadir}/icons"
# Change the name of tpaw's .mo files to avoid conflicts with other packages using tp-aw
ac_configure_args="$ac_configure_args --with-gettext-package=gnome-online-accounts-tpaw"
# Disable the installation of the GSettings schema to avoid multiple components shipping
# the same file. See https://bugzilla.gnome.org/show_bug.cgi?id=706803
ac_configure_args="$ac_configure_args --disable-schemas-compile --disable-settings"
AX_CONFIG_DIR([telepathy-account-widgets])
ac_top_build_prefix=$prev_top_build_prefix
ac_configure_args=$prev_ac_configure_args
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-account-widgets/
PKG_CHECK_MODULES(TPAW, telepathy-account-widgets)
AC_ARG_ENABLE([inspector],
[AS_HELP_STRING([--enable-inspector],
[Enable a WebKitWebInspector for the embedded web view])],
[],
[enable_inspector=no])
if test "$enable_inspector" != "no"; then
AC_DEFINE(GOA_INSPECTOR_ENABLED, 1, [Enable a WebKitWebInspector for the embedded web view])
fi
# service providers
#
# Microsoft Exchange
AC_ARG_ENABLE([exchange],
[AS_HELP_STRING([--enable-exchange],
[Enable Microsoft Exchange provider])],
[],
[enable_exchange=yes])
if test "$enable_exchange" != "no"; then
AC_DEFINE(GOA_EXCHANGE_ENABLED, 1, [Enable Microsoft Exchange data provider])
fi
# Flickr
AC_ARG_ENABLE([flickr], [AS_HELP_STRING([--enable-flickr], [Enable Flickr provider])], [], [enable_flickr=yes])
AC_ARG_WITH(flickr-consumer-key,
[AS_HELP_STRING([--with-flickr-consumer-key],
[Flickr OAuth 1.0 consumer key])],
[],
[])
AC_ARG_WITH(flickr-consumer-secret,
[AS_HELP_STRING([--with-flickr-consumer-secret],
[Flickr OAuth 1.0 consumer secret])],
[],
[])
if test "$with_flickr_consumer_key" = ""; then
with_flickr_consumer_key=ed00ad7e0869897506e23c0d18e34d01
fi
if test "$with_flickr_consumer_secret" = ""; then
with_flickr_consumer_secret=ebd556dd187188b1
fi
AC_DEFINE_UNQUOTED(GOA_FLICKR_CONSUMER_KEY, ["$with_flickr_consumer_key"], [Flickr OAuth 1.0 consumer key])
AC_DEFINE_UNQUOTED(GOA_FLICKR_CONSUMER_SECRET, ["$with_flickr_consumer_secret"], [Flickr OAuth 1.0 consumer secret])
if test "$enable_flickr" != "no"; then
AC_DEFINE(GOA_FLICKR_ENABLED, 1, [Enable Flickr data provider])
fi
# Google
AC_ARG_ENABLE([google], [AS_HELP_STRING([--enable-google], [Enable Google provider])], [], [enable_google=yes])
AC_ARG_WITH(google-client-id,
[AS_HELP_STRING([--with-google-client-id],
[Google OAuth 2.0 client id])],
[],
[])
AC_ARG_WITH(google-client-secret,
[AS_HELP_STRING([--with-google-client-secret],
[Google OAuth 2.0 client secret])],
[],
[])
if test "$with_google_client_id" = ""; then
with_google_client_id=923794261470.apps.googleusercontent.com
fi
if test "$with_google_client_secret" = ""; then
with_google_client_secret=SlVBAcxamM0TBPlvX2c1zbEY
fi
AC_DEFINE_UNQUOTED(GOA_GOOGLE_CLIENT_ID,
["$with_google_client_id"],
[Google OAuth 2.0 client id])
AC_DEFINE_UNQUOTED(GOA_GOOGLE_CLIENT_SECRET,
["$with_google_client_secret"],
[Google OAuth 2.0 client secret])
if test "$enable_google" != "no"; then
AC_DEFINE(GOA_GOOGLE_ENABLED, 1, [Enable Google data provider])
fi
# IMAP/SMTP
AC_ARG_ENABLE([imap-smtp],
[AS_HELP_STRING([--enable-imap-smtp],
[Enable IMAP/SMTP provider])],
[],
[enable_imap_smtp=yes])
if test "$enable_imap_smtp" != "no"; then
AC_DEFINE(GOA_IMAP_SMTP_ENABLED, 1, [Enable IMAP/SMTP data provider])
fi
# ownCloud
AC_ARG_ENABLE([owncloud],
[AS_HELP_STRING([--enable-owncloud],
[Enable ownCloud provider])],
[],
[enable_owncloud=yes])
if test "$enable_owncloud" != "no"; then
AC_DEFINE(GOA_OWNCLOUD_ENABLED, 1, [Enable ownCloud data provider])
fi
# Yahoo
AC_ARG_ENABLE([yahoo], [AS_HELP_STRING([--enable-yahoo], [Enable Yahoo provider])], [], [enable_yahoo=no])
AC_ARG_WITH(yahoo-consumer-key,
[AS_HELP_STRING([--with-yahoo-consumer-key],
[Yahoo OAuth 1.0 consumer key])],
[],
[])
AC_ARG_WITH(yahoo-consumer-secret,
[AS_HELP_STRING([--with-yahoo-consumer-secret],
[Yahoo OAuth 1.0 consumer secret])],
[],
[])
if test "$with_yahoo_consumer_key" = ""; then
with_yahoo_consumer_key=not_set
fi
if test "$with_yahoo_consumer_secret" = ""; then
with_yahoo_consumer_secret=not_set
fi
AC_DEFINE_UNQUOTED(GOA_YAHOO_CONSUMER_KEY, ["$with_yahoo_consumer_key"], [Yahoo OAuth 1.0 consumer key])
AC_DEFINE_UNQUOTED(GOA_YAHOO_CONSUMER_SECRET, ["$with_yahoo_consumer_secret"], [Yahoo OAuth 1.0 consumer secret])
if test "$enable_yahoo" != "no"; then
AC_DEFINE(GOA_YAHOO_ENABLED, 1, [Enable Yahoo data provider])
fi
# Facebook
AC_ARG_ENABLE([facebook], [AS_HELP_STRING([--enable-facebook],
[Enable Facebook provider])],
[],
[enable_facebook=yes])
AC_ARG_WITH(facebook-client-id,
[AS_HELP_STRING([--with-facebook-client-id],
[Facebook OAuth 2.0 client id])],
[],
[])
if test "$with_facebook_client_id" = ""; then
with_facebook_client_id=297654143624603
fi
AC_DEFINE_UNQUOTED(GOA_FACEBOOK_CLIENT_ID,
["$with_facebook_client_id"],
[Facebook OAuth 2.0 client id])
if test "$enable_facebook" != "no"; then
AC_DEFINE(GOA_FACEBOOK_ENABLED, 1, [Enable Facebook data provider])
fi
# Windows Live
AC_ARG_ENABLE([windows-live], [AS_HELP_STRING([--enable-windows-live],
[Enable Windows Live provider])],
[],
[enable_windows_live=yes])
AC_ARG_WITH(windows-live-client-id,
[AS_HELP_STRING([--with-windows-live-client-id],
[Windows Live OAuth 2.0 client id])],
[],
[])
if test "$with_windows_live_client_id" = ""; then
with_windows_live_client_id=0000000044067703
fi
AC_DEFINE_UNQUOTED(GOA_WINDOWS_LIVE_CLIENT_ID,
["$with_windows_live_client_id"],
[Windows Live OAuth 2.0 client id])
if test "$enable_windows_live" != "no"; then
AC_DEFINE(GOA_WINDOWS_LIVE_ENABLED, 1, [Enable Windows Live data provider])
fi
# Telepathy
AC_ARG_ENABLE([telepathy],
[AS_HELP_STRING([--enable-telepathy],
[Enable Telepathy IM provider])],
[],
[enable_telepathy=yes])
if test "$enable_telepathy" != "no"; then
AC_DEFINE(GOA_TELEPATHY_ENABLED, 1, [Enable Telepathy data provider])
fi
PKG_CHECK_MODULES(TP, telepathy-glib)
# Pocket
AC_ARG_ENABLE([pocket], [AS_HELP_STRING([--enable-pocket],
[Enable Pocket provider])],
[],
[enable_pocket=yes])
AC_ARG_WITH(pocket-client-id,
[AS_HELP_STRING([--with-pocket-client-id],
[Pocket OAuth 2.0 client id])],
[],
[])
if test "$with_pocket_client_id" = ""; then
with_pocket_client_id="16630-40b25246b56e8ad5310b2883"
fi
AC_DEFINE_UNQUOTED(GOA_POCKET_CLIENT_ID,
["$with_pocket_client_id"],
[Pocket OAuth 2.0 client id])
if test "$enable_pocket" != "no"; then
AC_DEFINE(GOA_POCKET_ENABLED, 1, [Enable Pocket data provider])
fi
# Kerberos
AC_ARG_ENABLE([kerberos],
[AS_HELP_STRING([--enable-kerberos],
[Enable kerberos support])],
[with_kerberos=$enableval],
[enable_kerberos=no])
AC_PATH_PROG([KRB5_CONFIG], krb5-config, none, $PATH:/usr/kerberos/bin)
if test "x$KRB5_CONFIG" != "xnone"; then
KRB5_LIBS="`${KRB5_CONFIG} --libs krb5`"
KRB5_CFLAGS="`${KRB5_CONFIG} --cflags krb5`"
have_kerberos=yes
else
KRB5_LIBS=""
KRB5_CFLAGS=""
have_kerberos=no
fi
AC_SUBST(KRB5_CFLAGS)
AC_SUBST(KRB5_LIBS)
if test "$enable_kerberos" != "no"; then
if test "$have_kerberos" = "no" ; then
AC_MSG_ERROR([kerberos support requested, but not available])
fi
PKG_CHECK_MODULES(GCR, gcr-3)
AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Define to use the GCR API])
AC_DEFINE(GOA_KERBEROS_ENABLED, 1, [Enable Enterprise Identity data provider])
fi
AM_CONDITIONAL(BUILD_KERBEROS, [test x$enable_kerberos != xno])
# Optional timerfd support
AC_MSG_CHECKING([for timerfd support])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/timerfd.h>
#include <unistd.h>
],[
int
main (void)
{
struct itimerspec timer_spec = { 0 };
timerfd_settime (timerfd_create (CLOCK_MONOTONIC, TFD_CLOEXEC),
TFD_TIMER_ABSTIME,
&timer_spec,
NULL);
return 0;
}
])],
[have_timerfd=yes],
[have_timerfd=no])
AC_MSG_RESULT($have_timerfd)
if test x"$have_timerfd" = x"yes"; then
AC_DEFINE(HAVE_TIMERFD, 1, [have timerfd support])
dnl libc headers tend to trail kernel support
dnl so compensate if necessary
AC_MSG_CHECKING([for timerfd cancel-on-set support])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/timerfd.h>
#include <unistd.h>
],[
int
main (void)
{
struct itimerspec timer_spec = { 0 };
timerfd_settime (timerfd_create (CLOCK_MONOTONIC, TFD_CLOEXEC),
TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET,
&timer_spec,
NULL);
return 0;
}
])],
[have_tfd_timer_cancel_on_set=yes],
[have_tfd_timer_cancel_on_set=no])
AC_MSG_RESULT($have_tfd_timer_cancel_on_set)
if test x"$have_tfd_timer_cancel_on_set" = x"no"; then
AC_DEFINE(TFD_TIMER_CANCEL_ON_SET, [(1 << 1)], [have timerfd support])
fi
fi
# Internationalization
#
IT_PROG_INTLTOOL([$INTLTOOL_REQUIRED])
GETTEXT_PACKAGE=gnome-online-accounts
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
# goaconfig.h
#
AC_CONFIG_COMMANDS([src/goa/goaconfig.h],
[
outfile=src/goa/goaconfig.h-tmp
cat > $outfile <<\_______EOF
/* goaconfig.h
*
* This is a generated file. Please modify 'configure.ac'
*/
#ifndef __GOA_CONFIG_H__
#define __GOA_CONFIG_H__
G_BEGIN_DECLS
_______EOF
echo "#define GOA_MAJOR_VERSION $GOA_MAJOR_VERSION" >> $outfile
echo "#define GOA_MINOR_VERSION $GOA_MINOR_VERSION" >> $outfile
echo "#define GOA_MICRO_VERSION $GOA_MICRO_VERSION" >> $outfile
cat >> $outfile <<\_______EOF
G_END_DECLS
#endif /* __GOA_CONFIG_H__ */
_______EOF
if cmp -s $outfile src/goa/goaconfig.h; then
AC_MSG_NOTICE([src/goa/goaconfig.h is unchanged])
rm -f $outfile
else
mv $outfile src/goa/goaconfig.h
fi
],[
GOA_MAJOR_VERSION=$GOA_MAJOR_VERSION
GOA_MINOR_VERSION=$GOA_MINOR_VERSION
GOA_MICRO_VERSION=$GOA_MICRO_VERSION
])
# Generate
#
AC_OUTPUT([
Makefile
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/256x256/Makefile
src/Makefile
src/goa/Makefile
src/goa/goa-1.0.pc
src/goabackend/Makefile
src/goabackend/goa-backend-1.0.pc
src/goaidentity/Makefile
src/daemon/Makefile
src/examples/Makefile
po/Makefile.in
doc/Makefile
doc/version.xml
])
dnl ==========================================================================
echo "
gnome-online-accounts $VERSION
===============================
prefix: ${prefix}
libdir: ${libdir}
libexecdir: ${libexecdir}
bindir: ${bindir}
sbindir: ${sbindir}
datadir: ${datadir}
sysconfdir: ${sysconfdir}
localstatedir: ${localstatedir}
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
inspector: ${enable_inspector}
introspection: ${found_introspection}
Flickr provider: ${enable_flickr} (OAuth 1.0, key:${with_flickr_consumer_key} secret:${with_flickr_consumer_secret})
Google provider: ${enable_google} (OAuth 2.0, id:${with_google_client_id} secret:${with_google_client_secret})
IMAP/SMTP provider: ${enable_imap_smtp}
Microsoft Exchange provider: ${enable_exchange}
ownCloud provider: ${enable_owncloud}
Kerberos provider: ${enable_kerberos}
Yahoo provider: ${enable_yahoo} (OAuth 1.0, key:${with_yahoo_consumer_key} secret:${with_yahoo_consumer_secret})
Facebook provider: ${enable_facebook} (OAuth 2.0, id:${with_facebook_client_id})
Windows Live provider: ${enable_windows_live} (OAuth 2.0, id:${with_windows_live_client_id})
Telepathy provider: ${enable_telepathy}
Pocket provider: ${enable_pocket} (id:${with_pocket_client_id})
Maintainer mode: ${USE_MAINTAINER_MODE}
Building api docs: ${enable_gtk_doc}
"