diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh index 1a3b517470b..b012fd24139 100755 --- a/mozilla/allmakefiles.sh +++ b/mozilla/allmakefiles.sh @@ -1537,6 +1537,9 @@ for extension in $MOZ_EXTENSIONS; do extensions/xmlterm/tests/Makefile extensions/xmlterm/ui/Makefile " ;; + python ) MAKEFILES_extensions="$MAKEFILES_extensions + extensions/python/Makefile + " ;; python/xpcom ) MAKEFILES_extensions="$MAKEFILES_extensions extensions/python/xpcom/Makefile extensions/python/xpcom/components/Makefile diff --git a/mozilla/config/autoconf.mk.in b/mozilla/config/autoconf.mk.in index 1c0df85e8f4..e32529595ab 100644 --- a/mozilla/config/autoconf.mk.in +++ b/mozilla/config/autoconf.mk.in @@ -551,15 +551,16 @@ MOZ_QUANTIFY = @MOZ_QUANTIFY@ MSMANIFEST_TOOL = @MSMANIFEST_TOOL@ WIN32_REDIST_DIR = @WIN32_REDIST_DIR@ -#python options -PYTHON = @MOZ_PYTHON@ -PYTHON_PREFIX = @MOZ_PYTHON_PREFIX@ -PYTHON_INCLUDES = @MOZ_PYTHON_INCLUDES@ -PYTHON_LIBS = @MOZ_PYTHON_LIBS@ -PYTHON_DEBUG_SUFFIX = @MOZ_PYTHON_DEBUG_SUFFIX@ -PYTHON_DLL_SUFFIX = @MOZ_PYTHON_DLL_SUFFIX@ -PYTHON_VER_DOTTED = @MOZ_PYTHON_VER_DOTTED@ -PYTHON_VER = @MOZ_PYTHON_VER@ +# python options. +MOZ_PYTHON_EXTENSIONS = @MOZ_PYTHON_EXTENSIONS@ +MOZ_PYTHON = @MOZ_PYTHON@ +MOZ_PYTHON_PREFIX = @MOZ_PYTHON_PREFIX@ +MOZ_PYTHON_INCLUDES = @MOZ_PYTHON_INCLUDES@ +MOZ_PYTHON_LIBS = @MOZ_PYTHON_LIBS@ +MOZ_PYTHON_DEBUG_SUFFIX = @MOZ_PYTHON_DEBUG_SUFFIX@ +MOZ_PYTHON_DLL_SUFFIX = @MOZ_PYTHON_DLL_SUFFIX@ +MOZ_PYTHON_VER_DOTTED = @MOZ_PYTHON_VER_DOTTED@ +MOZ_PYTHON_VER = @MOZ_PYTHON_VER@ # Codesighs tools option, enables win32 mapfiles. MOZ_MAPINFO = @MOZ_MAPINFO@ diff --git a/mozilla/configure.in b/mozilla/configure.in index ee47cb6caad..74a90757291 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -4278,6 +4278,7 @@ MOZ_PREF_EXTENSIONS=1 MOZ_PROFILELOCKING=1 MOZ_PROFILESHARING=1 MOZ_PSM=1 +MOZ_PYTHON_EXTENSIONS="xpcom" MOZ_PYTHON= MOZ_PYTHON_DEBUG_SUFFIX= MOZ_PYTHON_DLL_SUFFIX= @@ -6860,17 +6861,21 @@ fi AC_SUBST(MOZ_XUL) dnl ======================================================== -dnl Python XPCOM bindings - if enabled, we must locate Python. +dnl Two ways to enable Python support: +dnl --enable-extensions=python # select all available. +dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions) +dnl or: +dnl --enable-extensions=python/xpcom,... # select individual ones +dnl +dnl If either is used, we locate the Python to use. dnl ======================================================== dnl -dnl Allow PYTHON to point to the Python interpreter to use. -dnl If not set, we use whatever Python we can find. Setting -dnl PYTHON will allow you to build from any Python version you nominate -dnl -dnl If future Python based extensions are added, some of this should -dnl be split out appropriately. -if test `echo "$MOZ_EXTENSIONS" | grep -c python/xpcom` -ne 0; then - dnl If PYTHON is in the environment, we use that +dnl If 'python' appears anywhere in the extensions list, go lookin'... +if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then + dnl Allow PYTHON to point to the Python interpreter to use + dnl (note that it must be the python executable - which we + dnl run to locate the relevant paths etc) + dnl If not set, we use whatever Python we can find. if test -z "$PYTHON"; then AC_PATH_PROG(PYTHON, python, :) fi @@ -6939,8 +6944,10 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c python/xpcom` -ne 0; then else MOZ_PYTHON_DEBUG_SUFFIX= fi - AC_MSG_RESULT(Building PyXPCOM using Python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX) + AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX) fi +dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified, but not necessary now. +AC_SUBST(MOZ_PYTHON_EXTENSIONS) AC_SUBST(MOZ_PYTHON) AC_SUBST(MOZ_PYTHON_PREFIX) AC_SUBST(MOZ_PYTHON_INCLUDES) diff --git a/mozilla/extensions/python/Makefile.in b/mozilla/extensions/python/Makefile.in new file mode 100644 index 00000000000..12ef0758075 --- /dev/null +++ b/mozilla/extensions/python/Makefile.in @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Hammond +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +DIRS = $(MOZ_PYTHON_EXTENSIONS) + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/extensions/python/xpcom/Makefile.in b/mozilla/extensions/python/xpcom/Makefile.in index 989216f37b8..1caef5fafaf 100644 --- a/mozilla/extensions/python/xpcom/Makefile.in +++ b/mozilla/extensions/python/xpcom/Makefile.in @@ -52,7 +52,7 @@ endif topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -pyexecdir = @libdir@/python$(PYTHON_VER_DOTTED)/site-packages +pyexecdir = @libdir@/python$(MOZ_PYTHON_VER_DOTTED)/site-packages PYSRCS_XPCOM = \ __init__.py \ diff --git a/mozilla/extensions/python/xpcom/src/Makefile.in b/mozilla/extensions/python/xpcom/src/Makefile.in index 965da7f9544..6698a35169e 100644 --- a/mozilla/extensions/python/xpcom/src/Makefile.in +++ b/mozilla/extensions/python/xpcom/src/Makefile.in @@ -41,7 +41,6 @@ DEPTH=../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -pyexecdir = @libdir@/python$(PYTHON_VER_DOTTED)/site-packages DIRS = module loader $(NULL) @@ -55,8 +54,8 @@ MOZILLA_INTERNAL_API = 1 FORCE_SHARED_LIB = 1 FORCE_USE_PIC = 1 -LOCAL_INCLUDES = $(PYTHON_INCLUDES) -EXTRA_LIBS += $(PYTHON_LIBS) +LOCAL_INCLUDES = $(MOZ_PYTHON_INCLUDES) +EXTRA_LIBS += $(MOZ_PYTHON_LIBS) EXPORTS = PyXPCOM.h diff --git a/mozilla/extensions/python/xpcom/src/loader/Makefile.in b/mozilla/extensions/python/xpcom/src/loader/Makefile.in index 39227168b0f..0134b3999f5 100644 --- a/mozilla/extensions/python/xpcom/src/loader/Makefile.in +++ b/mozilla/extensions/python/xpcom/src/loader/Makefile.in @@ -51,9 +51,9 @@ MOZILLA_INTERNAL_API = 1 FORCE_SHARED_LIB = 1 FORCE_USE_PIC = 1 -LOCAL_INCLUDES = $(PYTHON_INCLUDES) +LOCAL_INCLUDES = $(MOZ_PYTHON_INCLUDES) -EXTRA_LIBS += $(PYTHON_LIBS) +EXTRA_LIBS += $(MOZ_PYTHON_LIBS) ifeq ($(OS_ARCH), WINNT) EXTRA_LIBS += $(DIST)/lib/pyxpcom.lib @@ -69,7 +69,7 @@ CPPSRCS = \ include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk -CXXFLAGS += -DPYTHON_SO=\"libpython$(PYTHON_VER_DOTTED).so\" +CXXFLAGS += -DPYTHON_SO=\"libpython$(MOZ_PYTHON_VER_DOTTED).so\" EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) clobber:: diff --git a/mozilla/extensions/python/xpcom/src/module/Makefile.in b/mozilla/extensions/python/xpcom/src/module/Makefile.in index 0b5f44afb70..9eac29266f5 100644 --- a/mozilla/extensions/python/xpcom/src/module/Makefile.in +++ b/mozilla/extensions/python/xpcom/src/module/Makefile.in @@ -41,20 +41,20 @@ DEPTH=../../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -pyexecdir = @libdir@/python$(PYTHON_VER_DOTTED)/site-packages +pyexecdir = @libdir@/python$(MOZ_PYTHON_VER_DOTTED)/site-packages include $(DEPTH)/config/autoconf.mk -LIBRARY_NAME = _xpcom$(PYTHON_DEBUG_SUFFIX) +LIBRARY_NAME = _xpcom$(MOZ_PYTHON_DEBUG_SUFFIX) REQUIRES = pyxpcom xpcom string $(NULL) MOZILLA_INTERNAL_API = 1 FORCE_SHARED_LIB = 1 FORCE_USE_PIC = 1 -DLL_SUFFIX=$(PYTHON_DLL_SUFFIX) -LOCAL_INCLUDES = $(PYTHON_INCLUDES) +DLL_SUFFIX=$(MOZ_PYTHON_DLL_SUFFIX) +LOCAL_INCLUDES = $(MOZ_PYTHON_INCLUDES) -EXTRA_LIBS += $(PYTHON_LIBS) +EXTRA_LIBS += $(MOZ_PYTHON_LIBS) ifeq ($(OS_ARCH), WINNT) EXTRA_LIBS += $(DIST)/lib/pyxpcom.lib @@ -92,7 +92,7 @@ endif install:: ifneq ($(OS_ARCH),WINNT) $(SYSINSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DISTDIR)$(pyexecdir)/xpcom - mv $(DISTDIR)$(pyexecdir)/xpcom/$(SHARED_LIBRARY) $(DISTDIR)$(pyexecdir)/xpcom/_xpcom$(PYTHON_DLL_SUFFIX) + mv $(DISTDIR)$(pyexecdir)/xpcom/$(SHARED_LIBRARY) $(DISTDIR)$(pyexecdir)/xpcom/_xpcom$(MOZ_PYTHON_DLL_SUFFIX) endif clobber:: diff --git a/mozilla/extensions/python/xpcom/test/Makefile.in b/mozilla/extensions/python/xpcom/test/Makefile.in index ac666eec6df..605d2294e37 100644 --- a/mozilla/extensions/python/xpcom/test/Makefile.in +++ b/mozilla/extensions/python/xpcom/test/Makefile.in @@ -49,4 +49,4 @@ include $(topsrcdir)/config/rules.mk check:: @echo "Running Python XPCOM tests" - @$(PYTHON)$(PYTHON_DEBUG_SUFFIX) $(srcdir)/regrtest.py + @$(MOZ_PYTHON)$(MOZ_PYTHON_DEBUG_SUFFIX) $(srcdir)/regrtest.py