diff options
author | David Ostrovsky <d.ostrovsky@gmx.de> | 2012-06-18 00:04:19 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-06-22 13:11:41 +0200 |
commit | d712218cc0b658fae66f63c52af7996b714289c9 (patch) | |
tree | 74ebe377301f044f5ebd13d7e0ef645817c24dc0 /pyuno | |
parent | 3f5245db4b0248bb55c37d3400b8155263880f6e (diff) |
fixing pyuno bridge on mingw: packaging system-python
Change-Id: Ib46248d217b0161dc20dde0274842bd7381f0cda
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/CustomTarget_pyversion.mk | 8 | ||||
-rw-r--r-- | pyuno/CustomTarget_zipcore.mk | 15 | ||||
-rwxr-xr-x | pyuno/Module_pyuno.mk | 17 | ||||
-rw-r--r-- | pyuno/Package_zipcore.mk | 9 | ||||
-rw-r--r-- | pyuno/zipcore/python.cxx | 4 |
5 files changed, 46 insertions, 7 deletions
diff --git a/pyuno/CustomTarget_pyversion.mk b/pyuno/CustomTarget_pyversion.mk index 8766e7e348b9..41b26c1831da 100644 --- a/pyuno/CustomTarget_pyversion.mk +++ b/pyuno/CustomTarget_pyversion.mk @@ -29,7 +29,15 @@ $(eval $(call gb_CustomTarget_CustomTarget,pyuno/pyversion)) $(call gb_CustomTarget_get_target,pyuno/pyversion) : \ $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx +# system python +ifeq ($(SYSTEM_PYTHON),YES) +# mingw: MINGW_PYVERSION is defined in configure +ifeq ($(GUI)$(COM),WNTGCC) +PYVERSION=$(MINGW_PYVERSION) +endif +else include $(OUTDIR)/inc/pyversion.Makefile +endif $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/pyversion.hxx : $(SRCDIR)/pyuno/zipcore/pyversion.inc | \ $(call gb_CustomTarget_get_workdir,pyuno/pyversion)/.dir diff --git a/pyuno/CustomTarget_zipcore.mk b/pyuno/CustomTarget_zipcore.mk index ba220845b6f5..98e3c292fc2f 100644 --- a/pyuno/CustomTarget_zipcore.mk +++ b/pyuno/CustomTarget_zipcore.mk @@ -26,7 +26,18 @@ $(eval $(call gb_CustomTarget_CustomTarget,pyuno/zipcore)) +# system python (only mingw) +ifeq ($(SYSTEM_PYTHON),YES) +# mingw: MINGW_PYVERSION and MINGW_SYSROOT are defined in configure +ifeq ($(GUI)$(COM),WNTGCC) +PYVERSION=$(MINGW_PYVERSION) +pyuno_PYTHON_LIB_DIR=$(MINGW_SYSROOT)/lib/python$(MINGW_PYTHON_MAJOR_VERSION) +endif +else include $(OUTDIR)/inc/pyversion.Makefile +pyuno_PYTHON_LIB_DIR=$(OUTDIR)/lib/python +endif + pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYVERSION).zip FIND=find GREP=grep @@ -36,12 +47,12 @@ $(call gb_CustomTarget_get_target,pyuno/zipcore) : \ # 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) + $(shell $(FIND) $(pyuno_PYTHON_LIB_DIR) -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) + cd $(pyuno_PYTHON_LIB_DIR) && zip $@ $(shell cd $(pyuno_PYTHON_LIB_DIR) && $(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/Module_pyuno.mk b/pyuno/Module_pyuno.mk index 06356e2b491f..723b08530c32 100755 --- a/pyuno/Module_pyuno.mk +++ b/pyuno/Module_pyuno.mk @@ -41,7 +41,11 @@ $(eval $(call gb_Module_add_targets,pyuno,\ )) endif -ifneq ($(SYSTEM_PYTHON),YES) +# +# Windows: only --enable-python=internal possible +# mingw: both cases possible: internal && system +# that why it makes sense to handle the next 3 targets +# with SYSTEM_PYTHON=YES and SYSTEM_PYTHON=NO # zipcore: pyuno/python.exe on Windows # zipcore: pyversion.hxx on Windows @@ -52,6 +56,7 @@ $(eval $(call gb_Module_add_targets,pyuno,\ )) endif +ifneq ($(SYSTEM_PYTHON),YES) # zipcore: python.sh on Unix ifeq ($(GUI),UNX) @@ -76,6 +81,16 @@ $(eval $(call gb_Module_add_targets,pyuno,\ )) endif +else # SYSTEM_PYTHON + +# previous two targets has to be executed also with system-python on mingw +ifeq ($(OS)$(COM),WNTGCC) +$(eval $(call gb_Module_add_targets,pyuno,\ + CustomTarget_zipcore \ + Package_zipcore \ +)) +endif + endif # SYSTEM_PYTHON endif # DISABLE_PYTHON diff --git a/pyuno/Package_zipcore.mk b/pyuno/Package_zipcore.mk index 9069a8fdd32c..3666ad7a7252 100644 --- a/pyuno/Package_zipcore.mk +++ b/pyuno/Package_zipcore.mk @@ -26,7 +26,16 @@ $(eval $(call gb_Package_Package,python_zipcore,$(call gb_CustomTarget_get_workdir,pyuno/zipcore))) +# system python +ifeq ($(SYSTEM_PYTHON),YES) +# mingw: MINGW_PYVERSION is defined in configure +ifeq ($(GUI)$(COM),WNTGCC) +PYVERSION=$(MINGW_PYVERSION) +endif +else include $(OUTDIR)/inc/pyversion.Makefile +endif + 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))) diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx index cffee38e058b..f4d3024024b6 100644 --- a/pyuno/zipcore/python.cxx +++ b/pyuno/zipcore/python.cxx @@ -138,11 +138,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) { wchar_t pythonexe[MAX_PATH]; wchar_t * pythonexeEnd = tools::buildPath( pythonexe, path, pathEnd, -#ifdef __MINGW32__ - MY_STRING(L"\\python-core-" MY_PYVERSION L"\\bin\\python.bin")); -#else MY_STRING(L"\\python-core-" MY_PYVERSION L"\\bin\\python.exe")); -#endif if (pythonexeEnd == NULL) { exit(EXIT_FAILURE); } |