Fixed issue 1317 - git revision info used as version info for autotools & DEBUG

This commit is contained in:
Zdenko Podobný 2015-05-02 12:15:13 +02:00
parent d1c749f6ad
commit d508751e58
2 changed files with 13 additions and 3 deletions

View File

@ -138,7 +138,11 @@ TessBaseAPI::~TessBaseAPI() {
* Returns the version identifier as a static string. Do not delete.
*/
const char* TessBaseAPI::Version() {
#if defined(DEBUG) && defined(GIT_REV)
return GIT_REV;
#else
return TESSERACT_VERSION_STR;
#endif
}
/**

View File

@ -5,12 +5,10 @@
# ----------------------------------------
# Initialization
# ----------------------------------------
AC_PREREQ(2.50)
AC_INIT([tesseract], [3.04], [http://code.google.com/p/tesseract-ocr/issues/list])
CXXFLAGS=${CXXFLAGS:-""}
AC_CONFIG_MACRO_DIR([m4])
AC_REVISION([$Revision$])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(api/tesseractmain.cpp)
AC_PREFIX_DEFAULT(/usr/local)
@ -21,6 +19,14 @@ AC_PREFIX_DEFAULT(/usr/local)
PACKAGE_YEAR=2014
PACKAGE_DATE="08/13"
abs_top_srcdir=`AS_DIRNAME([$0])`
gitrev="`git --git-dir=${abs_top_srcdir}/.git --work-tree=${abs_top_srcdir} describe --always --tags`"
if test -n "${gitrev}" ; then
AC_REVISION("${gitrev}")
AC_DEFINE_UNQUOTED(GIT_REV,"${gitrev}", [Define to be the git revision])
echo "Using git revision: ${gitrev}"
fi
AC_DEFINE_UNQUOTED(PACKAGE_NAME,["${PACKAGE_NAME}"],[Name of package])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION,["${PACKAGE_VERSION}"],[Version number])
AC_DEFINE_UNQUOTED(PACKAGE_YEAR,"$PACKAGE_YEAR",[Official year for this release])