From 1f01e0e64587f34122822ba0ee9f445f17153173 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 11 Oct 2010 21:13:28 +0700 Subject: [PATCH] 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. --- 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 05515b2769..7dce876935 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-10-12 Gary V. Vaughan + 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 5617eb8d4e..76182c9c41 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 d54d869e3b..b078d37a6b 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 59d06d0562..c87f6adc1d 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 a3aedc3694..c68fa48d92 100644 --- 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 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 eb212c45e5..9be48fce60 100644 --- a/libposix/lib/Makefile.am +++ b/libposix/lib/Makefile.am @@ -1,11 +1,11 @@ BUILT_SOURCES = -EXTRA_DIST = +SUFFIXES = +EXTRA_DIST = EXTRA_HEADERS = nodist_include_HEADERS = nobase_nodist_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) -- 2.39.5