From f1c1cc7c3de0d4a5f310357a249cef82f73c588c Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Sun, 18 Sep 2011 21:13:34 +0000 Subject: [PATCH] cleaned up the mechanism for library versioning --- Makefile.am | 1 + configure.ac | 25 ++++++++++++++++++++----- library_versions | 12 ++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 library_versions diff --git a/Makefile.am b/Makefile.am index 5fb6ff9e9..b293da744 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,6 +88,7 @@ endif EXTRA_DIST = \ Makefile.builds.in \ Makefile.subdir \ + library_versions \ config/build-type \ config/mkbuilddir \ config/doxygen.cfg \ diff --git a/configure.ac b/configure.ac index 3205d9a3f..8a1039bd9 100644 --- a/configure.ac +++ b/configure.ac @@ -43,10 +43,25 @@ CVC4_RELEASE_STRING=_CVC4_RELEASE_STRING # For guidance on when to change the version number, refer to the # developer's guide. -CVC4_LIBRARY_VERSION=0:0:0 -CVC4_PARSER_LIBRARY_VERSION=0:0:0 -CVC4_COMPAT_LIBRARY_VERSION=0:0:0 -CVC4_BINDINGS_LIBRARY_VERSION=0:0:0 +m4_define([library_version], [m4_esyscmd([grep -F "$(grep -v '^#' library_versions | awk '{print$][1}' | sed 's,\\,\\\\\\,g' | (while read r; do if echo "]_CVC4_RELEASE_STRING[" | grep -q "^$r\$"; then echo "$r"; exit; fi; done; echo NO_MATCH_FOUND)) " library_versions | awk 'BEGIN {FS=":";OFS=":";RS=" "} /^$1:/ {print$][2,$][3,$][4}' | head -1])]) + +m4_define(_CVC4_LIBRARY_VERSION, library_version([libcvc4]))dnl +m4_define(_CVC4_PARSER_LIBRARY_VERSION, library_version([libcvc4parser]))dnl +m4_define(_CVC4_COMPAT_LIBRARY_VERSION, library_version([libcvc4compat]))dnl +m4_define(_CVC4_BINDINGS_LIBRARY_VERSION, library_version([libcvc4bindings]))dnl + +m4_define([fatal_error], [m4_errprint(__program__:__file__:__line__[: fatal error: $* +])m4_exit(1)])dnl + +m4_ifblank(_CVC4_LIBRARY_VERSION,[fatal_error([no CVC4_LIBRARY_VERSION defined for release version "]_CVC4_RELEASE_STRING[" in library_versions file])])dnl +m4_ifblank(_CVC4_PARSER_LIBRARY_VERSION,[fatal_error([no CVC4_PARSER_LIBRARY_VERSION defined for release version "]_CVC4_RELEASE_STRING[" in library_versions file])])dnl +m4_ifblank(_CVC4_COMPAT_LIBRARY_VERSION,[fatal_error([no CVC4_COMPAT_LIBRARY_VERSION defined for release version "]_CVC4_RELEASE_STRING[" in library_versions file])])dnl +m4_ifblank(_CVC4_BINDINGS_LIBRARY_VERSION,[fatal_error([no CVC4_BINDINGS_LIBRARY_VERSION defined for release version "]_CVC4_RELEASE_STRING[" in library_versions file])])dnl + +CVC4_LIBRARY_VERSION=_CVC4_LIBRARY_VERSION +CVC4_PARSER_LIBRARY_VERSION=_CVC4_PARSER_LIBRARY_VERSION +CVC4_COMPAT_LIBRARY_VERSION=_CVC4_COMPAT_LIBRARY_VERSION +CVC4_BINDINGS_LIBRARY_VERSION=_CVC4_BINDINGS_LIBRARY_VERSION # Using the AC_CANONICAL_* macros destroy the command line you get # from $@, which we want later for determining the build profile. So @@ -891,7 +906,7 @@ AC_SUBST(MAN_DATE) AC_CONFIG_FILES([ Makefile.builds Makefile] - m4_esyscmd([find contrib lib src test -name Makefile.am | sort | sed 's,\.am$,,']) + m4_esyscmd([find contrib src test -name Makefile.am | sort | sed 's,\.am$,,']) ) CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/rational.h]) diff --git a/library_versions b/library_versions new file mode 100644 index 000000000..d344bc763 --- /dev/null +++ b/library_versions @@ -0,0 +1,12 @@ +# Format is CVC4-RELEASE-VERSION-REGEXP (LIBRARY:VERSION)* +# +# This file contains library version release information. +# Lines are matched while processing configure.ac (and generating +# the configure script) using the CVC4_RELEASE_STRING. Lines are +# matched on the regexp in the first column, with only the first +# matching line counting. The library versions following, one per +# column, are then used. If there are no matching lines, an error +# is raised and the configure script is not generated. +# +0\..* libcvc4:0:0:0 libcvc4parser:0:0:0 libcvc4compat:0:0:0 libcvc4bindings:0:0:0 +1\.0 libcvc4:0:0:0 libcvc4parser:0:0:0 libcvc4compat:0:0:0 libcvc4bindings:0:0:0 -- 2.30.2