-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
2271 lines (2006 loc) · 72.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
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
AC_PREREQ([2.69])
m4_define([claws_VERSION], m4_esyscmd([./get-git-version]))
AC_INIT([Claws Mail],m4_defn([claws_VERSION]),[],[claws-mail-olh],[https://gitlab.com/olafhering/claws])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([no-define])
dnl version number
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
GIT_VERSION=m4_defn([claws_VERSION])
if test -f "$srcdir/VERSION_UI"
then
VERSION_UI="`cat $srcdir/VERSION_UI`"
else
date="`date -u -d @$(git --no-pager log -n1 --pretty=%at) +%Y%m%dT%H%M%S || echo 0`"
hash="`git --no-pager log -n1 --pretty=%H | cut -b -8`"
VERSION_UI="${date}.${hash}"
fi
if test \( -z "$GIT_VERSION" \); then
AC_MSG_ERROR([*** could not determine program version])
fi
MAJOR_VERSION=${GIT_VERSION%%.*}
MINOR_VERSION=${GIT_VERSION#*.}
MINOR_VERSION=${MINOR_VERSION%%.*}
MICRO_VERSION=${GIT_VERSION##*.}
MICRO_VERSION=${MICRO_VERSION%%-*}
EXTRA_VERSION=${GIT_VERSION#*-}
EXTRA_VERSION=${EXTRA_VERSION%%-*}
if test \( "x$EXTRA_VERSION" != "x" -a `echo -n $EXTRA_VERSION | wc -c` -lt 5 \); then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}git${EXTRA_VERSION}
else
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
EXTRA_VERSION=0
fi
if test \( "x$EXTRA_RELEASE" != "x" \); then
VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
fi
AC_SUBST(VERSION)
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(EXTRA_VERSION)
AC_SUBST(GIT_VERSION)
AC_SUBST(VERSION_UI)
AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
dnl Require pkg-config
m4_ifndef([PKG_PROG_PKG_CONFIG],
[m4_fatal([Could not locate the pkg-config autoconf macros. These
are usually located in /usr/share/aclocal/pkg.m4. If your macros
are in a different location, try setting the environment variable
ACLOCAL_FLAGS before running ./autogen.sh or autoreconf again. E.g.:
export ACLOCAL_FLAGS="-I/other/macro/dir"])
])
PKG_PROG_PKG_CONFIG
dnl libtool versioning
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Specify a header configuration file
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_HEADERS(claws-features.h)
AM_MAINTAINER_MODE
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs.
dnl AC_ARG_PROGRAM
AC_PROG_CC
AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_CPP
dnl AC_PROG_RANLIB
AC_PROG_LEX(noyywrap)
AC_PROG_YACC
AC_LIB_PREFIX
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE(AC_CANONICAL_HOST)_LT_SET_OPTION([LT_INIT],[win32-dll])
m4_warn([obsolete],[AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
])
LT_INIT
LT_PROG_RC
LT_LANG([Windows Resource])
LT_INIT
AC_PROG_AWK
dnl AC_PROG_CXX will set CXX=g++ even if it finds no useable C++
dnl compiler, so we have to check whether the program named by
dnl CXX exists.
AC_PROG_CXX
AC_PATH_PROG(REAL_CXX, $CXX)
HAVE_CXX=no
if test -n "$REAL_CXX"; then
HAVE_CXX=yes
fi
AC_SYS_LARGEFILE
dnl Copied from the official gtk+-2 configure.in
AC_MSG_CHECKING([for host platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
LDFLAGS="$LDFLAGS -mwindows -Wl,--export-all-symbols"
;;
*-apple-*)
platform_osx=yes
LDFLAGS="$LDFLAGS -Wl,-export_dynamic"
;;
*)
platform_win32=no
platform_osx=no
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
;;
esac
AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
AM_CONDITIONAL(PLATFORM_OSX, test x"$platform_osx" = x"yes")
AC_MSG_RESULT([$host])
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
AC_MSG_CHECKING([for Cygwin])
case "$host" in
*-*-cygwin*)
env_cygwin=yes
;;
*)
env_cygwin=no
;;
esac
AC_MSG_RESULT([$env_cygwin])
AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
AC_MSG_CHECKING([for time_t format specifier])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wformat -Werror"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <stdio.h>
#include <time.h>
]],[[printf("%lld", time(NULL));]])],
[time_t_long_long=yes],
[time_t_long_long=no])
CFLAGS=$_gcc_cflags_save
if test x"$time_t_long_long" = xyes; then
time_t_fmt=lld
else
time_t_fmt=ld
fi
AC_MSG_RESULT([$time_t_fmt])
AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"],
[Define printf format specifier for time_t])
AM_CFLAGS="-Wall"
if test $USE_MAINTAINER_MODE = yes; then
AM_CFLAGS="$AM_CFLAGS -g"
fi
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
AC_MSG_RESULT($_gcc_psign)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_psign" = xyes ; then
AM_CFLAGS="$AM_CFLAGS -Wno-pointer-sign"
fi
pthread_name=
case "$target" in
*-darwin*)
AM_CFLAGS="$AM_CFLAGS -no-cpp-precomp -fno-common"
;;
*-*-mingw*)
# Note that we need to link to pthread in all cases. This
# is because some locking is used even when pthread support is
# disabled.
pthread_name=pthread
AM_CFLAGS="$AM_CFLAGS -mms-bitfields"
LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
;;
*-*-solaris*)
AM_CFLAGS="$AM_CFLAGS -std=gnu99"
AC_DEFINE([SOLARIS], [], [Target is Solaris])
;;
esac
AC_SUBST(AM_CFLAGS)
dnl Checks for iconv
AM_ICONV
dnl floor and ceil are in -lm
LIBS="$LIBS -lm"
dnl for gettext
ALL_LINGUAS="ca cs da de el_GR en_GB es fi fr hu id_ID it ja nb nl pl pt_BR pt_PT ro ru sk sv tr zh_TW"
ALL_LINGUAS="de"
GETTEXT_PACKAGE=${PACKAGE_TARNAME}
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
AM_GNU_GETTEXT_VERSION([0.18])
AM_GNU_GETTEXT([external])
AC_ARG_ENABLE(manual,
[ --disable-manual Do not build user manual],
[enable_manual=$enableval], [enable_manual=yes])
AC_ARG_ENABLE(libsm,
[ --disable-libsm Do not build libSM support for session management],
[enable_libsm=$enableval], [enable_libsm=yes])
AC_ARG_ENABLE(ipv6,
[ --disable-ipv6 Do not build IPv6 support],
[enable_ipv6=$enableval], [enable_ipv6=yes])
AC_ARG_ENABLE(gnutls,
[ --disable-gnutls Do not build GnuTLS support for TLS],
[enable_gnutls=$enableval], [enable_gnutls=yes])
AC_ARG_ENABLE(oauth2,
[ --disable-oauth2 Do not build OAuth2 support],
[enable_oauth2=$enableval], [enable_oauth2=yes])
AC_ARG_ENABLE(enchant,
[ --disable-enchant Do not build Enchant support for spell-checking],
[enable_enchant=$enableval], [enable_enchant=yes])
AC_ARG_ENABLE(crash-dialog,
[ --enable-crash-dialog Build crash dialog],
[enable_crash_dialog=$enableval], [enable_crash_dialog=no])
AC_ARG_ENABLE(generic-umpc,
[ --enable-generic-umpc Build generic UMPC code],
[enable_generic_umpc=$enableval], [enable_generic_umpc=no])
AC_ARG_ENABLE(compface,
[ --disable-compface Do not build compface support for X-Face],
[enable_compface=$enableval], [enable_compface=yes])
AC_ARG_ENABLE(pthread,
[ --disable-pthread Do not build pthread support],
[enable_pthread=$enableval], [enable_pthread=yes])
AC_ARG_ENABLE(startup-notification,
[ --disable-startup-notification Do not startup notification support],
[enable_startup_notification=$enableval], [enable_startup_notification=yes])
AC_ARG_ENABLE(dbus,
[ --disable-dbus Do not build DBUS support],
[enable_dbus=$enableval], [enable_dbus=yes])
AC_ARG_ENABLE(ldap,
[ --disable-ldap Do not build LDAP support],
[enable_ldap=$enableval], [enable_ldap=yes])
AC_ARG_ENABLE(jpilot,
[ --disable-jpilot Do not build JPilot support],
[enable_jpilot=$enableval], [enable_jpilot=yes])
AC_ARG_ENABLE(networkmanager,
[ --disable-networkmanager Do not build NetworkManager support],
[enable_networkmanager=$enableval], [enable_networkmanager=yes])
AC_ARG_ENABLE(libetpan,
[ --disable-libetpan Do not build libetpan support for IMAP4/NNTP],
[enable_libetpan=$enableval], [enable_libetpan=yes])
AC_ARG_ENABLE(valgrind,
[ --disable-valgrind Do not build valgrind support for debugging],
[enable_valgrind=$enableval], [enable_valgrind=yes])
AC_ARG_ENABLE(alternate-addressbook,
[ --enable-alternate-addressbook Build alternate external address book support],
[enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
AC_ARG_ENABLE(svg,
[ --disable-svg Do not build SVG support],
[enable_svg=$enableval], [enable_svg=yes])
AC_ARG_ENABLE(tests,
[ --enable-tests Build unit tests],
[enable_tests=$enableval], [enable_tests=no])
AC_ARG_ENABLE(more-addressbook-debug,
[ --enable-more-addressbook-debug Build with additional addressbook debug calls],
[enable_more_addressbook_debug=$enableval], [enable_more_addressbook_debug=no])
AC_ARG_ENABLE(more-ldap-debug,
[ --enable-more-ldap-debug Build with additional LDAP debug calls],
[enable_more_ldap_debug=$enableval], [enable_more_ldap_debug=no])
manualdir='${docdir}/manual'
AC_ARG_WITH(manualdir,
[ --with-manualdir=DIR Manual directory],
[manualdir="$withval"])
AC_SUBST(manualdir)
dnl ******************************
dnl ** Check for required tools **
dnl ** to build manuals **
dnl ******************************
AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
if test x"$enable_manual" = x"yes"; then
if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
-o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
enable_manual=yes
else
enable_manual=no
fi
fi
AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datarootdir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE_TARNAME}",[PACKAGE_DATA_DIR])
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE_TARNAME}",[PACKAGE_DATA_DIR])
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE_TARNAME}",[PACKAGE_DATA_DIR])
fi
AC_CHECK_LIB(xpg4, setlocale)
SM_LIBS=""
dnl Check for LibSM
AC_MSG_CHECKING([whether to use LibSM])
if test x"$enable_libsm" = xyes; then
AC_MSG_RESULT(yes)
AC_CHECK_LIB(SM, SmcSaveYourselfDone,
[SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
$X_LIBS -lICE)
AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
if test x"$enable_libsm" = xyes; then
AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
else
AC_MSG_RESULT(not found)
AC_MSG_WARN([*** LibSM will not be supported ***])
fi
else
AC_MSG_RESULT(no)
fi
AC_SUBST(SM_LIBS)
dnl Checks for header files.
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(paths.h \
sys/param.h sys/utsname.h sys/select.h \
wchar.h wctype.h locale.h netdb.h)
AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(fgets_unlocked flock lockf strcasestr)
dnl *****************
dnl ** common code **
dnl *****************
dnl check for glib
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.50 gmodule-2.0 >= 2.50 gobject-2.0 >= 2.50 gthread-2.0 >= 2.50])
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_50, [Ignore post 2.50 deprecations])
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_50, [Prevent post 2.50 APIs])
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
dnl check for IPv6 option
dnl automated checks for IPv6 support.
AC_MSG_CHECKING([whether to use IPv6])
if test x"$enable_ipv6" = xyes; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([for IPv6 support])
if test x"$platform_win32" = xyes; then
AC_CACHE_VAL(ac_cv_ipv6,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <ws2tcpip.h>
]], [[struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
])
else
AC_CACHE_VAL(ac_cv_ipv6,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define INET6
#include <sys/types.h>
#include <netinet/in.h>
]], [[int x = IPPROTO_IPV6; struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
])
fi
AC_MSG_RESULT($ac_cv_ipv6)
if test $ac_cv_ipv6 = yes; then
AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
else
AC_MSG_WARN(*** IPv6 will not be supported ***)
enable_ipv6=no
fi
else
AC_MSG_RESULT(no)
fi
dnl GNUTLS
AC_MSG_CHECKING([whether to use GnuTLS])
AC_MSG_RESULT($enable_gnutls)
if test "x$enable_gnutls" != "xno"; then
PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
[
AC_DEFINE(USE_GNUTLS, 1, gnutls)
echo "Building with GnuTLS"
PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
[
dnl No linking against libgcrypt needed
],
[
dnl linking against libgcrypt *is* needed
GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
])
],
[
echo "Building without GnuTLS"
AC_MSG_RESULT([*** GnuTLS support is recommended ])
AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
AC_MSG_ERROR([GnuTLS not found])
])
AC_SUBST(GNUTLS_LIBS)
AC_SUBST(GNUTLS_CFLAGS)
fi
PKG_CHECK_MODULES(NETTLE, nettle)
AC_SUBST(NETTLE_LIBS)
AC_SUBST(NETTLE_CFLAGS)
AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
dnl RC dir (will be default at a certain point in time)
AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
dnl Set correct default value based on platform
if test x"$ac_cv_with_config_dir" = x""; then
if test x"$platform_win32" = xyes; then
ac_cv_with_config_dir="Claws-mail"
else
ac_cv_with_config_dir=".claws-mail"
fi
fi
AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
AC_ARG_WITH(password-encryption, [ --with-password-encryption=PROVIDER Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
pwd_crypto="$withval", pwd_crypto="default")
if test x"$pwd_crypto" = xdefault; then
if test x"$enable_gnutls" = xyes; then
if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
pwd_crypto="gnutls"
fi
fi
fi
if test x"$pwd_crypto" = xdefault; then
pwd_crypto="old"
fi
case $pwd_crypto in
gnutls)
if test x"$enable_gnutls" = xno; then
AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
fi
if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
fi
AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
;;
old)
AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
;;
*)
AC_MSG_ERROR([Unknown password encryption provider requested.])
;;
esac
AC_MSG_CHECKING([whether GnuTLS support is present for OAuth2])
if test x"$enable_gnutls" = xyes; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([whether to build OAuth2 support])
if test x"$enable_oauth2" = xyes; then
AC_MSG_RESULT([yes])
AC_DEFINE(USE_OAUTH2, 1, [Define if OAuth2 is to be activated.])
else
AC_MSG_RESULT([no])
enable_oauth2=no
fi
else
AC_MSG_RESULT([no])
enable_oauth2=no
fi
dnl ************************
dnl ** GTK user interface **
dnl ************************
dnl Checks for GTK
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_2_24, [Ignore post 2.24 deprecations])
AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_2_24, [Prevent post 2.24 APIs])
AC_ARG_ENABLE(deprecated,
[ --disable-deprecated Disable deprecated GTK functions],
gtkdeprecated=$enableval)
AC_MSG_CHECKING([whether to use deprecated GTK functions])
if test x"$gtkdeprecated" != xno; then
AC_MSG_RESULT(yes)
else
GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
AC_MSG_RESULT(no)
fi
dnl Make sure the code does not regress to using deprecated GTK stuff...
GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
dnl enchant is used for spell checking
AC_MSG_CHECKING([whether to use enchant])
AC_MSG_RESULT($enable_enchant)
if test $enable_enchant = yes; then
PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
[
AC_DEFINE(USE_ENCHANT, 1, enchant)
echo "Building with enchant"
enable_enchant=yes
],
[
PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
[
AC_DEFINE(USE_ENCHANT, 1, enchant-2)
echo "Building with enchant-2"
enable_enchant=yes
],
[
echo "Building without enchant-notification"
enable_enchant=no
])
])
AC_SUBST(ENCHANT_CFLAGS)
AC_SUBST(ENCHANT_LIBS)
fi
dnl want crash dialog
if test $enable_crash_dialog = yes; then
dnl check if GDB is somewhere
AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
AC_MSG_CHECKING([whether to use crash dialog])
if test $enable_crash_dialog = yes; then
AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
fi
AC_MSG_RESULT($enable_crash_dialog)
fi
dnl generic umpc
if test $enable_generic_umpc = yes; then
AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
AC_MSG_RESULT($enable_generic_umpc)
fi
dnl Check for X-Face support
AC_MSG_CHECKING([whether to use compface])
if test x"$enable_compface" = xyes; then
AC_MSG_RESULT(yes)
AC_CHECK_LIB(compface, uncompface,
[AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
[enable_compface=no])
if test x"$enable_compface" = xyes; then
COMPFACE_LIBS="-lcompface"
else
COMPFACE_LIBS=""
fi
AC_SUBST(COMPFACE_LIBS)
else
AC_MSG_RESULT(no)
fi
dnl check for pthread support
AC_MSG_CHECKING([whether to use pthread])
if test x$enable_pthread = xno; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
# For W32 we need to use a special ptrhead lib. In this case we can't
# use AC_CHECK_LIB because it has no means of checking for a
# library installed under a different name. Checking for the
# header is okay.
if test -n "${pthread_name}" ; then
enable_pthread=yes
else
AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
fi
AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
if test x$enable_pthread = xyes; then
AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
if test -z "${pthread_name}" ; then
PTHREAD_LIBS="-lpthread"
fi
fi
fi
AC_SUBST(PTHREAD_LIBS)
dnl
dnl Check whether we need to pass -lresolv
dnl We know that we don't need it for W32.
dnl
if test x$os_win32 = xno; then
t_oldLibs="$LIBS"
LIBS="$LIBS"
ac_cv_var__res_options=no
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>]], [[_res.options = RES_INIT;]])],[ac_cv_var__res_options=yes],[]);
if test "$ac_cv_var__res_options" != "yes"; then
LIBRESOLV="-lresolv"
fi
LIBS="$t_oldLibs"
if test "x$LIBRESOLV" = "x"; then
AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
LIBS="$t_oldLibs"
fi
fi
AC_SUBST(LIBRESOLV)
LIBS="$LIBS $LIBRESOLV"
dnl #######################################################################
dnl # Check for startup notification
dnl #######################################################################
if test "x$enable_startup_notification" = "xyes"; then
PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
[
AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
echo "Building with libstartup-notification"
enable_startup_notification=yes
],
[
echo "Building without libstartup-notification"
enable_startup_notification=no
])
AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
AC_SUBST(STARTUP_NOTIFICATION_LIBS)
fi
dnl #######################################################################
dnl # Check for D-Bus support
dnl #######################################################################
if test "x$enable_dbus" = "xyes"; then
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
[
AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
enable_dbus=yes
],
[
echo "D-Bus requirements not met. D-Bus support not activated."
enable_dbus=no
])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
fi
dnl #######################################################################
dnl # Configure address book support
dnl #######################################################################
dnl #######################################################################
dnl # Check for alternate address book support
dnl #######################################################################
AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
if test x"$enable_dbus" = xyes; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([whether to enable alternate address book])
if test x"$enable_alternate_addressbook" = xyes; then
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
[
AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
enable_alternate_addressbook=yes
AC_SUBST(CONTACTS_CFLAGS)
AC_SUBST(CONTACTS_LIBS)
],
[
enable_alternate_addressbook=no
])
else
AC_MSG_RESULT([no])
enable_alternate_addressbook=no
fi
else
AC_MSG_RESULT([no])
enable_alternate_addressbook=no
fi
dnl #######################################################################
dnl # Check for old address book support
dnl #######################################################################
if test x"$enable_alternate_addressbook" = xno; then
dnl for LDAP support in addressbook
dnl no check for libraries; dynamically loaded
AC_MSG_CHECKING([whether to use LDAP])
if test x"$enable_ldap" = xno; then
AC_MSG_RESULT(no)
elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
AC_MSG_RESULT(no - LDAP support needs pthread support)
enable_ldap=no
elif test x"$platform_win32" = xyes; then
AC_MSG_RESULT(yes)
AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
LDAP_LIBS="-lwldap32"
AC_SUBST(LDAP_LIBS)
else
AC_MSG_RESULT(yes)
dnl check for available libraries, and pull them in
AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
$LDAP_LIBS)
AC_CHECK_HEADERS(ldap.h lber.h,
[ enable_ldap=yes ],
[ enable_ldap=no ])
if test "$enable_ldap" = yes; then
AC_CHECK_LIB(ldap, ldap_open,
[ enable_ldap=yes ],
[ enable_ldap=no ],
$LDAP_LIBS)
AC_CHECK_LIB(ldap, ldap_start_tls_s,
[ ac_cv_have_tls=yes ],
[ ac_cv_have_tls=no ])
fi
AC_MSG_CHECKING([whether ldap library is available])
AC_MSG_RESULT($enable_ldap)
AC_MSG_CHECKING([whether TLS library is available])
AC_MSG_RESULT($ac_cv_have_tls)
if test "$enable_ldap" = yes; then
AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
LDAP_LIBS="$LDAP_LIBS -lldap"
AC_SUBST(LDAP_LIBS)
if test "$ac_cv_have_tls" = yes; then
AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
fi
dnl As of OpenLDAP API version 3000 a number of functions has
dnl been deprecated. As Claws-mail compiles and runs on many
dnl platforms and many versions of OpenLDAP we need to be able
dnl to switch between the old and new API because new API has
dnl added new functions replacing old ones and at the same time
dnl old functions has been changed.
dnl If cross-compiling defaults to enable deprecated features
dnl for maximum portability
AC_MSG_CHECKING([The API version of OpenLDAP])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[#include <ldap.h>],
[if (LDAP_API_VERSION >= 3000)
return 1
])],
[AC_MSG_RESULT([version < 3000])
AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
[AC_MSG_RESULT([version >= 3000])
AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
[AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
)
fi
fi
dnl for JPilot support in addressbook
dnl no check for libraries; these are dynamically loaded
AC_MSG_CHECKING([whether to use JPilot])
if test "$enable_jpilot" = yes; then
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
[ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
[ enable_jpilot=no ])
if test "$enable_jpilot" = no; then
AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
[ enable_jpilot=yes
AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
fi
AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
if test x"$enable_jpilot" = xyes; then
AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
else
AC_MSG_NOTICE([JPilot support not available])
fi
AC_SUBST(JPILOT_LIBS)
else
AC_MSG_RESULT(no)
fi
fi
AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
dnl #######################################################################
dnl # Check for NetworkManager support
dnl #######################################################################
if test x"$enable_dbus" = xyes; then
if test x"$enable_networkmanager" = xyes; then
PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
[
AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
echo "Building with NetworkManager support"
enable_networkmanager=yes
],
[
echo "NetworkManager not found."
enable_networkmanager=no
])
AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
fi
else
echo "NetworkManager support deactivated as D-Bus requirements were not met."
enable_networkmanager=no
fi
dnl Libetpan
AC_MSG_CHECKING([whether to use libetpan])
if test x"$enable_libetpan" = xyes; then
AC_MSG_RESULT(yes)
libetpan_config=no
libetpan_result=no
libetpan_versiontype=0
# since 1.9.4, libetpan uses pkg-config
PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
[
LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
libetpan_config=yes
],
[
# before 1.9.4, libetpan uses its own libetpan-config script
AC_PATH_PROG(libetpanconfig, [libetpan-config])
if test "x$libetpanconfig" != "x"; then
LIBETPAN_CFLAGS="`$libetpanconfig --cflags`"
LIBETPAN_LIBS="`$libetpanconfig --libs`"
# support libetpan version like x.x and x.x.x
libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
if test $libetpan_versiontype -eq 1; then
LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
else
LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
fi
libetpan_config=yes
fi
])
if test "x$libetpan_config" = "xyes"; then
libetpan_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LIBETPAN_CFLAGS"
AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
if test "x$libetpan_result" = "xyes"; then
AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
libetpan_save_LIBS=$LIBS
LIBS="$LIBS $LIBETPAN_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libetpan/dbstorage.h>]], [[db_mailstorage_init(NULL, NULL);]])],[libetpan_result=yes],[libetpan_result=no])
LIBS=$libetpan_save_LIBS
AC_MSG_RESULT([$libetpan_result])
fi
CPPFLAGS=$libetpan_save_CPPFLAGS
fi
if test "x$libetpan_result" = "xyes"; then
if test $libetpan_versiontype -eq 1; then
if test "$LIBETPAN_VERSION" -lt "57"; then
AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
AC_MSG_ERROR([libetpan 0.57 not found])
fi
fi
AC_SUBST(LIBETPAN_CFLAGS)
AC_SUBST(LIBETPAN_LIBS)
AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
else
AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
AC_MSG_ERROR([libetpan 0.57 not found])
fi
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
dnl librsvg
AC_MSG_CHECKING([whether to use librsvg])
if test x"$enable_svg" = xyes; then
AC_MSG_RESULT(yes)
PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
[
AC_SUBST(SVG_CFLAGS)
AC_SUBST(SVG_LIBS)
AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
enable_svg=yes
],
[
AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
enable_svg=no
])
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether to use valgrind])
if test x$enable_valgrind = xyes; then
AC_MSG_RESULT(yes)
PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0],
[
AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
enable_valgrind=yes
],
[
AC_MSG_NOTICE([valgrind support deactivated as valgrind >= 2.4.0 was not found])
enable_valgrind=no
])
else
AC_MSG_RESULT(no)
fi