]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/distrib/build.py
check for strtok_r() using C++ compiler
[wxWidgets.git] / utils / wxPython / distrib / build.py
index d9f1df635889fe858e850d392924dd3177007753..7d8a913511c6ec2c2d99b52561ee87e565958e90 100755 (executable)
@@ -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.1.5'
+__version__ = '2.1.14'
 
 #----------------------------------------------------------------------------
 
@@ -189,7 +189,7 @@ def main(args):
             print "Running:", cmd
             err = os.system(cmd)
 
-    return err
+    return err/256
 
 
 #----------------------------------------------------------------------------
@@ -277,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'
@@ -322,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):
@@ -457,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
@@ -600,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)
 <<
@@ -674,7 +680,7 @@ GENCODEDIR = %(GENCODEDIR)s
 WXPSRCDIR = %(WXPSRCDIR)s
 HELPERLIB = %(HELPERLIB)s
 HELPERLIBDIR = %(HELPERLIBDIR)s
-
+WXCONFIG=%(WXCONFIG)s
 TARGETDIR = %(TARGETDIR)s
 
 
@@ -724,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 $< $@
@@ -754,7 +763,7 @@ pycfiles : $(PYMODULES)
 
 
 $(TARGETDIR) :
-       mkdir $(TARGETDIR)
+       mkdir -p $(TARGETDIR)
 
 $(GENCODEDIR):
        mkdir $(GENCODEDIR)
@@ -772,7 +781,8 @@ $(GENCODEDIR):
 #----------------------------------------------------------------------------
 
 if __name__ == '__main__':
-    main(sys.argv)
+    err = main(sys.argv)
+    sys.exit(err)
 
 #----------------------------------------------------------------------------