GRAFIKS: Building and Installing XV

By: Kurt Wall

Tested on: Slackware 8.1, with XFree86 4.2.99 from CVS

XV, John Bradley's shareware graphics viewer, is distributed with most Linux distributions (Red Hat © is a notable exception -- it isn't free enough for them). However, it can be a bit of a challenge to build and install from scratch. Here's how I did it here at KurtWerks. As usual, your mileage may vary and if it breaks, you get to keep both pieces.


  1. Unpack the archive :
    $ gzip -cd xv-3.10a.tar.gz | tar -xf -
    $ cd xv-3.10a
    
  2. Apply the patches:
    $ patch -p0 < ../grabpatch
    patching file xvgrab.c
    $ patch -p0 < ../mp-tiff-patch
    patching file ./xv.c
    patching file ./xv.h
    patching file ./xvmisc.c
    patching file ./xvtiff.c
    $ patch -p0 < ../xpm.patch
    patching file xvdir.c
    $ patch -p0 < ../deepcolor.patch
    patching file xvimage.c
    $ patch -p0 < ../gifpatch
    patching file xvgif.c
    $ patch -p0 < ../exceed_grab.patch
    patching file xvgrab.c
    patching file xvxwd.c
    $ patch -p0 < ../tiff1200.patch
    patching file xvtiffwr.c
    $ patch -p0 < ../gssafer.patch
    patching file xvps.c
    
    
  3. Edit config.h:
    1. Change the following line:
      #undef USE_GUNZIP 
      
      to look like the following:
      #define USE_GUNZIP
      
    2. Change the following line:
      #    define GUNZIP "/usr/local/bin/gunzip -q"
      
      to look like the follwoing:
            
      #    define GUNZIP "/bin/gunzip -q"
      
      or wherever your gunzip binary lives, as reported by which gunzip.
    3. Change the following line:
      /* #define GS_PATH "/usr/local/bin/gs" */
      
      to look like the following:
      #define GS_PATH "/usr/bin/gs"
      
      or wherever your gs binary lives, as reported by which gs.
  4. Edit Makefile:
    1. Modify the CC line to reflect your preferences, if you wish. On my PIII 800, I use:
      CC = gcc -march=i686 -mcpu=i686
      
      On my Athlon Thunderbird, I use:
      CC = gcc -march=athlon -mcpu=athlon
      
    2. Modify the CCOPTS line to reflect your preferences for optimization. The default is fine, but I use:
      CCOPTS = -O3
      
  5. Change the installation locations to suit your preferences. The defaults (listed below) work just fine for me:
    ### Installation locations
    BINDIR = /usr/local/bin
    MANDIR = /usr/local/man/man1
    MANSUF = 1
    LIBDIR = /usr/local/lib
    
  6. Uncomment the following line:
    #MCHN = -DLINUX
    
    And add the text "-L/usr/X11R6/lib". After your changes, it should look like:
    MCHN = -DLINUX -L/usr/X11R6/lib
    
  7. Edit xv.h. Go to line 115. Delete lines 118-120. Before the edit, you have the following:
    #ifndef VMS
    #  include 
       extern int   errno;         /* SHOULD be in errno.h, but often isn't */
    #  ifndef __NetBSD__
         extern char *sys_errlist[];     /* this too... */
    #  endif
    #endif
    
    After the deletions, you should have the following:
    #ifndef VMS
    #  include 
       extern int   errno;         /* SHOULD be in errno.h, but often isn't */
    #endif
    
  8. Build and install:
     
    $ make
    $ su -c "make install"
    Password:
    cp xv bggen vdcomp xcmap xvpictoppm /usr/local/bin
    cp docs/xv.man     /usr/local/man/man1/xv.1
    cp docs/bggen.man  /usr/local/man/man1/bggen.1
    cp docs/xcmap.man  /usr/local/man/man1/xcmap.1
    cp docs/xvp2p.man  /usr/local/man/man1/xvpictoppm.1
    cp docs/vdcomp.man /usr/local/man/man1/vdcomp.1
    cp docs/xvdocs.ps* /usr/local/lib
    
  9. You're done.

Document Version: $Id: xv.html,v 1.4 2002/12/24 05:30:48 kwall Exp $

searchSearch Index