]> mj.ucw.cz Git - pciutils.git/commitdiff
Another try at choosing the default compiler
authorMartin Mares <mj@ucw.cz>
Fri, 21 Jan 2022 13:27:49 +0000 (14:27 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 21 Jan 2022 13:27:49 +0000 (14:27 +0100)
Cross-compilers often provide only "gcc" and not "cc".

So let's try "cc" when building natively and "gcc" when cross-compiling.

Makefile

index aeb020e6b944f2c0cc5921f0996a05fb5127088a..aac99fc7c30e12af81b707558bbc687950bdb314 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,11 @@ PKGCFDIR=$(LIBDIR)/pkgconfig
 INSTALL=install
 DIRINSTALL=install -d
 STRIP=-s
-CC=$(CROSS_COMPILE)cc
+ifdef CROSS_COMPILE
+CC=$(CROSS_COMPILE)gcc
+else
+CC=cc
+endif
 AR=$(CROSS_COMPILE)ar
 RANLIB=$(CROSS_COMPILE)ranlib