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

Automatically determine Autoconf package version from cmake package version #1663

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

ndim
Copy link
Contributor

@ndim ndim commented Feb 6, 2024

This PR will determine the PACKAGE_VERSION which the Automake/Autoconf avrdude package uses from the package version which the top level CMakeLists.txt file uses.

ETA 2024-02-06 23:59:59 UTC.

@mcuee mcuee added the enhancement New feature or request label Feb 6, 2024
@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

@ndim

It seems to me you are pretty good at auto-tools. Just wondering if you can help to fix the issue with libreadline status as well.

I tried to fix it last time but it caused issues with macOS terminal mode and I have to revert the following PR.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

Other than that, there are other issues as well.

Example build log under MSYS2 mingw64. You can see there are many warnings.

 MINGW64 /c/work/avr/avrdude_test/avrdude_main/src
$ ./bootstrap
+ rm -rf autom4te.cache
+ LIBTOOLIZE=libtoolize
+ glibtoolize --version
+ libtoolize
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
+ aclocal
+ autoheader
+ autoconf
configure.ac:46: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
../autoconf-2.72/lib/autoconf/programs.m4:743: _AC_PROG_LEX is expanded from...
../autoconf-2.72/lib/autoconf/programs.m4:736: AC_PROG_LEX is expanded from...
configure.ac:46: the top level
configure.ac:123: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:123: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:123: the top level
configure.ac:243: warning: The macro 'AC_HEADER_TIME' is obsolete.
configure.ac:243: You should run autoupdate.
../autoconf-2.72/lib/autoconf/headers.m4:702: AC_HEADER_TIME is expanded from...
configure.ac:243: the top level
configure.ac:265: warning: The macro 'AC_TRY_LINK' is obsolete.
configure.ac:265: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:2918: AC_TRY_LINK is expanded from...
configure.ac:265: the top level
configure.ac:297: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:297: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:297: the top level
configure.ac:315: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:315: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:315: the top level
configure.ac:327: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:327: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:327: the top level
configure.ac:339: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:339: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:339: the top level
configure.ac:351: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:351: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:351: the top level
configure.ac:474: warning: The macro 'AC_TRY_COMPILE' is obsolete.
configure.ac:474: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:2845: AC_TRY_COMPILE is expanded from...
configure.ac:474: the top level
configure.ac:499: warning: The macro 'AC_TRY_COMPILE' is obsolete.
configure.ac:499: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:2845: AC_TRY_COMPILE is expanded from...
configure.ac:499: the top level
configure.ac:523: warning: The macro 'AC_TRY_LINK' is obsolete.
configure.ac:523: You should run autoupdate.
../autoconf-2.72/lib/autoconf/general.m4:2918: AC_TRY_LINK is expanded from...
configure.ac:523: the top level
+ automake -a -c
configure.ac:37: installing './compile'
configure.ac:28: installing './config.guess'
configure.ac:28: installing './config.sub'
configure.ac:33: installing './install-sh'
configure.ac:33: installing './missing'
Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'
doc/Makefile.am:33: installing 'doc/mdate-sh'
doc/Makefile.am:33: installing 'doc/texinfo.tex'

$ ./configure --prefix=/mingw64
configure: loading site script /etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking target system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for -ar... ar
checking whether yylex_destroy is generated by flex... version 2.6.4 => yes
checking for WSAStartup in -lws2_32... yes
checking for tputs in -ltermcap... yes
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for elf_getshdrstrndx in -lelf... yes
checking for libelf.h... yes
checking for libelf/libelf.h... yes
checking for library containing gethostent... no
checking for library containing setsockopt... none required
checking for usb_get_string_simple in -lusb... yes
checking for usb.h... no
checking for lusb0_usb.h... yes
checking for libusb_init in -lusb-1.0... yes
checking for libusb-1.0/libusb.h... yes
checking for libusb.h... no
checking for libusb_init in -lusb... no
checking for libusb.h... (cached) no
checking for library containing hid_init... -lhidapi
checking for hidapi/hidapi.h... yes
checking for sp_open in -lserialport... yes
checking for libserialport.h... yes
checking for ftdi_new in -lftdi1... yes
checking for ftdi_usb_get_strings in -lftdi... no
checking for ftdi_tcioflush... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for fcntl.h... yes
checking for sys/ioctl.h... no
checking for sys/time.h... (cached) yes
checking for termios.h... no
checking for unistd.h... (cached) yes
checking for ddk/hidsdi.h... no
checking for an ANSI C-conforming const... yes
checking for netinet/in.h... no
checking for memset... yes
checking for select... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for strtoul... yes
checking for gettimeofday... yes
checking for usleep... yes
checking for getaddrinfo... yes
checking for a Win32 HID library... yes
checking for uint_t... no
checking for ulong_t... no
checking for serial device... com1
checking if gcc accepts -Wno-pointer-sign ... yes
checking if gcc accepts -mno-cygwin... no
configure: Your compiler does not understand the -mno-cygwin option.
configure: You might want to select an alternative compiler, like
configure:
configure: CC=mingw32-gcc ./configure
configure:
checking if linker accepts -static... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating doc/Makefile
config.status: creating avrdude.spec
config.status: creating Makefile
config.status: creating avrdude.conf.tmp
config.status: creating ac_cfg.h
config.status: executing depfiles commands
config.status: executing libtool commands


Configuration summary:
----------------------
DO HAVE    libelf
DO HAVE    libusb
DO HAVE    libusb_1_0
DO HAVE    libftdi1
DON'T HAVE libftdi
DO HAVE    libhid
DO HAVE    libhidapi
DON'T HAVE libreadline
DO HAVE    libserialport
DO HAVE    pthread
DISABLED   doc
DISABLED   parport
DISABLED   linuxgpio
DISABLED   linuxspi

$ make
  YACC     config_gram.c
updating config_gram.h
  LEX      lexer.c
make  all-recursive
make[1]: Entering directory '/c/work/avr/avrdude_test/avrdude_main/src'
Making all in .
make[2]: Entering directory '/c/work/avr/avrdude_test/avrdude_main/src'
  CC       avrdude-main.o
  CC       avrdude-whereami.o
  CC       avrdude-developer_opts.o
  CC       libavrdude_a-config_gram.o
  CC       libavrdude_a-lexer.o
  CC       libavrdude_a-arduino.o
  CC       libavrdude_a-avr.o
  CC       libavrdude_a-avr910.o
  CC       libavrdude_a-avrcache.o
  CC       libavrdude_a-avrftdi.o
  CC       libavrdude_a-avrftdi_tpi.o
  CC       libavrdude_a-avrintel.o
  CC       libavrdude_a-avrpart.o
  CC       libavrdude_a-bitbang.o
  CC       libavrdude_a-buspirate.o
  CC       libavrdude_a-butterfly.o
  CC       libavrdude_a-ch341a.o
  CC       libavrdude_a-config.o
  CC       libavrdude_a-confwin.o
  CC       libavrdude_a-crc16.o
  CC       libavrdude_a-dfu.o
  CC       libavrdude_a-dryrun.o
  CC       libavrdude_a-fileio.o
  CC       libavrdude_a-flip1.o
  CC       libavrdude_a-flip2.o
  CC       libavrdude_a-ft245r.o
  CC       libavrdude_a-jtagmkI.o
  CC       libavrdude_a-jtagmkII.o
  CC       libavrdude_a-jtag3.o
  CC       libavrdude_a-leds.o
  CC       libavrdude_a-linuxgpio.o
  CC       libavrdude_a-linuxspi.o
  CC       libavrdude_a-lists.o
  CC       libavrdude_a-micronucleus.o
  CC       libavrdude_a-par.o
  CC       libavrdude_a-pgm.o
  CC       libavrdude_a-pgm_type.o
  CC       libavrdude_a-pickit2.o
  CC       libavrdude_a-pindefs.o
  CC       libavrdude_a-ppi.o
  CC       libavrdude_a-ppiwin.o
  CC       libavrdude_a-serbb_posix.o
  CC       libavrdude_a-serbb_win32.o
  CC       libavrdude_a-ser_avrdoper.o
  CC       libavrdude_a-ser_posix.o
  CC       libavrdude_a-ser_win32.o
  CC       libavrdude_a-serialadapter.o
  CC       libavrdude_a-stk500.o
  CC       libavrdude_a-stk500v2.o
  CC       libavrdude_a-stk500generic.o
  CC       libavrdude_a-strutil.o
  CC       libavrdude_a-teensy.o
  CC       libavrdude_a-term.o
  CC       libavrdude_a-usbasp.o
  CC       libavrdude_a-serialupdi.o
  CC       libavrdude_a-updi_link.o
  CC       libavrdude_a-updi_state.o
  CC       libavrdude_a-updi_readwrite.o
  CC       libavrdude_a-updi_nvm.o
  CC       libavrdude_a-updi_nvm_v0.o
  CC       libavrdude_a-updi_nvm_v2.o
  CC       libavrdude_a-updi_nvm_v3.o
  CC       libavrdude_a-updi_nvm_v4.o
  CC       libavrdude_a-updi_nvm_v5.o
  CC       libavrdude_a-urclock.o
  CC       libavrdude_a-usb_hidapi.o
  CC       libavrdude_a-usb_libusb.o
  CC       libavrdude_a-usbtiny.o
  CC       libavrdude_a-update.o
  CC       libavrdude_a-wiring.o
  CC       libavrdude_a-xbee.o
  AR       libavrdude.a
C:\msys64\mingw64\bin\ar.exe: `u' modifier ignored since `D' is the default (see `U')
  CCLD     avrdude.exe
  CC       libavrdude_la-config_gram.lo
  CC       libavrdude_la-lexer.lo
  CC       libavrdude_la-arduino.lo
  CC       libavrdude_la-avr.lo
  CC       libavrdude_la-avr910.lo
  CC       libavrdude_la-avrcache.lo
  CC       libavrdude_la-avrftdi.lo
  CC       libavrdude_la-avrftdi_tpi.lo
  CC       libavrdude_la-avrintel.lo
  CC       libavrdude_la-avrpart.lo
  CC       libavrdude_la-bitbang.lo
  CC       libavrdude_la-buspirate.lo
  CC       libavrdude_la-butterfly.lo
  CC       libavrdude_la-ch341a.lo
  CC       libavrdude_la-config.lo
  CC       libavrdude_la-confwin.lo
  CC       libavrdude_la-crc16.lo
  CC       libavrdude_la-dfu.lo
  CC       libavrdude_la-dryrun.lo
  CC       libavrdude_la-fileio.lo
  CC       libavrdude_la-flip1.lo
  CC       libavrdude_la-flip2.lo
  CC       libavrdude_la-ft245r.lo
  CC       libavrdude_la-jtagmkI.lo
  CC       libavrdude_la-jtagmkII.lo
  CC       libavrdude_la-jtag3.lo
  CC       libavrdude_la-leds.lo
  CC       libavrdude_la-linuxgpio.lo
  CC       libavrdude_la-linuxspi.lo
  CC       libavrdude_la-lists.lo
  CC       libavrdude_la-micronucleus.lo
  CC       libavrdude_la-par.lo
  CC       libavrdude_la-pgm.lo
  CC       libavrdude_la-pgm_type.lo
  CC       libavrdude_la-pickit2.lo
  CC       libavrdude_la-pindefs.lo
  CC       libavrdude_la-ppi.lo
  CC       libavrdude_la-ppiwin.lo
  CC       libavrdude_la-serbb_posix.lo
  CC       libavrdude_la-serbb_win32.lo
  CC       libavrdude_la-ser_avrdoper.lo
  CC       libavrdude_la-ser_posix.lo
  CC       libavrdude_la-ser_win32.lo
  CC       libavrdude_la-serialadapter.lo
  CC       libavrdude_la-stk500.lo
  CC       libavrdude_la-stk500v2.lo
  CC       libavrdude_la-stk500generic.lo
  CC       libavrdude_la-strutil.lo
  CC       libavrdude_la-teensy.lo
  CC       libavrdude_la-term.lo
  CC       libavrdude_la-usbasp.lo
  CC       libavrdude_la-serialupdi.lo
  CC       libavrdude_la-updi_link.lo
  CC       libavrdude_la-updi_state.lo
  CC       libavrdude_la-updi_readwrite.lo
  CC       libavrdude_la-updi_nvm.lo
  CC       libavrdude_la-updi_nvm_v0.lo
  CC       libavrdude_la-updi_nvm_v2.lo
  CC       libavrdude_la-updi_nvm_v3.lo
  CC       libavrdude_la-updi_nvm_v4.lo
  CC       libavrdude_la-updi_nvm_v5.lo
  CC       libavrdude_la-urclock.lo
  CC       libavrdude_la-usb_hidapi.lo
  CC       libavrdude_la-usb_libusb.lo
  CC       libavrdude_la-usbtiny.lo
  CC       libavrdude_la-update.lo
  CC       libavrdude_la-wiring.lo
  CC       libavrdude_la-xbee.lo
  CCLD     libavrdude.la
libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only
make[2]: Leaving directory '/c/work/avr/avrdude_test/avrdude_main/src'
make[1]: Leaving directory '/c/work/avr/avrdude_test/avrdude_main/src'

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

@ndim

But no issues if you do not have the time and only fix the version number issue for avrdude 7.3 release. It is just my wish that you can help fix some of the issues with the auto-tools scripts.

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

I do have plans for the Autotools buildsystem, but I did not want to distract anybody from the 7.3 release you had already planned out before I started pushing PRs to you a couple of weeks ago.

Automatic version number possibly for 7.3, and everything else after 7.3 would be my preferred option.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

I do have plans for the Autotools buildsystem, but I did not want to distract anybody from the 7.3 release you had already planned out before I started pushing PRs to you a couple of weeks ago.

Automatic version number possibly for 7.3, and everything else after 7.3 would be my preferred option.

This is perfectly fine. Thanks a lot for the help.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

Ideally, this should be done now.

I will run some tests later on different operating systems before I declare this "Ready for review" and for merging. I have VMs with Debian, Ubuntu, Arch, FreeBSD in addition to my Fedora development system to test on:

  • build from git checkout (with and without a matching tag)
  • build from unpacked git snapshot tarball (just like a release tarball)
  • build from tarball generated by make dist, both without and with running autoreconf before the configure step

The test procedure is basically:

set -e
if test -f src/configure; then grep ^PACKAGE_VERSION= src/configure; fi
autoreconf -vis src
grep ^PACKAGE_VERSION= src/configure

Or with a few more checks

set -e
if test -f src/configure; then
  mkdir _b1
  cd _b1
  ../src/configure
  cd ..
fi
autoreconf -vis src
mkdir _b2
cd _b2
../src/configure

@ndim ndim force-pushed the autoconf-package-version branch 2 times, most recently from df2dbad to 5ed2201 Compare February 6, 2024 13:29
@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

I can test under Windows (MSYS2 mingw64), macOS (Homebrew) and Linux (Ubuntu 20.04). I can also test under FreeBSD/OpenBSD/NetBSD if necessary.

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

BTW, I am not sure whether you actually want the added CI build. It only checks the consistency of the Autotools build system.

I could not easily get the test script to work yet without investing more than a few cursory glances into it.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

BTW, I am not sure whether you actually want the added CI build. It only checks the consistency of the Autotools build system.

I could not easily get the test script to work yet without investing more than a few cursory glances into it.

To save the efforts and speed up avrdued 7.3 release, I will suggest we do not add this to CI first. We can do this post 7.3 release.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

