source: trunk/configure.in @ 515

Revision 515, 7.8 KB checked in by ludovic.rousseau, 7 weeks ago (diff)

Release 0.6.8

  • Property svn:keywords set to Id
Line 
1# $Id$
2
3# Require autoconf 2.52
4AC_PREREQ(2.52)
5
6# Process this file with autoconf to produce a configure script.
7AC_INIT(pam_pkcs11, [0.6.8])
8AC_CONFIG_SRCDIR([src/pam_pkcs11/pam_pkcs11.c])
9AC_CANONICAL_TARGET([])
10AM_INIT_AUTOMAKE
11AC_CONFIG_HEADERS([config.h])
12
13# silent build by default
14m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
15
16AM_MAINTAINER_MODE
17
18AM_GNU_GETTEXT_VERSION([0.17])
19AM_GNU_GETTEXT([external])
20
21dnl Add the languages which your application supports here.
22ALL_LINGUAS="de fr nl pl pt_br ru tr"
23
24# Checks for programs.
25AC_PROG_CC
26AC_PROG_CXX
27AM_PROG_LIBTOOL
28AC_PROG_INSTALL
29AC_PROG_LN_S
30AM_PROG_LEX
31AC_PROG_MAKE_SET
32
33# check enable_dependency_tracking configure option
34AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
35
36# Special check for pthread support
37ACX_PTHREAD(, [ AC_MSG_ERROR([POSIX thread support required]) ])
38CC="$PTHREAD_CC"
39
40# Argument for debuging
41AC_ARG_ENABLE(debug,
42  AC_HELP_STRING([--enable-debug], [add debugging code (default=yes)]))
43if test "$enable_debug" = "no" -o "$enable_debug" = "false"
44then
45  AC_MSG_WARN([Debugging support is completely disabled!])
46  with_debug=no
47else
48  AC_DEFINE(DEBUG, 1, [Define to 1 if you want to include debugging code.])
49  with_debug=yes
50fi
51
52# check for dlopen() in libdl
53AC_SUBST(LIBDL)
54AC_CHECK_LIB(dl, dlopen,
55        [LIBDL="$LIBDL -ldl"],
56        [AC_CHECK_FUNCS(dlopen,, [AC_MSG_ERROR(dlopen() not found)])])
57
58# Add argument for using curl
59AC_ARG_WITH(curl,
60  AC_HELP_STRING([--with-curl], [use curl (default=no)]))
61if test "$with_curl" = "yes" -o "$with_curl" = "true"
62then
63  AC_CHECK_LIB(curl, curl_easy_init,
64        [
65        with_curl=yes
66        LIBS="$LIBS -lcurl"
67        ],[
68        AC_MSG_WARN(Could not locate cURL library. cURL disabled)
69        with_curl=no
70        ])
71else
72  with_curl=no
73fi
74AC_SUBST(CURL_CFLAGS)
75AC_SUBST(CURL_LIBS)
76AM_CONDITIONAL(HAVE_CURL, test x$with_curl = xyes)
77
78# Add argument for defining configuration directory
79AC_ARG_WITH(confdir,
80AC_HELP_STRING([--with-confdir=DIR],
81        [directory containing pam_pkcs11.conf (default /etc/pam_pkcs11)]),
82        [confdir="${with_confdir}"], [confdir=false])
83if test x${confdir} = xfalse ; then
84        confdir="/etc/pam_pkcs11"
85fi
86AC_DEFINE_UNQUOTED(CONFDIR, "$confdir", [directory containing pam_pkcs11.conf (default /etc/pam_pkcs11)])
87AC_SUBST(confdir)
88
89# Add argument for using ldap
90AC_ARG_WITH(ldap,
91  AC_HELP_STRING([--with-ldap], [use ldap (default=yes)]))
92if test "$with_ldap" = "no" -o "$with_ldap" = "false"
93then
94  with_ldap=no
95else
96  AC_CHECK_LIB( ldap, ldap_init,
97        [
98        with_ldap=yes
99        LIBS="$LIBS -lldap"
100        ],[
101        AC_MSG_WARN([Cannot find LDAP libraries. LDAP support disabled])
102        with_ldap=no
103        ])
104fi
105if test "$with_ldap" \!= "no"; then
106  AC_CHECK_FUNCS(ldap_init ldap_initialize)
107  AC_CHECK_FUNCS(ldap_set_option ldap_get_option) 
108  AC_CHECK_FUNCS(ldap_start_tls ldap_start_tls_s)
109fi     
110AC_SUBST(LDAP_CFLAGS)
111AC_SUBST(LDAP_LIBS)
112AM_CONDITIONAL(HAVE_LDAP, test x$with_ldap = xyes)
113
114# Add argument for using libp11
115#AC_ARG_WITH(libp11,
116#  AC_HELP_STRING([--with-libp11], [use libp11 (default=yes)]))
117#if test "$with_libp11" = "no" -o "$with_libp11" = "false"
118#then
119#  with_libp11=no
120#else
121#  AC_CHECK_LIB( p11, PKCS11_CTX_new,
122#       [
123#       with_libp11=yes
124#       LIBS="$LIBS -lp11"
125#       ],[
126#       AC_MSG_WARN([Cannot find LIBP11 library. Using direct Pkcs11 access])
127#       with_libp11=no
128#       ])
129#fi
130#AC_SUBST(LIBP11_CFLAGS)
131#AC_SUBST(LIBP11_LIBS)
132#AM_CONDITIONAL(HAVE_LIBP11, test x$with_libp11 = xyes)
133
134PKG_PROG_PKG_CONFIG
135
136# Check and set crypto paths
137AC_ARG_WITH(nss,
138  AC_HELP_STRING([--with-nss], [use NSS instead of openSSL and raw PKCS 11 (default=no)]))
139if test "$with_nss" = "yes" -o "$with_nss" = "true"
140then
141  PKG_CHECK_MODULES(NSS, nss, [with_nss=yes],
142   [ AC_MSG_ERROR(could not locate NSS crypto library) ] )
143  OPENSSL_CFLAGS=
144  OPENSSL_LIBS=
145  AC_SUBST(OPENSSL_CFLAGS)
146  AC_SUBST(OPENSSL_LIBS)
147  with_ssl=no
148else
149   PKG_CHECK_MODULES(OPENSSL, openssl, [with_ssl=yes ],
150    [ AC_MSG_ERROR(openssl not found) ])
151  NSS_CFLAGS=
152  NSS_LIBS=
153  AC_SUBST(NSS_CFLAGS)
154  AC_SUBST(NSS_LIBS)
155  with_nss=no
156fi
157AM_CONDITIONAL(HAVE_NSS, test x$with_nss = xyes)
158if test "$with_nss" = "yes"
159then
160    CRYPTO_CFLAGS="${NSS_CFLAGS}-DHAVE_NSS"
161    CRYPTO_LIBS=${NSS_LIBS}
162else
163    CRYPTO_CFLAGS=${OPENSSL_CFLAGS}
164    CRYPTO_LIBS=${OPENSSL_LIBS}
165fi
166AC_SUBST(CRYPTO_CFLAGS)
167AC_SUBST(CRYPTO_LIBS)
168
169
170# Check for PCSC-Lite
171AC_ARG_WITH(pcsclite,
172  AC_HELP_STRING([--without-pcsclite], [Do not use pcsc-lite (default=yes)]),
173  [], [ with_pcsclite=yes ])
174
175if test "$with_pcsclite" != "no"; then
176        OLD_CFLAGS="$CFLAGS"
177        OLD_LIBS="$LIBS"
178        with_pcsclite=yes
179
180    PKG_CHECK_MODULES(PCSC, [libpcsclite], ,
181        [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then
182                AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
183        fi
184    ])
185
186        CFLAGS="$CFLAGS $PCSC_CFLAGS"
187        AC_CHECK_HEADER(winscard.h,,
188                [AC_MSG_ERROR([winscard.h not found, install pcsc-lite, or use PCSC_CFLAGS=... ./configure])],
189                [ #include <winscard.h> ])
190
191        LIBS="$LDLIBS $PCSC_LIBS"
192        AC_CHECK_FUNC(SCardEstablishContext, ,
193                [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite or later,or use PCSC_LIBS=... ./configure])])
194
195        LIBS="$OLD_LIBS"
196        CFLAGS="$OLD_CFLAGS"
197else
198        AC_MSG_WARN([pcsc-lite disabled])
199fi
200AC_SUBST(PCSC_CFLAGS)
201AC_SUBST(PCSC_LIBS)
202AM_CONDITIONAL(HAVE_PCSC, test "x$with_pcsclite" = "xyes")
203
204# Check for SGML processor
205AC_ARG_WITH(docbook,
206  AC_HELP_STRING([--without-docbook], [do not generate html manual (needs docbook)]),
207        with_docbook=$withval)
208if test "$with_docbook" = "no" -o "$with_docbook" = "false"
209then
210        with_docbook=no
211else
212    AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc)
213    if test "x$XSLTPROC" = "x"; then
214        if test "x$with_docbook" = "xyes"; then
215                AC_MSG_ERROR([Docbook support requested, but cannot find xsltproc])
216        fi
217        with_docbook=no
218    else
219        with_docbook=yes
220    fi
221fi
222AM_CONDITIONAL(HAVE_DOCBOOK, test "x$with_docbook" != "xno")
223
224# Checks for libraries.
225AC_CHECK_LIB(pam, pam_get_item, , AC_MSG_ERROR(could not locate pam libraries))
226
227# Checks for header files.
228AC_HEADER_STDC
229AC_CHECK_HEADERS([string.h syslog.h fcntl.h unistd.h error.h])
230if test "x$with_ldap" = "xyes"; then
231AC_CHECK_HEADERS([ldap.h])
232fi
233if test "x$with_curl" = "xyes"; then
234AC_CHECK_HEADERS([curl/curl.h])
235fi
236if test "x$with_libp11" = "xyes"; then
237AC_CHECK_HEADERS([libp11.h])
238fi
239AC_CHECK_HEADERS([security/pam_ext.h])
240
241# Checks for typedefs, structures, and compiler characteristics.
242AC_C_CONST
243AC_TYPE_SIZE_T
244
245# Checks for library functions.
246AC_FUNC_MALLOC
247AC_FUNC_REALLOC
248AC_FUNC_STAT
249AC_FUNC_VPRINTF
250AC_CHECK_FUNCS([memset strdup strerror strndup daemon])
251
252
253AC_CONFIG_FILES([
254Makefile
255po/Makefile.in
256doc/Makefile
257doc/pam_pkcs11.8
258doc/doxygen.conf
259etc/Makefile
260etc/pam.d_login.example
261etc/pam_pkcs11.conf.example
262src/Makefile
263src/scconf/Makefile
264src/common/Makefile
265src/common/rsaref/Makefile
266src/tools/Makefile
267src/mappers/Makefile
268src/pam_pkcs11/Makefile
269tools/Makefile
270])
271AC_OUTPUT
272
273A=`eval echo ${prefix}` ; A=`eval echo ${A}`
274B=`eval echo ${bindir}` ; B=`eval echo ${B}`
275C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
276D=`eval echo ${libdir}` ; D=`eval echo ${D}`
277
278echo ""
279echo "PAM-PKCS#11 has been configured with the following options"
280
281echo ""
282echo "Version:             ${PACKAGE_VERSION}"
283echo "User binaries:       ${B}"
284echo "Configuration files: ${C}"
285echo "libdir:              ${D}"
286echo ""
287echo "Host:                ${host}"
288echo "Compiler:            ${CC}"
289echo "Compiler flags:      ${CFLAGS}"
290echo "Preprocessor flags:  ${CPPFLAGS}"
291echo "Linker flags:        ${LDFLAGS}"
292echo "Libraries:           ${LIBS}"
293
294echo ""
295echo "Debugging:           ${with_debug}"
296echo "DocBook support:     ${with_docbook}"
297echo "PC/SC support:       ${with_pcsclite}"
298echo "CURL support:        ${with_curl}"
299echo "LDAP support:        ${with_ldap}"
300echo "NSS support:         ${with_nss}"
301echo "OPENSSL support:     ${with_ssl}"
302echo "confdir:             ${confdir}"
303#echo "LIBP11 support:      ${with_libp11}"
304echo ""
Note: See TracBrowser for help on using the repository browser.