summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/CustomTarget_python_bin.mk40
-rw-r--r--pyuno/CustomTarget_python_shell.mk50
-rwxr-xr-xpyuno/CustomTarget_python_wrapper.mk36
-rw-r--r--pyuno/CustomTarget_pyversion.mk39
-rw-r--r--pyuno/CustomTarget_zipcore.mk47
-rw-r--r--pyuno/Executable_python_wrapper.mk41
-rw-r--r--pyuno/Library_pythonloader.mk56
-rw-r--r--pyuno/Library_pyuno.mk66
-rw-r--r--pyuno/Library_pyuno_wrapper.mk65
-rw-r--r--pyuno/Makefile7
-rwxr-xr-xpyuno/Module_pyuno.mk86
-rw-r--r--pyuno/Package_python_bin.mk31
-rw-r--r--pyuno/Package_python_scripts.mk39
-rw-r--r--pyuno/Package_python_shell.mk31
-rw-r--r--pyuno/Package_pyunorc.mk31
-rw-r--r--pyuno/Package_zipcore.mk35
-rw-r--r--pyuno/inc/pyuno/pyuno.hxx15
-rw-r--r--pyuno/prj/build.lst6
-rw-r--r--pyuno/prj/dmake0
-rw-r--r--pyuno/source/module/pyuno_dlopenwrapper.c4
-rw-r--r--pyuno/source/module/pyuno_module.cxx2
21 files changed, 713 insertions, 14 deletions
diff --git a/pyuno/CustomTarget_python_bin.mk b/pyuno/CustomTarget_python_bin.mk
new file mode 100644
index 000000000000..044bb68a8bcb
--- /dev/null
+++ b/pyuno/CustomTarget_python_bin.mk
@@ -0,0 +1,40 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_CustomTarget_CustomTarget,pyuno/python_bin))
+
+# do we need it here: $(gb_Executable_EXT)?
+$(call gb_CustomTarget_get_target,pyuno/python_bin) : \
+ $(call gb_CustomTarget_get_workdir,pyuno/python_bin)/python.bin
+
+$(call gb_CustomTarget_get_workdir,pyuno/python_bin)/python.bin : $(OUTDIR)/bin/python | \
+ $(call gb_CustomTarget_get_workdir,pyuno/python_bin)/.dir
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),COP,1)
+ cp $< $@.tmp
+ strip $@.tmp
+ mv $@.tmp $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/CustomTarget_python_shell.mk b/pyuno/CustomTarget_python_shell.mk
new file mode 100644
index 000000000000..cf64f533ba7b
--- /dev/null
+++ b/pyuno/CustomTarget_python_shell.mk
@@ -0,0 +1,50 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_CustomTarget_CustomTarget,pyuno/python_shell))
+
+$(call gb_CustomTarget_get_target,pyuno/python_shell) : \
+ $(call gb_CustomTarget_get_workdir,pyuno/python_shell)/python.sh
+
+include $(OUTDIR)/inc/pyversion.Makefile
+
+ifeq ($(OS),MACOSX)
+pyuno_PYTHON_SHELL_VERSION:=$(PYMAJOR).$(PYMINOR)
+pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/,/^MACSECTION/d'
+else
+pyuno_PYTHON_SHELL_VERSION:=$(PYVERSION)
+pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/d' -e '/^MACSECTION/,$$d'
+endif
+
+$(call gb_CustomTarget_get_workdir,pyuno/python_shell)/python.sh : $(SRCDIR)/pyuno/zipcore/python.sh | \
+ $(call gb_CustomTarget_get_workdir,pyuno/python_shell)/.dir
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
+ sed -e "s/%%PYVERSION%%/$(pyuno_PYTHON_SHELL_VERSION)/g" -e \
+ "s/%%OOO_LIBRARY_PATH_VAR%%/$(gb_Helper_LIBRARY_PATH_VAR)/g" \
+ $(pyuno_PYTHON_SHELL_STRIPRULE) < $? > $@
+ chmod +x $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/CustomTarget_python_wrapper.mk b/pyuno/CustomTarget_python_wrapper.mk
new file mode 100755
index 000000000000..9f459a1c551d
--- /dev/null
+++ b/pyuno/CustomTarget_python_wrapper.mk
@@ -0,0 +1,36 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_CustomTarget_CustomTarget,pyuno/python_wrapper))
+
+python_wrapper_TARGET := $(OUTDIR)/bin/pyuno/python.exe
+
+$(call gb_CustomTarget_get_target,pyuno/python_wrapper) : $(python_wrapper_TARGET)
+
+$(python_wrapper_TARGET) : $(call gb_Executable_get_target,python_wrapper)
+ cp $< $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/CustomTarget_pyversion.mk b/pyuno/CustomTarget_pyversion.mk
new file mode 100644
index 000000000000..8766e7e348b9
--- /dev/null
+++ b/pyuno/CustomTarget_pyversion.mk
@@ -0,0 +1,39 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_CustomTarget_CustomTarget,pyuno/pyversion))
+
+$(call gb_CustomTarget_get_target,pyuno/pyversion) : \
+ $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx
+
+include $(OUTDIR)/inc/pyversion.Makefile
+
+$(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx : $(SRCDIR)/pyuno/zipcore/pyversion.inc | \
+ $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/.dir
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
+ sed -e "s/@/$(PYVERSION)/g" < $? > $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/CustomTarget_zipcore.mk b/pyuno/CustomTarget_zipcore.mk
new file mode 100644
index 000000000000..ba220845b6f5
--- /dev/null
+++ b/pyuno/CustomTarget_zipcore.mk
@@ -0,0 +1,47 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_CustomTarget_CustomTarget,pyuno/zipcore))
+
+include $(OUTDIR)/inc/pyversion.Makefile
+pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYVERSION).zip
+FIND=find
+GREP=grep
+
+$(call gb_CustomTarget_get_target,pyuno/zipcore) : \
+ $(call gb_CustomTarget_get_workdir,pyuno/zipcore)/$(pyuno_PYTHON_ARCHIVE_NAME)
+
+# capture the files to have them in prerequisite list
+pyuno_zipcore_FINDLIBFILES:=\
+ $(shell $(FIND) $(OUTDIR)/lib/python -type f| $(GREP) -v "\.pyc" | $(GREP) -v "\.py~" | $(GREP) -v .orig | $(GREP) -v _failed)
+
+# create zip archive
+$(call gb_CustomTarget_get_workdir,pyuno/zipcore)/$(pyuno_PYTHON_ARCHIVE_NAME) : $(pyuno_zipcore_FINDLIBFILES) | \
+ $(call gb_CustomTarget_get_workdir,pyuno/zipcore)/.dir
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ZIP,1)
+ cd $(OUTDIR)/lib/python && zip $@ $(shell cd $(OUTDIR)/lib/python && $(FIND) . -type f | $(GREP) -v "\.pyc" | $(GREP) -v "\.py~" | $(GREP) -v .orig | $(GREP) -v _failed)
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Executable_python_wrapper.mk b/pyuno/Executable_python_wrapper.mk
new file mode 100644
index 000000000000..709db4d349aa
--- /dev/null
+++ b/pyuno/Executable_python_wrapper.mk
@@ -0,0 +1,41 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Executable_Executable,python_wrapper))
+
+$(eval $(call gb_Executable_use_static_libraries,python_wrapper,\
+ ooopathutils \
+))
+
+$(eval $(call gb_Executable_use_custom_headers,python_wrapper,\
+ pyuno/pyversion \
+))
+
+$(eval $(call gb_Executable_add_noexception_objects,python_wrapper,\
+ pyuno/zipcore/python \
+))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/pyuno/Library_pythonloader.mk b/pyuno/Library_pythonloader.mk
new file mode 100644
index 000000000000..d57168d1badb
--- /dev/null
+++ b/pyuno/Library_pythonloader.mk
@@ -0,0 +1,56 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Library_Library,pythonloader))
+
+$(eval $(call gb_Library_set_componentfile,pythonloader,pyuno/source/loader/pythonloader))
+
+$(eval $(call gb_Library_set_include,pythonloader,\
+ -I$(SRCDIR)/pyuno/source/loader \
+ -I$(SRCDIR)/pyuno/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_use_api,pythonloader,\
+ udkapi \
+))
+
+$(eval $(call gb_Library_use_libraries,pythonloader,\
+ cppu \
+ cppuhelper \
+ pyuno \
+ sal \
+))
+
+$(eval $(call gb_Library_use_externals,pythonloader,\
+ python \
+))
+
+$(eval $(call gb_Library_add_exception_objects,pythonloader,\
+ pyuno/source/loader/pyuno_loader \
+))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/pyuno/Library_pyuno.mk b/pyuno/Library_pyuno.mk
new file mode 100644
index 000000000000..8ecda3dbc64a
--- /dev/null
+++ b/pyuno/Library_pyuno.mk
@@ -0,0 +1,66 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Library_Library,pyuno))
+
+$(eval $(call gb_Library_set_include,pyuno,\
+ -I$(SRCDIR)/pyuno/source/loader \
+ -I$(SRCDIR)/pyuno/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,pyuno,\
+ -DLO_DLLIMPLEMENTATION_PYUNO \
+))
+
+$(eval $(call gb_Library_use_api,pyuno,\
+ udkapi \
+))
+
+$(eval $(call gb_Library_use_libraries,pyuno,\
+ cppu \
+ cppuhelper \
+ sal \
+ salhelper \
+))
+
+$(eval $(call gb_Library_use_externals,pyuno,\
+ python \
+))
+
+$(eval $(call gb_Library_add_exception_objects,pyuno,\
+ pyuno/source/module/pyuno_runtime \
+ pyuno/source/module/pyuno \
+ pyuno/source/module/pyuno_callable \
+ pyuno/source/module/pyuno_module \
+ pyuno/source/module/pyuno_type \
+ pyuno/source/module/pyuno_util \
+ pyuno/source/module/pyuno_except \
+ pyuno/source/module/pyuno_adapter \
+ pyuno/source/module/pyuno_gc \
+))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/pyuno/Library_pyuno_wrapper.mk b/pyuno/Library_pyuno_wrapper.mk
new file mode 100644
index 000000000000..eba06d6d164d
--- /dev/null
+++ b/pyuno/Library_pyuno_wrapper.mk
@@ -0,0 +1,65 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Library_Library,pyuno_wrapper))
+
+$(eval $(call gb_Library_set_include,pyuno_wrapper,\
+ -I$(SRCDIR)/pyuno/source/module \
+ -I$(SRCDIR)/pyuno/inc \
+ $$(INCLUDE) \
+))
+
+# not using here external
+# because we do not want to link here
+# against python!
+# we need only -Idirective
+ifeq ($(SYSTEM_PYTHON),YES)
+$(eval $(call gb_Library_set_include,pyuno_wrapper,\
+ $(PYTHON_CFLAGS) \
+ $$(INCLUDE) \
+))
+else
+$(eval $(call gb_Library_set_include,pyuno_wrapper,\
+ -I$(OUTDIR)/inc/python \
+ $$(INCLUDE) \
+))
+endif
+
+ifneq ($(GUI)$(COM),WNTMSC)
+ifneq ($(OS),MACOSX)
+
+$(eval $(call gb_Library_add_libs,pyuno_wrapper,\
+ -ldl \
+))
+
+endif
+endif
+
+$(eval $(call gb_Library_add_cobjects,pyuno_wrapper,\
+ pyuno/source/module/pyuno_dlopenwrapper \
+))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/pyuno/Makefile b/pyuno/Makefile
new file mode 100644
index 000000000000..ccb1c85a04da
--- /dev/null
+++ b/pyuno/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/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk
new file mode 100755
index 000000000000..0f15ac5be631
--- /dev/null
+++ b/pyuno/Module_pyuno.mk
@@ -0,0 +1,86 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Module_Module,pyuno))
+
+ifneq ($(DISABLE_PYTHON),TRUE)
+
+$(eval $(call gb_Module_add_targets,pyuno,\
+ Library_pyuno \
+ Library_pythonloader \
+ Package_pyunorc \
+ Package_python_scripts \
+))
+
+ifneq ($(OS),WNT)
+$(eval $(call gb_Module_add_targets,pyuno,\
+ Library_pyuno_wrapper \
+))
+endif
+
+# zipcore: python.exe on Windows
+# zipcore: pyversion.hxx on Windows
+ifeq ($(OS),WNT)
+$(eval $(call gb_Module_add_targets,pyuno,\
+ CustomTarget_pyversion \
+ Executable_python_wrapper \
+ CustomTarget_python_wrapper \
+))
+endif
+
+
+# zipcore: python.sh on Unix
+ifneq ($(SYSTEM_PYTHON),YES)
+ifeq ($(GUI),UNX)
+$(eval $(call gb_Module_add_targets,pyuno,\
+ CustomTarget_python_shell \
+ Package_python_shell \
+))
+ifneq ($(OS),MACOSX)
+$(eval $(call gb_Module_add_targets,pyuno,\
+ CustomTarget_python_bin \
+ Package_python_bin \
+))
+endif
+endif
+endif
+
+# python-zipcore-$(PYVESION) not on MACOSX
+# (OOoPython.framework.zip is already delivered for MACOSX in python module)
+ifneq ($(SYSTEM_PYTHON),YES)
+ifneq ($(OS),MACOSX)
+$(eval $(call gb_Module_add_targets,pyuno,\
+ CustomTarget_zipcore \
+ Package_zipcore \
+))
+endif
+endif
+
+endif # DISABLE_PYTHON
+
+
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/pyuno/Package_python_bin.mk b/pyuno/Package_python_bin.mk
new file mode 100644
index 000000000000..a0a5a0845cf3
--- /dev/null
+++ b/pyuno/Package_python_bin.mk
@@ -0,0 +1,31 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Package_Package,python_bin,$(call gb_CustomTarget_get_workdir,pyuno/python_bin)))
+
+$(eval $(call gb_Package_add_file,python_bin,bin/python.bin,python.bin))
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Package_python_scripts.mk b/pyuno/Package_python_scripts.mk
new file mode 100644
index 000000000000..3672f6106f5e
--- /dev/null
+++ b/pyuno/Package_python_scripts.mk
@@ -0,0 +1,39 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Package_Package,pyuno_python,$(SRCDIR)/pyuno/source))
+
+ifeq ($(GUI),WNT)
+pyuno_PYTHON_SCRIPT_DIR=bin
+else
+pyuno_PYTHON_SCRIPT_DIR=lib
+endif
+
+$(eval $(call gb_Package_add_file,pyuno_python,$(pyuno_PYTHON_SCRIPT_DIR)/pyuno/unohelper.py,module/unohelper.py))
+$(eval $(call gb_Package_add_file,pyuno_python,$(pyuno_PYTHON_SCRIPT_DIR)/pyuno/uno.py,module/uno.py))
+$(eval $(call gb_Package_add_file,pyuno_python,$(pyuno_PYTHON_SCRIPT_DIR)/pyuno/pythonloader.py,loader/pythonloader.py))
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Package_python_shell.mk b/pyuno/Package_python_shell.mk
new file mode 100644
index 000000000000..bb2d6fa541f7
--- /dev/null
+++ b/pyuno/Package_python_shell.mk
@@ -0,0 +1,31 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Package_Package,python_shell,$(call gb_CustomTarget_get_workdir,pyuno/python_shell)))
+
+$(eval $(call gb_Package_add_file,python_shell,bin/pyuno/python,python.sh))
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Package_pyunorc.mk b/pyuno/Package_pyunorc.mk
new file mode 100644
index 000000000000..1f9a4b5cc3e2
--- /dev/null
+++ b/pyuno/Package_pyunorc.mk
@@ -0,0 +1,31 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Package_Package,pyuno_pyunorc,$(SRCDIR)/pyuno/source/module))
+
+$(eval $(call gb_Package_add_file,pyuno_pyunorc,$(call gb_Helper_get_rcfile,bin/pyuno),pyuno))
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/Package_zipcore.mk b/pyuno/Package_zipcore.mk
new file mode 100644
index 000000000000..9069a8fdd32c
--- /dev/null
+++ b/pyuno/Package_zipcore.mk
@@ -0,0 +1,35 @@
+# -*- 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 David Ostrovsky <d.ostrovsky@gmx.de> (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_Package_Package,python_zipcore,$(call gb_CustomTarget_get_workdir,pyuno/zipcore)))
+
+include $(OUTDIR)/inc/pyversion.Makefile
+pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYVERSION).zip
+
+$(eval $(call gb_Package_add_file,python_zipcore,bin/$(pyuno_PYTHON_ARCHIVE_NAME),$(pyuno_PYTHON_ARCHIVE_NAME)))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/inc/pyuno/pyuno.hxx b/pyuno/inc/pyuno/pyuno.hxx
index e62563e80afc..066fc93a4095 100644
--- a/pyuno/inc/pyuno/pyuno.hxx
+++ b/pyuno/inc/pyuno/pyuno.hxx
@@ -27,10 +27,10 @@
to do the necessary conversions.
*/
-#ifdef WIN32
-#define PY_DLLEXPORT __declspec(dllexport)
+#if defined LO_DLLIMPLEMENTATION_PYUNO
+#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_EXPORT
#else
-#define PY_DLLEXPORT
+#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_IMPORT
#endif
/** function called by the python runtime to initialize the
@@ -39,7 +39,8 @@
preconditions: python has been initialized before and
the global interpreter lock is held
*/
-extern "C" PY_DLLEXPORT
+
+extern "C" LO_DLLPUBLIC_PYUNO
#if PY_MAJOR_VERSION >= 3
PyObject* SAL_CALL PyInit_pyuno();
#else
@@ -136,7 +137,7 @@ enum ConversionMode { ACCEPT_UNO_ANY, REJECT_UNO_ANY };
make sure to fulfill all preconditions mentioned for the specific methods.
*/
-class PY_DLLEXPORT Runtime
+class LO_DLLPUBLIC_PYUNO Runtime
{
RuntimeImpl *impl;
public:
@@ -235,7 +236,7 @@ public:
e.g. when you would leave them away, dtors of potential pyrefs
may be called after the thread has detached again.
*/
-class PY_DLLEXPORT PyThreadAttach
+class LO_DLLPUBLIC_PYUNO PyThreadAttach
{
PyThreadState *tstate;
PyThreadAttach ( const PyThreadAttach & ); // not implemented
@@ -262,7 +263,7 @@ public:
@see PyThreadAttach
*/
-class PY_DLLEXPORT PyThreadDetach
+class LO_DLLPUBLIC_PYUNO PyThreadDetach
{
PyThreadState *tstate;
PyThreadDetach ( const PyThreadDetach & ); // not implemented
diff --git a/pyuno/prj/build.lst b/pyuno/prj/build.lst
index 8d0f8ba31525..ca0bce936b8b 100644
--- a/pyuno/prj/build.lst
+++ b/pyuno/prj/build.lst
@@ -1,5 +1,3 @@
bgpu pyuno : salhelper stoc cpputools cppuhelper bridges tools PYTHON:python LIBXSLT:libxslt NULL
-pu pyuno usr1 - all br_mkout NULL
-pu pyuno\zipcore nmake - all pu_zipcore NULL
-pu pyuno\source\module nmake - all pu_module NULL
-pu pyuno\source\loader nmake - all pu_loader pu_module NULL
+pu pyuno usr1 - all br_mkout NULL
+pu pyuno\prj nmake - all pu_prj NULL
diff --git a/pyuno/prj/dmake b/pyuno/prj/dmake
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/pyuno/prj/dmake
+++ /dev/null
diff --git a/pyuno/source/module/pyuno_dlopenwrapper.c b/pyuno/source/module/pyuno_dlopenwrapper.c
index 3bdc912f95bd..cb17c51aec9c 100644
--- a/pyuno/source/module/pyuno_dlopenwrapper.c
+++ b/pyuno/source/module/pyuno_dlopenwrapper.c
@@ -84,14 +84,14 @@ static void * load(void * address, char const * symbol) {
#if PY_MAJOR_VERSION >= 3
-PyObject * PyInit_pyuno(void) {
+SAL_DLLPUBLIC_EXPORT PyObject * PyInit_pyuno(void) {
return
((PyObject * (*)(void)) load((void *) &PyInit_pyuno, "PyInit_pyuno"))();
}
#else
-void initpyuno(void) {
+SAL_DLLPUBLIC_EXPORT void initpyuno(void) {
((void (*)(void)) load((void *) &initpyuno, "initpyuno"))();
}
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 432a61ef988d..26d1932bed0c 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -833,7 +833,7 @@ struct PyMethodDef PyUNOModule_methods [] =
}
-extern "C" PY_DLLEXPORT
+extern "C"
#if PY_MAJOR_VERSION >= 3
PyObject* PyInit_pyuno()
{