talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit d47f31be54ed1c2d44fdba5a23d56664d4427350
parent 3a31cf2d6a2483ee389a575def601c94366271c5
Author: Ricardo Mones <ricardo@mones.org>
Date:   Fri, 23 Sep 2022 17:17:41 +0200

Modernize configure.ac

And move computing git version to an external script.

Diffstat:
MMakefile.am | 1+
Mconfigure.ac | 28++++++++++------------------
Aget-git-version | 17+++++++++++++++++
3 files changed, 28 insertions(+), 18 deletions(-)

diff --git 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 @@ -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 @@ -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