User forums > Help

mac osx build failure

<< < (2/3) > >>

wmaxfield:

  If I run it from the command line, I get an error and then it quits.

  If someone can point me to a "debugging codeblocks on mac" site, I'll gladly read up and start looking at it.

  Who builds the mac version?  I'd like to find out what the final incantation is to get the executable.  mine doesn't run right.

wmaxfield:

  Sorry to answer my own question, but I did a google search.  some of the google searches are dead links.  I found this one that may be close to correct:
http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Mac_OS_X

afb:
The wiki is the latest information, it's correct but outdated (mentions 10.4 but not 10.5, and uses wxWidgets 2.6 instead of 2.8 ). The final step before assembling the bundle is install_name_tool. But that's only needed when running everything from inside the app bundle, if you do a regular install to a prefix then it only needs the directory structure of the bundle wrapper and the library/data can stay... This is how it is setup in the MacPorts port, the CodeBlocks.app there is just a symlink to the ${prefix}

Lis:
I use OSX 10.5
configured wxWidgets with:
./configure --prefix=/tmp/wxmac --enable-monolithic --enable-shared --enable-optimize --disable-universal_binary --enable-dynlib --enable-dynamicloader --enable-unicode --enable-threads --enable-gif --enable-pcx --enable-tga --enable-iff --enable-pnm --enable-xpm --with-mac --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-libxpm=builtin --with-opengl --with-regex=builtin --with-zlib=builtin --with-expat=builtin --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk --with-macosx-version-min=10.5

configured codeblocks with:
./configure --prefix=/tmp/codeblocks --with-platform=macosx --with-contrib-plugins=all --with-wx-prefix=/tmp/wxmac

I modified the 2 script who can be found here:
http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Mac_OS_X#Way_Two:_NeXT_.28bundle.29

They are used to create the real app bundle without the startscript.
First you execute codeBlocks_createAppDir.sh

--- Code: ---# Create the CodeBlocks.app bunde dir
mkdir ./CodeBlocks.app
mkdir ./CodeBlocks.app/Contents
cp CodeBlocks.Info.plist ./CodeBlocks.app/Contents/Info.plist
mkdir ./CodeBlocks.app/Contents/MacOS
cp CodeBlocks.sh ./CodeBlocks.app/Contents/MacOS/CodeBlocks
mkdir ./CodeBlocks.app/Contents/Resources
cp ./CodeBlocks.icns ./CodeBlocks.app/Contents/Resources/app.icns
#mkdir ./CodeBlocks.app/Contents/bin
#mkdir ./CodeBlocks.app/Contents/lib
#mkdir ./CodeBlocks.app/Contents/share/codeblocks/
cp -r /opt/codeblocks/share ./CodeBlocks.app/Contents/Resources

--- End code ---

Then you modify codeBlocks_createTrueApp.sh at the first 3 lines.
After you set your wxMac and CodeBlocks installation Prefix you
execute the script.

--- Code: ---#!/bin/sh
cbInstallPrefix="/tmp/codeblocks"
wxInstallPrefix="/tmp/wxmac"

# CodeBlocks copy
cp $cbInstallPrefix/bin/codeblocks ./CodeBlocks.app/Contents/MacOS/CodeBlocks
cp $cbInstallPrefix/bin/cb_share_config ./CodeBlocks.app/Contents/MacOS
cp $cbInstallPrefix/bin/cb_console_runner ./CodeBlocks.app/Contents/MacOS
cp $cbInstallPrefix/bin/codesnippets ./CodeBlocks.app/Contents/MacOS
cp $cbInstallPrefix/lib/* ./CodeBlocks.app/Contents/MacOS

# Wx copy
cp $wxInstallPrefix/lib/libwx* ./CodeBlocks.app/Contents/MacOS

install_name_tool -id @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/libcodeblocks.0.dylib
install_name_tool -id @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/libwx_macu-2.8.0.dylib
install_name_tool -id @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/libwxsmithlib.0.dylib

install_name_tool -change $cbInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/CodeBlocks
install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/CodeBlocks
install_name_tool -change $cbInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/CodeBlocks

install_name_tool -change $cbInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/codesnippets
install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/codesnippets
install_name_tool -change $cbInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/codesnippets

install_name_tool -change $cbInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_share_config
install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_share_config
install_name_tool -change $cbInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_share_config

install_name_tool -change $cbInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_console_runner
install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_console_runner
install_name_tool -change $cbInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/cb_console_runner

install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/libcodeblocks.0.dylib
install_name_tool -change $cbInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ./CodeBlocks.app/Contents/MacOS/libcodeblocks.0.dylib

install_name_tool -change $cbInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ./CodeBlocks.app/Contents/MacOS/libwxsmithlib.0.dylib
install_name_tool -change $cbInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ./CodeBlocks.app/Contents/MacOS/libwxsmithlib.0.dylib

cp -R $cbInstallPrefix/share/codeblocks/ ./CodeBlocks.app/Contents/Resources/share/codeblocks

for dotso in ./CodeBlocks.app/Contents/Resources/share/codeblocks/plugins/*.so
do
#echo $dotso
# install_name_tool -id $dotso ./libcodeblocks.0.dylib CodeBlocks
install_name_tool -change $wxInstallPrefix/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib $dotso
install_name_tool -change $wxInstallPrefix/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib $dotso
install_name_tool -change $wxInstallPrefix/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib $dotso
done

--- End code ---

However if i start the app bundle the application crashes.
The faszinating part is:
1. if I compile wxMac and replace the Apple delivered wxMac with my own compiled librarys the application does not crash but runs very slow.
2. If I use the Apple delivered wxMac for CodeBlocks the application also runs very slow.
3. The splashscreen does not change for about 30 seconds in booth cases.
4. If I switch to another application while CodeBlocks shows the spashscreen Codeblocks hangs completely.
5. I have the same problem with the released 8.02 CodeBlocks.

You can restore the original apple wxMac libs with pacifist. The libs are stored in the coreBSD.pkg Package on the OSX DVD.

Can someone help here? Beeing able to use CodeBlocks on OSX would be great.

Greets Louis.

[attachment deleted by admin]

Auria:
If all you want is to use it, can't you just use the pre-built binaries??

Anyway, the splash screen that hangs for an incredibly long time is a known issue, i don't know what can cause it. Once the splash screen is gone, it should run at approximately okay speed. (scintilla is still a little low on mac. I know the CodeLite author optimized wxScintilla for mac in his mac version of CodeLite - but some changes also spped it up on linux. it would help to import these changes, it's just a core decision i can't take)

I would suggest not to overwrite the Apple libs, nor play with /usr/lib in any way. Install your own wx to /usr/local, or, even better, don't install it and leave it in-place. Then adjust your PATH so that the correct wx-config is used.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version