The version number here is a bit different from CMake build -- no git commit ID info.

   85  cd avrdude_pr1663/
   86  ls
   87  cd src/
   88  ./bootstrap
   89  ./configure --prefix=/mingw64
   90  make
   91  ./avrdude.exe
   92  head avrdude.conf

MINGW64 /c/work/avr/avrdude_test/avrdude_pr1663/src
$ ./avrdude.exe
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20240206, https://github.com/avrdudes/avrdude

$ head avrdude.conf
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20240206";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

git main CMake build has the data and git commit ID.

MINGW64 /c/work/avr/avrdude_test/avrdude_main/build_mingw64_nt-10.0-22631/src
$ ./avrdude.exe
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20240206 (1a64d383), https://github.com/avrdudes/avrdude

$ head avrdude.conf
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20240206 (1a64d383)";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

@ndim Is it possible for you to follow CMake build as well? Thanks. But if it is a bit troublesome, we can live with this.

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

make dist seems to work under MSYS2 mingw64 (Windows 11 laptop).

MINGW64 /c/work/avr/avrdude_test/avrdude_pr1663/src
$ make dist
make  dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
make  distdir-am
make[2]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
if test -d "avrdude-7.2-20240206"; then find "avrdude-7.2-20240206" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "avrdude-7.2-20240206" || { sleep 5 && rm -rf "avrdude-7.2-20240206"; }; else :; fi
test -d "avrdude-7.2-20240206" || mkdir "avrdude-7.2-20240206"
 (cd doc && make  top_distdir=../avrdude-7.2-20240206 distdir=../avrdude-7.2-20240206/doc \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
make  distdir-am
make[4]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
Updating ./version.texi
make  \
  top_distdir="../avrdude-7.2-20240206" distdir="../avrdude-7.2-20240206/doc" \
  dist-info
make[5]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
../avrdude.exe -C ../avrdude.conf -c \? 2>&1 \
| gawk '$2 ~ /^=$/ {printf("@item @code{%s} @tab %s\n",$1,gensub("[^=]+=[ \t]*","",1))}' \
| sed "s# *,\? *<\?\(http://[^ \t>]*\)>\?#,@*\n@url{\1}#g" \
>programmers.texi
../avrdude.exe -C ../avrdude.conf -p \? 2>&1 \
| gawk '$2 ~ /^=$/ {printf("@item @code{%s} @tab %s\n",$1,$3)}' \
| sed -e "`sed 's:\([^ \t]*\)[ \t]*\(.*\):s/\1$/\1 \2/g:g' <parts_comments.txt`" \
>parts.texi
../avrdude.exe -C ../avrdude.conf -c \?type 2>&1 \
| gawk '$2 ~ /^=$/ {printf("@item @code{%s} @tab %s\n",$1,gensub("[^=]+=[ \t]*","",1))}' \
| sed "s#<\?\(http://[^ \t,>]*\)>\?#@url{\1}#g" \
>programmer_types.texi
  MAKEINFO avrdude.info
make[5]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
make[4]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
make[3]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/doc'
make  \
  top_distdir="avrdude-7.2-20240206" distdir="avrdude-7.2-20240206" \
  dist-hook
make[3]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
echo "7.2-20240206" > "avrdude-7.2-20240206/version-stamp"
rm -f \
avrdude-7.2-20240206/lexer.c \
avrdude-7.2-20240206/config_gram.c \
avrdude-7.2-20240206/config_gram.h
make[3]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
test -n "" \
|| find "avrdude-7.2-20240206" -type d ! -perm -755 \
        -exec chmod u+rwx,go+rx {} \; -o \
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh /c/work/avr/avrdude_test/avrdude_pr1663/src/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "avrdude-7.2-20240206"
make[2]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
tardir=avrdude-7.2-20240206 && ${TAR-tar} chof - "$tardir" | eval GZIP= gzip --best -c >avrdude-7.2-20240206.tar.gz
make[1]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src'
if test -d "avrdude-7.2-20240206"; then find "avrdude-7.2-20240206" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "avrdude-7.2-20240206" || { sleep 5 && rm -rf "avrdude-7.2-20240206"; }; else :; fi

$ tar xvf avrdude-7.2-20240206.tar.gz
...
$ cd avrdude-7.2-20240206/

$ ls
ac_cfg.h.in      avrftdi_private.h  ch341a.h          developer_opts_private.h  GNUmakefile.in      linuxgpio.c     pgm.c            serialupdi.c        tpi.h             updi_nvm_v5.c      usbtiny.c
aclocal.m4       avrftdi_tpi.c      compile           dfu.c                     install-sh          linuxgpio.h     pgm_type.c       serialupdi.h        update.c          updi_nvm_v5.h      usbtiny.h
arduino.c        avrftdi_tpi.h      config.c          dfu.h                     jtag3.c             linuxspi.c      pickit2.c        solaris_ecpp.h      updi_constants.h  updi_readwrite.c   version-stamp
arduino.h        avrintel.c         config.guess      doc                       jtag3.h             linuxspi.h      pickit2.h        stk500.c            updi_link.c       updi_readwrite.h   whereami.c
avr.c            avrintel.h         config.h          dryrun.c                  jtag3_private.h     lists.c         pindefs.c        stk500.h            updi_link.h       updi_state.c       whereami.h
avr910.c         avrpart.c          config.sub        dryrun.h                  jtagmkI.c           ltmain.sh       ppi.c            stk500_private.h    updi_nvm.c        updi_state.h       wiring.c
avr910.h         bitbang.c          config_gram.y     dryrun_private.h          jtagmkI.h           m4              ppi.h            stk500generic.c     updi_nvm.h        urclock.c          wiring.h
avrcache.c       bitbang.h          configure         fileio.c                  jtagmkI_private.h   main.c          ppiwin.c         stk500generic.h     updi_nvm_v0.c     urclock.h          xbee.c
avrdude.1        bootstrap          configure.ac      flip1.c                   jtagmkII.c          Makefile.am     ser_avrdoper.c   stk500v2.c          updi_nvm_v0.h     urclock_hash.h     xbee.h
avrdude.conf.in  build-helpers      confwin.c         flip1.h                   jtagmkII.h          Makefile.in     ser_posix.c      stk500v2.h          updi_nvm_v2.c     urclock_private.h  ylwrap
avrdude.h        buspirate.c        crc16.c           flip2.c                   jtagmkII_private.h  micronucleus.c  ser_win32.c      stk500v2_private.h  updi_nvm_v2.h     usb_hidapi.c
avrdude.spec     buspirate.h        crc16.h           flip2.h                   leds.c              micronucleus.h  serbb.h          strutil.c           updi_nvm_v3.c     usb_libusb.c
avrdude.spec.in  butterfly.c        depcomp           freebsd_ppi.h             lexer.l             missing         serbb_posix.c    teensy.c            updi_nvm_v3.h     usbasp.c
avrftdi.c        butterfly.h        developer_opts.c  ft245r.c                  libavrdude.h        par.c           serbb_win32.c    teensy.h            updi_nvm_v4.c     usbasp.h
avrftdi.h        ch341a.c           developer_opts.h  ft245r.h                  linux_ppdev.h       par.h           serialadapter.c  term.c              updi_nvm_v4.h     usbdevs.h

@mcuee
Copy link
Collaborator

mcuee commented Feb 6, 2024

Build log of the resulting tarball from make dist -- seems to be okay.

MINGW64 /c/work/avr/avrdude_test/avrdude_pr1663/src/avrdude-7.2-20240206
$ ./configure --prefix=/mingw64
configure: loading site script /etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking target system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for -ar... ar
checking whether yylex_destroy is generated by flex... version 2.6.4 => yes
checking for WSAStartup in -lws2_32... yes
checking for tputs in -ltermcap... yes
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for elf_getshdrstrndx in -lelf... yes
checking for libelf.h... yes
checking for libelf/libelf.h... yes
checking for library containing gethostent... no
checking for library containing setsockopt... none required
checking for usb_get_string_simple in -lusb... yes
checking for usb.h... no
checking for lusb0_usb.h... yes
checking for libusb_init in -lusb-1.0... yes
checking for libusb-1.0/libusb.h... yes
checking for libusb.h... no
checking for libusb_init in -lusb... no
checking for libusb.h... (cached) no
checking for library containing hid_init... -lhidapi
checking for hidapi/hidapi.h... yes
checking for sp_open in -lserialport... yes
checking for libserialport.h... yes
checking for ftdi_new in -lftdi1... yes
checking for ftdi_usb_get_strings in -lftdi... no
checking for ftdi_tcioflush... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for fcntl.h... yes
checking for sys/ioctl.h... no
checking for sys/time.h... (cached) yes
checking for termios.h... no
checking for unistd.h... (cached) yes
checking for ddk/hidsdi.h... no
checking for an ANSI C-conforming const... yes
checking for netinet/in.h... no
checking for memset... yes
checking for select... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for strtoul... yes
checking for gettimeofday... yes
checking for usleep... yes
checking for getaddrinfo... yes
checking for a Win32 HID library... yes
checking for uint_t... no
checking for ulong_t... no
checking for serial device... com1
checking if gcc accepts -Wno-pointer-sign ... yes
checking if gcc accepts -mno-cygwin... no
configure: Your compiler does not understand the -mno-cygwin option.
configure: You might want to select an alternative compiler, like
configure:
configure: CC=mingw32-gcc ./configure
configure:
checking if linker accepts -static... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating doc/Makefile
config.status: creating avrdude.spec
config.status: creating Makefile
config.status: creating GNUmakefile
config.status: creating avrdude.conf.tmp
config.status: creating ac_cfg.h
config.status: executing depfiles commands
config.status: executing libtool commands


Configuration summary:
----------------------
DO HAVE    libelf
DO HAVE    libusb
DO HAVE    libusb_1_0
DO HAVE    libftdi1
DON'T HAVE libftdi
DO HAVE    libhid
DO HAVE    libhidapi
DON'T HAVE libreadline
DO HAVE    libserialport
DO HAVE    pthread
DISABLED   doc
DISABLED   parport
DISABLED   linuxgpio
DISABLED   linuxspi

$ make
  YACC     config_gram.c
updating config_gram.h
  LEX      lexer.c
make  all-recursive
make[1]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/avrdude-7.2-20240206'
Making all in .
make[2]: Entering directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/avrdude-7.2-20240206'
  CC       avrdude-main.o
  CC       avrdude-whereami.o
  CC       avrdude-developer_opts.o
  CC       libavrdude_a-config_gram.o
  CC       libavrdude_a-lexer.o
  CC       libavrdude_a-arduino.o
  CC       libavrdude_a-avr.o
  CC       libavrdude_a-avr910.o
  CC       libavrdude_a-avrcache.o
  CC       libavrdude_a-avrftdi.o
  CC       libavrdude_a-avrftdi_tpi.o
  CC       libavrdude_a-avrintel.o
  CC       libavrdude_a-avrpart.o
  CC       libavrdude_a-bitbang.o
  CC       libavrdude_a-buspirate.o
  CC       libavrdude_a-butterfly.o
  CC       libavrdude_a-ch341a.o
  CC       libavrdude_a-config.o
  CC       libavrdude_a-confwin.o
  CC       libavrdude_a-crc16.o
  CC       libavrdude_a-dfu.o
  CC       libavrdude_a-dryrun.o
  CC       libavrdude_a-fileio.o
  CC       libavrdude_a-flip1.o
  CC       libavrdude_a-flip2.o
  CC       libavrdude_a-ft245r.o
  CC       libavrdude_a-jtagmkI.o
  CC       libavrdude_a-jtagmkII.o
  CC       libavrdude_a-jtag3.o
  CC       libavrdude_a-leds.o
  CC       libavrdude_a-linuxgpio.o
  CC       libavrdude_a-linuxspi.o
  CC       libavrdude_a-lists.o
  CC       libavrdude_a-micronucleus.o
  CC       libavrdude_a-par.o
  CC       libavrdude_a-pgm.o
  CC       libavrdude_a-pgm_type.o
  CC       libavrdude_a-pickit2.o
  CC       libavrdude_a-pindefs.o
  CC       libavrdude_a-ppi.o
  CC       libavrdude_a-ppiwin.o
  CC       libavrdude_a-serbb_posix.o
  CC       libavrdude_a-serbb_win32.o
  CC       libavrdude_a-ser_avrdoper.o
  CC       libavrdude_a-ser_posix.o
  CC       libavrdude_a-ser_win32.o
  CC       libavrdude_a-serialadapter.o
  CC       libavrdude_a-stk500.o
  CC       libavrdude_a-stk500v2.o
  CC       libavrdude_a-stk500generic.o
  CC       libavrdude_a-strutil.o
  CC       libavrdude_a-teensy.o
  CC       libavrdude_a-term.o
  CC       libavrdude_a-usbasp.o
  CC       libavrdude_a-serialupdi.o
  CC       libavrdude_a-updi_link.o
  CC       libavrdude_a-updi_state.o
  CC       libavrdude_a-updi_readwrite.o
  CC       libavrdude_a-updi_nvm.o
  CC       libavrdude_a-updi_nvm_v0.o
  CC       libavrdude_a-updi_nvm_v2.o
  CC       libavrdude_a-updi_nvm_v3.o
  CC       libavrdude_a-updi_nvm_v4.o
  CC       libavrdude_a-updi_nvm_v5.o
  CC       libavrdude_a-urclock.o
  CC       libavrdude_a-usb_hidapi.o
  CC       libavrdude_a-usb_libusb.o
  CC       libavrdude_a-usbtiny.o
  CC       libavrdude_a-update.o
  CC       libavrdude_a-wiring.o
  CC       libavrdude_a-xbee.o
  AR       libavrdude.a
C:\msys64\mingw64\bin\ar.exe: `u' modifier ignored since `D' is the default (see `U')
  CCLD     avrdude.exe
  CC       libavrdude_la-config_gram.lo
  CC       libavrdude_la-lexer.lo
  CC       libavrdude_la-arduino.lo
  CC       libavrdude_la-avr.lo
  CC       libavrdude_la-avr910.lo
  CC       libavrdude_la-avrcache.lo
  CC       libavrdude_la-avrftdi.lo
  CC       libavrdude_la-avrftdi_tpi.lo
  CC       libavrdude_la-avrintel.lo
  CC       libavrdude_la-avrpart.lo
  CC       libavrdude_la-bitbang.lo
  CC       libavrdude_la-buspirate.lo
  CC       libavrdude_la-butterfly.lo
  CC       libavrdude_la-ch341a.lo
  CC       libavrdude_la-config.lo
  CC       libavrdude_la-confwin.lo
  CC       libavrdude_la-crc16.lo
  CC       libavrdude_la-dfu.lo
  CC       libavrdude_la-dryrun.lo
  CC       libavrdude_la-fileio.lo
  CC       libavrdude_la-flip1.lo
  CC       libavrdude_la-flip2.lo
  CC       libavrdude_la-ft245r.lo
  CC       libavrdude_la-jtagmkI.lo
  CC       libavrdude_la-jtagmkII.lo
  CC       libavrdude_la-jtag3.lo
  CC       libavrdude_la-leds.lo
  CC       libavrdude_la-linuxgpio.lo
  CC       libavrdude_la-linuxspi.lo
  CC       libavrdude_la-lists.lo
  CC       libavrdude_la-micronucleus.lo
  CC       libavrdude_la-par.lo
  CC       libavrdude_la-pgm.lo
  CC       libavrdude_la-pgm_type.lo
  CC       libavrdude_la-pickit2.lo
  CC       libavrdude_la-pindefs.lo
  CC       libavrdude_la-ppi.lo
  CC       libavrdude_la-ppiwin.lo
  CC       libavrdude_la-serbb_posix.lo
  CC       libavrdude_la-serbb_win32.lo
  CC       libavrdude_la-ser_avrdoper.lo
  CC       libavrdude_la-ser_posix.lo
  CC       libavrdude_la-ser_win32.lo
  CC       libavrdude_la-serialadapter.lo
  CC       libavrdude_la-stk500.lo
  CC       libavrdude_la-stk500v2.lo
  CC       libavrdude_la-stk500generic.lo
  CC       libavrdude_la-strutil.lo
  CC       libavrdude_la-teensy.lo
  CC       libavrdude_la-term.lo
  CC       libavrdude_la-usbasp.lo
  CC       libavrdude_la-serialupdi.lo
  CC       libavrdude_la-updi_link.lo
  CC       libavrdude_la-updi_state.lo
  CC       libavrdude_la-updi_readwrite.lo
  CC       libavrdude_la-updi_nvm.lo
  CC       libavrdude_la-updi_nvm_v0.lo
  CC       libavrdude_la-updi_nvm_v2.lo
  CC       libavrdude_la-updi_nvm_v3.lo
  CC       libavrdude_la-updi_nvm_v4.lo
  CC       libavrdude_la-updi_nvm_v5.lo
  CC       libavrdude_la-urclock.lo
  CC       libavrdude_la-usb_hidapi.lo
  CC       libavrdude_la-usb_libusb.lo
  CC       libavrdude_la-usbtiny.lo
  CC       libavrdude_la-update.lo
  CC       libavrdude_la-wiring.lo
  CC       libavrdude_la-xbee.lo
  CCLD     libavrdude.la
libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only
make[2]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/avrdude-7.2-20240206'
make[1]: Leaving directory '/c/work/avr/avrdude_test/avrdude_pr1663/src/avrdude-7.2-20240206'

$ head ./avrdude.conf
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20240206";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

$ ldd ./avrdude.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffb25e30000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffb258d0000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffb23520000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffb24380000)
        HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ffb21980000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ffb251d0000)
        libftdi1.dll => /mingw64/bin/libftdi1.dll (0x7ffb0caf0000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ffb24300000)
        libreadline8.dll => /mingw64/bin/libreadline8.dll (0x7ffb0aaa0000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ffb23c80000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ffb25650000)
        libserialport-0.dll => /mingw64/bin/libserialport-0.dll (0x7ffb0cad0000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ffb23170000)
        ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ffb25800000)
        libhidapi-0.dll => /mingw64/bin/libhidapi-0.dll (0x7ffb11a00000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ffb245a0000)
        libusb-1.0.dll => /mingw64/bin/libusb-1.0.dll (0x7ffafed80000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ffb231a0000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ffb238d0000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ffb239a0000)
        libusb-0-1-4.dll => /mingw64/bin/libusb-0-1-4.dll (0x7ffb04720000)
        libtermcap-0.dll => /mingw64/bin/libtermcap-0.dll (0x7ffb0c290000)
        sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ffb25d40000)
        bcrypt.dll => /c/WINDOWS/System32/bcrypt.dll (0x7ffb23970000)
        cfgmgr32.DLL => /c/WINDOWS/SYSTEM32/cfgmgr32.DLL (0x7ffb22e60000)

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

