Unix

bishop3

Registered
hey all

I was wondering if all Unix-based software will automatically work
on OS X or will there have to be some programming involved to make it
work?

Thanks,

Aaron
 
No, not directly...
You can use darwin (OSX-UNIX) compiled software in the Terminal app...

What do you mean by "UNIX-based"?
 
There are a lot of different flavors of UNIX and other *nixen. Apps need to be ported to Darwin on the PPC to run on the Mac.

Check out:
http://fink.sourceforge.net
http://gnu-darwin.sourceforge.net/

both projects dedicated to porting *nix apps to Darwin on the Mac.

It is relatively easy to get a UNIX window manager running and get some cool apps running, too, like the GIMP (an opensource *NIX Photoshop-like prog) for example... With Xfree86 and a windows manager you can run apps in a GUI (even an aquaey gui with Tenon's XTools..) rather than just the command line...
 
Most unix apps are written in C. When you compile a C program you take cross platform source code and compile it to machine specifc executable code.

In theory, you should be able to take you C code, compile it on your mac, then run it.

However, in practice that's not always true. Maybe your program has assembler code (which isn't cross platform) in it to speed things up? Maybe your program relies on pre-compiled libraries? Maybe your program expects certain hardware to be present?

Anyway, simple things will easily work on a mac. I bet everything I've ever written for school would port right over. Larger and more complicated programs require more effort to get them to run.

I hope this helps,
Vanguard
 
I don't suppose there is some simple guide is there ;) just kidding I know it'll probably be a lot of headach but I would really like to try my hand at porting software. Assuming I have the right libraries (and Dev kit of course) is it just changing the configure script to make it work? What language is that in anyway? Would you think something like Gaim would be too hard. That's my current test case and it's not going well.

What makes Darwin different from BSD that it's based on so We can't just compile anything that runs on FreeBSD?

Sorry for all the questions all at once. Any little thing you have to say about any of this would help. I've been looking for guides all night online with no luck.
 
... you're best off learning a bit about general UNIX (or Linux) programming. There are numerous books on the subject and also a *lot* of info on the web. Mac OS X has all the tools you'll need to compile UNIX software, as others have already pointed out, but there are subtle differences in the way some of the tools works on almost every UNIX system. For example, the find tool on Linux will accept an 'iname' argument which performs a case-insensitive search, however the find on Solaris does *not* take this argument. (bummer) Another example, the ls command as in Darwing/Mac OS X by default does not accept the --color argument. You first have to compile the GNU version of ls (and make some termcap settings) before you get a colour ls in Darwin/Mac OS X.
The above examples are not directly related to programming, but give you a general idea of what I mean.
Also, I believe there are some differences in the directory structure between Mac OS X/Darwin/FreeBSD and Linux, for example. (This is based on my observation that OS X seems to store some libraries I'm used to finding in /usr/lib under a libext directory)

So anyway, back to my original thought - if you were to learn about 'generic' *nix programming, then you'll know what tools to use and what they do. Then you can go back and check the man pages on OS X/Darwin to see where the differences lie, and *then* you can go about changing scripts and altering source code.

NOTE: that's just the way I would go about doing it - everyone has their own preferred way of working, and perhaps you like doing things completely different, but I just thought I'd *try* and be helpful ;-))))


C
 
Back
Top