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