source: openpam/trunk/configure.ac

Last change on this file was 834, checked in by des, 4 weeks ago

Add configure options to build as much as possible using the system
libpam and / or liboath. Doing so disables building the corresponding
library and its documentation, but still builts the corresponding tools
and modules and runs the unit tests.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1dnl $Id$
2
3AC_PREREQ([2.62])
4AC_REVISION([$Id$])
5AC_INIT([OpenPAM], [trunk], [des@des.no], [openpam], [http://www.openpam.org/])
6AC_CONFIG_SRCDIR([lib/libpam/pam_start.c])
7AC_CONFIG_MACRO_DIR([m4])
8AM_INIT_AUTOMAKE([foreign])
9AM_CONFIG_HEADER([config.h])
10
11# C compiler and features
12AC_LANG(C)
13AC_PROG_CC
14AC_PROG_CC_STDC
15AC_PROG_CPP
16AC_GNU_SOURCE
17AC_C_CONST
18AC_C_RESTRICT
19AC_C_VOLATILE
20
21# libtool
22LT_PREREQ([2.2.6])
23LT_INIT([disable-static dlopen])
24
25# other programs
26AC_PROG_INSTALL
27
28LIB_MAJ=2
29AC_SUBST(LIB_MAJ)
30AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
31
32AC_ARG_ENABLE([debug],
33    AC_HELP_STRING([--enable-debug],
34        [turn debugging macros on]),
35    AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging macros on]))
36
37AC_ARG_ENABLE([unversioned-modules],
38    AC_HELP_STRING([--disable-unversioned-modules],
39        [support loading of unversioned modules]),
40    [AS_IF([test x"$enableval" = x"no"], [
41        AC_DEFINE(DISABLE_UNVERSIONED_MODULES,
42            1,
43            [Whether loading unversioned modules support is disabled])
44    ])])
45
46AC_ARG_WITH([modules-dir],
47    AC_HELP_STRING([--with-modules-dir=DIR],
48        [OpenPAM modules directory]),
49    [AS_IF([test x"$withval" != x"no"], [
50        OPENPAM_MODULES_DIR="$withval"
51        AC_DEFINE_UNQUOTED(OPENPAM_MODULES_DIR,
52            "${OPENPAM_MODULES_DIR%/}",
53            [OpenPAM modules directory])
54    ])])
55AC_SUBST(OPENPAM_MODULES_DIR)
56AM_CONDITIONAL([CUSTOM_MODULES_DIR], [test x"$OPENPAM_MODULES_DIR" != x""])
57
58AC_ARG_WITH([doc],
59    AC_HELP_STRING([--without-doc], [do not build documentation]),
60    [],
61    [with_doc=yes])
62AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"yes"])
63
64AC_ARG_WITH([pam-unix],
65    AC_HELP_STRING([--with-pam-unix], [build sample pam_unix(8) module]),
66    [],
67    [with_pam_unix=no])
68AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"])
69
70AC_ARG_WITH([oath],
71    AC_HELP_STRING([--without-oath], [do not build OATH library, module and utility]),
72    [],
73    [with_oath=yes])
74AM_CONDITIONAL([WITH_OATH], [test x"$with_oath" = x"yes"])
75
76AC_ARG_WITH(pamtest,
77    AC_HELP_STRING([--with-pamtest], [build test application]),
78    [],
79    [with_pamtest=no])
80AM_CONDITIONAL([WITH_PAMTEST], [test x"$with_pamtest" = x"yes"])
81
82AC_ARG_WITH(su,
83    AC_HELP_STRING([--with-su], [build sample su(1) implementation]),
84    [],
85    [with_su=no])
86AM_CONDITIONAL([WITH_SU], [test x"$with_su" = x"yes"])
87
88AC_ARG_WITH(system-libpam,
89    AC_HELP_STRING([--with-system-libpam], [use system libpam]),
90    [],
91    [with_system_libpam=no])
92AM_CONDITIONAL([WITH_SYSTEM_LIBPAM], [test x"$with_system_libpam" = x"yes"])
93
94AC_ARG_WITH(system-liboath,
95    AC_HELP_STRING([--with-system-liboath], [use system liboath]),
96    [],
97    [with_system_liboath=no])
98AM_CONDITIONAL([WITH_SYSTEM_LIBOATH], [test x"$with_system_liboath" = x"yes"])
99
100AC_CHECK_HEADERS([crypt.h])
101
102AC_CHECK_FUNCS([asprintf vasprintf])
103AC_CHECK_FUNCS([dlfunc fdlopen])
104AC_CHECK_FUNCS([fpurge])
105AC_CHECK_FUNCS([setlogmask])
106AC_CHECK_FUNCS([strlcat strlcmp strlcpy strlset])
107
108saved_LIBS="${LIBS}"
109LIBS=""
110AC_CHECK_LIB([dl], [dlopen])
111DL_LIBS="${LIBS}"
112LIBS="${saved_LIBS}"
113AC_SUBST(DL_LIBS)
114
115saved_LIBS="${LIBS}"
116LIBS=""
117AC_CHECK_LIB([crypt], [crypt])
118CRYPT_LIBS="${LIBS}"
119LIBS="${saved_LIBS}"
120AC_SUBST(CRYPT_LIBS)
121
122saved_LIBS="${LIBS}"
123LIBS=""
124AC_CHECK_LIB([crypto], [HMAC_CTX_init])
125CRYPTO_LIBS="${LIBS}"
126LIBS="${saved_LIBS}"
127AC_SUBST(CRYPTO_LIBS)
128
129saved_LIBS="${LIBS}"
130LIBS=""
131AC_CHECK_LIB([pam], [pam_start])
132SYSTEM_LIBPAM="${LIBS}"
133LIBS="${saved_LIBS}"
134AC_SUBST(SYSTEM_LIBPAM)
135
136saved_LIBS="${LIBS}"
137LIBS=""
138AC_CHECK_LIB([oath], [oath_key_alloc])
139SYSTEM_LIBOATH="${LIBS}"
140LIBS="${saved_LIBS}"
141AC_SUBST(SYSTEM_LIBOATH)
142
143AC_ARG_ENABLE([developer-warnings],
144    AS_HELP_STRING([--enable-developer-warnings], [enable strict warnings (default is NO)]),
145    [CFLAGS="${CFLAGS} -Wall -Wextra"])
146AC_ARG_ENABLE([debugging-symbols],
147    AS_HELP_STRING([--enable-debugging-symbols], [enable debugging symbols (default is NO)]),
148    [CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
149AC_ARG_ENABLE([werror],
150    AS_HELP_STRING([--enable-werror], [use -Werror (default is NO)]),
151    [CFLAGS="${CFLAGS} -Werror"])
152
153AC_CONFIG_FILES([
154    Makefile
155    bin/Makefile
156    bin/oathkey/Makefile
157    bin/openpam_dump_policy/Makefile
158    bin/pamtest/Makefile
159    bin/su/Makefile
160    doc/Makefile
161    doc/man/Makefile
162    include/Makefile
163    include/security/Makefile
164    lib/Makefile
165    lib/liboath/Makefile
166    lib/libpam/Makefile
167    modules/Makefile
168    modules/pam_deny/Makefile
169    modules/pam_permit/Makefile
170    modules/pam_unix/Makefile
171    modules/pam_oath/Makefile
172    t/Makefile
173])
174AC_CONFIG_FILES([pamgdb],[chmod +x pamgdb])
175AC_CONFIG_FILES([mkpkgng],[chmod +x mkpkgng])
176AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.