dnl
dnl Copyright (c) 1994-1996,1998-2011 Todd C. Miller <Todd.Miller@courtesan.com>
dnl
-AC_INIT([sudo], [1.8.2], [http://www.sudo.ws/bugs/], [sudo])
+AC_INIT([sudo], [1.8.3p1], [http://www.sudo.ws/bugs/], [sudo])
AC_CONFIG_HEADER([config.h pathnames.h])
dnl
dnl Note: this must come after AC_INIT
AC_ARG_WITH(CC, [AS_HELP_STRING([--with-CC], [C compiler to use])],
[case $with_CC in
- yes) AC_MSG_ERROR(["must give --with-CC an argument."])
- ;;
- no) AC_MSG_ERROR(["illegal argument: --without-CC."])
- ;;
- *) CC=$with_CC
+ *) AC_MSG_ERROR([the --with-CC option is no longer supported, please set the CC environment variable instead.])
;;
esac])
AC_ARG_ENABLE(warnings,
[AS_HELP_STRING([--enable-warnings], [Whether to enable compiler warnings])],
[ case "$enableval" in
- yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
- fi
- ;;
+ yes) ;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval])
;;
esac
])
+AC_ARG_ENABLE(werror,
+[AS_HELP_STRING([--enable-werror], [Whether to enable the -Werror compiler option])],
+[ case "$enableval" in
+ yes) ;;
+ no) ;;
+ *) AC_MSG_WARN([Ignoring unknown argument to --enable-werror: $enableval])
+ ;;
+ esac
+])
+
AC_ARG_ENABLE(admin-flag,
[AS_HELP_STRING([--enable-admin-flag], [Whether to create a Ubuntu-style admin flag file])],
[ case "$enableval" in
AC_MSG_ERROR([Sudo version $PACKAGE_VERSION requires an ANSI C compiler to build.])
fi
+dnl
+dnl If the user specified --disable-static, override them or we'll
+dnl be unable to build the executables in the sudoers plugin dir.
+dnl
+if test "$enable_static" = "no"; then
+ AC_MSG_WARN([Ignoring --disable-static, sudo does not install static libs])
+ enable_static=yes
+fi
+
dnl
dnl Libtool setup, we require libtool 2.2.6b or higher
dnl
NOEXECFILE="sudo_noexec$_shrext"
NOEXECDIR="`echo $with_noexec|sed 's:^\(.*\)/[[^/]]*:\1:'`"
-dnl
-dnl It is now safe to modify CFLAGS and CPPFLAGS
-dnl
-if test X"$with_devel" = X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
-fi
-
dnl
dnl Find programs we use
dnl
fi
LDFLAGS="$O_LDFLAGS"
- # Use authenticate(3) as the default authentication method
- if test X"$with_aixauth" = X""; then
- AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"])
+ # On AIX 6 and higher default to PAM, else default to LAM
+ if test $OSMAJOR -ge 6; then
+ if test X"$with_pam" = X""; then
+ AUTH_EXCL_DEF="PAM"
+ fi
+ else
+ if test X"$with_aixauth" = X""; then
+ AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"])
+ fi
fi
# AIX analog of nsswitch.conf, enabled by default
# For implementing getgrouplist()
AC_CHECK_FUNCS(getgrset)
- # LDR_PRELOAD is supported in AIX 5.3 and later
- case "$OSREV" in
- [1-4].*) with_noexec=no ;;
- esac
+ # LDR_PRELOAD is only supported in AIX 5.3 and later
+ if test $OSMAJOR -lt 5; then
+ with_noexec=no
+ fi
# AIX-specific functions
AC_CHECK_FUNCS(getuserattr setauthdb)
# Build PA-RISC1.1 objects for better portability
case "$host_cpu" in
- hppa[2-9]*)
+ hppa[[2-9]]*)
_CFLAGS="$CFLAGS"
if test -n "$GCC"; then
portable_flag="-march=1.1"
esac
case "$host" in
- *-*-hpux[1-8].*)
+ *-*-hpux[[1-8]].*)
AC_DEFINE(BROKEN_SYSLOG)
;;
*-*-hpux9.*)
;;
*-*-bsdi*)
SKIP_SETREUID=yes
- # Use shlicc for BSD/OS [23].x unless asked to do otherwise
- if test "${with_CC+set}" != set -a "$ac_cv_prog_CC" = gcc; then
- case "$OSMAJOR" in
- 2|3) AC_MSG_NOTICE([using shlicc as CC])
- ac_cv_prog_CC=shlicc
- CC="$ac_cv_prog_CC"
- ;;
- esac
- fi
- # Check for newer BSD auth API (just check for >= 3.0?)
+ # Check for newer BSD auth API
if test -z "$with_bsdauth"; then
AC_CHECK_FUNCS(auth_challenge, [AUTH_EXCL_DEF="BSD_AUTH"])
fi
SKIP_SETREUID=yes
;;
esac
+ OSDEFS="${OSDEFS} -D_BSD_SOURCE"
if test "${with_skey-'no'}" = "yes"; then
SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
fi
;;
*-*-*openbsd*)
# OpenBSD has a real setreuid(2) starting with 3.3 but
- # we will use setreuid(2) instead.
+ # we will use setresuid(2) instead.
SKIP_SETREUID=yes
+ OSDEFS="${OSDEFS} -D_BSD_SOURCE"
CHECKSHADOW="false"
# OpenBSD >= 3.0 supports BSD auth
if test -z "$with_bsdauth"; then
- case "$OSREV" in
- [0-2].*)
- ;;
- *)
+ if test "$OSMAJOR" -ge 3; then
AUTH_EXCL_DEF="BSD_AUTH"
- ;;
- esac
+ fi
fi
: ${with_logincap='maybe'}
;;
*-*-*netbsd*)
# NetBSD has a real setreuid(2) starting with 1.3.2
case "$OSREV" in
- 0.9*|1.[012]*|1.3|1.3.1)
+ 0.9*|1.[[012]]*|1.3|1.3.1)
SKIP_SETREUID=yes
;;
esac
: ${with_logincap='maybe'}
;;
*-*-dragonfly*)
+ OSDEFS="${OSDEFS} -D_BSD_SOURCE"
if test "${with_skey-'no'}" = "yes"; then
SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
fi
dnl Function checks
dnl
AC_FUNC_GETGROUPS
-AC_CHECK_FUNCS(strrchr sysconf tzset strftime fstat \
+AC_CHECK_FUNCS(strrchr sysconf tzset strftime \
regcomp setlocale nl_langinfo getaddrinfo mbr_check_membership \
setrlimit64 sysctl)
AC_REPLACE_FUNCS(getgrouplist)
AC_CHECK_FUNCS(getttyent ttyslot, [break])
fi
-AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [
+AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])], [
AC_CHECK_LIB(util, openpty, [
- AC_CHECK_HEADERS(util.h pty.h, [break])
+ AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])
case "$SUDO_LIBS" in
*-lutil*) ;;
*) SUDO_LIBS="${SUDO_LIBS} -lutil";;
AC_CONFIG_FILES([zlib/Makefile])
fi
+dnl
+dnl Check for errno declaration in errno.h
+dnl
+AC_CHECK_DECLS([errno], [], [], [
+AC_INCLUDES_DEFAULT
+#include <errno.h>
+])
+
dnl
dnl Check for strsignal() or sys_siglist
dnl
#include <lber.h>
#include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
done
+ if test "$found" = "no"; then
+ LDAP_LIBS=""
+ LIBS="$_LIBS"
+ for l in -libmldap -lidsldif; do
+ LIBS="${LIBS} $l"
+ LDAP_LIBS="${LDAP_LIBS} $l"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <lber.h>
+ #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
+ done
+ fi
dnl if nothing linked just try with -lldap
if test "$found" = "no"; then
LIBS="${_LIBS} -lldap"
done
fi
+dnl
+dnl We add -Wall and -Werror after all tests so they don't cause failures
+dnl
+if test -n "$GCC"; then
+ if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
+ CFLAGS="${CFLAGS} -Wall"
+ fi
+ if test X"$enable_werror" = X"yes"; then
+ CFLAGS="${CFLAGS} -Werror"
+ fi
+fi
+
dnl
dnl Set exec_prefix
dnl