cleaned up the mechanism for library versioning
authorMorgan Deters <mdeters@gmail.com>
Sun, 18 Sep 2011 21:13:34 +0000 (21:13 +0000)
committerMorgan Deters <mdeters@gmail.com>
Sun, 18 Sep 2011 21:13:34 +0000 (21:13 +0000)
Makefile.am
configure.ac
library_versions [new file with mode: 0644]

index 5fb6ff9e94765cfef91d14c5e166bd41a89bf4e7..b293da74450aa9f5fd35866a260af4a8ccf9143d 100644 (file)
@@ -88,6 +88,7 @@ endif
 EXTRA_DIST = \
        Makefile.builds.in \
        Makefile.subdir \
+       library_versions \
        config/build-type \
        config/mkbuilddir \
        config/doxygen.cfg \
index 3205d9a3f26e3adedaf577707f64f2d1d29326ce..8a1039bd940917987685f04a109717242c0394f3 100644 (file)
@@ -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 (file)
index 0000000..d344bc7
--- /dev/null
@@ -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