diff --git a/src/GNUmakefile.in b/src/GNUmakefile.in index 760ec9268..8229e7828 100644 --- a/src/GNUmakefile.in +++ b/src/GNUmakefile.in @@ -1,15 +1,15 @@ -# Helps update the version number automatically if using GNU make. -include Makefile +# @configure_input@ -AUTORECONF ?= autoreconf -AUTORECONF_OPTS ?= -vis +include Makefile -script_version := $(shell $(top_srcdir)/build-helpers/package-version $(top_srcdir) version-stamp) -ifneq ($(PACKAGE_VERSION),$(script_version)) -$(info autoconf and script versions do not match: $(PACKAGE_VERSION) vs $(script_version)) -$(info Removing autom4te.cache and related files and re-running autoreconf) -dummy1 := $(shell rm -rf $(top_srcdir)/autom4te.cache) -dummy2 := $(shell $(AUTORECONF) $(AUTORECONF_OPTS) $(top_srcdir)) +need_to_rerun := $(shell $(top_srcdir)/build-helpers/versioninfo.sh "$(top_srcdir)" "@VERSIONINFO_STAMPFILE@" | { @VERSIONINFO_READ@; \ + if @VERSIONINFO_IS_UNCHANGED@ \ + echo "no"; \ + fi; } ) +ifneq (no,$(need_to_rerun)) +$(info Recorded and current version information do not match.) +$(info Re-running autoreconf via bootstrap.) +dummy1 := $(shell echo $(top_srcdir)/bootstrap) endif # vim: syntax=make diff --git a/src/Makefile.am b/src/Makefile.am index 58bd116b7..8515aaec7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,7 +40,7 @@ CLEANFILES = \ config_gram.h \ lexer.c -include build-helpers/package-version.mk +include build-helpers/versioninfo.mk BUILT_SOURCES = $(CLEANFILES) @@ -248,4 +248,4 @@ backup-avrdude-conf: ${DESTDIR}${sysconfdir}/avrdude.conf.bak; \ fi -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -I build-helpers diff --git a/src/build-helpers/package-version b/src/build-helpers/package-version deleted file mode 100755 index beb5b36ca..000000000 --- a/src/build-helpers/package-version +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# Syntax: -# $0 -# -# may be relative -# is relative to the dist top_srcdir -# -# Test this script by running -# rm -rf autom4te.cache/ && autoreconf -vis . && sed -n "/^# Generated by GNU/p" configure -# -# If we run into an error, we cannot abort the "autoreconf" run by -# exiting with a non-0 error code. (We do exit non-0 in that case -# anyway for help when testing this script.) -# The only thing we can do to report an error is to write to stderr -# which appears as "autoreconf" output, and to write a version number -# to stdout which indicates an error. The "configure" script can -# then check whether $PACKAGE_VERSION indicates such an error. - -# Parse the command line arguments -prog="$(basename "$0")" -top_srcdir="${1-.}" -test -d "$top_srcdir" || { \ - echo "$prog: Error: Could not change to top_srcdir '$1'" >&2; \ - echo "version_error_1" | ${TR-tr} -d '\012' - exit 2; \ -} -version_stamp="${2-version-stamp}" - -# echo "$prog: Error: Some error happend." >&2 -# echo "version_error_2" | ${TR-tr} -d '\012' -# exit 2 - -# Is this a dist source tree? -# If so, use the version number from the version_stamp file. -if test -f "$top_srcdir/$version_stamp"; then - cat "$top_srcdir/$version_stamp" | ${TR-tr} -d '\012' - exit -fi - -# Is this part of a git checkout or an expanded github snapshot tarball? -test -f "$top_srcdir/../CMakeLists.txt" || { \ - echo "$prog: Error: top-level avrdude CMakeLists.txt file not found" >&2; \ - echo "version_error_3" | ${TR-tr} -d '\012' - exit 2; \ -} - -if PROJECT_VERSION="$(${SED-sed} -n 's/project(avrdude[[:space:]]\{1,\}VERSION[[:space:]]\{1,\}\([0-9\.]\{1,\}\)[[:space:]]\{1,\}.*/\1/p' "$top_srcdir/../CMakeLists.txt")"; then - : -else - echo "$prog: Error parsing top-level avrdude 'CMakeLists.txt'." >&2 - echo "version_error_4" | ${TR-tr} -d '\012' - exit 2 -fi - -test -n "$PROJECT_VERSION" || { \ - echo "$prog: Error: Could not find project(...) in top-level avrdude 'CMakeLists.txt'" >&2; \ - echo "version_error_5" | ${TR-tr} -d '\012' - exit 2; \ -} - -# If GIT_DIR is set, use it. If not, try "$top_srcdir/../.git". -test -n "$GIT_DIR" || { \ - GIT_DIR="$top_srcdir/../.git"; \ - export GIT_DIR; \ -} - -# Working with a git source tree -if test -d "$GIT_DIR"; then - GIT_COMMIT_HASH="$(${GIT-git} log -1 --format=%h)" || { \ - echo "$prog: Error: Cannot run 'git log' for commit hash" >&2; \ - echo "version_error_71" | ${TR-tr} -d '\012'; \ - exit 2; \ - } - GIT_COMMIT_DATE="$(${GIT-git} log -1 --format=%cd --date=format:%Y%m%d)" || { \ - echo "$prog: Error: Cannot run 'git log' for commit date" >&2; \ - echo "version_error_72" | ${TR-tr} -d '\012'; \ - exit 2; \ - } - GIT_TAG_HASH="$(${GIT-git} log -1 --tags --format=%h)" || { \ - echo "$prog: Error: Cannot run 'git log' for tag hash" >&2; \ - echo "version_error_73" | ${TR-tr} -d '\012'; \ - exit 2; \ - } - if test "x$GIT_COMMIT_HASH" = "x$GIT_TAG_HASH"; then - echo "${PROJECT_VERSION}" | ${TR-tr} -d '\012' - exit - else - echo "${PROJECT_VERSION}-${GIT_COMMIT_DATE}" | ${TR-tr} -d '\012' - exit - fi -else - # Building a github release tarball or github snapshot tarball. - # - # Presume this is a release version, because who would build a - # non-release version from a snapshot tarball? - echo "${PROJECT_VERSION}" | ${TR-tr} -d '\012' - exit -fi - -# If everything else has failed, call this version "devel" -echo "devel" | ${TR-tr} -d '\012' -exit 2 diff --git a/src/build-helpers/package-version.mk b/src/build-helpers/package-version.mk deleted file mode 100644 index 01502dfd5..000000000 --- a/src/build-helpers/package-version.mk +++ /dev/null @@ -1,26 +0,0 @@ -BUILD_SCRIPT_DIR = build-helpers - -# Check that package version matches git version before creating dist tarballs -dist-hook: cur-version-check cur-version-stamp -distcheck-hook: cur-version-check - -# Note: We cannot run autoreconf from here, because we would need some way to -# restart the whole dist process from the start and there is none. -EXTRA_DIST += $(top_srcdir)/$(BUILD_SCRIPT_DIR)/package-version -cur-version-check: - @cur_ver=`$(top_srcdir)/$(BUILD_SCRIPT_DIR)/package-version $(top_srcdir) version-stamp`; \ - if test "x$${cur_ver}" = "x$(PACKAGE_VERSION)"; then :; else \ - echo "ERROR: Recorded PACKAGE_VERSION and current version do not match:"; \ - echo " current version: $${cur_ver}"; \ - echo " recorded PACKAGE_VERSION: $(PACKAGE_VERSION)"; \ - rm -rf "$(top_srcdir)/autom4te.cache"; \ - echo "Update PACKAGE_VERSION by running autoreconf(1)."; \ - exit 1; \ - fi - -# Version stamp files can only exist in tarball source trees. -# -# So there is no need to generate them anywhere else or to clean them -# up anywhere. -cur-version-stamp: - echo "$(PACKAGE_VERSION)" > "$(distdir)/version-stamp" diff --git a/src/build-helpers/versioninfo.m4 b/src/build-helpers/versioninfo.m4 new file mode 100644 index 000000000..30e36d6e9 --- /dev/null +++ b/src/build-helpers/versioninfo.m4 @@ -0,0 +1,73 @@ +# versioninfo.m4 - find avrdude version information for msg -*- Autoconf -*- +# serial 1 +dnl | Increment the above serial number every time you edit this file. +dnl | When it finds multiple m4 files with the same name, +dnl | aclocal will use the one with the highest serial. +dnl +dnl The sequence of version info items to store in the version-stamp file. +dnl This must be the same sequence as the versioninfo script writes. +m4_pattern_forbid([versioninfo_items]) +m4_define([versioninfo_items], [ + [CMAKE_PROJECT_VERSION], + [GIT_COMMIT_DATE], + [GIT_COMMIT_HASH], + [GIT_TAG_HASH] +]) +dnl +dnl Initialize version info from the script command given as macro argument. +m4_pattern_forbid([versioninfo_init]) +m4_define([versioninfo_init], [ + m4_pushdef([versioninfo_split], m4_split(m4_esyscmd($1),m4_newline)) + m4_case(m4_sysval, [0], [ + m4_for([N], [1], m4_count(versioninfo_split), [1], [ + m4_define([versioninfo_]m4_normalize(m4_argn(N, versioninfo_items)), + m4_normalize(m4_argn(N, versioninfo_split))) + ]) + ], [ + m4_fatal([versioninfo script returned non-0]) + ]) +]) +dnl +m4_define([versioninfo_stampfile], [versioninfo-stamp]) +dnl +versioninfo_init([./build-helpers/versioninfo.sh . ]m4_defn([versioninfo_stampfile])) +dnl +dnl +dnl +dnl ======================================================================== +dnl VERSIONINFO_SETUP() +dnl ======================================================================== +dnl +AC_DEFUN([VERSIONINFO_SETUP], [dnl +m4_foreach([ITEM], [versioninfo_items], [dnl + AC_SUBST(m4_normalize(ITEM), [m4_defn([versioninfo_]m4_normalize(ITEM))]) + AC_MSG_CHECKING([versioninfo item ]m4_normalize(ITEM)) + AC_MSG_RESULT([$]m4_normalize(ITEM)) +]) +dnl +dnl Define helper substitutions containing shell code for use inside +dnl make recipes in build-helpers/versioninfo.mk and $(shell ...) +dnl calls in GNUmakefile.in dealing with version info. +dnl +AC_SUBST([VERSIONINFO_STAMPFILE], [m4_defn([versioninfo_stampfile])]) +AM_SUBST_NOTMAKE([VERSIONINFO_WRITE]) +dnl +AC_SUBST([VERSIONINFO_READ], + ['m4_foreach([ITEM], [versioninfo_items], [read m4_normalize(ITEM); ]):']) +AM_SUBST_NOTMAKE([VERSIONINFO_READ]) +dnl +AC_SUBST([VERSIONINFO_WRITE], + ['printf "%s\n"m4_foreach([ITEM], [versioninfo_items], [ "$(m4_normalize(ITEM))"])']) +AM_SUBST_NOTMAKE([VERSIONINFO_WRITE]) +dnl +AC_SUBST([VERSIONINFO_IS_UNCHANGED], + ['false; then :; m4_foreach([ITEM], [versioninfo_items], [elif test "x$(m4_normalize(ITEM))" != "x$$m4_normalize(ITEM)"; then printf "%s has changed from %s to %s\n" "m4_normalize(ITEM)" "$(m4_normalize(ITEM))" "$$m4_normalize(ITEM)" >&2; ]) else ']) +AM_SUBST_NOTMAKE([VERSIONINFO_IS_UNCHANGED]) +dnl +])dnl +dnl +dnl #################################################################### +dnl +dnl Local Variables: +dnl mode: autoconf +dnl End: diff --git a/src/build-helpers/versioninfo.md b/src/build-helpers/versioninfo.md new file mode 100644 index 000000000..965e06b40 --- /dev/null +++ b/src/build-helpers/versioninfo.md @@ -0,0 +1,143 @@ +The versioninfo mechanism +========================= + +This describes the versioninfo mechanism which automatically generates +the version information for use in `configure.ac` and then the rest of +the autotools build system. + + +The basic idea +-------------- + +The main goals are + + * Avoid the need for avrdude maintainers to edit the avrdude version + in the autotools buildsystem's `configure.ac` in addition to the + cmake buildsystem's main `CMakeLists.txt` file. + + * Have the autotools buildsystem generate the same version message as + the cmake buildsystem in both the `avrdude.conf` file and the + `avrdude -?` output version message. + +To achieve this, we need to replicate some of the logic from the +top-level `CMakeLists.txt` which creates the `AVRDUDE_FULL_VERSION` +variable. + +We run this logic mostly at bootstrap/autoreconf time, with the +`configure` propagating the information, so that some `make` time +checks can determine whether the bootstrap code needs to be re-run, +and re-run it automatically if possible. + + +All the different build types +----------------------------- + +There are many ways to build avrdude. + +There are three types of source trees: + + * a git clone's working directory with a `.git/` directory + + * an extracted GitHub tarball/zipfile (contains the same as a git + clone's working directory, but no `.git/` directory with its + associated git commit information) + + * from a dist tarball as generated by the autotools buildsystem's + `make dist` or `make distcheck` commands (contains the required + git commit information inside the versioninfo-stamp file) + +In any of these cases, this can be an avrdude release or non-release, +determined by whether the latest commit's hash is equal to the latest +tag's commit's hash (`GIT_COMMIT_HASH == GIT_TAG_HASH`). + +In principle, any of these source types could be built with either the +cmake buildsystem or the autotools buildsystem. With `configure.ac` +being rooted in the `src/` subdirectory though, the dist tarball +generated by `make dist` cannot contain files outside of `src/` which +are required for a cmake build. + +In all types of builds, we want the same version message when building +using the autotools buildsystem as the cmake buildsystem creates: + + * `7.3` for a release + * `7.3-20240213 (9634fd15)` with commit date and commit hash for a + non-release. + +If we abbreviate those types of version messages with `R` for release +and `H` for hash, we can put all cases into a table. `BS` stands for +buildsystem, obviously. + +``` + Version_Message +SOURCE TYPE BS Release? Wanted Actual +git clone wd cm yes R R +git clone wd cm no H H +github tarball cm yes R R +github tarball cm no H R (wrong/missing info) +dist tarball cm yes R cmake build N/A at this time +dist tarball cm no H cmake build N/A at this time + +git clone wd am yes R R +git clone wd am no H H +github tarball am yes R R +github tarball am no H R (wrong/missing info/like cmake) +dist tarball am yes R R +dist tarball am no H H +``` + +As the github tarball (like the github zipfile) does not contain any +commit/tag information, it is impossible for any buildsystem to +determine whether building a release or non-release. + +The dist tarball generated by the autotools buildsystem's `make dist` +does contain the commit/tag information, so builds from such a dist +tarball can correctly determine whether they are building a release or +a non-release source tree. However, only builds using the autotools +buildsystem are possible as long as the `configure.ac` file is located +inside the `src/` subdirectory instead of the top-level directory. + + +The `build-helpers/versioninfo.sh` script file +---------------------------------------------- + +The `versioninfo.sh` script tries to determine the version and git +information from the raw sources: + + * The version number (`7.3`) is determined from the top-level + `CMakeLists.txt` file's `project(... VERSION ...)` line. + + * The information on the latest git commit date and hash and git tag + hash is determined from the `.git/` subdirectory corresponding to + the top-level `CMakeLIsts.txt` file. + +The `versioninfo.sh` script then prints these items, one per line. + + +The `build-helpers/versioninfo.m4` m4 include file +-------------------------------------------------- + +TODO: Write text. + + +The `build-helpers/versioninfo.mk` Makefile include file +-------------------------------------------------------- + +TODO: Write text. + + +The `configure.ac` file +----------------------- + +TODO: Write text. + + +The `GNUmakefile.in` and `GNUmakefile` files +-------------------------------------------- + +If you are running GNU make, the `GNUmakefile` file generated from the +`GNUmakefile.in` file will update the versioninfo automatically before +executing any possible make recipes. + +If you are not running GNU make, you will need to run the command to +update the versioninfo update command manually. You will be shown that +command if necessary. diff --git a/src/build-helpers/versioninfo.mk b/src/build-helpers/versioninfo.mk new file mode 100644 index 000000000..7978bc2ec --- /dev/null +++ b/src/build-helpers/versioninfo.mk @@ -0,0 +1,31 @@ +# -*- makefile-automake -*- + +EXTRA_DIST += build-helpers/versioninfo.m4 +EXTRA_DIST += build-helpers/versioninfo.md +EXTRA_DIST += build-helpers/versioninfo.sh + +# Before creating dist tarballs, check that autom4te version matches +# versioninfo script version. +dist-hook: versioninfo-check versioninfo-stamp +distcheck-hook: versioninfo-check + +# Note: We cannot run autoreconf from this make recipe, because we would +# need some way to restart the whole dist process from the start +# and there is none. +versioninfo-check: + @:; \ + $(top_srcdir)/build-helpers/versioninfo.sh "$(top_srcdir)" "@VERSIONINFO_STAMPFILE@" \ + | ( @VERSIONINFO_READ@; \ + if @VERSIONINFO_IS_UNCHANGED@ \ + exit 0; \ + fi; \ + rm -rf "$(top_srcdir)/autom4te.cache"; \ + echo "Update the recorded version information by re-running bootstrap/autoreconf(1)."; \ + exit 1; ) + +# Version stamp files can only exist in tarball source trees. +# +# So there is no need to generate them anywhere else or to clean them +# up anywhere. +versioninfo-stamp: + @VERSIONINFO_WRITE@ > "$(distdir)/versioninfo-stamp" diff --git a/src/build-helpers/versioninfo.sh b/src/build-helpers/versioninfo.sh new file mode 100755 index 000000000..58ebc9c6d --- /dev/null +++ b/src/build-helpers/versioninfo.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# Syntax: +# $0 +# +# may be relative +# is relative to the dist top_srcdir +# +# Test this script by running something like +# rm -rf autom4te.cache/ && autoreconf -vis . && sed -n "/^# Generated by GNU/p" configure +# +# On error handling +# ----------------- +# +# If we run into an error, we write an error message to stderr and exit +# with a non-0 code. The caller can then check the exit code, and the +# user can read the message from stderr. + + +# Parse the command line arguments +prog="$(basename "$0")" +top_srcdir="${1-.}" +versioninfo_stamp="${2-versioninfo-stamp}" + + +# global settings +verbose=false + + +# Usage example: +# ret_error "Something is wrong: answer != 42" +ret_error() { + printf "$prog: error: %s\n" "$1" >&2 + exit 1 +} + + +# Usage examples: +# ret_ok "7.3" +# ret_ok "7.3" "20231231" +# ret_ok "7.3" "20231231" "0123abcd" +# ret_ok "7.3" "20231231" "0123abcd" "4567cdef" +ret_ok() { + if $verbose; then + printf "$prog: version info from cmake/git: %s\n" "$*" >&2 + fi + printf "%s\n" "$@" + exit 0 +} + + +# Usage example: +# ret_ok_file "$top_srcdir/$versioninfo_stamp" +ret_ok_file() { + if $verbose; then + printf "$prog: version information from file: %s\n" "$1" >&2 + fi + cat "$1" + exit 0 +} + + +# Uncomment the following line to help debug the error case +# ret_error "Some error happened for testing purposes" + + +test -d "$top_srcdir" || \ + ret_error "Could not change to top_srcdir '$1'" + + +# If this is a "make dist" source tree, use info from versioninfo_stamp file. +if test -f "$top_srcdir/$versioninfo_stamp"; then + ret_ok_file "$top_srcdir/$versioninfo_stamp" +fi + + +# This must be part of a git checkout or an expanded github snapshot tarball. +test -f "$top_srcdir/../CMakeLists.txt" || \ + ret_error "top-level avrdude CMakeLists.txt file not found" + + +# Find and parse "project(...)" line in top-level CmakeLists.txt file +if PROJECT_VERSION="$(${SED-sed} -n 's/project(avrdude[[:space:]]\{1,\}VERSION[[:space:]]\{1,\}\([0-9\.]\{1,\}\)[[:space:]]\{1,\}.*/\1/p' "$top_srcdir/../CMakeLists.txt")"; then + : +else + ret_error "Error parsing top-level avrdude 'CMakeLists.txt'." +fi + +test -n "$PROJECT_VERSION" || \ + ret_error "Cannot find project(...) in top-level avrdude 'CMakeLists.txt'" + + +# If GIT_DIR is set, use it. If not, try "$top_srcdir/../.git". +test -n "$GIT_DIR" || { \ + GIT_DIR="$top_srcdir/../.git"; \ + export GIT_DIR; \ +} + + +# If working with a git source tree, determine git information +if test -d "$GIT_DIR" && ${GIT-git} --version > /dev/null 2>&1; then + GIT_COMMIT_HASH="$(${GIT-git} log -1 --format=%h)" || \ + ret_error "$prog: Cannot run 'git log' for commit hash" + GIT_COMMIT_DATE="$(${GIT-git} log -1 --format=%cd --date=format:%Y%m%d)" || \ + ret_error "$prog: Error: Cannot run 'git log' for commit date" + GIT_TAG_HASH="$(${GIT-git} log -1 --tags --format=%h)" || \ + ret_error "$prog: Cannot run 'git log' for tag hash" + # This must be the same sequence as versioninfo_items in configure.ac + ret_ok "${PROJECT_VERSION}" \ + "${GIT_COMMIT_DATE}" "${GIT_COMMIT_HASH}" "${GIT_TAG_HASH}" +else # This is a github release tarball or github snapshot tarball + # Presume this is a release version, because who would build a + # non-release version from a snapshot tarball? + ret_ok "${PROJECT_VERSION}" +fi + + +# This code should never be reached. +ret_error "$prog: This code should never be reached." diff --git a/src/configure.ac b/src/configure.ac index 7b2a26071..7100c6a5f 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -35,9 +35,19 @@ dnl 2013-06-20 automake 1.14 dnl 2018-02-25 automake 1.16 dnl 2018-03-11 automake 1.16.1 install-sh symlink fix + +dnl Change this definition if you want to change the dist tarball name +dnl pattern from avrdude-7.3 for releases and avrdude-7.3-${COMMIT_DATE} +dnl for snapshots. +m4_define([versioninfo_AVRDUDE_PACKAGE_VERSION], + m4_case(m4_defn([versioninfo_GIT_COMMIT_HASH]), + m4_defn([versioninfo_GIT_TAG_HASH]), + m4_defn([versioninfo_CMAKE_PROJECT_VERSION]), + m4_defn([versioninfo_CMAKE_PROJECT_VERSION])-m4_defn([versioninfo_GIT_COMMIT_DATE]))) + AC_PREREQ([2.69]) AC_INIT([avrdude], - [m4_esyscmd(./build-helpers/package-version . version-stamp)], + m4_defn([versioninfo_AVRDUDE_PACKAGE_VERSION]), [https://github.com/avrdudes/avrdude/issues]) AC_CANONICAL_BUILD @@ -45,32 +55,38 @@ AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_CONFIG_SRCDIR([main.c]) -AC_CONFIG_HEADERS([ac_cfg.h]) AC_CONFIG_AUX_DIR([auto-aux]) +AC_CONFIG_HEADERS([ac_cfg.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([ 1.14 foreign + subdir-objects ]) AM_SILENT_RULES([yes]) -# Check that the build-helpers/package-version script has worked properly. -case "$PACKAGE_VERSION" in - devel|version_error_*) - AC_MSG_ERROR([ -Autogenerating the package version (${PACKAGE_VERSION}) has failed. +VERSIONINFO_SETUP() -Please file an issue at ${PACKAGE_BUGREPORT} +dnl Inform about the derived PACKAGE_VERSION +AC_MSG_CHECKING([versioninfo derived PACKAGE_VERSION]) +AC_MSG_RESULT([$PACKAGE_VERSION]) -You can write some version number to the file version-stamp as a -workaround to allow building avrdude until the filed issue has been -fixed. -]) - ;; -esac +dnl Compose the full version message mirroring the cmake one, inform +dnl about it and pass it on to avrdude.conf and the "avrdude -?" +dnl version message +AC_MSG_CHECKING([versioninfo derived AVRDUDE_FULL_VERSION]) +if test "x$GIT_COMMIT_HASH" = "x$GIT_TAG_HASH"; then + AVRDUDE_FULL_VERSION="$PACKAGE_VERSION" +else + AVRDUDE_FULL_VERSION="$PACKAGE_VERSION ($GIT_COMMIT_HASH)" +fi +AC_MSG_RESULT([$AVRDUDE_FULL_VERSION]) +AC_DEFINE_UNQUOTED([AVRDUDE_FULL_VERSION], ["$AVRDUDE_FULL_VERSION"], + [The full avrdude version as displayed in -? and avrdude.conf]) +AC_SUBST([AVRDUDE_FULL_VERSION]) # Checks for programs. @@ -607,12 +623,6 @@ AC_CONFIG_FILES([ GNUmakefile ]) -# Pass version number into avrdude.conf -dnl AVRDUDE_FULL_VERSION="${PACKAGE_VERSION} (${GIT_COMMIT_HASH})" -AVRDUDE_FULL_VERSION="$PACKAGE_VERSION" -AC_DEFINE_UNQUOTED([AVRDUDE_FULL_VERSION], ["$AVRDUDE_FULL_VERSION"], - [The full avrdude version as displayed in -? and avrdude.conf]) -AC_SUBST([AVRDUDE_FULL_VERSION]) # The procedure to create avrdude.conf involves two steps. First, # normal autoconf substitution will be applied, resulting in