Subject: Re: 'mailsync' program experiences & loss of mail problem?

From: Tim Culver <[email-masked]>
Date: Mon, 18 Jun 2001 15:17:39 -0700 (PDT)

You're right, Tomas, this is a good question for the list.  We want to
ship an operating system with a shared-object version of the c-client
library.  Is the c-client API stable enough to do that?  Of course I'm
interested in Mark's answer.  But I am also interested in hearing the
opinions of developers of widely-used mail clients.

-Tim

Tim Culver wrote:
> > I am starting to think it would be wise to incorporate c-client into
> > mailsync---that is, distribute a known-working version of the c-client
> > source with mailsync, and start keeping mailsync up-to-date with c-client
> > bugfixes.
> >
> > I understand that this is diametrically opposed to the idea of making
> > c-client a shared library.  But I am pretty sure Mark Crispin expects
> > developers to incorporate c-client.  For instance, the API is documented
> > in a file called "internal.txt".  Also, version numbers correspond to
> > dates, not API revisions.

Tomas Pospisek responded:
> IMHO it would be *much* better just to keep in sync with the library by
> using it then by incorporating it. FYI, as of Debian, there are allready 3
> versions of c-client in. I don't think it's very smart to add yet another
> one...please don't do it. Please remeber the nice UNIX idea: for each task
> one tool.

---

From: Mark Crispin <[email-masked]>
Date: Mon, 18 Jun 2001 16:40:43 -0700 (PDT)

On Mon, 18 Jun 2001 15:17:39 -0700 (PDT), Tim Culver wrote:
> We want to
> interested in Mark's answer.

It's a question of what you mean by "stable".

For the definition of "stable" as "nothing changes in it any more, it'll be
the same next year as it is now", then c-client most assuredly is not stable.
I work on c-client and related software (including imapd) on a daily basis.
The only time c-client is "stable" in that sense is when I go on vacation.

For the definition of "stable" as in "can you build reliable applications from
it" then c-client has been stable for many years.

The problem is, for the purposes of shared libraries, I fear that the former
definition of "stable" is the one that most people care about.

I don't see much benefit to having 3+ versions of c-client shared library
lying around, and it's unfortunate if, as is reported, that is the status quo
on Debian.

Last but not least, you need to consider the purpose in making c-client be a
shared library.  It only makes sense if you have several simultaneously
running applications that use c-client.  If you just run imapd, it doesn't
make any difference whether c-client is shared or in the imapd binary.
Similarly if you just run Pine.  If you run both imapd and Pine on a
continuous basis, then you get a single instance benefit to having c-client be
shared.  If ipop3d is also run continuously, then you get a second instance,
which *might* be worth it.  But if imapd, ipop3d, and Pine all have their own
c-client shared library, you've lost the benefit but gained the complexity.

---

From: "Andrej Borsenkow" <[email-masked]>
Date: Tue, 19 Jun 2001 09:41:53 +0400

> definition of "stable" is the one that most people care about.

FWIW I have been using shared version of c-client for years. I usually
rebuild clients only when new version comes out, but rebuild c-client
library casually when new imap distro appears (when I notice it to be sure
:-)

It means, that currently I have imap-utils dated 19 Dec 2000 (and built
somewhen in this time) and I have built four or five versions of c-client
shared library since then without updating imap-utils.

-andrej

---

From: "Jaldhar H. Vyas" <[email-masked]>
Date: Tue, 19 Jun 2001 10:29:32 -0400 (EDT)

> definition of "stable" is the one that most people care about.

FWIW, I've been building a shared library of c-client since 4.5 or so and
I've never had a problem due to changing APIs etc.

> lying around, and it's unfortunate if, as is reported, that is the status quo

There are actually 4.  Due to stupid US crypto policy we have to have a
seperate SSLized version (kept offshore) and a version without SSL.  And
for each of those variants there is a static library for the purists and a
shared library for us wild and crazy guys on the edge. :-)

If I had my druthers, everyone would switch to the shared lib with SSL
support but I try to give people a choice.  It would be nice if the
c-client distribution gave people the extra choice of building as a shared
library.

I'm attaching Debians' shared library patch to this message for anyone who
might be interested.

-- 
Jaldhar H. Vyas <[email-masked]>
--- uw-imap-2000.orig/src/imapd/Makefile
+++ uw-imap-2000/src/imapd/Makefile
@@ -34,17 +34,19 @@
 ALERT=/etc/imapd.alert
 USERALERT=.imapalert
 ANO=/etc/anonymous.newsgroups
+CCLIENTLIB = $C/`cat $C/$ARCHIVENAME`
 SHELL= /bin/sh

 # Get local definitions from c-client directory
 
 C = ../c-client
-CCLIENTLIB = $C/c-client.a
+CCLIENTLIB = $C/`cat $C/$ARCHIVENAME`
+
 CC = `cat $C/CCTYPE`
 CFLAGS = -I$C `cat $C/CFLAGS` -DANOFILE=\"$(ANO)\" \
 	-DALERTFILE=\"$(ALERT)\" -DUSERALERTFILE=\"$(USERALERT)\"
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+LDFLAGS = `cat $C/LDFLAGS`
 
 all:	imapd
 
--- uw-imap-2000.orig/src/ipopd/Makefile
+++ uw-imap-2000/src/ipopd/Makefile
@@ -32,14 +32,14 @@

 C = ../c-client
-CCLIENTLIB = $C/c-client.a
+CCLIENTLIB = $C/`cat $C/$ARCHIVENAME`
 SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
 CC = `cat $C/CCTYPE`
 CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+LDFLAGS = `cat $C/LDFLAGS`
 
 ipopd: ipop2d ipop3d
 
--- uw-imap-2000.orig/src/osdep/unix/Makefile
+++ uw-imap-2000/src/osdep/unix/Makefile
@@ -138,7 +138,7 @@
 	 SPOOLDIR=/var/spool \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -Dunix=1 -D_BSD" \
-	 BASELDFLAGS="-lbsd"
+	 BASELDFLAGS="../c-client/c-client.a -lbsd"
 
 a41:	# AIX 4.1 for RS/6000
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
@@ -146,7 +146,7 @@
 	 SPOOLDIR=/var/spool \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -Dunix=1 -D_BSD" \
-	 BASELDFLAGS="-lbsd -ls"
+	 BASELDFLAGS="../c-client/c-client.a -lbsd -ls"
 
 aix:	# AIX/370
 	@echo You are building for AIX on an S/370 class machine
@@ -154,12 +154,13 @@
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
 	 BASECFLAGS="-g" \
-	 BASELDFLAGS="-lbsd"
+	 BASELDFLAGS="../c-client/c-client.a -lbsd"
 
 aos:	# AOS for RT
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
 	 BASECFLAGS="-g -Dconst="
+	 BASELDFLAGS="../c-client/c-client.a"
 
 art:	# AIX 2.2.1 for RT
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
@@ -168,6 +169,7 @@
 	 ACTIVEFILE=/usr/local/news/control/active \
 	 RSHPATH=/bin/rsh \
 	 BASECFLAGS="-g -Dconst= -Dvoid=char" \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 RANLIB=true 
 
 asv:	# Altos SVR4
@@ -176,7 +178,7 @@
 	 ACTIVEFILE=/usr/spool/news/active \
 	 RSHPATH=/usr/bin/rcmd \
 	 BASECFLAGS="-Dconst= -DSIGSTOP=SIGKILL" \
-	 BASELDFLAGS="-lsocket -lrpc -lgen -lcrypt -lxenix" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lrpc -lgen -lcrypt -lxenix" \
 	 RANLIB=true
 
 aux:	# A/UX
@@ -192,6 +194,7 @@
 	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
 	 ACTIVEFILE=/var/news/etc/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O2 -pipe" CC=shlicc
 
 bsd:	# BSD UNIX
@@ -206,7 +209,7 @@
 	 ACTIVEFILE=/usr/local/news/lib/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -O -pipe" \
-	 BASELDFLAGS="-lcrypt"
+	 BASELDFLAGS="../c-client/c-client.a -lcrypt"
 
 bsi:	# BSD/i386
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
@@ -214,6 +217,7 @@
 	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
 	 ACTIVEFILE=/var/news/etc/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O2 -pipe"
 
 bso:	# OpenBSD
