From 8101619fdc5c3b0faff5d49f0e07c3a38ef63fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 3 Aug 2010 13:48:47 +0000 Subject: [PATCH] added version info, refs #4 --- configure.in | 2 ++ doc/examples/cryptoki-demo.cxx | 1 + doc/examples/makefile.am | 16 ++++++++++------ doc/examples/openssl-ssl-demo.cxx | 1 + doc/examples/openssl-tcp-demo.cxx | 1 + doc/examples/pcsc-demo.cxx | 1 + install-64-and-32-bit-linux.sh | 2 +- src/cryptoki.hxx | 4 ++++ src/makefile.am | 5 ++++- src/openssl.hxx | 5 ++++- src/pcsc.hxx | 5 +++++ src/version.cxx | 16 ++++++++++++++++ 12 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 src/version.cxx diff --git a/configure.in b/configure.in index 5475751..e16eceb 100644 --- a/configure.in +++ b/configure.in @@ -47,6 +47,8 @@ AC_SUBST_FILE(README) CHANGE_LOG=ChangeLog AC_SUBST_FILE(CHANGE_LOG) +AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'" + # Get rid of that stupid -O2 -g opions! CXXFLAGS="${CXXFLAGS:-}" diff --git a/doc/examples/cryptoki-demo.cxx b/doc/examples/cryptoki-demo.cxx index 241f084..15e65ff 100644 --- a/doc/examples/cryptoki-demo.cxx +++ b/doc/examples/cryptoki-demo.cxx @@ -14,6 +14,7 @@ int main(int argc, char const*const*const argv) try { // print(v); cryptoki::Init init(argc==2?argv[1]:"onepin-opensc-pkcs11.so"); cryptoki::Info inf(init.info()); + std::cout<<"Library-Version: "<1?argv[1]:"dev.swisssign.com"); std::string port(argc>2?argv[2]:"443"); std::string path(argc>3?argv[3]:"/"); + std::cout<<"Library-Version: "<1?argv[1]:"swisssign.com"); std::string port(argc>2?argv[2]:"80"); + std::cout<<"Library-Version: "< #include +namespace pcsc { + std::string version(); +} + #ifndef OPENSSL_LOG #include #if __GNUC__ >= 2 @@ -51,7 +55,6 @@ //! @see gopenssl namespace openssl { - //============================================================================ //! @addtogroup opensslexceptions //@{ diff --git a/src/pcsc.hxx b/src/pcsc.hxx index 9108caf..d8362d9 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -41,6 +41,7 @@ #define MAX_ATR_SIZE 33 #endif namespace pcsc { + #ifdef UNICODE inline std::wstring strconv(std::string s) { return std::wstring(s.begin(), s.end()); @@ -76,6 +77,10 @@ #include #include +namespace pcsc { + std::string version(); +} + #include #include diff --git a/src/version.cxx b/src/version.cxx new file mode 100644 index 0000000..ddcd7ce --- /dev/null +++ b/src/version.cxx @@ -0,0 +1,16 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#include + +namespace pcsc { + std::string version() { + return PACKAGENAME "-" PACKAGEVERSION; + } + const std::string IDENT("$Id: " PACKAGENAME "-" PACKAGEVERSION " $"); + const std::string WHAT("#(@)" PACKAGENAME "-" PACKAGEVERSION); +}