Kaydet (Commit) a7a79ee9 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Move clew into a library of its own

Change-Id: Ifb7e86b078bd549506a9cc1b9ce9fc22fffc5eec
üst 5cec4ea8
...@@ -115,6 +115,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) ...@@ -115,6 +115,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
$(call fetch_Optional,CAIRO,CAIRO_TARBALL) \ $(call fetch_Optional,CAIRO,CAIRO_TARBALL) \
$(call fetch_Optional,CAIRO,PIXMAN_TARBALL) \ $(call fetch_Optional,CAIRO,PIXMAN_TARBALL) \
$(call fetch_Optional,CDR,CDR_TARBALL) \ $(call fetch_Optional,CDR,CDR_TARBALL) \
$(call fetch_Optional,CLCC,CLCC_TARBALL) \
$(call fetch_Optional,CLUCENE,CLUCENE_TARBALL) \ $(call fetch_Optional,CLUCENE,CLUCENE_TARBALL) \
$(call fetch_Optional,CMIS,CMIS_TARBALL) \ $(call fetch_Optional,CMIS,CMIS_TARBALL) \
$(call fetch_Optional,COINMP,COINMP_TARBALL) \ $(call fetch_Optional,COINMP,COINMP_TARBALL) \
......
...@@ -316,6 +316,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -316,6 +316,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
chartcore \ chartcore \
chartcontroller \ chartcontroller \
chartopengl \ chartopengl \
$(call gb_Helper_optional,CLCC,clew) \
$(if $(filter $(OS),WNT),,cmdmail) \ $(if $(filter $(OS),WNT),,cmdmail) \
cppcanvas \ cppcanvas \
configmgr \ configmgr \
......
...@@ -279,6 +279,17 @@ endef ...@@ -279,6 +279,17 @@ endef
endif # SYSTEM_GLEW endif # SYSTEM_GLEW
define gb_LinkTarget__use_clew
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,clcc)/src \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_libraries,$(1),\
clew \
)
endef
define gb_LinkTarget__use_iconv define gb_LinkTarget__use_iconv
$(call gb_LinkTarget_add_libs,$(1),-liconv) $(call gb_LinkTarget_add_libs,$(1),-liconv)
......
...@@ -10264,6 +10264,7 @@ dnl ================================================= ...@@ -10264,6 +10264,7 @@ dnl =================================================
ENABLE_OPENCL= ENABLE_OPENCL=
if test $_os != iOS -a $_os != Android; then if test $_os != iOS -a $_os != Android; then
ENABLE_OPENCL=TRUE ENABLE_OPENCL=TRUE
BUILD_TYPE="$BUILD_TYPE CLCC"
AC_DEFINE(HAVE_FEATURE_OPENCL) AC_DEFINE(HAVE_FEATURE_OPENCL)
fi fi
AC_SUBST(ENABLE_OPENCL) AC_SUBST(ENABLE_OPENCL)
......
...@@ -20,6 +20,8 @@ export BSH_TARBALL := ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz ...@@ -20,6 +20,8 @@ export BSH_TARBALL := ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz
export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz
export CDR_MD5SUM := b33fd0be3befdd1b37777e08ce058bd9 export CDR_MD5SUM := b33fd0be3befdd1b37777e08ce058bd9
export CDR_TARBALL := libcdr-0.1.1.tar.bz2 export CDR_TARBALL := libcdr-0.1.1.tar.bz2
export CLCC_TARBALL := clcc-0.3.0-25-src.zip
export CLCC_MD5SUM := 7ec003cc775d1cd06e789fb054c1d695
export CLUCENE_TARBALL := 48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz export CLUCENE_TARBALL := 48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
export CMIS_TARBALL := 22f8a85daf4a012180322e1f52a7563b-libcmis-0.4.1.tar.gz export CMIS_TARBALL := 22f8a85daf4a012180322e1f52a7563b-libcmis-0.4.1.tar.gz
export COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129 export COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129
......
...@@ -27,6 +27,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ ...@@ -27,6 +27,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,BSH,beanshell) \ $(call gb_Helper_optional,BSH,beanshell) \
$(call gb_Helper_optional,CAIRO,cairo) \ $(call gb_Helper_optional,CAIRO,cairo) \
$(call gb_Helper_optional,CDR,libcdr) \ $(call gb_Helper_optional,CDR,libcdr) \
$(call gb_Helper_optional,CLCC,clcc) \
$(call gb_Helper_optional,CLUCENE,clucene) \ $(call gb_Helper_optional,CLUCENE,clucene) \
$(call gb_Helper_optional,CMIS,libcmis) \ $(call gb_Helper_optional,CMIS,libcmis) \
$(call gb_Helper_optional,COINMP,coinmp) \ $(call gb_Helper_optional,COINMP,coinmp) \
......
# -*- 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,clew))
$(eval $(call gb_Library_use_unpacked,clew,clcc))
$(eval $(call gb_Library_add_defs,clew,\
-DCLEW_BUILD \
))
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,clew,\
-ldl \
-lrt \
))
endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_libs,clew,\
-framework OpenCL \
))
endif
$(eval $(call gb_Library_add_generated_cobjects,clew,\
UnpackedTarball/clcc/src/clew \
))
# vim: set noet sw=4 ts=4:
# -*- 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:
# -*- 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,clcc))
$(eval $(call gb_Module_add_targets,clcc,\
Library_clew \
UnpackedTarball_clcc \
))
# vim: set noet sw=4 ts=4:
# -*- 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,clcc))
$(eval $(call gb_UnpackedTarball_set_tarball,clcc,$(CLCC_TARBALL),0))
$(eval $(call gb_UnpackedTarball_set_patchlevel,clcc,0))
$(eval $(call gb_UnpackedTarball_fix_end_of_line,clcc,\
src/clew.c \
src/clew.h \
))
$(eval $(call gb_UnpackedTarball_add_patches,clcc,\
external/clcc/clew-non-static.patch \
))
# vim: set noet sw=4 ts=4:
--- src/clew.h
+++ src/clew.h
@@ -1141,25 +1141,28 @@
// calling the returned function address.
//
typedef CL_API_ENTRY void * (CL_API_CALL * PFNCLGETEXTENSIONFUNCTIONADDRESS)(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
-
-
-#define CLEW_STATIC
#ifdef CLEW_STATIC
# define CLEWAPI extern
#else
# ifdef CLEW_BUILD
-# define CLEWAPI extern __declspec(dllexport)
+# if defined(_WIN32)
+# define CLEWAPI extern __declspec(dllexport)
+# elif defined(HAVE_GCC_VISIBILITY_FEATURE)
+# define CLEWAPI extern __attribute__ ((visibility("default")))
+# else
+# define CLEWAPI extern
+# endif
# else
-# define CLEWAPI extern __declspec(dllimport)
+# if defined(_WIN32)
+# define CLEWAPI extern __declspec(dllimport)
+# else
+# define CLEWAPI extern
+# endif
# endif
#endif
-#if defined(_WIN32)
-#define CLEW_FUN_EXPORT extern
-#else
#define CLEW_FUN_EXPORT CLEWAPI
-#endif
#define CLEW_GET_FUN(x) x
@@ -1305,9 +1305,9 @@
#define CLEW_ERROR_IMPORT_FAILED -3 //!< Error code for failing to import a named function from the dll
//! \brief Load OpenCL dynamic library and set function entry points
-int clewInit (const char*);
+CLEW_FUN_EXPORT int clewInit (const char*);
//! \brief Convert an OpenCL error code to its string equivalent
-const char* clewErrorString (cl_int error);
+CLEW_FUN_EXPORT const char* clewErrorString (cl_int error);
#ifdef __cplusplus
}
...@@ -107,13 +107,6 @@ $(eval $(call gb_CppunitTest_use_components,sc_opencl_test,\ ...@@ -107,13 +107,6 @@ $(eval $(call gb_CppunitTest_use_components,sc_opencl_test,\
xmloff/util/xo \ xmloff/util/xo \
)) ))
ifeq ($(OS),LINUX)
$(eval $(call gb_CppunitTest_add_libs,sc_opencl_test,\
-ldl \
-lrt \
))
endif
$(eval $(call gb_CppunitTest_use_configuration,sc_opencl_test)) $(eval $(call gb_CppunitTest_use_configuration,sc_opencl_test))
$(eval $(call gb_CppunitTest_use_filter_configuration,sc_opencl_test)) $(eval $(call gb_CppunitTest_use_filter_configuration,sc_opencl_test))
......
...@@ -31,6 +31,7 @@ endif ...@@ -31,6 +31,7 @@ endif
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\ $(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
boost_headers \ boost_headers \
$(call gb_Helper_optional,CLCC,clew) \
icu_headers \ icu_headers \
icui18n \ icui18n \
icuuc \ icuuc \
...@@ -105,13 +106,6 @@ $(eval $(call gb_CppunitTest_use_components,sc_ucalc,\ ...@@ -105,13 +106,6 @@ $(eval $(call gb_CppunitTest_use_components,sc_ucalc,\
uui/util/uui \ uui/util/uui \
)) ))
ifeq ($(OS),LINUX)
$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
-ldl \
-lrt \
))
endif
$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc)) $(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -37,6 +37,7 @@ $(eval $(call gb_Library_use_sdk_api,sc)) ...@@ -37,6 +37,7 @@ $(eval $(call gb_Library_use_sdk_api,sc))
$(eval $(call gb_Library_use_externals,sc,\ $(eval $(call gb_Library_use_externals,sc,\
boost_headers \ boost_headers \
$(call gb_Helper_optional,CLCC,clew) \
icu_headers \ icu_headers \
icui18n \ icui18n \
icuuc \ icuuc \
...@@ -673,22 +674,8 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ ...@@ -673,22 +674,8 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/opencl/op_array \ sc/source/core/opencl/op_array \
sc/source/core/opencl/op_logical \ sc/source/core/opencl/op_logical \
sc/source/core/opencl/op_spreadsheet \ sc/source/core/opencl/op_spreadsheet \
sc/source/core/opencl/clcc/clew \
)) ))
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,sc,\
-ldl \
-lrt \
))
endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_libs,sc,\
-framework OpenCL \
))
endif
endif endif
$(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc)) $(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc))
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <rtl/string.hxx> #include <rtl/string.hxx>
#include "clcc/clew.h" #include <clew.h>
#define CHECK_OPENCL(status,name) \ #define CHECK_OPENCL(status,name) \
if( status != CL_SUCCESS ) \ if( status != CL_SUCCESS ) \
......
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include "clcc/clew.h" #include <clew.h>
#include <formula/token.hxx> #include <formula/token.hxx>
#include <formula/vectortoken.hxx> #include <formula/vectortoken.hxx>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "clcc/clew.h" #include <clew.h>
#define DS_DEVICE_NAME_LENGTH 256 #define DS_DEVICE_NAME_LENGTH 256
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment