Branch libreoffice-24-8-3
[LibreOffice.git] / pyuno / Library_pyuno_wrapper.mk
blob4bce8fc00b640c17d62af105afd4ad11945cb0dd
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_Library_Library,pyuno_wrapper))
12 $(eval $(call gb_Library_set_include,pyuno_wrapper,\
13 -I$(SRCDIR)/pyuno/source/module \
14 -I$(SRCDIR)/pyuno/inc \
15 $$(INCLUDE) \
18 # not using external "python" because we do not want to link against python
19 $(eval $(call gb_Library_use_externals,pyuno_wrapper,\
20 python_headers \
23 # python "import pyuno" dlopens pyuno.so as RTLD_LOCAL, so g++ exception
24 # handling used to not work, so pyuno.so (pyuno_wrapper) is just a thin wrapper
25 # that dlopens libpyuno.so as RTLD_GLOBAL; but when pyuno.so wrapper links
26 # against libstdc++ (which has not previously been loaded into python process),
27 # that resolves its _ZNSs4_Rep20_S_empty_rep_storageE to itself, but later LO
28 # libs (loaded though RTLD_GLOBAL libpyuno.so) may resolve that symbol to e.g.
29 # cppu, because they happen to see that before libstdc++; so the requirement has
30 # always been that RTLD_LOCAL-loaded pyuno.so wrapper implicitly load into the
31 # process as little as possible.
32 # To ensure that pyuno.so does not link against libstdc++ the dynamic link
33 # command invokes gcc and not g++ if there are only C objects, so
34 # don't add any C++ objects here!
36 ifeq ($(filter DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX,$(OS)),)
38 $(eval $(call gb_Library_add_libs,pyuno_wrapper,\
39 -ldl \
42 endif
44 $(eval $(call gb_Library_add_cobjects,pyuno_wrapper,\
45 pyuno/source/module/pyuno_dlopenwrapper \
48 # vim:set noet sw=4 ts=4: