PDA

View Full Version : tutorial request. compiling for mac.



jeremyhardin
09-21-2005, 09:49 AM
Every time a plug-in comes out, I find myself and others asking for a mac compile. The author sometimes honors this request, and sometimes they ask Richard Brak or someone else to do it for them. The rest of the time it goes ignored alltogether.

How about someone with some experience compiling for mac or porting to mac from pc comes and writes a tutorial for all of us? It would be a great resource for developers, and it would probably get Richard Brak a few less emails.

I know I'd like to learn myself as well, but my experience is with Lscript.

Any takers on this one?

Lynx3d
09-21-2005, 05:48 PM
The problem is not that developers are to stupid to compile a Mac version, but that those tools are not available for free.
The obvious problem: you need a mac!
Apparently the option to cross-compile with CodeWarrior is now history too...
And even with a Mac the only alternative to CodeWarrior are some ancient tools called MPW, from what i know...

jeremyhardin
09-21-2005, 06:03 PM
The problem is not that developers are to stupid to compile a Mac version, but that those tools are not available for free.
The obvious problem: you need a mac!
Apparently the option to cross-compile with CodeWarrior is now history too...
And even with a Mac the only alternative to CodeWarrior are some ancient tools called MPW, from what i know...

Haha. Thanks Lynx. I completely understand that. But there are a few developers that just plain don't know how. Me personally, I learn on a per project basis. So it is entirely possible that I would learn only one way of doing something until a need arose to do it a different way.

Another reason for this is simple. If there were a tutorial online, the developers would all have to ask Richard Brak and the select few others to compile. I myself would do mac compiles for developers (as I do have a mac).

Making a tutorial is a needed (and appreciated) thing, even though the developers aren't "too stupid".

Lynx3d
09-22-2005, 07:41 AM
Hm yea you have a point there...perhaps there are some more people having the necessary tools available although they don't really use them.

But i'm really waiting for Lightwave to finally get ported to Xcode, because then you really can ask every mac user (you trust) to compile your code, and a tutorial would help there greatly.

blueagave
09-24-2005, 10:16 AM
Unless I missed something, until LW is built under Xcode, cross compiling with CodeWarrior should still work. I don't have CW, so I can't verify my statement, but I believe it's still true.

MPW is old, requires OS 9 (runs fine under Classic if you have it) and by todays standards is a painful tool. However, for compiling a LW plugin it works just fine. I use MinGW (windows gcc) on the PC and MPW on the Mac to build my plugins. For the most part, the same code compiles just fine for both. If anyone is really interested in building with MPW, I could probably put something together describing my process.

The switch to Xcode will definitely make plugin development much more pleasant on the Mac side.

Just another note re. cross platform, gcc can cross compile, so it should be entirely possible to compile a Windows LW plugin on a Mac. It would require installing a cross compling version of gcc on the Mac. Since my one PC is on it's last legs, I may give this a try myself shortly.

jeremyhardin
09-24-2005, 10:28 AM
If anyone is really interested in building with MPW, I could probably put something together describing my process.

definitely! thanks for that!

kfinla
09-24-2005, 08:55 PM
ya, i'd love to see some tutrials on using code warrior etc...

Lynx3d
09-25-2005, 02:50 AM
Actually the SDK has instructions for both, CodeWarrior and MPW...but apparently without pictures it doesn't get accepted by people ;)

blueagave
09-25-2005, 08:28 AM
Indeed, I just followed the SDK instructions for building with MPW.

A couple of tips for using MPW:

1) You can download it free here:
http://developer.apple.com/tools/mpw-tools/

You might need to sign up for an Apple dev id (free). Get the
MPW-GM.img.bin file from the MPW-GM_Images directory.
Unpack and mount the image, then drag the MPW-GM directory
to wherever you want it installed.

2) To Run MPW, run MPW-GM/MPW/MPW.Shell
MPW is an OS 9 program, so you either need a Mac with OS 9, or one
running Classic.

3) In MPW, use Directory->Set Directory to point MPW to the directory
where your source files are. I suggest having at least skeleton .c files
before starting the MPW process. In the next step, you'll tell MPW what
files are part of your project, and it's easier to have the files up front
than to try and add them later.

