| 1 | dnl $Id$ |
|---|
| 2 | |
|---|
| 3 | AC_PREREQ(2.59) |
|---|
| 4 | AC_REVISION([$Id$]) |
|---|
| 5 | AC_INIT([OpenPAM],[trunk],[des@des.no]) |
|---|
| 6 | AC_CONFIG_SRCDIR(lib/pam_start.c) |
|---|
| 7 | AM_CONFIG_HEADER(config.h) |
|---|
| 8 | |
|---|
| 9 | AC_CANONICAL_SYSTEM |
|---|
| 10 | AC_LANG(C) |
|---|
| 11 | AC_C_VOLATILE |
|---|
| 12 | AC_DISABLE_STATIC |
|---|
| 13 | AC_PROG_LIBTOOL |
|---|
| 14 | AM_INIT_AUTOMAKE |
|---|
| 15 | |
|---|
| 16 | LIB_MAJ=2 |
|---|
| 17 | AC_SUBST(LIB_MAJ) |
|---|
| 18 | AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number]) |
|---|
| 19 | |
|---|
| 20 | AC_ARG_ENABLE(debug, |
|---|
| 21 | AC_HELP_STRING([--enable-debug], |
|---|
| 22 | [turn debugging on by default]), |
|---|
| 23 | AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging on by default])) |
|---|
| 24 | |
|---|
| 25 | AC_MSG_CHECKING([whether loading unversioned modules support is enabled]) |
|---|
| 26 | AC_ARG_ENABLE(unversioned-modules, |
|---|
| 27 | AC_HELP_STRING([--disable-unversioned-modules], |
|---|
| 28 | [support loading of unversioned modules]), |
|---|
| 29 | [if test "$enableval" = "no"; then |
|---|
| 30 | AC_DEFINE(DISABLE_UNVERSIONED_MODULES, |
|---|
| 31 | 1, |
|---|
| 32 | [Whether loading unversioned modules support is disabled]) |
|---|
| 33 | fi |
|---|
| 34 | AC_MSG_RESULT(no)], |
|---|
| 35 | AC_MSG_RESULT(yes)) |
|---|
| 36 | |
|---|
| 37 | AC_MSG_CHECKING([for modules directory support]) |
|---|
| 38 | AC_ARG_WITH(modules-dir, |
|---|
| 39 | AC_HELP_STRING([--with-modules-dir=DIR], |
|---|
| 40 | [OpenPAM modules directory]), |
|---|
| 41 | [if test "$withval" != "no"; then |
|---|
| 42 | OPENPAM_MODULES_DIR="$withval" |
|---|
| 43 | AC_DEFINE_UNQUOTED(OPENPAM_MODULES_DIR, |
|---|
| 44 | "$OPENPAM_MODULES_DIR", |
|---|
| 45 | [OpenPAM modules directory]) |
|---|
| 46 | AC_MSG_RESULT($OPENPAM_MODULES_DIR) |
|---|
| 47 | else |
|---|
| 48 | OPENPAM_MODULES_DIR="$libdir" |
|---|
| 49 | AC_MSG_RESULT(no) |
|---|
| 50 | fi], |
|---|
| 51 | [OPENPAM_MODULES_DIR="$libdir" |
|---|
| 52 | AC_MSG_RESULT(no)]) |
|---|
| 53 | AC_SUBST(OPENPAM_MODULES_DIR) |
|---|
| 54 | |
|---|
| 55 | AC_MSG_CHECKING([whether to build the documentation]) |
|---|
| 56 | AC_ARG_WITH(doc, |
|---|
| 57 | AC_HELP_STRING([--with-doc], |
|---|
| 58 | [build documentation]), |
|---|
| 59 | , |
|---|
| 60 | [with_doc=yes]) |
|---|
| 61 | AC_MSG_RESULT($with_doc) |
|---|
| 62 | |
|---|
| 63 | AC_MSG_CHECKING([whether to build example version of pam_unix.so]) |
|---|
| 64 | AC_ARG_WITH(pam-unix, |
|---|
| 65 | AC_HELP_STRING([--with-pam-unix], |
|---|
| 66 | [compile example version of pam_unix.so]), |
|---|
| 67 | , |
|---|
| 68 | [with_pam_unix=no]) |
|---|
| 69 | AC_MSG_RESULT($with_pam_unix) |
|---|
| 70 | |
|---|
| 71 | AC_MSG_CHECKING([whether to build example version of su(1)]) |
|---|
| 72 | AC_ARG_WITH(su, |
|---|
| 73 | AC_HELP_STRING([--with-su], |
|---|
| 74 | [compile example version of su(1)]), |
|---|
| 75 | , |
|---|
| 76 | [with_su=no]) |
|---|
| 77 | AC_MSG_RESULT($with_su) |
|---|
| 78 | |
|---|
| 79 | AM_CONDITIONAL(WITH_DOC, test "x$with_doc" = "xyes") |
|---|
| 80 | AM_CONDITIONAL(WITH_PAM_UNIX, test "x$with_pam_unix" = "xyes") |
|---|
| 81 | AM_CONDITIONAL(WITH_SU, test "x$with_su" = "xyes") |
|---|
| 82 | |
|---|
| 83 | AC_PROG_INSTALL |
|---|
| 84 | |
|---|
| 85 | AC_CHECK_HEADERS(crypt.h) |
|---|
| 86 | |
|---|
| 87 | AC_CHECK_FUNCS(fpurge) |
|---|
| 88 | |
|---|
| 89 | DL_LIBS= |
|---|
| 90 | AC_CHECK_LIB(dl, dlopen, DL_LIBS=-ldl) |
|---|
| 91 | AC_SUBST(DL_LIBS) |
|---|
| 92 | |
|---|
| 93 | CRYPT_LIBS= |
|---|
| 94 | AC_CHECK_LIB(crypt, crypt, CRYPT_LIBS=-lcrypt) |
|---|
| 95 | AC_SUBST(CRYPT_LIBS) |
|---|
| 96 | |
|---|
| 97 | CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" |
|---|
| 98 | |
|---|
| 99 | AC_ARG_ENABLE(developer-warnings, |
|---|
| 100 | AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]), |
|---|
| 101 | CFLAGS="${CFLAGS} -Wall -Wextra") |
|---|
| 102 | AC_ARG_ENABLE(debugging-symbols, |
|---|
| 103 | AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]), |
|---|
| 104 | CFLAGS="${CFLAGS} -O0 -g -fno-inline") |
|---|
| 105 | AC_ARG_ENABLE(werror, |
|---|
| 106 | AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), |
|---|
| 107 | CFLAGS="${CFLAGS} -Werror") |
|---|
| 108 | |
|---|
| 109 | AC_CONFIG_FILES([ |
|---|
| 110 | bin/Makefile |
|---|
| 111 | bin/su/Makefile |
|---|
| 112 | include/Makefile |
|---|
| 113 | include/security/Makefile |
|---|
| 114 | lib/Makefile |
|---|
| 115 | modules/Makefile |
|---|
| 116 | modules/pam_unix/Makefile |
|---|
| 117 | modules/pam_deny/Makefile |
|---|
| 118 | modules/pam_permit/Makefile |
|---|
| 119 | doc/Makefile |
|---|
| 120 | doc/man/Makefile |
|---|
| 121 | Makefile |
|---|
| 122 | ]) |
|---|
| 123 | AC_OUTPUT |
|---|