From 5baef4dad8516b9804a3bc3dbbf3992335f95562 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 2 Jan 2002 22:36:50 +0000 Subject: [PATCH] Add info for autoheader. --- aclocal.m4 | 93 ++++++++++++--------- configure.in | 228 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 197 insertions(+), 124 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index a4520ef48..20856e5b4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,22 +12,22 @@ dnl AC_DEFUN(SUDO_PROG_SENDMAIL, [AC_MSG_CHECKING(for sendmail) if test -f "/usr/sbin/sendmail"; then AC_MSG_RESULT(/usr/sbin/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail") elif test -f "/usr/lib/sendmail"; then AC_MSG_RESULT(/usr/lib/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/lib/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/lib/sendmail") elif test -f "/usr/etc/sendmail"; then AC_MSG_RESULT(/usr/etc/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/etc/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/etc/sendmail") elif test -f "/usr/ucblib/sendmail"; then AC_MSG_RESULT(/usr/ucblib/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/ucblib/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/ucblib/sendmail") elif test -f "/usr/local/lib/sendmail"; then AC_MSG_RESULT(/usr/local/lib/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/lib/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/lib/sendmail") elif test -f "/usr/local/bin/sendmail"; then AC_MSG_RESULT(/usr/local/bin/sendmail) - AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/bin/sendmail") + SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/bin/sendmail") else AC_MSG_RESULT(not found) fi @@ -39,19 +39,19 @@ dnl AC_DEFUN(SUDO_PROG_VI, [AC_MSG_CHECKING(for vi) if test -f "/usr/bin/vi"; then AC_MSG_RESULT(/usr/bin/vi) - AC_DEFINE(_PATH_VI, "/usr/bin/vi") + SUDO_DEFINE(_PATH_VI, "/usr/bin/vi") elif test -f "/usr/ucb/vi"; then AC_MSG_RESULT(/usr/ucb/vi) - AC_DEFINE(_PATH_VI, "/usr/ucb/vi") + SUDO_DEFINE(_PATH_VI, "/usr/ucb/vi") elif test -f "/usr/bsd/vi"; then AC_MSG_RESULT(/usr/bsd/vi) - AC_DEFINE(_PATH_VI, "/usr/bsd/vi") + SUDO_DEFINE(_PATH_VI, "/usr/bsd/vi") elif test -f "/bin/vi"; then AC_MSG_RESULT(/bin/vi) - AC_DEFINE(_PATH_VI, "/bin/vi") + SUDO_DEFINE(_PATH_VI, "/bin/vi") elif test -f "/usr/local/bin/vi"; then AC_MSG_RESULT(/usr/local/bin/vi) - AC_DEFINE(_PATH_VI, "/usr/local/bin/vi") + SUDO_DEFINE(_PATH_VI, "/usr/local/bin/vi") else AC_MSG_RESULT(not found) fi @@ -63,16 +63,16 @@ dnl AC_DEFUN(SUDO_PROG_MV, [AC_MSG_CHECKING(for mv) if test -f "/usr/bin/mv"; then AC_MSG_RESULT(/usr/bin/mv) - AC_DEFINE(_PATH_MV, "/usr/bin/mv") + SUDO_DEFINE(_PATH_MV, "/usr/bin/mv") elif test -f "/bin/mv"; then AC_MSG_RESULT(/bin/mv) - AC_DEFINE(_PATH_MV, "/bin/mv") + SUDO_DEFINE(_PATH_MV, "/bin/mv") elif test -f "/usr/ucb/mv"; then AC_MSG_RESULT(/usr/ucb/mv) - AC_DEFINE(_PATH_MV, "/usr/ucb/mv") + SUDO_DEFINE(_PATH_MV, "/usr/ucb/mv") elif test -f "/usr/sbin/mv"; then AC_MSG_RESULT(/usr/sbin/mv) - AC_DEFINE(_PATH_MV, "/usr/sbin/mv") + SUDO_DEFINE(_PATH_MV, "/usr/sbin/mv") else AC_MSG_RESULT(not found) fi @@ -84,28 +84,28 @@ dnl AC_DEFUN(SUDO_PROG_BSHELL, [AC_MSG_CHECKING(for bourne shell) if test -f "/bin/sh"; then AC_MSG_RESULT(/bin/sh) - AC_DEFINE(_PATH_BSHELL, "/bin/sh") + SUDO_DEFINE(_PATH_BSHELL, "/bin/sh") elif test -f "/usr/bin/sh"; then AC_MSG_RESULT(/usr/bin/sh) - AC_DEFINE(_PATH_BSHELL, "/usr/bin/sh") + SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/sh") elif test -f "/sbin/sh"; then AC_MSG_RESULT(/sbin/sh) - AC_DEFINE(_PATH_BSHELL, "/sbin/sh") + SUDO_DEFINE(_PATH_BSHELL, "/sbin/sh") elif test -f "/usr/sbin/sh"; then AC_MSG_RESULT(/usr/sbin/sh) - AC_DEFINE(_PATH_BSHELL, "/usr/sbin/sh") + SUDO_DEFINE(_PATH_BSHELL, "/usr/sbin/sh") elif test -f "/bin/ksh"; then AC_MSG_RESULT(/bin/ksh) - AC_DEFINE(_PATH_BSHELL, "/bin/ksh") + SUDO_DEFINE(_PATH_BSHELL, "/bin/ksh") elif test -f "/usr/bin/ksh"; then AC_MSG_RESULT(/usr/bin/ksh) - AC_DEFINE(_PATH_BSHELL, "/usr/bin/ksh") + SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/ksh") elif test -f "/bin/bash"; then AC_MSG_RESULT(/bin/bash) - AC_DEFINE(_PATH_BSHELL, "/bin/bash") + SUDO_DEFINE(_PATH_BSHELL, "/bin/bash") elif test -f "/usr/bin/bash"; then AC_MSG_RESULT(/usr/bin/bash) - AC_DEFINE(_PATH_BSHELL, "/usr/bin/bash") + SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/bash") else AC_MSG_RESULT(not found) fi @@ -117,16 +117,16 @@ dnl AC_DEFUN(SUDO_LOGFILE, [AC_MSG_CHECKING(for log file location) if test -n "$with_logpath"; then AC_MSG_RESULT($with_logpath) - AC_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath") + SUDO_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath") elif test -d "/var/log"; then AC_MSG_RESULT(/var/log/sudo.log) - AC_DEFINE(_PATH_SUDO_LOGFILE, "/var/log/sudo.log") + SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/var/log/sudo.log") elif test -d "/var/adm"; then AC_MSG_RESULT(/var/adm/sudo.log) - AC_DEFINE(_PATH_SUDO_LOGFILE, "/var/adm/sudo.log") + SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/var/adm/sudo.log") elif test -d "/usr/adm"; then AC_MSG_RESULT(/usr/adm/sudo.log) - AC_DEFINE(_PATH_SUDO_LOGFILE, "/usr/adm/sudo.log") + SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/usr/adm/sudo.log") else AC_MSG_RESULT(unknown, you will have to set _PATH_SUDO_LOGFILE by hand) fi @@ -138,15 +138,15 @@ dnl AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location) if test -n "$with_timedir"; then AC_MSG_RESULT($with_timedir) - AC_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir") + SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir") timedir="$with_timedir" elif test -d "/var/run"; then AC_MSG_RESULT(/var/run/sudo) - AC_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo") + SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo") timedir="/var/run/sudo" else AC_MSG_RESULT(/tmp/.odus) - AC_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus") + SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus") timedir="/tmp/.odus" fi ])dnl @@ -156,7 +156,7 @@ dnl check for fullly working void dnl AC_DEFUN(SUDO_FULL_VOID, [AC_MSG_CHECKING(for full void implementation) AC_TRY_COMPILE(, [void *foo; -foo = (void *)0; (void *)"test";], AC_DEFINE(VOID, void) +foo = (void *)0; (void *)"test";], AC_DEFINE(VOID, void, [Define to "void" if your compiler supports void pointers, else use "char"].) AC_MSG_RESULT(yes), AC_DEFINE(VOID, char) AC_MSG_RESULT(no))]) @@ -178,7 +178,7 @@ AC_CACHE_VAL(sudo_cv_type_$1, #endif], sudo_cv_type_$1=yes, sudo_cv_type_$1=no)])dnl AC_MSG_RESULT($sudo_cv_type_$1) if test $sudo_cv_type_$1 = no; then - AC_DEFINE($1, $2) + AC_DEFINE($1, $2, [Define if your system lacks the $1 type.]) fi ]) @@ -226,7 +226,7 @@ exit(0); rm -f core core.* *.core])dnl AC_MSG_RESULT($sudo_cv_func_utime_posix) if test $sudo_cv_func_utime_posix = yes; then - AC_DEFINE(HAVE_UTIME_POSIX) + AC_DEFINE(HAVE_UTIME_POSIX, 1, [Define if you have a POSIX utime() (uses struct utimbuf).]) fi ]) @@ -259,7 +259,7 @@ AC_DEFUN([SUDO_FUNC_ISBLANK], sudo_cv_func_isblank=yes, sudo_cv_func_isblank=no)]) ] [ if test "$sudo_cv_func_isblank" = "yes"; then - AC_DEFINE(HAVE_ISBLANK) + AC_DEFINE(HAVE_ISBLANK, 1, [Define if you have isblank(3).]) fi ]) @@ -280,7 +280,7 @@ exit(0); rm -f core core.* *.core])dnl AC_MSG_RESULT($sudo_cv_sock_sa_len) if test $sudo_cv_sock_sa_len = yes; then - AC_DEFINE(HAVE_SA_LEN) + AC_DEFINE(HAVE_SA_LEN, 1, [Define if your struct sockadr has an sa_len field.]) fi ]) @@ -316,7 +316,7 @@ main() { ]) rm -f conftestdata AC_MSG_RESULT($sudo_cv_uid_t_len) -AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len) +AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len, [Define to the max length of a uid_t in string context (excluding the NUL).]) ]) dnl @@ -324,6 +324,23 @@ dnl check for "long long" dnl XXX hard to cache since it includes 2 tests dnl AC_DEFUN(SUDO_LONG_LONG, [AC_MSG_CHECKING(for long long support) -AC_TRY_LINK(, [long long foo = 1000; foo /= 10;], AC_DEFINE(HAVE_LONG_LONG) -[AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD))] +AC_TRY_LINK(, [long long foo = 1000; foo /= 10;], AC_DEFINE(HAVE_LONG_LONG, 1, [Define if your compiler supports the "long long" type.]) +[AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD, 1, [Define if sizeof(long) == sizeof(long long).]))] AC_MSG_RESULT(yes), AC_MSG_RESULT(no))]) + +dnl +dnl private versions of AC_DEFINE and AC_DEFINE_UNQUOTED that don't support +dnl tracing that we use to define paths for pathnames.h so autoheader doesn't +dnl put them in config.h.in. An awful hack. +dnl +m4_define([SUDO_DEFINE], +[cat >>confdefs.h <<\EOF +[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1) +EOF +]) + +m4_define([SUDO_DEFINE_UNQUOTED], +[cat >>confdefs.h < +dnl Copyright (c) 1994-1996,1998-2002 Todd C. Miller dnl -AC_INIT(sudo.h) +AC_INIT(sudo, 1.6.4) AC_CONFIG_HEADER(config.h pathnames.h) dnl dnl This won't work before AC_INIT() @@ -120,7 +120,7 @@ dnl AC_ARG_WITH(otp-only, [ --with-otp-only deprecated], [case $with_otp_only in yes) with_passwd=no - AC_DEFINE(WITHOUT_PASSWD) + AC_DEFINE(WITHOUT_PASSWD, 1, [Define to avoid using the passwd/shadow file for authentication.]) AC_MSG_WARN([--with-otp-only option deprecated, treating as --without-passwd]) ;; esac]) @@ -128,7 +128,6 @@ esac]) AC_ARG_WITH(alertmail, [ --with-alertmail deprecated], [case $with_alertmail in *) with_mailto="$with_alertmail" - AC_DEFINE(WITHOUT_PASSWD) AC_MSG_WARN([--with-alertmail option deprecated, treating as --mailto]) ;; esac]) @@ -235,7 +234,7 @@ AC_ARG_WITH(skey, [ --with-skey enable S/Key support ], yes) if test -n "$with_opie"; then AC_MSG_ERROR(["cannot use both S/Key and OPIE"]) fi - AC_DEFINE(HAVE_SKEY) + AC_DEFINE(HAVE_SKEY, 1, [Define if you use S/Key.]) AC_MSG_CHECKING(whether to try S/Key authentication) AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} rfc1938.o" @@ -250,7 +249,7 @@ AC_ARG_WITH(opie, [ --with-opie enable OPIE support ], yes) if test -n "$with_skey"; then AC_MSG_ERROR(["cannot use both S/Key and OPIE"]) fi - AC_DEFINE(HAVE_OPIE) + AC_DEFINE(HAVE_OPIE, 1, [Define if you use NRL OPIE.]) AC_MSG_CHECKING(whether to try NRL OPIE authentication) AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} rfc1938.o" @@ -262,7 +261,7 @@ esac]) AC_ARG_WITH(long-otp-prompt, [ --with-long-otp-prompt use a two line OTP (skey/opie) prompt], [case $with_long_otp_prompt in - yes) AC_DEFINE(LONG_OTP_PROMPT) + yes) AC_DEFINE(LONG_OTP_PROMPT, 1, [Define if you want a two line OTP (S/Key or OPIE) prompt.]) AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication) AC_MSG_RESULT(yes) long_otp_prompt=on @@ -276,7 +275,7 @@ esac]) AC_ARG_WITH(SecurID, [ --with-SecurID enable SecurID support], [case $with_SecurID in no) ;; - *) AC_DEFINE(HAVE_SECURID) + *) AC_DEFINE(HAVE_SECURID, 1, [Define if you use SecurID.]) AC_MSG_CHECKING(whether to use SecurID for authentication) AC_MSG_RESULT(yes) with_passwd=no @@ -286,21 +285,17 @@ esac]) AC_ARG_WITH(fwtk, [ --with-fwtk enable FWTK AuthSRV support], [case $with_fwtk in - yes) AC_DEFINE(HAVE_FWTK) - AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication) - AC_MSG_RESULT(yes) - with_passwd=no - AUTH_OBJS="fwtk.o" - ;; no) ;; - *) AC_DEFINE(HAVE_FWTK) + *) AC_DEFINE(HAVE_FWTK, 1, [Define if you use the FWTK authsrv daemon.]) AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication) AC_MSG_RESULT(yes) - SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}" - CPPFLAGS="${CPPFLAGS} -I${with_fwtk}" with_passwd=no AUTH_OBJS="fwtk.o" - with_fwtk=yes + if test "$with_fwtk" != "yes"; then + SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}" + CPPFLAGS="${CPPFLAGS} -I${with_fwtk}" + with_fwtk=yes + fi ;; esac]) @@ -326,7 +321,7 @@ esac]) AC_ARG_WITH(authenticate, [ --with-authenticate enable AIX general authentication support], [case $with_authenticate in - yes) AC_DEFINE(HAVE_AUTHENTICATE) + yes) AC_DEFINE(HAVE_AUTHENTICATE, 1, [Define if you use AIX general authentication.]) AC_MSG_CHECKING(whether to use AIX general authentication) AC_MSG_RESULT(yes) with_passwd=no @@ -339,7 +334,7 @@ esac]) AC_ARG_WITH(pam, [ --with-pam enable PAM support], [case $with_pam in - yes) AC_DEFINE(HAVE_PAM) + yes) AC_DEFINE(HAVE_PAM, 1, [Define if you use PAM.]) AC_MSG_CHECKING(whether to use PAM authentication) AC_MSG_RESULT(yes) with_passwd=no @@ -352,7 +347,7 @@ esac]) AC_ARG_WITH(AFS, [ --with-AFS enable AFS support], [case $with_AFS in - yes) AC_DEFINE(HAVE_AFS) + yes) AC_DEFINE(HAVE_AFS, 1, [Define if you use AFS.]) AC_MSG_CHECKING(whether to try AFS (kerberos) authentication) AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} afs.o" @@ -364,7 +359,7 @@ esac]) AC_ARG_WITH(DCE, [ --with-DCE enable DCE support], [case $with_DCE in - yes) AC_DEFINE(HAVE_DCE) + yes) AC_DEFINE(HAVE_DCE, 1, [Define if you use OSF DCE.]) AC_MSG_CHECKING(whether to try DCE (kerberos) authentication) AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} dce.o" @@ -403,7 +398,7 @@ esac]) if test "$lecture" = "on"; then AC_MSG_RESULT(yes) else - AC_DEFINE(NO_LECTURE) + AC_DEFINE(NO_LECTURE, 1, [Define if you don't want users to get the lecture the first they user sudo.]) AC_MSG_RESULT(no) fi @@ -414,7 +409,7 @@ AC_ARG_WITH(logging, [ --with-logging log via syslog, file, or both], ;; no) AC_MSG_ERROR(["--without-logging not supported."]) ;; - syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG) + syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.]) AC_MSG_RESULT(syslog) ;; file) AC_DEFINE(LOGGING, SLOG_FILE) @@ -439,7 +434,7 @@ AC_ARG_WITH(logfac, [ --with-logfac syslog facility to log with (defa *) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."]) ;; esac]) -AC_DEFINE_UNQUOTED(LOGFAC, "$logfac") +AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.]) AC_MSG_RESULT($logfac) AC_MSG_CHECKING(at which syslog priority to log commands) @@ -455,7 +450,7 @@ AC_ARG_WITH(goodpri, [ --with-goodpri syslog priority for commands (de *) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."]) ;; esac]) -AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri") +AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.]) AC_MSG_RESULT($goodpri) AC_MSG_CHECKING(at which syslog priority to log failures) @@ -471,7 +466,7 @@ AC_ARG_WITH(badpri, [ --with-badpri syslog priority for failures (def *) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.]) ;; esac]) -AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri") +AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.]) AC_MSG_RESULT(badpri) AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file], @@ -494,7 +489,7 @@ AC_ARG_WITH(loglen, [ --with-loglen maximum length of a log file line *) AC_MSG_ERROR(["you must enter a number, not $with_loglen"]) ;; esac]) -AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen) +AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).]) AC_MSG_RESULT($loglen) AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH) @@ -508,7 +503,7 @@ AC_ARG_WITH(ignore-dot, [ --with-ignore-dot ignore '.' in the PATH], ;; esac]) if test "$ignore_dot" = "on"; then - AC_DEFINE(IGNORE_DOT_PATH) + AC_DEFINE(IGNORE_DOT_PATH, 1, [Define if you want to ignore '.' and empty \$PATH elements]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -525,7 +520,7 @@ AC_ARG_WITH(mail-if-no-user, [ --without-mail-if-no-user do not send mail if us ;; esac]) if test "$mail_no_user" = "on"; then - AC_DEFINE(SEND_MAIL_WHEN_NO_USER) + AC_DEFINE(SEND_MAIL_WHEN_NO_USER, 1, [Define to send mail when the user is not in the sudoers file.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -542,7 +537,7 @@ AC_ARG_WITH(mail-if-no-host, [ --with-mail-if-no-host send mail if user in sud ;; esac]) if test "$mail_no_host" = "on"; then - AC_DEFINE(SEND_MAIL_WHEN_NO_HOST) + AC_DEFINE(SEND_MAIL_WHEN_NO_HOST, 1, [Define to send mail when the user is not not allowed to run sudo on this host.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -559,7 +554,7 @@ AC_ARG_WITH(mail-if-noperms, [ --with-mail-if-noperms send mail if user not al ;; esac]) if test "$mail_noperms" = "on"; then - AC_DEFINE(SEND_MAIL_WHEN_NOT_OK) + AC_DEFINE(SEND_MAIL_WHEN_NOT_OK, 1, [Define to send mail when the user is not not allowed to run a command.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -575,7 +570,7 @@ AC_ARG_WITH(mailto, [ --with-mailto who should get sudo mail (default *) mailto=$with_mailto ;; esac]) -AC_DEFINE_UNQUOTED(MAILTO, "$mailto") +AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.]) AC_MSG_RESULT([$mailto]) AC_ARG_WITH(mailsubject, [ --with-mailsubject subject of sudo mail], @@ -589,7 +584,7 @@ AC_ARG_WITH(mailsubject, [ --with-mailsubject subject of sudo mail], AC_MSG_RESULT([Using alert mail subject: $mailsub]) ;; esac]) -AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub") +AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.]) AC_MSG_CHECKING(for bad password prompt) AC_ARG_WITH(passprompt, [ --with-passprompt default password prompt], @@ -601,7 +596,7 @@ AC_ARG_WITH(passprompt, [ --with-passprompt default password prompt], *) passprompt="$with_passprompt" esac]) AC_MSG_RESULT($passprompt) -AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt") +AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.]) AC_MSG_CHECKING(for bad password message) AC_ARG_WITH(badpass-message, [ --with-badpass-message message the user sees when the password is wrong], @@ -613,7 +608,7 @@ AC_ARG_WITH(badpass-message, [ --with-badpass-message message the user sees wh *) badpass_message="$with_badpass_message" ;; esac]) -AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message") +AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.]) AC_MSG_RESULT([$badpass_message]) AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers) @@ -627,7 +622,7 @@ AC_ARG_WITH(fqdn, [ --with-fqdn expect fully qualified hosts in sud ;; esac]) if test "$fqdn" = "on"; then - AC_DEFINE(FQDN) + AC_DEFINE(FQDN, 1, [Define if you want to require fully qualified hosts in sudoers.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -647,7 +642,7 @@ AC_ARG_WITH(sendmail, [ --with-sendmail=path set path to sendmail yes) with_sendmail="" ;; no) ;; - *) AC_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail") + *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail") ;; esac]) @@ -695,17 +690,14 @@ AC_ARG_WITH(umask, [ --with-umask umask with which the prog should r [case $with_umask in yes) AC_MSG_ERROR(["must give --with-umask an argument."]) ;; - no) AC_MSG_RESULT(user) - sudo_umask=0777 + no) sudo_umask=0777 ;; - [[0-9]]*) AC_DEFINE_UNQUOTED(SUDO_UMASK, $with_umask) - AC_MSG_RESULT([$with_umask]) - sudo_umask=$with_umask + [[0-9]]*) sudo_umask=$with_umask ;; *) AC_MSG_ERROR(["you must enter a numeric mask."]) ;; esac]) -AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask) +AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the root-run prog should use.]) if test "$sudo_umask" = "0777"; then AC_MSG_RESULT(user) else @@ -722,7 +714,7 @@ AC_ARG_WITH(runas-default, [ --with-runas-default User to run commands as (d *) runas_default="$with_runas_default" ;; esac]) -AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default") +AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.]) AC_MSG_RESULT([$runas_default]) AC_ARG_WITH(exempt, [ --with-exempt=group no passwd needed for users in this group], @@ -731,7 +723,7 @@ AC_ARG_WITH(exempt, [ --with-exempt=group no passwd needed for users in thi ;; no) AC_MSG_ERROR(["--without-exempt not supported."]) ;; - *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt") + *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").]) AC_MSG_CHECKING(for group to be exempt from password) AC_MSG_RESULT([$with_exempt]) ;; @@ -744,7 +736,7 @@ AC_ARG_WITH(editor, [ --with-editor=path Default editor for visudo (defaul ;; no) AC_MSG_ERROR(["--without-editor not supported."]) ;; - *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor") + *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.]) AC_MSG_RESULT([$with_editor]) ;; esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)]) @@ -760,7 +752,7 @@ AC_ARG_WITH(env-editor, [ --with-env-editor Use the environment variable ;; esac]) if test "$env_editor" = "on"; then - AC_DEFINE(ENV_EDITOR) + AC_DEFINE(ENV_EDITOR, 1, [Define if you want visudo to honor the EDITOR and VISUAL env variables.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -777,7 +769,7 @@ AC_ARG_WITH(passwd-tries, [ --with-passwd-tries number of tries to enter pa *) AC_MSG_ERROR(["you must enter the numer of tries, > 0"]) ;; esac]) -AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries) +AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.]) AC_MSG_RESULT($passwd_tries) AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again) @@ -791,7 +783,7 @@ AC_ARG_WITH(timeout, [ --with-timeout minutes before sudo asks for pas *) AC_MSG_ERROR(["you must enter the numer of minutes."]) ;; esac]) -AC_DEFINE_UNQUOTED(TIMEOUT, $timeout) +AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.]) AC_MSG_RESULT($timeout) AC_MSG_CHECKING(time in minutes after the password prompt will time out) @@ -805,14 +797,14 @@ AC_ARG_WITH(password-timeout, [ --with-password-timeout passwd prompt timeout i *) AC_MSG_ERROR(["you must enter the numer of minutes."]) ;; esac]) -AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout) +AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).]) AC_MSG_RESULT($password_timeout) AC_ARG_WITH(execv, [ --with-execv use execv() instead of execvp()], [case $with_execv in yes) AC_MSG_CHECKING(whether to use execvp or execv) AC_MSG_RESULT(execv) - AC_DEFINE(USE_EXECV) + AC_DEFINE(USE_EXECV, 1, [Define if you wish to use execv() instead of execvp() when running programs.]) ;; no) ;; *) AC_MSG_ERROR(["--with-execv does not take an argument."]) @@ -830,7 +822,7 @@ AC_ARG_WITH(tty-tickets, [ --with-tty-tickets use a different ticket file ;; esac]) if test "$tty_tickets" = "on"; then - AC_DEFINE(USE_TTY_TICKETS) + AC_DEFINE(USE_TTY_TICKETS, 1, [Define if you want a different ticket file for each tty.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -849,7 +841,7 @@ AC_ARG_WITH(insults, [ --with-insults insult the user for entering an ;; esac]) if test "$insults" = "on"; then - AC_DEFINE(USE_INSULTS) + AC_DEFINE(USE_INSULTS, 1, [Define if you want to insult the user for entering an incorrect password.]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -869,7 +861,7 @@ esac]) AC_ARG_WITH(classic-insults, [ --with-classic-insults include the insults from the "classic" sudo], [case $with_classic_insults in - yes) AC_DEFINE(CLASSIC_INSULTS) + yes) AC_DEFINE(CLASSIC_INSULTS, 1, [Define if you want the insults from the "classic" version sudo.]) ;; no) ;; *) AC_MSG_ERROR(["--with-classic-insults does not take an argument."]) @@ -878,7 +870,7 @@ esac]) AC_ARG_WITH(csops-insults, [ --with-csops-insults include CSOps insults], [case $with_csops_insults in - yes) AC_DEFINE(CSOPS_INSULTS) + yes) AC_DEFINE(CSOPS_INSULTS, 1, [Define if you want insults culled from the twisted minds of CSOps.]) ;; no) ;; *) AC_MSG_ERROR(["--with-csops-insults does not take an argument."]) @@ -887,7 +879,7 @@ esac]) AC_ARG_WITH(hal-insults, [ --with-hal-insults include 2001-like insults], [case $with_hal_insults in - yes) AC_DEFINE(HAL_INSULTS) + yes) AC_DEFINE(HAL_INSULTS, 1, [Define if you want 2001-like insults.]) ;; no) ;; *) AC_MSG_ERROR(["--with-hal-insults does not take an argument."]) @@ -896,7 +888,7 @@ esac]) AC_ARG_WITH(goons-insults, [ --with-goons-insults include the insults from the "Goon Show"], [case $with_goons_insults in - yes) AC_DEFINE(GOONS_INSULTS) + yes) AC_DEFINE(GOONS_INSULTS, 1, [Define if you want insults from the "Goon Show".]) ;; no) ;; *) AC_MSG_ERROR(["--with-goons-insults does not take an argument."]) @@ -917,7 +909,7 @@ fi AC_MSG_CHECKING(whether to override the user's path) AC_ARG_WITH(secure-path, [ --with-secure-path override the user's path with a builtin one], [case $with_secure_path in - yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc") + yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc", [Define to override the user's path with a builtin one.]) AC_MSG_RESULT([:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc]) ;; no) AC_MSG_RESULT(no) @@ -932,7 +924,7 @@ AC_ARG_WITH(interfaces, [ --without-interfaces don't try to read the ip addr [case $with_interfaces in yes) AC_MSG_RESULT(yes) ;; - no) AC_DEFINE(STUB_LOAD_INTERFACES) + no) AC_DEFINE(STUB_LOAD_INTERFACES, 1, [Define if the code in interfaces.c does not compile for you.]) AC_MSG_RESULT(no) ;; *) AC_MSG_ERROR(["--with-interfaces does not take an argument."]) @@ -951,7 +943,7 @@ AC_ARG_ENABLE(authentication, yes) AC_MSG_RESULT(yes) ;; no) AC_MSG_RESULT(no) - AC_DEFINE(NO_AUTHENTICATION) + AC_DEFINE(NO_AUTHENTICATION, 1, [Define if you don't want sudo to prompt for a password by default.]) ;; *) AC_MSG_RESULT(no) echo "Ignoring unknown argument to --enable-authentication: $enableval" @@ -980,7 +972,7 @@ AC_ARG_ENABLE(root-sudo, [ case "$enableval" in yes) AC_MSG_RESULT(yes) ;; - no) AC_DEFINE(NO_ROOT_SUDO) + no) AC_DEFINE(NO_ROOT_SUDO, 1, [Define if root should not be allowed to use sudo.]) AC_MSG_RESULT(no) ;; *) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."]) @@ -993,7 +985,7 @@ AC_ARG_ENABLE(log-host, [ --enable-log-host Log the hostname in the log file], [ case "$enableval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(HOST_IN_LOG) + AC_DEFINE(HOST_IN_LOG, 1, [Define if you want the hostname to be entered into the log file.]) ;; no) AC_MSG_RESULT(no) ;; @@ -1008,7 +1000,7 @@ AC_ARG_ENABLE(noargs-shell, [ --enable-noargs-shell If sudo is given no arguments run a shell], [ case "$enableval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(SHELL_IF_NO_ARGS) + AC_DEFINE(SHELL_IF_NO_ARGS, 1, [Define if you want sudo to start a shell if given no arguments.]) ;; no) AC_MSG_RESULT(no) ;; @@ -1024,7 +1016,7 @@ AC_ARG_ENABLE(shell-sets-home, set $HOME to target user in shell mode], [ case "$enableval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(SHELL_SETS_HOME) + AC_DEFINE(SHELL_SETS_HOME, 1, [Define if you want sudo to set $HOME in shell mode.]) ;; no) AC_MSG_RESULT(no) ;; @@ -1041,7 +1033,7 @@ AC_ARG_ENABLE(path_info, yes) AC_MSG_RESULT(no) ;; no) AC_MSG_RESULT(yes) - AC_DEFINE(DONT_LEAK_PATH_INFO) + AC_DEFINE(DONT_LEAK_PATH_INFO, 1, [Define if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.]) ;; *) AC_MSG_RESULT(no) echo "Ignoring unknown argument to --enable-path-info: $enableval" @@ -1142,6 +1134,8 @@ case "$host" in # check for password adjunct functions (shadow passwords) if test "$CHECKSHADOW" = "true"; then AC_CHECK_FUNCS(getpwanam issecure, , [break]) + AH_TEMPLATE([HAVE_GETPWANAM], [Define if you have the `getpwanam' function. (SunOS 4.x shadow passwords)]) + AH_TEMPLATE([HAVE_ISSECURE], [Define if you have the `issecure' function. (SunOS 4.x check for shadow enabled)]) CHECKSHADOW="false" fi ;; @@ -1158,7 +1152,7 @@ case "$host" in *-*-aix*) # To get all prototypes (so we pass -Wall) CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE" - AC_DEFINE(_ALL_SOURCE) + SUDO_DEFINE(_ALL_SOURCE) SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp" ;; *-*-hiuxmpp*) @@ -1171,7 +1165,7 @@ case "$host" in ;; *-*-hpux1[[0-9]]*) if test "$CHECKSHADOW" = "true"; then - AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) AC_CHECK_LIB(sec, iscomsec, AC_DEFINE(HAVE_ISCOMSEC)) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1]) + AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) AC_CHECK_LIB(sec, iscomsec, AC_DEFINE(HAVE_ISCOMSEC, 1, [Define if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1]) CHECKSHADOW="false" fi @@ -1183,10 +1177,11 @@ case "$host" in test -n "$mansectform" || mansectform=4 ;; *-*-hpux9*) - AC_DEFINE(BROKEN_SYSLOG) + AC_DEFINE(BROKEN_SYSLOG, 1, [Define if the `syslog' function returns a non-zero int to denote failure.]) if test "$CHECKSHADOW" = "true"; then AC_CHECK_FUNCS(getspwuid) + AH_TEMPLATE([HAVE_GETSPWUID], [Define if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)]) CHECKSHADOW="false" fi @@ -1244,7 +1239,7 @@ case "$host" in # use SIA by default, if we have it, else SecureWare # unless overridden on the command line if test "$CHECKSIA" = "true"; then - AC_CHECK_FUNC(sia_ses_init, AC_DEFINE(HAVE_SIA) [ + AC_CHECK_FUNC(sia_ses_init, AC_DEFINE(HAVE_SIA, 1, [Define if you use SIA.]) [ if test -n "$with_skey" -o -n "$with_opie" -o -n "$with_otp_only" -o -n "$with_long_otp_prompt" -o -n "$with_SecurID" -o -n "$with_fwtk" -o -n "$with_kerb4" -o -n "$with_kerb5" -o -n "$with_pam" -o -n "$with_AFS" -o -n "$with_DCE"; then AC_MSG_ERROR(["you cannot mix SIA and other authentication schemes. You can turn off SIA support via the --disable-sia option"]) fi]; CHECKSHADOW=false) @@ -1255,7 +1250,7 @@ case "$host" in fi if test -n "$SECUREWARE"; then - AC_DEFINE(HAVE_GETPRPWNAM) + AC_DEFINE(HAVE_GETPRPWNAM, 1, [Define if you have the `getprpwnam' function. (SecureWare-style shadow passwords)]) # -ldb includes bogus versions of snprintf/vsnprintf AC_CHECK_FUNCS(snprintf, , [NEED_SNPRINTF=1]) AC_CHECK_FUNCS(vsnprintf, , [NEED_SNPRINTF=1]) @@ -1306,9 +1301,6 @@ case "$host" in test -n "$mansectform" || mansectform=4 ;; *-*-linux*) - # To get crypt(3) and vasprintf() prototypes (so we pass -Wall) - AC_DEFINE(_GNU_SOURCE) - # Some Linux versions need to link with -lshadow if test "$CHECKSHADOW" = "true"; then AC_CHECK_FUNCS(getspnam, , [AC_CHECK_LIB(shadow, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lshadow"; LIBS="${LIBS} -lshadow"])]) @@ -1316,7 +1308,7 @@ case "$host" in fi ;; *-convex-bsd*) - AC_DEFINE(_CONVEX_SOURCE) + SUDO_DEFINE(_CONVEX_SOURCE) if test -z "$GCC"; then CFLAGS="${CFLAGS} -D__STDC__" fi @@ -1329,7 +1321,7 @@ case "$host" in *-*-ultrix*) OS="ultrix" if test "$CHECKSHADOW" = "true"; then - AC_CHECK_LIB(auth, getauthuid, AC_DEFINE(HAVE_GETAUTHUID) [SUDO_LIBS="${SUDO_LIBS} -lauth"; LIBS="${LIBS} -lauth"]) + AC_CHECK_LIB(auth, getauthuid, AC_DEFINE(HAVE_GETAUTHUID, 1, [Define if you have the `getauthuid' function. (ULTRIX 4.x shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lauth"; LIBS="${LIBS} -lauth"]) CHECKSHADOW="false" fi ;; @@ -1442,7 +1434,7 @@ dnl Check for shadow password routines if we have not already done so. dnl We check for SVR4-style first and then SecureWare-style. dnl if test "$CHECKSHADOW" = "true"; then - AC_CHECK_FUNCS(getspnam, [CHECKSHADOW="false"], [AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])]) + AC_CHECK_FUNCS(getspnam, [CHECKSHADOW="false"], [AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM, 1, [Define if you have the `getspnam' function (SVR4-style shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])]) fi if test "$CHECKSHADOW" = "true"; then AC_CHECK_FUNC(getprpwnam, [AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1], AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"], AC_CHECK_LIB(prot, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lprot"; LIBS="${LIBS} -lprot"])))]) @@ -1476,7 +1468,7 @@ dnl ultrix termio/termios are broken if test "$OS" != "ultrix"; then AC_SYS_POSIX_TERMIOS if test "$ac_cv_sys_posix_termios" = "yes"; then - AC_DEFINE(HAVE_TERMIOS_H) + AC_DEFINE(HAVE_TERMIOS_H, 1, [Define if you have the header file and the `tcgetattr' function.]) else AC_CHECK_HEADERS(termio.h) fi @@ -1485,16 +1477,16 @@ if test "$with_logincap" = "yes"; then AC_CHECK_HEADERS(login_cap.h) fi if test "$with_bsdauth" = "yes"; then - AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H) [with_passwd=no; AUTH_OBJS=bsdauth.o]) + AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H, 1, [Define if you use BSD authentication.]) [with_passwd=no; AUTH_OBJS=bsdauth.o]) fi dnl dnl typedef checks dnl AC_TYPE_MODE_T AC_TYPE_UID_T -AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int)], [#include +AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int, [Define to `int' if does not define.])], [#include #include ]) -AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], ,[#include +AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T, 1, [Define if has the sigaction_t typedef.])], ,[#include #include ]) SUDO_TYPE_SIZE_T SUDO_TYPE_SSIZE_T @@ -1533,7 +1525,7 @@ AC_CHECK_FUNCS(waitpid wait3, [break]) AC_CHECK_FUNCS(innetgr _innetgr, AC_CHECK_FUNCS(getdomainname) [break]) AC_CHECK_FUNCS(lsearch, , [AC_CHECK_LIB(compat, lsearch, AC_CHECK_HEADER(search.h, AC_DEFINE(HAVE_LSEARCH) [LIBS="${LIBS} -lcompat"], AC_LIBOBJ(lsearch)), AC_LIBOBJ(lsearch))]) AC_CHECK_FUNCS(utime, SUDO_FUNC_UTIME_POSIX, AC_LIBOBJ(utime)) -SUDO_FUNC_FNMATCH(AC_DEFINE(HAVE_FNMATCH), AC_LIBOBJ(fnmatch)) +SUDO_FUNC_FNMATCH(AC_DEFINE(HAVE_FNMATCH, 1, [Define if you have the `fnmatch' function.]), AC_LIBOBJ(fnmatch)) SUDO_FUNC_ISBLANK AC_REPLACE_FUNCS(strerror strcasecmp sigaction) AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1]) @@ -1579,7 +1571,7 @@ dnl dnl Kerberos 5 dnl if test "$with_kerb5" = "yes"; then - AC_DEFINE(HAVE_KERB5) + AC_DEFINE(HAVE_KERB5, 1, [Define if you use Kerberos V.]) if test -f "/usr/local/include/krb5.h"; then CPPFLAGS="$CPPFLAGS -I/usr/local/include" elif test -f "/usr/local/kerberos/include/krb5.h"; then @@ -1619,7 +1611,7 @@ dnl dnl Find kerberos 4 includes and libs or complain dnl if test "$with_kerb4" = "yes"; then - AC_DEFINE(HAVE_KERB4) + AC_DEFINE(HAVE_KERB4, 1, [Define if you use Kerberos IV.]) if test -f "/usr/include/kerberosIV/krb.h"; then CPPFLAGS="${CPPFLAGS} -I/usr/include/kerberosIV" elif test -f "/usr/local/include/kerberosIV/krb.h"; then @@ -1716,7 +1708,7 @@ if test "$with_skey" = "yes"; then else echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS' fi - AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS)) + AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS, 1, [Define if your S/Key library has skeyaccess().])) fi dnl @@ -1774,7 +1766,7 @@ dnl dnl Use passwd (and secureware) auth modules? dnl if test "$with_passwd" = "no"; then - AC_DEFINE(WITHOUT_PASSWD) + AC_DEFINE(WITHOUT_PASSWD, 1. [Define to avoid using the passwd/shadow file for authentication.]) if test -z "$AUTH_OBJS"; then AC_MSG_ERROR([no authentication methods defined.]) fi @@ -1823,3 +1815,67 @@ if test "$with_pam" = "yes"; then esac echo "" fi + +dnl +dnl Special bits for autoheader +dnl +AH_VERBATIM([_GNU_SOURCE], +[/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif]) + +AH_VERBATIM([_ALL_SOURCE], +[/* Enable non-POSIX extensions on AIX. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif]) + +AH_VERBATIM([_CONVEX_SOURCE], +[/* Enable non-POSIX extensions on ConvexOS. */ +#ifndef _CONVEX_SOURCE +# undef _CONVEX_SOURCE +#endif]) + +AH_TOP([#ifndef _SUDO_CONFIG_H +#define _SUDO_CONFIG_H]) + +AH_BOTTOM([/* + * Emulate a subset of waitpid() if we don't have it. + */ +#ifdef HAVE_WAITPID +# define sudo_waitpid(p, s, o) waitpid(p, s, o) +#else +# ifdef HAVE_WAIT3 +# define sudo_waitpid(p, s, o) wait3(s, o, NULL) +# endif +#endif + +/* Solaris doesn't use const qualifiers in PAM. */ +#ifdef sun +# define PAM_CONST +#else +# define PAM_CONST const +#endif + +#ifdef USE_EXECV +# define EXEC execv +#else +# define EXEC execvp +#endif /* USE_EXECV */ + +/* New ANSI-style OS defs for HP-UX and ConvexOS. */ +#if defined(hpux) && !defined(__hpux) +# define __hpux 1 +#endif /* hpux */ + +#if defined(convex) && !defined(__convex__) +# define __convex__ 1 +#endif /* convex */ + +/* BSD compatibility on some SVR4 systems. */ +#ifdef __svr4__ +# define BSD_COMP +#endif /* __svr4__ */ + +#endif /* _SUDO_CONFIG_H */]) -- 2.40.0