-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfigure.in
1184 lines (1056 loc) · 28.4 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 Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------------------------------
dnl Initial settings
dnl ---------------------------------------------------------------------
AC_INIT
AC_CONFIG_SRCDIR([allow.c])
AC_CONFIG_HEADERS([config.h])
AC_PREREQ([2.71])
m4_include([m4/ax_lib_readline.m4])
vers="3.3.3pre"
vers_quoted="\"$vers\""
AC_DEFINE_UNQUOTED(VERSION, $vers)
AC_DEFINE_UNQUOTED(VERSION_QUOTED, $vers_quoted)
VERSION="$vers"
AC_SUBST(VERSION)
copyright_quoted="\"2000-2025\""
AC_DEFINE_UNQUOTED(COPYRIGHT_QUOTED, $copyright_quoted)
dnl ---------------------------------------------------------------------
dnl Check for programs, header files, types, etc (autoconf builtins)
dnl ---------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_CC
AC_PATH_PROGS(MAKE, $MAKE gmake make, $PATH:/local/bin:/usr/local/bin:/opt/TWWfsw/bin:/opt/sfw/bin)
AC_MSG_CHECKING(if make is actually GNU Make)
if test x"$MAKE" = x; then
AC_MSG_ERROR(Cannot locate a make utility, 1)
elif $MAKE --version 2>/dev/null |grep "^GNU Make" >/dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR($MAKE is not GNU Make.
Please install GNU Make or adjust your PATH so that GNU make can be found
before any others., 1)
fi
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROGS(STRIP, $STRIP strip, /usr/css/bin:$PATH:/local/bin:/usr/local/bin:/opt/TWWfsw/bin:/opt/sfw/bin)
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
AC_CHECK_HEADERS(errno.h sys/fcntl.h getopt.h limits.h)
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_HEADERS(termios.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(sys/select.h sys/timerfd.h sys/types.h sys/socket.h sys/un.h)
AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h crypt.h shadow.h libaudit.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(grp.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_STRUCT_TM
AC_TYPE_UID_T
dnl Check exitence of types
AC_CHECK_TYPE(ssize_t, int)
dnl Define sizeof constants
AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(pid_t)
AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(long long int)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_CHECK_LIB(xnet, shutdown)
AC_CHECK_LIB(selinux, getcon, [selinuxavail=1], [selinuxavail=0])
AC_CHECK_LIB(audit, audit_open, [auditavail=1], [auditavail=0])
AX_LIB_READLINE
AC_CHECK_FUNC(getloadavg, [getloadavg=1], [getloadavg=0])
AC_CHECK_LIB(kstat, kstat_open, [kstat=1], [kstat=0])
if test $getloadavg -eq 1; then
dnl Nothing to do ...
AC_FUNC_GETLOADAVG
AC_MSG_CHECKING(function to use for lavg* options)
AC_MSG_RESULT(getloadavg())
elif test $kstat -eq 1; then
AC_MSG_CHECKING(function to use for lavg* options)
LIBS="$LIBS -lkstat"
AC_LIBOBJ([getloadavg])
AC_DEFINE_UNQUOTED(HAVE_KSTAT, 1)
AC_MSG_RESULT(kstat)
else
dnl Try to use the /proc/loadavg file ...
AC_FUNC_GETLOADAVG
AC_MSG_CHECKING(function to use for lavg* options)
AC_MSG_RESULT(/proc/loadavg)
fi
AC_CHECK_FUNCS(getcwd gettimeofday mktime putenv strerror setenv unsetenv gethostname)
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(flock lockf)
AC_CHECK_FUNCS(setlinebuf)
AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(signal)
AC_CHECK_FUNCS(sigset)
AC_CHECK_FUNCS(gettimeofday, [gettimeofday=1], [gettimeofday=0])
AC_CHECK_FUNCS(seteuid, [seteuid=1], [seteuid=0])
AC_CHECK_FUNCS(setegid, [setegid=1], [setegid=0])
AC_CHECK_FUNCS(setresuid, [setresuid=1], [setresuid=0])
AC_CHECK_FUNCS(setresgid, [setresgid=1], [setresgid=0])
if test \( \( $seteuid -eq 1 \) -a \( $setegid -eq 1 \) \) -o \( \( "$setresuid" -eq 1 \) -a \( "$setresgid" -eq 1 \) \) ; then
has_euid=1
else
has_euid=0
fi
AC_CHECK_FUNCS(setpriority)
AC_SEARCH_LIBS([getspnam],[shadow sec], [AC_DEFINE_UNQUOTED(HAVE_GETSPNAM, 1)], [])
AC_CHECK_FUNCS(crypt, [crypt=1], [crypt=0])
if test "$crypt" -eq "0"; then
AC_CHECK_LIB(crypt, crypt, [crypt=1], [crypt=0])
if test "$crypt" -eq "1"; then
LIBS="$LIBS -lcrypt"
fi
fi
if test "$crypt" -eq "1"; then
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1)
fi
dnl --- sockets
dnl Check for post-Reno style struct sockaddr
AC_CACHE_CHECK([for sa_len],
ac_cv_sa_len,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>]], [[int main(void) {
struct sockaddr t;t.sa_len = 0;}]])],[ac_cv_sa_len=yes],[ac_cv_sa_len=no])])
if test $ac_cv_sa_len = yes; then
AC_DEFINE(HAVE_SA_LEN)
fi
dnl --- Socket authentication
AC_CHECK_HEADERS(cred.h sys/cred.h ucred.h sys/ucred.h)
AC_CHECK_FUNCS(getpeerucred) dnl Solaris 10 onward
AC_CHECK_FUNCS(getpeereid) dnl OpenBSD/FreeBSD
dnl ---------------------------------------------------------------------
dnl Check for fcron more specific stuffs (paths, progs, ...)
dnl ---------------------------------------------------------------------
fcron_enable_checks=yes
AC_ARG_ENABLE(checks,
[ --disable-checks Don't verify that programs exist on the host ], dnl '
[ case "$enableval" in
no)
fcron_enable_checks=no
;;
yes)
fcron_enable_checks=yes
;;
*)
AC_MSG_WARN([Bad value for --disable-checks])
;;
esac
])
MAILDISPLAYNAME=""
AC_MSG_CHECKING([mail display name])
AC_MSG_RESULT([$MAILDISPLAYNAME])
AC_SUBST([MAILDISPLAYNAME])
dnl ---------------------------------------------------------------------
dnl Programs ...
AC_PATH_PROG(FOUND_SENDMAIL, sendmail, , $PATH:/usr/lib:/usr/sbin )
SENDMAIL=
USE_SENDMAIL=1
AC_MSG_CHECKING([actual sendmail to use])
AC_ARG_WITH(sendmail, [ --with-sendmail=PATH Path to sendmail.],
[ case "$withval" in
no) USE_SENDMAIL=0 ;;
yes) ;;
*) SENDMAIL=$withval ;;
esac ],
)
if test "$USE_SENDMAIL" != "1" ; then
AC_MSG_RESULT([disabled])
AC_MSG_WARN([Without sendmail you will not get the output of the jobs by mail])
elif test -n "$SENDMAIL" ; then
dnl The user defined a sendmail program to use:
if test ! -x "$SENDMAIL" ; then
dnl ... but it is not an executable file!
AC_MSG_RESULT([$SENDMAIL])
AC_MSG_ERROR([File $SENDMAIL is not an executable file])
else
dnl ... and it is valid
AC_MSG_RESULT([$SENDMAIL])
fi
elif test -z "$FOUND_SENDMAIL" ; then
dnl The user didn't defined a program to use, and we didn't find one automatically
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Empty sendmail path or cannot determine path to sendmail: try option --with-sendmail=PATH])
else
dnl Use the automatically found sendmail program:
SENDMAIL="$FOUND_SENDMAIL"
AC_MSG_RESULT([$SENDMAIL])
fi
AC_SUBST([SENDMAIL])
if test "$USE_SENDMAIL" = "1"; then
AC_DEFINE([USE_SENDMAIL])
fi
AC_PATH_PROG(FOUND_FCRON_SHELL, sh, , $PATH)
FCRON_SHELL=
AC_MSG_CHECKING([default shell to use to run a job])
AC_ARG_WITH(shell,
[ --with-shell=PATH Path to default shell (by default, path to sh).],
[ case "$withval" in
no)
AC_MSG_ERROR(Need a default shell)
;;
yes)
;;
*)
FCRON_SHELL=$withval
if test $fcron_enable_checks = 'yes' -a ! -x "$withval"; then
AC_MSG_ERROR([
File $withval is not an executable file])
fi
;;
esac ]
)
if test x"$FCRON_SHELL" = x ; then
FCRON_SHELL=$FOUND_FCRON_SHELL
if test "$FOUND_FCRON_SHELL" = "" ; then
AC_MSG_ERROR([
Cannot determine path to sh: try option --with-shell=PATH])
fi
fi
AC_MSG_RESULT([$FCRON_SHELL])
AC_SUBST([FCRON_SHELL])
AC_PATH_PROG(FOUND_FCRON_EDITOR, vi)
FCRON_EDITOR=
AC_MSG_CHECKING([editor to use for fcrontab])
AC_ARG_WITH(editor,
[ --with-editor=PATH Path to default editor (by default, path to vi).],
[ case "$withval" in
no)
AC_MSG_ERROR([Need a default editor])
;;
yes)
;;
*)
FCRON_EDITOR=$withval
if test $fcron_enable_checks = 'yes' -a ! -x "$withval"; then
AC_MSG_ERROR([
File $withval is not an executable file])
fi
;;
esac ]
)
if test x"$FCRON_EDITOR" = x; then
FCRON_EDITOR=$FOUND_FCRON_EDITOR
if test x"$FCRON_EDITOR" = x ; then
AC_MSG_ERROR([
Cannot determine path to vi: try option --with-editor=PATH])
fi
fi
AC_MSG_RESULT([$FCRON_EDITOR])
AC_SUBST([FCRON_EDITOR])
dnl ---------------------------------------------------------------------
dnl Paths ...
PIDDIR="${localstatedir}/run"
AC_MSG_CHECKING(location of pid files)
AC_ARG_WITH(piddir,
[ --with-piddir=PATH Directory containing pid files.],
[ case "$withval" in
no)
AC_MSG_ERROR([Need PIDDIR.])
;;
yes)
;;
*)
PIDDIR=$withval
;;
esac ]
)
AC_MSG_RESULT([$PIDDIR])
PIDFILE="${PIDDIR}/fcron.pid"
dnl Is it the first time fcron starts since the system rebooted:
REBOOT_LOCK="${PIDDIR}/fcron.reboot"
dnl Used to notify fcron the system was suspended, and for how long:
SUSPEND_FILE="${PIDDIR}/fcron.suspend"
AC_SUBST(PIDDIR)
AC_SUBST(PIDFILE)
AC_SUBST(REBOOT_LOCK)
AC_SUBST(SUSPEND_FILE)
FIFODIR="${localstatedir}/run"
AC_MSG_CHECKING(location of fifo files)
AC_ARG_WITH(fifodir,
[ --with-fifodir=PATH Directory containing fifo files.],
[ case "$withval" in
no)
AC_MSG_ERROR(Need FIFODIR.)
;;
yes)
;;
*)
FIFODIR=$withval
;;
esac]
)
AC_MSG_RESULT([$FIFODIR])
FIFOFILE="${FIFODIR}/fcron.fifo"
AC_SUBST(FIFODIR)
AC_SUBST(FIFOFILE)
sp="${localstatedir}/spool/fcron"
AC_MSG_CHECKING(location of spool directory)
AC_ARG_WITH(spooldir,
[ --with-spooldir=PATH Directory containing fcron spool (default PREFIX/var/spool/fcron).],
[ case "$withval" in
no)
AC_MSG_ERROR(Need SPOOLDIR.)
;;
yes)
;;
*)
sp="$withval"
;;
esac ]
)
AC_MSG_RESULT($sp)
FCRONTABS="$sp"
AC_DEFINE_UNQUOTED(FCRONTABS, "$sp")
AC_SUBST(FCRONTABS)
if test \( $getloadavg -eq 0 \) -a \( $kstat -eq 0 \); then
proc=/proc
AC_MSG_CHECKING(proc directory)
AC_ARG_WITH(proc,
[ --with-proc=PATH Directory where linux procfs is mounted (default /proc).],
[ case "$withval" in
no)
AC_MSG_WARN([
Without proc, you won't be able to use the lavg* options
])
AC_DEFINE(NOLOADAVG)
;;
yes)
;;
*)
proc=$withval
;;
esac ]
)
if test "$withval" != "no" -a $fcron_enable_checks = 'yes'; then
if test -f "$proc/loadavg"; then :
else
AC_MSG_WARN([
Cannot determine value for proc directory: try option --with-proc=PATH])
AC_MSG_ERROR(Use --with-proc=no to disable the lavg* options)
fi
fi
AC_MSG_RESULT($proc)
PROC=$proc
AC_DEFINE_UNQUOTED(PROC, "$proc")
fi
docdir="${datadir}/doc"
AC_MSG_CHECKING(location of doc directory)
AC_ARG_WITH(docdir,
[ --with-docdir=PATH Directory containing documentation.],
[ case "$withval" in
no)
AC_MSG_ERROR(Need DOCDIR.)
;;
yes)
;;
*)
docdir="$withval"
;;
esac ])
AC_MSG_RESULT($docdir)
DOCDIR="$docdir"
AC_SUBST(DOCDIR)
dnl systemd init system
SYSTEMD_DIR="no"
AC_CHECK_PROGS(PKG_CONFIG, $PKG_CONFIG pkg-config, , $PATH:/local/bin:/usr/local/bin:/opt/sfw/bin)
AC_MSG_CHECKING(for systemd)
AC_ARG_WITH([systemdsystemunitdir],
[ --with-systemdsystemunitdir=DIR Directory for systemd service files.],
[], [ if test "x" != "x$PKG_CONFIG"; then
with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
fi])
if test "x$with_systemdsystemunitdir" != xno; then
if test "x" != "x$with_systemdsystemunitdir"; then
SYSTEMD_DIR="$with_systemdsystemunitdir"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(disabled)
fi
AC_SUBST(SYSTEMD_DIR)
dnl ---------------------------------------------------------------------
dnl Users and groups ...
AC_MSG_CHECKING(run non-privileged)
AC_ARG_WITH(run-non-privileged,
[ --with-run-non-privileged=[yes|no] Run fcron without root's rights (see FAQ !)],
[ case "$withval" in
no)
run_non_privileged=0
AC_MSG_RESULT(no)
;;
yes)
run_non_privileged=1
AC_MSG_RESULT(yes)
AC_MSG_WARN([
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING :
This option allows a non privileged user to run fcron. When used,
fcron does not change its rights before running a job (i.e.,
if joe runs fcron, every job will run as joe).
It means that YOU SHOULD NOT RUN FCRON AS A PRIVILEGED USER WHEN
COMPILED WITH THIS OPTION or you'll have a serious security hole.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
])
AC_DEFINE(RUN_NON_PRIVILEGED)
RUN_NON_PRIVILEGED=1
AC_SUBST(RUN_NON_PRIVILEGED)
bootinstall=0
fcrondyn=0
usepam=0
useselinux=0
useaudit=0
;;
*)
AC_MSG_ERROR(Invalid argument : please use 'yes' or 'no'.)
;;
esac],
run_non_privileged=0
AC_MSG_RESULT(no)
)
max_fcrontab_reload_delay_seconds=60
AC_MSG_CHECKING(max fcrontab reload delay seconds)
AC_ARG_WITH(max-fcrontab-reload-delay-seconds,
[ --with-max-fcrontab-reload-delay-seconds=INTEGER
The maximum delay, in seconds, before (re)loading the fcrontab as a non-root user
(there is never any delay for root). By default, the delay to (re)load the fcrontab
for a non-root user is at least one full second and at most sixty seconds,
depending on circumstances when the (re)load happens.
A value of 0 for this argument means no delay for any user, ever.
A value between 1 and 59 (inclusive) will ensure that the non-root delay is always at least 1s,
and never more than the given number of seconds.
A value greater than or equal to 60 has no effect.],
[
case "$withval" in
("" | *[!0123456789]*)
AC_MSG_ERROR(Invalid argument : please use a non-negative integer.)
;;
*)
max_fcrontab_reload_delay_seconds="$withval"
;;
esac
AC_MSG_RESULT([$withval])
])
MAX_FCRONTAB_RELOAD_DELAY_SECONDS="$max_fcrontab_reload_delay_seconds"
AC_SUBST(MAX_FCRONTAB_RELOAD_DELAY_SECONDS)
AC_DEFINE_UNQUOTED([MAX_FCRONTAB_RELOAD_DELAY_SECONDS], [$max_fcrontab_reload_delay_seconds])
if test "$fcrondyn" = ""; then
dnl As it stands gettimeofday() is required to have fcrondyn
if test "$gettimeofday" = 1; then
fcrondyn=1
else
fcrondyn=0
fi
fi
AC_MSG_CHECKING(if fcrondyn should be compiled)
AC_ARG_WITH(fcrondyn,
[ --with-fcrondyn=[yes|no] Compile (or not) fcrondyn (default: yes).],
[ case "$withval" in
no)
fcrondyn=0
AC_MSG_RESULT(no)
;;
yes)
if test "$crypt" -eq 1 || test "$gettimeofday" -eq 1; then
fcrondyn=1
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR(Need a crypt() and gettimeofday() function to enable fcrondyn.)
fi
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ],
if test "$fcrondyn" = "1" && test "$crypt" -eq 1 && test "$gettimeofday" -eq 1; then
AC_MSG_RESULT(yes)
else
fcrondyn=0
AC_MSG_RESULT(no)
fi
)
FCRONDYN="$fcrondyn"
if test "$fcrondyn" = 1; then
AC_DEFINE_UNQUOTED(FCRONDYN, "$fcrondyn")
AC_SUBST(FCRONDYN)
fi
AC_MSG_CHECKING([root's username])
rootname=root
AC_ARG_WITH(rootname,
[ --with-rootname=USERNAME Root's username (default root) ],
[ case "$withval" in
no)
AC_MSG_ERROR([Need rootname.])
;;
yes)
;;
*)
rootname=$withval
;;
esac
])
if test $fcron_enable_checks = 'yes'; then
rootuid=`$srcdir/script/has_usrgrp.pl -user $rootname -printuid`
if test "x$rootuid" = "x"; then
AC_MSG_ERROR([
Invalid root's username or cannot determine root's username: try option --with-rootname=USERNAME])
fi
fi
AC_MSG_RESULT([$rootname])
AC_MSG_CHECKING([root's groupname])
AC_ARG_WITH(rootgroup,
[ --with-rootgroup=GROUPNAME Root's groupname (default root (or wheel)) ],
[ case "$withval" in
no)
AC_MSG_ERROR(Need rootgroup.)
;;
yes)
;;
*)
rootgroup=$withval
;;
esac ]
)
if test $fcron_enable_checks = 'yes'; then
if test x"$rootgroup" = x; then
# rootgroup not defined: test a few possibilities
rgid=`$srcdir/script/has_usrgrp.pl -group root -printgid`
wgid=`$srcdir/script/has_usrgrp.pl -group wheel -printgid`
if test "x$rgid" != "x"; then
rootgid=$rgid
rootgroup=root
elif test "x$wgid" != "x"; then
rootgid=$wgid
rootgroup=wheel
else
AC_MSG_ERROR([
Cannot determine root's groupname: try option --with-rootgroup=GROUPNAME])
fi
else
# rootgroup defined: check it
rootgid=`$srcdir/script/has_usrgrp.pl -group $rootgroup -printgid`
if test "x$rootgid" = "x"; then
AC_MSG_ERROR([
Cannot determine root's groupname: try option --with-rootgroup=GROUPNAME])
fi
fi
else
# no check: use values given by user or default values
if test x"$rootgroup" = x ; then
rootgroup=root
fi
fi
AC_MSG_RESULT([$rootgroup])
ROOTNAME="$rootname"
AC_SUBST(ROOTNAME)
AC_DEFINE_UNQUOTED(ROOTNAME, "$rootname")
ROOTGROUP="$rootgroup"
AC_SUBST(ROOTGROUP)
AC_DEFINE_UNQUOTED(ROOTGROUP, "$rootgroup")
username="$rootname"
groupname="$rootgroup"
AC_MSG_CHECKING(username to run fcrontab under)
AC_ARG_WITH(username,
[ --with-username=USERNAME Username to run fcrontab under (default fcron) ],
[ case "$withval" in
no)
AC_MSG_ERROR(Need USERNAME.)
;;
yes)
if test "$has_euid" -eq 1 ; then
username=fcron
fi
AC_MSG_RESULT($username)
;;
*)
if test "$has_euid" -eq 1 ; then
username="$withval";
AC_MSG_RESULT($username)
if test "$withval" = "$rootname" && test "$RUN_NON_PRIVILEGED" != "1"; then
AC_MSG_ERROR([
Running fcrontab setuid root is NOT secure and would completely break
the security model of fcron. You must use a different user name.
])
has_euid=0
fi
else
AC_MSG_RESULT($username)
AC_MSG_WARN(username must be $rootname as your system has no seteuid)
fi
;;
esac ],
if test "$has_euid" -eq 1 ; then
username=fcron
fi
AC_MSG_RESULT($username)
)
AC_MSG_CHECKING(groupname to run fcrontab under)
AC_ARG_WITH(groupname,
[ --with-groupname=GROUPNAME Groupname to run fcrontab under (default fcron) ],
[ case "$withval" in
no)
AC_MSG_ERROR(Need GROUPNAME.)
;;
yes)
if test "$has_euid" -eq 1 ; then
groupname=fcron
fi
AC_MSG_RESULT($groupname)
;;
*)
if test "$has_euid" -eq 1 ; then
groupname="$withval";
AC_MSG_RESULT($groupname)
else
AC_MSG_RESULT($groupname)
AC_MSG_WARN(groupname must be $rootgroup as username is $username)
fi
;;
esac ],
if test "$has_euid" -eq 1 ; then
groupname=fcron
fi
AC_MSG_RESULT($groupname)
)
USERNAME="$username"
AC_SUBST(USERNAME)
AC_DEFINE_UNQUOTED(USERNAME, "$username")
GROUPNAME="$groupname"
AC_SUBST(GROUPNAME)
AC_DEFINE_UNQUOTED(GROUPNAME, "$groupname")
if test "$has_euid" -eq 1 ; then
AC_DEFINE(USE_SETE_ID)
fi
sysfcrontab="systab"
use_sysfcrontab=1
AC_MSG_CHECKING(use a system fcrontab)
AC_ARG_WITH(sysfcrontab,
[ --with-sysfcrontab=NAME Use (or not) a system fcrontab (default: yes)],
[ case "$withval" in
no)
use_sysfcrontab=0
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
;;
*)
sysfcrontab="$withval"
AC_MSG_RESULT($sysfcrontab)
esac ],
AC_MSG_RESULT(yes)
)
if test "$use_sysfcrontab" -eq 1 ; then
AC_DEFINE_UNQUOTED(SYSFCRONTAB, "$sysfcrontab")
SYSFCRONTAB="$sysfcrontab"
AC_SUBST(SYSFCRONTAB)
fi
dnl ---------------------------------------------------------------------
dnl Misc ...
AC_ARG_WITH(debug,
[ --with-debug=CFLAGS Use default debug flags or CFLAGS if given to compile fcron in debug mode.],
[ case "$withval" in
no)
cflags="-O2 -Wall"
debug="0"
;;
yes)
cflags="-DDEBUG -DCHECKRUNJOB -g -Wall -DFOREGROUND -DMALLOC_CHECK_=2 -Wpointer-arith -Wstrict-prototypes"
bootinstall=0
debug="1"
;;
*)
cflags="$withval"
debug="1"
;;
esac ],
cflags="-O2 -Wall"
debug="0"
)
DEBUG=$debug
AC_SUBST(DEBUG)
if test "$bootinstall" = ""; then
bootinstall=1
fi
AC_MSG_CHECKING(install interactively a boot script)
AC_ARG_WITH(boot-install,
[ --with-boot-install=[yes|no] Install (interactively) a boot script (default: yes).],
[ case "$withval" in
no)
bootinstall=0
AC_MSG_RESULT(no)
;;
yes)
bootinstall=1
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ],
if test "$bootinstall" = "1"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
)
BOOTINSTALL="$bootinstall"
AC_DEFINE_UNQUOTED(BOOTINSTALL, "$bootinstall")
AC_SUBST(BOOTINSTALL)
AC_ARG_WITH(cflags,
[ --with-cflags=CFLAGS Use CFLAGS flags to compile fcron.],
[ case "$withval" in
no)
AC_MSG_ERROR(Need an explicit value for --with-cflags.)
;;
yes)
AC_MSG_ERROR(Need an explicit value for --with-cflags.)
;;
*)
cflags="$withval"
;;
esac ],
)
CFLAGS=$cflags
AC_DEFINE_UNQUOTED(CFLAGS, "$cflags")
AC_MSG_CHECKING(automatic answer to make install's questions)
AC_ARG_WITH(answer-all,
[ --with-answer-all=[yes|no] Answer the argument to every make install's questions.],
[ case "$withval" in
no)
answerall=0
AC_MSG_RESULT(yes (answer "no"))
;;
yes)
answerall=1
AC_MSG_RESULT(yes (answer "yes"))
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ],
answerall=2
AC_MSG_RESULT(no)
)
ANSWERALL="$answerall"
AC_DEFINE_UNQUOTED(ANSWERALL, "$answerall")
AC_SUBST(ANSWERALL)
AC_MSG_CHECKING(if audit trails should be enabled if available)
AC_ARG_WITH(audit,
[ --with-audit=[yes|no] Enable (or not) audit trails if available (default: yes).],
[ case "$withval" in
no)
useaudit=0
;;
yes)
useaudit=1
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ]
)
if test "$useaudit" = "0"; then
AC_MSG_RESULT(no)
elif test "$useaudit" = "1" && test "$auditavail" != 1; then
useaudit=0
AC_MSG_RESULT(not available)
AC_MSG_ERROR([
You requested audit trails to be enabled, but libaudit was not found.
])
elif test "$auditavail" = 1; then
useaudit=1
AC_MSG_RESULT(yes)
LIBS="$LIBS -laudit"
AC_DEFINE(WITH_AUDIT)
else
useaudit=0
AC_MSG_RESULT(no)
fi
if test "$usepam" = ""; then
usepam=1
fi
AC_MSG_CHECKING(if pam should be used if available)
AC_ARG_WITH(pam,
[ --with-pam=[yes|no] Use (or not) PAM if available (default: yes).],
[ case "$withval" in
no)
usepam=0
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_CHECK_LIB(pam, pam_acct_mgmt)
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ],
if test "$usepam" = "1"; then
AC_MSG_RESULT(yes)
AC_CHECK_LIB(pam, pam_acct_mgmt)
else
usepam=0
AC_MSG_RESULT(no)
fi
)
if test "$usepam" != "0" && echo "$LIBS" | grep -- "-lpam" > /dev/null ; then
usepam=1
else
usepam=0
fi
USEPAM="$usepam"
AC_SUBST(USEPAM)
if test "$useselinux" = ""; then
useselinux=1
fi
AC_MSG_CHECKING(if SELinux should be used)
AC_ARG_WITH(selinux,
[ --with-selinux=[yes|no] Use (or not) SELinux (default: yes).],
[ case "$withval" in
no)
useselinux=0
AC_MSG_RESULT(no)
;;
yes)
if test "$selinuxavail" -eq 1; then
useselinux=1
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(not available)
AC_MSG_ERROR([
You requested the use of SELinux, but SELinux is considered
as not available by configure script.
])
fi
;;
*)
AC_MSG_ERROR(Must be set to either "yes" or "no".)
;;
esac ],
if test "$useselinux" != "0" && test "$selinuxavail" -eq 1; then
useselinux=1
AC_MSG_RESULT(yes)
else
useselinux=0
AC_MSG_RESULT(not available)
fi
)
if test "$useselinux" -eq 1; then
LIBS="$LIBS -lselinux"
AC_DEFINE(WITH_SELINUX)
CFLAGS="$CFLAGS -I/usr/include/selinux"
fi
dnl ---------------------------------------------------------------------
dnl DocBook
AC_PATH_PROG(JADE,openjade)
if test -z "$JADE"; then
AC_PATH_PROG(JADE,jade)
fi
AC_PATH_PROG(DB2MAN,docbook2man)
if test -z "$DB2MAN"; then
AC_PATH_PROG(DB2MAN,db2man)
fi
AC_MSG_CHECKING(Looking for docbook2man converter)
AC_ARG_WITH(db2man,
[ --with-db2man=PATH(or 'no') set PATH to a docbook2man converter.],
[ case "$withval" in
no)
DB2MAN=""
AC_MSG_RESULT(none)
;;
yes)
AC_MSG_ERROR(Must be set to PATH or "no".)
;;
*)
if test ! -x "$withval"; then
AC_MSG_ERROR($withval is not an exe file.)
fi
DB2MAN="$withval"
AC_MSG_RESULT($withval)
;;
esac ],
AC_MSG_RESULT(default: $DB2MAN)
)
AC_SUBST(DB2MAN)
AC_PATH_PROG(NSGMLS, nsgmls)
AC_PATH_PROG(SGMLSPL, sgmlspl)
DB2MAN_SPEC="/usr/share/sgml/docbook/utils-0.6.9/helpers/docbook2man-spec.pl"
AC_MSG_CHECKING(Looking for docbook2man-spec file)
AC_ARG_WITH(db2man-spec,