Author Topic: C::B working on Intel MAC OS X, but requires Makefile changes  (Read 27833 times)

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
C::B working on Intel MAC OS X, but requires Makefile changes
« on: August 08, 2006, 10:03:53 am »
Hi all:

In order to compile C::B on Intel Macs, using native wx support (_WXMAC_), I did some changes:
- Patch the code for the problem with InfoWindow (attached file thanks to Pecan)
- Modify all plugins Makefiles changing the line "LDFLAGS="  by "LDFLAGS=`wx-config --libs`

I understand that the InfoWindow problem is due to limitations on wx, but I believe that (configure.in? Makefile.in?) must be changed in order to get a right link process.

Thx.


[attachment deleted by admin]

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #1 on: August 08, 2006, 04:00:18 pm »
If you have a set of steps that gets codeblocks compiling on Mac OS X with autotools, please post it on the wiki.  With the way things are going it looks like it might be possible to have some kind of preliminary Mac support in the next release.  I developing with wxWidgets on OS X is my day job, and could help working out the issues related to that platform but I don't have time to slog through autotools and get it compiling.

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #2 on: August 08, 2006, 05:09:56 pm »
Of course.
Once wxWidgets are compiled for mac, you can do next steps:
- Patch the code with the previous firmware
- Call bootstrap
- ./configure --enable-shared
- Add to LDLIBS "`wx-config --libs`"

I must to probe with LDFLAGS="`wx-config --libs`" ./configure

Is it enough?

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #3 on: August 08, 2006, 05:33:27 pm »
Where did you get the most up to date autotools versions?  Darwin ports?

EDIT: By firmware do you mean you have to downgrade the firmware you Mac, or do you mean apply the patch you have attached to your post above.  You apply the patch to the current SVN head correct?
« Last Edit: August 08, 2006, 05:39:20 pm by Game_Ender »

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #4 on: August 08, 2006, 05:43:18 pm »
Yes. I used DarwinPorts. I have also Fink, but some command line tools are updated on DarwinPorts.
Also I've used the wxWidgets version of Darwinports to compile CodeBlocks.

Have you more information about DarwinPorts? Can be used?
My C::B for OSX don't compile any project and it have a lot of problems in order to manage projects.
I'm compiling the debig version in order to test the check the program.


skyjunky

  • Guest
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #5 on: August 20, 2006, 02:51:11 am »
I've managed to get it to build (revision 2879)
The linking problem can be fixed by:

Index: configure.in
===================================================================
--- configure.in        (revision 2879)
+++ configure.in        (working copy)
@@ -77,7 +77,7 @@
 dnl            CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
 dnl            CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
 dnl            CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
-dnl            LIBS="$LIBS $WX_LIBS"
+LIBS="$LIBS $WX_LIBS"
 
 AC_SUBST(CPPFLAGS)
 AC_SUBST(CXXFLAGS)

I'm using autoconf 2.59 built from source.
glibtool 1.5.20 from darwin ports.
automake etc. 1.7.9 from source.
wxMac 2.6.3 built from source with --enable-unicode in addition to the other options in the build instructions.
gcc 4.01 (xcode 2.4 installed)

There are enough problems to make it unusable. The exception handlers do work well however.
If I find time I'll have a look at the code.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #6 on: August 22, 2006, 12:41:58 am »
Oops, saw the infowindow patch in this topic too late.

I posted a similar (but simpler) workaround patch to:
http://developer.berlios.de/patch/?func=detailpatch&patch_id=1376&group_id=5358

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #7 on: August 22, 2006, 09:41:41 am »
I've compiled it, and I have now a bundle application....that crashes too easily on my MBP.
We must to fix C::B on this platform.
Or we must to get a right build process, I don0t know.

Can anyone compile with C::B on Intel-Mac platform (x86 no PPC)?

Thx!!

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #8 on: August 22, 2006, 10:19:34 am »
Not that it's stable here either, but it usually succeeds in building at least.
The main things missing are plugins (AngelScript) and double-clicking etc.

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #9 on: August 22, 2006, 12:20:05 pm »
Then I have problems. Is it possible to send me your app bundle (compressed)?
I can use it as a base to compile C::B with C::B.

sethjackson

  • Guest
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #10 on: August 22, 2006, 06:21:05 pm »
Not that it's stable here either, but it usually succeeds in building at least.
The main things missing are plugins (AngelScript) and double-clicking etc.



AngelScript? Code::Blocks doesn't use that anymore...... :?

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #11 on: August 23, 2006, 12:25:33 am »
AngelScript? Code::Blocks doesn't use that anymore...... :?

