Skip to content

Commit

Permalink
Merge branch 'avrdudes:main' into arduino_packing_release_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuee authored Apr 7, 2024
2 parents 9115a99 + f2b1c7e commit 4443118
Show file tree
Hide file tree
Showing 96 changed files with 1,405 additions and 749 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arduino_packing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: |
if [ "${{ matrix.config.os }}" = "macOS" ]; then
# For darwin we disable the static flags (not supported by clang) and we make some adjustments
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -DUSE_STATIC_LIBS="ON" -B build/
else
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compile }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compile }}-g++ -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include/libusb-1.0/ -I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/
fi
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,51 @@ env:
BUILD_TYPE: RelWithDebInfo

jobs:
linux-x86_64-autotools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
sudo apt-get update
sudo apt-get install -y
build-essential
automake
libtool
gettext
flex
bison
libelf-dev
libusb-dev
libusb-1.0-0-dev
libhidapi-dev
libftdi1-dev
libreadline-dev
libserialport-dev
texinfo
texlive
texi2html
- name: Configure
run: >-
autoreconf -vis src
mkdir _ambuild && cd _ambuild
../src/configure
--enable-doc
--enable-parport
--enable-linuxgpio
--enable-linuxspi
- name: Build
run: make -C _ambuild -j$(nproc)
- name: Install
run: sudo make -C _ambuild install
- name: Dryrun_test
run: printf "\n\n" | ./tools/test-avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
- name: distcheck
run: make -C _ambuild -j$(nproc) distcheck

linux-x86_64:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ ltmain.sh
ylwrap
tags
cscope.out
/src/avrdude-[1-9].*.tar.*
/src/avrdude-[1-9].[0-9].tar.*
/src/avrdude-[1-9].[0-9]/
/src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9].tar.*
/src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9]/
/src/GNUmakefile

*.o
Expand All @@ -52,6 +55,9 @@ cscope.out
out/
build/
build_*/
CMakeFiles/
/CMakeCache.txt
cmake_install.cmake

# Visual Studio
.vs/
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ if(Git_FOUND)
)

execute_process(
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y%m%d
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cd --date=format:%Y%m%d
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cd --date=format:%Y
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_YEAR
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
28 changes: 25 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,33 @@ Changes since version 7.3:
* New programmers supported:

* Issues fixed:
- Avrintel.h missing from installation #1683
- Use of undeclared identifier 'AVRDUDE_FULL_VERSION' #1706
- Wrong message level in jtag3_prmsg() #1726
- Old avrdude_message() can go away #1719
- avr_{read,write}_mem fail to initialize progress reporting #1718
- avr*timestamp() oddities #1722

* Pull requests:
- Remove 32bit MSYS2 mingw32 and clang32 build #1687
- Make avrintel.h an internal header file for libavrdude #1686
- Fix -Wcalloc-transposed-args warning #1680
- Remove 32bit MSYS2 mingw32 and clang32 build #1687
- Make avrintel.h an internal header file for libavrdude #1686
- Fix -Wcalloc-transposed-args warning #1680
- Improve autotool build #1681
- Installation of libavrdude-avrintel.h #1688
- Updated documentation about NVM models support #1689
- Abbreviate ids of modern AVR parts #1703
- Allow slash in part variant name for -p #1702
- Fix reporting of read/write times for files with holes #1700
- Change port array in PROGRAMMER to be const char * #1699
- Fix cmake build errors related to ac_cfg.h #1707
- Add benchmark option -b for test-avrdude #1709
- Replace msg_info() by msg_debug() in jtag3_prmsg()
and jtag3_prevent() #1727
- Remove unused avrdude_message() #1730
- Add lmsg_xyz() functions to start message at left margin #1728
- Document progress reporting in source code #1724
- Change type for avr_(ms|us)timestamp() to uint64_t #1729
- Use Static Libs for macOS arduino_packing build #1731

* Internals:

Expand Down
24 changes: 17 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,19 @@ endif()
# Configure files
# =====================================

configure_file(cmake_config.h.in ac_cfg.h)
configure_file(avrdude.spec.in avrdude.spec)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/ac_cfg.h"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/avrdude.spec.in"
"${CMAKE_CURRENT_BINARY_DIR}/avrdude.spec"
)
if(WIN32 OR MINGW)
configure_file(windows.rc.in windows.rc)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/windows.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
)
endif()

