All-in-one Windows zip env incorrectly reports compiler version issue
Posted: Sat Jan 14, 2017 2:28 am
The latest all-in-one windows environment (esp32_win32_mysys2_environment_and_toolchain-20170111.zip), when executing the make command incorrectly reports that the wrong tool chain has been installed.
The cause is in code added to esp-idf/make/project.mk which checks the version number of the compiler does not take into account that programs under windows end in a .exe extension.
This can be corrected, probably without ill effects in Linux environments by changing lines 432-433 in the make file from:
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(([^)]*).*|\1|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(.*\)\ (.*)|\1|gp')
to:
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(([^)]*).*|\1|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp')
the extra ./ after "gcc" should swallow up the extension if it exists, and not change anything if it does not.
The cause is in code added to esp-idf/make/project.mk which checks the version number of the compiler does not take into account that programs under windows end in a .exe extension.
This can be corrected, probably without ill effects in Linux environments by changing lines 432-433 in the make file from:
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(([^)]*).*|\1|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(.*\)\ (.*)|\1|gp')
to:
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(([^)]*).*|\1|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp')
the extra ./ after "gcc" should swallow up the extension if it exists, and not change anything if it does not.