28632b2ea58dc8b1bfc92ef98cdc2b160ad7f937
[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], [pcsclite])
23 AC_ARG_WITH(pcsc-include-path,
24         [  --with-pcsc-include-path=PATH path to pcsclite includes],
25         [PCSC_CFLAGS="-I $withval"],
26         [])
27 AC_ARG_WITH(pcsc-lib-path,
28         [  --with-pcsc-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
35 dnl Checks for header files.
36 AC_HEADER_STDC
37 AC_HEADER_TIME
38
39 AC_CHECK_LIB(libpcsclite, SCardEstablishContext)
40 if test x$ac_cv_lib_SCardEstablishContext != xyes; then
41         AC_MSG_ERROR([Cannot find usable libpcsclite])
42 fi
43
44 AC_CONFIG_FILES([Makefile])
45 AC_OUTPUT