]> www.average.org Git - pam_pcsc_cr.git/blobdiff - configure.ac
switch to autotools
[pam_pcsc_cr.git] / configure.ac
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..28632b2
--- /dev/null
@@ -0,0 +1,45 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([pam_pcsc_cr], 0.0.1)
+AC_CONFIG_SRCDIR([pam_pcsc_cr.c])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+AM_CONFIG_HEADER([config.h])
+AC_LANG_C
+AC_PROG_CC
+
+if test "X$CC" = "Xgcc"; then
+  CFLAGS="$CFLAGS -Wall -g"
+fi
+
+AC_PROG_MAKE_SET
+AC_SUBST(PROGS)dnl
+AC_SUBST(LIBPROGS)dnl
+AC_PROG_INSTALL
+AM_PROG_LIBTOOL
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES([PCSC], [pcsclite])
+AC_ARG_WITH(pcsc-include-path,
+       [  --with-pcsc-include-path=PATH path to pcsclite includes],
+       [PCSC_CFLAGS="-I $withval"],
+       [])
+AC_ARG_WITH(pcsc-lib-path,
+       [  --with-pcsc-lib-path=PATH path to pcsclite libs],
+       [PCSC_LIBS="-L $withval -lpcsclite"],
+       [])
+
+AC_SUBST(PCSC_LIBS)
+AC_SUBST(PCSC_CFLAGS)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_TIME
+
+AC_CHECK_LIB(libpcsclite, SCardEstablishContext)
+if test x$ac_cv_lib_SCardEstablishContext != xyes; then
+       AC_MSG_ERROR([Cannot find usable libpcsclite])
+fi
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT