summaryrefslogtreecommitdiffstats
path: root/external/clucene
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-10-17 01:28:29 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2013-10-17 17:15:05 +0000
commit894f5e46a6d72d3cfc3731c49a5f01626c6b95db (patch)
treec5f7df9061a2df3c6a07078f88d3f157eb205852 /external/clucene
parentMSWordStyles: initial DOCX export of list styles (diff)
downloadcore-894f5e46a6d72d3cfc3731c49a5f01626c6b95db.tar.gz
core-894f5e46a6d72d3cfc3731c49a5f01626c6b95db.zip
fdo#70393: move clucene to a subdir of external
Change-Id: Ia9b7b18526119e29e21eb315d84d099861e15ea0 Reviewed-on: https://gerrit.libreoffice.org/6285 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'external/clucene')
-rw-r--r--external/clucene/Library_clucene.mk236
-rw-r--r--external/clucene/Makefile11
-rw-r--r--external/clucene/Module_clucene.mk21
-rw-r--r--external/clucene/README4
-rw-r--r--external/clucene/UnpackedTarball_clucene.mk65
-rw-r--r--external/clucene/configs/_clucene-config-LINUX.h114
-rw-r--r--external/clucene/configs/_clucene-config-MSVC.h114
-rw-r--r--external/clucene/configs/_clucene-config-generic.h114
-rw-r--r--external/clucene/configs/clucene-config-GCC-atomic.h150
-rw-r--r--external/clucene/configs/clucene-config-MINGW-atomic.h150
-rw-r--r--external/clucene/configs/clucene-config-MINGW.h150
-rw-r--r--external/clucene/configs/clucene-config-MSVC.h150
-rw-r--r--external/clucene/configs/clucene-config-generic.h150
-rw-r--r--external/clucene/patches/clucene-aix.patch40
-rw-r--r--external/clucene/patches/clucene-debug.patch11
-rw-r--r--external/clucene/patches/clucene-git1-win64.patch45
-rw-r--r--external/clucene/patches/clucene-libcpp.patch42
-rw-r--r--external/clucene/patches/clucene-multimap-put.patch9
-rw-r--r--external/clucene/patches/clucene-narrowing-conversions.patch36
-rw-r--r--external/clucene/patches/clucene-nullptr.patch22
-rw-r--r--external/clucene/patches/clucene-warnings.patch54
-rw-r--r--external/clucene/patches/contribs-lib-makefile.patch23
22 files changed, 1711 insertions, 0 deletions
diff --git a/external/clucene/Library_clucene.mk b/external/clucene/Library_clucene.mk
new file mode 100644
index 000000000000..7ac8a48a19a2
--- /dev/null
+++ b/external/clucene/Library_clucene.mk
@@ -0,0 +1,236 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,clucene))
+
+$(eval $(call gb_Library_use_external,clucene,zlib))
+
+$(eval $(call gb_Library_use_unpacked,clucene,clucene))
+
+$(eval $(call gb_Library_set_warnings_not_errors,clucene))
+
+$(eval $(call gb_Library_set_include,clucene,\
+ -I$(WORKDIR)/UnpackedTarball/clucene/inc/internal \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/core \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/contribs-lib \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/shared \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,clucene,\
+ -Dclucene_shared_EXPORTS \
+ -Dclucene_core_EXPORTS \
+ -Dclucene_contribs_lib_EXPORTS \
+ $(LFS_CFLAGS) \
+))
+
+# clucene is riddled with warnings... let's spare use
+# the pointless spamming
+$(eval $(call gb_Library_add_cxxflags,clucene,\
+ -w \
+))
+$(eval $(call gb_Library_add_cflags,clucene,\
+ -w \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,clucene,\
+ -lm \
+ -ldl \
+ -lpthread \
+))
+endif
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,clucene,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,clucene,\
+ UnpackedTarball/clucene/src/shared/CLucene/SharedHeader \
+ UnpackedTarball/clucene/src/shared/CLucene/config/gunichartables \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcslwr \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcstoll \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcscasecmp \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tprintf \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_lltot \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcstod \
+ UnpackedTarball/clucene/src/shared/CLucene/config/utf8 \
+ UnpackedTarball/clucene/src/shared/CLucene/config/threads \
+ UnpackedTarball/clucene/src/shared/CLucene/debug/condition \
+ UnpackedTarball/clucene/src/shared/CLucene/util/StringBuffer \
+ UnpackedTarball/clucene/src/shared/CLucene/util/Misc \
+ UnpackedTarball/clucene/src/shared/CLucene/util/dirent \
+ UnpackedTarball/clucene/src/core/CLucene/StdHeader \
+ UnpackedTarball/clucene/src/core/CLucene/debug/error \
+ UnpackedTarball/clucene/src/core/CLucene/util/ThreadLocal \
+ UnpackedTarball/clucene/src/core/CLucene/util/Reader \
+ UnpackedTarball/clucene/src/core/CLucene/util/Equators \
+ UnpackedTarball/clucene/src/core/CLucene/util/FastCharStream \
+ UnpackedTarball/clucene/src/core/CLucene/util/MD5Digester \
+ UnpackedTarball/clucene/src/core/CLucene/util/StringIntern \
+ UnpackedTarball/clucene/src/core/CLucene/util/BitSet \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/FastCharStream \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/MultiFieldQueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryParserTokenManager \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryToken \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/Lexer \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/MultiFieldQueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryParserBase \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryToken \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/TokenList \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardAnalyzer \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardFilter \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/Analyzers \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/AnalysisHeader \
+ UnpackedTarball/clucene/src/core/CLucene/store/MMapInput \
+ UnpackedTarball/clucene/src/core/CLucene/store/IndexInput \
+ UnpackedTarball/clucene/src/core/CLucene/store/Lock \
+ UnpackedTarball/clucene/src/core/CLucene/store/LockFactory \
+ UnpackedTarball/clucene/src/core/CLucene/store/IndexOutput \
+ UnpackedTarball/clucene/src/core/CLucene/store/Directory \
+ UnpackedTarball/clucene/src/core/CLucene/store/FSDirectory \
+ UnpackedTarball/clucene/src/core/CLucene/store/RAMDirectory \
+ UnpackedTarball/clucene/src/core/CLucene/document/Document \
+ UnpackedTarball/clucene/src/core/CLucene/document/DateField \
+ UnpackedTarball/clucene/src/core/CLucene/document/DateTools \
+ UnpackedTarball/clucene/src/core/CLucene/document/Field \
+ UnpackedTarball/clucene/src/core/CLucene/document/FieldSelector \
+ UnpackedTarball/clucene/src/core/CLucene/document/NumberTools \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileNames \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileNameFilter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexDeletionPolicy \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMergeInfo \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentInfos \
+ UnpackedTarball/clucene/src/core/CLucene/index/MergeScheduler \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermDocs \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldsWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfosWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/Term \
+ UnpackedTarball/clucene/src/core/CLucene/index/Terms \
+ UnpackedTarball/clucene/src/core/CLucene/index/MergePolicy \
+ UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriterThreadState \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermVector \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermVectorReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldInfos \
+ UnpackedTarball/clucene/src/core/CLucene/index/CompoundFile \
+ UnpackedTarball/clucene/src/core/CLucene/index/SkipListReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/SkipListWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileDeleter \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/DirectoryIndexReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermVectorWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermPositions \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMerger \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultiReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultiSegmentReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/Payload \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfo \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexModifier \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMergeQueue \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldsReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfosReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultipleTermPositions \
+ UnpackedTarball/clucene/src/core/CLucene/search/Compare \
+ UnpackedTarball/clucene/src/core/CLucene/search/Scorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/ScorerDocQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/SloppyPhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/DisjunctionSumScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/ConjunctionScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhraseQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/PrefixQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/ExactPhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/TermScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/Similarity \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanScorer2 \
+ UnpackedTarball/clucene/src/core/CLucene/search/HitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldCacheImpl \
+ UnpackedTarball/clucene/src/core/CLucene/search/ChainedFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/RangeFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/CachingWrapperFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/QueryFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/TermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FuzzyQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/SearchHeader \
+ UnpackedTarball/clucene/src/core/CLucene/search/RangeQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/IndexSearcher \
+ UnpackedTarball/clucene/src/core/CLucene/search/Sort \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhrasePositions \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldDocSortedHitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/WildcardTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiSearcher \
+ UnpackedTarball/clucene/src/core/CLucene/search/Hits \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiTermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FilteredTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldSortedHitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/WildcardQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/Explanation \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldCache \
+ UnpackedTarball/clucene/src/core/CLucene/search/DateFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/MatchAllDocsQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiPhraseQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/ConstantScoreQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/CachingSpanFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/SpanQueryFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/NearSpansOrdered \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/NearSpansUnordered \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanFirstQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanNearQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanNotQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanOrQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanTermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanWeight \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/TermSpans \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/Snowball \
+))
+
+$(eval $(call gb_Library_add_generated_cobjects,clucene,\
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/libstemmer/libstemmer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_danish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_dutch \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_english \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_finnish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_french \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_german \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_italian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_norwegian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_porter \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_portuguese \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_spanish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_swedish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_KOI8_R_russian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_danish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_dutch \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_english \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_finnish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_french \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_german \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_italian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_norwegian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_porter \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_portuguese \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_russian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_spanish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_swedish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/runtime/utilities \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/runtime/api \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/clucene/Makefile b/external/clucene/Makefile
new file mode 100644
index 000000000000..5f46a974f7fe
--- /dev/null
+++ b/external/clucene/Makefile
@@ -0,0 +1,11 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+
+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
+export EXTERNAL_WARNINGS_NOT_ERRORS
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/clucene/Module_clucene.mk b/external/clucene/Module_clucene.mk
new file mode 100644
index 000000000000..aee86111ef28
--- /dev/null
+++ b/external/clucene/Module_clucene.mk
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,clucene))
+
+# do we need the Android check below? Shouldn't it be already covered by
+# gb_Helper_optional in Module_external.mk?
+ifneq ($(OS),ANDROID)
+$(eval $(call gb_Module_add_targets,clucene,\
+ Library_clucene \
+ UnpackedTarball_clucene \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/clucene/README b/external/clucene/README
new file mode 100644
index 000000000000..458762a6dfe0
--- /dev/null
+++ b/external/clucene/README
@@ -0,0 +1,4 @@
+External package containing clucene.
+
+This is used to index our downloadable help packages, and allow them
+to be searched efficiently at run-time. \ No newline at end of file
diff --git a/external/clucene/UnpackedTarball_clucene.mk b/external/clucene/UnpackedTarball_clucene.mk
new file mode 100644
index 000000000000..cda5b3aafee6
--- /dev/null
+++ b/external/clucene/UnpackedTarball_clucene.mk
@@ -0,0 +1,65 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,clucene))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,clucene,$(CLUCENE_TARBALL)))
+
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_set_post_action,clucene,\
+ mkdir -p inc/internal/CLucene/util && \
+ mv src/shared/CLucene/util/dirent.h inc/internal/CLucene/util \
+))
+endif
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,clucene,0))
+
+# clucene-multimap-put.patch was proposed upstream, see
+# http://sourceforge.net/mailarchive/message.php?msg_id=29143260
+$(eval $(call gb_UnpackedTarball_add_patches,clucene,\
+ external/clucene/patches/clucene-debug.patch \
+ external/clucene/patches/clucene-multimap-put.patch \
+ external/clucene/patches/clucene-narrowing-conversions.patch \
+ external/clucene/patches/clucene-nullptr.patch \
+ external/clucene/patches/clucene-warnings.patch \
+ external/clucene/patches/clucene-aix.patch \
+ external/clucene/patches/clucene-git1-win64.patch \
+))
+
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_patches,clucene,\
+ external/clucene/patches/clucene-libcpp.patch \
+))
+endif
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-MSVC.h))
+ifeq ($(COM),MSC)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MSVC.h))
+else
+ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MINGW-atomic.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MINGW.h))
+endif
+endif
+else # ! $(OS),WNT
+ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-GCC-atomic.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-generic.h))
+endif
+ifeq ($(OS),LINUX)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-LINUX.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-generic.h))
+endif
+endif # $(OS),WNT
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/clucene/configs/_clucene-config-LINUX.h b/external/clucene/configs/_clucene-config-LINUX.h
new file mode 100644
index 000000000000..2b425b6b2b60
--- /dev/null
+++ b/external/clucene/configs/_clucene-config-LINUX.h
@@ -0,0 +1,114 @@
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-LINUX.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+/* #undef _CL_HAVE_FUNCTION__VSNWPRINTF */
+/* #undef _CL_HAVE_FUNCTION__SNWPRINTF */
+#define _CL_HAVE_FUNCTION_WCSCASECMP
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+/* #undef _CL_HAVE_FUNCTION_WCSICMP */
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+#define _CL_HAVE_FUNCTION_WCSDUP 1
+#define _CL_HAVE_FUNCTION_WCSTOLL 1
+/* #undef _CL_HAVE_FUNCTION_WCSUPR */
+#define _CL_HAVE_FUNCTION_GETTIMEOFDAY 1
+/* #undef _CL_HAVE_FUNCTION_MAPVIEWOFFILE */
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+#define _CL_HAVE_FUNCTION_SNPRINTF 1
+#define _CL_HAVE_FUNCTION_MMAP 1
+/* #undef _CL_HAVE_FUNCTION_STRLWR */
+#define _CL_HAVE_FUNCTION_STRTOLL 1
+/* #undef _CL_HAVE_FUNCTION_STRUPR */
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+#define _CL_HAVE_FUNCTION_USLEEP 1
+/* #undef _CL_HAVE_FUNCTION_SLEEP */
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+#define _O_RANDOM 0
+#define _O_BINARY 0
+#define _S_IREAD S_IREAD
+#define _S_IWRITE S_IWRITE
+#define _timeb timeb
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat stat64
+#define cl_stat_t stat64
+#define fileSize CL_NS(util)::Misc::filelength
+#define fileSeek lseek64
+#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR)
+#define fileHandleStat fstat64
+#define _realpath realpath
+#define _rename rename
+#define _close close
+#define _read read
+#define _cl_open open
+#define _write write
+#define _snprintf snprintf
+#define _mkdir(x) mkdir(x,0777)
+#define _unlink unlink
+#define _ftime ftime
+#define SLEEPFUNCTION usleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+#define _CL_HAVE_PTHREAD_MUTEX_RECURSIVE 1
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
diff --git a/external/clucene/configs/_clucene-config-MSVC.h b/external/clucene/configs/_clucene-config-MSVC.h
new file mode 100644
index 000000000000..09ef41cb67b7
--- /dev/null
+++ b/external/clucene/configs/_clucene-config-MSVC.h
@@ -0,0 +1,114 @@
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-MSVC.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+#define _CL_HAVE_FUNCTION__VSNWPRINTF
+#define _CL_HAVE_FUNCTION__SNWPRINTF
+/* #undef _CL_HAVE_FUNCTION_WCSCASECMP */
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+#define _CL_HAVE_FUNCTION_WCSICMP
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+#define _CL_HAVE_FUNCTION_WCSDUP 1
+/* #undef _CL_HAVE_FUNCTION_WCSTOLL */
+#define _CL_HAVE_FUNCTION_WCSUPR 1
+/* #undef _CL_HAVE_FUNCTION_GETTIMEOFDAY */
+#define _CL_HAVE_FUNCTION_MAPVIEWOFFILE 1
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+/* #undef _CL_HAVE_FUNCTION_SNPRINTF */
+/* #undef _CL_HAVE_FUNCTION_MMAP */
+#define _CL_HAVE_FUNCTION_STRLWR 1
+/* #undef _CL_HAVE_FUNCTION_STRTOLL */
+#define _CL_HAVE_FUNCTION_STRUPR 1
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+/* #undef _CL_HAVE_FUNCTION_USLEEP */
+#define _CL_HAVE_FUNCTION_SLEEP 1
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+/* undef _O_RANDOM _O_RANDOM */
+/* undef _O_BINARY _O_BINARY */
+/* undef _S_IREAD _S_IREAD */
+/* undef _S_IWRITE _S_IWRITE */
+/* #undef _timeb */
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat _stati64
+#define cl_stat_t _stati64
+#define fileSize _filelengthi64
+#define fileSeek _lseeki64
+#define fileTell _telli64
+#define fileHandleStat _fstati64
+#define _realpath(rel,abs) ::_fullpath(abs,rel,CL_MAX_PATH)
+#define _rename rename
+/* undef _close _close */
+/* undef _read _read */
+#define _cl_open _open
+/* undef _write _write */
+/* undef _snprintf _snprintf */
+/* undef _mkdir _mkdir */
+/* undef _unlink _unlink */
+/* undef _ftime _ftime */
+#define SLEEPFUNCTION Sleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+/* #undef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE */
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
diff --git a/external/clucene/configs/_clucene-config-generic.h b/external/clucene/configs/_clucene-config-generic.h
new file mode 100644
index 000000000000..42cf27c7f2ce
--- /dev/null
+++ b/external/clucene/configs/_clucene-config-generic.h
@@ -0,0 +1,114 @@
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-generic.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+/* #undef _CL_HAVE_FUNCTION__VSNWPRINTF */
+/* #undef _CL_HAVE_FUNCTION__SNWPRINTF */
+#define _CL_HAVE_FUNCTION_WCSCASECMP
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+/* #undef _CL_HAVE_FUNCTION_WCSICMP */
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+/* #undef _CL_HAVE_FUNCTION_WCSDUP 1 */
+#define _CL_HAVE_FUNCTION_WCSTOLL 1
+/* #undef _CL_HAVE_FUNCTION_WCSUPR */
+#define _CL_HAVE_FUNCTION_GETTIMEOFDAY 1
+/* #undef _CL_HAVE_FUNCTION_MAPVIEWOFFILE */
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+#define _CL_HAVE_FUNCTION_SNPRINTF 1
+#define _CL_HAVE_FUNCTION_MMAP 1
+/* #undef _CL_HAVE_FUNCTION_STRLWR */
+#define _CL_HAVE_FUNCTION_STRTOLL 1
+/* #undef _CL_HAVE_FUNCTION_STRUPR */
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+#define _CL_HAVE_FUNCTION_USLEEP 1
+/* #undef _CL_HAVE_FUNCTION_SLEEP */
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+#define _O_RANDOM 0
+#define _O_BINARY 0
+#define _S_IREAD S_IREAD
+#define _S_IWRITE S_IWRITE
+#define _timeb timeb
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat stat
+#define cl_stat_t stat
+#define fileSize CL_NS(util)::Misc::filelength
+#define fileSeek lseek
+#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR)
+#define fileHandleStat fstat
+#define _realpath realpath
+#define _rename rename
+#define _close close
+#define _read read
+#define _cl_open open
+#define _write write
+#define _snprintf snprintf
+#define _mkdir(x) mkdir(x,0777)
+#define _unlink unlink
+#define _ftime ftime
+#define SLEEPFUNCTION usleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+#define _CL_HAVE_PTHREAD_MUTEX_RECURSIVE 1
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
diff --git a/external/clucene/configs/clucene-config-GCC-atomic.h b/external/clucene/configs/clucene-config-GCC-atomic.h
new file mode 100644
index 000000000000..3c034a1da831
--- /dev/null
+++ b/external/clucene/configs/clucene-config-GCC-atomic.h
@@ -0,0 +1,150 @@
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-GCC-atomic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+#define _CL_HAVE_UNISTD_H 1
+/* #undef _CL_HAVE_IO_H */
+/* #undef _CL_HAVE_DIRECT_H */
+#define _CL_HAVE_DIRENT_H 1
+#define _CL_HAVE_SYS_DIR_H
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+/* #undef _CL_HAVE_WINDOWS_H */
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+#define _CL_HAVE_EXT_HASH_MAP 1
+/* #undef _CL_HAVE_EXT_HASH_SET */
+#define _CL_HAVE_TR1_UNORDERED_MAP 1
+#define _CL_HAVE_TR1_UNORDERED_SET 1
+#define _CL_HAVE_HASH_MAP
+#define _CL_HAVE_HASH_SET
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+#define _CL_HAVE_SYS_TIME_H 1
+/* #undef _CL_HAVE_TCHAR_H */
+#define _CL_HAVE_SYS_MMAN_H 1
+/* #undef _CL_HAVE_WINERROR_H */
+#define _CL_HAVE_STDINT_H 1
+
+// our needed types
+/* undef int8_t int8_t */
+/* undef uint8_t uint8_t */
+/* undef int16_t int16_t */
+/* undef uint16_t uint16_t */
+/* undef int32_t int32_t */
+/* undef uint32_t uint32_t */
+/* undef int64_t int64_t */
+/* undef uint64_t uint64_t */
+
+/* undef float_t*/
+
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+typedef wchar_t TCHAR;
+#define _T(x) L ## x
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+#define _CL_HAVE_PTHREAD 1
+
+/* Define if you have Win32 threads libraries and header files. */
+/* #undef _CL_HAVE_WIN32_THREADS */
+
+/* Define if we have gcc atomic functions */
+#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func) std::tr1::func
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP unordered_map
+#define _CL_HASH_SET unordered_set
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+//#define _CL_TIME_WITH_SYS_TIME 1
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+#define _CL_HAVE_GCCVISIBILITYPATCH 1
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
diff --git a/external/clucene/configs/clucene-config-MINGW-atomic.h b/external/clucene/configs/clucene-config-MINGW-atomic.h
new file mode 100644
index 000000000000..4b77b69ff8c5
--- /dev/null
+++ b/external/clucene/configs/clucene-config-MINGW-atomic.h
@@ -0,0 +1,150 @@
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MINGW-atomic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+/* undef float_t*/
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
diff --git a/external/clucene/configs/clucene-config-MINGW.h b/external/clucene/configs/clucene-config-MINGW.h
new file mode 100644
index 000000000000..009505edcf33
--- /dev/null
+++ b/external/clucene/configs/clucene-config-MINGW.h
@@ -0,0 +1,150 @@
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MINGW.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+/* undef float_t*/
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
diff --git a/external/clucene/configs/clucene-config-MSVC.h b/external/clucene/configs/clucene-config-MSVC.h
new file mode 100644
index 000000000000..edd4a3b3022f
--- /dev/null
+++ b/external/clucene/configs/clucene-config-MSVC.h
@@ -0,0 +1,150 @@
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MSVC.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+typedef double float_t;
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
diff --git a/external/clucene/configs/clucene-config-generic.h b/external/clucene/configs/clucene-config-generic.h
new file mode 100644
index 000000000000..b84dd4bc0100
--- /dev/null
+++ b/external/clucene/configs/clucene-config-generic.h
@@ -0,0 +1,150 @@
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-generic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+#define _CL_HAVE_UNISTD_H 1
+/* #undef _CL_HAVE_IO_H */
+/* #undef _CL_HAVE_DIRECT_H */
+#define _CL_HAVE_DIRENT_H 1
+#define _CL_HAVE_SYS_DIR_H
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+/* #undef _CL_HAVE_WINDOWS_H */
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+#define _CL_HAVE_EXT_HASH_MAP 1
+/* #undef _CL_HAVE_EXT_HASH_SET */
+#define _CL_HAVE_TR1_UNORDERED_MAP 1
+#define _CL_HAVE_TR1_UNORDERED_SET 1
+#define _CL_HAVE_HASH_MAP
+#define _CL_HAVE_HASH_SET
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+#define _CL_HAVE_SYS_TIME_H 1
+/* #undef _CL_HAVE_TCHAR_H */
+#define _CL_HAVE_SYS_MMAN_H 1
+/* #undef _CL_HAVE_WINERROR_H */
+#define _CL_HAVE_STDINT_H 1
+
+// our needed types
+/* undef int8_t int8_t */
+/* undef uint8_t uint8_t */
+/* undef int16_t int16_t */
+/* undef uint16_t uint16_t */
+/* undef int32_t int32_t */
+/* undef uint32_t uint32_t */
+/* undef int64_t int64_t */
+/* undef uint64_t uint64_t */
+
+/* undef float_t*/
+
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+typedef wchar_t TCHAR;
+#define _T(x) L ## x
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+#define _CL_HAVE_PTHREAD 1
+
+/* Define if you have Win32 threads libraries and header files. */
+/* #undef _CL_HAVE_WIN32_THREADS */
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func) std::tr1::func
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP unordered_map
+#define _CL_HASH_SET unordered_set
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+//#define _CL_TIME_WITH_SYS_TIME 1
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+#define _CL_HAVE_GCCVISIBILITYPATCH 1
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
diff --git a/external/clucene/patches/clucene-aix.patch b/external/clucene/patches/clucene-aix.patch
new file mode 100644
index 000000000000..2b796fa45bdc
--- /dev/null
+++ b/external/clucene/patches/clucene-aix.patch
@@ -0,0 +1,40 @@
+diff -rc clucene.orig/src/core/CLucene/store/MMapInput.cpp clucene/src/core/CLucene/store/MMapInput.cpp
+*** src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:57:37 2013
+--- src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:58:30 2013
+***************
+*** 115,121 ****
+ {
+ }
+
+! bool MMapIndexInput::open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) {
+
+ //Func - Constructor.
+ // Opens the file named path
+--- 115,121 ----
+ {
+ }
+
+! bool MMapIndexInput::Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) {
+
+ //Func - Constructor.
+ // Opens the file named path
+diff -rc clucene.orig/src/core/CLucene/store/_MMapIndexInput.h clucene/src/core/CLucene/store/_MMapIndexInput.h
+*** src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:57:37 2013
+--- src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:58:53 2013
+***************
+*** 18,24 ****
+ MMapIndexInput(const MMapIndexInput& clone);
+ MMapIndexInput(Internal* _internal);
+ public:
+! static bool open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize);
+
+ ~MMapIndexInput();
+ IndexInput* clone() const;
+--- 18,24 ----
+ MMapIndexInput(const MMapIndexInput& clone);
+ MMapIndexInput(Internal* _internal);
+ public:
+! static bool Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize);
+
+ ~MMapIndexInput();
+ IndexInput* clone() const;
diff --git a/external/clucene/patches/clucene-debug.patch b/external/clucene/patches/clucene-debug.patch
new file mode 100644
index 000000000000..640454e2fb2d
--- /dev/null
+++ b/external/clucene/patches/clucene-debug.patch
@@ -0,0 +1,11 @@
+--- src/core/CLucene/index/TermInfosReader.cpp
++++ src/core/CLucene/index/TermInfosReader.cpp
+@@ -111,7 +111,7 @@
+ //destroy their elements
+ #ifdef _DEBUG
+ for ( int32_t i=0; i<indexTermsLength;++i ){
+- indexTerms[i].__cl_refcount--;
++ indexTerms[i].__cl_decref();
+ }
+ #endif
+ //Delete the arrays
diff --git a/external/clucene/patches/clucene-git1-win64.patch b/external/clucene/patches/clucene-git1-win64.patch
new file mode 100644
index 000000000000..dc07d380bb45
--- /dev/null
+++ b/external/clucene/patches/clucene-git1-win64.patch
@@ -0,0 +1,45 @@
+--- src/shared/CLucene/config/threads.cpp 2013-06-06 16:25:23.014622397 +0200
++++ src/shared/CLucene/config/threads.cpp 2013-06-06 16:33:35.326048842 +0200
+@@ -63,14 +63,14 @@
+ }
+
+ int32_t mutex_thread::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
+-#ifdef _M_X64
++#ifdef _WIN64
+ return _InterlockedIncrement64(theInteger);
+ #else
+ return InterlockedIncrement(theInteger);
+ #endif
+ }
+ int32_t mutex_thread::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
+-#ifdef _M_X64
++#ifdef _WIN64
+ return _InterlockedDecrement64(theInteger);
+ #else
+ return InterlockedDecrement(theInteger);
+--- src/shared/CLucene/config/_threads.h 2013-06-06 16:25:23.013622420 +0200
++++ src/shared/CLucene/config/_threads.h 2013-06-06 16:29:39.152601408 +0200
+@@ -34,9 +34,9 @@
+
+ __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId();
+
+-#ifdef _M_X64
+- __declspec(dllimport) long long __stdcall _InterlockedIncrement64(__inout long long volatile*);
+- __declspec(dllimport) long long __stdcall _InterlockedDecrement64(__inout long long volatile*);
++#ifdef _WIN64
++ long long __stdcall _InterlockedIncrement64(long long volatile*);
++ long long __stdcall _InterlockedDecrement64(long long volatile*);
+ #else
+ __declspec(dllimport) long __stdcall InterlockedIncrement(long volatile*);
+ __declspec(dllimport) long __stdcall InterlockedDecrement(long volatile*);
+--- src/shared/CLucene/LuceneThreads.h 2013-06-06 16:25:23.014622397 +0200
++++ src/shared/CLucene/LuceneThreads.h 2013-06-06 16:37:45.490166481 +0200
+@@ -101,7 +101,7 @@
+
+ #define _LUCENE_ATOMIC_INC(theInteger) CL_NS(util)::mutex_thread::atomic_increment(theInteger)
+ #define _LUCENE_ATOMIC_DEC(theInteger) CL_NS(util)::mutex_thread::atomic_decrement(theInteger)
+-#ifdef _M_X64
++#ifdef _WIN64
+ #define _LUCENE_ATOMIC_INT long long
+ #else
+ #define _LUCENE_ATOMIC_INT long
diff --git a/external/clucene/patches/clucene-libcpp.patch b/external/clucene/patches/clucene-libcpp.patch
new file mode 100644
index 000000000000..35235212c795
--- /dev/null
+++ b/external/clucene/patches/clucene-libcpp.patch
@@ -0,0 +1,42 @@
+--- src/shared/CLucene/LuceneThreads.h
++++ src/shared/CLucene/LuceneThreads.h
+@@ -7,6 +7,7 @@
+ #ifndef _LuceneThreads_h
+ #define _LuceneThreads_h
+
++#include "CLucene/config/_threads.h"
+
+ CL_NS_DEF(util)
+ class CLuceneThreadIdCompare;
+--- src/core/CLucene/util/VoidMap.h
++++ src/core/CLucene/util/VoidMap.h
+@@ -11,8 +11,13 @@
+ #include "CLucene/LuceneThreads.h"
+
+ #if defined(_CL_HAVE_TR1_UNORDERED_MAP) && defined(_CL_HAVE_TR1_UNORDERED_SET)
++#ifdef _LIBCPP_VERSION
++ #include <unordered_map>
++ #include <unordered_set>
++#else
+ #include <tr1/unordered_map>
+ #include <tr1/unordered_set>
++#endif
+ #elif defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET)
+ //hashing is all or nothing!
+ #include <hash_map>
+--- src/shared/CLucene/config/repl_tchar.h
++++ src/shared/CLucene/config/repl_tchar.h
+@@ -36,8 +36,13 @@
+ #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
+ #define _tcscat wcscat //copy a string onto the end of the other string
+ #define _tcsncat wcsncat
++#if defined(_LIBCPP_VERSION) && defined(__APPLE__)
++ #define _tcschr ::wcschr //find location of one character
++ #define _tcsstr ::wcsstr //find location of a string
++#else
+ #define _tcschr wcschr //find location of one character
+ #define _tcsstr wcsstr //find location of a string
++#endif
+ #define _tcslen wcslen //get length of a string
+ #define _tcscmp wcscmp //case sensitive compare two strings
+ #define _tcsncmp wcsncmp //case sensitive compare two strings
diff --git a/external/clucene/patches/clucene-multimap-put.patch b/external/clucene/patches/clucene-multimap-put.patch
new file mode 100644
index 000000000000..bfff31a8727b
--- /dev/null
+++ b/external/clucene/patches/clucene-multimap-put.patch
@@ -0,0 +1,9 @@
+--- src/core/CLucene/util/VoidMap.h
++++ src/core/CLucene/util/VoidMap.h
+@@ -316,6 +316,7 @@ public:
+ if ( _this::dk || _this::dv )
+ _this::remove(k);
+
++ (*this)[k] = v;
+ }
+ };
diff --git a/external/clucene/patches/clucene-narrowing-conversions.patch b/external/clucene/patches/clucene-narrowing-conversions.patch
new file mode 100644
index 000000000000..64065acb1650
--- /dev/null
+++ b/external/clucene/patches/clucene-narrowing-conversions.patch
@@ -0,0 +1,36 @@
+--- src/core/CLucene/queryParser/QueryParser.cpp.sav 2011-03-17 01:21:07.000000000 +0100
++++ src/core/CLucene/queryParser/QueryParser.cpp 2012-03-09 18:20:58.000000000 +0100
+@@ -79,7 +79,7 @@
+ _T("<RANGEEX_GOOP>")
+ };
+
+-const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
++const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,int32_t(0x80000000),0x20000000,int32_t(0x80000000),0x10000,0x80000,0x10000,0x1f68000};
+ const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
+
+ struct QueryParser::JJCalls {
+--- src/core/CLucene/queryParser/QueryParserTokenManager.cpp.sav 2011-03-17 01:21:07.000000000 +0100
++++ src/core/CLucene/queryParser/QueryParserTokenManager.cpp 2012-03-09 18:20:24.000000000 +0100
+@@ -15,9 +15,9 @@
+
+ CL_NS_DEF(queryParser)
+
+-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
++const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))};
+ const int64_t QueryParserTokenManager::jjbitVec0[] = {
+- _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
++ int64_t(_ILONGLONG(0xfffffffffffffffe)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))
+ };
+ const int32_t QueryParserTokenManager::jjnextStates[]={
+ 15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27,
+--- src/core/CLucene/queryParser/legacy/Lexer.cpp.sav 2013-03-01 09:25:18.000000000 +0100
++++ src/core/CLucene/queryParser/legacy/Lexer.cpp 09:25:12.000000000 +0100
+@@ -117,7 +117,7 @@ bool Lexer::GetNextToken(QueryToken* tok
+ if( _istspace(ch)!=0 ) {
+ continue;
+ }
+- TCHAR buf[2] = {ch,'\0'};
++ TCHAR buf[2] = {TCHAR(ch),'\0'};
+ switch(ch) {
+ case '+':
+ token->set(buf, QueryToken::PLUS);
diff --git a/external/clucene/patches/clucene-nullptr.patch b/external/clucene/patches/clucene-nullptr.patch
new file mode 100644
index 000000000000..a32ddb870b8c
--- /dev/null
+++ b/external/clucene/patches/clucene-nullptr.patch
@@ -0,0 +1,22 @@
+--- src/core/CLucene/index/DocumentsWriter.cpp 2011-03-16 20:21:07.000000000 -0400
++++ src/core/CLucene/index/DocumentsWriter.cpp 2012-07-31 18:52:09.000000000 -0400
+@@ -125,7 +125,7 @@
+ if (this->postingsFreeListDW.values){
+ if (this->postingsFreeCountDW < this->postingsFreeListDW.length) {
+ memset(this->postingsFreeListDW.values + this->postingsFreeCountDW
+- , NULL
++ , 0
+ , sizeof(Posting*));
+ }
+ postingsFreeListDW.deleteUntilNULL();
+--- src/core/CLucene/util/VoidMap.h 2012-07-31 18:13:08.000000000 -0400
++++ src/core/CLucene/util/VoidMap.h 2012-07-31 18:42:54.000000000 -0400
+@@ -83,7 +83,7 @@
+ _vt get( _kt k) const {
+ const_iterator itr = base::find(k);
+ if ( itr==base::end() )
+- return (_vt)NULL;
++ return static_cast<_vt>(0);
+ else
+ return itr->second;
+ }
diff --git a/external/clucene/patches/clucene-warnings.patch b/external/clucene/patches/clucene-warnings.patch
new file mode 100644
index 000000000000..b9676d90260c
--- /dev/null
+++ b/external/clucene/patches/clucene-warnings.patch
@@ -0,0 +1,54 @@
+--- src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:37:22.531637934 +0000
++++ src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:39:15.369916728 +0000
+@@ -7,6 +7,8 @@
+ #ifndef _lucene_analysis_AnalysisHeader_
+ #define _lucene_analysis_AnalysisHeader_
+
++#pragma GCC system_header
++
+ #include "CLucene/index/Payload.h"
+ #include "CLucene/util/VoidList.h"
+ #include "CLucene/LuceneThreads.h"
+--- src/core/CLucene/search/Searchable.h 2012-02-22 12:37:22.513637729 +0000
++++ src/core/CLucene/search/Searchable.h 2012-02-22 12:38:51.073641550 +0000
+@@ -7,6 +7,7 @@
+ #ifndef _lucene_search_Searcher_
+ #define _lucene_search_Searcher_
+
++#pragma GCC system_header
+
+ //#include "CLucene/index/IndexReader.h"
+ CL_CLASS_DEF(index,Term)
+--- src/core/CLucene/store/IndexInput.h 2012-02-22 12:37:22.508637673 +0000
++++ src/core/CLucene/store/IndexInput.h 2012-02-22 12:39:00.465747935 +0000
+@@ -7,6 +7,8 @@
+ #ifndef _lucene_store_IndexInput_
+ #define _lucene_store_IndexInput_
+
++#pragma GCC system_header
++
+ #include "CLucene/LuceneThreads.h"
+ #include "CLucene/util/Equators.h"
+
+--- src/core/CLucene/util/Array.h 2012-02-22 12:37:22.510637696 +0000
++++ src/core/CLucene/util/Array.h 2012-02-22 12:38:33.714444884 +0000
+@@ -7,6 +7,8 @@
+ #ifndef _lucene_util_Array_
+ #define _lucene_util_Array_
+
++#pragma GCC system_header
++
+ #include <stdlib.h>
+ #include <string.h>
+
+--- src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:37:22.510637696 +0000
++++ src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:38:40.316519685 +0000
+@@ -7,6 +7,8 @@
+ #ifndef _lucene_util_PriorityQueue_
+ #define _lucene_util_PriorityQueue_
+
++#pragma GCC system_header
++
+ #include <stdlib.h>
+
+ CL_NS_DEF(util)
diff --git a/external/clucene/patches/contribs-lib-makefile.patch b/external/clucene/patches/contribs-lib-makefile.patch
new file mode 100644
index 000000000000..8cc05aea4cfb
--- /dev/null
+++ b/external/clucene/patches/contribs-lib-makefile.patch
@@ -0,0 +1,23 @@
+--- src/contribs-lib/CMakeLists.txt 2012-05-24 22:38:20.002443317 +0200
++++ src/contribs-lib/CMakeLists.txt 2012-05-24 22:38:05.218443899 +0200
+@@ -113,3 +113,20 @@
+ COMPILE_DEFINITIONS_DEBUG _DEBUG
+ )
+
++#install lib
++install(TARGETS clucene-contribs-lib
++ DESTINATION ${LIB_DESTINATION}
++ COMPONENT runtime )
++
++#install public headers.
++FOREACH(file ${HEADERS})
++ get_filename_component(apath ${file} PATH)
++ get_filename_component(aname ${file} NAME)
++ file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
++ IF ( NOT aname MATCHES "^_.*" )
++ install(FILES ${file}
++ DESTINATION include/${relpath}
++ COMPONENT development)
++ ENDIF ( NOT aname MATCHES "^_.*" )
++ENDFOREACH(file)
++