1 dnl $Id: configure.ac,v 2.2 2005-07-30 12:57:04 bjk Exp $
3 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(userinfo, 2.1, [Ben Kibbey <bjk@arbornet.org>])
6 AC_CONFIG_AUX_DIR(build)
8 AM_INIT_AUTOMAKE([foreign])
13 AM_CONFIG_HEADER([config.h])
14 AC_CONFIG_SRCDIR([src/ui.c])
16 LIBTOOL="$LIBTOOL --silent"
18 dnl Checks for programs.
22 dnl Checks for header files.
25 AC_CHECK_HEADERS([fcntl.h limits.h paths.h stdlib.h string.h sys/param.h \
26 unistd.h sys/syslimits.h libgen.h err.h shadow.h \
27 lastlog.h err.h sys/mman.h getopt.h])
29 dnl Some systems have utmpx.h but don't utilize it (they use the older utmp
31 AC_CHECK_HEADER([utmpx.h], [have_utmpx=1], [have_utmpx=0])
33 if test $have_utmpx = 1; then
34 AC_MSG_CHECKING([how utmp is utilized])
43 if ((u = getutxent()) == NULL)
48 ], [utmpx_works=1], [utmpx_works=0])
50 if test $utmpx_works = 1; then
51 AC_MSG_RESULT([utmpx])
52 AC_DEFINE([UTMPX_FORMAT], 1, [Define if your system USES utmpx.])
58 dnl Checks for typedefs, structures, and compiler characteristics.
65 dnl Checks for library functions.
72 AC_CHECK_FUNCS([memset getspnam munmap setpassent setgroupent strchr strdup \
74 AC_CHECK_FUNC([__progname])
76 dnl /proc filesystem support
77 AC_MSG_CHECKING(for /proc filesystem)
79 if test -e /proc/self -o -e /proc/curproc; then
82 AC_DEFINE(HAVE_PROCFS, 1, [Define if you have a /proc file system.])
87 AM_CONDITIONAL(SOLARIS, false)
88 AM_CONDITIONAL(KVM, false)
92 AC_CHECK_HEADERS(kvm.h, AC_DEFINE([BSD_KVM], 1, [Define for BSD KVM.]))
93 AC_CHECK_LIB(kvm, kvm_openfiles, AM_CONDITIONAL(KVM, true))
96 if test ! $HAVE_PROCFS; then
97 AC_MSG_WARN(no /proc filesystem found. PPID info will be unavailable)
101 AM_CONDITIONAL(SOLARIS, true)
107 AC_SUBST(DLOPEN_LIBS, $lt_cv_dlopen_libs)
109 dnl default alias file
110 alias_file="/etc/aliases"
113 [ --with-aliases=FILE location of mail aliases file (/etc/aliases)],
114 alias_file="$withval")
116 AC_MSG_CHECKING(for mail aliases file)
117 if test -f $alias_file; then
118 AC_MSG_RESULT($alias_file)
120 AC_MSG_RESULT([$alias_file not found (using it anyway)])
129 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
130 [ac_cv_sys_debug=no])
132 if test "$ac_cv_sys_debug" = "yes"; then
133 CPPFLAGS="$CPPFLAGS -DDEBUG"
137 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
138 AC_DEBUG([$enableval]), AC_DEBUG)
140 AC_DEFINE_UNQUOTED([ALIAS_FILE], "$alias_file", [Location of your mail alias file.])
141 AC_DEFINE([DEFAULT_DELIMINATING_CHAR], ':', [Default field deliminator.])
142 AC_DEFINE_UNQUOTED([DEFAULT_MULTI_CHAR], [','], [Default multi-string value deliminator.])
143 AC_DEFINE([DEFAULT_TIMEFORMAT], "%s", [Default strftime() time format.])
147 AC_CONFIG_FILES([Makefile src/Makefile src/modules/Makefile doc/Makefile contrib/Makefile])