[Libreoffice-commits] core.git: configure.ac

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 4 09:30:43 UTC 2019


 configure.ac |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 65aeaac24dcad9bfbe7fecf54eab84c57a39857c
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Nov 1 22:03:11 2019 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Nov 4 10:30:02 2019 +0100

    find Clang headers also if it's Clang built from source
    
    Change-Id: I2253bdce982028277b30d7bf911201675be45ca4
    Reviewed-on: https://gerrit.libreoffice.org/81919
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/configure.ac b/configure.ac
index 464129d6cc95..1711ea8a3623 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7028,6 +7028,17 @@ if test "$COM_IS_CLANG" = "TRUE"; then
             if test -z "$CLANGLIBDIR"; then
                 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
             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"
+            fi
+            # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
+            clangobjdir=$($LLVM_CONFIG --obj-root)
+            if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
+                COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
+            fi
         fi
         AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
         AC_LANG_PUSH([C++])


More information about the Libreoffice-commits mailing list