* Build: Generate PACKAGE_VERSION according to the basename of the top directory OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/libqb?expand=0&rev=40
25 lines
780 B
Diff
25 lines
780 B
Diff
diff --git a/configure.ac b/configure.ac
|
|
index a4dc7c0..e0a5c92 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -26,6 +26,19 @@ AC_CANONICAL_HOST
|
|
AC_PROG_LIBTOOL
|
|
AC_LANG([C])
|
|
|
|
+
|
|
+if test $PACKAGE_VERSION = "UNKNOWN"; then
|
|
+ # The current directory name make a reasonable default
|
|
+ # Most generated archives will include the hash or tag
|
|
+ BASE=`basename $PWD`
|
|
+ PACKAGE_VERSION=`echo $BASE | sed s:.*[[Ll]]ibqb-::`
|
|
+ AC_MSG_RESULT(directory based hash: $PACKAGE_VERSION)
|
|
+
|
|
+ AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
|
|
+ AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION", Current libqb version)
|
|
+ AC_SUBST(PACKAGE_VERSION)
|
|
+fi
|
|
+
|
|
dnl Fix default variables - "prefix" variable if not specified
|
|
if test "$prefix" = "NONE"; then
|
|
prefix="/usr"
|