Mac FB?

For other topics related to the FreeBASIC project or its community.
Eponasoft
Posts: 264
Joined: Jul 26, 2007 2:40

Postby Eponasoft » Oct 28, 2009 0:35

FreeBSD, sh (user) and csh (root). So it's not too far removed from OS X. Some Linux distros come with bash as default though.
marcov
Posts: 3074
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Oct 28, 2009 9:54

Note also that under FreeBSD bash is typically not in /bin but in /usr/local/bin

The correct (POSIX) way for the first line of a script is therefore

#!/usr/bin/env bash

and not

#!/bin/bash
Oz
Posts: 585
Joined: Jul 02, 2005 14:21
Location: Waterloo, Ontario, Canada
Contact:

Postby Oz » Dec 21, 2009 19:17

I don't think the problem is as much how close it is to Linux, but really deals with the graphical back-end. Quartz (or whatever system Mac has these days) is very different from WinAPI and Xorg stuff, and as previously mentioned, none of the *devs* have a Mac. It is all well and good if members of the forum have macs, but it would be a huge waste of time for them to write code, send it, get feedback, debug, send again, feedback again, etc.

One thing we should be asking is: what do we build on, intel or mac processor? It looks like mac is moving most of their newer stuff onto intel, which may be good for translating the code, and may not be.

A good approach would be, if you have a decent knowledge of C, to svn FreeBASIC's source code, and without editing, from it through X-Code (is that still what Mac uses?). What sort of dependencies does it ask for? Are they available to Macs? Another step would be finding another open source language that supports windows, mac and linux. What sort of dependencies does it rely on? Is there any code that can be gleaned from it?

None of this is just an over night fun time. It would take a lot of time and effort, which I know I don't have, and I wouldn't blame the devs if they don't have that sort of time either. Not to say there is no hope, but if any members of the community can contribute, make sure you personally get in touch with the devs and get things rolling.

Anywho, I'll leave things at that.
Merry Christmas, my fellow FreeBASIC programmers,
-Alex
Mentat
Posts: 332
Joined: Oct 27, 2007 15:23
Location: NC, US
Contact:

Postby Mentat » Dec 21, 2009 23:26

Playing around with that time machine too much, eh? :P

Apple has moved to Intel a while ago. No need to worry about PPC.
And I wouldn't refer to the current FB development team as plural. We just have one person at the moment, and I don't think there's anything big in the works as of now.
Oz
Posts: 585
Joined: Jul 02, 2005 14:21
Location: Waterloo, Ontario, Canada
Contact:

Postby Oz » Dec 22, 2009 3:07

Well, we do have multiple devs, but perhaps only one dev who is active currently.

Ya, I've been out of touch with the Mac world for about 10 years, and only pay attention to a few snippets of news here and there. I used to have a much older mac, prior to the OS X days (much closer to the Windows 3.1 days).

I will be getting, in January or Febuary (whenever funds permit), Mac OS for my intel computer, and I'll definitely do some fiddling with the FB source code. It will be glorious.
Oz
Posts: 585
Joined: Jul 02, 2005 14:21
Location: Waterloo, Ontario, Canada
Contact:

Postby Oz » Jan 09, 2010 21:54

I'm currently on my girlfriend's intel macbook, and fbc runs fine through wine. I installed wine via git respos, with very little issue (although I can't get he quartz driver to work, but the x11 works good for just doing terminal emulation).
I also tried running a few programs compiled by fbc (which I had no doubt would work, but just testing), and I had absolutely no problem. From asking around a lot of mac users, most of them use wine quite regularly, and isn't much hassle. Maybe we don't even need a mac port, at least for the time being.

I'll probably have a good amount of access to her macbook over this next semester, so I'm going to read over some of the fbc source and see what can be done for compiling it on a mac. If anyone has done some code, if you can direct me there, that would be super.

Take care,
-Oz
segin
Posts: 126
Joined: Dec 27, 2005 5:22
Contact:

Postby segin » Jan 25, 2010 14:16

Pottersson wrote:I'd think that, in theory, a Mac port should come from the Linux version, you know, considering the *NIX they both share. But I am by no means an expert. I wonder, though, if I could get a simple Hello World program compiled for Linux to run...


Wouldn't work for some dumb reasons - the executables are not in the same format, for one. Linux uses AT&T SVr4 ELF and Mac OS X (and Darwin) uses the Mach-O format which it inherited from NeXTSTEP.

Secondly, the core system libraries on Linux are libc, libpthread, libm, libdl, etc., whereas on Mac OS X (and Darwin), this is all bundled into libSystem.

Now, I can see running simple programs from Linux on Mac OS X, say, a simple "Hello, World!" CLI app or so, but that'd take a ELF loader and a system to map the Linux libc calls to Darwin libSystem functions. Extremely difficult, but not impossible. I once compiled a trivial C app on FreeBSD 6.x and then, after a bit of trickery, ran the same binary on a Linux system without modification. However, for programs of any real functionality, this doesn't work as there are symbols in e.g. the FreeBSD libc that do not exist in glibc.

TL;DR: Don't bother, running Linux binaries on Mac OS X does not work, and making it work would involve far too much work
marcov
Posts: 3074
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Jan 25, 2010 18:50

segin wrote:
Pottersson wrote:I'd think that, in theory, a Mac port should come from the Linux version, you know, considering the *NIX they both share. But I am by no means an expert. I wonder, though, if I could get a simple Hello World program compiled for Linux to run...


Wouldn't work for some dumb reasons - the executables are not in the same format, for one. Linux uses AT&T SVr4 ELF and Mac OS X (and Darwin) uses the Mach-O format which it inherited from NeXTSTEP.


And on IA32 more SysV like ABI (http://personal.denison.edu/~bressoud/c ... velABI.pdf) :

the IA-32 architecture and whether their value is preserved after a subroutine call.
The function calling conventions used in the IA-32 environment are the same as those used in the
System V IA-32 ABI, with the following exceptions:
■ Structures 8 bytes or smaller in size are returned in registers
■ The stack is 16-byte aligned
■ Large data types (larger than 4 bytes) are kept at their natural alignment

Note that crosscompiling is a $#@$& since binutils don't support Darwin/OSX iirc, and you have to hand compile CCTOOLS.

It is possible though, I compiled a complete Lazarus IDE (gui Carbon app) to OS X 10.4/ppc from both Linux and windows.

As far as as GUI goes, there are several choices:
- Use X11 with GTK2
- use the native QT port.
- Use Carbon (but not on 64-bit x86)
- Cocoa is the advised widgetset, but it is specified in Objective C, which is a pain. Moreover it is Mac only.
- Owner drawn using Quartz
- owner drawn using OpenGL
Mentat
Posts: 332
Joined: Oct 27, 2007 15:23
Location: NC, US
Contact:

Postby Mentat » Jan 27, 2010 3:30

Oh yeah, I forgot. Macs can run x11 stuff, can't it?
marcov
Posts: 3074
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Jan 27, 2010 8:49

Mentat wrote:Playing around with that time machine too much, eh? :P

Apple has moved to Intel a while ago. No need to worry about PPC.


Well DUH, that means that PPC are the affordable ones for development :-)

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests