diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-27 15:32:36 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-27 16:57:19 +0100 |
commit | 9d921baa17c3ee8d3c7be0cab5980d0f66319891 (patch) | |
tree | 62f6b0b54e7f1db9a747ffc5a4065a509a0076b8 | |
parent | 0c8e2ee3b4bf133d59fd956715418196e0922187 (diff) |
clean up PYTHON related version etc. variables:
- configure defines PYTHON_VERSION, PYTHON_VERSION_MAJOR,
PYTHON_VERSION_MINOR
- remove pyversion.Makefile
Change-Id: I19ac8df18a520ad56bf63ea038dc0769b8249d0b
-rw-r--r-- | RepositoryExternal.mk | 12 | ||||
-rw-r--r-- | config_host.mk.in | 5 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | python3/CustomTarget_PythonFramework.mk | 28 | ||||
-rw-r--r-- | python3/Module_python3.mk | 1 | ||||
-rw-r--r-- | python3/Package_python3_mk.mk | 15 | ||||
-rw-r--r-- | python3/UnpackedTarball_python3.mk | 6 | ||||
-rw-r--r-- | python3/pyversion.Makefile | 22 | ||||
-rw-r--r-- | pyuno/CustomTarget_python_shell.mk | 6 | ||||
-rw-r--r-- | pyuno/CustomTarget_pyversion.mk | 12 | ||||
-rw-r--r-- | pyuno/CustomTarget_zipcore.mk | 8 | ||||
-rw-r--r-- | pyuno/Package_zipcore.mk | 13 | ||||
-rw-r--r-- | scp2/InstallModule_python.mk | 12 |
13 files changed, 45 insertions, 108 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 49fb06f34726..e6232b610b53 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1965,16 +1965,16 @@ define gb_LinkTarget__use_python ifeq ($(OS),WNT) $(call gb_LinkTarget_add_libs,$(1),\ - python33.lib \ + python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR).lib \ ) else ifeq ($(OS),MACOSX) $(call gb_LinkTarget_add_libs,$(1),\ - -dylib_file @loader_path/LibreOfficePython.framework/Versions/3.3/LibreOfficePython:$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.3/LibreOfficePython \ - -F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \ + -dylib_file @loader_path/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython:$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ + -F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \ ) else $(call gb_LinkTarget_use_libraries,$(1),\ - python3.3m \ + python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \ ) endif @@ -1988,8 +1988,8 @@ $(call gb_LinkTarget_set_include,$(1),\ endef $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\ - python3 \ - python3.3m \ + python$(PYTHON_VERSION_MAJOR) \ + python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \ )) endif # SYSTEM_PYTHON diff --git a/config_host.mk.in b/config_host.mk.in index a9a73350ccf1..b4d04018f3b0 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -407,8 +407,6 @@ export MINGW_PLDS4_DLL=@MINGW_PLDS4_DLL@ export MINGW_PNG15_DLL=@MINGW_PNG15_DLL@ export MINGW_PYTHON_DLL=@MINGW_PYTHON_DLL@ export MINGW_PYTHON_EXE=@MINGW_PYTHON_EXE@ -export MINGW_PYTHON_MAJOR_VERSION=@MINGW_PYTHON_MAJOR_VERSION@ -export MINGW_PYVERSION=@MINGW_PYVERSION@ export MINGW_RAPTOR_DLL=@MINGW_RAPTOR_DLL@ export MINGW_RASQAL_DLL=@MINGW_RASQAL_DLL@ export MINGW_READLINE_DLL=@MINGW_READLINE_DLL@ @@ -516,7 +514,10 @@ export PYTHON=@PYTHON@ export PYTHON_CFLAGS=$(gb_SPACE)@PYTHON_CFLAGS@ export PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ export PYTHON_LIBS=$(gb_SPACE)@PYTHON_LIBS@ +export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@ +export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@ export PYTHON_TARBALL=@PYTHON_TARBALL@ +export PYTHON_VERSION=@PYTHON_VERSION@ export RANLIB=@RANLIB@ export RAPTOR_TARBALL=@RAPTOR_TARBALL@ export RASQAL_TARBALL=@RASQAL_TARBALL@ diff --git a/configure.ac b/configure.ac index 71dcd56302fb..a5296e144bd0 100644 --- a/configure.ac +++ b/configure.ac @@ -7422,8 +7422,9 @@ if test $enable_python = system; then # actual distro package? # 2.6.2 currently on OpenSUSE 12.1? # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch - MINGW_PYTHON_MAJOR_VERSION="$python_version" - MINGW_PYVERSION=$python_version.2 + PYTHON_VERSION=$python_version.2 + PYTHON_MAJOR=${python_version%.*} + PYTHON_MINOR=${python_version#*.} break fi done @@ -7464,6 +7465,9 @@ int main(int argc, char **argv) { internal) SYSTEM_PYTHON=NO + PYTHON_VERSION_MAJOR=3 + PYTHON_VERSION_MINOR=3 + PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0 PYTHON_TARBALL="b3b2524f72409d919a4137826a870a8f-Python-3.3.0.tar.bz2" BUILD_TYPE="$BUILD_TYPE PYTHON" # Embedded Python dies without Home set @@ -7498,12 +7502,13 @@ AC_SUBST(SYSTEM_PYTHON) AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_TARBALL) +AC_SUBST(PYTHON_VERSION) +AC_SUBST(PYTHON_VERSION_MAJOR) +AC_SUBST(PYTHON_VERSION_MINOR) AC_SUBST([MINGW_PYTHON_EXE]) AC_SUBST([MINGW_PYTHON_DLL]) AC_SUBST([MINGW_READLINE_DLL]) AC_SUBST([MINGW_TERMCAP_DLL]) -AC_SUBST(MINGW_PYVERSION) -AC_SUBST(MINGW_PYTHON_MAJOR_VERSION) AC_MSG_CHECKING([whether to build the MySQL Connector extension]) if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then diff --git a/python3/CustomTarget_PythonFramework.mk b/python3/CustomTarget_PythonFramework.mk index bfeaa154688d..8b0a065da4fd 100644 --- a/python3/CustomTarget_PythonFramework.mk +++ b/python3/CustomTarget_PythonFramework.mk @@ -35,13 +35,13 @@ python3_fw_prefix=$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@______ $(call gb_CustomTarget_get_target,python3/fixscripts): $(call gb_ExternalProject_get_target,python3) $(call gb_Output_announce,python3 - remove reference to installroot from scripts,build,CUS,5) $(COMMAND_ECHO)for file in \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/2to3 \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/2to3-$(python3_PYMAJOR).$(python3_PYMINOR) \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/idle$(python3_PYMAJOR).$(python3_PYMINOR) \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/pydoc$(python3_PYMAJOR).$(python3_PYMINOR) \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/python$(python3_PYMAJOR).$(python3_PYMINOR)-config \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/python$(python3_PYMAJOR).$(python3_PYMINOR)m-config \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin/pyvenv-$(python3_PYMAJOR).$(python3_PYMINOR) ; do \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3 \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/idle$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m-config \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pyvenv-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \ { rm "$$file" && awk '\ BEGIN {print "#!/bin/bash\n\ origpath=$$(pwd)\n\ @@ -56,20 +56,20 @@ cd \"$$origpath\"\n\ $(call gb_CustomTarget_get_target,python3/fixinstallnames): $(call gb_ExternalProject_get_target,python3) $(call gb_Output_announce,python3 - fix installname,build,CUS,5) install_name_tool -change \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/LibreOfficePython \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ @executable_path/../../../../LibreOfficePython \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython touch $@ # also delete binaries that are symlinked in scp2 $(call gb_CustomTarget_get_target,python3/executables): $(call gb_ExternalProject_get_target,python3) $(call gb_Output_announce,python3 - fix installnames in executables,build,CUS,5) - cd $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/bin ; \ - for file in python$(python3_PYMAJOR).$(python3_PYMINOR) \ - python$(python3_PYMAJOR).$(python3_PYMINOR)m \ - pythonw$(python3_PYMAJOR).$(python3_PYMINOR) ; do \ + cd $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin ; \ + for file in python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \ + pythonw$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \ install_name_tool -change \ - $(python3_fw_prefix)/Versions/$(python3_PYMAJOR).$(python3_PYMINOR)/LibreOfficePython \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ @executable_path/../LibreOfficePython $$file ; done touch $@ diff --git a/python3/Module_python3.mk b/python3/Module_python3.mk index e9da887f6b7a..5ab63ba7d706 100644 --- a/python3/Module_python3.mk +++ b/python3/Module_python3.mk @@ -15,7 +15,6 @@ ifeq ($(SYSTEM_PYTHON),NO) $(eval $(call gb_Module_add_targets,python3,\ UnpackedTarball_python3 \ ExternalProject_python3 \ - Package_python3_mk \ $(if $(filter MACOSX,$(OS)),Zip_PythonFramework CustomTarget_PythonFramework,ExternalPackage_python3) \ )) diff --git a/python3/Package_python3_mk.mk b/python3/Package_python3_mk.mk deleted file mode 100644 index adb30bf553cb..000000000000 --- a/python3/Package_python3_mk.mk +++ /dev/null @@ -1,15 +0,0 @@ -# -*- 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_Package_Package,python3_mk,$(SRCDIR)/python3)) - -#FIXME why deliver that? -$(eval $(call gb_Package_add_file,python3_mk,inc/pyversion.Makefile,pyversion.Makefile)) - -# vim: set noet sw=4 ts=4: diff --git a/python3/UnpackedTarball_python3.mk b/python3/UnpackedTarball_python3.mk index d235e0accce8..d43ad8475400 100644 --- a/python3/UnpackedTarball_python3.mk +++ b/python3/UnpackedTarball_python3.mk @@ -9,11 +9,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,python3)) -#FIXME configure -PYTHON3_TARBALL := b3b2524f72409d919a4137826a870a8f-Python-3.3.0.tar.bz2 -python3_PYMAJOR=3 -python3_PYMINOR=3 -$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON3_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL))) $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ PCbuild/pcbuild.sln \ diff --git a/python3/pyversion.Makefile b/python3/pyversion.Makefile deleted file mode 100644 index edcffd1da582..000000000000 --- a/python3/pyversion.Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#FIXME move that to configure - -# when you want to change the python version, you must update the d.lst -# in the python project accordingly !!! -PYMAJOR:=3 -PYMINOR:=3 -PYMICRO:=0 -PYVERSION:=$(PYMAJOR).$(PYMINOR).$(PYMICRO) - -ifeq ($(GUI),UNX) -ifeq ($(OS),MACOSX) -PY_FULL_DLL_NAME:=libpython$(PYMAJOR).$(PYMINOR).a -else -PY_FULL_DLL_NAME:=libpython$(PYMAJOR).$(PYMINOR)m.so -endif -else -ifeq ($(COM),GCC) -PY_FULL_DLL_NAME:=libpython$(PYMAJOR).$(PYMINOR).dll -else -PY_FULL_DLL_NAME:=python$(PYMAJOR)$(PYMINOR).dll -endif -endif diff --git a/pyuno/CustomTarget_python_shell.mk b/pyuno/CustomTarget_python_shell.mk index cf64f533ba7b..feed2e48730a 100644 --- a/pyuno/CustomTarget_python_shell.mk +++ b/pyuno/CustomTarget_python_shell.mk @@ -29,13 +29,11 @@ $(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_VERSION:=$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/,/^MACSECTION/d' else -pyuno_PYTHON_SHELL_VERSION:=$(PYVERSION) +pyuno_PYTHON_SHELL_VERSION:=$(PYTHON_VERSION) pyuno_PYTHON_SHELL_STRIPRULE:=-e '/^NONMACSECTION/d' -e '/^MACSECTION/,$$d' endif diff --git a/pyuno/CustomTarget_pyversion.mk b/pyuno/CustomTarget_pyversion.mk index 41b26c1831da..acfec165f47b 100644 --- a/pyuno/CustomTarget_pyversion.mk +++ b/pyuno/CustomTarget_pyversion.mk @@ -29,19 +29,9 @@ $(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 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1) - sed -e "s/@/$(PYVERSION)/g" < $? > $@ + sed -e "s/@/$(PYTHON_VERSION)/g" < $? > $@ # vim: set noet sw=4 ts=4: diff --git a/pyuno/CustomTarget_zipcore.mk b/pyuno/CustomTarget_zipcore.mk index 98e3c292fc2f..dc2f5603c14f 100644 --- a/pyuno/CustomTarget_zipcore.mk +++ b/pyuno/CustomTarget_zipcore.mk @@ -28,17 +28,15 @@ $(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 +# mingw: MINGW_SYSROOT is defined in configure ifeq ($(GUI)$(COM),WNTGCC) -PYVERSION=$(MINGW_PYVERSION) -pyuno_PYTHON_LIB_DIR=$(MINGW_SYSROOT)/lib/python$(MINGW_PYTHON_MAJOR_VERSION) +pyuno_PYTHON_LIB_DIR=$(MINGW_SYSROOT)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) endif else -include $(OUTDIR)/inc/pyversion.Makefile pyuno_PYTHON_LIB_DIR=$(OUTDIR)/lib/python endif -pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYVERSION).zip +pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYTHON_VERSION).zip FIND=find GREP=grep diff --git a/pyuno/Package_zipcore.mk b/pyuno/Package_zipcore.mk index 3666ad7a7252..c75c46bfbe10 100644 --- a/pyuno/Package_zipcore.mk +++ b/pyuno/Package_zipcore.mk @@ -26,19 +26,8 @@ $(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 +pyuno_PYTHON_ARCHIVE_NAME:=python-core-$(PYTHON_VERSION).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/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk index 6e2c6d09ee33..42f80c5fba10 100644 --- a/scp2/InstallModule_python.mk +++ b/scp2/InstallModule_python.mk @@ -39,19 +39,17 @@ $(eval $(call gb_InstallModule_add_defs,scp2/python,\ # mingw: mix mode copy file from system python to installation set ifeq ($(GUI)$(COM),WNTGCC) $(eval $(call gb_InstallModule_add_defs,scp2/python,\ - -DPYVERSION=$(MINGW_PYVERSION) \ + -DPYVERSION=$(PYTHON_VERSION) \ -DMINGW_SYSTEM_PYTHON \ )) endif else -include $(OUTDIR)/inc/pyversion.Makefile - $(eval $(call gb_InstallModule_add_defs,scp2/python,\ - -DPYVERSION=$(PYVERSION) \ - -DPYMAJMIN=$(PYMAJOR).$(PYMINOR) \ - -DPYMAJOR=$(PYMAJOR) \ - -DPY_FULL_DLL_NAME=$(PY_FULL_DLL_NAME) \ + -DPYVERSION=$(PYTHON_VERSION) \ + -DPYMAJMIN=$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + -DPYMAJOR=$(PYTHON_VERSION_MAJOR) \ + -DPY_FULL_DLL_NAME=$(if $(filter WNT-MSC,$(OS)-$(COM)),python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR).dll,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so) \ )) endif |