Skip to content

Commit

Permalink
Makefile: Fix detection of cross compiler
Browse files Browse the repository at this point in the history
The Fedora containers don't have 'which' installed. This means the
detection of the cross compiler gives false negatives, leaving CROSS
undefined.

Instead use command -v, which outputs the path of the executable if it
exists.

Fixes: 9cd556c ("Makefile: Search for distro-provided cross-compiler")
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
  • Loading branch information
shenki authored and legoater committed Mar 15, 2022
1 parent 908257e commit 3ffa501
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ ifdef CROSS_COMPILE
endif
ifneq ("$(ARCH)", "ppc64")
ifneq ("$(ARCH)", "ppc64le")
ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
ifneq ($(shell command -v powerpc64-linux-gcc 2> /dev/null),)
CROSS ?= powerpc64-linux-
else ifneq ($(shell which powerpc64le-linux-gcc 2> /dev/null),)
else ifneq ($(shell command -v powerpc64le-linux-gcc 2> /dev/null),)
CROSS ?= powerpc64le-linux-
else ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
else ifneq ($(shell command -v powerpc64-linux-gnu-gcc 2> /dev/null),)
CROSS ?= powerpc64-linux-gnu-
else ifneq ($(shell which powerpc64le-linux-gnu-gcc 2> /dev/null),)
else ifneq ($(shell command -v powerpc64le-linux-gnu-gcc 2> /dev/null),)
CROSS ?= powerpc64le-linux-gnu-
endif
endif
Expand Down

0 comments on commit 3ffa501

Please sign in to comment.