Build tool updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-08-24 19:53:40 +00:00
parent 0a98aa1a4d
commit f32bba383f
3 changed files with 20 additions and 24 deletions

View File

@@ -65,7 +65,7 @@ Configuration Files
separate namespace which is then used later as a configuration object. separate namespace which is then used later as a configuration object.
This keeps the build script simple in that it doesn't have to parse This keeps the build script simple in that it doesn't have to parse
anything, and the config files can be much more than just names and anything, and the config files can be much more than just names and
values as any pretty much any python code can be executed. The global values as pretty much any python code can be executed. The global
variables set in the config namespace are what are used later as variables set in the config namespace are what are used later as
configuation values. configuation values.
@@ -164,6 +164,7 @@ def main(args):
runUninstall = runUninstall) runUninstall = runUninstall)
if config.readConfigFiles(args): if config.readConfigFiles(args):
config.doFixups()
config.makeMakefile() config.makeMakefile()
err = 0 err = 0
@@ -209,18 +210,6 @@ def splitlines(st):
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
def strippath(st):
# remove any leading paths, retrieve only file name. Used while
# parsing the SOURCES file list, so that object files are local,
# while source may be anywere)
if sys.platform == 'win32':
sep = '\\'
else:
sep = '/'
return string.split(st,sep)[-1]
#----------------------------------------------------------------------------
class BuildConfig: class BuildConfig:
def __init__(self, **kw): def __init__(self, **kw):
self.__dict__.update(kw) self.__dict__.update(kw)
@@ -285,7 +274,7 @@ class BuildConfig:
self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`' self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`'
self.LIBS = '-l$(HELPERLIB)' self.LIBS = '-l$(HELPERLIB)'
# **** what to do when I start supporting Motif, etc.??? # **** What to do when I start supporting Motif, etc.???
self.GENCODEDIR = 'gtk' self.GENCODEDIR = 'gtk'
self.SWIGTOOLKITFLAG = '-D__WXGTK__' self.SWIGTOOLKITFLAG = '-D__WXGTK__'
@@ -299,13 +288,7 @@ class BuildConfig:
raise SystemExit, "Python development files not found" raise SystemExit, "Python development files not found"
self.CCC = self.findMFValue(mfText, 'CCC') self.CCC = self.findMFValue(mfText, 'CCC')
if not self.CCC:
print "Warning: C++ compiler not specified (CCC). Assuming c++"
self.CCC = 'c++'
self.CC = self.findMFValue(mfText, 'CC') self.CC = self.findMFValue(mfText, 'CC')
if not self.CC:
print "Warning: C compiler not specified (CCC). Assuming cc"
self.CC = 'cc'
self.OPT = self.findMFValue(mfText, 'OPT') self.OPT = self.findMFValue(mfText, 'OPT')
self.SO = self.findMFValue(mfText, 'SO') self.SO = self.findMFValue(mfText, 'SO')
self.LDSHARED = self.findMFValue(mfText, 'LDSHARED') self.LDSHARED = self.findMFValue(mfText, 'LDSHARED')
@@ -324,6 +307,18 @@ class BuildConfig:
' ') ' ')
#------------------------------------------------------------
def doFixups(self):
# This is called after the config files have been evaluated
# so we can do some sanity checking...
if sys.platform != 'win32':
if not self.CCC:
print "Warning: C++ compiler not specified (CCC). Assuming c++"
self.CCC = 'c++'
if not self.CC:
print "Warning: C compiler not specified (CC). Assuming cc"
self.CC = 'cc'
#------------------------------------------------------------ #------------------------------------------------------------
def findMFValue(self, mfText, st): def findMFValue(self, mfText, st):
# Find line begining with st= and return the value # Find line begining with st= and return the value
@@ -343,7 +338,7 @@ class BuildConfig:
for name in self.SWIGFILES: for name in self.SWIGFILES:
objects = objects + os.path.splitext(name)[0] + self.OBJEXT + ' ' objects = objects + os.path.splitext(name)[0] + self.OBJEXT + ' '
for name in self.SOURCES: for name in self.SOURCES:
obj = strippath(name) obj = os.path.basename(name)
objects = objects + os.path.splitext(obj)[0] + self.OBJEXT + ' ' objects = objects + os.path.splitext(obj)[0] + self.OBJEXT + ' '
self.OBJECTS = splitlines(objects) self.OBJECTS = splitlines(objects)

View File

@@ -4,6 +4,7 @@ import sys
MODULE = 'glcanvasc' MODULE = 'glcanvasc'
SWIGFILES = ['glcanvas.i', ] SWIGFILES = ['glcanvas.i', ]
OTHERCFLAGS = '-DWITH_GLCANVAS -I$(WXDIR)\utils\glcanvas\%s' % (GENCODEDIR,) OTHERCFLAGS = '-DWITH_GLCANVAS -I$(WXDIR)\utils\glcanvas\%s' % (GENCODEDIR,)
# Special action; for win32 we require you make the glcanvas lib. The # Special action; for win32 we require you make the glcanvas lib. The
# makefile will copy it to WXWIN\lib # makefile will copy it to WXWIN\lib
# Unix make system isn't so advanced, so we'll go looking for the source # Unix make system isn't so advanced, so we'll go looking for the source
@@ -12,7 +13,7 @@ if sys.platform == 'win32':
OTHERLIBS = '$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib' OTHERLIBS = '$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib'
else: else:
SOURCES = [GENCODEDIR+'/_glcanvas.cpp'] SOURCES = [GENCODEDIR+'/_glcanvas.cpp']
print "Warning: assuming MesaGL libraries. Modify build.cfg if you have native GL!" print "Warning: assuming MesaGL libraries. Override OTHERLIBS in build.local if you have native GL!"
OTHERLIBS = "-lMesaGL -lMesaGLU" OTHERLIBS = "-lMesaGL -lMesaGLU"
OTHERRULES = """ OTHERRULES = """
$(GENCODEDIR)/_glcanvas.cpp : $(GENCODEDIR)/_glcanvas.cpp :

View File

@@ -43,7 +43,7 @@ $(HELPERLIBDIR)/lib$(HELPERLIB)$(SO) : lib$(HELPERLIB)$(SO)
installLibDemo: installLibDemo:
@if [ "$(TARGETDIR)" != ".." ]; then \\ @if [ "$(TARGETDIR)" != ".." -a "$(TARGETDIR)" != "$(WXWIN)/utils/wxPython"]; then \\
mkdir $(TARGETDIR)/lib; \\ mkdir $(TARGETDIR)/lib; \\
mkdir $(TARGETDIR)/lib/sizers; \\ mkdir $(TARGETDIR)/lib/sizers; \\
mkdir $(TARGETDIR)/demo; \\ mkdir $(TARGETDIR)/demo; \\