Added the beginnings of a new all-in-one build script like the build-wxpython.py in the wxPython folder. Made it command+options based instead of just options, and make it easy to extend with new commands.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-12-04 00:32:25 +00:00
parent a938e6a76f
commit bec66711ce
4 changed files with 422 additions and 16 deletions

View File

@@ -102,7 +102,7 @@ class Configuration(object):
# ---------------------------------------------------------------
# Basic initialization and configuration code
def __init__(self):
def __init__(self, noWxConfig=False):
self.CLEANUP = list()
# load the version numbers into this instance's namespace
@@ -148,6 +148,11 @@ class Configuration(object):
self.includes = ['sip/siplib', # to get our version of sip.h
'src', # for any hand-written headers
]
if noWxConfig:
# this is as far as we go
return
#---------------------------------------
# MSW specific settings
@@ -204,8 +209,8 @@ class Configuration(object):
# Uncomment these to have debug info for all kinds of builds
#self.cflags += ['/Od', '/Z7']
#self.lflags = ['/DEBUG', ]
#---------------------------------------
# Posix (wxGTK, wxMac or mingw32) settings
elif os.name == 'posix' or COMPILER == 'mingw32':
@@ -548,3 +553,10 @@ def loadETG(name):
execfile(name, ns.nsdict())
return ns
def etg2sip(etgfile):
cfg = Config()
sipfile = os.path.splitext(os.path.basename(etgfile))[0] + '.sip'
sipfile = posixjoin(cfg.SIPGEN, sipfile)
return sipfile

View File

@@ -19,7 +19,7 @@ import distutils.command.install_headers
import distutils.command.clean
from distutils.dep_util import newer, newer_group
from config import Config, posixjoin, loadETG
from config import Config, posixjoin, loadETG, etg2sip
@@ -318,15 +318,7 @@ class etgsip_build_ext(build_ext):
def _sip_output_dir(self):
cfg = Config()
return cfg.SIPOUT
def etg2sip(self, etgfile):
cfg = Config()
sipfile = os.path.splitext(os.path.basename(etgfile))[0] + '.sip'
sipfile = posixjoin(cfg.SIPGEN, sipfile)
return sipfile
return cfg.SIPOUT
def build_extension(self, extension):
"""
@@ -337,7 +329,7 @@ class etgsip_build_ext(build_ext):
if sources is not None and isinstance(sources, (list, tuple)):
etg_sources = [s for s in sources if s.startswith('etg/')]
for e in etg_sources:
extension.depends.append(self.etg2sip(e))
extension.depends.append(etg2sip(e))
# let the base class do the rest
return build_ext.build_extension(self, extension)
@@ -359,7 +351,7 @@ class etgsip_build_ext(build_ext):
other_sources = [s for s in sources if not s.startswith('etg/')]
for etg in etg_sources:
sipfile = self.etg2sip(etg)
sipfile = etg2sip(etg)
deps = [etg]
ns = loadETG(etg)