File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / sudo / configure.in
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 9 09:29:52 2012 UTC (11 years, 8 months ago) by misho
Branches: sudo, MAIN
CVS tags: HEAD
sudo

    1: dnl
    2: dnl Process this file with GNU autoconf to produce a configure script.
    3: dnl
    4: dnl Copyright (c) 1994-1996,1998-2012 Todd C. Miller <Todd.Miller@courtesan.com>
    5: dnl
    6: AC_INIT([sudo], [1.8.6p3], [http://www.sudo.ws/bugs/], [sudo])
    7: AC_CONFIG_HEADER([config.h pathnames.h])
    8: dnl
    9: dnl Note: this must come after AC_INIT
   10: dnl
   11: AC_MSG_NOTICE([Configuring Sudo version $PACKAGE_VERSION])
   12: dnl
   13: dnl Variables that get substituted in the Makefile and man pages
   14: dnl
   15: AC_SUBST([HAVE_BSM_AUDIT])
   16: AC_SUBST([SHELL])
   17: AC_SUBST([LIBTOOL])
   18: AC_SUBST([CFLAGS])
   19: AC_SUBST([PROGS])
   20: AC_SUBST([CPPFLAGS])
   21: AC_SUBST([LDFLAGS])
   22: AC_SUBST([SUDOERS_LDFLAGS])
   23: AC_SUBST([LT_LDFLAGS])
   24: AC_SUBST([LT_LDMAP])
   25: AC_SUBST([LT_LDOPT])
   26: AC_SUBST([LT_LDDEP])
   27: AC_SUBST([LT_LDEXPORTS])
   28: AC_SUBST([COMMON_OBJS])
   29: AC_SUBST([SUDOERS_OBJS])
   30: AC_SUBST([SUDO_OBJS])
   31: AC_SUBST([LIBS])
   32: AC_SUBST([SUDO_LIBS])
   33: AC_SUBST([SUDOERS_LIBS])
   34: AC_SUBST([NET_LIBS])
   35: AC_SUBST([AFS_LIBS])
   36: AC_SUBST([REPLAY_LIBS])
   37: AC_SUBST([GETGROUPS_LIB])
   38: AC_SUBST([OSDEFS])
   39: AC_SUBST([AUTH_OBJS])
   40: AC_SUBST([MANTYPE])
   41: AC_SUBST([MANDIRTYPE])
   42: AC_SUBST([MANCOMPRESS])
   43: AC_SUBST([MANCOMPRESSEXT])
   44: AC_SUBST([SHLIB_MODE])
   45: AC_SUBST([SUDOERS_MODE])
   46: AC_SUBST([SUDOERS_UID])
   47: AC_SUBST([SUDOERS_GID])
   48: AC_SUBST([DEVEL])
   49: AC_SUBST([BAMAN])
   50: AC_SUBST([LCMAN])
   51: AC_SUBST([PSMAN])
   52: AC_SUBST([SEMAN])
   53: AC_SUBST([devdir])
   54: AC_SUBST([mansectsu])
   55: AC_SUBST([mansectform])
   56: AC_SUBST([mansrcdir])
   57: AC_SUBST([NOEXECFILE])
   58: AC_SUBST([NOEXECDIR])
   59: AC_SUBST([PLUGINDIR])
   60: AC_SUBST([SOEXT])
   61: AC_SUBST([noexec_file])
   62: AC_SUBST([INSTALL_NOEXEC])
   63: AC_SUBST([DONT_LEAK_PATH_INFO])
   64: AC_SUBST([BSDAUTH_USAGE])
   65: AC_SUBST([SELINUX_USAGE])
   66: AC_SUBST([LDAP])
   67: AC_SUBST([LOGINCAP_USAGE])
   68: AC_SUBST([ZLIB])
   69: AC_SUBST([ZLIB_SRC])
   70: AC_SUBST([LIBTOOL_DEPS])
   71: AC_SUBST([ac_config_libobj_dir])
   72: AC_SUBST([CONFIGURE_ARGS])
   73: AC_SUBST([LIBDL])
   74: AC_SUBST([LT_STATIC])
   75: AC_SUBST([LIBINTL])
   76: AC_SUBST([SUDO_NLS])
   77: AC_SUBST([COMPAT_TEST_PROGS])
   78: AC_SUBST([CROSS_COMPILING])
   79: AC_SUBST([PIE_LDFLAGS])
   80: AC_SUBST([PIE_CFLAGS])
   81: AC_SUBST([NO_VIZ])
   82: dnl
   83: dnl Variables that get substituted in docs (not overridden by environment)
   84: dnl
   85: AC_SUBST([iolog_dir])dnl real initial value from SUDO_IO_LOGDIR
   86: AC_SUBST([timedir])dnl real initial value from SUDO_TIMEDIR
   87: AC_SUBST([timeout])
   88: AC_SUBST([password_timeout])
   89: AC_SUBST([sudo_umask])
   90: AC_SUBST([umask_override])
   91: AC_SUBST([passprompt])
   92: AC_SUBST([long_otp_prompt])
   93: AC_SUBST([lecture])
   94: AC_SUBST([logfac])
   95: AC_SUBST([goodpri])
   96: AC_SUBST([badpri])
   97: AC_SUBST([loglen])
   98: AC_SUBST([ignore_dot])
   99: AC_SUBST([mail_no_user])
  100: AC_SUBST([mail_no_host])
  101: AC_SUBST([mail_no_perms])
  102: AC_SUBST([mailto])
  103: AC_SUBST([mailsub])
  104: AC_SUBST([badpass_message])
  105: AC_SUBST([fqdn])
  106: AC_SUBST([runas_default])
  107: AC_SUBST([env_editor])
  108: AC_SUBST([env_reset])
  109: AC_SUBST([passwd_tries])
  110: AC_SUBST([tty_tickets])
  111: AC_SUBST([insults])
  112: AC_SUBST([root_sudo])
  113: AC_SUBST([path_info])
  114: AC_SUBST([ldap_conf])
  115: AC_SUBST([ldap_secret])
  116: AC_SUBST([sssd_lib])
  117: AC_SUBST([nsswitch_conf])
  118: AC_SUBST([netsvc_conf])
  119: AC_SUBST([secure_path])
  120: AC_SUBST([editor])
  121: #
  122: # Begin initial values for man page substitution
  123: #
  124: iolog_dir=/var/log/sudo-io
  125: timedir=/var/adm/sudo
  126: timeout=5
  127: password_timeout=5
  128: sudo_umask=0022
  129: umask_override=off
  130: passprompt="Password:"
  131: long_otp_prompt=off
  132: lecture=once
  133: logfac=auth
  134: goodpri=notice
  135: badpri=alert
  136: loglen=80
  137: ignore_dot=off
  138: mail_no_user=on
  139: mail_no_host=off
  140: mail_no_perms=off
  141: mailto=root
  142: mailsub="*** SECURITY information for %h ***"
  143: badpass_message="Sorry, try again."
  144: fqdn=off
  145: runas_default=root
  146: env_editor=off
  147: env_reset=on
  148: editor=vi
  149: passwd_tries=3
  150: tty_tickets=on
  151: insults=off
  152: root_sudo=on
  153: path_info=on
  154: ldap_conf=/etc/ldap.conf
  155: ldap_secret=/etc/ldap.secret
  156: netsvc_conf=/etc/netsvc.conf
  157: noexec_file=/usr/local/libexec/sudo_noexec.so
  158: nsswitch_conf=/etc/nsswitch.conf
  159: secure_path="not set"
  160: #
  161: # End initial values for man page substitution
  162: #
  163: dnl
  164: dnl Initial values for Makefile variables listed above
  165: dnl May be overridden by environment variables..
  166: dnl
  167: INSTALL_NOEXEC=
  168: devdir='$(srcdir)'
  169: PROGS="sudo"
  170: : ${MANDIRTYPE='man'}
  171: : ${mansrcdir='.'}
  172: : ${SHLIB_MODE='0644'}
  173: : ${SUDOERS_MODE='0440'}
  174: : ${SUDOERS_UID='0'}
  175: : ${SUDOERS_GID='0'}
  176: DEVEL=
  177: LDAP="#"
  178: BAMAN=0
  179: LCMAN=0
  180: PSMAN=0
  181: SEMAN=0
  182: LIBINTL=
  183: ZLIB=
  184: ZLIB_SRC=
  185: AUTH_OBJS=
  186: AUTH_REG=
  187: AUTH_EXCL=
  188: AUTH_EXCL_DEF=
  189: AUTH_DEF=passwd
  190: SUDO_NLS=disabled
  191: LT_LDEXPORTS="-export-symbols \$(shlib_exp)"
  192: LT_LDDEP="\$(shlib_exp)"
  193: NO_VIZ=
  194: 
  195: dnl
  196: dnl Other vaiables
  197: dnl
  198: CHECKSHADOW=true
  199: shadow_defs=
  200: shadow_funcs=
  201: shadow_libs=
  202: shadow_libs_optional=
  203: CONFIGURE_ARGS="$@"
  204: 
  205: dnl
  206: dnl LD_PRELOAD equivalents
  207: dnl
  208: RTLD_PRELOAD_VAR="LD_PRELOAD"
  209: RTLD_PRELOAD_ENABLE_VAR=
  210: RTLD_PRELOAD_DELIM=":"
  211: RTLD_PRELOAD_DEFAULT=
  212: 
  213: dnl
  214: dnl libc replacement functions live in compat
  215: dnl
  216: AC_CONFIG_LIBOBJ_DIR(compat)
  217: 
  218: dnl
  219: dnl Deprecated --with options (these all warn or generate an error)
  220: dnl
  221: 
  222: AC_ARG_WITH(otp-only, [AS_HELP_STRING([--with-otp-only], [deprecated])],
  223: [case $with_otp_only in
  224:     yes)	with_passwd="no"
  225: 		AC_MSG_NOTICE([--with-otp-only option deprecated, treating as --without-passwd])
  226: 		;;
  227: esac])
  228: 
  229: AC_ARG_WITH(alertmail, [AS_HELP_STRING([--with-alertmail], [deprecated])],
  230: [case $with_alertmail in
  231:     *)		with_mailto="$with_alertmail"
  232: 		AC_MSG_NOTICE([--with-alertmail option deprecated, treating as --mailto])
  233: 		;;
  234: esac])
  235: 
  236: dnl
  237: dnl Options for --with
  238: dnl
  239: 
  240: AC_ARG_WITH(devel, [AS_HELP_STRING([--with-devel], [add development options])],
  241: [case $with_devel in
  242:     yes)	AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
  243: 		OSDEFS="${OSDEFS} -DSUDO_DEVEL"
  244: 		DEVEL="true"
  245: 		devdir=.
  246: 		;;
  247:     no)		;;
  248:     *)		AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
  249: 		;;
  250: esac])
  251: 
  252: AC_ARG_WITH(CC, [AS_HELP_STRING([--with-CC], [C compiler to use])],
  253: [case $with_CC in
  254:     *)		AC_MSG_ERROR([the --with-CC option is no longer supported, please set the CC environment variable instead.])
  255: 		;;
  256: esac])
  257: 
  258: AC_ARG_WITH(rpath, [AS_HELP_STRING([--with-rpath], [pass -R flag in addition to -L for lib paths])],
  259: [case $with_rpath in
  260:     yes|no)	;;
  261:     *)		AC_MSG_ERROR(["--with-rpath does not take an argument."])
  262: 		;;
  263: esac])
  264: 
  265: AC_ARG_WITH(blibpath, [AS_HELP_STRING([--with-blibpath[=PATH]], [pass -blibpath flag to ld for additional lib paths])],
  266: [case $with_blibpath in
  267:     yes|no)	;;
  268:     *)		AC_MSG_NOTICE([will pass -blibpath:${with_blibpath} to the loader.])
  269: 		;;
  270: esac])
  271: 
  272: dnl
  273: dnl Handle BSM auditing support.
  274: dnl
  275: AC_ARG_WITH(bsm-audit, [AS_HELP_STRING([--with-bsm-audit], [enable BSM audit support])],
  276: [case $with_bsm_audit in
  277:     yes)	AC_DEFINE(HAVE_BSM_AUDIT)
  278: 		SUDOERS_LIBS="${SUDOERS_LIBS} -lbsm"
  279: 		SUDOERS_OBJS="${SUDOERS_OBJS} bsm_audit.lo"
  280: 		;;
  281:     no)		;;
  282:     *)		AC_MSG_ERROR(["--with-bsm-audit does not take an argument."])
  283: 		;;
  284: esac])
  285: 
  286: dnl
  287: dnl Handle Linux auditing support.
  288: dnl
  289: AC_ARG_WITH(linux-audit, [AS_HELP_STRING([--with-linux-audit], [enable Linux audit support])],
  290: [case $with_linux_audit in
  291:     yes)	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libaudit.h>]], [[int i = AUDIT_USER_CMD; (void)i;]])], [
  292: 		    AC_DEFINE(HAVE_LINUX_AUDIT)
  293: 		    SUDO_LIBS="${SUDO_LIBS} -laudit"
  294: 		    SUDOERS_LIBS="${SUDO_LIBS} -laudit"
  295: 		    SUDOERS_OBJS="${SUDOERS_OBJS} linux_audit.lo"
  296: 		], [
  297: 		    AC_MSG_ERROR([unable to find AUDIT_USER_CMD in libaudit.h for --with-linux-audit])
  298: 		])
  299: 		;;
  300:     no)		;;
  301:     *)		AC_MSG_ERROR(["--with-linux-audit does not take an argument."])
  302: 		;;
  303: esac])
  304: 
  305: dnl
  306: dnl Handle SSSD support.
  307: dnl
  308: AC_ARG_WITH(sssd, [AS_HELP_STRING([--with-sssd], [enable SSSD support])],
  309: [case $with_sssd in
  310:     yes)	SUDOERS_OBJS="${SUDOERS_OBJS} sssd.lo"
  311: 		AC_DEFINE(HAVE_SSSD)
  312: 		;;
  313:     no)		;;
  314:     *)		AC_MSG_ERROR(["--with-sssd does not take an argument."])
  315: 		;;
  316: esac])
  317: 
  318: AC_ARG_WITH(sssd-lib, [AS_HELP_STRING([--with-sssd-lib], [path to the SSSD library])])
  319: sssd_lib="\"LIBDIR\""
  320: test -n "$with_sssd_lib" && sssd_lib="$with_sssd_lib"
  321: SUDO_DEFINE_UNQUOTED(_PATH_SSSD_LIB, "$sssd_lib", [Path to the SSSD library])
  322: 
  323: AC_ARG_WITH(incpath, [AS_HELP_STRING([--with-incpath], [additional places to look for include files])],
  324: [case $with_incpath in
  325:     yes)	AC_MSG_ERROR(["must give --with-incpath an argument."])
  326: 		;;
  327:     no)		AC_MSG_ERROR(["--without-incpath not supported."])
  328: 		;;
  329:     *)		AC_MSG_NOTICE([Adding ${with_incpath} to CPPFLAGS])
  330: 		for i in ${with_incpath}; do
  331: 		    CPPFLAGS="${CPPFLAGS} -I${i}"
  332: 		done
  333: 		;;
  334: esac])
  335: 
  336: AC_ARG_WITH(libpath, [AS_HELP_STRING([--with-libpath], [additional places to look for libraries])],
  337: [case $with_libpath in
  338:     yes)	AC_MSG_ERROR(["must give --with-libpath an argument."])
  339: 		;;
  340:     no)		AC_MSG_ERROR(["--without-libpath not supported."])
  341: 		;;
  342:     *)		AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS])
  343: 		;;
  344: esac])
  345: 
  346: AC_ARG_WITH(libraries, [AS_HELP_STRING([--with-libraries], [additional libraries to link with])],
  347: [case $with_libraries in
  348:     yes)	AC_MSG_ERROR(["must give --with-libraries an argument."])
  349: 		;;
  350:     no)		AC_MSG_ERROR(["--without-libraries not supported."])
  351: 		;;
  352:     *)		AC_MSG_NOTICE([Adding ${with_libraries} to LIBS])
  353: 		;;
  354: esac])
  355: 
  356: AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence], [link with -lefence for malloc() debugging])],
  357: [case $with_efence in
  358:     yes)	AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
  359: 		LIBS="${LIBS} -lefence"
  360: 		if test -f /usr/local/lib/libefence.a; then
  361: 		    with_libpath="${with_libpath} /usr/local/lib"
  362: 		fi
  363: 		;;
  364:     no)		;;
  365:     *)		AC_MSG_WARN([Ignoring unknown argument to --with-efence: $with_efence])
  366: 		;;
  367: esac])
  368: 
  369: AC_ARG_WITH(csops, [AS_HELP_STRING([--with-csops], [add CSOps standard options])],
  370: [case $with_csops in
  371:     yes)	AC_MSG_NOTICE([Adding CSOps standard options])
  372: 		CHECKSIA=false
  373: 		with_ignore_dot=yes
  374: 		insults=on
  375: 		with_classic_insults=yes
  376: 		with_csops_insults=yes
  377: 		with_env_editor=yes
  378: 		: ${mansectsu='8'}
  379: 		: ${mansectform='5'}
  380: 		;;
  381:     no)		;;
  382:     *)		AC_MSG_WARN([Ignoring unknown argument to --with-csops: $with_csops])
  383: 		;;
  384: esac])
  385: 
  386: AC_ARG_WITH(passwd, [AS_HELP_STRING([--without-passwd], [don't use passwd/shadow file for authentication])],
  387: [case $with_passwd in
  388:     yes|no)	AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
  389: 		AC_MSG_RESULT($with_passwd)
  390: 		AUTH_DEF=""
  391: 		test "$with_passwd" = "yes" && AUTH_REG="$AUTH_REG passwd"
  392: 		;;
  393:     *)		AC_MSG_ERROR(["Sorry, --with-passwd does not take an argument."])
  394: 		;;
  395: esac])
  396: 
  397: AC_ARG_WITH(skey, [AS_HELP_STRING([--with-skey[=DIR]], [enable S/Key support ])],
  398: [case $with_skey in
  399:     no)		;;
  400:     *)		AC_DEFINE(HAVE_SKEY)
  401: 		AC_MSG_CHECKING(whether to try S/Key authentication)
  402: 		AC_MSG_RESULT(yes)
  403: 		AUTH_REG="$AUTH_REG S/Key"
  404: 		;;
  405: esac])
  406: 
  407: AC_ARG_WITH(opie, [AS_HELP_STRING([--with-opie[=DIR]], [enable OPIE support ])],
  408: [case $with_opie in
  409:     no)		;;
  410:     *)		AC_DEFINE(HAVE_OPIE)
  411: 		AC_MSG_CHECKING(whether to try NRL OPIE authentication)
  412: 		AC_MSG_RESULT(yes)
  413: 		AUTH_REG="$AUTH_REG NRL_OPIE"
  414: 		;;
  415: esac])
  416: 
  417: AC_ARG_WITH(long-otp-prompt, [AS_HELP_STRING([--with-long-otp-prompt], [use a two line OTP (skey/opie) prompt])],
  418: [case $with_long_otp_prompt in
  419:     yes)	AC_DEFINE(LONG_OTP_PROMPT)
  420: 		AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
  421: 		AC_MSG_RESULT(yes)
  422: 		long_otp_prompt=on
  423: 		;;
  424:     no)		long_otp_prompt=off
  425: 		;;
  426:     *)		AC_MSG_ERROR(["--with-long-otp-prompt does not take an argument."])
  427: 		;;
  428: esac])
  429: 
  430: AC_ARG_WITH(SecurID, [AS_HELP_STRING([--with-SecurID[[=DIR]]], [enable SecurID support])],
  431: [case $with_SecurID in
  432:     no)		;;
  433:     *)		AC_DEFINE(HAVE_SECURID)
  434: 		AC_MSG_CHECKING(whether to use SecurID for authentication)
  435: 		AC_MSG_RESULT(yes)
  436: 		AUTH_EXCL="$AUTH_EXCL SecurID"
  437: 		;;
  438: esac])
  439: 
  440: AC_ARG_WITH(fwtk, [AS_HELP_STRING([--with-fwtk[[=DIR]]], [enable FWTK AuthSRV support])],
  441: [case $with_fwtk in
  442:     no)		;;
  443:     *)		AC_DEFINE(HAVE_FWTK)
  444: 		AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
  445: 		AC_MSG_RESULT(yes)
  446: 		AUTH_EXCL="$AUTH_EXCL FWTK"
  447: 		;;
  448: esac])
  449: 
  450: AC_ARG_WITH(kerb5, [AS_HELP_STRING([--with-kerb5[[=DIR]]], [enable Kerberos V support])],
  451: [case $with_kerb5 in
  452:     no)		;;
  453:     *)		AC_MSG_CHECKING(whether to try Kerberos V authentication)
  454: 		AC_MSG_RESULT(yes)
  455: 		AUTH_REG="$AUTH_REG kerb5"
  456: 		;;
  457: esac])
  458: 
  459: AC_ARG_WITH(aixauth, [AS_HELP_STRING([--with-aixauth], [enable AIX general authentication support])],
  460: [case $with_aixauth in
  461:     yes)	AUTH_EXCL="$AUTH_EXCL AIX_AUTH";;
  462:     no)		;;
  463:     *)		AC_MSG_ERROR(["--with-aixauth does not take an argument."])
  464: 		;;
  465: esac])
  466: 
  467: AC_ARG_WITH(pam, [AS_HELP_STRING([--with-pam], [enable PAM support])],
  468: [case $with_pam in
  469:     yes)	AUTH_EXCL="$AUTH_EXCL PAM";;
  470:     no)		;;
  471:     *)		AC_MSG_ERROR(["--with-pam does not take an argument."])
  472: 		;;
  473: esac])
  474: 
  475: AC_ARG_WITH(AFS, [AS_HELP_STRING([--with-AFS], [enable AFS support])],
  476: [case $with_AFS in
  477:     yes)	AC_DEFINE(HAVE_AFS)
  478: 		AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
  479: 		AC_MSG_RESULT(yes)
  480: 		AUTH_REG="$AUTH_REG AFS"
  481: 		;;
  482:     no)		;;
  483:     *)		AC_MSG_ERROR(["--with-AFS does not take an argument."])
  484: 		;;
  485: esac])
  486: 
  487: AC_ARG_WITH(DCE, [AS_HELP_STRING([--with-DCE], [enable DCE support])],
  488: [case $with_DCE in
  489:     yes)	AC_DEFINE(HAVE_DCE)
  490: 		AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
  491: 		AC_MSG_RESULT(yes)
  492: 		AUTH_REG="$AUTH_REG DCE"
  493: 		;;
  494:     no)		;;
  495:     *)		AC_MSG_ERROR(["--with-DCE does not take an argument."])
  496: 		;;
  497: esac])
  498: 
  499: AC_ARG_WITH(logincap, [AS_HELP_STRING([--with-logincap], [enable BSD login class support])],
  500: [case $with_logincap in
  501:     yes|no)	;;
  502:     *)		AC_MSG_ERROR(["--with-logincap does not take an argument."])
  503: 		;;
  504: esac])
  505: 
  506: AC_ARG_WITH(bsdauth, [AS_HELP_STRING([--with-bsdauth], [enable BSD authentication support])],
  507: [case $with_bsdauth in
  508:     yes)	AUTH_EXCL="$AUTH_EXCL BSD_AUTH";;
  509:     no)		;;
  510:     *)		AC_MSG_ERROR(["--with-bsdauth does not take an argument."])
  511: 		;;
  512: esac])
  513: 
  514: AC_ARG_WITH(project, [AS_HELP_STRING([--with-project], [enable Solaris project support])],
  515: [case $with_project in
  516:     yes|no)	;;
  517:     no)	;;
  518:     *)		AC_MSG_ERROR(["--with-project does not take an argument."])
  519: 		;;
  520: esac])
  521: 
  522: AC_MSG_CHECKING(whether to lecture users the first time they run sudo)
  523: AC_ARG_WITH(lecture, [AS_HELP_STRING([--without-lecture], [don't print lecture for first-time sudoer])],
  524: [case $with_lecture in
  525:     yes|short|always)	lecture=once
  526: 		;;
  527:     no|none|never)	lecture=never
  528: 		;;
  529:     *)		AC_MSG_ERROR(["unknown argument to --with-lecture: $with_lecture"])
  530: 		;;
  531: esac])
  532: if test "$lecture" = "once"; then
  533:     AC_MSG_RESULT(yes)
  534: else
  535:     AC_DEFINE(NO_LECTURE)
  536:     AC_MSG_RESULT(no)
  537: fi
  538: 
  539: AC_MSG_CHECKING(whether sudo should log via syslog or to a file by default)
  540: AC_ARG_WITH(logging, [AS_HELP_STRING([--with-logging], [log via syslog, file, or both])],
  541: [case $with_logging in
  542:     yes)	AC_MSG_ERROR(["must give --with-logging an argument."])
  543: 		;;
  544:     no)		AC_MSG_ERROR(["--without-logging not supported."])
  545: 		;;
  546:     syslog)	AC_DEFINE(LOGGING, SLOG_SYSLOG)
  547: 		AC_MSG_RESULT(syslog)
  548: 		;;
  549:     file)	AC_DEFINE(LOGGING, SLOG_FILE)
  550: 		AC_MSG_RESULT(file)
  551: 		;;
  552:     both)	AC_DEFINE(LOGGING, SLOG_BOTH)
  553: 		AC_MSG_RESULT(both)
  554: 		;;
  555:     *)		AC_MSG_ERROR(["unknown argument to --with-logging: $with_logging"])
  556: 		;;
  557: esac], [AC_DEFINE(LOGGING, SLOG_SYSLOG) AC_MSG_RESULT(syslog)])
  558: 
  559: AC_ARG_WITH(logfac, [AS_HELP_STRING([--with-logfac], [syslog facility to log with (default is "auth")])],
  560: [case $with_logfac in
  561:     yes)	AC_MSG_ERROR(["must give --with-logfac an argument."])
  562: 		;;
  563:     no)		AC_MSG_ERROR(["--without-logfac not supported."])
  564: 		;;
  565:     authpriv|auth|daemon|user|local0|local1|local2|local3|local4|local5|local6|local7)		logfac=$with_logfac
  566: 		;;
  567:     *)		AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
  568: 		;;
  569: esac])
  570: 
  571: AC_MSG_CHECKING(at which syslog priority to log commands)
  572: AC_ARG_WITH(goodpri, [AS_HELP_STRING([--with-goodpri], [syslog priority for commands (def is "notice")])],
  573: [case $with_goodpri in
  574:     yes)	AC_MSG_ERROR(["must give --with-goodpri an argument."])
  575: 		;;
  576:     no)		AC_MSG_ERROR(["--without-goodpri not supported."])
  577: 		;;
  578:     alert|crit|debug|emerg|err|info|notice|warning)
  579: 		goodpri=$with_goodpri
  580: 		;;
  581:     *)		AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
  582: 		;;
  583: esac])
  584: AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
  585: AC_MSG_RESULT($goodpri)
  586: 
  587: AC_MSG_CHECKING(at which syslog priority to log failures)
  588: AC_ARG_WITH(badpri, [AS_HELP_STRING([--with-badpri], [syslog priority for failures (def is "alert")])],
  589: [case $with_badpri in
  590:     yes)	AC_MSG_ERROR(["must give --with-badpri an argument."])
  591: 		;;
  592:     no)		AC_MSG_ERROR(["--without-badpri not supported."])
  593: 		;;
  594:     alert|crit|debug|emerg|err|info|notice|warning)
  595: 		badpri=$with_badpri
  596: 		;;
  597:     *)		AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
  598: 		;;
  599: esac])
  600: AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
  601: AC_MSG_RESULT($badpri)
  602: 
  603: AC_ARG_WITH(logpath, [AS_HELP_STRING([--with-logpath], [path to the sudo log file])],
  604: [case $with_logpath in
  605:     yes)	AC_MSG_ERROR(["must give --with-logpath an argument."])
  606: 		;;
  607:     no)		AC_MSG_ERROR(["--without-logpath not supported."])
  608: 		;;
  609: esac])
  610: 
  611: AC_MSG_CHECKING(how long a line in the log file should be)
  612: AC_ARG_WITH(loglen, [AS_HELP_STRING([--with-loglen], [maximum length of a log file line (default is 80)])],
  613: [case $with_loglen in
  614:     yes)	AC_MSG_ERROR(["must give --with-loglen an argument."])
  615: 		;;
  616:     no)		AC_MSG_ERROR(["--without-loglen not supported."])
  617: 		;;
  618:     [[0-9]]*)	loglen=$with_loglen
  619: 		;;
  620:     *)		AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
  621: 		;;
  622: esac])
  623: AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
  624: AC_MSG_RESULT($loglen)
  625: 
  626: AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
  627: AC_ARG_WITH(ignore-dot, [AS_HELP_STRING([--with-ignore-dot], [ignore '.' in the PATH])],
  628: [case $with_ignore_dot in
  629:     yes)	ignore_dot=on
  630: 		;;
  631:     no)		ignore_dot=off
  632: 		;;
  633:     *)		AC_MSG_ERROR(["--with-ignore-dot does not take an argument."])
  634: 		;;
  635: esac])
  636: if test "$ignore_dot" = "on"; then
  637:     AC_DEFINE(IGNORE_DOT_PATH)
  638:     AC_MSG_RESULT(yes)
  639: else
  640:     AC_MSG_RESULT(no)
  641: fi
  642: 
  643: AC_MSG_CHECKING(whether to send mail when a user is not in sudoers)
  644: AC_ARG_WITH(mail-if-no-user, [AS_HELP_STRING([--without-mail-if-no-user], [do not send mail if user not in sudoers])],
  645: [case $with_mail_if_no_user in
  646:     yes)	mail_no_user=on
  647: 		;;
  648:     no)		mail_no_user=off
  649: 		;;
  650:     *)		AC_MSG_ERROR(["--with-mail-if-no-user does not take an argument."])
  651: 		;;
  652: esac])
  653: if test "$mail_no_user" = "on"; then
  654:     AC_DEFINE(SEND_MAIL_WHEN_NO_USER)
  655:     AC_MSG_RESULT(yes)
  656: else
  657:     AC_MSG_RESULT(no)
  658: fi
  659: 
  660: AC_MSG_CHECKING(whether to send mail when user listed but not for this host)
  661: AC_ARG_WITH(mail-if-no-host, [AS_HELP_STRING([--with-mail-if-no-host], [send mail if user in sudoers but not for this host])],
  662: [case $with_mail_if_no_host in
  663:     yes)	mail_no_host=on
  664: 		;;
  665:     no)		mail_no_host=off
  666: 		;;
  667:     *)		AC_MSG_ERROR(["--with-mail-if-no-host does not take an argument."])
  668: 		;;
  669: esac])
  670: if test "$mail_no_host" = "on"; then
  671:     AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
  672:     AC_MSG_RESULT(yes)
  673: else
  674:     AC_MSG_RESULT(no)
  675: fi
  676: 
  677: AC_MSG_CHECKING(whether to send mail when a user tries a disallowed command)
  678: AC_ARG_WITH(mail-if-noperms, [AS_HELP_STRING([--with-mail-if-noperms], [send mail if user not allowed to run command])],
  679: [case $with_mail_if_noperms in
  680:     yes)	mail_noperms=on
  681: 		;;
  682:     no)		mail_noperms=off
  683: 		;;
  684:     *)		AC_MSG_ERROR(["--with-mail-if-noperms does not take an argument."])
  685: 		;;
  686: esac])
  687: if test "$mail_noperms" = "on"; then
  688:     AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
  689:     AC_MSG_RESULT(yes)
  690: else
  691:     AC_MSG_RESULT(no)
  692: fi
  693: 
  694: AC_MSG_CHECKING(who should get the mail that sudo sends)
  695: AC_ARG_WITH(mailto, [AS_HELP_STRING([--with-mailto], [who should get sudo mail (default is "root")])],
  696: [case $with_mailto in
  697:     yes)	AC_MSG_ERROR(["must give --with-mailto an argument."])
  698: 		;;
  699:     no)		AC_MSG_ERROR(["--without-mailto not supported."])
  700: 		;;
  701:     *)		mailto=$with_mailto
  702: 		;;
  703: esac])
  704: AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
  705: AC_MSG_RESULT([$mailto])
  706: 
  707: AC_ARG_WITH(mailsubject, [AS_HELP_STRING([--with-mailsubject], [subject of sudo mail])],
  708: [case $with_mailsubject in
  709:     yes)	AC_MSG_ERROR(["must give --with-mailsubject an argument."])
  710: 		;;
  711:     no)		AC_MSG_WARN([Sorry, --without-mailsubject not supported.])
  712: 		;;
  713:     *)		mailsub="$with_mailsubject"
  714: 		AC_MSG_CHECKING(sudo mail subject)
  715: 		AC_MSG_RESULT([Using alert mail subject: $mailsub])
  716: 		;;
  717: esac])
  718: AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
  719: 
  720: AC_MSG_CHECKING(for bad password prompt)
  721: AC_ARG_WITH(passprompt, [AS_HELP_STRING([--with-passprompt], [default password prompt])],
  722: [case $with_passprompt in
  723:     yes)	AC_MSG_ERROR(["must give --with-passprompt an argument."])
  724: 		;;
  725:     no)		AC_MSG_WARN([Sorry, --without-passprompt not supported.])
  726: 		;;
  727:     *)		passprompt="$with_passprompt"
  728: esac])
  729: AC_MSG_RESULT($passprompt)
  730: AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
  731: 
  732: AC_MSG_CHECKING(for bad password message)
  733: AC_ARG_WITH(badpass-message, [AS_HELP_STRING([--with-badpass-message], [message the user sees when the password is wrong])],
  734: [case $with_badpass_message in
  735:     yes)	AC_MSG_ERROR(["Must give --with-badpass-message an argument."])
  736: 		;;
  737:     no)		AC_MSG_WARN([Sorry, --without-badpass-message not supported.])
  738: 		;;
  739:     *)		badpass_message="$with_badpass_message"
  740: 		;;
  741: esac])
  742: AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
  743: AC_MSG_RESULT([$badpass_message])
  744: 
  745: AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
  746: AC_ARG_WITH(fqdn, [AS_HELP_STRING([--with-fqdn], [expect fully qualified hosts in sudoers])],
  747: [case $with_fqdn in
  748:     yes)	fqdn=on
  749: 		;;
  750:     no)		fqdn=off
  751: 		;;
  752:     *)		AC_MSG_ERROR(["--with-fqdn does not take an argument."])
  753: 		;;
  754: esac])
  755: if test "$fqdn" = "on"; then
  756:     AC_DEFINE(FQDN)
  757:     AC_MSG_RESULT(yes)
  758: else
  759:     AC_MSG_RESULT(no)
  760: fi
  761: 
  762: AC_ARG_WITH(timedir, [AS_HELP_STRING([--with-timedir], [path to the sudo timestamp dir])],
  763: [case $with_timedir in
  764:     yes)	AC_MSG_ERROR(["must give --with-timedir an argument."])
  765: 		;;
  766:     no)		AC_MSG_ERROR(["--without-timedir not supported."])
  767: 		;;
  768: esac])
  769: 
  770: AC_ARG_WITH(iologdir, [AS_HELP_STRING([--with-iologdir=DIR], [directory to store sudo I/O log files in])],
  771: [case $with_iologdir in
  772:     yes)    ;;
  773:     no)     AC_MSG_ERROR(["--without-iologdir not supported."])
  774: 	    ;;
  775: esac])
  776: 
  777: AC_ARG_WITH(sendmail, [AS_HELP_STRING([--with-sendmail], [set path to sendmail])
  778: AS_HELP_STRING([--without-sendmail], [do not send mail at all])],
  779: [case $with_sendmail in
  780:     yes)	with_sendmail=""
  781: 		;;
  782:     no)		;;
  783:     *)		SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
  784: 		;;
  785: esac])
  786: 
  787: AC_ARG_WITH(sudoers-mode, [AS_HELP_STRING([--with-sudoers-mode], [mode of sudoers file (defaults to 0440)])],
  788: [case $with_sudoers_mode in
  789:     yes)	AC_MSG_ERROR(["must give --with-sudoers-mode an argument."])
  790: 		;;
  791:     no)		AC_MSG_ERROR(["--without-sudoers-mode not supported."])
  792: 		;;
  793:     [[1-9]]*)	SUDOERS_MODE=0${with_sudoers_mode}
  794: 		;;
  795:     0*)		SUDOERS_MODE=$with_sudoers_mode
  796: 		;;
  797:     *)		AC_MSG_ERROR(["you must use an octal mode, not a name."])
  798: 		;;
  799: esac])
  800: 
  801: AC_ARG_WITH(sudoers-uid, [AS_HELP_STRING([--with-sudoers-uid], [uid that owns sudoers file (defaults to 0)])],
  802: [case $with_sudoers_uid in
  803:     yes)	AC_MSG_ERROR(["must give --with-sudoers-uid an argument."])
  804: 		;;
  805:     no)		AC_MSG_ERROR(["--without-sudoers-uid not supported."])
  806: 		;;
  807:     [[0-9]]*)	SUDOERS_UID=$with_sudoers_uid
  808: 		;;
  809:     *)		AC_MSG_ERROR(["you must use an unsigned numeric uid, not a name."])
  810: 		;;
  811: esac])
  812: 
  813: AC_ARG_WITH(sudoers-gid, [AS_HELP_STRING([--with-sudoers-gid], [gid that owns sudoers file (defaults to 0)])],
  814: [case $with_sudoers_gid in
  815:     yes)	AC_MSG_ERROR(["must give --with-sudoers-gid an argument."])
  816: 		;;
  817:     no)		AC_MSG_ERROR(["--without-sudoers-gid not supported."])
  818: 		;;
  819:     [[0-9]]*)	SUDOERS_GID=$with_sudoers_gid
  820: 		;;
  821:     *)		AC_MSG_ERROR(["you must use an unsigned numeric gid, not a name."])
  822: 		;;
  823: esac])
  824: 
  825: AC_MSG_CHECKING(for umask programs should be run with)
  826: AC_ARG_WITH(umask, [AS_HELP_STRING([--with-umask], [umask with which the prog should run (default is 022)])
  827: AS_HELP_STRING([--without-umask], [Preserves the umask of the user invoking sudo.])],
  828: [case $with_umask in
  829:     yes)	AC_MSG_ERROR(["must give --with-umask an argument."])
  830: 		;;
  831:     no)		sudo_umask=0777
  832: 		;;
  833:     [[0-9]]*)	sudo_umask=$with_umask
  834: 		;;
  835:     *)		AC_MSG_ERROR(["you must enter a numeric mask."])
  836: 		;;
  837: esac])
  838: AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the sudo-run prog should use.])
  839: if test "$sudo_umask" = "0777"; then
  840:     AC_MSG_RESULT(user)
  841: else
  842:     AC_MSG_RESULT($sudo_umask)
  843: fi
  844: 
  845: AC_ARG_WITH(umask-override, [AS_HELP_STRING([--with-umask-override], [Use the umask specified in sudoers even if it is less restrictive than the user's.])],
  846: [case $with_umask_override in
  847:     yes)	AC_DEFINE(UMASK_OVERRIDE)
  848: 		umask_override=on
  849: 		;;
  850:     no)		umask_override=off
  851: 		;;
  852:     *)		AC_MSG_ERROR(["--with-umask-override does not take an argument."])
  853: 		;;
  854: esac])
  855: 
  856: AC_MSG_CHECKING(for default user to run commands as)
  857: AC_ARG_WITH(runas-default, [AS_HELP_STRING([--with-runas-default], [User to run commands as (default is "root")])],
  858: [case $with_runas_default in
  859:     yes)	AC_MSG_ERROR(["must give --with-runas-default an argument."])
  860: 		;;
  861:     no)		AC_MSG_ERROR(["--without-runas-default not supported."])
  862: 		;;
  863:     *)		runas_default="$with_runas_default"
  864: 		;;
  865: esac])
  866: AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
  867: AC_MSG_RESULT([$runas_default])
  868: 
  869: AC_ARG_WITH(exempt, [AS_HELP_STRING([--with-exempt=group], [no passwd needed for users in this group])],
  870: [case $with_exempt in
  871:     yes)	AC_MSG_ERROR(["must give --with-exempt an argument."])
  872: 		;;
  873:     no)		AC_MSG_ERROR(["--without-exempt not supported."])
  874: 		;;
  875:     *)		AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
  876: 		AC_MSG_CHECKING(for group to be exempt from password)
  877: 		AC_MSG_RESULT([$with_exempt])
  878: 		;;
  879: esac])
  880: 
  881: AC_MSG_CHECKING(for editor that visudo should use)
  882: AC_ARG_WITH(editor, [AS_HELP_STRING([--with-editor=path], [Default editor for visudo (defaults to vi)])],
  883: [case $with_editor in
  884:     yes)	AC_MSG_ERROR(["must give --with-editor an argument."])
  885: 		;;
  886:     no)		AC_MSG_ERROR(["--without-editor not supported."])
  887: 		;;
  888:     *)		AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
  889: 		AC_MSG_RESULT([$with_editor])
  890: 		editor="$with_editor"
  891: 		;;
  892: esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
  893: 
  894: AC_MSG_CHECKING(whether to obey EDITOR and VISUAL environment variables)
  895: AC_ARG_WITH(env-editor, [AS_HELP_STRING([--with-env-editor], [Use the environment variable EDITOR for visudo])],
  896: [case $with_env_editor in
  897:     yes)	env_editor=on
  898: 		;;
  899:     no)		env_editor=off
  900: 		;;
  901:     *)		AC_MSG_ERROR(["--with-env-editor does not take an argument."])
  902: 		;;
  903: esac])
  904: if test "$env_editor" = "on"; then
  905:     AC_DEFINE(ENV_EDITOR)
  906:     AC_MSG_RESULT(yes)
  907: else
  908:     AC_MSG_RESULT(no)
  909: fi
  910: 
  911: AC_MSG_CHECKING(number of tries a user gets to enter their password)
  912: AC_ARG_WITH(passwd-tries, [AS_HELP_STRING([--with-passwd-tries], [number of tries to enter password (default is 3)])],
  913: [case $with_passwd_tries in
  914:     yes)	;;
  915:     no)		AC_MSG_ERROR(["--without-editor not supported."])
  916: 		;;
  917:     [[1-9]]*)	passwd_tries=$with_passwd_tries
  918: 		;;
  919:     *)		AC_MSG_ERROR(["you must enter the numer of tries, > 0"])
  920: 		;;
  921: esac])
  922: AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
  923: AC_MSG_RESULT($passwd_tries)
  924: 
  925: AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
  926: AC_ARG_WITH(timeout, [AS_HELP_STRING([--with-timeout], [minutes before sudo asks for passwd again (def is 5 minutes)])],
  927: [case $with_timeout in
  928:     yes)	;;
  929:     no)		timeout=0
  930: 		;;
  931:     [[0-9]]*)	timeout=$with_timeout
  932: 		;;
  933:     *)		AC_MSG_ERROR(["you must enter the numer of minutes."])
  934: 		;;
  935: esac])
  936: AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
  937: AC_MSG_RESULT($timeout)
  938: 
  939: AC_MSG_CHECKING(time in minutes after the password prompt will time out)
  940: AC_ARG_WITH(password-timeout, [AS_HELP_STRING([--with-password-timeout], [passwd prompt timeout in minutes (default is 5 minutes)])],
  941: [case $with_password_timeout in
  942:     yes)	;;
  943:     no)		password_timeout=0
  944: 		;;
  945:     [[0-9]]*)	password_timeout=$with_password_timeout
  946: 		;;
  947:     *)		AC_MSG_ERROR(["you must enter the numer of minutes."])
  948: 		;;
  949: esac])
  950: AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
  951: AC_MSG_RESULT($password_timeout)
  952: 
  953: AC_MSG_CHECKING(whether to use per-tty ticket files)
  954: AC_ARG_WITH(tty-tickets, [AS_HELP_STRING([--with-tty-tickets], [use a different ticket file for each tty])],
  955: [case $with_tty_tickets in
  956:     yes)	tty_tickets=on
  957: 		;;
  958:     no)		tty_tickets=off
  959: 		;;
  960:     *)		AC_MSG_ERROR(["--with-tty-tickets does not take an argument."])
  961: 		;;
  962: esac])
  963: if test "$tty_tickets" = "off"; then
  964:     AC_DEFINE(NO_TTY_TICKETS)
  965:     AC_MSG_RESULT(no)
  966: else
  967:     AC_MSG_RESULT(yes)
  968: fi
  969: 
  970: AC_MSG_CHECKING(whether to include insults)
  971: AC_ARG_WITH(insults, [AS_HELP_STRING([--with-insults], [insult the user for entering an incorrect password])],
  972: [case $with_insults in
  973:     yes)	insults=on
  974: 		with_classic_insults=yes
  975: 		with_csops_insults=yes
  976: 		;;
  977:     disabled)	insults=off
  978: 		with_classic_insults=yes
  979: 		with_csops_insults=yes
  980: 		;;
  981:     no)		insults=off
  982: 		;;
  983:     *)		AC_MSG_ERROR(["--with-insults does not take an argument."])
  984: 		;;
  985: esac])
  986: if test "$insults" = "on"; then
  987:     AC_DEFINE(USE_INSULTS)
  988:     AC_MSG_RESULT(yes)
  989: else
  990:     AC_MSG_RESULT(no)
  991: fi
  992: 
  993: AC_ARG_WITH(all-insults, [AS_HELP_STRING([--with-all-insults], [include all the sudo insult sets])],
  994: [case $with_all_insults in
  995:     yes)	with_classic_insults=yes
  996: 		with_csops_insults=yes
  997: 		with_hal_insults=yes
  998: 		with_goons_insults=yes
  999: 		;;
 1000:     no)		;;
 1001:     *)		AC_MSG_ERROR(["--with-all-insults does not take an argument."])
 1002: 		;;
 1003: esac])
 1004: 
 1005: AC_ARG_WITH(classic-insults, [AS_HELP_STRING([--with-classic-insults], [include the insults from the "classic" sudo])],
 1006: [case $with_classic_insults in
 1007:     yes)	AC_DEFINE(CLASSIC_INSULTS)
 1008: 		;;
 1009:     no)		;;
 1010:     *)		AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
 1011: 		;;
 1012: esac])
 1013: 
 1014: AC_ARG_WITH(csops-insults, [AS_HELP_STRING([--with-csops-insults], [include CSOps insults])],
 1015: [case $with_csops_insults in
 1016:     yes)	AC_DEFINE(CSOPS_INSULTS)
 1017: 		;;
 1018:     no)		;;
 1019:     *)		AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
 1020: 		;;
 1021: esac])
 1022: 
 1023: AC_ARG_WITH(hal-insults, [AS_HELP_STRING([--with-hal-insults], [include 2001-like insults])],
 1024: [case $with_hal_insults in
 1025:     yes)	AC_DEFINE(HAL_INSULTS)
 1026: 		;;
 1027:     no)		;;
 1028:     *)		AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
 1029: 		;;
 1030: esac])
 1031: 
 1032: AC_ARG_WITH(goons-insults, [AS_HELP_STRING([--with-goons-insults], [include the insults from the "Goon Show"])],
 1033: [case $with_goons_insults in
 1034:     yes)	AC_DEFINE(GOONS_INSULTS)
 1035: 		;;
 1036:     no)		;;
 1037:     *)		AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
 1038: 		;;
 1039: esac])
 1040: 
 1041: AC_ARG_WITH(nsswitch, [AS_HELP_STRING([--with-nsswitch[[=PATH]]], [path to nsswitch.conf])],
 1042: [case $with_nsswitch in
 1043:     no)		;;
 1044:     yes)	with_nsswitch="/etc/nsswitch.conf"
 1045: 		;;
 1046:     *)		;;
 1047: esac])
 1048: 
 1049: AC_ARG_WITH(ldap, [AS_HELP_STRING([--with-ldap[[=DIR]]], [enable LDAP support])],
 1050: [case $with_ldap in
 1051:     no)		;;
 1052:     *)		AC_DEFINE(HAVE_LDAP)
 1053: 		AC_MSG_CHECKING(whether to use sudoers from LDAP)
 1054: 		AC_MSG_RESULT(yes)
 1055: 		;;
 1056: esac])
 1057: 
 1058: AC_ARG_WITH(ldap-conf-file, [AS_HELP_STRING([--with-ldap-conf-file], [path to LDAP configuration file])])
 1059: test -n "$with_ldap_conf_file" && ldap_conf="$with_ldap_conf_file"
 1060: SUDO_DEFINE_UNQUOTED(_PATH_LDAP_CONF, "$ldap_conf", [Path to the ldap.conf file])
 1061: 
 1062: AC_ARG_WITH(ldap-secret-file, [AS_HELP_STRING([--with-ldap-secret-file], [path to LDAP secret password file])])
 1063: test -n "$with_ldap_secret_file" && ldap_secret="$with_ldap_secret_file"
 1064: SUDO_DEFINE_UNQUOTED(_PATH_LDAP_SECRET, "$ldap_secret", [Path to the ldap.secret file])
 1065: 
 1066: AC_ARG_WITH(pc-insults, [AS_HELP_STRING([--with-pc-insults], [replace politically incorrect insults with less offensive ones])],
 1067: [case $with_pc_insults in
 1068:     yes)	AC_DEFINE(PC_INSULTS)
 1069: 		;;
 1070:     no)		;;
 1071:     *)		AC_MSG_ERROR(["--with-pc-insults does not take an argument."])
 1072: 		;;
 1073: esac])
 1074: 
 1075: dnl include all insult sets on one line
 1076: if test "$insults" = "on"; then
 1077:     AC_MSG_CHECKING(which insult sets to include)
 1078:     i=""
 1079:     test "$with_goons_insults" = "yes" && i="goons ${i}"
 1080:     test "$with_hal_insults" = "yes" && i="hal ${i}"
 1081:     test "$with_csops_insults" = "yes" && i="csops ${i}"
 1082:     test "$with_classic_insults" = "yes" && i="classic ${i}"
 1083:     AC_MSG_RESULT([$i])
 1084: fi
 1085: 
 1086: AC_MSG_CHECKING(whether to override the user's path)
 1087: AC_ARG_WITH(secure-path, [AS_HELP_STRING([--with-secure-path], [override the user's path with a built-in one])],
 1088: [case $with_secure_path in
 1089:     yes)	with_secure_path="/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc"
 1090: 		AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
 1091: 		AC_MSG_RESULT([$with_secure_path])
 1092: 		secure_path="set to $with_secure_path"
 1093: 		;;
 1094:     no)		AC_MSG_RESULT(no)
 1095: 		;;
 1096:     *)		AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
 1097: 		AC_MSG_RESULT([$with_secure_path])
 1098: 		secure_path="set to F<$with_secure_path>"
 1099: 		;;
 1100: esac], AC_MSG_RESULT(no))
 1101: 
 1102: AC_MSG_CHECKING(whether to get ip addresses from the network interfaces)
 1103: AC_ARG_WITH(interfaces, [AS_HELP_STRING([--without-interfaces], [don't try to read the ip addr of ether interfaces])],
 1104: [case $with_interfaces in
 1105:     yes)	AC_MSG_RESULT(yes)
 1106: 		;;
 1107:     no)		AC_DEFINE(STUB_LOAD_INTERFACES)
 1108: 		AC_MSG_RESULT(no)
 1109: 		;;
 1110:     *)		AC_MSG_ERROR(["--with-interfaces does not take an argument."])
 1111: 		;;
 1112: esac], AC_MSG_RESULT(yes))
 1113: 
 1114: AC_ARG_WITH(stow, [AS_HELP_STRING([--with-stow], [deprecated])],
 1115: [case $with_stow in
 1116:     *)		AC_MSG_NOTICE([--with-stow option deprecated, now is defalt behavior])
 1117: 		;;
 1118: esac])
 1119: 
 1120: AC_MSG_CHECKING(whether to use an askpass helper)
 1121: AC_ARG_WITH(askpass, [AS_HELP_STRING([--with-askpass=PATH], [Fully qualified pathname of askpass helper])],
 1122: [case $with_askpass in
 1123:     yes)	AC_MSG_ERROR(["--with-askpass takes a path as an argument."])
 1124: 		;;
 1125:     no)		;;
 1126:     *)		SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ASKPASS, "$with_askpass", [The fully qualified pathname of askpass])
 1127: 		;;
 1128: esac], AC_MSG_RESULT(no))
 1129: 
 1130: AC_ARG_WITH(plugindir, [AS_HELP_STRING([--with-plugindir], [set directory to load plugins from])],
 1131: [case $with_plugindir in
 1132:     no)		AC_MSG_ERROR(["illegal argument: --without-plugindir."])
 1133: 		;;
 1134:     *)		;;
 1135: esac], [with_plugindir="$libexecdir"])
 1136: 
 1137: AC_ARG_WITH(man, [AS_HELP_STRING([--with-man], [manual pages use man macros])],
 1138: [case $with_man in
 1139:     yes)	MANTYPE=man
 1140: 		;;
 1141:     no)		AC_MSG_ERROR(["--without-man not supported."])
 1142: 		;;
 1143:     *)		AC_MSG_ERROR(["ignoring unknown argument to --with-man: $with_man."])
 1144: 		;;
 1145: esac])
 1146: 
 1147: AC_ARG_WITH(mdoc, [AS_HELP_STRING([--with-mdoc], [manual pages use mdoc macros])],
 1148: [case $with_mdoc in
 1149:     yes)	MANTYPE=mdoc
 1150: 		;;
 1151:     no)		AC_MSG_ERROR(["--without-mdoc not supported."])
 1152: 		;;
 1153:     *)		AC_MSG_ERROR(["ignoring unknown argument to --with-mdoc: $with_mdoc."])
 1154: 		;;
 1155: esac])
 1156: 
 1157: dnl
 1158: dnl Options for --enable
 1159: dnl
 1160: 
 1161: AC_MSG_CHECKING(whether to do user authentication by default)
 1162: AC_ARG_ENABLE(authentication,
 1163: [AS_HELP_STRING([--disable-authentication], [Do not require authentication by default])],
 1164: [ case "$enableval" in
 1165:     yes)	AC_MSG_RESULT(yes)
 1166: 		;;
 1167:     no)		AC_MSG_RESULT(no)
 1168: 		AC_DEFINE(NO_AUTHENTICATION)
 1169: 		;;
 1170:     *)		AC_MSG_RESULT(no)
 1171:     		AC_MSG_WARN([Ignoring unknown argument to --enable-authentication: $enableval])
 1172: 		;;
 1173:   esac
 1174: ], AC_MSG_RESULT(yes))
 1175: 
 1176: AC_MSG_CHECKING(whether to disable running the mailer as root)
 1177: AC_ARG_ENABLE(root-mailer,
 1178: [AS_HELP_STRING([--disable-root-mailer], [Don't run the mailer as root, run as the user])],
 1179: [ case "$enableval" in
 1180:     yes)	AC_MSG_RESULT(no)
 1181: 		;;
 1182:     no)		AC_MSG_RESULT(yes)
 1183: 		AC_DEFINE(NO_ROOT_MAILER)
 1184: 		;;
 1185:     *)		AC_MSG_RESULT(no)
 1186:     		AC_MSG_WARN([Ignoring unknown argument to --enable-root-mailer: $enableval])
 1187: 		;;
 1188:   esac
 1189: ], AC_MSG_RESULT(no))
 1190: 
 1191: AC_ARG_ENABLE(setreuid,
 1192: [AS_HELP_STRING([--disable-setreuid], [Don't try to use the setreuid() function])],
 1193: [ case "$enableval" in
 1194:     no)		SKIP_SETREUID=yes
 1195: 		;;
 1196:     *)		;;
 1197:   esac
 1198: ])
 1199: 
 1200: AC_ARG_ENABLE(setresuid,
 1201: [AS_HELP_STRING([--disable-setresuid], [Don't try to use the setresuid() function])],
 1202: [ case "$enableval" in
 1203:     no)		SKIP_SETRESUID=yes
 1204: 		;;
 1205:     *)		;;
 1206:   esac
 1207: ])
 1208: 
 1209: AC_MSG_CHECKING(whether to disable shadow password support)
 1210: AC_ARG_ENABLE(shadow,
 1211: [AS_HELP_STRING([--disable-shadow], [Never use shadow passwords])],
 1212: [ case "$enableval" in
 1213:     yes)	AC_MSG_RESULT(no)
 1214: 		;;
 1215:     no)		AC_MSG_RESULT(yes)
 1216: 		CHECKSHADOW="false"
 1217: 		;;
 1218:     *)		AC_MSG_RESULT(no)
 1219:     		AC_MSG_WARN([Ignoring unknown argument to --enable-shadow: $enableval])
 1220: 		;;
 1221:   esac
 1222: ], AC_MSG_RESULT(no))
 1223: 
 1224: AC_MSG_CHECKING(whether root should be allowed to use sudo)
 1225: AC_ARG_ENABLE(root-sudo,
 1226: [AS_HELP_STRING([--disable-root-sudo], [Don't allow root to run sudo])],
 1227: [ case "$enableval" in
 1228:     yes)	AC_MSG_RESULT(yes)
 1229: 		;;
 1230:     no)		AC_DEFINE(NO_ROOT_SUDO)
 1231: 		AC_MSG_RESULT(no)
 1232: 		root_sudo=off
 1233: 		;;
 1234:     *)		AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
 1235: 		;;
 1236:   esac
 1237: ], AC_MSG_RESULT(yes))
 1238: 
 1239: AC_MSG_CHECKING(whether to log the hostname in the log file)
 1240: AC_ARG_ENABLE(log-host,
 1241: [AS_HELP_STRING([--enable-log-host], [Log the hostname in the log file])],
 1242: [ case "$enableval" in
 1243:     yes)	AC_MSG_RESULT(yes)
 1244: 		AC_DEFINE(HOST_IN_LOG)
 1245: 		;;
 1246:     no)		AC_MSG_RESULT(no)
 1247: 		;;
 1248:     *)		AC_MSG_RESULT(no)
 1249:     		AC_MSG_WARN([Ignoring unknown argument to --enable-log-host: $enableval])
 1250: 		;;
 1251:   esac
 1252: ], AC_MSG_RESULT(no))
 1253: 
 1254: AC_MSG_CHECKING(whether to invoke a shell if sudo is given no arguments)
 1255: AC_ARG_ENABLE(noargs-shell,
 1256: [AS_HELP_STRING([--enable-noargs-shell], [If sudo is given no arguments run a shell])],
 1257: [ case "$enableval" in
 1258:     yes)	AC_MSG_RESULT(yes)
 1259: 		AC_DEFINE(SHELL_IF_NO_ARGS)
 1260: 		;;
 1261:     no)		AC_MSG_RESULT(no)
 1262: 		;;
 1263:     *)		AC_MSG_RESULT(no)
 1264:     		AC_MSG_WARN([Ignoring unknown argument to --enable-noargs-shell: $enableval])
 1265: 		;;
 1266:   esac
 1267: ], AC_MSG_RESULT(no))
 1268: 
 1269: AC_MSG_CHECKING(whether to set \$HOME to target user in shell mode)
 1270: AC_ARG_ENABLE(shell-sets-home,
 1271: [AS_HELP_STRING([--enable-shell-sets-home], [Set $HOME to target user in shell mode])],
 1272: [ case "$enableval" in
 1273:     yes)	AC_MSG_RESULT(yes)
 1274: 		AC_DEFINE(SHELL_SETS_HOME)
 1275: 		;;
 1276:     no)		AC_MSG_RESULT(no)
 1277: 		;;
 1278:     *)		AC_MSG_RESULT(no)
 1279:     		AC_MSG_WARN([Ignoring unknown argument to --enable-shell-sets-home: $enableval])
 1280: 		;;
 1281:   esac
 1282: ], AC_MSG_RESULT(no))
 1283: 
 1284: AC_MSG_CHECKING(whether to disable 'command not found' messages)
 1285: AC_ARG_ENABLE(path_info,
 1286: [AS_HELP_STRING([--disable-path-info], [Print 'command not allowed' not 'command not found'])],
 1287: [ case "$enableval" in
 1288:     yes)	AC_MSG_RESULT(no)
 1289: 		;;
 1290:     no)		AC_MSG_RESULT(yes)
 1291: 		AC_DEFINE(DONT_LEAK_PATH_INFO)
 1292: 		path_info=off
 1293: 		;;
 1294:     *)		AC_MSG_RESULT(no)
 1295: 		AC_MSG_WARN([Ignoring unknown argument to --enable-path-info: $enableval])
 1296: 		;;
 1297:   esac
 1298: ], AC_MSG_RESULT(no))
 1299: 
 1300: AC_MSG_CHECKING(whether to enable environment debugging)
 1301: AC_ARG_ENABLE(env_debug,
 1302: [AS_HELP_STRING([--enable-env-debug], [Whether to enable environment debugging.])],
 1303: [ case "$enableval" in
 1304:     yes)	AC_MSG_RESULT(yes)
 1305: 		AC_DEFINE(ENV_DEBUG)
 1306: 		;;
 1307:     no)		AC_MSG_RESULT(no)
 1308: 		;;
 1309:     *)		AC_MSG_RESULT(no)
 1310:     		AC_MSG_WARN([Ignoring unknown argument to --enable-env-debug: $enableval])
 1311: 		;;
 1312:   esac
 1313: ], AC_MSG_RESULT(no))
 1314: 
 1315: AC_ARG_ENABLE(zlib,
 1316: [AS_HELP_STRING([--enable-zlib[[=PATH]]], [Whether to enable or disable zlib])],
 1317: [], [enable_zlib=yes])
 1318: 
 1319: AC_MSG_CHECKING(whether to enable environment resetting by default)
 1320: AC_ARG_ENABLE(env_reset,
 1321: [AS_HELP_STRING([--enable-env-reset], [Whether to enable environment resetting by default.])],
 1322: [ case "$enableval" in
 1323:     yes)	env_reset=on
 1324: 		;;
 1325:     no)		env_reset=off
 1326: 		;;
 1327:     *)		env_reset=on
 1328:     		AC_MSG_WARN([Ignoring unknown argument to --enable-env-reset: $enableval])
 1329: 		;;
 1330:   esac
 1331: ])
 1332: if test "$env_reset" = "on"; then
 1333:     AC_MSG_RESULT(yes)
 1334:     AC_DEFINE(ENV_RESET, 1)
 1335: else
 1336:     AC_MSG_RESULT(no)
 1337:     AC_DEFINE(ENV_RESET, 0)
 1338: fi
 1339: 
 1340: AC_ARG_ENABLE(warnings,
 1341: [AS_HELP_STRING([--enable-warnings], [Whether to enable compiler warnings])],
 1342: [ case "$enableval" in
 1343:     yes)    ;;
 1344:     no)	    ;;
 1345:     *)	    AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval])
 1346: 	    ;;
 1347:   esac
 1348: ])
 1349: 
 1350: AC_ARG_ENABLE(werror,
 1351: [AS_HELP_STRING([--enable-werror], [Whether to enable the -Werror compiler option])],
 1352: [ case "$enableval" in
 1353:     yes)    ;;
 1354:     no)	    ;;
 1355:     *)	    AC_MSG_WARN([Ignoring unknown argument to --enable-werror: $enableval])
 1356: 	    ;;
 1357:   esac
 1358: ])
 1359: 
 1360: AC_ARG_ENABLE(hardening,
 1361: [AS_HELP_STRING([--disable-hardening], [Do not use compiler/linker exploit mitigation options])],
 1362: [], [enable_hardening=yes])
 1363: 
 1364: AC_ARG_ENABLE(pie,
 1365: [AS_HELP_STRING([--disable-pie], [Do not build position independent executables, even if the compiler/linker supports them])],
 1366: [], [enable_pie=yes])
 1367: 
 1368: AC_ARG_ENABLE(admin-flag,
 1369: [AS_HELP_STRING([--enable-admin-flag], [Whether to create a Ubuntu-style admin flag file])],
 1370: [ case "$enableval" in
 1371:     yes)    AC_DEFINE(USE_ADMIN_FLAG)
 1372: 	    ;;
 1373:     no)	    ;;
 1374:     *)	    AC_MSG_WARN([Ignoring unknown argument to --enable-admin-flag: $enableval])
 1375: 	    ;;
 1376:   esac
 1377: ])
 1378: 
 1379: AC_ARG_ENABLE(nls,
 1380: [AS_HELP_STRING([--disable-nls], [Disable natural language support using gettext])],
 1381: [], [enable_nls=yes])
 1382: 
 1383: AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
 1384: [case $with_selinux in
 1385:     yes)	SELINUX_USAGE="[[-r role]] [[-t type]] "
 1386:     		AC_DEFINE(HAVE_SELINUX)
 1387: 		SUDO_LIBS="${SUDO_LIBS} -lselinux"
 1388: 		SUDO_OBJS="${SUDO_OBJS} selinux.o"
 1389: 		PROGS="${PROGS} sesh"
 1390: 		SEMAN=1
 1391: 		AC_CHECK_LIB([selinux], [setkeycreatecon],
 1392: 		    [AC_DEFINE(HAVE_SETKEYCREATECON)])
 1393: 		;;
 1394:     no)		;;
 1395:     *)		AC_MSG_ERROR(["--with-selinux does not take an argument."])
 1396: 		;;
 1397: esac])
 1398: 
 1399: dnl
 1400: dnl gss_krb5_ccache_name() may not work on Heimdal so we don't use it by default
 1401: dnl
 1402: AC_ARG_ENABLE(gss_krb5_ccache_name,
 1403: [AS_HELP_STRING([--enable-gss-krb5-ccache-name], [Use GSS-API to set the Kerberos V cred cache name])],
 1404: [check_gss_krb5_ccache_name=$enableval], [check_gss_krb5_ccache_name=no])
 1405: 
 1406: dnl
 1407: dnl C compiler checks
 1408: dnl
 1409: AC_SEARCH_LIBS([strerror], [cposix])
 1410: AC_PROG_CPP
 1411: AC_CHECK_TOOL(AR, ar, false)
 1412: AC_CHECK_TOOL(RANLIB, ranlib, :)
 1413: if test X"$AR" = X"false"; then
 1414:     AC_MSG_ERROR([the "ar" utility is required to build sudo])
 1415: fi
 1416: 
 1417: if test "x$ac_cv_prog_cc_c89" = "xno"; then
 1418:     AC_MSG_ERROR([Sudo version $PACKAGE_VERSION requires an ANSI C compiler to build.])
 1419: fi
 1420: 
 1421: dnl
 1422: dnl If the user specified --disable-static, override them or we'll
 1423: dnl be unable to build the executables in the sudoers plugin dir.
 1424: dnl
 1425: if test "$enable_static" = "no"; then
 1426:     AC_MSG_WARN([Ignoring --disable-static, sudo does not install static libs])
 1427:     enable_static=yes
 1428: fi
 1429: 
 1430: dnl
 1431: dnl Libtool setup, we require libtool 2.2.6b or higher
 1432: dnl
 1433: AC_CANONICAL_HOST
 1434: AC_CONFIG_MACRO_DIR([m4])
 1435: LT_PREREQ([2.2.6b])
 1436: LT_INIT([dlopen])
 1437: 
 1438: dnl
 1439: dnl Defer with_noexec until after libtool magic runs
 1440: dnl
 1441: if test "$enable_shared" = "no"; then
 1442:     with_noexec=no
 1443:     enable_dlopen=no
 1444:     lt_cv_dlopen=none
 1445:     lt_cv_dlopen_libs=
 1446:     ac_cv_func_dlopen=no
 1447: else
 1448:     eval _shrext="$shrext_cmds"
 1449:     # Darwin uses .dylib for libraries but .so for modules
 1450:     if test X"$_shrext" = X".dylib"; then
 1451: 	SOEXT=".so"
 1452:     else
 1453: 	SOEXT="$_shrext"
 1454:     fi
 1455: fi
 1456: AC_MSG_CHECKING(path to sudo_noexec.so)
 1457: AC_ARG_WITH(noexec, [AS_HELP_STRING([--with-noexec[=PATH]], [fully qualified pathname of sudo_noexec.so])],
 1458: [case $with_noexec in
 1459:     yes)	with_noexec="$libexecdir/sudo_noexec$_shrext"
 1460: 		;;
 1461:     no)		;;
 1462:     *)		;;
 1463: esac], [with_noexec="$libexecdir/sudo_noexec$_shrext"])
 1464: AC_MSG_RESULT($with_noexec)
 1465: NOEXECFILE="sudo_noexec$_shrext"
 1466: NOEXECDIR="`echo $with_noexec|sed -e 's:^${\([[^}]]*\)}:$(\1):' -e 's:^\(.*\)/[[^/]]*:\1:'`"
 1467: 
 1468: dnl
 1469: dnl Find programs we use
 1470: dnl
 1471: AC_PATH_PROG(UNAMEPROG, [uname], [uname])
 1472: AC_PATH_PROG(TRPROG, [tr], [tr])
 1473: AC_PATH_PROG(MANDOCPROG, [mandoc], [mandoc])
 1474: if test "$MANDOCPROG" != "mandoc"; then
 1475:     : ${MANTYPE='mdoc'}
 1476: else
 1477:     AC_PATH_PROG(NROFFPROG, [nroff])
 1478:     if test -n "$NROFFPROG"; then
 1479: 	test -n "$MANTYPE" && sudo_cv_var_mantype="$MANTYPE"
 1480: 	AC_CACHE_CHECK([which macro set to use for manual pages],
 1481: 	    [sudo_cv_var_mantype],
 1482: 	    [
 1483: 		sudo_cv_var_mantype="man"
 1484: 		echo ".Sh NAME" > conftest
 1485: 		echo ".Nm sudo" >> conftest
 1486: 		echo ".Nd sudo" >> conftest
 1487: 		echo ".Sh DESCRIPTION" >> conftest
 1488: 		echo "sudo" >> conftest
 1489: 		if $NROFFPROG -mdoc conftest >/dev/null 2>&1; then
 1490: 		    sudo_cv_var_mantype="mdoc"
 1491: 		fi
 1492: 		rm -f conftest
 1493: 	    ]
 1494: 	)
 1495: 	MANTYPE="$sudo_cv_var_mantype"
 1496:     else
 1497: 	MANTYPE=cat
 1498: 	MANDIRTYPE=cat
 1499: 	mansrcdir='$(srcdir)'
 1500:     fi
 1501: fi
 1502: 
 1503: dnl
 1504: dnl What kind of beastie are we being run on?
 1505: dnl Barf if config.cache was generated on another host.
 1506: dnl
 1507: if test -n "$sudo_cv_prev_host"; then
 1508:     if test "$sudo_cv_prev_host" != "$host"; then
 1509: 	AC_MSG_ERROR([config.cache was created on a different host; remove it and re-run configure.])
 1510:     else
 1511: 	AC_MSG_CHECKING(previous host type)
 1512: 	AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
 1513: 	AC_MSG_RESULT([$sudo_cv_prev_host])
 1514:     fi
 1515: else
 1516:     # this will produce no output since there is no cached value
 1517:     AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
 1518: fi
 1519: 
 1520: dnl
 1521: dnl We want to be able to differentiate between different rev's
 1522: dnl
 1523: if test -n "$host_os"; then
 1524:     OS=`echo $host_os | sed 's/[[0-9]].*//'`
 1525:     OSREV=`echo $host_os | sed 's/^[[^0-9\.]]*\([[0-9\.]]*\).*$/\1/'`
 1526:     OSMAJOR=`echo $OSREV | sed 's/\..*$//'`
 1527: else
 1528:     OS="unknown"
 1529:     OSREV=0
 1530:     OSMAJOR=0
 1531: fi
 1532: 
 1533: case "$host" in
 1534:     *-*-sunos4*)
 1535: 		# LD_PRELOAD is space-delimited
 1536: 		RTLD_PRELOAD_DELIM=" "
 1537: 
 1538: 		# getcwd(3) opens a pipe to getpwd(1)!?!
 1539: 		BROKEN_GETCWD=1
 1540: 
 1541: 		# system headers lack prototypes but gcc helps...
 1542: 		if test -n "$GCC"; then
 1543: 		    OSDEFS="${OSDEFS} -D__USE_FIXED_PROTOTYPES__"
 1544: 		fi
 1545: 
 1546: 		shadow_funcs="getpwanam issecure"
 1547: 		;;
 1548:     *-*-solaris2*)
 1549: 		# LD_PRELOAD is space-delimited
 1550: 		RTLD_PRELOAD_DELIM=" "
 1551: 
 1552: 		# To get the crypt(3) prototype (so we pass -Wall)
 1553: 		OSDEFS="${OSDEFS} -D__EXTENSIONS__"
 1554: 		# AFS support needs -lucb
 1555: 		if test "$with_AFS" = "yes"; then
 1556: 		    AFS_LIBS="-lc -lucb"
 1557: 		fi
 1558: 		: ${mansectsu='1m'}
 1559: 		: ${mansectform='4'}
 1560: 		: ${with_rpath='yes'}
 1561: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1562: 		AC_CHECK_FUNCS(priv_set, [PSMAN=1])
 1563: 		;;
 1564:     *-*-aix*)
 1565: 		# To get all prototypes (so we pass -Wall)
 1566: 		OSDEFS="${OSDEFS} -D_ALL_SOURCE -D_LINUX_SOURCE_COMPAT"
 1567: 		SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp"
 1568: 		if test X"$with_blibpath" != X"no"; then
 1569: 		    AC_MSG_CHECKING([if linker accepts -Wl,-blibpath])
 1570: 		    O_LDFLAGS="$LDFLAGS"
 1571: 		    LDFLAGS="$O_LDFLAGS -Wl,-blibpath:/usr/lib:/lib"
 1572: 		    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [
 1573: 			if test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
 1574: 			    blibpath="$with_blibpath"
 1575: 			elif test -n "$GCC"; then
 1576: 			    blibpath="/usr/lib:/lib:/usr/local/lib"
 1577: 			else
 1578: 			    blibpath="/usr/lib:/lib"
 1579: 			fi
 1580: 			AC_MSG_RESULT(yes)
 1581: 		    ], [AC_MSG_RESULT(no)])
 1582: 		fi
 1583: 		LDFLAGS="$O_LDFLAGS"
 1584: 
 1585: 		# On AIX 6 and higher default to PAM, else default to LAM
 1586: 		if test $OSMAJOR -ge 6; then
 1587: 		    if test X"$with_pam" = X""; then
 1588: 			AUTH_EXCL_DEF="PAM"
 1589: 		    fi
 1590: 		else
 1591: 		    if test X"$with_aixauth" = X""; then
 1592: 			AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"])
 1593: 		    fi
 1594: 		fi
 1595: 
 1596: 		# AIX analog of nsswitch.conf, enabled by default
 1597: 		AC_ARG_WITH(netsvc, [AS_HELP_STRING([--with-netsvc[[=PATH]]], [path to netsvc.conf])],
 1598: 		[case $with_netsvc in
 1599: 		    no)		;;
 1600: 		    yes)	with_netsvc="/etc/netsvc.conf"
 1601: 				;;
 1602: 		    *)		;;
 1603: 		esac])
 1604: 		if test -z "$with_nsswitch" -a -z "$with_netsvc"; then
 1605: 		    with_netsvc="/etc/netsvc.conf"
 1606: 		fi
 1607: 
 1608: 		# For implementing getgrouplist()
 1609: 		AC_CHECK_FUNCS(getgrset)
 1610: 
 1611: 		# LDR_PRELOAD is only supported in AIX 5.3 and later
 1612: 		if test $OSMAJOR -lt 5; then
 1613: 		    with_noexec=no
 1614: 		else
 1615: 		    RTLD_PRELOAD_VAR="LDR_PRELOAD"
 1616: 		fi
 1617: 
 1618: 		# AIX-specific functions
 1619: 		AC_CHECK_FUNCS(getuserattr setauthdb)
 1620: 		COMMON_OBJS="$COMMON_OBJS aix.lo"
 1621: 		;;
 1622:     *-*-hiuxmpp*)
 1623: 		: ${mansectsu='1m'}
 1624: 		: ${mansectform='4'}
 1625: 
 1626: 		# HP-UX shared libs must be executable
 1627: 		SHLIB_MODE=0755
 1628: 		;;
 1629:     *-*-hpux*)
 1630: 		# AFS support needs -lBSD
 1631: 		if test "$with_AFS" = "yes"; then
 1632: 		    AFS_LIBS="-lc -lBSD"
 1633: 		fi
 1634: 		: ${mansectsu='1m'}
 1635: 		: ${mansectform='4'}
 1636: 
 1637: 		# HP-UX shared libs must be executable
 1638: 		SHLIB_MODE=0755
 1639: 
 1640: 		# The HP bundled compiler cannot generate shared libs
 1641: 		if test -z "$GCC"; then
 1642: 		    AC_CACHE_CHECK([for HP bundled C compiler],
 1643: 			[sudo_cv_var_hpccbundled],
 1644: 			[if $CC -V 2>&1 | grep '^(Bundled)' >/dev/null 2>&1; then
 1645: 			    sudo_cv_var_hpccbundled=yes
 1646: 			else
 1647: 			    sudo_cv_var_hpccbundled=no
 1648: 			fi]
 1649: 		    )
 1650: 		    if test "$sudo_cv_var_hpccbundled" = "yes"; then
 1651: 			AC_MSG_ERROR([The HP bundled C compiler is unable to build Sudo, you must use gcc or the HP ANSI C compiler instead.])
 1652: 		    fi
 1653: 		fi
 1654: 
 1655: 		# Build PA-RISC1.1 objects for better portability
 1656: 		case "$host_cpu" in
 1657: 		    hppa[[2-9]]*)
 1658: 			_CFLAGS="$CFLAGS"
 1659: 			if test -n "$GCC"; then
 1660: 			    portable_flag="-march=1.1"
 1661: 			else
 1662: 			    portable_flag="+DAportable"
 1663: 			fi
 1664: 			CFLAGS="$CFLAGS $portable_flag"
 1665: 			AC_CACHE_CHECK([whether $CC understands $portable_flag],
 1666: 			    [sudo_cv_var_daportable],
 1667: 			    [AC_LINK_IFELSE(
 1668: 				[AC_LANG_PROGRAM([[]], [[]])],
 1669: 				    [sudo_cv_var_daportable=yes],
 1670: 				    [sudo_cv_var_daportable=no]
 1671: 				)
 1672: 			    ]
 1673: 			)
 1674: 			if test X"$sudo_cv_var_daportable" != X"yes"; then
 1675: 			    CFLAGS="$_CFLAGS"
 1676: 			fi
 1677: 			;;
 1678: 		esac
 1679: 
 1680: 		case "$host" in
 1681: 			*-*-hpux[[1-8]].*)
 1682: 			    AC_DEFINE(BROKEN_SYSLOG)
 1683: 			;;
 1684: 			*-*-hpux9.*)
 1685: 			    AC_DEFINE(BROKEN_SYSLOG)
 1686: 
 1687: 			    shadow_funcs="getspwuid"
 1688: 
 1689: 			    # DCE support (requires ANSI C compiler)
 1690: 			    if test "$with_DCE" = "yes"; then
 1691: 				# order of libs in 9.X is important. -lc_r must be last
 1692: 				SUDOERS_LIBS="${SUDOERS_LIBS} -ldce -lM -lc_r"
 1693: 				LIBS="${LIBS} -ldce -lM -lc_r"
 1694: 				CPPFLAGS="${CPPFLAGS} -D_REENTRANT -I/usr/include/reentrant"
 1695: 			    fi
 1696: 			;;
 1697: 			*-*-hpux10.*)
 1698: 			    shadow_funcs="getprpwnam iscomsec"
 1699: 			    shadow_libs="-lsec"
 1700: 			    # HP-UX 10.20 libc has an incompatible getline
 1701: 			    ac_cv_func_getline="no"
 1702: 			;;
 1703: 			*)
 1704: 			    shadow_funcs="getspnam iscomsec"
 1705: 			    shadow_libs="-lsec"
 1706: 			    test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1707: 			;;
 1708: 		esac
 1709: 		;;
 1710:     *-dec-osf*)
 1711: 		# ignore envariables wrt dynamic lib path
 1712: 		# XXX - sudo LDFLAGS instead?
 1713: 		SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-no_library_replacement"
 1714: 
 1715: 		: ${CHECKSIA='true'}
 1716: 		AC_MSG_CHECKING(whether to disable sia support on Digital UNIX)
 1717: 		AC_ARG_ENABLE(sia,
 1718: 		[AS_HELP_STRING([--disable-sia], [Disable SIA on Digital UNIX])],
 1719: 		[ case "$enableval" in
 1720: 		    yes)	AC_MSG_RESULT(no)
 1721: 				CHECKSIA=true
 1722: 				;;
 1723: 		    no)		AC_MSG_RESULT(yes)
 1724: 				CHECKSIA=false
 1725: 				;;
 1726: 		    *)		AC_MSG_RESULT(no)
 1727: 				AC_MSG_WARN([Ignoring unknown argument to --enable-sia: $enableval])
 1728: 				;;
 1729: 		  esac
 1730: 		], AC_MSG_RESULT(no))
 1731: 
 1732: 		shadow_funcs="getprpwnam dispcrypt"
 1733: 		# OSF/1 4.x and higher need -ldb too
 1734: 		if test $OSMAJOR -lt 4; then
 1735: 		    shadow_libs="-lsecurity -laud -lm"
 1736: 		else
 1737: 		    shadow_libs="-lsecurity -ldb -laud -lm"
 1738: 		fi
 1739: 
 1740: 		# use SIA by default, if we have it
 1741: 		test "$CHECKSIA" = "true" && AUTH_EXCL_DEF="SIA"
 1742: 
 1743: 		#
 1744: 		# Some versions of Digital Unix ship with a broken
 1745: 		# copy of prot.h, which we need for shadow passwords.
 1746: 		# XXX - make should remove this as part of distclean
 1747: 		#
 1748: 		AC_MSG_CHECKING([for broken prot.h])
 1749: 		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 1750: #include <sys/types.h>
 1751: #include <sys/security.h>
 1752: #include <prot.h>
 1753: 		]], [[exit(0);]])], [AC_MSG_RESULT(no)], [AC_MSG_RESULT([yes, fixing locally])
 1754: 		sed 's:<acl.h>:<sys/acl.h>:g' < /usr/include/prot.h > prot.h
 1755: 		])
 1756: 		# ":DEFAULT" must be appended to _RLD_LIST
 1757: 		RTLD_PRELOAD_VAR="_RLD_LIST"
 1758: 		RTLD_PRELOAD_DEFAULT="DEFAULT"
 1759: 		: ${mansectsu='8'}
 1760: 		: ${mansectform='4'}
 1761: 		;;
 1762:     *-*-irix*)
 1763: 		OSDEFS="${OSDEFS} -D_BSD_TYPES"
 1764: 		if test -z "$NROFFPROG"; then
 1765: 		    if test "$prefix" = "/usr/local" -a "$mandir" = '${datarootdir}/man'; then
 1766: 			if test -d /usr/share/catman/local; then
 1767: 			    mandir="/usr/share/catman/local"
 1768: 			else
 1769: 			    mandir="/usr/catman/local"
 1770: 			fi
 1771: 		    fi
 1772: 		    # Compress cat pages with pack
 1773: 		    MANCOMPRESS='pack'
 1774: 		    MANCOMPRESSEXT='.z'
 1775: 		else
 1776: 		    if test "$prefix" = "/usr/local" -a "$mandir" = '${datarootdir}/man'; then
 1777: 			if test -d "/usr/share/man/local"; then
 1778: 			    mandir="/usr/share/man/local"
 1779: 			else
 1780: 			    mandir="/usr/man/local"
 1781: 			fi
 1782: 		    fi
 1783: 		fi
 1784: 		# IRIX <= 4 needs -lsun
 1785: 		if test "$OSMAJOR" -le 4; then
 1786: 		    AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
 1787: 		fi
 1788: 		# ":DEFAULT" must be appended to _RLD_LIST
 1789: 		RTLD_PRELOAD_VAR="_RLD_LIST"
 1790: 		RTLD_PRELOAD_DEFAULT="DEFAULT"
 1791: 		: ${mansectsu='1m'}
 1792: 		: ${mansectform='4'}
 1793: 		;;
 1794:     *-*-linux*|*-*-k*bsd*-gnu)
 1795: 		OSDEFS="${OSDEFS} -D_GNU_SOURCE"
 1796: 		# Some Linux versions need to link with -lshadow
 1797: 		shadow_funcs="getspnam"
 1798: 		shadow_libs_optional="-lshadow"
 1799: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1800: 		;;
 1801:     *-convex-bsd*)
 1802: 		OSDEFS="${OSDEFS} -D_CONVEX_SOURCE"
 1803: 		if test -z "$GCC"; then
 1804: 		    CFLAGS="${CFLAGS} -D__STDC__"
 1805: 		fi
 1806: 
 1807: 		shadow_defs="-D_AUDIT -D_ACL -DSecureWare"
 1808: 		shadow_funcs="getprpwnam"
 1809: 		shadow_libs="-lprot"
 1810: 		;;
 1811:     *-*-ultrix*)
 1812: 		OS="ultrix"
 1813: 		shadow_funcs="getauthuid"
 1814: 		shadow_libs="-lauth"
 1815: 		;;
 1816:     *-*-riscos*)
 1817: 		LIBS="${LIBS} -lsun -lbsd"
 1818: 		CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd"
 1819: 		OSDEFS="${OSDEFS} -D_MIPS"
 1820: 		: ${mansectsu='1m'}
 1821: 		: ${mansectform='4'}
 1822: 		;;
 1823:     *-*-isc*)
 1824: 		OSDEFS="${OSDEFS} -D_ISC"
 1825: 		LIB_CRYPT=1
 1826: 		SUDOERS_LIBS="${SUDOERS_LIBS} -lcrypt"
 1827: 
 1828: 		shadow_funcs="getspnam"
 1829: 		shadow_libs="-lsec"
 1830: 
 1831: 		: ${mansectsu='1m'}
 1832: 		: ${mansectform='4'}
 1833: 		;;
 1834:     *-*-sco*|*-sco-*)
 1835: 		shadow_funcs="getprpwnam"
 1836: 		shadow_libs="-lprot -lx"
 1837: 		: ${mansectsu='1m'}
 1838: 		: ${mansectform='4'}
 1839: 		;;
 1840:     m88k-motorola-sysv*)
 1841: 		# motorolla's cc (a variant of gcc) does -O but not -O2
 1842: 		CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/g'`
 1843: 		: ${mansectsu='1m'}
 1844: 		: ${mansectform='4'}
 1845: 		;;
 1846:     *-sequent-sysv*)
 1847: 		shadow_funcs="getspnam"
 1848: 		shadow_libs="-lsec"
 1849: 		: ${mansectsu='1m'}
 1850: 		: ${mansectform='4'}
 1851: 		: ${with_rpath='yes'}
 1852: 		;;
 1853:     *-ncr-sysv4*|*-ncr-sysvr4*)
 1854: 		AC_CHECK_LIB(c89, strcasecmp, [LIBS="${LIBS} -lc89"])
 1855: 		: ${mansectsu='1m'}
 1856: 		: ${mansectform='4'}
 1857: 		: ${with_rpath='yes'}
 1858: 		;;
 1859:     *-ccur-sysv4*|*-ccur-sysvr4*)
 1860: 		LIBS="${LIBS} -lgen"
 1861: 		: ${mansectsu='1m'}
 1862: 		: ${mansectform='4'}
 1863: 		: ${with_rpath='yes'}
 1864: 		;;
 1865:     *-*-bsdi*)
 1866: 		SKIP_SETREUID=yes
 1867: 		# Check for newer BSD auth API
 1868: 		if test -z "$with_bsdauth"; then
 1869: 		    AC_CHECK_FUNCS(auth_challenge, [AUTH_EXCL_DEF="BSD_AUTH"])
 1870: 		fi
 1871: 		;;
 1872:     *-*-freebsd*)
 1873: 		# FreeBSD has a real setreuid(2) starting with 2.1 and
 1874: 		# backported to 2.0.5.  We just take 2.1 and above...
 1875: 		case "$OSREV" in
 1876: 		0.*|1.*|2.0*)
 1877: 		    SKIP_SETREUID=yes
 1878: 		    ;;
 1879: 		esac
 1880: 		OSDEFS="${OSDEFS} -D_BSD_SOURCE"
 1881: 		if test "${with_skey-'no'}" = "yes"; then
 1882: 		     SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
 1883: 		fi
 1884: 		CHECKSHADOW="false"
 1885: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1886: 		: ${with_logincap='maybe'}
 1887: 		;;
 1888:     *-*-*openbsd*)
 1889: 		# OpenBSD has a real setreuid(2) starting with 3.3 but
 1890: 		# we will use setresuid(2) instead.
 1891: 		SKIP_SETREUID=yes
 1892: 		OSDEFS="${OSDEFS} -D_BSD_SOURCE"
 1893: 		CHECKSHADOW="false"
 1894: 		# OpenBSD >= 3.0 supports BSD auth
 1895: 		if test -z "$with_bsdauth"; then
 1896: 		    if test "$OSMAJOR" -ge 3; then
 1897: 			AUTH_EXCL_DEF="BSD_AUTH"
 1898: 		    fi
 1899: 		fi
 1900: 		: ${with_logincap='maybe'}
 1901: 		;;
 1902:     *-*-*netbsd*)
 1903: 		# NetBSD has a real setreuid(2) starting with 1.3.2
 1904: 		case "$OSREV" in
 1905: 		0.9*|1.[[012]]*|1.3|1.3.1)
 1906: 		    SKIP_SETREUID=yes
 1907: 		    ;;
 1908: 		esac
 1909: 		CHECKSHADOW="false"
 1910: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1911: 		: ${with_logincap='maybe'}
 1912: 		;;
 1913:     *-*-dragonfly*)
 1914: 		OSDEFS="${OSDEFS} -D_BSD_SOURCE"
 1915: 		if test "${with_skey-'no'}" = "yes"; then
 1916: 		     SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
 1917: 		fi
 1918: 		CHECKSHADOW="false"
 1919: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1920: 		: ${with_logincap='yes'}
 1921: 		;;
 1922:     *-*-*bsd*)
 1923: 		CHECKSHADOW="false"
 1924: 		;;
 1925:     *-*-darwin*)
 1926: 		# Darwin has a real setreuid(2) starting with 9.0
 1927: 		if test $OSMAJOR -lt 9; then
 1928: 		    SKIP_SETREUID=yes
 1929: 		fi
 1930: 		CHECKSHADOW="false"
 1931: 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 1932: 		: ${with_logincap='yes'}
 1933: 		RTLD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
 1934: 		RTLD_PRELOAD_ENABLE_VAR="DYLD_FORCE_FLAT_NAMESPACE"
 1935: 		;;
 1936:     *-*-nextstep*)
 1937: 		# lockf() on is broken on the NeXT -- use flock instead
 1938: 		ac_cv_func_lockf=no
 1939: 		ac_cv_func_flock=yes
 1940: 		RTLD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
 1941: 		RTLD_PRELOAD_ENABLE_VAR="DYLD_FORCE_FLAT_NAMESPACE"
 1942: 		;;
 1943:     *-*-*sysv4*)
 1944: 		: ${mansectsu='1m'}
 1945: 		: ${mansectform='4'}
 1946: 		: ${with_rpath='yes'}
 1947: 		;;
 1948:     *-*-sysv*)
 1949: 		: ${mansectsu='1m'}
 1950: 		: ${mansectform='4'}
 1951: 		;;
 1952:     *-gnu*)
 1953: 		OSDEFS="${OSDEFS} -D_GNU_SOURCE"
 1954: 		;;
 1955: esac
 1956: 
 1957: dnl
 1958: dnl Library preloading to support NOEXEC
 1959: dnl
 1960: if test -n "$with_noexec"; then
 1961:     SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_VAR, "$RTLD_PRELOAD_VAR")
 1962:     SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_DELIM, "$RTLD_PRELOAD_DELIM")
 1963:     if test -n "$RTLD_PRELOAD_DEFAULT"; then
 1964: 	SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_DEFAULT, "$RTLD_PRELOAD_DEFAULT")
 1965:     fi
 1966:     if test -n "$RTLD_PRELOAD_ENABLE_VAR"; then
 1967: 	SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_ENABLE_VAR, "$RTLD_PRELOAD_ENABLE_VAR")
 1968:     fi
 1969: fi
 1970: 
 1971: dnl
 1972: dnl Check for mixing mutually exclusive and regular auth methods
 1973: dnl
 1974: AUTH_REG=${AUTH_REG# }
 1975: AUTH_EXCL=${AUTH_EXCL# }
 1976: if test -n "$AUTH_EXCL"; then
 1977:     set -- $AUTH_EXCL
 1978:     if test $# != 1; then
 1979: 	AC_MSG_ERROR([More than one mutually exclusive authentication method specified: $AUTH_EXCL])
 1980:     fi
 1981:     if test -n "$AUTH_REG"; then
 1982: 	AC_MSG_ERROR([Cannot mix mutually exclusive ($AUTH_EXCL) and regular ($AUTH_REG) authentication methods])
 1983:     fi
 1984: fi
 1985: dnl
 1986: dnl Only one of S/Key and OPIE may be specified
 1987: dnl
 1988: if test X"${with_skey}${with_opie}" = X"yesyes"; then
 1989:     AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
 1990: fi
 1991: 
 1992: dnl
 1993: dnl Use BSD-style man sections by default
 1994: dnl
 1995: : ${mansectsu='8'}
 1996: : ${mansectform='5'}
 1997: 
 1998: dnl
 1999: dnl Add in any libpaths or libraries specified via configure
 2000: dnl
 2001: if test -n "$with_libpath"; then
 2002:     for i in ${with_libpath}; do
 2003: 	SUDO_APPEND_LIBPATH(LDFLAGS, [$i])
 2004:     done
 2005: fi
 2006: if test -n "$with_libraries"; then
 2007:     for i in ${with_libraries}; do
 2008: 	case $i in
 2009: 	    -l*)	;;
 2010: 	    *.a)	;;
 2011: 	    *.o)	;;
 2012: 	    *)	i="-l${i}";;
 2013: 	esac
 2014: 	LIBS="${LIBS} ${i}"
 2015:     done
 2016: fi
 2017: 
 2018: dnl
 2019: dnl C compiler checks (to be done after os checks)
 2020: dnl
 2021: AC_PROG_GCC_TRADITIONAL
 2022: AC_C_CONST
 2023: AC_C_VOLATILE
 2024: # Check for variadic macro support in cpp
 2025: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 2026: AC_INCLUDES_DEFAULT
 2027: #if defined(__GNUC__) && __GNUC__ == 2
 2028: # define sudo_fprintf(fp, fmt...) fprintf((fp), (fmt))
 2029: #else
 2030: # define sudo_fprintf(fp, ...) fprintf((fp), __VA_ARGS__)
 2031: #endif
 2032: ], [sudo_fprintf(stderr, "a %s", "test");])], [], [AC_MSG_ERROR([Your C compiler doesn't support variadic macros, try building with gcc instead])])
 2033: 
 2034: dnl
 2035: dnl Program checks
 2036: dnl
 2037: AC_PROG_YACC
 2038: AC_PATH_PROG([FLEX], [flex], [flex])
 2039: SUDO_PROG_MV
 2040: SUDO_PROG_BSHELL
 2041: if test -z "$with_sendmail"; then
 2042:     SUDO_PROG_SENDMAIL
 2043: fi
 2044: SUDO_PROG_VI
 2045: dnl
 2046: dnl Check for authpriv support in syslog
 2047: dnl
 2048: AC_MSG_CHECKING(which syslog facility sudo should log with)
 2049: if test X"$with_logfac" = X""; then
 2050:     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <syslog.h>]], [[int i = LOG_AUTHPRIV; (void)i;]])], [logfac=authpriv])
 2051: fi
 2052: AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
 2053: AC_MSG_RESULT($logfac)
 2054: dnl
 2055: dnl Header file checks
 2056: dnl
 2057: AC_HEADER_STDC
 2058: AC_HEADER_DIRENT
 2059: AC_HEADER_TIME
 2060: AC_HEADER_STDBOOL
 2061: AC_HEADER_MAJOR
 2062: AC_CHECK_HEADERS(malloc.h netgroup.h paths.h spawn.h utime.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h sys/sysmacros.h)
 2063: AC_CHECK_HEADERS([procfs.h] [sys/procfs.h], [AC_CHECK_MEMBERS(struct psinfo.pr_ttydev, [AC_CHECK_FUNCS(_ttyname_dev)], [], [AC_INCLUDES_DEFAULT
 2064: #ifdef HAVE_PROCFS_H
 2065: #include <procfs.h>
 2066: #endif
 2067: #ifdef HAVE_SYS_PROCFS_H
 2068: #include <sys/procfs.h>
 2069: #endif
 2070: ])]
 2071: break)
 2072: dnl
 2073: dnl Check for large file support.  HP-UX 11.23 has a broken sys/type.h
 2074: dnl when large files support is enabled so work around it.
 2075: dnl
 2076: AC_SYS_LARGEFILE
 2077: case "$host" in
 2078:     *-*-hpux11.*)
 2079: 	AC_CACHE_CHECK([whether sys/types.h needs _XOPEN_SOURCE_EXTENDED], [sudo_cv_xopen_source_extended],
 2080: 	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
 2081: 	#include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=no], [
 2082: 	    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _XOPEN_SOURCE_EXTENDED
 2083: 	    AC_INCLUDES_DEFAULT
 2084: 	    #include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=yes],
 2085: 	    [sudo_cv_xopen_source_extended=error])
 2086: 	])])
 2087: 	if test "$sudo_cv_xopen_source_extended" = "yes"; then
 2088: 	    OSDEFS="${OSDEFS} -D_XOPEN_SOURCE_EXTENDED"
 2089: 	    SUDO_DEFINE(_XOPEN_SOURCE_EXTENDED)
 2090: 	fi
 2091: 	;;
 2092: esac
 2093: AC_SYS_POSIX_TERMIOS
 2094: if test "$ac_cv_sys_posix_termios" != "yes"; then
 2095:     AC_MSG_ERROR([Must have POSIX termios to build sudo])
 2096: fi
 2097: SUDO_MAILDIR
 2098: if test ${with_logincap-'no'} != "no"; then
 2099:     AC_CHECK_HEADERS(login_cap.h, [LOGINCAP_USAGE='[[-c class|-]] '; LCMAN=1
 2100: 	case "$OS" in
 2101: 	    freebsd|netbsd)
 2102: 		SUDO_LIBS="${SUDO_LIBS} -lutil"
 2103: 		SUDOERS_LIBS="${SUDOERS_LIBS} -lutil"
 2104: 		;;
 2105: 	esac
 2106:     ])
 2107: fi
 2108: if test ${with_project-'no'} != "no"; then
 2109:     AC_CHECK_HEADER(project.h, [
 2110: 	AC_CHECK_LIB(project, setproject, [
 2111: 	    AC_DEFINE(HAVE_PROJECT_H)
 2112: 	    SUDO_LIBS="${SUDO_LIBS} -lproject"
 2113: 	])
 2114:     ], [])
 2115: fi
 2116: dnl
 2117: dnl typedef checks
 2118: dnl
 2119: AC_TYPE_MODE_T
 2120: AC_TYPE_UID_T
 2121: AC_CHECK_TYPE([__signed char], [], [AC_CHECK_TYPE([signed char], [AC_DEFINE(__signed, signed)], [AC_DEFINE(__signed, [])])])
 2122: AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
 2123: #include <signal.h>])
 2124: AC_CHECK_TYPES([sigaction_t], [], [], [#include <sys/types.h>
 2125: #include <signal.h>])
 2126: AC_CHECK_TYPES([struct timespec], [], [], [#include <sys/types.h>
 2127: #if TIME_WITH_SYS_TIME
 2128: # include <sys/time.h>
 2129: #endif
 2130: #include <time.h>])
 2131: AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
 2132: #include <netinet/in.h>])
 2133: AC_TYPE_LONG_LONG_INT
 2134: AC_CHECK_SIZEOF([long int])
 2135: AC_CHECK_TYPE(size_t, unsigned int)
 2136: AC_CHECK_TYPE(ssize_t, int)
 2137: AC_CHECK_TYPE(dev_t, int)
 2138: AC_CHECK_TYPE(ino_t, unsigned int)
 2139: AC_CHECK_TYPE(socklen_t, [], [AC_DEFINE(socklen_t, unsigned int)], [
 2140: AC_INCLUDES_DEFAULT
 2141: #include <sys/socket.h>])
 2142: SUDO_UID_T_LEN
 2143: SUDO_SOCK_SA_LEN
 2144: dnl
 2145: dnl Check for utmp/utmpx struct members.
 2146: dnl We need to include OSDEFS for glibc which only has __e_termination
 2147: dnl visible when _GNU_SOURCE is *not* defined.
 2148: dnl
 2149: _CFLAGS="$CFLAGS"
 2150: CFLAGS="$CFLAGS $OSDEFS"
 2151: if test $ac_cv_header_utmpx_h = "yes"; then
 2152:     AC_CHECK_MEMBERS([struct utmpx.ut_id, struct utmpx.ut_pid, struct utmpx.ut_tv, struct utmpx.ut_type], [], [], [
 2153: 	#include <sys/types.h>
 2154: 	#include <utmpx.h>
 2155:     ])
 2156:     dnl
 2157:     dnl Check for ut_exit.__e_termination first, then ut_exit.e_termination
 2158:     dnl
 2159:     AC_CHECK_MEMBERS([struct utmpx.ut_exit.__e_termination], [AC_DEFINE(HAVE_STRUCT_UTMPX_UT_EXIT)], [
 2160: 	AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination], [AC_DEFINE(HAVE_STRUCT_UTMPX_UT_EXIT)], [], [
 2161: 	    #include <sys/types.h>
 2162: 	    #include <utmpx.h>
 2163: 	])
 2164:     ], [
 2165: 	#include <sys/types.h>
 2166: 	#include <utmpx.h>
 2167:     ])
 2168: else
 2169:     AC_CHECK_MEMBERS([struct utmp.ut_id, struct utmp.ut_pid, struct utmp.ut_tv, struct utmp.ut_type, struct utmp.ut_user], [], [], [
 2170: 	#include <sys/types.h>
 2171: 	#include <utmp.h>
 2172:     ])
 2173:     dnl
 2174:     dnl Check for ut_exit.__e_termination first, then ut_exit.e_termination
 2175:     dnl
 2176:     AC_CHECK_MEMBERS([struct utmp.ut_exit.__e_termination], [AC_DEFINE(HAVE_STRUCT_UTMP_UT_EXIT)], [
 2177: 	AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination], [AC_DEFINE(HAVE_STRUCT_UTMP_UT_EXIT)], [], [
 2178: 	    #include <sys/types.h>
 2179: 	    #include <utmp.h>
 2180: 	])
 2181:     ], [
 2182: 	#include <sys/types.h>
 2183: 	#include <utmp.h>
 2184:     ])
 2185: fi
 2186: CFLAGS="$_CFLAGS"
 2187: 
 2188: dnl
 2189: dnl Function checks
 2190: dnl
 2191: AC_FUNC_GETGROUPS
 2192: AC_CHECK_FUNCS(glob strrchr sysconf tzset strftime setenv \
 2193: 	       regcomp setlocale nl_langinfo mbr_check_membership \
 2194: 	       setrlimit64)
 2195: AC_REPLACE_FUNCS(getgrouplist)
 2196: AC_CHECK_FUNCS(getline, [], [
 2197:     AC_LIBOBJ(getline)
 2198:     AC_CHECK_FUNCS(fgetln)
 2199: ])
 2200: dnl
 2201: dnl If libc supports _FORTIFY_SOURCE check functions, use it.
 2202: dnl
 2203: if test "$enable_hardening" != "no"; then
 2204:     O_CPPFLAGS="$CPPFLAGS"
 2205:     CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
 2206:     AC_CHECK_FUNC(__sprintf_chk, [
 2207: 	AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[char buf[4]; (void)sprintf(buf, "%s", "foo");]])], [OSDEFS="${OSDEFS} -D_FORTIFY_SOURCE=2"], [])
 2208:     ], [])
 2209:     CPPFLAGS="$O_CPPFLAGS"
 2210: fi
 2211: 
 2212: utmp_style=LEGACY
 2213: AC_CHECK_FUNCS(getutxid getutid, [utmp_style=POSIX; break])
 2214: if test "$utmp_style" = "LEGACY"; then
 2215:     AC_CHECK_FUNCS(getttyent ttyslot, [break])
 2216:     AC_CHECK_FUNCS(fseeko)
 2217: fi
 2218: 
 2219: AC_CHECK_FUNCS(sysctl, [AC_CHECK_MEMBERS([struct kinfo_proc.ki_tdev], [],
 2220:     [
 2221: 	AC_CHECK_MEMBERS([struct kinfo_proc2.p_tdev], [], [
 2222: 	    AC_CHECK_MEMBERS([struct kinfo_proc.p_tdev], [], [
 2223: 		AC_CHECK_MEMBERS([struct kinfo_proc.kp_eproc.e_tdev], [], [], [
 2224: 		    #include <sys/param.h>
 2225: 		    #include <sys/sysctl.h>
 2226: 		])
 2227: 	    ], [
 2228: 		#include <sys/param.h>
 2229: 		#include <sys/sysctl.h>
 2230: 	    ])
 2231: 	],
 2232: 	[
 2233: 	    #include <sys/param.h>
 2234: 	    #include <sys/sysctl.h>
 2235: 	])
 2236:     ],
 2237:     [
 2238: 	#include <sys/param.h>
 2239: 	#include <sys/sysctl.h>
 2240: 	#include <sys/user.h>
 2241:     ])
 2242: ])
 2243: 
 2244: AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])], [
 2245:     AC_CHECK_LIB(util, openpty, [
 2246: 	AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])
 2247: 	case "$SUDO_LIBS" in
 2248: 	    *-lutil*) ;;
 2249: 	    *) SUDO_LIBS="${SUDO_LIBS} -lutil";;
 2250: 	esac
 2251: 	AC_DEFINE(HAVE_OPENPTY)
 2252:     ], [
 2253: 	AC_CHECK_FUNCS(_getpty, [], [
 2254: 	    AC_CHECK_FUNCS(grantpt, [
 2255: 		AC_CHECK_FUNCS(posix_openpt)
 2256: 	    ], [
 2257: 		AC_CHECK_FUNCS(revoke)
 2258: 	    ])
 2259: 	])
 2260:     ])
 2261: ])
 2262: AC_CHECK_FUNCS(unsetenv, [SUDO_FUNC_UNSETENV_VOID], [])
 2263: SUDO_FUNC_PUTENV_CONST
 2264: if test -z "$SKIP_SETRESUID"; then
 2265:     AC_CHECK_FUNCS(setresuid, [
 2266: 	SKIP_SETREUID=yes
 2267: 	AC_CHECK_FUNCS(getresuid)
 2268:     ])
 2269: fi
 2270: if test -z "$SKIP_SETREUID"; then
 2271:     AC_CHECK_FUNCS(setreuid, [SKIP_SETEUID=yes])
 2272: fi
 2273: if test -z "$SKIP_SETEUID"; then
 2274:     AC_CHECK_FUNCS(seteuid)
 2275: fi
 2276: if test X"$with_interfaces" != X"no"; then
 2277:     AC_CHECK_FUNCS(getifaddrs, [AC_CHECK_FUNCS(freeifaddrs)])
 2278: fi
 2279: if test -z "$BROKEN_GETCWD"; then
 2280:     AC_REPLACE_FUNCS(getcwd)
 2281: fi
 2282: AC_CHECK_FUNCS(lockf flock, [break])
 2283: AC_CHECK_FUNCS(innetgr _innetgr, [AC_CHECK_FUNCS(getdomainname) [break]])
 2284: AC_CHECK_FUNCS(utimes, [AC_CHECK_FUNCS(futimes futimesat, [break])], [AC_CHECK_FUNCS(futime) AC_LIBOBJ(utimes)])
 2285: AC_CHECK_FUNCS(killpg, [], [AC_LIBOBJ(killpg)])
 2286: SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)
 2287:     COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }fnm_test"
 2288: ])
 2289: SUDO_FUNC_ISBLANK
 2290: AC_REPLACE_FUNCS(memrchr pw_dup strlcpy strlcat)
 2291: AC_CHECK_FUNCS(nanosleep, [], [
 2292:     # On Solaris, nanosleep is in librt
 2293:     AC_CHECK_LIB(rt, nanosleep, [REPLAY_LIBS="${REPLAY_LIBS} -lrt"], [AC_LIBOBJ(nanosleep)])
 2294: ])
 2295: AC_CHECK_FUNCS(closefrom, [], [AC_LIBOBJ(closefrom)
 2296:     AC_CHECK_DECL(F_CLOSEM, AC_DEFINE(HAVE_FCNTL_CLOSEM), [],
 2297: 	[ #include <limits.h>
 2298: 	  #include <fcntl.h> ])
 2299: ])
 2300: AC_CHECK_FUNCS(mkstemps mkdtemp, [], [
 2301:     AC_CHECK_FUNCS(random lrand48, [break])
 2302:     AC_LIBOBJ(mktemp)
 2303: ])
 2304: AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1])
 2305: if test X"$ac_cv_type_struct_timespec" != X"no"; then
 2306:     AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
 2307: 	[AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
 2308: 	[AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
 2309: fi
 2310: dnl
 2311: dnl Check for the dirfd function/macro.  If not found, look for dd_fd in DIR.
 2312: dnl
 2313: AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 2314: #include <$ac_header_dirent>]], [[DIR *d; (void)dirfd(d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 2315: #include <$ac_header_dirent>]], [[DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);]])], [AC_DEFINE(HAVE_DD_FD)], [])])
 2316: AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [
 2317: AC_INCLUDES_DEFAULT
 2318: #include <$ac_header_dirent>
 2319: ])
 2320: dnl
 2321: dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS
 2322: dnl (it contains snprintf, vsnprintf, asprintf, and vasprintf)
 2323: dnl
 2324: if test -n "$NEED_SNPRINTF"; then
 2325:     AC_LIBOBJ(snprintf)
 2326: fi
 2327: dnl
 2328: dnl If socket(2) not in libc, check -lsocket and -linet
 2329: dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
 2330: dnl
 2331: AC_CHECK_FUNC(socket, [], [
 2332:     for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
 2333: 	_libs=
 2334: 	for lib in $libs; do
 2335: 	    case "$NET_LIBS" in
 2336: 		*"$lib"*)   ;;
 2337: 		*)	    _libs="$_libs $lib";;
 2338: 	    esac
 2339: 	done
 2340: 	libs="${_libs# }"
 2341: 	test -z "$libs" && continue
 2342: 	lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
 2343: 	extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
 2344: 	SUDO_CHECK_LIB($lib, socket, [NET_LIBS="${NET_LIBS} $libs"; LIBS="${LIBS} $libs"; break], [], [$extralibs])
 2345:     done
 2346: ])
 2347: dnl
 2348: dnl If inet_addr(3) not in libc, check -lnsl and -linet
 2349: dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
 2350: dnl
 2351: AC_CHECK_FUNC(inet_addr, [], [
 2352:     AC_CHECK_FUNC(__inet_addr, [], [
 2353: 	for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
 2354: 	    _libs=
 2355: 	    for lib in $libs; do
 2356: 		case "$NET_LIBS" in
 2357: 		    *"$lib"*)   ;;
 2358: 		    *)		_libs="$_libs $lib";;
 2359: 		esac
 2360: 	    done
 2361: 	    libs="${_libs# }"
 2362: 	    test -z "$libs" && continue
 2363: 	    lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
 2364: 	    extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
 2365: 	    SUDO_CHECK_LIB($lib, inet_addr, [NET_LIBS="${NET_LIBS} $libs"; LIBS="${LIBS} $libs"; break], [], [$extralibs])
 2366: 	done
 2367:     ])
 2368: ])
 2369: dnl
 2370: dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet
 2371: dnl
 2372: AC_CHECK_FUNC(syslog, [], [
 2373:     for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
 2374: 	_libs=
 2375: 	for lib in $libs; do
 2376: 	    case "$NET_LIBS" in
 2377: 		*"$lib"*)   ;;
 2378: 		*)	    _libs="$_libs $lib";;
 2379: 	    esac
 2380: 	done
 2381: 	libs="${_libs# }"
 2382: 	test -z "$libs" && continue
 2383: 	lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
 2384: 	extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
 2385: 	SUDO_CHECK_LIB($lib, syslog, [NET_LIBS="${NET_LIBS} $libs"; LIBS="${LIBS} $libs"; break], [], [$extralibs])
 2386:     done
 2387: ])
 2388: dnl
 2389: dnl If getaddrinfo(3) not in libc, check -lsocket and -linet
 2390: dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols.
 2391: dnl
 2392: AC_CHECK_FUNCS(getaddrinfo, [], [
 2393:     found=no
 2394:     for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
 2395: 	_libs=
 2396: 	for lib in $libs; do
 2397: 	    case "$NET_LIBS" in
 2398: 		*"$lib"*)   ;;
 2399: 		*)	    _libs="$_libs $lib";;
 2400: 	    esac
 2401: 	done
 2402: 	libs="${_libs# }"
 2403: 	test -z "$libs" && continue
 2404: 	lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
 2405: 	extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
 2406: 	SUDO_CHECK_LIB($lib, getaddrinfo, [NET_LIBS="${NET_LIBS} $libs"; LIBS="${LIBS} $libs"; found=yes; break], [], [$extralibs])
 2407:     done
 2408:     if test X"$found" != X"no"; then
 2409: 	AC_DEFINE(HAVE_GETADDRINFO)
 2410:     fi
 2411: ])
 2412: dnl
 2413: dnl Check for getprogname() or __progname
 2414: dnl
 2415: AC_CHECK_FUNCS(getprogname, , [
 2416:     AC_MSG_CHECKING([for __progname])
 2417:     AC_CACHE_VAL(sudo_cv___progname, [
 2418:     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *__progname; (void)puts(__progname);]])], [sudo_cv___progname=yes], [sudo_cv___progname=no])])
 2419:     if test "$sudo_cv___progname" = "yes"; then
 2420: 	AC_DEFINE(HAVE___PROGNAME)
 2421:     else
 2422: 	AC_LIBOBJ(getprogname)
 2423:     fi
 2424:     AC_MSG_RESULT($sudo_cv___progname)
 2425: ])
 2426: dnl
 2427: dnl Check for __func__ or __FUNCTION__
 2428: dnl
 2429: AC_MSG_CHECKING([for __func__])
 2430: AC_CACHE_VAL(sudo_cv___func__, [
 2431: AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void)puts(__func__);]])], [sudo_cv___func__=yes], [sudo_cv___func__=no])])
 2432: AC_MSG_RESULT($sudo_cv___func__)
 2433: if test "$sudo_cv___func__" = "yes"; then
 2434:     AC_DEFINE(HAVE___FUNC__)
 2435: elif test -n "$GCC"; then
 2436:     AC_MSG_CHECKING([for __FUNCTION__])
 2437:     AC_CACHE_VAL(sudo_cv___FUNCTION__, [
 2438:     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void)puts(__FUNCTION__);]])], [sudo_cv___FUNCTION__=yes], [sudo_cv___FUNCTION__=no])])
 2439:     AC_MSG_RESULT($sudo_cv___FUNCTION__)
 2440:     if test "$sudo_cv___FUNCTION__" = "yes"; then
 2441: 	AC_DEFINE(HAVE___FUNC__)
 2442: 	AC_DEFINE(__func__, __FUNCTION__, [Define to __FUNCTION__ if your compiler support __FUNCTION__ but not __func__])
 2443:     fi
 2444: fi
 2445: 
 2446: # gettext() and friends may be located in libc (Linux and Solaris)
 2447: # or in libintl.  However, it is possible to have libintl installed
 2448: # even when gettext() is present in libc.  In the case of GNU libintl,
 2449: # gettext() will be defined to gettext_libintl in libintl.h.
 2450: # Since gcc prefers /usr/local/include to /usr/include, we need to
 2451: # make sure we use the gettext() that matches the include file.
 2452: if test "$enable_nls" != "no"; then
 2453:     if test "$enable_nls" != "yes"; then
 2454: 	CPPFLAGS="${CPPFLAGS} -I${enable_nls}/include"
 2455: 	SUDO_APPEND_LIBPATH(LDFLAGS, [$enable_nls/lib])
 2456:     fi
 2457:     OLIBS="$LIBS"
 2458:     for l in "libc" "-lintl" "-lintl -liconv"; do
 2459: 	if test "$l" = "libc"; then
 2460: 	    # If user specified a dir for libintl ignore libc
 2461: 	    if test "$enable_nls" != "yes"; then
 2462: 		continue
 2463: 	    fi
 2464: 	    gettext_name=sudo_cv_gettext
 2465: 	    AC_MSG_CHECKING([for gettext])
 2466: 	else
 2467: 	    LIBS="$OLIBS $l"
 2468: 	    gettext_name=sudo_cv_gettext"`echo $l|sed -e 's/ //g' -e 's/-/_/g'`"
 2469: 	    AC_MSG_CHECKING([for gettext in $l])
 2470: 	fi
 2471: 	AC_CACHE_VAL($gettext_name, [
 2472: 		AC_LINK_IFELSE(
 2473: 		    [
 2474: 			AC_LANG_PROGRAM([[#include <libintl.h>]], [(void)gettext((char *)0);])
 2475: 		    ], [eval $gettext_name=yes], [eval $gettext_name=no]
 2476: 		)
 2477: 	])
 2478: 	eval gettext_result="\$$gettext_name"
 2479: 	AC_MSG_RESULT($gettext_result)
 2480: 	if test "$gettext_result" = "yes"; then
 2481: 	    AC_CHECK_FUNCS(ngettext)
 2482: 	    break
 2483: 	fi
 2484:     done
 2485:     LIBS="$OLIBS"
 2486: 
 2487:     if test "$sudo_cv_gettext" = "yes"; then
 2488: 	AC_DEFINE(HAVE_LIBINTL_H)
 2489: 	SUDO_NLS=enabled
 2490:     elif test "$sudo_cv_gettext_lintl" = "yes"; then
 2491: 	AC_DEFINE(HAVE_LIBINTL_H)
 2492: 	SUDO_NLS=enabled
 2493: 	LIBINTL="-lintl"
 2494:     elif test "$sudo_cv_gettext_lintl_liconv" = "yes"; then
 2495: 	AC_DEFINE(HAVE_LIBINTL_H)
 2496: 	SUDO_NLS=enabled
 2497: 	LIBINTL="-lintl -liconv"
 2498:     fi
 2499: fi
 2500: 
 2501: dnl
 2502: dnl Deferred zlib option processing.
 2503: dnl By default we use the system zlib if it is present.
 2504: dnl If a directory was specified for zlib (or we are use sudo's version),
 2505: dnl prepend the include dir to make sure we get the right zlib header.
 2506: dnl
 2507: case "$enable_zlib" in
 2508:     yes)
 2509: 	AC_CHECK_LIB(z, gzdopen, [
 2510: 	    AC_CHECK_HEADERS(zlib.h, [ZLIB="-lz"], [enable_zlib=builtin])
 2511: 	])
 2512: 	;;
 2513:     no)
 2514: 	;;
 2515:     system)
 2516: 	AC_DEFINE(HAVE_ZLIB_H)
 2517: 	ZLIB="-lz"
 2518: 	;;
 2519:     builtin)
 2520: 	# handled below
 2521: 	;;
 2522:     *)
 2523: 	AC_DEFINE(HAVE_ZLIB_H)
 2524: 	CPPFLAGS="-I${enable_zlib}/include ${CPPFLAGS}"
 2525: 	SUDO_APPEND_LIBPATH(ZLIB, [$enable_zlib/lib])
 2526: 	ZLIB="${ZLIB} -lz"
 2527: 	;;
 2528: esac
 2529: if test X"$enable_zlib" = X"builtin"; then
 2530:     AC_DEFINE(HAVE_ZLIB_H)
 2531:     CPPFLAGS='-I$(top_builddir)/zlib -I$(top_srcdir)/zlib '"${CPPFLAGS}"
 2532:     ZLIB="${ZLIB}"' $(top_builddir)/zlib/libz.la'
 2533:     ZLIB_SRC=zlib
 2534:     AC_CONFIG_HEADER([zlib/zconf.h])
 2535:     AC_CONFIG_FILES([zlib/Makefile])
 2536: fi
 2537: 
 2538: dnl
 2539: dnl Check for errno declaration in errno.h
 2540: dnl
 2541: AC_CHECK_DECLS([errno], [], [], [
 2542: AC_INCLUDES_DEFAULT
 2543: #include <errno.h>
 2544: ])
 2545: 
 2546: dnl
 2547: dnl Check for h_errno declaration in netdb.h
 2548: dnl
 2549: AC_CHECK_DECLS([h_errno], [], [], [
 2550: AC_INCLUDES_DEFAULT
 2551: #include <netdb.h>
 2552: ])
 2553: 
 2554: dnl
 2555: dnl Check for strsignal() or sys_siglist
 2556: dnl
 2557: AC_CHECK_FUNCS(strsignal, [], [
 2558:     AC_LIBOBJ(strsignal)
 2559:     HAVE_SIGLIST="false"
 2560:     AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], [
 2561: 	HAVE_SIGLIST="true"
 2562: 	break
 2563:     ], [ ], [
 2564: AC_INCLUDES_DEFAULT
 2565: #include <signal.h>
 2566:     ])
 2567:     if test "$HAVE_SIGLIST" != "true"; then
 2568: 	AC_LIBOBJ(siglist)
 2569:     fi
 2570: ])
 2571: 
 2572: dnl
 2573: dnl Check for sig2str(), sys_signame or sys_sigabbrev
 2574: dnl
 2575: AC_CHECK_FUNCS(sig2str, [], [
 2576:     AC_LIBOBJ(sig2str)
 2577:     HAVE_SIGNAME="false"
 2578:     AC_CHECK_DECLS([sys_signame, _sys_signame, __sys_signame, sys_sigabbrev], [
 2579: 	HAVE_SIGNAME="true"
 2580: 	break
 2581:     ], [ ], [
 2582: AC_INCLUDES_DEFAULT
 2583: #include <signal.h>
 2584:     ])
 2585:     if test "$HAVE_SIGNAME" != "true"; then
 2586: 	AC_CACHE_CHECK([for undeclared sys_sigabbrev],
 2587: 	    [sudo_cv_var_sys_sigabbrev],
 2588: 	    [AC_LINK_IFELSE(
 2589: 		[AC_LANG_PROGRAM([[extern char **sys_sigabbrev;]], [[return sys_sigabbrev[1];]])],
 2590: 		    [sudo_cv_var_sys_sigabbrev=yes],
 2591: 		    [sudo_cv_var_sys_sigabbrev=no]
 2592: 		)
 2593: 	    ]
 2594: 	)
 2595: 	if test "$sudo_cv_var_sys_sigabbrev" = yes; then
 2596: 	    AC_DEFINE(HAVE_SYS_SIGABBREV)
 2597: 	else
 2598: 	    AC_LIBOBJ(signame)
 2599: 	fi
 2600:     fi
 2601: ])
 2602: 
 2603: dnl
 2604: dnl nsswitch.conf and its equivalents
 2605: dnl
 2606: if test ${with_netsvc-"no"} != "no"; then
 2607:     SUDO_DEFINE_UNQUOTED(_PATH_NETSVC_CONF, "${with_netsvc-/etc/netsvc.conf}")
 2608:     netsvc_conf=${with_netsvc-/etc/netsvc.conf}
 2609: elif test ${with_nsswitch-"yes"} != "no"; then
 2610:     SUDO_DEFINE_UNQUOTED(_PATH_NSSWITCH_CONF, "${with_nsswitch-/etc/nsswitch.conf}")
 2611:     nsswitch_conf=${with_nsswitch-/etc/nsswitch.conf}
 2612: fi
 2613: 
 2614: dnl
 2615: dnl Mutually exclusive auth checks come first, followed by
 2616: dnl non-exclusive ones.  Note: passwd must be last of all!
 2617: dnl
 2618: 
 2619: dnl
 2620: dnl Convert default authentication methods to with_* if
 2621: dnl no explicit authentication scheme was specified.
 2622: dnl
 2623: if test -z "${AUTH_EXCL}${AUTH_REG}" -a -n "$AUTH_EXCL_DEF"; then
 2624:     for auth in $AUTH_EXCL_DEF; do
 2625: 	case $auth in
 2626: 	    AIX_AUTH)	with_aixauth=maybe;;
 2627: 	    BSD_AUTH)	with_bsdauth=maybe;;
 2628: 	    PAM)	with_pam=maybe;;
 2629: 	    SIA)	CHECKSIA=true;;
 2630: 	esac
 2631:     done
 2632: fi
 2633: 
 2634: dnl
 2635: dnl PAM support.  Systems that use PAM by default set with_pam=default
 2636: dnl and we do the actual tests here.
 2637: dnl
 2638: if test ${with_pam-"no"} != "no"; then
 2639:     #
 2640:     # Check for pam_start() in libpam first, then for pam_appl.h.
 2641:     #
 2642:     found_pam_lib=no
 2643:     AC_CHECK_LIB(pam, pam_start, [found_pam_lib=yes], [], [$lt_cv_dlopen_libs])
 2644:     #
 2645:     # Some PAM implementations (MacOS X for example) put the PAM headers
 2646:     # in /usr/include/pam instead of /usr/include/security...
 2647:     #
 2648:     found_pam_hdrs=no
 2649:     AC_CHECK_HEADERS([security/pam_appl.h] [pam/pam_appl.h], [found_pam_hdrs=yes; break])
 2650:     if test "$found_pam_lib" = "yes" -a "$found_pam_hdrs" = "yes"; then
 2651: 	# Found both PAM libs and headers
 2652: 	with_pam=yes
 2653:     elif test "$with_pam" = "yes"; then
 2654: 	if test "$found_pam_lib" = "no"; then
 2655: 	    AC_MSG_ERROR(["--with-pam specified but unable to locate PAM development library."])
 2656: 	fi
 2657: 	if test "$found_pam_hdrs" = "no"; then
 2658: 	    AC_MSG_ERROR(["--with-pam specified but unable to locate PAM development headers."])
 2659: 	fi
 2660:     elif test "$found_pam_lib" != "$found_pam_hdrs"; then
 2661: 	if test "$found_pam_lib" = "no"; then
 2662: 	    AC_MSG_ERROR(["found PAM headers but no PAM development library; specify --without-pam to build without PAM"])
 2663: 	fi
 2664: 	if test "$found_pam_hdrs" = "no"; then
 2665: 	    AC_MSG_ERROR(["found PAM library but no PAM development headers; specify --without-pam to build without PAM"])
 2666: 	fi
 2667:     fi
 2668: 
 2669:     if test "$with_pam" = "yes"; then
 2670: 	# Older PAM implementations lack pam_getenvlist
 2671: 	OLIBS="$LIBS"
 2672: 	LIBS="$LIBS -lpam $lt_cv_dlopen_libs"
 2673: 	AC_CHECK_FUNCS(pam_getenvlist)
 2674: 	LIBS="$OLIBS"
 2675: 
 2676: 	# We already link with -ldl if needed (see LIBDL below)
 2677: 	SUDOERS_LIBS="${SUDOERS_LIBS} -lpam"
 2678: 	AC_DEFINE(HAVE_PAM)
 2679: 	AUTH_OBJS="$AUTH_OBJS pam.lo";
 2680: 	AUTH_EXCL=PAM
 2681: 
 2682: 	AC_ARG_WITH(pam-login, [AS_HELP_STRING([--with-pam-login], [enable specific PAM session for sudo -i])],
 2683: 	[case $with_pam_login in
 2684: 	    yes)	AC_DEFINE([HAVE_PAM_LOGIN])
 2685: 			AC_MSG_CHECKING(whether to use PAM login)
 2686: 			AC_MSG_RESULT(yes)
 2687: 			;;
 2688: 	    no)		;;
 2689: 	    *)		AC_MSG_ERROR(["--with-pam-login does not take an argument."])
 2690: 			;;
 2691: 	esac])
 2692: 
 2693: 	AC_MSG_CHECKING(whether to use PAM session support)
 2694: 	AC_ARG_ENABLE(pam_session,
 2695: 	[AS_HELP_STRING([--disable-pam-session], [Disable PAM session support])],
 2696: 	    [ case "$enableval" in
 2697: 		yes)	AC_MSG_RESULT(yes)
 2698: 			;;
 2699: 		no)		AC_MSG_RESULT(no)
 2700: 			    AC_DEFINE(NO_PAM_SESSION)
 2701: 			    ;;
 2702: 		*)		AC_MSG_RESULT(no)
 2703: 			    AC_MSG_WARN([Ignoring unknown argument to --enable-pam-session: $enableval])
 2704: 			    ;;
 2705: 	    esac], AC_MSG_RESULT(yes))
 2706:     fi
 2707: fi
 2708: 
 2709: dnl
 2710: dnl AIX general authentication
 2711: dnl If set to "maybe" only enable if no other exclusive method in use.
 2712: dnl
 2713: if test ${with_aixauth-'no'} != "no"; then
 2714:     if test X"$with_aixauth" != X"maybe" -o X"$AUTH_EXCL" = X""; then
 2715: 	AC_MSG_NOTICE([using AIX general authentication])
 2716: 	AC_DEFINE(HAVE_AIXAUTH)
 2717: 	AUTH_OBJS="$AUTH_OBJS aix_auth.lo";
 2718: 	SUDOERS_LIBS="${SUDOERS_LIBS} -ls"
 2719: 	AUTH_EXCL=AIX_AUTH
 2720:     fi
 2721: fi
 2722: 
 2723: dnl
 2724: dnl BSD authentication
 2725: dnl If set to "maybe" only enable if no other exclusive method in use.
 2726: dnl
 2727: if test ${with_bsdauth-'no'} != "no"; then
 2728:     AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H)
 2729: 	[AUTH_OBJS="$AUTH_OBJS bsdauth.lo"]
 2730: 	[BSDAUTH_USAGE='[[-a auth_type]] ']
 2731: 	[AUTH_EXCL=BSD_AUTH; BAMAN=1],
 2732: 	[AC_MSG_ERROR([BSD authentication was specified but bsd_auth.h could not be found])])
 2733: fi
 2734: 
 2735: dnl
 2736: dnl SIA authentication for Tru64 Unix
 2737: dnl
 2738: if test ${CHECKSIA-'false'} = "true"; then
 2739:     AC_CHECK_FUNCS(sia_ses_init, [found=true], [found=false])
 2740:     if test "$found" = "true"; then
 2741: 	AUTH_EXCL=SIA
 2742: 	AUTH_OBJS="$AUTH_OBJS sia.lo"
 2743:     fi
 2744: fi
 2745: 
 2746: dnl
 2747: dnl extra FWTK libs + includes
 2748: dnl
 2749: if test ${with_fwtk-'no'} != "no"; then
 2750:     if test "$with_fwtk" != "yes"; then
 2751: 	SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_fwtk}])
 2752: 	CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
 2753: 	with_fwtk=yes
 2754:     fi
 2755:     SUDOERS_LIBS="${SUDOERS_LIBS} -lauth -lfwall"
 2756:     AUTH_OBJS="$AUTH_OBJS fwtk.lo"
 2757: fi
 2758: 
 2759: dnl
 2760: dnl extra SecurID lib + includes
 2761: dnl
 2762: if test ${with_SecurID-'no'} != "no"; then
 2763:     if test "$with_SecurID" != "yes"; then
 2764: 	:
 2765:     elif test -d /usr/ace/examples; then
 2766: 	with_SecurID=/usr/ace/examples
 2767:     else
 2768: 	with_SecurID=/usr/ace
 2769:     fi
 2770:     CPPFLAGS="${CPPFLAGS} -I${with_SecurID}"
 2771:     SUDO_APPEND_LIBPATH(LDFLAGS, [${with_SecurID}])
 2772:     SUDOERS_LIBS="${SUDOERS_LIBS} -laceclnt -lpthread"
 2773:     AUTH_OBJS="$AUTH_OBJS securid5.lo";
 2774: fi
 2775: 
 2776: dnl
 2777: dnl Non-mutually exclusive auth checks come next.
 2778: dnl Note: passwd must be last of all!
 2779: dnl
 2780: 
 2781: dnl
 2782: dnl Convert default authentication methods to with_* if
 2783: dnl no explicit authentication scheme was specified.
 2784: dnl
 2785: if test -z "${AUTH_EXCL}" -a -n "$AUTH_DEF"; then
 2786:     for auth in $AUTH_DEF; do
 2787: 	case $auth in
 2788: 	    passwd)	: ${with_passwd='maybe'};;
 2789: 	esac
 2790:     done
 2791: fi
 2792: 
 2793: dnl
 2794: dnl Kerberos V
 2795: dnl There is an easy way and a hard way...
 2796: dnl
 2797: if test ${with_kerb5-'no'} != "no"; then
 2798:     AC_CHECK_PROG(KRB5CONFIG, krb5-config, yes, "")
 2799:     if test -n "$KRB5CONFIG"; then
 2800: 	AC_DEFINE(HAVE_KERB5)
 2801: 	AUTH_OBJS="$AUTH_OBJS kerb5.lo"
 2802: 	CPPFLAGS="$CPPFLAGS `krb5-config --cflags`"
 2803: 	SUDOERS_LIBS="$SUDOERS_LIBS `krb5-config --libs`"
 2804: 	dnl
 2805: 	dnl Try to determine whether we have Heimdal or MIT Kerberos
 2806: 	dnl
 2807: 	AC_MSG_CHECKING(whether we are using Heimdal)
 2808: 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
 2809: 		AC_MSG_RESULT(yes)
 2810: 		AC_DEFINE(HAVE_HEIMDAL)
 2811: 	    ], [
 2812: 		AC_MSG_RESULT(no)
 2813: 	    ]
 2814: 	)
 2815:     else
 2816: 	AC_DEFINE(HAVE_KERB5)
 2817: 	dnl
 2818: 	dnl Use the specified directory, if any, else search for correct inc dir
 2819: 	dnl
 2820: 	if test "$with_kerb5" = "yes"; then
 2821: 	    found=no
 2822: 	    O_CPPFLAGS="$CPPFLAGS"
 2823: 	    for dir in "" "kerberosV/" "krb5/" "kerberos5/" "kerberosv5/"; do
 2824: 		CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
 2825: 		AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]])], [found=yes; break])
 2826: 	    done
 2827: 	    if test X"$found" = X"no"; then
 2828: 		CPPFLAGS="$O_CPPFLAGS"
 2829: 		AC_MSG_WARN([Unable to locate Kerberos V include files, you will have to edit the Makefile and add -I/path/to/krb/includes to CPPFLAGS])
 2830: 	    fi
 2831: 	else
 2832: 	    dnl XXX - try to include krb5.h here too
 2833: 	    SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_kerb5}/lib])
 2834: 	    CPPFLAGS="$CPPFLAGS -I${with_kerb5}/include"
 2835: 	fi
 2836: 
 2837: 	dnl
 2838: 	dnl Try to determine whether we have Heimdal or MIT Kerberos
 2839: 	dnl
 2840: 	AC_MSG_CHECKING(whether we are using Heimdal)
 2841: 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
 2842: 		AC_MSG_RESULT(yes)
 2843: 		AC_DEFINE(HAVE_HEIMDAL)
 2844: 		# XXX - need to check whether -lcrypo is needed!
 2845: 		SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lcrypto -ldes -lcom_err -lasn1"
 2846: 		AC_CHECK_LIB(roken, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lroken"])
 2847: 	    ], [
 2848: 		AC_MSG_RESULT(no)
 2849: 		SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lk5crypto -lcom_err"
 2850: 		AC_CHECK_LIB(krb5support, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5support"])
 2851: 	])
 2852: 	AUTH_OBJS="$AUTH_OBJS kerb5.lo"
 2853:     fi
 2854:     _LIBS="$LIBS"
 2855:     LIBS="${LIBS} ${SUDOERS_LIBS}"
 2856:     AC_CHECK_FUNCS(krb5_verify_user krb5_init_secure_context)
 2857:     AC_CHECK_FUNCS(krb5_get_init_creds_opt_alloc, [
 2858: 	AC_CACHE_CHECK([whether krb5_get_init_creds_opt_free takes a context],
 2859: 	    sudo_cv_krb5_get_init_creds_opt_free_two_args, [
 2860: 		AC_COMPILE_IFELSE(
 2861: 		    [AC_LANG_PROGRAM(
 2862: 			[[#include <krb5.h>]],
 2863: 			[[krb5_get_init_creds_opt_free(NULL, NULL);]]
 2864: 		    )],
 2865: 		    [sudo_cv_krb5_get_init_creds_opt_free_two_args=yes],
 2866: 		    [sudo_cv_krb5_get_init_creds_opt_free_two_args=no]
 2867: 		)
 2868: 	    ]
 2869: 	)
 2870:     ])
 2871:     if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then
 2872:   	AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS)
 2873:     fi
 2874:     LIBS="$_LIBS"
 2875:     AC_MSG_CHECKING(whether to use an instance name for Kerberos V)
 2876:     AC_ARG_ENABLE(kerb5-instance,
 2877:     [AS_HELP_STRING([--enable-kerb5-instance], [instance string to append to the username (separated by a slash)])],
 2878: 	[ case "$enableval" in
 2879: 	    yes)	AC_MSG_ERROR(["must give --enable-kerb5-instance an argument."])
 2880: 			;;
 2881: 	    no)		AC_MSG_RESULT(no)
 2882: 			;;
 2883: 	    *)		SUDO_DEFINE_UNQUOTED(SUDO_KRB5_INSTANCE, "$enableval")
 2884: 			AC_MSG_RESULT([$enableval])
 2885: 			;;
 2886: 	esac], AC_MSG_RESULT(no))
 2887: fi
 2888: 
 2889: dnl
 2890: dnl extra AFS libs and includes
 2891: dnl
 2892: if test ${with_AFS-'no'} = "yes"; then
 2893: 
 2894:     # looks like the "standard" place for AFS libs is /usr/afsws/lib
 2895:     AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
 2896:     for i in $AFSLIBDIRS; do
 2897: 	if test -d ${i}; then
 2898: 	    SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [$i])
 2899: 	    FOUND_AFSLIBDIR=true
 2900: 	fi
 2901:     done
 2902:     if test -z "$FOUND_AFSLIBDIR"; then
 2903: 	AC_MSG_WARN([Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDOERS_LDFLAGS or rerun configure with the --with-libpath options.])
 2904:     fi
 2905: 
 2906:     # Order is important here.  Note that we build AFS_LIBS from right to left
 2907:     # since AFS_LIBS may be initialized with BSD compat libs that must go last
 2908:     AFS_LIBS="-laudit ${AFS_LIBS}"
 2909:     for i in $AFSLIBDIRS; do
 2910: 	if test -f ${i}/util.a; then
 2911: 	    AFS_LIBS="${i}/util.a ${AFS_LIBS}"
 2912: 	    FOUND_UTIL_A=true
 2913: 	    break;
 2914: 	fi
 2915:     done
 2916:     if test -z "$FOUND_UTIL_A"; then
 2917: 	AFS_LIBS="-lutil ${AFS_LIBS}"
 2918:     fi
 2919:     AFS_LIBS="-lkauth -lprot -lubik -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err ${AFS_LIBS}"
 2920: 
 2921:     # AFS includes may live in /usr/include on some machines...
 2922:     for i in /usr/afsws/include; do
 2923: 	if test -d ${i}; then
 2924: 	    CPPFLAGS="${CPPFLAGS} -I${i}"
 2925: 	    FOUND_AFSINCDIR=true
 2926: 	fi
 2927:     done
 2928: 
 2929:     if test -z "$FOUND_AFSLIBDIR"; then
 2930: 	AC_MSG_WARN([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.])
 2931:     fi
 2932: 
 2933:     AUTH_OBJS="$AUTH_OBJS afs.lo"
 2934: fi
 2935: 
 2936: dnl
 2937: dnl extra DCE obj + lib
 2938: dnl Order of libs in HP-UX 10.x is important, -ldce must be last.
 2939: dnl
 2940: if test ${with_DCE-'no'} = "yes"; then
 2941:     DCE_OBJS="${DCE_OBJS} dce_pwent.o"
 2942:     SUDOERS_LIBS="${SUDOERS_LIBS} -ldce"
 2943:     AUTH_OBJS="$AUTH_OBJS dce.lo"
 2944: fi
 2945: 
 2946: dnl
 2947: dnl extra S/Key lib and includes
 2948: dnl
 2949: if test "${with_skey-'no'}" = "yes"; then
 2950:     O_LDFLAGS="$LDFLAGS"
 2951:     if test "$with_skey" != "yes"; then
 2952: 	CPPFLAGS="${CPPFLAGS} -I${with_skey}/include"
 2953: 	SUDO_APPEND_LIBPATH(LDFLAGS, [${with_skey}/lib])
 2954: 	SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_skey}/lib])
 2955: 	AC_CHECK_HEADER([skey.h], [found=yes], [found=no], [#include <stdio.h>])
 2956:     else
 2957: 	found=no
 2958: 	O_CPPFLAGS="$CPPFLAGS"
 2959: 	for dir in "" "/usr/local" "/usr/contrib"; do
 2960: 	    test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
 2961: 	    AC_CHECK_HEADER([skey.h], [found=yes; break], [],
 2962: 		[#include <stdio.h>])
 2963: 	done
 2964: 	if test "$found" = "no" -o -z "$dir"; then
 2965: 	    CPPFLAGS="$O_CPPFLAGS"
 2966: 	else
 2967: 	    SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
 2968: 	    SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
 2969: 	fi
 2970: 	if test "$found" = "no"; then
 2971: 	    AC_MSG_WARN([Unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS])
 2972: 	fi
 2973:     fi
 2974:     AC_CHECK_LIB(skey, main, [found=yes], [AC_MSG_WARN([Unable to locate libskey.a, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDOERS_LDFLAGS])])
 2975:     AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
 2976: 
 2977:     AC_MSG_CHECKING([for RFC1938-compliant skeychallenge])
 2978:     AC_COMPILE_IFELSE(
 2979: 	[AC_LANG_PROGRAM(
 2980: 	    [[#include <stdio.h>
 2981: 	    #include <skey.h>]],
 2982: 	    [[skeychallenge(NULL, NULL, NULL, 0);]]
 2983: 	)], [
 2984: 	    AC_DEFINE(HAVE_RFC1938_SKEYCHALLENGE)
 2985: 	    AC_MSG_RESULT([yes])
 2986: 	], [
 2987: 	    AC_MSG_RESULT([no])
 2988: 	]
 2989:     )
 2990: 
 2991:     LDFLAGS="$O_LDFLAGS"
 2992:     SUDOERS_LIBS="${SUDOERS_LIBS} -lskey"
 2993:     AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
 2994: fi
 2995: 
 2996: dnl
 2997: dnl extra OPIE lib and includes
 2998: dnl
 2999: if test "${with_opie-'no'}" = "yes"; then
 3000:     O_LDFLAGS="$LDFLAGS"
 3001:     if test "$with_opie" != "yes"; then
 3002: 	CPPFLAGS="${CPPFLAGS} -I${with_opie}/include"
 3003: 	SUDO_APPEND_LIBPATH(LDFLAGS, [${with_opie}/lib])
 3004: 	SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_opie}/lib])
 3005: 	AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <opie.h>]])], [found=yes], [found=no])
 3006:     else
 3007: 	found=no
 3008: 	O_CPPFLAGS="$CPPFLAGS"
 3009: 	for dir in "" "/usr/local" "/usr/contrib"; do
 3010: 	    test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
 3011: 	    AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <opie.h>]])], [found=yes; break])
 3012: 	done
 3013: 	if test "$found" = "no" -o -z "$dir"; then
 3014: 	    CPPFLAGS="$O_CPPFLAGS"
 3015: 	else
 3016: 	    SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
 3017: 	    SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
 3018: 	fi
 3019: 	if test "$found" = "no"; then
 3020: 	    AC_MSG_WARN([Unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS])
 3021: 	fi
 3022:     fi
 3023:     AC_CHECK_LIB(opie, main, [found=yes], [AC_MSG_WARN([Unable to locate libopie.a, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDOERS_LDFLAGS])])
 3024:     LDFLAGS="$O_LDFLAGS"
 3025:     SUDOERS_LIBS="${SUDOERS_LIBS} -lopie"
 3026:     AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
 3027: fi
 3028: 
 3029: dnl
 3030: dnl Check for shadow password routines if we have not already done so.
 3031: dnl If there is a specific list of functions to check we do that first.
 3032: dnl Otherwise, we check for SVR4-style and then SecureWare-style.
 3033: dnl
 3034: if test ${with_passwd-'no'} != "no"; then
 3035:     dnl
 3036:     dnl if crypt(3) not in libc, look elsewhere
 3037:     dnl
 3038:     if test -z "$LIB_CRYPT"; then
 3039: 	_LIBS="$LIBS"
 3040: 	AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
 3041: 	LIBS="$_LIBS"
 3042:     fi
 3043: 
 3044:     if test "$CHECKSHADOW" = "true" -a -n "$shadow_funcs"; then
 3045: 	_LIBS="$LIBS"
 3046: 	LIBS="$LIBS $shadow_libs"
 3047: 	found=no
 3048: 	AC_CHECK_FUNCS($shadow_funcs, [found=yes])
 3049: 	if test "$found" = "yes"; then
 3050: 	    SUDOERS_LIBS="$SUDOERS_LIBS $shadow_libs"
 3051: 	elif test -n "$shadow_libs_optional"; then
 3052: 	    LIBS="$LIBS $shadow_libs_optional"
 3053: 	    AC_CHECK_FUNCS($shadow_funcs, [found=yes])
 3054: 	    if test "$found" = "yes"; then
 3055: 		SUDOERS_LIBS="$SUDOERS_LIBS $shadow_libs $shadow_libs_optional"
 3056: 	    fi
 3057: 	fi
 3058: 	if test "$found" = "yes"; then
 3059: 	    case "$shadow_funcs" in
 3060: 		*getprpwnam*) SECUREWARE=1;;
 3061: 	    esac
 3062: 	    test -n "$shadow_defs" && OSDEFS="${OSDEFS} $shadow_defs"
 3063: 	else
 3064: 	    LIBS="$_LIBS"
 3065: 	fi
 3066: 	CHECKSHADOW=false
 3067:     fi
 3068:     if test "$CHECKSHADOW" = "true"; then
 3069: 	AC_SEARCH_LIBS([getspnam], [gen], [AC_DEFINE(HAVE_GETSPNAM)] [CHECKSHADOW=false; test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
 3070:     fi
 3071:     if test "$CHECKSHADOW" = "true"; then
 3072: 	AC_SEARCH_LIBS([getprpwnam], [sec security prot], [AC_DEFINE(HAVE_GETPRPWNAM)] [CHECKSHADOW=false; SECUREWARE=1; test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
 3073:     fi
 3074:     if test -n "$SECUREWARE"; then
 3075: 	AC_CHECK_FUNCS(bigcrypt set_auth_parameters initprivs)
 3076: 	AUTH_OBJS="$AUTH_OBJS secureware.lo"
 3077:     fi
 3078: fi
 3079: 
 3080: dnl
 3081: dnl extra lib and .o file for LDAP support
 3082: dnl
 3083: if test ${with_ldap-'no'} != "no"; then
 3084:     _LDFLAGS="$LDFLAGS"
 3085:     if test "$with_ldap" != "yes"; then
 3086: 	SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_ldap}/lib])
 3087: 	SUDO_APPEND_LIBPATH(LDFLAGS, [${with_ldap}/lib])
 3088: 	CPPFLAGS="${CPPFLAGS} -I${with_ldap}/include"
 3089: 	with_ldap=yes
 3090:     fi
 3091:     SUDOERS_OBJS="${SUDOERS_OBJS} ldap.lo"
 3092:     LDAP=""
 3093: 
 3094:     AC_MSG_CHECKING([for LDAP libraries])
 3095:     LDAP_LIBS=""
 3096:     _LIBS="$LIBS"
 3097:     found=no
 3098:     for l in -lldap -llber '-lssl -lcrypto'; do
 3099: 	LIBS="${LIBS} $l"
 3100: 	LDAP_LIBS="${LDAP_LIBS} $l"
 3101: 	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 3102: 	#include <lber.h>
 3103: 	#include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
 3104:     done
 3105:     if test "$found" = "no"; then
 3106: 	LDAP_LIBS=""
 3107: 	LIBS="$_LIBS"
 3108: 	for l in -libmldap -lidsldif; do
 3109: 	    LIBS="${LIBS} $l"
 3110: 	    LDAP_LIBS="${LDAP_LIBS} $l"
 3111: 	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 3112: 	    #include <lber.h>
 3113: 	    #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
 3114: 	done
 3115:     fi
 3116:     dnl if nothing linked just try with -lldap
 3117:     if test "$found" = "no"; then
 3118: 	LIBS="${_LIBS} -lldap"
 3119: 	LDAP_LIBS="-lldap"
 3120: 	AC_MSG_RESULT([not found, using -lldap])
 3121:     else
 3122: 	AC_MSG_RESULT([$LDAP_LIBS])
 3123:     fi
 3124:     dnl check if we need to link with -llber for ber_set_option
 3125:     OLIBS="$LIBS"
 3126:     AC_SEARCH_LIBS([ber_set_option], [lber], [found=yes], [found=no])
 3127:     if test X"$found" = X"yes" -a X"$LIBS" != X"$OLIBS"; then
 3128: 	LDAP_LIBS="$LDAP_LIBS -llber"
 3129:     fi
 3130:     dnl check if ldap.h includes lber.h for us
 3131:     AC_MSG_CHECKING([whether lber.h is needed])
 3132:     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 3133:     #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [AC_MSG_RESULT([no])], [
 3134:     AC_MSG_RESULT([yes])
 3135:     AC_DEFINE(HAVE_LBER_H)])
 3136: 
 3137:     AC_CHECK_HEADERS([sasl/sasl.h] [sasl.h], [AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s)], [break])
 3138:     AC_CHECK_HEADERS([ldap_ssl.h] [mps/ldap_ssl.h], [break], [], [#include <ldap.h>])
 3139:     AC_CHECK_FUNCS(ldap_initialize ldap_start_tls_s ldapssl_init ldapssl_set_strength ldap_unbind_ext_s ldap_str2dn ldap_create ldap_sasl_bind_s ldap_ssl_init ldap_ssl_client_init ldap_start_tls_s_np)
 3140:     AC_CHECK_FUNCS(ldap_search_ext_s ldap_search_st, [break])
 3141: 
 3142:     if test X"$check_gss_krb5_ccache_name" = X"yes"; then
 3143: 	AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,
 3144: 	    AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
 3145: 	    [LDAP_LIBS="${LDAP_LIBS} -lgssapi"],
 3146: 	    AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,
 3147: 		AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
 3148: 		[LDAP_LIBS="${LDAP_LIBS} -lgssapi_krb5"])
 3149: 	)
 3150: 
 3151: 	# gssapi headers may be separate or part of Kerberos V
 3152: 	found=no
 3153: 	O_CPPFLAGS="$CPPFLAGS"
 3154: 	for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do
 3155: 	    test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
 3156: 	    AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <gssapi/gssapi.h>]])], [found="gssapi/gssapi.h"; break], [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <gssapi.h>]])], [found="gssapi.h"; break])])
 3157: 	done
 3158: 	if test X"$found" != X"no"; then
 3159: 	    AC_CHECK_HEADERS([$found])
 3160: 	    if test X"$found" = X"gssapi/gssapi.h"; then
 3161: 		AC_CHECK_HEADERS([gssapi/gssapi_krb5.h])
 3162: 	    fi
 3163: 	else
 3164: 	    CPPFLAGS="$O_CPPFLAGS"
 3165: 	    AC_MSG_WARN([Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS])
 3166: 	fi
 3167:     fi
 3168: 
 3169:     SUDOERS_LIBS="${SUDOERS_LIBS} ${LDAP_LIBS}"
 3170:     LIBS="$_LIBS"
 3171:     LDFLAGS="$_LDFLAGS"
 3172: fi
 3173: 
 3174: #
 3175: # How to do dynamic object loading.
 3176: # We support dlopen() and sh_load(), else fall back to static loading.
 3177: #
 3178: case "$lt_cv_dlopen" in
 3179:     dlopen)
 3180: 	AC_DEFINE(HAVE_DLOPEN)
 3181: 	SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo"
 3182: 	LT_STATIC="--tag=disable-static"
 3183: 	;;
 3184:     shl_load)
 3185: 	AC_DEFINE(HAVE_SHL_LOAD)
 3186: 	SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo"
 3187: 	LT_STATIC="--tag=disable-static"
 3188: 	AC_LIBOBJ(dlopen)
 3189: 	;;
 3190:     *)
 3191: 	if test X"${ac_cv_func_dlopen}" = X"yes"; then
 3192: 	    AC_MSG_ERROR(["dlopen present but libtool doesn't appear to support your platform."])
 3193: 	fi
 3194: 	# Preload sudoers module symbols
 3195: 	SUDO_OBJS="${SUDO_OBJS} preload.o"
 3196: 	SUDO_LIBS="${SUDO_LIBS} \$(top_builddir)/plugins/sudoers/sudoers.la"
 3197: 	LT_STATIC=""
 3198: 	AC_LIBOBJ(dlopen)
 3199: 	;;
 3200: esac
 3201: 
 3202: #
 3203: # Add library needed for dynamic loading, if any.
 3204: #
 3205: LIBDL="$lt_cv_dlopen_libs"
 3206: if test X"$LIBDL" != X""; then
 3207:     SUDO_LIBS="${SUDO_LIBS} $LIBDL"
 3208:     SUDOERS_LIBS="${SUDOERS_LIBS} $LIBDL"
 3209: fi
 3210: 
 3211: # On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
 3212: # the main program is linked against -lpthread.  We have no knowledge of
 3213: # what libraries a plugin may depend on (e.g. HP-UX LDAP which uses pthreads)
 3214: # so always link against -lpthread on HP-UX if it is available.
 3215: # This check should go after all other libraries tests.
 3216: case "$host" in
 3217:     *-*-hpux*)
 3218: 	AC_CHECK_LIB(pthread, main, [SUDO_LIBS="${SUDO_LIBS} -lpthread"])
 3219: 	;;
 3220: esac
 3221: 
 3222: dnl
 3223: dnl Add $blibpath to SUDOERS_LDFLAGS if specified by the user or if we
 3224: dnl added -L dirpaths to SUDOERS_LDFLAGS.
 3225: dnl
 3226: if test -n "$blibpath"; then
 3227:     if test -n "$blibpath_add"; then
 3228:     	SUDOERS_LDFLAGS="$SUDOERS_LDFLAGS -Wl,-blibpath:${blibpath}${blibpath_add}"
 3229:     elif test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
 3230:     	SUDOERS_LDFLAGS="$SUDOERS_LDFLAGS -Wl,-blibpath:${blibpath}"
 3231:     fi
 3232: fi
 3233: 
 3234: dnl
 3235: dnl Check for log file, timestamp and iolog locations
 3236: dnl
 3237: if test "$utmp_style" = "LEGACY"; then
 3238:     SUDO_PATH_UTMP
 3239: fi
 3240: SUDO_LOGFILE
 3241: SUDO_TIMEDIR
 3242: SUDO_IO_LOGDIR
 3243: 
 3244: dnl
 3245: dnl Turn warnings into errors.
 3246: dnl All compiler/loader tests after this point will fail if
 3247: dnl a warning is displayed (nornally, warnings are not fata).
 3248: dnl
 3249: AC_LANG_WERROR
 3250: 
 3251: dnl
 3252: dnl If compiler supports the -static-libgcc flag use it unless we have
 3253: dnl GNU ld (which can avoid linking in libgcc when it is not needed).
 3254: dnl This test relies on AC_LANG_WERROR
 3255: dnl
 3256: if test -n "$GCC" -a "$lt_cv_prog_gnu_ld" != "yes" -a -n "$GCC"; then
 3257:     AX_CHECK_COMPILE_FLAG([-static-libgcc], [LT_LDFLAGS="$LT_LDFLAGS -Wc,-static-libgcc"])
 3258: fi
 3259: 
 3260: dnl
 3261: dnl Check for symbol visibility support.
 3262: dnl This test relies on AC_LANG_WERROR
 3263: dnl
 3264: AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [
 3265:     AC_DEFINE(HAVE_DSO_VISIBILITY)
 3266:     CFLAGS="${CFLAGS} -fvisibility=hidden"
 3267:     LT_LDEXPORTS=
 3268:     LT_LDDEP=
 3269: ], [
 3270:     NO_VIZ="-DNO_VIZ"
 3271:     if test -z "$GCC"; then
 3272: 	case "$host" in
 3273: 	    *-*-hpux*)
 3274: 		AX_CHECK_COMPILE_FLAG([-Bhidden_def], [
 3275: 		    AC_DEFINE(HAVE_DSO_VISIBILITY)
 3276: 		    CFLAGS="${CFLAGS} -Bhidden_def"
 3277: 		    LT_LDEXPORTS=
 3278: 		    LT_LDDEP=
 3279: 		])
 3280: 		;;
 3281: 	    *-*-solaris2*)
 3282: 		AX_CHECK_COMPILE_FLAG([-xldscope=hidden], [
 3283: 		    AC_DEFINE(HAVE_DSO_VISIBILITY)
 3284: 		    CFLAGS="${CFLAGS} -xldscope=hidden"
 3285: 		    LT_LDEXPORTS=
 3286: 		    LT_LDDEP=
 3287: 		])
 3288: 		;;
 3289: 	esac
 3290:     fi
 3291: ])
 3292: 
 3293: dnl
 3294: dnl If the compiler doesn't have symbol visibility support, it may
 3295: dnl support version scripts (only GNU and Solaris ld).
 3296: dnl This test relies on AC_LANG_WERROR
 3297: dnl
 3298: if test -n "$LT_LDEXPORTS"; then
 3299:     if test "$lt_cv_prog_gnu_ld" = "yes"; then
 3300: 	AC_CACHE_CHECK([whether ld supports anonymous map files],
 3301: 	    [sudo_cv_var_gnu_ld_anon_map],
 3302: 	    [
 3303: 		cat > conftest.map <<-EOF
 3304: 		{
 3305: 		    global: foo;
 3306: 		    local:  *;
 3307: 		};
 3308: EOF
 3309: 		_CFLAGS="$CFLAGS"
 3310: 		CFLAGS="$CFLAGS $lt_prog_compiler_pic"
 3311: 		_LDFLAGS="$LDFLAGS"
 3312: 		LDFLAGS="$LDFLAGS -fpic -shared -Wl,--version-script,./conftest.map"
 3313: 		AC_TRY_LINK([int foo;], [], [
 3314: 		    sudo_cv_var_gnu_ld_anon_map=yes
 3315: 		])
 3316: 		CFLAGS="$_CFLAGS"
 3317: 		LDFLAGS="$_LDFLAGS"
 3318: 	    ]
 3319: 	)
 3320: 	if test "$sudo_cv_var_gnu_ld_anon_map" = "yes"; then
 3321: 	    LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,--version-script,\$(shlib_map)"
 3322: 	fi
 3323:     else
 3324: 	case "$host" in
 3325: 	    *-*-solaris2*)
 3326: 		AC_CACHE_CHECK([whether ld supports anonymous map files],
 3327: 		    [sudo_cv_var_solaris_ld_anon_map],
 3328: 		    [
 3329: 			cat > conftest.map <<-EOF
 3330: 			{
 3331: 			    global: foo;
 3332: 			    local:  *;
 3333: 			};
 3334: EOF
 3335: 			_CFLAGS="$CFLAGS"
 3336: 			CFLAGS="$CFLAGS $lt_prog_compiler_pic"
 3337: 			_LDFLAGS="$LDFLAGS"
 3338: 			LDFLAGS="$LDFLAGS -shared -Wl,-M,./conftest.map"
 3339: 			AC_TRY_LINK([int foo;], [], [
 3340: 			    sudo_cv_var_solaris_ld_anon_map=yes
 3341: 			])
 3342: 			CFLAGS="$_CFLAGS"
 3343: 			LDFLAGS="$_LDFLAGS"
 3344: 		    ]
 3345: 		)
 3346: 		if test "$sudo_cv_var_solaris_ld_anon_map" = "yes"; then
 3347: 		    LT_LDEXPORTS=; LT_LDDEP="\$(shlib_map)"; LT_LDMAP="-Wl,-M,\$(shlib_map)"
 3348: 		fi
 3349: 		;;
 3350: 	    *-*-hpux*)
 3351: 		AC_CACHE_CHECK([whether ld supports controlling exported symbols],
 3352: 		    [sudo_cv_var_hpux_ld_symbol_export],
 3353: 		    [
 3354: 			echo "+e foo" > conftest.opt
 3355: 			_CFLAGS="$CFLAGS"
 3356: 			CFLAGS="$CFLAGS $lt_prog_compiler_pic"
 3357: 			_LDFLAGS="$LDFLAGS"
 3358: 			if test -n "$GCC"; then
 3359: 			    LDFLAGS="$LDFLAGS -shared -Wl,-c,./conftest.opt"
 3360: 			else
 3361: 			    LDFLAGS="$LDFLAGS -Wl,-b -Wl,-c,./conftest.opt"
 3362: 			fi
 3363: 			AC_TRY_LINK([int foo;], [], [
 3364: 			    sudo_cv_var_hpux_ld_symbol_export=yes
 3365: 			])
 3366: 			CFLAGS="$_CFLAGS"
 3367: 			LDFLAGS="$_LDFLAGS"
 3368: 		    ]
 3369: 		)
 3370: 		if test "$sudo_cv_var_hpux_ld_symbol_export" = "yes"; then
 3371: 		    LT_LDEXPORTS=; LT_LDDEP="\$(shlib_opt)"; LT_LDOPT="-Wl,-c,\$(shlib_opt)"
 3372: 		fi
 3373: 		;;
 3374: 	esac
 3375:     fi
 3376: fi
 3377: 
 3378: dnl
 3379: dnl Check for PIE executable support if using gcc.
 3380: dnl This test relies on AC_LANG_WERROR
 3381: dnl
 3382: if test "$enable_pie" != "no" -a -n "$GCC"; then
 3383:     AX_CHECK_COMPILE_FLAG([-fPIE], [
 3384: 	_CFLAGS="$CFLAGS"
 3385: 	CFLAGS="$CFLAGS -fPIE"
 3386: 	AX_CHECK_LINK_FLAG([-pie], [
 3387: 	    PIE_CFLAGS="-fPIE"
 3388: 	    PIE_LDFLAGS="-pie"
 3389: 	])
 3390: 	CFLAGS="$_CFLAGS"
 3391:     ])
 3392: fi
 3393: 
 3394: dnl
 3395: dnl Check for -fstack-protector and -z relro support
 3396: dnl This test relies on AC_LANG_WERROR
 3397: dnl
 3398: if test "$enable_hardening" != "no"; then
 3399:     AX_CHECK_COMPILE_FLAG([-fstack-protector], [
 3400: 	AX_CHECK_LINK_FLAG([-fstack-protector], [
 3401: 	    CFLAGS="${CFLAGS} -fstack-protector"
 3402: 	    LT_LDFLAGS="${LT_LDFLAGS} -Wc,-fstack-protector"
 3403: 	])
 3404:     ])
 3405:     AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="${LDFLAGS} -Wl,-z,relro"])
 3406: fi
 3407: 
 3408: dnl
 3409: dnl Use passwd auth module?
 3410: dnl
 3411: case "$with_passwd" in
 3412: yes|maybe)
 3413:     AUTH_OBJS="$AUTH_OBJS getspwuid.lo passwd.lo"
 3414:     ;;
 3415: *)
 3416:     AC_DEFINE(WITHOUT_PASSWD)
 3417:     if test -z "$AUTH_OBJS"; then
 3418: 	AC_MSG_ERROR([no authentication methods defined.])
 3419:     fi
 3420:     ;;
 3421: esac
 3422: AUTH_OBJS=${AUTH_OBJS# }
 3423: _AUTH=`echo "$AUTH_OBJS" | sed -e 's/\.lo//g' -e 's/getspwuid *//'`
 3424: AC_MSG_NOTICE([using the following authentication methods: $_AUTH])
 3425: 
 3426: dnl
 3427: dnl LIBS may contain duplicates from SUDO_LIBS, SUDOERS_LIBS, or NET_LIBS
 3428: dnl
 3429: if test -n "$LIBS"; then
 3430:     L="$LIBS"
 3431:     LIBS=
 3432:     for l in ${L}; do
 3433: 	dupe=0
 3434: 	for sl in ${SUDO_LIBS} ${SUDOERS_LIBS} ${NET_LIBS}; do
 3435: 	    test $l = $sl && dupe=1
 3436: 	done
 3437: 	test $dupe = 0 && LIBS="${LIBS} $l"
 3438:     done
 3439: fi
 3440: 
 3441: dnl
 3442: dnl We add -Wall and -Werror after all tests so they don't cause failures
 3443: dnl
 3444: if test -n "$GCC"; then
 3445:     if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
 3446: 	CFLAGS="${CFLAGS} -Wall"
 3447:     fi
 3448:     if test X"$enable_werror" = X"yes"; then
 3449: 	CFLAGS="${CFLAGS} -Werror"
 3450:     fi
 3451: fi
 3452: 
 3453: dnl
 3454: dnl Skip regress tests and sudoers sanity check if cross compiling.
 3455: dnl
 3456: CROSS_COMPILING="$cross_compiling"
 3457: 
 3458: dnl
 3459: dnl Set exec_prefix
 3460: dnl
 3461: test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
 3462: 
 3463: dnl
 3464: dnl Defer setting _PATH_SUDO_NOEXEC until after exec_prefix is set
 3465: dnl XXX - this is gross!
 3466: dnl
 3467: if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
 3468:     oexec_prefix="$exec_prefix"
 3469:     if test "$exec_prefix" = '$(prefix)'; then
 3470: 	if test "$prefix" = "NONE"; then
 3471: 	    exec_prefix="$ac_default_prefix"
 3472: 	else
 3473: 	    exec_prefix="$prefix"
 3474: 	fi
 3475:     fi
 3476:     if test X"$with_noexec" != X"no"; then
 3477: 	PROGS="${PROGS} libsudo_noexec.la"
 3478: 	INSTALL_NOEXEC="install-noexec"
 3479: 
 3480: 	noexec_file="$with_noexec"
 3481: 	_noexec_file=
 3482: 	while test X"$noexec_file" != X"$_noexec_file"; do
 3483: 	    _noexec_file="$noexec_file"
 3484: 	    eval noexec_file="$_noexec_file"
 3485: 	done
 3486: 	SUDO_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, "$noexec_file", [The fully qualified pathname of sudo_noexec.so])
 3487:     fi
 3488:     if test X"$with_selinux" != X"no"; then
 3489: 	sesh_file="$libexecdir/sesh"
 3490: 	_sesh_file=
 3491: 	while test X"$sesh_file" != X"$_sesh_file"; do
 3492: 	    _sesh_file="$sesh_file"
 3493: 	    eval sesh_file="$_sesh_file"
 3494: 	done
 3495: 	SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file", [The fully qualified pathname of sesh])
 3496:     fi
 3497:     PLUGINDIR="$with_plugindir"
 3498:     _PLUGINDIR=
 3499:     while test X"$PLUGINDIR" != X"$_PLUGINDIR"; do
 3500: 	_PLUGINDIR="$PLUGINDIR"
 3501: 	eval PLUGINDIR="$_PLUGINDIR"
 3502:     done
 3503:     SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$PLUGINDIR/")
 3504:     SUDO_DEFINE_UNQUOTED(SUDOERS_PLUGIN, "sudoers${SOEXT}")
 3505:     exec_prefix="$oexec_prefix"
 3506: fi
 3507: 
 3508: dnl
 3509: dnl Override default configure dirs for the Makefile
 3510: dnl
 3511: if test X"$prefix" = X"NONE"; then
 3512:     test "$mandir" = '${datarootdir}/man' && mandir='$(prefix)/man'
 3513: else
 3514:     test "$mandir" = '${datarootdir}/man' && mandir='$(datarootdir)/man'
 3515: fi
 3516: test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin'
 3517: test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin'
 3518: test "$libexecdir" = '${exec_prefix}/libexec' && libexecdir='$(exec_prefix)/libexec'
 3519: test "$includedir" = '${prefix}/include' && includedir='$(prefix)/include'
 3520: test "$datarootdir" = '${prefix}/share' && datarootdir='$(prefix)/share'
 3521: test "$docdir" = '${datarootdir}/doc/${PACKAGE_TARNAME}' && docdir='$(datarootdir)/doc/$(PACKAGE_TARNAME)'
 3522: test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale'
 3523: test "$localstatedir" = '${prefix}/var' && localstatedir='$(prefix)/var'
 3524: test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
 3525: 
 3526: dnl
 3527: dnl Substitute into the Makefile and man pages
 3528: dnl
 3529: AC_CONFIG_FILES([Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/sample_group/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers])
 3530: AC_OUTPUT
 3531: 
 3532: dnl
 3533: dnl Spew any text the user needs to know about
 3534: dnl
 3535: if test "$with_pam" = "yes"; then
 3536:     case $host in
 3537: 	*-*-hpux*)
 3538: 	    if test -f /usr/lib/security/libpam_hpsec.so.1; then
 3539: 		AC_MSG_NOTICE([You may wish to add the following line to /etc/pam.conf])
 3540: 		AC_MSG_NOTICE([sudo session required libpam_hpsec.so.1 bypass_umask bypass_last_login])
 3541: 	    fi
 3542: 	    ;;
 3543: 	*-*-linux*)
 3544: 	    AC_MSG_NOTICE([You will need to customize sample.pam and install it as /etc/pam.d/sudo])
 3545: 	    ;;
 3546:     esac
 3547: fi
 3548: 
 3549: dnl
 3550: dnl Autoheader templates
 3551: dnl
 3552: AH_TEMPLATE(BROKEN_SYSLOG, [Define to 1 if the `syslog' function returns a non-zero int to denote failure.])
 3553: AH_TEMPLATE(CLASSIC_INSULTS, [Define to 1 if you want the insults from the "classic" version sudo.])
 3554: AH_TEMPLATE(CSOPS_INSULTS, [Define to 1 if you want insults culled from the twisted minds of CSOps.])
 3555: AH_TEMPLATE(SUDOERS_PLUGIN, [The name of the sudoers plugin, including extension.])
 3556: AH_TEMPLATE(DONT_LEAK_PATH_INFO, [Define to 1 if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.])
 3557: AH_TEMPLATE(ENV_DEBUG, [Define to 1 to enable environment function debugging.])
 3558: AH_TEMPLATE(ENV_EDITOR, [Define to 1 if you want visudo to honor the EDITOR and VISUAL env variables.])
 3559: AH_TEMPLATE(FQDN, [Define to 1 if you want to require fully qualified hosts in sudoers.])
 3560: AH_TEMPLATE(ENV_RESET, [Define to 1 to enable environment resetting by default.])
 3561: AH_TEMPLATE(GOONS_INSULTS, [Define to 1 if you want insults from the "Goon Show".])
 3562: AH_TEMPLATE(HAL_INSULTS, [Define to 1 if you want 2001-like insults.])
 3563: AH_TEMPLATE(HAVE_AFS, [Define to 1 if you use AFS.])
 3564: AH_TEMPLATE(HAVE_AIXAUTH, [Define to 1 if you use AIX general authentication.])
 3565: AH_TEMPLATE(HAVE_BSD_AUTH_H, [Define to 1 if you use BSD authentication.])
 3566: AH_TEMPLATE(HAVE_BSM_AUDIT, [Define to 1 to enable BSM audit support.])
 3567: AH_TEMPLATE(HAVE_DCE, [Define to 1 if you use OSF DCE.])
 3568: AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.])
 3569: AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.])
 3570: AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.])
 3571: AH_TEMPLATE(HAVE_DLOPEN, [Define to 1 if you have the `dlopen' function.])
 3572: AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcntl.])
 3573: AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.])
 3574: AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.])
 3575: AH_TEMPLATE(HAVE_GETAUTHUID, [Define to 1 if you have the `getauthuid' function. (ULTRIX 4.x  shadow passwords)])
 3576: AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the `getprpwnam' function.  (SecureWare-style shadow passwords)])
 3577: AH_TEMPLATE(HAVE_GETPWANAM, [Define to 1 if you have the `getpwanam' function. (SunOS 4.x shadow passwords)])
 3578: AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR4-style shadow passwords)])
 3579: AH_TEMPLATE(HAVE_GETSPWUID, [Define to 1 if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
 3580: AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
 3581: AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
 3582: AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])
 3583: AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
 3584: AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.])
 3585: AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.])
 3586: AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_free' function takes two arguments.])
 3587: AH_TEMPLATE(HAVE_KRB5_INIT_SECURE_CONTEXT, [Define to 1 if you have the `krb5_init_secure_context' function.])
 3588: AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.])
 3589: AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs <lber.h>. (OpenLDAP does not)])
 3590: AH_TEMPLATE(HAVE_LDAP, [Define to 1 if you use LDAP for sudoers.])
 3591: AH_TEMPLATE(HAVE_LIBINTL_H, [Define to 1 if you have the <libintl.h> header file.])
 3592: AH_TEMPLATE(HAVE_LINUX_AUDIT, [Define to 1 to enable Linux audit support.])
 3593: AH_TEMPLATE(HAVE_SSSD, [Define to 1 to enable SSSD support.])
 3594: AH_TEMPLATE(HAVE_OPIE, [Define to 1 if you use NRL OPIE.])
 3595: AH_TEMPLATE(HAVE_PAM, [Define to 1 if you use PAM authentication.])
 3596: AH_TEMPLATE(HAVE_PAM_LOGIN, [Define to 1 if you use a specific PAM session for sudo -i.])
 3597: AH_TEMPLATE(HAVE_PROJECT_H, [Define to 1 if you have the <project.h> header file.])
 3598: AH_TEMPLATE(HAVE_SECURID, [Define to 1 if you use SecurID for authentication.])
 3599: AH_TEMPLATE(HAVE_SELINUX, [Define to 1 to enable SELinux RBAC support.])
 3600: AH_TEMPLATE(HAVE_SETKEYCREATECON, [Define to 1 if you have the `setkeycreatecon' function.])
 3601: AH_TEMPLATE(HAVE_SHL_LOAD, [Define to 1 if you have the `shl_load' function.])
 3602: AH_TEMPLATE(HAVE_SKEY, [Define to 1 if you use S/Key.])
 3603: AH_TEMPLATE(HAVE_SKEYACCESS, [Define to 1 if your S/Key library has skeyaccess().])
 3604: AH_TEMPLATE(HAVE_RFC1938_SKEYCHALLENGE, [Define to 1 if the skeychallenge() function is RFC1938-compliant and takes 4 arguments])
 3605: AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union])
 3606: AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
 3607: AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
 3608: AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
 3609: AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
 3610: AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements])
 3611: AH_TEMPLATE(LOGGING, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
 3612: AH_TEMPLATE(LONG_OTP_PROMPT, [Define to 1 if you want a two line OTP (S/Key or OPIE) prompt.])
 3613: AH_TEMPLATE(NO_AUTHENTICATION, [Define to 1 if you don't want sudo to prompt for a password by default.])
 3614: AH_TEMPLATE(NO_LECTURE, [Define to 1 if you don't want users to get the lecture the first they user sudo.])
 3615: AH_TEMPLATE(NO_PAM_SESSION, [Define to 1 if you don't want to use sudo's PAM session support])
 3616: AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid runing the mailer as root.])
 3617: AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.])
 3618: AH_TEMPLATE(NO_TTY_TICKETS, [Define to 1 if you want a single ticket file instead of per-tty files.])
 3619: AH_TEMPLATE(PC_INSULTS, [Define to 1 to replace politically incorrect insults with less offensive ones.])
 3620: AH_TEMPLATE(SECURE_PATH, [Define to 1 to override the user's path with a built-in one.])
 3621: AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.])
 3622: AH_TEMPLATE(SEND_MAIL_WHEN_NO_HOST, [Define to 1 to send mail when the user is not allowed to run sudo on this host.])
 3623: AH_TEMPLATE(SEND_MAIL_WHEN_NO_USER, [Define to 1 to send mail when the user is not in the sudoers file.])
 3624: AH_TEMPLATE(SHELL_IF_NO_ARGS, [Define to 1 if you want sudo to start a shell if given no arguments.])
 3625: AH_TEMPLATE(SHELL_SETS_HOME, [Define to 1 if you want sudo to set $HOME in shell mode.])
 3626: AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does not compile for you.])
 3627: AH_TEMPLATE(UMASK_OVERRIDE, [Define to 1 to use the umask specified in sudoers even when it is less restrictive than the invoking user's.])
 3628: AH_TEMPLATE(USE_ADMIN_FLAG, [Define to 1 if you want to create ~/.sudo_as_admin_successful if the user is in the admin group the first time they run sudo.])
 3629: AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.])
 3630: AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.])
 3631: AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.])
 3632: AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
 3633: AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.])
 3634: AH_TEMPLATE(socklen_t, [Define to `unsigned int' if <sys/socket.h> doesn't define.])
 3635: AH_TEMPLATE(HAVE_STRUCT_UTMP_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmp'.])
 3636: AH_TEMPLATE(HAVE_STRUCT_UTMPX_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmpx'.])
 3637: AH_TEMPLATE(HAVE___FUNC__, [Define to 1 if the compiler supports the C99 __func__ variable.])
 3638: AH_TEMPLATE(SUDO_KRB5_INSTANCE, [An instance string to append to the username (separated by a slash) for Kerberos V authentication])
 3639: AH_TEMPLATE(RTLD_PRELOAD_VAR, [The environment variable that controls preloading of dynamic objects.])
 3640: AH_TEMPLATE(RTLD_PRELOAD_ENABLE_VAR, [An extra environment variable that is required to enable preloading (if any).])
 3641: AH_TEMPLATE(RTLD_PRELOAD_DELIM, [The delimiter to use when defining multiple preloaded objects.])
 3642: AH_TEMPLATE(RTLD_PRELOAD_DEFAULT, [The default value of preloaded objects (if any).])
 3643: AH_TEMPLATE(HAVE_DSO_VISIBILITY, [Define to 1 if the compiler supports the __visibility__ attribute.])
 3644: AH_TEMPLATE(HAVE_SYS_SIGABBREV, [Define to 1 if your libc has the `sys_sigabbrev' symbol.])
 3645: 
 3646: dnl
 3647: dnl Bits to copy verbatim into config.h.in
 3648: dnl
 3649: AH_TOP([#ifndef _SUDO_CONFIG_H
 3650: #define _SUDO_CONFIG_H])
 3651: 
 3652: AH_BOTTOM([/*
 3653:  * Macros to convert ctime and mtime into timevals.
 3654:  */
 3655: #define timespec2timeval(_ts, _tv) do {					\
 3656:     (_tv)->tv_sec = (_ts)->tv_sec;					\
 3657:     (_tv)->tv_usec = (_ts)->tv_nsec / 1000;				\
 3658: } while (0)
 3659: 
 3660: #ifdef HAVE_ST_MTIM
 3661: # ifdef HAVE_ST__TIM
 3662: #  define ctim_get(_x, _y)	timespec2timeval(&(_x)->st_ctim.st__tim, (_y))
 3663: #  define mtim_get(_x, _y)	timespec2timeval(&(_x)->st_mtim.st__tim, (_y))
 3664: # else
 3665: #  define ctim_get(_x, _y)	timespec2timeval(&(_x)->st_ctim, (_y))
 3666: #  define mtim_get(_x, _y)	timespec2timeval(&(_x)->st_mtim, (_y))
 3667: # endif
 3668: #else
 3669: # ifdef HAVE_ST_MTIMESPEC
 3670: #  define ctim_get(_x, _y)	timespec2timeval(&(_x)->st_ctimespec, (_y))
 3671: #  define mtim_get(_x, _y)	timespec2timeval(&(_x)->st_mtimespec, (_y))
 3672: # else
 3673: #  define ctim_get(_x, _y)	do { (_y)->tv_sec = (_x)->st_ctime; (_y)->tv_usec = 0; } while (0)
 3674: #  define mtim_get(_x, _y)	do { (_y)->tv_sec = (_x)->st_mtime; (_y)->tv_usec = 0; } while (0)
 3675: # endif /* HAVE_ST_MTIMESPEC */
 3676: #endif /* HAVE_ST_MTIM */
 3677: 
 3678: #ifdef __GNUC__
 3679: # define ignore_result(x) do {						       \
 3680:     __typeof__(x) y = (x);						       \
 3681:     (void)y;								       \
 3682: } while(0)
 3683: #else
 3684: # define ignore_result(x)	(void)(x)
 3685: #endif
 3686: 
 3687: /* Macros to set/clear/test flags. */
 3688: #undef SET
 3689: #define SET(t, f)	((t) |= (f))
 3690: #undef CLR
 3691: #define CLR(t, f)	((t) &= ~(f))
 3692: #undef ISSET
 3693: #define ISSET(t, f)     ((t) & (f))
 3694: 
 3695: /* ANSI-style OS defs for HP-UX and ConvexOS. */
 3696: #if defined(hpux) && !defined(__hpux)
 3697: # define __hpux		1
 3698: #endif /* hpux */
 3699: 
 3700: #if defined(convex) && !defined(__convex__)
 3701: # define __convex__	1
 3702: #endif /* convex */
 3703: 
 3704: /* BSD compatibility on some SVR4 systems. */
 3705: #ifdef __svr4__
 3706: # define BSD_COMP
 3707: #endif /* __svr4__ */
 3708: 
 3709: #endif /* _SUDO_CONFIG_H */])

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>