diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d98e877..433c315a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,14 +157,6 @@ if(GIT_EXECUTABLE) message("Git commit hash: ${LWS_BUILD_HASH}") endif() -macro(confirm_command CMD NOCMD) - find_program (HAVE_CMD_${CMD} ${CMD} ) - if (NOT HAVE_CMD_${CMD}) - message(FATAL_ERROR "Missing command ${CMD} required for build: ${NOCMD}" ) - endif() -endmacro() - - if (LWS_WITH_LWSWS) message(STATUS "LWS_WITH_LWSWS --> Enabling LWS_WITH_PLUGINS and LWS_WITH_LIBUV") set(LWS_WITH_PLUGINS 1) @@ -224,10 +216,6 @@ if (LWS_WITH_ESP8266) endif() if (LWS_WITH_ESP32) - - confirm_command(xxd "usually found in vim package") - confirm_command(genromfs "install genromfs package") - set(LWS_WITH_SHARED OFF) set(LWS_WITH_MBEDTLS ON) # set(LWS_WITHOUT_CLIENT ON) diff --git a/scripts/esp32.mk b/scripts/esp32.mk index f8c8f687..566ca3d7 100644 --- a/scripts/esp32.mk +++ b/scripts/esp32.mk @@ -8,6 +8,11 @@ SHELL=/bin/bash +# check genromfs is available +GENROMFS := $(shell command -v genromfs 2> /dev/null) +# check xxd is available +XXD := $(shell command -v xxd 2> /dev/null) + ESPPORT ?= $(CONFIG_ESPTOOLPY_PORT) LWS_BUILD_PATH=$(PROJECT_PATH)/build @@ -22,6 +27,14 @@ export FAC DIRNAME:=$(shell basename $$(pwd) | tr -d '\n') $(LWS_BUILD_PATH)/pack.img: $(APP_BIN) + if [ -z "$(GENROMFS)" ]; then \ + echo "ERROR: genromfs is unavailable, please install or compile genromfs" ; \ + exit 1 ; \ + fi; \ + if [ -z "$(XXD)" ]; then \ + echo "ERROR: xxd is unavailable, please install or compile xxd (usually provided by vim package)" ; \ + exit 1 ; \ + fi; \ GNUSTAT=stat ;\ if [ `which gstat 2>/dev/null` ] ; then GNUSTAT=gstat ; fi ;\ DIRNAME=$$(basename $$(pwd) | tr -d '\n') ;\