Skip to Main Content
Mac OS X for Unix Geeks
book

Mac OS X for Unix Geeks

by Ernest E. Rothman, Brian Jepson
September 2002
Beginner to intermediate content levelBeginner to intermediate
216 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Mac OS X for Unix Geeks

Compiler Differences

GCC is supported on a wide range of platforms and is familiar to most Unix developers. A natural consequence of this is that most Unix developers will find a familiar development environment in Mac OS X. There are, however, some important differences.

One difference that experienced GCC users may notice, particularly if they have dealt with a lot of mathematical and scientific programming, is that Mac OS X’s Developer Tools do not include FORTRAN. However, the Fink distribution (http://fink.sourceforge.net) includes g77 , the GNU FORTRAN ’77 compiler. Also, the Darwin archive includes the source code for g77, which you can use to compile FORTRAN code. For more information on the Darwin CVS archive, see Chapter 7.

Tip

Mac OS X’s C compiler contains a number of Mac OS X-specific features that have not been folded into the main GCC distribution. (It is up to the Free Software Foundation (FSF) to accept and merge Apple’s patches.) For information on how Apple’s compiler differs from the GNU version, see the README.Apple file in the Darwin CVS archive’s gcc3 subdirectory.

As of this writing, Apple’s cc compiler is based on GCC 3.1. However, GCC 2.95 is also available as /usr/bin/gcc2. By default, invoking cc or gcc will invoke GCC 3.1. You can change this to GCC 2.95 by running the command gcc_select 2, and you can change it back with gcc_select 3. You can see the current settings by running gcc_select with no arguments:

% gcc_select Apple Computer, Inc. GCC ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X For Unix Geeks, 4th Edition

Mac OS X For Unix Geeks, 4th Edition

Ernest E. Rothman, Rich Rosen, Brian Jepson
Mac OS X Hacks

Mac OS X Hacks

Kevin Hemenway, Rael Dornfest
Mac OS X in a Nutshell

Mac OS X in a Nutshell

Jason McIntosh, Chuck Toporek, Chris Stone

Publisher Resources

ISBN: 0596003560Errata Page