Skip to content

Commit

Permalink
Updated esp32 toolchain to 2019r1.
Browse files Browse the repository at this point in the history
Fixed up weird permissions in the esp32 toolchain tar ball.

Patched configure to accept bash 5 as being >= 3.1.
  • Loading branch information
jmattsson committed Jul 31, 2019
1 parent bf95ffb commit b83956a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ esp8266: build/toolchain-esp8266-$(VER).tar.xz
build/lx106/Makefile:
$Qcd build && git clone --recursive https://github.com/pfalcon/esp-open-sdk.git lx106

esp8266-$(VER)/bin/xtensa-lx106-elf-gcc: build/lx106/Makefile
build/lx106/patched: build/lx106/Makefile
$Qcd "$(dir $@)" && patch -p0 < ../../esp8266-configure.patch
@touch $@

esp8266-$(VER)/bin/xtensa-lx106-elf-gcc: build/lx106/patched
$Qecho CT_STATIC_TOOLCHAIN=y >> $(dir $<)/crosstool-config-overrides
$Qcd "$(dir $<)" && $(MAKE) STANDALONE=n TOOLCHAIN="$(TOPDIR)/esp8266-$(VER)" toolchain libhal

Expand All @@ -30,10 +34,14 @@ build/toolchain-esp8266-$(VER).tar.xz: esp8266-$(VER)/bin/xtensa-lx106-elf-gcc


build/esp32/bootstrap:
$Qcd build && git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git esp32
$Qcd build && git clone -b esp32-2019r1_ctng-1.23.x https://github.com/espressif/crosstool-NG.git esp32
@touch $@

build/esp32/patched: build/esp32/bootstrap
$Qcd "$(dir $@)" && patch -p0 < ../../esp32-configure.patch
@touch $@

build/esp32/Makefile: build/esp32/bootstrap
build/esp32/Makefile: build/esp32/patched
$Qcd "$(dir $@)" && ./bootstrap && ./configure --prefix="`pwd`"

build/esp32/ct-ng: build/esp32/Makefile
Expand All @@ -46,6 +54,8 @@ build/esp32/.config: build/esp32/ct-ng

esp32-$(VER)/bin/xtensa-esp32-elf-gcc: build/esp32/.config
$Qcd "$(dir $<)" && ./ct-ng build
@echo Fixing up directory permissions...
$Qchmod -R u+w "esp32-$(VER)"

build/toolchain-esp32-$(VER).tar.xz: esp32-$(VER)/bin/xtensa-esp32-elf-gcc
@echo 'Packaging toolchain ($@)...'
Expand Down
11 changes: 11 additions & 0 deletions esp32-configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- configure.orig 2019-07-31 16:33:42.340434597 +1000
+++ configure.ac 2019-07-31 16:35:51.013963106 +1000
@@ -151,7 +151,7 @@
[GNU bash >= 3.1],
[bash],
[bash],
- [^GNU bash, version (3\.[1-9]|4)])
+ [^GNU bash, version (3\.[1-9]|4|5)])

# We need a awk that *is* GNU awk
CTNG_PROG_VERSION_REQ_STRICT([AWK],
11 changes: 11 additions & 0 deletions esp8266-configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- crosstool-NG/configure.orig 2019-07-31 17:38:30.662644555 +1000
+++ crosstool-NG/configure.ac 2019-07-31 17:38:43.786800527 +1000
@@ -190,7 +190,7 @@
AC_CACHE_CHECK([for bash >= 3.1], [ac_cv_path__BASH],
[AC_PATH_PROGS_FEATURE_CHECK([_BASH], [bash],
[[_BASH_ver=$($ac_path__BASH --version 2>&1 \
- |$EGREP '^GNU bash, version (3\.[1-9]|4)')
+ |$EGREP '^GNU bash, version (3\.[1-9]|4|5)')
test -n "$_BASH_ver" && ac_cv_path__BASH=$ac_path__BASH ac_path__BASH_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find bash >= 3.1])])])

0 comments on commit b83956a

Please sign in to comment.