Thanks to several people graciously donating shell accounts on their OS X boxes, Nmap usually compiles on that platform without problems. Doing this does require the Apple Developer Tools system. If you are not careful, Apple tries to charge for them. Brian Hatch sent me the following steps for obtaining the Developer Tools for free (as of September 2003).
Browse to http://connect.apple.com and join the ADC (Apple Developer Connection). Skip to step 4 if you already have an account.
Fill out several forms to create a new account.
Eventually you reach a page for buying support and/or CD media. Ignore this page and return to http://connect.apple.com
Log in with your new account credentials.
Hit the Download
link on the left and then choose Developer Tools
.
Download the most recent Dev Tools
and install.
Download the most recent XCode (dev tools) release and install.
These exact steps may change, but it is hoped that this general
approach will continue to work.
Once you have the developer tools installed, you can follow the compilation instructions found in the section called “Unix Compilation and Installation from Source Code” Note that on some older versions of Mac OS X, you may have to replace the command ./configure with ./configure CPP=/usr/bin/cpp.
Users who prefer binary packages may want to have a look at the
Fink project Their
stated goal is “to bring the full world of Unix Open Source
software to Darwin and Mac OS X”, and so they offer Nmap and
hundreds of other useful packages. Another good option is Darwinports As with all
contributed binary packages, the disadvantage is that they may not be
up-to-date with the latest Nmap releases and you have less flexibility
in the build process. But it is certainly worth a look if you want to
install many popular Unix tools at once.