Annotation of src/usr.bin/sudo/configure.in, Revision 1.14
1.1 millert 1: dnl
2: dnl Process this file with GNU autoconf to produce a configure script.
1.14 ! millert 3: dnl $Sudo: configure.in,v 1.367 2003/03/15 20:31:01 millert Exp $
1.1 millert 4: dnl
1.14 ! millert 5: dnl Copyright (c) 1994-1996,1998-2003 Todd C. Miller <Todd.Miller@courtesan.com>
1.1 millert 6: dnl
1.14 ! millert 7: AC_INIT(sudo, 1.6.7)
1.1 millert 8: AC_CONFIG_HEADER(config.h pathnames.h)
9: dnl
10: dnl This won't work before AC_INIT()
11: dnl
1.14 ! millert 12: echo "Configuring Sudo version 1.6.7"
1.1 millert 13: dnl
1.7 millert 14: dnl Variables that get substituted in the Makefile and man pages
1.1 millert 15: dnl
1.5 millert 16: AC_SUBST(CFLAGS)dnl
1.1 millert 17: AC_SUBST(PROGS)dnl
18: AC_SUBST(CPPFLAGS)dnl
19: AC_SUBST(LDFLAGS)dnl
20: AC_SUBST(SUDO_LDFLAGS)dnl
21: AC_SUBST(LIBS)dnl
22: AC_SUBST(SUDO_LIBS)dnl
23: AC_SUBST(NET_LIBS)dnl
24: AC_SUBST(AFS_LIBS)dnl
25: AC_SUBST(OSDEFS)dnl
26: AC_SUBST(AUTH_OBJS)dnl
27: AC_SUBST(MANTYPE)dnl
28: AC_SUBST(MAN_POSTINSTALL)dnl
29: AC_SUBST(SUDOERS_MODE)dnl
30: AC_SUBST(SUDOERS_UID)dnl
31: AC_SUBST(SUDOERS_GID)dnl
1.5 millert 32: AC_SUBST(DEV)
33: AC_SUBST(mansectsu)
34: AC_SUBST(mansectform)
35: AC_SUBST(mansrcdir)
36: dnl
1.7 millert 37: dnl Variables that get substituted in docs (not overridden by environment)
38: dnl
39: AC_SUBST(timedir)dnl initial value from SUDO_TIMEDIR
40: AC_SUBST(timeout)
41: AC_SUBST(password_timeout)
42: AC_SUBST(sudo_umask)
43: AC_SUBST(passprompt)
44: AC_SUBST(long_otp_prompt)
45: AC_SUBST(lecture)
46: AC_SUBST(logfac)
47: AC_SUBST(goodpri)
48: AC_SUBST(badpri)
49: AC_SUBST(loglen)
50: AC_SUBST(ignore_dot)
51: AC_SUBST(mail_no_user)
52: AC_SUBST(mail_no_host)
53: AC_SUBST(mail_no_perms)
54: AC_SUBST(mailto)
55: AC_SUBST(mailsub)
56: AC_SUBST(badpass_message)
57: AC_SUBST(fqdn)
58: AC_SUBST(runas_default)
59: AC_SUBST(env_editor)
60: AC_SUBST(passwd_tries)
61: AC_SUBST(tty_tickets)
62: AC_SUBST(insults)
63: dnl
64: dnl Initial values for above
65: dnl
66: timeout=5
67: password_timeout=5
68: sudo_umask=0022
69: passprompt="Password:"
70: long_otp_prompt=off
71: lecture=on
72: logfac=local2
73: goodpri=notice
74: badpri=alert
75: loglen=80
76: ignore_dot=off
77: mail_no_user=on
78: mail_no_host=off
79: mail_no_perms=off
80: mailto=root
81: mailsub='*** SECURITY information for %h ***'
82: badpass_message='Sorry, try again.'
83: fqdn=off
84: runas_default=root
85: env_editor=off
86: passwd_tries=3
87: tty_tickets=off
88: insults=off
89: dnl
1.5 millert 90: dnl Initial values for Makefile variables listed above
1.7 millert 91: dnl May be overridden by environment variables..
1.5 millert 92: dnl
93: PROGS="sudo visudo"
94: test -n "$MANTYPE" || MANTYPE="man"
95: test -n "$mansrcdir" || mansrcdir="."
96: test -n "$SUDOERS_MODE" || SUDOERS_MODE=0440
97: test -n "$SUDOERS_UID" || SUDOERS_UID=0
98: test -n "$SUDOERS_GID" || SUDOERS_GID=0
1.1 millert 99: DEV="#"
1.5 millert 100:
101: dnl
102: dnl Other vaiables
103: dnl
1.1 millert 104: CHECKSHADOW=true
105: CHECKSIA=true
106:
107: dnl
108: dnl Override default configure dirs...
109: dnl
110: test "$mandir" = '${prefix}/man' && mandir='$(prefix)/man'
111: test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin'
112: test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin'
1.14 ! millert 113: test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
1.1 millert 114:
115: dnl
116: dnl Deprecated --with options (these all warn or generate an error)
117: dnl
118:
119: AC_ARG_WITH(otp-only, [ --with-otp-only deprecated],
120: [case $with_otp_only in
121: yes) with_passwd=no
1.7 millert 122: AC_DEFINE(WITHOUT_PASSWD, 1, [Define to avoid using the passwd/shadow file for authentication.])
1.1 millert 123: AC_MSG_WARN([--with-otp-only option deprecated, treating as --without-passwd])
124: ;;
125: esac])
126:
127: AC_ARG_WITH(alertmail, [ --with-alertmail deprecated],
128: [case $with_alertmail in
129: *) with_mailto="$with_alertmail"
130: AC_MSG_WARN([--with-alertmail option deprecated, treating as --mailto])
131: ;;
132: esac])
133:
134: dnl
135: dnl Options for --with
136: dnl
137:
138: AC_ARG_WITH(CC, [ --with-CC C compiler to use],
139: [case $with_CC in
140: yes) AC_MSG_ERROR(["must give --with-CC an argument."])
141: ;;
142: no) AC_MSG_ERROR(["illegal argument: --without-CC."])
143: ;;
144: *) CC=$with_CC
145: ;;
146: esac])
147:
148: AC_ARG_WITH(incpath, [ --with-incpath additional places to look for include files],
149: [case $with_incpath in
150: yes) AC_MSG_ERROR(["must give --with-incpath an argument."])
151: ;;
152: no) AC_MSG_ERROR(["--without-incpath not supported."])
153: ;;
154: *) echo "Adding ${with_incpath} to CPPFLAGS"
155: for i in ${with_incpath}; do
156: CPPFLAGS="${CPPFLAGS} -I${i}"
157: done
158: ;;
159: esac])
160:
161: AC_ARG_WITH(libpath, [ --with-libpath additional places to look for libraries],
162: [case $with_libpath in
163: yes) AC_MSG_ERROR(["must give --with-libpath an argument."])
164: ;;
165: no) AC_MSG_ERROR(["--without-libpath not supported."])
166: ;;
167: *) echo "Adding ${with_libpath} to LDFLAGS"
168: for i in ${with_libpath}; do
169: LDFLAGS="${LDFLAGS} -L${i}"
170: done
171: ;;
172: esac])
173:
174: AC_ARG_WITH(libraries, [ --with-libraries additional libraries to link with],
175: [case $with_libraries in
176: yes) AC_MSG_ERROR(["must give --with-libraries an argument."])
177: ;;
178: no) AC_MSG_ERROR(["--without-libraries not supported."])
179: ;;
180: *) echo "Adding ${with_libraries} to LIBS"
181: for i in ${with_libraries}; do
182: case $i in
183: -l*) ;;
184: *.a) ;;
185: *.o) ;;
186: *) i="-l${i}";;
187: esac
188: LIBS="${LIBS} ${i}"
189: done
190: ;;
191: esac])
192:
1.13 david 193: AC_ARG_WITH(devel, [ --with-devel add development options],
1.1 millert 194: [case $with_devel in
1.13 david 195: yes) echo 'Setting up for development: -Wall, flex, yacc'
1.1 millert 196: PROGS="${PROGS} testsudoers"
197: OSDEFS="${OSDEFS} -DSUDO_DEVEL"
198: DEV=""
199: ;;
200: no) ;;
1.5 millert 201: *) echo "Ignoring unknown argument to --with-devel: $with_devel"
1.1 millert 202: ;;
203: esac])
204:
1.9 millert 205: AC_ARG_WITH(efence, [ --with-efence link with -lefence for malloc() debugging],
206: [case $with_efence in
207: yes) echo 'Sudo will link with -lefence (Electric Fence)'
208: LIBS="${LIBS} -lefence"
209: if test -f /usr/local/lib/libefence.a; then
210: LDFLAGS="${LDFLAGS} -L/usr/local/lib"
211: fi
212: ;;
213: no) ;;
214: *) echo "Ignoring unknown argument to --with-efence: $with_efence"
215: ;;
216: esac])
217:
1.1 millert 218: AC_ARG_WITH(csops, [ --with-csops add CSOps standard options],
219: [case $with_csops in
220: yes) echo 'Adding CSOps standard options'
221: CHECKSIA=false
222: with_ignore_dot=yes
1.7 millert 223: insults=on
1.1 millert 224: with_classic_insults=yes
225: with_csops_insults=yes
226: with_env_editor=yes
227: ;;
228: no) ;;
229: *) echo "Ignoring unknown argument to --with-csops: $with_csops"
230: ;;
231: esac])
232:
233: AC_ARG_WITH(passwd, [ --without-passwd don't use passwd/shadow file for authentication],
234: [case $with_passwd in
235: yes) ;;
236: no) AC_DEFINE(WITHOUT_PASSWD)
237: AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
238: AC_MSG_RESULT(no)
239: ;;
240: *) AC_MSG_ERROR(["Sorry, --with-passwd does not take an argument."])
241: ;;
242: esac])
243:
244: AC_ARG_WITH(skey, [ --with-skey enable S/Key support ],
245: [case $with_skey in
246: yes) if test -n "$with_opie"; then
247: AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
248: fi
1.7 millert 249: AC_DEFINE(HAVE_SKEY, 1, [Define if you use S/Key.])
1.1 millert 250: AC_MSG_CHECKING(whether to try S/Key authentication)
251: AC_MSG_RESULT(yes)
252: AUTH_OBJS="${AUTH_OBJS} rfc1938.o"
253: ;;
254: no) ;;
255: *) echo "Ignoring unknown argument to --with-skey: $with_skey"
256: ;;
257: esac])
258:
259: AC_ARG_WITH(opie, [ --with-opie enable OPIE support ],
260: [case $with_opie in
261: yes) if test -n "$with_skey"; then
262: AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
263: fi
1.7 millert 264: AC_DEFINE(HAVE_OPIE, 1, [Define if you use NRL OPIE.])
1.1 millert 265: AC_MSG_CHECKING(whether to try NRL OPIE authentication)
266: AC_MSG_RESULT(yes)
267: AUTH_OBJS="${AUTH_OBJS} rfc1938.o"
268: ;;
269: no) ;;
270: *) echo "Ignoring unknown argument to --with-opie: $with_opie"
271: ;;
272: esac])
273:
274: AC_ARG_WITH(long-otp-prompt, [ --with-long-otp-prompt use a two line OTP (skey/opie) prompt],
275: [case $with_long_otp_prompt in
1.7 millert 276: yes) AC_DEFINE(LONG_OTP_PROMPT, 1, [Define if you want a two line OTP (S/Key or OPIE) prompt.])
1.1 millert 277: AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
278: AC_MSG_RESULT(yes)
1.7 millert 279: long_otp_prompt=on
280: ;;
281: no) long_otp_prompt=off
1.1 millert 282: ;;
283: *) AC_MSG_ERROR(["--with-long-otp-prompt does not take an argument."])
284: ;;
285: esac])
286:
287: AC_ARG_WITH(SecurID, [ --with-SecurID enable SecurID support],
288: [case $with_SecurID in
289: no) ;;
1.7 millert 290: *) AC_DEFINE(HAVE_SECURID, 1, [Define if you use SecurID.])
1.1 millert 291: AC_MSG_CHECKING(whether to use SecurID for authentication)
292: AC_MSG_RESULT(yes)
293: with_passwd=no
294: ;;
295: esac])
296:
297: AC_ARG_WITH(fwtk, [ --with-fwtk enable FWTK AuthSRV support],
298: [case $with_fwtk in
299: no) ;;
1.7 millert 300: *) AC_DEFINE(HAVE_FWTK, 1, [Define if you use the FWTK authsrv daemon.])
1.1 millert 301: AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
302: AC_MSG_RESULT(yes)
303: with_passwd=no
304: AUTH_OBJS="fwtk.o"
1.7 millert 305: if test "$with_fwtk" != "yes"; then
306: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}"
307: CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
308: with_fwtk=yes
309: fi
1.1 millert 310: ;;
311: esac])
312:
313: AC_ARG_WITH(kerb4, [ --with-kerb4 enable kerberos v4 support],
314: [case $with_kerb4 in
315: yes) AC_MSG_CHECKING(whether to try Kerberos 4 authentication)
316: AC_MSG_RESULT(yes)
317: ;;
318: no) ;;
319: *) AC_MSG_ERROR(["--with-kerb4 does not take an argument."])
320: ;;
321: esac])
322:
323: AC_ARG_WITH(kerb5, [ --with-kerb5 enable kerberos v5 support],
324: [case $with_kerb5 in
325: yes) AC_MSG_CHECKING(whether to try Kerberos 5 authentication)
326: AC_MSG_RESULT(yes)
327: ;;
328: no) ;;
329: *) AC_MSG_ERROR(["--with-kerb5 does not take an argument."])
330: ;;
331: esac])
332:
333: AC_ARG_WITH(authenticate, [ --with-authenticate enable AIX general authentication support],
334: [case $with_authenticate in
1.7 millert 335: yes) AC_DEFINE(HAVE_AUTHENTICATE, 1, [Define if you use AIX general authentication.])
1.1 millert 336: AC_MSG_CHECKING(whether to use AIX general authentication)
337: AC_MSG_RESULT(yes)
338: with_passwd=no
339: AUTH_OBJS="aix_auth.o"
340: ;;
341: no) ;;
342: *) AC_MSG_ERROR(["--with-authenticate does not take an argument."])
343: ;;
344: esac])
345:
346: AC_ARG_WITH(pam, [ --with-pam enable PAM support],
347: [case $with_pam in
1.7 millert 348: yes) AC_DEFINE(HAVE_PAM, 1, [Define if you use PAM.])
1.1 millert 349: AC_MSG_CHECKING(whether to use PAM authentication)
350: AC_MSG_RESULT(yes)
351: with_passwd=no
352: AUTH_OBJS="pam.o"
353: ;;
354: no) ;;
355: *) AC_MSG_ERROR(["--with-pam does not take an argument."])
356: ;;
357: esac])
358:
359: AC_ARG_WITH(AFS, [ --with-AFS enable AFS support],
360: [case $with_AFS in
1.7 millert 361: yes) AC_DEFINE(HAVE_AFS, 1, [Define if you use AFS.])
1.1 millert 362: AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
363: AC_MSG_RESULT(yes)
364: AUTH_OBJS="${AUTH_OBJS} afs.o"
365: ;;
366: no) ;;
367: *) AC_MSG_ERROR(["--with-AFS does not take an argument."])
368: ;;
369: esac])
370:
371: AC_ARG_WITH(DCE, [ --with-DCE enable DCE support],
372: [case $with_DCE in
1.7 millert 373: yes) AC_DEFINE(HAVE_DCE, 1, [Define if you use OSF DCE.])
1.1 millert 374: AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
375: AC_MSG_RESULT(yes)
376: AUTH_OBJS="${AUTH_OBJS} dce.o"
377: ;;
378: no) ;;
379: *) AC_MSG_ERROR(["--with-DCE does not take an argument."])
380: ;;
381: esac])
382:
1.6 millert 383: AC_ARG_WITH(logincap, [ --with-logincap enable BSD login class support],
1.5 millert 384: [case $with_logincap in
1.6 millert 385: yes|no) ;;
386: *) AC_MSG_ERROR(["--with-logincap does not take an argument."])
387: ;;
388: esac])
389:
390: AC_ARG_WITH(bsdauth, [ --with-bsdauth enable BSD authentication support],
391: [case $with_bsdauth in
392: yes) with_logincap=yes
1.5 millert 393: ;;
394: no) ;;
1.6 millert 395: *) AC_MSG_ERROR(["--with-bsdauth does not take an argument."])
1.5 millert 396: ;;
397: esac])
398:
1.1 millert 399: AC_MSG_CHECKING(whether to lecture users the first time they run sudo)
400: AC_ARG_WITH(lecture, [ --without-lecture don't print lecture for first-time sudoer],
401: [case $with_lecture in
1.7 millert 402: yes|short) lecture=on
1.1 millert 403: ;;
1.7 millert 404: no|none) lecture=off
1.1 millert 405: ;;
406: *) AC_MSG_ERROR(["unknown argument to --with-lecture: $with_lecture"])
407: ;;
1.7 millert 408: esac])
409: if test "$lecture" = "on"; then
410: AC_MSG_RESULT(yes)
411: else
412: AC_DEFINE(NO_LECTURE, 1, [Define if you don't want users to get the lecture the first they user sudo.])
413: AC_MSG_RESULT(no)
414: fi
1.1 millert 415:
416: AC_MSG_CHECKING(whether sudo should log via syslog or to a file by default)
417: AC_ARG_WITH(logging, [ --with-logging log via syslog, file, or both],
418: [case $with_logging in
419: yes) AC_MSG_ERROR(["must give --with-logging an argument."])
420: ;;
421: no) AC_MSG_ERROR(["--without-logging not supported."])
422: ;;
1.7 millert 423: syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
1.1 millert 424: AC_MSG_RESULT(syslog)
425: ;;
426: file) AC_DEFINE(LOGGING, SLOG_FILE)
427: AC_MSG_RESULT(file)
428: ;;
429: both) AC_DEFINE(LOGGING, SLOG_BOTH)
430: AC_MSG_RESULT(both)
431: ;;
432: *) AC_MSG_ERROR(["unknown argument to --with-logging: $with_logging"])
433: ;;
434: esac], [AC_DEFINE(LOGGING, SLOG_SYSLOG) AC_MSG_RESULT(syslog)])
435:
436: AC_MSG_CHECKING(which syslog facility sudo should log with)
1.7 millert 437: AC_ARG_WITH(logfac, [ --with-logfac syslog facility to log with (default is "local2")],
1.1 millert 438: [case $with_logfac in
439: yes) AC_MSG_ERROR(["must give --with-logfac an argument."])
440: ;;
441: no) AC_MSG_ERROR(["--without-logfac not supported."])
442: ;;
1.7 millert 443: authpriv|auth|daemon|user|local0|local1|local2|local3|local4|local5|local6|local7) logfac=$with_logfac
1.1 millert 444: ;;
445: *) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
446: ;;
1.7 millert 447: esac])
448: AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
449: AC_MSG_RESULT($logfac)
1.1 millert 450:
451: AC_MSG_CHECKING(at which syslog priority to log commands)
1.7 millert 452: AC_ARG_WITH(goodpri, [ --with-goodpri syslog priority for commands (def is "notice")],
1.1 millert 453: [case $with_goodpri in
454: yes) AC_MSG_ERROR(["must give --with-goodpri an argument."])
455: ;;
456: no) AC_MSG_ERROR(["--without-goodpri not supported."])
457: ;;
1.7 millert 458: alert|crit|debug|emerg|err|info|notice|warning)
459: goodpri=$with_goodpri
1.1 millert 460: ;;
461: *) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
462: ;;
1.7 millert 463: esac])
464: AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
465: AC_MSG_RESULT($goodpri)
1.1 millert 466:
467: AC_MSG_CHECKING(at which syslog priority to log failures)
1.7 millert 468: AC_ARG_WITH(badpri, [ --with-badpri syslog priority for failures (def is "alert")],
1.1 millert 469: [case $with_badpri in
470: yes) AC_MSG_ERROR(["must give --with-badpri an argument."])
471: ;;
472: no) AC_MSG_ERROR(["--without-badpri not supported."])
473: ;;
1.7 millert 474: alert|crit|debug|emerg|err|info|notice|warning)
475: badpri=$with_badpri
1.1 millert 476: ;;
477: *) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
478: ;;
1.7 millert 479: esac])
480: AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
1.14 ! millert 481: AC_MSG_RESULT($badpri)
1.1 millert 482:
483: AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file],
484: [case $with_logpath in
485: yes) AC_MSG_ERROR(["must give --with-logpath an argument."])
486: ;;
487: no) AC_MSG_ERROR(["--without-logpath not supported."])
488: ;;
489: esac])
490:
491: AC_MSG_CHECKING(how long a line in the log file should be)
492: AC_ARG_WITH(loglen, [ --with-loglen maximum length of a log file line (default is 80)],
493: [case $with_loglen in
494: yes) AC_MSG_ERROR(["must give --with-loglen an argument."])
495: ;;
496: no) AC_MSG_ERROR(["--without-loglen not supported."])
497: ;;
1.7 millert 498: [[0-9]]*) loglen=$with_loglen
1.1 millert 499: ;;
500: *) AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
501: ;;
1.7 millert 502: esac])
503: AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
504: AC_MSG_RESULT($loglen)
1.1 millert 505:
506: AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
507: AC_ARG_WITH(ignore-dot, [ --with-ignore-dot ignore '.' in the PATH],
508: [case $with_ignore_dot in
1.7 millert 509: yes) ignore_dot=on
1.1 millert 510: ;;
1.7 millert 511: no) ignore_dot=off
1.1 millert 512: ;;
513: *) AC_MSG_ERROR(["--with-ignore-dot does not take an argument."])
514: ;;
1.7 millert 515: esac])
516: if test "$ignore_dot" = "on"; then
517: AC_DEFINE(IGNORE_DOT_PATH, 1, [Define if you want to ignore '.' and empty \$PATH elements])
518: AC_MSG_RESULT(yes)
519: else
520: AC_MSG_RESULT(no)
521: fi
1.1 millert 522:
523: AC_MSG_CHECKING(whether to send mail when a user is not in sudoers)
524: AC_ARG_WITH(mail-if-no-user, [ --without-mail-if-no-user do not send mail if user not in sudoers],
525: [case $with_mail_if_no_user in
1.7 millert 526: yes) mail_no_user=on
1.1 millert 527: ;;
1.7 millert 528: no) mail_no_user=off
1.1 millert 529: ;;
1.7 millert 530: *) AC_MSG_ERROR(["--with-mail-if-no-user does not take an argument."])
1.1 millert 531: ;;
1.7 millert 532: esac])
533: if test "$mail_no_user" = "on"; then
534: AC_DEFINE(SEND_MAIL_WHEN_NO_USER, 1, [Define to send mail when the user is not in the sudoers file.])
535: AC_MSG_RESULT(yes)
536: else
537: AC_MSG_RESULT(no)
538: fi
1.1 millert 539:
540: AC_MSG_CHECKING(whether to send mail when user listed but not for this host)
541: AC_ARG_WITH(mail-if-no-host, [ --with-mail-if-no-host send mail if user in sudoers but not for this host],
542: [case $with_mail_if_no_host in
1.7 millert 543: yes) mail_no_host=on
1.1 millert 544: ;;
1.7 millert 545: no) mail_no_host=off
1.1 millert 546: ;;
1.7 millert 547: *) AC_MSG_ERROR(["--with-mail-if-no-host does not take an argument."])
1.1 millert 548: ;;
1.7 millert 549: esac])
550: if test "$mail_no_host" = "on"; then
1.14 ! millert 551: AC_DEFINE(SEND_MAIL_WHEN_NO_HOST, 1, [Define to send mail when the user is not allowed to run sudo on this host.])
1.7 millert 552: AC_MSG_RESULT(yes)
553: else
554: AC_MSG_RESULT(no)
555: fi
1.1 millert 556:
557: AC_MSG_CHECKING(whether to send mail when a user tries a disallowed command)
558: AC_ARG_WITH(mail-if-noperms, [ --with-mail-if-noperms send mail if user not allowed to run command],
559: [case $with_mail_if_noperms in
1.7 millert 560: yes) mail_noperms=on
561: ;;
562: no) mail_noperms=off
563: ;;
564: *) AC_MSG_ERROR(["--with-mail-if-noperms does not take an argument."])
565: ;;
566: esac])
567: if test "$mail_noperms" = "on"; then
1.14 ! millert 568: AC_DEFINE(SEND_MAIL_WHEN_NOT_OK, 1, [Define to send mail when the user is not allowed to run a command.])
1.7 millert 569: AC_MSG_RESULT(yes)
570: else
571: AC_MSG_RESULT(no)
572: fi
573:
574: AC_MSG_CHECKING(who should get the mail that sudo sends)
575: AC_ARG_WITH(mailto, [ --with-mailto who should get sudo mail (default is "root")],
576: [case $with_mailto in
577: yes) AC_MSG_ERROR(["must give --with-mailto an argument."])
578: ;;
579: no) AC_MSG_ERROR(["--without-mailto not supported."])
580: ;;
581: *) mailto=$with_mailto
582: ;;
583: esac])
584: AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
585: AC_MSG_RESULT([$mailto])
586:
587: AC_ARG_WITH(mailsubject, [ --with-mailsubject subject of sudo mail],
588: [case $with_mailsubject in
589: yes) AC_MSG_ERROR(["must give --with-mailsubject an argument."])
1.1 millert 590: ;;
1.7 millert 591: no) echo "Sorry, --without-mailsubject not supported."
1.1 millert 592: ;;
1.7 millert 593: *) mailsub="$with_mailsubject"
594: AC_MSG_CHECKING(sudo mail subject)
595: AC_MSG_RESULT([Using alert mail subject: $mailsub])
1.1 millert 596: ;;
1.7 millert 597: esac])
598: AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
1.1 millert 599:
600: AC_MSG_CHECKING(for bad password prompt)
601: AC_ARG_WITH(passprompt, [ --with-passprompt default password prompt],
602: [case $with_passprompt in
603: yes) AC_MSG_ERROR(["must give --with-passprompt an argument."])
604: ;;
605: no) echo "Sorry, --without-passprompt not supported."
606: ;;
1.7 millert 607: *) passprompt="$with_passprompt"
608: esac])
609: AC_MSG_RESULT($passprompt)
610: AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
1.1 millert 611:
612: AC_MSG_CHECKING(for bad password message)
613: AC_ARG_WITH(badpass-message, [ --with-badpass-message message the user sees when the password is wrong],
614: [case $with_badpass_message in
615: yes) AC_MSG_ERROR(["Must give --with-badpass-message an argument."])
616: ;;
617: no) echo "Sorry, --without-badpass-message not supported."
618: ;;
1.7 millert 619: *) badpass_message="$with_badpass_message"
1.1 millert 620: ;;
1.7 millert 621: esac])
622: AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
623: AC_MSG_RESULT([$badpass_message])
1.1 millert 624:
625: AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
626: AC_ARG_WITH(fqdn, [ --with-fqdn expect fully qualified hosts in sudoers],
627: [case $with_fqdn in
1.7 millert 628: yes) fqdn=on
1.1 millert 629: ;;
1.7 millert 630: no) fqdn=off
1.1 millert 631: ;;
632: *) AC_MSG_ERROR(["--with-fqdn does not take an argument."])
633: ;;
1.7 millert 634: esac])
635: if test "$fqdn" = "on"; then
636: AC_DEFINE(FQDN, 1, [Define if you want to require fully qualified hosts in sudoers.])
637: AC_MSG_RESULT(yes)
638: else
639: AC_MSG_RESULT(no)
640: fi
1.1 millert 641:
642: AC_ARG_WITH(timedir, [ --with-timedir path to the sudo timestamp dir],
643: [case $with_timedir in
644: yes) AC_MSG_ERROR(["must give --with-timedir an argument."])
645: ;;
646: no) AC_MSG_ERROR(["--without-timedir not supported."])
647: ;;
648: esac])
649:
650: AC_ARG_WITH(sendmail, [ --with-sendmail=path set path to sendmail
651: --without-sendmail do not send mail at all],
652: [case $with_sendmail in
653: yes) with_sendmail=""
654: ;;
655: no) ;;
1.7 millert 656: *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
1.1 millert 657: ;;
658: esac])
659:
660: AC_ARG_WITH(sudoers-mode, [ --with-sudoers-mode mode of sudoers file (defaults to 0440)],
661: [case $with_sudoers_mode in
662: yes) AC_MSG_ERROR(["must give --with-sudoers-mode an argument."])
663: ;;
664: no) AC_MSG_ERROR(["--without-sudoers-mode not supported."])
665: ;;
666: [[1-9]]*) SUDOERS_MODE=0${with_sudoers_mode}
667: ;;
668: 0*) SUDOERS_MODE=$with_sudoers_mode
669: ;;
1.14 ! millert 670: *) AC_MSG_ERROR(["you must use an octal mode, not a name."])
1.1 millert 671: ;;
672: esac])
673:
674: AC_ARG_WITH(sudoers-uid, [ --with-sudoers-uid uid that owns sudoers file (defaults to 0)],
675: [case $with_sudoers_uid in
676: yes) AC_MSG_ERROR(["must give --with-sudoers-uid an argument."])
677: ;;
678: no) AC_MSG_ERROR(["--without-sudoers-uid not supported."])
679: ;;
680: [[0-9]]*) SUDOERS_UID=$with_sudoers_uid
681: ;;
1.14 ! millert 682: *) AC_MSG_ERROR(["you must use an unsigned numeric uid, not a name."])
1.1 millert 683: ;;
684: esac])
685:
686: AC_ARG_WITH(sudoers-gid, [ --with-sudoers-gid gid that owns sudoers file (defaults to 0)],
687: [case $with_sudoers_gid in
688: yes) AC_MSG_ERROR(["must give --with-sudoers-gid an argument."])
689: ;;
690: no) AC_MSG_ERROR(["--without-sudoers-gid not supported."])
691: ;;
692: [[0-9]]*) SUDOERS_GID=$with_sudoers_gid
693: ;;
1.14 ! millert 694: *) AC_MSG_ERROR(["you must use an unsigned numeric gid, not a name."])
1.1 millert 695: ;;
696: esac])
697:
698: AC_MSG_CHECKING(for umask programs should be run with)
1.7 millert 699: AC_ARG_WITH(umask, [ --with-umask umask with which the prog should run (default is 022)
1.1 millert 700: --without-umask Preserves the umask of the user invoking sudo.],
701: [case $with_umask in
702: yes) AC_MSG_ERROR(["must give --with-umask an argument."])
703: ;;
1.7 millert 704: no) sudo_umask=0777
1.1 millert 705: ;;
1.7 millert 706: [[0-9]]*) sudo_umask=$with_umask
1.1 millert 707: ;;
708: *) AC_MSG_ERROR(["you must enter a numeric mask."])
709: ;;
1.7 millert 710: esac])
711: AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the root-run prog should use.])
712: if test "$sudo_umask" = "0777"; then
713: AC_MSG_RESULT(user)
714: else
715: AC_MSG_RESULT($sudo_umask)
716: fi
1.1 millert 717:
718: AC_MSG_CHECKING(for default user to run commands as)
1.7 millert 719: AC_ARG_WITH(runas-default, [ --with-runas-default User to run commands as (default is "root")],
1.1 millert 720: [case $with_runas_default in
721: yes) AC_MSG_ERROR(["must give --with-runas-default an argument."])
722: ;;
723: no) AC_MSG_ERROR(["--without-runas-default not supported."])
724: ;;
1.7 millert 725: *) runas_default="$with_runas_default"
1.1 millert 726: ;;
1.7 millert 727: esac])
728: AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
729: AC_MSG_RESULT([$runas_default])
1.1 millert 730:
731: AC_ARG_WITH(exempt, [ --with-exempt=group no passwd needed for users in this group],
732: [case $with_exempt in
733: yes) AC_MSG_ERROR(["must give --with-exempt an argument."])
734: ;;
735: no) AC_MSG_ERROR(["--without-exempt not supported."])
736: ;;
1.7 millert 737: *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
1.1 millert 738: AC_MSG_CHECKING(for group to be exempt from password)
739: AC_MSG_RESULT([$with_exempt])
740: ;;
741: esac])
742:
743: AC_MSG_CHECKING(for editor that visudo should use)
744: AC_ARG_WITH(editor, [ --with-editor=path Default editor for visudo (defaults to vi)],
745: [case $with_editor in
746: yes) AC_MSG_ERROR(["must give --with-editor an argument."])
747: ;;
748: no) AC_MSG_ERROR(["--without-editor not supported."])
749: ;;
1.7 millert 750: *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
1.1 millert 751: AC_MSG_RESULT([$with_editor])
752: ;;
753: esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
754:
755: AC_MSG_CHECKING(whether to obey EDITOR and VISUAL environment variables)
756: AC_ARG_WITH(env-editor, [ --with-env-editor Use the environment variable EDITOR for visudo],
757: [case $with_env_editor in
1.7 millert 758: yes) env_editor=on
1.1 millert 759: ;;
1.7 millert 760: no) env_editor=off
1.1 millert 761: ;;
762: *) AC_MSG_ERROR(["--with-env-editor does not take an argument."])
763: ;;
1.7 millert 764: esac])
765: if test "$env_editor" = "on"; then
766: AC_DEFINE(ENV_EDITOR, 1, [Define if you want visudo to honor the EDITOR and VISUAL env variables.])
767: AC_MSG_RESULT(yes)
768: else
769: AC_MSG_RESULT(no)
770: fi
1.1 millert 771:
772: AC_MSG_CHECKING(number of tries a user gets to enter their password)
773: AC_ARG_WITH(passwd-tries, [ --with-passwd-tries number of tries to enter password (default is 3)],
774: [case $with_passwd_tries in
1.7 millert 775: yes) ;;
1.1 millert 776: no) AC_MSG_ERROR(["--without-editor not supported."])
777: ;;
1.7 millert 778: [[1-9]]*) passwd_tries=$with_passwd_tries
1.1 millert 779: ;;
780: *) AC_MSG_ERROR(["you must enter the numer of tries, > 0"])
781: ;;
1.7 millert 782: esac])
783: AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
784: AC_MSG_RESULT($passwd_tries)
1.1 millert 785:
786: AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
1.7 millert 787: AC_ARG_WITH(timeout, [ --with-timeout minutes before sudo asks for passwd again (def is 5 minutes)],
1.14 ! millert 788: [case $with_timeout in
1.7 millert 789: yes) ;;
790: no) timeout=0
1.1 millert 791: ;;
1.7 millert 792: [[0-9]]*) timeout=$with_timeout
1.1 millert 793: ;;
794: *) AC_MSG_ERROR(["you must enter the numer of minutes."])
795: ;;
1.7 millert 796: esac])
797: AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
798: AC_MSG_RESULT($timeout)
1.1 millert 799:
800: AC_MSG_CHECKING(time in minutes after the password prompt will time out)
1.7 millert 801: AC_ARG_WITH(password-timeout, [ --with-password-timeout passwd prompt timeout in minutes (default is 5 minutes)],
1.1 millert 802: [case $with_password_timeout in
1.7 millert 803: yes) ;;
804: no) password_timeout=0
1.1 millert 805: ;;
1.7 millert 806: [[0-9]]*) password_timeout=$with_password_timeout
1.1 millert 807: ;;
808: *) AC_MSG_ERROR(["you must enter the numer of minutes."])
809: ;;
1.7 millert 810: esac])
811: AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
812: AC_MSG_RESULT($password_timeout)
1.1 millert 813:
814: AC_ARG_WITH(execv, [ --with-execv use execv() instead of execvp()],
815: [case $with_execv in
1.7 millert 816: yes) AC_MSG_CHECKING(whether to use execvp or execv)
1.1 millert 817: AC_MSG_RESULT(execv)
1.7 millert 818: AC_DEFINE(USE_EXECV, 1, [Define if you wish to use execv() instead of execvp() when running programs.])
1.1 millert 819: ;;
1.7 millert 820: no) ;;
1.1 millert 821: *) AC_MSG_ERROR(["--with-execv does not take an argument."])
822: ;;
1.7 millert 823: esac])
1.1 millert 824:
825: AC_MSG_CHECKING(whether to use per-tty ticket files)
826: AC_ARG_WITH(tty-tickets, [ --with-tty-tickets use a different ticket file for each tty],
827: [case $with_tty_tickets in
1.7 millert 828: yes) tty_tickets=on
1.1 millert 829: ;;
1.7 millert 830: no) tty_tickets=off
1.1 millert 831: ;;
832: *) AC_MSG_ERROR(["--with-tty-tickets does not take an argument."])
833: ;;
1.7 millert 834: esac])
835: if test "$tty_tickets" = "on"; then
836: AC_DEFINE(USE_TTY_TICKETS, 1, [Define if you want a different ticket file for each tty.])
837: AC_MSG_RESULT(yes)
838: else
839: AC_MSG_RESULT(no)
840: fi
1.1 millert 841:
842: AC_MSG_CHECKING(whether to include insults)
843: AC_ARG_WITH(insults, [ --with-insults insult the user for entering an incorrect password],
844: [case $with_insults in
1.7 millert 845: yes) insults=on
1.1 millert 846: with_classic_insults=yes
847: with_csops_insults=yes
848: ;;
1.7 millert 849: no) insults=off
1.1 millert 850: ;;
851: *) AC_MSG_ERROR(["--with-insults does not take an argument."])
852: ;;
1.7 millert 853: esac])
854: if test "$insults" = "on"; then
855: AC_DEFINE(USE_INSULTS, 1, [Define if you want to insult the user for entering an incorrect password.])
856: AC_MSG_RESULT(yes)
857: else
858: AC_MSG_RESULT(no)
859: fi
1.1 millert 860:
861: AC_ARG_WITH(all-insults, [ --with-all-insults include all the sudo insult sets],
862: [case $with_all_insults in
863: yes) with_classic_insults=yes
864: with_csops_insults=yes
865: with_hal_insults=yes
866: with_goons_insults=yes
867: ;;
868: no) ;;
869: *) AC_MSG_ERROR(["--with-all-insults does not take an argument."])
870: ;;
871: esac])
872:
873: AC_ARG_WITH(classic-insults, [ --with-classic-insults include the insults from the "classic" sudo],
874: [case $with_classic_insults in
1.7 millert 875: yes) AC_DEFINE(CLASSIC_INSULTS, 1, [Define if you want the insults from the "classic" version sudo.])
1.1 millert 876: ;;
877: no) ;;
878: *) AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
879: ;;
880: esac])
881:
882: AC_ARG_WITH(csops-insults, [ --with-csops-insults include CSOps insults],
883: [case $with_csops_insults in
1.7 millert 884: yes) AC_DEFINE(CSOPS_INSULTS, 1, [Define if you want insults culled from the twisted minds of CSOps.])
1.1 millert 885: ;;
886: no) ;;
887: *) AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
888: ;;
889: esac])
890:
891: AC_ARG_WITH(hal-insults, [ --with-hal-insults include 2001-like insults],
892: [case $with_hal_insults in
1.7 millert 893: yes) AC_DEFINE(HAL_INSULTS, 1, [Define if you want 2001-like insults.])
1.1 millert 894: ;;
895: no) ;;
896: *) AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
897: ;;
898: esac])
899:
1.7 millert 900: AC_ARG_WITH(goons-insults, [ --with-goons-insults include the insults from the "Goon Show"],
1.1 millert 901: [case $with_goons_insults in
1.7 millert 902: yes) AC_DEFINE(GOONS_INSULTS, 1, [Define if you want insults from the "Goon Show".])
1.1 millert 903: ;;
904: no) ;;
905: *) AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
906: ;;
907: esac])
908:
909: dnl include all insult sets on one line
1.7 millert 910: if test "$insults" = "on"; then
1.1 millert 911: AC_MSG_CHECKING(which insult sets to include)
912: i=""
913: test "$with_goons_insults" = "yes" && i="goons ${i}"
914: test "$with_hal_insults" = "yes" && i="hal ${i}"
915: test "$with_csops_insults" = "yes" && i="csops ${i}"
916: test "$with_classic_insults" = "yes" && i="classic ${i}"
917: AC_MSG_RESULT([$i])
918: fi
919:
920: AC_MSG_CHECKING(whether to override the user's path)
921: AC_ARG_WITH(secure-path, [ --with-secure-path override the user's path with a builtin one],
922: [case $with_secure_path in
1.7 millert 923: yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc", [Define to override the user's path with a builtin one.])
1.1 millert 924: AC_MSG_RESULT([:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc])
925: ;;
926: no) AC_MSG_RESULT(no)
927: ;;
928: *) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
929: AC_MSG_RESULT([$with_secure_path])
930: ;;
931: esac], AC_MSG_RESULT(no))
932:
933: AC_MSG_CHECKING(whether to get ip addresses from the network interfaces)
934: AC_ARG_WITH(interfaces, [ --without-interfaces don't try to read the ip addr of ether interfaces],
935: [case $with_interfaces in
936: yes) AC_MSG_RESULT(yes)
937: ;;
1.7 millert 938: no) AC_DEFINE(STUB_LOAD_INTERFACES, 1, [Define if the code in interfaces.c does not compile for you.])
1.1 millert 939: AC_MSG_RESULT(no)
940: ;;
941: *) AC_MSG_ERROR(["--with-interfaces does not take an argument."])
942: ;;
943: esac], AC_MSG_RESULT(yes))
944:
1.14 ! millert 945: AC_MSG_CHECKING(whether stow should be used)
! 946: AC_ARG_WITH(stow, [ --with-stow properly handle GNU stow packaging],
! 947: [case $with_stow in
! 948: yes) AC_MSG_RESULT(yes)
! 949: AC_DEFINE(USE_STOW, 1, [Define if you use stow packaging.])
! 950: ;;
! 951: no) AC_MSG_RESULT(no)
! 952: ;;
! 953: *) AC_MSG_ERROR(["--with-stow does not take an argument."])
! 954: ;;
! 955: esac], AC_MSG_RESULT(no))
! 956:
1.1 millert 957: dnl
958: dnl Options for --enable
959: dnl
960:
961: AC_MSG_CHECKING(whether to do user authentication by default)
962: AC_ARG_ENABLE(authentication,
963: [ --disable-authentication
964: Do not require authentication by default],
965: [ case "$enableval" in
966: yes) AC_MSG_RESULT(yes)
967: ;;
968: no) AC_MSG_RESULT(no)
1.7 millert 969: AC_DEFINE(NO_AUTHENTICATION, 1, [Define if you don't want sudo to prompt for a password by default.])
1.1 millert 970: ;;
971: *) AC_MSG_RESULT(no)
972: echo "Ignoring unknown argument to --enable-authentication: $enableval"
973: ;;
974: esac
975: ], AC_MSG_RESULT(yes))
1.9 millert 976:
1.10 millert 977: AC_MSG_CHECKING(whether to disable running the mailer as root)
978: AC_ARG_ENABLE(root-mailer,
979: [ --disable-root-mailer Don't run the mailer as root, run as the user],
980: [ case "$enableval" in
981: yes) AC_MSG_RESULT(no)
982: ;;
983: no) AC_MSG_RESULT(yes)
984: AC_DEFINE(NO_ROOT_MAILER, 1, [Define to avoid runing the mailer as root.])
985: ;;
986: *) AC_MSG_RESULT(no)
987: echo "Ignoring unknown argument to --enable-root-mailer: $enableval"
988: ;;
989: esac
990: ], AC_MSG_RESULT(no))
991:
1.11 millert 992: AC_ARG_ENABLE(setreuid,
993: [ --disable-setreuid Don't try to use the setreuid() function],
994: [ case "$enableval" in
1.14 ! millert 995: no) SKIP_SETREUID=yes
! 996: ;;
! 997: *) ;;
! 998: esac
! 999: ])
! 1000:
! 1001: AC_ARG_ENABLE(setresuid,
! 1002: [ --disable-setresuid Don't try to use the setresuid() function],
! 1003: [ case "$enableval" in
! 1004: no) SKIP_SETRESUID=yes
1.11 millert 1005: ;;
1006: *) ;;
1007: esac
1008: ])
1009:
1.9 millert 1010: AC_MSG_CHECKING(whether to disable use of POSIX saved ids)
1011: AC_ARG_ENABLE(saved-ids,
1.10 millert 1012: [ --disable-saved-ids Don't try to use POSIX saved ids],
1.9 millert 1013: [ case "$enableval" in
1014: yes) AC_MSG_RESULT(no)
1015: ;;
1016: no) AC_MSG_RESULT(yes)
1017: AC_DEFINE(NO_SAVED_IDS, 1, [Define to avoid using POSIX saved ids.])
1018: ;;
1019: *) AC_MSG_RESULT(no)
1020: echo "Ignoring unknown argument to --enable-saved-ids: $enableval"
1021: ;;
1022: esac
1023: ], AC_MSG_RESULT(no))
1.1 millert 1024:
1025: AC_MSG_CHECKING(whether to disable shadow password support)
1026: AC_ARG_ENABLE(shadow,
1027: [ --disable-shadow Never use shadow passwords],
1028: [ case "$enableval" in
1029: yes) AC_MSG_RESULT(no)
1030: ;;
1031: no) AC_MSG_RESULT(yes)
1032: CHECKSHADOW="false"
1033: ;;
1034: *) AC_MSG_RESULT(no)
1035: echo "Ignoring unknown argument to --enable-shadow: $enableval"
1036: ;;
1037: esac
1038: ], AC_MSG_RESULT(no))
1039:
1040: AC_MSG_CHECKING(whether root should be allowed to use sudo)
1041: AC_ARG_ENABLE(root-sudo,
1.10 millert 1042: [ --disable-root-sudo Don't allow root to run sudo],
1.1 millert 1043: [ case "$enableval" in
1044: yes) AC_MSG_RESULT(yes)
1045: ;;
1.7 millert 1046: no) AC_DEFINE(NO_ROOT_SUDO, 1, [Define if root should not be allowed to use sudo.])
1.1 millert 1047: AC_MSG_RESULT(no)
1048: ;;
1049: *) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
1050: ;;
1051: esac
1052: ], AC_MSG_RESULT(yes))
1053:
1054: AC_MSG_CHECKING(whether to log the hostname in the log file)
1055: AC_ARG_ENABLE(log-host,
1056: [ --enable-log-host Log the hostname in the log file],
1057: [ case "$enableval" in
1058: yes) AC_MSG_RESULT(yes)
1.7 millert 1059: AC_DEFINE(HOST_IN_LOG, 1, [Define if you want the hostname to be entered into the log file.])
1.1 millert 1060: ;;
1061: no) AC_MSG_RESULT(no)
1062: ;;
1063: *) AC_MSG_RESULT(no)
1064: echo "Ignoring unknown argument to --enable-log-host: $enableval"
1065: ;;
1066: esac
1067: ], AC_MSG_RESULT(no))
1068:
1069: AC_MSG_CHECKING(whether to invoke a shell if sudo is given no arguments)
1070: AC_ARG_ENABLE(noargs-shell,
1071: [ --enable-noargs-shell If sudo is given no arguments run a shell],
1072: [ case "$enableval" in
1073: yes) AC_MSG_RESULT(yes)
1.7 millert 1074: AC_DEFINE(SHELL_IF_NO_ARGS, 1, [Define if you want sudo to start a shell if given no arguments.])
1.1 millert 1075: ;;
1076: no) AC_MSG_RESULT(no)
1077: ;;
1078: *) AC_MSG_RESULT(no)
1079: echo "Ignoring unknown argument to --enable-noargs-shell: $enableval"
1080: ;;
1081: esac
1082: ], AC_MSG_RESULT(no))
1083:
1084: AC_MSG_CHECKING(whether to set \$HOME to target user in shell mode)
1085: AC_ARG_ENABLE(shell-sets-home,
1086: [ --enable-shell-sets-home
1.7 millert 1087: set $HOME to target user in shell mode],
1.1 millert 1088: [ case "$enableval" in
1089: yes) AC_MSG_RESULT(yes)
1.7 millert 1090: AC_DEFINE(SHELL_SETS_HOME, 1, [Define if you want sudo to set $HOME in shell mode.])
1.1 millert 1091: ;;
1092: no) AC_MSG_RESULT(no)
1093: ;;
1094: *) AC_MSG_RESULT(no)
1095: echo "Ignoring unknown argument to --enable-shell-sets-home: $enableval"
1096: ;;
1097: esac
1098: ], AC_MSG_RESULT(no))
1099:
1100: AC_MSG_CHECKING(whether to disable 'command not found' messages)
1101: AC_ARG_ENABLE(path_info,
1102: [ --disable-path-info Print 'command not allowed' not 'command not found'],
1103: [ case "$enableval" in
1104: yes) AC_MSG_RESULT(no)
1105: ;;
1106: no) AC_MSG_RESULT(yes)
1.7 millert 1107: AC_DEFINE(DONT_LEAK_PATH_INFO, 1, [Define if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.])
1.1 millert 1108: ;;
1109: *) AC_MSG_RESULT(no)
1110: echo "Ignoring unknown argument to --enable-path-info: $enableval"
1111: ;;
1112: esac
1113: ], AC_MSG_RESULT(no))
1114:
1115: dnl
1116: dnl If we don't have egrep we can't do anything...
1117: dnl
1118: AC_CHECK_PROG(EGREPPROG, egrep, egrep, )
1119: if test -z "$EGREPPROG"; then
1120: echo "Sorry, configure requires egrep to run."
1121: exit
1122: fi
1123:
1124: dnl
1.7 millert 1125: dnl Prevent configure from adding the -g flag unless in devel mode
1126: dnl
1127: if test "$with_devel" != "yes"; then
1128: ac_cv_prog_cc_g=no
1129: fi
1130:
1131: dnl
1.1 millert 1132: dnl C compiler checks
1133: dnl XXX - the cross-compiler check gets false positives so we override it
1134: dnl
1.7 millert 1135: AC_ISC_POSIX
1.1 millert 1136: ac_cv_prog_cc_cross="no"
1137: cross_compiling="no"
1.7 millert 1138: AC_PROG_CC_STDC
1.1 millert 1139: ac_cv_prog_cc_cross="no"
1140: cross_compiling="no"
1141: AC_PROG_CPP
1142:
1143: dnl
1144: dnl It is now safe to modify CFLAGS and CPPFLAGS
1145: dnl
1146: if test "$with_devel" = "yes" -a -n "$GCC"; then
1147: CFLAGS="${CFLAGS} -Wall"
1148: fi
1149:
1150: dnl
1151: dnl Find programs we use
1152: dnl
1153: AC_CHECK_PROG(UNAMEPROG, uname, uname, )
1154: AC_CHECK_PROG(TRPROG, tr, tr, )
1155: AC_CHECK_PROG(SEDPROG, sed, sed, )
1156: AC_CHECK_PROG(NROFFPROG, nroff, nroff, )
1157: if test -z "$NROFFPROG"; then
1158: MANTYPE="cat"
1.5 millert 1159: mansrcdir='$(srcdir)'
1.1 millert 1160: fi
1161:
1162: dnl
1163: dnl What kind of beastie are we being run on?
1164: dnl Barf if config.cache was generated on another host.
1165: dnl
1166: AC_CANONICAL_HOST
1167: if test -n "$sudo_cv_prev_host"; then
1168: if test "$sudo_cv_prev_host" != "$host"; then
1169: echo ""
1170: echo "Fatal Error: config.cache exists from another platform!"
1171: echo "Please remove it and re-run configure."
1172: echo ""
1173: exit 1
1174: else
1175: AC_MSG_CHECKING(previous host type)
1176: AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1177: echo $sudo_cv_prev_host
1178: fi
1179: else
1180: # this will produce no output since there is no cached value
1181: AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1182: fi
1183:
1184: dnl
1185: dnl We want to be able to differentiate between different rev's
1186: dnl
1187: if test -n "$host_os"; then
1188: OS=`echo $host_os | sed 's/[[0-9]].*//'`
1189: OSREV=`echo $host_os | sed 's/^[[^0-9]]*\([[0-9]][[0-9]]*\).*$/\1/'`
1190: else
1191: OS="unknown"
1192: OSREV=0
1193: fi
1194:
1195: case "$host" in
1196: *-*-sunos4*)
1197: # getcwd(3) opens a pipe to getpwd(1)!?!
1198: BROKEN_GETCWD=1
1199:
1200: # system headers lack prototypes but gcc helps...
1201: if test -n "$GCC"; then
1202: CPPFLAGS="${CPPFLAGS} -D__USE_FIXED_PROTOTYPES__"
1203: fi
1204:
1205: # check for password adjunct functions (shadow passwords)
1206: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1207: AC_CHECK_FUNCS(getpwanam issecure, , [break])
1208: AH_TEMPLATE([HAVE_GETPWANAM], [Define if you have the `getpwanam' function. (SunOS 4.x shadow passwords)])
1209: AH_TEMPLATE([HAVE_ISSECURE], [Define if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
1.1 millert 1210: CHECKSHADOW="false"
1211: fi
1212: ;;
1213: *-*-solaris2*)
1214: # To get the crypt(3) prototype (so we pass -Wall)
1215: CPPFLAGS="${CPPFLAGS} -D__EXTENSIONS__"
1216: # AFS support needs -lucb
1217: if test "$with_AFS" = "yes"; then
1218: AFS_LIBS="-lc -lucb"
1219: fi
1.7 millert 1220: test -n "$mansectsu" || mansectsu=1m
1221: test -n "$mansectform" || mansectform=4
1.1 millert 1222: ;;
1223: *-*-aix*)
1224: # To get all prototypes (so we pass -Wall)
1225: CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE"
1.7 millert 1226: SUDO_DEFINE(_ALL_SOURCE)
1.1 millert 1227: SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp"
1228: ;;
1229: *-*-hiuxmpp*)
1230: if test "$CHECKSHADOW" = "true"; then
1231: AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"; SECUREWARE=1]))
1232: CHECKSHADOW="false"
1233: fi
1.7 millert 1234: test -n "$mansectsu" || mansectsu=1m
1235: test -n "$mansectform" || mansectform=4
1.1 millert 1236: ;;
1237: *-*-hpux1[[0-9]]*)
1238: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1239: AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) AC_CHECK_LIB(sec, iscomsec, AC_DEFINE(HAVE_ISCOMSEC, 1, [Define if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1])
1.1 millert 1240: CHECKSHADOW="false"
1241: fi
1242:
1243: # AFS support needs -lBSD
1244: if test "$with_AFS" = "yes"; then
1245: AFS_LIBS="-lc -lBSD"
1246: fi
1.7 millert 1247: test -n "$mansectsu" || mansectsu=1m
1248: test -n "$mansectform" || mansectform=4
1.1 millert 1249: ;;
1250: *-*-hpux9*)
1.7 millert 1251: AC_DEFINE(BROKEN_SYSLOG, 1, [Define if the `syslog' function returns a non-zero int to denote failure.])
1.1 millert 1252:
1253: if test "$CHECKSHADOW" = "true"; then
1254: AC_CHECK_FUNCS(getspwuid)
1.7 millert 1255: AH_TEMPLATE([HAVE_GETSPWUID], [Define if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
1.1 millert 1256: CHECKSHADOW="false"
1257: fi
1258:
1259: # DCE support (requires ANSI C compiler)
1260: if test "$with_DCE" = "yes"; then
1261: # order of libs in 9.X is important. -lc_r must be last
1262: SUDO_LIBS="${SUDO_LIBS} -ldce -lM -lc_r"
1263: LIBS="${LIBS} -ldce -lM -lc_r"
1.3 millert 1264: CPPFLAGS="${CPPFLAGS} -D_REENTRANT -I/usr/include/reentrant"
1.1 millert 1265: fi
1266:
1267: # AFS support needs -lBSD
1268: if test "$with_AFS" = "yes"; then
1269: AFS_LIBS="-lc -lBSD"
1270: fi
1.7 millert 1271: test -n "$mansectsu" || mansectsu=1m
1272: test -n "$mansectform" || mansectform=4
1.1 millert 1273: ;;
1274: *-*-hpux*)
1275: AC_DEFINE(BROKEN_SYSLOG)
1276:
1277: # Not sure if setuid binaries are safe in < 9.x
1278: if test -n "$GCC"; then
1279: SUDO_LDFLAGS="${SUDO_LDFLAGS} -static"
1280: else
1281: SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-a,archive"
1282: fi
1283:
1284: # AFS support needs -lBSD
1285: if test "$with_AFS" = "yes"; then
1286: AFS_LIBS="-lc -lBSD"
1287: fi
1.7 millert 1288: test -n "$mansectsu" || mansectsu=1m
1289: test -n "$mansectform" || mansectform=4
1.1 millert 1290: ;;
1291: *-dec-osf*)
1292: # ignore envariables wrt dynamic lib path
1293: SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-no_library_replacement"
1294:
1295: AC_MSG_CHECKING(whether to disable sia support on Digital UNIX)
1296: AC_ARG_ENABLE(sia,
1297: [ --disable-sia Never use SIA on Digital UNIX],
1298: [ case "$enableval" in
1299: yes) AC_MSG_RESULT(no)
1300: ;;
1301: no) AC_MSG_RESULT(yes)
1302: CHECKSIA=false
1303: ;;
1304: *) AC_MSG_RESULT(no)
1305: echo "Ignoring unknown argument to --enable-sia: $enableval"
1306: ;;
1307: esac
1308: ], AC_MSG_RESULT(no))
1309:
1310: # use SIA by default, if we have it, else SecureWare
1311: # unless overridden on the command line
1312: if test "$CHECKSIA" = "true"; then
1.14 ! millert 1313: AC_CHECK_FUNC(sia_ses_init, [AC_DEFINE(HAVE_SIA, 1, [Define if you use SIA.])] [
1.1 millert 1314: if test -n "$with_skey" -o -n "$with_opie" -o -n "$with_otp_only" -o -n "$with_long_otp_prompt" -o -n "$with_SecurID" -o -n "$with_fwtk" -o -n "$with_kerb4" -o -n "$with_kerb5" -o -n "$with_pam" -o -n "$with_AFS" -o -n "$with_DCE"; then
1315: AC_MSG_ERROR(["you cannot mix SIA and other authentication schemes. You can turn off SIA support via the --disable-sia option"])
1316: fi]; CHECKSHADOW=false)
1317: fi
1318: if test "$CHECKSHADOW" = "true"; then
1319: AC_CHECK_LIB(security, getprpwnam, SECUREWARE=1)
1320: CHECKSHADOW="false"
1321: fi
1322:
1323: if test -n "$SECUREWARE"; then
1.7 millert 1324: AC_DEFINE(HAVE_GETPRPWNAM, 1, [Define if you have the `getprpwnam' function. (SecureWare-style shadow passwords)])
1.1 millert 1325: # -ldb includes bogus versions of snprintf/vsnprintf
1.7 millert 1326: AC_CHECK_FUNCS(snprintf, , [NEED_SNPRINTF=1])
1327: AC_CHECK_FUNCS(vsnprintf, , [NEED_SNPRINTF=1])
1.1 millert 1328: # 4.x and higher need -ldb too...
1329: AC_CHECK_LIB(db, dbopen, [SUDO_LIBS="${SUDO_LIBS} -lsecurity -ldb -laud -lm"; LIBS="${LIBS} -lsecurity -ldb -laud -lm"], [SUDO_LIBS="${SUDO_LIBS} -lsecurity -ldb -laud -lm"; LIBS="${LIBS} -lsecurity -ldb -laud -lm"])
1330: AC_CHECK_FUNCS(dispcrypt)
1331: AC_MSG_CHECKING([for broken /usr/include/prot.h])
1332: AC_TRY_COMPILE([
1333: #include <sys/types.h>
1334: #include <sys/security.h>
1335: #include <prot.h>
1336: ], [exit(0);], AC_MSG_RESULT(no),
1337: [AC_MSG_RESULT([yes, fixing locally])
1338: sed 's:<acl.h>:<sys/acl.h>:g' < /usr/include/prot.h > prot.h
1339: ])
1.7 millert 1340: elif test "$CHECKSIA" = "true"; then
1.1 millert 1341: with_passwd=no
1342: AUTH_OBJS="sia.o"
1343: fi
1.7 millert 1344: test -n "$mansectsu" || mansectsu=8
1345: test -n "$mansectform" || mansectform=4
1.1 millert 1346: ;;
1347: *-*-irix*)
1348: CPPFLAGS="${CPPFLAGS} -D_BSD_TYPES"
1349: if test -z "$NROFFPROG"; then
1.14 ! millert 1350: MAN_POSTINSTALL=' /bin/rm -f $(mandirsu)/sudo.$(mansectsu).z $(mandirsu)/visudo.$(mansectsu).z $(mandirform)/sudoers.$(mansectform).z ; /usr/bin/pack $(mandirsu)/sudo.$(mansectsu) $(mandirsu)/visudo.$(mansectsu) $(mandirform)/sudoers.$(mansectform)'
1.1 millert 1351: if test "$prefix" = "/usr/local" -a "$mandir" = '$(prefix)/man'; then
1352: if test -d /usr/share/catman/local; then
1353: mandir="/usr/share/catman/local"
1354: else
1355: mandir="/usr/catman/local"
1356: fi
1357: fi
1358: else
1359: if test "$prefix" = "/usr/local" -a "$mandir" = '$(prefix)/man'; then
1360: if test -d "/usr/share/man/local"; then
1361: mandir="/usr/share/man/local"
1362: else
1363: mandir="/usr/man/local"
1364: fi
1365: fi
1366: fi
1367: # IRIX <= 4 needs -lsun
1368: if test "$OSREV" -le 4; then
1369: AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
1370: fi
1.7 millert 1371: test -n "$mansectsu" || mansectsu=1m
1372: test -n "$mansectform" || mansectform=4
1.1 millert 1373: ;;
1374: *-*-linux*)
1375: # Some Linux versions need to link with -lshadow
1376: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1377: AC_CHECK_FUNCS(getspnam, , [AC_CHECK_LIB(shadow, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lshadow"; LIBS="${LIBS} -lshadow"])])
1.1 millert 1378: CHECKSHADOW="false"
1379: fi
1380: ;;
1381: *-convex-bsd*)
1.7 millert 1382: SUDO_DEFINE(_CONVEX_SOURCE)
1.1 millert 1383: if test -z "$GCC"; then
1384: CFLAGS="${CFLAGS} -D__STDC__"
1385: fi
1386:
1387: if test "$CHECKSHADOW" = "true"; then
1388: AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lprot"; LIBS="${LIBS} -lprot"; OSDEFS="${OSDEFS} -D_AUDIT -D_ACL -DSecureWare"; SECUREWARE=1])
1389: CHECKSHADOW="false"
1390: fi
1391: ;;
1392: *-*-ultrix*)
1393: OS="ultrix"
1394: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1395: AC_CHECK_LIB(auth, getauthuid, AC_DEFINE(HAVE_GETAUTHUID, 1, [Define if you have the `getauthuid' function. (ULTRIX 4.x shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lauth"; LIBS="${LIBS} -lauth"])
1.1 millert 1396: CHECKSHADOW="false"
1397: fi
1398: ;;
1399: *-*-riscos*)
1400: LIBS="${LIBS} -lsun -lbsd"
1401: CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd"
1402: OSDEFS="${OSDEFS} -D_MIPS"
1.7 millert 1403: test -n "$mansectsu" || mansectsu=1m
1404: test -n "$mansectform" || mansectform=4
1.1 millert 1405: ;;
1406: *-*-isc*)
1407: OSDEFS="${OSDEFS} -D_ISC"
1408: LIB_CRYPT=1
1409: SUDO_LIBS="${SUDO_LIBS} -lcrypt"
1410: LIBS="${LIBS} -lcrypt"
1411:
1412: if test "$CHECKSHADOW" = "true"; then
1413: AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"])
1414: CHECKSHADOW="false"
1415: fi
1.7 millert 1416: test -n "$mansectsu" || mansectsu=1m
1417: test -n "$mansectform" || mansectform=4
1.1 millert 1418: ;;
1.7 millert 1419: *-*-sco*|*-sco-*)
1.1 millert 1420: if test "$CHECKSHADOW" = "true"; then
1421: AC_CHECK_LIB(prot, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lprot -lx"; LIBS="${LIBS} -lprot -lx"; SECUREWARE=1], , -lx)
1422: AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])
1423: CHECKSHADOW="false"
1424: fi
1.8 millert 1425: test -n "$mansectsu" || mansectsu=1m
1426: test -n "$mansectform" || mansectform=4
1427: ;;
1428: m88k-motorola-sysv*)
1429: # motorolla's cc (a variant of gcc) does -O but not -O2
1430: CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/g'`
1.7 millert 1431: test -n "$mansectsu" || mansectsu=1m
1432: test -n "$mansectform" || mansectform=4
1.1 millert 1433: ;;
1434: *-sequent-sysv*)
1435: if test "$CHECKSHADOW" = "true"; then
1436: AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"])
1437: CHECKSHADOW="false"
1438: fi
1.7 millert 1439: test -n "$mansectsu" || mansectsu=1m
1440: test -n "$mansectform" || mansectform=4
1441: ;;
1442: *-ncr-sysv4*|*-ncr-sysvr4*)
1443: AC_CHECK_LIB(c89, strcasecmp, AC_DEFINE(HAVE_STRCASECMP) [LIBS="${LIBS} -lc89"; ac_cv_func_strcasecmp=yes])
1444: test -n "$mansectsu" || mansectsu=1m
1445: test -n "$mansectform" || mansectform=4
1.1 millert 1446: ;;
1.7 millert 1447: *-ccur-sysv4*|*-ccur-sysvr4*)
1.1 millert 1448: LIBS="${LIBS} -lgen"
1449: SUDO_LIBS="${SUDO_LIBS} -lgen"
1.7 millert 1450: test -n "$mansectsu" || mansectsu=1m
1451: test -n "$mansectform" || mansectform=4
1.1 millert 1452: ;;
1453: *-*-bsdi*)
1.14 ! millert 1454: SKIP_SETREUID=yes
1.5 millert 1455: # Use shlicc for BSD/OS [23].x unless asked to do otherwise
1456: if test "${with_CC+set}" != set -a "$ac_cv_prog_CC" = gcc; then
1457: case "$OSREV" in
1458: 2|3) echo 'using shlicc as CC'
1459: ac_cv_prog_CC=shlicc
1460: CC="$ac_cv_prog_CC"
1461: ;;
1462: esac
1463: fi
1464: ;;
1465: *-*-freebsd*)
1.11 millert 1466: # FreeBSD has a real setreuid(2) starting with 2.1 and
1467: # backported to 2.0.5. We just take 2.1 and above...
1468: case "`echo $host_os | sed 's/^freebsd\([[0-9\.]]*\).*$/\1/'`" in
1469: 0.*|1.*|2.0*)
1.14 ! millert 1470: SKIP_SETREUID=yes
1.11 millert 1471: ;;
1472: esac
1.6 millert 1473: if test "$with_logincap" = "yes"; then
1474: SUDO_LIBS="${SUDO_LIBS} -lutil"
1475: fi
1.5 millert 1476: if test "$with_skey" = "yes"; then
1477: SUDO_LIBS="${SUDO_LIBS} -lmd"
1478: fi
1479: if test "$CHECKSHADOW" = "true"; then
1480: CHECKSHADOW="false"
1.1 millert 1481: fi
1482: ;;
1.7 millert 1483: *-*-*openbsd*)
1.14 ! millert 1484: SKIP_SETREUID=yes
1.7 millert 1485: if test "$CHECKSHADOW" = "true"; then
1486: CHECKSHADOW="false"
1487: fi
1488: ;;
1489: *-*-*netbsd*)
1.11 millert 1490: # NetBSD has a real setreuid(2) starting with 1.3.2
1491: case "`echo $host_os | sed 's/^netbsd\([[0-9\.]]*\).*$/\1/'`" in
1492: 0.9*|1.[012]*|1.3|1.3.1)
1.14 ! millert 1493: SKIP_SETREUID=yes
1.11 millert 1494: ;;
1495: esac
1.7 millert 1496: if test "$CHECKSHADOW" = "true"; then
1497: CHECKSHADOW="false"
1498: fi
1499: ;;
1.1 millert 1500: *-*-*bsd*)
1501: if test "$CHECKSHADOW" = "true"; then
1502: CHECKSHADOW="false"
1503: fi
1504: ;;
1.7 millert 1505: *-*-nextstep*)
1506: # lockf() on is broken on the NeXT -- use flock instead
1507: ac_cv_func_lockf=no
1508: ac_cv_func_flock=yes
1509: ;;
1.5 millert 1510: *-*-sysv*)
1.7 millert 1511: test -n "$mansectsu" || mansectsu=1m
1512: test -n "$mansectform" || mansectform=4
1.5 millert 1513: ;;
1.1 millert 1514: esac
1515:
1516: dnl
1.5 millert 1517: dnl Use BSD-style man sections by default
1518: dnl
1519: test -n "$mansectsu" || mansectsu=8
1520: test -n "$mansectform" || mansectform=5
1521:
1522: dnl
1.1 millert 1523: dnl Check for shadow password routines if we have not already done so.
1524: dnl We check for SVR4-style first and then SecureWare-style.
1525: dnl
1526: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1527: AC_CHECK_FUNCS(getspnam, [CHECKSHADOW="false"], [AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM, 1, [Define if you have the `getspnam' function (SVR4-style shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])])
1.1 millert 1528: fi
1529: if test "$CHECKSHADOW" = "true"; then
1.7 millert 1530: AC_CHECK_FUNC(getprpwnam, [AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1], AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"], AC_CHECK_LIB(prot, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lprot"; LIBS="${LIBS} -lprot"])))])
1.1 millert 1531: fi
1532:
1533: dnl
1534: dnl C compiler checks (to be done after os checks)
1535: dnl
1536: AC_PROG_GCC_TRADITIONAL
1537: AC_C_CONST
1.7 millert 1538: AC_C_VOLATILE
1.1 millert 1539: dnl
1540: dnl Program checks
1541: dnl
1542: AC_PROG_YACC
1.7 millert 1543: SUDO_PROG_MV
1544: SUDO_PROG_BSHELL
1.1 millert 1545: if test -z "$with_sendmail"; then
1546: SUDO_PROG_SENDMAIL
1547: fi
1.7 millert 1548: if test -z "$with_editor"; then
1549: SUDO_PROG_VI
1550: fi
1.1 millert 1551: dnl
1552: dnl Header file checks
1553: dnl
1554: AC_HEADER_STDC
1555: AC_HEADER_DIRENT
1.7 millert 1556: AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h)
1.1 millert 1557: dnl ultrix termio/termios are broken
1558: if test "$OS" != "ultrix"; then
1.7 millert 1559: AC_SYS_POSIX_TERMIOS
1560: if test "$ac_cv_sys_posix_termios" = "yes"; then
1561: AC_DEFINE(HAVE_TERMIOS_H, 1, [Define if you have the <termios.h> header file and the `tcgetattr' function.])
1562: else
1563: AC_CHECK_HEADERS(termio.h)
1564: fi
1.1 millert 1565: fi
1.6 millert 1566: if test "$with_logincap" = "yes"; then
1567: AC_CHECK_HEADERS(login_cap.h)
1568: fi
1569: if test "$with_bsdauth" = "yes"; then
1.14 ! millert 1570: AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H, 1, [Define if you use BSD authentication.]) [with_passwd=no; AUTH_OBJS=bsdauth.o], -)
1.6 millert 1571: fi
1.1 millert 1572: dnl
1573: dnl typedef checks
1574: dnl
1575: AC_TYPE_MODE_T
1576: AC_TYPE_UID_T
1.7 millert 1577: AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int, [Define to `int' if <signal.h> does not define.])], [#include <sys/types.h>
1578: #include <signal.h>])
1579: AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T, 1, [Define if <signal.h> has the sigaction_t typedef.])], ,[#include <sys/types.h>
1580: #include <signal.h>])
1.1 millert 1581: SUDO_TYPE_SIZE_T
1582: SUDO_TYPE_SSIZE_T
1583: SUDO_TYPE_DEV_T
1584: SUDO_TYPE_INO_T
1585: SUDO_FULL_VOID
1586: SUDO_UID_T_LEN
1587: SUDO_LONG_LONG
1588: SUDO_SOCK_SA_LEN
1589: dnl
1590: dnl only set RETSIGTYPE if it is not set already
1591: dnl
1592: case "$DEFS" in
1593: *"RETSIGTYPE"*) ;;
1594: *) AC_TYPE_SIGNAL;;
1595: esac
1596: dnl
1597: dnl Function checks
1598: dnl
1.7 millert 1599: AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \
1.14 ! millert 1600: strftime setrlimit initgroups fstat)
! 1601: if test -z "$SKIP_SETRESUID"; then
! 1602: AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes])
! 1603: fi
! 1604: if test -z "$SKIP_SETREUID"; then
1.7 millert 1605: AC_CHECK_FUNCS(setreuid)
1606: fi
1607: if test X"$with_interfaces" != X"no"; then
1.14 ! millert 1608: AC_CHECK_FUNCS(getifaddrs, [AC_CHECK_FUNCS(freeifaddrs)])
1.7 millert 1609: fi
1.1 millert 1610: if test -n "$SECUREWARE"; then
1.7 millert 1611: AC_CHECK_FUNCS(bigcrypt set_auth_parameters initprivs)
1.1 millert 1612: fi
1613: if test -z "$BROKEN_GETCWD"; then
1.7 millert 1614: AC_REPLACE_FUNCS(getcwd)
1.1 millert 1615: fi
1.7 millert 1616: AC_CHECK_FUNCS(lockf flock, [break])
1617: AC_CHECK_FUNCS(waitpid wait3, [break])
1.14 ! millert 1618: AC_CHECK_FUNCS(innetgr _innetgr, [AC_CHECK_FUNCS(getdomainname) [break]])
! 1619: AC_CHECK_FUNCS(lsearch, , [AC_CHECK_LIB(compat, lsearch, AC_CHECK_HEADER(search.h, AC_DEFINE(HAVE_LSEARCH) [LIBS="${LIBS} -lcompat"], AC_LIBOBJ(lsearch), -), AC_LIBOBJ(lsearch))])
! 1620: AC_CHECK_FUNCS(utime, [SUDO_FUNC_UTIME_POSIX], [AC_LIBOBJ(utime)])
1.7 millert 1621: SUDO_FUNC_FNMATCH(AC_DEFINE(HAVE_FNMATCH, 1, [Define if you have the `fnmatch' function.]), AC_LIBOBJ(fnmatch))
1622: SUDO_FUNC_ISBLANK
1.14 ! millert 1623: AC_REPLACE_FUNCS(strerror strcasecmp sigaction strlcpy strlcat)
1.7 millert 1624: AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1])
1.1 millert 1625: dnl
1626: dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS
1627: dnl (it contains snprintf, vsnprintf, asprintf, and vasprintf)
1628: dnl
1629: if test -n "$NEED_SNPRINTF"; then
1.7 millert 1630: AC_LIBOBJ(snprintf)
1.1 millert 1631: fi
1632: dnl
1633: dnl if crypt(3) not in libc, look elsewhere
1634: dnl
1635: if test -z "$LIB_CRYPT"; then
1.7 millert 1636: AC_CHECK_FUNC(crypt, , [AC_CHECK_LIB(crypt, crypt, [SUDO_LIBS="${SUDO_LIBS} -lcrypt"; LIBS="${LIBS} -lcrypt"], AC_CHECK_LIB(crypt_d, crypt, [SUDO_LIBS="${SUDO_LIBS} -lcrypt_d"; LIBS="${LIBS} -lcrypt_d"], AC_CHECK_LIB(ufc, crypt, [SUDO_LIBS="${SUDO_LIBS} -lufc"; LIBS="${LIBS} -lufc"])))])
1.1 millert 1637: fi
1638: dnl
1639: dnl If socket(2) not in libc, check -lsocket and -linet
1640: dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
1641: dnl In this case we look for main(), not socket() to avoid using a cached value
1642: dnl
1.7 millert 1643: AC_CHECK_FUNC(socket, , [AC_CHECK_LIB(socket, socket, [NET_LIBS="${NET_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"], AC_CHECK_LIB(inet, socket, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"], AC_MSG_WARN(unable to find socket() trying -lsocket -lnsl)
1644: AC_CHECK_LIB(socket, socket, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl)))])
1.1 millert 1645: dnl
1646: dnl If inet_addr(3) not in libc, check -lnsl and -linet
1647: dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
1648: dnl
1.7 millert 1649: AC_CHECK_FUNC(inet_addr, , [AC_CHECK_FUNC(__inet_addr, , AC_CHECK_LIB(nsl, inet_addr, [NET_LIBS="${NET_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"], AC_CHECK_LIB(inet, inet_addr, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"], AC_MSG_WARN(unable to find inet_addr() trying -lsocket -lnsl)
1650: AC_CHECK_LIB(socket, inet_addr, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl))))])
1.1 millert 1651: dnl
1652: dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet
1653: dnl
1.7 millert 1654: AC_CHECK_FUNC(syslog, , [AC_CHECK_LIB(socket, syslog, [NET_LIBS="${NET_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"], AC_CHECK_LIB(nsl, syslog, [NET_LIBS="${NET_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"], AC_CHECK_LIB(inet, syslog, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"])))])
1.1 millert 1655: dnl
1656: dnl Bison and DCE use alloca(3), if not in libc, use the sudo one (from gcc)
1657: dnl (gcc includes its own alloca(3) but other compilers may not)
1658: dnl
1659: if test "$with_DCE" = "yes" -o "$ac_cv_prog_YACC" = "bison -y"; then
1660: AC_FUNC_ALLOCA
1661: fi
1662:
1663: dnl
1664: dnl Kerberos 5
1665: dnl
1666: if test "$with_kerb5" = "yes"; then
1.7 millert 1667: AC_DEFINE(HAVE_KERB5, 1, [Define if you use Kerberos V.])
1.1 millert 1668: if test -f "/usr/local/include/krb5.h"; then
1669: CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1670: elif test -f "/usr/local/kerberos/include/krb5.h"; then
1671: CPPFLAGS="$CPPFLAGS -I/usr/local/kerberos/include"
1.7 millert 1672: elif test -f "/usr/krb5/include/krb5.h"; then
1673: CPPFLAGS="$CPPFLAGS -I/usr/krb5/include"
1.1 millert 1674: elif test -f "/usr/local/krb5/include/krb5.h"; then
1675: CPPFLAGS="$CPPFLAGS -I/usr/local/krb5/include"
1676: else
1677: echo 'Unable to locate kerberos 5 include files, you will have to edit the Makefile and add -I/path/to/krb/includes to CPPFLAGS'
1678: fi
1679:
1680: if test -f "/usr/local/lib/libkrb5.a"; then
1681: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib"
1682: elif test -f "/usr/local/kerberos/lib/libkrb5.a"; then
1683: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/kerberos/lib"
1.7 millert 1684: elif test -f "/usr/krb5/lib/libkrb5.a"; then
1685: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/krb5/lib"
1.1 millert 1686: elif test -f "/usr/local/krb5/lib/libkrb5.a"; then
1687: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/krb5/lib"
1688: else
1689: echo 'Unable to locate kerberos 5 libraries, you will have to edit the Makefile and add -L/path/to/krb/libs to SUDO_LDFLAGS'
1690: fi
1691:
1692: SUDO_LIBS="${SUDO_LIBS} -lkrb5 -lk5crypto -lcom_err"
1693: AUTH_OBJS="${AUTH_OBJS} kerb5.o"
1694: fi
1695:
1696: dnl
1.4 millert 1697: dnl PAM libs
1698: dnl
1699: if test "$with_pam" = "yes"; then
1.14 ! millert 1700: AC_HAVE_LIBRARY(dl, SUDO_LIBS="${SUDO_LIBS} -lpam -ldl", SUDO_LIBS="${SUDO_LIBS} -lpam")
1.4 millert 1701: fi
1702:
1703: dnl
1.1 millert 1704: dnl Find kerberos 4 includes and libs or complain
1705: dnl
1706: if test "$with_kerb4" = "yes"; then
1.7 millert 1707: AC_DEFINE(HAVE_KERB4, 1, [Define if you use Kerberos IV.])
1.1 millert 1708: if test -f "/usr/include/kerberosIV/krb.h"; then
1709: CPPFLAGS="${CPPFLAGS} -I/usr/include/kerberosIV"
1710: elif test -f "/usr/local/include/kerberosIV/krb.h"; then
1711: CPPFLAGS="${CPPFLAGS} -I/usr/local/include/kerberosIV"
1712: elif test -f "/usr/kerberos/include/krb.h"; then
1713: CPPFLAGS="${CPPFLAGS} -I/usr/kerberos/include"
1714: elif test -f "/usr/local/kerberos/include/krb.h"; then
1715: CPPFLAGS="${CPPFLAGS} -I/usr/local/kerberos/include"
1716: else
1717: echo 'Unable to locate kerberos 4 include files, you will have to edit the Makefile and add -I/path/to/krb/includes to CPPFLAGS'
1718: fi
1719:
1720: if test -d "/usr/kerberos/lib"; then
1721: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/kerberos/lib"
1722: elif test -d "/usr/lib/kerberos"; then
1723: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/lib/kerberos"
1724: elif test -f "/usr/local/lib/libkrb.a"; then
1725: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib"
1726: elif test ! -f "/usr/lib/libkrb.a"; then
1727: echo 'Unable to locate kerberos 4 libraries, you will have to edit the Makefile and add -L/path/to/krb/libs to SUDO_LDFLAGS'
1728: fi
1729:
1730: AC_HAVE_LIBRARY(des, SUDO_LIBS="${SUDO_LIBS} -lkrb -ldes", SUDO_LIBS="${SUDO_LIBS} -lkrb")
1731: AUTH_OBJS="${AUTH_OBJS} kerb4.o"
1732: fi
1733:
1734: dnl
1735: dnl extra AFS libs and includes
1736: dnl
1737: if test "$with_AFS" = "yes"; then
1738:
1739: # looks like the "standard" place for AFS libs is /usr/afsws/lib
1740: AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
1741: for i in $AFSLIBDIRS; do
1742: if test -d ${i}; then
1743: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${i}"
1744: FOUND_AFSLIBDIR=true
1745: fi
1746: done
1747: if test -z "$FOUND_AFSLIBDIR"; then
1748: echo 'Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDO_LDFLAGS or rerun configure with the --with-libpath options.'
1749: fi
1750:
1751: # Order is important here. Note that we build AFS_LIBS from right to left
1752: # since AFS_LIBS may be initialized with BSD compat libs that must go last
1753: AFS_LIBS="-laudit ${AFS_LIBS}"
1754: for i in $AFSLIBDIRS; do
1755: if test -f ${i}/util.a; then
1756: AFS_LIBS="${i}/util.a ${AFS_LIBS}"
1757: FOUND_UTIL_A=true
1758: break;
1759: fi
1760: done
1761: if test -z "$FOUND_UTIL_A"; then
1762: AFS_LIBS="-lutil ${AFS_LIBS}"
1763: fi
1764: AFS_LIBS="-lkauth -lprot -lubik -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err ${AFS_LIBS}"
1765:
1766: # AFS includes may live in /usr/include on some machines...
1767: for i in /usr/afsws/include; do
1768: if test -d ${i}; then
1769: CPPFLAGS="${CPPFLAGS} -I${i}"
1770: FOUND_AFSINCDIR=true
1771: fi
1772: done
1773:
1774: if test -z "$FOUND_AFSLIBDIR"; then
1775: echo 'Unable to locate AFS include dir, you may have to edit the Makefile and add -I/path/to/afs/includes to CPPFLAGS or rerun configure with the --with-incpath options.'
1776: fi
1777: fi
1778:
1779: dnl
1780: dnl extra DCE obj + lib
1781: dnl Order of libs in HP-UX 10.x is important, -ldce must be last.
1782: dnl
1783: if test "$with_DCE" = "yes"; then
1784: DCE_OBJS="${DCE_OBJS} dce_pwent.o"
1785: SUDO_LIBS="${SUDO_LIBS} -ldce"
1.5 millert 1786: fi
1787:
1788: dnl
1.1 millert 1789: dnl extra S/Key lib and includes
1790: dnl
1791: if test "$with_skey" = "yes"; then
1792: SUDO_LIBS="${SUDO_LIBS} -lskey"
1793: if test -f /usr/include/skey.h -a -f /usr/lib/libskey.a; then
1794: :
1795: elif test -f /usr/local/include/skey.h; then
1796: CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
1797: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib"
1798: elif test "$with_csops" = "yes" -a -f /tools/cs/skey/include/skey.h -a -f /tools/cs/skey/lib/libskey.a; then
1799: CPPFLAGS="${CPPFLAGS} -I/tools/cs/skey/include"
1800: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/tools/cs/skey/lib"
1801: else
1802: echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS'
1803: fi
1.7 millert 1804: AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS, 1, [Define if your S/Key library has skeyaccess().]))
1.1 millert 1805: fi
1806:
1807: dnl
1808: dnl extra OPIE lib and includes
1809: dnl
1810: if test "$with_opie" = "yes"; then
1811: SUDO_LIBS="${SUDO_LIBS} -lopie"
1812: if test -f /usr/include/opie.h -a -f /usr/lib/libopie.a; then
1813: :
1814: elif test -f /usr/local/include/opie.h; then
1815: CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
1816: SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib"
1817: else
1818: echo 'Unable to locate libopie.a and/or opie.h, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDO_LDFLAGS and/or -I/path/to/opie.h to CPPFLAGS'
1819: fi
1820: fi
1821:
1822: dnl
1823: dnl extra SecurID lib + includes
1824: dnl
1825: if test -n "$with_SecurID" -a "$with_SecurID" != "no"; then
1826: if test "$with_SecurID" != "yes"; then
1.14 ! millert 1827: :
! 1828: elif test -d /usr/ace/examples; then
! 1829: with_SecurID=/usr/ace/examples
1.1 millert 1830: else
1.14 ! millert 1831: with_SecurID=/usr/ace
1.1 millert 1832: fi
1.14 ! millert 1833: CPPFLAGS="${CPPFLAGS} -I${with_SecurID}"
! 1834: _LDFLAGS="${LDFLAGS}"
! 1835: LDFLAGS="${LDFLAGS} -L${with_SecurID}"
! 1836: #
! 1837: # Determine whether to use the new or old SecurID API
! 1838: #
! 1839: AC_CHECK_LIB(aceclnt, SD_Init, [AUTH_OBJS="securid5.o"; SUDO_LIBS="${SUDO_LIBS} -laceclnt -lpthread"; SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_SecurID}"], [AUTH_OBJS="securid.o"; SUDO_LIBS="${SUDO_LIBS} ${with_SecurID}/sdiclient.a"], [-lpthread])
! 1840: LDFLAGS="${_LDFLAGS}"
1.1 millert 1841: fi
1842:
1843: dnl
1844: dnl extra FWTK libs + includes
1845: dnl
1846: if test "$with_fwtk" = "yes"; then
1847: SUDO_LIBS="${SUDO_LIBS} -lauth -lfwall"
1848: fi
1849:
1850: dnl
1851: dnl extra 'authenticate' lib (AIX only?)
1852: dnl
1853: if test "$with_authenticate" = "yes"; then
1854: SUDO_LIBS="${SUDO_LIBS} -ls"
1855: fi
1856:
1857: dnl
1858: dnl Check for log file and timestamp locations
1859: dnl
1860: SUDO_LOGFILE
1861: SUDO_TIMEDIR
1862:
1863: dnl
1864: dnl Use passwd (and secureware) auth modules?
1865: dnl
1866: if test "$with_passwd" = "no"; then
1.7 millert 1867: AC_DEFINE(WITHOUT_PASSWD, 1. [Define to avoid using the passwd/shadow file for authentication.])
1.1 millert 1868: if test -z "$AUTH_OBJS"; then
1869: AC_MSG_ERROR([no authentication methods defined.])
1870: fi
1871: else
1872: if test -n "$SECUREWARE"; then
1873: AUTH_OBJS="${AUTH_OBJS} passwd.o secureware.o"
1874: else
1875: AUTH_OBJS="${AUTH_OBJS} passwd.o"
1876: fi
1877: fi
1878:
1879: dnl
1880: dnl LIBS may contain duplicates from SUDO_LIBS or NET_LIBS so prune it.
1881: dnl
1882: if test -n "$LIBS"; then
1883: L="$LIBS"
1884: LIBS=
1885: for l in ${L}; do
1886: dupe=0
1887: for sl in ${SUDO_LIBS} ${NET_LIBS}; do
1888: test $l = $sl && dupe=1
1889: done
1890: test $dupe = 0 && LIBS="${LIBS} $l"
1891: done
1892: fi
1893:
1894: dnl
1895: dnl Set exec_prefix
1896: dnl
1897: test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
1898:
1899: dnl
1.5 millert 1900: dnl Substitute into the Makefile and man pages
1.1 millert 1901: dnl
1.5 millert 1902: AC_OUTPUT([Makefile sudo.man visudo.man sudoers.man])
1.1 millert 1903:
1904: dnl
1905: dnl Spew any text the user needs to know about
1906: dnl
1907: if test "$with_pam" = "yes"; then
1908: echo ""
1909: case $host in
1910: *-*-linux*)
1911: echo "You will need to customize sample.pam and install it as /etc/pam.d/sudo"
1912: ;;
1913: esac
1914: echo ""
1915: fi
1.7 millert 1916:
1917: dnl
1918: dnl Special bits for autoheader
1919: dnl
1920: AH_VERBATIM([_GNU_SOURCE],
1921: [/* Enable GNU extensions on systems that have them. */
1922: #ifndef _GNU_SOURCE
1923: # define _GNU_SOURCE 1
1924: #endif])
1925:
1926: AH_VERBATIM([_ALL_SOURCE],
1927: [/* Enable non-POSIX extensions on AIX. */
1928: #ifndef _ALL_SOURCE
1929: # undef _ALL_SOURCE
1930: #endif])
1931:
1932: AH_VERBATIM([_CONVEX_SOURCE],
1933: [/* Enable non-POSIX extensions on ConvexOS. */
1934: #ifndef _CONVEX_SOURCE
1935: # undef _CONVEX_SOURCE
1936: #endif])
1937:
1938: AH_TOP([#ifndef _SUDO_CONFIG_H
1939: #define _SUDO_CONFIG_H])
1940:
1941: AH_BOTTOM([/*
1942: * Emulate a subset of waitpid() if we don't have it.
1943: */
1944: #ifdef HAVE_WAITPID
1945: # define sudo_waitpid(p, s, o) waitpid(p, s, o)
1946: #else
1947: # ifdef HAVE_WAIT3
1948: # define sudo_waitpid(p, s, o) wait3(s, o, NULL)
1949: # endif
1.14 ! millert 1950: #endif
! 1951:
! 1952: /* GNU stow needs /etc/sudoers to be a symlink. */
! 1953: #ifdef HAVE_STOW
! 1954: # define stat_sudoers stat
! 1955: #else
! 1956: # define stat_sudoers lstat
1.7 millert 1957: #endif
1958:
1959: /* Solaris doesn't use const qualifiers in PAM. */
1960: #ifdef sun
1961: # define PAM_CONST
1962: #else
1963: # define PAM_CONST const
1964: #endif
1965:
1966: #ifdef USE_EXECV
1967: # define EXEC execv
1968: #else
1969: # define EXEC execvp
1970: #endif /* USE_EXECV */
1971:
1972: /* New ANSI-style OS defs for HP-UX and ConvexOS. */
1973: #if defined(hpux) && !defined(__hpux)
1974: # define __hpux 1
1975: #endif /* hpux */
1976:
1977: #if defined(convex) && !defined(__convex__)
1978: # define __convex__ 1
1979: #endif /* convex */
1980:
1981: /* BSD compatibility on some SVR4 systems. */
1982: #ifdef __svr4__
1983: # define BSD_COMP
1984: #endif /* __svr4__ */
1985:
1986: #endif /* _SUDO_CONFIG_H */])