Compiling wxMax (on OS X)

BlitzMax Forums/Brucey's Modules/Compiling wxMax (on OS X)

Winni(Posted 2008) [#1]
I --want-- to build the entire stuff myself from SVN.

I've checkout out wxMax from SVN and downloaded wxWidgets and built the libraries like this:

../configure --enable-unicode --disable-shared --with-opengl
make

Then I copied the lib directory to wxMax/lib and renamed it to macosx86 on my Intel box and macosxppc on my G4.

I also copied the header files to the wxMax directory.

When I now run bmk makemods -h -a, the following orgy of error messages starts:

Compiling:wxglue.cpp
In file included from /Applications/BlitzMax/mod/wx.mod/include/wx/defs.h:21,
                 from /Applications/BlitzMax/mod/wx.mod/include/wx/wx.h:15,
                 from /Applications/BlitzMax/mod/wx.mod/wx.mod/wxglue.h:26,
                 from /Applications/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp:23:
/Applications/BlitzMax/mod/wx.mod/include/wx/platform.h:196:22: error: wx/setup.h: No such file or directory
In file included from /Applications/BlitzMax/mod/wx.mod/include/wx/platform.h:293,
                 from /Applications/BlitzMax/mod/wx.mod/include/wx/defs.h:21,
                 from /Applications/BlitzMax/mod/wx.mod/include/wx/wx.h:15,
                 from /Applications/BlitzMax/mod/wx.mod/wx.mod/wxglue.h:26,
                 from /Applications/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp:23:
/Applications/BlitzMax/mod/wx.mod/include/wx/chkconf.h:103:9: error: #error "wxUSE_DYNLIB_CLASS must be defined."
/Applications/BlitzMax/mod/wx.mod/include/wx/chkconf.h:111:9: error: #error "wxUSE_EXCEPTIONS must be defined."
/Applications/BlitzMax/mod/wx.mod/include/wx/chkconf.h:119:9: error: #error "wxUSE_FILESYSTEM must be defined."

...and a TON more...



So... With what parameters/flags must I compile the wxWidgets libraries and what else is there to do to successfully compile wxMax?

Thanks in advance,


Winni(Posted 2008) [#2]
Ah... I have to copy lib/macosx86/wx/include/mac-unicode-release-static-2.8/wx/setup.h to wx.mod/include/wx.

It --seems-- to compile now.


Winni(Posted 2008) [#3]
Ok, it compiled, but now I am getting errors like this when I want to compile a wxMax sample application:

Building glcube
Compiling:glcube.bmx
Linking:glcube
ld: library not found for -lwxexpat-2.8
collect2: ld returned 1 exit status
Build Error: Failed to link /Applications/BlitzMax/mod/wx.mod/samples/glcube.app/Contents/MacOS/glcube
Process complete


I -did- re-configure wxWidgets with --enable-expat and the like, but still get this.

Any ideas anyone?


plash(Posted 2008) [#4]
Have you successfully (without threading) compiled/installed wxWidgets and wxMax previously?
Maybe it has issues with the experimental threaded GC?


Winni(Posted 2008) [#5]
I've compiled the modules both with bmk makemods -a and bmk makemods -h -a, so both the multi-threaded and the single-threaded versions are there.

To answer first questions, I've actually never managed to get an SVN-checkout of wxMax compiled. I don't know how Brucey does it, but only the pre-compiled packages actually work for me.

But I really want to learn how to build wxMax, and I also want to get it running on my PowerBook G4 for which no pre-compiled packages currently exist.


plash(Posted 2008) [#6]
That is beyond my understanding of Mac.. ;)


Winni(Posted 2008) [#7]
Is it a Mac issue? I have more the feeling that wxWidgets needs to be compiled with a rather specific configuration in order to work properly with wxMax, but that piece of documentation is missing - or at least I cannot find it anywhere.


Brucey(Posted 2008) [#8]
Allo ;-)

You probably want to do something like this :
./configure --enable-unicode --with-opengl --enable-mediactrl --enable-graphics_ctx --disable-shared --with-expat=builtin --with-libjpeg=builtin --with-libpng=builtin

...for the Mac build.
That should get you all the same things as I'm using for the release builds.

Once it's all built, you can get the static libs from the lib folder. You copy these into the the lib/macosXXX dir - where XXX is appropriately either ppc or x86.
Once that folder is copied, you need to modify the name of one of the embedded folders. It'll be called something like lib/macosx86/wx/include/mac-unicode-release-static-2.8
You need to remove the "-2.8" part.

The normal includes folder you can simply drop into wx.mod/include, so that it would look like wx.mod/include/wx

That should do it.

The "missing" docs are in wx.mod/wxWidgets_BuildNotes.txt
but.. I really need to revise those and add a better explanation, especially regarding the win32 build and the gdiplus requirements... (but they've been more for me, so I haven't worried about it too much til now).

Is that enough to get you going?


Brucey(Posted 2008) [#9]
Oh... apologies for the lack of ppc build... I was distracted in the run up to the weekend by porting box2d to objective-c... well, you know how it is :-p


Winni(Posted 2008) [#10]
Thanks a lot, Brucey! It now works!!!! This stuff is beautiful! :-))))

Only one note: When you check out wxMax from SVN, there does not seem to be a file wxWidgets_BuildNotes.txt. wxWidgets_licence.txt and wxWidgets_licendoc.txt are there, and a README.txt, but no build notes.

Again, thanks a lot!


Brucey(Posted 2008) [#11]
ah yes, it's in wx.mod/wx.mod

I suppose if I'm going to put together some proper (step-by-step) build docs, I can move it into the main dir.


Sorry it's a bit fiddly with all the folder renaming and stuff, but it's not something you are likely to need to do very often.
But it seems to work ;-)


Winni(Posted 2008) [#12]
Don't worry, it's all perfectly fine. If I had looked more thoroughly, I'd have found the documentation.

The thing is, I really like checking out stuff from SVN to build it from scratch. If you want to put it that way, it's also some kind of QA and testing and verifying that the code base still works. ;-)