diff options
-rw-r--r-- | compilerplugins/Makefile-clang.mk | 2 | ||||
-rw-r--r-- | compilerplugins/clang/sallogareas.cxx | 8 | ||||
-rw-r--r-- | config/config_clang.h.in | 12 | ||||
-rw-r--r-- | configure.ac | 3 |
4 files changed, 19 insertions, 6 deletions
diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk index c87338c36c6a..6031fe194f86 100644 --- a/compilerplugins/Makefile-clang.mk +++ b/compilerplugins/Makefile-clang.mk @@ -52,7 +52,7 @@ CLANGOBJS= define clangbuildsrc $(3): $(2) $(SRCDIR)/compilerplugins/Makefile-clang.mk $(CLANGOUTDIR)/clang-timestamp @echo [build CXX] $(subst $(SRCDIR)/,,$(2)) - $(CXX) $(CLANGCXXFLAGS) $(CLANGDEFS) $(CLANGINCLUDES) -DSRCDIR=$(SRCDIR) $(2) -fPIC -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d + $(CXX) $(CLANGCXXFLAGS) $(CLANGDEFS) $(CLANGINCLUDES) -I$(BUILDDIR)/config $(2) -fPIC -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d -include $(CLANGOUTDIR)/$(1).d diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx index 10630aa3981c..4462413f7ced 100644 --- a/compilerplugins/clang/sallogareas.cxx +++ b/compilerplugins/clang/sallogareas.cxx @@ -16,6 +16,8 @@ #include <fstream> +#include <config_clang.h> + namespace loplugin { @@ -110,11 +112,7 @@ void SalLogAreas::checkArea( StringRef area, SourceLocation location ) void SalLogAreas::readLogAreas() { -#define STRINGIFY2( s ) #s -#define STRINGIFY( s ) STRINGIFY2( s ) - ifstream is( STRINGIFY( SRCDIR ) "/sal/inc/sal/log-areas.dox" ); -#undef STRINGIFY -#undef STRINGIFY2 + ifstream is( SRCDIR "/sal/inc/sal/log-areas.dox" ); while( is.good()) { string line; diff --git a/config/config_clang.h.in b/config/config_clang.h.in new file mode 100644 index 000000000000..60ff5bf5914d --- /dev/null +++ b/config/config_clang.h.in @@ -0,0 +1,12 @@ +/* + +Settings related to Clang compiler plugins. + +*/ + +#ifndef CONFIG_CLANG_H +#define CONFIG_CLANG_H + +#undef SRCDIR + +#endif diff --git a/configure.ac b/configure.ac index 9de1aeccee2a..d5ce6afca0a0 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,7 @@ AC_SUBST(SRC_ROOT) AC_SUBST(BUILDDIR) AC_SUBST(EXEEXT_FOR_BUILD) AC_SUBST(x_Cygwin) +AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT") if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account]) @@ -4164,6 +4165,7 @@ if test "$cross_compiling" = "yes"; then config_host.mk.in \ configure \ Makefile.in \ + config/config_clang.h.in \ config/config_global.h.in \ config/config_graphite.h.in \ config/config_telepathy.h.in \ @@ -12353,6 +12355,7 @@ else fi AC_CONFIG_FILES([config_host.mk Makefile]) +AC_CONFIG_HEADERS([config/config_clang.h]) AC_CONFIG_HEADERS([config/config_global.h]) AC_CONFIG_HEADERS([config/config_graphite.h]) AC_CONFIG_HEADERS([config/config_telepathy.h]) |