shadow/configure.in

309 lines
9.7 KiB
Plaintext
Raw Normal View History

dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/dialchk.c)
AM_INIT_AUTOMAKE(shadow, 19990827)
AM_CONFIG_HEADER(config.h)
dnl Some hacks...
test "$prefix" = "NONE" && prefix="/usr"
test "$prefix" = "/usr" && exec_prefix=""
test "$CFLAGS" = "" && CFLAGS="-O2 -Wall"
test "$LDFLAGS" = "" && LDFLAGS="-s"
ALL_LINGUAS="el fr pl sv"
dnl Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
dnl AC_PROG_INSTALL
AC_PROG_LN_S
dnl AC_PROG_MAKE_SET
AC_PROG_YACC
dnl AC_ARG_PROGRAM
AM_C_PROTOTYPES
AM_PROG_LIBTOOL
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h sys/time.h utmp.h utmpx.h)
AC_CHECK_HEADERS(termios.h termio.h sgtty.h sys/ioctl.h syslog.h)
AC_CHECK_HEADERS(paths.h usersec.h utime.h ulimit.h sys/resource.h)
AC_CHECK_HEADERS(gshadow.h shadow.h lastlog.h rpc/key_prot.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_MODE_T
AC_STRUCT_ST_RDEV
AC_HEADER_STAT
AC_HEADER_TIME
AC_STRUCT_TM
AC_CACHE_CHECK(for pw_age in struct passwd,
ac_cv_struct_passwd_pw_age, AC_TRY_COMPILE([#include <pwd.h>],
[ struct passwd pw; pw.pw_age = ""; ],
ac_cv_struct_passwd_pw_age=yes, ac_cv_struct_passwd_pw_age=no))
if test "$ac_cv_struct_passwd_pw_age" = "yes"; then
AC_DEFINE(ATT_AGE)
fi
AC_CACHE_CHECK(for pw_comment in struct passwd,
ac_cv_struct_passwd_pw_comment, AC_TRY_COMPILE([#include <pwd.h>],
[ struct passwd pw; pw.pw_comment = ""; ],
ac_cv_struct_passwd_pw_comment=yes, ac_cv_struct_passwd_pw_comment=no))
if test "$ac_cv_struct_passwd_pw_comment" = "yes"; then
AC_DEFINE(ATT_COMMENT)
fi
AC_CACHE_CHECK(for pw_quota in struct passwd,
ac_cv_struct_passwd_pw_quota, AC_TRY_COMPILE([#include <pwd.h>],
[ struct passwd pw; pw.pw_quota = ""; ],
ac_cv_struct_passwd_pw_quota=yes, ac_cv_struct_passwd_pw_quota=no))
if test "$ac_cv_struct_passwd_pw_quota" = "yes"; then
AC_DEFINE(BSD_QUOTA)
fi
if test "$ac_cv_header_utmp_h" = "yes"; then
AC_CACHE_CHECK(for ut_host in struct utmp,
ac_cv_struct_utmp_ut_host, AC_TRY_COMPILE([#include <utmp.h>],
[ struct utmp ut; char *cp = ut.ut_host; ],
ac_cv_struct_utmp_ut_host=yes, ac_cv_struct_utmp_ut_host=no))
if test "$ac_cv_struct_utmp_ut_host" = "yes"; then
AC_DEFINE(UT_HOST)
fi
AC_CACHE_CHECK(for ut_user in struct utmp,
ac_cv_struct_utmp_ut_user, AC_TRY_COMPILE([#include <utmp.h>],
[ struct utmp ut; char *cp = ut.ut_user; ],
ac_cv_struct_utmp_ut_user=yes, ac_cv_struct_utmp_ut_user=no))
if test "$ac_cv_struct_utmp_ut_user" = "no"; then
AC_DEFINE(ut_user, ut_name)
fi
fi
if test "$ac_cv_header_lastlog_h" = "yes"; then
AC_CACHE_CHECK(for ll_host in struct lastlog,
ac_cv_struct_lastlog_ll_host, AC_TRY_COMPILE([#include <lastlog.h>],
[ struct lastlog ll; char *cp = ll.ll_host; ],
ac_cv_struct_lastlog_ll_host=yes, ac_cv_struct_lastlog_ll_host=no))
if test "$ac_cv_struct_lastlog_ll_host" = "yes"; then
AC_DEFINE(HAVE_LL_HOST)
fi
fi
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_FUNC_STRFTIME
dnl Disabled for now, strtoday.c has problems with year 2000 or later
dnl AC_CHECK_FUNCS(strptime)
AC_CHECK_FUNCS(a64l fchmod fchown fsync getgroups gethostname getspnam)
AC_CHECK_FUNCS(gettimeofday getusershell getutent initgroups lckpwdf)
AC_CHECK_FUNCS(memcpy memset setgroups sigaction strchr updwtmp updwtmpx)
AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
AC_CHECK_FUNC(setpgrp)
AC_FUNC_SETPGRP
if test "$ac_cv_header_shadow_h" = "yes"; then
AC_CACHE_CHECK(for working shadow group support,
ac_cv_libc_shadowgrp, AC_TRY_RUN(
[
#include <shadow.h>
main()
{
struct sgrp *sg = sgetsgent("test:x::");
/* NYS libc on Red Hat 3.0.3 has broken shadow group support */
return !sg || !sg->sg_adm || !sg->sg_mem;
}
],
ac_cv_libc_shadowgrp=yes,ac_cv_libc_shadowgrp=no,ac_cv_libc_shadowgrp=no))
if test "$ac_cv_libc_shadowgrp" = "yes"; then
AC_DEFINE(HAVE_SHADOWGRP)
fi
fi
AC_MSG_CHECKING(location of shared mail directory)
for maildir in /var/spool/mail /var/mail /usr/spool/mail /usr/mail NONE; do
if test "$maildir" = "NONE"; then
AC_MSG_RESULT(None)
elif test -d $maildir; then
AC_DEFINE_UNQUOTED(MAIL_SPOOL_DIR, "$maildir")
AC_MSG_RESULT($maildir)
break
fi
done
AC_MSG_CHECKING(location of user mail file)
for mailfile in Mailbox mailbox Mail mail .mail NONE; do
if test "$mailfile" = "NONE"; then
AC_MSG_RESULT(None)
elif test -f $HOME/$mailfile; then
AC_DEFINE_UNQUOTED(MAIL_SPOOL_FILE, "$mailfile")
AC_MSG_RESULT($mailfile)
break
fi
done
AC_MSG_CHECKING(location of utmp)
for utmpdir in /var/run /var/adm /usr/adm /etc NONE; do
if test "$utmpdir" = "NONE"; then
AC_MSG_WARN(utmp file not found)
elif test -f $utmpdir/utmp; then
AC_DEFINE_UNQUOTED(_UTMP_FILE, "$utmpdir/utmp")
AC_MSG_RESULT($utmpdir)
break
fi
done
AC_MSG_CHECKING(location of faillog/lastlog/wtmp)
for logdir in /var/log /var/adm /usr/adm /etc; do
if test -d $logdir; then
AC_DEFINE_UNQUOTED(_WTMP_FILE, "$logdir/wtmp")
AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$logdir/lastlog")
AC_DEFINE_UNQUOTED(FAILLOG_FILE, "$logdir/faillog")
AC_MSG_RESULT($logdir)
break
fi
done
AC_MSG_CHECKING(location of the passwd program)
if test -f /usr/bin/passwd; then
passwd_dir=/usr/bin
else
passwd_dir=/bin
fi
AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$passwd_dir/passwd")
AC_MSG_RESULT($passwd_dir)
dnl XXX - quick hack, should disappear before anyone notices :).
AC_DEFINE(SHADOWPWD)
AC_DEFINE(USG)
AC_DEFINE(AGING)
AC_DEFINE(USE_SYSLOG)
AC_DEFINE(RLOGIN)
AC_DEFINE(RUSEROK, 0)
AC_DEFINE(LOGIN_ACCESS)
AC_DEFINE(SU_ACCESS)
dnl Use our own version of getpass(), which handles long passwords
dnl (unlike many systems which have a limit of 8 characters), and can
dnl be interrupted with Ctrl-C (unlike Linux libc).
AC_DEFINE(getpass, libshadow_getpass)
AC_ARG_ENABLE(desrpc, [ --enable-desrpc try to use secure RPC in login (default if found)])
dnl AC_ARG_ENABLE(md5crypt, [ --enable-md5crypt include MD5-compatible crypt function])
AC_ARG_ENABLE(shadowgrp, [ --enable-shadowgrp enable shadow group support [default=yes]])
AC_ARG_WITH(libcrack, [ --with-libcrack try to use libcrack (default if found)])
AC_ARG_WITH(libcrypt, [ --with-libcrypt try to use libcrypt (default if found)])
AC_ARG_WITH(libopie, [ --with-libopie use libopie for OPIE support])
AC_ARG_WITH(libpam, [ --with-libpam use libpam for PAM support])
AC_ARG_WITH(libskey, [ --with-libskey use libskey for S/Key support])
AC_ARG_WITH(libtcfs, [ --with-libtcfs use libtcfs for TCFS support])
dnl Check for some functions in libc first, only if not found check for
dnl other libraries. This should prevent linking libnsl if not really
dnl needed (Linux glibc, Irix), but still link it if needed (Solaris).
AC_CHECK_FUNC(inet_ntoa, [], AC_CHECK_LIB(inet, inet_ntoa))
AC_CHECK_FUNC(socket, [], AC_CHECK_LIB(socket, socket))
AC_CHECK_FUNC(gethostbyname, [], AC_CHECK_LIB(nsl, gethostbyname))
dnl XXX - getsecretkey() causes login to hang for 5 minutes on at least
dnl one RH 4.0 system. Use --disable-desrpc if you have this problem.
dnl Reported by Mohan Khurana <mohan@stealth.net>.
if test "$enable_desrpc" != "no" -a "$ac_cv_header_rpc_key_prot_h" = "yes" ; then
AC_CHECK_FUNC(getsecretkey, AC_DEFINE(DES_RPC),
AC_CHECK_LIB(rpcsvc, getsecretkey, AC_DEFINE(DES_RPC)))
fi
if test "$enable_shadowgrp" != "no"; then
AC_DEFINE(SHADOWGRP)
fi
AC_SUBST(LIBCRYPT)
if test "$with_libcrypt" != "no"; then
AC_CHECK_LIB(crypt, crypt, [AC_DEFINE(HAVE_LIBCRYPT) LIBCRYPT=-lcrypt])
fi
if test "$enable_md5crypt" = "yes"; then
LIBOBJS="$LIBOBJS md5.o md5crypt.o"
AC_DEFINE(MD5_CRYPT)
fi
AC_SUBST(LIBCRACK)
if test "$with_libcrack" != "no"; then
echo "checking cracklib flavour, don't be surprised by the results"
AC_CHECK_LIB(crack, FascistCheck, AC_DEFINE(HAVE_LIBCRACK) LIBCRACK=-lcrack)
AC_CHECK_LIB(crack, FascistHistory, AC_DEFINE(HAVE_LIBCRACK_HIST))
AC_CHECK_LIB(crack, FascistHistoryPw, AC_DEFINE(HAVE_LIBCRACK_PW))
fi
AC_SUBST(LIBSKEY)
if test "$with_libskey" = "yes"; then
AC_CHECK_LIB(skey, skeychallenge, AC_DEFINE(SKEY) LIBSKEY=-lskey, , $LIBCRYPT)
elif test "$with_libopie" = "yes"; then
AC_CHECK_LIB(opie, opiechallenge, AC_DEFINE(OPIE) LIBSKEY=-lopie, , $LIBCRYPT)
fi
AC_SUBST(LIBTCFS)
if test "$with_libtcfs" = "yes"; then
AC_CHECK_LIB(tcfs, tcfs_encrypt_key, AC_DEFINE(HAVE_TCFS) AC_DEFINE(TCFS_GDBM_SUPPORT) LIBTCFS="-ltcfs -lgdbm", , -lgdbm)
fi
AC_SUBST(LIBPAM)
if test "$with_libpam" = "yes"; then
dnl AC_CHECK_LIB(pam, pam_start, AC_DEFINE(USE_PAM) LIBPAM=-lpam)
dnl the above doesn't work as there is no libpam.a (only .so)
dnl XXX - libpam_misc is probably Linux-PAM specific
LIBPAM="-lpam -lpam_misc -ldl"
AC_DEFINE(USE_PAM)
AC_CACHE_CHECK(whether pam_strerror needs two arguments,
ac_cv_pam_strerror_needs_two_args,
AC_TRY_COMPILE(
[#include <security/pam_appl.h>],
[ pam_handle_t *pamh; pam_strerror(pamh, PAM_SUCCESS); ],
ac_cv_pam_strerror_needs_two_args=yes,
ac_cv_pam_strerror_needs_two_args=no
)
)
if test "$ac_cv_pam_strerror_needs_two_args" = "yes"; then
AC_DEFINE(PAM_STRERROR_NEEDS_TWO_ARGS)
fi
fi
LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'`
AC_SUBST(LTLIBOBJS)
dnl LTALLOCA=`echo "$ALLOCA" | sed 's/\.o/.lo/g'`
dnl AC_SUBST(LTALLOCA)
AM_GNU_GETTEXT
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT(libmisc/Makefile man/Makefile lib/Makefile src/Makefile Makefile
contrib/Makefile debian/Makefile doc/Makefile etc/Makefile
intl/Makefile intl/po2tbl.sed po/Makefile.in
etc/pam.d/Makefile old/Makefile
redhat/Makefile redhat/shadow-utils.spec,
echo timestamp > stamp-h)