05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

346<br />

CHAPTER 19 EXTENDING THE POWER OF DARWIN<br />

Table 19-6. Continued<br />

Command Action<br />

sudo port uninstall appname Removes the port appname.<br />

sudo port clean appname Removes the build files for appname, which is a good way to free up<br />

disk space after you install a port.<br />

NOTE So, you may ask, what’s really better, Fink or <strong>Mac</strong>Ports? The answer is that it probably<br />

doesn’t matter much these days. We use <strong>Mac</strong>Ports since it’s familiar to us and for some historical<br />

reasons that have no significant relevance anymore. Today, as far as we can tell, they are<br />

both equally good at doing what they do, and either of them is better than none of them.<br />

Compiling Software from the Source Code<br />

With the maturity of Darwin in <strong>Leopard</strong> combined with the availability of most popular open<br />

source software through either <strong>Mac</strong>Ports or Fink, it’s rare you would ever need to compile software<br />

from source code (unless of course you are actively developing software, in which case you<br />

probably know all the information we’re about to relate, plus a good bit more). Still, if you really<br />

want to try a bleeding-edge program that hasn’t found its way to Fink or <strong>Mac</strong>Ports or you think<br />

you must compile an application with just the right options, then you want to compile your own<br />

application from source code.<br />

CAUTION Compiling your own software from source code is not for the weak. Things will<br />

often just not work as they should, and it could take some time and research to figure out how<br />

to get something built correctly on your computer. Sometimes, things won’t work at all (unless<br />

of course you want to dig into the code yourself and tweak it). If you are easily frustrated, then<br />

we suggest that the benefits of compiling your own program might not outweigh the mental<br />

anguish you could be setting yourself up for.<br />

Compiling your application from source code generally requires three steps: configuring,<br />

building, and installing. Usually these steps are fairly automated and, with the exception of the<br />

configure stage, are usually pretty much the same.<br />

NOTE To be honest, there is often a fourth step: figuring out what went wrong when one of<br />

the three primary steps fails. We’ll talk about this too.<br />

Before you start any steps, though, you need to get the source code. This can usually be found<br />

on a project’s web site or through a source repository such as SourceForge (www.sourceforge.net).<br />

Step 1: Configure<br />

For the user building an application for their own use, the configure stage is the most important<br />

part of the whole build process. This is where you can customize the application for your specific<br />

needs and your specific system. The first part of configuring your build is to see what configure<br />

options are available. You do this by going into the primary source folder and typing the following:<br />

./configure --help

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!