summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.top2
-rw-r--r--Module_tail_build.mk1
-rw-r--r--RepositoryExternal.mk24
-rw-r--r--RepositoryModule_ooo.mk1
-rw-r--r--libexttextcat/ExternalPackage_libexttextcat.mk19
-rw-r--r--libexttextcat/ExternalProject_libexttextcat.mk27
-rw-r--r--libexttextcat/Makefile7
-rw-r--r--libexttextcat/Module_libexttextcat.mk29
-rw-r--r--libexttextcat/StaticLibrary_exttextcat.mk25
-rw-r--r--libexttextcat/UnpackedTarball_libexttextcat.mk18
-rw-r--r--libexttextcat/Zip_fingerprint.mk37
-rw-r--r--libexttextcat/makefile.mk94
-rw-r--r--libexttextcat/prj/d.lst10
-rw-r--r--libexttextcat/prj/dmake0
-rw-r--r--lingucomponent/source/languageguessing/guess.cxx4
-rw-r--r--lingucomponent/source/languageguessing/guesslang.cxx4
-rw-r--r--lingucomponent/source/languageguessing/simpleguesser.cxx8
-rw-r--r--tail_build/prj/build.lst2
18 files changed, 192 insertions, 120 deletions
diff --git a/Makefile.top b/Makefile.top
index 9e67a71eb476..5ab6e590e42a 100644
--- a/Makefile.top
+++ b/Makefile.top
@@ -108,6 +108,7 @@ languagetool\
lcms2\
libcdr\
libcmis\
+libexttextcat\
libmspub\
liborcus\
libpng\
@@ -224,7 +225,6 @@ external\
helpcontent2 \
icu\
instsetoo_native\
-libexttextcat\
liblangtag\
libxml2\
libxmlsec\
diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index f1a43f955986..7917d7f968e6 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -95,6 +95,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
$(call gb_Helper_optional,LCMS2,lcms2) \
libcdr \
libcmis \
+ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \
libmspub \
liborcus \
librelogo \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 782f3e5e4ea9..6ffed9a4a092 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -487,32 +487,28 @@ $(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \
$(LIBEXTTEXTCAT_CFLAGS) \
)
+$(call gb_LinkTarget_add_defs,$(1),\
+ -DSYSTEM_LIBEXTTEXTCAT \
+)
$(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))
endef
else # !SYSTEM_LIBEXTTEXTCAT
-ifeq ($(OS),WNT)
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
- libexttextcat \
-))
-else
$(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
- exttextcat-1.0 \
+ exttextcat \
))
-endif
define gb_LinkTarget__use_libexttextcat
-ifeq ($(OS),WNT)
-$(call gb_LinkTarget_use_libraries,$(1),\
- libexttextcat \
-)
-else
$(call gb_LinkTarget_use_static_libraries,$(1),\
- exttextcat-1.0 \
+ exttextcat \
+)
+
+$(call gb_LinkTarget_set_include,$(1),\
+ -I$(call gb_UnpackedTarball_get_dir,libexttextcat/src) \
+ $$(INCLUDE) \
)
-endif
endef
diff --git a/RepositoryModule_ooo.mk b/RepositoryModule_ooo.mk
index e77c1c8ecc72..68140781722e 100644
--- a/RepositoryModule_ooo.mk
+++ b/RepositoryModule_ooo.mk
@@ -105,6 +105,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
$(call gb_Helper_optional,LCMS2,lcms2) \
libcdr \
libcmis \
+ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \
libmspub \
liborcus \
libpng \
diff --git a/libexttextcat/ExternalPackage_libexttextcat.mk b/libexttextcat/ExternalPackage_libexttextcat.mk
new file mode 100644
index 000000000000..c6140a446247
--- /dev/null
+++ b/libexttextcat/ExternalPackage_libexttextcat.mk
@@ -0,0 +1,19 @@
+# -*- 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_ExternalPackage_ExternalPackage,libexttextcat,libexttextcat))
+
+ifneq ($(COM),MSC)
+
+$(eval $(call gb_ExternalPackage_use_external_project,libexttextcat,libexttextcat))
+
+$(eval $(call gb_ExternalPackage_add_file,libexttextcat,lib/libexttextcat.a,src/.libs/libexttextcat-1.0.a))
+
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/ExternalProject_libexttextcat.mk b/libexttextcat/ExternalProject_libexttextcat.mk
new file mode 100644
index 000000000000..e792b3f975df
--- /dev/null
+++ b/libexttextcat/ExternalProject_libexttextcat.mk
@@ -0,0 +1,27 @@
+# -*- 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_ExternalProject_ExternalProject,libexttextcat))
+
+$(eval $(call gb_ExternalProject_use_unpacked,libexttextcat,libexttextcat))
+
+$(eval $(call gb_ExternalProject_register_targets,libexttextcat,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,libexttextcat,build):
+ cd $(EXTERNAL_WORKDIR) \
+ && ./configure --disable-shared --with-pic \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CFLAGS="$(if $(filter TRUE,$(HAVE_GCC_VISIBILITY_FEATURE)),-fvisibility=hidden) \
+ $(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \
+ && $(MAKE) \
+ && touch $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/Makefile b/libexttextcat/Makefile
new file mode 100644
index 000000000000..ccb1c85a04da
--- /dev/null
+++ b/libexttextcat/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+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/libexttextcat/Module_libexttextcat.mk b/libexttextcat/Module_libexttextcat.mk
new file mode 100644
index 000000000000..7aa1e10a5ad9
--- /dev/null
+++ b/libexttextcat/Module_libexttextcat.mk
@@ -0,0 +1,29 @@
+# -*- 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,libexttextcat))
+
+ifeq ($(SYSTEM_LIBEXTTEXTCAT),NO)
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ UnpackedTarball_libexttextcat \
+ ExternalPackage_libexttextcat \
+ Zip_fingerprint \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ StaticLibrary_exttextcat \
+))
+else
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ ExternalProject_libexttextcat \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/StaticLibrary_exttextcat.mk b/libexttextcat/StaticLibrary_exttextcat.mk
new file mode 100644
index 000000000000..194aa6b3b195
--- /dev/null
+++ b/libexttextcat/StaticLibrary_exttextcat.mk
@@ -0,0 +1,25 @@
+# -*- 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_StaticLibrary_StaticLibrary,exttextcat))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,exttextcat,libexttextcat))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,exttextcat))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,exttextcat,\
+ UnpackedTarball/libexttextcat/src/common \
+ UnpackedTarball/libexttextcat/src/fingerprint \
+ UnpackedTarball/libexttextcat/src/textcat \
+ UnpackedTarball/libexttextcat/src/wg_mempool \
+ UnpackedTarball/libexttextcat/src/utf8misc \
+))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/UnpackedTarball_libexttextcat.mk b/libexttextcat/UnpackedTarball_libexttextcat.mk
new file mode 100644
index 000000000000..bd8fae6a642f
--- /dev/null
+++ b/libexttextcat/UnpackedTarball_libexttextcat.mk
@@ -0,0 +1,18 @@
+# -*- 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,libexttextcat))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libexttextcat,$(LIBEXTTEXTCAT_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libexttextcat,\
+ libexttextcat/android.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/Zip_fingerprint.mk b/libexttextcat/Zip_fingerprint.mk
new file mode 100644
index 000000000000..d8b449418c8b
--- /dev/null
+++ b/libexttextcat/Zip_fingerprint.mk
@@ -0,0 +1,37 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
+# (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_Zip_Zip,fingerprint,$(call gb_UnpackedTarball_get_dir,libexttextcat)/langclass))
+
+$(eval $(call gb_Zip_use_unpacked,fingerprint,libexttextcat))
+
+$(eval $(call gb_Zip_add_files,fingerprint,\
+ langclass/fpdb.conf \
+ LM/*.lm \
+))
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/libexttextcat/makefile.mk b/libexttextcat/makefile.mk
deleted file mode 100644
index a0733fdfd00b..000000000000
--- a/libexttextcat/makefile.mk
+++ /dev/null
@@ -1,94 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=.
-
-PRJNAME=libexttextcat
-TARGET=libexttextcat
-
-.IF "$(SYSTEM_LIBEXTTEXTCAT)" == "YES"
-all:
- @echo "An already available installation of libexttextcat should exist on your system."
- @echo "Therefore the version provided here does not need to be built in addition."
-.ENDIF
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# See http://cgit.freedesktop.org/libreoffice/libexttextcat/ for upstream
-# sources, far better to commit your changes in there
-TARFILE_NAME=libexttextcat-3.3.1
-TARFILE_MD5=6097739c841f671cb21332b9cc593ae7
-TARFILE_ROOTDIR=libexttextcat-3.3.1
-PATCH_FILES=android.patch
-
-.IF "$(GUI)"=="UNX"
-.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
-EXTRA_CFLAGS+=-fvisibility=hidden
-.ENDIF
-#relative to CONFIGURE_DIR
-CONFIGURE_ACTION=configure --disable-shared --with-pic CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)"
-CONFIGURE_FLAGS=$(eq,$(OS),MACOSX CPPFLAGS="$(EXTRA_CDEFS)" $(NULL))
-.IF "$(OS)"=="AIX"
-CONFIGURE_FLAGS+= CFLAGS=-D_LINUX_SOURCE_COMPAT
-.ELIF "$(OS)" == "MACOSX"
-CONFIGURE_FLAGS += \
- --prefix=/@.__________________________________________________$(EXTRPATH)
-.END
-.IF "$(CROSS_COMPILING)"=="YES"
-CONFIGURE_FLAGS+= --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
-.ENDIF
-
-BUILD_ACTION=make $(eq,$(VERBOSE),TRUE V=1)
-
-OUT2LIB=$(BUILD_DIR)$/src$/.libs$/libexttextcat-1.0.a
-
-.ENDIF # "$(GUI)"=="UNX"
-
-
-.IF "$(GUI)"=="WNT"
-BUILD_ACTION=cd src && dmake $(MAKEMACROS)
-.ENDIF # "$(GUI)"=="WNT"
-
-ALLTAR: $(BIN)/fingerprint.zip
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-.INCLUDE : tg_ext.mk
-.INCLUDE : target.mk
-
-$(BIN)/fingerprint.zip: $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
- @-rm -f $@
- @echo creating ../../../../../$@
- $(COMMAND_ECHO)zip -j $(ZIP_VERBOSITY) $@ $(MISC)/build$/$(TARFILE_ROOTDIR)$/langclass$/fpdb.conf
- $(COMMAND_ECHO)find $(MISC)/build$/$(TARFILE_ROOTDIR)$/langclass$/LM \
- -name "*.lm" -print0 | \
- xargs -0 zip -j $(ZIP_VERBOSITY) $@
diff --git a/libexttextcat/prj/d.lst b/libexttextcat/prj/d.lst
index f96c7249d226..e69de29bb2d1 100644
--- a/libexttextcat/prj/d.lst
+++ b/libexttextcat/prj/d.lst
@@ -1,10 +0,0 @@
-
-..\%__SRC%\lib\lib*.* %_DEST%\lib\lib*.*
-..\%__SRC%\lib\ilib*.* %_DEST%\lib\ilib*.*
-..\%__SRC%\bin\l*.dll %_DEST%\bin\*.dll
-
-mkdir: %_DEST%\inc\external\libexttextcat
-..\%__SRC%\misc\build\libexttextcat-3.3.1\src\*.h %_DEST%\inc\external\libexttextcat\*.h
-
-# data for language guessing
-..\%COMMON_OUTDIR%\bin\*.zip %COMMON_DEST%\pck\*.zip
diff --git a/libexttextcat/prj/dmake b/libexttextcat/prj/dmake
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/libexttextcat/prj/dmake
+++ /dev/null
diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx
index 853a0ffb0386..3fbc4a247363 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -21,7 +21,11 @@
#include <iostream>
#include <string.h>
+#ifdef SYSTEM_LIBEXTEXTCAT
#include <libexttextcat/textcat.h>
+#else
+#include <textcat.h>
+#endif
#include <altstrfunc.hxx>
#include <guess.hxx>
diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index 1f9f6e29ef2c..977c2459e358 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -40,7 +40,11 @@
#include <sal/macros.h>
+#ifdef SYSTEM_LIBEXTEXTCAT
#include <libexttextcat/textcat.h>
+#else
+#include <textcat.h>
+#endif
using namespace ::rtl;
using namespace ::osl;
diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx
index 8ed660d95b57..8057bef880b7 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -32,11 +32,19 @@
#include <sstream>
#include <iostream>
+#ifdef SYSTEM_LIBEXTEXTCAT
#include <libexttextcat/textcat.h>
#include <libexttextcat/common.h>
#include <libexttextcat/constants.h>
#include <libexttextcat/fingerprint.h>
#include <libexttextcat/utf8misc.h>
+#else
+#include <textcat.h>
+#include <common.h>
+#include <constants.h>
+#include <fingerprint.h>
+#include <utf8misc.h>
+#endif
#include <sal/types.h>
diff --git a/tail_build/prj/build.lst b/tail_build/prj/build.lst
index cc0db06a599c..6813399e6ba4 100644
--- a/tail_build/prj/build.lst
+++ b/tail_build/prj/build.lst
@@ -1,2 +1,2 @@
-tb tail_build : BERKELEYDB:berkeleydb BOOST:boost CAIRO:cairo CPPUNIT:cppunit EXPAT:expat ICU:icu JPEG:jpeg LIBEXTTEXTCAT:libexttextcat LIBLANGTAG:liblangtag LIBXML2:libxml2 libxmlsec LIBXSLT:libxslt MOZ:moz NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland XPDF:xpdf ZLIB:zlib external solenv soltools NULL
+tb tail_build : BERKELEYDB:berkeleydb BOOST:boost CAIRO:cairo CPPUNIT:cppunit EXPAT:expat ICU:icu JPEG:jpeg LIBLANGTAG:liblangtag LIBXML2:libxml2 libxmlsec LIBXSLT:libxslt MOZ:moz NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland XPDF:xpdf ZLIB:zlib external solenv soltools NULL
tb tail_build\prj nmake - all tb_prj NULL