diff options
author | Christopher Wellons <wellons@nullprogram.com> | 2021-03-03 14:23:06 -0500 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-03-04 08:16:51 +0000 |
commit | b4506956a5703ae2df062ec307d76ac935be0258 (patch) | |
tree | 49f766adaf013e8d124f94ccc09d33148da9062f | |
parent | 61e53aa93d3d6c6fcbea93c2a959836f51ef35e8 (diff) | |
download | busybox-w32-b4506956a5703ae2df062ec307d76ac935be0258.tar.gz busybox-w32-b4506956a5703ae2df062ec307d76ac935be0258.tar.bz2 busybox-w32-b4506956a5703ae2df062ec307d76ac935be0258.zip |
Work around GNU Make bug involving shell built-ins
The workaround for MSYS2 in 475c111 interacts badly with a long-standing
bug in GNU Make where it avoids spawning a shell when it believes it can
handle a command itself as a sort of Bourne shell emulation. Since
"command" is typically implemented as a special shell built-in and not
an actual program, and GNU Make does not implement this built-in in its
Bourne shell emulation, GNU Make's shell function fails to invoke it
properly, resulting in an error:
make: command: Command not found
One work-around is to set a custom shell that is not "/bin/sh" so that
GNU Make does not assume any particular shell semantics. For instance:
make SHELL=dash
A second work-around is to use a shell feature not implemented by GNU
Make, such as redirection or variable assignment (this patch), causing
it to spawn an actual shell to handle the shell command.
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -308,7 +308,7 @@ CHECK = sparse | |||
308 | 308 | ||
309 | # Handle MSYS2 weirdness | 309 | # Handle MSYS2 weirdness |
310 | ifneq ($(CROSS_COMPILE),) | 310 | ifneq ($(CROSS_COMPILE),) |
311 | ifeq ($(shell command -v $(AR)),) | 311 | ifeq ($(shell _= command -v $(AR)),) |
312 | AR := $(CROSS_COMPILE)gcc-ar | 312 | AR := $(CROSS_COMPILE)gcc-ar |
313 | STRIP := strip | 313 | STRIP := strip |
314 | WINDRES := windres | 314 | WINDRES := windres |