[Commits] [SCM] claws branch, master, updated. 4.1.0-67-gd47f31be5

mones at claws-mail.org mones at claws-mail.org
Fri Sep 23 17:18:09 CEST 2022


The branch, master has been updated
       via  d47f31be54ed1c2d44fdba5a23d56664d4427350 (commit)
      from  3a31cf2d6a2483ee389a575def601c94366271c5 (commit)

Summary of changes:
 Makefile.am     |  1 +
 configure.ac    | 28 ++++++++++------------------
 get-git-version | 17 +++++++++++++++++
 3 files changed, 28 insertions(+), 18 deletions(-)
 create mode 100755 get-git-version


- Log -----------------------------------------------------------------
commit d47f31be54ed1c2d44fdba5a23d56664d4427350
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri Sep 23 17:17:41 2022 +0200

    Modernize configure.ac
    
    And move computing git version to an external script.

diff --git a/Makefile.am b/Makefile.am
index cbbe2f2b4..96d57b16f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST = \
 	claws-mail.png \
 	autogen.sh \
 	claws-features.h.in \
+	get-git-version \
 	version
 
 # hicolor icon theme, base class of all icon themes
diff --git a/configure.ac b/configure.ac
index cf55d809b..c32c79a69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,16 @@
 
 AC_PREREQ([2.69])
-AC_INIT
+
+m4_define([claws_VERSION],
+    m4_esyscmd([./get-git-version]))
+
+AC_INIT([claws-mail],
+    m4_defn([claws_VERSION]))
 AC_CONFIG_SRCDIR([src/main.c])
-AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_AUX_DIR([config])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([no-define])
 
 PACKAGE=claws-mail
 
@@ -13,17 +20,7 @@ BINARY_AGE=0
 EXTRA_RELEASE=
 EXTRA_GTK3_VERSION=
 
-if test \( -d .git \); then
-    AC_CHECK_PROG([GIT], [git], [yes], [no], [$PATH])
-    if test \( "$GIT" = "no" \); then
-	AC_MSG_ERROR([*** git not found. See http://git-scm.com/])
-    else
-	GIT_VERSION=`git describe --abbrev=6 --dirty --always`
-	echo "echo ${GIT_VERSION}" > ./version
-    fi
-else
-    GIT_VERSION=`sh -c ". $srcdir/version"`
-fi
+GIT_VERSION=m4_defn([claws_VERSION])
 
 if test \( -z "$GIT_VERSION" \); then
 	AC_MSG_ERROR([*** could not determine program version])
@@ -48,11 +45,6 @@ if test \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK3_VERSION}
 fi
 
-dnl set $target
-AC_CANONICAL_TARGET
-
-dnl
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
 AC_SUBST(PACKAGE)
diff --git a/get-git-version b/get-git-version
new file mode 100755
index 000000000..1c105039a
--- /dev/null
+++ b/get-git-version
@@ -0,0 +1,17 @@
+#!/bin/sh
+if test \( -d .git \); then
+  git=`which git`
+  if test \( -x "$git" \); then
+    version=`git describe --abbrev=6 --dirty --always`
+    echo "echo $version" > ./version
+  else
+    echo "Error: *** git not found. See http://git-scm.com/"
+    exit 1
+  fi
+elif test \( -s ./version \); then
+  version=`sh -c ". ./version"`
+else
+  echo "Error: *** invalid tree. Neither '.git' nor 'version' were found"
+  exit 1
+fi
+echo -n $version

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list