# HG changeset patch # User Bruce Korb # Date 1293739465 28800 # Node ID 9a45e81fffbebb9ea20da6d89c95f8a2eed6c108 # Parent 2256b67fa8bc8304a5a43f533ae04878346f1a34# Parent 733b45c14610136ef740846e21326a5886b557bd merge from trunk diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -73,6 +73,32 @@ * doc/posix-functions/pipe.texi (pipe): Update documentation. * MODULES.html.sh (File descriptor based Input/Output): Likewise. +2010-12-08 Gary V. Vaughan + + libposix: generate compile and runtime versions with configure + * libposix/lib/version.c, libposix/lib/version.h.in: Templates + for code to allow runtime and compile time checking of libposix + version numbers. + * libposix/configure.ac (AC_CONFIG_FILES): Use the already + calculated libposix version number to generate libposix/ + lib/version.h. + * libposix/mk-tarball (func_mkver): Removed. Adjust all callers. + Don't generate files required by the build in an optionally + used script, and incidentally avoid recalculating the version + number that configure already knows. + +2010-12-07 Gary V. Vaughan + + libposix: version filter script was adding a newline + * libposix/configure.ac (AC_INIT): Use the output of + git-version-gen unmodified, os per other GNU projects... + otherwise the spurious newline added to the version number + breaks operation of the configure script (tested with + Autoconf-2.68). + * libposix/mk-tarball: Remove the filter here too, otherwise + we'll end up with two conflicting version numbers in the same + release! + 2010-12-07 Bruno Haible unistr/u8-strcmp: Avoid collision with libc function on Solaris 11. diff --git a/libposix/.gitignore b/libposix/.gitignore --- a/libposix/.gitignore +++ b/libposix/.gitignore @@ -34,6 +34,8 @@ /lib/arpa /lib/pt_chown /lib/sys +!lib/version.c +!lib/version.h.in libtool ltmain.sh /m4 diff --git a/libposix/bootstrap b/libposix/bootstrap --- a/libposix/bootstrap +++ b/libposix/bootstrap @@ -12,11 +12,10 @@ mkdir tmp tmp/modules fi +posix_list=` { echo alloca posix-modules -} | sort -u > tmp/posix-list - -posix_list=`grep -v '^$' tmp/posix-list` +} | tr -d ' \t' | sed '/^$/d' | sort -u` cat > tmp/modules/libposix <<- _EOF_ Description: @@ -58,7 +57,6 @@ # Bootstrap for autotools. gnulib-tool ${opts} git-version-gen libposix - # No need to maintain a Makefile.am just to include gnulib.mk. mv tests/gnulib.mk tests/Makefile.am diff --git a/libposix/configure.ac b/libposix/configure.ac --- a/libposix/configure.ac +++ b/libposix/configure.ac @@ -1,6 +1,5 @@ AC_INIT([GNU libposix], - m4_esyscmd([./git-version-gen .tarball-version | \ - sed 's/-dirty/-modified/']), + m4_esyscmd([./git-version-gen .tarball-version 's/dirty/modified/']), [bug-gnulib@gnu.org]) AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION]) @@ -8,6 +7,7 @@ dnl this should be AC_REQUIRED by gnulib modules that need it, dnl but either a couple of modules have forgotten it, or else dnl AC_REQUIRE is emitting macro expansions out of order +dnl AC_USE_SYSTEM_EXTENSIONS dnl we can't use AC_CONFIG_AUX_DIR here, because the heuristics @@ -15,10 +15,11 @@ 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]) - +dnl AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile]) +AC_CONFIG_FILES([lib/version.h]) AM_INIT_AUTOMAKE([foreign]) LT_INIT diff --git a/libposix/lib/version.c b/libposix/lib/version.c new file mode 100644 --- /dev/null +++ b/libposix/lib/version.c @@ -0,0 +1,19 @@ +/* A C macro and symbol for compile- and run-time libposix version checking. + Copyright (C) 2010 Free Software Foundation, Inc. + + This program 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 program 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include "version.h" + +char const libposix_version_string[] = LIBPOSIX_VERSION; diff --git a/libposix/lib/version.h.in b/libposix/lib/version.h.in new file mode 100644 --- /dev/null +++ b/libposix/lib/version.h.in @@ -0,0 +1,20 @@ +/* A C macro and symbol for compile- and run-time libposix version checking. + Copyright (C) 2010 Free Software Foundation, Inc. + + This program 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 program 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef LIBPOSIX_VERSION +#define LIBPOSIX_VERSION "@PACKAGE_VERSION@" +extern char const libposix_version_string[]; +#endif diff --git a/libposix/mk-tarball b/libposix/mk-tarball --- a/libposix/mk-tarball +++ b/libposix/mk-tarball @@ -54,52 +54,16 @@ case "$*" in *'--clean'* | *'--clob'* ) git clean -f -x -d . + test $# -eq 1 && exit 0 ;; esac } -func_mkver() -{ - { - echo '/*' - sed '1,/^$/d;s/^#/ */;/http:\/\/www\.gnu\.org/q' ${prognam} - echo ' */' - - gv=`../build-aux/git-version-gen .tarball-version | \ - sed 's/-dirty/-modified/'` - sedcmd='/^2[01][0-9][0-9]-[0-1][0-9]-[0-3][0-9] /{ - s/ .*// - s/-/./gp - q - }' - dv=`sed -n "${sedcmd}" ${glibdir}/ChangeLog` - cat <<-_EOF_ - #ifndef LIBPOSIX_GIT_VERSION - #define LIBPOSIX_GIT_VERSION "$gv" - #define LIBPOSIX_VERSION "$dv" - - extern char const libposix_git_version[]; - extern char const libposix_version[]; - #endif /* LIBPOSIX_GIT_VERSION */ - _EOF_ - } > lib/version.h - - { - sed -n '1,/^ \*\/$/p' lib/version.h - - cat <<-\_EOF_ - #include "version.h" - - char const libposix_git_version[] = LIBPOSIX_GIT_VERSION; - char const libposix_version[] = LIBPOSIX_VERSION; - _EOF_ - - } > lib/version.c -} - func_bootstrap() { - /bin/sh ./bootstrap func_die bootstrap failure + + /bin/sh ./bootstrap \ + || func_die bootstrap failure } func_mkdistro() @@ -113,7 +77,6 @@ } func_init ${1+"$@"} -func_mkver func_bootstrap func_mkdistro