File postgresql-llvm-optional.patch of Package postgresql18

Index: src/Makefile.global.in
===================================================================
--- src/Makefile.global.in.orig
+++ src/Makefile.global.in
@@ -200,7 +200,12 @@ with_libnuma	= @with_libnuma@
 with_liburing	= @with_liburing@
 with_libxml	= @with_libxml@
 with_libxslt	= @with_libxslt@
-with_llvm	= @with_llvm@
+# Only build for LLVM, if the core supports it and the llvm and clang packages are installed.
+ifeq (@with_llvm@ $(wildcard /usr/bin/clang /usr/bin/llvm-lto),yes /usr/bin/clang /usr/bin/llvm-lto)
+with_llvm	= yes
+else
+with_llvm	= no
+endif
 with_system_tzdata = @with_system_tzdata@
 with_uuid	= @with_uuid@
 with_zlib	= @with_zlib@
openSUSE Build Service is sponsored by