fixes for the build on MSW and other tweaks and cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-11-18 08:05:50 +00:00
parent b9e74764ec
commit 5e4f2bfbff
4 changed files with 44 additions and 20 deletions

View File

@@ -8,7 +8,7 @@
#
# Created: 3-Nov-2010
# Copyright: (c) 2010 by Total Control Software
# Licence: wxWindows license
# License: wxWindows License
#----------------------------------------------------------------------
import sys
@@ -25,14 +25,27 @@ from distutils.spawn import spawn
runSilently = False
#----------------------------------------------------------------------
# Set some defaults based on the environment or platform
if os.environ.get('SIP'):
SIPdefault = os.environ.get('SIP')
elif os.name == 'nt':
SIPdefault = 'c:/projects/sip/sip/sipgen/sip.exe'
else:
SIPdefault = '/projects/sip/sip/sipgen/sip'
#----------------------------------------------------------------------
class Configuration(object):
USE_SIP = True
SIP = '/projects/sip/sip/sipgen/sip'
SIP = SIPdefault
SIPINC = 'sip/siplib' # Use our local copy of sip.h
SIPGEN = 'sip/gen' # Where the generated .zip files go
SIPGEN = 'sip/gen' # Where the generated .sip files go
SIPFILES = 'sip' # where to find other sip files for %Include or %Import
SIPOUT = 'sip/cpp' # where to put the generated C++ code
@@ -148,14 +161,14 @@ class Configuration(object):
self.VCDLL = 'vc_dll'
self.includes = ['include', 'src',
opj(WXDIR, 'lib', VCDLL, 'msw' + self.libFlag()),
opj(WXDIR, 'include'),
opj(WXDIR, 'contrib', 'include'),
opj(self.WXDIR, 'lib', self.VCDLL, 'msw' + self.libFlag()),
opj(self.WXDIR, 'include'),
opj(self.WXDIR, 'contrib', 'include'),
]
self.defines = [ ('WIN32', None),
('_WINDOWS', None),
(WXPLAT, None),
(self.WXPLAT, None),
('WXUSINGDLL', '1'),
('ISOLATION_AWARE_ENABLED', None),
('NDEBUG',), # using a 1-tuple makes it do an undef
@@ -166,9 +179,9 @@ class Configuration(object):
if self.MONOLITHIC:
self.libs += makeLibName('')
else:
self.libs += [ 'wxbase' + WXDLLVER + libFlag(),
'wxbase' + WXDLLVER + libFlag() + '_net',
'wxbase' + WXDLLVER + libFlag() + '_xml',
self.libs += [ 'wxbase' + self.WXDLLVER + self.libFlag(),
'wxbase' + self.WXDLLVER + self.libFlag() + '_net',
'wxbase' + self.WXDLLVER + self.libFlag() + '_xml',
self.makeLibName('core')[0],
self.makeLibName('adv')[0],
self.makeLibName('html')[0],
@@ -502,3 +515,15 @@ def msg(text):
def opj(*args):
path = os.path.join(*args)
return os.path.normpath(path)
def posixjoin(a, *p):
"""Join two or more pathname components, inserting sep as needed"""
path = a
for b in p:
if os.path.isabs(b):
path = b
elif path == '' or path[-1:] in '/\\:':
path = path + b
else:
path = path + '/' + b
return path

View File

@@ -7,7 +7,7 @@
#
# Created: 3-Nov-2010
# Copyright: (c) 2010 by Total Control Software
# Licence: wxWindows license
# License: wxWindows License
#----------------------------------------------------------------------
import sys
@@ -19,7 +19,7 @@ import distutils.command.install_headers
import distutils.command.clean
from distutils.dep_util import newer
from config import Config
from config import Config, posixjoin
@@ -324,7 +324,7 @@ class etgsip_build_ext(build_ext):
def etg2sip(self, etgfile):
cfg = Config()
sipfile = os.path.splitext(os.path.basename(etgfile))[0] + '.sip'
sipfile = os.path.join(cfg.SIPGEN, sipfile)
sipfile = posixjoin(cfg.SIPGEN, sipfile)
return sipfile
@@ -375,12 +375,15 @@ class etgsip_build_ext(build_ext):
def _sip_compile(self, sip_bin, source, sbf):
cfg = Config()
if not cfg.USE_SIP:
return
other_opts = []
base = os.path.basename(source)
if base.startswith('_'):
cfg = Config()
pycode = os.path.splitext(base[1:])[0] + '.py'
pycode = os.path.join(cfg.PKGDIR, pycode)
pycode = posixjoin(cfg.PKGDIR, pycode)
other_opts = ['-X', 'pycode:'+pycode]
self.spawn([sip_bin] + self.sip_opts +
other_opts +

View File

@@ -4,10 +4,6 @@
# Written by Giovanni Bajo <rasky at develer dot com>
# Based on Pyrex.Distutils, written by Graham Fawcett and Darrel Gallion.
# NOTE: This has been tweaked slightly to allow the folder used for the SIP
# output to be overridden in a derived class. It is otherwise the same as the
# module provided by sip. --Robin
import distutils.command.build_ext
from distutils.dep_util import newer, newer_group
import os

View File

@@ -7,7 +7,7 @@
#
# Created: 3-Nov-2010
# Copyright: (c) 2010 by Total Control Software
# Licence: wxWindows license
# License: wxWindows License
#----------------------------------------------------------------------