#!/bin/sh
if [ ! -d ./Dependencies ]
then
mkdir Dependencies
mv wxMac-2.8.12.tar.gz ./Dependencies
fi
cd Dependencies
tar xvf wxMac-2.8.12.tar.gz
cd wxMac-2.8.12
# For Mac OS X 10.5 or older or with a 32-bit processor, build Carbon like this:
mkdir build-carbon-debug
cd build-carbon-debug
arch_flags="-arch i386"
../configure --enable-shared --enable-monolithic --enable-unicode --with-mac --with-opengl --with-png=builtin --with-jpeg=builtin --with-tiff=builtin --with-expat=builtin CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
make;
sudo make install
#!/bin/sh
if [ ! -d ./Source ]
then
mkdir Source
fi
cd Source
if [ ! -d ./trunk ]
then
# Checkout SVN
svn checkout svn://svn.berlios.de/codeblocks/trunk
cd trunk
else
# Update SVN
cd trunk
svn update
fi
cp ../../Dependencies/wxMac-2.8.12/wxwin.m4 .
echo -----------------------------------------------------------
echo "Please add the following to your trunk/configure.in file:"
echo
echo " - After the line m4_include([revision.m4]), add:"
echo " m4_include([wxwin.m4])"
echo
echo "Once you have added this, press any key to continue..."
read
# Add m4_include[wxwin.m4] to configure.in.
ACLOCAL_FLAGS="-I /usr/share/aclocal"
./bootstrap
arch_flags="-arch i386"
./configure --with-contrib-plugins=all --enable-shared --enable-monolithic --enable-unicode --with-mac --with-opengl --with-png=builtin --with-jpeg=builtin --with-tiff=builtin --with-expat=builtin CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
make
sudo make install
#!/bin/sh
echo ===== Making Bundle Directories =====
mkdir ./Output
cd Output
mkdir ./CodeBlocksSVN.app
mkdir ./CodeBlocksSVN.app/Contents
mkdir ./CodeBlocksSVN.app/Contents/MacOS
mkdir ./CodeBlocksSVN.app/Contents/Resources
mkdir ./CodeBlocksSVN.app/Contents/Resources/share
mkdir ./CodeBlocksSVN.app/Contents/Resources/share/codeblocks
mkdir ./CodeBlocksSVN.app/Contents/Resources/lib
mkdir ./CodeBlocksSVN.app/Contents/Resources/lib/codeblocks
mkdir ./CodeBlocksSVN.app/Contents/Resources/English.lproj
echo ===== Copying Built Files =====
cp /usr/local/bin/codeblocks ./CodeBlocksSVN.app/Contents/MacOS/CodeBlocks
cp /usr/local/bin/cb_share_config ./CodeBlocksSVN.app/Contents/MacOS
cp /usr/local/bin/cb_console_runner ./CodeBlocksSVN.app/Contents/MacOS
cp /usr/local/bin/codesnippets ./CodeBlocksSVN.app/Contents/MacOS
cp /usr/local/lib/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS
cp /usr/local/lib/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS
cp /usr/local/lib/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS
echo ===== Copying Resources From Source =====
# Most of this section has been copied from the Wiki:http://wiki.wxwidgets.org/WxMac_Issues#Building_a_MacOSX_application_bundle
# I don't know how much of it is necessary though.
#cp /Applications/CodeBlocks.app/Contents/Info.plist ./CodeBlocksSVN.app/Contents/
cp ../Source/trunk/codeblocks.plist ./CodeBlocksSVN.app/Contents/Info.plist
# cp version.plist YourApp.app/Contents/
# cp InfoPlist.strings YourApp.app/Contents/Resources/English.lproj/
# echo -n 'APPL????' > YourApp.app/Contents/PkgInfo
# cp YourApp YourApp.app/Contents/MacOS/YourApp
cp ../Source/trunk/src/src/resources/icons/* ./CodeBlocksSVN.app/Contents/Resources/
echo ===== Doing install_name_tool stuff =====
install_name_tool -id @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libcodeblocks.0.dylib
install_name_tool -id @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libwx_macu-2.8.0.dylib
install_name_tool -id @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libwxsmithlib.0.dylib
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/CodeBlocks
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/CodeBlocks
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/CodeBlocks
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/codesnippets
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/codesnippets
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/codesnippets
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_share_config
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_share_config
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_share_config
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_console_runner
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_console_runner
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/cb_console_runner
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libcodeblocks.0.dylib
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libcodeblocks.0.dylib
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libwxsmithlib.0.dylib
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocksSVN.app/Contents/MacOS/libwxsmithlib.0.dylib
echo ===== Finished install_name_tool stuff =====
cp -R /usr/local/share/codeblocks/ ./CodeBlocksSVN.app/Contents/Resources/share/codeblocks
cp -R /usr/local/lib/codeblocks/ ./CodeBlocksSVN.app/Contents/Resources/share/codeblocks
for dotso in ./CodeBlocksSVN.app/Contents/Resources/share/codeblocks/plugins/*.so
do
#echo $dotso
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib $dotso
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib $dotso
install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib $dotso
done
If you have any comments/suggestions for improvement, please let me know! I'm hoping to do a bit of development on Mac in the coming few months, so any advice is very welcome. :-)Well, I don't have a Mac and I cannot try, but thanks a bunch, that is definitely a good source for Mac'ers. :D
../include/wx/mac/carbon/private.h: In function ‘Rect* wxMacGetPictureBounds(Picture**, Rect*)’:
../include/wx/mac/carbon/private.h:1375: error: ‘QDGetPictureBounds’ was not declared in this scope
../include/wx/mac/carbon/private.h: At global scope:
../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type
../include/wx/mac/carbon/private.h:1488: error: ‘ClassicCursor’ does not name a type
make: *** [monodll_dynlib.o] Error 1
If you want to, you could also create an article in the WiKi with the same content, so that this doesn't get lost.
Nice contribution, but it fails compiling wxWidgets in Lion :(
The scripts aren't perfect, there are a couple of hacks:
- There is a pause in the building of C::B to add a line to the configure.in file for m4_include[wxwin.m4].
- Maybe this should be checked into Subversion?
- All the plugins are built and not all of them always compile properly.
- FileManager, NassiShneiderman and Hunspell all seem to be broken on mine, so you might have to comment some stuff out.
If you have any comments/suggestions for improvement, please let me know! I'm hoping to do a bit of development on Mac in the coming few months, so any advice is very welcome. :-)
I've uploaded a new "nightly": http://prdownload.berlios.de/codeblocks/CB_20110815_rev7385_mac2812.zipThat's great to hear!
I've uploaded a new "nightly": -Awesome, unfortunately it doesn't seem to run very well on my system. I don't really know much of codeblocks internals so I should probably not try to make a diagnosis. But the symptoms are pretty obvious codeblocks hangs shortly after loading a project. No cpu load and a bunch of threads with almost no cpu time, I think its some parsing related problem but thats just a guess. Must threads appears to be stuck on
Call graph:
2624 Thread_3628 DispatchQueue_1: com.apple.main-thread (serial)
2624 start
2624 _start
2624 main
2624 wxEntry(int&, wchar_t**)
2624 CodeBlocksApp::OnRun()
2624 wxAppBase::MainLoop()
2624 wxEventLoopManual::Run()
2624 wxEventLoop::Dispatch()
2624 wxApp::MacDoOneEvent()
2624 wxApp::MacHandleOneEvent(void*)
2624 SendEventToEventTarget
2624 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*)
2624 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*)
2624 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)
2624 SendEventToEventTarget
2624 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*)
2624 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*)
2624 wxMacTopLevelEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)
2624 wxMacTopLevelMouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)
2624 HandleControlClick
2624 HIView::ClickInternal(CGPoint const&, unsigned long, void (*)(OpaqueControlRef*, short), OpaqueEventRef*, bool)
2624 HIView::NotifyControlHit(OpaqueEventRef*, short, unsigned long)
2624 SendControlHit(HIView*, OpaqueEventRef*, short, unsigned long)
2624 SendEventToEventTarget
2624 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*)
2624 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*)
2624 wxMacToolBarToolEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)
2624 wxToolBarBase::OnLeftClick(int, bool)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxWindowBase::TryParent(wxEvent&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
[i]--- lots of ProcessEvent calls ---[/i]
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
2624 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
2624 MainFrame::DoOnFileOpen(bool)
2624 MainFrame::OnDropFiles(int, int, wxArrayString const&)
2624 MainFrame::OpenGeneric(wxString const&, bool)
2624 MainFrame::DoOpenProject(wxString const&, bool)
2624 ProjectManager::LoadProject(wxString const&, bool)
2624 ProjectManager::SetProject(cbProject*, bool)
2624 Manager::ProcessEvent(CodeBlocksEvent&)
2624 CodeCompletion::OnProjectActivated(CodeBlocksEvent&)
2624 NativeParser::CreateParser(cbProject*)
2624 ClassBrowser::UpdateView(bool)
2624 ClassBrowser::BuildTree()
2624 ClassBrowserBuilderThread::Init(NativeParser*, CBTreeCtrl*, CBTreeCtrl*, wxString const&, void*, BrowserOptions const&, TokensTree*, bool)
2624 wxMutexInternal::Lock()
2624 pthread_mutex_lock
2624 semaphore_wait_signal_trap
2624 Thread_3640 DispatchQueue_2: com.apple.libdispatch-manager (serial)
2624 start_wqthread
2624 _pthread_wqthread
2624 _dispatch_worker_thread2
2624 _dispatch_queue_invoke
2624 _dispatch_mgr_invoke
2624 kevent
2624 Thread_3643: com.apple.CFSocket.private
2624 thread_start
2624 _pthread_start
2624 __CFSocketManager
2624 select$DARWIN_EXTSN
2624 Thread_3650
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 BackgroundThread::Entry()
2624 wxSemaphore::Wait()
2624 wxSemaphoreInternal::WaitTimeout(unsigned long)
2624 MPWaitOnSemaphore
2624 semaphore_timedwait_trap
2624 Thread_3651
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 BackgroundThread::Entry()
2624 wxSemaphore::Wait()
2624 wxSemaphoreInternal::WaitTimeout(unsigned long)
2624 MPWaitOnSemaphore
2624 semaphore_timedwait_trap
2624 Thread_3652
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 BackgroundThread::Entry()
2624 wxSemaphore::Wait()
2624 wxSemaphoreInternal::WaitTimeout(unsigned long)
2624 MPWaitOnSemaphore
2624 semaphore_timedwait_trap
2624 Thread_3653
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 BackgroundThread::Entry()
2624 wxSemaphore::Wait()
2624 wxSemaphoreInternal::WaitTimeout(unsigned long)
2624 MPWaitOnSemaphore
2624 semaphore_timedwait_trap
2624 Thread_3674
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 ClassBrowserBuilderThread::Entry()
2624 ClassBrowserBuilderThread::BuildTree()
2624 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId)
2624 wxGenericTreeCtrl::CollapseAndReset(wxTreeItemId const&)
2624 wxGenericTreeCtrl::Collapse(wxTreeItemId const&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxWindowBase::TryParent(wxEvent&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxWindowBase::TryParent(wxEvent&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxWindowBase::TryParent(wxEvent&)
2624 wxEvtHandler::ProcessEvent(wxEvent&)
2624 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
2624 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
2624 ClassBrowser::OnTreeItemCollapsing(wxTreeEvent&)
2624 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId)
2624 wxMutexInternal::Lock()
2624 pthread_mutex_lock
2624 semaphore_wait_signal_trap
2624 Thread_3824
2624 thread_start
2624 _pthread_start
2624 PrivateMPEntryPoint
2624 wxThreadInternal::MacThreadStart(void*)
2624 cbThreadPool::cbWorkerThread::Entry()
2624 wxSemaphore::Wait()
2624 wxSemaphoreInternal::WaitTimeout(unsigned long)
2624 MPWaitOnSemaphore
2624 semaphore_timedwait_trap
Total number in stack (recursive counted multiple, when >=5):
58 wxEvtHandler::ProcessEvent(wxEvent&)
7 _pthread_start
7 thread_start
6 PrivateMPEntryPoint
6 wxThreadInternal::MacThreadStart(void*)
5 MPWaitOnSemaphore
5 semaphore_timedwait_trap
5 wxSemaphore::Wait()
5 wxSemaphoreInternal::WaitTimeout(unsigned long)
Sort by top of stack, same collapsed (when >= 5):
semaphore_timedwait_trap 13120
semaphore_wait_signal_trap 5248
kevent 2624
select$DARWIN_EXTSN 2624
I've uploaded a new "nightly": http://prdownload.berlios.de/codeblocks/CB_20110815_rev7385_mac2812.zipThat's great to hear!