configure.ac revision 174833
1dnl $Id: configure.ac 411 2007-12-21 11:44:14Z des $
2
3AC_PREREQ(2.59)
4AC_REVISION([$Id: configure.ac 411 2007-12-21 11:44:14Z des $])
5AC_INIT([OpenPAM],[20071221],[des@des.no])
6AC_CONFIG_SRCDIR(lib/pam_start.c)
7AM_CONFIG_HEADER(config.h)
8
9AC_CANONICAL_SYSTEM
10AC_LANG(C)
11AC_C_VOLATILE
12AC_DISABLE_STATIC
13AC_PROG_LIBTOOL
14AM_INIT_AUTOMAKE
15
16LIB_MAJ=2
17AC_SUBST(LIB_MAJ)
18AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
19
20AC_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
25AC_MSG_CHECKING([whether loading unversioned modules support is enabled])
26AC_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
37AC_MSG_CHECKING([for modules directory support])
38AC_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)])
53AC_SUBST(OPENPAM_MODULES_DIR)
54
55AC_MSG_CHECKING([whether to build the documentation])
56AC_ARG_WITH(doc,
57	AC_HELP_STRING([--with-doc],
58		[build documentation]),
59	,
60	[with_doc=yes])
61AC_MSG_RESULT($with_doc)
62
63AC_MSG_CHECKING([whether to build example version of pam_unix.so])
64AC_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])
69AC_MSG_RESULT($with_pam_unix)
70
71AC_MSG_CHECKING([whether to build example version of su(1)])
72AC_ARG_WITH(su,
73	AC_HELP_STRING([--with-su],
74		[compile example version of su(1)]),
75	,
76	[with_su=no])
77AC_MSG_RESULT($with_su)
78
79AM_CONDITIONAL(WITH_DOC, test "x$with_doc" = "xyes")
80AM_CONDITIONAL(WITH_PAM_UNIX, test "x$with_pam_unix" = "xyes")
81AM_CONDITIONAL(WITH_SU, test "x$with_su" = "xyes")
82
83AC_PROG_INSTALL
84
85AC_CHECK_HEADERS(crypt.h)
86
87AC_CHECK_FUNCS(fpurge)
88
89DL_LIBS=
90AC_CHECK_LIB(dl, dlopen, DL_LIBS=-ldl)
91AC_SUBST(DL_LIBS)
92
93CRYPT_LIBS=
94AC_CHECK_LIB(crypt, crypt, CRYPT_LIBS=-lcrypt)
95AC_SUBST(CRYPT_LIBS)
96
97CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
98
99# This corresponds to FreeBSD's WARNS level 6
100DEVELOPER_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"
101
102AC_ARG_ENABLE(developer-warnings,
103        AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]),
104        CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}")
105AC_ARG_ENABLE(debugging-symbols,
106        AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]),
107        CFLAGS="${CFLAGS} -O0 -g -fno-inline")
108AC_ARG_ENABLE(werror,
109        AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]),
110        CFLAGS="${CFLAGS} -Werror")
111
112AC_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
125])
126AC_OUTPUT
127