changeset 14104:41be2f78c573

libposix: use git-version-gen for version numbering * build-aux/git-version-gen: In order to work inside the libposix subdirectory, also check the parent directory for .git before assuming git describe will not work. * libposix/bootstrap: Add git-version-gen to gnulib-tool invocation. * libposix/configure.ac (AC_INIT): Use it to get a unique version number, and a configure time banner.
author Gary V. Vaughan <gary@gnu.org>
date Mon, 11 Oct 2010 21:13:28 +0700
parents 01c6bf7ffb26
children adc54921d935
files ChangeLog build-aux/git-version-gen libposix/.gitignore libposix/bootstrap libposix/configure.ac libposix/lib/Makefile.am
diffstat 6 files changed, 29 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-10-12  Gary V. Vaughan  <gary@gnu.org>
 
+	libposix: use git-version-gen for version numbering
+	* build-aux/git-version-gen: In order to work inside the
+	libposix subdirectory, also check the parent directory for .git
+	before assuming git describe will not work.
+	* libposix/bootstrap: Add git-version-gen to gnulib-tool
+	invocation.
+	* libposix/configure.ac (AC_INIT): Use it to get a unique
+	version number, and a configure time banner.
+
 	libposix: raw files to import an installable libposix project
 	* libposix/bootstrap: New script to import gnulib posix modules
 	and bootstrap configury so that the result is an installable
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -98,7 +98,7 @@
 if test -n "$v"
 then
     : # use $v
-elif test -d .git \
+elif test -d .git || test -d ../.git \
     && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
 	  || git describe --abbrev=4 HEAD 2>/dev/null` \
     && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
--- a/libposix/.gitignore
+++ b/libposix/.gitignore
@@ -1,5 +1,7 @@
 .deps
 .libs
+/.tarball-version
+/.version
 *.a
 *.gperf
 *.la
@@ -18,8 +20,10 @@
 c++defs.h
 compile
 config.*
+/config.rpath
 configure
 depcomp
+/git-version-gen
 install-sh
 /lib/*.alias
 /lib/*.c
@@ -42,4 +46,3 @@
 /tests/test-*
 unused-parameter.h
 warn-on-use.h
-/config.rpath
--- a/libposix/bootstrap
+++ b/libposix/bootstrap
@@ -5,7 +5,7 @@
 gnulib-tool --import --lib=libposix --makefile-name=gnulib.mk \
   --macro-prefix=LIBPOSIX --libtool --no-changelog --symlink \
   --with-tests --with-c++-tests --with-longrunning-tests \
-  libposix
+  git-version-gen libposix
 
 mv tests/gnulib.mk tests/Makefile.am
 
--- a/libposix/configure.ac
+++ b/libposix/configure.ac
@@ -1,4 +1,8 @@
-AC_INIT([GNU libposix], [20101011], [bug-gnulib@gnu.org])
+AC_INIT([GNU libposix],
+        m4_esyscmd([./git-version-gen .tarball-version]),
+        [bug-gnulib@gnu.org])
+
+AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION])
 
 dnl this should be AC_REQUIRED by gnulib modules that need it,
 dnl but either a couple of modules have forgotten it, or else
@@ -10,6 +14,7 @@
 dnl consider this directory to be a subproject of gnulib proper,
 dnl and will only look for install-sh in . and .. :(
 dnl AC_CONFIG_AUX_DIR([build-aux])
+
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile])
@@ -17,6 +22,11 @@
 AM_INIT_AUTOMAKE([foreign])
 LT_INIT
 
+# libtool interface versioning for libposix.la
+AC_SUBST([LTV_CURRENT], 0)
+AC_SUBST([LTV_REVISION], 0)
+AC_SUBST([LTV_AGE], 0)
+
 AC_PROG_CC
 LIBPOSIX_EARLY
 AM_PROG_CC_C_O
--- a/libposix/lib/Makefile.am
+++ b/libposix/lib/Makefile.am
@@ -1,11 +1,11 @@
 BUILT_SOURCES =
+SUFFIXES =
+
 EXTRA_DIST =
-
 EXTRA_HEADERS =
 nodist_include_HEADERS =
 nobase_nodist_include_HEADERS =
 
-
 CLEANFILES =
 MOSTLYCLEANDIRS =
 MOSTLYCLEANFILES =
@@ -13,5 +13,4 @@
 
 include gnulib.mk
 
-
-libposix_la_LDFLAGS += -version-info 0:0:0
+libposix_la_LDFLAGS += -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE)