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