dnl $Id: configure.ac,v 2.2 2005-07-30 12:57:04 bjk Exp $ dnl dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(userinfo, 2.2, [Ben Kibbey ]) AC_CONFIG_AUX_DIR(build) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([foreign]) AC_PROG_MAKE_SET AC_LIBTOOL_DLOPEN AC_DISABLE_STATIC AC_PROG_LIBTOOL AM_CONFIG_HEADER([config.h]) AC_CONFIG_SRCDIR([src/ui.c]) LIBTOOL="$LIBTOOL --silent" dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL 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 sys/syslimits.h libgen.h err.h shadow.h \ lastlog.h err.h sys/mman.h getopt.h]) dnl Some systems have utmpx.h but don't utilize it (they use the older utmp dnl format). AC_CHECK_HEADER([utmpx.h], [have_utmpx=1], [have_utmpx=0]) if test $have_utmpx = 1; then AC_MSG_CHECKING([how utmp is utilized]) AC_RUN_IFELSE([\ #include #include int main() { struct utmpx *u; if ((u = getutxent()) == NULL) exit(1); exit(0); } ], [utmpx_works=1], [utmpx_works=0]) if test $utmpx_works = 1; then AC_MSG_RESULT([utmpx]) AC_DEFINE([UTMPX_FORMAT], 1, [Define if your system USES utmpx.]) else AC_MSG_RESULT([utmp]) fi fi 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]) AC_CHECK_FUNC([__progname]) 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