Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Avrdude build version into avrdude.conf #1542

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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=$<BOOL:${HAVE_PARPORT}>
-D HAVE_LINUXSPI=$<BOOL:${HAVE_LINUXSPI}>
-D HAVE_LINUXGPIO=$<BOOL:${HAVE_LINUXGPIO}>
Expand Down
3 changes: 3 additions & 0 deletions src/avrdude.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@
# ATmega8 0x76
# ATmega169 0x78

# Buildtime configuration
avrdude_version = "@AVRDUDE_FULL_VERSION@";

#
# Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc
#
Expand Down
3 changes: 3 additions & 0 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ AC_CONFIG_FILES([
Makefile
])

# Pass into avrdude.conf.in
AVRDUDE_FULL_VERSION='$(VERSION)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no autotools expert (nor user for that matter), but my guess is that one more line is missing to make it work:

AC_SUBST(AVRDUDE_FULL_VERSION, $AVRDUDE_FULL_VERSION)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe even:

AC_SUBST(AVRDUDE_FULL_VERSION, '$(VERSION)')

instead


# 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
Expand Down