diff --git a/src/Makefile.global.in b/src/Makefile.global.in index e3ea7f21a7..df191709b2 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1020,6 +1020,21 @@ endif # enable_coverage # LLVM support # +# Don't try to build llvm bitcode if the clang used when Pg itself was built +# can no longer be found. This is possible when this Makefile.global is +# installed via a -devel package that doesn't have a hard dependency on clang, +# particularly for enterprise distros that may use a newer clang for builds. +ifeq ($(with_llvm),yes) +# Only override setting made by Makefile.global defaults not on cmdline etc +ifeq ($(origin with_llvm),file) +ifeq ($(wildcard $(CLANG)),) +$(warning disabling llvm bitcode generation: $$(CLANG) = $(CLANG) not found) +with_llvm = no +endif +endif +endif + ifndef COMPILE.c.bc # -Wno-ignored-attributes added so gnu_printf doesn't trigger # warnings, when the main binary is compiled with C.