aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile.llvm16
1 files changed, 14 insertions, 2 deletions
diff --git a/GNUmakefile.llvm b/GNUmakefile.llvm
index 4dd0793f..bd5adcb6 100644
--- a/GNUmakefile.llvm
+++ b/GNUmakefile.llvm
@@ -165,12 +165,24 @@ endif
# old. For these we need to use gcc/g++, so if we find REAL_CC and REAL_CXX
# variable we override the compiler variables here
ifneq "$(REAL_CC)" ""
-CC = $(REAL_CC)
+ CC = $(REAL_CC)
endif
ifneq "$(REAL_CXX)" ""
-CXX = $(REAL_CXX)
+ CXX = $(REAL_CXX)
endif
+#
+# Now it can happen that CC points to clang - but there is no clang on the
+# system. Then we fall back to cc
+#
+ifeq "$(shell type $(CC)" ""
+ CC = cc
+endif
+ifeq "$(shell type $(CXX)" ""
+ CXX = c++
+endif
+
+
# After we set CC/CXX we can start makefile magic tests
#ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"