@@ -222,11 +226,13 @@
 	 SPOOLDIR=/var \
 	 ACTIVEFILE=/usr/local/news/lib/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-O2 -pipe"
 
 cvx:	# Convex
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-O -ext -Dconst="
 
 d-g:	# Data General DG/UX
@@ -236,7 +242,7 @@
 	 ACTIVEFILE=/local/news/active \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -Dconst=" \
-	 BASELDFLAGS="-lnsl -lsocket" \
+	 BASELDFLAGS="../c-client/c-client.a -lnsl -lsocket" \
 	 RANLIB=true
 
 d54:	# Data General DG/UX 5.4
@@ -246,7 +252,7 @@
 	 ACTIVEFILE=/local/news/active \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -Dconst=" \
-	 BASELDFLAGS="-lnsl -lsocket" \
+	 BASELDFLAGS="../c-client/c-client.a -lnsl -lsocket" \
 	 RANLIB=true
 
 dpx:	# Bull DPX/2
@@ -254,7 +260,7 @@
 	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT" \
-	 BASELDFLAGS="-linet" \
+	 BASELDFLAGS="../c-client/c-client.a -linet" \
 	 RANLIB=true LN=ln
 
 drs:	# ICL DRS/NX
@@ -264,18 +270,20 @@
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-O" \
-	 BASELDFLAGS="-lsocket -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lgen" \
 	 RANLIB=true
 
 do4:	# Apollo Domain/OS sr10.4
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
 	 BASECFLAGS="-A systype,bsd4.3 -D_APOLLO_SOURCE" \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 RANLIB=true
 
 dyn:	# Dynix
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -Dconst="
 
 epx:	# EP/IX
@@ -285,7 +293,7 @@
 	 ACTIVEFILE=/usr/share/news/active \
 	 RSHPATH=/usr/net/rsh \
 	 BASECFLAGS="-g -systype svr4" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true
 
 gas:	# GCC Altos SVR4
@@ -294,7 +302,7 @@
 	 ACTIVEFILE=/usr/spool/news/active \
 	 RSHPATH=/usr/bin/rcmd \
 	 BASECFLAGS="-g -O -DALTOS_SYSTEM_V -DSIGSTOP=SIGKILL" \
-	 BASELDFLAGS="-lsocket -lrpc -lgen -lcrypt -lxenix" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lrpc -lgen -lcrypt -lxenix" \
 	 RANLIB=true CC=gcc
 
 gh9:	# GCC HP-UX9.x
@@ -303,6 +311,7 @@
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -O2" \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 RANLIB=true CC=gcc
 
 ghp:	# GCC HP-UX
@@ -312,6 +321,7 @@
 	 ACTIVEFILE=/var/news/active \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -O2" \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 RANLIB=true CC=gcc
 
 gs5:	# GCC 2.7.1 (95q4) SCO Open Server 5.0.x
@@ -322,7 +332,7 @@
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rcmd \
 	 BASECFLAGS="-O3 -belf -I/usr/include -L/lib" \
-	 BASELDFLAGS="-lsocket -lcrypt -lprot -lx -ltinfo -lm" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lcrypt -lprot -lx -ltinfo -lm" \
 	 RANLIB=true CC=gcc
 
 # Is the bizarre MAKEFLAGS= needed here?
@@ -333,6 +343,7 @@
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bsd/rsh \
 	 BASECFLAGS="-g -O2" \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 RANLIB=true CC=gcc
 
 gso:	# GCC Solaris
@@ -342,21 +353,21 @@
 	 ACTIVEFILE=/usr/share/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -O2" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true CC=gcc
 
 gsu:	# GCC SUN-OS
 	$(BUILD) `cat EXTRASPECIALS` OS=sun \
 	 CRXTYPE=nfs \
 	 BASECFLAGS="-g -O2" \
-	 BASELDFLAGS="-ldl" \
+	 BASELDFLAGS="../c-client/c-client.a -ldl" \
 	 CC=gcc
 
 gul:	# GCC Ultrix
 	$(BUILD) `cat EXTRASPECIALS` OS=ult \
 	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
 	 BASECFLAGS="-g -O" \
-	 BASELDFLAGS="-lauth -lc" \
+	 BASELDFLAGS="../c-client/c-client.a -lauth -lc" \
 	 CC=gcc
 
 hpp:	# HP-UX 9.x
