2009-05-04 10:00:08 +02:00
|
|
|
AC_INIT(libnfc, 1.1.1, roel@libnfc.org)
|
|
|
|
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
|
|
|
AC_LANG_C
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
|
|
AC_PATH_PROG(PKG_CONFIG, pkg-config)
|
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2009-05-27 14:18:21 +02:00
|
|
|
AC_CHECK_HEADERS([stdio.h stdlib.h stdint.h stddef.h])
|
2009-05-04 10:00:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
# libusb
|
|
|
|
PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0])
|
|
|
|
if test "$WITH_USB" == "0" ; then
|
|
|
|
AC_MSG_ERROR([libusb is mandatory.])
|
|
|
|
fi
|
|
|
|
AC_SUBST(LIBUSB_LIBS)
|
|
|
|
AC_SUBST(LIBUSB_CFLAGS)
|
|
|
|
|
|
|
|
# libpcsclite
|
|
|
|
PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0])
|
|
|
|
if test "$WITH_PCSC" == "0" ; then
|
|
|
|
AC_MSG_ERROR([libpcsclite is mandatory.])
|
|
|
|
fi
|
|
|
|
AC_SUBST(LIBPCSCLITE_LIBS)
|
|
|
|
AC_SUBST(LIBPCSCLITE_CFLAGS)
|
|
|
|
|
2009-05-27 10:54:50 +02:00
|
|
|
# --enable-debug support
|
|
|
|
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Debug flags]),[enable_debug=$enableval],[enable_debug="no"])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(debug)
|
|
|
|
AC_MSG_RESULT($enable_debug)
|
|
|
|
|
|
|
|
if test "x$enable_debug" = "xyes"
|
|
|
|
then
|
2009-05-27 12:13:19 +02:00
|
|
|
CFLAGS="$CFLAGS -g -Wall -DDEBUG -pedantic"
|
2009-05-27 10:54:50 +02:00
|
|
|
fi
|
|
|
|
AC_SUBST([DEBUG_CFLAGS])
|
|
|
|
|
2009-05-27 12:13:19 +02:00
|
|
|
CFLAGS="$CFLAGS -std=c99"
|
2009-05-27 10:54:50 +02:00
|
|
|
|
2009-05-04 10:00:08 +02:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
2009-05-04 15:02:29 +02:00
|
|
|
src/Makefile
|
2009-05-04 10:00:08 +02:00
|
|
|
libnfc.pc
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|