Skip to content

Commit 8d2f55e

Browse files
committed
[ISSUE-14]: make distcheck runs on pure gcc (on i386 arch)
1 parent bf030bf commit 8d2f55e

File tree

18 files changed

+104
-19
lines changed

18 files changed

+104
-19
lines changed

.github/workflows/ccpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: configure
17-
run: aclocal && autoconf && automake --add-missing && ./configure
17+
run: aclocal && autoconf && automake --add-missing && ./configure --host='' 'CFLAGS=-Wall' 'LDFLAGS=' --without-binaries
1818
- name: make
1919
run: make
2020
- name: make check
2121
run: make check
2222
- name: make distcheck
23-
run: make distcheck
23+
run: DISTCHECK_CONFIGURE_FLAGS="--host= CFLAGS='' LDFLAGS='' --without-binaries" make distcheck

aclocal.m4

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,43 @@ AC_DEFUN([AM_AUX_DIR_EXPAND],
108108
am_aux_dir=`cd "$ac_aux_dir" && pwd`
109109
])
110110

111+
# AM_COND_IF -*- Autoconf -*-
112+
113+
# Copyright (C) 2008-2018 Free Software Foundation, Inc.
114+
#
115+
# This file is free software; the Free Software Foundation
116+
# gives unlimited permission to copy and/or distribute it,
117+
# with or without modifications, as long as this notice is preserved.
118+
119+
# _AM_COND_IF
120+
# _AM_COND_ELSE
121+
# _AM_COND_ENDIF
122+
# --------------
123+
# These macros are only used for tracing.
124+
m4_define([_AM_COND_IF])
125+
m4_define([_AM_COND_ELSE])
126+
m4_define([_AM_COND_ENDIF])
127+
128+
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
129+
# ---------------------------------------
130+
# If the shell condition COND is true, execute IF-TRUE, otherwise execute
131+
# IF-FALSE. Allow automake to learn about conditional instantiating macros
132+
# (the AC_CONFIG_FOOS).
133+
AC_DEFUN([AM_COND_IF],
134+
[m4_ifndef([_AM_COND_VALUE_$1],
135+
[m4_fatal([$0: no such condition "$1"])])dnl
136+
_AM_COND_IF([$1])dnl
137+
if test -z "$$1_TRUE"; then :
138+
m4_n([$2])[]dnl
139+
m4_ifval([$3],
140+
[_AM_COND_ELSE([$1])dnl
141+
else
142+
$3
143+
])dnl
144+
_AM_COND_ENDIF([$1])dnl
145+
fi[]dnl
146+
])
147+
111148
# AM_CONDITIONAL -*- Autoconf -*-
112149

113150
# Copyright (C) 1997-2018 Free Software Foundation, Inc.

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
AC_PREREQ([2.69])
22
AC_INIT([esp32basic],[1.0.0])
33
AM_INIT_AUTOMAKE
4-
: ${CFLAGS="-g -Os -Wall"}
4+
: ${CFLAGS="-g -Os -Wall -nostdlib -mlongcalls" LDFLAGS="-specs=nano.specs"}
55
AC_PROG_CC
66
AC_PROG_CC_STDC
77
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
88
AC_PROG_AR
99
AC_PROG_RANLIB
1010

11+
AC_ARG_WITH([binaries], AS_HELP_STRING([--without-binaries], [Do not generate .bin images (esptool.py required).]))
12+
AM_CONDITIONAL([WITH_BINARIES], [test x$with_binaries != xno])
13+
AM_COND_IF([WITH_BINARIES],[ AC_MSG_NOTICE([generate .bin images]) ])
14+
1115
AC_CONFIG_SUBDIRS([src])
1216
AC_CONFIG_SUBDIRS([modules])
1317
AC_CONFIG_SUBDIRS([examples])

examples/0blink/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ include $(top_srcdir)/ld/flags.mk
33

44
noinst_HEADERS = defines.h
55

6-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
6+
AM_CFLAGS = -std=c11 -flto
77
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
88
LDADD = $(top_builddir)/src/libesp32basic.a
99

1010
bin_PROGRAMS = \
1111
ledblink.elf
1212

13+
if WITH_BINARIES
1314
CLEANFILES = \
1415
ledblink.bin
16+
endif
1517

1618
BUILT_SOURCES = $(CLEANFILES)

examples/0hello/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ include $(top_srcdir)/ld/flags.mk
33

44
noinst_HEADERS = defines.h
55

6-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
6+
AM_CFLAGS = -std=c11 -flto
77
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
88
LDADD = $(top_builddir)/src/libesp32basic.a
99

