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
,\
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
26 $(call gb_ExternalProject_get_state_target
,python3
,build
) :
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 \
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 \
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 \
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
57 ifeq ($(ENABLE_VALGRIND
),TRUE
)
58 python3_cflags
+= $(VALGRIND_CFLAGS
)
61 $(call gb_ExternalProject_get_state_target
,python3
,build
) :
62 cd
$(EXTERNAL_WORKDIR
) \
64 $(if
$(filter YES
,$(CROSS_COMPILING
)),--build
=$(BUILD_PLATFORM
) --host
=$(HOST_PLATFORM
)) \
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
, \
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) \
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)) \
88 && MAKEFLAGS
=$(if
$(VERBOSE
)$(verbose
),,s
) $(MAKE
) $(if
$(filter MACOSX
,$(OS
)), DESTDIR
=$(EXTERNAL_WORKDIR
)/python-inst
install) \
89 && ln
-s build
/lib.
* LO_lib \
94 # vim: set noet sw=4 ts=4: