bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 7/7] libposix: use git-version-gen for version numbering


From: Gary V. Vaughan
Subject: [PATCH 7/7] libposix: use git-version-gen for version numbering
Date: Tue, 12 Oct 2010 23:08:42 +0700

Might as well use the existing git-version-gen mechanism to
get git based unique version strings for libposix.  However,
git-version-gen itself relies on the presence of .git in the
current directory.  I've made a quick and dirty patch to it
here to also look in the parent directory... but surely there's
a nicer way to determine whether the current directory is managed
by git than this?

Also, I'm not yet sure how the tree should be tagged for libposix
releases, so that needs to be decided -- likely requiring another
patch to git-version-gen to match libposix tags only when calculating
the version strings.

Comments on the series as a whole?

Okay to merge to master?

Cheers,
-- 
Gary V. Vaughan (address@hidden)

* 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.
---
 ChangeLog                 |    9 +++++++++
 build-aux/git-version-gen |    2 +-
 libposix/.gitignore       |    5 ++++-
 libposix/bootstrap        |    2 +-
 libposix/configure.ac     |   12 +++++++++++-
 libposix/lib/Makefile.am  |    7 +++----
 6 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2679141..549b28c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-10-12  Gary V. Vaughan  <address@hidden>
 
+       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
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 5617eb8..76182c9 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -98,7 +98,7 @@ fi
 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"` \
diff --git a/libposix/.gitignore b/libposix/.gitignore
index d54d869..b078d37 100644
--- a/libposix/.gitignore
+++ b/libposix/.gitignore
@@ -1,5 +1,7 @@
 .deps
 .libs
+/.tarball-version
+/.version
 *.a
 *.gperf
 *.la
@@ -18,8 +20,10 @@ arg-nonnull.h
 c++defs.h
 compile
 config.*
+/config.rpath
 configure
 depcomp
+/git-version-gen
 install-sh
 /lib/*.alias
 /lib/*.c
@@ -42,4 +46,3 @@ stamp-h1
 /tests/test-*
 unused-parameter.h
 warn-on-use.h
-/config.rpath
diff --git a/libposix/bootstrap b/libposix/bootstrap
index 59d06d0..c87f6ad 100755
--- a/libposix/bootstrap
+++ b/libposix/bootstrap
@@ -5,7 +5,7 @@ PATH=..:$PATH
 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
 
diff --git a/libposix/configure.ac b/libposix/configure.ac
index a3aedc3..c68fa48 100644
--- a/libposix/configure.ac
+++ b/libposix/configure.ac
@@ -1,4 +1,8 @@
-AC_INIT([GNU libposix], [20101011], address@hidden)
+AC_INIT([GNU libposix],
+        m4_esyscmd([./git-version-gen .tarball-version]),
+        address@hidden)
+
+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 for finding install-sh in the generated configure script
 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 @@ AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile])
 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
diff --git a/libposix/lib/Makefile.am b/libposix/lib/Makefile.am
index fa2e6ed..bcbfe37 100644
--- a/libposix/lib/Makefile.am
+++ b/libposix/lib/Makefile.am
@@ -1,11 +1,11 @@
 BUILT_SOURCES =
-EXTRA_DIST =
+SUFFIXES =
 
+EXTRA_DIST =
 EXTRA_HEADERS =
 include_HEADERS =
 nobase_include_HEADERS =
 
-
 CLEANFILES =
 MOSTLYCLEANDIRS =
 MOSTLYCLEANFILES =
@@ -13,5 +13,4 @@ MAINTAINERCLEANFILES =
 
 include gnulib.mk
 
-
-libposix_la_LDFLAGS += -version-info 0:0:0
+libposix_la_LDFLAGS += -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE)
-- 
1.7.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]