X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/efc5f2246391dc536e5ace471af019bba8d6851b..6098c7f9533ba4fe22b04048e92c7ac0b9c0ebe7:/utils/wxPython/distrib/build.py diff --git a/utils/wxPython/distrib/build.py b/utils/wxPython/distrib/build.py index 6bd2fefaf7..7d8a913511 100755 --- a/utils/wxPython/distrib/build.py +++ b/utils/wxPython/distrib/build.py @@ -119,7 +119,7 @@ import sys, os, string, getopt # This is really the wxPython version number, and will be placed in the # Makefiles for use with the distribution related targets. -__version__ = '2.1b3' +__version__ = '2.1.14' #---------------------------------------------------------------------------- @@ -163,10 +163,10 @@ def main(args): runClean = runClean, runUninstall = runUninstall) + err = 0 if config.readConfigFiles(args): config.doFixups() config.makeMakefile() - err = 0 if config.runBuild: cmd = "%s -f %s" % (config.MAKE, config.MAKEFILE) @@ -189,6 +189,7 @@ def main(args): print "Running:", cmd err = os.system(cmd) + return err/256 #---------------------------------------------------------------------------- @@ -242,6 +243,8 @@ class BuildConfig: self.WXUSINGDLL = '1' self.OTHERDEP = '' self.WXPSRCDIR = '$(WXDIR)/utils/wxPython/src' + self.SWIGDEPS = '' + self.OTHERDEPS = '' if sys.platform == 'win32': @@ -260,6 +263,7 @@ class BuildConfig: self.OVERRIDEFLAGS = '/GX-' self.RMCMD = '-erase ' self.WXPSRCDIR = os.path.normpath(self.WXPSRCDIR) + self.CRTFLAG = '' else: @@ -273,11 +277,13 @@ class BuildConfig: self.HELPERLIB = 'wxPyHelpers' self.HELPERLIBDIR = '/usr/local/lib' self.CFLAGS = '-DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD) -I. '\ - '`wx-config --cflags` -I$(PYINCLUDE) -I$(EXECINCLUDE) '\ + '`$(WXCONFIG) --cflags` -I$(PYINCLUDE) -I$(EXECINCLUDE) '\ '-I$(WXPSRCDIR)' - self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`' + self.LFLAGS = '-L$(WXPSRCDIR) `$(WXCONFIG) --libs`' self.LIBS = '-l$(HELPERLIB)' self.RMCMD = '-rm -f ' + self.WXCONFIG = 'wx-config' + # **** What to do when I start supporting Motif, etc.??? self.GENCODEDIR = 'gtk' @@ -318,11 +324,15 @@ class BuildConfig: # 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' + self.CCC = os.popen('%(WXCONFIG)s --cxx' % self.__dict__, 'r').read()[:-1] + if not self.CCC: + print "Warning: C++ compiler not specified (CCC). Assuming c++" + self.CCC = 'c++' + if not self.CC: + self.CCC = os.popen('%(WXCONFIG)s --cc' % self.__dict__, 'r').read()[:-1] + if not self.CC: + print "Warning: C compiler not specified (CC). Assuming cc" + self.CC = 'cc' #------------------------------------------------------------ def findMFValue(self, mfText, st): @@ -351,14 +361,26 @@ class BuildConfig: # now build the text for the dependencies depends = "" for name in self.SWIGFILES: - text = '$(GENCODEDIR)/%s.cpp $(GENCODEDIR)/%s.py : %s.i\n' \ + rootname = os.path.splitext(name)[0] + text = '$(GENCODEDIR)/%s.cpp $(GENCODEDIR)/%s.py : %s.i %s\n' \ '$(TARGETDIR)\\%s.py : $(GENCODEDIR)\\%s.py\n' % \ - tuple([os.path.splitext(name)[0]] * 5) + (rootname, rootname, rootname, self.SWIGDEPS, rootname, rootname) depends = depends + text + if self.OTHERDEPS: + text = '%s%s : %s\n' % \ + (os.path.splitext(name)[0], self.OBJEXT, self.OTHERDEPS) + depends = depends + text for name in self.PYFILES: text = '$(TARGETDIR)\\%s.py : %s.py\n' % \ tuple([os.path.splitext(name)[0]] * 2) depends = depends + text + if self.OTHERDEPS: + for name in self.SOURCES: + name = os.path.basename(name) + text = '%s%s : %s\n' % \ + (os.path.splitext(name)[0], self.OBJEXT, self.OTHERDEPS) + depends = depends + text + self.DEPENDS = swapslash(depends) @@ -441,7 +463,7 @@ class BuildConfig: for st in args: pair = string.split(st, '=') name = pair[0] - value = pair[1] + value = string.join(pair[1:], '=') self.__dict__[name] = value except: print "Error parsing command-line: %s" % st @@ -512,6 +534,8 @@ EXTRAFLAGS = $(CFLAGS) %(OTHERCFLAGS)s LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s EXTRALIBS = %(LIBS)s %(OTHERLIBS)s +CRTFLAG=%(CRTFLAG)s + #---------------------------------------------------------------------- !include $(WXDIR)\\src\\makevc.env @@ -582,7 +606,7 @@ $(CPPFLAGS) /c $< $(TARGET) : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(RESFILE) $(link) @<< /out:$@ -$(LFLAGS) /def:$(MODULE).def /implib:./$(MODULE).lib +$(LFLAGS) /export:init$(MODULE) /implib:./$(MODULE).lib $(DUMMYOBJ) $(OBJECTS) $(RESFILE) $(LIBS) << @@ -656,7 +680,7 @@ GENCODEDIR = %(GENCODEDIR)s WXPSRCDIR = %(WXPSRCDIR)s HELPERLIB = %(HELPERLIB)s HELPERLIBDIR = %(HELPERLIBDIR)s - +WXCONFIG=%(WXCONFIG)s TARGETDIR = %(TARGETDIR)s @@ -706,12 +730,15 @@ uninstall: %(OTHERUNINSTALLTARGETS)s %%.o : $(GENCODEDIR)/%%.c $(CC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $< +ifndef NOSWIG $(GENCODEDIR)/%%.cpp : %%.i swig $(SWIGFLAGS) -c -o $@ $< $(GENCODEDIR)/%%.py : %%.i swig $(SWIGFLAGS) -c -o $(GENCODEDIR)/tmp_wrap.cpp $< rm $(GENCODEDIR)/tmp_wrap.cpp +endif + $(TARGETDIR)/%% : %% cp -f $< $@ @@ -736,7 +763,7 @@ pycfiles : $(PYMODULES) $(TARGETDIR) : - mkdir $(TARGETDIR) + mkdir -p $(TARGETDIR) $(GENCODEDIR): mkdir $(GENCODEDIR) @@ -754,7 +781,8 @@ $(GENCODEDIR): #---------------------------------------------------------------------------- if __name__ == '__main__': - main(sys.argv) + err = main(sys.argv) + sys.exit(err) #----------------------------------------------------------------------------