[BACK]Return to configure.in CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Annotation of src/usr.bin/sudo/configure.in, Revision 1.1

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