This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
3099 lines (2843 loc) · 104 KB
/
configure.in
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 -*- sh -*-
dnl Process this file with autoconf to produce a configure script.
#
# This autoconfigure input was modelled after GNU fileutils configure.in,
# and modified by hand by <matti.aarnio@nic.funet.fi> for the ZMailer
#
#
# Things to do:
# AC_DEFINE(NO_SECURITY_PAM) # Done with: --disable-pam
# AC_DEFINE(NO_SHADOW) # ???
# AC_DEFINE(CHECK_MB_SIZE) # mailbox.c feature using external function
#
#
# This autoconfigure input was taken from GNU fileutils configure.in,
# and modified by hand by <matti.aarnio@nic.funet.fi> for the ZMailer
#
# Parts are also from scotty-2.0.2 configuration
# Parts from other sources long forgotten, and many
# new things invented by myself...
#
# ZMailer is almost as a versatile systems feature tester as
# the best (or worst) other beats, like SSH ... About the
# only things that ZMailer does not need are PTY allocation
# mechanisms ...
#
AC_PREREQ(2.53)
AC_COPYRIGHT([ZMailer autoconfiguration setup
copyright 1996-2003 by Matti Aarnio <mea@nic.funet.fi>])
AC_REVISION($Revision$)
# In version numbers, USE NO HYPHENS!
AC_INIT(ZMailer, [2.99.57], [zmhack@nic.funet.fi])
AC_PREFIX_DEFAULT([/opt/zmailer])
AC_PROG_CPP
AC_ISC_POSIX
AC_AIX
AC_MINIX
#----------------------------------------------------------------------------
# Check if we should use gcc if available on this machine.
#----------------------------------------------------------------------------
use_gcc=0
AC_ARG_WITH(gcc, [ --with-gcc use gcc for compilation],
use_gcc=1)
if test "$use_gcc" = 0 ; then
CC=${CC-cc}
else
AC_PROG_CC
if test "$CC" = "gcc" ; then
CC="gcc -Wall"
fi
fi
AC_LANG(C)
AC_SUBST(MKDIR)
MKDIR="mkdir -p"
# AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
# things get pretty tought, if the dup2() is not available ...
AC_CHECK_FUNC(dup2,
AC_DEFINE(HAVE_DUP2,1,[Checking that our compiler works; the dup2() exists at all UNIXes..]),
AC_MSG_ERROR([Bizzare -- the system does not have dup2()! Is your C-compiler working ? (See config.log)])
)
if test "x$prefix" = "xNONE" ; then
AC_MSG_RESULT([!!!])
AC_MSG_RESULT([!!! You did not define --prefix=DIR -parameter !!!])
AC_MSG_RESULT([!!!])
AC_MSG_RESULT([!!! Define the --prefix=DIR -parameter to tell the subtree,])
AC_MSG_RESULT([!!! where the ZMailer system is to be installed.])
AC_MSG_RESULT([!!!])
exit 1
fi
defROUTEROPTIONS='-dWkn 4'
defSMTPOPTIONS='-sve -l ${LOGDIR}/smtpserver'
defSCHEDULEROPTIONS='-S -H'
defNNTPSERVER='nntp'
ac_default_zmconfig="${ZCONFIG-$prefix/zmailer.conf}"
AC_MSG_RESULT([***])
AC_MSG_RESULT([*** You can set ZCONFIG environment variable to define])
AC_MSG_RESULT([*** the location of the (default) $prefix/zmailer.conf -file])
AC_MSG_RESULT([*** (You can use also --with-zconfig= -parameter)])
AC_MSG_RESULT([***])
AC_MSG_RESULT([*** Consider also setting following parameters:])
AC_MSG_RESULT([*** --mandir=DIR -- for man-pages])
AC_MSG_RESULT([*** --libdir=DIR -- for libzmailer(3)])
AC_MSG_RESULT([*** --includedir=DIR -- for libzmailer(3)])
AC_MSG_RESULT([*** (They can be outside the --prefix=DIR -tree)])
AC_MSG_RESULT([***])
AC_MSG_RESULT([*** You can also set CC, CFLAGS, and CPPFLAGS environment variables])
AC_MSG_RESULT([*** to choose the C-compiler, and its options, especially at systems])
AC_MSG_RESULT([*** where there are multiple choices to use ...])
AC_MSG_RESULT([*** (Also doing CPPFLAGS="-I/local/include" may be something you need])
AC_MSG_RESULT([*** to find oddly located headers of some utility libraries.)])
AC_MSG_RESULT([***])
sleep 3 # delay a bit, then continue..
AC_SUBST(PROGS)dnl
AC_PATH_PROG(LN, ln, ln)dnl
AC_PATH_PROG(MV, mv, mv)dnl
AC_PATH_PROG(RM, rm, rm)dnl
AC_PATH_PROG(TRUE, true, true)dnl
AC_PATH_PROG(PERL, perl, perl)dnl
AC_PATH_PROG(GZIP, gzip, gzip)dnl
AC_PATH_PROG(PKGCONFIG, pkg-config)dnl
AC_SUBST(LIBPROGS)dnl
AC_SUBST(CPPDEP)
CPPDEP=${CPPDEP-"gcc -MM"}
AC_MSG_RESULT([** Using C compiler: $CC])
AC_MSG_RESULT([** Using CFLAGS: $CFLAGS])
AC_MSG_RESULT([** Using CPPDEP: $CPPDEP])
dnl AC_DEFINE_UNQUOTED(CONFIGURE_CMD,"$0 $ac_configure_args")
AC_DEFINE_UNQUOTED(CONFIGURE_CMD,
"CC='$CC' CFLAGS='$CFLAGS' $0 $ac_configure_args",
[Configuration command line])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.11.5)
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar, ar)dnl
AC_PATH_PROG(LD, ld, ld)dnl
AC_PROG_YACC
AC_PROG_LN_S
AC_HEADER_MAJOR
AC_C_BIGENDIAN
AC_C_INLINE
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(double)
OrigCPPFLAGS="$CPPFLAGS"
AC_SUBST(PERLINSTALLDIRS)
AC_SUBST(PERLDESTINSTALLDIRS)
PERLINSTALLDIRS=""
PERLDESTINSTALLDIRS=""
use_perlinstalldirs=0
AC_ARG_WITH(perl-installdirs, [ --with-perl-installdirs=\"/prefix/path\"
Perl module installation thingie.],
use_perlinstalldirs=1)
if test "$use_perlinstalldirs" = 1; then
PERLINSTALLDIRS="PREFIX=$with_perl_installdirs"
PERLDESTINSTALLDIRS="PREFIX=\$(DESTDIR)$with_perl_installdirs"
fi
# AC_SUBST(PERLINSTALLPREFIX)
# PERLINSTALLPREFIX="/usr" # When nothing else is known...
# if test -x "$PERL" ; then
#
# fi
AC_SUBST(PERLEMBEDCCOPTS)
AC_SUBST(PERLEMBEDLDOPTS)
AC_ARG_WITH(embed-perl, [ --with-embed-perl Do embed perl into system],
embed_perl=1)
if test "$embed_perl" = 1 ; then
PERLEMBEDCCOPTS="`$ac_cv_path_PERL -MExtUtils::Embed -e ccopts`"
PERLEMBEDLDOPTS="`$ac_cv_path_PERL -MExtUtils::Embed -e ldopts`"
AC_DEFINE(DO_PERL_EMBED,1,[We do embed perl into system])
AC_MSG_RESULT([Embedding perl, with:])
AC_MSG_RESULT([ CCOPTS=$PERLEMBEDCCOPTS])
AC_MSG_RESULT([ LDOPTS=$PERLEMBEDLDOPTS])
fi
AC_SUBST(GENINCL)
use_genincl=0
AC_ARG_WITH(generic-include, [ --with-generic-include=\"-I/...\"
Include option for local overriders],
use_genincl=1)
if test "$use_genincl" = 1; then
GENINCL="$withval"
CPPFLAGS="$CPPFLAGS $withval"
fi
AC_SUBST(GENLIB)
AC_ARG_WITH(generic-library, [ --with-generic-library=\"-L/...\"
Library directory option for local overriders],
use_genlib=1, use_genlib=0)
if test "$use_genlib" = 1; then
GENLIB="$withval"
LIBS="$LIBS $GENLIB"
fi
AC_SUBST(ZMAILERCFGFILE)
use_zcfg=0
AC_ARG_WITH(zconfig,
[ --with-zconfig=PATH define the path and name of the zmailer.conf -file
Set ZCONFIG environment, and then use --with-zconfig=no
to disable usage of existing zmailer.conf -file to
load existing defaults. ],
use_zcfg=1)
load_zcfg=1
AC_ARG_WITH(zconfig-noload,
[ --with-zconfig-noload Don't pre-load old values from possibly existing
ZCONFIG file.],
load_zcfg=0)
if test "$use_zcfg" = "0" ; then
ZMAILERCFGFILE="${ZMAILERCFGFILE-$ac_default_zmconfig}"
use_zcfg=1
else
if test "$withval" != "no" ; then
use_zcfg=1
ZMAILERCFGFILE="$withval"
else
use_zcfg=0
ZMAILERCFGFILE="${ZMAILERCFGFILE-$ac_default_zmconfig}"
fi
fi
AC_MSG_RESULT([Using ZMailer parametrization file path: $ZMAILERCFGFILE])
if test -r $ZMAILERCFGFILE -a "$load_zcfg" != "0" ; then
# Source the previous configuration values for various environment parameters
. $ZMAILERCFGFILE
AC_MSG_RESULT([ The file exists, we use its values as defaults])
fi
AC_SUBST(MAILBOX)
use_mailbox=0
AC_ARG_WITH(mailbox, [ --with-mailbox=DIR define the path of the mailbox directory],
use_mailbox=1)
if test "$use_mailbox" = 0 ; then
# No explicite value given, make some guesses as to where it might be..
for DEFMAILBOX in /var/mail /var/spool/mail /usr/mail /usr/spool/mail x
do
if test -d $DEFMAILBOX ; then
break
fi
done
if test "DEFMAILBOX" = x ; then
DEFMAILBOX=/var/spool/mail
if test -r /usr/include/paths.h ; then
tt=`egrep _PATH_MAILDIR /usr/include/paths.h | cut -d'"' -f2`
if test "$tt" != "" -a -d $tt ; then
DEFMAILBOX=$tt
fi
fi
fi
MAILBOX="${MAILBOX-$DEFMAILBOX}"
else
MAILBOX="$withval"
fi
AC_MSG_RESULT([Using ZMailer MAILBOX directory path: $MAILBOX])
AC_SUBST(POSTOFFICE)
use_postoffice=0
AC_ARG_WITH(postoffice, [ --with-postoffice=DIR define the path of the postoffice directory],
use_postoffice=1)
if test "$use_postoffice" = 0 ; then
# No explicite value given, make some guesses as to where it might be..
# XX: Should see what the MAILBOX value is, and then default between
# XX: the /usr, and the /var -trees.
for DEFPOSTOFFICE in /usr/spool/postoffice /var/spool/postoffice
do
if test -d $DEFPOSTOFFICE ; then
break
fi
done
POSTOFFICE="${POSTOFFICE-$DEFPOSTOFFICE}"
else
POSTOFFICE="$withval"
fi
AC_MSG_RESULT([Using ZMailer POSTOFFICE path: $POSTOFFICE])
AC_SUBST(MAILSHARE)
use_mailshare=0
AC_ARG_WITH(mailshare, [ --with-mailshare=DIR define the path of the mailshare directory],
use_mailshare=1)
if test "$use_mailshare" = 0 ; then
eval MAILSHARE="${MAILSHARE-$prefix}"
else
MAILSHARE="$withval"
fi
AC_MSG_RESULT([Using ZMailer MAILSHARE directory path: $MAILSHARE])
AC_SUBST(MAILVAR)
use_mailvar=0
AC_ARG_WITH(mailvar, [ --with-mailvar=DIR define the path of the mailvar directory],
use_mailvar=1)
if test "$use_mailvar" = 0 ; then
eval MAILVAR="${MAILVAR-$prefix}"
else
MAILVAR="$withval"
fi
AC_MSG_RESULT([Using ZMailer MAILVAR directory path: $MAILVAR])
AC_SUBST(MAILBIN)
use_mailbin=0
AC_ARG_WITH(mailbin, [ --with-mailbin=DIR define the path of the mailbin directory],
use_mailbin=1)
if test "$use_mailbin" = 0 ; then
eval MAILBIN="${MAILBIN-${MAILSHARE}/bin}"
else
MAILBIN="$withval"
fi
AC_MSG_RESULT([Using ZMailer MAILBIN directory path: $MAILBIN])
AC_SUBST(LOGDIR)
use_logdir=0
AC_ARG_WITH(logdir, [ --with-logdir=DIR define the path of the log directory],
use_logdir=1)
if test "$use_logdir" = 0; then
LOGDIR=${LOGDIR-/var/log/mail}
else
LOGDIR="$withval"
fi
AC_MSG_RESULT([Using ZMailer LOGDIR directory path: $LOGDIR])
AC_SUBST(ROUTEUSER_IN_ABNORMAL_UNIX)
use_routeuser=0
AC_ARG_WITH(routeuser-is-abnormal, [ --with-routeuser-is-abnormal={yes,no} define if your system doesn't get
homedirs for users from getpwnam() call in router.
Giving here 'no' will produce errors at routing for
nonexistent users, not waiting until doing delivery
attempt at mailbox.],
use_routeuser=1)
if test "$use_routeuser" = 0; then
# When not defined, ASSUME ABNORMAL UNIX, unless ZCONFIG file
# was read in, and it had some value for this..
ROUTEUSER_IN_ABNORMAL="${ROUTEUSER_IN_ABNORMAL-abnormal}"
elif test "$withval" = no; then
# "no" given, it is NORMAL UNIX, and the router shall produce
# error messages!
ROUTEUSER_IN_ABNORMAL_UNIX=
else
ROUTEUSER_IN_ABNORMAL_UNIX=abnormal
fi
# There might be old (non-substituted) value lurking...
if test "$ROUTEUSER_IN_ABNORMAL_UNIX" = "@ROUTEUSER_IN_ABNORMAL_UNIX@"
then
ROUTEUSER_IN_ABNORMAL_UNIX=abnormal
fi
AC_MSG_RESULT([Using ZMailer ROUTEUSER_IN_ABNORMAL_UNIX value: '$ROUTEUSER_IN_ABNORMAL_UNIX'])
AC_SUBST(NNTPSERVER)
use_nntpserver=0
AC_ARG_WITH(nntpserver, [ --with-nntpserver=HOST define the domain name of the nntp server],
use_nntpserver=1)
if test "$use_nntpserver" = 0; then
NNTPSERVER="${NNTPSERVER-$defNNTPSERVER}"
else
NNTPSERVER="$withval"
fi
AC_MSG_RESULT([Using ZMailer NNTPSERVER host name: $NNTPSERVER])
if test "x$INEWSBIN" = "x" ; then
AC_PATH_PROG(INEWS, inews, inews)
else
AC_SUBST(INEWS)
INEWS="$INEWSBIN"
fi
AC_MSG_RESULT([Using ZMailer INEWS program path: $INEWS])
AC_SUBST(SCHEDULEROPTIONS)
SCHEDULEROPTIONS="${SCHEDULEROPTIONS-$defSCHEDULEROPTIONS}"
AC_MSG_RESULT([Using ZMailer SCHEDULEROPTIONS='$SCHEDULEROPTIONS'])
AC_SUBST(ROUTEROPTIONS)
ROUTEROPTIONS="${ROUTEROPTIONS-$defROUTEROPTIONS}"
AC_MSG_RESULT([Using ZMailer ROUTEROPTIONS='$ROUTEROPTIONS'])
AC_SUBST(SMTPOPTIONS)
SMTPOPTIONS="${SMTPOPTIONS-$defSMTPOPTIONS}"
AC_MSG_RESULT([Using ZMailer SMTPOPTIONS='$SMTPOPTIONS'])
AC_SUBST(SENDMAILPATH)
use_sendmailpath=0
AC_ARG_WITH(sendmailpath, [ --with-sendmailpath=PATH The location of the 'sendmail'],
use_sendmailpath=1)
if test "$use_sendmailpath" = 0 ; then
# Ok, no value given, make some guesses; /usr/sbin ??
for SENDMAILDEF in /usr/sbin/sendmail /usr/lib/sendmail x ; do
if test -x $SENDMAILDEF ; then
break
fi
done
if test "$SENDMAILDEF" = x ; then
SENDMAILDEF=/usr/sbin/sendmail
if test -r /usr/include/paths.h ; then
tt=`egrep _PATH_SENDMAIL /usr/include/paths.h | cut -d'"' -f2`
if test "$tt" != "" -a -x $tt ; then
SENDMAILDEF=$tt
fi
fi
fi
SENDMAILPATH="${SENDMAILPATH-$SENDMAILDEF}"
else
if test -d "$withval" ; then
SENDMAILPATH="$withval/sendmail"
else
SENDMAILPATH="$withval"
fi
fi
AC_MSG_RESULT([Using ZMailer SENDMAILPATH: $SENDMAILPATH])
oldRMAILPATH="$RMAILPATH"
AC_SUBST(RMAILPATH)
use_rmailpath=0
AC_ARG_WITH(rmailpath, [ --with-rmailpath=PATH The location of 'rmail'],
use_rmailpath=1)
if test "$use_rmailpath" = 0 ; then
# Ok, no value given, make some guesses; /usr/bin ?? (last is default)
for RMAILDEF in /sbin/rmail /usr/sbin/rmail /usr/bin/rmail /bin/rmail; do
if test -x $RMAILDEF ; then
break
fi
done
if test "x$oldRMAILPATH" = x ; then
RMAILPATH="$RMAILDEF"
else
RMAILPATH="$oldRMAILPATH"
fi
else
RMAILPATH="$withval"
fi
AC_MSG_RESULT([Using ZMailer RMAILPATH: $RMAILPATH])
AC_SUBST(VACATIONPATH)
use_vacationpath=0
AC_ARG_WITH(vacationpath, [ --with-vacationpath=PATH The location of the 'vacation'],
use_vacationpath=1)
if test "$use_vacationpath" = 0 ; then
# Ok, no value given, make some guesses; /usr/sbin ??
for VACATIONDEF in /bin/vacation /usr/ucb/vacation /usr/bin/vacation ; do
if test -x $VACATIONDEF ; then
break
fi
done
VACATIONPATH="${VACATIONPATH-$VACATIONDEF}"
else
if test -d "$withval" ; then
VACATIONPATH="$withval/vacation"
else
VACATIONPATH="$withval"
fi
fi
AC_MSG_RESULT([Using ZMailer VACATIONPATH: $VACATIONPATH])
oldSELFADDRESSES="$SELFADDRESSES"
AC_SUBST(SELFADDRESSES)
AC_ARG_WITH(selfaddresses, [ --with-selfaddresses=NAME,NAME Comma separated list of names],
use_selfaddresses=1)
if test "x$use_selfaddresses" != "x" ; then
SELFADDRESSES="$withval"
else
SELFADDRESSES="$oldSELFADDRESSES"
fi
AC_MSG_RESULT([Using ZMailer SELFADDRESSES: $SELFADDRESSES])
oldBINDADDR="$BINDADDR"
AC_SUBST(BINDADDR)
AC_ARG_WITH(bindaddr, [ --with-bindaddr=SPEC Bind to specific local interface
possible format: [0.0.0.0], [IPv6.0::0], iface:eth0:1],
use_bindaddr=1)
if test "x$use_bindaddr" != "x" ; then
BINDADDR="$withval"
else
BINDADDR="$oldBINDADDR"
fi
AC_MSG_RESULT([Using ZMailer BINDADDR: $BINDADDR])
AC_SUBST(SYSLOGFLG)
AC_ARG_WITH(syslogflg, [ --with-syslogflg=FLGS A set of flag-characters for subsystems
doing (or not doing) their loggings via syslog.],
SYSLOGFLG="$withval")
if test -z "$SYSLOGFLG" ; then
SYSLOGFLG="RT"
fi
AC_MSG_RESULT([Using ZMailer SYSLOGFLG: $SYSLOGFLG])
AC_SUBST(SNMPSHAREDFILE)
AC_ARG_WITH(snmpsharedfile, [ --with-snmpsharedfile=/path/to/file Path of SNMP shared file. (use default!)],
SNMPSHAREDFILE="$withval")
if test -z "$SNMPSHAREDFILE" ; then
SNMPSHAREDFILE="$POSTOFFICE/.zmailer.SNMP.block"
fi
AC_MSG_RESULT([Using ZMailer SNMPSHAREDFILE: $SNMPSHAREDFILE])
AC_SUBST(DOMAIN_AWARE_GETPWNAM)
AC_ARG_WITH(domainawaregetpwnam, [ --with-domainawaregetpwnam=[0|1] Does local getpwnam(3) understand domains ?],
DOMAIN_AWARE_GETPWNAM="$withval")
AC_MSG_RESULT([Using ZMailer DOMAIN_AWARE_GETPWNAM: $DOMAIN_AWARE_GETPWNAM])
sleep 2 # Sleep a bit here too
AC_SUBST(LIBMALLOC)
AC_SUBST(MALLOC)
AC_SUBST(MALLOCEXT)
MALLOCEXT=""
AC_ARG_WITH(system-malloc,[ --with-system-malloc use system malloc instead of our own],
use_system_malloc=1)
AC_ARG_WITH(libmalloc,
[ --with-libmalloc=LIBNAME define the name of the malloc library
possible values: malloc, malloc_d, system (default)],
use_libmalloc=1)
if test "x$use_system_malloc" = x1 ; then
LIBMALLOC=""
MALLOC="system"
else
if test "x$withval" = xmalloc_d -o "x$withval" = xmalloc ; then
LIBMALLOC="-l$withval"
MALLOC="$withval"
if test "$withval" = "malloc_d" ; then
MALLOCEXT="_d"
fi
else
if test "x$withval" = xsystem -o "x$use_libmalloc" != x1; then
LIBMALLOC=""; MALLOCEXT=""
MALLOC="system"
else
eval LIBMALLOC="-l${MALLOC-malloc}"
if test "x$LIBMALLOC" = "x-lmalloc_d"; then
MALLOC="malloc_d"; MALLOCEXT="_d"
else
if test "x$LIBMALLOC" = "x-lmalloc"; then
MALLOC="malloc"
fi
fi
fi
fi
fi
AC_MSG_RESULT([Using ZMailer malloc library of type: $MALLOC])
#
# Following is rather painfull to do fully automatic, thus I choose
# to do it in dumb way -- explicitely, INCLUDING LINKER STUFF !
#
AC_SUBST(HAVE_YP)
AC_ARG_WITH(yp, [ --with-yp Have YP/NIS in system, and want to use it],
AC_DEFINE(HAVE_YP,1,[Have YP/NIS in the system, and want to use it]))
AC_SUBST(LIBNIS)
LIBNIS=""
AC_ARG_WITH(yp-lib, [ --with-yp-lib='-L... -lyp' Linker arguments for the YP/NIS in the router],
LIBNIS="$withval")
#AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
#if test "$ac_cv_header_rpc_rpc.h" = yes \
# -a "$ac_cv_header_rpcsvc_yp_prot_h" = yes \
# -a "$ac_cv_header_rpcsvc_ypclnt_h" = yes ; then
# # Ok, we have the headers, do we have the libs ?
# # Asch.... Lets just presume that headers match with libs
# # (and for Solaris the needed -lnsl comes with connect() )
# AC_DEFINE(HAVE_YP)
#fi
AC_HEADER_SYS_WAIT
AC_FUNC_WAIT3
AC_CHECK_FUNCS(waitpid getrusage wait4)
AC_CHECK_FUNCS(getenv putenv setenv unsetenv setproctitle)
#
# Study shared library generation
#
#AC_SUBST(SHLIB_CFLAGS)
#AC_SUBST(SHLIB_LD)
#AC_SUBST(SHLIB_SUFFIX)
#AC_SUBST(DL_LIBS)
#AC_SUBST(LD_FLAGS)
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_CHECK_TYPES([ino_t, u_int16_t, u_int32_t, uint16_t, uint32_t])
AC_CHECK_TYPES(sighandler_t, , ,
[#define _GNU_SOURCE
#include <signal.h>])
AC_C_CONST
AC_HEADER_STDC
# Timezones are always a pain in... everybody has their own ways :-(
AC_CHECK_HEADERS(sys/time.h termios.h)
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
AC_STRUCT_TM
AC_STRUCT_TM_GMTOFF
# AC_STRUCT_ST_BLOCKS
# AC_STRUCT_ST_BLKSIZE
AC_CHECK_MEMBERS([struct stat.st_atim, struct stat.st_atim.tv_nsec,
struct stat.st_atim.__tv_nsec, struct stat.st_atimensec])
AC_MSG_RESULT([Scanning possible database libraries in preferrence order:])
AC_MSG_RESULT([ NDBM, GDBM, BSD DB 1.x, SleepyCat DB 2.x/3.x/4.x])
AC_MSG_RESULT([ ( Hash, Hash, Hash, BTree, BTree )])
AC_MSG_RESULT([Last one of them found will be system default DB format.])
DEFDBTYPE="$DBTYPE" # From possible entry in zmailer.conf above...
AC_SUBST(DBTYPE) # Default db-type, unless we figure out something.
AC_SUBST(DBEXT) # Default db-extension (pag/db) for FILE OPEN
AC_SUBST(DBEXTtest) # Default db-extension (pag/db) for FILE AGE TESTS
AC_CHECK_HEADERS(ndbm.h gdbm.h db.h db1/db.h db_185.h db3.h \
db2/db.h db2/db_185.h db3/db.h db3/db_185.h db4/db.h \
ldap.h)
dblocation=""
without_ndbm=0
AC_ARG_WITH(ndbm, [ --without-ndbm Disable search for, and use of NDBM, even if it could be found],
if test "$withval" = no ; then
without_ndbm=1
else
without_ndbm=0
fi
)
LIBNDBM=""
t_have_dbm_error=no
if test "$ac_cv_header_ndbm_h" = yes -a $without_ndbm = 0; then
t_found_at="nowhere"
if test "$ac_cv_lib_c_dbm_open" = yes ; then
LIBNDBM="-lc"
t_found_at="libc"
DBTYPE="ndbm"
elif test "$ac_cv_lib_dbm_dbm_open" = yes ; then
LIBNDBM="-ldbm"
t_found_at="dbm library"
DBTYPE="ndbm"
elif test "$ac_cv_lib_ndbm_dbm_open" = yes ; then
LIBNDBM="-lndbm"
t_found_at="ndbm library"
DBTYPE="ndbm"
elif test "$LIBNDBM" = "" ; then
if test "$ac_cv_lib_db1_dbm_open" = yes ; then
LIBNDBM="-ldb1"
t_found_at="db1 library"
DBTYPE="ndbm"
elif test "$ac_cv_lib_db2_dbm_open" = yes ; then
LIBNDBM="-ldb2"
t_found_at="db2 library"
DBTYPE="ndbm"
elif test "$ac_cv_lib_db3_dbm_open" = yes ; then
LIBNDBM="-ldb3"
t_found_at="db3 library"
DBTYPE="ndbm"
elif test "$ac_cv_lib_db_dbm_open" = yes ; then
LIBNDBM="-ldb"
t_found_at="db library"
DBTYPE="ndbm"
fi
fi
t_oldLibs="$LIBS"
if test "$LIBNDBM" = "" ; then
LIBS="$t_oldLibs -lc"
AC_TRY_LINK([], [dbm_open();], ac_cv_lib_c_dbm_open=yes,
ac_cv_lib_c_dbm_open=no)
if test "$ac_cv_lib_c_dbm_open" = yes; then
# Has it in the libc!
LIBNDBM="-lc"
t_found_at="libc"
DBTYPE="ndbm"
fi
fi
if test "$LIBNDBM" = "" ; then
LIBS="$t_oldLibs -lndbm"
AC_TRY_LINK([], [dbm_open();], ac_cv_lib_ndbm_dbm_open=yes,
ac_cv_lib_ndbm_dbm_open=no)
if test "$ac_cv_lib_ndbm_dbm_open" = yes; then
# Has it in the ndbm library!
LIBNDBM="-lndbm"
t_found_at="ndbm"
DBTYPE="ndbm"
fi
fi
if test "$LIBNDBM" = "" ; then
LIBS="$t_oldLibs -ldbm"
AC_TRY_LINK([], [dbm_open();], ac_cv_lib_dbm_dbm_open=yes,
ac_cv_lib_dbm_dbm_open=no)
if test "$ac_cv_lib_dbm_dbm_open" = yes; then
# Has it in the dbm library!
LIBNDBM="-ldbm"
t_found_at="dbm"
DBTYPE="ndbm"
fi
fi
if test "$LIBNDBM" = "" ; then
LIBS="$t_oldLibs -ldb1"
AC_TRY_LINK([], [dbm_open();], ac_cv_lib_db1_dbm_open=yes,
ac_cv_lib_db1_dbm_open=no)
if test "$ac_cv_lib_db1_dbm_open" = yes; then
# Has it in the db1 library!
LIBNDBM="-ldb1"
t_found_at="db1"
DBTYPE="ndbm"
fi
fi
# if test "$LIBNDBM" = "" ; then
# LIBS="$t_oldLibs -ldb2"
# AC_TRY_LINK([], [dbm_open();], ac_cv_lib_db2_dbm_open=yes,
# ac_cv_lib_db2_dbm_open=no)
# if test "$ac_cv_lib_db2_dbm_open" = yes; then
# # Has it in the db2 library!
# LIBNDBM="-ldb2"
# t_found_at="db2"
# DBTYPE="ndbm"
# fi
# fi
if test "$LIBNDBM" = "" ; then
AC_MSG_RESULT([??? Has <ndbm.h>, but dbm_open() is not at libc, libndbm, nor at libdb ???])
fi
LIBS="$t_oldLibs"
if test "$t_found_at" != nowhere ; then
# If we have BSD DB's compability mode in use, it does not have
# dbm_error() function. Check at it!
LIBS="$LIBS $LIBNDBM"
AC_TRY_LINK([#include <ndbm.h>], [DBM *db;int i = dbm_error(db);], t_have_dbm_error=yes)
LIBS="$t_oldLibs"
AC_MSG_RESULT([Located NDBM's dbm_open() routine at $t_found_at])
else
AC_MSG_RESULT([Didn't locate NDBM dbm_open() routine. Maybe something better exists...])
AC_MSG_RESULT([(This is for support of the original NDBM library in old systems, not])
AC_MSG_RESULT([about API compability in e.g. GDBM and SleepyCat.)])
fi
if test "$t_found_at" != nowhere; then
dblocation="$dblocation;$t_found_at"
fi
fi
if test -n "$LIBNDBM" -a $without_ndbm = 0; then
if test -z "$ac_cv_ndbm_dbm_pagfno" ; then
LIBS="$LIBS $LIBNDBM"
AC_TRY_LINK([#include <sys/types.h>
#include <ndbm.h>],
[DBM *tdbm; int fd = dbm_pagfno(tdbm);],
ac_cv_ndbm_dbm_pagfno=yes,
ac_cv_ndbm_dbm_pagfno=no)
LIBS="$t_oldLibs"
fi
if test "$ac_cv_ndbm_dbm_pagfno" = no ; then
AC_MSG_RESULT([<ndbm.h> sighted, but linkage of dbm_pagfno() function fails. ndbm will not be used])
else
AC_DEFINE(HAVE_NDBM,1,[Have old BSD NDBM in the system, and want to use it])
if test "$t_have_dbm_error" = yes; then
AC_DEFINE(HAVE_DBM_ERROR,1,[Function dbm_error() exists in the system])
fi
fi
fi
dnl without_sdbm=0
dnl AC_ARG_WITH(sdbm, [ --without-sdbm Disable search for, and use of SDBM, even if it could be found],
dnl without_sdbm=1)
dnl LIBSDBM=""
dnl # Sometimes it is in libc, sometimes at separate lib...
dnl # Umm...
dnl if test "$ac_cv_header_sdbm_h" = yes -a $without_sdbm = 0 ; then
dnl AC_MSG_RESULT([Note: SDBM support is not really integrated!])
dnl AC_MSG_RESULT([Note2: Usually the <sdbm.h> is installed as <ndbm.h> and the library])
dnl AC_MSG_RESULT([ is installed as libdbm.a, and it is indistinguishable])
dnl AC_MSG_RESULT([ (at source level) from a real NDBM.])
dnl t_found_at="nowhere"
dnl if test "$ac_cv_lib_c_dbm_open" = yes ; then
dnl LIBSDBM=""
dnl t_found_at="libc"
dnl DBTYPE="ndbm"
dnl else
dnl if test "$ac_cv_lib_sdbm_dbm_open" = yes ; then
dnl LIBSDBM="-lsdbm"
dnl t_found_at="sdbm library"
dnl DBTYPE="ndbm"
dnl else
dnl AC_TRY_LINK([], [dbm_open();], ac_cv_lib_c_dbm_open=yes,
dnl ac_cv_lib_c_dbm_open=no)
dnl if test "$ac_cv_lib_c_dbm_open" = no; then
dnl if test "x$ac_cv_lib_sdbm_dbm_open" = x; then # not set
dnl t_oldLibs="$LIBS"
dnl LIBS="$LIBS -lsdbm"
dnl AC_TRY_LINK([], [dbm_open();], ac_cv_lib_sdbm_dbm_open=yes,
dnl ac_cv_lib_sdbm_dbm_open=no)
dnl LIBS="$t_oldLibs"
dnl if test "$ac_cv_lib_sdbm_dbm_open" = yes; then
dnl LIBSDBM="-lsdbm"
dnl t_found_at="sdbm library"
dnl DBTYPE="ndbm"
dnl else
dnl AC_MSG_RESULT([??? Has <sdbm.h>, but dbm_open() is not at libc, nor at libsdbm ???])
dnl fi
dnl else
dnl if test "$ac_cv_lib_sdbm_dbm_open" = yes ; then
dnl AC_MSG_ERROR([config.cache inconsistency! (sdbm) Delete it, and redo!])
dnl fi
dnl fi
dnl else # Has it in the libc!
dnl LIBSDBM=""
dnl t_found_at="libc"
dnl DBTYPE="ndbm"
dnl fi
dnl fi
dnl fi
dnl AC_MSG_RESULT([Located SDBM's dbm_open() routine at $t_found_at])
dnl if test "$t_found_at" != nowhere; then
dnl dblocation="$dblocation;$t_found_at"
dnl AC_DEFINE(HAVE_SDBM,1,[System has dbm_open() in -lsdbm, and want to use it.])
dnl fi
dnl fi
LIBGDBM=""
# Sometimes it is in libc, sometimes at separate lib...
# Umm...
without_gdbm=0
AC_ARG_WITH(gdbm, [ --without-gdbm Disable search for, and use of GDBM, even if it could be found],
if test "$withval" = no ; then
without_gdbm=1
else
without_gdbm=0
fi
)
if test "$ac_cv_header_gdbm_h" = yes -a $without_gdbm = 0 ; then
t_found_at="nowhere"
if test "$ac_cv_lib_c_gdbm_open" = yes ; then
LIBGDBM="-lc"
t_found_at="libc"
else
if test "$ac_cv_lib_gdbm_gdbm_open" = yes ; then
LIBGDBM="-lgdbm"
t_found_at="gdbm library"
DBTYPE="gdbm"
else
AC_TRY_LINK([], [gdbm_open();], ac_cv_lib_c_gdbm_open=yes,
ac_cv_lib_c_gdbm_open=no)
if test "$ac_cv_lib_c_gdbm_open" = no; then
if test "x$ac_cv_lib_gdbm_gdbm_open" = x; then # not set
t_oldLibs="$LIBS"
LIBS="$LIBS -lgdbm"
AC_TRY_LINK([], [gdbm_open();], ac_cv_lib_gdbm_gdbm_open=yes,
ac_cv_lib_gdbm_gdbm_open=no)
LIBS="$t_oldLibs"
if test "$ac_cv_lib_gdbm_gdbm_open" = yes; then
LIBGDBM="-lgdbm"
t_found_at="gdbm library"
DBTYPE="gdbm"
else
AC_MSG_RESULT([??? Has <gdbm.h>, but gdbm_open() is not at libc, nor at libgdbm ???])
fi
else
if test "$ac_cv_lib_gdbm_gdbm_open" = yes ; then
AC_MSG_ERROR([config.cache inconsistency! (gdbm) Delete it, and redo!])
fi
fi
else # Has it in the libc!
LIBGDBM="-lc"
t_found_at="libc"
DBTYPE="gdbm"
fi
fi
fi
AC_MSG_RESULT([Located GNU GDBM's gdbm_open() routine at $t_found_at])
if test -z "$ac_cv_gdbm_fdesc" ; then
t_oldLibs="$LIBS"
LIBS="$LIBS -lgdbm"
AC_TRY_LINK([], [gdbm_fdesc();], ac_cv_gdbm_fdesc=yes, ac_cv_gdbm_fdesc=no)
LIBS="$t_oldLibs"
fi
if test "$ac_cv_gdbm_fdesc" = yes ; then
AC_DEFINE(HAVE_GDBM_FDESC,1,[New thing in GDBM 1.8.0: gdbm_fdesk()])
AC_MSG_RESULT([The GDBM has gdbm_fdesc() function!])
fi
if test "$t_found_at" != nowhere; then
dblocation="$dblocation;$t_found_at"
AC_DEFINE(HAVE_GDBM,1,[Have GNU DBM, and want to use it])
fi
fi
#LIBDB1="" # CAN INHERIT FROM ENVIRONMENT!
# Sometimes it is in libc, sometimes at separate lib...
# Umm...
if test "$ac_cv_header_db_185_h" = yes ; then
t_found_at="nowhere"
if test "$ac_cv_lib_c_dbopen1" = yes ; then
LIBDB1=""
t_found_at="libc(1)"
DBTYPE="btree"
elif test "$ac_cv_lib_db1_dbopen1" = yes ; then
LIBDB1="-ldb1"
t_found_at="db1 library"
DBTYPE="btree"
else
if test "x$ac_cv_lib_c_dbopen1" = x ; then # not set
AC_TRY_LINK([], [dbopen();], ac_cv_lib_c_dbopen1=yes,
ac_cv_lib_c_dbopen1=no)
fi
if test "$ac_cv_lib_c_dbopen1" = no ; then
if test "x$ac_cv_lib_db1_dbopen1" = x ; then # not set
t_oldLibs="$LIBS"
LIBS="$LIBS -ldb1"
AC_TRY_LINK([], [dbopen();], ac_cv_lib_db1_dbopen1=yes,
ac_cv_lib_db1_dbopen1=no)
LIBS="$t_oldLibs"
if test "$ac_cv_lib_db1_dbopen1" = yes ; then
LIBDB1="-ldb1"
t_found_at="db1 library"
DBTYPE="btree"
else
AC_MSG_RESULT([??? Has <db_185.h>, but dbopen() is not at libc, nor at libdb ???])
fi
elif test "$ac_cv_lib_db1_dbopen1" = yes ; then
AC_MSG_ERROR([config.cache inconsistency! (db1) Delete it, and redo!])
fi
else # Has it in the libc!
LIBDB1=""
t_found_at="libc(2)"
DBTYPE="btree"
fi
fi
if test "$t_found_at" = nowhere ; then
AC_MSG_RESULT([Didn't locate BSD DB 1.x dbopen() anywhere, although <db_185.h> file exists.])
else
AC_MSG_RESULT([Located BSD DB 1.x dbopen() routine at $t_found_at])
if test "$LIBDB1" != "" -a "$LIBDB1" = "$LIBNDBM" ; then
# Well, both at the same library ( -ldb ), which propably
# means that <ndbm.h> is just an emulation mode at BSD DB.
LIBNDBM=""
AC_MSG_RESULT([Note: It looks like your NDBM is actually BSD DB compability wrapper at])
AC_MSG_RESULT([ libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones..])
fi
if test "$t_found_at" != nowhere; then
dblocation="$dblocation;$t_found_at"
AC_DEFINE(HAVE_DB1,1,[Has BSD DB 1.x, and want to support it])
fi
fi
fi
dnl Possible backwards compability library is detected above, but we believe
dnl that following code can be *still* able to locate dbopen() from another
dnl library which contains call API (ABI?) compatible interface, however which
dnl does not necessarily contain binary compatible DATABASE which would use
dnl same binary layout as old BSD DB 1.85 version did...
if test "$ac_cv_header_db_h" = yes -o "$ac_cv_header_db1_db_h" = yes ; then
t_found_at="nowhere"
if test "$ac_cv_lib_c_dbopen" = yes ; then
LIBDB1=""
t_found_at="libc(3)"
DBTYPE="btree"
elif test "$ac_cv_lib_db1_dbopen" = yes ; then
LIBDB1="-ldb1"
t_found_at="db1 library"
DBTYPE="btree"
elif test "$ac_cv_lib_db_dbopen" = yes ; then
LIBDB1="-ldb"
t_found_at="db library"
DBTYPE="btree"
else
if test "x$ac_cv_lib_c_dbopen" = x ; then # not set
AC_TRY_LINK([], [dbopen();], ac_cv_lib_c_dbopen=yes,
ac_cv_lib_c_dbopen=no)
fi
if test "$ac_cv_lib_c_dbopen" = no ; then
if test "x$ac_cv_lib_db1_dbopen" = x ; then # not set
t_oldLibs="$LIBS"
LIBS="$LIBS -ldb1"
AC_TRY_LINK([], [dbopen();], ac_cv_lib_db1_dbopen=yes,
ac_cv_lib_db1_dbopen=no)
LIBS="$t_oldLibs"
if test "$ac_cv_lib_db1_dbopen" = no ; then