Make version granularity a configure option
authorKlaus Aehlig <aehlig@google.com>
Thu, 12 Sep 2013 16:24:10 +0000 (18:24 +0200)
committerKlaus Aehlig <aehlig@google.com>
Thu, 19 Sep 2013 11:59:06 +0000 (13:59 +0200)
From 2.10 onwards, all files are installed into versioned
directories. As everything stays compatible between revisions,
it is not technically necessary, to have revisions included in
the directories. Nevertheless, there are situations where this
is desirable. So make it available at configure time, disabled
by default.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

Makefile.am
configure.ac

index 92d187b..5a8f10e 100644 (file)
@@ -55,8 +55,13 @@ SHELL_ENV_INIT = autotools/shell-env-init
 # so, if some currently architecture-independent executable is replaced by an
 # architecture-dependent one (and hence has to go under $(versiondir)), add a link
 # under $(versionedsharedir) but do not change the external links.
-versiondir = $(libdir)/ganeti/$(VERSION)
-versionedsharedir = $(prefix)/share/ganeti/$(VERSION)
+if USE_VERSION_FULL
+DIRVERSION=VERSION_FULL
+else
+DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
+endif
+versiondir = $(libdir)/ganeti/$(DIRVERSION)
+versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
 
 # Note: these are automake-specific variables, and must be named after
 # the directory + 'dir' suffix
index 1672306..440784f 100644 (file)
@@ -20,6 +20,22 @@ AC_SUBST([VERSION_REVISION], gnt_version_revision)
 AC_SUBST([VERSION_SUFFIX], gnt_version_suffix)
 AC_SUBST([VERSION_FULL], gnt_version_full)
 
+# --enable-versionfull
+AC_ARG_ENABLE([versionfull],
+  [AS_HELP_STRING([--enable-versionfull],
+                  m4_normalize([use the full version string rather
+                  than major.minor for version directories]))],
+  [[if test "$enableval" != yes; then
+      USE_VERSION_FULL=yes
+    else
+      USER_VERSION_FULL=no
+    fi
+  ]],
+  [USE_VERSION_FULL=no
+  ])
+AC_SUBST(USE_VERSION_FULL, $USE_VERSION_FULL)
+AM_CONDITIONAL([USE_VERSION_FULL], [test "$USE_VERSION_FULL" = yes])
+
 # --enable-symlinks
 AC_ARG_ENABLE([symlinks],
   [AS_HELP_STRING([--enable-symlinks],