зеркало из https://github.com/mozilla/gecko-dev.git
Move PyXPCOM to the Mozilla build system on Windows.
Linux still uses ".stupid" makefile. Not part of the build.
This commit is contained in:
Родитель
b53b15bbee
Коммит
004d13cda3
|
@ -1,237 +0,0 @@
|
|||
# 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 the Python XPCOM language bindings.
|
||||
#
|
||||
# The Initial Developer of the Original Code is ActiveState Tool Corp.
|
||||
# Portions created by ActiveState Tool Corp. are Copyright (C) 2000, 2001
|
||||
# ActiveState Tool Corp. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Trent Mick <TrentM@ActiveState.com> (original author)
|
||||
# Mark Hammond <MarkH@ActiveState.com>
|
||||
#
|
||||
|
||||
# Dumb makefile to build PyXPCOM on Windows
|
||||
#
|
||||
# The build is by no means clean. I just kept shoving in compiler and linker
|
||||
# options until it worked. :)
|
||||
#
|
||||
# USAGE:
|
||||
# 1. edit top section as appropriate
|
||||
# 2. build, install, and test PyXPCOM
|
||||
# > nmake -f makefile.stupid.win
|
||||
# > nmake -f makefile.stupid.win install
|
||||
# > nmake -f makefile.stupid.win test
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# You must edit the variables in this section as appropriate for your machine
|
||||
# The most common edits will just be:
|
||||
# INSTALLDIR, and PYTHON_SRC
|
||||
# ========= START OF SECTION FOR COMMON EDITS ==============
|
||||
|
||||
# this will have an "xpcom" subdir on install
|
||||
INSTALLDIR=C:\Python20
|
||||
|
||||
# this is setup to use the *installed* Python directory structure
|
||||
PYTHON_SRC=C:\Python20
|
||||
|
||||
|
||||
# ========= END OF SECTION FOR COMMON EDITS ==============
|
||||
# We expect a "mozilla" directory under this
|
||||
MOZ_SRC=..\..\..\..\..
|
||||
|
||||
!IF DEFINED(DEBUG)
|
||||
MOZ_BUILD_DIR=$(MOZ_SRC)\mozilla\dist\WIN32_D.OBJ
|
||||
PYTHON_EXE=python_d.exe
|
||||
!ELSE
|
||||
MOZ_BUILD_DIR=$(MOZ_SRC)\mozilla\dist\WIN32_O.OBJ
|
||||
PYTHON_EXE=python.exe
|
||||
!ENDIF
|
||||
|
||||
MOZCOMPONENTSDIR=$(MOZ_BUILD_DIR)\bin\components
|
||||
MOZINCLUDES=/I$(MOZ_SRC)\mozilla\dist\include /I$(MOZ_BUILD_DIR)\include
|
||||
MOZLIBS=/LIBPATH:$(MOZ_BUILD_DIR)\lib
|
||||
|
||||
# this is setup to use the *installed* Python directory structure
|
||||
# - To use the development Python dir structure some changes are
|
||||
# necessary here *and* below (below, because there two lib dir
|
||||
# to include in LDFLAGS for the dev dir structure)
|
||||
PYTHONINCLUDES=/I$(PYTHON_SRC)\include /I$(PYTHON_SRC)\PC
|
||||
PYTHONLIBS=/LIBPATH:$(PYTHON_SRC)\libs /LIBPATH:$(PYTHON_SRC)\pcbuild
|
||||
|
||||
MOZ_BIN=$(MOZ_BUILD_DIR)\bin
|
||||
|
||||
XPIDL=$(MOZ_BIN)\xpidl.exe
|
||||
IDLINCLUDES=-I$(MOZ_SRC)\mozilla\dist\idl
|
||||
REGXPCOM=$(MOZ_BIN)\regxpcom.exe
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# You should not need to edit anything beyond this point.
|
||||
#
|
||||
|
||||
# the main PyXPCOM engine library
|
||||
!IF DEFINED(DEBUG)
|
||||
ENGINE=src\_xpcom_d.pyd
|
||||
# the PyXPCOM loader
|
||||
LOADER=src\loader\pyloader_d.dll
|
||||
!ELSE
|
||||
ENGINE=src\_xpcom.pyd
|
||||
# the PyXPCOM loader
|
||||
LOADER=src\loader\pyloader.dll
|
||||
!ENDIF
|
||||
|
||||
|
||||
all:: $(ENGINE) $(LOADER)
|
||||
|
||||
|
||||
#---- build the PyXPCOM loader
|
||||
|
||||
!IF DEFINED(DEBUG)
|
||||
LOADER_CFLAGS_THIS_BUILD=/ZI /MDd /Od /DDEBUG /D_DEBUG
|
||||
LOADER_LDFLAGS_THIS_BUILD=/debug
|
||||
!ELSE
|
||||
LOADER_CFLAGS_THIS_BUILD=/MD /Ox /DNDEBUG /D_NDEBUG
|
||||
LOADER_LDFLAGS_THIS_BUILD=
|
||||
!ENDIF
|
||||
|
||||
LOADER_CFLAGS=/W3 /D WIN32 /D _WINDOWS /D XPCOM_EXPORTS $(LOADER_CFLAGS_THIS_BUILD)
|
||||
LOADER_LDFLAGS=/dll $(LOADER_LDFLAGS_THIS_BUILD)
|
||||
|
||||
$(LOADER): src\loader\pyloader.cpp
|
||||
cl /nologo $(LOADER_CFLAGS) $(MOZINCLUDES) $(PYTHONINCLUDES) \
|
||||
/c src\loader\pyloader.cpp \
|
||||
/Fosrc\loader\pyloader.obj
|
||||
link $(LOADER_LDFLAGS) $(PYTHONLIBS) $(MOZLIBS) \
|
||||
/out:$(LOADER) \
|
||||
src\loader\pyloader.obj \
|
||||
xpcom.lib
|
||||
|
||||
|
||||
#---- build the PyXPCOM engine
|
||||
|
||||
!IF DEFINED(DEBUG)
|
||||
ENGINE_CFLAGS_THIS_BUILD=/ZI /MDd /Od /DDEBUG /D_DEBUG
|
||||
!ELSE
|
||||
ENGINE_CFLAGS_THIS_BUILD=/MD /Ox /DNDEBUG /D_NDEBUG
|
||||
!ENDIF
|
||||
|
||||
ENGINE_CFLAGS=/D _USRDLL /W3 /D WIN32 /D _WINDOWS /D XPCOM_EXPORTS $(ENGINE_CFLAGS_THIS_BUILD)
|
||||
|
||||
XPCOM_SRC_OBJECTS = \
|
||||
src\ErrorUtils.obj \
|
||||
src\PyGBase.obj \
|
||||
src\PyGModule.obj \
|
||||
src\PyGStub.obj \
|
||||
src\PyGInputStream.obj \
|
||||
src\PyGWeakReference.obj \
|
||||
src\PyIComponentManager.obj \
|
||||
src\PyIInputStream.obj \
|
||||
src\PyIEnumerator.obj \
|
||||
src\PyIID.obj \
|
||||
src\PyIInterfaceInfo.obj \
|
||||
src\PyIInterfaceInfoManager.obj \
|
||||
src\PyIServiceManager.obj \
|
||||
src\PyISimpleEnumerator.obj \
|
||||
src\PyISupports.obj \
|
||||
src\Pyxpt_info.obj \
|
||||
src\TypeObject.obj \
|
||||
src\VariantUtils.obj \
|
||||
src\dllmain.obj \
|
||||
src\xpcom.obj
|
||||
|
||||
.cpp.obj:
|
||||
cl /nologo $(ENGINE_CFLAGS) $(MOZINCLUDES) $(PYTHONINCLUDES) -c $< -Fo$@
|
||||
|
||||
!IF DEFINED(DEBUG)
|
||||
ENGINE_LDFLAGS_THIS_BUILD=/debug
|
||||
!ELSE
|
||||
ENGINE_LDFLAGS_THIS_BUILD=
|
||||
!ENDIF
|
||||
|
||||
#XXX for debug: ENGINE_LDFLAGS_DEBUG=/DEBUG
|
||||
ENGINE_LDFLAGS=/dll /export:init_xpcom $(ENGINE_LDFLAGS_THIS_BUILD)
|
||||
|
||||
$(ENGINE): $(XPCOM_SRC_OBJECTS)
|
||||
link $(ENGINE_LDFLAGS) $(XPCOM_SRC_OBJECTS) $(MOZLIBS) $(PYTHONLIBS) /out:$(ENGINE)
|
||||
|
||||
|
||||
#---- install PyXPCOM
|
||||
|
||||
XPCOM_PACKAGE_FILES = \
|
||||
__init__.py \
|
||||
components.py \
|
||||
file.py \
|
||||
nsError.py \
|
||||
register.py \
|
||||
xpcom_consts.py \
|
||||
xpt.py \
|
||||
client\__init__.py \
|
||||
server\__init__.py \
|
||||
server\enumerator.py \
|
||||
server\factory.py \
|
||||
server\loader.py \
|
||||
server\module.py \
|
||||
server\policy.py
|
||||
|
||||
# this is a cheasy install
|
||||
# - no attention to permissions
|
||||
# - doesn't explicitly use $(XPCOM_PACKAGE_FILES)
|
||||
install:: all $(XPCOM_PACKAGE_FILES)
|
||||
if not exist $(INSTALLDIR) mkdir $(INSTALLDIR)
|
||||
if not exist $(INSTALLDIR)\xpcom mkdir $(INSTALLDIR)\xpcom
|
||||
if not exist $(INSTALLDIR)\xpcom\client mkdir $(INSTALLDIR)\xpcom\client
|
||||
if not exist $(INSTALLDIR)\xpcom\server mkdir $(INSTALLDIR)\xpcom\server
|
||||
if not exist $(INSTALLDIR)\xpcom\test mkdir $(INSTALLDIR)\xpcom\test
|
||||
if not exist $(INSTALLDIR)\xpcom\test\output mkdir $(INSTALLDIR)\xpcom\test\output
|
||||
copy /v /y *.py $(INSTALLDIR)\xpcom
|
||||
copy /v /y client\*.py $(INSTALLDIR)\xpcom\client
|
||||
copy /v /y server\*.py $(INSTALLDIR)\xpcom\server
|
||||
copy /v /y test\*.py $(INSTALLDIR)\xpcom\test
|
||||
copy /v /y test\output\* $(INSTALLDIR)\xpcom\test\output
|
||||
copy /v /y $(ENGINE) $(INSTALLDIR)\xpcom
|
||||
if not exist $(MOZCOMPONENTSDIR) mkdir $(MOZCOMPONENTSDIR)
|
||||
copy /v /y $(LOADER) $(MOZCOMPONENTSDIR)
|
||||
set PYTHONPATH=$(INSTALLDIR);$(PYTHONPATH)
|
||||
set PATH=$(MOZ_BIN);$(PATH)
|
||||
$(REGXPCOM)
|
||||
|
||||
|
||||
#---- build and run the PyXPCOM test suite
|
||||
|
||||
all:: test\test_component\py_test_component.xpt
|
||||
|
||||
test\test_component\py_test_component.xpt: test\test_component\py_test_component.idl
|
||||
$(XPIDL) -m typelib -w $(IDLINCLUDES) -o test\test_component\py_test_component test\test_component\py_test_component.idl
|
||||
|
||||
install::
|
||||
if not exist $(MOZCOMPONENTSDIR) mkdir $(MOZCOMPONENTSDIR)
|
||||
copy /v /y test\test_component\py_test_component.xpt $(MOZCOMPONENTSDIR)
|
||||
copy /v /y test\test_component\py_test_component.py $(MOZCOMPONENTSDIR)
|
||||
set PYTHONPATH=$(INSTALLDIR);$(PYTHONPATH)
|
||||
set PATH=$(MOZ_BIN);$(PATH)
|
||||
$(REGXPCOM)
|
||||
|
||||
test:: install
|
||||
set PATH=$(MOZ_BIN);$(PATH)
|
||||
set PYTHONPATH=$(INSTALLDIR);$(PYTHONPATH)
|
||||
$(PYTHON_EXE) test\regrtest.py
|
||||
|
||||
runpython:: install
|
||||
set PATH=$(MOZ_BIN);$(PATH)
|
||||
set PYTHONPATH=$(INSTALLDIR);$(PYTHONPATH)
|
||||
$(PYTHON_EXE)
|
||||
|
||||
clean:
|
||||
-del /f /q src\*.obj
|
||||
-del /f /q src\loader\*.obj
|
||||
-del /f /q *.pyc
|
||||
-del /f /q client\*.pyc
|
||||
-del /f /q server\*.pyc
|
||||
-del /f /q test\*.pyc
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# 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 the Python XPCOM language bindings.
|
||||
#
|
||||
# The Initial Developer of the Original Code is ActiveState Tool Corp.
|
||||
# Portions created by ActiveState are Copyright (C) 2000 ActiveState.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Mark Hammond <MarkH@ActiveState.com>
|
||||
#
|
||||
|
||||
DEPTH =..\..\..
|
||||
|
||||
DIRS = \
|
||||
src \
|
||||
test/test_component \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) *.py $(DIST)\bin\python\xpcom
|
||||
$(MAKE_INSTALL) client\*.py $(DIST)\bin\python\xpcom\client
|
||||
$(MAKE_INSTALL) server\*.py $(DIST)\bin\python\xpcom\server
|
||||
$(MAKE_INSTALL) tools\*.py $(DIST)\bin\python\xpcom\server
|
||||
|
||||
clobber::
|
||||
rm -rf $(DIST)\bin\python\xpcom
|
||||
rm -f test\*.pyc test\*.pyo
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
#!nmake
|
||||
#
|
||||
#
|
||||
# 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 the Python XPCOM language bindings.
|
||||
#
|
||||
# The Initial Developer of the Original Code is ActiveState Tool Corp.
|
||||
# Portions created by ActiveState are Copyright (C) 2000 ActiveState.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Mark Hammond <MarkH@ActiveState.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
|
||||
LIBRARY_NAME=pyloader
|
||||
DLLNAME=pyloader
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\pyloader.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
CPPSRCS = \
|
||||
pyloader.cpp \
|
||||
$(NULL)
|
||||
|
||||
MODULE=pyloader
|
||||
EXPORTS= $(NULL)
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(NULL)
|
||||
|
||||
# Hack to get /LIBPATH down to the cmdline
|
||||
OS_LIBS=$(OS_LIBS) /libpath:$(PYTHON_SRC)/pcbuild /libpath:$(PYTHON_SRC)/lib
|
||||
|
||||
LINCS= /I$(PYTHON_SRC)\Include /I$(PYTHON_SRC)\PC \
|
||||
$(NULL)
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
#clobber::
|
||||
# echo write me
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components\.
|
|
@ -0,0 +1,107 @@
|
|||
#!nmake
|
||||
#
|
||||
#
|
||||
# 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 the Python XPCOM language bindings.
|
||||
#
|
||||
# The Initial Developer of the Original Code is ActiveState Tool Corp.
|
||||
# Portions created by ActiveState are Copyright (C) 2000 ActiveState.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Mark Hammond <MarkH@ActiveState.com>
|
||||
#
|
||||
|
||||
DIRS = \
|
||||
loader \
|
||||
$(NULL)
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
|
||||
LIBRARY_NAME=_xpcom
|
||||
DLLNAME=_xpcom
|
||||
!ifdef MOZ_DEBUG
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME)_d.pyd
|
||||
!else
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).pyd
|
||||
!endif
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\ErrorUtils.obj \
|
||||
.\$(OBJDIR)\PyGBase.obj \
|
||||
.\$(OBJDIR)\PyGModule.obj \
|
||||
.\$(OBJDIR)\PyGStub.obj \
|
||||
.\$(OBJDIR)\PyGInputStream.obj \
|
||||
.\$(OBJDIR)\PyGWeakReference.obj \
|
||||
.\$(OBJDIR)\PyIComponentManager.obj \
|
||||
.\$(OBJDIR)\PyIInputStream.obj \
|
||||
.\$(OBJDIR)\PyIEnumerator.obj \
|
||||
.\$(OBJDIR)\PyIID.obj \
|
||||
.\$(OBJDIR)\PyIInterfaceInfo.obj \
|
||||
.\$(OBJDIR)\PyIInterfaceInfoManager.obj \
|
||||
.\$(OBJDIR)\PyIServiceManager.obj \
|
||||
.\$(OBJDIR)\PyISimpleEnumerator.obj \
|
||||
.\$(OBJDIR)\PyISupports.obj \
|
||||
.\$(OBJDIR)\Pyxpt_info.obj \
|
||||
.\$(OBJDIR)\TypeObject.obj \
|
||||
.\$(OBJDIR)\VariantUtils.obj \
|
||||
.\$(OBJDIR)\dllmain.obj \
|
||||
.\$(OBJDIR)\xpcom.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
CPPSRCS = \
|
||||
ErrorUtils.cpp \
|
||||
PyGBase.cpp \
|
||||
PyGModule.cpp \
|
||||
PyGStub.cpp \
|
||||
PyGInputStream.cpp \
|
||||
PyGWeakReference.cpp \
|
||||
PyIComponentManager.cpp \
|
||||
PyIInputStream.cpp \
|
||||
PyIEnumerator.cpp \
|
||||
PyIID.cpp \
|
||||
PyIInterfaceInfo.cpp \
|
||||
PyIInterfaceInfoManager.cpp \
|
||||
PyIServiceManager.cpp \
|
||||
PyISimpleEnumerator.cpp \
|
||||
PyISupports.cpp \
|
||||
Pyxpt_info.cpp \
|
||||
TypeObject.cpp \
|
||||
VariantUtils.cpp \
|
||||
dllmain.cpp \
|
||||
xpcom.cpp \
|
||||
$(NULL)
|
||||
|
||||
MODULE=_xpcom
|
||||
EXPORTS= $(NULL)
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(NULL)
|
||||
|
||||
# Hack to get /LIBPATH down to the cmdline
|
||||
OS_LIBS=$(OS_LIBS) /libpath:$(PYTHON_SRC)/pcbuild /libpath:$(PYTHON_SRC)/lib
|
||||
|
||||
LINCS= /I$(PYTHON_SRC)\Include /I$(PYTHON_SRC)\PC \
|
||||
$(NULL)
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
#clobber::
|
||||
# echo write me
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\Python\xpcom\.
|
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# 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 the Python XPCOM language bindings.
|
||||
#
|
||||
# The Initial Developer of the Original Code is ActiveState Tool Corp.
|
||||
# Portions created by ActiveState are Copyright (C) 2000 ActiveState.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Mark Hammond <MarkH@ActiveState.com>
|
||||
#
|
||||
|
||||
DEPTH =..\..\..\..\..
|
||||
MODULE=py_test_component
|
||||
|
||||
################################################################################
|
||||
## exports
|
||||
|
||||
XPIDLSRCS = \
|
||||
py_test_component.idl \
|
||||
$(NULL)
|
||||
|
||||
################################################################################
|
||||
## library
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) ./py_test_component.py $(DIST)\bin\components
|
||||
|
||||
clobber::
|
||||
$(RM) py_test_component.xpt
|
||||
$(RM) $(DIST)\bin\components\py_test_component.py
|
||||
$(RM) $(DIST)\bin\components\py_test_component.xpt
|
Загрузка…
Ссылка в новой задаче