1?RCS: $Id$
2?RCS:
3?RCS:  Copyright (c) 1991, Syd Weinstein
4?RCS:  Copyright (c) 1991, Raphael Manfredi
5?RCS:
6?RCS:  You may redistribute only under the terms of the GNU General Public
7?RCS:  Licence as specified in the README file that comes with dist.
8?RCS:
9?RCS: $Log
10?MAKE:d_lockflock d_flockonly lock_by_flock flock_only: cat contains d_flock Myread +usrinc Setvar Oldconfig package
11?MAKE:	-pick add $@ %<
12?S:d_lockflock:
13?S:	This variable conditionally defines the LOCK_BY_FLOCK symbol, which
14?S:	indicates that the mailbox should be locked by flock.
15?S:.
16?S:d_flockonly:
17?S:	This variable conditionally defines the FLOCK_ONLY symbol, which indicates
18?S:	that the mailbox should be locked only by flock. Be sure this will not
19?S:	introduce any conflict with other mail-related programs.
20?S:.
21?S:lock_by_flock:
22?S:	This variable holds 'true' if the mailbox should be locked by flock.
23?S:.
24?S:flock_only:
25?S:	This variable holds 'true' when the mailbox is to be locked by flock only.
26?S:.
27?C:LOCK_BY_FLOCK:
28?C:	This symbol, if defined, indicates that the flock mailbox locking should
29?C:	be used.
30?C:.
31?C:FLOCK_ONLY:
32?C:	This symbol, if defined, indicates that only flock mailbox locking should
33?C:	be used. Be sure that this will never conflict with other utilities.
34?C:.
35?H:#$d_lockflock	LOCK_BY_FLOCK		/**/
36?H:#$d_flockonly	FLOCK_ONLY		/**/
37?H:.
38?LINT:set d_lockflock d_flockonly
39: see which mailbox locking should be used
40echo " "
41lock_by_flock=''
42flock_only=''
43case "$d_flock" in
44"$define")
45	if $contains EWOULDBLOCK $usrinc/errno.h > /dev/null 2>&1; then
46		echo 'EWOULDBLOCK found, will use flock type mailbox locking.'
47		val="$define"
48	elif $contains EWOULDBLOCK $usrinc/sys/errno.h > /dev/null 2>&1; then
49		echo 'EWOULDBLOCK found, will use flock type mailbox locking.'
50		val="$define"
51	else
52		echo 'Will use .lock type mailbox locking.'
53		val="$undef"
54	fi
55	;;
56*)
57	echo 'Will use .lock type mailbox locking.'
58	val="$undef"
59	;;
60esac
61set d_lockflock; eval $setvar
62
63case "$d_lockflock" in
64"$define")
65	lock_by_flock='true'
66	case "$d_flockonly" in
67	"$define") dflt=y;;
68	*) dflt=n;;
69	esac
70	$cat <<EOM
71
72Some sites wish to use flock style locking only. This allows $package to be
73installed without the setgid bit being set on some systems that would otherwise
74require it.
75
76Note: Be sure no other mail utility that needs to lock the mail spool file
77uses .lock type locking before using only flock style locking.
78
79EOM
80	rp="Would you like to use flock style mail spool locking only?"
81	. ./myread
82	case "$ans" in
83	y*|Y*) val="$define";;
84	*) val="$undef";;
85	esac
86	;;
87*) val="$undef";;
88esac
89set d_flockonly; eval $setvar
90
91case "$d_flockonly" in
92"$define") flock_only='true';;
93esac
94
95