3 # Script to generate svn_revision.c
9 SCRIPT_DIR=`dirname $0`
10 SRC_DIR=`dirname $SCRIPT_DIR`
12 C_FILE="$CUR_DIR/svn_revision.c"
13 H_FILE="$CUR_DIR/svn_revision.h"
15 # determine if this code base came from subversion.
16 if test -d $SRC_DIR/.svn ; then
17 echo "have subversion repository"
18 SVNVERSION=`which svnversion`
19 if test -x $SVNVERSION ; then
20 echo "have svnversion at $SVNVERSION"
21 BUILD=`svnversion -n .`
22 echo "This code base svn-revision: $BUILD"
23 CAN_BUILD_SVN_REVISION="yes"
26 if test -d $SRC_DIR/../.git ; then
27 echo "have Git repository."
28 BUILD=`/usr/bin/git log -1 --pretty=%h . `
29 echo "This code base git-revision: $BUILD"
30 CAN_BUILD_SVN_REVISION="yes"
32 if test -f $C_FILE; then
38 if [ "$CAN_BUILD_SVN_REVISION" = "yes" ] ; then
42 * Subversion / GIT revision functions
44 * Autogenerated at make/release time
46 * Do not modify this file
50 const char *svn_revision (void)
52 const char *SVN_Version = "$BUILD";
57 elif test ! -f $C_FILE ; then
61 * Subversion / GIT revision functions
63 * Autogenerated at make time
65 * There should have been one with your source distribution
67 * Do not modify this file
71 const char *svn_revision (void)
73 const char *SVN_Version = "(unknown)";