Automatically generate versions from git
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 10 May 2020 20:32:46 +0000 (16:32 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 10 May 2020 20:32:46 +0000 (16:32 -0400)
Integrates GNULib's git-version-gen. Requested by Dale Smith.

Bundle a bootstrap script since it seems the attempt to eliminate them
a decade and a half ago failed and everyone is doing it (plus we have
two commands we need to run and not just autoreconf now).

.gitignore
Makefile.am
README.CVS [deleted file]
README.GIT [new file with mode: 0644]
bootstrap [new file with mode: 0755]
build-aux/.gitignore [new file with mode: 0644]
configure.ac
lib/.gitignore [new file with mode: 0644]
m4/.gitignore [new file with mode: 0644]
m4/gnulib-cache.m4 [new file with mode: 0644]

index e03dde0..309314d 100644 (file)
@@ -1,18 +1,26 @@
 *~
 *.o
+*.a
+*.so
 .deps/
 autom4te.cache/
 Makefile
 Makefile.in
-/compile
-/config.*
+/config.h
+/config.h.in
+/config.log
+/config.status
 /configure
-/depcomp
-documentation/texinfo.tex
-documentation/*.info
-INSTALL
-aclocal.m4
-install-sh
-missing
-stamp-h1
-source/bobotpp
\ No newline at end of file
+/stamp-h1
+/INSTALL
+/aclocal.m4
+/build-aux/compile
+/build-aux/config.*
+/build-aux/configure
+/build-aux/depcomp
+/build-aux/texinfo.tex
+/build-aux/install-sh
+/build-aux/stamp-h1
+/build-aux/missing
+/documentation/*.info
+/source/bobotpp
\ No newline at end of file
index bf76bed..cc65ed0 100644 (file)
@@ -1,5 +1,8 @@
-SUBDIRS = documentation source scripts
+SUBDIRS = documentation source scripts lib
 
 EXTRA_DIST = examples m4
 
-ACLOCAL_AMFLAGS = -I m4
\ No newline at end of file
+ACLOCAL_AMFLAGS = -I m4
+
+dist-hook:
+       echo $(VERSION) > $(distdir)/.tarball-version
diff --git a/README.CVS b/README.CVS
deleted file mode 100644 (file)
index f0495a2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Run 
-
-  autoreconf --install --symlink
-
-to boostrap the source tree. Then make sure to run configure with
-`--enable-maintainer-mode'
diff --git a/README.GIT b/README.GIT
new file mode 100644 (file)
index 0000000..5f049b7
--- /dev/null
@@ -0,0 +1,2 @@
+To bootstrap the build, you will need autotools and gnulib. Simply run
+`./bootstrap' in the root of the checkout to bootstrap.
\ No newline at end of file
diff --git a/bootstrap b/bootstrap
new file mode 100755 (executable)
index 0000000..dbdfdfe
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# need --force to ensure VERSION is updated since it is auto-generated
+#  by git-version-gen, and configure.ac mtime doesn't change on version
+#  changes anymore.
+gnulib-tool --update && autoreconf --force --install --symlink
\ No newline at end of file
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
new file mode 100644 (file)
index 0000000..912b4ae
--- /dev/null
@@ -0,0 +1 @@
+/git-version-gen
index 0d3f4d0..2e17c6f 100644 (file)
@@ -1,8 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PRERQ(2.50)
-AC_INIT([Bobot++], [2.3.1], [clinton@unknownlamer.org], [bobotpp])
+AC_INIT([Bobot++], m4_esyscmd([build-aux/git-version-gen --prefix 'release-' .tarball-version]), [clinton@unknownlamer.org], [bobotpp])
 AC_LANG([C++])
+AC_CONFIG_AUX_DIR(build-aux)
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
 
@@ -45,6 +46,9 @@ AC_SUBST(LIBS, "$PTHREAD_LIBS $LIBS")
 
 dnl Checks for programs.
 AC_PROG_CXX
+dnl GNULib needs gcc
+AC_PROG_CC
+gl_EARLY
 
 dnl Checks for STL compliance
 AC_CPP_STL
@@ -69,6 +73,8 @@ dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS(select socket strtoul)
 
+dnl GNULib
+gl_INIT
 
 dnl PREFIX (I know, I know. Not very nice but...)
 if test "x$prefix" == "xNONE"
@@ -79,4 +85,4 @@ else
 fi
 
 dnl Generates the makefiles
-AC_OUTPUT(documentation/Makefile source/Makefile scripts/Makefile Makefile)
+AC_OUTPUT(documentation/Makefile source/Makefile scripts/Makefile Makefile lib/Makefile)
diff --git a/lib/.gitignore b/lib/.gitignore
new file mode 100644 (file)
index 0000000..d9f5394
--- /dev/null
@@ -0,0 +1,2 @@
+/Makefile.am
+/dummy.c
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644 (file)
index 0000000..1614b4e
--- /dev/null
@@ -0,0 +1,5 @@
+/00gnulib.m4
+/gnulib-common.m4
+/gnulib-comp.m4
+/gnulib-tool.m4
+/zzgnulib.m4
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
new file mode 100644 (file)
index 0000000..6da617f
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the specification of how gnulib-tool is used.
+# It acts as a cache: It is written and read by gnulib-tool.
+# In projects that use version control, this file is meant to be put under
+# version control, like the configure.ac and various Makefile.am files.
+
+
+# Specification in the form of a command-line invocation:
+# gnulib-tool --import \
+#  --lib=libgnu \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=gl \
+#  git-version-gen
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([
+  git-version-gen
+])
+gl_AVOID([])
+gl_SOURCE_BASE([lib])
+gl_M4_BASE([m4])
+gl_PO_BASE([])
+gl_DOC_BASE([doc])
+gl_TESTS_BASE([tests])
+gl_LIB([libgnu])
+gl_MAKEFILE_NAME([])
+gl_MACRO_PREFIX([gl])
+gl_PO_DOMAIN([])
+gl_WITNESS_C_MACRO([])