CLEANUP.append('wx/__version__.py')
+#----------------------------------------------------------------------
+# Write the SWIG version to a header file
+#----------------------------------------------------------------------
+
+if USE_SWIG:
+ try:
+ # It may come on either stdout or stderr, depending on the
+ # version, so read both.
+ i, o, e = os.popen3(SWIG + ' -version', 't')
+ stext = o.read() + e.read()
+ import re
+ match = re.search(r'[0-9]+\.[0-9]+\.[0-9]+$', stext, re.MULTILINE)
+ if not match:
+ raise 'NotFound'
+ SVER = match.group(0)
+ open('include/wx/wxPython/swigver.h', 'w').write('''\
+// This file was generated by setup.py
+
+#define wxPy_SWIG_VERSION "SWIG-%s"
+''' % SVER)
+ msg('Using SWIG-' + SVER)
+
+ except:
+ msg('\nUnable to get SWIG version number\n')
+
+
#----------------------------------------------------------------------
# patch distutils if it can't cope with the "classifiers" or
# "download_url" keywords
#include <Python.h>
#include "wx/wxPython/wxPython_int.h"
#include "wx/wxPython/pyistream.h"
+#include "wx/wxPython/swigver.h"
#ifdef __WXMSW__
#include <wx/msw/private.h>
#include <gdk/gdkprivate.h>
#include <wx/gtk/win_gtk.h>
#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
- GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
- GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+ GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
+ GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
#include <locale.h>
#endif
#else
_AddInfoString("wx-assertions-off");
#endif
-
+ _AddInfoString(wxPy_SWIG_VERSION);
+
#undef _AddInfoString
PyObject* PlatInfoTuple = PyList_AsTuple(PlatInfo);