diff --git a/wxPython/BUILD.unix.txt b/wxPython/BUILD.unix.txt index d9c37c3f95..61f9787955 100644 --- a/wxPython/BUILD.unix.txt +++ b/wxPython/BUILD.unix.txt @@ -39,7 +39,7 @@ Okay, now on the the fun stuff... A. First of all, check and see if you've already got glib/gtk+ on your system, all the Linux distributions I know of come with it, at - least as an option. Look for libglib* and libgtk* in your system's + least as an option. Look for libglib.* and libgtk.* in your system's standard library directories. You'll also need the headers and config scripts in order to build things that use glib/gtk. Try running gtk-config: @@ -120,7 +120,7 @@ D. If using the sources (either from the tarball or from CVS) then macro. You'll get some extra asserts, failure logging, etc. E. Now just compile and install. You need to use GNU make, so if your - system has something else get GNU make and build, install it and + system has something else get GNU make and build and install it and use it instead of your system's default make command. make @@ -147,7 +147,7 @@ A. You have the same options (and same advantages/disadvantages) for above) in the wxWindows/wxPython directory. B. As mentioned previouslly, wxPython is built with the standard - Python Distutils tool. If you are using Python 2.0c1 or later you + Python Distutils tool. If you are using Python 2.0 or later you are all set, otherwise you need to download and install Distutils 1.0 from http://www.python.org/sigs/distutils-sig/. @@ -193,10 +193,10 @@ C. Change to the root wxPython directory and look at the setup.py file. This is the script that configures and defines all the information that Distutils needs to build wxPython. There are some options near the begining of the script that you may want or need - to change based on what options you have selected up to this point, - (sources from tar.gz or from CVS, etc.) You can either change - these flags directly in setup.py or supply them on the - command-line. + to change based on your system and what options you have selected + up to this point, (sources from tar.gz or from CVS, etc.) You can + either change these flags directly in setup.py or supply them on + the command-line. BUILD_GLCANVAS Set to zero if you don't want to build the Open GL canvas extension module. If you don't @@ -215,18 +215,18 @@ C. Change to the root wxPython directory and look at the setup.py will be executed to regenerate the wrapper C++ and shadow python files. - IN_CVS_TREE If you using the CVS version of the wxWindows - and wxPython sources then you will need to set - this flag to non-zero. This is needed because - some source files from the wxWindows tree are - copied to be under the wxPython tree in order - to keep Distutils happy. With this flag set - then setup.py will automatically keep these - copied sources up to date if the original - version is ever updated. If you are using the - tar.gz version of the Python sources then these - copied sources are already present in your - source tree. + IN_CVS_TREE If you are using the CVS version of the + wxWindows and wxPython sources then you will + need to set this flag to non-zero. This is + needed because some source files from the + wxWindows tree are copied to be under the + wxPython tree in order to keep Distutils happy. + With this flag set then setup.py will + automatically keep these copied sources up to + date if the original version is ever updated. + If you are using the tar.gz version of the + Python sources then these copied sources are + already present in your source tree. D. To build and install wxPython you simply need to execute the diff --git a/wxPython/BUILD.win32.txt b/wxPython/BUILD.win32.txt index 638d5a4424..4944ecebe2 100644 --- a/wxPython/BUILD.win32.txt +++ b/wxPython/BUILD.win32.txt @@ -218,18 +218,18 @@ B. Change to the root wxPython directory and look at the setup.py will be executed to regenerate the wrapper C++ and shadow python files. - IN_CVS_TREE If you using the CVS version of the wxWindows - and wxPython sources then you will need to set - this flag to non-zero. This is needed because - some source files from the wxWindows tree are - copied to be under the wxPython tree in order - to keep Distutils happy. With this flag set - then setup.py will automatically keep these - copied sources up to date if the original - version is ever updated. If you are using the - tar.gz version of the Python sources then these - copied sources are already present in your - source tree. + IN_CVS_TREE If you are using the CVS version of the + wxWindows and wxPython sources then you will + need to set this flag to non-zero. This is + needed because some source files from the + wxWindows tree are copied to be under the + wxPython tree in order to keep Distutils happy. + With this flag set then setup.py will + automatically keep these copied sources up to + date if the original version is ever updated. + If you are using the tar.gz version of the + Python sources then these copied sources are + already present in your source tree. C. To build and install wxPython you simply need to execute the diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 3e9b6c22e5..dd3b035b06 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -38,6 +38,11 @@ Removed the old python sizers. Added __add__, __sub__ and __cmp__ (equality check only) for wxPoint and wxRealPoint. +Changed the build to make one big extension module instead of one for +the core and each contrib. This allowed me to do away with the +libwxPyHelpers.so on unix systems. + + New in 2.2.1 diff --git a/wxPython/contrib/glcanvas/stub.cpp b/wxPython/contrib/glcanvas/stub.cpp new file mode 100644 index 0000000000..b675bd21c0 --- /dev/null +++ b/wxPython/contrib/glcanvas/stub.cpp @@ -0,0 +1,24 @@ +/* Definitions for Windows/Unix exporting */ +#if defined(__WIN32__) +# if defined(_MSC_VER) +# define SWIGEXPORT(a) __declspec(dllexport) a +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +#endif + + + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) initglcanvasc() { +} + + diff --git a/wxPython/contrib/ogl/stub.cpp b/wxPython/contrib/ogl/stub.cpp new file mode 100644 index 0000000000..45305e77e1 --- /dev/null +++ b/wxPython/contrib/ogl/stub.cpp @@ -0,0 +1,24 @@ +/* Definitions for Windows/Unix exporting */ +#if defined(__WIN32__) +# if defined(_MSC_VER) +# define SWIGEXPORT(a) __declspec(dllexport) a +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +#endif + + + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) initoglc() { +} + + diff --git a/wxPython/contrib/stc/stub.cpp b/wxPython/contrib/stc/stub.cpp new file mode 100644 index 0000000000..d8fd4bba86 --- /dev/null +++ b/wxPython/contrib/stc/stub.cpp @@ -0,0 +1,24 @@ +/* Definitions for Windows/Unix exporting */ +#if defined(__WIN32__) +# if defined(_MSC_VER) +# define SWIGEXPORT(a) __declspec(dllexport) a +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +#endif + + + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) initstc_c() { +} + + diff --git a/wxPython/setup.cfg b/wxPython/setup.cfg index 15b138a783..a6ffda1465 100644 --- a/wxPython/setup.cfg +++ b/wxPython/setup.cfg @@ -11,4 +11,4 @@ release = 1 group = Development/Languages/Python packager = Robin Dunn vendor = wxPROs -doc_files = README.txt BUILD.txt CHANGES.txt licence/ +doc_files = README.txt BUILD.win32.txt BUILD.unix.txt CHANGES.txt licence/ diff --git a/wxPython/setup.py b/wxPython/setup.py index 90ed4dd59b..a618704da6 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -177,8 +177,7 @@ elif os.name == 'posix': os.popen('gtk-config --cflags', 'r').read()[:-1] cflags = string.split(cflags) - lflags = os.popen('wx-config --libs', 'r').read()[:-1] + ' ' + \ - os.popen('gtk-config --libs', 'r').read()[:-1] + lflags = os.popen('wx-config --libs', 'r').read()[:-1] lflags = string.split(lflags) @@ -228,7 +227,7 @@ else: rc_file = [] -ext = Extension('wxc', ['src/helpers.cpp', +wxext = ext = Extension('wxc', ['src/helpers.cpp', 'src/libpy.c', ] + rc_file + swig_sources, @@ -256,7 +255,9 @@ if os.name == 'nt': # Define the GLCanvas extension module #---------------------------------------------------------------------- -if BUILD_GLCANVAS: +if not BUILD_GLCANVAS: + wxext.sources = wxext.sources + ['contrib/glcanvas/stub.cpp'] +else: print 'Preparing GLCANVAS...' location = 'contrib/glcanvas' swig_files = ['glcanvas.i'] @@ -271,26 +272,18 @@ if BUILD_GLCANVAS: else: gl_libs = ['wx_gtk_gl', 'GL', 'GLU'] - ext = Extension('glcanvasc', - swig_sources, + wxext.sources = wxext.sources + swig_sources + wxext.libraries = wxext.libraries + gl_libs - include_dirs = includes, - define_macros = defines, - - library_dirs = libdirs, - libraries = libs + gl_libs, - - extra_compile_args = cflags, - extra_link_args = lflags, - ) - - wxpExtensions.append(ext) #---------------------------------------------------------------------- # Define the OGL extension module #---------------------------------------------------------------------- -if BUILD_OGL: + +if not BUILD_OGL: + wxext.sources = wxext.sources + ['contrib/ogl/stub.cpp'] +else: print 'Preparing OGL...' location = 'contrib/ogl' OGLLOC = location + '/contrib/src/ogl' @@ -307,38 +300,32 @@ if BUILD_OGL: contrib_copy_tree(WXDIR + '/contrib/include/wx/ogl', OGLINC+'/wx/ogl') contrib_copy_tree(WXDIR + '/contrib/src/ogl', OGLLOC) - ext = Extension('oglc', [location + '/oglhelpers.cpp', - '%s/basic.cpp' % OGLLOC, - '%s/bmpshape.cpp' % OGLLOC, - '%s/composit.cpp' % OGLLOC, - '%s/divided.cpp' % OGLLOC, - '%s/lines.cpp' % OGLLOC, - '%s/misc.cpp' % OGLLOC, - '%s/basic2.cpp' % OGLLOC, - '%s/canvas.cpp' % OGLLOC, - '%s/constrnt.cpp' % OGLLOC, - '%s/drawn.cpp' % OGLLOC, - '%s/mfutils.cpp' % OGLLOC, - '%s/ogldiag.cpp' % OGLLOC, - ] + swig_sources, + # add items to the core extension module definition + wxext.sources = wxext.sources + [location + '/oglhelpers.cpp', + '%s/basic.cpp' % OGLLOC, + '%s/bmpshape.cpp' % OGLLOC, + '%s/composit.cpp' % OGLLOC, + '%s/divided.cpp' % OGLLOC, + '%s/lines.cpp' % OGLLOC, + '%s/misc.cpp' % OGLLOC, + '%s/basic2.cpp' % OGLLOC, + '%s/canvas.cpp' % OGLLOC, + '%s/constrnt.cpp' % OGLLOC, + '%s/drawn.cpp' % OGLLOC, + '%s/mfutils.cpp' % OGLLOC, + '%s/ogldiag.cpp' % OGLLOC, + ] + swig_sources - include_dirs = [OGLINC] + includes, - define_macros = defines, - - library_dirs = libdirs, - libraries = libs, - - extra_compile_args = cflags, - extra_link_args = lflags, - ) - - wxpExtensions.append(ext) + wxext.include_dirs = wxext.include_dirs + [OGLINC] #---------------------------------------------------------------------- # Define the STC extension module #---------------------------------------------------------------------- -if BUILD_STC: + +if not BUILD_STC: + wxext.sources = wxext.sources + ['contrib/stc/stub.cpp'] +else: print 'Preparing STC...' location = 'contrib/stc' STCLOC = location + '/contrib/src/stc' @@ -361,19 +348,18 @@ if BUILD_STC: copy_file(location+'/stc.py', PKGDIR, update=1, verbose=1) # add some include dirs to the standard set - stc_includes = includes[:] - stc_includes.append('%s/scintilla/include' % STCLOC) - stc_includes.append('%s/scintilla/src' % STCLOC) - stc_includes.append(STCINC) + stc_includes = [ '%s/scintilla/include' % STCLOC, + '%s/scintilla/src' % STCLOC, + STCINC ] # and some macro definitions - stc_defines = defines[:] - stc_defines.append( ('__WX__', None) ) - stc_defines.append( ('SCI_LEXER', None) ) + stc_defines = [ ('__WX__', None), + ('SCI_LEXER', None) ] - ext = Extension('stc_c', - ['%s/scintilla/src/AutoComplete.cxx' % STCLOC, + # add items to the core extension module definition + wxext.sources = wxext.sources + [ + '%s/scintilla/src/AutoComplete.cxx' % STCLOC, '%s/scintilla/src/CallTip.cxx' % STCLOC, '%s/scintilla/src/CellBuffer.cxx' % STCLOC, '%s/scintilla/src/ContractionState.cxx' % STCLOC, @@ -403,19 +389,11 @@ if BUILD_STC: '%s/PlatWX.cpp' % STCLOC, '%s/ScintillaWX.cpp' % STCLOC, '%s/stc.cpp' % STCLOC, - ] + swig_sources, + ] + swig_sources - include_dirs = stc_includes, - define_macros = stc_defines, + wxext.include_dirs = wxext.include_dirs + stc_includes + wxext.define_macros = wxext.define_macros + stc_defines - library_dirs = libdirs, - libraries = libs, - - extra_compile_args = cflags, - extra_link_args = lflags, - ) - - wxpExtensions.append(ext) #---------------------------------------------------------------------- @@ -445,6 +423,9 @@ setup(name = PKGDIR, #---------------------------------------------------------------------- +#---------------------------------------------------------------------- +#---------------------------------------------------------------------- + # The pre-distutils binary distributions of wxPython included the demo # as a subdirectory of the package dir. This doesn't really make sense # for Linux/Unix platforms as it's not part of the package, and the user @@ -473,3 +454,173 @@ setup(name = PKGDIR, ## ) ## ], + + +#---------------------------------------------------------------------- +#---------------------------------------------------------------------- +#---------------------------------------------------------------------- + +# Originally I was building separate extension module .so's for the +# CORE and the various contribs. Because of shared library issues I've +# decided to combine things into one .so as implemented above, but as +# I'm still not entirely convinced that this is the right thing to do +# I will keep the old code around for a while, but commented out below. + +## if BUILD_GLCANVAS: +## print 'Preparing GLCANVAS...' +## location = 'contrib/glcanvas' +## swig_files = ['glcanvas.i'] + +## swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR, +## USE_SWIG, swig_force, swig_args) + +## gl_libs = [] +## if os.name == 'posix': +## if '-D__WXDEBUG__' in cflags: +## gl_libs = ['wx_gtkd_gl', 'GL', 'GLU'] +## else: +## gl_libs = ['wx_gtk_gl', 'GL', 'GLU'] + +## ext = Extension('glcanvasc', +## swig_sources, + +## include_dirs = includes, +## define_macros = defines, + +## library_dirs = libdirs, +## libraries = libs + gl_libs, + +## extra_compile_args = cflags, +## extra_link_args = lflags, +## ) + +## wxpExtensions.append(ext) + + + +## if BUILD_OGL: +## print 'Preparing OGL...' +## location = 'contrib/ogl' +## OGLLOC = location + '/contrib/src/ogl' +## OGLINC = location + '/contrib/include' + +## swig_files = ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i', +## 'oglcanvas.i'] + +## swig_sources = run_swig(swig_files, location, '', PKGDIR, +## USE_SWIG, swig_force, swig_args) + +## # make sure local copy of contrib files are up to date +## if IN_CVS_TREE: +## contrib_copy_tree(WXDIR + '/contrib/include/wx/ogl', OGLINC+'/wx/ogl') +## contrib_copy_tree(WXDIR + '/contrib/src/ogl', OGLLOC) + +## ext = Extension('oglc', [location + '/oglhelpers.cpp', +## '%s/basic.cpp' % OGLLOC, +## '%s/bmpshape.cpp' % OGLLOC, +## '%s/composit.cpp' % OGLLOC, +## '%s/divided.cpp' % OGLLOC, +## '%s/lines.cpp' % OGLLOC, +## '%s/misc.cpp' % OGLLOC, +## '%s/basic2.cpp' % OGLLOC, +## '%s/canvas.cpp' % OGLLOC, +## '%s/constrnt.cpp' % OGLLOC, +## '%s/drawn.cpp' % OGLLOC, +## '%s/mfutils.cpp' % OGLLOC, +## '%s/ogldiag.cpp' % OGLLOC, +## ] + swig_sources, + +## include_dirs = [OGLINC] + includes, +## define_macros = defines, + +## library_dirs = libdirs, +## libraries = libs, + +## extra_compile_args = cflags, +## extra_link_args = lflags, +## ) + +## wxpExtensions.append(ext) + + + +## if BUILD_STC: +## print 'Preparing STC...' +## location = 'contrib/stc' +## STCLOC = location + '/contrib/src/stc' +## STCINC = location + '/contrib/include' +## STC_H = location + '/contrib/include/wx/stc' + +## # make sure local copy of contrib files are up to date +## if IN_CVS_TREE: +## contrib_copy_tree(WXDIR + '/contrib/include/wx/stc', STCINC+'/wx/stc') +## contrib_copy_tree(WXDIR + '/contrib/src/stc', STCLOC) + + +## swig_files = ['stc_.i'] +## swig_sources = run_swig(swig_files, location, '', PKGDIR, +## USE_SWIG, swig_force, +## swig_args + ['-I'+STC_H, '-I'+location], +## [STC_H+'/stc.h']) + +## # copy a project specific py module to the main package dir +## copy_file(location+'/stc.py', PKGDIR, update=1, verbose=1) + +## # add some include dirs to the standard set +## stc_includes = includes[:] +## stc_includes.append('%s/scintilla/include' % STCLOC) +## stc_includes.append('%s/scintilla/src' % STCLOC) +## stc_includes.append(STCINC) + +## # and some macro definitions +## stc_defines = defines[:] +## stc_defines.append( ('__WX__', None) ) +## stc_defines.append( ('SCI_LEXER', None) ) + + +## ext = Extension('stc_c', +## ['%s/scintilla/src/AutoComplete.cxx' % STCLOC, +## '%s/scintilla/src/CallTip.cxx' % STCLOC, +## '%s/scintilla/src/CellBuffer.cxx' % STCLOC, +## '%s/scintilla/src/ContractionState.cxx' % STCLOC, +## '%s/scintilla/src/Document.cxx' % STCLOC, +## '%s/scintilla/src/Editor.cxx' % STCLOC, +## '%s/scintilla/src/Indicator.cxx' % STCLOC, +## '%s/scintilla/src/KeyMap.cxx' % STCLOC, +## '%s/scintilla/src/KeyWords.cxx' % STCLOC, +## '%s/scintilla/src/LineMarker.cxx' % STCLOC, +## '%s/scintilla/src/PropSet.cxx' % STCLOC, +## '%s/scintilla/src/ScintillaBase.cxx' % STCLOC, +## '%s/scintilla/src/Style.cxx' % STCLOC, +## '%s/scintilla/src/ViewStyle.cxx' % STCLOC, +## '%s/scintilla/src/LexCPP.cxx' % STCLOC, +## '%s/scintilla/src/LexHTML.cxx' % STCLOC, +## '%s/scintilla/src/LexLua.cxx' % STCLOC, +## '%s/scintilla/src/LexOthers.cxx' % STCLOC, +## '%s/scintilla/src/LexPerl.cxx' % STCLOC, +## '%s/scintilla/src/LexPython.cxx' % STCLOC, +## '%s/scintilla/src/LexSQL.cxx' % STCLOC, +## '%s/scintilla/src/LexVB.cxx' % STCLOC, +## '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC, +## '%s/scintilla/src/UniConversion.cxx' % STCLOC, +## '%s/scintilla/src/WindowAccessor.cxx' % STCLOC, +## '%s/scintilla/src/PosRegExp.cxx' % STCLOC, + +## '%s/PlatWX.cpp' % STCLOC, +## '%s/ScintillaWX.cpp' % STCLOC, +## '%s/stc.cpp' % STCLOC, +## ] + swig_sources, + +## include_dirs = stc_includes, +## define_macros = stc_defines, + +## library_dirs = libdirs, +## libraries = libs, + +## extra_compile_args = cflags, +## extra_link_args = lflags, +## ) + +## wxpExtensions.append(ext) + + diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp index fc04466509..6fb949b752 100644 --- a/wxPython/src/gtk/wx.cpp +++ b/wxPython/src/gtk/wx.cpp @@ -646,6 +646,10 @@ extern "C" SWIGEXPORT(void) inithtmlhelpc(); extern "C" SWIGEXPORT(void) initcalendarc(); extern "C" SWIGEXPORT(void) initstreamsc(); extern "C" SWIGEXPORT(void) initfilesysc(); + +extern "C" SWIGEXPORT(void) initglcanvasc(); +extern "C" SWIGEXPORT(void) initoglc(); +extern "C" SWIGEXPORT(void) initstc_c(); #ifdef __cplusplus extern "C" { #endif @@ -2903,6 +2907,10 @@ SWIGEXPORT(void) initwxc() { inithtmlc(); inithtmlhelpc(); initcalendarc(); + + initglcanvasc(); + initoglc(); + initstc_c(); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/wx.i b/wxPython/src/wx.i index fec9487911..27dbca27a0 100644 --- a/wxPython/src/wx.i +++ b/wxPython/src/wx.i @@ -148,6 +148,10 @@ extern "C" SWIGEXPORT(void) inithtmlhelpc(); extern "C" SWIGEXPORT(void) initcalendarc(); extern "C" SWIGEXPORT(void) initstreamsc(); extern "C" SWIGEXPORT(void) initfilesysc(); + +extern "C" SWIGEXPORT(void) initglcanvasc(); +extern "C" SWIGEXPORT(void) initoglc(); +extern "C" SWIGEXPORT(void) initstc_c(); %} @@ -185,6 +189,10 @@ extern "C" SWIGEXPORT(void) initfilesysc(); inithtmlc(); inithtmlhelpc(); initcalendarc(); + + initglcanvasc(); + initoglc(); + initstc_c(); %} //----------------------------------------------------------------------