Bump for 4.0-11
[LibreOffice.git] / python3 / ExternalProject_python3.mk
blob49fa0b4fd370ebd135be975a52c59c0080d4fc70
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_ExternalProject_ExternalProject,python3))
12 $(eval $(call gb_ExternalProject_use_unpacked,python3,python3))
14 $(eval $(call gb_ExternalProject_use_external,python3,expat))
16 $(eval $(call gb_ExternalProject_register_targets,python3,\
17 build \
20 ifeq ($(OS)$(COM),WNTMSC)
22 # TODO: using Debug configuration and related mangling of pyconfig.h
24 # at least for MSVC 2008 it is necessary to clear MAKEFLAGS because
25 # nmake is invoked
26 $(call gb_ExternalProject_get_state_target,python3,build) :
27 ifeq ($(VCVER),110)
28 cd $(EXTERNAL_WORKDIR)/PCbuild \
29 && MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build /p:Configuration=Release /p:PlatformToolset=v110 \
30 && cd $(EXTERNAL_WORKDIR) \
31 && ln -s PCbuild LO_lib \
32 && touch $@
33 else ifeq ($(VCVER),100)
34 cd $(EXTERNAL_WORKDIR)/PCbuild \
35 && MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build /p:Configuration=Release /ToolsVersion:4.0 \
36 && cd $(EXTERNAL_WORKDIR) \
37 && ln -s PCbuild LO_lib \
38 && touch $@
39 else ifeq ($(VCVER),90)
40 cd $(EXTERNAL_WORKDIR)/PC/VS9.0 \
41 && MAKEFLAGS= $(COMPATH)/vcpackages/vcbuild.exe pcbuild.sln "Release|$(if $(filter INTEL,$(CPUNAME)),Win32,x64)" \
42 && cd $(EXTERNAL_WORKDIR) \
43 && ln -s PC/VS9.0 LO_lib \
44 && touch $@
45 endif
47 else
49 # this was added in 2004, hopefully is obsolete now (and why only intel anyway)? $(if $(filter SOLARIS-INTEL,$(OS)$(CPUNAME)),--disable-ipv6)
51 # --with-system-expat: this should find the one in the solver (or system)
53 # create a symlink "LO_lib" because the .so are in a directory with platform
54 # specific name like build/lib.linux-x86_64-3.3
56 python3_cflags =
57 ifeq ($(ENABLE_VALGRIND),TRUE)
58 python3_cflags += $(VALGRIND_CFLAGS)
59 endif
61 $(call gb_ExternalProject_get_state_target,python3,build) :
62 cd $(EXTERNAL_WORKDIR) \
63 && ./configure \
64 $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
65 --with-system-expat \
66 $(if $(filter TRUE,$(ENABLE_VALGRIND)),--with-valgrind) \
67 --prefix=/python-inst \
68 $(if $(filter AIX,$(OS)),--disable-ipv6 --with-threads \
69 OPT="-g0 -fwrapv -O3 -Wall") \
70 $(if $(filter WNT-GCC,$(OS)-$(COM)),--with-threads ac_cv_printf_zd_format=no) \
71 $(if $(filter MACOSX,$(OS)), \
72 --enable-universalsdk=$(MACOSX_SDK_PATH) --with-universal-archs=32-bit --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \
73 --enable-shared \
74 ) \
75 CC="$(strip $(CC) \
76 $(if $(filter YES,$(SYSTEM_OPENSSL)),, -I$(OUTDIR)/inc/external) \
77 $(if $(filter YES,$(SYSTEM_EXPAT)),, -I$(OUTDIR)/inc/external/expat) \
78 $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \
79 )" \
80 $(if $(python3_cflags),CFLAGS='$(python3_cflags)') \
81 LDFLAGS="$(strip $(LDFLAGS) \
82 $(if $(filter YES,$(SYSTEM_OPENSSL)),, -L$(OUTDIR)/lib) \
83 $(if $(filter YES,$(SYSTEM_EXPAT)),, -L$(OUTDIR)/lib) \
84 $(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \
85 $(if $(filter WNT-GCC,$(OS)-$(COM)), -shared-libgcc \
86 $(if $(filter YES,$(MINGW_SHARED_GCCLIB)),-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols)) \
87 )" \
88 && MAKEFLAGS=$(if $(VERBOSE)$(verbose),,s) $(MAKE) $(if $(filter MACOSX,$(OS)), DESTDIR=$(EXTERNAL_WORKDIR)/python-inst install) \
89 && ln -s build/lib.* LO_lib \
90 && touch $@
92 endif
94 # vim: set noet sw=4 ts=4: