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.

Starting Out

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:

Comment out line 119 so that it reads:

/* extern char *sys_errlist[]; */

Adjust the path included in line 167 so that it reads:

# include <malloc/malloc.h>

In vdcomp.c:

Adjust the path included in line 116 so that it reads:

# include <malloc/malloc.h>

In Makefile:

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: