echo "autogen.sh: running: $LIBTOOLIZE --copy --force --ltdl"
$LIBTOOLIZE --copy --force --ltdl
+# Use "now" if we can't get time of last commit
+GRAPHVIZ_VERSION_DATE=$( date -u +%Y%m%d.%H%M )
+
+# initialize version for a "stable" build
+cat >./version.m4 <<EOF
+dnl graphviz package version number, (as distinct from shared library version)
+dnl For the minor number: odd => unstable series
+dnl even => stable series
+dnl For the micro number: 0 => in-progress development
+dnl timestamp => tar-file snapshot or release
+m4_define(graphviz_version_major, 2)
+m4_define(graphviz_version_minor, 35)
+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")
+EOF
+
autoreconf -v --install --force || exit 1
# ensure config/depcomp exists even if still using automake-1.4
# otherwise "make dist" fails.
touch config/depcomp
-# don't use any old cache, but create a new one
-rm -f config.cache
-./configure -C "$@"
+# suppress automatic ./configure if there are any args
+if test $# -eq 0; then
+ # don't use any old cache, but create a new one
+ rm -f config.cache
+ ./configure -C "$@"
+fi
# Try to use version available on FC8
AC_PREREQ(2.61)
-dnl graphviz package version number, (as distinct from shared library version)
-dnl For the minor number: odd => unstable series
-dnl even => stable series
-dnl For the micro number: 0 => in-progress development (from cvs)
-dnl timestamp => tar-file snapshot or release
-m4_define(graphviz_version_major, 2)
-m4_define(graphviz_version_minor, 35)
-#NB: the next line gets changed to a date/time string for development releases
-m4_define(graphviz_version_micro, 0)
+# set:
+# graphviz_version_major
+# graphviz_version_minor
+# graphviz_version_micro
+# graphviz_collection
+# graphviz_version_date
+m4_include(./version.m4)
AC_INIT([graphviz],[graphviz_version_major.graphviz_version_minor.graphviz_version_micro],[http://www.graphviz.org/])
GRAPHVIZ_VERSION_MAJOR=graphviz_version_major()
GRAPHVIZ_VERSION_MINOR=graphviz_version_minor()
GRAPHVIZ_VERSION_MICRO=graphviz_version_micro()
-AC_SUBST([GRAPHVIZ_VERSION_MAJOR])
-AC_SUBST([GRAPHVIZ_VERSION_MINOR])
-AC_SUBST([GRAPHVIZ_VERSION_MICRO])
-VERSION_DATE=`date -u +%Y%m%d.%H%M`
-AC_SUBST([VERSION_DATE])
+#NB: "stable" or "development"
+GRAPHVIZ_COLLECTION=graphviz_collection()
-#NB: "stable" on the next line gets changed to "development" when building a development release
-GRAPHVIZ_COLLECTION=stable
+#NB: date/time of last commit - or "now"
+GRAPHVIZ_VERSION_DATE=graphviz_version_date()
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_COLLECTION])
AC_SUBST([GRAPHVIZ_SOURCES])
AC_DEFINE_UNQUOTED(DEFAULT_DPI,$DEFAULT_DPI,Default DPI.)
AC_DEFINE_UNQUOTED(BROWSER,"$BROWSER",[Command to open a browser on a URL])
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_INIT_AUTOMAKE([no-define])
# Suppress verbose compile lines
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])