xref: /aoo41x/main/python/makefile.mk (revision 935c1df3)
1cdf0e10cSrcweir#*************************************************************************
2cdf0e10cSrcweir#
3cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir#
5cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir#
7cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir#
9cdf0e10cSrcweir# This file is part of OpenOffice.org.
10cdf0e10cSrcweir#
11cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14cdf0e10cSrcweir#
15cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir#
21cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25cdf0e10cSrcweir#
26cdf0e10cSrcweir#*************************************************************************
27cdf0e10cSrcweir
28cdf0e10cSrcweirPRJ=.
29cdf0e10cSrcweir
30cdf0e10cSrcweirPRJNAME=so_python
31cdf0e10cSrcweirTARGET=so_python
32cdf0e10cSrcweir
33cdf0e10cSrcweir# --- Settings -----------------------------------------------------
34cdf0e10cSrcweir
35cdf0e10cSrcweir.INCLUDE :	settings.mk
36cdf0e10cSrcweir.INCLUDE :      pyversion.mk
37cdf0e10cSrcweir
38cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES"
39cdf0e10cSrcweirall:
40cdf0e10cSrcweir	@echo "An already available installation of python should exist on your system."
41cdf0e10cSrcweir	@echo "Therefore the version provided here does not need to be built in addition."
42cdf0e10cSrcweir.ENDIF
43cdf0e10cSrcweir
44cdf0e10cSrcweir
45cdf0e10cSrcweir# --- Files --------------------------------------------------------
46cdf0e10cSrcweir
47cdf0e10cSrcweir
48cdf0e10cSrcweirTARFILE_NAME=Python-$(PYVERSION)
49cdf0e10cSrcweirTARFILE_MD5=e81c2f0953aa60f8062c05a4673f2be0
50cdf0e10cSrcweirPATCH_FILES=\
51cdf0e10cSrcweir	Python-$(PYVERSION).patch \
52cdf0e10cSrcweir	Python-parallel-make.patch \
53cdf0e10cSrcweir	Python-ssl.patch \
54cdf0e10cSrcweir    Python-2.6.1-sysbase.patch\
55*935c1df3SAriel Constenla-Haile	Python-2.6.1-nohardlink.patch \
56*935c1df3SAriel Constenla-Haile	Python-disable-dbm.patch
57cdf0e10cSrcweir
58cdf0e10cSrcweirCONFIGURE_DIR=
59cdf0e10cSrcweir
60cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
61cdf0e10cSrcweirBUILD_DIR=
62cdf0e10cSrcweirMYCWD=$(shell @pwd)/$(INPATH)/misc/build
63cdf0e10cSrcweir
64cdf0e10cSrcweir# CLFLAGS get overwritten in Makefile.pre.in
65cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
66cdf0e10cSrcweirCC+:=-I$(SYSBASE)$/usr$/include
67cdf0e10cSrcweirpython_LDFLAGS+=-L$(SYSBASE)/usr/lib
68cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5"
69cdf0e10cSrcweirCC+:=$(C_RESTRICTIONFLAGS)
70cdf0e10cSrcweir.ENDIF			# "$(COMNAME)"=="sunpro5"
71cdf0e10cSrcweir.ENDIF			# "$(SYSBASE)"!=""
72cdf0e10cSrcweir
73cdf0e10cSrcweir.IF "$(OS)$(CPU)"=="SOLARISU"
74cdf0e10cSrcweirCC+:=$(ARCH_FLAGS)
75cdf0e10cSrcweirpython_LDFLAGS+=$(ARCH_FLAGS)
76cdf0e10cSrcweir.ENDIF
77cdf0e10cSrcweir
78cdf0e10cSrcweirCONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
79cdf0e10cSrcweir.IF "$(OS)$(CPU)" == "SOLARISI"
80cdf0e10cSrcweirCONFIGURE_ACTION += --disable-ipv6
81cdf0e10cSrcweir.ENDIF
82cdf0e10cSrcweirBUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) && $(GNUMAKE) install && chmod -R ug+w $(MYCWD)/python-inst && chmod g+w Include
83cdf0e10cSrcweir.ELSE
84cdf0e10cSrcweir# ----------------------------------
85cdf0e10cSrcweir# WINDOWS
86cdf0e10cSrcweir# ----------------------------------
87cdf0e10cSrcweir.IF "$(COM)"=="GCC"
88cdf0e10cSrcweirPATCH_FILES=Python-$(PYVERSION)-mingw.patch
89cdf0e10cSrcweirBUILD_DIR=
90cdf0e10cSrcweirMYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
91cdf0e10cSrcweirpython_CFLAGS=-mno-cygwin -mthreads
92cdf0e10cSrcweirpython_LDFLAGS=-mno-cygwin -mthreads
93cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
94cdf0e10cSrcweirpython_LDFLAGS+=-shared-libgcc
95cdf0e10cSrcweir.ENDIF
96cdf0e10cSrcweirpython_LDFLAGS+=-shared-libgcc -Wl,--enable-runtime-pseudo-reloc-v2
97cdf0e10cSrcweirCONFIGURE_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)"
98cdf0e10cSrcweirBUILD_ACTION=$(ENV_BUILD) make && make install
99cdf0e10cSrcweir.ELSE
100cdf0e10cSrcweir#PYTHONPATH:=..$/Lib
101cdf0e10cSrcweir#.EXPORT : PYTHONPATH
102cdf0e10cSrcweir
103cdf0e10cSrcweir#.IF "$(CCNUMVER)" <= "001400000000"
104cdf0e10cSrcweir#EXFLAGS="/GX /YX"
105cdf0e10cSrcweir#.ELSE
106cdf0e10cSrcweir#.IF "$(WINDOWS_VISTA_PSDK)"!=""
107cdf0e10cSrcweir#EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
108cdf0e10cSrcweir#ADDITIONALLIBS=ws2_32.lib
109cdf0e10cSrcweir#.ELSE  #"$(WINDOWS_VISTA_PSDK)"!=""
110cdf0e10cSrcweir#EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
111cdf0e10cSrcweir#.ENDIF #"$(WINDOWS_VISTA_PSDK)"!=""
112cdf0e10cSrcweir#.ENDIF
113cdf0e10cSrcweir
114cdf0e10cSrcweirBUILD_DIR=PCbuild
115cdf0e10cSrcweir
116cdf0e10cSrcweir# Build python executable and then runs a minimal script. Running the minimal script
117cdf0e10cSrcweir# ensures that certain *.pyc files are generated which would otherwise be created on
118cdf0e10cSrcweir# solver during registration in insetoo_native
119cdf0e10cSrcweir.IF "$(SYSBASE)" != ""
120cdf0e10cSrcweirBUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv pcbuild.sln "Release|Win32"
121cdf0e10cSrcweir.ELSE
122cdf0e10cSrcweirBUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "Release|Win32"
123cdf0e10cSrcweir.ENDIF # "$(SYSBASE)" != ""
124cdf0e10cSrcweir.ENDIF
125cdf0e10cSrcweir.ENDIF
126cdf0e10cSrcweir
127cdf0e10cSrcweirPYVERSIONFILE=$(MISC)$/pyversion.mk
128cdf0e10cSrcweir
129cdf0e10cSrcweir# --- Targets ------------------------------------------------------
130cdf0e10cSrcweir
131cdf0e10cSrcweir
132cdf0e10cSrcweir.INCLUDE : set_ext.mk
133cdf0e10cSrcweir.INCLUDE : target.mk
134cdf0e10cSrcweir.INCLUDE : tg_ext.mk
135cdf0e10cSrcweir
136cdf0e10cSrcweir.IF "$(L10N_framework)"==""
137cdf0e10cSrcweir.IF "$(GUI)" != "UNX"
138cdf0e10cSrcweir.IF "$(COM)"!="GCC"
139cdf0e10cSrcweirPYCONFIG:=$(MISC)$/build$/pyconfig.h
140cdf0e10cSrcweir$(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
141cdf0e10cSrcweir
142cdf0e10cSrcweir$(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
143cdf0e10cSrcweir
144cdf0e10cSrcweir$(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
145cdf0e10cSrcweir	-rm -f $@
146cdf0e10cSrcweir	cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
147cdf0e10cSrcweir.ENDIF
148cdf0e10cSrcweir.ENDIF
149cdf0e10cSrcweir
150cdf0e10cSrcweirALLTAR : $(PYVERSIONFILE)
151cdf0e10cSrcweir.ENDIF          # "$(L10N_framework)"==""
152cdf0e10cSrcweir
153cdf0e10cSrcweir
154cdf0e10cSrcweir$(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
155cdf0e10cSrcweir	-rm -f $@
156cdf0e10cSrcweir	cat $? > $@
157cdf0e10cSrcweir
158