diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-10-05 18:17:13 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-10-09 17:25:27 +0200 |
commit | 02a8d36ebf3d54784903f2899eafe010bedf2f4c (patch) | |
tree | 61ba648242b1356b7da72336073b91e397814e50 /configure.in | |
parent | 7b34748b1bfd8b5fe0406c1f6bdaaa585d7bc4c3 (diff) |
initial support for clang compiler plugins
The plugin is intentionally built using a custom Makefile,
because it's used by gbuild, so I don't want to build the plugin
using gbuild too. It is also intentionally not placed under workdir/,
as that is cleaned by 'make clean', the plugin is cleaned only
by 'make distclean', so that cleaning it doesn't cause ccache misses.
No actual functionality in the plugin itself yet.
Change-Id: Ic05eba8d6260eec123c9e699eb5385abfe1b832f
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 5d37a667b2d8..8b29eb30d755 100644 --- a/configure.in +++ b/configure.in @@ -791,6 +791,11 @@ AC_ARG_ENABLE(dbgutil, It is not possible to mix object files or libraries from a --enable-dbgutil and a --disable-dbgutil build.])) +AC_ARG_ENABLE(compiler-plugins, + AS_HELP_STRING([--enable-compiler-plugins], + [Enable compiler plugins that will perform additional checks during + building. Enabled automatically by --enable-dbgutil.])) + AC_ARG_ENABLE(linkoo, AS_HELP_STRING([--disable-linkoo], [Disable linkoo for the smoketest installation.])) @@ -5024,6 +5029,40 @@ fi AC_SUBST([VALGRIND_CFLAGS]) dnl =================================================================== +dnl Compiler plugins +dnl =================================================================== + +COMPILER_PLUGINS= +# currently only Clang +if test "$COM_GCC_IS_CLANG" = "TRUE"; then + if test -n "$enable_compiler_plugins"; then + compiler_plugins="$enable_compiler_plugins" + elif test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then + compiler_plugins=test + else + compiler_plugins=no + fi + if test "$compiler_plugins" != "no"; then + AC_LANG_PUSH([C++]) + save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" + AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h, + [COMPILER_PLUGINS=TRUE], + [ + if test "$compiler_plugins" = "yes"; then + AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.]) + else + AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled]) + add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled." + fi + ]) + CPPFLAGS=$save_CPPFLAGS + AC_LANG_POP([C++]) + fi +fi +AC_SUBST(COMPILER_PLUGINS) + +dnl =================================================================== dnl Set the MinGW sys-root dnl =================================================================== if test "$WITH_MINGW" = "yes"; then |