e9fd2f3d2a663e92d5d8aee0d4d9bb807556afbf
[pam_pcsc_cr.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([pam_pcsc_cr], 0.0.1)
4 AC_CONFIG_SRCDIR([pam_pcsc_cr.c])
5 AC_CONFIG_MACRO_DIR([m4])
6 AM_INIT_AUTOMAKE
7 AM_CONFIG_HEADER([config.h])
8 AC_LANG_C
9 AC_PROG_CC
10
11 if test "X$CC" = "Xgcc"; then
12   CFLAGS="$CFLAGS -Wall -g"
13 fi
14
15 AC_PROG_MAKE_SET
16 AC_SUBST(PROGS)dnl
17 AC_SUBST(LIBPROGS)dnl
18 AC_PROG_INSTALL
19 AM_PROG_LIBTOOL
20 PKG_PROG_PKG_CONFIG
21
22 PKG_CHECK_MODULES([PCSC], [libpcsclite])
23 AC_ARG_WITH(pcsclite-include-path,
24         [  --with-pcsclite-include-path=PATH path to pcsclite includes],
25         [PCSC_CFLAGS="-I $withval"],
26         [])
27 AC_ARG_WITH(pcsclite-lib-path,
28         [  --with-pcsclite-lib-path=PATH path to pcsclite libs],
29         [PCSC_LIBS="-L $withval -lpcsclite"],
30         [])
31
32 AC_SUBST(PCSC_LIBS)
33 AC_SUBST(PCSC_CFLAGS)
34 CFLAGS="$PCSC_CFLAGS $CFLAGS"
35 LIBS="$PCSC_LIBS $LIBS"
36
37 AC_SUBST(CRYPTO_OBJS)
38
39 dnl Checks for header files.
40 AC_HEADER_STDC
41 AC_HEADER_TIME
42
43 AC_CHECK_HEADERS([winscard.h reader.h], [],
44   [AC_MSG_ERROR([[pcsclite headers not found]])])
45 AC_CHECK_LIB([pcsclite], [SCardEstablishContext], [],
46   [AC_MSG_ERROR([[pcsclite library not useable]])])
47
48 AC_CONFIG_FILES([Makefile])
49 AC_OUTPUT