Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / openpam / configure.ac
blob17464e3c256980deefce97f123cff12124b6c24a
1 dnl $Id: configure.ac,v 1.1.1.2 2008/01/27 00:54:47 christos Exp $
3 AC_PREREQ(2.59)
4 AC_REVISION([$Id: configure.ac,v 1.1.1.2 2008/01/27 00:54:47 christos Exp $])
5 AC_INIT([OpenPAM],[20071221],[des@des.no])
6 AC_CONFIG_SRCDIR(lib/pam_start.c)
7 AM_CONFIG_HEADER(config.h)
9 AC_CANONICAL_SYSTEM
10 AC_LANG(C)
11 AC_C_VOLATILE
12 AC_DISABLE_STATIC
13 AC_PROG_LIBTOOL
14 AM_INIT_AUTOMAKE
16 LIB_MAJ=2
17 AC_SUBST(LIB_MAJ)
18 AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
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]))
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))
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)
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)
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)
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)
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")
83 AC_PROG_INSTALL
85 AC_CHECK_HEADERS(crypt.h)
87 AC_CHECK_FUNCS(fpurge)
89 DL_LIBS=
90 AC_CHECK_LIB(dl, dlopen, DL_LIBS=-ldl)
91 AC_SUBST(DL_LIBS)
93 CRYPT_LIBS=
94 AC_CHECK_LIB(crypt, crypt, CRYPT_LIBS=-lcrypt)
95 AC_SUBST(CRYPT_LIBS)
97 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
99 # This corresponds to FreeBSD's WARNS level 6
100 DEVELOPER_CFLAGS="-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat"
102 AC_ARG_ENABLE(developer-warnings,
103         AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]),
104         CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}")
105 AC_ARG_ENABLE(debugging-symbols,
106         AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]),
107         CFLAGS="${CFLAGS} -O0 -g -fno-inline")
108 AC_ARG_ENABLE(werror,
109         AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]),
110         CFLAGS="${CFLAGS} -Werror")
112 AC_CONFIG_FILES([
113         bin/Makefile
114         bin/su/Makefile
115         include/Makefile
116         include/security/Makefile
117         lib/Makefile
118         modules/Makefile
119         modules/pam_unix/Makefile
120         modules/pam_deny/Makefile
121         modules/pam_permit/Makefile
122         doc/Makefile
123         doc/man/Makefile
124         Makefile
126 AC_OUTPUT