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