configure.ac |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 08bb758b150d6d52258b2a4f783e37298bb42373
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Sun Nov 6 21:51:40 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Nov 7 08:15:36 2022 +0100

    Adapt to llvm-config --src-root dropped from LLVM 16 trunk
    
    ...with
    
<https://github.com/llvm/llvm-project/commit/c061892fcdbdfe46884c54a7a7bfe6df54d1df12>
    "[llvm-config] Remove --src-root option", causing
    
    > checking for llvm-config... .../llvm-config
    > usage: llvm-config <OPTION>... [<COMPONENT>...]
    [...]
    > dirname: missing operand
    > Try 'dirname --help' for more information.
    
    noise during configure
    
    Change-Id: I0051dd523a3f4cebfdd8b14d8f2e83ba9e5e959b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142362
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/configure.ac b/configure.ac
index e079b251b108..b4b9a7a24eb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8403,9 +8403,11 @@ if test "$COM_IS_CLANG" = "TRUE"; then
             fi
             # Try if clang is built from source (in which case its includes 
are not together with llvm includes).
             # src-root is [llvm-toplevel-src-dir]/llvm, clang is 
[llvm-toplevel-src-dir]/clang
-            clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
-            if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d 
"$clangsrcdir/clang/include"; then
-                COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS 
-I$clangsrcdir/clang/include"
+            if $LLVM_CONFIG --src-root >/dev/null 2>&1; then
+                clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
+                if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d 
"$clangsrcdir/clang/include"; then
+                    COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS 
-I$clangsrcdir/clang/include"
+                fi
             fi
             # obj-root is [llvm-toplevel-obj-dir]/, clang is 
[llvm-toplevel-obj-dir]/tools/clang
             clangobjdir=$($LLVM_CONFIG --obj-root)

Reply via email to