The version number here is a bit different from CMake build -- no git commit ID info.

avrdude version 7.2-20240206, https://github.com/avrdudes/avrdude
avrdude_conf_version = "7.2-20240206";

avrdude version 7.2-20240206 (1a64d38), https://github.com/avrdudes/avrdude
avrdude_conf_version = "7.2-20240206 (1a64d38)";

@ndim Is it possible for you to follow CMake build as well? Thanks. But if it is a bit troublesome, we can live with this.

The current main branch (commit 83571e3) uses 7.2-20230720 with manual editing.

This PR (as of commit 5ed2201) uses 7.2-20240206 (or whatever the date of the latest commit is) without manual editing — which certainly is an improvement already.

Of course it is possible to add the hash there like in the cmake build, but I thought the priority was to avoid manually editing src/configure.ac to change the version number, and that was relatively straightforward with the concepts of the version script and Makefile.am rules I have been using in other projects for 10+ years.

I have already made preparations for adding the hash, but my priority was to have an automatically and robustly generated 7.2-20240206 type version quickly.

After a bit more thinking though, adding the hash might not be as complicated as I had originally feared. Let me try a few things.

@MCUdude
Copy link
Collaborator

MCUdude commented Feb 6, 2024

There's someting wrong with the date/git hash when building using make on macOS 10.14:

I've buildt like I always do; ./bootstrap, ./configure and make

$ ./avrdude -?
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file ~/.avrduderc
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version -20240206, https://github.com/avrdudes/avrdude

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

avrdude version -20240206, https://github.com/avrdudes/avrdude

Ah. So there is something wrong with the sed command which parses CMakeLists.txt looking for the VERSION part of the project(...) line. I should add a check for that parsing result being an empty string.

As it turns out, FreeBSD's sed also does not understand the sed regexp either. With OSX userland deriving from FreeBSD, I suspect this is the same issue:

sed: 1: "s/project(avrdude\s\{1, ...": RE error: trailing backslash (\)
package-version: Error: Could not parse top-level avrdude 'CMakeLists.txt'.

I had only gotten around to test GNU sed and busybox sed.

BTW, if you run env SED="/path/to/sed --with --args" bootstrap, you can change the sed implementation used in the package-version script.

@MCUdude
Copy link
Collaborator

MCUdude commented Feb 6, 2024

That's better, but there are still no commit hash. I'm not the one who decided if that should be there or not:


$ ./avrdude -?
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file ~/.avrduderc
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20240206, https://github.com/avrdudes/avrdude

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

That's better, but there are still no commit hash. I'm not the one who decided if that should be there or not:

Judging from studying the history of the src/configure.ac file, there has never been a git commit hash in Autotools builds.

So the missing git commit hash is not a regression.

I would prefer not to hasten adding the git commit hash just two days before a release date. That time can be better spent to make the existing automatic $(version-from-CMakeLists.txt)-$(DATE-from-last-commit) type version as robust as possible.

@stefanrueger
Copy link
Collaborator

stefanrueger commented Feb 6, 2024

automatic $(version-from-CMakeLists.txt)-$(DATE-from-last-commit) type version as robust as possible

Completely agree, and this is the main improvement that was needed. The output of the test-avrdude script self-documents the version avrdude reports; getting this right is important. The granularity to be able to distinguish different versions with last commit on the same day is not needed that often and can be added after v7.3 has been released.

@ndim I noticed SQUASHME directives in commit messages. Will github automagically consider them when it carries out a web-interface merge? I won't be able to manually cherry pick commits for squashing. I normally use the the github web interface and either merge PRs as they are or squash and merge them (depending on what the author wants or how I think it documents the feature nicer in the git main history) .

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

@stefanrueger SQUASHME are notices to myself. I will squash those commits and force-push the result before I mark this Draft PR as "Ready for review", so that you can use the web interface to merge.

@ndim ndim force-pushed the autoconf-package-version branch 3 times, most recently from 5f0ceba to 780c91b Compare February 6, 2024 23:27
Sometimes when building with the Autoconf buildsystem,
the avrdude-html/ subdir already exists and therefore
renaming the newly built avrdude/ subdir to avrdude-html/
cannot succeed.

Removing the old avrdude-html/ subdir first fixes that.
Generate the version number used in the Autotools builds
via a script from the top-level CMakeLists.txt and git
information instead of manual editing.

This script mimics what the avrdude top-level CMakeLists.txt
does for composing AVRDUDE_FULL_VERSION.

Consequently, maintainers do not need to edit the version numbers
in the "src/configure.ac" file's "AC_INIT(...)" line any more.

However, unlike the cmake based builds, this does not print the
commit hash in the "avrdude --help" message or in the "avrdude.conf"
file's "avrdude_conf_version = " line. That will come later.

