Author Topic: CB startup problem on Mac OSX  (Read 7341 times)

bnilsson

  • Guest
CB startup problem on Mac OSX
« on: August 20, 2006, 05:50:38 pm »
Hi!

Platform: Dual 2.3 GHz PowerMac G5, OSX10.4.7, 1GB DDR RAM, XCode Toolkit 2.4
I updated wxWidgets_WX_2_6_BRANCH by "cvs update" today.
I updated CB by "svn checkout svn://svn.berlios.de/codeblocks/trunk" today.

I configured, built and installed wxwidgets to /opt/local.
I bootstrapped CB (I use autotools from darwinports, and modified bootstrap by adding /opt/local/bin as explicit path to the autotools commands), configured, built and installed CB to /opt/local.
No errors, or I missed them. It all completed, anyway.

I added "setenv CODEBLOCKS_DATA_DIR /opt/local" to my .tcshrc.

I gave the command "codeblocks" in the terminal window.

Now the splash screen appears, and a message about Code-completion. I click on the Code-completion "OK" and the window disappears.

Then the Compilers auto-detection window shows up, saying
/***
GNU GCC Compiler  Detected
Intel C/C++ Compiler
SDCC Compiler
GNU GDC Compiler

Default Compiler: GNU GCC Compiler
**/

And there it hangs, and does not respond to any clicks.

Does anybody have any suggestions how to proceed?



Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: CB startup problem on Mac OSX
« Reply #1 on: August 20, 2006, 08:12:21 pm »

http://wxforum.shadonet.com/viewtopic.php?t=6045&highlight=


See below the section of Bundles

http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Mac_OS_X

Code
/Developer/Tools/SetFile -t APPL `pwd`/${1}
/developer/tools/Rez -d __DARWIN__ -t APPL Carbon.r -o `pwd`/${1}

« Last Edit: August 20, 2006, 08:15:00 pm by Pecan »

bnilsson

  • Guest
Re: CB startup problem on Mac OSX
« Reply #2 on: August 20, 2006, 09:30:49 pm »
Thanks, after some trial and error it more or less worked. Some comments:

1) The info in http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Mac_OS_X was very condensed and not entirely correct. It ommitted the fact that CodeBlocks.app/Contents/MacOS/ should contain CodeBlocks.sh renamed to CodeBlocks, or alternatively that Info.plist (which incidentally should be the renamed CodeBlocks.Info.plist, not mentioned either) should reference to CodeBlocks.sh instead of CodeBlocks (CFBundleExecutable = CodeBlocks -> CFBundleExecutable = CodeBlocks.sh).
Who will update the info on the wiki page?

2) The CodeBlocks main window starts with the window header hidden behind the MacOS desktop menu bar, probably placed at (0,0). It has to be zoom-ed to get out into the open. Where can we find the initial placement? It should be easy to fix by setting another init position for the windowm, suitable for the MacOS desktop.

3) The "Messages" field has a font so small that it is impossible to read. Whaere can this be changed?

Anyway, it is a good start, and I will now try to do something with it.

bnilsson

  • Guest
Re: CB startup problem on Mac OSX
« Reply #3 on: August 20, 2006, 09:39:35 pm »
About 3) Found the fonts settings all by myself, sorry about that.

bnilsson

  • Guest
Re: CB startup problem on Mac OSX
« Reply #4 on: August 20, 2006, 09:58:31 pm »
I made a new wxWidgets project by "New project" and it seems it has aproblem finding the "wx" headers.
It complains file-not-found on "#include <wx/wxprec.h>"
How do I set this?

The docs does not build with the Makefile supplied. There is no /opt/local/share/xsl/docbook.
make says
warning: failed to load external entity "/opt/local/share/xsl/docbook/html/chunk.xsl"
cannot parse /opt/local/share/xsl/docbook/html/chunk.xsl

Am I missing some utility?

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: CB startup problem on Mac OSX
« Reply #5 on: August 21, 2006, 01:50:11 am »
You need to have doxygen installed.  If you have Darwin Ports installed you should just be able to type "port install doxygen" at the command line and it will be downloaded and compiled.  This will bring in a ton of dependencies so don't worry if it install a bunch of extra stuff first.

Also if there is something wrong with the wiki, just updated it.  Thats the point :).  Make sure to include the versions of the autotools you used to build code::blocks.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: CB startup problem on Mac OSX
« Reply #6 on: August 23, 2006, 04:18:22 pm »
Who will update the info on the wiki page?

I have updated the Mac information on the Wiki page now.
The shell script workaround will not be in the final version.

"MacOS/CodeBlocks" should be the real application/exe, the stuff in
"lib" should go in Frameworks and "share/codeblocks" into Resources.

(this assumes converting wx and codeblocks to frameworks, and
teaching the main program to understand Mac args and bundling)

bnilsson

  • Guest
Re: CB startup problem on Mac OSX
« Reply #7 on: August 27, 2006, 06:29:08 pm »
Hi!

Platform: Dual 2.3 GHz PowerMac G5, OSX10.4.7, 1GB DDR RAM, XCode Toolkit 2.4

I am sorry to say, but the instructions on the wiki page did not work for me.

I installed autoconf-1.7, but skipped the section "Universal binaries" since I did not understand in which context it was supposed to be applied.

I followed your list of actions exactly:

