dnl NB: the next line gets changed to a date/time string for development releases
m4_define(graphviz_version_micro, 0)
m4_define(graphviz_version_date, $GRAPHVIZ_VERSION_DATE)
-m4_define(graphviz_collection, stable)
+m4_define(graphviz_collection, test)
+m4_define(graphviz_version_commit, unknown)
EOF
autoreconf -v --install --force || exit 1
git log -1 --date raw |
while read a b c; do
case "$a" in
- commit) COMMIT=$b;;
+ commit) VERSION_COMMIT=$b;;
Date:) EPOCHSEC=$b; TZ=$c; break;;
*) continue;;
esac
VERSION_MINOR=`grep 'm4_define(graphviz_version_minor' version.m4 | sed 's/.*, \([0-9]*\))/\1/'`
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_DATE
+if test $(( $VERSION_MINOR % 2 )) -eq 0; then
+ VERSION_COLLECTION="stable"
+else
+ VERSION_COLLECTION="development"
+fi
+
sed "s/\(m4_define(graphviz_version_micro, \).*)/\1$VERSION_DATE)/" <version.m4 >t$$
mv t$$ version.m4
-sed "s/\(m4_define(graphviz_collection, \).*)/\1development)/" <version.m4 >t$$
+sed "s/\(m4_define(graphviz_collection, \).*)/\1$VERSION_COLLECTION)/" <version.m4 >t$$
mv t$$ version.m4
sed "s/\(m4_define(graphviz_version_date, \).*)/\1$VERSION_DATE)/" <version.m4 >t$$
mv t$$ version.m4
-
-exit
+sed "s/\(m4_define(graphviz_version_commit, \).*)/\1$VERSION_COMMIT)/" <version.m4 >t$$
+mv t$$ version.m4
./configure >/dev/null
# graphviz_version_micro
# graphviz_collection
# graphviz_version_date
+# graphviz_version_commit
m4_include(./version.m4)
AC_INIT([graphviz],[graphviz_version_major.graphviz_version_minor.graphviz_version_micro],[http://www.graphviz.org/])
#NB: date/time of last commit - or "now"
GRAPHVIZ_VERSION_DATE=graphviz_version_date()
+#NB: git commit hash of last commit
+GRAPHVIZ_VERSION_COMMIT=graphviz_version_commit()
+
GRAPHVIZ_SOURCES=graphviz/$GRAPHVIZ_COLLECTION/SOURCES
AC_SUBST([GRAPHVIZ_VERSION_MAJOR])
AC_SUBST([GRAPHVIZ_VERSION_MINOR])
AC_SUBST([GRAPHVIZ_VERSION_MICRO])
AC_SUBST([GRAPHVIZ_VERSION_DATE])
+AC_SUBST([GRAPHVIZ_VERSION_COMMIT])
AC_SUBST([GRAPHVIZ_COLLECTION])
AC_SUBST([GRAPHVIZ_SOURCES])