Mac OS X?

General FreeBASIC programming questions.
jeremy
Posts: 6
Joined: Oct 23, 2006 0:08

Mac OS X?

Postby jeremy » Oct 23, 2006 0:09

Will FreeBASIC compile on Mac OS X? How hard would it be to port?

Jeremy
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Oct 23, 2006 0:40

No. Very.

:P.

You probably need to either

1) be v1ctor
or
2) haven studied computer science

to make it happen, either method would take more time than anyone is willing to contribute, considering the ultimate plan is to become a frontend to gcc.
jeremy
Posts: 6
Joined: Oct 23, 2006 0:08

Postby jeremy » Oct 23, 2006 0:44

Hm, I figured that because Mac is now based off a Unice kernel and x86 processors now, has all the libs, etc... it wouldn't be that hard. Bummer.

Jeremy
v1ctor
Site Admin
Posts: 3799
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Postby v1ctor » Oct 23, 2006 3:41

The OSX/x86 port wouldn't be too hard, in the compiler you would have to create a new fbc_osx.bas and edit the fbc.bas and inc/fb.bi files.

The hardest part would be the runtime library if FreeBSD (used as base by Apple) isn't fully compatible with the rtlib Linux port (the rtlib/linux/*.c files). The gfxlib would be harder to port, if Cocoa and its Objetive-C dependency is involved.

Also, all configure.ac and makefile.in files in the /rtlib, /compiler and /gfxlib2 dirs would have to be updated and GNU autoreconf re-run.

The GNU binutils also would have to be copied to bin/osx and the crt*.o, libgcc.a, etc from GCC OSX/x86 distro to lib/osx.

The only problem is, nobody in the dev team has a Mac, so we can't do the port at the moment. Anybody willing to create the OSX/x86 port *AND* willing to maintain it (what's more important than the port itself as nobody else would have how to make releases, fix bugs, make updates, etc) would become a new member of the dev team in the next minute, getting money, girls and the good stuff in return.
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Oct 23, 2006 3:47

OSX does have an X11 server. But yeah, the hardest part is getting a Mac programmer interested...
jeremy
Posts: 6
Joined: Oct 23, 2006 0:08

Postby jeremy » Oct 23, 2006 14:50

Would you have to port the graphics part? I will play with FreeBASIC on my linux box for a bit. Write a few sample programs of things I do in every day life.

Basically, I am looking for a language that is compiled, more efficient on memory and processor usage than the scripting languages I normally use (Python, Ruby, PHP) but not as complex or dangerous as C.

I know C, but for some apps I just don't want to revert to it. To cumbersome.

Jeremy
jeremy
Posts: 6
Joined: Oct 23, 2006 0:08

Postby jeremy » Oct 23, 2006 19:36

Say I wanted to give it a shot, how would I even be able to work on it as there is no compiler on Mac OS X to begin work on it with, it's a self compiling compiler.

Jeremy
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Oct 23, 2006 19:48

Right. You'd have to program fbc on another platform first, and have it produce Mac code. FreeBASIC was originally written in VBDos, for 16-bit real mode DOS.

That means making sure the library that fbc depends on (rtlib) works on MacOS, and then making sure that it produces assembly that's compatible.
marcov
Posts: 2929
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Nov 02, 2006 9:49

OS X has a different calling convention than Linux. (e.g. handles by value types differently iirc). So unless e.g. GCC abstracts you enough from that, it will require both compiler as RTL work.

Still, the basic port (for FPC) was done relatively easily (2-5 days by experienced developer), but he started from an already abstracted Unix port, cleaned of Linuxisms because of FreeBSD.
marcov
Posts: 2929
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Nov 02, 2006 9:51

jeremy wrote:Say I wanted to give it a shot, how would I even be able to work on it as there is no compiler on Mac OS X to begin work on it with, it's a self compiling compiler.
Jeremy


Crosscompiling. E.g. compile on platform A for platform B.

However in general it is often easier for initial ports to generate assembler (text), and assemble and link on the target (B), to avoid mixing the normal linking probs and the specific cross- issues.

Specially in this case, since Mac OS X does not use GNU LD/AS, but an own linker and assembler (based on the NextStep one, which is based on ancient (1985-1990) BSD linkers, with own cmdline etc.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Nov 02, 2006 11:43

Since, new mac os runs on intel based machines, there are ways of installing osx on normal pc.

check this out:
http://en.wikipedia.org/wiki/OSx86
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Nov 02, 2006 12:04

Yes, but not legally and not reliably enough for coding.
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » Nov 02, 2006 12:10

Other then said "normal PC" *must* have SSE2 and it's preferable to have SSE3. This excludes anything predating the P4 and AthlonXP64/Opteron CPUs.

See here: http://en.wikipedia.org/wiki/SSE2
marcov
Posts: 2929
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Apr 16, 2010 13:47

Reading this back, I'm not sure if my earlier comment was correct.

IIRC the main gripe between AIX and SYSV Abi is that one skips an integer register for a floating point parameter, and one not.
jboadas
Posts: 3
Joined: Jul 13, 2011 18:37

Postby jboadas » Jul 13, 2011 19:01


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests