1dnl configure.in: Input for Autoconf
2dnl
3dnl %%% portions-copyright-cmetz-96
4dnl Portions of this software are Copyright 1996-1999 by Craig Metz, All Rights
5dnl Reserved. The Inner Net License Version 2 applies to these portions of
6dnl the software.
7dnl You should have received a copy of the license with this software. If
8dnl you didn't get a copy, you may request one from <license@inner.net>.
9dnl
10dnl Portions of this software are Copyright 1995 by Randall Atkinson and Dan
11dnl McDonald, All Rights Reserved. All Rights under this copyright are assigned
12dnl to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and
13dnl License Agreement applies to this software.   
14dnl
15dnl	History:
16dnl
17dnl	Modified by cmetz for OPIE 2.4. Add --enable-opieauto option. Check
18dnl	     for ut_id and ut_syslen. Make disable-wtmp disable wtmp not utmp.
19dnl	     Define HAVE_foo if foo is found by the libmissing function check.
20dnl	     Added checks for libmissing functions that were there but never
21dnl	     actually checked for and therefore available.
22dnl	Modified by cmetz for OPIE 2.32. Substitute default for LOCK_DIR.
23dnl	     Fix the --disable-user-locking bug. AC_DEFINE variables to 1.
24dnl          Really check for ut_host.
25dnl	Modified by cmetz for OPIE 2.31. Put back manual utmp[x]/wtmp[x]
26dnl          checks -- too many OSs can't be trusted to tell us where they are.
27dnl	     Check for sys/select.h. Spell endutent right. Replace strtoul()
28dnl	     if needed. Removed duplicate check for sysconf. Added check for
29dnl          SunOS C2 shadow passwords (may need more work). Replace
30dnl          setutent. Added options to disable use of utmp/wtmp. Replace
31dnl          seteuid and setegid. Check for usleep. Moved options.h options
32dnl          here as enable/disable options.
33dnl     Modified by cmetz for OPIE 2.3. Removed redundant memset/memcpy.
34dnl	     Changed ls -g test around. Changed logindevperm/fbtab defines.
35dnl	     Added check for /etc/environment and /etc/src.sh. Check for
36dnl          /var/adm/sulog. Check for {get,put}utxline, provide libmissing
37dnl          versionf of {get,put}utline. Added --enable option for anonymous
38dnl          FTP. Got rid of a few unneeded checks. Check for functions only
39dnl	     used by libmissing only if the replacement function that needs
40dnl	     them is itself needed.
41dnl	Modified by cmetz for OPIE 2.22. Check for Solaris drain bamaged ls.
42dnl          Check for setlogin(). Removed duplicate checks for some funcs.
43dnl     Modified by cmetz for OPIE 2.21. Filename must be in utmp[x]/wtmp[x]
44dnl          defines.
45dnl     Modified by cmetz for OPIE 2.2. Misc changes. Changed for libmissing
46dnl          support and building its target object list. Changed to support
47dnl          FUNCTION declaration et al. Added a LOT of checks and a LOT of
48dnl          fixes.
49dnl	Created at NRL for OPIE 2.1.
50
51AC_INIT(README)
52AC_CONFIG_HEADER(config.h)
53AC_ARG_ENABLE(access-file, [  --enable-access-file=FILENAME
54                          Enable the OPIE access file FILENAME], AC_DEFINE_UNQUOTED(PATH_ACCESS_FILE, "$enable_access_file") echo "Using the access file in $enable_access_file -- don't say we didn't warn you!")
55ACCESS_FILE="$enable_access_file"
56AC_SUBST(ACCESS_FILE)
57AC_ARG_ENABLE(server-md4, [  --enable-server-md4     Use MD4 instead of MD5 for the server], AC_DEFINE(MDX, 4), AC_DEFINE(MDX, 5))
58
59AC_ARG_ENABLE(user-locking, [  --disable-user-locking  Disable user locking
60  --enable-user-locking[=DIR]
61                          Put user lock files in DIR [/etc/opielocks]],,)
62if test "$enable_user_locking" != no;
63then
64  if test -z "$enable_user_locking"
65  then
66    AC_DEFINE(OPIE_LOCK_DIR, "/etc/opielocks")
67    LOCK_DIR="/etc/opielocks"
68  else
69    AC_DEFINE_UNQUOTED(OPIE_LOCK_DIR, "$enable_user_locking")
70    LOCK_DIR="$enable_user_locking"
71  fi
72fi
73AC_SUBST(LOCK_DIR)
74
75AC_ARG_ENABLE(retype, [  --enable-retype         Ask users to re-type their secret pass phrases], AC_DEFINE(RETYPE, 1))
76AC_ARG_ENABLE(su-star-check, [  --enable-su-star-check  Refuse to switch to disabled accounts], AC_DEFINE(SU_STAR_CHECK, 1))
77AC_ARG_ENABLE(new-prompts, [  --disable-new-prompts   Use more compatible (but less informative) prompts],, AC_DEFINE(NEW_PROMPTS, 1))
78AC_ARG_ENABLE(insecure-override, [  --enable-insecure-override
79                          Allow users to override insecure checks], AC_DEFINE(INSECURE_OVERRIDE, 1))
80AC_ARG_ENABLE(anonymous-ftp, [  --enable-anonymous-ftp  Enable anonymous FTP support], AC_DEFINE(DOANONYMOUS, 1) echo "enabling anonymous FTP support in ftp -- don't say we didn't warn you!")
81AC_ARG_ENABLE(utmp, [  --disable-utmp          Disable utmp logging], AC_DEFINE(DISABLE_UTMP, 1) echo "disabling utmp logging")
82AC_ARG_ENABLE(wtmp, [  --disable-wtmp          Disable wtmp logging], AC_DEFINE(DISABLE_WTMP, 1) echo "disabling wtmp logging")
83AC_ARG_ENABLE(opieauto, [  --enable-opieauto       Enable support for opieauto], AC_DEFINE(OPIEAUTO, 1) OPIEAUTO=opieauto; echo "enabling opieauto support")
84AC_SUBST(OPIEAUTO)
85
86dnl Checks for programs.
87AC_PROG_CC
88AC_PROG_CPP
89AC_PROG_LN_S
90AC_PROG_RANLIB
91AC_PROG_YACC
92
93AC_AIX
94AC_ISC_POSIX
95AC_MINIX
96
97dnl We'd put PATH in these checks, but it turns out that autoconf doesn't
98dnl work as documented when it comes to the colon separator...
99
100AC_PATH_PROG(CHOWN, chown, /bin/chown, /usr/bin /bin /usr/sbin /sbin /usr/etc /etc)
101
102AC_PATH_PROG(SU, su, /bin/su, /usr/bin /bin)
103AC_PATH_PROG(ALT_SU, su,, /usr/sbin /sbin)
104
105AC_PATH_PROG(SCHEME, scheme,, /usr/lib/iaf/scheme)
106AC_PATH_PROG(LOGIN, login, /bin/login, /usr/bin /bin)
107dnl AC_DEFINE_UNQUOTED(PATH_LOGIN, "$LOGIN")
108
109if test ! -z "$SCHEME";
110then
111	LOGIN="$SCHEME";
112fi
113
114AC_PATH_PROG(FTPD, ftpd,, /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin)
115AC_PATH_PROG(INFTPD, in.ftpd,, /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin)
116
117if test -z "$FTPD"
118then
119	if test ! -z "$INFTPD"
120	then
121		FTPD="$INFTPD"
122	fi
123fi
124
125AC_MSG_CHECKING(for default PATH entries)
126default_path=""
127save_IFS="$IFS"
128IFS=" "
129for i in /usr/bin /bin /usr/ucb /usr/sbin /usr/bsd /sbin /usr/bin/X11 /etc /usr/local/X11/bin /usr/X11R6/bin /your-system-is-broken
130do
131	IFS=":"
132	for j in $PATH
133	do
134		if test "$i" = "$j"
135		then
136			if test -d "$i"
137			then
138				if test -z "$default_path"
139				then
140					default_path="$i"
141				else
142					default_path="$default_path:$i"
143				fi
144			fi
145		fi
146	done
147	IFS=" "
148done
149AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$default_path")
150AC_MSG_RESULT($default_path)
151
152AC_MSG_CHECKING(for test -e flag)
153if sh config.testeflag
154then
155	result=yes
156	EXISTS="-e"
157else
158	result=no
159	EXISTS="-f"
160fi
161AC_SUBST(EXISTS)
162AC_MSG_RESULT($result)
163
164AC_MSG_CHECKING(for mkdir -p flag)
165if test -d config.tmpdir
166then
167	rmdir config.tmpdir/foo/bar >/dev/null 2>/dev/null
168	rmdir config.tmpdir/foo >/dev/null 2>/dev/null
169	rmdir config.tmpdir >/dev/null 2>/dev/null
170fi
171
172result=no
173if mkdir -p config.tmpdir/foo/bar >/dev/null 2>/dev/null
174then
175	if test -d config.tmpdir
176	then
177		if test -d config.tmpdir/foo
178		then
179			if test -d config.tmpdir/foo/bar
180			then
181				result=yes
182				rmdir config.tmpdir/foo/bar >/dev/null 2>/dev/null
183			fi
184			rmdir config.tmpdir/foo >/dev/null 2>/dev/null
185		fi
186		rmdir config.tmpdir >/dev/null 2>/dev/null
187	fi
188fi
189
190if test "$result" = yes
191then
192	MKDIR="mkdir -p"
193else
194	MKDIR="mkdir"
195fi
196AC_SUBST(MKDIR)
197AC_MSG_RESULT($result)
198
199AC_MSG_CHECKING(for ls group field)
200lsg=`/bin/ls -ldg / | wc -w | awk '{print $1}'`;
201ls=`/bin/ls -ld / | wc -w | awk '{print $1}'`;
202result="no"
203if test $ls = 9;
204then
205	result="yes"
206else
207	if test "$ls" = 8 -a "$lsg" = 9;
208	then
209		result="yes, with -g"
210		AC_DEFINE(HAVE_LS_G_FLAG)
211	fi
212fi
213AC_MSG_RESULT($result)
214
215dnl Checks for various system characteristics
216AC_MSG_CHECKING(for /etc/default/login)
217if test $EXISTS /etc/default/login
218then
219	result=yes
220	AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
221else
222	result=no
223fi
224AC_MSG_RESULT($result)
225
226AC_MSG_CHECKING(for /etc/securetty)
227if test $EXISTS /etc/securetty
228then
229	result=yes
230	AC_DEFINE(HAVE_SECURETTY)
231else
232	result=no
233fi
234AC_MSG_RESULT($result)
235
236AC_MSG_CHECKING(for /etc/logindevperm)
237if test $EXISTS /etc/logindevperm
238then
239	AC_MSG_RESULT(yes)
240	AC_DEFINE(HAVE_LOGIN_PERMFILE, "/etc/logindevperm")
241else
242	AC_MSG_RESULT(no)
243
244	AC_MSG_CHECKING(for /etc/fbtab)
245	if test $EXISTS /etc/fbtab
246	then
247		result=yes
248		AC_DEFINE(HAVE_LOGIN_PERMFILE, "/etc/fbtab")
249	else
250		result=no
251	fi
252	AC_MSG_RESULT($result)
253fi
254
255AC_MSG_CHECKING(for /etc/environment)
256if test $EXISTS /etc/environment
257then
258	AC_MSG_RESULT(yes)
259	AC_DEFINE(HAVE_LOGIN_ENVFILE, "/etc/environment")
260else
261	AC_MSG_RESULT(no)
262
263	AC_MSG_CHECKING(for /etc/src.sh)
264	if test $EXISTS /etc/src.sh
265	then
266		result=yes
267		AC_DEFINE(HAVE_LOGIN_ENVFILE, "/etc/src.sh")
268	else
269		result=no
270	fi
271	AC_MSG_RESULT($result)
272fi
273
274AC_MSG_CHECKING(for /etc/shadow)
275if test $EXISTS /etc/shadow
276then
277	result=yes
278	AC_DEFINE(HAVE_ETC_SHADOW)
279else
280	AC_MSG_RESULT(no)
281
282	AC_MSG_CHECKING(for /etc/security/passwd.adjunct)
283	if test $EXISTS /etc/security/passwd.adjunct
284	then
285		result=yes
286		AC_DEFINE(HAVE_SUNOS_C2_SHADOW)
287		LIBOBJS="$LIBOBJS getspnam.o endspent.o"
288	else
289		result=no
290	fi
291fi
292AC_MSG_RESULT($result)
293
294AC_MSG_CHECKING(for /var/adm/sulog)
295if test $EXISTS /var/adm/sulog
296then
297	result=yes
298	AC_DEFINE(HAVE_SULOG)
299else
300	result=no
301fi
302AC_MSG_RESULT($result)
303
304AC_MSG_CHECKING(mail spool location)
305mail_spool=""
306for i in /var/mail /usr/mail /var/spool/mail /usr/spool/mail
307do
308	if test -d $i
309	then
310		mail_spool="$i"
311	fi
312done
313if test -z "$mail_spool"
314then
315	result="not found"
316else
317	result="$mail_spool"
318	AC_DEFINE_UNQUOTED(PATH_MAIL, "$mail_spool")
319fi
320AC_MSG_RESULT($result)
321
322AC_MSG_CHECKING(where your system puts the utmp file)
323utmp_path=""
324for i in /var/run /var/adm /usr/adm /etc
325do
326	if test $EXISTS $i/utmp
327	then
328		utmp_path="$i"
329	fi
330done
331if test -z "$utmp_path"
332then
333	result="not found"
334else
335	result="$utmp_path"
336	AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmp")
337fi
338AC_MSG_RESULT($result)
339
340AC_MSG_CHECKING(where your system puts the utmpx file)
341utmp_path=""
342for i in /var/run /var/adm /usr/adm /etc
343do
344	if test $EXISTS $i/utmp
345	then
346		utmp_path="$i"
347	fi
348done
349if test -z "$utmp_path"
350then
351	result="not found"
352	AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmpx")
353fi
354AC_MSG_RESULT($result)
355
356AC_MSG_CHECKING(where your system puts the wtmp file)
357wtmp_path=""
358for i in /var/run /var/log /var/adm /usr/adm /etc
359do
360	if test $EXISTS $i/wtmp
361	then
362		wtmp_path="$i"
363	fi
364done
365if test -z "$wtmp_path"
366then
367	result="not found"
368else
369	result="$wtmp_path"
370	AC_DEFINE_UNQUOTED(PATH_WTMP_AC, "$wtmp_path/wtmp")
371fi
372AC_MSG_RESULT($result)
373
374AC_MSG_CHECKING(where your system puts the wtmpx file)
375wtmpx_path=""
376for i in /var/run /var/log /var/adm /usr/adm /etc
377do
378	if test $EXISTS $i/wtmpx
379	then
380		wtmpx_path="$i"
381	fi
382done
383if test -z "$wtmpx_path"
384then
385	result="not found"
386else
387	result="$wtmpx_path"
388	AC_DEFINE_UNQUOTED(PATH_WTMPX_AC, "$wtmpx_path/wtmpx")
389fi
390AC_MSG_RESULT($result)
391
392AC_MSG_CHECKING(whether the system profile displays the motd)
393result=no
394if test $EXISTS /etc/profile
395then
396	if grep motd /etc/profile >/dev/null 2>/dev/null
397	then
398		result=yes
399	fi
400fi
401if test "$result" = yes
402then
403	AC_DEFINE(HAVE_MOTD_IN_PROFILE)
404fi
405AC_MSG_RESULT($result)
406
407AC_MSG_CHECKING(whether the system profile checks for mail)
408result=no
409if test $EXISTS /etc/profile
410then
411	if grep 'mail\.' /etc/profile >/dev/null 2>/dev/null
412	then
413		result=yes
414	fi
415fi
416if test "$result" = yes
417then
418	AC_DEFINE(HAVE_MAILCHECK_IN_PROFILE)
419fi
420AC_MSG_RESULT($result)
421
422dnl Random checks
423AC_C_CONST
424
425AC_MSG_CHECKING(to see if your compiler can handle void arguments)
426AC_TRY_COMPILE(foo(void) { },, AC_DEFINE(HAVE_VOIDARG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
427
428AC_MSG_CHECKING(to see if your compiler can handle void return values)
429AC_TRY_COMPILE(void foo() { },, AC_DEFINE(HAVE_VOIDRET) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
430
431AC_MSG_CHECKING(to see if your compiler can handle void pointers)
432AC_TRY_COMPILE(foo() { void *bar = (void *)0x42; bar = bar + 1; },, AC_DEFINE(HAVE_VOIDPTR) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
433
434AC_MSG_CHECKING(to see if your compiler can handle ANSI argument lists)
435AC_TRY_COMPILE(int foo(int bar, int baz) { return 0; },, AC_DEFINE(HAVE_ANSIDECL) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
436
437AC_MSG_CHECKING(to see if your compiler can handle ANSI prototypes)
438AC_TRY_COMPILE(extern int foo(int, int);,, AC_DEFINE(HAVE_ANSIPROTO) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
439
440AC_MSG_CHECKING(to see if your compiler can handle ANSI variable arguments)
441AC_TRY_COMPILE([#include <stdarg.h>
442int foo(int arg, ...) {
443	va_list ap;
444	va_start(ap, arg);
445	va_end(ap);
446	return 0;
447}],, AC_DEFINE(HAVE_ANSISTDARG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
448
449AC_MSG_CHECKING(to see if you have an ANSI-style sprintf)
450AC_TRY_RUN([#include <stdio.h>
451int main(argc, argv)
452int argc;
453char *argv[];
454{
455  char buf[5];
456  int i = 2;
457  i += sprintf(buf, "1234");
458  return (i == 6) ? 0 : -1;
459}], AC_DEFINE(HAVE_ANSISPRINTF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no))
460
461dnl Checks for libraries.
462AC_CHECK_LIB(crypt, crypt)
463AC_CHECK_LIB(nsl, gethostname)
464AC_CHECK_LIB(posix, main)
465AC_CHECK_LIB(socket, socket)
466
467dnl Checks for header files.
468AC_HEADER_DIRENT
469AC_HEADER_SYS_WAIT
470AC_CHECK_HEADERS(crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h sys/select.h)
471
472dnl Checks for typedefs, structures, and compiler characteristics.
473dnl AC_TYPE_UID_T
474dnl AC_TYPE_OFF_T
475dnl AC_TYPE_PID_T
476dnl AC_STRUCT_ST_BLKSIZE
477dnl AC_STRUCT_TM
478
479AC_MSG_CHECKING(for ut_pid in struct utmp)
480AC_TRY_COMPILE([#include <sys/types.h>
481#include <utmp.h>], [struct utmp foo; return (int)foo.ut_pid;], AC_DEFINE(HAVE_UT_PID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
482AC_MSG_CHECKING(for ut_type in struct utmp)
483AC_TRY_COMPILE([#include <sys/types.h>
484#include <utmp.h>], [struct utmp foo; return (int)foo.ut_type;], AC_DEFINE(HAVE_UT_TYPE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
485AC_MSG_CHECKING(for ut_name in struct utmp)
486AC_TRY_COMPILE([#include <sys/types.h>
487#include <utmp.h>], [struct utmp foo; return (int)foo.ut_name[0];], AC_DEFINE(HAVE_UT_NAME) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
488dnl AC_MSG_CHECKING(for ut_user in struct utmp)
489dnl AC_TRY_COMPILE([#include <sys/types.h>
490dnl #include <utmp.h>], [struct utmp foo; return (int)foo.ut_user[0];], AC_DEFINE(HAVE_UT_USER) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
491AC_MSG_CHECKING(for ut_host in struct utmp)
492AC_TRY_COMPILE([#include <sys/types.h>
493#include <utmp.h>], [struct utmp foo; return (int)foo.ut_host[0];], AC_DEFINE(HAVE_UT_HOST) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
494AC_MSG_CHECKING(for ut_id in struct utmp)
495AC_TRY_COMPILE([#include <sys/types.h>
496#include <utmp.h>], [struct utmp foo; return (int)foo.ut_id[0];], AC_DEFINE(HAVE_UT_ID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
497#AC_MSG_CHECKING(for ut_syslen in struct utmp)
498#AC_TRY_COMPILE([#include <sys/types.h>
499##include <utmp.h>], [struct utmp foo; return (int)foo.ut_syslen;], AC_DEFINE(HAVE_UT_SYSLEN) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
500AC_MSG_CHECKING(for ut_syslen in struct utmpx)
501AC_TRY_COMPILE([#include <sys/types.h>
502#include <utmpx.h>], [struct utmpx foo; return (int)foo.ut_syslen;], AC_DEFINE(HAVE_UTX_SYSLEN) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
503
504dnl Checks for library functions.
505dnl AC_PROG_GCC_TRADITIONAL
506AC_TYPE_SIGNAL
507AC_CHECK_FUNCS(gettimeofday socket strftime strstr setpriority getttynam setvbuf getspnam endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline usleep)
508
509dnl Libmissing...
510AC_FUNC_MEMCMP
511AC_FUNC_ALLOCA
512AC_REPLACE_FUNCS(getusershell sigaddset sigemptyset strerror strncasecmp)
513MISSING="$LIBOBJS $ALLOCA " ;
514
515dnl These should be simplified by a macro
516AC_CHECK_FUNC(atexit,      AC_DEFINE(HAVE_ATEXIT),      MISSING="${MISSING}atexit.o "; AC_CHECK_FUNCS(on_exit))
517AC_CHECK_FUNC(endutent,    AC_DEFINE(HAVE_ENDUTENT),    MISSING="${MISSING}endutent.o ")
518AC_CHECK_FUNC(initgroups,  AC_DEFINE(HAVE_INITGROUPS),  MISSING="${MISSING}initgroups.o ")
519AC_CHECK_FUNC(memcmp,      AC_DEFINE(HAVE_MEMCMP),      MISSING="${MISSING}memcmp.o ")
520AC_CHECK_FUNC(memcpy,      AC_DEFINE(HAVE_MEMCPY),      MISSING="${MISSING}memcpy.o "; AC_CHECK_FUNCS(bcopy))
521AC_CHECK_FUNC(memset,      AC_DEFINE(HAVE_MEMSET),      MISSING="${MISSING}memset.o "; AC_CHECK_FUNCS(bzero))
522AC_CHECK_FUNC(getcwd,      AC_DEFINE(HAVE_GETCWD),      MISSING="${MISSING}getcwd.o "; AC_CHECK_FUNCS(getwd))
523AC_CHECK_FUNC(getenv,      AC_DEFINE(HAVE_GETENV),      MISSING="${MISSING}env.o ")
524AC_CHECK_FUNC(getutline,   AC_DEFINE(HAVE_GETUTLINE),   MISSING="${MISSING}getutline.o "; AC_CHECK_FUNCS(ttyslot))
525AC_CHECK_FUNC(pututline,   AC_DEFINE(HAVE_PUTUTLINE),   MISSING="${MISSING}pututline.o "; AC_CHECK_FUNCS(ttyslot))
526AC_CHECK_FUNC(setenv,      AC_DEFINE(HAVE_SETENV),      MISSING="${MISSING}env.o ")
527AC_CHECK_FUNC(setegid,     AC_DEFINE(HAVE_SETEGID),     MISSING="${MISSING}setegid.o "; AC_CHECK_FUNCS(setregid setresgid))
528AC_CHECK_FUNC(seteuid,     AC_DEFINE(HAVE_SETEUID),     MISSING="${MISSING}seteuid.o "; AC_CHECK_FUNCS(setreuid setresuid))
529AC_CHECK_FUNC(setutent,    AC_DEFINE(HAVE_SETUTENT),    MISSING="${MISSING}setutent.o ")
530AC_CHECK_FUNC(sigprocmask, AC_DEFINE(HAVE_SIGPROCMASK), MISSING="${MISSING}sigprocmask.o "; AC_CHECK_FUNCS(sigblock sigsetmask))
531AC_CHECK_FUNC(strchr,      AC_DEFINE(HAVE_STRCHR),      MISSING="${MISSING}strchr.o "; AC_CHECK_FUNCS(index))
532AC_CHECK_FUNC(strrchr,     AC_DEFINE(HAVE_STRRCHR),     MISSING="${MISSING}strrchr.o "; AC_CHECK_FUNCS(rindex))
533AC_CHECK_FUNC(strtoul,     AC_DEFINE(HAVE_STRTOUL),     MISSING="${MISSING}strtoul.o ")
534AC_CHECK_FUNC(sysconf,     AC_DEFINE(HAVE_SYSCONF),     MISSING="${MISSING}sysconf.o "; AC_CHECK_FUNCS(getdtablesize))
535AC_CHECK_FUNC(uname,       AC_DEFINE(HAVE_UNAME),       MISSING="${MISSING}uname.o "; AC_CHECK_FUNCS(gethostname))
536AC_CHECK_FUNC(unsetenv,    AC_DEFINE(HAVE_UNSETENV),    MISSING="${MISSING}env.o ")
537AC_SUBST(MISSING)
538
539AC_MSG_CHECKING(for nonstandard gettimeofday)
540AC_TRY_COMPILE([
541#if HAVE_SYS_TIME_H
542#include <sys/time.h>
543#endif /* HAVE_SYS_TIME_H */
544#if HAVE_UNISTD_H
545#include <unistd.h>
546#endif /* HAVE_UNISTD_H */
547],
548[struct timeval tv;
549gettimeofday(&tv, NULL)], AC_MSG_RESULT(no), AC_MSG_RESULT(maybe) AC_TRY_COMPILE([
550#if HAVE_SYS_TIME_H
551#include <sys/time.h>
552#endif /* HAVE_SYS_TIME_H */
553#if HAVE_UNISTD_H
554#include <unistd.h>
555#endif /* HAVE_UNISTD_H */
556],
557[struct timeval tv;
558gettimeofday(&tv)], AC_DEFINE(HAVE_ONE_ARG_GETTIMEOFDAY) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
559
560# Munge out LOCALBIN and LOCALMAN in canonical (no bletch) form
561AC_OUTPUT(configure.munger libmissing/Makefile libopie/Makefile Makefile.munge:Makefile.in)
562sh configure.munger
563