These are the six build types supported and what avrdude
versions cmake and the autoconf builds actually produce:

                               cmake          autoconf
    git clone     release      7.2            7.2
    git clone     non-release  7.2-DATE+HASH  7.2-DATE
    git archive   release      7.2            7.2
    git archive   non-release  7.2            7.2
    dist tarball  release      N/A            7.2
    dist tarball  non-release  N/A            7.2-DATE
@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

As you can tell by the CI checks now running again, I have removed the simple autoconf based test build from the CI checks again. I do not want to foist a completely untested CI check on you so close to a release.

No surprises to be expected there: None of the existing CI workflows actually use an Autotool based build, so changes to the Autotools build system will not change the CI outcomes in any significant way.

I have developed on Fedora, tested on Debian and Arch (all using GNU tools) and FreeBSD (using FreeBSD tools), so that should cover many systems. MSYS2 and mingw use GNU tools, OSX is based on FreeBSD tools, so those should work as well.

I am mostly confident that the changes to the Autotools build system should work. The basic idea has been working for me in other projects for the last about 15 years, and the adaptations for avrdude have been tested at least somewhat.

I hope I have not overlooked too many edge and corner cases with my manual non-CI non systematic testing.

Thanks to @mcuee and @MCUdude for testing.

Do ping me if anything comes up.

@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

Regarding the git commit hash, I have a basic idea I am confident will work, but I have not used some of the required techniques yet, so that will require a bit of testing, i.e. time.

Expect it some time after the 7.3 release.

@ndim ndim marked this pull request as ready for review February 6, 2024 23:51
@ndim
Copy link
Contributor Author

ndim commented Feb 6, 2024

I just noticed... does it really make sense for the GIT_COMMIT_DATE to use --format=%ad?

I just copied the command from CMakeLists.txt to src/build-helpers/package-version, so the behaviour is identical.

avrdude/CMakeLists.txt

Lines 71 to 76 in 1a64d38

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

https://github.com/ndim/avrdude/blob/d15c561a7ad7ba3e8cbac2fe78e7f06b383f4cc7/src/build-helpers/package-version#L74

The author date of that commit could have been last year, but the committer date (--format=%cd) might have been today. Why display the author date when the purpose of showing that date is presumably to show how recently the source tree was changed?

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

Regarding the git commit hash, I have a basic idea I am confident will work, but I have not used some of the required techniques yet, so that will require a bit of testing, i.e. time.

Expect it some time after the 7.3 release.

I am fine with this. As @stefanrueger mentioned earlier:

The output of the test-avrdude script self-documents the version avrdude reports; getting this right is important. The granularity to be able to distinguish different versions with last commit on the same day is not needed that often and can be added after v7.3 has been released.

Thinking about this, I am okay to even keep this after 7.3 release as it is kind of a differntiation between CMake build and Autotools build.

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

I just noticed... does it really make sense for the GIT_COMMIT_DATE to use --format=%ad?

I just copied the command from CMakeLists.txt to src/build-helpers/package-version, so the behaviour is identical.

The author date of that commit could have been last year, but the committer date (--format=%cd) might have been today. Why display the author date when the purpose of showing that date is presumably to show how recently the source tree was changed?

Hmm, strange, so far from my experiences, CMake build always display the commit date and not author date.

@ndim
Copy link
Contributor Author

ndim commented Feb 7, 2024

Regarding the git commit hash, I have a basic idea I am confident will work, but I have not used some of the required techniques yet, so that will require a bit of testing, i.e. time.
Expect it some time after the 7.3 release.

I am fine with this. As @stefanrueger mentioned earlier:

The output of the test-avrdude script self-documents the version avrdude reports; getting this right is important. The granularity to be able to distinguish different versions with last commit on the same day is not needed that often and can be added after v7.3 has been released.

Thinking about this, I am okay to even keep this after 7.3 release as it is kind of a differntiation between CMake build and Autotools build.

I think it is better to use an explicit marker to distinguish cmake and autotools builds. Noted for after 7.3.

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

Tested the latest git commit under MSYS2 mingw64 and it works fine.

MINGW64 /c/work/avr/avrdude_test/avrdude_pr1663/src
$ ./avrdude.exe
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20240206, https://github.com/avrdudes/avrdude

$ head ./avrdude.conf
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20240206";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

$ ldd ./avrdude.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffb25e30000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffb258d0000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffb23520000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffb24380000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ffb251d0000)
        HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ffb21980000)
        libftdi1.dll => /mingw64/bin/libftdi1.dll (0x7ffb13ae0000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ffb24300000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ffb23c80000)
        libreadline8.dll => /mingw64/bin/libreadline8.dll (0x7ffb0aaa0000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ffb25650000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ffb23170000)
        libusb-1.0.dll => /mingw64/bin/libusb-1.0.dll (0x7ffada710000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ffb245a0000)
        libserialport-0.dll => /mingw64/bin/libserialport-0.dll (0x7ffb1a3d0000)
        libusb-0-1-4.dll => /mingw64/bin/libusb-0-1-4.dll (0x7ffaff1d0000)
        ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ffb25800000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ffb231a0000)
        sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ffb25d40000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ffb238d0000)
        bcrypt.dll => /c/WINDOWS/System32/bcrypt.dll (0x7ffb23970000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ffb239a0000)
        libtermcap-0.dll => /mingw64/bin/libtermcap-0.dll (0x7ffb11a00000)
        libhidapi-0.dll => /mingw64/bin/libhidapi-0.dll (0x7ffb14a00000)
        cfgmgr32.DLL => /c/WINDOWS/SYSTEM32/cfgmgr32.DLL (0x7ffb22e60000)

$ cd ../tools/

$ ./test-avrdude -e "../src/avrdude.exe" -d 0 -t . -v -p "-c jtag2updi -p m4808 -P ch340"
Testing ../src/avrdude.exe version 7.2-20240206
Prepare "-c jtag2updi -p m4808 -P ch340" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.915 s: fuse access: clear, set and read eesave fuse bit
✅   0.899 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   1.050 s: chip erase
✅   4.787 s: flash -U write/verify holes_rjmp_loops_49152B.hex
✅   2.355 s: flash -T write/verify holes_rjmp_loops_49152B.hex
✅   0.972 s: eeprom check whether programmer can flip 0s to 1s
✅   1.011 s: eeprom -U write/verify holes_pack_my_box_256B.hex
✅   1.070 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_256B.hex
✅   2.522 s: chip erase and spot check flash is actually erased
✅   0.924 s: spot check eeprom is erased, too
✅   1.010 s: usersig -T/-U write/read random_data_64B.bin

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

@ndim

Unfortunately this PR does not seem to work under NetBSD. But I think it is an existing issue -- not able to detect the libraries.

-bash-5.2$ CFLAGS="-I/usr/pkg/include" LDFLAGS="-R/usr/pkg/lib" ./configure --prefix=/usr/pkg
checking build system type... x86_64-unknown-netbsd9.3
checking host system type... x86_64-unknown-netbsd9.3
checking target system type... x86_64-unknown-netbsd9.3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/pkg/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-unknown-netbsd9.3 file names to x86_64-unknown-netbsd9.3 format... func_convert_file_noop
checking how to convert x86_64-unknown-netbsd9.3 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... match_pattern /lib[^/]+(\.so|_pic\.a)$
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... NetBSD ld.elf_so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for a sed that does not truncate output... (cached) /usr/pkg/bin/gsed
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... -lfl
checking whether yytext is a pointer... yes
checking for -ar... ar
test: ==: unexpected operator
checking for WSAStartup in -lws2_32... no
checking for tputs in -ltermcap... yes
checking for tputs in -lncurses... no
checking for readline in -lreadline... no
checking for elf_getshdrstrndx in -lelf... yes
checking for libelf.h... yes
checking for libelf/libelf.h... yes
checking for library containing gethostent... none required
checking for library containing setsockopt... none required
checking for usb_get_string_simple in -lusb... no
checking for libusb_init in -lusb-1.0... no
checking for libusb_init in -lusb... no
checking for library containing hid_init... no
checking for sp_open in -lserialport... no
checking for ftdi_new in -lftdi1... no
checking for ftdi_usb_get_strings in -lftdi... no
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for sys/time.h... (cached) yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for ddk/hidsdi.h... no
checking for an ANSI C-conforming const... yes
checking for netinet/in.h... yes
checking for memset... yes
checking for select... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for strtoul... yes
checking for gettimeofday... yes
checking for usleep... yes
checking for getaddrinfo... yes
checking for a Win32 HID library... no
checking for uint_t... no
checking for ulong_t... no
checking for serial device... unknown
checking if gcc accepts -Wno-pointer-sign ... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating doc/Makefile
config.status: creating avrdude.spec
config.status: creating Makefile
config.status: creating GNUmakefile
config.status: creating avrdude.conf.tmp
config.status: creating ac_cfg.h
config.status: executing depfiles commands
config.status: executing libtool commands