[Tiger:OpenSource/CBtest/trunk] bnilsson% ./update_revision.sh
[Tiger:OpenSource/CBtest/trunk] bnilsson% glibtoolize --force --copy
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
[Tiger:OpenSource/CBtest/trunk] bnilsson% cat /usr/share/aclocal/libtool.m4 >> aclocal.m4
[Tiger:OpenSource/CBtest/trunk] bnilsson% autoheader
[Tiger:OpenSource/CBtest/trunk] bnilsson% automake-1.7 --include-deps --add-missing --foreign --copy
configure.in: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.in: You should verify that configure.in invokes AM_INIT_AUTOMAKE,
configure.in: that aclocal.m4 is present in the top-level directory,
configure.in: and that aclocal.m4 was recently regenerated (using aclocal).
src/plugins/Makefile.am:1: BUILD_ASTYLE does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:5: BUILD_AUTOSAVE does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:9: BUILD_CLASSWIZARD does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:13: BUILD_CODECOMPLETION does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:17: BUILD_COMPILER does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:21: BUILD_DEBUGGER does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:25: BUILD_MIMEHANDLER does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:29: BUILD_SCRIPTEDWIZARD does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:33: BUILD_TODO does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:37: BUILD_MANIFEST does not appear in AM_CONDITIONAL
src/plugins/Makefile.am:41: BUILD_CONTRIB does not appear in AM_CONDITIONAL
/usr/local/share/automake-1.7/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL
/usr/local/share/automake-1.7/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL
...
... and many more similar error messages. I can send you the complete list if you wish.
I did not continue from there.


On the other hand, what DOES work for me is to modify and use the supplied "bootstrap" file, referring to the autotools installed by DarwinPorts by explicit calls to /opt/local/bin/aclocal, /opt/local/bin/glibtoolize, etc. instead of the default ones, as I diecribed before.
bootstrap gives only some warnings:

[Tiger:OpenSource/CodeBlocks/trunk] bnilsson% ./bootstrap
/opt/local/share/aclocal/xmms.m4:17: warning: underquoted definition of XMMS_TEST_VERSION
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/opt/local/share/aclocal/xmms.m4:62: warning: underquoted definition of AM_PATH_XMMS
/opt/local/share/aclocal/smpeg.m4:13: warning: underquoted definition of AM_PATH_SMPEG
/opt/local/share/aclocal/libmikmod.m4:11: warning: underquoted definition of AM_PATH_LIBMIKMOD
/opt/local/share/aclocal/gtk.m4:7: warning: underquoted definition of AM_PATH_GTK
/opt/local/share/aclocal/glib.m4:8: warning: underquoted definition of AM_PATH_GLIB
/opt/local/share/aclocal/audiofile.m4:12: warning: underquoted definition of AM_PATH_AUDIOFILE

./configure then runs without problems.
Actually, I found it convenient to specify installation directly into the bundle:
./configure --prefix=$HOME/CodeBlocks.app/Contents
make and make install works without problems.

The wiki instructions on how to complete the bundle is now perfecly ok, thanks.



Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: CB startup problem on Mac OSX
« Reply #8 on: August 27, 2006, 09:35:24 pm »
I followed your list of actions exactly:

There seemed to be a call to "aclocal-1.7" missing from that list, to create aclocal.m4 ?
(which is probably why it worked better for the bootstrap script - that should be fixed...)

Quote
Actually, I found it convenient to specify installation directly into the bundle:
./configure --prefix=$HOME/CodeBlocks.app/Contents

Only problem here being that your $HOME ain't the same as my $HOME :-)
Xcode has a life-long problem with wanting to link to /Users/afb absolute...

Quote
The wiki instructions on how to complete the bundle is now perfecly ok, thanks.

I modified them a bit to clear things up, should make a Portfile for C::B too.

port install codeblocks

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: CB startup problem on Mac OSX
« Reply #9 on: August 28, 2006, 01:54:38 pm »
Quote
configure.in: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.in: You should verify that configure.in invokes AM_INIT_AUTOMAKE,
configure.in: that aclocal.m4 is present in the top-level directory,
configure.in: and that aclocal.m4 was recently regenerated (using aclocal).

A user in the past stated that he solved this problem by completly removing the old autotools from his system before doing the update.

I have not tried this though. I spent many days trying to get autotools to work, and failing, I just don't use them anymore.

« Last Edit: August 28, 2006, 01:59:49 pm by Pecan »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: CB startup problem on Mac OSX
« Reply #10 on: August 28, 2006, 02:08:15 pm »
I have a Portfile that should work for installing Code::Blocks
using DarwinPorts MacPorts, just waiting for this SVN patch:

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1395&group_id=5358

Without it, the plugins fail when linking with libcodeblocks.
("symbol" defined in indirectly referenced dynamic library)


It would be nice if bootstrap could learn about glibtoolize, too.
Currently using a workaround, for both of libtool and aclocal...

Code
pre-configure {
        reinplace "s|^libtoolize|glibtoolize|" \
                "${worksrcpath}/bootstrap"
        reinplace "s|aclocal$|aclocal -I ${prefix}/share/aclocal|" \
                "${worksrcpath}/bootstrap"
}

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: CB startup problem on Mac OSX
« Reply #11 on: August 29, 2006, 10:29:28 am »
I've posted a "C::B from SVN trunk" Portfile for DarwinPorts (with some instructions) on the Wiki:

http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Mac_OS_X

Code
port install codeblocks