Merge branch 'master' into alex
This commit is contained in:
commit
90451a16b9
6 changed files with 30 additions and 9 deletions
|
@ -13,9 +13,11 @@ SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||||
# config.h
|
# config.h
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_windows.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_windows.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
||||||
|
SET(LIBNFC_SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/config" CACHE PATH "libnfc configuration directory")
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
SET(_XOPEN_SOURCE 600)
|
SET(_XOPEN_SOURCE 600)
|
||||||
|
SET(SYSCONFDIR "/etc" CACHE PATH "System configuration directory")
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_posix.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_posix.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
@ -27,10 +29,15 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/incl
|
||||||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip")
|
SET(LIBNFC_LOG ON CACHE BOOL "Enable log facility")
|
||||||
IF(LIBNFC_DEBUG_OUTPUT)
|
IF(LIBNFC_LOG)
|
||||||
ADD_DEFINITIONS(-DDEBUG -DLOG -g3)
|
ADD_DEFINITIONS(-DLOG)
|
||||||
ENDIF(LIBNFC_DEBUG_OUTPUT)
|
ENDIF(LIBNFC_LOG)
|
||||||
|
|
||||||
|
SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode")
|
||||||
|
IF(LIBNFC_DEBUG_MODE)
|
||||||
|
ADD_DEFINITIONS(-DDEBUG -g3)
|
||||||
|
ENDIF(LIBNFC_DEBUG_MODE)
|
||||||
|
|
||||||
# Doxygen
|
# Doxygen
|
||||||
SET(builddir "${CMAKE_BINARY_DIR}")
|
SET(builddir "${CMAKE_BINARY_DIR}")
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||||
#cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@
|
#cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@
|
||||||
|
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
|
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
|
||||||
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||||
|
#cmakedefine LIBNFC_SYSCONFDIR "@LIBNFC_SYSCONFDIR@"
|
||||||
|
|
|
@ -39,9 +39,10 @@ ENDIF(LIBUSB_FOUND)
|
||||||
# Library
|
# Library
|
||||||
SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal conf iso14443-subr mirror-subr target-subr log ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES} ${WINDOWS_SOURCES})
|
SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal conf iso14443-subr mirror-subr target-subr log ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES} ${WINDOWS_SOURCES})
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
IF(LIBNFC_DEBUG_OUTPUT)
|
|
||||||
|
IF(LIBNFC_LOG)
|
||||||
LIST(APPEND LIBRARY_SOURCES log-printf)
|
LIST(APPEND LIBRARY_SOURCES log-printf)
|
||||||
ENDIF(LIBNFC_DEBUG_OUTPUT)
|
ENDIF(LIBNFC_LOG)
|
||||||
ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})
|
ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})
|
||||||
|
|
||||||
IF(PCSC_FOUND)
|
IF(PCSC_FOUND)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
SUBDIRS = chips buses drivers .
|
SUBDIRS = chips buses drivers .
|
||||||
|
|
||||||
# set the include path found by configure
|
# set the include path found by configure
|
||||||
AM_CPPFLAGS = $(all_includes) $(LIBNFC_CFLAGS)
|
AM_CPPFLAGS = $(all_includes) $(LIBNFC_CFLAGS) -DSYSCONFDIR='"$(sysconfdir)"'
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
conf.h \
|
conf.h \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (C) 2012 Romuald Conty
|
* Copyright (C) 2012, 2013 Romuald Conty
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU Lesser General Public License as published by the
|
* under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -31,7 +35,14 @@
|
||||||
#define LOG_CATEGORY "libnfc.config"
|
#define LOG_CATEGORY "libnfc.config"
|
||||||
#define LOG_GROUP NFC_LOG_GROUP_CONFIG
|
#define LOG_GROUP NFC_LOG_GROUP_CONFIG
|
||||||
|
|
||||||
#define LIBNFC_SYSCONFDIR "/etc/nfc"
|
#ifndef LIBNFC_SYSCONFDIR
|
||||||
|
// If this define does not already exists, we build it using SYSCONFDIR
|
||||||
|
#ifndef SYSCONFDIR
|
||||||
|
#error "SYSCONFDIR is not defined but required."
|
||||||
|
#endif // SYSCONFDIR
|
||||||
|
#define LIBNFC_SYSCONFDIR SYSCONFDIR"/nfc"
|
||||||
|
#endif // LIBNFC_SYSCONFDIR
|
||||||
|
|
||||||
#define LIBNFC_CONFFILE LIBNFC_SYSCONFDIR"/libnfc.conf"
|
#define LIBNFC_CONFFILE LIBNFC_SYSCONFDIR"/libnfc.conf"
|
||||||
#define LIBNFC_DEVICECONFDIR LIBNFC_SYSCONFDIR"/devices.d"
|
#define LIBNFC_DEVICECONFDIR LIBNFC_SYSCONFDIR"/devices.d"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue