xv Compilation for RHEL4

These are the steps necessary to compile the xv image viewer on Redhat Enterprise Linux 4 (RHEL4).

The home page for this excellent package can be found at the following URL.

http://www.trilon.com/xv/xv.html

xv is not free software. Read and understand the licensing agreement.

Download the Source

Visit the download page for xv.

http://www.trilon.com/xv/downloads.html

You will want to download the main source code package, as well as the optional patches. At this time, the most current version was 3.10a

wget ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.tar.gz

Download Recommended Patches

wget ftp://ftp.trilon.com/pub/xv/patches/grabpatch
wget ftp://ftp.trilon.com/pub/xv/patches/vispatch
wget ftp://ftp.trilon.com/pub/xv/patches/mp-tiff-patch
wget ftp://ftp.trilon.com/pub/xv/patches/longname.patch
wget ftp://ftp.trilon.com/pub/xv/patches/xpm.patch
wget ftp://ftp.trilon.com/pub/xv/patches/deepcolor.patch
wget ftp://ftp.trilon.com/pub/xv/patches/gifpatch
wget ftp://ftp.trilon.com/pub/xv/patches/exceed_grab.patch
wget ftp://ftp.trilon.com/pub/xv/xv-redhat6-readme.txt
wget ftp://ftp.trilon.com/pub/xv/patches/tiff1200.patch
wget ftp://ftp.trilon.com/pub/xv/patches/gssafer.patch

Download Optional Patches

wget ftp://ftp.trilon.com/pub/xv/xv-3.10a-png-1.2d.tar.gz
wget ftp://ftp.trilon.com/pub/xv/patches/pdf.patch
wget ftp://ftp.trilon.com/pub/xv/patches/windowid.patch
wget ftp://ftp.trilon.com/pub/xv/patches/bmp32.patch

The following two patches may be relavent if you want to link against the system TIFF and JPEG libraries, but additional changes need to be made to the Makefile. I didn’t bother to figure it out.

wget ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.JPEG-patch
wget ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.TIFF-patch

Prepare the Source

First extract the main source.

tar -xvzf xv-3.10a.tar.gz

Extract the PNG patch.

mkdir png
cd png
tar -xvzf ../xv-3.10a-png-1.2d.tar.gz
cd ..

Next apply the patches. Watch for the changes to the -p flag.

cd xv-3.10a

patch -p2 <../grabpatch 
patch -p2 <../vispatch 
patch -p2 <../mp-tiff-patch 
patch -p1 <../longname.patch 
patch -p0 <../xpm.patch
patch -p0 <../deepcolor.patch
patch -p0 <../gifpatch
patch -p0 <../exceed_grab.patch
patch -p0 <../tiff1200.patch
patch -p0 <../gssafer.patch

patch -p0 <../pdf.patch
patch -p0 <../windowid.patch
patch -p0 <../bmp32.patch

cp ../png/bits/br_png bits/
cp ../png/xvpng.c .
patch -p1 <../png/xcmap.diff
patch -p1 <../png/xvpng.diff

The png/pvpng.diff patch applies fixes to several files. The changes to xvdir.c will fail, but that’s okay because the fix was already applied by xpm.patch. If you prefer, you can skip the xpm.patch step and you won’t get the warning. Both patches have the same affect but the xpm patch follows the indentation style more closely (but perhaps that doesn’t really matter).

Make the following changes as outlined in xv-redhat6-readme.txt.

First, in the header file xv.h lines 119-121 should be commented out, otherwise you get an “already defined in stdio.h” error and compilation aborts:

/* #  ifndef __NetBSD__
     extern char *sys_errlist[];     this too... 
#  endif */

Second, in the machine-specific options in the Makefile the Linux once should contain the exact path to X11 libraries: -L/usr/X11/lib - otherwise make doesn’t find them. (I haven’t checked where it looks for them, but all current Linux distributions I know of come with XFree86 pre-compiled and installed with this very path.) So, line 105 reads:

MCHN = -DLINUX -L/usr/X11R6/lib

Build

Now just run make.

make

Installation

If you have root access and want everything installed to /usr/local, first update MANDIR in Makefile.

MANDIR = /usr/local/share/man/man1

Then, as root, run the following.

make install
 
howto/xv.txt · Last modified: 2006/06/24 11:48 by dpotter