AC_SUBST([WIN_FILEVERSION])
YAZ_VERSION_HEX=`echo $PACKAGE_VERSION | awk 'BEGIN { FS = "."; } { printf("%x", ($1 * 256 + $2) * 256 + $3);}'`
AC_SUBST([YAZ_VERSION_HEX])
+if test ${srcdir}/.git; then
+ VERSION_SHA1=`git show --pretty=format:%H|head -1`
+else
+ VERSION_SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
+fi
+AC_SUBST([VERSION_SHA1])
dnl
dnl ------ Makefiles
dnl
#define YAZ_FILEVERSION @WIN_FILEVERSION@
+#define YAZ_VERSION_SHA1 "@VERSION_SHA1@"
+
#define YAZ_DATE 1
YAZ_BEGIN_CDECL
-YAZ_EXPORT unsigned long yaz_version(char *version_str, char *sys_str);
+YAZ_EXPORT unsigned long yaz_version(char *version_str, char *sha1_str);
YAZ_END_CDECL
Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_initResponse);
Z_InitResponse *resp = apdu->u.initResponse;
bend_initresult *binitres;
- char *version;
char options[140];
statserv_options_block *cb = 0; /* by default no control for backend */
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.128 $");
- if (strlen(version) > 10) /* check for unexpanded CVS strings */
- version[strlen(version)-2] = '\0';
- resp->implementationVersion = odr_prepend(assoc->encode,
- assoc->init->implementation_version,
- odr_prepend(assoc->encode, &version[11],
- resp->implementationVersion));
-
if (binitres->errcode)
{
assoc->state = ASSOC_DEAD;
#include <string.h>
#include <yaz/yaz-version.h>
-unsigned long yaz_version(char *version_str, char *sys_str)
+unsigned long yaz_version(char *version_str, char *sha1_str)
{
if (version_str)
strcpy(version_str, YAZ_VERSION);
- if (sys_str)
- strcpy(sys_str, "");
+ if (sha1_str)
+ strcpy(sha1_str, YAZ_VERSION_SHA1);
return YAZ_VERSIONL;
}
/*
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
-#ifdef YAZ_DATE_STR
- " (" YAZ_DATE_STR ")"
-#endif
-#ifdef YAZ_OS
- " " YAZ_OS
+#ifdef YAZ_VERSION_SHA1
+ " " YAZ_VERSION_SHA1
#endif
;
r->userInformationField = 0;
r->implementationId = "81";
r->implementationName = "YAZ";
r->implementationVersion = YAZ_VERSION
-#ifdef YAZ_DATE_STR
- " (" YAZ_DATE_STR ")"
-#endif
-#ifdef YAZ_OS
- " " YAZ_OS
+#ifdef YAZ_VERSION_SHA1
+ " " YAZ_VERSION_SHA1
#endif
;
r->userInformationField = 0;