Building XV 3.10a on an Intel Mac

What is this?

This page was written in 2006. It explains how to build XV for use with an Intel Mac. As of November 2011 on Mac OS X 10.7.2, these instruction still work – albeit with MacOSX10.7.sdk in place of MacOSX10.4u.sdk in the Makefile.

What you need

These instructions are based on Mac OS X 10.4.6 and 10.4.7 with X11 and the XCode developer tools installed. Your mileage may vary with other configurations.

Download the source code from the XV downloads page. The specific file is xv-3.10a.tar.gz. You can put it wherever you’d like, but I put it in /usr/local/src.

Starting Out

First you have to unpack the source code:

> gunzip xv-3.10a.tar.gz
> tar xvf xv-3.10a.tar

You can delete the tar file:

> rm xv-3.10a.tar

Change to the new XV directory:

> cd xv-3.10a

Optional Changes

From XV’s config.h header:

If you have the gnu uncompression utility ‘gunzip’, XV can use it to automatically ‘unzip’ any gzip’d files. To enable this feature, change ‘undef’ to ‘define’ in the following line. Needless to say, if your gunzip is installed elsewhere on your machine, change the ‘GUNZIP’ definition appropriately. (use ‘which gunzip’ to find if you have gunzip, and where it lives)

This is straightforward, so you might as well do it. Open the config.h header with your editor of choice.

Change line 16 so that it reads:

#define USE_GUNZIP

Then change line 22 so that it reads:

#    define GUNZIP "/usr/bin/gunzip -q"

(The path is originally set to /usr/local/bin/gunzip.)

Necessary Changes

These changes needed to be made before I could successfully compile XV. The changes I made are not necessarily the “best” solutions, but rather the simplest that introduce the fewest changes.

In xv.h:

  1. Comment out line 119 so that it reads:
    /*  extern char *sys_errlist[];   */
  2. Adjust the path included in line 167 so that it reads:
    #   include <malloc/malloc.h>

In vdcomp.c:

  1. Adjust the path included in line 116 so that it reads:
    #   include <malloc/malloc.h>

In Makefile:

  1. Edit the CCOPTSdefinition at or near line 16 so that it reads:
    CCOPTS = -O -L/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib

Compiling XV

If all has gone well, you should now be able to build XV with the following simple command:

> make
> make install

Now you just have to figure out how XV actually works!

XV screenshot