Make distcheck OK.

Add SVN revision to libnfc version (if available).
This commit is contained in:
Romuald Conty 2009-11-20 13:43:18 +00:00
parent 877176c98f
commit 1e5658eeba
6 changed files with 17 additions and 7 deletions

View file

@ -2,7 +2,7 @@ PROJECT(libnfc C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(VERSION_MAJOR "1") SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "2") SET(VERSION_MINOR "2")
SET(VERSION_PATCH "1+svn") SET(VERSION_PATCH "1")
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

View file

@ -1,11 +1,13 @@
# SVN revison
define([svn_revision], esyscmd([sh -c "svnversion -n"]))
SVN_REVISION=svn_revision
# General init # General init
AC_INIT(libnfc, 1.2.1, info@libnfc.org) AC_INIT(libnfc, 1.2.1, info@libnfc.org)
AC_CONFIG_HEADER(config.h) 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 AM_INIT_AUTOMAKE
AC_LANG_C AC_LANG_C
@ -36,6 +38,7 @@ AC_TYPE_UINT32_T
AC_TYPE_UINT64_T AC_TYPE_UINT64_T
AC_TYPE_INT32_T AC_TYPE_INT32_T
# Debug support (default:no) # Debug support (default:no)
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debug output]),[enable_debug=$enableval],[enable_debug="no"]) AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debug output]),[enable_debug=$enableval],[enable_debug="no"])

2
debian/rules vendored
View file

@ -106,7 +106,7 @@ binary-arch: build install
dh_fixperms dh_fixperms
# dh_perl # dh_perl
# dh_python # dh_python
# dh_makeshlibs dh_makeshlibs
dh_installdeb dh_installdeb
$(DH_SHLIBDEPS) $(DH_SHLIBDEPS)
dh_gencontrol dh_gencontrol

View file

@ -39,6 +39,9 @@ int main(int argc, const char* argv[])
{ {
nfc_target_info_t nti; 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 // Try to open the NFC device
pnd = nfc_connect(NULL); pnd = nfc_connect(NULL);

View file

@ -3,7 +3,7 @@ SUBDIRS = chips buses drivers .
# set the include path found by configure # set the include path found by configure
INCLUDES= $(all_includes) 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 nfcincludedir = $(includedir)/nfc
lib_LTLIBRARIES = libnfc.la lib_LTLIBRARIES = libnfc.la

View file

@ -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) const char* nfc_version(void)
{ {
#ifdef SVN_REVISION
return PACKAGE_VERSION" (r"SVN_REVISION")";
#else
return PACKAGE_VERSION; return PACKAGE_VERSION;
#endif // SVN_REVISION
} }