@@ -365,7 +376,7 @@
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -Aa -D_HPUX_SOURCE" \
-	 BASELDFLAGS="-lnet -lV3" \
+	 BASELDFLAGS="../c-client/c-client.a -lnet -lV3" \
 	 RANLIB=true
 
 hpx:	# HP-UX 10.x
@@ -375,7 +386,7 @@
 	 ACTIVEFILE=/var/news/active \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -Ae" \
-	 BASELDFLAGS="-lnet -lV3" \
+	 BASELDFLAGS="../c-client/c-client.a -lnet -lV3" \
 	 RANLIB=true
 
 isc:	# Interactive
@@ -384,7 +395,7 @@
 	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
 	 ACTIVEFILE=/var/spool/news/active \
 	 BASECFLAGS="-Xp -D_SYSV3" \
-	 BASELDFLAGS="-linet -lnsl_s -lgen -lx -lsec -liberty" \
+	 BASELDFLAGS="../c-client/c-client.a -linet -lnsl_s -lgen -lx -lsec -liberty" \
 	 RANLIB=true
 
 lnp:	# Linux Pluggable Authentication modules
@@ -393,8 +404,20 @@
 	 SPOOLDIR=/var/spool \
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
-	 BASECFLAGS="-g -fno-omit-frame-pointer -O6" \
-	 BASELDFLAGS="-lpam -ldl"
+	 BASECFLAGS="-g -fno-omit-frame-pointer -O2" \
+	 BASELDFLAGS="../c-client/c-client.a -lpam -ldl"
+
+lnps:	# Linux Pluggable Authentication modules (c-client as shared lib)
+	$(BUILD) `cat EXTRASPECIALS` OS=lnx \
+	 SIGTYPE=psx CHECKPW=pam CRXTYPE=nfs \
+	 SPOOLDIR=/var/spool \
+	 ACTIVEFILE=/var/lib/news/active \
+	 RSHPATH=/usr/bin/rsh \
+	 BASECFLAGS="-fPIC -g -fno-omit-frame-pointer -O2 -DNFSKLUDGE" \
+	 ARCHIVE="libc-client.so" \
+	 BASELDFLAGS="-L../c-client -lc-client -lpam -ldl -lc" \
+	 ARRC="ld -shared -soname libc-client.so.$(VERSION) -lpam -ldl -lc -o" \
+	 RANLIB=true
 
 lnx:	# Linux non-shadow passwords
 	@echo You are building for traditional Linux *without* shadow
@@ -406,6 +429,7 @@
 	 SPOOLDIR=/var/spool \
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O"
 
 lyn:	# LynxOS
@@ -419,6 +443,7 @@
 mct:	# MachTen - CRXTYPE=nfs doesn't work (at least not on 2.2)
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 SPOOLDIR=/var/spool \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O -pipe"
 
 mnt:	# Mint
@@ -427,6 +452,7 @@
 	 SPOOLDIR=/var/spool \
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O"
 
 neb:	# NetBSD
@@ -436,7 +462,7 @@
 	 ACTIVEFILE=/var/db/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -O -pipe" \
-	 BASELDFLAGS="-lcrypt"
+	 BASELDFLAGS="../c-client/c-client.a -lcrypt"
 
 nec:	# NEC UX
 	$(BUILD) `cat EXTRASPECIALS` OS=sv4 \
@@ -445,17 +471,19 @@
 	 ACTIVEFILE=/var/news/lib/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -Kopt=2 -KOlimit=2000" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true CC=/usr/abiccs/bin/cc
 
 nxt:	# NEXTSTEP
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O -pipe"
 
 nx3:	# NEXTSTEP 3.0 single threaded
 	$(BUILD) `cat EXTRASPECIALS` OS=nxt \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -O -pipe -Wall"
 	echo "void malloc_singlethreaded (void);" >> linkage.h
 	echo "  malloc_singlethreaded ();" >> linkage.c
@@ -464,6 +492,7 @@
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 SIGTYPE=psx CRXTYPE=nfs \
 	 SPOOLDIR=/var/spool \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g3 -O2 -Olimit 1500"
 
 # Note: sia_become_user() used by LOGINPW=os4 doesn't seem to work right.  The
