1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(userinfo, 2.5-dev, [Ben Kibbey bjk@luxsci.net])
4 AC_CONFIG_MACRO_DIR([m4])
5 AC_CONFIG_AUX_DIR(build)
7 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
11 AM_CONFIG_HEADER([config.h])
12 AC_CONFIG_SRCDIR([src/ui.c])
14 LIBTOOL="$LIBTOOL --silent"
16 dnl Checks for programs.
24 dnl Checks for header files.
27 AC_CHECK_HEADERS([fcntl.h limits.h paths.h stdlib.h string.h sys/param.h \
28 unistd.h libgen.h err.h shadow.h lastlog.h err.h \
29 sys/mman.h getopt.h utmp.h utmpx.h])
31 dnl Checks for typedefs, structures, and compiler characteristics.
38 dnl Checks for library functions.
45 AC_CHECK_FUNCS([memset getspnam munmap setpassent setgroupent strchr strdup \
46 strerror strsep getgrent setutxent getlastlogx])
47 AC_CHECK_FUNC([__progname])
49 # Test for struct passwd members.
50 AC_MSG_CHECKING([for pw_change member in struct passwd])
51 AC_TRY_COMPILE([#include <pwd.h>],
53 (void)pwd.pw_change;], have_passwd_change=yes)
54 if test x"$have_passwd_change" = "xyes"; then
56 AC_DEFINE(HAVE_PASSWD_CHANGE, 1, [Define if struct passwd contains pw_change.])
61 AC_MSG_CHECKING([for pw_expire member in struct passwd])
62 AC_TRY_COMPILE([#include <pwd.h>],
64 (void)pwd.pw_expire;], [have_passwd_expire=yes])
65 if test x"$have_passwd_expire" = "xyes"; then
67 AC_DEFINE(HAVE_PASSWD_EXPIRE, 1, [Define if struct passwd contains pw_expire.])
72 AC_MSG_CHECKING([for pw_gecos member in struct passwd])
73 AC_TRY_COMPILE([#include <pwd.h>],
75 (void)pwd.pw_gecos;], [have_passwd_gecos=yes])
76 if test x"$have_passwd_gecos" = "xyes"; then
78 AC_DEFINE(HAVE_PASSWD_GECOS, 1, [Define if struct passwd contains pw_gecos.])
83 dnl /proc filesystem support
84 AC_MSG_CHECKING(for /proc filesystem)
86 if test -e /proc/self -o -e /proc/curproc; then
89 AC_DEFINE(HAVE_PROCFS, 1, [Define if you have a /proc file system.])
94 AM_CONDITIONAL(SOLARIS, false)
95 AM_CONDITIONAL(KVM, false)
99 AC_CHECK_HEADERS(kvm.h, AC_DEFINE([BSD_KVM], 1, [Define for BSD KVM.]))
100 AC_CHECK_LIB(kvm, kvm_openfiles, AM_CONDITIONAL(KVM, true))
103 if test ! $HAVE_PROCFS; then
104 AC_MSG_WARN(no /proc filesystem found. PPID info will be unavailable)
108 AM_CONDITIONAL(SOLARIS, true)
114 AC_SUBST(DLOPEN_LIBS, $lt_cv_dlopen_libs)
116 dnl default alias file
117 alias_file="/etc/aliases"
120 [ --with-aliases=FILE location of mail aliases file (/etc/aliases)],
121 alias_file="$withval")
123 AC_MSG_CHECKING(for mail aliases file)
124 if test -f $alias_file; then
125 AC_MSG_RESULT($alias_file)
127 AC_MSG_RESULT([$alias_file not found (using it anyway)])
136 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
137 [ac_cv_sys_debug=no])
139 if test "$ac_cv_sys_debug" = "yes"; then
140 CPPFLAGS="$CPPFLAGS -DDEBUG"
144 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
145 AC_DEBUG([$enableval]), AC_DEBUG)
147 AC_DEFINE_UNQUOTED([ALIAS_FILE], "$alias_file", [Location of your mail alias file.])
148 AC_DEFINE([DEFAULT_DELIMINATING_CHAR], ':', [Default field deliminator.])
149 AC_DEFINE_UNQUOTED([DEFAULT_MULTI_CHAR], [','], [Default multi-string value deliminator.])
150 AC_DEFINE([DEFAULT_TIMEFORMAT], "%s", [Default strftime() time format.])
154 AC_CONFIG_FILES([Makefile src/Makefile src/modules/Makefile doc/Makefile contrib/Makefile])