forked from GNOME/evolution-data-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1971 lines (1696 loc) · 59.3 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
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl Evolution-Data-Server version
m4_define([eds_major_version], [3])
m4_define([eds_minor_version], [19])
m4_define([eds_micro_version], [92])
m4_define([eds_version],
[eds_major_version.eds_minor_version.eds_micro_version])
dnl Base Version: This is for API/version tracking for things like
dnl Bonobo server files. This should always be the major/minor of
dnl the stable version or stable version to be. Note, this is set
dnl the way it is so that GETTEXT_PACKAGE will be parsed correctly.
BASE_VERSION=3.20
m4_define([base_version], [3.20])
dnl This number is meaningless, but we're now stuck with it in our
dnl library names for backward compatibility.
m4_define([api_version], [1.2])
dnl Autoconf / Automake Initialization
AC_PREREQ(2.62)
AC_INIT([evolution-data-server],[eds_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server])
AM_INIT_AUTOMAKE([gnu 1.10 tar-ustar dist-xz no-dist-gzip -Wall -Wno-portability foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(README)
AC_CONFIG_HEADERS(config.h)
dnl This is for the autoconf tests only - it set's the language we use
AC_LANG(C)
dnl Automake 1.11 - Silent Build Rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Required Package Versions
dnl Keep these two definitions in agreement.
m4_define([glib_minimum_version], [2.40])
m4_define([glib_encoded_version], [GLIB_VERSION_2_40])
dnl Keep these two definitions in agreement.
m4_define([gdk_minimum_version], [3.10])
m4_define([gdk_encoded_version], [GDK_VERSION_3_10])
dnl Keep these two definitions in agreement.
m4_define([soup_minimum_version], [2.42])
m4_define([soup_encoded_version], [SOUP_VERSION_2_42])
m4_define([gcr_minimum_version], [3.4])
m4_define([libsecret_minimum_version], [0.5])
m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
m4_define([libgdata_minimum_version], [0.10])
m4_define([sqlite_minimum_version], [3.7.17])
m4_define([libical_minimum_version], [0.43])
dnl Optional Packages
m4_define([goa_minimum_version], [3.8])
m4_define([gweather_minimum_version], [3.10])
m4_define([libaccounts_glib_minimum_version], [1.4])
m4_define([libsignon_glib_minimum_version], [1.8])
m4_define([webkitgtk_minimum_version], [2.4.9])
m4_define([json_glib_minimum_version], [1.0.4])
AC_SUBST([BASE_VERSION],[base_version])
AC_SUBST([API_VERSION],[api_version])
AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
EDS_MAJOR_VERSION=eds_major_version
EDS_MINOR_VERSION=eds_minor_version
EDS_MICRO_VERSION=eds_micro_version
GLIB_GSETTINGS
dnl ******************************
dnl D-Bus versioning
dnl ******************************
ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook9"
CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar7"
SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources5"
USER_PROMPTER_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.UserPrompter0"
AC_DEFINE_UNQUOTED(
ADDRESS_BOOK_DBUS_SERVICE_NAME,
["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
[D-Bus service name for the address book factory])
AC_DEFINE_UNQUOTED(
CALENDAR_DBUS_SERVICE_NAME,
["$CALENDAR_DBUS_SERVICE_NAME"],
[D-Bus service name for the calendar factory])
AC_DEFINE_UNQUOTED(
SOURCES_DBUS_SERVICE_NAME,
["$SOURCES_DBUS_SERVICE_NAME"],
[D-Bus service name for the source registry])
AC_DEFINE_UNQUOTED(
USER_PROMPTER_DBUS_SERVICE_NAME,
["$USER_PROMPTER_DBUS_SERVICE_NAME"],
[D-Bus service name for the user prompter])
AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
AC_SUBST(SOURCES_DBUS_SERVICE_NAME)
AC_SUBST(USER_PROMPTER_DBUS_SERVICE_NAME)
dnl ******************************
dnl Libtool versioning
dnl ******************************
LIBEDATASERVER_CURRENT=21
LIBEDATASERVER_REVISION=0
LIBEDATASERVER_AGE=0
LIBEDATASERVERUI_CURRENT=1
LIBEDATASERVERUI_REVISION=0
LIBEDATASERVERUI_AGE=0
LIBECAL_CURRENT=19
LIBECAL_REVISION=0
LIBECAL_AGE=0
LIBEDATACAL_CURRENT=28
LIBEDATACAL_REVISION=0
LIBEDATACAL_AGE=0
LIBEDATABOOK_CURRENT=25
LIBEDATABOOK_REVISION=0
LIBEDATABOOK_AGE=0
LIBEBOOK_CURRENT=19
LIBEBOOK_REVISION=1
LIBEBOOK_AGE=3
LIBEBOOK_CONTACTS_CURRENT=2
LIBEBOOK_CONTACTS_REVISION=0
LIBEBOOK_CONTACTS_AGE=0
LIBCAMEL_CURRENT=57
LIBCAMEL_REVISION=0
LIBCAMEL_AGE=0
LIBEBACKEND_CURRENT=10
LIBEBACKEND_REVISION=0
LIBEBACKEND_AGE=0
AC_SUBST(EDS_MAJOR_VERSION)
AC_SUBST(EDS_MINOR_VERSION)
AC_SUBST(EDS_MICRO_VERSION)
AC_SUBST(LIBEDATASERVER_CURRENT)
AC_SUBST(LIBEDATASERVER_REVISION)
AC_SUBST(LIBEDATASERVER_AGE)
AC_SUBST(LIBEDATASERVERUI_CURRENT)
AC_SUBST(LIBEDATASERVERUI_REVISION)
AC_SUBST(LIBEDATASERVERUI_AGE)
AC_SUBST(LIBECAL_CURRENT)
AC_SUBST(LIBECAL_REVISION)
AC_SUBST(LIBECAL_AGE)
AC_SUBST(LIBEDATACAL_CURRENT)
AC_SUBST(LIBEDATACAL_REVISION)
AC_SUBST(LIBEDATACAL_AGE)
AC_SUBST(LIBEBOOK_CURRENT)
AC_SUBST(LIBEBOOK_REVISION)
AC_SUBST(LIBEBOOK_AGE)
AC_SUBST(LIBEBOOK_CONTACTS_CURRENT)
AC_SUBST(LIBEBOOK_CONTACTS_REVISION)
AC_SUBST(LIBEBOOK_CONTACTS_AGE)
AC_SUBST(LIBEDATABOOK_CURRENT)
AC_SUBST(LIBEDATABOOK_REVISION)
AC_SUBST(LIBEDATABOOK_AGE)
AC_SUBST(LIBCAMEL_CURRENT)
AC_SUBST(LIBCAMEL_REVISION)
AC_SUBST(LIBCAMEL_AGE)
AC_SUBST(LIBEBACKEND_CURRENT)
AC_SUBST(LIBEBACKEND_REVISION)
AC_SUBST(LIBEBACKEND_AGE)
dnl **************************************
dnl Put the ACLOCAL flags in the Makefile
dnl **************************************
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
dnl *********************************************
dnl Figure out early if we'll need a C++ compiler
dnl *********************************************
EVO_PHONENUMBER_ARGS
dnl ******************************
dnl Initialize maintainer mode
dnl ******************************
AM_MAINTAINER_MODE([enable])
if test "x$enable_maintainer_mode" = "xyes" ; then
AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
fi
dnl ******************************
dnl Compiler Warning Flags
dnl ******************************
proposed_warning_flags=
if test "x$enable_maintainer_mode" = "xyes" ; then
proposed_warning_flags="-Wall -Wextra -Wdeprecated-declarations"
else
proposed_warning_flags="-Wno-deprecated-declarations"
fi
proposed_warning_flags="$proposed_warning_flags
-Werror-implicit-function-declaration
-Wformat -Wformat-security -Winit-self
-Wmissing-declarations -Wmissing-include-dirs
-Wmissing-noreturn -Wpointer-arith
-Wredundant-decls -Wundef -Wwrite-strings"
proposed_c_warning_flags="$proposed_warning_flags
-Wdeclaration-after-statement
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
-Wnested-externs"
proposed_cxx_warning_flags="$proposed_warning_flags
-Wabi -Wnoexcept"
AS_COMPILER_FLAGS(WARNING_FLAGS, [$proposed_c_warning_flags])
AC_SUBST(WARNING_FLAGS)
dnl Other useful compiler warnings for test builds only.
dnl These may produce warnings we have no control over,
dnl or false positives we don't always want to see.
dnl
dnl -Wformat-nonliteral
dnl -Wmissing-format-attribute
dnl -Wshadow
dnl -Wstrict-aliasing=2
AM_CFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
AC_SUBST(AM_CFLAGS)
dnl C++ Compiler flags, needed for ICU C++ access and libphonenumber usage
AC_PROG_CXX
AC_LANG_PUSH([C++])
AS_COMPILER_FLAGS(CXX_WARNING_FLAGS, [$proposed_cxx_warning_flags])
AC_SUBST(CXX_WARNING_FLAGS)
AM_CXXFLAGS="$CXX_WARNING_FLAGS"
AC_SUBST(AM_CXXFLAGS)
AC_LANG_POP([C++])
dnl Permits linking of C++ based libraries using the C linker if needed.
AC_SUBST([predeps_CXX])
AC_SUBST([postdeps_CXX])
AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
dnl Warn about API usage that violates our minimum requirements.
AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
dnl These will suppress warnings about newly-deprecated symbols. Ideally
dnl these settings should match our minimum requirements and we will clean
dnl up any new deprecation warnings after bumping our minimum requirements.
dnl But if the warnings get to be overwhelming, use fixed versions instead.
AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"
AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
AC_SUBST(AM_CPPFLAGS)
AC_PROG_CC
AC_PROG_CPP
AC_C_INLINE
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl For gen-western-table.py
AM_PATH_PYTHON
dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
dnl behavior that -- according to the C99 standard -- is supposed to be
dnl undefined. We may still have aliasing abuses lying around that rely
dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
dnl optimization until we can find and fix all the abuses.
dnl (AC_PROG_CC must run first to set the GCC variable.)
dnl XXX This really belongs in AM_CFLAGS.
if test "x${GCC}" = "xyes"; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
dnl ******************************
dnl I18N stuff
dnl ******************************
IT_PROG_INTLTOOL([0.35.5])
GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
dnl ******************************
dnl Initialize libtool
dnl ******************************
LT_PREREQ(2.2)
LT_INIT(disable-static win32-dll)
PKG_PROG_PKG_CONFIG
dnl This relies on $SED, which is defined in ltmain.sh, which
dnl is invoked by LT_INIT (at least I think that's how it works).
GNOME_CODE_COVERAGE
dnl Add the option install unit tests
EDS_INSTALLED_TESTS
dnl ******************************
dnl Gtk Doc stuff
dnl ******************************
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
dnl The private D-Bus documentation is for developers only.
AC_ARG_WITH([private-docs],
AS_HELP_STRING([--with-private-docs],
[Build documentation for private libraries ]
[(requires --enable-gtk-doc) [default=no]],),
[with_private_docs="$withval"],[with_private_docs="no"])
AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
dnl This must appear after AC_CANONICAL_HOST, which defines $host.
case "$host" in
*openbsd*|*freebsd*)
dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
;;
*)
LDFLAGS="$LDFLAGS -Wl,--no-undefined"
;;
esac
dnl ******************************
dnl Check for Win32
dnl ******************************
AC_MSG_CHECKING([for Win32])
case "$host" in
*-mingw*)
os_win32='yes'
NO_UNDEFINED='-no-undefined'
SOCKET_LIBS='-lws2_32 -ldnsapi'
DL_LIB=''
LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
;;
*openbsd*|*freebsd*)
os_win32='no'
NO_UNDEFINED=''
SOCKET_LIBS=''
DL_LIB=''
LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
;;
*)
os_win32='no'
NO_UNDEFINED=''
SOCKET_LIBS=''
DL_LIB='-ldl'
LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
AC_SUBST(NO_UNDEFINED)
AC_SUBST(SOCKET_LIBS)
AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
dnl **************************************
dnl Check for posix compatible sys/wait.h
dnl **************************************
AC_HEADER_SYS_WAIT
dnl ************************************
dnl Check for posix compatible alloca()
dnl ************************************
AC_FUNC_ALLOCA
dnl ******************************
dnl Checks for functions
dnl ******************************
AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
dnl ***********************************
dnl Check for base dependencies early.
dnl ***********************************
PKG_CHECK_MODULES(GNOME_PLATFORM,
[gio-2.0 >= glib_minimum_version
gmodule-2.0 >= glib_minimum_version
libxml-2.0 >= libxml_minimum_version
libsoup-2.4 >= soup_minimum_version])
if test x$os_win32 = xno; then
PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
else
PKG_CHECK_MODULES(GIO_UNIX, [gio-windows-2.0])
fi
dnl ******************************
dnl Check for libphonenumber
dnl ******************************
EVO_PHONENUMBER_SUPPORT
dnl *******************
dnl Check for ICU
dnl *******************
dnl
dnl ICU recently started shipping pkg-config files but it's
dnl not present on many systems, if we don't find the pkg-config
dnl file then let's fallback on a manual check
enable_icu=no
PKG_CHECK_MODULES(ICU, icu-i18n, enable_icu=yes, [
enable_icu=yes
AC_CHECK_HEADERS(unicode/ucol.h,, enable_icu=no)
AC_MSG_CHECKING([for libicui18n])
LIBS_old=$LIBS
LIBS="$LIBS -licui18n -licuuc -licudata"
AC_TRY_LINK([#include <unicode/ucol.h>],
[ucol_open ("", NULL);],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no); enable_icu=no)
LIBS=$LIBS_old
if [test x$enable_icu = xyes]; then
ICU_CFLAGS=-D_REENTRANT
ICU_LIBS="-licui18n -licuuc -licudata"
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
else
AC_MSG_ERROR([ICU libs not found, icu-i18n is required.])
fi
])
dnl *************************
dnl Check for GTK+
dnl *************************
AC_ARG_ENABLE([gtk],
[AS_HELP_STRING([--enable-gtk],
[enable GTK+ (default=yes)])],
[enable_gtk=$enableval], [enable_gtk=yes])
AC_MSG_CHECKING([if GTK+ support is enabled])
AC_MSG_RESULT([$enable_gtk])
if test "x$enable_gtk" = xyes; then
PKG_CHECK_MODULES(
[GTK], [gtk+-3.0 >= gdk_minimum_version],,
[AC_MSG_ERROR([
gtk+-3.0 not found (or version < gdk_minimum_version)
If you want to disable GTK+ support,
please append --disable-gtk to configure.
])])
PKG_CHECK_MODULES(
[GCR], [gcr-3 >= gcr_minimum_version],,
[AC_MSG_ERROR([
gcr-3.0 not found (or version < gcr_minimum_version)
If you want to disable gcr-3.0's GTK+ widgets,
please append --disable-gtk to configure.
])])
AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
fi
AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
dnl **********************************
dnl Check for WebKitGTK+ and json-glib
dnl **********************************
AC_ARG_ENABLE([google-auth],
[AS_HELP_STRING([--enable-google-auth],
[enable Google authentication (default=yes)])],
[enable_google_auth=$enableval], [enable_google_auth=yes])
AC_MSG_CHECKING([if Google authentication support is enabled])
AC_MSG_RESULT([$enable_google_auth])
if test "x$enable_google_auth" = "xyes"; then
PKG_CHECK_MODULES(
[GOOGLE_AUTH], [webkitgtk-3.0 >= webkitgtk_minimum_version
json-glib-1.0 >= json_glib_minimum_version],,
[AC_MSG_ERROR([
Libraries to support Google authentication prompts not found,
or versions not new enough.
If you want to disable Google authentication support,
please append --disable-google-auth to configure.
])])
AC_DEFINE(ENABLE_GOOGLE_AUTH, 1, [Define to 1 if Google autentication support is enabled.])
AC_ARG_WITH(google-client-id, [AS_HELP_STRING([--with-google-client-id], [Google OAuth 2.0 client id])], [], [])
if test "x$with_google_client_id" = "x"; then
with_google_client_id=590402290962-2i0b7rqma8b9nmtfrcp7fa06g6cf7g74.apps.googleusercontent.com
fi
AC_ARG_WITH(google-client-secret, [AS_HELP_STRING([--with-google-client-secret], [Google OAuth 2.0 client secret])], [], [])
if test "x$with_google_client_secret" = "x"; then
with_google_client_secret=mtfUe5W8Aal9DcgVipOY1T9G
fi
AC_DEFINE_UNQUOTED(GOOGLE_CLIENT_ID, ["$with_google_client_id"], [Define Google OAuth 2.0 Client ID to use])
AC_DEFINE_UNQUOTED(GOOGLE_CLIENT_SECRET, ["$with_google_client_secret"], [Define Google OAuth 2.0 Client Secret to use])
fi
AM_CONDITIONAL(ENABLE_GOOGLE_AUTH, [test x$enable_google_auth = xyes])
dnl ******************************************
dnl Check whether to build examples/demos
dnl ******************************************
AC_ARG_ENABLE([examples],
[AS_HELP_STRING([--enable-examples],
[enable the building examples (default=yes)])],
[enable_examples=$enableval], [enable_examples=yes])
AC_MSG_CHECKING([if examples should be built])
AC_MSG_RESULT([$enable_examples])
if test "x$enable_examples" = xyes; then
PKG_CHECK_MODULES([EXAMPLES],
[gtk+-3.0 >= 3.10 glib-2.0 >= 2.38],,
[AC_MSG_ERROR([
Some packages were not available to build the example program(s).
If you want to disable examples, please
append --disable-examples to configure.
])])
AC_DEFINE(BUILD_EXAMPLES, 1, [Define to 1 if the examples should be built.])
fi
AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_examples = xyes])
dnl *******************************
dnl Check for GNOME Online Accounts
dnl *******************************
AC_ARG_ENABLE([goa],
[AS_HELP_STRING([--enable-goa],
[enable GNOME Online Accounts support (default=yes)])],
[enable_goa=$enableval], [enable_goa=yes])
AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
AC_MSG_RESULT([$enable_goa])
if test "x$enable_goa" = xyes; then
PKG_CHECK_MODULES(
[GOA], [goa-1.0 >= goa_minimum_version],,
[AC_MSG_ERROR([
goa-1.0 not found (or version < goa_minimum_version)
If you want to disable GNOME Online Accounts support,
please append --disable-goa to configure.
])])
AC_DEFINE(HAVE_GOA, 1, [Define to 1 if you have the goa-1.0 package.])
fi
AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
dnl ********************************
dnl Check for Ubuntu Online Accounts
dnl ********************************
AC_ARG_ENABLE([uoa],
[AS_HELP_STRING([--enable-uoa],
[enable Ubuntu Online Accounts support (default=yes)])],
[enable_uoa=$enableval], [enable_uoa=yes])
AC_MSG_CHECKING([if Ubuntu Online Accounts support is enabled])
AC_MSG_RESULT([$enable_uoa])
if test "x$enable_uoa" = xyes; then
PKG_CHECK_MODULES(
[LIBACCOUNTS_GLIB],
[libaccounts-glib >= libaccounts_glib_minimum_version],,
[AC_MSG_ERROR([
libaccounts-glib not found (or version < libaccounts_glib_minimum_version)
If you want to disable Ubuntu Online Accounts support,
please append --disable-uoa to configure.
])])
PKG_CHECK_MODULES(
[LIBSIGNON_GLIB],
[libsignon-glib >= libsignon_glib_minimum_version],,
[AC_MSG_ERROR([
libsignon-glib not found (or version < libsignon_glib_minimum_version)
If you want to disable Ubuntu Online Accounts support,
please append --disable-uoa to configure.
])])
PKG_CHECK_MODULES(
[JSON_GLIB], [json-glib-1.0],,
[AC_MSG_ERROR([
json-glib-1.0 not found
If you want to disable Ubuntu Online Accounts support,
please append --disable-uoa to configure.
])])
PKG_CHECK_MODULES(
[REST], [rest-0.7],,
[AC_MSG_ERROR([
librest-0.7 not found
If you want to disable Ubuntu Online Accounts support,
please append --disable-uoa to configure.
])])
AC_DEFINE(HAVE_UOA, 1, [Have libaccounts-glib])
fi
AM_CONDITIONAL(HAVE_UOA, [test x$enable_uoa = xyes])
dnl **********************************************
dnl Check if backend per process should be enabled
dnl **********************************************
AC_ARG_ENABLE([backend-per-process],
[AS_HELP_STRING([--enable-backend-per-process],
[enable backend per process support (default=yes)])],
[enable_backend_per_process=$enableval], [enable_backend_per_process=yes])
AC_MSG_CHECKING([if backend per process is enabled])
AC_MSG_RESULT([$enable_backend_per_process])
if test "x$enable_backend_per_process" = xyes; then
AC_DEFINE(ENABLE_BACKEND_PER_PROCESS, 1, [If backend-per-process is enabled])
fi
AM_CONDITIONAL(ENABLE_BACKEND_PER_PROCESS, [test x$enable_backend_per_process = xyes])
dnl ***********************************
dnl Check for GNOME Keyring.
dnl ***********************************
if test x$os_win32 = xno; then
PKG_CHECK_MODULES(LIBSECRET,
[libsecret-unstable >= libsecret_minimum_version])
fi
AC_SUBST(LIBSECRET_CFLAGS)
AC_SUBST(LIBSECRET_LIBS)
dnl **********************************************************
dnl gcr-base is needed for secure password exchange over D-Bus
dnl **********************************************************
PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
AC_SUBST(GCR_BASE_CFLAGS)
AC_SUBST(GCR_BASE_LIBS)
LIBICAL_REQUIRED=libical_minimum_version
AC_SUBST(LIBICAL_REQUIRED)
dnl ******************************
dnl regex check
dnl ******************************
AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
[REGEX_LIBS=-lregex
AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
[AC_MSG_ERROR([No regex library found])])])
AC_SUBST(REGEX_LIBS)
dnl ******************************
dnl libdb checking
dnl ******************************
AC_ARG_WITH([libdb],
AS_HELP_STRING([--with-libdb=PREFIX],
[Prefix where libdb is installed]),
[with_libdb=$withval],[with_libdb=yes])
if test "x$with_libdb" != "xno" ; then
if test "x$with_libdb" != "xyes" ; then
DB_CFLAGS="$CFLAGS -I$with_libdb/include"
DB_LIBS="$LIBS -L$with_libdb/lib -ldb"
else
if test -z "$DB_CFLAGS" -a -z "$DB_LIBS"; then
DB_CFLAGS="$CFLAGS"
DB_LIBS="$LIBS -ldb"
fi
fi
AC_MSG_CHECKING([Berkeley DB])
save_cflags=$CFLAGS; CFLAGS="$CFLAGS $DB_CFLAGS"
save_libs=$LIBS; LIBS="$LIBS $DB_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <db.h>]],
[[db_create(NULL, NULL, 0)]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([Cannot find libdb])])
CFLAGS=$save_cflags
LIBS=$save_libs
AC_SUBST(DB_CFLAGS)
AC_SUBST(DB_LIBS)
AC_DEFINE(HAVE_LIBDB, 1, [Have libdb])
fi
AM_CONDITIONAL(HAVE_LIBDB, [test x$with_libdb != xno])
dnl ******************************
dnl db_load checking
dnl ******************************
have_db_load=no
AC_PATH_PROG(DB_LOAD, [db_load])
if test -z "$DB_LOAD"; then
AC_MSG_WARN([db_load not found, some unit tests will not be run.])
else
have_db_load=yes
fi
AM_CONDITIONAL(HAVE_DB_LOAD, test x"$have_db_load" = "xyes")
dnl ******************************
dnl iconv checking
dnl ******************************
have_iconv="no"
save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[
#include <iconv.h>
#include <stdlib.h>
]],
[[
iconv_t cd;
cd = iconv_open ("UTF-8", "ISO-8859-1");
]]
)],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
if test "x$ac_cv_libiconv" = "xyes"; then
ICONV_LIBS="-liconv"
if test "x$os_win32" = "xyes"; then
dnl Don't pointlessly auto-export the global symbols
dnl from a potentially static libiconv.a
ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
fi
have_iconv="yes"
else
LIBS="$save_LIBS"
AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
fi
if test "x$have_iconv" = "xyes"; then
if test "x$ac_cv_libiconv" = "xno"; then
AC_CHECK_FUNCS(gnu_get_libc_version)
fi
AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <iconv.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_GNU_GET_LIBC_VERSION
#include <gnu/libc-version.h>
#endif
int main() {
char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
char *transbuf = malloc (10), *trans = transbuf;
iconv_t cd;
size_t jp_len = strlen (jp), utf8_len = 10;
size_t utf8_real_len = strlen (utf8);
#ifdef HAVE_GNU_GET_LIBC_VERSION
/* glibc 2.1.2's iconv is broken in hard to test ways. */
if (!strcmp (gnu_get_libc_version (), "2.1.2"))
exit (1);
#endif
cd = iconv_open ("UTF-8", "ISO-2022-JP");
if (cd == (iconv_t) -1)
exit (1);
if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
exit (1);
if (memcmp (utf8, transbuf, utf8_real_len) != 0)
exit (1);
return (0);}
]])
],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
fi
if test "x$have_iconv" = "xno"; then
AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
fi
AC_SUBST(ICONV_LIBS)
CFLAGS="$CFLAGS -I$srcdir $GNOME_PLATFORM_CFLAGS"
LIBS="$LIBS $ICONV_LIBS $GNOME_PLATFORM_LIBS"
AC_MSG_CHECKING([preferred charset name formats for system iconv])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define CONFIGURE_IN
#include "iconv-detect.c"
]])],
[AC_MSG_RESULT([found])],
[AC_MSG_RESULT([not found])
AC_MSG_WARN([
*** The iconv-detect program was unable to determine the
*** preferred charset name formats recognized by your
*** iconv library. It is suggested that you install a
*** working iconv library such as the one found at
*** ftp://ftp.gnu.org/pub/gnu/libiconv
])],
[if test "x$os_win32" = xyes; then
AC_MSG_RESULT([using known win32 result])
echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
echo >>iconv-detect.h
echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
else
AC_MSG_RESULT([unknown])
AC_MSG_WARN([
*** We can't determine the preferred charset name formats
*** recognized by your iconv library. You are
*** cross-compiling and supposed to know what you are doing.
*** Please construct the iconv-detect.h file manually.
])
fi
])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
AC_ARG_ENABLE([backtraces],
[AS_HELP_STRING([--enable-backtraces],
[enable backtraces for camel_pointer_tracker (default=no)])],
[enable_backtraces=$enableval], [enable_backtraces=no])
if test "x$enable_backtraces" = xyes; then
dnl ****************************
dnl Check for backtrace_symbols function and dwfl from elfutils
dnl ****************************
AC_MSG_CHECKING([libc backtrace_symbols function])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <execinfo.h>]],
[[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
[AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
AC_MSG_RESULT([$ac_cv_have_bsf])
if test "x$ac_cv_have_bsf" = xyes; then
LIBS="$LIBS -ldw"
AC_MSG_CHECKING([elfutils/libdwfl])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <elfutils/libdwfl.h>]],
[[{
Dwfl *dwfl;
Dwfl_Module *module;
Dwarf_Addr module_low_addr;
Dwfl_Line *line;
dwfl_standard_find_debuginfo;
dwfl_linux_proc_find_elf;
dwfl_begin (NULL);
dwfl_linux_proc_report (NULL, 1);
dwfl_report_end (NULL, NULL, NULL);
dwfl_end (NULL);
dwfl_module_addrname (NULL, NULL);
dwfl_module_getsrc (NULL, NULL);
dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
DWARF_CB_ABORT; DWARF_CB_OK;
dwfl_getmodules (NULL, NULL, NULL, 0);
}]])],
[AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
AC_MSG_RESULT([$ac_cv_have_elfdwfl])
LIBS="$save_LIBS"
if test "x$ac_cv_have_elfdwfl" = xyes; then
LIBDWFL_LIBS="-ldw"
AC_SUBST(LIBDWFL_LIBS)
fi
fi
fi
dnl ******************************
dnl Check for nl_langinfo features
dnl ******************************
EVO_CHECK_LANGINFO([CODESET])
EVO_CHECK_LANGINFO([_NL_ADDRESS_COUNTRY_AB2])
dnl *******************************************************
dnl Check to see if strftime supports the use of %l and %k
dnl *******************************************************
AC_MSG_CHECKING([for %l and %k support in strftime])
AC_RUN_IFELSE([AC_LANG_SOURCE(
[[ #include <stdlib.h>
#include <string.h>
#include <time.h>
int main(int argc, char **argv) {
char buf[10];
time_t rawtime;
struct tm *timeinfo;
time(&rawtime);
timeinfo=localtime(&rawtime);
buf[0] = '\0';
strftime(buf, 10, "%lx%k", timeinfo);
if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
exit(1);
else
exit(0);
return 0;
}
]]
)],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
AC_MSG_RESULT([$ac_cv_lkstrftime])
dnl ********************************************************************************
dnl security extension support (SSL and S/MIME)
dnl
dnl The following voodoo does detection of mozilla libraries (nspr and nss)
dnl needed by Camel (SSL and S/MIME).
dnl
dnl The Evolution security extensions are only built if these libraries are found
dnl ********************************************************************************
msg_smime="no"
AC_ARG_ENABLE([smime],
AS_HELP_STRING([--enable-smime],
[Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
[enable_smime="$enableval"],[enable_smime="yes"])
AC_ARG_WITH([nspr-includes],
AS_HELP_STRING([--with-nspr-includes],
[Prefix of Mozilla nspr4 includes.]),
[with_nspr_includes="$withval"])
AC_ARG_WITH([nspr-libs],
AS_HELP_STRING([--with-nspr-libs],
[Prefix of Mozilla nspr4 libs.]),
[with_nspr_libs="$withval"])
AC_ARG_WITH([nss-includes],
AS_HELP_STRING([--with-nss-includes],
[Prefix of Mozilla nss3 includes.]),
[with_nss_includes="$withval"])
AC_ARG_WITH([nss-libs],
AS_HELP_STRING([--with-nss-libs],
[Prefix of Mozilla nss3 libs.]),
[with_nss_libs="$withval"])
if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
check_manually="yes"
else
check_manually="no"
fi
dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
if test "x${check_manually}" = "xno"; then
AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
for pc in $mozilla_nspr_pcs; do
if $PKG_CONFIG --exists $pc; then
AC_MSG_RESULT($pc)
mozilla_nspr=$pc
break;
fi
done
AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
for pc in $mozilla_nss_pcs; do
if $PKG_CONFIG --exists $pc; then
AC_MSG_RESULT($pc)
mozilla_nss=$pc
break;
fi
done
if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
if test "x$enable_smime" = "xyes"; then
AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
msg_smime="yes"
fi
MANUAL_NSPR_CFLAGS=""
MANUAL_NSPR_LIBS=""
MANUAL_NSS_CFLAGS=""
MANUAL_NSS_LIBS=""
else
check_manually="yes"
mozilla_nspr=""
mozilla_nss=""
fi
fi
if test "x${check_manually}" = "xyes"; then
dnl ******************
dnl Check for NSPR 4
dnl ******************
AC_MSG_CHECKING([for Mozilla nspr4 includes])
CPPFLAGS_save="$CPPFLAGS"
if test -n "$with_nspr_includes"; then
CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
fi