Skip to content

Commit 27fe913

Browse files
authored
Merge pull request #1681 from ndim/improve-autotool-build
Improve autotool build (part 1/n)
2 parents 5c1649d + 8553d37 commit 27fe913

File tree

18 files changed

+743
-304
lines changed

18 files changed

+743
-304
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,51 @@ env:
3131
BUILD_TYPE: RelWithDebInfo
3232

3333
jobs:
34+
linux-x86_64-autotools:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Install prerequisites
39+
run: >-
40+
sudo apt-get update
41+
42+
sudo apt-get install -y
43+
build-essential
44+
automake
45+
libtool
46+
gettext
47+
flex
48+
bison
49+
libelf-dev
50+
libusb-dev
51+
libusb-1.0-0-dev
52+
libhidapi-dev
53+
libftdi1-dev
54+
libreadline-dev
55+
libserialport-dev
56+
texinfo
57+
texlive
58+
texi2html
59+
- name: Configure
60+
run: >-
61+
autoreconf -vis src
62+
63+
mkdir _ambuild && cd _ambuild
64+
65+
../src/configure
66+
--enable-doc
67+
--enable-parport
68+
--enable-linuxgpio
69+
--enable-linuxspi
70+
- name: Build
71+
run: make -C _ambuild -j$(nproc)
72+
- name: Install
73+
run: sudo make -C _ambuild install
74+
- name: Dryrun_test
75+
run: printf "\n\n" | ./tools/test-avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
76+
- name: distcheck
77+
run: make -C _ambuild -j$(nproc) distcheck
78+
3479
linux-x86_64:
3580
runs-on: ubuntu-latest
3681
steps:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ ltmain.sh
4040
ylwrap
4141
tags
4242
cscope.out
43-
/src/avrdude-[1-9].*.tar.*
43+
/src/avrdude-[1-9].[0-9].tar.*
44+
/src/avrdude-[1-9].[0-9]/
45+
/src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9].tar.*
46+
/src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9]/
4447
/src/GNUmakefile
4548

4649
*.o

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ if(Git_FOUND)
6969
)
7070

7171
execute_process(
72-
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y%m%d
72+
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cd --date=format:%Y%m%d
7373
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
7474
OUTPUT_VARIABLE GIT_COMMIT_DATE
7575
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
7676
)
7777

7878
execute_process(
79-
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%ad --date=format:%Y
79+
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cd --date=format:%Y
8080
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
8181
OUTPUT_VARIABLE GIT_COMMIT_YEAR
8282
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE

src/GNUmakefile.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Helps update the version number automatically if using GNU make.
2-
include Makefile
1+
# @configure_input@
32

4-
AUTORECONF ?= autoreconf
5-
AUTORECONF_OPTS ?= -vis
3+
include Makefile
64

7-
script_version := $(shell $(top_srcdir)/build-helpers/package-version $(top_srcdir) version-stamp)
8-
ifneq ($(PACKAGE_VERSION),$(script_version))
9-
$(info autoconf and script versions do not match: $(PACKAGE_VERSION) vs $(script_version))
10-
$(info Removing autom4te.cache and related files and re-running autoreconf)
11-
dummy1 := $(shell rm -rf $(top_srcdir)/autom4te.cache)
12-
dummy2 := $(shell $(AUTORECONF) $(AUTORECONF_OPTS) $(top_srcdir))
5+
need_to_rerun := $(shell $(top_srcdir)/build-helpers/versioninfo.sh "$(top_srcdir)" "@VERSIONINFO_STAMPFILE@" | { @VERSIONINFO_READ@; \
6+
if @VERSIONINFO_IS_UNCHANGED@ \
7+
echo "no"; \
8+
fi; } )
9+
ifneq (no,$(need_to_rerun))
10+
$(info Recorded and current version information do not match.)
11+
$(info Re-running autoreconf via bootstrap.)
12+
dummy1 := $(shell $(top_srcdir)/bootstrap)
1313
endif
1414

1515
# vim: syntax=make

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CLEANFILES = \
4040
config_gram.h \
4141
lexer.c
4242

43-
include build-helpers/package-version.mk
43+
include build-helpers/versioninfo.mk
4444

4545
BUILT_SOURCES = $(CLEANFILES)
4646

@@ -248,4 +248,4 @@ backup-avrdude-conf:
248248
${DESTDIR}${sysconfdir}/avrdude.conf.bak; \
249249
fi
250250

251-
ACLOCAL_AMFLAGS = -I m4
251+
ACLOCAL_AMFLAGS = -I auto-m4 -I build-helpers

src/auto-aux/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ensure git creates empty directory for autotools to place files into
2+
*

src/auto-m4/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ensure creation of empty directory for autotools to place files into
2+
*

src/autotools-build.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#! /bin/sh
2+
3+
set -ex
4+
5+
cd "$(dirname "$0")"
6+
top_srcdir="$(pwd)"
7+
8+
ostype="$(uname | tr A-Z a-z)"
9+
10+
if test "x$MAKE" = x; then
11+
if gmake --version > /dev/null 2>&1; then
12+
MAKE=gmake
13+
fi
14+
fi
15+
make="${make-"${MAKE-make} -j$(nproc)"}"
16+
17+
rm -rf autom4te.cache/
18+
19+
prefix="$top_srcdir/build_autotools-prefix"
20+
rm -rf "$prefix"
21+
22+
top_builddir="$top_srcdir/build_autotools"
23+
24+
# Remove remainders of failed distcheck attempts
25+
for dir in "$top_builddir"
26+
do
27+
if test -d "$dir"; then
28+
chmod -R +w "$dir"
29+
fi
30+
done
31+
rm -rf "$top_builddir"
32+
33+
./bootstrap
34+
35+
mkdir "$top_builddir"
36+
cd "$top_builddir"
37+
38+
configure_opts=""
39+
configure_opts="$configure_opts --disable-silent-rules"
40+
configure_opts="$configure_opts --enable-parport"
41+
case "$ostype" in
42+
*linux)
43+
configure_opts="$configure_opts --enable-linuxgpio --enable-linuxspi"
44+
configure_opts="$configure_opts --enable-doc"
45+
;;
46+
esac
47+
48+
$top_srcdir/configure --prefix="$prefix" ${configure_opts}
49+
50+
$make all
51+
$make check
52+
$make install
53+
$make installcheck
54+
55+
printf "\n\n" | $top_srcdir/../tools/test-avrdude -e $prefix/bin/avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28"
56+
57+
$make distcheck

src/bootstrap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#! /bin/sh
22

3+
cd "$(dirname "$0")"
4+
5+
: ${AUTORECONF="autoreconf${AC_VER}"}
36
: ${AUTOHEADER="autoheader${AC_VER}"}
47
: ${AUTOCONF="autoconf${AC_VER}"}
58
: ${ACLOCAL="aclocal${AM_VER}"}
@@ -17,9 +20,6 @@ rm -rf autom4te.cache
1720
# probe for that
1821
LIBTOOLIZE=libtoolize
1922
glibtoolize --version > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize
20-
${LIBTOOLIZE}
23+
export LIBTOOLIZE
2124

22-
${ACLOCAL}
23-
${AUTOHEADER}
24-
${AUTOCONF}
25-
${AUTOMAKE} -a -c
25+
${AUTORECONF} -i "$@"

src/build-helpers/package-version

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)