2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00
sudo/aclocal.m4

205 lines
5.4 KiB
Plaintext
Raw Normal View History

1994-03-09 23:51:22 +00:00
dnl Local m4 macors for autoconf (used by sudo)
dnl
dnl checks for programs
dnl
define(SUDO_PROG_INSTALL,
1994-05-14 21:56:22 +00:00
[# Make sure to not get the incompatible SysV /etc/install, /sbin/install
# and /usr/sbin/install, which might be in PATH before a BSD-like install,
1994-03-09 23:51:22 +00:00
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args, or
# /usr/ucb/install on SVR4, which tries to use the nonexistent group
# `staff'. On most BSDish systems install is in /usr/bin, not /usr/ucb
# anyway. Sigh. We can always use the installbsd in $srcdir.
if test "z${INSTALL}" = "z" ; then
1995-02-06 22:43:42 +00:00
echo checking for BSD compatible install...
1994-03-09 23:51:22 +00:00
savepath="$PATH"
PATH="${PATH}:${srcdir}"
IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
case $dir in
1994-05-14 21:56:22 +00:00
/sbin|/etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
1994-03-09 23:51:22 +00:00
*)
if test -f $dir/installbsd; then
INSTALL="$dir/installbsd -c" # OSF1
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
break
fi
if test -f $dir/install; then
if grep dspmsg $dir/install >/dev/null 2>&1; then
: # AIX
else
INSTALL="$dir/install -c"
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
break
fi
fi
;;
esac
done
IFS="$saveifs"
PATH="$savepath"
fi
INSTALL=${INSTALL-cp}
AC_SUBST(INSTALL)dnl
test -n "$verbose" && echo " setting INSTALL to $INSTALL"
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
AC_SUBST(INSTALL_PROGRAM)dnl
test -n "$verbose" && echo " setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
AC_SUBST(INSTALL_DATA)dnl
test -n "$verbose" && echo " setting INSTALL_DATA to $INSTALL_DATA"
])dnl
dnl
dnl check for sendmail
dnl
define(SUDO_PROG_SENDMAIL,
[if test -f "/usr/sbin/sendmail"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_SENDMAIL, "/usr/sbin/sendmail")
1994-03-09 23:51:22 +00:00
elif test -f "/usr/lib/sendmail"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_SENDMAIL, "/usr/lib/sendmail")
1994-03-09 23:51:22 +00:00
elif test -f "/usr/etc/sendmail"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_SENDMAIL, "/usr/etc/sendmail")
1994-03-09 23:51:22 +00:00
elif test -f "/usr/local/lib/sendmail"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_SENDMAIL, "/usr/local/lib/sendmail")
1994-03-09 23:51:22 +00:00
elif test -f "/usr/local/bin/sendmail"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_SENDMAIL, "/usr/local/bin/sendmail")
1994-03-12 18:39:00 +00:00
fi
])dnl
dnl
dnl check for vi
dnl
define(SUDO_PROG_VI,
[if test -f "/usr/bin/vi"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_VI, "/usr/bin/vi")
1994-03-12 18:39:00 +00:00
elif test -f "/usr/ucb/vi"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_VI, "/usr/ucb/vi")
1994-03-12 18:39:00 +00:00
elif test -f "/usr/local/bin/vi"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_VI, "/usr/local/bin/vi")
1994-03-09 23:51:22 +00:00
fi
])dnl
1994-06-04 18:46:49 +00:00
dnl
dnl check for pwd
dnl
define(SUDO_PROG_PWD,
[if test -f "/usr/bin/pwd"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_PWD, "/usr/bin/pwd")
1994-06-04 18:46:49 +00:00
elif test -f "/bin/pwd"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_PWD, "/bin/pwd")
1994-06-04 18:46:49 +00:00
elif test -f "/usr/ucb/pwd"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_PWD, "/usr/ucb/pwd")
1994-06-04 18:46:49 +00:00
elif test -f "/usr/sbin/pwd"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_PWD, "/usr/sbin/pwd")
1994-06-04 18:46:49 +00:00
fi
])dnl
1994-03-09 23:51:22 +00:00
dnl
1995-01-13 17:48:02 +00:00
dnl check for mv
dnl
define(SUDO_PROG_MV,
[if test -f "/usr/bin/mv"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_MV, "/usr/bin/mv")
1995-01-13 17:48:02 +00:00
elif test -f "/bin/mv"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_MV, "/bin/mv")
1995-01-13 17:48:02 +00:00
elif test -f "/usr/ucb/mv"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_MV, "/usr/ucb/mv")
1995-01-13 17:48:02 +00:00
elif test -f "/usr/sbin/mv"; then
1995-01-16 21:30:03 +00:00
AC_DEFINE(_SUDO_PATH_MV, "/usr/sbin/mv")
1995-01-13 17:48:02 +00:00
fi
])dnl
dnl
1994-09-20 18:45:18 +00:00
dnl Check for ssize_t declation
1995-01-13 17:48:02 +00:00
dnl
1994-09-20 18:45:18 +00:00
define(SUDO_SSIZE_T,
[AC_CHECKING(for ssize_t in sys/types.h)
AC_HEADER_EGREP(ssize_t, sys/types.h, , AC_DEFINE(ssize_t, int))])dnl
dnl
1994-05-28 23:36:08 +00:00
dnl check for known UNIX variants
dnl XXX - check to see that uname was checked first
1994-03-09 23:51:22 +00:00
dnl
1994-05-28 23:36:08 +00:00
define(SUDO_OSTYPE,
AC_BEFORE([$0], [AC_PROGRAM_CHECK])
1995-02-06 22:43:42 +00:00
[echo trying to figure out what OS you are running...
OS="unknown"
OSREV=0
1994-05-28 23:36:08 +00:00
if test -n "$UNAMEPROG"; then
1994-05-29 19:29:51 +00:00
echo "checking OS based on uname(1)"
1994-05-28 23:36:08 +00:00
OS=`$UNAMEPROG -s`
1994-05-30 01:28:45 +00:00
# this is yucky but we want to make sure $OSREV is an int...
OSREV=`$UNAMEPROG -r | $SEDPROG -e 's/^[[ \.0A-z]]*//' -e 's/\..*//'`
1994-05-28 23:36:08 +00:00
if test "$OS" = "SunOS" -a "$OSREV" -ge 5 ; then
OS="solaris"
fi
else
if test -z "$OS"; then
SUDO_CONVEX(OS="convex")
fi
if test -z "$OS"; then
SUDO_MTXINU(OS="mtxinu")
fi
if test -z "$OS"; then
SUDO_NEXT(OS="NeXT")
fi
if test -z "$OS"; then
SUDO_BSD(OS="bsd")
fi
if test -z "$OS"; then
OS="unknown"
fi
fi
1994-03-09 23:51:22 +00:00
])dnl
dnl
1994-05-28 23:36:08 +00:00
dnl checks for UNIX variants that lack uname
1994-03-09 23:51:22 +00:00
dnl
1994-05-24 16:51:12 +00:00
dnl SUDO_CONVEX
dnl
1994-03-09 23:51:22 +00:00
define(SUDO_CONVEX,
[echo checking for ConvexOS
AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([
$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
1994-03-12 21:16:10 +00:00
[#if defined(__convex__) || defined(convex)
1994-03-09 23:51:22 +00:00
yes
#endif
], [$1], [$2])
1994-03-09 23:51:22 +00:00
])dnl
dnl
1994-05-28 23:36:08 +00:00
dnl SUDO_MTXINU
1994-05-24 16:51:12 +00:00
dnl
1994-05-28 23:36:08 +00:00
define(SUDO_MTXINU,
[echo checking for MORE/BSD
1994-03-09 23:51:22 +00:00
AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([
$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
1994-05-28 23:36:08 +00:00
[#include <sys/param.h>
#ifdef MORE_BSD
1994-03-09 23:51:22 +00:00
yes
#endif
1994-05-28 23:36:08 +00:00
], [$1], [$2])
1994-03-09 23:51:22 +00:00
])dnl
dnl
1994-05-28 23:36:08 +00:00
dnl SUDO_NEXT
1994-05-24 16:51:12 +00:00
dnl
1994-05-28 23:36:08 +00:00
define(SUDO_NEXT,
[echo checking for NeXTstep
AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([
$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
[#ifdef NeXT
yes
#endif
], [$1], [$2])
1994-05-24 16:51:12 +00:00
])dnl
dnl
1994-05-28 23:36:08 +00:00
dnl SUDO_BSD
1994-05-24 16:51:12 +00:00
dnl
1994-05-28 23:36:08 +00:00
define(SUDO_BSD,
[echo checking for BSD
1994-03-12 18:39:00 +00:00
AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([
$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
1994-05-28 23:36:08 +00:00
[#include <sys/param.h>
#ifdef BSD
1994-03-12 18:39:00 +00:00
yes
#endif
1994-05-28 23:36:08 +00:00
], [$1], [$2])
1994-03-12 18:39:00 +00:00
])dnl