aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@linux.ibm.com>2020-01-24 20:01:02 -0300
committerOliver O'Halloran <oohall@gmail.com>2020-01-29 13:51:35 +1100
commit9cd556ca1e5f3371662b83388eda2c52fc3ea092 (patch)
tree8c7f73c6db0f573f05317eb80740d1e7b4d0746e /Makefile
parentbc72973d1321546a43f03367b5e73d8ff83a83bd (diff)
downloadskiboot-9cd556ca1e5f3371662b83388eda2c52fc3ea092.zip
skiboot-9cd556ca1e5f3371662b83388eda2c52fc3ea092.tar.gz
skiboot-9cd556ca1e5f3371662b83388eda2c52fc3ea092.tar.bz2
Makefile: Search for distro-provided cross-compiler
Search for different variations of cross-compiler prefixes that might be in the PATH, in this order of preference: 1. powerpc64-linux-gcc 2. powerpc64le-linux-gcc 3. powerpc64-linux-gnu-gcc 4. powerpc64le-linux-gnu-gcc The latter two are available as distro packages in at least Debian, Fedora and Ubuntu. Tested with GNU Make 3.82 (CentOS 7) and GNU make 4.2.1 (Fedora 30). Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Tested-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f938a06..8122e0c 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,15 @@ ifdef CROSS_COMPILE
endif
ifneq ("$(ARCH)", "ppc64")
ifneq ("$(ARCH)", "ppc64le")
+ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
CROSS ?= powerpc64-linux-
+else ifneq ($(shell which powerpc64le-linux-gcc 2> /dev/null),)
+ CROSS ?= powerpc64le-linux-
+else ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
+ CROSS ?= powerpc64-linux-gnu-
+else ifneq ($(shell which powerpc64le-linux-gnu-gcc 2> /dev/null),)
+ CROSS ?= powerpc64le-linux-gnu-
+endif
endif
endif