merged tag ooo/OOO330_m14
[LibreOffice.git] / python / makefile.mk
bloba35e596669a0199ea8f51912e3809b0c30deeff6
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 PRJ=.
30 PRJNAME=so_python
31 TARGET=so_python
33 # --- Settings -----------------------------------------------------
35 .INCLUDE : settings.mk
36 .INCLUDE : pyversion.mk
38 .IF "$(SYSTEM_PYTHON)" == "YES"
39 all:
40 @echo "An already available installation of python should exist on your system."
41 @echo "Therefore the version provided here does not need to be built in addition."
42 .ENDIF
45 # --- Files --------------------------------------------------------
48 TARFILE_NAME=Python-$(PYVERSION)
49 TARFILE_MD5=e81c2f0953aa60f8062c05a4673f2be0
50 PATCH_FILES=\
51 Python-$(PYVERSION).patch \
52 Python-ssl.patch
54 CONFIGURE_DIR=
56 .IF "$(GUI)"=="UNX"
57 BUILD_DIR=
58 MYCWD=$(shell @pwd)/$(INPATH)/misc/build
60 # CLFLAGS get overwritten in Makefile.pre.in
61 .IF "$(SYSBASE)"!=""
62 CC+:=-I$(SYSBASE)$/usr$/include
63 python_LDFLAGS+=-L$(SYSBASE)/usr/lib
64 .IF "$(COMNAME)"=="sunpro5"
65 CC+:=$(C_RESTRICTIONFLAGS)
66 .ENDIF # "$(COMNAME)"=="sunpro5"
67 .ENDIF # "$(SYSBASE)"!=""
69 .IF "$(OS)$(COM)"=="LINUXGCC"
70 python_LDFLAGS+=-Wl,-z,noexecstack
71 .ENDIF
73 .IF "$(OS)$(CPU)"=="SOLARISU"
74 CC+:=$(ARCH_FLAGS)
75 python_LDFLAGS+=$(ARCH_FLAGS)
76 .ENDIF
78 CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
79 .IF "$(OS)$(CPU)" == "SOLARISI"
80 CONFIGURE_ACTION += --disable-ipv6
81 .ENDIF
82 BUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) && $(GNUMAKE) install && chmod -R ug+w $(MYCWD)/python-inst && chmod g+w Include
83 .ELSE
84 # ----------------------------------
85 # WINDOWS
86 # ----------------------------------
87 .IF "$(COM)"=="GCC"
88 PATCH_FILES=Python-$(PYVERSION)-mingw.patch
89 BUILD_DIR=
90 MYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
91 python_CFLAGS=-mno-cygwin -mthreads
92 python_LDFLAGS=-mno-cygwin -mthreads
93 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
94 python_LDFLAGS+=-shared-libgcc
95 .ENDIF
96 python_LDFLAGS+=-shared-libgcc -Wl,--enable-runtime-pseudo-reloc-v2
97 CONFIGURE_ACTION=./configure --prefix=$(MYCWD)/python-inst --enable-shared CC="$(CC:s/guw.exe //)" CXX="$(CXX:s/guw.exe //)" MACHDEP=MINGW32 LN="cp -p" CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
98 BUILD_ACTION=$(ENV_BUILD) make && make install
99 .ELSE
100 #PYTHONPATH:=..$/Lib
101 #.EXPORT : PYTHONPATH
103 #.IF "$(CCNUMVER)" <= "001400000000"
104 #EXFLAGS="/GX /YX"
105 #.ELSE
106 #.IF "$(WINDOWS_VISTA_PSDK)"!=""
107 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
108 #ADDITIONALLIBS=ws2_32.lib
109 #.ELSE #"$(WINDOWS_VISTA_PSDK)"!=""
110 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
111 #.ENDIF #"$(WINDOWS_VISTA_PSDK)"!=""
112 #.ENDIF
114 BUILD_DIR=PCbuild
116 # Build python executable and then runs a minimal script. Running the minimal script
117 # ensures that certain *.pyc files are generated which would otherwise be created on
118 # solver during registration in insetoo_native
119 .IF "$(SYSBASE)" != ""
120 BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv pcbuild.sln "Release|Win32"
121 .ELSE
122 BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "Release|Win32"
123 .ENDIF # "$(SYSBASE)" != ""
124 .ENDIF
125 .ENDIF
127 PYVERSIONFILE=$(MISC)$/pyversion.mk
129 # --- Targets ------------------------------------------------------
132 .INCLUDE : set_ext.mk
133 .INCLUDE : target.mk
134 .INCLUDE : tg_ext.mk
136 .IF "$(L10N_framework)"==""
137 .IF "$(GUI)" != "UNX"
138 .IF "$(COM)"!="GCC"
139 PYCONFIG:=$(MISC)$/build$/pyconfig.h
140 $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
142 $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
144 $(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
145 -rm -f $@
146 cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
147 .ENDIF
148 .ENDIF
150 ALLTAR : $(PYVERSIONFILE)
151 .ENDIF # "$(L10N_framework)"==""
154 $(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
155 -rm -f $@
156 cat $? > $@