Bump (Linux) Clang baseline to 5.0.2

...as discussed at
<https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html>
"minutes of ESC call ...".

This no longer sets CLANGVER, CLANG_VERSION, and CLANG_FULL_VERSION when using
Apple Clang (on macOS), which uses different version numbers from upstream
anyway.  But those variables are only used in the context of compiler plugins,
which do not work with Apple Clang anyway (which lacks necessary include files).

(Also, move "AC_SUBST(COM_IS_CLANG)" up to where it belongs.)

Change-Id: Iee37c42ecacf52fa5a07e35241bcd404025e1cdf
Reviewed-on: https://gerrit.libreoffice.org/63899
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2018-11-23 19:04:07 +01:00
parent 60610d4f5d
commit 685aca47da
2 changed files with 41 additions and 30 deletions

View file

@ -40,15 +40,11 @@ run and compile LibreOffice, also used by the TDF builds:
* Build: 10.13.2 + Xcode 9.3
* Linux:
* Runtime: RHEL 6 or CentOS 6
* Build: GCC 4.8.1 or Clang
* Build: either GCC 4.8.1; or Clang 5.0.2 with libstdc++ 7.3.0
* iOS (only for LibreOfficeKit):
* Runtime: 11.4 (only support for newer i devices == 64 bit)
* Build: Xcode 9.3 and iPhone SDK 11.4
At least Clang 3.4.2 is known to be too old to pass the configure.ac check "whether $CXX supports
C++17, C++14, or C++11" in its current form (due to the #pragma GCC diagnostic ignored "-Wpragmas"
that it does not understand).
If you want to use Clang with the LibreOffice compiler plugins, the minimal
version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin
headers, you have to compile your own Clang to use them on macOS.

View file

@ -3639,37 +3639,52 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
[AC_MSG_RESULT([yes])
COM_IS_CLANG=TRUE],
[AC_MSG_RESULT([no])])
AC_SUBST(COM_IS_CLANG)
CC_PLAIN=$CC
CLANGVER=
if test "$COM_IS_CLANG" = TRUE; then
AC_MSG_CHECKING([the Clang version])
if test "$_os" = WINNT; then
dnl In which case, assume clang-cl:
my_args="/EP /TC"
dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
dnl clang-cl:
CC_PLAIN=
for i in $CC; do
case $i in
-FIIntrin.h)
;;
*)
CC_PLAIN="$CC_PLAIN $i"
;;
esac
done
AC_MSG_CHECKING([whether Clang is new enough])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if !defined __apple_build_version__
#error
#endif
]])],
[my_apple_clang=yes],[my_apple_clang=])
if test "$my_apple_clang" = yes; then
AC_MSG_RESULT([assumed yes (Apple Clang)])
else
my_args="-E -P"
if test "$_os" = WINNT; then
dnl In which case, assume clang-cl:
my_args="/EP /TC"
dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
dnl clang-cl:
CC_PLAIN=
for i in $CC; do
case $i in
-FIIntrin.h)
;;
*)
CC_PLAIN="$CC_PLAIN $i"
;;
esac
done
else
my_args="-E -P"
fi
clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
CLANGVER=`echo $clang_version \
| $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
if test "$CLANGVER" -ge 50002; then
AC_MSG_RESULT([yes ($clang_version)])
else
AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
fi
AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
fi
clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
CLANGVER=`echo $clang_version \
| $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
fi
AC_SUBST(COM_IS_CLANG)
SHOWINCLUDES_PREFIX=
if test "$_os" = WINNT; then