forked from cyrusimap/cyrus-sasl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1540 lines (1322 loc) · 44.9 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 configure.ac for the SASL library
dnl Rob Siemborski
dnl Rob Earhart
dnl $Id: configure.ac,v 1.224 2011/09/22 14:44:15 mel Exp $
dnl
dnl Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in
dnl the documentation and/or other materials provided with the
dnl distribution.
dnl
dnl 3. The name "Carnegie Mellon University" must not be used to
dnl endorse or promote products derived from this software without
dnl prior written permission. For permission or any other legal
dnl details, please contact
dnl Office of Technology Transfer
dnl Carnegie Mellon University
dnl 5000 Forbes Avenue
dnl Pittsburgh, PA 15213-3890
dnl (412) 268-4387, fax: (412) 268-7395
dnl
dnl 4. Redistributions of any form whatsoever must retain the following
dnl acknowledgment:
dnl \"This product includes software developed by Computing Services
dnl at Carnegie Mellon University (http://www.cmu.edu/computing/).\"
dnl
dnl CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
dnl THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dnl AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
dnl FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
dnl AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
dnl OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl
AC_PREREQ([2.69])
dnl
dnl REMINDER: When changing the version number here, please also update
dnl the values in win32/include/config.h and include/sasl.h as well.
dnl
AC_INIT([cyrus-sasl],[2.1.28],[https://github.com/cyrusimap/cyrus-sasl/issues],[cyrus-sasl],[https://www.cyrusimap.org])
AC_CONFIG_MACRO_DIR([m4])
dnl use ./config.cache as the default cache file.
dnl we require a cache file to successfully configure our build.
if test $cache_file = "/dev/null"; then
cache_file="./config.cache"
AC_CACHE_LOAD
fi
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.11 tar-ustar dist-bzip2 foreign -Wno-portability subdir-objects])
DIRS=""
AC_ARG_ENABLE(cmulocal,
[AS_HELP_STRING([--enable-cmulocal],[enable local mods for CMU [[no]]])],
[],
enable_cmulocal=no)
AC_ARG_ENABLE(sample,
[AS_HELP_STRING([--enable-sample],[compile sample code [[yes]]])],
[],
enable_sample=yes)
AC_PROG_CC
AX_PROG_CC_FOR_BUILD
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_USE_SYSTEM_EXTENSIONS
AC_ARG_WITH(threads,
[AS_HELP_STRING([--with-threads={auto|pthread|nt|no}], [With built-in threading support])],
[],
with_threads=auto)
sasl_threads=
if test "$with_threads" = no; then
sasl_threads=no
fi
if test -z "$sasl_threads" && (test "$with_threads" = nt || test "$with_threads" = auto); then
SASL2_NT_THREADS
if test "$sasl2_cv_nt_threads" = yes; then
sasl_threads=nt
elif test "$with_threads" = nt; then
AC_MSG_ERROR(NT threads not found)
fi
fi
if test -z "$sasl_threads" && (test "$with_threads" = pthread || test "$with_threads" = auto); then
AX_PTHREAD
if test "$ax_pthread_ok" = yes; then
sasl_threads=pthread
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
CXX="$PTHREAD_CXX"
elif test "$with_threads" = pthread; then
AC_MSG_ERROR(pthread library not found)
fi
fi
if test -z "$sasl_threads" && test "$with_threads" != "auto"; then
AC_MSG_ERROR(Unrecognised thread implementation $with_threads)
fi
dnl check for -R, etc. switch
CMU_GUESS_RUNPATH_SWITCH
dnl xxx compatibility
AC_ARG_WITH(staticsasl)
if test "$with_staticsasl" = yes; then
enable_shared=yes
enable_static=yes
fi
save_target=$target
if test -z "$target"; then
target="NONE"
fi
# new libtool
AC_DISABLE_STATIC([])
LT_INIT([win32-dll])
gl_LD_VERSION_SCRIPT
target=$save_target
if test "$enable_static" = yes; then
SASL_STATIC_LIB=libsasl2.a
else
SASL_STATIC_LIB=
fi
AC_SUBST(SASL_STATIC_LIB)
SASL_STATIC_LIBS=
AC_ARG_ENABLE(staticdlopen, [ --enable-staticdlopen try dynamic plugins when we are a static libsasl [[no]] ],
enable_staticdlopen=$enableval,
enable_staticdlopen=no)
if test "$enable_staticdlopen" = yes; then
AC_DEFINE(TRY_DLOPEN_WHEN_STATIC,[],[Should we try to dlopen() plugins while statically compiled?])
fi
if test "$ac_cv_c_compiler_gnu" = yes; then
CFLAGS="-Wall -W ${CFLAGS}"
fi
AC_ARG_WITH(purecov,[ --with-purecov link with purecov])
if test "$with_purecov" = yes; then
AC_CHECK_PROGS(PURECOV, purecov)
fi
AC_ARG_WITH(purify,[ --with-purify link with purify])
if test "$with_purify" = yes; then
AC_CHECK_PROGS(PURIFY, purify)
fi
AM_CONDITIONAL(SAMPLE, test "$enable_sample" = yes)
dnl call before we do the LMDB checks
CMU_SOCKETS
dnl we extracted this to config/sasldb.m4
SASL_DB_PATH_CHECK()
SASL_DB_CHECK()
AC_ARG_ENABLE(keep_db_open, [ --enable-keep-db-open keep handle to DB open for improved performance [[no]] ],
keep_db_open=$enableval,
keep_db_open=no)
# Disable if LMDB is not used
if test "$dblib" != lmdb; then
keep_db_open=no
fi
if test "$keep_db_open" = yes; then
AC_DEFINE(KEEP_DB_OPEN,[],[Should we keep handle to DB open in SASLDB plugin?])
fi
AC_MSG_CHECKING(if DB handle is kept open in SASLDB)
AC_MSG_RESULT($keep_db_open)
AC_CHECK_LIB(dl, dlopen, SASL_DL_LIB="-ldl", SASL_DL_LIB="")
AC_SUBST(SASL_DL_LIB)
dnl /dev/random ?
AC_ARG_WITH(devrandom, [ --with-devrandom=PATH set the path to pseudo random number generator [[/dev/urandom]] ],
devrandom=$withval,
devrandom=/dev/urandom)
AC_MSG_CHECKING(PRNG to use)
AC_MSG_RESULT($devrandom)
AC_DEFINE_UNQUOTED(SASL_DEV_RANDOM, "$devrandom", [File to use for source of randomness])
dnl Do we need leading underscores on our symbols?
AC_CHECK_PROGS(NM, nm)
AC_MSG_CHECKING(for underscore before symbols)
AC_CACHE_VAL(sasl_cv_uscore,[
echo "int main(){int i=1; return 0;}
void foo(){int i=6;}" > conftest.c
${CC} -o a.out conftest.c > /dev/null
if (${NM} a.out | grep _foo) > /dev/null; then
sasl_cv_uscore=yes
else
sasl_cv_uscore=no
fi])
AC_MSG_RESULT($sasl_cv_uscore)
rm -f conftest.c a.out
if test $sasl_cv_uscore = yes; then
if test $ac_cv_lib_dl_dlopen = yes ; then
AC_MSG_CHECKING(whether dlsym adds the underscore for us)
cmu_save_LIBS="$LIBS"
LIBS="$LIBS $SASL_DL_LIB"
AC_CACHE_VAL([sasl_cv_dlsym_adds_uscore],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
void foo() { int i=0;}
int main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo");
if(ptr1 && !ptr2) return 0; } return 1; }
]])],[sasl_cv_dlsym_adds_uscore=yes],[sasl_cv_dlsym_adds_uscore=no],[AC_MSG_WARN(cross-compiler, we'll do our best)])])
LIBS="$cmu_save_LIBS"
AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore)
if test "$sasl_cv_dlsym_adds_uscore" = no; then
AC_DEFINE(DLSYM_NEEDS_UNDERSCORE, [], [Do we need a leading _ for dlsym?])
fi
fi
fi
dnl See if we can provide a default logging function...
AC_CHECK_FUNCS(syslog)
AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ],
with_saslauthd=$withval,
with_saslauthd=yes)
if test "$with_saslauthd" != no; then
if test "$with_saslauthd" = yes; then
with_saslauthd="/var/state/saslauthd"
fi
AC_DEFINE(HAVE_SASLAUTHD,[],[Include support for saslauthd?])
AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd",
[Where do we look for saslauthd's socket?])
fi
AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no)
AC_MSG_CHECKING(if I should include saslauthd)
AC_MSG_RESULT($with_saslauthd)
AC_ARG_WITH(authdaemond, [ --with-authdaemond=PATH enable use of authdaemon with default socket=PATH [[yes]] ],
with_authdaemon=$withval,
with_authdaemon=yes)
if test "$with_authdaemon" != no; then
if test "$with_authdaemon" = yes; then
with_authdaemon="/dev/null"
fi
AC_DEFINE(HAVE_AUTHDAEMON,[],[Include support for Courier's authdaemond?])
AC_DEFINE_UNQUOTED(PATH_AUTHDAEMON_SOCKET, "$with_authdaemon",
[Where do we look for Courier authdaemond's socket?])
fi
AC_MSG_CHECKING(to include Courier authdaemond support)
AC_MSG_RESULT($with_authdaemon)
AC_ARG_WITH(pwcheck,
[ --with-pwcheck=DIR enable deprecated pwcheck daemon using statedir DIR ],
with_pwcheck=$withval,
with_pwcheck=no)
if test "$with_pwcheck" != no; then
if test "$with_pwcheck" = yes; then
with_pwcheck=/var/pwcheck
fi
AC_DEFINE(HAVE_PWCHECK,[],[Include Support for pwcheck daemon?])
AC_DEFINE_UNQUOTED(PWCHECKDIR, "$with_pwcheck", [Location of pwcheck socket])
AC_CHECK_FUNC(getspnam,PWCHECKMETH="getspnam",PWCHECKMETH="getpwnam")
AC_SUBST(PWCHECKMETH)
fi
AM_CONDITIONAL(PWCHECK, test "$with_pwcheck" != no)
AC_MSG_CHECKING(if I should include pwcheck)
AC_MSG_RESULT($with_pwcheck)
AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [[unix]] ],
with_ipctype=$withval,
with_ipctype="unix")
IPCTYPE=$with_ipctype
AC_SUBST(IPCTYPE)
LIB_DOOR=
if test "$with_ipctype" = "doors"; then
LIB_DOOR="-ldoor"
AC_DEFINE(USE_DOORS,[],[use the doors IPC API for saslauthd?])
fi
AC_SUBST(LIB_DOOR)
AC_ARG_ENABLE(alwaystrue, [ --enable-alwaystrue enable the alwaystrue password verifier (discouraged)],
enable_alwaystrue=$enableval,
enable_alwaystrue=no)
if test "$enable_alwaystrue" = yes; then
AC_DEFINE(HAVE_ALWAYSTRUE, [], [Enable 'alwaystrue' password verifier?])
fi
AC_MSG_CHECKING(if I should include the alwaystrue verifier)
AC_MSG_RESULT($enable_alwaystrue)
dnl sasl_checkapop support
AC_ARG_ENABLE(checkapop, [ --enable-checkapop enable use of sasl_checkapop [[yes]] ],
checkapop=$enableval,
checkapop=yes)
AC_MSG_CHECKING(if we should enable sasl_checkapop)
if test "$checkapop" != no; then
AC_MSG_RESULT(enabled)
AC_DEFINE(DO_SASL_CHECKAPOP, [], [should we support sasl_checkapop?])
else
AC_MSG_RESULT(disabled)
fi
CMU_HAVE_OPENSSL
AC_MSG_CHECKING(for OpenSSL)
AC_MSG_RESULT($with_openssl)
if test "$with_openssl" = no; then
AC_MSG_ERROR(OpenSSL not found)
fi
dnl SCRAM
AC_ARG_ENABLE(scram, [ --enable-scram enable SCRAM authentication [[yes]] ],
scram=$enableval,
scram=yes)
AC_MSG_CHECKING(SCRAM)
if test "$scram" != no; then
AC_MSG_RESULT(enabled)
SCRAM_LIBS="-lcrypto $LIB_RSAREF"
SASL_MECHS="$SASL_MECHS libscram.la"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/scram.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS scram.o"
AC_DEFINE(STATIC_SCRAM, [], [Link SCRAM Statically])
fi
AC_SUBST(SCRAM_LIBS)
else
AC_MSG_RESULT(disabled)
fi
dnl OTP
AC_ARG_ENABLE(otp, [ --enable-otp enable OTP authentication [[yes]] ],
otp=$enableval,
otp=yes)
AC_MSG_CHECKING(OTP)
if test "$otp" != no; then
AC_MSG_RESULT(enabled)
OTP_LIBS="-lcrypto $LIB_RSAREF"
SASL_MECHS="$SASL_MECHS libotp.la"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/otp.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS otp.o"
AC_DEFINE(STATIC_OTP, [], [Link OTP Statically])
fi
dnl Test for OPIE
AC_ARG_WITH(opie, AS_HELP_STRING([--with-opie=PATH],[use OPIE (One Time Passwords in Everything) from PATH]))
case "$with_opie" in
""|yes)
AC_CHECK_LIB(opie, opiechallenge, [
AC_CHECK_HEADER(opie.h, with_opie="yes",
with_opie="no")],
with_opie="no")
;;
*)
if test -d $with_opie; then
CPPFLAGS="${CPPFLAGS} -I${with_opie}/include"
LDFLAGS="${LDFLAGS} -L${with_opie}/lib"
else
with_opie="no"
fi
;;
esac
AC_MSG_CHECKING(for OPIE)
AC_MSG_RESULT($with_opie)
if test "$with_opie" != no; then
AC_DEFINE(HAVE_OPIE,[],[Use OPIE for server-side OTP?])
OTP_LIBS="$OTP_LIBS -lopie"
fi
AC_SUBST(OTP_LIBS)
else
AC_MSG_RESULT(disabled)
fi
dnl SRP
AC_ARG_ENABLE(srp, [ --enable-srp enable SRP authentication [[no]] ],
srp=$enableval,
srp=no)
AC_MSG_CHECKING(SRP)
if test "$srp" != no; then
AC_MSG_RESULT(enabled)
SRP_LIBS="-lcrypto $LIB_RSAREF"
SASL_MECHS="$SASL_MECHS libsrp.la"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/srp.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS srp.o"
AC_DEFINE(STATIC_SRP, [], [Link SRP Statically])
fi
dnl srp_setpass support
AC_ARG_ENABLE(srp_setpass, [ --enable-srp-setpass enable setting SRP secrets with saslpasswd [[no]]],
srp_setpass=$enableval,
srp_setpass=no)
AC_MSG_CHECKING(if we should enable setting SRP secrets with saslpasswd)
if test "$srp_setpass" != no; then
AC_MSG_RESULT(enabled)
AC_DEFINE(DO_SRP_SETPASS, [], [should we support setpass() for SRP?])
else
AC_MSG_RESULT(disabled)
fi
AC_SUBST(SRP_LIBS)
else
AC_MSG_RESULT(disabled)
fi
dnl Kerberos based Mechanisms
SASL_GSSAPI_CHK
if test "$gssapi" != "no"; then
AC_DEFINE(STATIC_GSSAPIV2,[],[Link GSSAPI Statically])
AC_DEFINE(HAVE_GSSAPI,[],[Include GSSAPI/Kerberos 5 Support])
mutex_default="no"
ccache_default="no"
load_from_default="no"
AC_CHECK_HEADERS(gssapi.h, [have_gss_header=y])
AC_CHECK_HEADERS(gssapi/gssapi_ext.h, [have_gss_ext_header=y])
AC_SEARCH_LIBS(gss_acquire_cred_from, [gssapi_krb5], [have_load_from=t])
AC_SEARCH_LIBS(gss_store_cred_into, [gssapi_krb5], [have_store_into=t])
if test x"${have_gss_ext_header}" != x -a x"${have_load_from}" != x; then
load_from_default="yes"
fi
if test x"${have_gss_ext_header}" != x -a x"${have_store_into}" != x; then
ccache_default="yes"
fi
if test "$gss_impl" = "mit"; then
mutex_default="yes"
elif test "$gss_impl" = "heimdal"; then
AC_DEFINE(KRB5_HEIMDAL,[],[Using Heimdal])
fi
AC_MSG_CHECKING(to use mutexes aroung GSS calls)
AC_ARG_ENABLE(gss_mutexes, [ --enable-gss_mutexes use mutexes around calls to the GSS library],
use_gss_mutexes=$enableval,
use_gss_mutexes=$mutex_default)
if test $use_gss_mutexes = "yes"; then
AC_DEFINE(GSS_USE_MUTEXES, [], [should we mutex-wrap calls into the GSS library?])
fi
AC_MSG_RESULT($use_gss_mutexes)
AC_MSG_CHECKING(to use GSS delgation with ccache store)
AC_ARG_ENABLE(gss_ccache, [ --enable-gss-ccache allow delegation of cached credentials],
use_gss_ccache=$enableval,
use_gss_ccache=$ccache_default)
if test $use_gss_ccache = "yes"; then
AC_DEFINE(GSS_USE_CCACHE_STORE, [], [should we allow storage of cached credentials?])
fi
AC_MSG_RESULT($use_gss_ccache)
AC_MSG_CHECKING(to use GSS service keytab loading with gss_acquire_cred_from)
AC_ARG_ENABLE(gss_load_from, [ --enable-gss-load-from allow GSSProxy friendly keytab load],
use_gss_load_from=$enableval,
use_gss_load_from=$load_from_default)
if test $use_gss_load_from = "yes"; then
AC_DEFINE(GSS_USE_LOAD_FROM, [], [should we use gss_acquire_cred_from?])
fi
AC_MSG_RESULT($use_gss_load_from)
fi
SASL2_CRYPT_CHK
AC_ARG_ENABLE(sia, [ --enable-sia enable SIA authentication [no] ],
sia=$enableval,
sia=no)
LIB_SIA=""
if test "$sia" != no; then
if test -f /etc/sia/matrix.conf; then
AC_DEFINE(HAVE_SIA,[],[Include SIA Support])
LIB_SIA="-lsecurity -ldb -lm -laud"
else
AC_MSG_ERROR([No support for SIA found])
fi
fi
AC_SUBST(LIB_SIA)
AC_ARG_ENABLE(auth-sasldb, [ --enable-auth-sasldb enable experimental SASLdb authentication module [no] ],
authsasldb=$enableval,
authsasldb=no)
if test "$authsasldb" != no; then
AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support])
SASL_DB_PATH_CHECK()
SASL_DB_CHECK()
fi
AM_CONDITIONAL(AUTH_SASLDB, test "$authsasldb" != no)
AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ],
httpform=$enableval,
httpform=no)
if test "$httpform" != no; then
AC_DEFINE(HAVE_HTTPFORM,[],[Include HTTP form Support])
fi
AC_ARG_WITH(pam, AS_HELP_STRING([--with-pam=DIR],[use PAM (rooted in DIR) [yes]]),,
with_pam=yes)
if test "$with_pam" != no; then
if test -d $with_pam; then
CPPFLAGS="$CPPFLAGS -I${with_pam}/include"
LDFLAGS="$LDFLAGS -L${with_pam}/lib"
fi
cmu_save_LIBS="$LIBS"
AC_CHECK_LIB(pam, pam_start, [
AC_CHECK_HEADER(security/pam_appl.h,,
with_pam=no)],
with_pam=no, $SASL_DL_LIB)
LIBS="$cmu_save_LIBS"
fi
AC_MSG_CHECKING(for PAM support)
AC_MSG_RESULT($with_pam)
LIB_PAM=""
if test "$with_pam" != no; then
AC_DEFINE(HAVE_PAM,[],[Support for PAM?])
LIB_PAM="-lpam"
fi
AC_SUBST(LIB_PAM)
dnl PLAIN
SASL_PLAIN_CHK
dnl ANONYMOUS
AC_ARG_ENABLE(anon, [ --enable-anon enable ANONYMOUS authentication [[yes]] ],
anon=$enableval,
anon=yes)
AC_MSG_CHECKING(ANONYMOUS)
if test "$anon" != no; then
AC_MSG_RESULT(enabled)
SASL_MECHS="$SASL_MECHS libanonymous.la"
if test "$enable_static" = yes; then
SASL_STATIC_OBJS="$SASL_STATIC_OBJS anonymous.o"
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/anonymous.c"
AC_DEFINE(STATIC_ANONYMOUS, [], [Link ANONYMOUS Statically])
fi
else
AC_MSG_RESULT(disabled)
fi
dnl PASSDSS
AC_ARG_ENABLE(passdss, [ --enable-passdss enable PASSDSS authentication (experimental) [[no]] ],
passdss=$enableval,
passdss=no)
AC_MSG_CHECKING(PASSDSS)
if test "$passdss" != no; then
AC_MSG_RESULT(enabled)
PASSDSS_LIBS="-lcrypto $LIB_RSAREF"
AC_SUBST(PASSDSS_LIBS)
SASL_MECHS="$SASL_MECHS libpassdss.la"
if test "$enable_static" = yes; then
SASL_STATIC_OBJS="$SASL_STATIC_OBJS passdss.o"
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/passdss.c"
AC_DEFINE(STATIC_PASSDSS,[],[Link PASSDSS Statically])
fi
else
AC_MSG_RESULT(disabled)
fi
dnl OPAQUE
AC_CHECK_LIB(libopaque, opaque_CreateCredentialRequest, [AC_SUBST([LIB_OPAQUE], ["-lopaque"]) AC_DEFINE([HAVE_LIBOPAQUE], [1],[opaque library])],have_libopaque="no",-lopaque)
AC_ARG_ENABLE(opaque, [ --enable-opaque enable OPAQUE authentication [[yes]] ],
opaque=$enableval,
opaque=yes)
if test "$have_libopaque" = no; then
AC_CHECK_LIB(sodium, crypto_core_ristretto255_scalar_invert, [AC_SUBST([LIB_SODIUM], ["-lsodium"]) AC_DEFINE([HAVE_LIBSODIUM], [1],[sodium library])],have_sodium="no",-lsodium)
AC_CHECK_LIB(sodium, crypto_kdf_hkdf_sha512_expand,need_internal_hkdf="no",need_internal_hkdf="yes",-lsodium)
if test "$have_sodium" = no; then
AC_MSG_WARN(neither libopaque nor libsodium found -- OPAQUE will be disabled)
opaque=no
else
opaque=internal
fi
else
opaque=yes
fi
AM_CONDITIONAL(OPAQUE_INTERNAL,test "$opaque" = internal)
AM_CONDITIONAL(INTERNAL_HKDF,test "$need_internal_hkdf" = yes)
AC_MSG_CHECKING(OPAQUE)
if test "$opaque" != no; then
if test "$opaque" = internal; then
AC_MSG_RESULT(internal)
OPAQUE_LIBS="-lsodium"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/opaque.c \$(top_srcdir)/plugins/opaque_impl.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS opaque.o opaque_impl.o kdf_hkdf_sha512."
AC_DEFINE(STATIC_OPAQUE, [], [Link OPAQUE Statically])
fi
else
AC_MSG_RESULT(enabled)
OPAQUE_LIBS="-lopaque"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/opaque.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS opaque.o kdf_hkdf_sha512.o"
AC_DEFINE(STATIC_OPAQUE, [], [Link OPAQUE Statically])
fi
fi
SASL_MECHS="$SASL_MECHS libopaque.la"
AC_SUBST(OPAQUE_LIBS)
else
AC_MSG_RESULT(disabled)
fi
AC_MSG_CHECKING(to include LDAP support)
AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) for saslauthd [no] ],
with_ldap=$withval,
with_ldap=no)
AC_MSG_RESULT($with_ldap)
if test -d $with_ldap; then
CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
CMU_ADD_LIBPATH(${with_ldap}/lib)
fi
LDAP_LIBS=""
if test "$with_ldap" != no; then
AC_CHECK_LIB(ldap, ldap_initialize, [ AC_DEFINE(HAVE_LDAP,[],[Support for LDAP?])
LDAP_LIBS="-lldap -llber -lcrypto $LIB_RSAREF"
],,-llber)
fi
AC_SUBST(LDAP_LIBS)
dnl SQL
dnl This flag also changes the requirements of --with-mysql and --with-pgsql
dnl
dnl Desired behavior:
dnl
dnl doesn't require mysql or postgres if --disable-sql is chosen
dnl requires at least one (but not both) if --enable-sql is chosen
AC_ARG_ENABLE(sql, [ --enable-sql enable SQL auxprop [[no]] ],
sql=$enableval,
sql=no)
AC_MSG_CHECKING(SQL)
if test "$sql" != no; then
AC_MSG_RESULT(enabled)
SASL_MECHS="$SASL_MECHS libsql.la"
if test "$enable_static" = yes; then
SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/sql.c"
SASL_STATIC_OBJS="$SASL_STATIC_OBJS sql.o"
AC_DEFINE(STATIC_SQL,[],[Link SQL plugin statically])
fi
else
AC_MSG_RESULT(disabled)
fi
dnl MySQL
AC_ARG_WITH(mysql, [ --with-mysql=PATH use MySQL from PATH ],
with_mysql=$withval,
with_mysql=$sql)
# find location of library
# presuming if one given then correct
if test "${with_mysql}" = "yes"; then
with_mysql=notfound
for mysqlloc in lib/mysql lib mysql/lib
do
if test -f ${prefix}/${mysqlloc}/libmysqlclient.a; then
with_mysql="${prefix}"
break
elif test -f /usr/local/${mysqlloc}/libmysqlclient.a; then
with_mysql="/usr/local"
break
elif test -f /usr/${mysqlloc}/libmysqlclient.a; then
with_mysql="/usr"
break
fi
done
fi
LIB_MYSQL=""
case "$with_mysql" in
no) true;;
notfound)
save_LDFLAGS=$LDFLAGS
LIB_MYSQL=`mysql_config --libs`
LIB_MYSQL="-lmysqlclient"
LDFLAGS="$LDFLAGS $LIB_MYSQL"
# CPPFLAGS="${CPPFLAGS} `mysql_config --include`"
AC_CHECK_LIB(mysqlclient, mysql_select_db,
AC_DEFINE(HAVE_MYSQL, [], [Do we have mysql support?]),
[AC_MSG_WARN(MySQL library mysqlclient does not work)
with_mysql=no])
LDFLAGS=$save_LDFLAGS
;;
*)
if test -d ${with_mysql}/lib/mysql; then
CMU_ADD_LIBPATH_TO(${with_mysql}/lib/mysql, LIB_MYSQL)
elif test -d ${with_mysql}/mysql/lib; then
CMU_ADD_LIBPATH_TO(${with_mysql}/mysql/lib, LIB_MYSQL)
elif test -d ${with_mysql}/lib; then
CMU_ADD_LIBPATH_TO(${with_mysql}/lib, LIB_MYSQL)
else
CMU_ADD_LIBPATH_TO(${with_mysql}, LIB_MYSQL)
fi
LIB_MYSQL_DIR=$LIB_MYSQL
LIB_MYSQL="$LIB_MYSQL -lmysqlclient"
if test -d ${with_mysql}/include/mysql; then
CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include/mysql"
elif test -d ${with_mysql}/mysql/include; then
CPPFLAGS="${CPPFLAGS} -I${with_mysql}/mysql/include"
elif test -d ${with_mysql}/include; then
CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include"
elif test -d ${prefix}/include/mysql; then
CPPFLAGS="${CPPFLAGS} -I${prefix}/include/mysql"
else
CPPFLAGS="${CPPFLAGS} -I${with_mysql}"
fi
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $LIB_MYSQL_DIR"
AC_CHECK_LIB(mysqlclient, mysql_select_db,
AC_DEFINE(HAVE_MYSQL, [], [Do we have mysql support?]),
[AC_MSG_WARN(MySQL library mysqlclient does not work)
with_mysql=no])
LDFLAGS=$save_LDFLAGS;;
esac
AC_SUBST(LIB_MYSQL)
dnl PgSQL
AC_ARG_WITH(pgsql, [ --with-pgsql=PATH use PostgreSQL from PATH ],
with_pgsql=$withval,
with_pgsql=$sql)
# find location of library
# presuing if one given then correct
if test "${with_pgsql}" = "yes"; then
with_pgsql=notfound
for pgsqlloc in lib/pgsql lib pgsql/lib
do
if test -f ${prefix}/${pgsqlloc}/libpq.a; then
with_pgsql="${prefix}"
break
elif test -f /usr/local/${pgsqlloc}/libpq.a; then
with_pgsql="/usr/local"
break
elif test -f /usr/${pgsqlloc}/libpq.a; then
with_pgsql="/usr"
break
fi
done
fi
LIB_PGSQL=""
case "$with_pgsql" in
no) true;;
notfound)
LIB_PGSQL="-lpq"
# CPPFLAGS="${CPPFLAGS} -I`pg_config --includedir`"
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $LIB_PGSQL"
AC_CHECK_LIB(pq, PQsetdbLogin, AC_DEFINE(HAVE_PGSQL,[],
[Do we have Postgres support?]),
[AC_MSG_WARN(PostgreSQL Library pq does not work)
with_pgsql=no])
LDFLAGS=$save_LDFLAGS
;;
*)
if test -d ${with_pgsql}/lib/pgsql; then
CMU_ADD_LIBPATH_TO(${with_pgsql}/lib/pgsql, LIB_PGSQL)
elif test -d ${with_pgsql}/pgsql/lib; then
CMU_ADD_LIBPATH_TO(${with_pgsql}/pgsql/lib, LIB_PGSQL)
elif test -d ${with_pgsql}/lib; then
CMU_ADD_LIBPATH_TO(${with_pgsql}/lib, LIB_PGSQL)
else
CMU_ADD_LIBPATH_TO(${with_pgsql}, LIB_PGSQL)
fi
LIB_PGSQL_DIR=$LIB_PGSQL
LIB_PGSQL="$LIB_PGSQL -lpq"
if test -d ${with_pgsql}/include/pgsql; then
CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/include/pgsql"
elif test -d ${with_pgsql}/pgsql/include; then
CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/pgsql/include"
elif test -d ${with_pgsql}/include; then
CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/include"
elif test -d ${prefix}/include; then
CPPFLAGS="${CPPFLAGS} -I${prefix}/include"
else
CPPFLAGS="${CPPFLAGS} -I${with_pgsql}"
fi
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $LIB_PGSQL_DIR"
AC_CHECK_LIB(pq, PQsetdbLogin, AC_DEFINE(HAVE_PGSQL,[],
[Do we have Postgres support?]),
[AC_MSG_WARN(PostgreSQL Library pq does not work)
with_pgsql=no])
LDFLAGS=$save_LDFLAGS;;
esac
AC_SUBST(LIB_PGSQL)
dnl SQLite
AC_ARG_WITH(sqlite, [ --with-sqlite=PATH use SQLite from PATH ],
with_sqlite=$withval,
with_sqlite=$sql)
# find location of library
# presuing if one given then correct
if test "${with_sqlite}" = "yes"; then
with_sqlite=notfound
for sqliteloc in lib
do
if test -f ${prefix}/${sqliteloc}/libsqlite.a; then
with_sqlite="${prefix}"
break
elif test -f /usr/local/${sqliteloc}/libsqlite.a; then
with_sqlite="/usr/local"
break
elif test -f /usr/${sqliteloc}/libsqlite.a; then
with_sqlite="/usr"
break
fi
done
fi
LIB_SQLITE=""
case "$with_sqlite" in
no) true;;
notfound) AC_MSG_WARN(SQLite Library not found); true;;
*)
if test -d ${with_sqlite}/lib; then
CMU_ADD_LIBPATH_TO(${with_sqlite}/lib, LIB_SQLITE)
else
CMU_ADD_LIBPATH_TO(${with_sqlite}, LIB_SQLITE)
fi
LIB_SQLITE_DIR=$LIB_SQLITE
LIB_SQLITE="$LIB_SQLITE -lsqlite"
if test -d ${with_sqlite}/include; then
CPPFLAGS="${CPPFLAGS} -I${with_sqlite}/include"
else
CPPFLAGS="${CPPFLAGS} -I${with_sqlite}"
fi
AC_CHECK_LIB(sqlite, sqlite_open, AC_DEFINE(HAVE_SQLITE,[],
[Do we have SQLite support?]),
[AC_MSG_WARN(SQLite Library sqlite does not work)
with_sqlite=no], $LIB_SQLITE_DIR);;
esac
AC_SUBST(LIB_SQLITE)
dnl SQLite3
AC_ARG_WITH(sqlite3, [ --with-sqlite3=PATH use SQLite3 from PATH ],
with_sqlite3=$withval,
with_sqlite3=$sql)
# find location of library
# we assume that if one given then it is correct
if test "${with_sqlite3}" = "yes"; then
with_sqlite3=notfound
for sqlite3loc in lib
do
if test -f ${prefix}/${sqlite3loc}/libsqlite3.a; then
with_sqlite3="${prefix}"
break
elif test -f /usr/local/${sqlite3loc}/libsqlite3.a; then
with_sqlite3="/usr/local"
break
elif test -f /usr/${sqlite3loc}/libsqlite3.a; then
with_sqlite3="/usr"
break
fi
done
fi
LIB_SQLITE3=""
case "$with_sqlite3" in
no) true;;
notfound) AC_MSG_WARN(SQLite3 Library not found); true;;
*)
if test -d ${with_sqlite3}/lib; then
CMU_ADD_LIBPATH_TO(${with_sqlite3}/lib, LIB_SQLITE3)
else
CMU_ADD_LIBPATH_TO(${with_sqlite3}, LIB_SQLITE3)
fi
LIB_SQLITE3_DIR=$LIB_SQLITE3
LIB_SQLITE3="$LIB_SQLITE3 -lsqlite3"
if test -d ${with_sqlite3}/include; then
CPPFLAGS="${CPPFLAGS} -I${with_sqlite3}/include"
else
CPPFLAGS="${CPPFLAGS} -I${with_sqlite3}"
fi
AC_CHECK_LIB(sqlite3, sqlite3_open, AC_DEFINE(HAVE_SQLITE3,[],
[Do we have SQLite3 support?]),
[AC_MSG_WARN(SQLite3 Library sqlite3 does not work)
with_sqlite3=no], $LIB_SQLITE3_DIR);;
esac
AC_SUBST(LIB_SQLITE3)
if test "$sql" = yes -a "$with_pgsql" = no -a "$with_mysql" = no -a "$with_sqlite" = no -a "$with_sqlite3" = no; then
AC_MSG_ERROR([--enable-sql chosen but neither Postgres nor MySQL nor SQLite nor SQLite3 found])
fi
if test "$enable_shared" = yes; then
AC_DEFINE(DO_DLOPEN,[],[Should we build a shared plugin (via dlopen) library?])
fi
dnl LDAPDB
AC_ARG_ENABLE(ldapdb, [ --enable-ldapdb enable LDAPDB plugin [no] ],
ldapdb=$enableval,
ldapdb=no)
AC_MSG_CHECKING(LDAPDB)
if test "$ldapdb" != no; then
AC_MSG_RESULT(enabled)
if test "$with_ldap" = no; then
AC_MSG_ERROR([Cannot enable LDAPDB plugin: You need to specify --with-ldap])
fi
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
if test -d $with_ldap; then
CPPFLAGS="${CPPFLAGS} -I${with_ldap}/include"
CMU_ADD_LIBPATH(${with_ldap}/lib)
fi
AC_CHECK_HEADERS(ldap.h lber.h)
if test $ac_cv_header_ldap_h = yes -a $ac_cv_header_lber_h = yes; then
CMU_OPENLDAP_API
if test "$cmu_cv_openldap_api" = yes; then
AC_CHECK_LIB(ldap, ldap_initialize, [ cmu_link_openldap="-lldap -llber" ], [ cmu_link_openldap=no ],-llber)
fi
fi
if test "$cmu_cv_openldap_api" = no -o "$cmu_link_openldap" = no; then
AC_MSG_ERROR([Cannot enable LDAPDB plugin: Could not locate OpenLDAP])
else
CMU_OPENLDAP_COMPAT