summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clucene/Library_clucene.mk6
-rw-r--r--clucene/Package_source.mk8
-rw-r--r--clucene/patches/clucene-internal-zlib.patch15
-rw-r--r--clucene/source/Makefile16
4 files changed, 43 insertions, 2 deletions
diff --git a/clucene/Library_clucene.mk b/clucene/Library_clucene.mk
index 74e7dbc071fc..bda591770370 100644
--- a/clucene/Library_clucene.mk
+++ b/clucene/Library_clucene.mk
@@ -47,6 +47,12 @@ $(eval $(call gb_Library_add_defs,clucene,\
-Dclucene_contribs_lib_EXPORTS\
))
+ifeq ($(SYSTEM_ZLIB),YES)
+$(eval $(call gb_Library_add_defs,clucene,\
+ -DSYSTEM_ZLIB \
+))
+endif
+
$(eval $(call gb_Library_add_linked_libs,clucene,\
$(gb_STDLIBS) \
))
diff --git a/clucene/Package_source.mk b/clucene/Package_source.mk
index b8a774edf6f3..c51dbce75afb 100644
--- a/clucene/Package_source.mk
+++ b/clucene/Package_source.mk
@@ -35,9 +35,15 @@ $(eval $(call gb_CustomTarget_add_dependencies,clucene/source,\
clucene/configs/clucene-config-generic.h \
))
+ifeq ($(OS),WNT)
+FIXED_TARFILE_LOCATION=$(shell cygpath -u $(TARFILE_LOCATION))
+else
+FIXED_TARFILE_LOCATION=$(TARFILE_LOCATION)
+endif
+
# FIXME: do not hardcode the path here
$(eval $(call gb_CustomTarget_add_outdir_dependencies,clucene/source,\
- $(TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz \
+ $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz \
))
$(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/SharedHeader.h,src/shared/CLucene/SharedHeader.h))
diff --git a/clucene/patches/clucene-internal-zlib.patch b/clucene/patches/clucene-internal-zlib.patch
new file mode 100644
index 000000000000..666792634456
--- /dev/null
+++ b/clucene/patches/clucene-internal-zlib.patch
@@ -0,0 +1,15 @@
+--- src/shared/CLucene/util/Misc.cpp 2012-02-17 15:33:09.217891100 +0000
++++ src/shared/CLucene/util/Misc.cpp 2012-02-17 15:38:10.836597500 +0000
+@@ -34,7 +34,11 @@
+ #include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used
+
+ //for zlib...
+-#include "zlib.h"
++#ifdef SYSTEM_ZLIB
++#include <zlib.h>
++#else
++#include <external/zlib/zlib.h>
++#endif
+ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+ # include <fcntl.h>
+ # include <io.h>
diff --git a/clucene/source/Makefile b/clucene/source/Makefile
index 9a274c1902e6..aa5bcfd284ec 100644
--- a/clucene/source/Makefile
+++ b/clucene/source/Makefile
@@ -29,18 +29,32 @@
gb_PARTIALBUILD := T
include $(GBUILDDIR)/gbuild_simple.mk
+ifeq ($(OS),WNT)
+FIXED_TARFILE_LOCATION=$(shell cygpath -u $(TARFILE_LOCATION))
+else
+FIXED_TARFILE_LOCATION=$(TARFILE_LOCATION)
+endif
+
done :
mkdir -p $(dir $@)
# FIXME: do not hardcode the path here
- $(GNUTAR) -x --strip-component=1 -f $(TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
+ $(GNUTAR) -x --strip-component=1 -f $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
+ $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-internal-zlib.patch
#FIXME ?, our rules expect .cxx
for i in `find . -name "*.cpp"`; do mv $$i $${i%%cpp}cxx; done
+ifneq ($(OS),WNT)
#dirent.h is a problem, move it around
mkdir -p inc/internal/CLucene/util
mv src/shared/CLucene/util/dirent.h inc/internal/CLucene/util
+endif
#To generate these, run cmake for each sufficiently different platform, customize and stick into configs
+ifeq ($(COM),MSC)
+ cp $(SRCDIR)/clucene/configs/_clucene-config-MSVC.h src/shared/CLucene/_clucene-config.h
+ cp $(SRCDIR)/clucene/configs/clucene-config-MSVC.h src/shared/CLucene/clucene-config.h
+else
cp $(SRCDIR)/clucene/configs/_clucene-config-generic.h src/shared/CLucene/_clucene-config.h
cp $(SRCDIR)/clucene/configs/clucene-config-generic.h src/shared/CLucene/clucene-config.h
+endif
.DEFAULT_GOAL := all
.PHONY : all