1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(userinfo, 2.5, [Ben Kibbey bjk@luxsci.net])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(build)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
AC_LIBTOOL_DLOPEN
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([src/ui.c])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h paths.h stdlib.h string.h sys/param.h \
unistd.h libgen.h err.h shadow.h lastlog.h err.h \
sys/mman.h getopt.h utmp.h utmpx.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_GETGROUPS
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_MMAP
AC_CHECK_FUNCS([memset getspnam munmap setpassent setgroupent strchr strdup \
strerror strsep getgrent setutxent getlastlogx])
AC_CHECK_FUNC([__progname])
# Test for struct passwd members.
AC_MSG_CHECKING([for pw_change member in struct passwd])
AC_TRY_COMPILE([#include <pwd.h>],
[struct passwd pwd;
(void)pwd.pw_change;], have_passwd_change=yes)
if test x"$have_passwd_change" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_PASSWD_CHANGE, 1, [Define if struct passwd contains pw_change.])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for pw_expire member in struct passwd])
AC_TRY_COMPILE([#include <pwd.h>],
[struct passwd pwd;
(void)pwd.pw_expire;], [have_passwd_expire=yes])
if test x"$have_passwd_expire" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_PASSWD_EXPIRE, 1, [Define if struct passwd contains pw_expire.])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for pw_gecos member in struct passwd])
AC_TRY_COMPILE([#include <pwd.h>],
[struct passwd pwd;
(void)pwd.pw_gecos;], [have_passwd_gecos=yes])
if test x"$have_passwd_gecos" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_PASSWD_GECOS, 1, [Define if struct passwd contains pw_gecos.])
else
AC_MSG_RESULT([no])
fi
dnl /proc filesystem support
AC_MSG_CHECKING(for /proc filesystem)
if test -e /proc/self -o -e /proc/curproc; then
AC_MSG_RESULT(yes)
HAVE_PROCFS=1
AC_DEFINE(HAVE_PROCFS, 1, [Define if you have a /proc file system.])
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(SOLARIS, false)
AM_CONDITIONAL(KVM, false)
case "$target_os" in
*bsd*)
AC_CHECK_HEADERS(kvm.h, AC_DEFINE([BSD_KVM], 1, [Define for BSD KVM.]))
AC_CHECK_LIB(kvm, kvm_openfiles, AM_CONDITIONAL(KVM, true))
;;
*linux*)
if test ! $HAVE_PROCFS; then
AC_MSG_WARN(no /proc filesystem found. PPID info will be unavailable)
fi
;;
*solaris*)
AM_CONDITIONAL(SOLARIS, true)
;;
*)
;;
esac
AC_SUBST(DLOPEN_LIBS, $lt_cv_dlopen_libs)
dnl default alias file
alias_file="/etc/aliases"
AC_ARG_WITH(aliases,
[ --with-aliases=FILE location of mail aliases file (/etc/aliases)],
alias_file="$withval")
AC_MSG_CHECKING(for mail aliases file)
if test -f $alias_file; then
AC_MSG_RESULT($alias_file)
else
AC_MSG_RESULT([$alias_file not found (using it anyway)])
fi
AC_DEFUN([AC_DEBUG],
[
if test "$1"; then
ac_cv_sys_debug=$1
fi
AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
[ac_cv_sys_debug=no])
if test "$ac_cv_sys_debug" = "yes"; then
CPPFLAGS="$CPPFLAGS -DDEBUG"
fi
])
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
AC_DEBUG([$enableval]), AC_DEBUG)
AC_DEFINE_UNQUOTED([ALIAS_FILE], "$alias_file", [Location of your mail alias file.])
AC_DEFINE([DEFAULT_DELIMINATING_CHAR], ':', [Default field deliminator.])
AC_DEFINE_UNQUOTED([DEFAULT_MULTI_CHAR], [','], [Default multi-string value deliminator.])
AC_DEFINE([DEFAULT_TIMEFORMAT], "%s", [Default strftime() time format.])
AM_WITH_DMALLOC
AC_CONFIG_FILES([Makefile src/Makefile src/modules/Makefile doc/Makefile contrib/Makefile])
AC_OUTPUT
|