From 7cf7c7363620cdedaf796b44dad07bb722bea2c7 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sat, 28 Oct 2023 23:46:35 +0300 Subject: [PATCH] Add Avrdude build version into avrdude.conf --- src/CMakeLists.txt | 1 + src/avrdude.conf.in | 3 +++ src/configure.ac | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce6131be..02bad689 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,6 +120,7 @@ add_custom_command( OUTPUT avrdude.conf COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/avrdude.conf.in" avrdude.conf.in COMMAND ${CMAKE_COMMAND} + -D "AVRDUDE_FULL_VERSION=${AVRDUDE_FULL_VERSION}" -D HAVE_PARPORT=$ -D HAVE_LINUXSPI=$ -D HAVE_LINUXGPIO=$ diff --git a/src/avrdude.conf.in b/src/avrdude.conf.in index 5d35fba1..62609329 100644 --- a/src/avrdude.conf.in +++ b/src/avrdude.conf.in @@ -432,6 +432,9 @@ # ATmega8 0x76 # ATmega169 0x78 +# Buildtime configuration +avrdude_version = "@AVRDUDE_FULL_VERSION@"; + # # Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc # diff --git a/src/configure.ac b/src/configure.ac index be34c6a0..a67dac28 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -543,6 +543,9 @@ AC_CONFIG_FILES([ Makefile ]) +# Pass into avrdude.conf.in +AVRDUDE_FULL_VERSION='$(VERSION)' + # The procedure to create avrdude.conf involves two steps. First, # normal autoconf substitution will be applied, resulting in # avrdude.conf.tmp. Finally, a sed command will be applied to filter