Configuration summary:
----------------------
DO HAVE    libelf
DON'T HAVE libusb
DON'T HAVE libusb_1_0
DON'T HAVE libftdi1
DON'T HAVE libftdi
DON'T HAVE libhid
DON'T HAVE libhidapi
DON'T HAVE libreadline
DON'T HAVE libserialport
DO HAVE    pthread
DISABLED   doc
DISABLED   parport
DISABLED   linuxgpio
DISABLED   linuxspi

Last time I spent some time to figure out using -R for the LDFLAGS with CMake build. CMakebuild does work.

-bash-5.2$ ./build.sh
-- The C compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/pkg/bin/git (found version "2.43.0")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found BISON: /usr/pkg/bin/bison (found version "3.8.2")
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi (but prefer to use libftdi1)
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DO HAVE    libserialport
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done (1.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mcuee/build/avrdude_pr1663/build_netbsd
[  1%] Generating avrdude.conf
[  1%] Built target conf
[  2%] [FLEX][Parser] Building scanner with flex 2.6.4
[  3%] [BISON][Parser] Building parser with bison 3.8.2
[  5%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  6%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[  9%] Building C object src/CMakeFiles/libavrdude.dir/avrcache.c.o
[ 10%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
[ 11%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.o
[ 13%] Building C object src/CMakeFiles/libavrdude.dir/avrintel.c.o
[ 14%] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.o
[ 15%] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.o
[ 17%] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.o
[ 18%] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.o
[ 19%] Building C object src/CMakeFiles/libavrdude.dir/ch341a.c.o
[ 21%] Building C object src/CMakeFiles/libavrdude.dir/config.c.o
[ 22%] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.o
[ 23%] Building C object src/CMakeFiles/libavrdude.dir/crc16.c.o
[ 25%] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.o
[ 26%] Building C object src/CMakeFiles/libavrdude.dir/dryrun.c.o
[ 27%] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.o
[ 28%] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.o
[ 30%] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.o
[ 31%] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.o
[ 32%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.o
[ 34%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.o
[ 35%] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.o
[ 36%] Building C object src/CMakeFiles/libavrdude.dir/leds.c.o
[ 38%] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.o
[ 39%] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.o
[ 40%] Building C object src/CMakeFiles/libavrdude.dir/lists.c.o
[ 42%] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.o
[ 43%] Building C object src/CMakeFiles/libavrdude.dir/par.c.o
[ 44%] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.o
[ 46%] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.o
[ 47%] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.o
[ 48%] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.o
[ 50%] Building C object src/CMakeFiles/libavrdude.dir/ppi.c.o
[ 51%] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.o
[ 52%] Building C object src/CMakeFiles/libavrdude.dir/serbb_posix.c.o
[ 53%] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.o
[ 55%] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.o
[ 56%] Building C object src/CMakeFiles/libavrdude.dir/ser_posix.c.o
[ 57%] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.o
[ 59%] Building C object src/CMakeFiles/libavrdude.dir/serialadapter.c.o
[ 60%] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.o
[ 61%] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.o
[ 63%] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.o
[ 64%] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.o
[ 65%] Building C object src/CMakeFiles/libavrdude.dir/strutil.c.o
[ 67%] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.o
[ 68%] Building C object src/CMakeFiles/libavrdude.dir/term.c.o
[ 69%] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.o
[ 71%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.o
[ 72%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm_v0.c.o
[ 73%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm_v2.c.o
[ 75%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm_v3.c.o
[ 76%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm_v4.c.o
[ 77%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm_v5.c.o
[ 78%] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.o
[ 80%] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.o
[ 81%] Building C object src/CMakeFiles/libavrdude.dir/urclock.c.o
[ 82%] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.o
[ 84%] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.o
[ 85%] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.o
[ 86%] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.o
[ 88%] Building C object src/CMakeFiles/libavrdude.dir/update.c.o
[ 89%] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.o
[ 90%] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.o
[ 92%] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.o
[ 93%] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.o
[ 94%] Linking C static library libavrdude.a
[ 94%] Built target libavrdude
[ 96%] Building C object src/CMakeFiles/avrdude.dir/main.c.o
[ 97%] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.o
[ 98%] Building C object src/CMakeFiles/avrdude.dir/whereami.c.o
[100%] Linking C executable avrdude
[100%] Built target avrdude

Build succeeded.

Run

sudo cmake --build build_netbsd --target install

to install.

-bash-5.2$ sudo cmake --build build_netbsd --target install
Password:
[  1%] Built target conf
[ 94%] Built target libavrdude
[100%] Built target avrdude
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/pkg/bin/avrdude
-- Set non-toolchain portion of runtime path of "/usr/pkg/bin/avrdude" to ""
-- Installing: /usr/pkg/lib/libavrdude.a
-- Installing: /usr/pkg/include/libavrdude.h
-- Installing: /usr/pkg/etc/avrdude.conf
-- Installing: /usr/pkg/man/man1/avrdude.1
-bash-5.2$ avrdude
Usage: avrdude [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -C +<config-file>      Specify additional config file, can be repeated
  -N                     Do not load config file
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memstr>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20240206 (d15c561a), https://github.com/avrdudes/avrdude

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

Unfortunately this PR does not seem to work under NetBSD. But I think it is an existing issue -- not able to detect the libraries.

@ndim

Yes, git main has the same issue. So this is not a regression. And it is okay to address the issue after 7.3 release.

I have not looked into the details of NetBSD pkgsrc here to see how they build avrdude 6.4 version using Autotools.
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/cross/avrdude/

ndim added a commit to ndim/avrdude that referenced this pull request Feb 7, 2024
The test(1) command string comparison operator is a single
equals sign, not a double equals sign.

Pointed out by @mcuee at avrdudes#1663
ndim added a commit to ndim/avrdude that referenced this pull request Feb 7, 2024
The test(1) command string comparison operator is a single
equals sign, not a double equals sign.

Pointed out by @mcuee at avrdudes#1663
@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

@ndim

OpenBSD is better but somehow last step failed.

openbsdvmn100$  CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure --prefix=/usr/local
checking build system type... x86_64-unknown-openbsd7.4
checking host system type... x86_64-unknown-openbsd7.4
checking target system type... x86_64-unknown-openbsd7.4
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... print -r
checking whether make supports the include directive... yes (GNU style)
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking whether cc understands -c and -o together... yes
checking dependency style of cc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 393216
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking how to convert x86_64-unknown-openbsd7.4 file names to x86_64-unknown-openbsd7.4 format... func_convert_file_noop
checking how to convert x86_64-unknown-openbsd7.4 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$
checking for dlltool... no
checking how to associate runtime and link libraries... print -r --
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... openbsd7.4 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking whether the compiler supports GNU C... (cached) yes
checking whether cc accepts -g... (cached) yes
checking for cc option to enable C11 features... (cached) none needed
checking whether cc understands -c and -o together... (cached) yes
checking dependency style of cc... (cached) gcc3
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for bison... bison -y
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... -lfl
checking whether yytext is a pointer... yes
checking for -ar... ar
checking whether yylex_destroy is generated by flex... version 2.5.39 => yes
checking for WSAStartup in -lws2_32... no
checking for tputs in -ltermcap... yes
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking for elf_getshdrstrndx in -lelf... yes
checking for libelf.h... yes
checking for libelf/libelf.h... no
checking for library containing gethostent... none required
checking for library containing setsockopt... none required
checking for usb_get_string_simple in -lusb... yes
checking for usb.h... yes
checking for lusb0_usb.h... no
checking for libusb_init in -lusb-1.0... yes
checking for libusb-1.0/libusb.h... yes
checking for libusb.h... no
checking for libusb_init in -lusb... no
checking for libusb.h... (cached) no
checking for library containing hid_init... no
checking for sp_open in -lserialport... yes
checking for libserialport.h... yes
checking for ftdi_new in -lftdi1... yes
checking for ftdi_usb_get_strings in -lftdi... no
checking for ftdi_tcioflush... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for sys/time.h... (cached) yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for ddk/hidsdi.h... no
checking for an ANSI C-conforming const... yes
checking for netinet/in.h... yes
checking for memset... yes
checking for select... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for strtoul... yes
checking for gettimeofday... yes
checking for usleep... yes
checking for getaddrinfo... yes
checking for a Win32 HID library... no
checking for uint_t... no
checking for ulong_t... no
checking for serial device... unknown
checking if gcc accepts -Wno-pointer-sign ... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating doc/Makefile
config.status: creating avrdude.spec
config.status: creating Makefile
config.status: creating GNUmakefile
config.status: creating avrdude.conf.tmp
config.status: creating ac_cfg.h
config.status: ac_cfg.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands


Configuration summary:
----------------------
DO HAVE    libelf
DO HAVE    libusb
DO HAVE    libusb_1_0
DO HAVE    libftdi1
DON'T HAVE libftdi
DON'T HAVE libhid
DON'T HAVE libhidapi
DON'T HAVE libreadline
DO HAVE    libserialport
DO HAVE    pthread
DISABLED   doc
DISABLED   parport
DISABLED   linuxgpio
DISABLED   linuxspi

openbsdvmn100$ make
  YACC     config_gram.c
updating config_gram.h
  LEX      lexer.c
make  all-recursive
Making all in .
  CC       avrdude-main.o
  CC       avrdude-whereami.o
  CC       avrdude-developer_opts.o
  CC       libavrdude_a-config_gram.o
  CC       libavrdude_a-lexer.o
  CC       libavrdude_a-arduino.o
  CC       libavrdude_a-avr.o
  CC       libavrdude_a-avr910.o
  CC       libavrdude_a-avrcache.o
  CC       libavrdude_a-avrftdi.o
  CC       libavrdude_a-avrftdi_tpi.o
  CC       libavrdude_a-avrintel.o
  CC       libavrdude_a-avrpart.o
  CC       libavrdude_a-bitbang.o
  CC       libavrdude_a-buspirate.o
  CC       libavrdude_a-butterfly.o
  CC       libavrdude_a-ch341a.o
  CC       libavrdude_a-config.o
  CC       libavrdude_a-confwin.o
  CC       libavrdude_a-crc16.o
  CC       libavrdude_a-dfu.o
  CC       libavrdude_a-dryrun.o
  CC       libavrdude_a-fileio.o
  CC       libavrdude_a-flip1.o
  CC       libavrdude_a-flip2.o
  CC       libavrdude_a-ft245r.o
  CC       libavrdude_a-jtagmkI.o
  CC       libavrdude_a-jtagmkII.o
  CC       libavrdude_a-jtag3.o
  CC       libavrdude_a-leds.o
  CC       libavrdude_a-linuxgpio.o
  CC       libavrdude_a-linuxspi.o
  CC       libavrdude_a-lists.o
  CC       libavrdude_a-micronucleus.o
  CC       libavrdude_a-par.o
  CC       libavrdude_a-pgm.o
  CC       libavrdude_a-pgm_type.o
  CC       libavrdude_a-pickit2.o
  CC       libavrdude_a-pindefs.o
  CC       libavrdude_a-ppi.o
  CC       libavrdude_a-ppiwin.o
  CC       libavrdude_a-serbb_posix.o
  CC       libavrdude_a-serbb_win32.o
  CC       libavrdude_a-ser_avrdoper.o
  CC       libavrdude_a-ser_posix.o
  CC       libavrdude_a-ser_win32.o
  CC       libavrdude_a-serialadapter.o
  CC       libavrdude_a-stk500.o
  CC       libavrdude_a-stk500v2.o
  CC       libavrdude_a-stk500generic.o
  CC       libavrdude_a-strutil.o
  CC       libavrdude_a-teensy.o
  CC       libavrdude_a-term.o
  CC       libavrdude_a-usbasp.o
  CC       libavrdude_a-serialupdi.o
  CC       libavrdude_a-updi_link.o
  CC       libavrdude_a-updi_state.o
  CC       libavrdude_a-updi_readwrite.o
  CC       libavrdude_a-updi_nvm.o
  CC       libavrdude_a-updi_nvm_v0.o
  CC       libavrdude_a-updi_nvm_v2.o
  CC       libavrdude_a-updi_nvm_v3.o
  CC       libavrdude_a-updi_nvm_v4.o
  CC       libavrdude_a-updi_nvm_v5.o
  CC       libavrdude_a-urclock.o
  CC       libavrdude_a-usb_hidapi.o
  CC       libavrdude_a-usb_libusb.o
  CC       libavrdude_a-usbtiny.o
  CC       libavrdude_a-update.o
  CC       libavrdude_a-wiring.o
  CC       libavrdude_a-xbee.o
Warning: target ./libavrdude.a (prerequisite of: avrdude) does not have any command (BUG)
  CCLD     avrdude
cc: error: no such file or directory: './libavrdude.a'
*** Error 1 in . (Makefile:1049 'avrdude': @echo "  CCLD    " avrdude;/bin/sh ./libtool --silent --tag=CC    --mode=link cc -Wall -Wextra -W...)
*** Error 1 in . (Makefile:2826 'all-recursive': @fail=;  if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_w...)
*** Error 2 in /home/mcuee/build/avrdude_pr1663/src (Makefile:889 'all')

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

@ndim

OpenBSD is better but somehow last step failed.

Same for git main. So again this is not a regression.

git main build last step also failed.

Warning: target ./libavrdude.a (prerequisite of: avrdude) does not have any command (BUG)
  CCLD     avrdude
cc: error: no such file or directory: './libavrdude.a'
*** Error 1 in . (Makefile:1043 'avrdude': @echo "  CCLD    " avrdude;/bin/sh ./libtool --silent --tag=CC    --mode=link cc -Wall -Wextra -W...)
*** Error 1 in . (Makefile:2820 'all-recursive': @fail=;  if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_w...)
*** Error 2 in /home/mcuee/build/avrdude/src (Makefile:886 'all')

I have not looked into OpenBSD port to see how they build avrdude 6.3.
https://github.com/openbsd/ports/tree/master/devel/avrdude

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

@ndim

I am happy with this PR. Thanks.

We can deal with OpenBSD/NetBSD after 7.3 release as well.

@mcuee
Copy link
Collaborator

mcuee commented Feb 7, 2024

@ndim

FYI on the git version guess from OpenOCD project. Just for reference.
https://github.com/openocd-org/openocd/blob/master/guess-rev.sh

@stefanrueger stefanrueger merged commit 4f1e387 into avrdudes:main Feb 7, 2024
13 checks passed
@ndim ndim deleted the autoconf-package-version branch February 7, 2024 11:31
@ndim ndim mentioned this pull request Jul 31, 2024
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants