Skip to content

Commit

Permalink
Fixed issue 1317 - git revision info used as version info for autotoo…
Browse files Browse the repository at this point in the history
…ls & DEBUG
  • Loading branch information
zdenop committed May 2, 2015
1 parent d1c749f commit d508751
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down
12 changes: 9 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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])
Expand Down Expand Up @@ -85,7 +91,7 @@ case "${host_os}" in
AM_CONDITIONAL(ADD_RT, false)
AM_CONDITIONAL(T_WIN, true)
AC_SUBST([AM_LDFLAGS], ['-Wl,-no-undefined -Wl,--as-needed'])
;;
;;
solaris*)
LIBS="-lsocket -lnsl -lrt -lxnet"
AM_CONDITIONAL(ADD_RT, true)
Expand Down

0 comments on commit d508751

Please sign in to comment.