@@ -473,6 +502,7 @@
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 SIGTYPE=psx CHECKPW=os4 LOGINPW=os4 CRXTYPE=nfs \
 	 SPOOLDIR=/var/spool \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g3 -std0 -O2"
 
 ptx:	# PTX
@@ -481,12 +511,13 @@
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bin/resh \
 	 BASECFLAGS="-Wc,-O3 -Wc,-seq -Dprivate=PRIVATE" \
-	 BASELDFLAGS="-lseq -lsec -lsocket -linet -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lseq -lsec -lsocket -linet -lnsl -lgen" \
 	 RANLIB=true
 
 pyr:	# Pyramid
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -Dconst="
 
 qnx:	# QNX
@@ -494,11 +525,12 @@
 	 CHECKPW=psx LOGINPW=old \
 	 RSHPATH=/usr/ucb/rsh \
 	 BASECFLAGS="-Otax -g -Dunix=1 -D_POSIX_SOURCE" \
-	 BASELDFLAGS="-g -N128k -llogin -lsocket -lunix"
+	 BASELDFLAGS="../c-client/c-client.a -g -N128k -llogin -lsocket -lunix"
 
 s40:	# SUN-OS 4.0
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -Dconst="
 
 sc5:	# SCO Open Server 5.0
@@ -509,7 +541,7 @@
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rcmd \
 	 BASECFLAGS="-O3 -s" \
-	 BASELDFLAGS="-lsocket -lcrypt -lprot -lx -ltinfo -lm" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lcrypt -lprot -lx -ltinfo -lm" \
 	 RANLIB=true
 
 sco:	# Santa Cruz Operation
@@ -518,7 +550,7 @@
 	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
 	 RSHPATH=/usr/bin/rcmd \
 	 BASECFLAGS="-O3" \
-	 BASELDFLAGS="-lsocket -lprot -lcrypt_i -lx -los" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lprot -lcrypt_i -lx -los" \
 	 RANLIB=true LN=ln
 
 # Notes:
@@ -531,6 +563,7 @@
 	 SIGTYPE=sv4 CRXTYPE=nfs \
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bsd/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g3 -O2 -Olimit 8192" \
 	 RANLIB=true
 
@@ -539,6 +572,7 @@
 	 SIGTYPE=sv4 CRXTYPE=nfs \
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bsd/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g3 -O2 -woff 1048,1110,1116" \
 	 RANLIB=true
 
@@ -551,7 +585,7 @@
 	 ACTIVEFILE=/var/news/active \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-g -Ae" \
-	 BASELDFLAGS="-lnet -lV3 -lsec" \
+	 BASELDFLAGS="../c-client/c-client.a -lnet -lV3 -lsec" \
 	 RANLIB=true
 
 slx:	# Secure Linux
@@ -564,7 +598,7 @@
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -fno-omit-frame-pointer -O6" \
-	 BASELDFLAGS="-lcrypt"
+	 BASELDFLAGS="../c-client/c-client.a -lcrypt"
 
 sl4:	# Secure Linux using libc4
 	@echo You are building for libc4 versions of Secure Linux
@@ -576,7 +610,7 @@
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -fno-omit-frame-pointer -O6" \
-	 BASELDFLAGS="-lshadow"
+	 BASELDFLAGS="../c-client/c-client.a -lshadow"
 
 sl5:	# Secure Linux using libc5
 	@echo You are building for libc5 versions of Secure Linux
@@ -587,6 +621,7 @@
 	 SPOOLDIR=/var/spool \
 	 ACTIVEFILE=/var/lib/news/active \
 	 RSHPATH=/usr/bin/rsh \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-g -fno-omit-frame-pointer -O6"
 
 snx:	# Siemens Nixdorf SINIX and Reliant UNIX
@@ -596,7 +631,7 @@
 	 ACTIVEFILE=/usr/share/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -D_SYS_CLOCK_H -Dconst=" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true
 
 # Note: It is a long and disgusting story about why cc is set to ucbcc.  You
@@ -641,26 +676,26 @@
 	 ACTIVEFILE=/usr/share/news/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g -O2" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true CC=ucbcc
 
 sos:	# Secure OSF/1
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 SIGTYPE=psx CHECKPW=sec LOGINPW=sec CRXTYPE=nfs \
 	 BASECFLAGS="-g3 -O2 -Olimit 1500" \
