1# ========================================================================
2# Copyright 1988-2007 University of Washington
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10#
11# ========================================================================
12
13# Program:	C client makefile
14#
15# Author:	Mark Crispin
16#		Networks and Distributed Computing
17#		Computing & Communications
18#		University of Washington
19#		Administration Building, AG-44
20#		Seattle, WA  98195
21#		Internet: MRC@CAC.Washington.EDU
22#
23# Date:		11 May 1989
24# Last Edited:	17 December 2007
25
26
27# Command line build parameters
28
29EXTRAAUTHENTICATORS=
30EXTRADRIVERS=mbox
31PASSWDTYPE=std
32SSLTYPE=nopwd
33IP=4
34
35
36# The optimization level here for GCC ports is set here for a reason.  It's
37# to get you to read this text.
38# The general concensus seems to be that -O2 is the one to use.
39# Over the years, I've been told to use many different settings, including -O6.
40# In recent versions of GCC [as of 2/2005], -O6 generates bad code that, among
41# other ill effects, causes infinite loops.
42# -O3 seems to be safe, but empirical observation from our local expert
43# indicates that in some (many?) cases -O3 code runs slower than -O2.
44
45GCCOPTLEVEL= -O2
46
47
48# Try to have some consistency in GCC builds.  We want optimization, but we
49# also want to be able to debug.
50
51GCCCFLAGS= -g $(GCCOPTLEVEL) -pipe -fno-omit-frame-pointer
52GCC4CFLAGS= $(GCCCFLAGS) -Wno-pointer-sign
53
54
55# Extended flags needed for SSL.  You may need to modify.
56
57#SSLDIR=/usr/local/ssl
58SSLCERTS=$(PREFIX)/certs
59SSLKEYS=$(SSLCERTS)
60SSLINCLUDE=$(SSLDIR)/include
61SSLLIB=$(SSLDIR)/lib
62
63SSLCRYPTO=-lcrypto -lcrypt
64
65# Older versions of MIT Kerberos also have a libcrypto.  If so, you may need
66# to use this instead
67#SSLCRYPTO=$(SSLLIB)/libcrypto.a
68
69# RSA Security Inc. released the RSA public key encryption algorithm into
70# the public domain on September 6, 2000.  There is no longer any need to
71# use RSAREF.
72SSLRSA= # -lRSAglue -lrsaref
73
74SSLCFLAGS= -I$(SSLINCLUDE) -I$(SSLINCLUDE)/openssl\
75 -DSSL_CERT_DIRECTORY=\"$(SSLCERTS)\" -DSSL_KEY_DIRECTORY=\"$(SSLKEYS)\"
76SSLLDFLAGS= # -L$(SSLLIB) -lssl $(SSLCRYPTO) $(SSLRSA)
77
78
79# Extended flags needed for non-standard passwd types.  You may need to modify.
80
81AFSDIR=/usr/afsws
82AFSCFLAGS=-I$(AFSDIR)/include
83AFSLIB=$(AFSDIR)/lib
84AFSLDFLAGS=-L$(AFSLIB)/afs -L$(AFSLIB) -L$(AFSDIR)/domestic/lib\
85 -lkauth -lprot -lubik -lauth -lrxkad -lrx -llwp -ldes -lcom_err\
86 $(AFSLIB)/afs/util.a -laudit -lsys
87# AFSLDFLAGS may also need -L/usr/ucblib -lucb
88DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\"
89DCELDFLAGS= -ldce
90PAMLDFLAGS= # -lpam -lcrypt
91
92
93# Build parameters normally set by the individual port
94
95CHECKPW=std
96LOGINPW=std
97SIGTYPE=bsd
98CRXTYPE=std
99ACTIVEFILE=/usr/lib/news/active
100SPOOLDIR=/usr/spool
101MAILSPOOL=$(SPOOLDIR)/mail
102NEWSSPOOL=$(SPOOLDIR)/news
103RSHPATH=/usr/ucb/rsh
104MD5PWD=/etc/cram-md5.pwd
105# Tries one of the test alternatives below if not specified.
106LOCKPGM=
107# Test alternatives if LOCKPGM not specified
108LOCKPGM1=/usr/libexec/mlock
109LOCKPGM2=/usr/sbin/mlock
110LOCKPGM3=/etc/mlock
111
112
113# Default formats for creating new mailboxes and for empty mailboxes in the
114# default namespace; must be set to the associated driver's prototype.
115#
116# The CREATEPROTO is the default format for new mailbox creation.
117# The EMPTYPROTO is the default format for handling zero-byte files.
118#
119# Normally, this is set by the individual port.
120#
121# NOTE: namespace formats (e.g. mh and news) can not be set as a default format
122# since they do not exist in the default namespace.  Also, it is meaningless to
123# set certain other formats (e.g. mbx, mx, and mix) as the EMPTYPROTO since
124# these formats can never be empty files.
125
126CREATEPROTO=unixproto
127EMPTYPROTO=unixproto
128
129
130# Commands possibly overriden by the individual port
131
132ARRC=ar rc
133CC?=cc
134LN=ln -s
135RANLIB=ranlib
136
137
138# Standard distribution build parameters
139
140DEFAULTAUTHENTICATORS=ext md5 pla log
141#
142# mh needs to be after any other directory format drivers (such as mx or mix)
143# since otherwise mh will seize any directory that is under the mh path.
144# However, mh needs to be before any sysinbox formats (such as mmdf or unix)
145# since otherwise INBOX won't work correctly when mh_allow_inbox is set.
146#
147DEFAULTDRIVERS=imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
148CHUNKSIZE=65536
149
150# Normally no need to change any of these
151
152ARCHIVE=c-client.a
153BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \
154 dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
155 rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
156 unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
157CFLAGS+=$(BASECFLAGS) $(EXTRACFLAGS)
158
159CAT=cat
160MAKE=make
161MV=mv
162RM=rm -rf
163SH=sh
164
165
166# Primary build command
167
168BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRACFLAGS)'\
169 EXTRALDFLAGS='$(EXTRALDFLAGS)'\
170 EXTRADRIVERS='$(EXTRADRIVERS)' EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\
171 PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP)
172
173
174# Here if no make argument established
175
176missing: osdep.h
177	$(MAKE) all `$(CAT) SPECIALS`
178
179osdep.h:
180	@echo You must specify what type of system
181	@false
182
183
184# Current ports
185
186a32:	# AIX 3.2 for RS/6000
187	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
188	 SIGTYPE=psx CRXTYPE=nfs \
189	 SPOOLDIR=/var/spool \
190	 RSHPATH=/usr/bin/rsh \
191	 BASECFLAGS="-g -Dunix=1 -D_BSD" \
192	 BASELDFLAGS="-lbsd"
193
194a41:	# AIX 4.1 for RS/6000
195	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
196	 SIGTYPE=psx CHECKPW=a41 CRXTYPE=nfs \
197	 SPOOLDIR=/var/spool \
198	 RSHPATH=/usr/bin/rsh \
199	 BASECFLAGS="-g -Dunix=1 -D_BSD -qro -qroconst" \
200	 BASELDFLAGS="-ls"
201
202a52:	# Attempt at AIX 5.2
203	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
204	 SIGTYPE=psx CHECKPW=a41 CRXTYPE=nfs \
205	 SPOOLDIR=/var/spool \
206	 RSHPATH=/usr/bin/rsh \
207	 BASECFLAGS="-g -Dunix=1 -D_BSD -qro -qroconst" \
208	 BASELDFLAGS="-ls"
209
210aix:	# AIX/370
211	@echo You are building for AIX on an S/370 class machine
212	@echo If you want AIX on an RS/6000 you need to use a32 or a41 instead!
213	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
214	 CRXTYPE=nfs \
215	 BASECFLAGS="-g" \
216	 BASELDFLAGS="-lbsd"
217
218aos:	# AOS for RT
219	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
220	 CRXTYPE=nfs \
221	 BASECFLAGS="-g -Dconst="
222
223art:	# AIX 2.2.1 for RT
224	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
225	 SIGTYPE=sv4 \
226	 SPOOLDIR=/var \
227	 ACTIVEFILE=/usr/local/news/control/active \
228	 RSHPATH=/bin/rsh \
229	 BASECFLAGS="-g -Dconst= -Dvoid=char" \
230	 RANLIB=true
231
232asv:	# Altos SVR4
233	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
234	 SIGTYPE=sv4 LOGINPW=old \
235	 ACTIVEFILE=/usr/spool/news/active \
236	 RSHPATH=/usr/bin/rcmd \
237	 BASECFLAGS="-Dconst= -DSIGSTOP=SIGKILL" \
238	 BASELDFLAGS="-lsocket -lrpc -lgen -lcrypt -lxenix" \
239	 RANLIB=true
240
241aux:	# A/UX
242	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
243	 CRXTYPE=nfs \
244	 MAILSPOOL=/usr/mail \
245	 BASECFLAGS="-g -B/usr/lib/big/ -Dvoid=char -Dconst=" \
246	 RANLIB=true ARRC="ar -rc"
247
248bfp:	# FreeBSD Pluggable Authentication Modules
249	$(BUILD) `cat SPECIALS` OS=bsi SIGTYPE=psx CHECKPW=pam \
250	 SPOOLDIR=/var \
251	 ACTIVEFILE=/usr/local/news/lib/active \
252	 RSHPATH=/usr/bin/rsh \
253	 LOCKPGM=$(PREFIX)/libexec/mlock \
254	 BASECFLAGS="-DNFSKLUDGE" \
255	 BASELDFLAGS="-lpam -lcrypt"
256
257bs3:	# BSD/i386 3.0 or higher
258	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
259	 CHECKPW=bsi LOGINPW=bsi CRXTYPE=nfs \
260	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
261	 ACTIVEFILE=/var/news/etc/active \
262	 RSHPATH=/usr/bin/rsh \
263	 BASECFLAGS="$(GCCCFLAGS)" CC=shlicc
264
265bsd:	# BSD UNIX
266	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
267	 CRXTYPE=nfs \
268	 BASECFLAGS="-g -Dconst="
269
270bsf:	# FreeBSD
271	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
272	 SIGTYPE=psx CRXTYPE=nfs \
273	 SPOOLDIR=/var \
274	 ACTIVEFILE=/usr/local/news/lib/active \
275	 RSHPATH=/usr/bin/rsh \
276	 LOCKPGM=$(PREFIX)/libexec/mlock \
277	 BASECFLAGS="$(GCCCFLAGS)" \
278	 BASELDFLAGS=""
279
280bsi:	# BSD/i386
281	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
282	 CRXTYPE=nfs \
283	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
284	 ACTIVEFILE=/var/news/etc/active \
285	 RSHPATH=/usr/bin/rsh \
286	 BASECFLAGS="$(GCCCFLAGS)"
287
288bso:	# OpenBSD
289	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
290	 SIGTYPE=psx CRXTYPE=nfs \
291	 SPOOLDIR=/var \
292	 ACTIVEFILE=/usr/local/news/lib/active \
293	 RSHPATH=/usr/bin/rsh \
294	 BASECFLAGS="$(GCCCFLAGS)"
295
296cvx:	# Convex
297	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
298	 CRXTYPE=nfs \
299	 BASECFLAGS="-O -ext -Dconst="
300
301cyg:	# Cygwin - note that most local file drivers don't work!!
302	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
303	DEFAULTDRIVERS="imap nntp pop3 mbx unix phile" \
304	SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
305	SPOOLDIR=/var \
306	ACTIVEFILE=/usr/local/news/lib/active \
307	RSHPATH=/usr/bin/rsh \
308	BASECFLAGS="$(GCCCFLAGS)" \
309	BASELDFLAGS="-lcrypt" \
310	CC=gcc
311
312d-g:	# Data General DG/UX
313	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
314	 SIGTYPE=sv4 CRXTYPE=nfs \
315	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
316	 ACTIVEFILE=/local/news/active \
317	 RSHPATH=/usr/bin/remsh \
318	 BASECFLAGS="-g -Dconst=" \
319	 BASELDFLAGS="-lnsl -lsocket" \
320	 RANLIB=true
321
322d54:	# Data General DG/UX 5.4
323	$(BUILD) `$(CAT) SPECIALS` OS=d-g \
324	 SIGTYPE=sv4 CRXTYPE=nfs \
325	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
326	 ACTIVEFILE=/local/news/active \
327	 RSHPATH=/usr/bin/remsh \
328	 BASECFLAGS="-g -Dconst=" \
329	 BASELDFLAGS="-lnsl -lsocket" \
330	 RANLIB=true
331
332dpx:	# Bull DPX/2
333	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
334	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
335	 RSHPATH=/usr/bin/remsh \
336	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT" \
337	 BASELDFLAGS="-linet" \
338	 RANLIB=true LN=ln
339
340drs:	# ICL DRS/NX
341	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
342	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 CRXTYPE=nfs \
343	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
344	 ACTIVEFILE=/var/lib/news/active \
345	 RSHPATH=/usr/bin/rsh \
346	 BASECFLAGS="-O" \
347	 BASELDFLAGS="-lsocket -lgen" \
348	 RANLIB=true
349
350do4:	# Apollo Domain/OS sr10.4
351	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
352	 CRXTYPE=nfs \
353	 BASECFLAGS="-A systype,bsd4.3 -D_APOLLO_SOURCE" \
354	 RANLIB=true
355
356dyn:	# Dynix
357	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
358	 CRXTYPE=nfs \
359	 BASECFLAGS="-g -Dconst="
360
361epx:	# EP/IX
362	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
363	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
364	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
365	 ACTIVEFILE=/usr/share/news/active \
366	 RSHPATH=/usr/net/rsh \
367	 BASECFLAGS="-g -systype svr4" \
368	 BASELDFLAGS="-lsocket -lnsl -lgen" \
369	 RANLIB=true
370
371ga4:	# GCC AIX 4.1 for RS/6000
372	$(BUILD) `$(CAT) SPECIALS` OS=a41 \
373	 SIGTYPE=psx CHECKPW=a41 CRXTYPE=nfs \
374	 SPOOLDIR=/var/spool \
375	 RSHPATH=/usr/bin/rsh \
376	 BASECFLAGS="-g -Dunix=1 -D_BSD" \
377	 BASELDFLAGS="-ls"
378
379gas:	# GCC Altos SVR4
380	$(BUILD) `$(CAT) SPECIALS` OS=asv \
381	 SIGTYPE=sv4 LOGINPW=old \
382	 ACTIVEFILE=/usr/spool/news/active \
383	 RSHPATH=/usr/bin/rcmd \
384	 BASECFLAGS="-g -O -DALTOS_SYSTEM_V -DSIGSTOP=SIGKILL" \
385	 BASELDFLAGS="-lsocket -lrpc -lgen -lcrypt -lxenix" \
386	 RANLIB=true CC=gcc
387
388gh9:	# GCC HP-UX 9.x
389	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
390	 SIGTYPE=psx CRXTYPE=nfs \
391	 MAILSPOOL=/usr/mail \
392	 RSHPATH=/usr/bin/remsh \
393	 BASECFLAGS="$(GCCCFLAGS)" \
394	 RANLIB=true CC=gcc
395
396ghp:	# GCC HP-UX 10.x
397	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
398	 SIGTYPE=psx CRXTYPE=nfs \
399	 SPOOLDIR=/var \
400	 ACTIVEFILE=/var/news/active \
401	 RSHPATH=/usr/bin/remsh \
402	 BASECFLAGS="$(GCCCFLAGS)" \
403	 RANLIB=true CC=gcc
404
405ghs:	# GCC HP-UX with Trusted Computer Base
406	$(BUILD) `$(CAT) SPECIALS` OS=shp \
407	 SIGTYPE=psx CHECKPW=sec CRXTYPE=nfs \
408	 SPOOLDIR=/var \
409	 ACTIVEFILE=/var/news/active \
410	 RSHPATH=/usr/bin/remsh \
411	 BASECFLAGS="$(GCCCFLAGS)" \
412	 BASELDFLAGS="-lnet -lV3 -lsec" \
413	 RANLIB=true CC=gcc
414
415go5:	# GCC 2.7.1 (95q4) SCO Open Server 5.0.x
416	$(BUILD) `$(CAT) SPECIALS` OS=sc5 \
417	 SIGTYPE=psx CHECKPW=sec LOGINPW=sec \
418	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
419	 SPOOLDIR=/var/spool \
420	 ACTIVEFILE=/var/lib/news/active \
421	 RSHPATH=/usr/bin/rcmd \
422	 BASECFLAGS="$(GCCCFLAGS) -I/usr/include -L/lib" \
423	 BASELDFLAGS="-lsocket -lprot -lx -ltinfo -lm" \
424	 RANLIB=true CC=gcc
425
426gsc:	# Santa Cruz Operation
427	$(BUILD) `$(CAT) SPECIALS` OS=sco \
428	 SIGTYPE=sv4 CHECKPW=sec LOGINPW=sec \
429	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
430	 RSHPATH=/usr/bin/rcmd \
431	 BASECFLAGS="$(GCCCFLAGS)" \
432	 BASELDFLAGS="-lsocket -lprot -lcrypt_i -lx -los" \
433	 RANLIB=true LN=ln CC=gcc
434
435gsg:	# GCC Silicon Graphics
436	$(BUILD) `$(CAT) SPECIALS` OS=sgi \
437	 SIGTYPE=sv4 CRXTYPE=nfs \
438	 MAILSPOOL=/usr/mail \
439	 RSHPATH=/usr/bsd/rsh \
440	 BASECFLAGS="$(GCCCFLAGS)" \
441	 RANLIB=true CC=gcc
442
443gso:	os_sol.h	# GCC Solaris
444	$(BUILD) `$(CAT) SPECIALS` OS=sol \
445	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
446	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
447	 ACTIVEFILE=/usr/share/news/active \
448	 RSHPATH=/usr/bin/rsh \
449	 BASECFLAGS="$(GCCCFLAGS)" \
450	 BASELDFLAGS="-lsocket -lnsl -lgen" \
451	 RANLIB=true CC=gcc
452
453gsu:	# GCC SUN-OS
454	$(BUILD) `$(CAT) SPECIALS` OS=sun \
455	 CRXTYPE=nfs \
456	 BASECFLAGS="$(GCCCFLAGS)" \
457	 BASELDFLAGS="-ldl" \
458	 CC=gcc
459
460gul:	# GCC Ultrix
461	$(BUILD) `$(CAT) SPECIALS` OS=ult \
462	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
463	 BASECFLAGS="$(GCCCFLAGS)" \
464	 BASELDFLAGS="-lauth -lc" \
465	 CC=gcc
466
467h11:	# HP-UX 11i
468	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
469	 SIGTYPE=psx CRXTYPE=nfs \
470	 SPOOLDIR=/var \
471	 ACTIVEFILE=/var/news/active \
472	 RSHPATH=/usr/bin/remsh \
473	 BASECFLAGS="-g -Ae" \
474	 RANLIB=true
475
476hpp:	# HP-UX 9.x
477	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
478	 SIGTYPE=psx CRXTYPE=nfs \
479	 MAILSPOOL=/usr/mail \
480	 RSHPATH=/usr/bin/remsh \
481	 BASECFLAGS="-g -Aa -D_HPUX_SOURCE" \
482	 BASELDFLAGS="-lnet -lV3" \
483	 RANLIB=true
484
485hpx:	# HP-UX 10.x
486	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
487	 SIGTYPE=psx CRXTYPE=nfs \
488	 SPOOLDIR=/var \
489	 ACTIVEFILE=/var/news/active \
490	 RSHPATH=/usr/bin/remsh \
491	 BASECFLAGS="-g -Ae" \
492	 BASELDFLAGS="-lnet -lV3" \
493	 RANLIB=true
494
495isc:	# Interactive
496	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
497	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
498	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
499	 ACTIVEFILE=/var/spool/news/active \
500	 BASECFLAGS="-Xp -D_SYSV3" \
501	 BASELDFLAGS="-linet -lnsl_s -lgen -lx -lsec -liberty" \
502	 RANLIB=true
503
504lnp:	# Linux Pluggable Authentication modules
505	$(BUILD) `$(CAT) SPECIALS` OS=slx \
506	 SIGTYPE=psx CHECKPW=pam CRXTYPE=nfs \
507	 SPOOLDIR=/var/spool \
508	 ACTIVEFILE=/var/lib/news/active \
509	 RSHPATH=/usr/bin/rsh \
510	 BASECFLAGS="$(GCCCFLAGS)" \
511	 BASELDFLAGS="$(PAMLDFLAGS)"
512
513lnx:	# Linux non-shadow passwords
514	@echo You are building for traditional Linux *without* shadow
515	@echo passwords and with the crypt function in the C library.
516	@echo If your system has shadow passwords, or if crypt is not
517	@echo in the C library, you must use slx, sl4, or sl5 instead!
518	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
519	 SIGTYPE=psx CRXTYPE=nfs \
520	 SPOOLDIR=/var/spool \
521	 ACTIVEFILE=/var/lib/news/active \
522	 RSHPATH=/usr/bin/rsh \
523	 BASECFLAGS="$(GCCCFLAGS)"
524
525lyn:	# LynxOS
526	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
527	 CRXTYPE=nfs \
528	 RSHPATH=/bin/rsh \
529	 BASECFLAGS="$(GCCCFLAGS)" \
530	 BASELDFLAGS=-lbsd \
531	 CC=gcc
532
533mct:	# MachTen - CRXTYPE=nfs doesn't work (at least not on 2.2)
534	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
535	 SPOOLDIR=/var/spool \
536	 BASECFLAGS="$(GCCCFLAGS)"
537
538mnt:	# Mint
539	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
540	 SIGTYPE=psx CRXTYPE=nfs \
541	 SPOOLDIR=/var/spool \
542	 ACTIVEFILE=/var/lib/news/active \
543	 RSHPATH=/usr/bin/rsh \
544	 BASECFLAGS="$(GCCCFLAGS)"
545
546neb:	# NetBSD
547	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
548	 CRXTYPE=nfs \
549	 SPOOLDIR=/var \
550	 ACTIVEFILE=/var/db/news/active \
551	 RSHPATH=/usr/bin/rsh \
552	 BASECFLAGS="$(GCCCFLAGS)" \
553	 BASELDFLAGS="-lcrypt"
554
555nec:	# NEC UX
556	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
557	 SIGTYPE=sv4 CHECKPW=sv4 \
558	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
559	 ACTIVEFILE=/var/news/lib/active \
560	 RSHPATH=/usr/bin/rsh \
561	 BASECFLAGS="-g -Kopt=2 -KOlimit=2000" \
562	 BASELDFLAGS="-lsocket -lnsl -lgen" \
563	 RANLIB=true CC=/usr/abiccs/bin/cc
564
565nto:	# QNX Neutrino RTP
566	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
567	 CRXTYPE=nfs \
568	 SPOOLDIR=/var/spool \
569	 ACTIVEFILE=/var/lib/news/active \
570	 RSHPATH=/usr/bin/rsh \
571	 BASECFLAGS="-g -O"
572
573nxt:	# NEXTSTEP
574	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
575	 CRXTYPE=nfs \
576	 BASECFLAGS="$(GCCCFLAGS)"
577
578nx3:	# NEXTSTEP 3.0 single threaded
579	$(BUILD) `$(CAT) SPECIALS` OS=nxt \
580	 CRXTYPE=nfs \
581	 BASECFLAGS="$(GCCCFLAGS)"
582	echo "void malloc_singlethreaded (void);" >> linkage.h
583	echo "  malloc_singlethreaded ();" >> linkage.c
584
585osf:	# OSF/1
586	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
587	 SIGTYPE=psx CRXTYPE=nfs \
588	 SPOOLDIR=/var/spool \
589	 BASECFLAGS="-g3 -w -O2 -Olimit 1500"
590
591# Note: sia_become_user() used by LOGINPW=os4 doesn't seem to work right.  The
592# user doesn't get proper file access, and the process can't be killed.
593
594os4:	# OSF/1 (Digital UNIX) 4
595	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
596	 SIGTYPE=psx CHECKPW=os4 LOGINPW=os4 CRXTYPE=nfs \
597	 SPOOLDIR=/var/spool \
598	 BASECFLAGS="-g3 -w -std0 -O2"
599
600osx:	# Mac OS X
601	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
602	 CRXTYPE=nfs \
603	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
604	 RSHPATH=/usr/bin/rsh \
605	 BASECFLAGS="$(GCC4CFLAGS)"
606
607ptx:	# PTX
608	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
609	 SIGTYPE=psx CHECKPW=svo LOGINPW=sv4 CRXTYPE=nfs \
610	 MAILSPOOL=/usr/mail \
611	 RSHPATH=/usr/bin/resh \
612	 BASECFLAGS="-Wc,-O3 -Wc,-seq -Dprivate=PRIVATE" \
613	 BASELDFLAGS="-lseq -lsec -lsocket -linet -lnsl -lgen" \
614	 RANLIB=true
615
616pyr:	# Pyramid
617	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
618	 CRXTYPE=nfs \
619	 BASECFLAGS="-g -Dconst="
620
621qnx:	# QNX
622	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
623	 CHECKPW=psx LOGINPW=old \
624	 RSHPATH=/usr/ucb/rsh \
625	 BASECFLAGS="-Otax -g -Dunix=1 -D_POSIX_SOURCE" \
626	 BASELDFLAGS="-g -N128k -llogin -lsocket -lunix"
627
628s40:	# SUN-OS 4.0
629	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
630	 CRXTYPE=nfs \
631	 BASECFLAGS="-g -Dconst="
632
633sc5:	# SCO Open Server 5.0
634	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
635	 SIGTYPE=psx CHECKPW=sec LOGINPW=sec \
636	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
637	 SPOOLDIR=/var/spool \
638	 ACTIVEFILE=/var/lib/news/active \
639	 RSHPATH=/usr/bin/rcmd \
640	 BASECFLAGS="-O3 -s -belf" \
641	 BASELDFLAGS="-lsocket -lprot -lx -ltinfo -lm" \
642	 RANLIB=true
643
644sco:	# Santa Cruz Operation
645	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
646	 SIGTYPE=sv4 CHECKPW=sec LOGINPW=sec \
647	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
648	 RSHPATH=/usr/bin/rcmd \
649	 BASECFLAGS="-O3" \
650	 BASELDFLAGS="-lsocket -lprot -lcrypt_i -lx -los" \
651	 RANLIB=true LN=ln
652
653# Note: setting _POSIX_SOURCE doesn't seem to build it as of SGI IRIX 5.3
654
655sgi:	# Silicon Graphics
656	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
657	 SIGTYPE=sv4 CRXTYPE=nfs \
658	 MAILSPOOL=/usr/mail \
659	 RSHPATH=/usr/bsd/rsh \
660	 BASECFLAGS="-g3 -O2 -Olimit 8192" \
661	 RANLIB=true
662
663sg6:	# Silicon Graphics, IRIX 6.5
664	MAKEFLAGS= $(BUILD) `$(CAT) SPECIALS` OS=sgi \
665	 SIGTYPE=sv4 CRXTYPE=nfs \
666	 MAILSPOOL=/usr/mail \
667	 RSHPATH=/usr/bsd/rsh \
668	 BASECFLAGS="-g3 -O2 -OPT:Olimit=0 -woff 1110,1116" \
669	 RANLIB=true
670
671# Note: Mark Kaesling says that setluid() isn't in HP-UX with SecureWare.
672
673shp:	# HP-UX with Trusted Computer Base
674	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
675	 SIGTYPE=psx CHECKPW=sec CRXTYPE=nfs \
676	 SPOOLDIR=/var \
677	 ACTIVEFILE=/var/news/active \
678	 RSHPATH=/usr/bin/remsh \
679	 BASECFLAGS="-g -Ae" \
680	 BASELDFLAGS="-lnet -lV3 -lsec" \
681	 RANLIB=true
682
683slx:	# Secure Linux
684	@echo You are building for libc6/glibc versions of Secure Linux
685	@echo If you want libc5 versions you must use sl5 instead!
686	@echo If you want libc4 versions you must use sl4 instead!
687	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
688	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
689	 SPOOLDIR=/var/spool \
690	 ACTIVEFILE=/var/lib/news/active \
691	 RSHPATH=/usr/bin/rsh \
692	 BASECFLAGS="$(GCCCFLAGS)" \
693	 BASELDFLAGS="-lcrypt"
694
695sl4:	# Secure Linux using libc4
696	@echo You are building for libc4 versions of Secure Linux
697	@echo If you want libc6/glibc versions you must use slx instead!
698	@echo If you want libc5 versions you must use sl5 instead!
699	$(BUILD) `$(CAT) SPECIALS` OS=slx \
700	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
701	 SPOOLDIR=/var/spool \
702	 ACTIVEFILE=/var/lib/news/active \
703	 RSHPATH=/usr/bin/rsh \
704	 BASECFLAGS="$(GCCCFLAGS)" \
705	 BASELDFLAGS="-lshadow"
706
707sl5:	# Secure Linux using libc5
708	@echo You are building for libc5 versions of Secure Linux
709	@echo If you want libc6/glibc versions you must use slx instead!
710	@echo If you want libc4 versions you must use sl4 instead!
711	$(BUILD) `$(CAT) SPECIALS` OS=slx \
712	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
713	 SPOOLDIR=/var/spool \
714	 ACTIVEFILE=/var/lib/news/active \
715	 RSHPATH=/usr/bin/rsh \
716	 BASECFLAGS="$(GCCCFLAGS)"
717
718snx:	# Siemens Nixdorf SINIX and Reliant UNIX
719	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
720	 SIGTYPE=psx CHECKPW=sv4 \
721	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
722	 ACTIVEFILE=/usr/share/news/active \
723	 RSHPATH=/usr/bin/rsh \
724	 BASECFLAGS="-g -D_SYS_CLOCK_H -Dconst=" \
725	 BASELDFLAGS="-lsocket -lnsl -lgen" \
726	 RANLIB=true
727
728# Sorry about the -w, but the cretinous SUN Workshop Pro C compiler barfs on
729# implicit casts between char and unsigned char.
730
731soc:	os_sol.h	# Solaris with cc
732	$(BUILD) `$(CAT) SPECIALS` OS=sol \
733	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
734	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
735	 ACTIVEFILE=/usr/share/news/active \
736	 RSHPATH=/usr/bin/rsh \
737	 BASECFLAGS="-g -O -w" \
738	 BASELDFLAGS="-lsocket -lnsl -lgen" \
739	 RANLIB=true CC=/opt/SUNWspro/bin/cc
740
741
742# Note: It is a long and disgusting story about why cc is set to ucbcc.  You
743# need to invoke the C compiler so that it links with the SVR4 libraries and
744# not the BSD libraries, otherwise readdir() will return the wrong information.
745# Of all the names in the most common path, ucbcc is the only name to be found
746# (on /usr/ccs/bin) that points to a suitable compiler.  cc is likely to be
747# /usr/ucb/cc which is absolutely not the compiler that you want.  The real
748# SVR4 cc is probably something like /opt/SUNWspro/bin/cc which is rarely in
749# anyone's path.
750#
751# ucbcc is probably a link to acc, e.g. /opt/SUNWspro/SC4.0/bin/acc, and is
752# the UCB C compiler using the SVR4 libraries.
753#
754# If ucbcc isn't on your system, then punt on the SUN C compiler and use gcc
755# instead (the gso port instead of the sol port).
756#
757# If, in spite of all the above warnings, you choose to use the "soc" port
758# instead of the "sol" port, be sure to check the behavior of the LIST command
759# in imapd.  Also, note that the "soc" port uses -O.  If you want to use the
760# real SVR4 compiler, you must use -O.  If it works to compile with -O2, then
761# cc is probably using the UCB compiler with BSD libraries, and will not build
762# a good binary
763#
764# To recap:
765# 1) The sol port is designed to be built using the UCB compiler using the
766#    SVR4 libraries.  This compiler is "ucbcc", which is lunk to acc.  You
767#    use -O2 as one of the CFLAGS.
768# 2) If you build the sol port with the UCB compiler using the BSD libraries,
769#    you will get no error messages but you will get bad binaries (the most
770#    obvious symptom is dropping the first two characters return filenames
771#    from the imapd LIST command.  This compiler also uses -O2, and is very
772#    often what the user gets from "cc".  BEWARE!!!
773# 3) If you build the sol port with the real SVR4 compiler, which is often
774#    hidden away or unavailable on many systems, then you will get errors
775#    from -O2 and you need to change that to -O.  But you will get a good
776#    binary.  However, you should try it with -O2 first, to make sure that
777#    you got this compiler and not the UCB compiler using BSD libraries.
778
779sol:	os_sol.h	# Solaris
780	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
781	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
782	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
783	 ACTIVEFILE=/usr/share/news/active \
784	 RSHPATH=/usr/bin/rsh \
785	 BASECFLAGS="-g -O2" \
786	 BASELDFLAGS="-lsocket -lnsl -lgen" \
787	 RANLIB=true CC=ucbcc
788
789sos:	# Secure OSF/1
790	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
791	 SIGTYPE=psx CHECKPW=sce LOGINPW=sec CRXTYPE=nfs \
792	 BASECFLAGS="-g3 -w -O2 -Olimit 1500" \
793	 BASELDFLAGS="-lsecurity -laud"
794
795ssn:	# Secure SUN-OS
796	$(BUILD) `$(CAT) SPECIALS` OS=sun \
797	 CHECKPW=ssn CRXTYPE=nfs \
798	 BASECFLAGS="-g -Dconst=" \
799	 BASELDFLAGS="-ldl"
800
801sua:	# Windows Vista Subsystem for UNIX Applications
802	$(BUILD) `$(CAT) SPECIALS` OS=sua \
803	 SIGTYPE=psx CRXTYPE=nfs LOGINPW=old \
804	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
805	 ACTIVEFILE=/var/lib/news/active \
806	 RSHPATH=/usr/bin/rsh \
807	 BASECFLAGS="-g -O2" \
808	 BASELDFLAGS="-lcrypt"
809
810sun:	# SUN-OS
811	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
812	 CRXTYPE=nfs \
813	 BASECFLAGS="-g -Dconst=" \
814	 BASELDFLAGS="-ldl"
815
816sv2:	# SVR2
817	@echo You are being *very* optimistic!
818	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
819	 SIGTYPE=sv4 LOGINPW=old \
820	 MAILSPOOL=/usr/mail \
821	 RSHPATH=/usr/bin/remsh \
822	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT -I/usr/ethernet/include" \
823	 BASELDFLAGS="-lnet" \
824	 RANLIB=true LN=ln
825
826sv4:	# SVR4
827	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
828	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
829	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
830	 ACTIVEFILE=/usr/share/news/active \
831	 RSHPATH=/usr/bin/resh \
832	 BASECFLAGS="-g -Dconst=" \
833	 BASELDFLAGS="-lsocket -lnsl -lgen" \
834	 RANLIB=true
835
836ult:	# Ultrix
837	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
838	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
839	 BASECFLAGS="-g3 -O2 -Olimit 1500 -Dconst=" \
840	 BASELDFLAGS="-lauth -lc"
841
842uw2:	# UnixWare SVR4.2
843	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
844	 SIGTYPE=sv4 CHECKPW=sv4 \
845	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
846	 ACTIVEFILE=/var/news/lib/active \
847	 RSHPATH=/usr/bin/rsh \
848	 BASECFLAGS="-g" \
849	 BASELDFLAGS="-lsocket -lnsl -lgen" \
850	 RANLIB=true
851
852vul:	# VAX Ultrix
853	$(BUILD) `$(CAT) SPECIALS` OS=ult \
854	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
855	 BASECFLAGS="-O2 -Dconst=" \
856	 BASELDFLAGS="-lauth -lc"
857
858vu2:	# VAX Ultrix 2.3, etc.
859	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
860	 CRXTYPE=nfs \
861	 BASECFLAGS="-O2 -Dconst= -Dvoid=char"
862
863
864# Build it!
865
866build:	clean once $(ARCHIVE)
867
868all:	onceenv
869
870$(ARCHIVE): $(BINARIES)
871	sh -c '$(RM) $(ARCHIVE) || true'
872	@$(CAT) ARCHIVE
873	@$(SH) ARCHIVE
874
875.c.o:
876	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
877
878
879# Cleanup
880
881clean:
882	sh -c '$(RM) auths.c crexcl.c ip_unix.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
883
884
885# Dependencies
886
887dummy.o: mail.h misc.h osdep.h dummy.h
888fdstring.o: mail.h misc.h osdep.h fdstring.h
889flstring.o: mail.h misc.h osdep.h flstring.h
890imap4r1.o: mail.h misc.h osdep.h imap4r1.h rfc822.h
891mail.o: mail.h misc.h osdep.h rfc822.h linkage.h
892mbx.o: mail.h misc.h osdep.h dummy.h
893mh.o: mail.h misc.h osdep.h dummy.h
894mix.o: mail.h misc.h osdep.h dummy.h
895mx.o: mail.h misc.h osdep.h dummy.h
896misc.o: mail.h misc.h osdep.h
897mmdf.o: mail.h misc.h osdep.h pseudo.h dummy.h
898mtx.o: mail.h misc.h osdep.h dummy.h
899netmsg.o: mail.h misc.h osdep.h netmsg.h
900news.o: mail.h misc.h osdep.h
901newsrc.o: mail.h misc.h osdep.h newsrc.h
902nntp.o: mail.h misc.h osdep.h netmsg.h smtp.h nntp.h rfc822.h
903phile.o: mail.h misc.h osdep.h rfc822.h dummy.h
904pseudo.o: pseudo.h
905pop3.o: mail.h misc.h osdep.h rfc822.h
906smanager.o: mail.h misc.h osdep.h
907smtp.o: mail.h misc.h osdep.h smtp.h rfc822.h
908rfc822.o: mail.h misc.h osdep.h rfc822.h
909tenex.o: mail.h misc.h osdep.h dummy.h
910unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
911utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
912utf8aux.o: mail.h misc.h osdep.h utf8.h
913
914
915# OS-dependent
916
917osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
918	osdep.h env_unix.h tcp_unix.h \
919	osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\
920	auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \
921	gethstid.c getspnam.c \
922	gr_wait.c gr_wait4.c gr_waitp.c \
923	kerb_mit.c \
924	auth_ext.c auth_gss.c auth_log.c auth_md5.c auth_pla.c \
925	pmatch.c scandir.c setpgrp.c strerror.c truncate.c write.c \
926	memmove.c memmove2.c memset.c \
927	tz_bsd.c tz_nul.c tz_sv4.c \
928	write.c sslstdio.c \
929	strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
930	OSCFLAGS
931	@echo Building OS-dependent module
932	@echo If you get No such file error messages for files x509.h, ssl.h,
933	@echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
934	@echo is not installed on your system.  Either install OpenSSL first
935	@echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
936	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
937
938osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
939	$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
940
941osdepbas.c:
942	@echo osdepbas.c not found...try make clean and new make
943	@false
944
945osdepckp.c:
946	@echo osdepckp.c not found...try make clean and new make
947	@false
948
949osdeplog.c:
950	@echo osdeplog.c not found...try make clean and new make
951	@false
952
953osdepssl.c:
954	@echo osdepssl.c not found...try make clean and new make
955	@false
956
957siglocal.c:
958	@echo siglocal.c not found...try make clean and new make
959	@false
960
961crexcl.c:
962	@echo crexcl.c not found...do make clean and new make
963	@false
964
965ip_unix.c:
966	@echo ip_unix.c not found...do make clean and new make
967	@false
968
969os_sol.h:
970	sh -c 'if [ -f /lib/libc.a ]; then (strings /lib/libc.a | grep getpassphrase > /dev/null) && $(LN) os_soln.h os_sol.h || $(LN) os_solo.h os_sol.h ; else $(LN) os_soln.h os_sol.h ; fi'
971
972
973# Once-only environment setup
974
975once:	onceenv ckp$(PASSWDTYPE) ssl$(SSLTYPE) osdep.c
976
977onceenv:
978	@echo Once-only environment setup...
979	echo $(CC) > CCTYPE
980	echo $(BASECFLAGS) '$(EXTRACFLAGS)' -DCHUNKSIZE=$(CHUNKSIZE) > CFLAGS
981	echo -DCREATEPROTO=$(CREATEPROTO) -DEMPTYPROTO=$(EMPTYPROTO) \
982	 -DMD5ENABLE=\"$(MD5PWD)\" -DMAILSPOOL=\"$(MAILSPOOL)\" \
983	 -DANONYMOUSHOME=\"$(MAILSPOOL)/anonymous\" \
984	 -DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
985	 -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" \
986	 -DLOCKPGM1=\"$(LOCKPGM1)\" -DLOCKPGM2=\"$(LOCKPGM2)\" \
987	 -DLOCKPGM3=\"$(LOCKPGM3)\" > OSCFLAGS
988	echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
989	echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
990	echo $(OS) > OSTYPE
991	./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
992	./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
993	echo "  mail_versioncheck (CCLIENTVERSION);" >> linkage.c
994	$(LN) os_$(OS).h osdep.h
995	$(LN) os_$(OS).c osdepbas.c
996	$(LN) log_$(LOGINPW).c osdeplog.c
997	$(LN) sig_$(SIGTYPE).c siglocal.c
998	$(LN) crx_$(CRXTYPE).c crexcl.c
999	$(LN) ip$(IP)_unix.c ip_unix.c
1000	sh -c '(test $(OS) = sc5 -o $(OS) = sco -o ! -f /usr/include/sys/statvfs.h) && echo -DNOFSTATVFS >> OSCFLAGS || fgrep statvfs64 /usr/include/sys/statvfs.h > /dev/null || echo -DNOFSTATVFS64 >> OSCFLAGS'
1001
1002
1003# Password checkers
1004
1005ckpafs:	# AFS
1006	@echo AFS password authentication
1007	echo $(AFSCFLAGS) >> OSCFLAGS
1008#	echo $(AFSLDFLAGS) >> LDFLAGS
1009# Note: Steve Roseman says that AFS libraries have to be lunk before SSL
1010	echo $(AFSLDFLAGS) `$(CAT) LDFLAGS` > LDFLAGS.tmp
1011	mv LDFLAGS.tmp LDFLAGS
1012	$(LN) ckp_afs.c osdepckp.c
1013
1014ckpdce:	# DCE
1015	@echo DCE password authentication
1016	echo $(DCECFLAGS) >> OSCFLAGS
1017	echo $(DCELDFLAGS) >> LDFLAGS
1018	$(LN) ckp_dce.c osdepckp.c
1019
1020ckpgss:	# Kerberos V (must have gss EXTRAAUTHENTICATOR as well)
1021	@echo Kerberos V password authentication
1022	$(LN) ckp_gss.c osdepckp.c
1023
1024ckpnul:	# NUL authenticator (disables all plaintext authentication)
1025	@echo Plaintext authentication prohibited
1026	echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 1);" >> linkage.c
1027	$(LN) ckp_nul.c osdepckp.c
1028
1029ckppam:	# Pluggable Authentication Modules authenticator
1030	@echo PAM password authentication
1031	echo $(PAMLDFLAGS) >> LDFLAGS
1032	$(LN) ckp_pam.c osdepckp.c
1033
1034ckppmb:	# Broken (e.g. SUN) Pluggable Authentication Modules authenticator
1035	@echo Broken PAM password authentication
1036	echo $(PAMLDFLAGS) >> LDFLAGS
1037	$(LN) ckp_pmb.c osdepckp.c
1038
1039ckpstd:	# Port standard
1040	@echo Standard password authentication
1041	$(LN) ckp_$(CHECKPW).c osdepckp.c
1042
1043ckptwo:	# Something plus standard
1044	@echo $(CHECKPWALT) password authentication first, then standard
1045	$(CAT) ckp_1st.c ckp_$(CHECKPWALT).c ckp_2nd.c ckp_$(CHECKPW).c \
1046	 ckp_3rd.c > osdepckp.c
1047
1048
1049# SSL support
1050
1051sslnone:# No SSL
1052	@echo Building without SSL support
1053	$(LN) ssl_none.c osdepssl.c
1054
1055sslnopwd: sslunix snopwd
1056
1057sslunix.nopwd: sslnopwd
1058
1059sslsco.nopwd: sslsco snopwd
1060
1061sslunix: sbasic sldunix
1062
1063sslsco:	sbasic sldsco
1064
1065sbasic:	# UNIX OpenSSL
1066	@echo Building with SSL
1067	$(LN) ssl_unix.c osdepssl.c
1068	echo $(SSLCFLAGS) >> OSCFLAGS
1069	echo "  ssl_onceonlyinit ();" >> linkage.c
1070
1071snopwd:	# Plaintext disable
1072	@echo Building with SSL and plaintext passwords disabled unless SSL/TLS
1073	echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 2);" >> linkage.c
1074
1075sldunix:# Normal UNIX SSL load flags
1076	echo $(SSLLDFLAGS) >> LDFLAGS
1077
1078
1079sldsco:	# SCO SSL load flags
1080# Note: Tim Rice says that SSL has to be lunk before other libraries on SCO.
1081	echo $(SSLLDFLAGS) `cat LDFLAGS` > LDFLAGS.tmp
1082	mv LDFLAGS.tmp LDFLAGS
1083
1084
1085# A monument to a hack of long ago and far away...
1086
1087love:
1088	@echo not war?
1089