Dear all,
I got my Code::Blocks running on an iBook G4 with Mac OS X. Here are the steps I had done on my iBook.
Requirements:
wxWidgets: 2.6.1 (Mac version named wxMac-2.6.1, you can download it at:
http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.1.tar.gz )
Code::Blocks: tarball version 1.0-RC1-1 (You can download it at:
http://prdownloads.sourceforge.net/codeblocks/codeblocks-1.0-rc1-1.tar.gz?download )
XCode: 2.0 (You can download it at Apple Developer Corner)
1. Download & compiling wxWidgets 2.6.1
> Download wxMac-2.6.1.tar.gz and decompress it with:
tar xvfz wxMac-2.6.1.tar.gz
> Change to the wxMac-2.6.1 directory, make a sub-directory named build:
cd wxMac-2.6.1
mkdir build
> Run configurate script:
../configure --with-mac --with-opengl --enable-xrc --enable-monolithic
> Build wxMac libraries and install it with:
make
sudo make install
> Build the contribute library and install it:
cd contrib
make
sudo make install
with these steps, you will install wxMac libraries and header files into /usr/local.
2. Download & building Code::Blocks
> Download the tarball version of Code::Blocks from the website and decompress it with:
tar xvfz codeblocks-1.0-rc1.tar.gz
> Backup Makefile.unix.wx2.6 and then edit it as next steps;
> Insert variable defination at the beginning:
=================================BEGIN===============================
MAC_CXXFLAGS = -DWX_PRECOMP -DNO_GCC_PRAGMA -D_FILE_OFFSET_BITS=64 \
-D_LARGE_FILES `wx-config --cxxflags` \
-O2 -Wall -Wno-ctor-dtor-privacy -fno-common \
-fpascal-strings -I/Developer/Headers/FlatCarbon
MAC_LDFLAGS = `wx-config --libs` \
-framework QuickTime -framework IOKit -framework Carbon \
-framework Cocoa -framework System -framework WebKit \
-lz -lpthread -liconv
MACDLL_CXXFLAGS = -dynamic -fPIC
MACDLL_LDFLAGS = -dynamiclib -single_module -headerpad_max_install_names
==================================END================================
> Replace tinyXML_PROJECT_CFLAGS, src_PROJECT_CFLAGS, update_PROJECT_CFLAGS, doc_PROJECT_CFLAGS value with $(MAC_CXXFLAGS)
> Replace sdk_PROJECT_CFLAGS, plugin_?
_PROJECT_CFLAGS value with $(MAC_CXXFLAGS) $(MACDLL_CXXFLAGS)
> Replace tinyXML_PROJECT_LDFLAGS, src_PROJECT_LDFLAGS, update_PROJECT_LDFLAGS, doc_PROJECT_LDFLAGS value with $(MAC_LDFLAGS)
> Replace sdk_PROJECT_LDFLAGS, plugin_?
_PROJECT_LDFLAGS value with $(MAC_LDFLAGS) $(MACDLL_LDFLAGS)
> Append $(plugin_?
_PROJECT_LDFLAGS) to all plugin_?
_LDFLAGS variables (variable for ToDo and XPManifest plugin have already been appended)
> Replace all wx_gtk2_stc with wx_mac_stc
> Replace all .so with .dynalib
> Remove all -shared
> Insert line:
#include <wx/wx.h>
before all other header files in sdk/editmanager.cpp sdk/messagemanager.cpp sdk/newfromtemplatedlg.cpp sdk/projectmanager.cpp
> Insert line:
#include <wx/image.h>
behind line:
#include <wx/notebook.h>
in file src/app.cpp
> Open sdk/editorbase.cpp in an editor, comment line 93~94:
if (mypage != -1)
Manager::Get()->GetEditorManager()->GetNotebook()->SetPageText(mypage, newTitle);
NOTE: these two lines will cause crash!
> Now, you can make all with:
make -f Makefile.unix.wx2.6
> Convert update to unix format. You can use an editor (e.g. TextWrangler) to do the conversion. Open update in editor, replace all .so with .dylib, comment all 3 strip command line, then save it in unix format named update.unix .
> Run commands:
chmod +x update.unix
./update.unix
> Sun is rising,
. Let's do the final steps!
cd output
mkdir devel
mv libcodeblocks.dylib devel
`wx-config --rezflags` codeblocks.exe
./codeblock.exe
Aha, what do you find?
A modified version of Makefile and update are attached. You have to do the source modification by your self. Good luck! :lol:
Though Code::Blocks can run on Mac OS X now, it's useless with following bugs,
Windows layout is mixed up.
Plugins can not be recognized.
[attachment deleted by admin]