|
|
|
@ -29,15 +29,23 @@ AC_REVISION($Revision$)
|
|
|
|
|
|
|
|
|
|
# Get SVN Revision - idea from xfce-power-manager (C) 2007 by B.Tarricone
|
|
|
|
|
dnl get svn revision
|
|
|
|
|
AC_MSG_CHECKING([code revision])
|
|
|
|
|
SVN=`which svn`
|
|
|
|
|
SVN_REVISION=0
|
|
|
|
|
if test -n "$SVN" -a -x "$SVN"; then
|
|
|
|
|
SVN_REVISION=`LC_ALL=C svn info | awk '/^Revision: / {printf "%d\n", $2}'`
|
|
|
|
|
SVN_REVISION=`LC_ALL=C svn info -R | awk 'BEGIN { x=0 } /^Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }'`
|
|
|
|
|
if test "$SVN_REVISION" -ne "0" ; then
|
|
|
|
|
AC_MSG_RESULT([from svn info: $SVN_REVISION])
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if test -z "$SVN_REVISION" -a -e "ChangeLog"; then
|
|
|
|
|
SVN_REVISION=`cat ChangeLog | awk '/Revision: / {printf "%d\n", $2}'`
|
|
|
|
|
if test "$SVN_REVISION" -eq 0 -a -e "ChangeLog"; then
|
|
|
|
|
SVN_REVISION=`awk 'BEGIN { x=0 } /Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }' ChangeLog`
|
|
|
|
|
if test "$SVN_REVISION" -ne "0" ; then
|
|
|
|
|
AC_MSG_RESULT([from ChangeLog: $SVN_REVISION])
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if test -z "$SVN_REVISION" ; then
|
|
|
|
|
SVN_REVISION=0
|
|
|
|
|
if test "$SVN_REVISION" -eq "0" ; then
|
|
|
|
|
AC_MSG_RESULT([unknown, using 0])
|
|
|
|
|
fi
|
|
|
|
|
AC_DEFINE_UNQUOTED([SVN_REVISION], "$SVN_REVISION", [subversion revision number])
|
|
|
|
|
AC_SUBST([SVN_REVISION])
|
|
|
|
|