Cocotron and Xcode 4

382 views
Skip to first unread message

TheMonkey

unread,
Feb 11, 2011, 1:11:43 PM2/11/11
to Cocotron Developers
Anyone have any success building Applications for Windows with Xcode
4? I have not been able to do so with the GM seed, specifically I ran
into a pthread-w32 issue. Any project setup voodoo that might help?

Christopher Lloyd

unread,
Feb 14, 2011, 9:27:38 AM2/14/11
to Cocotron Developers
Hi,

I haven't tried out 4 yet, could you post the part of the build log
with the error?

Thanks,
Chris


TheMonkey

unread,
Feb 18, 2011, 5:40:25 AM2/18/11
to Cocotron Developers
Unfortunately (or fortunately) I can't. I had to remove Xcode 4, as at
this point it's pretty unsuitable for getting actual work done, even
for vanilla mac/ios projects. Maybe the next build will be less sucky.

Robert

unread,
Mar 4, 2011, 3:29:17 PM3/4/11
to Cocotron Developers
Has anyone tried since? I am trying out Xcode 4 gm 2 but won't be
doing any cocotron-ish stuff for a couple weeks.. I thought I was
installing IN ADDITION TO Xcode 3 but that wasn't the case :) (Oops)

I do have all my cross-compilers present though. So I guess if those
are still there, everything should in theory work?

I'll post results as I see them

On Feb 18, 5:40 am, TheMonkey <dognot...@gmail.com> wrote:
> Unfortunately (or fortunately) I can't. I had to removeXcode4, as at
> this point it's pretty unsuitable for getting actual work done, even
> for vanilla mac/ios projects. Maybe the next build will be less sucky.
>
> On Feb 14, 3:27 pm, Christopher Lloyd <cjwll...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I haven't tried out4yet, could you post the part of the build log

Robert

unread,
Mar 11, 2011, 8:51:58 PM3/11/11
to Cocotron Developers
I am using the Xcode4 release and I'm trying to build the Cocotron for
FreeBSD. Things look pretty smooth, except I'm having a major issue:
how can I build WITHOUT APPKIT? I'm trying to cross-compile for
FreeBSD and Linux and it's failing on Onyx. I don't care about this
Onyx stuff (or AppKit)

So how do I either:

Compile everything except AppKit

or

Fix my Onyx issue?

I get an error that I don't have 'O2Context_distill.h' or
'O2PDFCharWidths.h'.. this is true. The Windows/i386/Frameworks/...
has many of these headers, I only have a couple here on my FreeBSD/
i386/Frameworks.. dir tree.

Robert

unread,
Mar 12, 2011, 8:32:08 AM3/12/11
to Cocotron Developers
I answered my own silly question, I can just pick the Foundation
project and build that. I was a little confused by Xcode 4

This is just to confirm that I got the Cocotron Foundation cross-
compiling and working on FreeBSD 8.2

I also did a lot of work to try to get the AppKit to compile as well.
I hit a lot of project issues before finally coming to a "halt" when
it required CoreVideo to get much farther.

I'll paste my notes in here for anyone that may care to address this.
I have no idea if it was a known limitation before Xcode 4 or not (I
assume yes). One bit of the process became a bit hard to debug; as
the build was insisting on using the regular non-cross ld and I could
never figure out why. There were also some (to me) esoteric settings

I've created a test app and everything seems to be working great on
the target, although I haven't done anything "heavy duty" or any real
full tests.

=====================================

To create the FreeBSD platform, pull all: cp -R /lib, /usr/lib, /usr/
local/lib/ and cp -R /usr/include, /usr/local/include/ - no editing of
libs were necessary or anything as on Linux. Put the platform in the
i386-pc-freebsd7 (freebsd7 is meaningless even though I was using 8.2)

Run the InstallCDT's sudo ./install.sh FreeBSD i386
Download cocotron: hg clone http://cocotron.googlecode.com/hg/
cocotron
Set up permissions correctly, sudo chown -R rcl /Developer/ (this
seemed to be Xcode4 thing.. I never had issues before)

Open Xcode
Open the cocotron/Cocotron/Cocotron.xcodeproj

Pick 'Scheme' as Foundation-FreeBSD-i386
Select Product -> Build
Now, Foundation is built successfully for FreeBSD.

(This 'scheme' thing was a bit confusing because it's different than
how things used to work in Xcode)



===============================

My AppKit attempt

Libs I think I need: (make sure when you build this you don't have
WITHOUT_X11=YES in your /etc/make.conf .. I know that sounds stupid
and obvious but it caused me a lot of grief.)

cd /usr/ports/print/freetype2 ; sudo make install clean
cd /usr/ports/graphics/libGL ; sudo make install clean
cd /usr/ports/X11/xlib ; sudo make install clean
cd /usr/ports/graphics/cairo ; sudo make install clean

Under the Onyx2D Project, for the Onyx2D-FreeBSD-i386 target, under
Linking -> Other Linker Flags -> Debug, --enable-auto-import is there.
Also remove --export-all-symbols from there. Also --out-implib ..
instead, just make it be -shared like it is for release. Then set
Perform Single-Object Prelink = YES (or else you get a -single_module
error on link)

Get up the AppKit FreeBSD project to use the correct compiler... and
for that project's "Header Search Path" it's wrong, it should point
to ..FreeBSD/i386/gcc-4.3.1/i386-pc-freebsd7/include insted of just
i386/include


Right before building, (or else Onyx2D won't link), move /Developer/
usr/bin/ld to /Developer/usr/bin/ld-real, then link ld to /Developer/
Coco../FreeBSD/../i386-...-ld (the cross ld)


Start building 'Cocoa' (or AppKit);

It will fail about O2_distill.h or such, on command line run:

cp /Developer/Cocotron/1.0/Windows/i386/Frameworks/Onyx2D.framework/
Versions/A/PrivateHeaders/O2Context_distill.h /Developer/Cocotron/1.0/
FreeBSD/i386/Frameworks/Onyx2D.framework/Versions/A/PrivateHeaders/
cp /Developer/Cocotron/1.0/Windows/i386/Frameworks/Onyx2D.framework/
Versions/A/PrivateHeaders/O2PDFCharWidths.h /Developer/Cocotron/1.0/
FreeBSD/i386/Frameworks/Onyx2D.framework/Versions/A/PrivateHeaders/

Continue building. It will fail..

cp /Developer/Cocotron/1.0/Windows/i386/Frameworks/
QuartzCore.framework/Versions/A/PrivateHeaders/CALayerContext.h /
Developer/Cocotron/1.0/FreeBSD/i386/Frameworks/QuartzCore.framework/
Versions/A/PrivateHeaders/
cp /Developer/Cocotron/1.0/Windows/i386/Frameworks/
CoreGraphics.framework/Versions/A/Headers/CGLPixelSurface.h /Developer/
Cocotron/1.0/FreeBSD/i386/Frameworks/CoreGraphics.framework/Versions/A/
Headers/

Eventually, you reach the issue with CoreVIdeo and O2Context_cairo.m

Hopefully this saves someone a huge amount of time that I wasted
messing with it :)


Robert
Reply all
Reply to author
Forward
0 new messages