Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mac port?
#11
Quote:I don't even read those threads - waste of time.

A wise choice, sir. I'm sure you'll be very pleased. And don't worry about the sleeves, they'll ride up with wear.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Reply
#12
I have a few questions and I wonder who knows the answers, cause I don't. I'm up to something here.

What type of C was gfxlib written in (GNU?)?

Is the assembly that fbc -r spits out compatible with the GNU assembler?

If the answers to both of these questions are yes then I think a Mac port may not be as painless as I originally thought. Here's my idea: I'll take the source code for the FB compiler and compile it with the -r argument. Then I'll take the assembly and run it through the UNIX version of GAS. Then I'll take the gfxlib source code and run it through a C compiler (there are lots of them for Mac so I can tweak the code a little to make it work.) Then I should have a FB compiler for OSX, right?

I'll probably be able to make an IDE for FB Mac pretty easily with XCode.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#13
The GNU C compiler is used to compile the graphics and runtime libraries. The assembly that fbc emits is intended for the GNU assembler, but it is of course x86-specific. If you have an Intel Mac, then it will work, but otherwise, you are out of luck. There's a little more work involved than just that if you want to port FB to a new platform, though. You'll need to implement all the platform-dependent pieces of the runtime and graphics libraries, write an ld script, add a fbc-(platform).bas to the compiler, and more. It's possible, but it's not painless. Smile
Reply
#14
Do you have a Intel or PowerPC based Mac? In the former case it shouldn't be too hard to port the Linux version of FB straight over since all the other tools you need besides FB should already have Mac ports. In the latter case you would need to rewrite the backend of FB to generate PowerPC code instead of Intel. This is a non-trivial task.
esus saves.... Passes to Moses, shoots, he scores!
Reply
#15
I have a PPC processor, but there is a GNU compiler for PPC, I know because I use it all the time. Some of the graphics may need to be rewritten for Mac, or I could probably convert the OpenGL library because the entire OSX interface is based around OpenGL. I'll look at how the universal binary work, somehow there are programs that run on both IBM and Intel processors. If I can't I might compiler one for IBM and one for Intel. I think I'll start on it when the stable release of .17 is done.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#16
If you want FreeBASIC to produce code for a PPC processor (regardless of operating system), you would need to write a PPC emitter for FreeBASIC. This is probably a fruitless task, since FreeBASIC is being converted to a gcc frontend, and there are gcc backends for nearly every architecture known to man, including PPC.
Reply
#17
Listen to DrV. Unless you know a lot about how compilers work and the PowerPC architecture then you are not going to be able to write a PPC backend for FreeBasic. It is not simply a matter of running the code produced by FB through a PPC assembler, it will not work.

Like DrV said, your best bet is to wait for the gcc move to be finished. Not only will that allow FB to compile to every system that gcc can, but it will also allow you to use all of the optimisations provided by gcc.
esus saves.... Passes to Moses, shoots, he scores!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)