libtiff: v3.4beta031 release

From 9b8fa7705c7d7aa31cef9c148e19cd59162f3519 Mon Sep 17 00:00:00 2001
From: Sam Leffler <[EMAIL REDACTED]>
Date: Tue, 19 Mar 1996 18:26:58 +0000
Subject: [PATCH] v3.4beta031 release

---
 Makefile.in           |   3 +-
 config.guess          |   8 +-
 config.site           |  13 +-
 configure             | 218 ++++++++++++++-----
 dist/tiff.alpha       |   2 +-
 html/build.html       |  84 +++++++-
 html/index.html       |   4 +-
 html/v3.4beta031.html |  93 ++++++++
 libtiff/Makefile.in   |  87 ++++++--
 libtiff/tif_codec.c   |   8 +-
 libtiff/tif_print.c   |  50 +----
 libtiff/tif_zip.c     | 138 +++++++++---
 libtiff/tiff.h        |  25 ++-
 libtiff/tiffio.h      |  11 +-
 man/Makefile.in       | 479 ++++++++++++++++++++++++++----------------
 port/Makefile.in      |   8 +-
 tools/Makefile.in     |   7 +-
 tools/ppm2tiff.c      |   4 +-
 18 files changed, 879 insertions(+), 363 deletions(-)
 create mode 100644 html/v3.4beta031.html

diff --git a/Makefile.in b/Makefile.in
index d9d15abf..6e7e9a40 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
 #! smake
-#	$Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.44 1996/02/09 21:29:19 sam Exp $
+#	$Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.45 1996/03/18 22:21:38 sam Exp $
 #
 # @WARNING@
 #
@@ -260,6 +260,7 @@ TIFFFILES=\
 	    html/misc.html			\
 	    html/support.html			\
 	    html/tools.html			\
+	    html/v3.4beta031.html		\
 	    html/v3.4beta029.html		\
 	    html/v3.4beta028.html		\
 	    html/v3.4beta024.html		\
diff --git a/config.guess b/config.guess
index 1626b108..75907e0d 100755
--- a/config.guess
+++ b/config.guess
@@ -295,13 +295,13 @@ EOF
 	fi
 	exit 0 ;;
     i[34]86:*:3.2:*)
-	if /bin/uname -X 2>/dev/null >/dev/null ; then
+	if test -d /etc/conf/cf.d -a -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
 		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
 		echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
-	elif test -f /usr/options/cb.name; then
-		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
 	else
 		echo ${UNAME_MACHINE}-unknown-sysv32
 	fi
diff --git a/config.site b/config.site
index 357294c3..8bc38b91 100644
--- a/config.site
+++ b/config.site
@@ -1,4 +1,4 @@
-# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.10 1996/02/09 05:53:45 sam Exp $
+# $Header: /usr/people/sam/tiff/RCS/config.site,v 1.12 1996/02/22 18:16:44 sam Exp $
 #
 # TIFF Software
 #
@@ -40,7 +40,7 @@
 #
 # Package controls.
 #
-#DSO="auto"			# auto|IRIX configure DSO support for system
+#DSO="auto"			# auto|IRIX|IRIX52 enable DSO support for system
 #JPEG="no"			# yes|no configure JPEG support (see below)
 #ZIP="no"			# yes|no configure Deflate support (see below)
 #LIBGL="auto"			# yes|no|auto configure IRIS GL-based tools
@@ -134,15 +134,8 @@
 #MACHDEPLIBS=""				# extra libraries for linking
 #PORTFUNCS=""				# non-standard functions to emulate
 #RANLIB=":"				# pathname of suitable ranlib program
-
-#
-# Dynamic Shared Object (DSO) support.
-#
-# Beware that adding new support for DSOs may require some
-# modifications to the */Makefile.dso files.
-#
 #DSOSUF="so"				# DSO filename suffix
-#DSOOPTS="-shared -rdata_shared"	# options for building DSOs
+#LIBCOPTS="-K PIC"			# compiler options for building library
 
 #
 # Makefile construction parameters.
diff --git a/configure b/configure
index 9613382d..31e9bd1f 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$Header: /usr/people/sam/tiff/RCS/configure,v 1.34 1996/02/09 05:53:45 sam Exp $
+#	$Header: /usr/people/sam/tiff/RCS/configure,v 1.45 1996/03/19 18:26:58 sam Exp $
 #
 # Tag Image File Format (TIFF) Software
 #
@@ -43,6 +43,7 @@ DIRS_LIBINC=
 DIR_JPEGLIB=
 DIR_GZLIB=
 DSO=auto
+LIBCOPTS=				# library-specific C-compiler options
 JPEG=no
 ZIP=no
 PORT=auto
@@ -140,7 +141,7 @@ do
     -target|--target)		ac_prev=TARGET;;
     -target=*|--target=*)	TARGET="$ac_optarg" ;;
     -version|--version)
-	echo "This is TIFF configure $Revision: 1.34 $"
+	echo "This is TIFF configure $Revision: 1.45 $"
 	exit 0
 	;;
     -help|--help)		usage; exit 0;;
