1.2. Obtaining Compilers

 < Day Day Up > 

If you wish to build programs from source code, you need a compiler. Almost all Unix applications are written in C or C++, with the majority still written in C. This section describes obtaining compilers for the three systems covered in this book.

1.2.1. Solaris

Solaris 10 includes a Java compiler. Earlier versions of Solaris did not come with C or C++ compilers. You had to either buy compilers from Sun, from other third party vendors, or find a binary of some version of GCC for use in bootstrapping the latest version of GCC.

The final version of Solaris 10 now includes GCC (both C and C++ compilers) in /usr/sfw/bin. This is true for both the SPARC and Intel x86 versions. You thus have a choice: you may use the supplied GCC, or buy high-quality C and C++ compilers from Sun.

Besides GCC, a very large number of precompiled packages is available from http://www.sunfreeware.com/. You should see both the "Download/Install" and "FAQ" sections of that web site.

All the software from http://www.sunfreeware.com is in pkgadd format and is installable using that command. (See Chapter 6.) We recommend reading the details on the web site, which will always be up to date.

Note that many commands discussed in this book won't be on your system if all you've done is an end user install. If you can afford the disk space, do at least a developer install. This also installs many of the header files and libraries that you need in order to compile programs from source code.

For support issues and publicly released patches to Solaris, the web starting point is http://sunsolve.sun.com.

1.2.2. GNU/Linux

GNU/Linux systems usually install software development tools by default. If your system does not have compiler tools or make (see Chapter 16), then you will have to find the appropriate package(s) for your distribution. This is likely to be one or more .rpm or .deb files on your distribution media (CD or DVD), or you may be able to install it over the Internet, using a package manager such as apt or yum.

At a minimum, you will need the GNU Compiler Collection (GCC), system header files and libraries, the GNU Binutils (assembler, loader, ar, etc.), and make.

1.2.3. Mac OS X

Unix-style development tools (compiler, make) are included as part of the larger Xcode Tools package . Boxed distributions of Mac OS X include an Xcode Tools CD. The easiest way to install the tools is to insert that CD into your CD drive.

If your version of Mac OS X is that which came with your hardware, you won't have an Xcode Tools CD. Instead, click on Developer.mpkg in /Applications/Installers/Developer Tools. Doing so installs the development tools.

     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net