Files
sudo/configure.in
1994-05-29 00:18:13 +00:00

158 lines
3.4 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
echo Configuring CU Sudo version 1.3.1
AC_INIT(sudo.h)
AC_CONFIG_HEADER(config.h pathnames.h)
dnl
dnl Variables that get substituted in the Makefile
dnl
PROGS="sudo visudo"
AC_SUBST(PROGS)dnl
STATIC_FLAGS=""
AC_SUBST(STATIC_FLAGS)dnl
INC_FLAGS=""
AC_SUBST(INC_FLAGS)dnl
OPTIONS=""
AC_SUBST(OPTIONS)dnl
dnl
dnl did they say --with-csops?
dnl
AC_WITH(csops, OPTIONS="${OPTIONS} -DUSE_INSULTS -DENV_EDITOR -DSHORT_MESSAGE"
echo 'CSOps--adding options: USE_INSULTS ENV_EDITOR SHORT_MESSAGE')
dnl
dnl C compiler checks
dnl
AC_PROG_CC
AC_PROG_CPP
dnl
dnl find "uname"
dnl
AC_PROGRAM_CHECK(UNAMEPROG, uname, uname ,)
AC_PROGRAM_CHECK(TRPROG, tr, tr ,)
dnl
dnl what architecture are we on?
dnl
SUDO_OSTYPE()
OS=`echo $OS | $TRPROG '[A-Z]' '[a-z]'`
case `echo $OS | $TRPROG '[A-Z]' '[a-z]'` in
"sunos") echo "Looks like SunOS 4.x"
if test -n "$GCC"; then
STATIC_FLAGS="-static"
fi
;;
"solaris") echo "Looks like Solaris"
;;
"aix") echo "Looks like AIX"
AC_DEFINE(_ALL_SOURCE)
OPTIONS="${OPTIONS} -DBROKEN_GETPASS"
if test -n "$GCC"; then
STATIC_FLAGS="-bnso -bI:/lib/syscalls.exp -bI:./aixcrypt.exp -liconv -bnodelcsect"
fi
;;
"hp-ux") echo "Looks like HP-UX"
OPTIONS="${OPTIONS} -DBROKEN_GETPASS"
if test -n "$GCC"; then
STATIC_FLAGS="-Wl,-a,archive"
fi
;;
"osf1") echo "Looks like OSF/1"
if test -n "$GCC"; then
STATIC_FLAGS="-non_shared"
fi
;;
"irix") echo "Looks like IRIX"
OPTIONS="${OPTIONS} -DBROKEN_GETPASS"
# need bsd signals to get sigmask()
AC_DEFINE(_BSD_SIGNALS)
AC_DEFINE(RETSIGTYPE, int)
# configure doesn't think irix has stdc headers
# but it's good enough for sudo
AC_DEFINE(STDC_HEADERS)
;;
"linux") echo "Looks like linux"
if test -n "$GCC"; then
STATIC_FLAGS="-static"
fi
;;
"convex") echo "Looks like ConvexOs"
AC_DEFINE(_CONVEX_SOURCE)
;;
"ultrix"*) echo "Looks like ultrix"
;;
"ksr"*) echo "Looks like a KSR"
;;
"next") echo "Looks like NeXTstep"
if test -n "$GCC"; then
STATIC_FLAGS="-static"
fi
;;
"bsd/386") echo "Looks like bsdi BSD/386"
;;
"4.3bsd") echo "Looks like HP BSD"
;;
*"bsd"*) echo "Looks like some kind of BSD"
;;
"unknown") echo "I don't recognize your OS, but that's ok"
;;
*) echo "Hmmm, I don't recognize $OS offhand, but that's ok"
;;
esac
dnl
dnl We can't make a static binary on solaris...
dnl
if test -n "$GCC" -a -n "$OS" -a "$OS" != "solaris" ; then
STATIC_FLAGS="-static"
fi
dnl
dnl C compiler checks (to be done after os checks)
dnl
AC_GCC_TRADITIONAL
AC_CONST
dnl
dnl Program checks
dnl
AC_PROG_YACC
AC_PROG_LEX
SUDO_PROG_INSTALL
SUDO_PROG_SENDMAIL
SUDO_PROG_VI
dnl
dnl Header file checks
dnl
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h strings.h unistd.h malloc.h paths.h termio.h termios.h)
dnl
dnl typedef checks
dnl
AC_MODE_T
AC_UID_T
AC_SIZE_T
dnl
dnl only set RETSIGTYPE if it is not set already
dnl
case "$DEFS" in
*"RETSIGTYPE"*) ;;
*) AC_RETSIGTYPE;;
esac
dnl
dnl Function checks
dnl
AC_HAVE_FUNCS(getcwd strdup strchr strrchr sysconf)
dnl
dnl library checks
dnl
AC_HAVE_LIBRARY(shadow)
AC_HAVE_LIBRARY(ufc)
dnl
dnl OS-dependent libraries
dnl
if test -n "$OS" -a "$OS" != "sunos"; then
AC_HAVE_LIBRARY(nsl)
fi
if test -n "$OS" -a "$OS" = "irix" ; then
AC_IRIX_SUN
fi
dnl
dnl Substitute into the Makefiles
dnl
AC_OUTPUT(Makefile visudoers/Makefile)