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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon May 18 13:03:50 UTC 2020


 configure.ac |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cce42f7de6bdc406f40a0a16ad15285adc4a4c62
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon May 18 11:54:08 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon May 18 15:03:14 2020 +0200

    Apply dirname to the first word of CXX
    
    ...in case it contains addtional arguments like -fsized-deallocation besides the
    compiler's pathname, which would have caused failures like
    
      basename: extra operand '-fsized-deallocation'
      Try 'basename --help' for more information.
      dirname: missing operand
      Try 'dirname --help' for more information.
      dirname: missing operand
      Try 'dirname --help' for more information.
    
    (printf reuses the format operand to satisfy all argument operands, so that \n |
    head hack is needed to get just the first one, assuming that CXX did not contain
    any carefully crafted escape sequences inside that first argument that would
    expand to a newline when printing.  Also, this does not cater for leading
    var=value or (even more far-fetched) redirection words in CXX, but the original
    code did not, either.)
    
    Change-Id: Iae4d1a0ae3b67cc5e8c7a8a36258230f8ab8fd70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94406
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/configure.ac b/configure.ac
index 1d531f32edec..6e5e18021a3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7205,7 +7205,7 @@ if test "$COM_IS_CLANG" = "TRUE"; then
         dnl The prefix where Clang resides, override to where Clang resides if
         dnl using a source build:
         if test -z "$CLANGDIR"; then
-            CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $CXX))))
+            CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $(printf '%s\n' $CXX | head -n 1)))))
         fi
         # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
         if test -z "$COMPILER_PLUGINS_CXX"; then


More information about the Libreoffice-commits mailing list