1010
bin_PROGRAMS = \
1111
hello.elf
1212

13+
if WITH_BINARIES
1314
CLEANFILES = \
1415
hello.bin
16+
endif
1517

1618
BUILT_SOURCES = $(CLEANFILES)

examples/0ledctrl/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ include $(top_srcdir)/ld/flags.mk
33

44
noinst_HEADERS = defines.h
55

6-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
6+
AM_CFLAGS = -std=c11 -flto
77
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
88
LDADD = $(top_builddir)/src/libesp32basic.a
99

1010
bin_PROGRAMS = \
1111
ledctrl.elf
1212

13+
if WITH_BINARIES
1314
CLEANFILES = \
1415
ledctrl.bin
16+
endif
1517

1618
BUILT_SOURCES = $(CLEANFILES)

examples/1rmtblink/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ AM_LDFLAGS += -T $(top_srcdir)/ld/esp32.rom.ld
44

55
noinst_HEADERS = defines.h
66

7-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
7+
AM_CFLAGS = -std=c11 -flto
88
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
99
LDADD = $(top_builddir)/src/libesp32basic.a
1010

1111
bin_PROGRAMS = \
1212
rmtblink.elf
1313

14+
if WITH_BINARIES
1415
CLEANFILES = \
1516
rmtblink.bin
17+
endif
1618

1719
BUILT_SOURCES = $(CLEANFILES)

examples/1rmtmorse/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AM_LDFLAGS += -T $(top_srcdir)/ld/esp32.rom.ld
44

55
noinst_HEADERS = defines.h mphgen.h
66

7-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
7+
AM_CFLAGS = -std=c11 -flto
88
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
99
LDADD = $(top_builddir)/src/libesp32basic.a
1010

@@ -13,7 +13,9 @@ bin_PROGRAMS = \
1313

1414
rmtmorse_elf_SOURCES = mphgen.c rmtmorse.c
1515

16+
if WITH_BINARIES
1617
CLEANFILES = \
1718
rmtmorse.bin
19+
endif
1820

1921
BUILT_SOURCES = $(CLEANFILES)

examples/1rmtmusic/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AM_LDFLAGS += -T $(top_srcdir)/ld/esp32.rom.ld \
55

66
noinst_HEADERS = defines.h music.h
77

8-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
8+
AM_CFLAGS = -std=c11 -flto
99
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
1010
LDADD = $(top_builddir)/src/libesp32basic.a
1111

@@ -14,7 +14,9 @@ bin_PROGRAMS = \
1414

1515
rmtmusic_elf_SOURCES = music.c rmtmusic.c
1616

17+
if WITH_BINARIES
1718
CLEANFILES = \
1819
rmtmusic.bin
20+
endif
1921

2022
BUILT_SOURCES = $(CLEANFILES)

examples/1rmtws2812/Makefile.am

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ include $(top_srcdir)/ld/flags.mk
33

44
noinst_HEADERS = defines.h
55

6-
AM_CFLAGS = -nostdlib -mlongcalls -std=c11 -flto
6+
AM_CFLAGS = -std=c11 -flto
7+
if WITH_BINARIES
78
AM_LDFLAGS += \
89
-T $(top_srcdir)/ld/esp32.rom.ld \
910
-T $(top_srcdir)/ld/esp32.rom.libgcc.ld \
@@ -13,6 +14,13 @@ AM_LDFLAGS += \
1314
-T $(top_srcdir)/ld/esp32.rom.newlib-time.ld \
1415
-T $(top_srcdir)/ld/esp32.rom.redefined.ld \
1516
-T $(top_srcdir)/ld/esp32.rom.syscalls.ld
17+
else
18+
AM_LDFLAGS += \
19+
-T $(top_srcdir)/ld/esp32.rom.ld \
20+
-T $(top_srcdir)/ld/esp32.rom.libgcc.ld \
21+
-T $(top_srcdir)/ld/esp32.rom.redefined.ld \
22+
-T $(top_srcdir)/ld/esp32.rom.syscalls.ld
23+
endif
1624

1725
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
1826
LDADD = $(top_builddir)/src/libesp32basic.a
@@ -22,7 +30,9 @@ bin_PROGRAMS = \
2230

2331
rmtws2812_elf_SOURCES = rmtws2812.c
2432

33+
if WITH_BINARIES
2534
CLEANFILES = \
2635
rmtws2812.bin
36+
endif
2737

2838
BUILT_SOURCES = $(CLEANFILES)

0 commit comments

Comments
 (0)