2009-07-24 16:51:03 +02:00
|
|
|
AC_INIT(libnfc, 1.2.1, info@libnfc.org)
|
2009-05-04 10:00:08 +02:00
|
|
|
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
|
|
|
AC_LANG_C
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
2009-08-26 10:54:39 +02:00
|
|
|
|
|
|
|
# Libtool
|
2009-05-04 10:00:08 +02:00
|
|
|
AC_PROG_LIBTOOL
|
2009-08-26 10:54:39 +02:00
|
|
|
case "$host" in
|
|
|
|
*-pc-linux-gnu)
|
|
|
|
AC_MSG_RESULT([Fixing libtool for -rpath problems.])
|
|
|
|
sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' libtool
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-05-04 10:00:08 +02:00
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
|
|
AC_PATH_PROG(PKG_CONFIG, pkg-config)
|
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2009-05-27 16:05:07 +02:00
|
|
|
AC_HEADER_STDBOOL
|
2009-06-03 09:32:43 +02:00
|
|
|
AC_CHECK_HEADERS([stdio.h stdlib.h stdint.h stddef.h stdbool.h usb.h])
|
2009-05-04 10:00:08 +02:00
|
|
|
|
2009-05-27 16:05:07 +02:00
|
|
|
# Checks for types
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
|
|
|
AC_TYPE_INT32_T
|
2009-05-04 10:00:08 +02:00
|
|
|
|
2009-06-11 10:30:49 +02:00
|
|
|
# --enable-pcsc-lite support (default: yes)
|
|
|
|
AC_ARG_ENABLE([pcsc-lite],AS_HELP_STRING([--enable-pcsc-lite],[pcsc-lite feature flag]),[enable_pcsc_lite=$enableval],[enable_pcsc_lite="yes"])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for pcsc-lite support)
|
|
|
|
AC_MSG_RESULT($enable_pcsc_lite)
|
|
|
|
|
|
|
|
if test x"$enable_pcsc_lite" = "xno"
|
|
|
|
then
|
|
|
|
WITH_PCSC=0
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(PCSC_LITE_ENABLED, [test x"$enable_pcsc_lite" = xyes])
|
|
|
|
|
2009-06-11 13:57:36 +02:00
|
|
|
# --enable-debug support (default:no)
|
2009-05-27 16:05:07 +02:00
|
|
|
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Debug flags]),[enable_debug=$enableval],[enable_debug="no"])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for debug flag)
|
|
|
|
AC_MSG_RESULT($enable_debug)
|
|
|
|
|
2009-06-11 10:30:49 +02:00
|
|
|
if test x"$enable_debug" = "xyes"
|
2009-05-27 16:05:07 +02:00
|
|
|
then
|
2009-06-29 10:47:19 +02:00
|
|
|
CFLAGS="$CFLAGS -g -Wall -DDEBUG -pedantic"
|
2009-05-27 16:05:07 +02:00
|
|
|
fi
|
|
|
|
AC_SUBST([DEBUG_CFLAGS])
|
|
|
|
|
|
|
|
## libusb
|
2009-06-30 15:30:31 +02:00
|
|
|
if test x"$PKG_CONFIG" = "x"; then
|
2009-06-29 10:47:19 +02:00
|
|
|
AC_PATH_PROG(LIBUSB_CONFIG,libusb-config)
|
2009-06-30 15:30:31 +02:00
|
|
|
if test x"$LIBUSB_CONFIG" = "x" ; then
|
|
|
|
WITH_USB=0
|
|
|
|
else
|
|
|
|
LIBUSB_CFLAGS=`$LIBUSB_CONFIG --cflags`
|
|
|
|
LIBUSB_LIBS=`$LIBUSB_CONFIG --libs`
|
|
|
|
WITH_USB=1
|
2009-06-29 10:47:19 +02:00
|
|
|
fi
|
2009-06-30 15:30:31 +02:00
|
|
|
else
|
|
|
|
PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"$WITH_USB" = "x0"; then
|
|
|
|
AC_MSG_ERROR([libusb is mandatory.])
|
2009-05-04 10:00:08 +02:00
|
|
|
fi
|
|
|
|
AC_SUBST(LIBUSB_LIBS)
|
|
|
|
AC_SUBST(LIBUSB_CFLAGS)
|
|
|
|
|
2009-05-27 16:05:07 +02:00
|
|
|
## libpcsclite
|
2009-06-11 10:30:49 +02:00
|
|
|
if test "x$enable_pcsc_lite" = "xyes"
|
|
|
|
then
|
2009-06-29 10:32:07 +02:00
|
|
|
case "$host" in
|
|
|
|
*darwin*)
|
|
|
|
AC_MSG_WARN(Using darwin PCSC Framework)
|
2009-07-22 11:35:48 +02:00
|
|
|
LIBPCSCLITE_LIBS="-Wl,-framework,PCSC"
|
|
|
|
LIBPCSCLITE_CFLAGS="-I/System/Library/Frameworks/PCSC.framework/Headers"
|
2009-06-29 10:32:07 +02:00
|
|
|
;;
|
|
|
|
*)
|
2009-06-29 10:47:19 +02:00
|
|
|
PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0])
|
|
|
|
if test "$WITH_PCSC" = "0" ; then
|
|
|
|
AC_MSG_ERROR([libpcsclite is mandatory.])
|
|
|
|
fi
|
2009-06-29 10:32:07 +02:00
|
|
|
;;
|
|
|
|
esac
|
2009-06-11 10:30:49 +02:00
|
|
|
AC_SUBST(LIBPCSCLITE_LIBS)
|
|
|
|
AC_SUBST(LIBPCSCLITE_CFLAGS)
|
2009-05-04 10:00:08 +02:00
|
|
|
fi
|
|
|
|
|
2009-05-27 16:05:07 +02:00
|
|
|
# Set C standard to C99
|
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
|