2003-03-31 07:08:05 -06:00
|
|
|
#*************************************************************************
|
|
|
|
#
|
2008-04-11 01:06:52 -05:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
2010-02-12 08:01:35 -06:00
|
|
|
# Copyright 2000, 2010 Oracle and/or its affiliates.
|
2003-03-31 07:08:05 -06:00
|
|
|
#
|
2008-04-11 01:06:52 -05:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2003-03-31 07:08:05 -06:00
|
|
|
#
|
2008-04-11 01:06:52 -05:00
|
|
|
# This file is part of OpenOffice.org.
|
2003-03-31 07:08:05 -06:00
|
|
|
#
|
2008-04-11 01:06:52 -05: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 07:08:05 -06:00
|
|
|
#
|
2008-04-11 01:06:52 -05: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 07:08:05 -06:00
|
|
|
#
|
2008-04-11 01:06:52 -05: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 07:08:05 -06:00
|
|
|
#
|
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
PRJ=.
|
|
|
|
|
|
|
|
PRJNAME=so_python
|
|
|
|
TARGET=so_python
|
|
|
|
|
|
|
|
# --- Settings -----------------------------------------------------
|
|
|
|
|
|
|
|
.INCLUDE : settings.mk
|
2011-05-27 12:58:57 -05:00
|
|
|
|
|
|
|
.IF "$(DISABLE_PYTHON)"!="TRUE"
|
|
|
|
|
2003-03-31 07:08:05 -06:00
|
|
|
.INCLUDE : pyversion.mk
|
|
|
|
|
2005-01-25 05:59:50 -06:00
|
|
|
.IF "$(SYSTEM_PYTHON)" == "YES"
|
|
|
|
all:
|
2011-06-06 11:21:14 -05:00
|
|
|
@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."
|
2005-01-25 05:59:50 -06:00
|
|
|
.ENDIF
|
|
|
|
|
2003-03-31 07:08:05 -06:00
|
|
|
# --- Files --------------------------------------------------------
|
|
|
|
|
|
|
|
TARFILE_NAME=Python-$(PYVERSION)
|
2010-01-15 07:55:12 -06:00
|
|
|
TARFILE_MD5=e81c2f0953aa60f8062c05a4673f2be0
|
2009-11-09 02:39:23 -06:00
|
|
|
PATCH_FILES=\
|
|
|
|
Python-$(PYVERSION).patch \
|
2010-10-08 09:12:40 -05:00
|
|
|
Python-parallel-make.patch \
|
2010-10-13 08:42:06 -05:00
|
|
|
Python-ssl.patch \
|
2010-11-23 11:31:36 -06:00
|
|
|
Python-aix.patch \
|
2011-04-22 08:08:24 -05:00
|
|
|
Python-2.6.1-urllib.patch \
|
|
|
|
Python-2.6.1-sysbase.patch \
|
2011-07-26 11:12:00 -05:00
|
|
|
Python-2.6.1-nohardlink.patch \
|
2011-08-02 03:08:49 -05:00
|
|
|
Python-2.6.1-py2422.patch \
|
2012-05-17 15:49:33 -05:00
|
|
|
Python-2.6.1-py4768.patch \
|
|
|
|
Python-2.6.1-svn-1.7.patch \
|
2003-03-31 07:08:05 -06:00
|
|
|
|
2004-11-15 06:08:39 -06:00
|
|
|
CONFIGURE_DIR=
|
2003-03-31 07:08:05 -06:00
|
|
|
|
2003-06-17 10:22:30 -05:00
|
|
|
.IF "$(GUI)"=="UNX"
|
2004-11-15 06:08:39 -06:00
|
|
|
BUILD_DIR=
|
2007-11-06 08:58:43 -06:00
|
|
|
MYCWD=$(shell @pwd)/$(INPATH)/misc/build
|
2005-12-28 09:57:47 -06:00
|
|
|
|
2012-04-10 10:45:48 -05:00
|
|
|
.IF "$(SYSTEM_OPENSSL)" != "YES"
|
2012-04-10 10:07:47 -05:00
|
|
|
#we want to be sure we use our internal openssl if
|
|
|
|
#that's enabled
|
|
|
|
CC+:=-I$(SOLARINCDIR)$/external
|
|
|
|
python_LDFLAGS+=-L$(SOLARLIBDIR)
|
2012-04-10 10:45:48 -05:00
|
|
|
.ENDIF
|
2012-04-10 10:07:47 -05:00
|
|
|
|
2008-03-18 08:46:20 -05:00
|
|
|
# CLFLAGS get overwritten in Makefile.pre.in
|
2005-12-28 09:57:47 -06:00
|
|
|
.IF "$(SYSBASE)"!=""
|
2008-03-18 08:46:20 -05:00
|
|
|
CC+:=-I$(SYSBASE)$/usr$/include
|
2005-12-28 09:57:47 -06:00
|
|
|
python_LDFLAGS+=-L$(SYSBASE)/usr/lib
|
|
|
|
.IF "$(COMNAME)"=="sunpro5"
|
2008-03-18 08:46:20 -05:00
|
|
|
CC+:=$(C_RESTRICTIONFLAGS)
|
2005-12-28 09:57:47 -06:00
|
|
|
.ENDIF # "$(COMNAME)"=="sunpro5"
|
|
|
|
.ENDIF # "$(SYSBASE)"!=""
|
|
|
|
|
2008-06-16 08:27:36 -05:00
|
|
|
.IF "$(OS)$(CPU)"=="SOLARISU"
|
|
|
|
CC+:=$(ARCH_FLAGS)
|
|
|
|
python_LDFLAGS+=$(ARCH_FLAGS)
|
|
|
|
.ENDIF
|
2007-06-27 06:12:12 -05:00
|
|
|
|
2010-10-13 08:42:06 -05:00
|
|
|
.IF "$(OS)"=="AIX"
|
|
|
|
python_CFLAGS=-g0
|
|
|
|
.ENDIF
|
|
|
|
|
2012-02-29 11:34:42 -06:00
|
|
|
.IF "$(OS)" == "MACOSX"
|
|
|
|
my_prefix = @__________________________________________________$(EXTRPATH)
|
|
|
|
.ELSE
|
|
|
|
my_prefix = python-inst
|
|
|
|
.END
|
|
|
|
|
|
|
|
CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=/$(my_prefix) --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
|
2011-06-06 11:21:14 -05:00
|
|
|
|
2012-05-08 18:22:29 -05:00
|
|
|
.IF "$(OS)$(CPUNAME)" == "SOLARISINTEL"
|
2004-11-15 06:08:39 -06:00
|
|
|
CONFIGURE_ACTION += --disable-ipv6
|
2004-11-24 04:17:42 -06:00
|
|
|
.ENDIF
|
2011-06-06 11:21:14 -05:00
|
|
|
|
|
|
|
.IF "$(OS)" == "MACOSX"
|
2012-02-22 02:58:16 -06:00
|
|
|
PATCH_FILES+=Python-2.6.1-py8067.patch
|
2011-06-06 11:21:14 -05:00
|
|
|
# don't build dual-arch version as OOo itself is not universal binary either
|
|
|
|
PATCH_FILES+=Python-2.6.1-arch_$(eq,$(CPU),I i386 ppc).patch
|
|
|
|
|
2012-02-29 11:34:42 -06:00
|
|
|
CONFIGURE_ACTION+=--enable-universalsdk=$(MACOSX_SDK_PATH) --with-universal-archs=32-bit --enable-framework=/$(my_prefix) --with-framework-name=OOoPython
|
2011-06-06 11:21:14 -05:00
|
|
|
ALLTAR: $(MISC)/OOoPython.framework.zip
|
|
|
|
|
|
|
|
.ENDIF
|
|
|
|
|
2010-10-13 08:42:06 -05:00
|
|
|
.IF "$(OS)"=="AIX"
|
|
|
|
CONFIGURE_ACTION += --disable-ipv6 --with-threads
|
|
|
|
.ENDIF
|
2012-02-29 11:34:42 -06:00
|
|
|
BUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) && $(GNUMAKE) install DESTDIR=$(MYCWD) && chmod -R ug+w $(MYCWD)/$(my_prefix) && chmod g+w Include
|
2003-07-16 11:34:17 -05:00
|
|
|
.ELSE
|
2004-11-15 06:08:39 -06:00
|
|
|
# ----------------------------------
|
|
|
|
# WINDOWS
|
|
|
|
# ----------------------------------
|
2007-03-26 08:36:51 -05:00
|
|
|
.IF "$(COM)"=="GCC"
|
2009-04-24 01:37:46 -05:00
|
|
|
PATCH_FILES=Python-$(PYVERSION)-mingw.patch
|
2007-03-26 08:36:51 -05:00
|
|
|
BUILD_DIR=
|
2008-02-04 05:57:14 -06:00
|
|
|
MYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
|
2009-04-22 09:05:37 -05:00
|
|
|
python_CFLAGS=-mno-cygwin -mthreads
|
|
|
|
python_LDFLAGS=-mno-cygwin -mthreads
|
2009-08-26 01:36:38 -05:00
|
|
|
.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
|
|
|
|
python_LDFLAGS+=-shared-libgcc
|
|
|
|
.ENDIF
|
2010-05-31 07:53:32 -05:00
|
|
|
python_LDFLAGS+=-shared-libgcc -Wl,--enable-runtime-pseudo-reloc-v2
|
2012-02-29 11:34:42 -06:00
|
|
|
CONFIGURE_ACTION=./configure --prefix=$(MYCWD)/$(my_prefix) --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 08:46:09 -05:00
|
|
|
BUILD_ACTION=$(ENV_BUILD) make && make install
|
2007-03-26 08:36:51 -05:00
|
|
|
.ELSE
|
2006-09-25 07:22:22 -05:00
|
|
|
|
2010-10-28 18:14:45 -05:00
|
|
|
.IF "$(CCNUMVER)" >= "001600000000"
|
|
|
|
PATCH_FILES+=Python-$(PYVERSION)-vc10.patch
|
|
|
|
BUILD_DIR=PC/VS10.0
|
|
|
|
.ELIF "$(CCNUMVER)" >= "001500000000"
|
2004-11-15 06:08:39 -06:00
|
|
|
BUILD_DIR=PCbuild
|
2010-09-14 05:49:54 -05: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 04:45:54 -05:00
|
|
|
|
2012-05-08 18:22:29 -05:00
|
|
|
.IF "$(CPUNAME)" == "INTEL"
|
2011-01-23 12:55:04 -06:00
|
|
|
ARCH=Win32
|
|
|
|
.ELSE
|
|
|
|
ARCH=x64
|
|
|
|
.ENDIF
|
|
|
|
|
2011-02-13 18:25:28 -06:00
|
|
|
.IF "$(debug)"!=""
|
|
|
|
CONF=Debug
|
|
|
|
.ELSE
|
|
|
|
CONF=Release
|
|
|
|
.ENDIF
|
|
|
|
|
2005-02-16 06:33:16 -06: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-28 18:14:45 -05:00
|
|
|
.IF "$(CCNUMVER)" >= "001600000000"
|
2011-02-13 18:25:28 -06:00
|
|
|
BUILD_ACTION=MSBuild.exe pcbuild.sln /t:Build /p:Configuration=$(CONF) /ToolsVersion:4.0
|
2010-11-02 14:37:12 -05:00
|
|
|
.ELSE
|
2011-02-13 18:25:28 -06:00
|
|
|
BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "$(CONF)|$(ARCH)"
|
2003-03-31 07:08:05 -06:00
|
|
|
.ENDIF
|
2007-03-26 08:36:51 -05:00
|
|
|
.ENDIF
|
2010-10-28 18:14:45 -05:00
|
|
|
.ENDIF
|
2003-03-31 07:08:05 -06:00
|
|
|
|
|
|
|
PYVERSIONFILE=$(MISC)$/pyversion.mk
|
|
|
|
|
|
|
|
# --- Targets ------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
.INCLUDE : set_ext.mk
|
2011-05-27 12:58:57 -05:00
|
|
|
.ENDIF # DISABLE_PYTHON != TRUE
|
2003-03-31 07:08:05 -06:00
|
|
|
.INCLUDE : target.mk
|
2011-05-27 12:58:57 -05:00
|
|
|
.IF "$(DISABLE_PYTHON)"!="TRUE"
|
2003-03-31 07:08:05 -06:00
|
|
|
.INCLUDE : tg_ext.mk
|
|
|
|
|
2003-12-16 04:43:12 -06:00
|
|
|
.IF "$(L10N_framework)"==""
|
2005-09-26 07:00:50 -05:00
|
|
|
.IF "$(GUI)" != "UNX"
|
2007-03-26 08:36:51 -05:00
|
|
|
.IF "$(COM)"!="GCC"
|
2005-09-26 07:00:50 -05:00
|
|
|
PYCONFIG:=$(MISC)$/build$/pyconfig.h
|
|
|
|
$(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
|
2003-06-17 10:22:30 -05:00
|
|
|
|
2005-09-26 07:00:50 -05:00
|
|
|
$(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
|
2003-06-17 10:22:30 -05:00
|
|
|
|
2005-09-26 07:00:50 -05:00
|
|
|
$(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
|
2003-03-31 07:08:05 -06:00
|
|
|
-rm -f $@
|
|
|
|
cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
|
2011-02-14 07:01:54 -06:00
|
|
|
# We know that the only thing guarded with #ifdef _DEBUG in PC/pyconfig.h is
|
|
|
|
# the line defining Py_DEBUG.
|
|
|
|
.IF "$(debug)"!=""
|
|
|
|
# If Python is built with debugging, then the modules we build need to be built with
|
|
|
|
# Py_DEBUG defined too because of the Py_InitModule4 redefining magic in modsupport.h
|
|
|
|
sed -e 's/^#ifdef _DEBUG$/#if 1/' <$@ >$@.new && mv $@.new $@
|
|
|
|
.ELSE
|
|
|
|
# Correspondingly, if Python is not built with debugging, it won't use the Py_InitModule4 redefining
|
|
|
|
# magic, so our Python modules should not be built to provide that either.
|
|
|
|
sed -e 's/^#ifdef _DEBUG$/#if 0/' <$@ >$@.new && mv $@.new $@
|
|
|
|
.ENDIF
|
2005-09-26 07:00:50 -05:00
|
|
|
.ENDIF
|
2007-03-26 08:36:51 -05:00
|
|
|
.ENDIF
|
2005-09-26 07:00:50 -05:00
|
|
|
|
|
|
|
ALLTAR : $(PYVERSIONFILE)
|
|
|
|
.ENDIF # "$(L10N_framework)"==""
|
|
|
|
|
2011-06-06 11:21:14 -05:00
|
|
|
# rule to allow relocating the whole framework, removing reference to buildinstallation directory
|
|
|
|
$(PACKAGE_DIR)/fixscripts: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
|
|
|
|
@echo remove build installdir from scripts
|
|
|
|
$(COMMAND_ECHO)for file in \
|
2012-02-29 11:34:42 -06:00
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/bin/2to3 \
|
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/bin/idle$(PYMAJOR).$(PYMINOR) \
|
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/bin/pydoc$(PYMAJOR).$(PYMINOR) \
|
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/bin/python$(PYMAJOR).$(PYMINOR)-config \
|
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/bin/smtpd$(PYMAJOR).$(PYMINOR).py ; do \
|
2011-06-06 11:21:14 -05:00
|
|
|
{{ rm "$$file" && awk '\
|
|
|
|
BEGIN {{print "\
|
|
|
|
#!/bin/bash\n\
|
|
|
|
origpath=$$(pwd)\n\
|
|
|
|
bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\
|
|
|
|
cd \"$$origpath\"\n\
|
|
|
|
\"$$bindir/../Resources/Python.app/Contents/MacOS/OOoPython\" - $$@ <<EOF"}} \
|
|
|
|
FNR==1{{next}} \
|
|
|
|
{{print}} \
|
|
|
|
END {{print "EOF"}}' > "$$file" ; }} < "$$file" ; chmod +x "$$file" ; done
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
$(PACKAGE_DIR)/fixinstallnames: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
|
|
|
|
@echo remove build installdir from OOoPython
|
|
|
|
$(COMMAND_ECHO)install_name_tool -change \
|
2012-02-29 11:34:42 -06:00
|
|
|
/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/OOoPython \
|
2011-06-06 11:21:14 -05:00
|
|
|
@executable_path/../../../../OOoPython \
|
2012-02-29 11:34:42 -06:00
|
|
|
$(MYCWD)/$(my_prefix)/OOoPython.framework/Versions/$(PYMAJOR).$(PYMINOR)/Resources/Python.app/Contents/MacOS/OOoPython
|
2011-06-06 11:21:14 -05:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
$(MISC)/OOoPython.framework.zip: $(PACKAGE_DIR)/fixinstallnames $(PACKAGE_DIR)/fixscripts
|
|
|
|
@-rm -f $@
|
|
|
|
@echo creating $@
|
2012-02-29 11:34:42 -06:00
|
|
|
$(COMMAND_ECHO)cd $(MISC)/build/$(my_prefix) && find OOoPython.framework \
|
2011-06-06 11:21:14 -05:00
|
|
|
-not -type l -not -name Info.plist.in \
|
|
|
|
-not -name pythonw$(PYMAJOR).$(PYMINOR) \
|
|
|
|
-not -name python$(PYMAJOR).$(PYMINOR) -print0 | \
|
|
|
|
xargs -0 zip $(ZIP_VERBOSITY) ../../$(@:f)
|
2003-03-31 07:08:05 -06:00
|
|
|
|
2003-06-17 10:22:30 -05:00
|
|
|
$(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
|
2011-06-06 11:21:14 -05:00
|
|
|
@-rm -f $@
|
2011-06-11 13:19:03 -05:00
|
|
|
$(COMMAND_ECHO)$(COPY) pyversion.mk $@
|
2003-06-17 10:22:30 -05:00
|
|
|
|
2011-05-27 12:58:57 -05:00
|
|
|
.ENDIF # DISABLE_PYTHON != TRUE
|