Skip to content

Commit 27c9b2e

Browse files
dwrobelAndy Pugh
authored andcommitted
Fix using -dumpfullversion for old compilers and clang
Fixes (non-fatal) error: gcc: fatal error: no input files produced by compilers which does not support -dumpfullversion (includes old gcc and all clang). It also uses $(CC) instead of hardcoded 'gcc' value. Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
1 parent cb294d9 commit 27c9b2e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/hal/user_comps/xhc-whb04b-6/Submakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
GCC_VERSION := $(shell gcc -dumpversion)
2-
MIN_VERSION := 4.7
3-
ifeq ($(MIN_VERSION),$(firstword $(sort $(GCC_VERSION) $(MIN_VERSION))))
1+
2+
GCC_GTEQ_470 := $(shell $(CC) --version | head -n1 | grep gcc >/dev/null && (expr `($(CC) -dumpfullversion 2>/dev/null || $(CC) -dumpversion) | awk -F '.' '{print $$1*10000+$$2*100+$$3}'` \>= 40700 || true) || echo 1)
3+
ifeq "$(GCC_GTEQ_470)" "1"
44
ifdef HAVE_LIBUSB10
55

66
XHC_WHB04B6_LIB_DEPENDENCIES = ../lib/liblinuxcnchal.so.0 ../lib/liblinuxcncini.so.0
@@ -27,5 +27,5 @@ TARGETS += ../bin/xhc-whb04b-6
2727
endif # HAVE_LIBUSB10
2828

2929
else
30-
$(info gcc version $(GCC_VERSION) too old: skipping hal/user_comps/xhc-whb04b-6)
30+
$(info Compiler version: "$(shell $(CC) --version | head -n1)" is too old: skipping hal/user_comps/xhc-whb04b-6)
3131
endif # GCC VERSION CHECK

0 commit comments

Comments
 (0)