Fix autotools on FreeBSD.
Endianness fun is not provided by the same header file on GNU/Linux (endian.h) and FreeBSD (sys/endian.h). Add some magic for the autotools to detect the correct header file. While here, add AC_C_INLINE: it's reported as missing by autoscan(1).
This commit is contained in:
parent
58d83ae20a
commit
4bf33cc707
4 changed files with 22 additions and 2 deletions
|
@ -7,11 +7,14 @@ AC_PROG_CXX
|
||||||
|
|
||||||
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
||||||
|
|
||||||
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
|
||||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
AC_C_INLINE
|
||||||
AC_HEADER_STDBOOL
|
AC_HEADER_STDBOOL
|
||||||
AC_TYPE_INT16_T
|
AC_TYPE_INT16_T
|
||||||
AC_TYPE_INT32_T
|
AC_TYPE_INT32_T
|
||||||
|
@ -25,6 +28,11 @@ AC_FUNC_MALLOC
|
||||||
AC_FUNC_REALLOC
|
AC_FUNC_REALLOC
|
||||||
AC_CHECK_FUNCS([memset])
|
AC_CHECK_FUNCS([memset])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([endian.h sys/endian.h])
|
||||||
|
if test $ac_cv_header_endian_h = "no" -a $ac_cv_header_sys_endian_h = "no"; then
|
||||||
|
AC_MSG_ERROR([Can't locate header endian.h.]);
|
||||||
|
fi
|
||||||
|
|
||||||
# Checks for pkg-config modules.
|
# Checks for pkg-config modules.
|
||||||
PKG_CHECK_MODULES([LIBNFC], [libnfc], [], [AC_MSG_ERROR([libnfc is mandatory.])])
|
PKG_CHECK_MODULES([LIBNFC], [libnfc], [], [AC_MSG_ERROR([libnfc is mandatory.])])
|
||||||
|
|
||||||
|
@ -32,3 +40,4 @@ PKG_CONFIG_REQUIRES="libnfc"
|
||||||
AC_SUBST([PKG_CONFIG_REQUIRES])
|
AC_SUBST([PKG_CONFIG_REQUIRES])
|
||||||
|
|
||||||
AC_OUTPUT([Makefile libfreefare.pc])
|
AC_OUTPUT([Makefile libfreefare.pc])
|
||||||
|
|
||||||
|
|
1
mad.c
1
mad.c
|
@ -25,6 +25,7 @@
|
||||||
* MIFARE Application Directory (MAD)
|
* MIFARE Application Directory (MAD)
|
||||||
* Rev. 04 - 5 March 2009
|
* Rev. 04 - 5 March 2009
|
||||||
*/
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
*
|
*
|
||||||
* /dev/brain
|
* /dev/brain
|
||||||
*/
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <mifare_application.h>
|
#include <mifare_application.h>
|
||||||
|
|
|
@ -29,8 +29,16 @@
|
||||||
* October 6, 2008
|
* October 6, 2008
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _BSD_SOURCE
|
#include "config.h"
|
||||||
#include <endian.h>
|
|
||||||
|
#if defined(HAVE_SYS_ENDIAN_H)
|
||||||
|
# include <sys/endian.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_ENDIAN_H)
|
||||||
|
# define _BSD_SOURCE
|
||||||
|
# include <endian.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
Loading…
Reference in a new issue