2013-12-04 10:57:42 +01:00
|
|
|
AC_INIT([libfreefare],[0.4.0])
|
2009-12-18 21:32:25 +01:00
|
|
|
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
2012-06-29 01:26:14 +02:00
|
|
|
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
2012-05-18 17:59:00 +02:00
|
|
|
LT_INIT
|
2009-12-18 21:32:25 +01:00
|
|
|
|
2009-12-22 21:48:13 +01:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
2015-04-13 15:10:35 +02:00
|
|
|
AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip)
|
2009-12-18 21:32:25 +01:00
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
|
|
|
|
2010-07-29 08:11:27 +02:00
|
|
|
# Debug support (default:no)
|
|
|
|
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debug output]),[enable_debug=$enableval],[enable_debug="no"])
|
|
|
|
if test x"$enable_debug" = xyes; then
|
|
|
|
AC_CHECK_LIB([util], [hexdump], [has_libutil=yes], [has_libutil=no])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(WITH_DEBUG, [test x"$enable_debug" = xyes])
|
|
|
|
AM_CONDITIONAL(HAS_LIBUTIL, [test x"$has_libutil" = xyes])
|
|
|
|
|
2009-12-18 21:32:25 +01:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2009-12-22 21:48:13 +01:00
|
|
|
AC_C_INLINE
|
2009-12-18 21:32:25 +01:00
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
AC_TYPE_INT16_T
|
|
|
|
AC_TYPE_INT32_T
|
2010-07-26 23:48:18 +02:00
|
|
|
AC_TYPE_OFF_T
|
2009-12-18 21:32:25 +01:00
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_SIZE_T
|
2010-07-26 23:48:18 +02:00
|
|
|
AC_TYPE_SSIZE_T
|
2009-12-18 21:32:25 +01:00
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_REALLOC
|
2010-04-07 16:06:04 +02:00
|
|
|
|
|
|
|
AC_CHECK_HEADERS([sys/types.h])
|
2010-12-15 13:43:31 +01:00
|
|
|
AC_CHECK_FUNCS([memset letoh32 htole32 pow strdup strerror])
|
2009-12-18 21:32:25 +01:00
|
|
|
|
2010-09-04 13:06:14 +02:00
|
|
|
AC_CHECK_HEADERS([endian.h sys/endian.h CoreFoundation/CoreFoundation.h])
|
|
|
|
if test $ac_cv_header_endian_h = "no" -a $ac_cv_header_sys_endian_h = "no" -a $ac_cv_header_CoreFoundation_CoreFoundation_h = "no"; then
|
|
|
|
AC_MSG_ERROR(["Can't locate usable header file for endianness convertions."]);
|
2009-12-22 21:48:13 +01:00
|
|
|
fi
|
|
|
|
|
2010-02-25 19:02:54 +01:00
|
|
|
AC_CHECK_HEADERS([byteswap.h])
|
|
|
|
|
2010-01-13 14:53:45 +01:00
|
|
|
AC_DEFINE([_XOPEN_SOURCE], [600], [Define to 500 if Single Unix conformance is wanted, 600 for sixth revision.])
|
2010-04-07 16:06:04 +02:00
|
|
|
AC_DEFINE([_BSD_SOURCE], [1], [Define on BSD to activate all library features])
|
2010-01-13 14:53:45 +01:00
|
|
|
|
2009-12-23 16:26:57 +01:00
|
|
|
CFLAGS="$CFLAGS -std=c99"
|
|
|
|
|
2010-07-26 23:48:18 +02:00
|
|
|
# Crypto functions for MIFARE DesFire support are provided by OpenSSL.
|
2010-09-04 12:47:07 +02:00
|
|
|
AC_CHECK_LIB([crypto], [DES_ecb_encrypt], [], [AC_MSG_ERROR([Cannot find libcrypto.])])
|
2010-12-15 13:43:31 +01:00
|
|
|
AC_CHECK_HEADERS([openssl/aes.h openssl/des.h openssl/rand.h], [], [AC_MSG_ERROR([Cannot find openssl headers.])])
|
2010-07-26 23:48:18 +02:00
|
|
|
|
2009-12-18 21:32:25 +01:00
|
|
|
# Checks for pkg-config modules.
|
2012-12-23 22:30:10 +01:00
|
|
|
LIBNFC_REQUIRED_VERSION="1.7.0"
|
2010-04-07 12:22:23 +02:00
|
|
|
PKG_CHECK_MODULES([LIBNFC], [libnfc >= $LIBNFC_REQUIRED_VERSION], [], [AC_MSG_ERROR([libnfc >= $LIBNFC_REQUIRED_VERSION is mandatory.])])
|
2009-12-18 21:32:25 +01:00
|
|
|
|
2009-12-18 22:31:45 +01:00
|
|
|
PKG_CONFIG_REQUIRES="libnfc"
|
|
|
|
AC_SUBST([PKG_CONFIG_REQUIRES])
|
|
|
|
|
2011-05-11 19:29:22 +02:00
|
|
|
CUTTER_REQUIRED_VERSION=1.1.7
|
2010-04-08 14:01:14 +02:00
|
|
|
m4_ifdef([AC_CHECK_CUTTER], [AC_CHECK_CUTTER([>= $CUTTER_REQUIRED_VERSION])], [ac_cv_use_cutter="no"])
|
|
|
|
if test x$ac_cv_with_cutter = xyes -a x$ac_cv_use_cutter = xno; then
|
|
|
|
AC_MSG_ERROR([cutter >= $CUTTER_REQUIRED_VERSION is mandatory.])
|
|
|
|
fi
|
2010-01-11 21:14:30 +01:00
|
|
|
AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
|
|
|
|
|
|
|
|
m4_ifdef([AC_CHECK_COVERAGE], [AC_CHECK_COVERAGE])
|
|
|
|
|
2011-05-11 19:29:22 +02:00
|
|
|
if test x$cutter_enable_coverage = xyes; then
|
2010-01-11 21:14:30 +01:00
|
|
|
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
|
|
|
fi
|
|
|
|
|
2012-05-18 17:59:00 +02:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2010-07-29 08:11:27 +02:00
|
|
|
contrib/Makefile
|
|
|
|
contrib/libutil/Makefile
|
2010-07-26 23:48:18 +02:00
|
|
|
examples/Makefile
|
|
|
|
libfreefare/Makefile
|
|
|
|
libfreefare.pc
|
2010-11-23 19:38:10 +01:00
|
|
|
test/Makefile
|
|
|
|
test/common/Makefile])
|
2012-05-18 17:59:00 +02:00
|
|
|
AC_OUTPUT
|
2009-12-22 21:48:13 +01:00
|
|
|
|