@@ -214,6 +215,28 @@ else
 fi
 exec 5>./config.log			# compiler messages and the like
 
+capture()
+{
+    (eval "set -x; $*") >&5 2>&1
+    return
+}
+captureX()
+{
+    (eval "set -x; $*") 2>&5
+    return
+}
+
+date >&5
+cat 1>&5 <<'EOF'
+
+This file contains information that is captured from running the configure
+script.  Lines that begin with a "+" are command lines echoed by the
+shell.  Other lines are the output of commands; usually the contents of
+test case files or the output from compilers.  If configure does the
+wrong thing, you can use the information captured here to aid in debugging.
+
+EOF
+
 if [ -r $SRCDIR/tiff.alpha ] ; then
     VERSIONFILE=$SRCDIR/VERSION
     ALPHAFILE=$SRCDIR/tiff.alpha
@@ -224,6 +247,10 @@ fi
 VERSION="v`cat $VERSIONFILE``awk '{print $3}' $ALPHAFILE`"
 DATE=`date`
 
+DIST_MAJOR=`echo $VERSION | sed 's/v\([0-9][0-9]*\)\..*/\1/'`
+DIST_MINOR=`echo $VERSION | sed 's/v.*\.\([0-9][0-9]*\).*/\1/'`
+DIST_ALPHA=`echo $VERSION | sed -e 's/.*beta//' -e 's/.*release//'`
+
 Note()
 {
     echo "$@" 1>&4
@@ -235,6 +262,10 @@ if [ $SRCDIR_IS_LIBTIFF = yes ] ; then
 else
   Note "Configuring TIFF Software $VERSION."
 fi
+
+Note ""
+Note "If configure does the wrong thing, check the file config.log for"
+Note "information that may help you understand what went wrong."
 Note ""
 
 #
@@ -243,16 +274,20 @@ Note ""
 if [ -f $SITE/config.site ]; then
     Note "Reading site-wide parameters from $SITE/config.site."
     . $SITE/config.site
+    capture . $SITE/config.site
 elif [ -f $SRCDIR/config.site ]; then
     Note "Reading site-wide parameters from $SRCDIR/config.site."
     . $SRCDIR/config.site
+    capture . $SRCDIR/config.site
 fi
 if [ -f config.local ]; then
     Note "Reading local parameters from config.local."
     . ./config.local
+    capture . ./config.local
 elif [ -f $SRCDIR/config.local ]; then
     Note "Reading local parameters from $SRCDIR/config.local."
     . $SRCDIR/config.local
+    capture . $SRCDIR/config.local
 fi
 
 #
@@ -311,12 +346,6 @@ if [ -z "${FILLORDER:-}" ]; then
     esac
 fi
 
-cat 1>&5 <<EOF
-This file contains any messages produced by compilers while
-running configure, to aid in debugging if configure makes a mistake.
-
-EOF
-
 #
 # Find the full pathname of a file
 # using the specified test operation.
@@ -375,7 +404,7 @@ findHeader()
     case "$1" in
     /*) echo "$1"; return ;;
     esac
-    for i in ${DIRS_LIBINC}; do
+    for i in ${DIRS_LIBINC} /usr/include; do
 	test -r $i/$1 && {
 	    case "$i" in
 	    /*) echo "$i/$1"; return ;;
@@ -391,14 +420,14 @@ findHeader()
 }
 
 #
-# Locate a C and C++ compiler and verify they work and
-# satisfy our needs (using assorted heuristics).
+# Locate a C compiler that satisfies our needs (using assorted heuristics).
 #
 JUNK="
     a.out
     confsed
     conftestmmap
     confx confy
+    confMakefile
     core
     dummy
     dummy.a
@@ -430,7 +459,7 @@ EOF
 #
 isGNU()
 {
-    ($1 -E xgnu.c 2>&5 | egrep yes) >/dev/null 2>&1
+    capture "cat xgnu.c; ($1 -E xgnu.c 2>&5 | egrep yes)"
 }
 
 #
@@ -466,7 +495,7 @@ checkCompiler()
 	C_ANSI="$ENVOPTS"
     fi
     $RM dummy dummy.o
-    ($compiler -o dummy ${C_ANSI} dummy.c) >/dev/null 2>&5 && {
+    capture $compiler -o dummy ${C_ANSI} dummy.c && {
 	CC=$compiler;
 	test -z "${CCOMPILER:-}" && CCOMPILER=`findApp $compiler $PATH`
 	test -z "${ENVOPTS:-}"   && ENVOPTS="${C_ANSI:-}"
@@ -475,27 +504,52 @@ checkCompiler()
     return 1
 }
 
+CCtested=
+capture cat dummy.c
 if [ -z "${CC:-}" ]; then
     CCOMPILER=
     for i in gcc cc ncc dcc xlc c89 gcc2; do
+	CCtested="$CCtested $i"
 	checkCompiler $i && break
     done
 else
+    CCtested="$CCtested $CC"
     checkCompiler $CC
 fi
 if [ -z "$CCOMPILER" ]; then
     cat<<EOF
+
 Cannot locate a working ANSI C compiler.
 
-If the compiler is in a non-standard location, set the environment
-variable CC to the absolute pathname of the compiler that is to be used
-and rerun this script.
+We attempted to compile the following test program:
+
+----------------------------------------------------------
+EOF
+    cat dummy.c
+    cat<<EOF
+----------------------------------------------------------
+
+with these compilers:
+
+    $CCtested
+
+but none of them were successful.
+
+If your compiler is in a non-standard location, you can specify its
+location in several ways:
+
+    o set the environment variable CC
+    o create a config.local or config.site file that includes a
+      definition for CC
+    o supply it on the command line using -with-CC=<pathname>
 
 If command line options are required for ANSI C compilation, set the
-variable ENVOPTS to these options and rerun this script.
+ENVOPTS parameter to these options in a similar way (either through
+an environment variable or config.local/config.site) and then rerun
+this script.
 EOF
-        boom
-    fi
+    boom
+fi
 Note "Using $CCOMPILER for a C compiler (set CC to override)."
 
 test "$ENVOPTS" && {
@@ -512,14 +566,15 @@ CheckForGandO()
 {
    f=$1
    if test -s $f; then
-	grep -i \(error\|warning\) $f 1>&5 2>&5 || return 1
+	capture grep -i \(error\|warning\) $f || return 1
     fi
     return 0
 }
 
 if [ -z "${GCOPTS:-}" ]; then
-    if $CCOMPILER $ENVOPTS -g -c dummy.c >/dev/null 2>&5; then
+    if capture $CCOMPILER $ENVOPTS -g -c dummy.c; then
 	Note "Looks like $CCOMPILER supports the -g option."
+	# NB: cannot use captureX here 'cuz we lose stderr
 	if $CCOMPILER $ENVOPTS -c -g -O dummy.c >t 2>&1 && CheckForGandO t; then
 	    GCOPTS="-g"
 	else
@@ -602,13 +657,22 @@ fi
 #
 # runMake target rules ...
 #
-runMake()
+runMakeX()
 {
     target="$1"; shift
     $RM $target
-    (for i in "$@"; do
+    (echo SRCDIR=.
+       for i in "$@"; do
 	  echo "$i";
-     done) | ${MAKE} -f - $target 2>&5
+       done
+    )>confMakefile
+    captureX ${MAKE} -f confMakefile $target
+    return
+}
+runMake()
+{
+    runMakeX "$@" >&5
+    return
 }
 
 #
@@ -622,7 +686,7 @@ CheckForLibrary()
 int t() { $f(); return 0; }
 int main(){ t(); return 0; }
 EOF
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c $libs" >/dev/null
+    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c $libs"
 }
 
 #
@@ -633,7 +697,7 @@ CheckForIncludeFile()
     (for i do
 	echo "#include \"$i\""
      done)>t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" >/dev/null
+    runMake t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c"
 }
 
 #
@@ -679,7 +743,7 @@ EmitCPlusPlusEpilogue()
 CheckForFunc()
 {
     echo "extern int $1(); main(){$1();exit(0);}" >t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c ${MACHDEPLIBS}" >/dev/null
+    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c ${MACHDEPLIBS}"
 }
 
 #
@@ -696,9 +760,10 @@ CheckForFuncDecl()
     (for i do
 	echo "#include \"$i\""
      done)>t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" |\
+    capture cat t.c
+    runMakeX t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" |\
      awk '{while($0~/[,(][ \t]*$/){printf"%s",$0;getline}print}' |\
-     grep "$f[ ]*(.*)" >/dev/null
+     grep "$f[ ]*(.*)" >&5
     return
 }
 CheckFuncDecl()
@@ -717,7 +782,8 @@ CheckForVarDecl()
     (for i do
 	echo "#include \"$i\""
      done)>t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep "$v" >/dev/null
+    capture cat t.c
+    runMakeX t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep "$v" >&5
     return
 }
 CheckVarDecl()
@@ -745,10 +811,11 @@ CheckForDefine()
 	echo "#include \"$i\""
      done
      echo "#ifdef $def"
-     echo "FOUND"
+     echo "FOUND();"
      echo "#endif"
     )>t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep FOUND >/dev/null
+    capture cat t.c
+    runMakeX t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep FOUND >&5
 }
 CheckDefine()
 {
@@ -838,13 +905,15 @@ main()
   exit(0);
 }
 EOF
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c" >/dev/null
+    capture cat t.c
+    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c ${MACHDEPLIBS}" && ./a.out
 }
 
 CheckForBigEndian()
 {
     echo 'main() { int one = 1; char* cp = (char*)&one; exit(*cp!=0); }'>t.c
-    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c">/dev/null && ./a.out
+    capture cat t.c
+    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c" && ./a.out
 }
 
 #
@@ -951,6 +1020,10 @@ BuildPortDotH()
     CheckFuncDecl free 'extern void free(void*);' stdlib.h
     EmitCPlusPlusEpilogue
     )>xport.h
+    if [ $SRCDIR_IS_LIBTIFF = no -a ! -d libtiff ]; then
+	Note "Creating libtiff directory"
+	mkdir libtiff
+    fi
     mv xport.h $PORTDOTH; chmod 444 $PORTDOTH
     Note "Done creating $PORTDOTH."
 }
@@ -995,23 +1068,58 @@ Note "Done checking system libraries."
 Note ""
 Note "Checking for Dynamic Shared Object (DSO) support."
 if [ "$DSO" = auto ]; then
-    case $TARGET in
+    DSOSUF_VERSION=
+    case $TARGET-$CC in
     *-irix5.2*)
 	if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
 	    DSOSUF=so
-	    DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
+	    DSOLD='${LD}'
+	    DSOOPTS='-elf -shared -no_unresolved -all'
 	    DSO=IRIX52
 	fi
 	;;
     *-irix*)
 	if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
 	    DSOSUF=so
+	    DSOLD="${CCOMPILER} ${ENVOPTS}"
 	    DSOOPTS='-shared -rdata_shared -check_registry ${SRCDIR}/port/irix/so_locations -quickstart_info'
 	    DSO=IRIX
 	fi
 	;;
+    *-aix*)
+	DSOSUF=a
+	DSOLD='${LD}'
+	DSOOPTS='-r'
+	LIBCOPTS="-bM\:SRE"
+	DSO=AIX
+	;;
+    *-hpux*)
+	DSOSUF=sl
+	DSOLD='${LD}'
+	DSOOPTS='-b'
+	LIBCOPTS="+Z"
+#	LIBPORT="-Wl,+b${DIR_LIB}"
+	DSO=HPUX
+	;;
+    *-solaris*)
+	DSOSUF=so
+	DSOLD='${LD}'
+	DSOOPTS='-G'
+	LIBCOPTS="-K PIC"
+	DSO=SOLARIS
+	;;
+    *-linux)
+	if [ -x /lib/libc.so.5 ]; then
+	    DSOSUF=so.${DIST_MAJOR}
+	    DSOSUF_VERSION=${DSOSUF}.${DIST_MINOR}.${DIST_ALPHA}
+	    LIBCOPTS='-fPIC'
+	    DSOOPTS='-shared'
+	    DSO=LINUX
+	fi
+	;;
     *)  DSO=no;;
     esac
+    test -z "$DSOSUF_VERSION" && DSOSUF_VERSION=${DSOSUF}
 fi
 if [ "$DSO" != no ]; then
     JUNK="$JUNK t.${DSOSUF}"
@@ -1025,9 +1133,10 @@ if [ "$DSO" != no ]; then
     cat>t.c<<EOF
 int f() { return 0; }
 EOF
+    capture cat t.c
     runMake t \
-	"t.o:; ${CCOMPILER} ${ENVOPTS} -c t.c" \
-	"t: t.o; ${CCOMPILER} ${ENVOPTS} ${DSOOPTS} -o t.${DSOSUF} t.o" >/dev/null
+	"t.o:; ${CCOMPILER} ${ENVOPTS} ${LIBCOPTS} -c t.c" \
+	"t: t.o; ${DSOLD} ${DSOOPTS} -o t.${DSOSUF} t.o"
     }
     if CheckCCDSO; then
 	Note "Looks like your system supports $DSO-style DSOs."
@@ -1040,7 +1149,8 @@ EOF
     fi
 fi
 if [ "$DSO" = no ]; then
-    DSOSUF=a DSOOPTS= 
+    DSOSUF=a DSOOPTS= LIBCOPTS= 
+    DSOSUF_VERSION=$DSOSUF
 fi
 Note "Done checking for DSO support."
 
@@ -1436,7 +1546,7 @@ case $MANSCHEME in
 *-nroff-cat-*)	MANCVT='${MANSED} $? | nroff -man > $@';;
 esac
 case $MANSCHEME in
-*-0.gz|*-0.Z|*-gz|*-Z|*-z)
+*-0|*-0.gz|*-0.Z|*-gz|*-Z|*-z)
     suf=`echo $MANSCHEME | sed 's/.*-/./'`
     A='`echo $$i | sed' B='`'		# workaround shell bugs
     MANAPPNAME="$A s/\\\\.1\$\$/$suf/$B"
@@ -1469,12 +1579,17 @@ fi
 Note ""
 
 #
-# Fixup a list of potentially relative pathnames
-# so that they work when used in a subdirectory.
+# Fixup a list of potentially relative pathnames so
+# that they work when used in a subdirectory.  The
+# string sent to stdout has no extraneous spaces so
+# it can be used, for example, in building pathnames.
+#
+# NB: There's an extra echo done here so we get a
+#     \n-terminated string passed to sed.
 #
 relativize()
 {
-    if [ $SRCDIR_IS_LIBTIFF = no ]; then
+    echo `if [ $SRCDIR_IS_LIBTIFF = no ]; then
 	(for i do
 	    case "$i" in
 	    /*|-l*)	echo "$i" ;;
@@ -1484,12 +1599,12 @@ relativize()
 	    esac
 	done) | tr '\012' ' '
     else
-	(for i do echo "$i" ; done ) | tr '\012' ' '
-    fi
+	echo "$@"
+    fi` | sed -e 's;[ ][ ]*$;;' -e 's;/[.]$;;'
 }
 #
 # Generate a list of compiler include options,
-# relativizing any relative pathnames.
+# prepending ``../'' to any relative pathnames.
 #
 makeIncArgs()
 {
@@ -1514,7 +1629,7 @@ if [ $SRCDIR_IS_LIBTIFF = yes ]; then
     LIBSRCDIR="${SRCDIR}"
 else
     CONFIGDIR=".."
-    LIBSRCDIR="../${SRCDIR}/libtiff"
+    LIBSRCDIR=`relativize ${SRCDIR}`/libtiff
 fi
 
 # NB: these should be sorted alphabetically
@@ -1530,7 +1645,7 @@ cat>>confsed<<EOF
 /@COPT_LIBINC@/s;;`makeIncArgs ${DIRS_LIBINC}`;g
 /@DATE@/s;;${DATE};g
 /@DEPEND_JPEGLIB@/s;;${CONF_JPEG:+`findHeader jpeglib.h` `findHeader jerror.h`};g
-/@DEPEND_ZLIB@/s;;${CONF_ZIP:+`findHeader zlib.h` `findHeader zutil.h`};g
+/@DEPEND_ZLIB@/s;;${CONF_ZIP:+`findHeader zlib.h`};g
 /@DIR_BIN@/s;;${DIR_BIN};g
 /@DIR_JPEGLIB@/s;;`relativize ${DIR_JPEGLIB}`;g
 /@DIR_GZLIB@/s;;`relativize ${DIR_GZLIB}`;g
@@ -1538,9 +1653,12 @@ cat>>confsed<<EOF
 /@DIR_LIB@/s;;${DIR_LIB};g
 /@DIR_MAN@/s;;${DIR_MAN};g
 /@DIRS_LIBINC@/s;;`relativize ${DIRS_LIBINC}`;g
+/@DIST_ALPHA@/s;;${DIST_ALPHA};g
+/@DIST_MAJOR@/s;;${DIST_MAJOR};g
+/@DIST_MINOR@/s;;${DIST_MINOR};g
 /@DSO@/s;;${DSO};g
-/@DSOOPTS@/s;;${DSOOPTS};g
 /@DSOSUF@/s;;${DSOSUF};g
+/@DSOSUF_VERSION@/s;;${DSOSUF_VERSION};g
 /@ENVOPTS@/s;;${ENVOPTS};g
 /@FILLORDER@/s;;${FILLORDER};g
 /@GCOPTS@/s;;${GCOPTS};g
@@ -1550,6 +1668,7 @@ cat>>confsed<<EOF
 /@LIBGZ@/s;;`relativize ${LIBGZ}`;g
 /@LIBSRCDIR@/s;;${LIBSRCDIR};g
 /@LIBIMAGE@/s;;${LIBIMAGE};g
+/@LIBCOPTS@/s;;${LIBCOPTS};g
 /@LIBPORT@/s;;${LIBPORT};g
 /@LN@/s;;${LN};g
 /@LN_S@/s;;${LN_S};g
@@ -1568,6 +1687,7 @@ cat>>confsed<<EOF
 /@SED@/s;;${SED};g
 /@SETMAKE@/s;;${SETMAKE};g
 /@SRCDIR@/s;;${SRCDIR};g
+/@RELSRCDIR@/s;;`relativize ${SRCDIR}`;g
 /@STRIP@/s;;${STRIP};g
 /@TARGET@/s;;${TARGET};g
 /@VERSION@/s;;${VERSION};g
diff --git a/dist/tiff.alpha b/dist/tiff.alpha
index cd85e195..c04be6b3 100644
--- a/dist/tiff.alpha
+++ b/dist/tiff.alpha
@@ -1 +1 @@
-define ALPHA 029
+define ALPHA 031
diff --git a/html/build.html b/html/build.html
index 51ebb5d3..6cefc72a 100644
--- a/html/build.html
+++ b/html/build.html
@@ -107,10 +107,6 @@ <H5>
   the distribution on CD-ROM)
 </UL>
 
-Beware that if you choose to use the second scheme for configuring
-the software you must not use an absolute pathname when you run configure
-(i.e. a pathname that begins with ``/'').
-
 <A NAME="ConfigFiles"><P><HR WIDTH=65% ALIGN=right><H3>Configuration Files</H3></A>
 
 The configuration process is critical to the proper compilation,
@@ -418,6 +414,56 @@ <H5>
 Done.
 </TT></PRE></UL>
 
+<A NAME=DSOSupport><P><HR><H3>Shared Library Support</H3></A>
+
+It is desirable to make the TIFF library be a shared object
+on systems that have support for shared libraries.
+Unfortunately the rules to use to build a shared library
+vary between operating systems and even compilers.
+The distributed software includes support for building a shared
+version of the library on a number of different systems.
+This support is split between rules in the file
+<B>libtiff/Makefile.in</B> that construct the shared library
+and checks done by the <TT>configure</TT> script to verify that
+the expected rules are supported by compilation tools for 
+the target system.
+
+<P>
+To add new support for building a shared library both these files
+must be updated.
+In the configure script search for the section where the autoconfiguration
+setting of the <TT>DSO</TT> parameter is handled and
+add a new case for the target system that sets the
+<TT>DSOSUF</TT>,
+<TT>DSOLD</TT>,
+<TT>DSOOPTS</TT>,
+and
+<TT>LIBCOPTS</TT>
+options as appropriate for the system.
+<TT>DSOSUF</TT> specifies the filename suffix used for the shared
+library (e.g. ``.so'' for Dynamic Shared Objects on most SVR4-based
+systems).
+<TT>DSOLD</TT> specifies the program to use to build the shared library
+from a compiled object file; typically ``${LD}'' though on some systems
+it is better to use the C compiler directly so system-dependent options and
+libraries are automatically supplied.
+<TT>DSOOPTS</TT> are options that must be specified to <TT>DSOLD</TT>
+when building the shared library.
+<TT>LIBCOPTS</TT> are options to pass to the C compiler when constructing
+a relocatable object file to include in a shared library; e.g. ``-K PIC''
+on a Sun system.
+The <TT>DSO</TT> parameter must also be set to a unique label that identifies
+the target system and compilation tools.
+This label is used to select
+a target in <B>libtiff/Makefile.in</B> to do the actual work in building
+the shared library.
+Finally, to complete support for the shared library added the appropriate
+rules to <B>libtiff/Makefile.in</B> under the target specified in the
+<TT>configure</TT> script.
+
+
+
+
 <A NAME="Parameters"><P><HR WIDTH=65% ALIGN=right><H3>Configuration Parameters</H3></A>
 
 This section gives a brief description of the less obvious
@@ -475,9 +521,21 @@ <H5>
 </TR>
 
 <TR>
-<TD VALIGN=top><TT>DSOOPTS</TT></TD>
-<TD>When DSO's are built, the options to specify to <TT>CC</TT>
-to create a DSO.</TD>
+<TD VALIGN=top><TT>DIST_ALPHA</TT></TD>
+<TD>The alpha version number for the distribution; e.g. if this
+is version 3.4beta031 then the the major number is 31.</TD>
+</TR>
+
+<TR>
+<TD VALIGN=top><TT>DIST_MAJOR</TT></TD>
+<TD>The major version number for the distribution; e.g. if this
+is version 3.4beta031 then the the major number is 3.</TD>
+</TR>
+
+<TR>
+<TD VALIGN=top><TT>DIST_MINOR</TT></TD>
+<TD>The minor version number for the distribution; e.g. if this
+is version 3.4beta031 then the the major number is 4.</TD>
 </TR>
 
 <TR>
@@ -486,6 +544,16 @@ <H5>
 If this is set to <TT>"a"</TT> then  statically linked archives are used.</TD>
 </TR>
 
+<TR>
+<TD VALIGN=top><TT>DSOSUF_VERSION</TT></TD>
+<TD>When DSO's are built, a version-specific filename suffix for a DSO.
+If this is set to something other than the value of <TT>DSO</TT> then
+the file <B>libtiff.<TT>DSOSUF_VERSION</TT></B> will be installed and
+a link to it named <B>libtiff.<TT>DSOSUF</TT></B> will automatically
+be created.  (Note that this means that rule for building the target
+DSO must generate a file named <B>libtiff.<TT>DSOSUF_VERSION</TT></B>.)</TD>
+</TR>
+
 <TR>
 <TD VALIGN=top><TT>ENVOPTS</TT></TD>
 <TD>Options to pass to <TT>CC</TT> to force ANSI C compilation.</TD>
@@ -1037,7 +1105,7 @@ <H3>Compiling LibTIFF:</H3>
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/02/09 22:08:41 $
+Last updated: $Date: 1996/03/18 22:21:04 $
 </ADDRESS>
 
 </BODY>
diff --git a/html/index.html b/html/index.html
index 86de3779..c35ddf6c 100644
--- a/html/index.html
+++ b/html/index.html
@@ -12,7 +12,7 @@ <H1>
 </H1>
 
 <B>Latest Release</B>: <I>None</I><BR>
-<B>Latest Software</B>: <A HREF="v3.4beta029.html">v3.4beta029</A><BR>
+<B>Latest Software</B>: <A HREF="v3.4beta031.html">v3.4beta031</A><BR>
 <B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
 <B>Home Page</B>: <A HREF="http://www-mipl.jpl.nasa.gov/~ndr/tiff/">
   http://www-mipl.jpl.nasa.gov/~ndr/tiff/</A> <BR>
@@ -81,7 +81,7 @@ <H5>
 
 <ADDRESS>
 <A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>.
-Last updated: $Date: 1996/02/09 21:28:38 $
+Last updated: $Date: 1996/03/18 22:21:19 $
 </ADDRESS>
 
 </BODY>
diff --git a/html/v3.4beta031.html b/html/v3.4beta031.html
new file mode 100644
index 00000000..032b3b5b
--- /dev/null
+++ b/html/v3.4beta031.html
@@ -0,0 +1,93 @@
+<HTML>
+<HEAD>
+<TITLE>
+Changes in TIFF v3.4beta031
+</TITLE>
+</HEAD>
+
+<BODY>
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<UL>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+<B>Current Version</B>: v3.4beta031<BR>
+<B>Previous Version</B>: <A HREF=v3.4beta029.html>v3.4beta029</A><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+</UL>
+
+<P>
+This document describes the changes made to the software between the
+<I>previous</I> and <I>current</I> versions (see above).
+If you don't find something listed here, then it was not done in this
+timeframe, or it was not considered important enough to be mentioned.
+The following information is located here:
+<UL>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+<LI><A HREF="#man">Changes in the manual pages</A>
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+<LI><B>configure</B> now captures significantly more information
+   in the <B>config.log</B> file and provides more information when
+   it is unable to setup a configuration
+<LI>support was added for building shared libraries on more systems:
+   AIX, HPUX, Solaris, and Linux.
+<LI>a new configuration parameter <TT>LIBCOPTS</TT> was added for
+   passing arguments to the C compiler to use when building only
+   the library; this is part of the enhanced support for building
+   shared libraries
+<LI>include files for optional packages that reside in <B>/usr/include</B>
+   are now handled correctly
+<LI>build trees may now be configured using either relative or absolute
+   pathnames to the source distribution
+<LI>several new configuration parameters were added, mainly for building
+   shared libraries: <TT>DIST_MAJOR</TT>, <TT>DIST_MINOR</TT>, 
+   <TT>DIST_ALPHA</TT>, and <TT>DSOSUF_VERSION</TT>
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+<LI>the Deflate support has been revised: it requires version 0.99 of
+   the zlib software distribution, <B>the output format has changed and
+   is incompatible with previous versions of this library</B> (each
+   strip now includes a header read and written by the zlib library)
+<LI>the codec name printed by the TIFFPrintDirectory routine is now
+   taken from the codec table instead of from a builtin table; this means
+   that application-defined codecs are handled correctly
+<LI>a new symbol was added that contains the library version number;
+   this can be used to do a compile-time compatibility check of the
+   library version
+</UL>
+
+<P><HR WIDTH=65% ALIGN=right>
+
+<A NAME="man"><B><FONT SIZE=+3>C</FONT>HANGES IN THE MANUAL PAGES:</B></A>
+
+<UL>
+<LI>the creation and installation of manual pages was redone; it now
+    implements the documented ``configuration scheme''
+</UL>
+
+<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>
+
+<HR>
+
+<ADDRESS>
+<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
+Last updated $Date: 1996/03/18 22:05:56 $.
+</ADDRESS>
+
+</BODY>
+</HTML>
diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in
index d29af81b..f7d0c488 100644
--- a/libtiff/Makefile.in
+++ b/libtiff/Makefile.in
@@ -1,4 +1,4 @@
-#	$Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.28 1996/02/09 05:55:00 sam Exp $
+#	$Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.32 1996/03/14 00:54:03 sam Exp $
 #
 # Tag Image File Format Library
 #
@@ -63,7 +63,7 @@ IPATH	= -I. -I${SRCDIR} @COPT_LIBINC@
 CONF_LIBRARY=@CONF_JPEG@ @CONF_ZIP@
 COPTS	= @GCOPTS@
 OPTIMIZER=-O
-CFLAGS	= @ENVOPTS@ ${COPTS} ${OPTIMIZER} ${IPATH} ${CONF_LIBRARY}
+CFLAGS	= @ENVOPTS@ @LIBCOPTS@ ${COPTS} ${OPTIMIZER} ${IPATH} ${CONF_LIBRARY}
 #
 SRCS	= \
 	tif_aux.c \
@@ -144,16 +144,57 @@ libtiff.a: ${OBJS}
 	${AR} ${AROPTS} libtiff.a $?
 	${RANLIB} libtiff.a
 
+#
+# NB: The configure script verifies that the configured
+# tools are capable of producing a DSO before enabling
+# their creation/use.  The following rules are effectively
+# duplicated in the configure script to do this verification.
+# This means that if you want to add support for building a
+# DSO on another system you'll need to modify this file *and*
+# configure if you want the right thing to happen automatically
+# (should probably be fixed up).
+#
+
 # default IRIX DSO building rule
 IRIXdso: ${OBJS}
-	${CC} -o libtiff.@DSOSUF@ -shared -rdata_shared ${OBJS} \
-	    @LIBJPEG@ @LIBGZ@
-	touch IRIXdso
+	${CC} -o libtiff.@DSOSUF@ -shared -rdata_shared \
+	    -check_registry ${SRCDIR}/../port/irix/so_locations \
+	    -quickstart_info \
+	    ${OBJS} @LIBJPEG@ @LIBGZ@
+	touch $@
 # special rule for IRIX 5.2
 IRIX52dso: ${OBJS}
-	${LD} -elf -o libtiff.@DSOSUF@ -shared -no_unresolved -all libtiff.a \
+	${LD} -elf -o libtiff.@DSOSUF@ -shared -no_unresolved -all ${OBJS} \
 	    @LIBJPEG@ @LIBGZ@ -lc -lm
-	touch IRIX52dso
+	touch $@
+# Solaris 2.4
+SOLARISdso: ${OBJS}
+	${LD} -L@DIR_LIB@ -G -o libtiff.@DSOSUF@ ${OBJS}
+	touch $@
+# HP-UX A.09.03
+HPUXdso: ${OBJS}
+	${LD} +b@DIR_LIB@ -b -o libtiff.@DSOSUF@ ${OBJS}
+	touch $@
+# AIX 2.3.5 and 4.1.1
+AIXdso: ${OBJS}
+	rm -f libtiff.syms shr.o
+	echo "#!" > libtiff.syms
+	/bin/dump -g libtiff.a | sed -n -e \
+	      's/^[ 	]*[0-9][0-9]*[	 ]*\([^	 .][^ 	]*\)$$/\1/p' \
+	      >> libtiff.syms
+	${LD} -o shr.o libtiff.a -H512 -T512 -bM\:SRE \
+	    -bE\:libtiff.syms @LIBJPEG@ @LIBGZ@ -lc -lm -L@DIR_LIB@
+	rm -f libtiff.syms libtiff.@DSOSUF@
+	${AR} ${AROPTS} libtiff.@DSOSUF@ shr.o
+	rm -f shr.o
+	touch $@
+# linux ELF shared lib rule
+LINUXdso:  ${OBJS}
+	${CC} -shared -Wl,-soname,libtiff.@DSOSUF@ \
+	    -o libtiff.@DSOSUF_VERSION@  ${OBJS} @LIBJPEG@ @LIBGZ@ 
+	@LN@ @LN_S@ libtiff.@DSOSUF_VERSION@ libtiff.@DSOSUF@
+	touch $@
+
 
 ${OBJS}: ${SRCDIR}/tiffio.h ${SRCDIR}/tiff.h ${SRCDIR}/tif_dir.h
 ${OBJS}: ${SRCDIR}/tiffcomp.h ${SRCDIR}/tiffiop.h ${SRCDIR}/tiffconf.h
@@ -251,22 +292,32 @@ INCS	= ${SRCDIR}/tiff.h ${SRCDIR}/tiffio.h
 
 installHdrs: ${INCS}
 	${INSTALL} -idb tiff.sw.dev -m 755 -dir @DIR_INC@
-	for i in ${INCS}; do \
-	    f=`basename $$i`; \
-	    ${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_INC@ \
-		-src $$i -O $$f; \
+	for i in ${INCS}; do						\
+	    f=`basename $$i`;						\
+	    ${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_INC@		\
+		-src $$i -O $$f;					\
 	done
 installDSO: @DSO@dso
-	${INSTALL} -idb tiff.sw.tools -m 444 -F @DIR_LIB@ -O libtiff.@DSOSUF@
+	if [ @DSOSUF_VERSION@ != @DSOSUF@ ]; then			\
+	    ${INSTALL} -idb tiff.sw.tools -m 555 -F @DIR_LIB@		\
+		-O libtiff.@DSOSUF_VERSION@;				\
+	    ${INSTALL} -idb tiff.sw.tools -F @DIR_LIB@			\
+		-ln libtiff.@DSOSUF_VERSION@ -O libtiff.@DSOSUF@;	\
+	else								\
+	    ${INSTALL} -idb tiff.sw.tools -m 444 -F @DIR_LIB@		\
+		-O libtiff.@DSOSUF@;					\
+	fi
 install: all installHdrs
 	${INSTALL} -idb tiff.sw.dev -m 755 -dir @DIR_LIB@
 	${INSTALL} -idb tiff.sw.dev -m 444 -F @DIR_LIB@ -O libtiff.a
-	if [ @DSO@dso != nodso ]; then \
-	    ${MAKE} installDSO; \
-	else \
-	    true; \
+	if [ @DSO@dso != nodso ]; then					\
+	    ${MAKE} installDSO;						\
+	else								\
+	    true;							\
 	fi
 
 clean:
-	rm -f ${TARGETS} ${OBJS} core a.out mkg3states tif_fax3sm.c version.h \
-	    libtiff.@DSOSUF@ *dso mkversion
+	rm -f ${TARGETS} ${OBJS} core a.out \
+	    mkg3states tif_fax3sm.c \
+	    mkversion version.h \
+	    libtiff.a libtiff.@DSOSUF@ libtiff.@DSOSUF_VERSION@ *dso
diff --git a/libtiff/tif_codec.c b/libtiff/tif_codec.c
index ec62814b..c5432638 100644
--- a/libtiff/tif_codec.c
+++ b/libtiff/tif_codec.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_codec.c,v 1.7 1996/01/10 19:32:56 sam Exp $ */
+/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_codec.c,v 1.8 1996/02/16 05:54:21 sam Exp $ */
 
 /*
  * Copyright (c) 1988-1996 Sam Leffler
@@ -72,7 +72,7 @@ const TIFFCodec _TIFFBuiltinCO

(Patch may be truncated, please check the link at the top of this post.)