summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--configure.ac67
2 files changed, 42 insertions, 31 deletions
diff --git a/README.md b/README.md
index 45abb593bf9d..d72e9549c4fa 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/configure.ac b/configure.ac
index 947fc3920782..cb54af0e828f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
- else
- my_args="-E -P"
+ 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
+ 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