Great. one less thing to worry about... :-)

Wonder what else happened since last time ?



Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #12 on: August 23, 2006, 12:26:23 am »
Then I have problems. Is it possible to send me your app bundle (compressed)?
I can use it as a base to compile C::B with C::B.

I have uploaded rev 2886 to BerliOS, was hoping to get it deployed ?

http://developer.berlios.de/project/showfiles.php?group_id=5358&release_id=9217

« Last Edit: August 23, 2006, 12:28:42 am by afb »

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #13 on: August 23, 2006, 12:33:34 am »
Sorry, but I didn't find the link.
Is the PPC executable? Revision 2411?
Please, post the right link!!!!
I want to probe it!!!!!!!!

ARGHHHHHHHHHHHHHHHH!

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #14 on: August 23, 2006, 12:49:33 am »
Please, post the right link!!!!
I want to probe it!!!!!!!!

I don't have release priviledges, so it's left in "incoming".
Will email you a temporary location in private, for now...

sethjackson

  • Guest
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #15 on: August 23, 2006, 01:03:02 am »
AngelScript? Code::Blocks doesn't use that anymore...... :?

Great. one less thing to worry about... :-)

Wonder what else happened since last time ?




Lots. :)
Anyways C::B uses Squirrel for scripting now anyways. :)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #16 on: August 23, 2006, 09:29:06 am »
Okay, hope it won't be another 6 months until I check in again :-)

