summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubos Lunak <l.lunak@suse.cz>2012-12-23 22:38:34 +0100
committerLubos Lunak <l.lunak@suse.cz>2012-12-26 13:56:45 +0100
commite1b11cc461423f4b8f2709bd83cc7c7014c3de1c (patch)
tree2641b58aae7266063106f1651a675047f1f329bb
parent8c0cb89a4f00704223101c8a380da1ceb33d706a (diff)
config_clang.h
-rw-r--r--compilerplugins/Makefile-clang.mk2
-rw-r--r--compilerplugins/clang/sallogareas.cxx8
-rw-r--r--config/config_clang.h.in12
-rw-r--r--configure.ac3
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])