add_custom_command(
Expand All @@ -142,7 +151,7 @@ add_custom_target(conf ALL DEPENDS avrdude.conf)
# =====================================

add_library(libavrdude
ac_cfg.h
${CMAKE_CURRENT_BINARY_DIR}/ac_cfg.h
arduino.h
arduino.c
avr.c
Expand Down Expand Up @@ -278,9 +287,9 @@ add_library(libavrdude

set_target_properties(libavrdude PROPERTIES
PREFIX ""
PUBLIC_HEADER "libavrdude.h"
VERSION 1.0.0
SOVERSION 1
PUBLIC_HEADER "libavrdude.h;libavrdude-avrintel.h"
VERSION 2.0.0
SOVERSION 2
)

target_include_directories(libavrdude
Expand Down Expand Up @@ -316,6 +325,7 @@ add_executable(avrdude
developer_opts_private.h
whereami.c
whereami.h
${CMAKE_CURRENT_BINARY_DIR}/ac_cfg.h
${EXTRA_WINDOWS_RESOURCES}
)

Expand Down
20 changes: 10 additions & 10 deletions src/GNUmakefile.in
Original file line number Diff line number Diff line change
@@ -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 $(top_srcdir)/bootstrap)
endif

# vim: syntax=make
7 changes: 4 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CLEANFILES = \
config_gram.h \
lexer.c

include build-helpers/package-version.mk
include build-helpers/versioninfo.mk

BUILT_SOURCES = $(CLEANFILES)

Expand Down Expand Up @@ -219,9 +219,10 @@ libavrdude_a_SOURCES = \
xbee.h \
xbee.c
libavrdude_la_SOURCES = $(libavrdude_a_SOURCES)
libavrdude_la_LDFLAGS = -version-info 1:0
libavrdude_la_LDFLAGS = -version-info 2:0

include_HEADERS = libavrdude.h
include_HEADERS += libavrdude-avrintel.h

avrdude_SOURCES = \
main.c \
Expand All @@ -248,4 +249,4 @@ backup-avrdude-conf:
${DESTDIR}${sysconfdir}/avrdude.conf.bak; \
fi

ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I auto-m4 -I build-helpers
4 changes: 2 additions & 2 deletions src/arduino.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* are read differently.
*/

#include "ac_cfg.h"
#include <ac_cfg.h>

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -78,7 +78,7 @@ static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const

static int arduino_open(PROGRAMMER *pgm, const char *port) {
union pinfo pinfo;
strcpy(pgm->port, port);
pgm->port = port;
pinfo.serialinfo.baud = pgm->baudrate? pgm->baudrate: 115200;
pinfo.serialinfo.cflags = SERIAL_8N1;
if (serial_open(port, pinfo, &pgm->fd)==-1) {
Expand Down
2 changes: 2 additions & 0 deletions src/auto-aux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensure git creates empty directory for autotools to place files into
*
2 changes: 2 additions & 0 deletions src/auto-m4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensure creation of empty directory for autotools to place files into
*
57 changes: 57 additions & 0 deletions src/autotools-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#! /bin/sh

set -ex

cd "$(dirname "$0")"
top_srcdir="$(pwd)"

ostype="$(uname | tr A-Z a-z)"

if test "x$MAKE" = x; then
if gmake --version > /dev/null 2>&1; then
MAKE=gmake
fi
fi
make="${make-"${MAKE-make} -j$(nproc)"}"

rm -rf autom4te.cache/

prefix="$top_srcdir/build_autotools-prefix"
rm -rf "$prefix"

top_builddir="$top_srcdir/build_autotools"

# Remove remainders of failed distcheck attempts
for dir in "$top_builddir"
do
if test -d "$dir"; then
chmod -R +w "$dir"
fi
done
rm -rf "$top_builddir"

./bootstrap

mkdir "$top_builddir"
cd "$top_builddir"

configure_opts=""
configure_opts="$configure_opts --disable-silent-rules"
configure_opts="$configure_opts --enable-parport"
case "$ostype" in
*linux)
configure_opts="$configure_opts --enable-linuxgpio --enable-linuxspi"
configure_opts="$configure_opts --enable-doc"
;;
esac

$top_srcdir/configure --prefix="$prefix" ${configure_opts}

$make all
$make check
$make install
$make installcheck

printf "\n\n" | $top_srcdir/../tools/test-avrdude -e $prefix/bin/avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"

$make distcheck
Loading

0 comments on commit 4443118

Please sign in to comment.