(Hmm, still no RC3 ? I would have thought that to be out by now)

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #17 on: August 23, 2006, 01:10:28 pm »
Thanks. It works better than rev2411, but Rosetta is not working fine with this executable.
When I used it I can n ot create new projects, it can not open (right) created projects....It doesn't compile....
Am I the only one that it is trying to work with C::B on IntelMacs????
 :( :( :( :( :( :( :( :( :( :( :( :( :( :( :(

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #18 on: August 23, 2006, 01:26:29 pm »
I am currently using Mac OS X 10.3 on PPC still, since Tiger has been so buggy for me.

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #19 on: August 23, 2006, 01:35:49 pm »
Ops...I'm working on Tiger with IntelMac.
 :?

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #20 on: August 23, 2006, 01:40:58 pm »
Once I get the funds for a new Mac, I'll upgrade to Tiger and Intel as well...
Meanwhile I am running Fedora Core instead, which works just fine on Macs.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #21 on: August 23, 2006, 01:43:58 pm »
Thanks. It works better than rev2411, but Rosetta is not working fine with this executable.

I'll see if I can build a Universal Binary as well, that might work better for you.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #22 on: August 23, 2006, 02:34:07 pm »
Then I have problems. Is it possible to send me your app bundle (compressed)?
I can use it as a base to compile C::B with C::B.

I have uploaded rev 2886 to BerliOS, was hoping to get it deployed ?

http://developer.berlios.de/project/showfiles.php?group_id=5358&release_id=9217



Oops, sorry I missed it. It's in the Files section now. Thanks :).
Be patient!
This bug will be fixed soon...

Offline Paco.Blasco

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #23 on: August 23, 2006, 06:43:10 pm »
Thanks. It works better than rev2411, but Rosetta is not working fine with this executable.

I'll see if I can build a Universal Binary as well, that might work better for you.


It will be very good if you can build an Universal binary. At the moment, I have no too much solutions to get a C::B for my Mac. PPC version has a lot of problems (due to Rosetta I think), and Intel version is not compiling too much right (it is unusable).
Anyone can help us to create a check list to begin to solve all problems of C::B on Tiger/Intel?
It is complicated for anyone that has been never debug the C::B code.
I need a small help in order to begin to patch C::B.

Thx.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #24 on: August 23, 2006, 07:45:05 pm »
I don't see any real problems with an Universal Binary / on Intel,
just need to get it wrapped and then tested on a real Intel as well.

But I would also be interested in what kinds of problems people are
seeing, if they are specific to Intel or if they're more of generic Mac.

Offline Auria

  • Almost regular
  • **
  • Posts: 152
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #25 on: August 23, 2006, 09:06:54 pm »
I remember i had downloaded the previous version you posted (24 something?) i don't quite remember this version, but i think it was more functional than this one :? almost nothing reacts. 'new file' doesn't react, 'new project' doesn't either. trying to open various 'configure' options trigger no reaction either. So it  looks nice, but is yet impossible to use on its own...

However i was able to create a file in a third-part text-editor, then open it in code blocks and build. The text in the console and build messages is so small it's almost impossible to read

i'm on PPC, mac OS X 10.3.9 ( if i was just a little bit better at programming i could trying helping, but i'm not :( ) Well good job anyway keep trying i'll try helping if i can :lol

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #26 on: August 23, 2006, 10:51:58 pm »
I remember i had downloaded the previous version you posted (24 something?) i don't quite remember this version, but i think it was more functional than this one :? almost nothing reacts. 'new file' doesn't react, 'new project' doesn't either. trying to open various 'configure' options trigger no reaction either. So it  looks nice, but is yet impossible to use on its own...

Yeah, I'm trying to run it through the debugger here (in debug build) to see what I can find...

Just thought I'd upload, once I got it to build ;-)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #27 on: August 23, 2006, 11:42:55 pm »
The 2890 revision looks a whole lot better for project/file "Open"...
So I guess it was just one of those "nightly" / reorganization issues.

Or it was the zip files containing old (!) xrc files when doing a build,
and it got better when wiping all the old files out with a clean build.
« Last Edit: August 24, 2006, 12:04:21 pm by afb »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #28 on: August 24, 2006, 12:12:38 pm »
The LDFLAGS="`wx-config --libs`" ./configure workaround doesn't work for Universal builds, as it will pass the -isysroot /Developer/SDKs/MacOSX10.4u.sdk to GCC twice - making it cry and killing the build.

Will patch all the Makefile.am for the plugins instead.

The issue is that you can't link with libcodeblocks.dylib, without also linking with the wxWidgets libraries that it (indirectly) requires. A little Mac OS X quirk there...

Code
ld: object_file illegal reference to symbol: ***
defined in indirectly referenced dynamic library: ***

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #29 on: August 24, 2006, 09:56:13 pm »
'new file' doesn't react, 'new project' doesn't either. trying to open various 'configure' options trigger no reaction either. So it  looks nice, but is yet impossible to use on its own...

However i was able to create a file in a third-part text-editor, then open it in code blocks and build. The text in the console and build messages is so small it's almost impossible to read

These issues are fixed in the 2890 build, which should be available on BerliOS shortly.

Offline Auria

  • Almost regular
  • **
  • Posts: 152
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #30 on: August 24, 2006, 11:17:25 pm »
These issues are fixed in the 2890 build, which should be available on BerliOS shortly.

This one doesn't even open :(

This is what it prints when i run it via terminal:

can't open library: /usr/local/lib/libcodeblocks.0.dylib  (No such file or directory, errno = 2)
Trace/BPT trap

Though i have no experience with dylibs so i might have done something  dumb (or maybe the error message is meaningless)
« Last Edit: August 24, 2006, 11:20:05 pm by Auria »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #31 on: August 24, 2006, 11:30:52 pm »
It is supposed to be bundled with the application...
(CodeBlocks.app/Contents/lib/libcodeblocks.0.dylib)

It doesn't happen to be in a directory with spaces ?

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #32 on: August 24, 2006, 11:41:20 pm »
This one doesn't even open :(

This is what it prints when i run it via terminal:

By the way, what do you mean with "via terminal" ?
It is supposed to just be double-clicked in the Finder...

In the Terminal, you need to use "open CodeBlocks.app"

Offline Auria

  • Almost regular
  • **
  • Posts: 152
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #33 on: August 25, 2006, 01:41:18 am »
If i open it by double-clicking nothing happens. The icon briefly appears in the dock and goes away.

Forget the thing i wrote about the terminal is probably meaningless, i didn't think enough and the idea i had didn,t make sense. I was trying to get an error message but realised shortly after my very limiotd knowledge didn't allow me to make any assertion on what was wrong :)

in fact i just don't know why it doesn't work
« Last Edit: August 25, 2006, 02:34:11 am by Auria »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #34 on: August 25, 2006, 09:06:08 am »
Any messages from GUI apps should show in the system log,
which can be viewed using /Applications/Utilities/Console.app

I've duplicated a problem with the current script hack when run
in directories with spaces (missing quotes), and that'll be fixed.

Offline Auria

  • Almost regular
  • **
  • Posts: 152
Re: C::B working on Intel MAC OS X, but requires Makefile changes
« Reply #35 on: August 25, 2006, 08:47:10 pm »
Any messages from GUI apps should show in the system log,
which can be viewed using /Applications/Utilities/Console.app

I've duplicated a problem with the current script hack when run
in directories with spaces (missing quotes), and that'll be fixed.

That's it i moved it and it works

thanks