4) In MPW, use Build->Create Build Commands to get to the MPW make
file builder. This is where the SDK docs start in - telling MPW what
to build and how to build it. If you get the build commands wrong or
need to add more files, it is possible to hand edit the generated .make
file, but it's often easier to just do Create Build Commands over again.

5) Follow the instructions in the SDK docs, in the Compiling section for
Mac Programmers Workshop (MPW). Follow the instructions for building
server.lib (just once). Then follow the instructions for building a
plugin.

One trick I found when using MPW under Classic and OS 10.4, sometimes if I click outside the MPW window into an OSX application, when I go back to MPW it doesn't correctly focus again (buttons greyed out, etc.). The work around it to select Help->About Bubble Help, then just close the help popup window and MPW will have focus again.

AntonyScerri
02-24-2006, 06:23 AM
Hi

Im trying to get a version of my UVImaginator plugin out for the Mac. I have finally got some access to a Mac with Mac OS X 10.2.8 but im not sure what i can use to compile it with. I installed the Developers Tools which has gcc 3.1 but im struggling to work out if i can compile my plugin using that or not. I have read something about the binary format being different. Also the SDK docs say to build a shared library but with gcc 3.1 it doesnt support the -shared flag. I dont know if i can use MPW on this version of Mac OS X. Not knowing Macs very well im running round in circles trying to work out exactly what kind of library i need to build for LW. Also what different settings are needed for OS 9 and OS X versions of my plugin.

Can anyone help?

Thanks

Tony

eblu
02-24-2006, 07:12 AM
antony,
in a word: no. XCode (the devtools you downloaded) won't make a plugin LW can load.
the archaic and counterintuitive MPW is what you need. It runs under os 9 (classic) see above for examples and tutorials.

But... in theory, Newtek is "hard at work" making an Xcode version of Lightwave and when that happens, all of this will change. btw: no date has been given for that change.

jeremyhardin
02-24-2006, 08:39 AM
richard brak actually did do a tutorial on this:
http://www.richardbrak.net/plugins/cwonosx.html

AntonyScerri
02-24-2006, 12:36 PM
Thanks for the info, unfortunately the tutorial by Richard Brak is for code warrior. Regrding the dev tools i downloaded, i dont believe they are Xcode they were simply called Developer Tools 2002 CD. The main application being "Project Builder". I have managed to find and install MPW but it will not work properly from within classic complaining that my .c files are of an unknown type. If anyone knows how to fix that it would be great?

Thanks

Tony

jeremyhardin
02-24-2006, 12:38 PM
yeah i gave that link in case you went for CW.

Hardwater
02-24-2006, 04:39 PM
I can't add any info at all but would like to say thanks for all your efforts gentlemen. There are to many plugins that fill in the pot holes in LW that aren't mac ready.

Thanks Fellas!

AntonyScerri
02-24-2006, 05:51 PM
Well just like to let you know im making progress. I couldnt get MPW to work because all my files were created from within Mac OS X and therefore it seems didnt have any creator/type info set, and MPW wouldnt recognise the files as being text files. So im now having to find a way to convert them quicker. I found a freeware tool but it will only do 2 at a time unless i register it, so its slow progress. But I have made the necessary server.lib file so not much longer. If anyone would like to test uvimaginator on their Mac please let me know, i have no idea whether this will be Mac OS 9 or Mac OS X compatible at this point (I know people release two different versions so im not sure which i'll get), and its being built with LW SDK 6.5 but should work fine with that or later releases.

Thanks

Tony

jeremyhardin
02-24-2006, 06:01 PM
I'll give it a go whenever you're ready with it. :thumbsup:

AntonyScerri
02-25-2006, 04:57 AM
Thanks Jeremy, i'll PM you with details when im done. I ran into a problem early this morning 1am and gave up, but think ive figured that one out too so very nearly there. I hope....

AntonyScerri
04-26-2006, 10:56 AM
BTW I got UV Imaginator ported (posted on other groups and threads), but as a result i did right a little tutorial which may help some other people port their plugins.

I have now gone even further with my Mac adventure and successfuly got my plugin to copy to the clipboard for both windows and mac, which i hope to release soon. So even with the freebie MPW it can be done, it just takes a bit of fiddling which hopefully my tutorial takes the sting out of.

It can be found at - http://www.3dcybercorp.com/tutorials/lightwave.html

Thanks

Tony