fixed automake/autoconf files to allow clean firmware compilation

git-svn-id: https://svn.gnumonks.org/trunk/librfid@1996 e0336214-984f-0b4b-a45f-81c69e1f0ede
This commit is contained in:
meri 2007-05-03 09:11:50 +00:00
parent 2ab18ca131
commit a91cd3d9e2
4 changed files with 14 additions and 13 deletions

View File

@ -1,15 +1,22 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
SUBDIRS = etc include src utils
SUBDIRS = etc include src
DEFAULT_AM_CFLAGS = -std=gnu99
if ENABLE_WIN32
SUBDIRS += win32
LINKOPTS = -mno-cygwin
AM_CFLAGS = $(DEFAULT_AM_CFLAGS)
AM_CFLAGS = $(DEFAULT_AM_CFLAGS) -mno-cygwin
else
LINKOPTS = -lusb
AM_CFLAGS = $(DEFAULT_AM_CFLAGS) -mno-cygwin
AM_CFLAGS = $(DEFAULT_AM_CFLAGS)
endif
if ENABLE_FIRMWARE
AM_CFLAGS += -DLIBRFID_FIRMWARE
else
SUBDIRS += utils
endif
EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch

View File

@ -52,17 +52,13 @@ AC_ARG_WITH(firmware,
[ --with-firmware=PATH Compile for running inside firmware],
[FIRMWARE_PATH="$withval"], [FIRMWARE_PATH=""])
AC_SUBST(FIRMWARE_PATH)
AM_CONDITIONAL(ENABLE_FIRMWARE, test "$FIRMWARE_PATH" != "")
AC_ARG_ENABLE(static,
[ --enable-static Don't use dynamic allocations at all],
[ENABLE_STATIC=1], [ENABLE_STATIC=0])
AM_CONDITIONAL(ENABLE_STATIC, test "$ENABLE_STATIC" == "1")
AC_ARG_ENABLE(firmware,
[ --enable-firmware Don't use dynamic allocations at all],
[ENABLE_FIRMWARE=1], [ENABLE_FIRMWARE=0])
AM_CONDITIONAL(ENABLE_FIRMWARE, test "$ENABLE_FIRMWARE" == "1")
AC_ARG_WITH()
AC_CHECK_LIB(usb, usb_close,,)

View File

@ -1,7 +1,7 @@
LIBVERSION= 0:0:0
if ENABLE_FIRMWARE
INCLUDES_FIRMWARE = -I$(FIRMWARE_PATH)/include -I$(GNUARM_PATH)/arm-elf/include
INCLUDES_FIRMWARE = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include
AM_CFLAGS_FIRMWARE = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__
endif

View File

@ -25,14 +25,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//#define DEBUG
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <librfid/rfid.h>
#include <librfid/rfid_reader.h>
#include <librfid/rfid_asic.h>
@ -53,7 +50,6 @@ static char rcv_buf[RECVBUF_LEN];
static struct openpcd_hdr *snd_hdr;
static struct openpcd_hdr *rcv_hdr;
#ifndef LIBRFID_FIRMWARE
#ifdef __MINGW32__
@ -532,10 +528,12 @@ const struct rfid_reader rfid_reader_openpcd = {
.open = &openpcd_open,
.close = &openpcd_close,
#ifndef LIBRFID_FIRMWARE
.get_api_version = &openpcd_get_api_version,
.get_environment = &openpcd_get_environment,
.set_environment = &openpcd_set_environment,
.reset = &openpcd_reset,
#endif
.transceive = &openpcd_transceive,
.l2_supported = (1 << RFID_LAYER2_ISO14443A) |