mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make GnuCash compile from a git repository.
Patch gnc-svnversion to check for .git, but in the top-level source directory instead of src/gnome-utils. Use the output of "git-rev-parse HEAD" as version string. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15292 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -220,7 +220,7 @@ _gnc-version.h: gnc-svninfo.h Makefile
|
|||||||
@echo "#ifndef GNC_VERSION_H" >> _gnc-version.h
|
@echo "#ifndef GNC_VERSION_H" >> _gnc-version.h
|
||||||
@echo "#define GNC_VERSION_H" >> _gnc-version.h
|
@echo "#define GNC_VERSION_H" >> _gnc-version.h
|
||||||
@echo "" >> _gnc-version.h
|
@echo "" >> _gnc-version.h
|
||||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${srcdir}` ; \
|
@svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \
|
||||||
if [ $$? = 0 ] ; then \
|
if [ $$? = 0 ] ; then \
|
||||||
echo "#define GNUCASH_SVN 1" >> _gnc-version.h ; \
|
echo "#define GNUCASH_SVN 1" >> _gnc-version.h ; \
|
||||||
fi
|
fi
|
||||||
@@ -234,11 +234,11 @@ gnc-svninfo.h: _gnc-svninfo.h
|
|||||||
-rm -f _gnc-svninfo.h
|
-rm -f _gnc-svninfo.h
|
||||||
|
|
||||||
_gnc-svninfo.h: Makefile
|
_gnc-svninfo.h: Makefile
|
||||||
@svninfo=`${top_srcdir}/util/gnc-svnversion ${srcdir}` ; \
|
@svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \
|
||||||
if [ $$? = 0 ] ; then \
|
if [ $$? = 0 ] ; then \
|
||||||
if [ -z "$$svninfo" ] ; then \
|
if [ -z "$$svninfo" ] ; then \
|
||||||
echo "gnc-svnversion failed. figure out why." ; \
|
echo "gnc-svnversion failed. figure out why." ; \
|
||||||
echo "can't determine svn revision from ${srcdir}." ; \
|
echo "can't determine svn revision from ${top_srcdir}." ; \
|
||||||
exit 1 ; \
|
exit 1 ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
echo "/* Autogenerated. Do not change. */" > _gnc-svninfo.h ; \
|
echo "/* Autogenerated. Do not change. */" > _gnc-svninfo.h ; \
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# gnc-svnversion <srcdir>
|
# gnc-svnversion <srcdir>
|
||||||
#
|
#
|
||||||
# Prints the revision number to stdout and exits 0 on success
|
# Prints the revision number to stdout and exits 0 on success
|
||||||
# exits with errorcode 1 if we're not in an svn or svk checkout
|
# exits with errorcode 1 if we're not in an svn, svk or git checkout
|
||||||
#
|
#
|
||||||
# Written By: Derek Atkins <derek@ihtfp.com>
|
# Written By: Derek Atkins <derek@ihtfp.com>
|
||||||
#
|
#
|
||||||
@@ -40,8 +40,21 @@ then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we get here then this is NOT an svn checkout. Maybe it's
|
# If we get here then this is NOT an svn checkout.
|
||||||
# SVK? First, check if we've got 'svk' in the path. If not,
|
|
||||||
|
# Maybe it's git?
|
||||||
|
if test -d "${real_srcdir}"/.git
|
||||||
|
then
|
||||||
|
githead=`git --git-dir "${real_srcdir}"/.git rev-parse HEAD 2>/dev/null`
|
||||||
|
if test $? = 0 ; then
|
||||||
|
echo $githead
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Maybe it's SVK? First, check if we've got 'svk' in the path. If not,
|
||||||
# then exit with an error code of 1..
|
# then exit with an error code of 1..
|
||||||
which svk >/dev/null 2>&1
|
which svk >/dev/null 2>&1
|
||||||
if test $? != 0 ; then exit 1 ; fi
|
if test $? != 0 ; then exit 1 ; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user