2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00
sudo/configure.in

216 lines
4.9 KiB
Plaintext
Raw Normal View History

1994-03-09 23:51:22 +00:00
dnl Process this file with autoconf to produce a configure script.
1994-03-12 18:37:58 +00:00
echo Configuring CU Sudo version 1.3.1
1994-03-09 23:51:22 +00:00
AC_INIT(sudo.h)
1994-03-12 18:37:58 +00:00
AC_CONFIG_HEADER(config.h pathnames.h)
1994-03-09 23:51:22 +00:00
dnl
dnl Variables that get substituted in the Makefile
dnl
PROGS="sudo visudo"
AC_SUBST(PROGS)dnl
STATIC_FLAGS=""
AC_SUBST(STATIC_FLAGS)dnl
1994-03-12 18:37:58 +00:00
INC_FLAGS=""
AC_SUBST(INC_FLAGS)dnl
1994-07-07 00:52:41 +00:00
OSDEFS=""
AC_SUBST(OSDEFS)dnl
1994-03-09 23:51:22 +00:00
OPTIONS=""
AC_SUBST(OPTIONS)dnl
LIBOBJS=""
AC_SUBST(LIBOBJS)dnl
1994-06-26 20:35:48 +00:00
TGETPASS="tgetpass.o"
AC_SUBST(TGETPASS)dnl
MAN_PREFIX='$(prefix)/man'
AC_SUBST(MAN_PREFIX)dnl
MANTYPE="man"
MAN_POSTINSTALL=""
AC_SUBST(MAN_POSTINSTALL)dnl
AC_SUBST(MANTYPE)dnl
1994-03-09 23:51:22 +00:00
dnl
1994-06-26 20:35:48 +00:00
dnl Options for --with(out)
dnl
dnl --with-getpass
AC_WITH(getpass, AC_DEFINE(USE_GETPASS)
echo 'Using system getpass'
TGETPASS="")
1994-03-09 23:51:22 +00:00
dnl
dnl --with-C2
AC_WITH(C2, AC_DEFINE(HAVE_C2_SECURITY)
1994-07-07 00:52:41 +00:00
C2=1
echo 'Configuring for C2 security')
dnl
1994-07-14 15:32:13 +00:00
dnl --with-AFS
1994-07-14 16:34:40 +00:00
AC_WITH(AFS, AC_DEFINE(HAVE_AFS)
1994-07-14 23:11:06 +00:00
AFS=1
1994-07-14 15:32:13 +00:00
echo 'Configuring for use with AFS')
dnl
dnl --with-csops
1994-03-12 22:41:53 +00:00
AC_WITH(csops, OPTIONS="${OPTIONS} -DUSE_INSULTS -DENV_EDITOR -DSHORT_MESSAGE"
1994-03-09 23:51:22 +00:00
echo 'CSOps--adding options: USE_INSULTS ENV_EDITOR SHORT_MESSAGE')
dnl
dnl C compiler checks
dnl
AC_PROG_CC
AC_PROG_CPP
dnl
1994-05-24 16:50:57 +00:00
dnl find "uname"
dnl
1994-05-29 19:52:11 +00:00
AC_PROGRAM_CHECK(UNAMEPROG, uname, uname, )
AC_PROGRAM_CHECK(TRPROG, tr, tr, )
1994-05-30 01:29:00 +00:00
AC_PROGRAM_CHECK(SEDPROG, sed, sed, )
AC_PROGRAM_CHECK(NROFFPROG, nroff, nroff, )
if test -z "$NROFFPROG"; then
MANTYPE="cat"
fi
1994-05-24 16:50:57 +00:00
dnl
1994-03-09 23:51:22 +00:00
dnl what architecture are we on?
dnl
1994-05-28 23:36:22 +00:00
SUDO_OSTYPE()
1994-06-03 15:31:18 +00:00
OS=`echo $OS | $TRPROG '[[A-Z]]' '[[a-z]]'`
case "$OS" in
1994-05-28 23:36:22 +00:00
"sunos") echo "Looks like SunOS 4.x"
if test -z "$GCC"; then
STATIC_FLAGS="-Bstatic"
1994-05-28 23:36:22 +00:00
fi
;;
"solaris") echo "Looks like Solaris"
AC_DEFINE(SVR4)
1994-05-28 23:36:22 +00:00
;;
"aix") echo "Looks like AIX"
AC_DEFINE(_ALL_SOURCE)
;;
"hp-ux") echo "Looks like HP-UX"
if test -z "$GCC"; then
1994-05-28 23:36:22 +00:00
STATIC_FLAGS="-Wl,-a,archive"
fi
;;
"osf1") echo "Looks like OSF/1"
if test -z "$GCC"; then
1994-05-28 23:36:22 +00:00
STATIC_FLAGS="-non_shared"
fi
;;
"irix") echo "Looks like IRIX"
# configure doesn't think irix has stdc headers
# but it's good enough for sudo
AC_DEFINE(STDC_HEADERS)
if test -z "$NROFFPROG"; then
MAN_POSTINSTALL='/bin/rm -f $(mandir)/sudo.$(mansect).z ; /usr/bin/pack $(mandir)/sudo.$(mansect)'
if test -d /usr/share/catman/local; then
MAN_PREFIX="/usr/share/catman/local"
else
MAN_PREFIX="/usr/catman/local"
fi
else
if test -d /usr/share/man/local; then
MAN_PREFIX="/usr/share/man/local"
else
MAN_PREFIX="/usr/man/local"
fi
fi
1994-05-28 23:36:22 +00:00
;;
"linux") echo "Looks like linux"
;;
"convex") echo "Looks like ConvexOs"
AC_DEFINE(_CONVEX_SOURCE)
1994-07-07 00:52:41 +00:00
# C2 security stuff
if test -n "$C2"; then
OSDEFS="${OSDEFS} -D_AUDIT -D_ACL -DSecureWare"
LIBS="${LIBS} -lprot"
fi
1994-05-28 23:36:22 +00:00
;;
"ultrix"*) echo "Looks like ultrix"
1994-07-25 22:25:15 +00:00
# C2 security stuff
if test -n "$C2"; then
LIBS="${LIBS} -lauth"
fi
1994-05-28 23:36:22 +00:00
;;
"ksr"*) echo "Looks like a KSR"
;;
"next") echo "Looks like NeXTstep"
;;
"bsd/386") echo "Looks like bsdi BSD/386"
;;
1994-05-29 23:13:18 +00:00
"mtxinu") echo "Looks like mt Xinu MORE/BSD"
;;
1994-05-28 23:36:22 +00:00
"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
1994-03-12 18:37:58 +00:00
dnl
1994-07-26 00:36:54 +00:00
dnl We can't make a static binary on solaris and it causes probs on AIX
1994-03-09 23:51:22 +00:00
dnl
1994-07-26 00:36:54 +00:00
if test -n "$GCC" -a -n "$OS" -a "$OS" != "solaris" -a "$OS" != "aix" ; then
1994-05-28 23:36:22 +00:00
STATIC_FLAGS="-static"
1994-03-09 23:51:22 +00:00
fi
dnl
1994-07-14 23:11:06 +00:00
dnl extra AFS libs
dnl
if test -n "$AFS" ; then
LIBS="${LIBS} -L/usr/lib/afs -lkauth -lprot -lauth -lubik -lrxkad -lsys -ldes -lrx -llwp -lcom_err -laudit -lutil"
fi
dnl
1994-05-28 23:36:22 +00:00
dnl C compiler checks (to be done after os checks)
1994-03-12 18:37:58 +00:00
dnl
1994-05-28 23:36:22 +00:00
AC_GCC_TRADITIONAL
AC_CONST
1994-03-09 23:51:22 +00:00
dnl
1994-05-24 16:50:57 +00:00
dnl Program checks
1994-03-09 23:51:22 +00:00
dnl
AC_PROG_YACC
AC_PROG_LEX
if test "$LEX" = "flex"; then
AC_DEFINE(HAVE_FLEX)
fi
1994-03-09 23:51:22 +00:00
SUDO_PROG_INSTALL
SUDO_PROG_SENDMAIL
SUDO_PROG_PWD
1994-03-12 18:37:58 +00:00
SUDO_PROG_VI
1994-03-09 23:51:22 +00:00
dnl
dnl Header file checks
dnl
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h strings.h unistd.h malloc.h paths.h sys/sockio.h)
if test "$OS" != "ultrix" ; then
AC_HAVE_HEADERS(termio.h termios.h)
fi
1994-03-09 23:51:22 +00:00
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
1994-03-09 23:51:22 +00:00
dnl
1994-05-24 16:50:57 +00:00
dnl Function checks
1994-03-09 23:51:22 +00:00
dnl
AC_HAVE_FUNCS(getwd strchr strrchr memcpy sysconf sigaction bzero tzset)
1994-06-07 18:54:38 +00:00
AC_FUNC_CHECK(strdup, AC_DEFINE(HAVE_STRDUP), LIBOBJS="$LIBOBJS strdup.o")
AC_FUNC_CHECK(getcwd, AC_DEFINE(HAVE_GETCWD), LIBOBJS="$LIBOBJS getcwd.o")
AC_FUNC_CHECK(setenv, AC_DEFINE(HAVE_SETENV), AC_FUNC_CHECK(putenv, AC_DEFINE(HAVE_PUTENV), LIBOBJS="$LIBOBJS putenv.o"))
1994-03-09 23:51:22 +00:00
dnl
dnl library checks
dnl
1994-05-29 19:52:11 +00:00
AC_HAVE_LIBRARY(nsl)
AC_HAVE_LIBRARY(socket)
1994-03-13 01:41:10 +00:00
AC_HAVE_LIBRARY(ufc)
1994-03-09 23:51:22 +00:00
dnl
1994-05-28 23:36:22 +00:00
dnl OS-dependent libraries
1994-05-24 16:50:57 +00:00
dnl
1994-05-28 23:36:22 +00:00
if test -n "$OS" -a "$OS" = "irix" ; then
AC_IRIX_SUN
fi
1994-05-24 16:50:57 +00:00
dnl
dnl Substitute into the Makefiles
1994-03-09 23:51:22 +00:00
dnl
AC_OUTPUT(Makefile visudoers/Makefile)