Macintosh OS X

Copied from http://n1ofz.connares.org/software/build

 

The following text is shamelessly copied from Dana's website. I have followed his directions, and it is working great on my MacBook Pro running OS X 10.4 (Tiger). Note that after his instructions are complete, you may go over to the Legacy --> Configure instructions, and download the same maps that the linux guys use, and get the software up and running on your computer with the layers and such.

 

How to get Xastir up and running on OS X
by Dana Rawding, N1OFZ.

There are many ways to get Xastir running on OS X. Unfortunately it can be confusing and even daunting to the average or new OS X user. I have tried to write this How-to from the perspective of the average or 'typical' OS X user. My definition of a typical user is someone who probably upgraded to OS X from OS 9 or Windows and has never used or even seen a command line. Only since OS X has there even been an ability to get under the hood of MacOS. I hope this document will help and encourage the typical user to get his hands a little dirty and explore the world of Open Source Software.

Xastir was written for the Linux platform. Lucky for us it is not too difficult to port Xastir to the Mac platform. One of the great things about Linux (and most Unixes) is that you have practically unlimited customization of your system. The bad thing about Linux is that you have practically unlimited customization of your system. For instance, on OS X you have one choice for your default desktop environment. Apple defines and controls it. In Linux you can pick any number of environments (KDE, Gnome and a host of others) and modify them in any way you want. Most of these environments are run on top of X11. Lucky for us that since OS X is based on Unix, X11 is available to us. The problem is there are a number of X11 distros available for OS X. On top of that you have the choice of using package managers such as Fink or MacPorts. Or you can choose to build from the source yourself. I have tried to simplify the installation as much as possible by making all the choices for you. I have selected Apple's X11 with MacPorts.

Install Developer Tools:
In order to be able to build an application on OS X you will need at least a compiler and some OS X libraries & headers. Apple has made this easy by providing everything you need on one CD/DVD. So grab your Apple Developer Tools from CD that came with your OSX software. If you purchased a machine with OSX preinstalled or you do not have this CD you will have to go to Apple's site (look for ADC) and sign up as a developer. The entry level developer membership is free and will allow you to download many nice tools as well as the entire Developer Toolkit. Install the Developer Tools as you would any other program.

Install X11:
We now need to install X11 for OS X. Download and install Apple's X11 disto from http://www.apple.com/support/downloads/x11formacosx.html. Make sure while you are on the download page you grab and install the SDK. It will be important to have when you compile your application. If you have your original Apple media X11 is on the third CD or on the Install DVD.

Install MacPorts:
Once you have X11 running go to http://www.macports.org and install the MacPorts package

The next step is to install the packages needed to build Xastir. Open the terminal application and type in the folllowing:
sudo /opt/local/bin/port selfupdate
You will be prompted for your admin password.

After the update check completes type:
sudo /opt/local/bin/port install curl imagemagick openmotif pcre db42 lcms proj gdal libpng libxml2
Note: Now is a good time to go to bed as it is going to take (depending on your processor, memory and Internet connection speed) a couple of hours to download and install everything. Once this is done you have enough to build a pretty complete Xastir application. Optional Installs
The only software you can not install with MacPorts is shapelib and geotiff. In order to install shaplib, grab the source from http://wetnet.net/~we7u/xastir/shapelib/shapelib-1.2.10.tar.gz. To complicate matters more the Makefile does not work. Fortunately, Bill Owen, N2RKL, came up with the following procedure to build and install shapelib:

from a X11 terminal window:
go to the directory that you downloaded the shapelib source with the cd command then type in the following list of commands:
tar -xvzf shapelib-1.2.10.tar.gz
cd shapelib-1.2.10
cc -c shpopen.c
cc -c shptree.c
cc -c dbfopen.c
ar cru libshp.a shpopen.o shptree.o dbfopen.o
sudo cp libshp.a /usr/local/lib
sudo ranlib /usr/local/lib/libshp.a
sudo mkdir /usr/local/include/libshp
sudo cp shapefil.h /usr/local/include/libshp

To install geotiff go to http://www.remotesensing.org/geotiff/geotiff.html and get the latest source. Then do the following commands:
tar -xvzf libgeotiff-1.2.2.tar.gz
cd libgeotiff-1.2.2
./configure --prefix=/usr/local
make
sudo make install
sudo ranlib /usr/local/lib/libgeotiff.a

install Xastir: Download Xastir from http://www.xastir.org and put it in your home directory. You may want to keep the source directory after you finish installing. It will make things easier if you want to update Xastir later via CVS.

from a X11 terminal window type in the following list of commands:
tar -xvzf xastir* (for example tar -xvzf xastir121-2003-Jul-02.tgz)
mv xastir* xastir
cd xastir
./bootstrap.sh
./configure
make
sudo make install-strip

if you want to enable map caching use
./configure --with-bdb-incdir=/opt/local/include/db42 --with-bdb-libdir=/opt/local/lib/db42 instead of just ./configure

That's it! You can now run Xastir from an X terminal window with: /usr/local/bin/xastir. Or add it to the X11 Application menu. Do this by going to the Applications pull down and select Customize. Click the 'add item' button. Double click the blank hi-lighted line under the name column. Type in 'Xastir'. Next double click under the Command column and type '/usr/local/bin/xastir'. Click the done button. Now you can launch Xastir from the Applications menu.

You should now spend some time reading all the Xastir documentation. In case you need to know where the Xastir files are located on your system please reference the following:

/Users/"username"/xastir - this folder contains the Xastir source. It can be deleted but I recommend keeping it for future software upgrades
/Users/"username"/.xastir - this is a hidden directory and contains all your personal configuration files
/usr/local/bin/xastir - this is where the Xasir application resides
/usr/local/share/xastir - this is where you will put maps and such

Good Luck
Dana
N1OFZ