From 1e5658eeba4dc8bd8bd36e50a031b5c0979a35ed Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 20 Nov 2009 13:43:18 +0000 Subject: [PATCH] Make distcheck OK. Add SVN revision to libnfc version (if available). --- CMakeLists.txt | 2 +- configure.ac | 11 +++++++---- debian/rules | 2 +- src/examples/nfc-list.c | 3 +++ src/lib/Makefile.am | 2 +- src/lib/nfc.c | 4 ++++ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6fb643..326aaab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT(libnfc C) CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "2") -SET(VERSION_PATCH "1+svn") +SET(VERSION_PATCH "1") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff --git a/configure.ac b/configure.ac index 7dd3326..d67224f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,13 @@ -# SVN revison -define([svn_revision], esyscmd([sh -c "svnversion -n"])) -SVN_REVISION=svn_revision - # General init AC_INIT(libnfc, 1.2.1, info@libnfc.org) AC_CONFIG_HEADER(config.h) + +# SVN revison +define([svn_revision], esyscmd([sh -c "svnversion -n"])) +SVN_REVISION=svn_revision +AC_DEFINE_UNQUOTED([SVN_REVISION], ["$SVN_REVISION"], [SVN revision]) + AM_INIT_AUTOMAKE AC_LANG_C @@ -36,6 +38,7 @@ AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_INT32_T + # Debug support (default:no) AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debug output]),[enable_debug=$enableval],[enable_debug="no"]) diff --git a/debian/rules b/debian/rules index 52b9b37..5728314 100755 --- a/debian/rules +++ b/debian/rules @@ -106,7 +106,7 @@ binary-arch: build install dh_fixperms # dh_perl # dh_python -# dh_makeshlibs + dh_makeshlibs dh_installdeb $(DH_SHLIBDEPS) dh_gencontrol diff --git a/src/examples/nfc-list.c b/src/examples/nfc-list.c index 137aed7..2e80fd3 100644 --- a/src/examples/nfc-list.c +++ b/src/examples/nfc-list.c @@ -39,6 +39,9 @@ int main(int argc, const char* argv[]) { nfc_target_info_t nti; + const char* acLibnfcVersion = nfc_version(); + printf("%s use libnfc %s\n", argv[0], acLibnfcVersion); + // Try to open the NFC device pnd = nfc_connect(NULL); diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f031c1b..373f599 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = chips buses drivers . # set the include path found by configure INCLUDES= $(all_includes) -nfcinclude_HEADERS = nfc.h nfc-types.h buses.h drivers.h nfc-messages.h bitutils.h +nfcinclude_HEADERS = nfc.h nfc-types.h nfc-messages.h chips.h buses.h drivers.h bitutils.h nfcincludedir = $(includedir)/nfc lib_LTLIBRARIES = libnfc.la diff --git a/src/lib/nfc.c b/src/lib/nfc.c index 964a0b4..793582d 100644 --- a/src/lib/nfc.c +++ b/src/lib/nfc.c @@ -785,7 +785,11 @@ bool nfc_target_send_dep_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, con const char* nfc_version(void) { +#ifdef SVN_REVISION + return PACKAGE_VERSION" (r"SVN_REVISION")"; +#else return PACKAGE_VERSION; +#endif // SVN_REVISION }