From d8b46c919f45666af0d541e00dcedf57e6c4b66f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 26 Feb 2013 17:10:18 +0100 Subject: Change the various version numbers to the new scheme. * configure.ac: Rename my_foo variables to mym4_foo variables to make clear that they are processed by m4. (VERSION_NUMBER): New ac_subst. (AH_BOTTOM): Add CRIGHTBLURB macro. (BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP): Change them to work similar to libgpg-error et al. * src/versioninfo.rc.in: Remove use of BUILD_NUMBER and get it in line with gpg-error et al. * src/version.c (cright_blurb): New. (gpgme_check_version_internal): Add magic to display the above information. * tests/t-version.c (main): Add option --verbose. --- src/version.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/version.c') diff --git a/src/version.c b/src/version.c index 227a1067..18825f88 100644 --- a/src/version.c +++ b/src/version.c @@ -83,6 +83,21 @@ do_subsystem_inits (void) } +/* Put vesion information into the binary. */ +static const char * +cright_blurb (void) +{ + static const char blurb[] = + "\n\n" + "This is GPGME " PACKAGE_VERSION " - The GnuPG Made Easy library\n" + CRIGHTBLURB + "\n" + "(" BUILD_REVISION " " BUILD_TIMESTAMP ")\n" + "\n\n"; + return blurb; +} + + /* Read the next number in the version string STR and return it in *NUMBER. Return a pointer to the tail of STR after parsing, or *NULL if the version string was invalid. */ @@ -208,6 +223,8 @@ gpgme_check_version_internal (const char *req_version, { const char *result; + if (req_version && req_version[0] == 1 && req_version[1] == 1) + return cright_blurb (); result = gpgme_check_version (req_version); if (result == NULL) return result; -- cgit v1.2.3