2003-03-31 13:08:05 +00:00
|
|
|
#*************************************************************************
|
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
2010-02-12 15:01:35 +01:00
|
|
|
# Copyright 2000, 2010 Oracle and/or its affiliates.
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# This file is part of OpenOffice.org.
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
# only, as published by the Free Software Foundation.
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License version 3 for more details
|
|
|
|
# (a copy is included in the LICENSE file that accompanied this code).
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
2008-04-11 06:06:52 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# version 3 along with OpenOffice.org. If not, see
|
|
|
|
# <http://www.openoffice.org/license.html>
|
|
|
|
# for a copy of the LGPLv3 License.
|
2003-03-31 13:08:05 +00:00
|
|
|
#
|
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
PRJ=.
|
|
|
|
|
|
|
|
PRJNAME=so_python
|
|
|
|
TARGET=so_python
|
|
|
|
|
|
|
|
# --- Settings -----------------------------------------------------
|
|
|
|
|
|
|
|
.INCLUDE : settings.mk
|
|
|
|
.INCLUDE : pyversion.mk
|
|
|
|
|
2005-01-25 11:59:50 +00:00
|
|
|
.IF "$(SYSTEM_PYTHON)" == "YES"
|
|
|
|
all:
|
|
|
|
@echo "An already available installation of python should exist on your system."
|
|
|
|
@echo "Therefore the version provided here does not need to be built in addition."
|
|
|
|
.ENDIF
|
|
|
|
|
2003-03-31 13:08:05 +00:00
|
|
|
# --- Files --------------------------------------------------------
|
|
|
|
|
|
|
|
TARFILE_NAME=Python-$(PYVERSION)
|
2010-01-15 14:55:12 +01:00
|
|
|
TARFILE_MD5=e81c2f0953aa60f8062c05a4673f2be0
|
2009-11-09 08:39:23 +00:00
|
|
|
PATCH_FILES=\
|
|
|
|
Python-$(PYVERSION).patch \
|
2010-10-13 14:42:06 +01:00
|
|
|
Python-ssl.patch \
|
2010-11-23 18:31:36 +01:00
|
|
|
Python-aix.patch \
|
|
|
|
Python-2.6.1-urllib.patch
|
2003-03-31 13:08:05 +00:00
|
|
|
|
2004-11-15 12:08:39 +00:00
|
|
|
CONFIGURE_DIR=
|
2003-03-31 13:08:05 +00:00
|
|
|
|
2003-06-17 15:22:30 +00:00
|
|
|
.IF "$(GUI)"=="UNX"
|
2004-11-15 12:08:39 +00:00
|
|
|
BUILD_DIR=
|
2007-11-06 14:58:43 +00:00
|
|
|
MYCWD=$(shell @pwd)/$(INPATH)/misc/build
|
2005-12-28 15:57:47 +00:00
|
|
|
|
2008-03-18 13:46:20 +00:00
|
|
|
# CLFLAGS get overwritten in Makefile.pre.in
|
2005-12-28 15:57:47 +00:00
|
|
|
.IF "$(SYSBASE)"!=""
|
2008-03-18 13:46:20 +00:00
|
|
|
CC+:=-I$(SYSBASE)$/usr$/include
|
2005-12-28 15:57:47 +00:00
|
|
|
python_LDFLAGS+=-L$(SYSBASE)/usr/lib
|
|
|
|
.IF "$(COMNAME)"=="sunpro5"
|
2008-03-18 13:46:20 +00:00
|
|
|
CC+:=$(C_RESTRICTIONFLAGS)
|
2005-12-28 15:57:47 +00:00
|
|
|
.ENDIF # "$(COMNAME)"=="sunpro5"
|
|
|
|
.ENDIF # "$(SYSBASE)"!=""
|
|
|
|
|
2007-03-26 11:23:31 +00:00
|
|
|
.IF "$(OS)$(COM)"=="LINUXGCC"
|
|
|
|
python_LDFLAGS+=-Wl,-z,noexecstack
|
|
|
|
.ENDIF
|
|
|
|
|
2008-06-16 13:27:36 +00:00
|
|
|
.IF "$(OS)$(CPU)"=="SOLARISU"
|
|
|
|
CC+:=$(ARCH_FLAGS)
|
|
|
|
python_LDFLAGS+=$(ARCH_FLAGS)
|
|
|
|
.ENDIF
|
2007-06-27 11:12:12 +00:00
|
|
|
|
2010-10-13 14:42:06 +01:00
|
|
|
.IF "$(OS)"=="AIX"
|
|
|
|
python_CFLAGS=-g0
|
|
|
|
.ENDIF
|
|
|
|
|
2009-03-06 14:28:25 +00:00
|
|
|
CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
|
2004-11-15 12:08:39 +00:00
|
|
|
.IF "$(OS)$(CPU)" == "SOLARISI"
|
|
|
|
CONFIGURE_ACTION += --disable-ipv6
|
2004-11-24 10:17:42 +00:00
|
|
|
.ENDIF
|
2010-10-13 14:42:06 +01:00
|
|
|
.IF "$(OS)"=="AIX"
|
|
|
|
CONFIGURE_ACTION += --disable-ipv6 --with-threads
|
|
|
|
.ENDIF
|
2010-03-22 14:46:09 +01:00
|
|
|
BUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) && $(GNUMAKE) install && chmod -R ug+w $(MYCWD)/python-inst && chmod g+w Include
|
2003-07-16 16:34:17 +00:00
|
|
|
.ELSE
|
2004-11-15 12:08:39 +00:00
|
|
|
# ----------------------------------
|
|
|
|
# WINDOWS
|
|
|
|
# ----------------------------------
|
2007-03-26 13:36:51 +00:00
|
|
|
.IF "$(COM)"=="GCC"
|
2009-04-24 06:37:46 +00:00
|
|
|
PATCH_FILES=Python-$(PYVERSION)-mingw.patch
|
2007-03-26 13:36:51 +00:00
|
|
|
BUILD_DIR=
|
2008-02-04 11:57:14 +00:00
|
|
|
MYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
|
2009-04-22 14:05:37 +00:00
|
|
|
python_CFLAGS=-mno-cygwin -mthreads
|
|
|
|
python_LDFLAGS=-mno-cygwin -mthreads
|
2009-08-26 06:36:38 +00:00
|
|
|
.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
|
|
|
|
python_LDFLAGS+=-shared-libgcc
|
|
|
|
.ENDIF
|
2010-05-31 21:53:32 +09:00
|
|
|
python_LDFLAGS+=-shared-libgcc -Wl,--enable-runtime-pseudo-reloc-v2
|
2009-04-22 14:05:37 +00:00
|
|
|
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)"
|
2010-03-22 14:46:09 +01:00
|
|
|
BUILD_ACTION=$(ENV_BUILD) make && make install
|
2007-03-26 13:36:51 +00:00
|
|
|
.ELSE
|
2006-09-25 12:22:22 +00:00
|
|
|
|
2010-10-29 01:14:45 +02:00
|
|
|
.IF "$(CCNUMVER)" >= "001600000000"
|
|
|
|
PATCH_FILES+=Python-$(PYVERSION)-vc10.patch
|
|
|
|
BUILD_DIR=PC/VS10.0
|
|
|
|
.ELIF "$(CCNUMVER)" >= "001500000000"
|
2004-11-15 12:08:39 +00:00
|
|
|
BUILD_DIR=PCbuild
|
2010-09-14 12:49:54 +02:00
|
|
|
.ELIF "$(CCNUMVER)" >= "001400000000"
|
|
|
|
BUILD_DIR=PC/VS8.0
|
|
|
|
.ELIF "$(CCNUMVER)" >= "001310000000"
|
|
|
|
BUILD_DIR=PC/VS7.1
|
|
|
|
.ELSE
|
|
|
|
BUILD_DIR=PC/VC6
|
|
|
|
.ENDIF
|
2007-06-05 09:45:54 +00:00
|
|
|
|
2011-01-23 20:55:04 +02:00
|
|
|
.IF "$(CPU)" == "I"
|
|
|
|
ARCH=Win32
|
|
|
|
.ELSE
|
|
|
|
ARCH=x64
|
|
|
|
.ENDIF
|
|
|
|
|
2005-02-16 12:33:16 +00:00
|
|
|
# Build python executable and then runs a minimal script. Running the minimal script
|
|
|
|
# ensures that certain *.pyc files are generated which would otherwise be created on
|
|
|
|
# solver during registration in insetoo_native
|
2010-10-29 01:14:45 +02:00
|
|
|
.IF "$(CCNUMVER)" >= "001600000000"
|
|
|
|
BUILD_ACTION=MSBuild.exe pcbuild.sln /t:Build /p:Configuration=Release /ToolsVersion:4.0
|
2010-11-02 20:37:12 +01:00
|
|
|
.ELSE
|
2011-01-23 20:55:04 +02:00
|
|
|
BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "Release|$(ARCH)"
|
2003-03-31 13:08:05 +00:00
|
|
|
.ENDIF
|
2007-03-26 13:36:51 +00:00
|
|
|
.ENDIF
|
2010-10-29 01:14:45 +02:00
|
|
|
.ENDIF
|
2003-03-31 13:08:05 +00:00
|
|
|
|
|
|
|
PYVERSIONFILE=$(MISC)$/pyversion.mk
|
|
|
|
|
|
|
|
# --- Targets ------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
.INCLUDE : set_ext.mk
|
|
|
|
.INCLUDE : target.mk
|
|
|
|
.INCLUDE : tg_ext.mk
|
|
|
|
|
2003-12-16 10:43:12 +00:00
|
|
|
.IF "$(L10N_framework)"==""
|
2005-09-26 12:00:50 +00:00
|
|
|
.IF "$(GUI)" != "UNX"
|
2007-03-26 13:36:51 +00:00
|
|
|
.IF "$(COM)"!="GCC"
|
2005-09-26 12:00:50 +00:00
|
|
|
PYCONFIG:=$(MISC)$/build$/pyconfig.h
|
|
|
|
$(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
|
2003-06-17 15:22:30 +00:00
|
|
|
|
2005-09-26 12:00:50 +00:00
|
|
|
$(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
|
2003-06-17 15:22:30 +00:00
|
|
|
|
2005-09-26 12:00:50 +00:00
|
|
|
$(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
|
2003-03-31 13:08:05 +00:00
|
|
|
-rm -f $@
|
|
|
|
cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
|
2005-09-26 12:00:50 +00:00
|
|
|
.ENDIF
|
2007-03-26 13:36:51 +00:00
|
|
|
.ENDIF
|
2005-09-26 12:00:50 +00:00
|
|
|
|
|
|
|
ALLTAR : $(PYVERSIONFILE)
|
|
|
|
.ENDIF # "$(L10N_framework)"==""
|
|
|
|
|
2003-03-31 13:08:05 +00:00
|
|
|
|
2003-06-17 15:22:30 +00:00
|
|
|
$(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
|
2003-03-31 13:08:05 +00:00
|
|
|
-rm -f $@
|
2003-06-12 13:51:27 +00:00
|
|
|
cat $? > $@
|
2003-06-17 15:22:30 +00:00
|
|
|
|