Toggle diff (7768 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index b3aaeadf1d..45eb09d9f8 100644
@@ -1622,6 +1622,7 @@ dist_patch_DATA = \
%D%/packages/patches/xf86-video-voodoo-pcitag.patch \
%D%/packages/patches/xfce4-panel-plugins.patch \
%D%/packages/patches/xfce4-settings-defaults.patch \
+ %D%/packages/patches/xloadimage-debian-series-25.patch \
%D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \
%D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \
%D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \
diff --git a/gnu/packages/patches/xloadimage-debian-series-25.patch b/gnu/packages/patches/xloadimage-debian-series-25.patch
index 0000000000..593de65883
+++ b/gnu/packages/patches/xloadimage-debian-series-25.patch
+Combined patches from Debian: https://sources.debian.org/patches/xloadimage/4.1-25/
+Index: xloadimage.4.1.old/Makefile.in
+===================================================================
++++ xloadimage.4.1.old/Makefile.in
++# Makefile for autoconf tutorial
++DEFS = @DEFS@ -DSYSPATHFILE=\"/etc/X11/Xloadimage\"
++XLIB = @X_LIBS@ -lX11 @X_EXTRA_LIBS@
++SRCS = bright.c clip.c cmuwmraster.c compress.c config.c \
++dither.c faces.c fbm.c fill.c gif.c halftone.c imagetypes.c img.c jpeg.c \
++mac.c mc_tables.c mcidas.c merge.c misc.c new.c niff.c options.c \
++pbm.c pcx.c pdsuncomp.c reduce.c rle.c rlelib.c root.c rotate.c \
++send.c smooth.c sunraster.c tiff.c undither.c value.c vff.c \
++vicar.c window.c xbitmap.c xloadimage.c xpixmap.c xwd.c zio.c zoom.c png.c
++ $(CC) $(CFLAGS) -c $(DEFS) build.c
++ $(CC) -o $@ $(OBJS) build.o $(LDFLAGS) $(XLIB) $(LIBS)
++ $(CC) $(CFLAGS) $(DEFS) uufilter.c -o $@
++ $(CC) $(CFLAGS) -c $(DEFS) $<
++ rm -f autoconfig build.c err
++ rm -f *.o *~ xloadimage uufilter autoconfig libconfig packtar \
++ buildshar doshar shar.* *.tar *.tar.Z *.tc
++ rm -f config.log config.cache config.status config.h Makefile
++config.h.in: configure.in
++configure: configure.in
+Index: xloadimage.4.1.old/config.h.in
+===================================================================
++++ xloadimage.4.1.old/config.h.in
++/* config.h.in. Generated automatically from configure.in by autoheader. */
++/* Define as the return type of signal handlers (int or void). */
++/* Define if you have the ANSI C header files. */
++/* Define if the X Window System is missing or not being used. */
++#undef X_DISPLAY_MISSING
++/* Define if you have the select function. */
++/* Define if you have the <malloc.h> header file. */
++/* Define if you have the <strings.h> header file. */
++/* Define if you have the <sys/time.h> header file. */
++/* Define if you have the <unistd.h> header file. */
++/* Define if you have the m library (-lm). */
++/* Define if you have the jpeg library (-ljpeg). */
++/* Define if you have the tiff library (-ltiff). */
++/* Define if you have the png library (-lpng). */
++/* Define if you have the z library (-lz). */
+Index: xloadimage.4.1.old/configure
+===================================================================
++++ xloadimage.4.1.old/configure
++# Guess values for system-dependent variables and create Makefiles.
++# Generated automatically using autoconf version 2.13
++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
++# This configure script is free software; the Free Software Foundation
++# gives unlimited permission to copy, distribute and modify it.
++ac_default_prefix=/usr/local
++# Any additions from configure.in:
++ --with-x use the X Window System"
++# Initialize some variables set by options.
++# The variables have the same names as the options, with
++# dashes changed to underlines.
++cache_file=./config.cache
++program_transform_name=s,x,x,
++bindir='${exec_prefix}/bin'
++sbindir='${exec_prefix}/sbin'
++libexecdir='${exec_prefix}/libexec'
++datadir='${prefix}/share'
++sysconfdir='${prefix}/etc'
++sharedstatedir='${prefix}/com'
++localstatedir='${prefix}/var'
++libdir='${exec_prefix}/lib'
++includedir='${prefix}/include'
++oldincludedir='/usr/include'
++infodir='${prefix}/info'
++# Initialize some other variables.
++SHELL=${CONFIG_SHELL-/bin/sh}
++# Maximum number of lines to put in a shell here document.
++ # If the previous option needs an argument, assign it.
++ if test -n "$ac_prev"; then
++ eval "$ac_prev=\$ac_option"
++ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
++ # Accept the important Cygnus configure options, so we can diagnose typos.
++ -bindir | --bindir | --bindi | --bind | --bin | --bi)
++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
++ bindir="$ac_optarg" ;;
++ -build | --build | --buil | --bui | --bu)
++ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
++ -cache-file | --cache-file | --cache-fil | --cache-fi \
++ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
++ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
++ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
++ cache_file="$ac_optarg" ;;
++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
++ datadir="$ac_optarg" ;;
++ -disable-* | --disable-*)
++ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
++ # Reject names that are not valid shell variable names.
++ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
++ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
++ eval "enable_${ac_feature}=no" ;;
++ -enable-* | --enable-*)
++ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
++ # Reject names that are not valid shell variable names.
++ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
++ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
++ eval "enable_${ac_feature}='$ac_optarg'" ;;
++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
++ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
++ | --exec | --exe | --ex)
++ ac_prev=exec_prefix ;;
++ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
++ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
++ | --exec=* | --exe=* | --ex=*)
++ exec_prefix="$ac_optarg" ;;
++ -gas | --gas | --ga | --g)
++ # Obsolete; use --with-gas.
++ -help | --help | --hel | --he)
++ # Omit some internal or obsolete options to make the list less imposing.
++ # This message is too long to be a string in the A/UX 3.1 sh.
++Usage: configure [options] [host]
++Options: [defaults in brackets after descriptions]
++ --cache-file=FILE cache test results in FILE
++ --help print this message
++ --no-create do not create output files
++ --quiet, --silent do not print \`checking...' messages
++ --version print the version of autoconf that created configure
++Directory and file names:
++ --prefix=PREFIX install architecture-independent files in PREFIX
++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
++ --bindir=DIR user executables in DIR [EPREFIX/bin]
++ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
++ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
++ --datadir=DIR read-only architecture-independent data in DIR
++ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
++ --sharedstatedir=DIR modifiable architecture-independent data in DIR
++ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
++ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
++ --includedir=DIR C header files in DIR [PREFIX/include]
++ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
++ --infodir=DIR info documentation in DIR [PREFIX/info]
++ --mandir=DIR man documentation in DIR [PREFIX/man]
++ --srcdir=DIR find the sources in DIR [configure dir or ..]
++ --program-prefix=PREFIX prepend PREFIX to installed program names
++ --program-suffix=SUFFIX append SUFFIX to installed program names
++ --program-transform-name=PROGRAM
++ run sed PROGRAM on installed program names
++ --build=BUILD configure for building on BUILD [BUILD=HOST]
++ --host=HOST configure for HOST [guessed]
++ --target=TARGET configure for TARGET [TARGET=HOST]
++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --x-includes=DIR X include files are in DIR
++ --x-libraries=DIR X library files are in DIR
++ if test -n "$ac_help"; then
++ echo "--enable and --with options recognized:$ac_help"
++ -host | --host | --hos | --ho)
++ -host=* | --host=* | --hos=* | --ho=*)
++ -includedir | --includedir | --includedi | --included | --include \
++ | --includ | --inclu | --incl | --inc)
++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
++ | --includ=* | --inclu=* | --incl=* | --inc=*)
++ includedir="$ac_optarg" ;;
++ -infodir | --infodir | --infodi | --infod | --info | --inf)
++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
++ infodir="$ac_optarg" ;;
++ -libdir | --libdir | --libdi | --libd)
++ -libdir=* | --libdir=* | --libdi=* | --libd=*)
++ libdir="$ac_optarg" ;;
++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
++ | --libexe | --libex | --libe)
++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
++ | --libexe=* | --libex=* | --libe=*)
++ libexecdir="$ac_optarg" ;;
++ -localstatedir | --localstatedir | --localstatedi | --localstated \
++ | --localstate | --localstat | --localsta | --localst \
++ | --locals | --local | --loca | --loc | --lo)
++ ac_prev=localstatedir ;;
++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++ localstatedir="$ac_optarg" ;;
++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
++ mandir="$ac_optarg" ;;
++ # Obsolete; use --without-fp.
++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
++ | --oldin | --oldi | --old | --ol | --o)
++ ac_prev=oldincludedir ;;
++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
++ oldincludedir="$ac_optarg" ;;
++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
++ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
++ prefix="$ac_optarg" ;;
++ -program-prefix | --program-prefix | --program-prefi | --program-pref \
++ | --program-pre | --program-pr | --program-p)
++ ac_prev=program_prefix ;;
++ -program-prefix=* | --program-prefix=* | --program-prefi=* \
++ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
++ program_prefix="$ac_optarg" ;;
++ -program-suffix | --program-suffix | --program-suffi | --program-suff \
++ | --program-suf | --program-su | --program-s)
++ ac_prev=program_suffix ;;
++ -program-suffix=* | --program-suffix=* | --program-suffi=* \
++ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
++ program_suffix="$ac_optarg" ;;
++ -program-transform-name | --program-transform-name \
++ | --program-transform-nam | --program-transform-na \
++ | --program-transform-n | --program-transform- \
++ | --program-transform | --program-transfor \
++ | --program-transfo | --program-transf \
++ | --program-trans | --program-tran \
++ | --progr-tra | --program-tr | --program-t)
++ ac_prev=program_transform_name ;;
++ -program-transform-name=* | --program-transform-name=* \
++ | --program-transform-nam=* | --program-transform-na=* \
++ | --program-transform-n=* | --program-transform-=* \
++ | --program-transform=* | --program-transfor=* \
++ | --program-transfo=* | --program-transf=* \
++ | --program-trans=* | --program-tran=* \
++ | --progr-tra=* | --program-tr=* | --program-t=*)
++ program_transform_name="$ac_optarg" ;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil)
++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
++ sbindir="$ac_optarg" ;;
++ -sharedstatedir | --sharedstatedir | --sharedstatedi \
++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
++ | --sharedst | --shareds | --shared | --share | --shar \
++ ac_prev=sharedstatedir ;;
++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
++ sharedstatedir="$ac_optarg" ;;
++ -site | --site | --sit)
++ -site=* | --site=* | --sit=*)
++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
++ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
++ srcdir="$ac_optarg" ;;
++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
++ | --syscon | --sysco | --sysc | --sys | --sy)
++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
++ sysconfdir="$ac_optarg" ;;
++ -target | --target | --targe | --targ | --tar | --ta | --t)
++ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
++ target="$ac_optarg" ;;
++ -v | -verbose | --verbose | --verbos | --verbo | --verb)
++ -version | --version | --versio | --versi | --vers)
++ echo "configure generated by autoconf version 2.13"
++ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
++ # Reject names that are not valid shell variable names.
++ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
++ ac_package=`echo $ac_package| sed 's/-/_/g'`
++ eval "with_${ac_package}='$ac_optarg'" ;;
++ -without-* | --without-*)
++ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
++ # Reject names that are not valid shell variable names.
++ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
++ ac_package=`echo $ac_package| sed 's/-/_/g'`
++ eval "with_${ac_package}=no" ;;
++ # Obsolete; use --with-x.
++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
++ | --x-incl | --x-inc | --x-in | --x-i)
++ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
++ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
++ x_includes="$ac_optarg" ;;
++ -x-libraries | --x-libraries | --x-librarie | --x-librari \
++ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
++ ac_prev=x_libraries ;;
++ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
++ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
++ x_libraries="$ac_optarg" ;;
++ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
++ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
++ echo "configure: warning: $ac_option: invalid host type" 1>&2
++ if test "x$nonopt" != xNONE; then
++ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
++if test -n "$ac_prev"; then
++ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
++# File descriptor usage:
++# 2 errors and warnings
++# 3 some systems may open it to /dev/tty
++# 4 used on the Kubota Titan
++# 6 checking for... messages and results
++# 5 compiler messages saved in config.log
++if test "$silent" = yes; then
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++# Strip out --no-create and --no-recursion so they do not pile up.
++# Also quote any args containing shell metacharacters.
++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++ | --no-cr | --no-c) ;;
++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
++ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
++# Only set these to C if already set. These must not be set unconditionally
++# because not all systems understand e.g. LANG=C (notably SCO).
++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
++# Non-C LC_CTYPE values break the ctype check.
++if test "${LANG+set}" = set; then LANG=C; export LANG; fi
++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++# A filename unique to this package, relative to the directory that
++# configure is in, which we can look for to find out if srcdir is correct.
++ac_unique_file=xloadimage.c
++# Find the source files, if location was not specified.
++if test -z "$srcdir"; then
++ ac_srcdir_defaulted=yes
++ # Try the directory containing this script, then its parent.
++ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
++ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
++ if test ! -r $srcdir/$ac_unique_file; then
++ ac_srcdir_defaulted=no
++if test ! -r $srcdir/$ac_unique_file; then
++ if test "$ac_srcdir_defaulted" = yes; then
++ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
++ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++ if test "x$prefix" != xNONE; then
++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++for ac_site_file in $CONFIG_SITE; do
++ if test -r "$ac_site_file"; then
++ echo "loading site script $ac_site_file"
++if test -r "$cache_file"; then
++ echo "loading cache $cache_file"
++ echo "creating cache $cache_file"
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
++ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
++ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
++# Extract the first word of "gcc", so it can be a program name with args.
++set dummy gcc; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:532: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ if test -n "$CC"; then
++ ac_cv_prog_CC="$CC" # Let the user override the test.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ echo "$ac_t""$CC" 1>&6
++ # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:562: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ if test -n "$CC"; then
++ ac_cv_prog_CC="$CC" # Let the user override the test.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
++if test $ac_prog_rejected = yes; then
++ # We found a bogon in the path, so make sure we never use it.
++ set dummy $ac_cv_prog_CC
++ if test $# -gt 0; then
++ # We chose a different compiler from the bogus one.
++ # However, it has the same basename, so the bogon will be chosen
++ # first if we set CC to just the basename; use the full file name.
++ set dummy "$ac_dir/$ac_word" "$@"
++ echo "$ac_t""$CC" 1>&6
++ if test -z "$CC"; then
++ # Extract the first word of "cl", so it can be a program name with args.
++set dummy cl; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:613: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ if test -n "$CC"; then
++ ac_cv_prog_CC="$CC" # Let the user override the test.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ echo "$ac_t""$CC" 1>&6
++ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
++echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++cat > conftest.$ac_ext << EOF
++if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ ac_cv_prog_cc_works=yes
++ # If we can't run a trivial program, we are probably using a cross compiler.
++ if (./conftest; exit) 2>/dev/null; then
++ ac_cv_prog_cc_cross=no
++ ac_cv_prog_cc_cross=yes
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ ac_cv_prog_cc_works=no
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
++if test $ac_cv_prog_cc_works = no; then
++ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
++echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
++cross_compiling=$ac_cv_prog_cc_cross
++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
++echo "configure:692: checking whether we are using GNU C" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.c <<EOF
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++echo "$ac_t""$ac_cv_prog_gcc" 1>&6
++if test $ac_cv_prog_gcc = yes; then
++ac_test_CFLAGS="${CFLAGS+set}"
++ac_save_CFLAGS="$CFLAGS"
++echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
++echo "configure:720: checking whether ${CC-cc} accepts -g" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ echo 'void f(){}' > conftest.c
++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
++if test "$ac_test_CFLAGS" = set; then
++ CFLAGS="$ac_save_CFLAGS"
++elif test $ac_cv_prog_cc_g = yes; then
++ if test "$GCC" = yes; then
++ if test "$GCC" = yes; then
++echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
++echo "configure:753: checking how to run the C preprocessor" >&5
++# On Suns, sometimes $CPP names a directory.
++if test -n "$CPP" && test -d "$CPP"; then
++if test -z "$CPP"; then
++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ # This must be in double quotes, not single quotes, because CPP may get
++ # substituted into the Makefile and "${CC-cc}" will confuse make.
++ # On the NeXT, cc -E runs the code through the compiler's parser,
++ # not just through cpp.
++ cat > conftest.$ac_ext <<EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ CPP="${CC-cc} -E -traditional-cpp"
++ cat > conftest.$ac_ext <<EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ CPP="${CC-cc} -nologo -E"
++ cat > conftest.$ac_ext <<EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++echo "$ac_t""$CPP" 1>&6
++# If we find X, set shell vars x_includes and x_libraries to the
++# paths, otherwise set no_x=yes.
++# Uses ac_ vars as temps to allow command line to override cache and checks.
++# --without-x overrides everything else, but does not touch the cache.
++echo $ac_n "checking for X""... $ac_c" 1>&6
++echo "configure:837: checking for X" >&5
++# Check whether --with-x or --without-x was given.
++if test "${with_x+set}" = set; then
++# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
++if test "x$with_x" = xno; then
++ # The user explicitly disabled X.
++ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
++ # Both variables are already set.
++if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ # One or both of the vars are not set, and there is no cached value.
++ac_x_includes=NO ac_x_libraries=NO
++if mkdir conftestdir; then
++ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
++ cat > Imakefile <<'EOF'
++ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
++ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
++ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
++ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
++ for ac_extension in a so sl; do
++ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
++ test -f $ac_im_libdir/libX11.$ac_extension; then
++ ac_im_usrlibdir=$ac_im_libdir; break
++ # Screen out bogus values from the imake configuration. They are
++ # bogus both because they are the default anyway, and because
++ # using them would break gcc on systems where it needs fixed includes.
++ case "$ac_im_incroot" in
++ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
++ case "$ac_im_usrlibdir" in
++ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
++if test "$ac_x_includes" = NO; then
++ # Guess where to find include files, by looking for this one X11 .h file.
++ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
++ # First, try using that file with no special directory specified.
++cat > conftest.$ac_ext <<EOF
++#include <$x_direct_test_include>
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ # We can compile using X headers with no special include directory.
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ # Look for the header file in a standard set of common directories.
++# Check X11 before X11Rn because it is often a symlink to the current release.
++ /usr/local/X11/include \
++ /usr/local/X11R6/include \
++ /usr/local/X11R5/include \
++ /usr/local/X11R4/include \
++ /usr/local/include/X11 \
++ /usr/local/include/X11R6 \
++ /usr/local/include/X11R5 \
++ /usr/local/include/X11R4 \
++ /usr/XFree86/include/X11 \
++ /usr/unsupported/include \
++ /usr/local/x11r5/include \
++ /usr/lpp/Xamples/include \
++ /usr/openwin/include \
++ /usr/openwin/share/include \
++ if test -r "$ac_dir/$x_direct_test_include"; then
++fi # $ac_x_includes = NO
++if test "$ac_x_libraries" = NO; then
++ # Check for the libraries.
++ test -z "$x_direct_test_library" && x_direct_test_library=Xt
++ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
++ # See if we find them without any special options.
++ # Don't add to $LIBS permanently.
++ LIBS="-l$x_direct_test_library $LIBS"
++cat > conftest.$ac_ext <<EOF
++${x_direct_test_function}()
++if { (eval echo configure:980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++# We can link X programs with no special library path.
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++# First see if replacing the include by lib works.
++# Check X11 before X11Rn because it is often a symlink to the current release.
++for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
++ /usr/local/X11R6/lib \
++ /usr/local/X11R5/lib \
++ /usr/local/X11R4/lib \
++ /usr/local/lib/X11R6 \
++ /usr/local/lib/X11R5 \
++ /usr/local/lib/X11R4 \
++ /usr/XFree86/lib/X11 \
++ /usr/unsupported/lib \
++ /usr/local/x11r5/lib \
++ /usr/lpp/Xamples/lib \
++ /usr/openwin/share/lib \
++ for ac_extension in a so sl; do
++ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
++ ac_x_libraries=$ac_dir
++fi # $ac_x_libraries = NO
++if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
++ # Didn't find X anywhere. Cache the known absence of X.
++ ac_cv_have_x="have_x=no"
++ # Record where we found X for the cache.
++ ac_cv_have_x="have_x=yes \
++ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
++if test "$have_x" != yes; then
++ echo "$ac_t""$have_x" 1>&6
++ # If each of the values was on the command line, it overrides each guess.
++ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
++ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
++ # Update the cache value to reflect the command line values.
++ ac_cv_have_x="have_x=yes \
++ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
++ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
++if test "$no_x" = yes; then
++ # Not all programs may use this symbol, but it does not hurt to define it.
++ cat >> confdefs.h <<\EOF
++#define X_DISPLAY_MISSING 1
++ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
++ if test -n "$x_includes"; then
++ X_CFLAGS="$X_CFLAGS -I$x_includes"
++ # It would also be nice to do this for all -L options, not just this one.
++ if test -n "$x_libraries"; then
++ X_LIBS="$X_LIBS -L$x_libraries"
++ # For Solaris; some versions of Sun CC require a space after -R and
++ # others require no space. Words are not sufficient . . . .
++ case "`(uname -sr) 2>/dev/null`" in
++ echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
++echo "configure:1086: checking whether -R must be followed by a space" >&5
++ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
++ cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ if test $ac_R_nospace = yes; then
++ X_LIBS="$X_LIBS -R$x_libraries"
++ LIBS="$ac_xsave_LIBS -R $x_libraries"
++ cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ if test $ac_R_space = yes; then
++ echo "$ac_t""yes" 1>&6
++ X_LIBS="$X_LIBS -R $x_libraries"
++ echo "$ac_t""neither works" 1>&6
++ # Check for system-dependent libraries X programs must link with.
++ # Do this before checking for the system-independent R6 libraries
++ # (-lICE), since we may need -lsocket or whatever for X linking.
++ if test "$ISC" = yes; then
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
++ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
++ # libraries were built with DECnet support. And karl@cs.umb.edu says
++ # the Alpha needs dnet_stub (dnet does not exist).
++ echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
++echo "configure:1151: checking for dnet_ntoa in -ldnet" >&5
++ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
++ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
++ echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
++echo "configure:1192: checking for dnet_ntoa in -ldnet_stub" >&5
++ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++LIBS="-ldnet_stub $LIBS"
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
++ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
++ # to get the SysV transport functions.
++ # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
++ # The nsl library prevents programs from opening the X display
++ # on Irix 5.2, according to dickey@clark.net.
++ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
++echo "configure:1240: checking for gethostbyname" >&5
++if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char gethostbyname(); below. */
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
++if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_func_gethostbyname=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_func_gethostbyname=no"
++if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ if test $ac_cv_func_gethostbyname = no; then
++ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
++echo "configure:1289: checking for gethostbyname in -lnsl" >&5
++ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
++ # lieder@skyler.mavd.honeywell.com says without -lsocket,
++ # socket/setsockopt and other routines are undefined under SCO ODT
++ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
++ # on later versions), says simon@lia.di.epfl.ch: it contains
++ # gethostby* variants that don't use the nameserver (or something).
++ # -lsocket must be given before -lnsl if both are needed.
++ # We assume that if connect needs -lnsl, so does gethostbyname.
++ echo $ac_n "checking for connect""... $ac_c" 1>&6
++echo "configure:1338: checking for connect" >&5
++if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char connect(); below. */
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_connect) || defined (__stub___connect)
++if { (eval echo configure:1366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_func_connect=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_func_connect=no"
++if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ if test $ac_cv_func_connect = no; then
++ echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
++echo "configure:1387: checking for connect in -lsocket" >&5
++ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
++ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
++ echo $ac_n "checking for remove""... $ac_c" 1>&6
++echo "configure:1430: checking for remove" >&5
++if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char remove(); below. */
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_remove) || defined (__stub___remove)
++if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_func_remove=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_func_remove=no"
++if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ if test $ac_cv_func_remove = no; then
++ echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
++echo "configure:1479: checking for remove in -lposix" >&5
++ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
++ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
++ echo $ac_n "checking for shmat""... $ac_c" 1>&6
++echo "configure:1522: checking for shmat" >&5
++if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char shmat(); below. */
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_shmat) || defined (__stub___shmat)
++if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_func_shmat=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_func_shmat=no"
++if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ if test $ac_cv_func_shmat = no; then
++ echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
++echo "configure:1571: checking for shmat in -lipc" >&5
++ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
++ # Check for libraries that X11R6 Xt/Xaw programs need.
++ ac_save_LDFLAGS="$LDFLAGS"
++ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
++ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
++ # check for ICE first), but we must link in the order -lSM -lICE or
++ # we get undefined symbols. So assume we have SM if we have ICE.
++ # These have to be linked with before -lX11, unlike the other
++ # libraries we check for below, so use a different variable.
++ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
++ echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
++echo "configure:1623: checking for IceConnectionNumber in -lICE" >&5
++ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++LIBS="-lICE $X_EXTRA_LIBS $LIBS"
++cat > conftest.$ac_ext <<EOF
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char IceConnectionNumber();
++if { (eval echo configure:1642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
++ LDFLAGS="$ac_save_LDFLAGS"
++echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
++echo "configure:1667: checking for ANSI C header files" >&5
++if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++if test $ac_cv_header_stdc = yes; then
++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
++cat > conftest.$ac_ext <<EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++ egrep "memchr" >/dev/null 2>&1; then
++if test $ac_cv_header_stdc = yes; then
++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
++cat > conftest.$ac_ext <<EOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++ egrep "free" >/dev/null 2>&1; then
++if test $ac_cv_header_stdc = yes; then
++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
++if test "$cross_compiling" = yes; then
++ cat > conftest.$ac_ext <<EOF
++#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
++#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
++int main () { int i; for (i = 0; i < 256; i++)
++if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
++if { (eval echo configure:1747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++echo "$ac_t""$ac_cv_header_stdc" 1>&6
++if test $ac_cv_header_stdc = yes; then
++ cat >> confdefs.h <<\EOF
++for ac_hdr in malloc.h strings.h sys/time.h unistd.h
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:1774: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ eval "ac_cv_header_$ac_safe=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_header_$ac_safe=no"
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
++echo "configure:1812: checking for main in -lm" >&5
++ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking for main in -lz""... $ac_c" 1>&6
++echo "configure:1855: checking for main in -lz" >&5
++ac_lib_var=`echo z'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking for main in -lpng""... $ac_c" 1>&6
++echo "configure:1898: checking for main in -lpng" >&5
++ac_lib_var=`echo png'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking for main in -ljpeg""... $ac_c" 1>&6
++echo "configure:1941: checking for main in -ljpeg" >&5
++ac_lib_var=`echo jpeg'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking for main in -ltiff""... $ac_c" 1>&6
++echo "configure:1984: checking for main in -ltiff" >&5
++ac_lib_var=`echo tiff'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++cat > conftest.$ac_ext <<EOF
++if { (eval echo configure:1999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_lib_$ac_lib_var=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_lib_$ac_lib_var=no"
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo tiff | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
++echo "configure:2030: checking return type of signal handlers" >&5
++if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++extern "C" void (*signal (int, void (*)(int)))(int);
++if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ ac_cv_type_signal=void
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++echo "$ac_t""$ac_cv_type_signal" 1>&6
++cat >> confdefs.h <<EOF
++#define RETSIGTYPE $ac_cv_type_signal
++for ac_func in mkdir select
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:2073: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++ cat > conftest.$ac_ext <<EOF
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ eval "ac_cv_func_$ac_func=yes"
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ eval "ac_cv_func_$ac_func=no"
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++# This file is a shell script that caches the results of configure
++# tests run on this system so they can be shared between configure
++# scripts and configure runs. It is not useful on other systems.
++# If it contains results you don't want to keep, you may remove or edit it.
++# By default, configure uses ./config.cache as the cache file,
++# creating it if it does not exist already. You can give configure
++# the --cache-file=FILE option to use a different cache file; that is
++# what configure does when it calls configure scripts in
++# subdirectories, so they share the cache.
++# Giving --cache-file=/dev/null disables caching, for debugging configure.
++# config.status only pays attention to the cache file if you give it the
++# --recheck option to rerun configure.
++# The following way of writing the cache mishandles newlines in values,
++# but we know of no workaround that is simple, portable, and efficient.
++# So, don't put newlines in cache variables' values.
++# Ultrix sh set writes to stderr and can't be redirected directly,
++# and sets the high bit in the cache file unless we assign to the vars.
++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
++ # `set' does not quote correctly, so add quotes (double-quote substitution
++ # turns \\\\ into \\, and sed turns \\ into \).
++ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
++ # `set' quotes correctly as required by POSIX, so do not add quotes.
++ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
++if cmp -s $cache_file confcache; then
++ if test -w $cache_file; then
++ echo "updating cache $cache_file"
++ cat confcache > $cache_file
++ echo "not updating unwritable cache $cache_file"
++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
++test "x$prefix" = xNONE && prefix=$ac_default_prefix
++# Let make expand exec_prefix.
++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
++# Any assignment to VPATH causes Sun make to only execute
++# the first set of double-colon rules, so remove it if not needed.
++# If there is a colon in the path, we need to keep it.
++if test "x$srcdir" = x.; then
++ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
++# Without the "./", some shells look in PATH for config.status.
++: ${CONFIG_STATUS=./config.status}
++echo creating $CONFIG_STATUS
++cat > $CONFIG_STATUS <<EOF
++# Generated automatically by configure.
++# Run this file to recreate the current configuration.
++# This directory was configured as follows,
++# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++# $0 $ac_configure_args
++# Compiler output produced by configure, useful for debugging
++# configure, is in ./config.log if it exists.
++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
++ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
++ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
++ echo "$CONFIG_STATUS generated by autoconf version 2.13"
++ -help | --help | --hel | --he | --h)
++ echo "\$ac_cs_usage"; exit 0 ;;
++ *) echo "\$ac_cs_usage"; exit 1 ;;
++ac_given_srcdir=$srcdir
++trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
++cat >> $CONFIG_STATUS <<EOF
++# Protect against being on the right side of a sed subst in config.status.
++sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
++ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
++s%@CPPFLAGS@%$CPPFLAGS%g
++s%@CXXFLAGS@%$CXXFLAGS%g
++s%@exec_prefix@%$exec_prefix%g
++s%@program_transform_name@%$program_transform_name%g
++s%@libexecdir@%$libexecdir%g
++s%@sysconfdir@%$sysconfdir%g
++s%@sharedstatedir@%$sharedstatedir%g
++s%@localstatedir@%$localstatedir%g
++s%@includedir@%$includedir%g
++s%@oldincludedir@%$oldincludedir%g
++s%@X_CFLAGS@%$X_CFLAGS%g
++s%@X_PRE_LIBS@%$X_PRE_LIBS%g
++s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
++cat >> $CONFIG_STATUS <<\EOF
++# Split the substitutions into bite-sized pieces for seds with
++# small command number limits, like on Digital OSF/1 and HP-UX.
++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
++ac_file=1 # Number of current file.
++ac_beg=1 # First line for current file.
++ac_end=$ac_max_sed_cmds # Line after last line for current file.
++while $ac_more_lines; do
++ if test $ac_beg -gt 1; then
++ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
++ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
++ if test ! -s conftest.s$ac_file; then
++ rm -f conftest.s$ac_file
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds="sed -f conftest.s$ac_file"
++ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
++ ac_file=`expr $ac_file + 1`
++ ac_end=`expr $ac_end + $ac_max_sed_cmds`
++if test -z "$ac_sed_cmds"; then
++cat >> $CONFIG_STATUS <<EOF
++CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
++cat >> $CONFIG_STATUS <<\EOF
++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++ *) ac_file_in="${ac_file}.in" ;;
++ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
++ # Remove last slash and all that follows it. Not all systems have dirname.
++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
++ # The file is in a subdirectory.
++ test ! -d "$ac_dir" && mkdir "$ac_dir"
++ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
++ ac_dir_suffix= ac_dots=
++ case "$ac_given_srcdir" in
++ if test -z "$ac_dots"; then top_srcdir=.
++ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
++ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
++ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
++ top_srcdir="$ac_dots$ac_given_srcdir" ;;
++ echo creating "$ac_file"
++ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
++ *Makefile*) ac_comsub="1i\\
++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
++s%@configure_input@%$configure_input%g
++s%@top_srcdir@%$top_srcdir%g
++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
++# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
++# NAME is the cpp macro being defined and VALUE is the value it is being given.
++# ac_d sets the value in "#define NAME VALUE" lines.
++ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
++# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
++ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uB='\([ ]\)%\1#\2define\3'
++# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
++ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_eB='$%\1#\2define\3'
++if test "${CONFIG_HEADERS+set}" != set; then
++cat >> $CONFIG_STATUS <<EOF
++ CONFIG_HEADERS="config.h"
++cat >> $CONFIG_STATUS <<\EOF
++for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++ *) ac_file_in="${ac_file}.in" ;;
++ echo creating $ac_file
++ rm -f conftest.frag conftest.in conftest.out
++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
++ cat $ac_file_inputs > conftest.in
++# Transform confdefs.h into a sed script conftest.vals that substitutes
++# the proper values into config.h.in to produce config.h. And first:
++# Protect against being on the right side of a sed subst in config.status.
++# Protect against being in an unquoted here document in config.status.
++cat > conftest.hdr <<\EOF
++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
++sed -n -f conftest.hdr confdefs.h > conftest.vals
++# This sed command replaces #undef with comments. This is necessary, for
++# example, in the case of _POSIX_SOURCE, which is predefined and required
++# on some systems where configure will not decide to define it.
++cat >> conftest.vals <<\EOF
++s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
++# Break up conftest.vals because some shells have a limit on
++# the size of here documents, and old seds have small limits too.
++ ac_lines=`grep -c . conftest.vals`
++ # grep -c gives empty output for an empty file on some AIX systems.
++ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
++ # Write a limited-size here document to conftest.frag.
++ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
++ sed -f conftest.frag conftest.in > conftest.out
++ mv conftest.out conftest.in
++ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
++ mv conftest.tail conftest.vals
++cat >> $CONFIG_STATUS <<\EOF
++ rm -f conftest.frag conftest.h
++ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
++ cat conftest.in >> conftest.h
++ if cmp -s $ac_file conftest.h 2>/dev/null; then
++ echo "$ac_file is unchanged"
++ # Remove last slash and all that follows it. Not all systems have dirname.
++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
++ # The file is in a subdirectory.
++ test ! -d "$ac_dir" && mkdir "$ac_dir"
++ mv conftest.h $ac_file
++cat >> $CONFIG_STATUS <<EOF
++cat >> $CONFIG_STATUS <<\EOF
++chmod +x $CONFIG_STATUS
++rm -fr confdefs* $ac_clean_files
++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+Index: xloadimage.4.1.old/configure.in
+===================================================================
++++ xloadimage.4.1.old/configure.in
++dnl Process this file with autoconf to produce a configure script.
++AC_CONFIG_HEADER(config.h)
++dnl Checks for programs.
++dnl Checks for header files.
++AC_CHECK_HEADERS(malloc.h strings.h sys/time.h unistd.h)
++dnl Checks for libraries.
++dnl Replace `main' with a function in -lm:
++dnl Replace `main' with a function in -lz:
++dnl Replace `main' with a function in -lpng:
++AC_CHECK_LIB(png, main)
++dnl Replace `main' with a function in -ljpeg:
++AC_CHECK_LIB(jpeg, main)
++dnl Replace `main' with a function in -ltiff:
++AC_CHECK_LIB(tiff, main)
++dnl Checks for typedefs, structures, and compiler characteristics.
++dnl Checks for library functions.
+Index: xloadimage.4.1.old/configure.scan
+===================================================================
++++ xloadimage.4.1.old/configure.scan
++dnl Process this file with autoconf to produce a configure script.
++dnl Checks for programs.
++dnl Checks for libraries.
++dnl Replace `main' with a function in -lX11:
++AC_CHECK_LIB(X11, main)
++dnl Replace `main' with a function in -lXext:
++AC_CHECK_LIB(Xext, main)
++dnl Replace `main' with a function in -ljpeg:
++AC_CHECK_LIB(jpeg, main)
++dnl Replace `main' with a function in -lm:
++dnl Replace `main' with a function in -ltiff:
++AC_CHECK_LIB(tiff, main)
++dnl Replace `main' with a function in -lz:
++dnl Checks for header files.
++AC_CHECK_HEADERS(malloc.h strings.h sys/time.h unistd.h)
++dnl Checks for typedefs, structures, and compiler characteristics.
++dnl Checks for library functions.
++AC_CHECK_FUNCS(mkdir select)
+Index: xloadimage.4.1.old/fbm.c
+===================================================================
+--- xloadimage.4.1.old.orig/fbm.c
++++ xloadimage.4.1.old/fbm.c
+@@ -45,12 +45,12 @@ static int fbmin_img_bits; /* co
+ static int fbmin_img_rowlen; /* length of one row of data */
+ static int fbmin_img_plnlen; /* length of one plane of data */
+ static int fbmin_img_clrlen; /* length of the colormap */
+-static int fbmin_img_aspect; /* image aspect ratio */
++static double fbmin_img_aspect; /* image aspect ratio */
+ static int fbmin_img_physbits; /* physical bits per pixel */
+ static char *fbmin_img_title; /* name of image */
+ static char *fbmin_img_credit; /* credit for image */
+-static fbmin_image_test()
++static int fbmin_image_test()
+ if (fbmin_img_width < 1 || fbmin_img_width > 32767) {
+ fprintf (stderr, "Invalid width (%d) on input\n", fbmin_img_width);
+@@ -93,7 +93,7 @@ static fbmin_image_test()
+ if (fbmin_img_aspect < 0.01 || fbmin_img_aspect > 100.0) {
+- fprintf (stderr, "Invalid aspect ratio %lg on input\n",
++ fprintf (stderr, "Invalid aspect ratio %1.3f on input\n",
+ return FBMIN_ERR_BAD_SD;
+@@ -133,7 +133,7 @@ ZFILE *s;
+ fbmin_img_rowlen = atoi(phdr.rowlen);
+ fbmin_img_plnlen = atoi(phdr.plnlen);
+ fbmin_img_clrlen = atoi(phdr.clrlen);
+- fbmin_img_aspect = atoi(phdr.aspect);
++ fbmin_img_aspect = atof(phdr.aspect);
+ fbmin_img_physbits = atoi(phdr.physbits);
+ fbmin_img_title = phdr.title;
+ fbmin_img_credit = phdr.credits;
+@@ -204,7 +204,6 @@ Image *fbmLoad(fullname, name, verbose)
+ register int x, y, j, k, rowlen, plnlen;
+ unsigned char *pixptr, *cm;
+ unsigned char *r, *g, *b;
+ if (! (zf= zopen(fullname)))
+Index: xloadimage.4.1.old/image.h
+===================================================================
+--- xloadimage.4.1.old.orig/image.h
++++ xloadimage.4.1.old/image.h
+ * copyright information.
+ #if !defined(_ArgProto)
+ #define _ArgProto(ARGS) ARGS
++#else /* !STDC_HEADERS */
+ #if !defined(const) /* "const" is an ANSI thing */
+ #define _ArgProto(ARGS) ()
++#endif /* !STDC_HEADERS */
+ /* handle strings stuff that varies between BSD and ANSI/SYSV
+-#if defined(IS_BSD) && !defined(__STDC__)
+-#if !defined(strchr) && !defined(index)
+-#if !defined(strrchr) && !defined(rindex)
+-#if !defined(memcpy) && !defined(bcopy)
+-#define memcpy(D,S,L) bcopy((char *)(S),(char *)(D),(L))
+-#if !defined(memset) && !defined(bzero)
+-/* #define memset(D,V,L) bzero(D,L) */
+-#else /* !IS_BSD || __STDC__ */
++#else /* !HAVE_STRINGS_H */
+ #if !defined(index) && !defined(strchr)
+ #if !defined(bzero) && !defined(memset)
+ #define bzero(D,L) memset((void *)(D),0,(L))
+-#endif /* !IS_BSD || __STDC__ */
++#endif /* !HAVE_STRINGS_H */
+@@ -230,7 +222,7 @@ void gray _ArgProto((Image *image, unsig
+ Image *normalize _ArgProto((Image *image, unsigned int verbose));
+-void compress _ArgProto((Image *image, unsigned int verbose));
++void compress_cmap _ArgProto((Image *image, unsigned int verbose));
+ Image *dither _ArgProto((Image *image, unsigned int verbose));
+@@ -331,3 +323,5 @@ extern int _Xdebug;
++#endif /* __IMAGE_H__ */
+Index: xloadimage.4.1.old/imagetypes.c
+===================================================================
+--- xloadimage.4.1.old.orig/imagetypes.c
++++ xloadimage.4.1.old/imagetypes.c
++extern int findImage(char *name, char *fullname);
+@@ -46,7 +46,7 @@ Image *loadImage(globalopts, options, na
+ for (a= 0; ImageTypes[a].loader; a++)
+ if (!strncmp(ImageTypes[a].type, opt->info.type, strlen(opt->info.type))) {
+- if (image= ImageTypes[a].loader(fullname, name, verbose)) {
++ if ((image= ImageTypes[a].loader(fullname, name, verbose))) {
+ /* this converts a 1-bit RGB image to a bitmap prior to blitting
+@@ -79,7 +79,7 @@ Image *loadImage(globalopts, options, na
+ for (a= 0; ImageTypes[a].loader; a++) {
+ debug(("Checking %s against loader for %s\n", fullname, ImageTypes[a].name));
+- if (image= ImageTypes[a].loader(fullname, name, verbose)) {
++ if ((image= ImageTypes[a].loader(fullname, name, verbose))) {
+ /* this does the 1-bit conversion as above.
+@@ -145,7 +145,10 @@ void dumpImage(image, type, filename, ve
+ optptr++; /* skip comma */
+- strcpy(typename, type);
++ strncpy(typename, type, 31);
+ for (a= 0; ImageTypes[a].loader; a++)
+ if (!strncmp(ImageTypes[a].type, typename, strlen(typename))) {
+Index: xloadimage.4.1.old/imagetypes.h
+===================================================================
+--- xloadimage.4.1.old.orig/imagetypes.h
++++ xloadimage.4.1.old/imagetypes.h
++#ifndef __IMAGETYPES_H__
++#define __IMAGETYPES_H__
+@@ -28,12 +31,15 @@ Image *pdsLoad();
+@@ -56,18 +62,21 @@ int pdsIdent();
+@@ -82,32 +91,39 @@ struct {
+ char *type; /* image type name */
+ char *name; /* name of this image format */
+- niffIdent, niffLoad, niffDump, "niff", "Native Image File Format (NIFF)",
+- sunRasterIdent, sunRasterLoad, NULL, "sunraster", "Sun Rasterfile",
+- gifIdent, gifLoad, NULL, "gif", "GIF Image",
+- jpegIdent, jpegLoad, jpegDump, "jpeg", "JFIF-style JPEG Image",
+- tiffIdent, tiffLoad, tiffDump, "tiff", "TIFF image",
+- fbmIdent, fbmLoad, NULL, "fbm", "FBM Image",
+- cmuwmIdent, cmuwmLoad, NULL, "cmuraster", "CMU WM Raster",
+- pbmIdent, pbmLoad, pbmDump, "pbm", "Portable Bit Map (PBM, PGM, PPM)",
+- facesIdent, facesLoad, NULL, "faces", "Faces Project",
+- rleIdent, rleLoad, NULL, "rle", "Utah RLE Image",
+- xwdIdent, xwdLoad, NULL, "xwd", "X Window Dump",
+- vffIdent, vffLoad, NULL, "vff", "Sun Visualization File Format",
+- mcidasIdent, mcidasLoad, NULL, "mcidas", "McIDAS areafile",
++ {niffIdent, niffLoad, niffDump, "niff", "Native Image File Format (NIFF)"},
++ {sunRasterIdent, sunRasterLoad, NULL, "sunraster", "Sun Rasterfile"},
++ {gifIdent, gifLoad, NULL, "gif", "GIF Image"},
++ {jpegIdent, jpegLoad, jpegDump, "jpeg", "JFIF-style JPEG Image"},
++ {tiffIdent, tiffLoad, tiffDump, "tiff", "TIFF image"},
++ {pngIdent, pngLoad, NULL, "png", "PNG image"},
++ {fbmIdent, fbmLoad, NULL, "fbm", "FBM Image"},
++ {cmuwmIdent, cmuwmLoad, NULL, "cmuraster", "CMU WM Raster"},
++ {pbmIdent, pbmLoad, pbmDump, "pbm", "Portable Bit Map (PBM, PGM, PPM)"},
++ {facesIdent, facesLoad, NULL, "faces", "Faces Project"},
++ {rleIdent, rleLoad, NULL, "rle", "Utah RLE Image"},
++ {xwdIdent, xwdLoad, NULL, "xwd", "X Window Dump"},
++ {vffIdent, vffLoad, NULL, "vff", "Sun Visualization File Format"},
++ {mcidasIdent, mcidasLoad, NULL, "mcidas", "McIDAS areafile"},
+- pdsIdent, pdsLoad, NULL, "pds", "PDS/VICAR Image",
++ {pdsIdent, pdsLoad, NULL, "pds", "PDS/VICAR Image"},
+- vicarIdent, vicarLoad, NULL, "vicar", "VICAR Image",
++ {vicarIdent, vicarLoad, NULL, "vicar", "VICAR Image"},
+- pcxIdent, pcxLoad, NULL, "pcx", "PC Paintbrush Image",
+- imgIdent, imgLoad, NULL, "gem", "GEM Bit Image",
+- macIdent, macLoad, NULL, "macpaint", "MacPaint Image",
+- xpixmapIdent, xpixmapLoad, NULL, "xpm", "X Pixmap",
+- xbitmapIdent, xbitmapLoad, NULL, "xbm", "X Bitmap",
+- NULL, NULL, NULL, NULL, NULL
++ {pcxIdent, pcxLoad, NULL, "pcx", "PC Paintbrush Image"},
++ {imgIdent, imgLoad, NULL, "gem", "GEM Bit Image"},
++ {macIdent, macLoad, NULL, "macpaint", "MacPaint Image"},
++ {xpixmapIdent, xpixmapLoad, NULL, "xpm", "X Pixmap"},
++ {xbitmapIdent, xbitmapLoad, NULL, "xbm", "X Bitmap"},
++ {NULL, NULL, NULL, NULL, NULL}
++void dumpImage (Image *image, char *type, char *filename, int verbose);
++#endif /* __IMAGETYPES_H__ */
+Index: xloadimage.4.1.old/img.c
+===================================================================
+--- xloadimage.4.1.old.orig/img.c
++++ xloadimage.4.1.old/img.c
+@@ -71,11 +70,15 @@ typedef struct ximg_header
++#ifdef UNUSED_FUNCTIONS
++#endif /* UNUSED_FUNCTIONS */
+ static void transf0 ();
+ static void transf1 ();
++#ifdef UNUSED_FUNCTIONS
+ static void transf2 ();
++#endif /* UNUSED_FUNCTIONS */
+ static void transf3 ();
+ static void xread_img ();
+ static void xread_line ();
+@@ -89,8 +92,9 @@ XIMG_HEADER xheader;
+ unsigned int ScanByteBreite, max_planes,
+ pattern_len, plane, x, y, ByteNr, height;
+ unsigned char *ptr, Muster[ALL_PLANES][BUFSIZ], tmp[BUFSIZ];
++#ifdef UNUSED_FUNCTIONS
+ static unsigned char *bitplane[ALL_PLANES], *lastbitplane;
++#endif /* UNUSED_FUNCTIONS */
+ static void transf0(bitimage, plane, value, planes)
+@@ -128,7 +132,7 @@ static void transf1(bitimage, plane, val
++#ifdef UNUSED_FUNCTIONS
+ static void transf2(bitimage, plane, value, planes)
+ unsigned char *bitimage;
+@@ -146,6 +150,7 @@ static void transf2(bitimage, plane, val
+ bitplane[plane][x] = value;
++#endif /* UNUSED_FUNCTIONS */
+ static void transf3(bitimage, plane, value, planes)
+ unsigned char *bitimage;
+@@ -367,9 +372,10 @@ static int ident_img(name)
+ strncpy (extention, name+strlen(name)-4, 4);
+ if (strcmp(extention, ".IMG") != 0 && strcmp(extention, ".img") != 0)
+@@ -402,7 +408,7 @@ static int ident_img(name)
+ printf("%s is a %dx%d monochrome IMG-file\n",name , w, h);
+- printf("%s is a %dx%d IMG-file with %ld colors\n",name , w, h,
++ printf("%s is a %dx%d IMG-file with %d colors\n",name , w, h,
+ printf("%s is a %dx%d %d-bit IMG-file\n",name , w, h, nplanes);
+@@ -413,7 +419,7 @@ static Image *load_img(name)
+ unsigned long w, h, nplanes, headlength, scanwidth;
+@@ -564,7 +570,6 @@ static int ident_ximg(name)
+ if ((file = zopen(name)) == NULL)
+@@ -593,7 +598,7 @@ static int ident_ximg(name)
+ printf("%s\n is a %dx%d ",name, w, h);
+- printf("RGB XIMG-file with %ld colors\n", 1<<nplanes);
++ printf("RGB XIMG-file with %d colors\n", 1<<nplanes);
+ printf("24-bit XIMG-file\n");
+@@ -602,8 +607,6 @@ static int ident_ximg(name)
+ static int vdi2pli(vdi, plimax)
+- extern unsigned char indexToCode[];
+- extern int work_ext[];
+ static char vdi2pli[] = {0, 15, 1, 2, 4, 6, 3, 5, 7, 8, 9, 10, 12, 14, 11, 13 };
+@@ -614,7 +617,7 @@ static int vdi2pli(vdi, plimax)
++#ifdef UNUSED_FUNCTIONS
+ static int pli2vdi(pli, plimax)
+@@ -626,15 +629,16 @@ static int pli2vdi(pli, plimax)
++#endif /* UNUSED_FUNCTIONS */
+ static Image *load_ximg(name)
+ unsigned long w, h, nplanes, scanwidth;
+Index: xloadimage.4.1.old/install-sh
+===================================================================
++++ xloadimage.4.1.old/install-sh
++# install - install a program, script, or datafile
++# This comes from X11R5.
++# Calling this script install-sh is preferred over install.sh, to prevent
++# `make' implicit rules from creating a file called install from it
++# when there is no Makefile.
++# This script is compatible with the BSD install script, but was written
++# set DOITPROG to echo to test this script
++# Don't use :- since 4.3BSD and earlier shells don't like it.
++# put in absolute paths if you don't have them in your path; or use env. vars.
++chmodprog="${CHMODPROG-chmod}"
++chownprog="${CHOWNPROG-chown}"
++chgrpprog="${CHGRPPROG-chgrp}"
++stripprog="${STRIPPROG-strip}"
++mkdirprog="${MKDIRPROG-mkdir}"
++chmodcmd="$chmodprog 0755"
++while [ x"$1" != x ]; do
++ -m) chmodcmd="$chmodprog $2"
++ -o) chowncmd="$chownprog $2"
++ -g) chgrpcmd="$chgrpprog $2"
++ -s) stripcmd="$stripprog"
++ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
++ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
++ # this colon is to work around a 386BSD /bin/sh bug
++ echo "install: no input file specified"
++if [ x"$dir_arg" != x ]; then
++# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
++# might cause directories to be created, which would be especially bad
++# if $src (and thus $dsttmp) contains '*'.
++ if [ -f $src -o -d $src ]
++ echo "install: $src does not exist"
++ echo "install: no destination specified"
++# If destination is a directory, append the input filename; if your system
++# does not like double slashes in filenames, you may need to add some logic
++ dst="$dst"/`basename $src`
++## this sed command emulates the dirname command
++dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
++# Make sure that the destination directory exists.
++# this part is taken from Noah Friedman's mkinstalldirs script
++# Skip lots of stat calls in the usual case.
++if [ ! -d "$dstdir" ]; then
++IFS="${IFS-${defaultIFS}}"
++# Some sh's can't handle IFS=/ for some reason.
++set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
++while [ $# -ne 0 ] ; do
++ pathcomp="${pathcomp}${1}"
++ if [ ! -d "${pathcomp}" ] ;
++ $mkdirprog "${pathcomp}"
++ pathcomp="${pathcomp}/"
++if [ x"$dir_arg" != x ]
++ $doit $instcmd $dst &&
++ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
++ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
++ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
++ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
++# If we're going to rename the final executable, determine the name now.
++ if [ x"$transformarg" = x ]
++ dstfile=`basename $dst`
++ dstfile=`basename $dst $transformbasename |
++ sed $transformarg`$transformbasename
++# don't allow the sed command to completely eliminate the filename
++ if [ x"$dstfile" = x ]
++ dstfile=`basename $dst`
++# Make a temp file name in the proper directory.
++ dsttmp=$dstdir/#inst.$$#
++# Move or copy the file name to the temp name
++ $doit $instcmd $src $dsttmp &&
++ trap "rm -f ${dsttmp}" 0 &&
++# and set any options; do chmod last to preserve setuid bits
++# If any of these fail, we abort the whole thing. If we want to
++# ignore errors from any of these, just make sure not to ignore
++# errors from the above "$doit $instcmd $src $dsttmp" command.
++ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
++ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
++ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
++ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
++# Now rename the file to the real destination.
++ $doit $rmcmd -f $dstdir/$dstfile &&
++ $doit $mvcmd $dsttmp $dstdir/$dstfile
+Index: xloadimage.4.1.old/jpeg.c
+===================================================================
+--- xloadimage.4.1.old.orig/jpeg.c
++++ xloadimage.4.1.old/jpeg.c
+ * free JPEG software. See jpeg.README for more information.
+ * This code is based on example.c from the IJG v4 distribution.
++ * 1998/08/19: Change for IJG v6.0a. dump Progressive JPEG support.
+ #include "image.h" /* xloadimage declarations */
+-#include "jpeg.conf.h" /* definitions used in jpeg directory */
+-#include "jpeg/jinclude.h" /* IJG declarations */
+ #include <setjmp.h> /* need setjmp/longjmp */
+-/* Error-catching routines */
++# define debug(xx) fprintf(stderr,xx)
++static Image *image; /* xloadimage image being returned */
+-static unsigned int verbose;
+-static unsigned int identify;
+ static jmp_buf setjmp_buffer; /* for return to caller */
+-static external_methods_ptr emethods; /* needed for access to message_parm */
++ZFILE * zinput_file; /* tells input routine where to read JPEG */
++static JOCTET jpeg_read_buff[1024 * 16];
+-trace_message (msgtext)
++static void init_source( j_decompress_ptr cinfo)
+- fprintf(stderr, "jpegLoad: %s - ", filename);
+- fprintf(stderr, msgtext,
+- emethods->message_parm[0], emethods->message_parm[1],
+- emethods->message_parm[2], emethods->message_parm[3],
+- emethods->message_parm[4], emethods->message_parm[5],
+- emethods->message_parm[6], emethods->message_parm[7]);
+- fprintf(stderr, "\n"); /* there is no \n in the format string! */
+- trace_message(msgtext); /* report the error message */
+- (*emethods->free_all) (); /* clean up memory allocation & temp files */
+- longjmp(setjmp_buffer, 1); /* return control to outer routine */
++ debug("init_source()");
++static boolean fill_input_buffer( j_decompress_ptr cinfo)
++ struct jpeg_source_mgr *src = cinfo->src;
+-/* Output-acceptance routines */
+-static Image *image; /* xloadimage image being returned */
+-static int rows_put; /* Number of rows copied to image */
+- decompress_info_ptr cinfo;
+-/* Initialize for output */
+- if (cinfo->out_color_space == CS_GRAYSCALE) {
+- image = newRGBImage(cinfo->image_width,cinfo->image_height,8);
+- image->title = dupString(filename);
+- /* set a linear map */
+- *(image->rgb.red + i) =
+- *(image->rgb.green + i) =
+- *(image->rgb.blue + i) = i<<8;
+- image->rgb.used = 256;
+- } else if (cinfo->out_color_space == CS_RGB) {
+- image = newTrueImage(cinfo->image_width,cinfo->image_height);
+- image->title = dupString(filename);
+- ERREXIT(cinfo->emethods, "Cannot cope with JPEG image colorspace");
++ debug("fill_input_buffer()");
++ fprintf( stderr,"fill_input_buffer(): %d ",src->bytes_in_buffer);
++ src->next_input_byte = jpeg_read_buff;
++ src->bytes_in_buffer = zread(zinput_file,
++ jpeg_read_buff, sizeof(jpeg_read_buff));
++ if(src->bytes_in_buffer <= 0){
++ WARNMS(cinfo, JWRN_JPEG_EOF);
++ jpeg_read_buff[0] = 0xFF;
++ jpeg_read_buff[1] = JPEG_EOI;
++ src->bytes_in_buffer = 2;
++static void skip_input_data( j_decompress_ptr cinfo, long num_bytes)
++ struct jpeg_source_mgr *src = cinfo->src;
++ debug("skip_input_data()");
++ fprintf(stderr,": %ld,%d ", num_bytes, src->bytes_in_buffer);
++ if( num_bytes < 1) return;
++ rest = src->bytes_in_buffer;
++ if( num_bytes < rest) {
++ src->next_input_byte += num_bytes;
++ src->bytes_in_buffer -= num_bytes;;
++ fill_input_buffer(cinfo);
+-put_color_map (cinfo, num_colors, colormap)
+- decompress_info_ptr cinfo;
+-/* Write the color map -- should not be called */
++static boolean resync_to_restart( j_decompress_ptr cinfo, int desired)
+- fprintf(stderr, "put_color_map called: there is a bug here somewhere!\n");
++ return jpeg_resync_to_restart( cinfo, desired);
+-put_pixel_rows (cinfo, num_rows, pixel_data)
+- decompress_info_ptr cinfo;
+- JSAMPIMAGE pixel_data;
+-/* Write some rows of output data */
+- register unsigned char *bufp;
+- register JSAMPROW ptr0, ptr1, ptr2;
+- long width = cinfo->image_width;
+- if (cinfo->out_color_space == CS_GRAYSCALE) {
+- bufp = image->data + rows_put * width;
+- /* Assume JSAMPLE == chars */
+- for (row = 0; row < num_rows; row++) {
+- bcopy(pixel_data[0][row],bufp,width);
+- bufp = image->data + rows_put * width * 3;
+- for (row = 0; row < num_rows; row++) {
+- ptr0 = pixel_data[0][row];
+- ptr1 = pixel_data[1][row];
+- ptr2 = pixel_data[2][row];
+- for (col = width; col > 0; col--) {
++static void term_source( j_decompress_ptr cinfo)
++ debug("term_source()");
+- decompress_info_ptr cinfo;
+-/* Finish up at the end of the output */
++output_message ( j_common_ptr cominfo)
++ char buf[JMSG_LENGTH_MAX];
+-/* Input-file-reading routine */
+-static ZFILE * input_file; /* tells input routine where to read JPEG */
++ (*cominfo->err->format_message)(cominfo, buf);
++ fprintf(stderr, "jpegLoad: %s - %s\n", filename, buf);
+- decompress_info_ptr cinfo;
++static void error_exit (j_common_ptr cominfo)
+- cinfo->next_input_byte = cinfo->input_buffer + MIN_UNGET;
+- cinfo->bytes_in_buffer = zread(input_file,
+- (byte *)cinfo->next_input_byte,
+- if (cinfo->bytes_in_buffer <= 0) {
+- WARNMS(cinfo->emethods, "Premature EOF in JPEG file");
+- cinfo->next_input_byte[0] = (char) 0xFF;
+- cinfo->next_input_byte[1] = (char) 0xD9; /* EOI marker */
+- cinfo->bytes_in_buffer = 2;
++ output_message( cominfo);
++ longjmp(setjmp_buffer, 1); /* return control to outer routine */
+-/* Required control-hook routine */
+-d_ui_method_selection (cinfo)
+- decompress_info_ptr cinfo;
++ j_decompress_ptr cinfo;
+- /* if grayscale input, force grayscale output; */
+- /* else leave the output colorspace as set by main routine. */
+- if (cinfo->jpeg_color_space == CS_GRAYSCALE)
+- cinfo->out_color_space = CS_GRAYSCALE;
+- /* Create display of image parameters */
++ /* Create display of image parameters */
+ printf("%s is a %dx%d JPEG image, color space ", filename,
+ cinfo->image_width, cinfo->image_height);
+ switch (cinfo->jpeg_color_space) {
+ printf(", %d comp%s,", cinfo->num_components,
+- cinfo->num_components ? "s." : ".");
++ (cinfo->num_components - 1) ? "s" : "");
++ if (cinfo->progressive_mode)
++ printf(" Progressive,");
+- printf(" Arithmetic coding\n");
++ printf(" Arithmetic coding.\n");
+- printf(" Huffman coding\n");
+- /* Turn off caching beyond this point of the file */
+- /* If we only wanted to identify the image, abort now */
+- (*emethods->free_all) (); /* clean up memory allocation & temp files */
+- longjmp(setjmp_buffer, 10); /* return control with success code */
+- /* select output routines */
+- cinfo->methods->output_init = output_init;
+- cinfo->methods->put_color_map = put_color_map;
+- cinfo->methods->put_pixel_rows = put_pixel_rows;
+- cinfo->methods->output_term = output_term;
++ printf(" Huffman coding.\n");
+ /* Main control routine for loading */
+-jpegLoad (fullname, name, vbose)
++jpegLoad (fullname, name, verbose)
+- struct Decompress_info_struct cinfo;
+- struct Decompress_methods_struct dc_methods;
+- struct External_methods_struct e_methods;
+- input_file = zopen(fullname); /* Open the input file */
+- if (input_file == NULL)
+- /* Quick check to see if file starts with JPEG SOI marker */
+- if (zgetc(input_file) != 0xFF || zgetc(input_file) != 0xD8) {
++ struct jpeg_decompress_struct cinfo;
++ struct jpeg_source_mgr src_mgr;
++ struct jpeg_error_mgr err_mgr;
++ zinput_file = zopen(fullname); /* Open the input file */
++ if (zinput_file == NULL)
++ filename = name; /* copy parms to static vars */
++ image = NULL; /* in case we fail before creating image */
++ jpeg_create_decompress(&cinfo);
++ src_mgr.init_source = init_source;
++ src_mgr.fill_input_buffer = fill_input_buffer;
++ src_mgr.skip_input_data = skip_input_data;
++ src_mgr.resync_to_restart = resync_to_restart;
++ src_mgr.term_source = term_source;
++ cinfo.src = &src_mgr; /* links to method structs */
++ err_mgr.error_exit = error_exit; /* supply error-exit routine */
++ err_mgr.output_message = output_message;
++ err_mgr.trace_level = 0; /* default = no tracing */
++ err_mgr.num_warnings = 0; /* no warnings emitted yet */
++ cinfo.err = jpeg_std_error(&err_mgr);
++ src_mgr.bytes_in_buffer = 0;
++ fill_input_buffer( &cinfo);
++ /* Quick check to see if file starts with JPEG SOI marker */
++ if(jpeg_read_buff[0] != 0xFF || jpeg_read_buff[1] != 0xD8) {
++ /* prepare setjmp context for possible exit from error_exit */
++ if (setjmp(setjmp_buffer)) {
++ /* If we get here, the JPEG code has signaled an error. */
++ /* Return as much of the image as we could get. */
++ jpeg_destroy_decompress(&cinfo);
++ jpeg_read_header(&cinfo, TRUE);
++ if (verbose) jpegInfo(&cinfo);
++ /* Turn off caching beyond this point of the file */
++ znocache(zinput_file);
++ jpeg_start_decompress(&cinfo);
++ switch (cinfo.out_color_space) {
++ image = newRGBImage(cinfo.image_width,cinfo.image_height,8);
++ image->title = dupString(filename);
++ /* set a linear map */
++ *(image->rgb.red + i) =
++ *(image->rgb.green + i) =
++ *(image->rgb.blue + i) = i << 8;
++ image->rgb.used = 256;
++ image = newTrueImage(cinfo.image_width,cinfo.image_height);
++ image->title = dupString(filename);
++ ERREXITS(&cinfo, 1, "Cannot cope with JPEG image colorspace");
++ row_stride = cinfo.output_width * cinfo.output_components;
++ while (cinfo.output_scanline < cinfo.output_height) {
++ jpeg_read_scanlines(&cinfo, &bufp, 1);
++ jpeg_finish_decompress(&cinfo);
++ jpeg_destroy_decompress(&cinfo);
++ zclose(zinput_file); /* Done, close the input file */
+- filename = name; /* copy parms to static vars */
+- image = NULL; /* in case we fail before creating image */
+- cinfo.methods = &dc_methods; /* links to method structs */
+- cinfo.emethods = &e_methods;
+- emethods = &e_methods; /* save struct addr for possible access */
+- e_methods.error_exit = error_exit; /* supply error-exit routine */
+- e_methods.trace_message = trace_message; /* supply trace-message routine */
+- e_methods.trace_level = 0; /* default = no tracing */
+- e_methods.num_warnings = 0; /* no warnings emitted yet */
+- e_methods.first_warning_level = 0; /* display first corrupt-data warning */
+- e_methods.more_warning_level = 3; /* but suppress additional ones */
+- /* prepare setjmp context for possible exit from error_exit */
+- if (setjmp(setjmp_buffer)) {
+- /* If we get here, the JPEG code has signaled an error. */
+- /* Return as much of the image as we could get. */
+- jselmemmgr(&e_methods); /* select std memory allocation routines */
+- /* Set up default decompression parameters. */
+- j_d_defaults(&cinfo, TRUE);
+- /* Override default methods */
+- dc_methods.d_ui_method_selection = d_ui_method_selection;
+- dc_methods.read_jpeg_data = read_jpeg_data;
+- /* Insert fake SOI into the input buffer --- needed cause we read it above */
+- cinfo.next_input_byte = cinfo.input_buffer + MIN_UNGET;
+- cinfo.next_input_byte[0] = (char) 0xFF;
+- cinfo.next_input_byte[1] = (char) 0xD8; /* SOI marker */
+- cinfo.bytes_in_buffer = 2;
+- /* Set up to read a JFIF or baseline-JPEG file. */
+- /* This is the only JPEG file format currently supported. */
+- jpeg_decompress(&cinfo);
+- zclose(input_file); /* Done, close the input file */
+-/* Main control routine for identifying JPEG without loading */
++ Main control routine for identifying JPEG without loading
++ return 0: Not jpeg file.
+ jpegIdent (fullname, name)
+- struct Decompress_info_struct cinfo;
+- struct Decompress_methods_struct dc_methods;
+- struct External_methods_struct e_methods;
+- input_file = zopen(fullname); /* Open the input file */
+- if (input_file == NULL)
+- /* Quick check to see if file starts with JPEG SOI marker */
+- if (zgetc(input_file) != 0xFF || zgetc(input_file) != 0xD8) {
++ struct jpeg_decompress_struct cinfo;
++ struct jpeg_source_mgr src_mgr;
++ struct jpeg_error_mgr err_mgr;
++ zinput_file = zopen(fullname); /* Open the input file */
++ if (zinput_file == NULL)
++ filename = name; /* copy parms to static vars */
++ jpeg_create_decompress(&cinfo);
++ src_mgr.init_source = init_source;
++ src_mgr.fill_input_buffer = fill_input_buffer;
++ src_mgr.skip_input_data = skip_input_data;
++ src_mgr.resync_to_restart = resync_to_restart;
++ src_mgr.term_source = term_source;
++ cinfo.src = &src_mgr; /* links to method structs */
++ err_mgr.error_exit = error_exit; /* supply error-exit routine */
++ err_mgr.output_message = output_message;
++ err_mgr.trace_level = 0; /* default = no tracing */
++ err_mgr.num_warnings = 0; /* no warnings emitted yet */
++ cinfo.err = jpeg_std_error(&err_mgr);
++ src_mgr.bytes_in_buffer = 0;
++ fill_input_buffer( &cinfo);
++ /* Quick check to see if file starts with JPEG SOI marker */
++ if(jpeg_read_buff[0] != 0xFF || jpeg_read_buff[1] != 0xD8) {
++ jpeg_destroy_decompress(&cinfo);
++ /* prepare setjmp context for expected exit via longjmp */
++ if (setjmp(setjmp_buffer)) {
++ /* If we get here, the JPEG code has signaled an error. */
++ /* Return 0 since error in the headers means the image is unloadable. */
++ jpeg_destroy_decompress(&cinfo);
++ jpeg_read_header(&cinfo, TRUE);
++ /* Turn off caching beyond this point of the file */
++ znocache(zinput_file);
++ jpeg_destroy_decompress(&cinfo);
+- /* We want to find and display the image dimensions, and also
+- * verify that the header markers are not corrupt. To do this,
+- * we fire up the JPEG decoder as normal, but when d_ui_method_selection
+- * is called, we abort the process by longjmp'ing back here.
+- * This works nicely since the headers are all read at that point.
+- filename = name; /* copy parms to static vars */
+- cinfo.methods = &dc_methods; /* links to method structs */
+- cinfo.emethods = &e_methods;
+- emethods = &e_methods; /* save struct addr for possible access */
+- e_methods.error_exit = error_exit; /* supply error-exit routine */
+- e_methods.trace_message = trace_message; /* supply trace-message routine */
+- e_methods.trace_level = 0; /* default = no tracing */
+- e_methods.num_warnings = 0; /* no warnings emitted yet */
+- e_methods.first_warning_level = 0; /* display first corrupt-data warning */
+- e_methods.more_warning_level = 3; /* but suppress additional ones */
+- /* prepare setjmp context for expected exit via longjmp */
+- switch (setjmp(setjmp_buffer)) {
+- /* First time thru, keep going */
+- /* Successful exit from d_ui_method_selection; return A-OK */
+- /* If we get here, the JPEG code has signaled an error. */
+- /* Return 0 since error in the headers means the image is unloadable. */
+- jselmemmgr(&e_methods); /* select std memory allocation routines */
+- /* Set up default decompression parameters. */
+- j_d_defaults(&cinfo, TRUE);
+- /* Override default methods */
+- dc_methods.d_ui_method_selection = d_ui_method_selection;
+- dc_methods.read_jpeg_data = read_jpeg_data;
+- /* Insert fake SOI into the input buffer --- needed cause we read it above */
+- cinfo.next_input_byte = cinfo.input_buffer + MIN_UNGET;
+- cinfo.next_input_byte[0] = (char) 0xFF;
+- cinfo.next_input_byte[1] = (char) 0xD8; /* SOI marker */
+- cinfo.bytes_in_buffer = 2;
+- /* Set up to read a JFIF or baseline-JPEG file. */
+- /* This is the only JPEG file format currently supported. */
+- jpeg_decompress(&cinfo);
+- /* Don't expect to get here since d_ui_method_selection should do longjmp */
+-/* information necessary to extract image data
+- unsigned int bytes_per_row;
+-static void input_init(cinfo)
+-compress_info_ptr cinfo;
+- /* this is done in jpegDump()
+-static void input_term(cinfo)
+-compress_info_ptr cinfo;
+- /* there is no shutdown necessary
+-/* this reads a single raster line
+-static void read_row(cinfo, pixel_rows)
+- compress_info_ptr cinfo;
+- JSAMPARRAY pixel_rows;
+- register byte *src_row_ptr;
+- register byte *dest_red_ptr;
+- register byte *dest_green_ptr;
+- register byte *dest_blue_ptr;
+- register Pixel pixval;
+- switch (ReadInfo.image->type) {
+- src_row_ptr = ReadInfo.current_row;
+- dest_red_ptr = (byte *)pixel_rows[0];
+- for (x = 0; x < cinfo->image_width; x++) {
+- pixval = ((*src_row_ptr & mask) > 0 ? 1 : 0);
+- /* we use the "red" color value under the assumption that they
+- * are all equal. that can be wrong if the user used -foreground
+- * or -background. I don't care right now.
+- *(dest_red_ptr++) = ReadInfo.image->rgb.red[pixval] >> 8;
+- /* this expands the pixel value into its components
+- pixlen = ReadInfo.image->pixlen;
+- src_row_ptr = ReadInfo.current_row;
+- dest_red_ptr = (byte *)pixel_rows[0];
+- dest_green_ptr = (byte *)pixel_rows[1];
+- dest_blue_ptr = (byte *)pixel_rows[2];
+- for (x = 0; x < cinfo->image_width; x++) {
+- pixval = memToVal(src_row_ptr, pixlen);
+- *(dest_red_ptr++) = ReadInfo.image->rgb.red[pixval] >> 8;
+- *(dest_green_ptr++) = ReadInfo.image->rgb.green[pixval] >> 8;
+- *(dest_blue_ptr++) = ReadInfo.image->rgb.blue[pixval] >> 8;
+- src_row_ptr += pixlen;
+- src_row_ptr = ReadInfo.current_row;
+- dest_red_ptr = (byte *)pixel_rows[0];
+- dest_green_ptr = (byte *)pixel_rows[1];
+- dest_blue_ptr = (byte *)pixel_rows[2];
+- for (x = 0; x < cinfo->image_width; x++) {
+- *(dest_red_ptr++) = *(src_row_ptr++);
+- *(dest_green_ptr++) = *(src_row_ptr++);
+- *(dest_blue_ptr++) = *(src_row_ptr++);
+- ReadInfo.current_row += ReadInfo.bytes_per_row;
+- * This routine gets control after the input file header has been read.
+- * It must determine what output JPEG file format is to be written,
+- * and make any other compression parameter changes that are desirable.
+-c_ui_method_selection (cinfo)
+- compress_info_ptr cinfo;
+- /* If the input is gray scale, generate a monochrome JPEG file. */
+- if (cinfo->in_color_space == CS_GRAYSCALE)
+- j_monochrome_default(cinfo);
+ /* parse options passed to jpegDump
+-static void parseOptions(cinfo, options, verbose)
+- compress_info_ptr cinfo;
++static void parseOptions(j_compress_ptr cinfo, char *options, int verbose)
+- /* (Re-)initialize the system-dependent error and memory managers. */
+- jselerror(cinfo->emethods); /* error/trace message routines */
+- jselmemmgr(cinfo->emethods); /* memory allocation routines */
+- cinfo->methods->c_ui_method_selection = c_ui_method_selection;
+- /* Set up default JPEG parameters. */
+- /* Note that default -quality level here need not, and does not,
+- * match the default scaling for an explicit -qtables argument.
+- j_c_defaults(cinfo, 75, FALSE); /* default quality level = 75 */
+ while (getNextTypeOption(&options, &name, &value) > 0) {
+ if (!strncmp("arithmetic", name, strlen(name))) {
+ /* Use arithmetic coding. */
+@@ -516,15 +321,15 @@ static void parseOptions(cinfo, options,
+ cinfo->arith_code = TRUE;
+ fprintf(stderr, "jpegDump: sorry, arithmetic coding not supported\n");
+ else if (!strncmp("grayscale", name, strlen(name)) ||
+ !strncmp("greyscale", name, strlen(name)) ||
+ !strncmp("monochrome", name, strlen(name))) {
+ /* Force a monochrome JPEG file to be generated. */
+ printf(" Creating a grayscale/monochrome file.\n");
+- j_monochrome_default(cinfo);
++ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
+ else if (!strncmp("nointerleave", name, strlen(name))) {
+ /* Create noninterleaved file. */
+@@ -536,16 +341,18 @@ static void parseOptions(cinfo, options,
+ fprintf(stderr, "jpegDump: sorry, multiple-scan support was not compiled\n");
++ else if (!strncmp("progressive", name, strlen(name))) {
++ /* Enable progressive JPEG. */
++ printf(" Progressive JPEG.\n");
++ jpeg_simple_progression (cinfo);
+ else if (!strncmp("optimize", name, strlen(name)) ||
+ !strncmp("optimise", name, strlen(name))) {
+ /* Enable entropy parm optimization. */
+-#ifdef ENTROPY_OPT_SUPPORTED
+ printf(" Optimizing entropy.\n");
+ cinfo->optimize_coding = TRUE;
+- fprintf(stderr, "jpegDump: sorry, entropy optimization was not compiled\n");
+ else if (!strncmp("quality", name, strlen(name))) {
+ /* Quality factor (quantization table scaling factor). */
+@@ -561,7 +368,7 @@ static void parseOptions(cinfo, options,
+ printf(" Using a quality factor of %d.\n", val);
+- j_set_quality(cinfo, val, FALSE);
++ jpeg_set_quality(cinfo, val, FALSE);
+ /* Change scale factor in case -qtables is present. */
+ q_scale_factor = j_quality_scaling(val);
+@@ -626,74 +433,134 @@ static void parseOptions(cinfo, options,
+-void jpegDump(image, options, file, verbose)
+- struct Compress_info_struct cinfo;
+- struct Compress_methods_struct c_methods;
+- struct External_methods_struct e_methods;
+- printf("Dumping JFIF-style JPEG image to %s.\n", file);
+- /* Set up links to method structures. */
+- cinfo.methods = &c_methods;
+- cinfo.emethods = &e_methods;
+- /* set up "input methods" that handle "reading" from our image file
+- cinfo.methods->input_init = input_init;
+- cinfo.methods->input_term = input_term;
+- cinfo.methods->get_input_row = read_row;
+- /* set up output file; there is no input file
+- cinfo.input_file = NULL;
+- cinfo.output_file = fopen(file, "w");
+- if (cinfo.output_file == NULL) {
++/* this reads a single raster line
+- ReadInfo.image = image;
+- ReadInfo.current_row = image->data;
++unsigned int bytes_per_row;
+- /* parse the options the user gave us
+- parseOptions(&cinfo, options, verbose);
+- /* set up image information
+- cinfo.image_width = image->width;
+- cinfo.image_height = image->height;
+- switch (image->type) {
+- ReadInfo.bytes_per_row = (image->width / 8) + (image->width % 8 ? 1 : 0);
+- cinfo.input_components = 1;
+- cinfo.in_color_space = CS_GRAYSCALE;
+- cinfo.data_precision = 8;
+- ReadInfo.bytes_per_row = image->width * image->pixlen;
+- cinfo.input_components = 3;
+- cinfo.in_color_space = CS_RGB;
+- cinfo.data_precision = 8;
+- ReadInfo.bytes_per_row = image->width * image->pixlen;
+- cinfo.input_components = 3;
+- cinfo.in_color_space = CS_RGB;
+- cinfo.data_precision = 8;
++static byte *read_row(Image *image, byte *pixel_rows)
++ byte *src_row_ptr = current_row;
++ byte *dest_row_ptr = pixel_rows;
++ switch (image->type) {
++ for (x = 0; x < image->width; x++) {
++ pixval = ((*src_row_ptr & mask) > 0 ? 1 : 0);
+- jpeg_compress(&cinfo);
++ /* we use the "red" color value under the assumption that they
++ * are all equal. that can be wrong if the user used -foreground
++ * or -background. I don't care right now.
++ *dest_row_ptr++ = image->rgb.red[pixval] >> 8;
+- fclose(cinfo.output_file);
++ /* this expands the pixel value into its components
++ pixlen = image->pixlen;
++ for (x = 0; x < image->width; x++) {
++ pixval = memToVal(src_row_ptr, pixlen);
++ *dest_row_ptr++ = image->rgb.red[pixval] >> 8;
++ *dest_row_ptr++ = image->rgb.green[pixval] >> 8;
++ *dest_row_ptr++ = image->rgb.blue[pixval] >> 8;
++ src_row_ptr += pixlen;
++void jpegDump(Image *image, char *options, char *file, int verbose)
++ struct jpeg_compress_struct cinfo;
++ struct jpeg_error_mgr jerr;
++ FILE * outfile; /* target file */
++ JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
++ cinfo.err = jpeg_std_error(&jerr);
++ jpeg_create_compress(&cinfo);
++ if ((outfile = fopen(file, "w")) == NULL) {
++ jpeg_stdio_dest(&cinfo, outfile);
++ cinfo.image_width = image->width;
++ cinfo.image_height = image->height;
++ /* set # of color components per pixel & colospace fo input image */
++ switch (image->type) {
++ bytes_per_row = (image->width / 8) + (image->width % 8 ? 1 : 0);
++ cinfo.input_components = 1;
++ cinfo.in_color_space = JCS_GRAYSCALE;
++ row_pointer[0] = lmalloc( cinfo.image_width * cinfo.input_components);
++ bytes_per_row = image->width * image->pixlen;
++ cinfo.input_components = 3;
++ cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
++ row_pointer[0] = lmalloc( cinfo.image_width * cinfo.input_components);
++ bytes_per_row = image->width * image->pixlen;
++ cinfo.input_components = 3;
++ cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
++ row_pointer[0] = image->data;
++ /* Now use the library's routine to set default compression parameters.
++ * (You must set at least cinfo.in_color_space before calling this,
++ * since the defaults depend on the source color space.)
++ jpeg_set_defaults(&cinfo);
++ /* Now you can set any non-default parameters you wish to.
++ * Here we just illustrate the use of quality (quantization table) scaling:
++ jpeg_set_quality(&cinfo, 75, TRUE /* limit to baseline-JPEG values */);
++ if( cinfo.in_color_space == JCS_GRAYSCALE)
++ jpeg_set_colorspace(&cinfo, JCS_GRAYSCALE);
++ parseOptions(&cinfo, options, verbose);
++ jpeg_start_compress(&cinfo, TRUE);
++ current_row = image->data;
++ while (cinfo.next_scanline < cinfo.image_height) {
++ /* jpeg_write_scanlines expects an array of pointers to scanlines.
++ * Here the array is only one element long, but you could pass
++ * more than one scanline at a time if that's more convenient.
++ row_pointer[0] = read_row(image, row_pointer[0]);
++ (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
++ current_row += bytes_per_row;
++ jpeg_finish_compress(&cinfo);
++ jpeg_destroy_compress(&cinfo);
++ if (image->type == IBITMAP || image->type == IRGB) {
++ lfree( row_pointer[0]);
++#else /* !HAVE_LIBJPEG */
++#endif /* !HAVE_LIBJPEG */
+Index: xloadimage.4.1.old/misc.c
+===================================================================
+--- xloadimage.4.1.old.orig/misc.c
++++ xloadimage.4.1.old/misc.c
+ #include "xloadimage.h"
+@@ -32,8 +33,10 @@ static char *signalName(sig)
+@@ -149,7 +152,7 @@ int errorHandler(disp, error)
+ { char errortext[BUFSIZ];
+ XGetErrorText(disp, error->error_code, errortext, BUFSIZ);
+- fprintf(stderr, "xloadimage: X Error: %s on 0x%x\n",
++ fprintf(stderr, "xloadimage: X Error: %s on 0x%lx\n",
+ errortext, error->resourceid);
+ if (_Xdebug) /* if -debug mode is enabled, dump a core when we hit this */
+Index: xloadimage.4.1.old/niff.c
+===================================================================
+--- xloadimage.4.1.old.orig/niff.c
++++ xloadimage.4.1.old/niff.c
+ static void babble(name, header, title)
+ struct niff_header *header;
+- printf("%s is a %dx%d ", name,
++ printf("%s is a %ldx%ld ", name,
+ memToVal(header->width, 4),
+- memToVal(header->height, 4),
+- memToVal(header->depth, 4));
++ memToVal(header->height, 4));
+ if (memToVal(header->version, 4) != NIFF_VERSION)
+- printf("version %d ", memToVal(header->version, 4));
++ printf("version %ld ", memToVal(header->version, 4));
+ switch (header->type) {
+ printf("bitmap image");
+- printf("%d-bit RGB image with %d colors",
++ printf("%ld-bit RGB image with %ld colors",
+ memToVal(header->depth, 4), memToVal(header->cmap_size, 4));
+- printf("%d-bit true color image", memToVal(header->depth, 4));
++ printf("%ld-bit true color image", memToVal(header->depth, 4));
+ printf("image with an unknown type");
+@@ -121,8 +124,8 @@ Image *niffLoad(fullname, name, verbose)
+ struct niff_header header;
+ unsigned int width, height, depth;
+- unsigned int data_size;
++ unsigned int data_size = 0;
+ if (! (zf= zopen(fullname)))
+@@ -191,7 +194,7 @@ void niffDump(image, options, filename,
+ struct niff_header header;
+- unsigned int data_size;
++ unsigned int data_size = 0;
+ printf("Dumping NIFF image to %s.\n", filename);
+Index: xloadimage.4.1.old/pbm.c
+===================================================================
+--- xloadimage.4.1.old.orig/pbm.c
++++ xloadimage.4.1.old/pbm.c
+@@ -188,14 +189,14 @@ Image *pbmLoad(fullname, name, verbose)
+ int width, height, maxval, depth;
+ byte srcmask, destmask;
+ byte *destptr, *destline;
+ if (! (zf= zopen(fullname)))
+Index: xloadimage.4.1.old/rlelib.c
+===================================================================
+--- xloadimage.4.1.old.orig/rlelib.c
++++ xloadimage.4.1.old/rlelib.c
+ #include "image.h" /* need ZFILE definition */
+@@ -710,11 +710,12 @@ register char *v;
+ for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
+- if (*n == '\0' || *n == '=')
++ if (*n == '\0' || *n == '=') {
+@@ -820,7 +821,7 @@ static void bfill();
+ * Read in the setup info and fill in sv_globals.
+-rle_get_setup( globals )
++int rle_get_setup( globals )
+ struct sv_globals * globals;
+ struct XtndRsetup setup;
+@@ -980,7 +981,8 @@ struct sv_globals * globals;
+-rle_get_error( code, pgmname, fname )
++int rle_get_error( code, pgmname, fname )
+@@ -1099,7 +1101,7 @@ int on_off;
+ * decoding the instructions into scanline data.
+-rle_getrow( globals, scanline )
++int rle_getrow( globals, scanline )
+ struct sv_globals * globals;
+@@ -1229,7 +1231,7 @@ rle_pixel *scanline[];
+ if ( SV_BIT( *globals, channel ) )
+ rle_pixel * cp = scanc - nc;
+@@ -1240,6 +1242,7 @@ rle_pixel *scanline[];
+ fprintf( stderr, "Pixel data %d (to %d)\n", nc, scan_x );
+@@ -1585,7 +1588,7 @@ int magic16x16[16][16] =
+ * Chose sub cell of 16 by 16 magic square
+-make_magic( size, magic )
++void make_magic( size, magic )
+@@ -1595,7 +1598,7 @@ int magic[16][16];
+@@ -1629,7 +1632,7 @@ int magic[16][16];
+ * Changes gamma array entries.
+-make_gamma( gamma, gammamap )
++void make_gamma( gamma, gammamap )
+@@ -1666,7 +1669,7 @@ int gammamap[256];
+ * see "Note:" in dithermap comment.
+-dithergb( x, y, r, g, b, levels, divN, modN, magic )
++int dithergb( x, y, r, g, b, levels, divN, modN, magic )
+@@ -1696,7 +1699,7 @@ int magic[16][16];
+ * see "Note:" in bwdithermap comment.
+-ditherbw( x, y, val, divN, modN, magic )
++int ditherbw( x, y, val, divN, modN, magic )
+Index: xloadimage.4.1.old/sunraster.c
+===================================================================
+--- xloadimage.4.1.old.orig/sunraster.c
++++ xloadimage.4.1.old/sunraster.c
+@@ -42,7 +42,7 @@ static void babble(name, header)
+ printf(" unknown-type");
+- printf(" %dx%d", memToVal(header->width, 4), memToVal(header->height, 4));
++ printf(" %ldx%ld", memToVal(header->width, 4), memToVal(header->height, 4));
+ switch (memToVal(header->depth, 4)) {
+@@ -240,7 +240,8 @@ Image *sunRasterLoad(fullname, name, ver
+ case RTIFF: /* sorry, don't even know what these are */
+- fprintf(stderr, "%s: Unsupported Sun Rasterfile image type (sorry)\n");
++ fprintf(stderr, "%s: Unsupported Sun Rasterfile image type (sorry)\n",
+@@ -255,7 +256,7 @@ Image *sunRasterLoad(fullname, name, ver
+- if (mapsize= memToVal(header.maplen, 4)) {
++ if ((mapsize= memToVal(header.maplen, 4))) {
+ if (zread(zf, map, mapsize) < mapsize) {
+ printf("sunRasterLoad: Bad read on colormap\n");
+Index: xloadimage.4.1.old/tiff.c
+===================================================================
+--- xloadimage.4.1.old.orig/tiff.c
++++ xloadimage.4.1.old/tiff.c
+-#include "tiff/tiffio.h"
++#ifndef TIFF_VERSION_CLASSIC /* libtiff4 or libtiff5? */
++#define TIFFHeaderCommon TIFFHeader
+ /* this structure contains all the information we care about WRT a TIFF
+@@ -33,14 +38,14 @@ static TIFF *is_tiff(fullname, name, inf
+ struct tiff_info *info;
+ /* read TIFF header and see if it looks right
+- if ((zread(zf, (byte *)&th, sizeof(TIFFHeader)) == sizeof(TIFFHeader)) &&
++ if ((zread(zf, (byte *)&th, sizeof(TIFFHeaderClassic)) == sizeof(TIFFHeaderClassic)) &&
+ ((th.tiff_magic == TIFF_BIGENDIAN) ||
+ (th.tiff_magic == TIFF_LITTLEENDIAN))) {
+@@ -124,14 +129,14 @@ static char *photometricName(info)
+ switch (info->photometric) {
+ case PHOTOMETRIC_MINISBLACK:
+ if (info->bitspersample > 1) {
+- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
++ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
+ return "white-on-black ";
+ case PHOTOMETRIC_MINISWHITE:
+ if (info->bitspersample > 1) {
+- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
++ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
+@@ -217,7 +222,7 @@ static void babble(name, info)
+ compressionName(info->compression));
+- printf("Titled \"%s\"");
++ printf("Titled \"%s\"", info->title);
+@@ -227,14 +232,14 @@ int tiffIdent(fullname, name)
+ tiff = is_tiff(fullname, name, &info);
+ if (tiff == (TIFF *)-1) /* is TIFF, but can't open it */
+- babble(fullname, name, info);
++/* babble(fullname, name, info); */
+@@ -404,6 +409,7 @@ Image *tiffLoad(fullname, name, verbose)
+ if (info.samplesperpixel != 3) {
+ "%s: Can't handle TIFF RGB images with %d samples per pixel, sorry\n",
+@@ -624,6 +630,6 @@ void tiffDump(image, options, file, verb
++#else /* !HAVE_LIBTIFF */
++#endif /* !HAVE_LIBTIFF */
+Index: xloadimage.4.1.old/uufilter.c
+===================================================================
+--- xloadimage.4.1.old.orig/uufilter.c
++++ xloadimage.4.1.old/uufilter.c
+@@ -64,7 +66,7 @@ main(argc, argv)
+ fprintf(stderr, "Ignoring header line: %s\n", buf);
+- fprintf(stderr, "No 'begin' line, sorry.\n", infilename);
++ fprintf(stderr, "%s: No 'begin' line, sorry.\n", infilename);
+@@ -162,6 +164,7 @@ main(argc, argv)
+Index: xloadimage.4.1.old/vff.c
+===================================================================
+--- xloadimage.4.1.old.orig/vff.c
++++ xloadimage.4.1.old/vff.c
+ #define HEAD_BUF_SIZE 2048
+@@ -149,7 +150,7 @@ Image *image;
+ linewidth = bands * width;
+- buf = (unsigned char *)malloc((unsigned)linewidth);
++ buf = (unsigned char *)lmalloc((unsigned)linewidth);
+@@ -336,7 +337,7 @@ ZFILE *zf;
+- if ((header[lines] = (char *)malloc((unsigned)count+1)) == NULL) {
++ if ((header[lines] = (char *)lmalloc((unsigned)count+1)) == NULL) {
+ bcopy(buf, header[lines], count);
+@@ -360,7 +361,7 @@ ZFILE *zf;
+ return(0); /* so that we try and see what was wrong */
+-vffIdent(fullname, name)
++int vffIdent(fullname, name)
+Index: xloadimage.4.1.old/window.c
+===================================================================
+--- xloadimage.4.1.old.orig/window.c
++++ xloadimage.4.1.old/window.c
++#include <sys/select.h>
++#else /* !HAVE_SELECT */
+-#ifdef HAS_SELECT_INCLUDE
+-#include <sys/select.h>
+-#endif /* HAS_SELECT_INCLUDE */
+-/* we can use timeouts if either select() or poll() are available.
+-#if defined(HAS_SELECT_INCLUDE) || defined(HAS_POLL)
++#endif /* !HAVE_SELECT */
+-extern int errno; /* not defined in errno.h on some systems */
+ static Window ImageWindow= 0;
+ static Window ViewportWin= 0;
+ static Colormap ImageColormap;
+@@ -229,7 +225,7 @@ void setViewportColormap(disp, scrn, vis
+ { XSetWindowAttributes swa;
+- static cmap_atom= None;
++ static Atom cmap_atom= None;
+ Window cmap_windows[2];
+@@ -280,7 +276,7 @@ static char *iconName(s)
+- if (t= rindex(buf, '/')) {
++ if ((t= rindex(buf, '/'))) {
+ for (s= buf, t++; *t; s++, t++)
+@@ -298,14 +294,14 @@ static struct visual_class_name {
+ int class; /* numerical value of class */
+ char *name; /* actual name of class */
+ } VisualClassName[] = {
+- TrueColor, "TrueColor",
+- DirectColor, "DirectColor",
+- PseudoColor, "PseudoColor",
+- StaticColor, "StaticColor",
+- GrayScale, "GrayScale",
+- StaticGray, "StaticGray",
+- StaticGray, "StaticGrey",
++ {TrueColor, "TrueColor"},
++ {DirectColor, "DirectColor"},
++ {PseudoColor, "PseudoColor"},
++ {StaticColor, "StaticColor"},
++ {GrayScale, "GrayScale"},
++ {StaticGray, "StaticGray"},
++ {StaticGray, "StaticGrey"},
+ int visualClassFromName(name)
+@@ -395,6 +391,7 @@ static void bestVisual(disp, scrn, image
+ * have no visuals that support that depth. seems silly to me....
+ screen= ScreenOfDisplay(disp, scrn);
+ for (a= 0; a < screen->ndepths; a++) {
+@@ -577,19 +574,21 @@ char imageInWindow(disp, scrn, image, gl
+ unsigned int private_cmap;
+ /* get values from options that we'll use a lot
+ fit= (getOption(global_options, FIT) != NULL);
+ fullscreen= (getOption(global_options, FULLSCREEN) != NULL);
+ install= (getOption(global_options, INSTALL) != NULL);
+ private_cmap= (getOption(global_options, PRIVATE) != NULL);
+- if (opt= getOption(image_options, DELAY))
++ if ((opt= getOption(image_options, DELAY)))
+ delay= opt->info.delay;
+- else if (opt= getOption(global_options, DELAY))
++ else if ((opt= getOption(global_options, DELAY)))
+ delay= opt->info.delay;
+- if (opt= getOption(image_options, VISUAL))
++ if ((opt= getOption(image_options, VISUAL)))
+ visual_class= opt->info.visual;
+@@ -603,7 +602,7 @@ char imageInWindow(disp, scrn, image, gl
+- sprintf(def_geom, "%ux%u+0+0", image->width, image->height);
++ snprintf(def_geom, 29, "%ux%u+0+0", image->width, image->height);
+ XGeometry(disp, scrn, opt->info.geometry.string, def_geom, 0, 1, 1, 0, 0,
+ (int *)&winx, (int *)&winy, (int *)&winwidth, (int *)&winheight);
+@@ -616,13 +615,13 @@ char imageInWindow(disp, scrn, image, gl
+ lastx= (winwidth || winheight); /* user set size flag */
+ winwidth= image->width;
+- if (winwidth > DisplayWidth(disp, scrn) * 0.9)
+- winwidth= DisplayWidth(disp, scrn) * 0.9;
++ if (winwidth > DisplayWidth(disp, scrn) * 0.98)
++ winwidth= DisplayWidth(disp, scrn) * 0.98;
+ winheight= image->height;
+- if (winheight > DisplayHeight(disp, scrn) * 0.9)
+- winheight= DisplayHeight(disp, scrn) * 0.9;
++ if (winheight > DisplayHeight(disp, scrn) * 0.95)
++ winheight= DisplayHeight(disp, scrn) * 0.95;
+@@ -902,10 +901,25 @@ char imageInWindow(disp, scrn, image, gl
+ switch (event.any.type) {
+- if (event.button.button == 1) {
++ switch (event.button.button) {
++ cursor= swa_view.cursor;
++ swa_view.cursor= XCreateFontCursor(disp, XC_watch);
++ XChangeWindowAttributes(disp, ViewportWin, CWCursor, &swa_view);
++ XFreeCursor(disp, cursor);
++ cleanUpImage(disp, scrn, swa_view.cursor, pixmap,
+Index: xloadimage.4.1.old/xbitmap.c
+===================================================================
+--- xloadimage.4.1.old.orig/xbitmap.c
++++ xloadimage.4.1.old/xbitmap.c
+@@ -132,7 +132,7 @@ Image *xbitmapLoad(fullname, name, verbo
+ char name_and_type[MAX_SIZE];
+ unsigned int linelen, dlinelen;
+ unsigned int w = 0, h = 0;
+@@ -247,7 +247,7 @@ int xbitmapIdent(fullname, name)
+- if (image= xbitmapLoad(fullname, name, (unsigned int)1)) {
++ if ((image= xbitmapLoad(fullname, name, (unsigned int)1))) {
+Index: xloadimage.4.1.old/xloadimage.c
+===================================================================
+--- xloadimage.4.1.old.orig/xloadimage.c
++++ xloadimage.4.1.old/xloadimage.c
+ #include "xloadimage.h"
+ char *ProgramName= "xloadimage";
+ /* if an image loader needs to have our display and screen, it will get
+@@ -120,6 +123,10 @@ static Image *doProcessOnImage(image, op
+ retimage= zoom(image, option->info.zoom.x, option->info.zoom.y, verbose);
+@@ -166,7 +173,7 @@ static Image *processImage(image, global
+@@ -192,7 +199,9 @@ main(argc, argv)
+ signal(SIGSEGV, internalError);
+ signal(SIGBUS, internalError);
+ signal(SIGFPE, internalError);
+ signal(SIGILL, internalError);
+ #if defined(_AIX) && defined(_IBMR2)
+@@ -230,7 +239,7 @@ main(argc, argv)
+ if (getOption(global_options, IDENTIFY)) {
+ for (optset= image_options; optset; optset= optset->next) {
+- if (opt= getOption(optset, NAME))
++ if ((opt= getOption(optset, NAME)))
+ identifyImage(opt->info.name);
+@@ -269,7 +278,7 @@ main(argc, argv)
+ onroot= (getOption(global_options, ONROOT) != NULL);
+ fullscreen= (getOption(global_options, FULLSCREEN) != NULL);
+ shrinktofit= (getOption(global_options, SHRINKTOFIT) != NULL);
+- if (opt= getOption(global_options, GEOMETRY)) {
++ if ((opt= getOption(global_options, GEOMETRY))) {
+ winwidth= opt->info.geometry.w;
+ winheight= opt->info.geometry.h;
+@@ -351,7 +360,7 @@ main(argc, argv)
+ /* retitle the image if we were asked to
+- if (opt= getOption(optset, TITLE)) {
++ if ((opt= getOption(optset, TITLE))) {
+ lfree((byte *)newimage->title);
+ newimage->title= dupString(opt->info.title);
+@@ -370,8 +379,8 @@ main(argc, argv)
+ if ((newimage->width > DisplayWidth(disp, scrn)) ||
+ (newimage->height > DisplayHeight(disp, scrn))) {
+ opt->info.zoom.x= opt->info.zoom.y=
+- (newimage->width - DisplayWidth(disp, scrn) >
+- newimage->height - DisplayHeight(disp, scrn) ?
++ ((int)newimage->width - DisplayWidth(disp, scrn) >
++ (int)newimage->height - DisplayHeight(disp, scrn) ?
+ (float)DisplayWidth(disp, scrn) / (float)newimage->width * 100.0 :
+ (float)DisplayHeight(disp, scrn) / (float)newimage->height * 100.0);
+@@ -399,6 +408,9 @@ main(argc, argv)
+ / (float)newimage->width * 100.0 :
+ ((float)DisplayHeight(disp, scrn) * 0.9)
+ / (float)newimage->height * 100.0);
++ if ((opt->info.zoom.x > 100) || (opt->info.zoom.y > 100))
++ opt->info.zoom.x=opt->info.zoom.y=100;
+ addOption(optset, opt);
+@@ -425,7 +437,7 @@ main(argc, argv)
+- if (opt= getOption(optset, AT))
++ if ((opt= getOption(optset, AT)))
+ tmpimage= merge(dispimage, newimage,
+ opt->info.at.x, opt->info.at.y, verbose);
+@@ -467,7 +479,7 @@ main(argc, argv)
+ case 'n': /* next image */
+- if (opt= getOption(optset->next, GOTO)) {
++ if ((opt= getOption(optset->next, GOTO))) {
+ char *tag= opt->info.go_to;
+ for (tmpset= image_options; tmpset; tmpset= tmpset->next) {
+@@ -490,6 +502,8 @@ main(argc, argv)
+ goto redisplay_in_window; /* ick */
+ goto get_another_image; /* ick */
+ if ((opt = getOption(optset,ZOOM)) == NULL) {
+@@ -534,7 +548,7 @@ main(argc, argv)
+ for (optset= image_options; optset && optset->next; optset= optset->next)
+- if (opt= getOption(optset, NAME)) {
++ if ((opt= getOption(optset, NAME))) {
+ lfree((byte *)dispimage->title);
+ dispimage->title= dupString(opt->info.title);
+Index: xloadimage.4.1.old/bright.c
+===================================================================
+--- xloadimage.4.1.old.orig/bright.c
++++ xloadimage.4.1.old/bright.c
+ /* alter an image's brightness by a given percentage
+@@ -73,9 +74,10 @@ void gammacorrect(image, disp_gam, verbo
++ static int gammamap[256];
++ const byte *endptr, *srcptr;
++ static double old_gamma = -1.0;
+ goodImage(image, "gammacorrect");
+ if (BITMAPP(image)) /* we're AT&T */
+@@ -86,7 +88,9 @@ void gammacorrect(image, disp_gam, verbo
+- make_gamma(disp_gam,gammamap);
++ if( disp_gam != old_gamma)
++ make_gamma(disp_gam,gammamap);
+@@ -98,12 +102,13 @@ void gammacorrect(image, disp_gam, verbo
+- size= image->width * image->height * 3;
+- for (a= 0; a < size; a++) {
+- *destptr= gammamap[*destptr];
++ srcptr = destptr = image->data;
++ endptr = destptr + image->width * image->height * 3;
++ *destptr++ = gammamap[*srcptr++];
++ *destptr++ = gammamap[*srcptr++];
++ *destptr++ = gammamap[*srcptr++];
++ } while (srcptr < endptr);
+@@ -146,6 +151,8 @@ Image *normalize(image, verbose)
+ byte *srcptr, *destptr;
+ goodImage(image, "normalize");
+@@ -190,11 +197,11 @@ Image *normalize(image, verbose)
+ for (x= 0; x < image->width; x++) {
+ pixval= memToVal(srcptr, image->pixlen);
+ *destptr= array[image->rgb.red[pixval] >> 8];
+ *destptr= array[image->rgb.green[pixval] >> 8];
+ *destptr= array[image->rgb.blue[pixval] >> 8];
+ srcptr += image->pixlen;
+Index: xloadimage.4.1.old/compress.c
+===================================================================
+--- xloadimage.4.1.old.orig/compress.c
++++ xloadimage.4.1.old/compress.c
+ #define NIL_PIXEL 0xffffffff
+-void compress(image, verbose)
++void compress_cmap(image, verbose)
+ { Pixel hash_table[32768];
+@@ -136,15 +136,16 @@ void compress(image, verbose)
+ lfree((byte *)pixel_table);
+ lfree((byte *)pixel_map);
+ printf("%d out-of-range pixels, ", badcount);
+ fprintf(stderr, "Warning: %d out-of-range pixels were seen\n",
+ if ((rgb.used == image->rgb.used) && !badcount)
+- printf("no improvment\n");
++ printf("no improvement\n");
+ int unused= image->rgb.used - rgb.used - dupcount;
+Index: xloadimage.4.1.old/config.c
+===================================================================
+--- xloadimage.4.1.old.orig/config.c
++++ xloadimage.4.1.old/config.c
+ struct filter *Filters = (struct filter *)NULL;
+ static unsigned int NumPaths= 0;
+@@ -256,7 +256,8 @@ static void readPathsAndExts(name)
+ case parse_filter_name: /* name of filter program */
+- strcpy(filter_name, buf);
++ strncpy(filter_name, buf, BUFSIZ - 1);
++ filter_name[BUFSIZ - 1] = '\0';
+ state= parse_filter_extension;
+ case parse_filter_extension:
+@@ -433,14 +434,29 @@ void showConfiguration()
+ printf("No filters\n");
++/* Work out where this user's home directory is, or default to '/' */
++/* XXX needs a VMS guru to supply something plausable for VMS */
++ /* try for a password file lookup instead */
++ pw = getpwuid(getuid());
++ return "/"; /* XXX maybe print message? */
+ { char buf1[BUFSIZ], buf2[BUFSIZ];
+@@ -454,7 +470,8 @@ char *expandPath(p)
+- strcat(buf1, getenv("HOME"));
++ strncat(buf1, homedir(), BUFSIZ - strlen(buf1) - 1);
++ buf1[BUFSIZ - 1] = '\0';
+@@ -462,7 +479,8 @@ char *expandPath(p)
+- strcat(buf1, getenv(buf2));
++ strncat(buf1, getenv(buf2), BUFSIZ - strlen (buf1) - 1);
++ buf1[BUFSIZ - 1] = '\0';
+Index: xloadimage.4.1.old/new.c
+===================================================================
+--- xloadimage.4.1.old.orig/new.c
++++ xloadimage.4.1.old/new.c
+@@ -48,8 +51,8 @@ unsigned long DepthToColorsTable[] = {
+- /* 32 */ 2147483648 /* bigger than unsigned int; this is good enough */
++ /* 31 */ 2147483648UL,
++ /* 32 */ 2147483648UL /* bigger than unsigned int; this is good enough */
+ unsigned long colorsToDepth(ncolors)
+@@ -63,6 +66,18 @@ unsigned long colorsToDepth(ncolors)
++static unsigned int ovmul(unsigned int a, unsigned int b)
+ void goodImage(image, func)
+@@ -128,7 +143,7 @@ Image *newBitImage(width, height)
+ linelen= (width / 8) + (width % 8 ? 1 : 0); /* thanx johnh@amcc.com */
+- image->data= (unsigned char *)lcalloc(linelen * height);
++ image->data= (unsigned char *)lcalloc(ovmul(linelen, height));
+@@ -149,7 +164,7 @@ Image *newRGBImage(width, height, depth)
+- image->data= (unsigned char *)lmalloc(width * height * pixlen);
++ image->data= (unsigned char *)lmalloc(ovmul(ovmul(width, height), pixlen));
+@@ -165,6 +180,7 @@ Image *newTrueImage(width, height)
++ image->data= (unsigned char *)lmalloc(ovmul(ovmul(width, height), 3));
+ image->data= (unsigned char *)lmalloc(width * height * 3);
+Index: xloadimage.4.1.old/options.c
+===================================================================
+--- xloadimage.4.1.old.orig/options.c
++++ xloadimage.4.1.old/options.c
++#include "xloadimage.h"
++#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+ extern char *ProgramName;
+ /* options array and definitions. If you add something to this you also
+@@ -546,6 +551,7 @@ void processOptions(argc, argv, rglobal,
++ killOption(global_options, VERBOSE);
+@@ -701,7 +707,7 @@ void processOptions(argc, argv, rglobal,
+- fprintf(stderr, "%s has been superceded by %s (translating)\n",
++ fprintf(stderr, "%s has been superseded by %s (translating)\n",
+ optionName(IDELAY), optionName(DELAY));
+@@ -731,6 +737,11 @@ void processOptions(argc, argv, rglobal,
+ newopt->info.gamma= getFloat(GAMMA, argv[a]);
++ if (newopt->info.gamma < 0.0) {
++ fprintf(stderr, "Argument to %s must be over 0.0 (ignored)\n",
++ newopt->type= OPT_IGNORE;
+@@ -878,12 +889,13 @@ int getNextTypeOption(opt_string, name,
+ p = index(*opt_string, ',');
+- strncpy(option_name, *opt_string, p - *opt_string);
+- option_name[p - *opt_string] = '\0';
++ strncpy(option_name, *opt_string, MIN(BUFSIZ - 1, p - *opt_string));
++ option_name[MIN(BUFSIZ - 1, p - *opt_string)] = '\0';
+ *opt_string = p + 1; /* increment to next option */
+- strcpy(option_name, *opt_string);
++ strncpy(option_name, *opt_string, BUFSIZ -1);
++ option_name[BUFSIZ - 1] = '\0';
+ *opt_string += strlen(*opt_string); /* increment to end of string */
+@@ -892,7 +904,8 @@ int getNextTypeOption(opt_string, name,
+ p = index(option_name, '=');
+- strcpy(option_value, p + 1);
++ strncpy(option_value, p + 1, BUFSIZ - 1);
++ option_value[BUFSIZ - 1] = '\0';
+ *p = '\0'; /* stomp equals sign */
+Index: xloadimage.4.1.old/png.c
+===================================================================
++++ xloadimage.4.1.old/png.c
++ * PNG - Portable Network Graphics
++ * Alpha channle is linear.
++ * Color \ Bit Depth 1 2 4 8 16 palette bKGD
++ * PNG_COLOR_TYPE_PALETTE O O O O must 8 bit
++ * PNG_COLOR_TYPE_GRAY O O O O O 16
++ * PNG_COLOR_TYPE_GRAY_ALPHA O O 16
++ * PNG_COLOR_TYPE_RGB O O possible 16 * 3
++ * PNG_COLOR_TYPE_RGB_ALPHA O O possible 16 * 3
++ * This code is based on jpeg.c and sample code from the libpng-1.0.5.
++ * 2000/01/10: YOSHIDA Hiroshi
++ * pngLoad(): Alpha channel, Transparency palette.
++#include "image.h" /* xloadimage declarations */
++# define debug(xx) fprintf(stderr,xx)
++#define PNG_BYTES_TO_CHECK 4
++static Image *image; /* xloadimage image being returned */
++static ZFILE *zinput_file;
++int pngIdent(char *fullname, char *name);
++Image *pngLoad(char *fullname, char *name, unsigned int verbose);
++/* void pngDump(Image *image, char *options, char *file, int verbose); */
++static void png_read_data(png_structp png_ptr,
++ png_bytep data, png_size_t length)
++ if (zread(zinput_file, data, length) != length)
++ png_error(png_ptr, "Read Error");
++static void output_warn(png_structp png_ptr, png_const_charp str)
++ fprintf(stderr, " PNG file: %s - %s\n", filename, str);
++static void output_error(png_structp png_ptr, png_const_charp str)
++ output_warn( png_ptr, str);
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ longjmp(png_jmpbuf((png_ptr)),1);
++ longjmp(png_ptr->jmpbuf, 1); /* return control to outer routine */
++static const char *pngColor(int color_type)
++ case PNG_COLOR_TYPE_GRAY:
++ case PNG_COLOR_TYPE_GRAY_ALPHA:
++ case PNG_COLOR_TYPE_PALETTE:
++ case PNG_COLOR_TYPE_RGB:
++ case PNG_COLOR_TYPE_RGB_ALPHA:
++ str = "UNKNOWN_COLOR_TYPE";
++static const char *pngInterlace(int interlace_type)
++ switch (interlace_type) {
++ case PNG_INTERLACE_NONE:
++ case PNG_INTERLACE_ADAM7:
++ * Output PNG file infomation.
++static void pngInfo( png_uint_32 width, png_uint_32 height,
++ int bit_depth, int color_type, int interlace_type,
++ printf("%s is %ldx%ld PNG image, color type %s, %d bit",
++ filename, width, height, pngColor(color_type), bit_depth);
++ if( interlace_type != PNG_INTERLACE_NONE)
++ printf(", interlace %s", pngInterlace(interlace_type));
++ if( file_gamma >= 0.0)
++ printf(", file gamma %.4f", file_gamma);
++ * pngIdent(), pngLoad()
++ * Read PNG header & allocate png's struct:
++static int pngHeader(png_structpp png_pp,
++ png_infopp info_pp, png_infopp end_pp)
++ *info_pp = *end_pp = NULL;
++ *png_pp = png_create_read_struct(PNG_LIBPNG_VER_STRING,
++ NULL, output_error, output_warn);
++ *info_pp = png_create_info_struct(*png_pp);
++ png_destroy_read_struct(png_pp, info_pp, end_pp);
++ *end_pp = png_create_info_struct(*png_pp);
++ png_destroy_read_struct(png_pp, info_pp, end_pp);
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(*png_pp))) {
++ if (setjmp((*png_pp)->jmpbuf)) {
++ png_destroy_read_struct(png_pp, info_pp, end_pp);
++ png_set_sig_bytes(*png_pp, PNG_BYTES_TO_CHECK);
++ png_set_read_fn(*png_pp, NULL, png_read_data);
++ png_read_info(*png_pp, *info_pp);
++ * return !0: It is a PNG.
++static int is_png(ZFILE *zf)
++ byte png_read_buff[PNG_BYTES_TO_CHECK];
++ /* Read in some of the signature bytes */
++ if (zread(zf, png_read_buff,PNG_BYTES_TO_CHECK) != PNG_BYTES_TO_CHECK)
++ return !png_sig_cmp(png_read_buff, (png_size_t)0, PNG_BYTES_TO_CHECK);
++ * Main control routine for identifying PNG without loading
++int pngIdent(char *fullname, char *name)
++ png_infop info_ptr, end_info;
++ png_uint_32 width, height;
++ int color_type, bit_depth, interlace_type;
++ zinput_file = zopen(fullname);
++ if (zinput_file == NULL) {
++ /* check at early timing */
++ if (is_png(zinput_file) == 0) {
++ /* read infomation header */
++ if (!pngHeader(&png_ptr, &info_ptr, &end_info)) {
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr))) {
++ if (setjmp(png_ptr->jmpbuf)) {
++ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
++ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
++ &color_type, &interlace_type, NULL, NULL);
++ if(!png_get_gAMA( png_ptr, info_ptr, &file_gamma))
++ /* print out PNG infomation */
++ pngInfo( width, height, bit_depth, color_type, interlace_type, file_gamma);
++ znocache(zinput_file);
++ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
++ * Main control routine for loading
++Image *pngLoad(char *fullname, char *name, unsigned int verbose)
++ png_infop info_ptr, end_info;
++ png_color_16p background;
++ png_bytep bufp, *row_pointers;
++ png_uint_32 width, height;
++ int i, row_stride, color_type, bit_depth, num_palette, interlace_type;
++ zinput_file = zopen(fullname);
++ if (zinput_file == NULL) {
++ /* check at early timing */
++ if (is_png(zinput_file) == 0) {
++ /* read infomation header */
++ if (!pngHeader(&png_ptr, &info_ptr, &end_info)) {
++ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
++ &color_type, &interlace_type, NULL, NULL);
++ if(!png_get_gAMA( png_ptr, info_ptr, &file_gamma))
++ /* print out PNG infomation */
++ pngInfo( width, height, bit_depth, color_type, interlace_type, file_gamma);
++ znocache(zinput_file);
++ if (file_gamma <= 0.0)
++ png_set_gamma(png_ptr, 1.0, file_gamma);
++ png_set_strip_16(png_ptr); /* 16 bit -> 8 bit */
++ /* if (color_type & PNG_COLOR_MASK_ALPHA) */
++ png_set_strip_alpha(png_ptr);
++ if (png_get_bKGD(png_ptr, info_ptr, &background))
++ png_set_background(png_ptr, background, file_gamma, 1, 1.0);
++ case PNG_COLOR_TYPE_PALETTE:
++ png_set_packing(png_ptr); /* 1 pixlel 1 byte */
++ image = newRGBImage(width, height, 8);
++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++ image->rgb.used = num_palette;
++ for (i = 0; i < num_palette; i++) {
++ *(image->rgb.red + i) = palette->red << 8;
++ *(image->rgb.green + i) = palette->green << 8;
++ *(image->rgb.blue + i) = palette->blue << 8;
++ case PNG_COLOR_TYPE_GRAY_ALPHA:
++ case PNG_COLOR_TYPE_GRAY:
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ png_set_expand_gray_1_2_4_to_8(png_ptr); /* 1 pixlel 1 byte */
++ png_set_gray_1_2_4_to_8(png_ptr); /* 1 pixlel 1 byte */
++ image = newRGBImage(width, height, 8);
++ image->rgb.used = 256;
++ for (i = 0; i < 256; i++) {
++ *(image->rgb.red + i) =
++ *(image->rgb.green + i) =
++ *(image->rgb.blue + i) = i << 8;
++ case PNG_COLOR_TYPE_RGB_ALPHA:
++ case PNG_COLOR_TYPE_RGB:
++ image = newTrueImage(width, height);
++ fprintf(stderr, "Unknown color type PNG.");
++ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
++ image->title = dupString(filename);
++ png_read_update_info(png_ptr, info_ptr);
++ row_stride = png_get_rowbytes(png_ptr, info_ptr);
++ row_pointers = (png_bytep *)lmalloc(sizeof(png_bytep) * height);
++ for (i = 0; i < height; i++) {
++ *(row_pointers + i) = bufp;
++ png_read_image(png_ptr, row_pointers);
++ lfree((byte *)row_pointers);
++ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
++#else /* !HAVE_LIBPNG */
++#endif /* !HAVE_LIBPNG */
+Index: xloadimage.4.1.old/send.c
+===================================================================
+--- xloadimage.4.1.old.orig/send.c
++++ xloadimage.4.1.old/send.c
+@@ -21,7 +21,7 @@ static int pixmapErrorTrap(disp, pErrorE
+ char buf[MAXERRORLEN+1];
+ XGetErrorText(disp, pErrorEvent->error_code, buf, MAXERRORLEN);
+- printf("serial #%d (request code %d) Got Error %s\n",
++ printf("serial #%ld (request code %d) Got Error %s\n",
+ pErrorEvent->request_code,
+@@ -166,6 +166,8 @@ XImageInfo *imageToXImage(disp, scrn, vi
+ unsigned int redbottom, greenbottom, bluebottom;
+ unsigned int redtop, greentop, bluetop;
++ redtop = greentop = bluetop = 0;
+ redvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256);
+ greenvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256);
+ bluevalue= (Pixel *)lmalloc(sizeof(Pixel) * 256);
+@@ -255,7 +257,7 @@ imageToXImage: XAllocColor failed on a T
+ retry: /* this tag is used when retrying because we couldn't get a fit */
+- compress(image, verbose);
++ compress_cmap(image, verbose);
+ index= (Pixel *)lmalloc(sizeof(Pixel) * image->rgb.used);
+@@ -300,7 +302,7 @@ imageToXImage: XAllocColor failed on a T
+ xcolor.red= *(image->rgb.red + a);
+ xcolor.green= *(image->rgb.green + a);
+ xcolor.blue= *(image->rgb.blue + a);
+- if (! XAllocColor(disp, ximageinfo->cmap, &xcolor))
++ if (! XAllocColor(disp, ximageinfo->cmap, &xcolor)) {
+ if ((visual->class == StaticColor) ||
+ (visual->class == StaticGray) ||
+ (visual->class == TrueColor) ||
+@@ -319,6 +321,7 @@ imageToXImage: XAllocColor failed on a T
+ *(index + a)= xcolor.pixel;
+@@ -602,8 +605,6 @@ void sendXImage(ximageinfo, src_x, src_y
+ int src_x, src_y, dst_x, dst_y;
+ /* build and cache the GC
+Index: xloadimage.4.1.old/vicar.c
+===================================================================
+--- xloadimage.4.1.old.orig/vicar.c
++++ xloadimage.4.1.old/vicar.c
+ #define SAMPLES label[6]
+@@ -108,14 +107,12 @@ Image *vicarLoad(fullname, name, verbose
+ unsigned int mapsize, size;
+ byte *mapred,*mapgreen,*mapblue;
+ if ( vicarIdent(fullname,name,verbose) == 0 )
+Index: xloadimage.4.1.old/xloadimagerc
+===================================================================
+--- xloadimage.4.1.old.orig/xloadimagerc
++++ xloadimage.4.1.old/xloadimagerc
+ # Sample .xloadimagerc file
+-path = /usr/local/images
++# Directories to search for images
++path = ~/images /usr/local/images
++# Default extensions to try tacking onto the end of a filename, in order
+ extension = .niff # NIFF image
+ .jpg .jpeg # JPEG image
+ .gif # CompuServe GIF image
+@@ -14,6 +17,7 @@ extension = .niff # NIFF ima
+ .pbm .pgm .ppm # PBMPLUS
+ # add uufilter for automatic uudecoding of files ending in .uu or .uue
+ filter = "uufilter -s" .uu .uue
+Index: xloadimage.4.1.old/faces.c
+===================================================================
+--- xloadimage.4.1.old.orig/faces.c
++++ xloadimage.4.1.old/faces.c
+@@ -108,9 +108,15 @@ Image *facesLoad(fullname, name, verbose
+ if (! strcmp(buf, "\n"))
+ if (!strncmp(buf, "FirstName:", 10))
+- strcpy(fname, buf + 11);
++ strncpy(fname, buf + 11, BUFSIZ - 1);
++ fname[BUFSIZ - 1] = '\0';
+ else if (!strncmp(buf, "LastName:", 9))
+- strcpy(lname, buf + 10);
++ strncpy(lname, buf + 10, BUFSIZ - 1);
++ lname[BUFSIZ - 1] = '\0';
+ else if (!strncmp(buf, "Image:", 6)) {
+ if (sscanf(buf + 7, "%d%d%d", &iw, &ih, &id) != 3) {
+ printf("%s: Bad Faces Project image\n", fullname);
+@@ -136,7 +142,7 @@ Image *facesLoad(fullname, name, verbose
+ image= newRGBImage(w, h, d);
+ fname[strlen(fname) - 1]= ' ';
++ strncat(fname, lname, BUFSIZ - strlen(fname) -1);
+ fname[strlen(fname) - 1]= '\0';
+ image->title= dupString(fname);
+@@ -172,7 +178,7 @@ int facesIdent(fullname, name)
+- if (image= facesLoad(fullname, name, 1)) {
++ if ((image= facesLoad(fullname, name, 1))) {
+Index: xloadimage.4.1.old/packtar.c
+===================================================================
+--- xloadimage.4.1.old.orig/packtar.c
++++ xloadimage.4.1.old/packtar.c
+ /* poor-man's varargs. good enough for now.
+ int run(a0, a1, a2, a3, a4, a5, a6, a7, a8)
+@@ -48,9 +46,12 @@ void link_file(dir, old_file)
+- strcpy(new_file, dir); /* target directory */
+- strcat(new_file, "/");
+- strcat(new_file, old_file);
++ strncpy(new_file, dir, 1023); /* target directory */
++ new_file[1023] = '\0';
++ strncat(new_file, "/", 1023 - strlen(new_file));
++ new_file[1023] = '\0';
++ strncat(new_file, old_file, 1023 - strlen(new_file));
++ new_file[1023] = '\0';
+ for (p = new_file; p = strchr(p, '/'); p++) {
+ *p = '\0'; /* stomp directory separator */
+Index: xloadimage.4.1.old/xloadimage.man
+===================================================================
+--- xloadimage.4.1.old.orig/xloadimage.man
++++ xloadimage.4.1.old/xloadimage.man
+-.TH XLOADIMAGE 1 "8 May 1991"
++.TH XLOADIMAGE 1x "8 May 1991"
+ xloadimage, xsetbg, xview \- load images into an X11 window or onto
+@@ -9,7 +9,7 @@ the root window
+ \fIXloadimage\fR displays images in an X11 window, loads them onto the
+ root window, or writes them into a file. Many image types are
+-recognized; use the \fI-supported\fR option to list them.
++recognized; use the \fI\-supported\fR option to list them.
+ If the filename \fIstdin\fR is given, xloadimage will read the image
+ from standard input if this capability is supported by the loader for
+@@ -18,38 +18,38 @@ that image type (most types do support r
+ If the destination display cannot support the number of colors in the
+ image, the image will be dithered (monochrome destination) or have its
+ colormap reduced (color destination) as appropriate. This can also be
+-done forcibly with the \fI-halftone\fR, \fI-dither\fR, and
++done forcibly with the \fI\-halftone\fR, \fI\-dither\fR, and
++\fI\-colors\fR options.
+ A variety of image manipulations can be specified, including gamma
+-correction, brightening, clipping, dithering, depth-reduction,
++correction, brightening, clipping, dithering, depth\(hyreduction,
+ rotation, and zooming. Most of these manipulations have simple
+ implementations; speed was opted for above accuracy.
+ If you are viewing a large image in a window, the initial window will
+ be at most 90% of the size of the display unless the window manager
+ does not correctly handle window size requests or if you've used the
+-\fI-fullscreen\fR option. You may move the image around in the window
++\fI\-fullscreen\fR option. You may move the image around in the window
+ by dragging with the first mouse button. The cursor will indicate
+ which directions you may drag, if any. You may exit the window by
+ typing 'q' or '^C' when the keyboard focus is on the window.
+ If more than one image file is specified on the command line, each
+-image will be shown in order (except if \fI-merge\fR or \fI-goto\fR
++image will be shown in order (except if \fI\-merge\fR or \fI\-goto\fR
+ A wide variety of common image manipulations can be done by mixing and
+ matching the available options. See the section entitled \fIHINTS FOR
+ GOOD IMAGE DISPLAYS\fR for some ideas.
+-The \fI-dump\fR option causes an image to be written to a file rather
++The \fI\-dump\fR option causes an image to be written to a file rather
+ than displayed after processing. This allows you to read an image,
+ perform a number of processing operations on it, and save the
+ resultant image. This also allows translation from any of the
+ recognized image types into any of the formats that support dumping.
+-\fIXsetbg\fR is equivalent to \fIxloadimage -onroot -quiet\fR and
+-\fIxview\fR is equivalent to \fIxloadimage -view -verbose\fR.
++\fIXsetbg\fR is equivalent to \fIxloadimage \-onroot \-quiet\fR and
++\fIxview\fR is equivalent to \fIxloadimage \-view \-verbose\fR.
+ \fIXloadimage\fR uses the resource class name \fIXloadimage\fR for
+ window managers which need this resource set. This name changed
+@@ -59,61 +59,58 @@ in version 2.00 and 2.01; some previous
+ The following options affect the global operation of \fIxloadimage\fR.
+ They may be specified anywhere on the command line. Additionally the
+-\fI-global\fR option can be used to force an image option to apply to
++\fI\-global\fR option can be used to force an image option to apply to
+ This sets the background portion of the window which is not covered by
+ any images to be \fIcolor\fR.
+ Displays the image path, image suffixes, and supported filters which
+ will be used when looking for and reading images. These are loaded
+ from ~/.xloadimagerc and optionally from a systemwide file (normally
+-/usr/lib/xloadimagerc). This replaces the -path option.
++/usr/lib/xloadimagerc). This replaces the \-path option.
+ Use the default root weave as the image. This option forces
+-\fI-onroot\fR. If \fI-default\fR is used alone, it is the same as
++\fI\-onroot\fR. If \fI\-default\fR is used alone, it is the same as
+ \fIxsetroot\fR with no arguments. If used in conjunction with
+-\fI-tile\fR this option can be used to place images on the default
++\fI\-tile\fR this option can be used to place images on the default
+ root weave (see \fBEXAMPLES\fR below).
+ Talk to the X server in synchronous mode. This is useful for
+ debugging. If an X error is seen while in this mode, a core will be
+-Automatically advance to the next image after \fIsecs\fR seconds.
+--display \fIdisplay_name\fR
++\-display \fIdisplay_name\fR
+ X11 display name to send the image(s) to.
+--dump \fIimage_type[,option[=value]]\fR \fIdump_file\fR
++\-dump \fIimage_type[,option[=value]]\fR \fIdump_file\fR
+ Rather than displaying the loaded and processed image, dump it into an
+ image file of the specified type. For a list of image types that can
+-be dumped, use the \fI-supported\fR option. Some image types have
++be dumped, use the \fI\-supported\fR option. Some image types have
+ options that affect the format of the file that's created. See
+ \fBDUMP OPTIONS\fR below. An image can be dumped in any supported
+ dump format regardless of the original image type, so image file type
+ translation is possible using this option.
+ Force image to use the default visual and colormap. This is useful if
+ you do not want technicolor effects when the colormap focus is inside
+ the image window, but it may reduce the quality of the displayed
+-image. This is on by default if -onroot or -windowid is specified.
++image. This is on by default if \-onroot or \-windowid is specified.
+ Fork xloadimage. This causes xloadimage to disassociate itself from
+-the shell. This option automatically turns on -quiet.
++the shell. This option automatically turns on \-quiet.
+-Use the entire screen to display images. If combined with -onroot,
++Use the entire screen to display images. If combined with \-onroot,
+ the image will be zoomed to fill the entire rootwindow.
+--geometry \fIWxH[{+-X}{+-}Y]\fR
++\-geometry \fIWxH[{+\-X}{+\-}Y]\fR
+ This sets the size of the window onto which the images are loaded to a
+ different value than the size of the image. When viewing an image in
+ a window, this can be used to reduce the size of the destination
+@@ -122,223 +119,226 @@ controls the size of the pixmap which wi
+ If the size is smaller than that of the display, the image will be
+ Forces the next image to be displayed to be the image named
+ \fIimage_name\fR. This is useful for generating looped slideshows.
+ If more than one image of the same name as the target exists on the
+ argument list, the first in the argument list is used.
+ Give information on an option or list of options. If no option is
+ given, a simple interactive help facility is invoked.
+ Identify the supplied images rather than display them.
+ Forcibly install the image's colormap when the window is focused.
+ This violates ICCCM standards and only exists to allow operation with
+ naive window managers. Use this option only if your window manager
+ does not install colormaps properly.
+ List the images which are along the image path.
+ Load image(s) onto the root window instead of viewing in a window.
+-This option automatically sets the -fit option.
+-This is the opposite of \fI-view\fR. \fIXSetbg\fR has this option set
++This option automatically sets the \-fit option.
++This is the opposite of \fI\-view\fR. \fIXSetbg\fR has this option set
+ Displays miscellaneous information about the program configuration.
+-This option is obsolete and has been replaced by -configuration.
++This option is obsolete and has been replaced by \-configuration.
+-Force the use of a pixmap as backing-store. This is provided for
+-servers where backing-store is broken (such as some versions of the
++Force the use of a pixmap as backing\(hystore. This is provided for
++servers where backing\(hystore is broken (such as some versions of the
+ AIXWindows server). It may improve scrolling performance on servers
+-which provide backing-store.
++which provide backing\(hystore.
+ Force the use of a private colormap. Normally colors are allocated
+ shared unless there are not enough colors available.
+ Forces \fIxloadimage\fR and \fIxview\fR to be quiet. This is the
+ default for \fIxsetbg\fR, but the others like to whistle.
+ List the supported image types.
+ Forces \fIxloadimage\fR to try to load the image as a particular file
+ type rather than trying to guess. This often improves load
++performance noticeably.
+ Causes \fIxloadimage\fR to be talkative, telling you what kind of
+ image it's playing with and any special processing that it has to do.
+ This is the default for \fIxview\fR and \fIxloadimage\fR.
+ Print the version number and patchlevel of this version of
+-View image(s) in a window. This is the opposite of \fI-onroot\fR and
++View image(s) in a window. This is the opposite of \fI\-onroot\fR and
+ the default for \fIxview\fR and \fIxloadimage\fR.
+--visual \fIvisual_name\fR
++\-visual \fIvisual_name\fR
+ Force the use of a specific visual type to display an image. Normally
+ \fIxloadimage\fR tries to pick the best available image for a
+ particular image type. The available visual types are: DirectColor,
+ TrueColor, PseudoColor, StaticColor, GrayScale, and StaticGray.
+ Nonconflicting names may be abbreviated and case is ignored.
+--windowid \fIhex_window_id\fR
++\-windowid \fIhex_window_id\fR
+ Sets the background pixmap of a particular window ID. The argument
+-must be in hexadecimal and must be preceeded by "0x" (\fIeg\fR
+--windowid 0x40000b. This is intended for setting the background
++must be in hexadecimal and must be preceded by "0x" (\fIeg\fR
++\-windowid 0x40000b. This is intended for setting the background
+ pixmap of some servers which use untagged virtual roots
+ (\fIeg\fR HP-VUE), but can have other interesting applications.
+-The following options may preceed each image. These options are
+-local to the image they preceed.
++The following options may precede each image. These options are
++local to the image they precede.
+ Indicates coordinates to load the image at on the base image. If
+-this is an option to the first image, and the \fI-onroot\fR option is
++this is an option to the first image, and the \fI\-onroot\fR option is
+ specified, the image will be loaded at the given location on the
+--background \fIcolor\fR
++\-background \fIcolor\fR
+ Use \fIcolor\fR as the background color instead of the default
+ (usually white but this depends on the image type) if you are
+ transferring a monochrome image to a color display.
+--brighten \fIpercentage\fR
++\-brighten \fIpercentage\fR
+ Specify a percentage multiplier for a color image's colormap. A value
+ of more than 100 will brighten an image, one of less than 100 will
+ Center the image on the base image loaded. If this is an option to
+ the first image, and the \fI-onroot\fR option is specified, the image
+ will be centered on the display background.
+--clip \fIX\fR,\fIY\fR,\fIW\fR,\fIH\fR
++\-clip \fIX\fR,\fIY\fR,\fIW\fR,\fIH\fR
+ Clip the image before loading it. \fIX\fR and \fIY\fR define the
+-upper-left corner of the clip area, and \fIW\fR and \fIH\fR define the
++upper\(hyleft corner of the clip area, and \fIW\fR and \fIH\fR define the
+ extents of the area. A zero value for \fIW\fR or \fIH\fR will be
+ interpreted as the remainder of the image.
+ Specify the maximum number of colors to use in the image. This is a
+ way to forcibly reduce the depth of an image.
+-Dither a color image to monochrome using a Floyd-Steinberg dithering
++Automatically advance to the next image after \fIsecs\fR seconds. You
++may want to use the \fI\-global\fR switch with this command to create a
++slideshow with multiple images.
++Dither a color image to monochrome using a Floyd\(hySteinberg dithering
+ algorithm. This happens by default when viewing color images on a
+-monochrome display. This is slower than \fI-halftone\fR and affects
++monochrome display. This is slower than \fI\-halftone\fR and affects
+ the image accuracy but usually looks much better.
+--foreground \fIcolor\fR
++\-foreground \fIcolor\fR
+ Use \fIcolor\fR as the foreground color instead of black if you are
+ transferring a monochrome image to a color display. This can also be
+ used to invert the foreground and background colors of a monochrome
+--gamma \fIdisplay_gamma\fR
++\-gamma \fIdisplay_gamma\fR
+ Specify the gamma correction for the display.
+ The default value is 1.0, a typical display needs 2.0 to 2.5.
+ Force the following option to apply to all images rather than one
+ specific image. Local image options will temporarily override any
+-option specified with -global.
++option specified with \-global.
+ Convert an image to grayscale. This is very useful when displaying
+ colorful images on servers with limited color capability. It can also
+ be used to convert a bitmap image into a grayscale image, although the
+ resulting image will be smaller than the original. The optional
+-spelling \fI-grey\fR may also be used.
++spelling \fI\-grey\fR may also be used.
+ Force halftone dithering of a color image when displaying on a
+ monochrome display. This option is ignored on monochrome images.
+ This dithering algorithm blows an image up by sixteen times; if you
+-don't like this, the \fI-dither\fR option will not blow the image up
++don't like this, the \fI\-dither\fR option will not blow the image up
+ but will take longer to process and will be less accurate.
+-Set the delay to be used for this image to \fIsecs\fR seconds (see
+-\fI-delay\fR). If \fI-delay\fR was specified, this overrides it. If
+-it was not specified, this sets the automatic advance delay for this
+-image while others will wait for the user to advance them.
+-Inverts a monochrome image. This is shorthand for \fI-foreground
+-white -background black\fR.
++This option is no longer supported due to the addition of
++\fI\-global\fR. The same functionality can be had with \fI\-delay\fR.
++Inverts a monochrome image. This is shorthand for \fI\-foreground
++white \-background black\fR.
+ Merge this image onto the base image after local processing. The base
+ image is considered to be the first image specified or the last image
+-that was not preceeded by \fI-merge\fR. If used in conjunction with
+-\fI-at\fR and \fI-clip\fR, very complex images can be built up. This
+-option is on by default for all images if the \fI-onroot\fR or
+-\fI-windowid\fR options are specified.
++that was not preceded by \fI\-merge\fR. If used in conjunction with
++\fI\-at\fR and \fI\-clip\fR, very complex images can be built up. This
++option is on by default for all images if the \fI\-onroot\fR or
++\fI\-windowid\fR options are specified.
++\-name \fIimage_name\fR
+ Force the next argument to be treated as an image name. This is
+-useful if the name of the image is \fI-dither\fR, for instance.
++useful if the name of the image is \fI\-dither\fR, for instance.
+ Reset globally-specified options.
+ Normalize a color image.
+ Rotate the image by \fIdegrees\fR clockwise. The number must be a
+ Shrink an image down to fit on the display. This is particularly
+ useful with servers that do not support window sizes larger than the
+ physical screen (eg DECWINDOWS servers).
+ Smooth a color image. This reduces blockiness after zooming an image
+ up. If used on a monochrome image, nothing happens. This option can
+ take awhile to perform, especially on large images. You may specify
+-more than one \fI-smooth\fR option per image, causing multiple
++more than one \fI\-smooth\fR option per image, causing multiple
+ iterations of the smoothing algorithm.
+ Tile this image (after any necessary merging or tiling) to create a
+ fullscreen image. This is usually used to create a large background
+-image on which to merge other images. \fI-geometry\fR can be used to
+-set the new image size to something other than -fullscreen.
++image on which to merge other images. \fI\-geometry\fR can be used to
++set the new image size to something other than \-fullscreen.
+ Change the title of the image. This sets the title bar title if
+ displaying in a window or the NIFF file image title if dumping the
+--xzoom \fIpercentage\fR
++\-xzoom \fIpercentage\fR
+ Zoom the X axis of an image by \fIpercentage\fR. A number greater
+ than 100 will expand the image, one smaller will compress it. A zero
+-value will be ignored. This option, and the related \fI-yzoom\fR are
++value will be ignored. This option, and the related \fI\-yzoom\fR are
+ useful for correcting the aspect ratio of images to be displayed.
+--yzoom \fIpercentage\fR
+-Zoom the Y axis of an image by \fIpercentage\fR. See \fI-xzoom\fR for
++\-yzoom \fIpercentage\fR
++Zoom the Y axis of an image by \fIpercentage\fR. See \fI\-xzoom\fR for
+-Zoom both the X and Y axes by \fIpercentage\fR. See \fI-xzoom\fR for
++\-zoom \fIpercentage\fR
++Zoom both the X and Y axes by \fIpercentage\fR. See \fI\-xzoom\fR for
+ more information. Technically the percentage actually zoomed is the
+ square of the number supplied since the zoom is to both axes, but I
+ opted for consistency instead of accuracy.
+@@ -347,80 +347,80 @@ To load the rasterfile "my.image" onto t
+ it to fill the entire background:
+-xloadimage -onroot my.image
++xloadimage \-onroot my.image
+ To center an image on the default root background:
+-xloadimage -default -tile my.image
++xloadimage \-default \-tile my.image
+ If using a monochrome display and a color image you will probably want
+ to dither the image for a cleaner (and faster) display:
+-xloadimage -default -tile -dither my.image
++xloadimage \-default \-tile \-dither my.image
+ To load a monochrome image "my.image" onto the background, using red
+ as the foreground color, replicate the image, and overlay
+ "another.image" onto it at coordinate (10,10):
+-xloadimage -foreground red my.image -at 10,10 another.image
++xloadimage \-foreground red my.image \-at 10,10 another.image
+ To center the rectangular region from 10 to 110 along the X axis and
+ from 10 to the height of the image along the Y axis:
+-xloadimage -center -clip 10,10,100,0 my.image
++xloadimage \-center \-clip 10,10,100,0 my.image
+ To double the size of an image:
+-xloadimage -zoom 200 my.image
++xloadimage \-zoom 200 my.image
+ To halve the size of an image:
+-xloadimage -zoom 50 my.image
++xloadimage \-zoom 50 my.image
+ To brighten a dark image:
+-xloadimage -brighten 150 my.image
++xloadimage \-brighten 150 my.image
+ To darken a bright image:
+-xloadimage -brighten 50 my.image
++xloadimage \-brighten 50 my.image
+ .SH HINTS FOR GOOD IMAGE DISPLAYS
+ Since images are likely to come from a variety of sources, they may be
+ in a variety of aspect ratios which may not be supported by your
+-display. The \fI-xzoom\fR and \fI-yzoom\fR options can be used to
++display. The \fI\-xzoom\fR and \fI\-yzoom\fR options can be used to
+ change the aspect ratio of an image before display. If you use these
+ options, it is recommended that you increase the size of one of the
+ dimensions instead of shrinking the other, since shrinking looses
+ detail. For instance, many GIF and G3 FAX images have an X:Y ratio of
+ about 2:1. You can correct this for viewing on a 1:1 display with
+-either \fI-xzoom 50\fR or \fI-yzoom 200\fR (reduce X axis to 50% of
++either \fI\-xzoom 50\fR or \fI\-yzoom 200\fR (reduce X axis to 50% of
+ its size and expand Y axis to 200% of its size, respectively) but the
+ latter should be used so no detail is lost in the conversion.
+ When zooming color images up you can reduce blockiness with
+-\fI-smooth\fR. For zooms of 300% or more, I recommend two smoothing
++\fI\-smooth\fR. For zooms of 300% or more, I recommend two smoothing
+ passes (although this can take awhile to do on slow machines). There
+-will be a noticable improvement in the image.
++will be a noticeable improvement in the image.
+ You can perform image processing on a small portion of an image by
+-loading the image more than once and using the \fI-merge\fR, \fI-at\fR
+-and \fI-clip\fR options. Load the image, then merge it with a
++loading the image more than once and using the \fI\-merge\fR, \fI\-at\fR
++and \fI\-clip\fR options. Load the image, then merge it with a
+ clipped, processed version of itself. To brighten a 100x100 rectangular
+ portion of an image located at (50,50), for instance, you could type:
+-xloadimage my.image -merge -at 50,50 -clip 50,50,100,100 -brighten 150 my.image
++xloadimage my.image \-merge \-at 50,50 \-clip 50,50,100,100 \-brighten 150 my.image
+ If you're using a display with a small colormap to display colorful
+-images, try using the \fI-gray\fR option to convert to grayscale.
++images, try using the \fI\-gray\fR option to convert to grayscale.
+ .SH PATHS AND EXTENSIONS
+ The file ~/.xloadimagerc (and optionally a system-wide file) defines a
+ number of configuration options that affect xloadimage.
+@@ -472,19 +472,19 @@ provided for compressed (.Z) files and G
+ \fBFILTERS\fR section for more information on defining your own
+-Any text on a line following a hash-mark (#) is ignored; if you wish
+-to use a hash-mark in a path, extension, or filter you can escape it
++Any text on a line following a hash\(hymark (#) is ignored; if you wish
++to use a hash\(hymark in a path, extension, or filter you can escape it
+ using a backslash (\\).
+ If you wish to include white-space in a filter program name, path, or
+-extension you can enclose the entire text in double-quotes. For
++extension you can enclose the entire text in double\(hyquotes. For
+- filter = "gzip -cd" .gz
++ filter = "gzip \-cd" .gz
+-Use backslash (\\) characters to allow inclusion of double-quote marks
++Use backslash (\\) characters to allow inclusion of double\(hyquote marks
+ The following is a sample ~/.xloadimagerc file:
+@@ -499,7 +499,7 @@ The following is a sample ~/.xloadimager
+ extension = .csun .msun .sun .face .xbm .bm
+ # invoke GNU zip if a .z or .zip extension is found
+- filter = "gzip -cd" .z .zip
++ filter = "gzip \-cd" .z .zip
+@@ -507,7 +507,7 @@ The following is a sample ~/.xloadimager
+ \fIXloadimage\fR currently supports many common and some uncommon
+ image types, and can create images in several formats. For a complete
+-list use the \fI-supported\fR option.
++list use the \fI\-supported\fR option.
+ Several image dumpers are included that can be used to create a new
+ image after loading and processing. The NIFF (Native Image File
+@@ -518,12 +518,12 @@ format.
+ Some image dumpers allow options that affect the image output. These
+ options are appended to the image type following a comma and are
+ separated by commas. If a value is desired it can be specified
+-following an equals-sign. For example, to create a monochrome JPEG
++following an equals\(hysign. For example, to create a monochrome JPEG
+ image file with a quality factor of 80, you would use the following
+- xloadimage image_name -dump jpeg,quality=80,grayscale new_image.jpg
++ xloadimage image_name \-dump jpeg,quality=80,grayscale new_image.jpg
+ Option names can be abbreviated but if the abbreviation is too short
+@@ -537,20 +537,20 @@ The xloadimage distribution includes a s
+ called \fIuufilter\fR that can be used to automatically uudecode files
+ for processing. \fIUufilter\fR ignores extraneous lines in the file
+ so it is particularly useful if the uuencoded file was created by
+-concatenating email or news postings that had headers or line-break
++concatenating email or news postings that had headers or line\(hybreak
+ To make use of \fIuufilter\fR you can add the following to your
+ \fI.xloadimagerc\fR file:
+- filter = "uufilter -s" .uu .uue
++ filter = "uufilter \-s" .uu .uue
+ The filter will be automatically invoked on any file with a .uu or
+ For a list of filters automatically recognized by xloadimage use the
+-\fI-configuration\fR option.
++\fI\-configuration\fR option.
+ .SH SUPPORTED IMAGE OPTIONS
+@@ -564,7 +564,7 @@ Force a monochrome (grayscale) image to
+-Create a non-interleaved file.
++Create a non\(hyinterleaved file.
+ Enable entropy parameter optimization.
+@@ -604,9 +604,9 @@ Image data compression technique. Can b
+ \fIrle\fR (CCITT RLE compression),
+ \fIg3fax\fR (CCITT Group 3 FAX compression),
+ \fIg4fax\fR (CCITT Group 4 FAX compression),
+-\fIlzw\fR (Limpel-Ziv-Welsh compression, the default),
++\fIlzw\fR (Limpel\(hyZiv\(hyWelsh compression, the default),
+ \fIjpeg\fR (JPEG compression),
+-\fInext\fR (NeXT run-length compression),
++\fInext\fR (NeXT run\(hylength compression),
+ \fIrlew\fR (CCITT RLEW compression),
+ \fImac\fR (Macintosh PackBits compression),
+ \fIpackbits\fR (same as \fImac\fR),
+@@ -624,25 +624,25 @@ CenterLine Software
+-For a more-or-less complete list of other contributors (there are a
++For a more\(hyor\(hyless complete list of other contributors (there are a
+ \fIlot\fR of them), please see the README file enclosed with the
+-xloadimage - the image loader and viewer
+-xsetbg - pseudonym which quietly sets the background
+-xview - pseudonym which views in a window
+-/usr/lib/X11/Xloadimage - default system-wide configuration file
+-~/.xloadimagerc - user's personal configuration file
++xloadimage \- the image loader and viewer
++xsetbg \- pseudonym which quietly sets the background
++xview \- pseudonym which views in a window
++/etc/X11/Xloadimage \- default system-wide configuration file
++~/.xloadimagerc \- user's personal configuration file
+ Copyright (c) 1989, 1993 Jim Frost and others.
+-\fIXloadimage\fR is copywritten material with a very loose copyright
++\fIXloadimage\fR is copyrighted material with a very loose copyright
+ allowing unlimited modification and distribution if the copyright
+-notices are left intact. Various portions are copywritten by various
++notices are left intact. Various portions are copyrighted by various
+ people, but all use a modification of the MIT copyright notice.
+ Please check the source for complete copyright information. The
+ intent is to keep the source free, not to stifle its distribution, so
+@@ -662,7 +662,7 @@ file, but \fIxloadimage\fR will only dis
+ Only GIF87a format is supported.
+ One of the pseudonyms for \fIxloadimage\fR, \fIxview\fR, is the same
+-name as Sun uses for their SunView-under-X package. This will be
++name as Sun uses for their SunView\(hyunder\(hyX package. This will be
+ confusing if you're one of those poor souls who has to use Sun's
+@@ -674,7 +674,7 @@ screen, something which is normally avoi
+ also ignore the MaxSize argument's real function, to limit the maximum
+ size of the window, and allow the window to be resized larger than the
+ image. If this happens, \fIxloadimage\fR merely places the image in
+-the upper-left corner of the window and uses the zero-value'ed pixel
++the upper\(hyleft corner of the window and uses the zero\(hyvalue'ed pixel
+ for any space which is not covered by the image. This behavior is
+-less-than-graceful but so are window managers which are cruel enough
++less\(hythan\(hygraceful but so are window managers which are cruel enough
+ to ignore such details.
+Index: xloadimage.4.1.old/cmuwmraster.c
+===================================================================
+--- xloadimage.4.1.old.orig/cmuwmraster.c
++++ xloadimage.4.1.old/cmuwmraster.c
+-int babble(name, headerp)
++void babble(name, headerp)
+ struct cmuwm_header *headerp;
+- printf("%s is a %dx%d %d plane CMU WM raster\n",
++ printf("%s is a %ldx%ld %ld plane CMU WM raster\n",
+ memToVal(headerp->width, sizeof(long)),
+ memToVal(headerp->height, sizeof(long)),
+@@ -108,7 +108,7 @@ unsigned int verbose;
+ fprintf(stderr,"CMU WM raster %s is of depth %d, must be 1",
+Index: xloadimage.4.1.old/copyright.h
+===================================================================
+--- xloadimage.4.1.old.orig/copyright.h
++++ xloadimage.4.1.old/copyright.h
+ static char *Copyright= "Copyright 1989, 1993 Jim Frost";
+ #define _JIM_COPYRIGHT_
+Index: xloadimage.4.1.old/gif.c
+===================================================================
+--- xloadimage.4.1.old.orig/gif.c
++++ xloadimage.4.1.old/gif.c
+@@ -468,7 +468,7 @@ static int gifin_push_string(code)
+ * add a new string to the string table
+-static gifin_add_string(p, e)
++static void gifin_add_string(p, e)
+@@ -488,7 +488,7 @@ static gifin_add_string(p, e)
+ * semi-graceful fatal error mechanism
+-static gifin_fatal(msg)
++static void gifin_fatal(msg)
+ printf("Error reading GIF file: %s\n", msg);
+Index: xloadimage.4.1.old/gif.h
+===================================================================
+--- xloadimage.4.1.old.orig/gif.h
++++ xloadimage.4.1.old/gif.h
+@@ -50,8 +50,8 @@ static int gifin_load_cmap();
+ static int gifin_skip_extension();
+ static int gifin_read_data_block();
+ static int gifin_push_string();
+-static int gifin_add_string();
+-static int gifin_fatal();
++static void gifin_add_string();
++static void gifin_fatal();
+ /* #defines, typedefs, and such
+Index: xloadimage.4.1.old/halftone.c
+===================================================================
+--- xloadimage.4.1.old.orig/halftone.c
++++ xloadimage.4.1.old/halftone.c
+@@ -130,23 +130,23 @@ unsigned short BlueIntensity[256]= {
+ #define GRAYSTEP ((unsigned long)(65536 / GRAYS))
+ static byte DitherBits[GRAYS][4] = {
+ /* simple dithering algorithm, really optimized for the 4x4 array
+Index: xloadimage.4.1.old/kljcpyrght.h
+===================================================================
+--- xloadimage.4.1.old.orig/kljcpyrght.h
++++ xloadimage.4.1.old/kljcpyrght.h
+ static char *KLJCopyright = "Copyright 1989, 1990 Kirk L. Johnson";
+ #define _KLJ_COPYRIGHT_
+Index: xloadimage.4.1.old/mcidas.c
+===================================================================
+--- xloadimage.4.1.old.orig/mcidas.c
++++ xloadimage.4.1.old/mcidas.c
+@@ -63,7 +63,7 @@ static char *convert_date(time, date)
+ minute = (time % 10000) / 100;
+- sprintf(buf, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
++ snprintf(buf, 29, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
+ hour, minute, second, month_info[month].name, day, year,
+@@ -94,7 +94,7 @@ static void babble(name, dir)
+- printf("%s is a %dx%d McIDAS areafile from %s at %s (%d, %d) (%d, %d)\n",
++ printf("%s is a %ldx%ld McIDAS areafile from %s at %s (%ld, %ld) (%ld, %ld)\n",
+@@ -163,7 +163,6 @@ Image *mcidasLoad(fullname, name, verbos
+ if (! (zf= zopen(fullname))) {
+@@ -218,7 +217,7 @@ Image *mcidasLoad(fullname, name, verbos
+ zread(zf, image->data, dir.esiz * dir.lsiz * dir.zsiz) ;
+- printf("Warning: Only showing first of %d bands\n", dir.bands);
++ printf("Warning: Only showing first of %ld bands\n", dir.bands);
+ image->title= dupString(name);
+Index: xloadimage.4.1.old/misc.h
+===================================================================
++++ xloadimage.4.1.old/misc.h
++void usageHelp() __attribute__ ((noreturn));
+Index: xloadimage.4.1.old/mit.cpyrght
+===================================================================
+--- xloadimage.4.1.old.orig/mit.cpyrght
++++ xloadimage.4.1.old/mit.cpyrght
+ static char *MitCopyright=
+ "Copyright 1989 Massachusetts Institute of Technology";
+ #define _MIT_COPYRIGHT_
+Index: xloadimage.4.1.old/options.h
+===================================================================
+--- xloadimage.4.1.old.orig/options.h
++++ xloadimage.4.1.old/options.h
+ * copyright information.
+ /* enum with the options in it. If you add one to this you also have to
+ * add its information to Options[] in options.c before it becomes available.
+@@ -98,3 +101,8 @@ int getNextTypeOption();
+ Image *loadImage _ArgProto((OptionSet *globalopts, OptionSet *options,
+ char *name, unsigned int verbose));
+ void identifyImage _ArgProto((char *name));
++void processOptions (int argc, char *argv[], OptionSet **rglobal, OptionSet **rimage);
++void addOption (OptionSet *optset, Option *newopt);
++#endif /* __OPTIONS_H__ */
+Index: xloadimage.4.1.old/pcx.c
+===================================================================
+--- xloadimage.4.1.old.orig/pcx.c
++++ xloadimage.4.1.old/pcx.c
+@@ -259,7 +259,6 @@ static void PCX_LoadImage ( zf ,image )
+ switch (PCXH->Zbpp) { /* What kind of plane do we have ? */
+ case 1 : /* Bit planes */
+ if (PCXH->Znplanes == 1) /* Only one : Read it */
+@@ -298,7 +297,7 @@ Image *pcxLoad ( fullname, name, verbose
+Index: xloadimage.4.1.old/pdsuncomp.c
+===============================================================