-	 BASELDFLAGS="-lsecurity -laud"
+	 BASELDFLAGS="../c-client/c-client.a -lsecurity -laud"
 
 ssn:	# Secure SUN-OS
 	$(BUILD) `cat EXTRASPECIALS` OS=sun \
 	 CHECKPW=ssn CRXTYPE=nfs \
 	 BASECFLAGS="-g -Dconst=" \
-	 BASELDFLAGS="-ldl"
+	 BASELDFLAGS="../c-client/c-client.a -ldl"
 
 sun:	# SUN-OS
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
 	 BASECFLAGS="-g -Dconst=" \
-	 BASELDFLAGS="-ldl"
+	 BASELDFLAGS="../c-client/c-client.a -ldl"
 
 sv2:	# SVR2
 	@echo You are being *very* optimistic!
@@ -669,7 +704,7 @@
 	 MAILSPOOL=/usr/mail \
 	 RSHPATH=/usr/bin/remsh \
 	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT -I/usr/ethernet/include" \
-	 BASELDFLAGS="-lnet" \
+	 BASELDFLAGS="../c-client/c-client.a -lnet" \
 	 RANLIB=true LN=ln
 
 sv4:	# SVR4
@@ -679,14 +714,14 @@
 	 ACTIVEFILE=/usr/share/news/active \
 	 RSHPATH=/usr/bin/resh \
 	 BASECFLAGS="-g -Dconst=" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true
 
 ult:	# Ultrix
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
 	 BASECFLAGS="-g3 -O2 -Olimit 1500 -Dconst=" \
-	 BASELDFLAGS="-lauth -lc"
+	 BASELDFLAGS="../c-client/c-client.a -lauth -lc"
 
 uw2:	# UnixWare SVR4.2
 	$(BUILD) `cat EXTRASPECIALS` OS=sv4 \
@@ -695,18 +730,19 @@
 	 ACTIVEFILE=/var/news/lib/active \
 	 RSHPATH=/usr/bin/rsh \
 	 BASECFLAGS="-g" \
-	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 BASELDFLAGS="../c-client/c-client.a -lsocket -lnsl -lgen" \
 	 RANLIB=true
 
 vul:	# VAX Ultrix
 	$(BUILD) `cat EXTRASPECIALS` OS=ult \
 	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
 	 BASECFLAGS="-O2 -Dconst=" \
-	 BASELDFLAGS="-lauth -lc"
+	 BASELDFLAGS="../c-client/c-client.a -lauth -lc"
 
 vu2:	# VAX Ultrix 2.3, etc.
 	$(BUILD) `cat EXTRASPECIALS` OS=$@ \
 	 CRXTYPE=nfs \
+	 BASELDFLAGS="../c-client/c-client.a" \
 	 BASECFLAGS="-O2 -Dconst= -Dvoid=char"

@@ -724,7 +760,7 @@
 # Cleanup
 
 clean:
-	sh -c '$(RM) auths.c crexcl.c flockbsd.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
+	sh -c '$(RM) auths.c crexcl.c flockbsd.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE ARCHIVENAME *FLAGS *TYPE $(ARCHIVE) || true'

 # Dependencies
@@ -814,6 +851,7 @@
 	 -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" > OSCFLAGS
 	echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
 	echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
+	echo $(ARCHIVE) > ARCHIVENAME
 	./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
 	./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
 	$(LN) os_$(OS).h osdep.h
--- uw-imap-2000.orig/src/mtest/Makefile
+++ uw-imap-2000/src/mtest/Makefile
@@ -32,20 +32,20 @@

 C = ../c-client
-CCLIENTLIB = $C/c-client.a
+CCLIENTLIB = $C/`cat $C/$ARCHIVENAME`
 SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
 CC = `cat $C/CCTYPE`
 CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+LDFLAGS = `cat $C/LDFLAGS`
 
 all:	mtest
 
 mtest: $(CCLIENTLIB) mtest.o
 	$(CC) $(CFLAGS) -o mtest mtest.o $(LDFLAGS)
-
+	
 mtest.o: $C/mail.h $C/misc.h $C/osdep.h $C/rfc822.h $C/smtp.h $C/nntp.h
 
 $(CCLIENTLIB):