7 # Invoke ./config.local, if it exists
9 AC_DEFUN([AMANDA_CONFIG_LOCAL],
11 if test -f config.local; then
12 echo "running local script ./config.local"
23 # If the build is in a Subversion working copy, and if an svn client
24 # is available, then update common-src/svn-info.h to reflect the current
25 # revision and branch.
27 # If these things are not available, then the file is not updated, and
28 # any previous contents are used. If the file does not exist, it is
31 AC_DEFUN([AMANDA_GET_SVN_INFO],
33 AC_REQUIRE([AMANDA_INIT_PROGS])
34 AC_REQUIRE([AMANDA_PROG_GREP])
36 AC_PATH_PROG(SVN, svn,, $LOCSYSPATH)
37 AC_MSG_CHECKING([Subversion revision information])
38 if test -d $srcdir/.svn -a -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then
39 SVN_REV=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-`
40 SVN_URL=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
41 SVN_PATH=`$GREP URL: conftemp.svn|cut -d "/" -f 7-`
42 SVN_TYPE=`echo ${SVN_PATH} |cut -d "/" -f 1`
43 SVN_BRANCH=`echo "${SVN_PATH}"| cut -d "/" -f 2`
44 url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
45 ( echo '#define BUILT_REV "'$SVN_REV'"'
46 echo '#define BUILT_BRANCH "'$SVN_BRANCH'"'
47 ) > common-src/svn-info.h
49 AC_MSG_RESULT([updated])
51 # Makefiles will be upset if the file doesn't exist, so double-check
52 if test -f common-src/svn-info.h; then
54 AC_MSG_RESULT([not changed])
56 echo '/* no information available */' > common-src/svn-info.h
57 AC_MSG_RESULT([not available])
70 # If the build is in a git working copy, and if an git client
71 # is available, then set GIT_SHA1
73 AC_DEFUN([AMANDA_GET_GIT_INFO],
75 AC_REQUIRE([AMANDA_INIT_PROGS])
76 AC_REQUIRE([AMANDA_PROG_GREP])
78 AC_PATH_PROG(GIT, git,, $LOCSYSPATH)
79 AC_MSG_CHECKING([git revision information])
80 if test -d $srcdir/.git -a -n "$GIT"; then
81 GIT_SHA1=`(cd $srcdir > /dev/null ; $GIT rev-parse HEAD | cut -c -8 )`
82 if test -n "$GIT_SHA1"; then
83 AC_MSG_RESULT([$GIT_SHA1])
85 AC_MSG_RESULT(['git rev-parse HEAD' failed])
88 AC_MSG_RESULT([not available])