From 85a77720c678d1bb37c1445755ea2b38c658ca36 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 24 Mar 2012 19:42:26 +0100 Subject: [PATCH] sr: sigrok.h: Add version macros. --- configure.ac | 13 ++++--------- sigrok.h.in | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 31737676..d51449d7 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,10 @@ LIBSIGROK_LT_REVISION=0 LIBSIGROK_LT_AGE=0 LIBSIGROK_LT_VERSION="$LIBSIGROK_LT_CURRENT:$LIBSIGROK_LT_REVISION:$LIBSIGROK_LT_AGE" LIBSIGROK_LT_LDFLAGS="-version-info $LIBSIGROK_LT_VERSION" +AC_SUBST(LIBSIGROK_LT_CURRENT) +AC_SUBST(LIBSIGROK_LT_REVISION) +AC_SUBST(LIBSIGROK_LT_AGE) +AC_SUBST(LIBSIGROK_LT_VERSION) AC_SUBST(LIBSIGROK_LT_LDFLAGS) # Logic analyzer hardware support '--enable' options. @@ -273,15 +277,6 @@ AC_SUBST(LIBSIGROK_MINOR_VERSION) AC_SUBST(LIBSIGROK_MICRO_VERSION) AC_SUBST(LIBSIGROK_VERSION) -AC_DEFINE(LIBSIGROK_MAJOR_VERSION, [libsigrok_major_version], - [Define to the libsigrok major package version]) -AC_DEFINE(LIBSIGROK_MINOR_VERSION, [libsigrok_minor_version], - [Define to the libsigrok minor package version]) -AC_DEFINE(LIBSIGROK_MICRO_VERSION, [libsigrok_micro_version], - [Define to the libsigrok micro package version]) -AC_DEFINE(LIBSIGROK_VERSION, [libsigrok_version], - [Define to the libsigrok package version]) - AC_CONFIG_FILES([Makefile sigrok.h firmware/Makefile diff --git a/sigrok.h.in b/sigrok.h.in index 35874385..2a7d9762 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -30,6 +30,38 @@ extern "C" { #endif +/* + * Package version macros (can be used for conditional compilation). + */ + +/** The libsigrok package 'major' version number. */ +#define LIBSIGROK_MAJOR_VERSION @LIBSIGROK_MAJOR_VERSION@ + +/** The libsigrok package 'minor' version number. */ +#define LIBSIGROK_MINOR_VERSION @LIBSIGROK_MINOR_VERSION@ + +/** The libsigrok package 'micro' version number. */ +#define LIBSIGROK_MICRO_VERSION @LIBSIGROK_MICRO_VERSION@ + +/** The libsigrok package version ("major.minor.micro") as string. */ +#define LIBSIGROK_VERSION_STRING "@LIBSIGROK_VERSION@" + +/* + * Library/libtool version macros (can be used for conditional compilation). + */ + +/** The libsigrok libtool 'current' version number. */ +#define LIBSIGROK_LT_CURRENT @LIBSIGROK_LT_CURRENT@ + +/** The libsigrok libtool 'revision' version number. */ +#define LIBSIGROK_LT_REVISION @LIBSIGROK_LT_REVISION@ + +/** The libsigrok libtool 'age' version number. */ +#define LIBSIGROK_LT_AGE @LIBSIGROK_LT_AGE@ + +/** The libsigrok libtool version ("current:revision:age") as string. */ +#define LIBSIGROK_LT_VERSION_STRING "@LIBSIGROK_LT_VERSION@" + /* * Status/error codes returned by libsigrok functions. *