2009-11-04 14:55:24 +00:00
|
|
|
# General init
|
2010-08-24 09:25:53 +00:00
|
|
|
|
2011-03-01 11:34:07 +00:00
|
|
|
# /!\ Don't forget to update 'CMakeLists.txt' too /!\
|
2012-12-23 20:04:34 +01:00
|
|
|
AC_INIT([libnfc],[1.7.0-rc1],[info@libnfc.org])
|
2009-05-04 08:00:08 +00:00
|
|
|
|
2009-12-20 19:14:41 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
2009-05-04 08:00:08 +00:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
2009-11-20 13:43:18 +00:00
|
|
|
|
2012-11-24 20:11:12 +01:00
|
|
|
# GIT revison
|
|
|
|
define([git_revision], esyscmd([sh -c "git describe"]))
|
|
|
|
GIT_REVISION=git_revision
|
|
|
|
AC_DEFINE_UNQUOTED([GIT_REVISION], ["$GIT_REVISION"], [GIT revision])
|
2009-11-20 13:43:18 +00:00
|
|
|
|
2009-05-04 08:00:08 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
2012-06-28 23:11:02 +00:00
|
|
|
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
2009-05-04 08:00:08 +00:00
|
|
|
|
2009-12-16 23:16:21 +00:00
|
|
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
|
|
|
|
2012-05-18 07:30:39 +00:00
|
|
|
AC_LANG([C])
|
2009-05-04 08:00:08 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
2009-08-26 08:54:39 +00:00
|
|
|
|
2010-11-17 08:29:41 +00:00
|
|
|
WITH_POSIX_ONLY_EXAMPLES=1
|
2009-08-26 08:54:39 +00:00
|
|
|
# Libtool
|
2012-05-18 07:30:39 +00:00
|
|
|
LT_INIT
|
2009-08-26 08:54:39 +00:00
|
|
|
case "$host" in
|
2010-11-17 08:29:41 +00:00
|
|
|
*-pc-linux-gnu)
|
|
|
|
AC_MSG_RESULT([Fixing libtool for -rpath problems.])
|
|
|
|
sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' libtool
|
|
|
|
;;
|
|
|
|
*-pc-mingw32msvc)
|
|
|
|
WITH_POSIX_ONLY_EXAMPLES=0
|
|
|
|
AC_MSG_RESULT([Disable extended examples due to target Windows system.])
|
|
|
|
# Undefine __STRICT_ANSI__ to allow to use strdup, putenv, etc. without warnings
|
|
|
|
CFLAGS="$CFLAGS -U__STRICT_ANSI__"
|
2009-08-26 08:54:39 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-11-17 08:29:41 +00:00
|
|
|
AM_CONDITIONAL(POSIX_ONLY_EXAMPLES_ENABLED, [test "$WITH_POSIX_ONLY_EXAMPLES" = "1"])
|
2009-08-26 08:54:39 +00:00
|
|
|
|
2010-11-05 11:36:20 +00:00
|
|
|
AC_PATH_PROG(PKG_CONFIG, pkg-config)
|
|
|
|
if test x"$PKG_CONFIG" = x""; then
|
|
|
|
AC_MSG_ERROR([pkg-config not found.])
|
|
|
|
fi
|
2009-05-04 08:00:08 +00:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2009-05-27 14:05:07 +00:00
|
|
|
AC_HEADER_STDBOOL
|
2010-09-07 09:01:59 +00:00
|
|
|
AC_CHECK_HEADERS([fcntl.h limits.h stdio.h stdlib.h stdint.h stddef.h stdbool.h sys/ioctl.h sys/param.h sys/time.h termios.h])
|
2010-10-22 14:29:44 +00:00
|
|
|
AC_CHECK_FUNCS([memmove memset select strdup strerror strstr strtol usleep],
|
2010-09-07 09:01:59 +00:00
|
|
|
[AC_DEFINE([_XOPEN_SOURCE], [600], [Enable POSIX extensions if present])])
|
2010-02-17 14:12:38 +00:00
|
|
|
|
2010-02-10 13:46:12 +00:00
|
|
|
AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
|
2010-02-17 14:12:38 +00:00
|
|
|
AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features])
|
2009-05-04 08:00:08 +00:00
|
|
|
|
2011-06-27 16:31:10 +00:00
|
|
|
# Note: malloc function should be tested but it produces some error while cross-compiling with MinGW
|
2010-11-17 08:29:41 +00:00
|
|
|
# AC_FUNC_MALLOC
|
2010-09-07 09:01:59 +00:00
|
|
|
|
2009-05-27 14:05:07 +00:00
|
|
|
# Checks for types
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
2011-10-17 12:32:16 +00:00
|
|
|
AC_TYPE_INT16_T
|
2009-05-27 14:05:07 +00:00
|
|
|
AC_TYPE_INT32_T
|
2011-03-08 14:36:13 +00:00
|
|
|
AC_TYPE_OFF_T
|
2009-05-04 08:00:08 +00:00
|
|
|
|
2010-04-07 14:37:19 +00:00
|
|
|
LIBNFC_CFLAGS='-I$(top_srcdir)/libnfc -I$(top_builddir)/include -I$(top_srcdir)/include'
|
2009-12-01 14:23:00 +00:00
|
|
|
AC_SUBST(LIBNFC_CFLAGS)
|
2009-11-20 13:43:18 +00:00
|
|
|
|
2012-11-26 21:02:03 +01:00
|
|
|
# Log support (default:yes)
|
|
|
|
AC_ARG_ENABLE([log],AS_HELP_STRING([--disable-log],[Disable any logs]),[enable_log=$enableval],[enable_log="yes"])
|
|
|
|
AC_MSG_CHECKING(for log flag)
|
|
|
|
AC_MSG_RESULT($enable_log)
|
|
|
|
AM_CONDITIONAL([WITH_LOG], [test "$enable_log" != "no"])
|
2009-05-27 14:05:07 +00:00
|
|
|
|
2012-11-26 21:02:03 +01:00
|
|
|
if test x"$enable_log" = "xyes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([LOG], [1], [Enable log])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Debug support (default:no)
|
|
|
|
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debug mode]),[enable_debug=$enableval],[enable_debug="no"])
|
2009-05-27 14:05:07 +00:00
|
|
|
AC_MSG_CHECKING(for debug flag)
|
|
|
|
AC_MSG_RESULT($enable_debug)
|
2011-05-11 17:38:11 +00:00
|
|
|
AM_CONDITIONAL([WITH_DEBUG], [test "$enable_debug" != "no"])
|
2009-05-27 14:05:07 +00:00
|
|
|
|
2009-06-11 08:30:49 +00:00
|
|
|
if test x"$enable_debug" = "xyes"
|
2009-05-27 14:05:07 +00:00
|
|
|
then
|
2012-11-26 21:02:03 +01:00
|
|
|
AC_DEFINE([DEBUG], [1], [Enable debug flag])
|
|
|
|
CFLAGS="$CFLAGS -g -O0 -ggdb"
|
2009-05-27 14:05:07 +00:00
|
|
|
fi
|
|
|
|
|
2010-04-15 14:41:13 +00:00
|
|
|
# Handle --with-drivers option
|
|
|
|
LIBNFC_ARG_WITH_DRIVERS
|
|
|
|
|
2009-10-13 12:43:52 +00:00
|
|
|
# Documentation (default: no)
|
|
|
|
AC_ARG_ENABLE([doc],AS_HELP_STRING([--enable-doc],[Enable documentation generation.]),[enable_doc=$enableval],[enable_doc="no"])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for documentation request)
|
|
|
|
AC_MSG_RESULT($enable_doc)
|
|
|
|
|
|
|
|
if test x"$enable_doc" = "xyes"
|
|
|
|
then
|
|
|
|
AC_PATH_PROG([DOXYGEN], [doxygen])
|
|
|
|
if test x$DOXYGEN = x
|
|
|
|
then
|
|
|
|
AC_MSG_ERROR([doxygen is mandatory.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
|
|
|
|
|
2009-09-10 13:18:51 +00:00
|
|
|
# Dependencies
|
|
|
|
PKG_CONFIG_REQUIRES=""
|
2010-01-28 13:56:04 +00:00
|
|
|
|
2010-04-15 14:41:13 +00:00
|
|
|
LIBNFC_CHECK_LIBUSB
|
|
|
|
LIBNFC_CHECK_PCSC
|
2009-05-04 08:00:08 +00:00
|
|
|
|
2009-09-10 13:18:51 +00:00
|
|
|
AC_SUBST(PKG_CONFIG_REQUIRES)
|
|
|
|
|
2010-04-15 14:41:13 +00:00
|
|
|
AM_CONDITIONAL(LIBUSB_ENABLED, [test "$HAVE_LIBUSB" = "1"])
|
|
|
|
AM_CONDITIONAL(PCSC_ENABLED, [test "$HAVE_PCSC" = "1"])
|
|
|
|
|
2011-09-12 14:33:26 +00:00
|
|
|
CUTTER_REQUIRED_VERSION=1.1.8
|
2010-08-11 16:36:35 +00: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
|
|
|
|
AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
|
|
|
|
|
2010-10-04 10:24:45 +00:00
|
|
|
AC_CHECK_READLINE
|
2010-08-11 16:36:35 +00:00
|
|
|
|
2011-02-28 09:45:09 +00:00
|
|
|
# Help us to write great code ;-)
|
|
|
|
CFLAGS="$CFLAGS -Wall -pedantic -Wextra"
|
|
|
|
|
2010-01-12 17:58:13 +00:00
|
|
|
# Defines and C flags
|
|
|
|
CFLAGS="$CFLAGS -std=c99"
|
2009-11-24 12:55:34 +00:00
|
|
|
|
2012-01-26 15:23:11 +00:00
|
|
|
# Workarounds for libusb in c99
|
|
|
|
CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t"
|
|
|
|
|
2009-05-04 08:00:08 +00:00
|
|
|
AC_CONFIG_FILES([
|
2011-01-07 16:15:18 +00:00
|
|
|
Doxyfile
|
2009-05-04 08:00:08 +00:00
|
|
|
Makefile
|
2011-09-30 11:33:31 +00:00
|
|
|
cmake/Makefile
|
|
|
|
cmake/modules/Makefile
|
2011-02-03 09:51:38 +00:00
|
|
|
contrib/Makefile
|
2011-12-09 16:13:32 +00:00
|
|
|
contrib/devd/Makefile
|
2012-12-02 18:49:51 +01:00
|
|
|
contrib/libnfc/Makefile
|
2012-12-01 17:24:42 +01:00
|
|
|
contrib/linux/Makefile
|
2011-12-09 16:13:32 +00:00
|
|
|
contrib/udev/Makefile
|
2011-02-03 09:51:38 +00:00
|
|
|
contrib/win32/Makefile
|
2011-04-02 21:16:31 +00:00
|
|
|
contrib/win32/sys/Makefile
|
2011-01-07 16:15:18 +00:00
|
|
|
examples/Makefile
|
2011-01-17 13:31:04 +00:00
|
|
|
examples/pn53x-tamashell-scripts/Makefile
|
2010-04-07 14:37:19 +00:00
|
|
|
include/Makefile
|
|
|
|
include/nfc/Makefile
|
2011-01-07 16:15:18 +00:00
|
|
|
libnfc.pc
|
|
|
|
libnfc/Makefile
|
2010-04-07 14:37:19 +00:00
|
|
|
libnfc/buses/Makefile
|
2011-01-07 16:15:18 +00:00
|
|
|
libnfc/chips/Makefile
|
2010-04-07 14:37:19 +00:00
|
|
|
libnfc/drivers/Makefile
|
2010-08-11 16:36:35 +00:00
|
|
|
test/Makefile
|
2011-09-30 11:33:31 +00:00
|
|
|
utils/Makefile
|
2009-05-04 08:00:08 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
2010-07-31 13:21:56 +00:00
|
|
|
|
|
|
|
LIBNFC_DRIVERS_SUMMARY
|