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
36
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 concensus 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
59#SSLDIR=/usr/local/ssl
60SSLCERTS=$(PREFIX)/certs
61SSLKEYS=$(SSLCERTS)
62SSLINCLUDE=$(SSLDIR)/include
63SSLLIB=$(SSLDIR)/lib
64
65SSLCRYPTO=-lcrypto -lcrypt
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 -lcrypt
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
113
114
115# Default formats for creating new mailboxes and for empty mailboxes in the
116# default namespace; must be set to the associated driver's prototype.
117#
118# The CREATEPROTO is the default format for new mailbox creation.
119# The EMPTYPROTO is the default format for handling zero-byte files.
120#
121# Normally, this is set by the individual port.
122#
123# NOTE: namespace formats (e.g. mh and news) can not be set as a default format
124# since they do not exist in the default namespace.  Also, it is meaningless to
125# set certain other formats (e.g. mbx, mx, and mix) as the EMPTYPROTO since
126# these formats can never be empty files.
127
128CREATEPROTO=unixproto
129EMPTYPROTO=unixproto
130
131
132# Commands possibly overriden by the individual port
133
134ARRC=ar rc
135CC?=cc
136LN=ln -s
137RANLIB=ranlib
138
139
140# Standard distribution build parameters
141
142DEFAULTAUTHENTICATORS=ext md5 pla log
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 pop3.o \
158 unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
159CFLAGS+=$(BASECFLAGS) $(EXTRACFLAGS)
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
250bfp:	# FreeBSD Pluggable Authentication Modules
251	$(BUILD) `cat SPECIALS` OS=bsi SIGTYPE=psx CHECKPW=pam \
252	 SPOOLDIR=/var \
253	 ACTIVEFILE=/usr/local/news/lib/active \
254	 RSHPATH=/usr/bin/rsh \
255	 LOCKPGM=$(PREFIX)/libexec/mlock \
256	 BASECFLAGS="-DNFSKLUDGE" \
257	 BASELDFLAGS="-lpam -lcrypt"
258
259bs3:	# BSD/i386 3.0 or higher
260	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
261	 CHECKPW=bsi LOGINPW=bsi CRXTYPE=nfs \
262	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
263	 ACTIVEFILE=/var/news/etc/active \
264	 RSHPATH=/usr/bin/rsh \
265	 BASECFLAGS="$(GCCCFLAGS)" CC=shlicc
266
267bsd:	# BSD UNIX
268	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
269	 CRXTYPE=nfs \
270	 BASECFLAGS="-g -Dconst="
271
272bsf:	# FreeBSD
273	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
274	 SIGTYPE=psx CRXTYPE=nfs \
275	 SPOOLDIR=/var \
276	 ACTIVEFILE=/usr/local/news/lib/active \
277	 RSHPATH=/usr/bin/rsh \
278	 LOCKPGM=$(PREFIX)/libexec/mlock \
279	 BASECFLAGS="$(GCCCFLAGS)" \
280	 BASELDFLAGS=""
281
282bsi:	# BSD/i386
283	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
284	 CRXTYPE=nfs \
285	 SPOOLDIR=/var NEWSSPOOL=/var/news/spool \
286	 ACTIVEFILE=/var/news/etc/active \
287	 RSHPATH=/usr/bin/rsh \
288	 BASECFLAGS="$(GCCCFLAGS)"
289
290bso:	# OpenBSD
291	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
292	 SIGTYPE=psx CRXTYPE=nfs \
293	 SPOOLDIR=/var \
294	 ACTIVEFILE=/usr/local/news/lib/active \
295	 RSHPATH=/usr/bin/rsh \
296	 BASECFLAGS="$(GCCCFLAGS)"
297
298cvx:	# Convex
299	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
300	 CRXTYPE=nfs \
301	 BASECFLAGS="-O -ext -Dconst="
302
303cyg:	# Cygwin - note that most local file drivers don't work!!
304	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
305	DEFAULTDRIVERS="imap nntp pop3 mbx unix phile" \
306	SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
307	SPOOLDIR=/var \
308	ACTIVEFILE=/usr/local/news/lib/active \
309	RSHPATH=/usr/bin/rsh \
310	BASECFLAGS="$(GCCCFLAGS)" \
311	BASELDFLAGS="-lcrypt" \
312	CC=gcc
313
314d-g:	# Data General DG/UX
315	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
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
324d54:	# Data General DG/UX 5.4
325	$(BUILD) `$(CAT) SPECIALS` OS=d-g \
326	 SIGTYPE=sv4 CRXTYPE=nfs \
327	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
328	 ACTIVEFILE=/local/news/active \
329	 RSHPATH=/usr/bin/remsh \
330	 BASECFLAGS="-g -Dconst=" \
331	 BASELDFLAGS="-lnsl -lsocket" \
332	 RANLIB=true
333
334dpx:	# Bull DPX/2
335	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
336	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
337	 RSHPATH=/usr/bin/remsh \
338	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT" \
339	 BASELDFLAGS="-linet" \
340	 RANLIB=true LN=ln
341
342drs:	# ICL DRS/NX
343	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
344	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 CRXTYPE=nfs \
345	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
346	 ACTIVEFILE=/var/lib/news/active \
347	 RSHPATH=/usr/bin/rsh \
348	 BASECFLAGS="-O" \
349	 BASELDFLAGS="-lsocket -lgen" \
350	 RANLIB=true
351
352do4:	# Apollo Domain/OS sr10.4
353	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
354	 CRXTYPE=nfs \
355	 BASECFLAGS="-A systype,bsd4.3 -D_APOLLO_SOURCE" \
356	 RANLIB=true
357
358dyn:	# Dynix
359	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
360	 CRXTYPE=nfs \
361	 BASECFLAGS="-g -Dconst="
362
363epx:	# EP/IX
364	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
365	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
366	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
367	 ACTIVEFILE=/usr/share/news/active \
368	 RSHPATH=/usr/net/rsh \
369	 BASECFLAGS="-g -systype svr4" \
370	 BASELDFLAGS="-lsocket -lnsl -lgen" \
371	 RANLIB=true
372
373ga4:	# GCC AIX 4.1 for RS/6000
374	$(BUILD) `$(CAT) SPECIALS` OS=a41 \
375	 SIGTYPE=psx CHECKPW=a41 CRXTYPE=nfs \
376	 SPOOLDIR=/var/spool \
377	 RSHPATH=/usr/bin/rsh \
378	 BASECFLAGS="-g -Dunix=1 -D_BSD" \
379	 BASELDFLAGS="-ls"
380
381gas:	# GCC Altos SVR4
382	$(BUILD) `$(CAT) SPECIALS` OS=asv \
383	 SIGTYPE=sv4 LOGINPW=old \
384	 ACTIVEFILE=/usr/spool/news/active \
385	 RSHPATH=/usr/bin/rcmd \
386	 BASECFLAGS="-g -O -DALTOS_SYSTEM_V -DSIGSTOP=SIGKILL" \
387	 BASELDFLAGS="-lsocket -lrpc -lgen -lcrypt -lxenix" \
388	 RANLIB=true CC=gcc
389
390gh9:	# GCC HP-UX 9.x
391	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
392	 SIGTYPE=psx CRXTYPE=nfs \
393	 MAILSPOOL=/usr/mail \
394	 RSHPATH=/usr/bin/remsh \
395	 BASECFLAGS="$(GCCCFLAGS)" \
396	 RANLIB=true CC=gcc
397
398ghp:	# GCC HP-UX 10.x
399	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
400	 SIGTYPE=psx CRXTYPE=nfs \
401	 SPOOLDIR=/var \
402	 ACTIVEFILE=/var/news/active \
403	 RSHPATH=/usr/bin/remsh \
404	 BASECFLAGS="$(GCCCFLAGS)" \
405	 RANLIB=true CC=gcc
406
407ghs:	# GCC HP-UX with Trusted Computer Base
408	$(BUILD) `$(CAT) SPECIALS` OS=shp \
409	 SIGTYPE=psx CHECKPW=sec CRXTYPE=nfs \
410	 SPOOLDIR=/var \
411	 ACTIVEFILE=/var/news/active \
412	 RSHPATH=/usr/bin/remsh \
413	 BASECFLAGS="$(GCCCFLAGS)" \
414	 BASELDFLAGS="-lnet -lV3 -lsec" \
415	 RANLIB=true CC=gcc
416
417go5:	# GCC 2.7.1 (95q4) SCO Open Server 5.0.x
418	$(BUILD) `$(CAT) SPECIALS` OS=sc5 \
419	 SIGTYPE=psx CHECKPW=sec LOGINPW=sec \
420	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
421	 SPOOLDIR=/var/spool \
422	 ACTIVEFILE=/var/lib/news/active \
423	 RSHPATH=/usr/bin/rcmd \
424	 BASECFLAGS="$(GCCCFLAGS) -I/usr/include -L/lib" \
425	 BASELDFLAGS="-lsocket -lprot -lx -ltinfo -lm" \
426	 RANLIB=true CC=gcc
427
428gsc:	# Santa Cruz Operation
429	$(BUILD) `$(CAT) SPECIALS` OS=sco \
430	 SIGTYPE=sv4 CHECKPW=sec LOGINPW=sec \
431	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
432	 RSHPATH=/usr/bin/rcmd \
433	 BASECFLAGS="$(GCCCFLAGS)" \
434	 BASELDFLAGS="-lsocket -lprot -lcrypt_i -lx -los" \
435	 RANLIB=true LN=ln CC=gcc
436
437gsg:	# GCC Silicon Graphics
438	$(BUILD) `$(CAT) SPECIALS` OS=sgi \
439	 SIGTYPE=sv4 CRXTYPE=nfs \
440	 MAILSPOOL=/usr/mail \
441	 RSHPATH=/usr/bsd/rsh \
442	 BASECFLAGS="$(GCCCFLAGS)" \
443	 RANLIB=true CC=gcc
444
445gso:	os_sol.h	# GCC Solaris
446	$(BUILD) `$(CAT) SPECIALS` OS=sol \
447	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
448	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
449	 ACTIVEFILE=/usr/share/news/active \
450	 RSHPATH=/usr/bin/rsh \
451	 BASECFLAGS="$(GCCCFLAGS)" \
452	 BASELDFLAGS="-lsocket -lnsl -lgen -R/usr/local/ssl/lib" \
453	 RANLIB=true CC=gcc
454
455gsu:	# GCC SUN-OS
456	$(BUILD) `$(CAT) SPECIALS` OS=sun \
457	 CRXTYPE=nfs \
458	 BASECFLAGS="$(GCCCFLAGS)" \
459	 BASELDFLAGS="-ldl" \
460	 CC=gcc
461
462gul:	# GCC Ultrix
463	$(BUILD) `$(CAT) SPECIALS` OS=ult \
464	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
465	 BASECFLAGS="$(GCCCFLAGS)" \
466	 BASELDFLAGS="-lauth -lc" \
467	 CC=gcc
468
469h11:	# HP-UX 11i
470	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
471	 SIGTYPE=psx CRXTYPE=nfs \
472	 SPOOLDIR=/var \
473	 ACTIVEFILE=/var/news/active \
474	 RSHPATH=/usr/bin/remsh \
475	 BASECFLAGS="-g -Ae" \
476	 RANLIB=true
477
478hpp:	# HP-UX 9.x
479	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
480	 SIGTYPE=psx CRXTYPE=nfs \
481	 MAILSPOOL=/usr/mail \
482	 RSHPATH=/usr/bin/remsh \
483	 BASECFLAGS="-g -Aa -D_HPUX_SOURCE" \
484	 BASELDFLAGS="-lnet -lV3" \
485	 RANLIB=true
486
487hpx:	# HP-UX 10.x
488	$(BUILD) `$(CAT) SPECIALS` OS=hpp \
489	 SIGTYPE=psx CRXTYPE=nfs \
490	 SPOOLDIR=/var \
491	 ACTIVEFILE=/var/news/active \
492	 RSHPATH=/usr/bin/remsh \
493	 BASECFLAGS="-g -Ae" \
494	 BASELDFLAGS="-lnet -lV3" \
495	 RANLIB=true
496
497isc:	# Interactive
498	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
499	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
500	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
501	 ACTIVEFILE=/var/spool/news/active \
502	 BASECFLAGS="-Xp -D_SYSV3" \
503	 BASELDFLAGS="-linet -lnsl_s -lgen -lx -lsec -liberty" \
504	 RANLIB=true
505
506lnp:	# Linux Pluggable Authentication modules
507	$(BUILD) `$(CAT) SPECIALS` OS=slx \
508	 SIGTYPE=psx CHECKPW=pam CRXTYPE=nfs \
509	 SPOOLDIR=/var/spool \
510	 ACTIVEFILE=/var/lib/news/active \
511	 RSHPATH=/usr/bin/rsh \
512	 BASECFLAGS="$(GCCCFLAGS)" \
513	 BASELDFLAGS="$(PAMLDFLAGS)"
514
515lnx:	# Linux non-shadow passwords
516	@echo You are building for traditional Linux *without* shadow
517	@echo passwords and with the crypt function in the C library.
518	@echo If your system has shadow passwords, or if crypt is not
519	@echo in the C library, you must use slx, sl4, or sl5 instead!
520	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
521	 SIGTYPE=psx CRXTYPE=nfs \
522	 SPOOLDIR=/var/spool \
523	 ACTIVEFILE=/var/lib/news/active \
524	 RSHPATH=/usr/bin/rsh \
525	 BASECFLAGS="$(GCCCFLAGS)"
526
527lyn:	# LynxOS
528	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
529	 CRXTYPE=nfs \
530	 RSHPATH=/bin/rsh \
531	 BASECFLAGS="$(GCCCFLAGS)" \
532	 BASELDFLAGS=-lbsd \
533	 CC=gcc
534
535mct:	# MachTen - CRXTYPE=nfs doesn't work (at least not on 2.2)
536	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
537	 SPOOLDIR=/var/spool \
538	 BASECFLAGS="$(GCCCFLAGS)"
539
540mnt:	# Mint
541	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
542	 SIGTYPE=psx CRXTYPE=nfs \
543	 SPOOLDIR=/var/spool \
544	 ACTIVEFILE=/var/lib/news/active \
545	 RSHPATH=/usr/bin/rsh \
546	 BASECFLAGS="$(GCCCFLAGS)"
547
548neb:	# NetBSD
549	$(BUILD) `$(CAT) SPECIALS` OS=bsi \
550	 CRXTYPE=nfs \
551	 SPOOLDIR=/var \
552	 ACTIVEFILE=/var/db/news/active \
553	 RSHPATH=/usr/bin/rsh \
554	 BASECFLAGS="$(GCCCFLAGS)" \
555	 BASELDFLAGS="-lcrypt"
556
557nec:	# NEC UX
558	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
559	 SIGTYPE=sv4 CHECKPW=sv4 \
560	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
561	 ACTIVEFILE=/var/news/lib/active \
562	 RSHPATH=/usr/bin/rsh \
563	 BASECFLAGS="-g -Kopt=2 -KOlimit=2000" \
564	 BASELDFLAGS="-lsocket -lnsl -lgen" \
565	 RANLIB=true CC=/usr/abiccs/bin/cc
566
567nto:	# QNX Neutrino RTP
568	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
569	 CRXTYPE=nfs \
570	 SPOOLDIR=/var/spool \
571	 ACTIVEFILE=/var/lib/news/active \
572	 RSHPATH=/usr/bin/rsh \
573	 BASECFLAGS="-g -O"
574
575nxt:	# NEXTSTEP
576	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
577	 CRXTYPE=nfs \
578	 BASECFLAGS="$(GCCCFLAGS)"
579
580nx3:	# NEXTSTEP 3.0 single threaded
581	$(BUILD) `$(CAT) SPECIALS` OS=nxt \
582	 CRXTYPE=nfs \
583	 BASECFLAGS="$(GCCCFLAGS)"
584	echo "void malloc_singlethreaded (void);" >> linkage.h
585	echo "  malloc_singlethreaded ();" >> linkage.c
586
587osf:	# OSF/1
588	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
589	 SIGTYPE=psx CRXTYPE=nfs \
590	 SPOOLDIR=/var/spool \
591	 BASECFLAGS="-g3 -w -O2 -Olimit 1500"
592
593# Note: sia_become_user() used by LOGINPW=os4 doesn't seem to work right.  The
594# user doesn't get proper file access, and the process can't be killed.
595
596os4:	# OSF/1 (Digital UNIX) 4
597	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
598	 SIGTYPE=psx CHECKPW=os4 LOGINPW=os4 CRXTYPE=nfs \
599	 SPOOLDIR=/var/spool \
600	 BASECFLAGS="-g3 -w -std0 -O2"
601
602osx:	# Mac OS X
603	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
604	 CRXTYPE=nfs \
605	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
606	 RSHPATH=/usr/bin/rsh \
607	 BASECFLAGS="$(GCC4CFLAGS)"
608
609ptx:	# PTX
610	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
611	 SIGTYPE=psx CHECKPW=svo LOGINPW=sv4 CRXTYPE=nfs \
612	 MAILSPOOL=/usr/mail \
613	 RSHPATH=/usr/bin/resh \
614	 BASECFLAGS="-Wc,-O3 -Wc,-seq -Dprivate=PRIVATE" \
615	 BASELDFLAGS="-lseq -lsec -lsocket -linet -lnsl -lgen" \
616	 RANLIB=true
617
618pyr:	# Pyramid
619	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
620	 CRXTYPE=nfs \
621	 BASECFLAGS="-g -Dconst="
622
623qn6:	# QNX 6
624	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
625	 CRXTYPE=nfs \
626	 SPOOLDIR=/var/spool \
627	 ACTIVEFILE=/var/lib/news/active \
628	 RSHPATH=/usr/bin/rsh \
629	 BASECFLAGS="$(GCCFLAGS)"
630
631qnx:	# QNX
632	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
633	 CHECKPW=psx LOGINPW=old \
634	 RSHPATH=/usr/ucb/rsh \
635	 BASECFLAGS="-Otax -g -Dunix=1 -D_POSIX_SOURCE" \
636	 BASELDFLAGS="-g -N128k -llogin -lsocket -lunix"
637
638s40:	# SUN-OS 4.0
639	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
640	 CRXTYPE=nfs \
641	 BASECFLAGS="-g -Dconst="
642
643sc5:	# SCO Open Server 5.0
644	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
645	 SIGTYPE=psx CHECKPW=sec LOGINPW=sec \
646	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
647	 SPOOLDIR=/var/spool \
648	 ACTIVEFILE=/var/lib/news/active \
649	 RSHPATH=/usr/bin/rcmd \
650	 BASECFLAGS="-O3 -s -belf" \
651	 BASELDFLAGS="-lsocket -lprot -lx -ltinfo -lm" \
652	 RANLIB=true
653
654sco:	# Santa Cruz Operation
655	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
656	 SIGTYPE=sv4 CHECKPW=sec LOGINPW=sec \
657	 CREATEPROTO=mmdfproto EMPTYPROTO=mmdfproto \
658	 RSHPATH=/usr/bin/rcmd \
659	 BASECFLAGS="-O3" \
660	 BASELDFLAGS="-lsocket -lprot -lcrypt_i -lx -los" \
661	 RANLIB=true LN=ln
662
663# Note: setting _POSIX_SOURCE doesn't seem to build it as of SGI IRIX 5.3
664
665sgi:	# Silicon Graphics
666	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
667	 SIGTYPE=sv4 CRXTYPE=nfs \
668	 MAILSPOOL=/usr/mail \
669	 RSHPATH=/usr/bsd/rsh \
670	 BASECFLAGS="-g3 -O2 -Olimit 8192" \
671	 RANLIB=true
672
673sg6:	# Silicon Graphics, IRIX 6.5
674	MAKEFLAGS= $(BUILD) `$(CAT) SPECIALS` OS=sgi \
675	 SIGTYPE=sv4 CRXTYPE=nfs \
676	 MAILSPOOL=/usr/mail \
677	 RSHPATH=/usr/bsd/rsh \
678	 BASECFLAGS="-g3 -O2 -OPT:Olimit=0 -woff 1110,1116" \
679	 RANLIB=true
680
681# Note: Mark Kaesling says that setluid() isn't in HP-UX with SecureWare.
682
683shp:	# HP-UX with Trusted Computer Base
684	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
685	 SIGTYPE=psx CHECKPW=sec CRXTYPE=nfs \
686	 SPOOLDIR=/var \
687	 ACTIVEFILE=/var/news/active \
688	 RSHPATH=/usr/bin/remsh \
689	 BASECFLAGS="-g -Ae" \
690	 BASELDFLAGS="-lnet -lV3 -lsec" \
691	 RANLIB=true
692
693slx:	# Secure Linux
694	@echo You are building for libc6/glibc versions of Secure Linux
695	@echo If you want libc5 versions you must use sl5 instead!
696	@echo If you want libc4 versions you must use sl4 instead!
697	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
698	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
699	 SPOOLDIR=/var/spool \
700	 ACTIVEFILE=/var/lib/news/active \
701	 RSHPATH=/usr/bin/rsh \
702	 BASECFLAGS="$(GCCCFLAGS)" \
703	 BASELDFLAGS="-lcrypt"
704
705sl4:	# Secure Linux using libc4
706	@echo You are building for libc4 versions of Secure Linux
707	@echo If you want libc6/glibc versions you must use slx instead!
708	@echo If you want libc5 versions you must use sl5 instead!
709	$(BUILD) `$(CAT) SPECIALS` OS=slx \
710	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
711	 SPOOLDIR=/var/spool \
712	 ACTIVEFILE=/var/lib/news/active \
713	 RSHPATH=/usr/bin/rsh \
714	 BASECFLAGS="$(GCCCFLAGS)" \
715	 BASELDFLAGS="-lshadow"
716
717sl5:	# Secure Linux using libc5
718	@echo You are building for libc5 versions of Secure Linux
719	@echo If you want libc6/glibc versions you must use slx instead!
720	@echo If you want libc4 versions you must use sl4 instead!
721	$(BUILD) `$(CAT) SPECIALS` OS=slx \
722	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
723	 SPOOLDIR=/var/spool \
724	 ACTIVEFILE=/var/lib/news/active \
725	 RSHPATH=/usr/bin/rsh \
726	 BASECFLAGS="$(GCCCFLAGS)"
727
728snx:	# Siemens Nixdorf SINIX and Reliant UNIX
729	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
730	 SIGTYPE=psx CHECKPW=sv4 \
731	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
732	 ACTIVEFILE=/usr/share/news/active \
733	 RSHPATH=/usr/bin/rsh \
734	 BASECFLAGS="-g -D_SYS_CLOCK_H -Dconst=" \
735	 BASELDFLAGS="-lsocket -lnsl -lgen" \
736	 RANLIB=true
737
738# Sorry about the -w, but the cretinous SUN Workshop Pro C compiler barfs on
739# implicit casts between char and unsigned char.
740
741soc:	os_sol.h	# Solaris with cc
742	$(BUILD) `$(CAT) SPECIALS` OS=sol \
743	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
744	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
745	 ACTIVEFILE=/usr/share/news/active \
746	 RSHPATH=/usr/bin/rsh \
747	 BASECFLAGS="-g -O -w" \
748	 BASELDFLAGS="-lsocket -lnsl -lgen -R/usr/local/ssl/lib" \
749	 RANLIB=true CC=/opt/SUNWspro/bin/cc
750
751
752# Note: It is a long and disgusting story about why cc is set to ucbcc.  You
753# need to invoke the C compiler so that it links with the SVR4 libraries and
754# not the BSD libraries, otherwise readdir() will return the wrong information.
755# Of all the names in the most common path, ucbcc is the only name to be found
756# (on /usr/ccs/bin) that points to a suitable compiler.  cc is likely to be
757# /usr/ucb/cc which is absolutely not the compiler that you want.  The real
758# SVR4 cc is probably something like /opt/SUNWspro/bin/cc which is rarely in
759# anyone's path.
760#
761# ucbcc is probably a link to acc, e.g. /opt/SUNWspro/SC4.0/bin/acc, and is
762# the UCB C compiler using the SVR4 libraries.
763#
764# If ucbcc isn't on your system, then punt on the SUN C compiler and use gcc
765# instead (the gso port instead of the sol port).
766#
767# If, in spite of all the above warnings, you choose to use the "soc" port
768# instead of the "sol" port, be sure to check the behavior of the LIST command
769# in imapd.  Also, note that the "soc" port uses -O.  If you want to use the
770# real SVR4 compiler, you must use -O.  If it works to compile with -O2, then
771# cc is probably using the UCB compiler with BSD libraries, and will not build
772# a good binary
773#
774# To recap:
775# 1) The sol port is designed to be built using the UCB compiler using the
776#    SVR4 libraries.  This compiler is "ucbcc", which is lunk to acc.  You
777#    use -O2 as one of the CFLAGS.
778# 2) If you build the sol port with the UCB compiler using the BSD libraries,
779#    you will get no error messages but you will get bad binaries (the most
780#    obvious symptom is dropping the first two characters return filenames
781#    from the imapd LIST command.  This compiler also uses -O2, and is very
782#    often what the user gets from "cc".  BEWARE!!!
783# 3) If you build the sol port with the real SVR4 compiler, which is often
784#    hidden away or unavailable on many systems, then you will get errors
785#    from -O2 and you need to change that to -O.  But you will get a good
786#    binary.  However, you should try it with -O2 first, to make sure that
787#    you got this compiler and not the UCB compiler using BSD libraries.
788
789sol:	os_sol.h	# Solaris
790	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
791	 SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
792	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
793	 ACTIVEFILE=/usr/share/news/active \
794	 RSHPATH=/usr/bin/rsh \
795	 BASECFLAGS="-g -O2" \
796	 BASELDFLAGS="-lsocket -lnsl -lgen -R/usr/local/ssl/lib" \
797	 RANLIB=true CC=ucbcc
798
799sos:	# Secure OSF/1
800	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
801	 SIGTYPE=psx CHECKPW=sce LOGINPW=sec CRXTYPE=nfs \
802	 BASECFLAGS="-g3 -w -O2 -Olimit 1500" \
803	 BASELDFLAGS="-lsecurity -laud"
804
805ssn:	# Secure SUN-OS
806	$(BUILD) `$(CAT) SPECIALS` OS=sun \
807	 CHECKPW=ssn CRXTYPE=nfs \
808	 BASECFLAGS="-g -Dconst=" \
809	 BASELDFLAGS="-ldl"
810
811sua:	# Windows Vista Subsystem for UNIX Applications
812	$(BUILD) `$(CAT) SPECIALS` OS=sua \
813	 SIGTYPE=psx CRXTYPE=nfs LOGINPW=old \
814	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
815	 ACTIVEFILE=/var/lib/news/active \
816	 RSHPATH=/usr/bin/rsh \
817	 BASECFLAGS="-g -O2" \
818	 BASELDFLAGS="-lcrypt"
819
820sun:	# SUN-OS
821	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
822	 CRXTYPE=nfs \
823	 BASECFLAGS="-g -Dconst=" \
824	 BASELDFLAGS="-ldl"
825
826sv2:	# SVR2
827	@echo You are being *very* optimistic!
828	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
829	 SIGTYPE=sv4 LOGINPW=old \
830	 MAILSPOOL=/usr/mail \
831	 RSHPATH=/usr/bin/remsh \
832	 BASECFLAGS="-Dconst= -DSYSTEM5 -DSHORT_IDENT -I/usr/ethernet/include" \
833	 BASELDFLAGS="-lnet" \
834	 RANLIB=true LN=ln
835
836sv4:	# SVR4
837	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
838	 SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
839	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
840	 ACTIVEFILE=/usr/share/news/active \
841	 RSHPATH=/usr/bin/resh \
842	 BASECFLAGS="-g -Dconst=" \
843	 BASELDFLAGS="-lsocket -lnsl -lgen" \
844	 RANLIB=true
845
846ult:	# Ultrix
847	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
848	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
849	 BASECFLAGS="-g3 -O2 -Olimit 1500 -Dconst=" \
850	 BASELDFLAGS="-lauth -lc"
851
852uw2:	# UnixWare SVR4.2
853	$(BUILD) `$(CAT) SPECIALS` OS=sv4 \
854	 SIGTYPE=sv4 CHECKPW=sv4 \
855	 SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
856	 ACTIVEFILE=/var/news/lib/active \
857	 RSHPATH=/usr/bin/rsh \
858	 BASECFLAGS="-g" \
859	 BASELDFLAGS="-lsocket -lnsl -lgen" \
860	 RANLIB=true
861
862vul:	# VAX Ultrix
863	$(BUILD) `$(CAT) SPECIALS` OS=ult \
864	 SIGTYPE=psx CHECKPW=ult CRXTYPE=nfs \
865	 BASECFLAGS="-O2 -Dconst=" \
866	 BASELDFLAGS="-lauth -lc"
867
868vu2:	# VAX Ultrix 2.3, etc.
869	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
870	 CRXTYPE=nfs \
871	 BASECFLAGS="-O2 -Dconst= -Dvoid=char"
872
873
874# Build it!
875
876build:	clean once $(ARCHIVE)
877
878all:	onceenv
879
880$(ARCHIVE): $(BINARIES)
881	sh -c '$(RM) $(ARCHIVE) || true'
882	@$(CAT) ./ARCHIVE
883	@$(SH) ./ARCHIVE
884
885.c.o:
886	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
887
888
889# Cleanup
890
891clean:
892	sh -c '$(RM) auths.c crexcl.c ip_unix.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
893
894
895# Dependencies
896
897dummy.o: mail.h misc.h osdep.h dummy.h
898fdstring.o: mail.h misc.h osdep.h fdstring.h
899flstring.o: mail.h misc.h osdep.h flstring.h
900imap4r1.o: mail.h misc.h osdep.h imap4r1.h rfc822.h
901mail.o: mail.h misc.h osdep.h rfc822.h linkage.h
902mbx.o: mail.h misc.h osdep.h dummy.h
903mh.o: mail.h misc.h osdep.h dummy.h
904mix.o: mail.h misc.h osdep.h dummy.h
905mx.o: mail.h misc.h osdep.h dummy.h
906misc.o: mail.h misc.h osdep.h
907mmdf.o: mail.h misc.h osdep.h pseudo.h dummy.h
908mtx.o: mail.h misc.h osdep.h dummy.h
909netmsg.o: mail.h misc.h osdep.h netmsg.h
910news.o: mail.h misc.h osdep.h
911newsrc.o: mail.h misc.h osdep.h newsrc.h
912nntp.o: mail.h misc.h osdep.h netmsg.h smtp.h nntp.h rfc822.h
913phile.o: mail.h misc.h osdep.h rfc822.h dummy.h
914pseudo.o: pseudo.h
915pop3.o: mail.h misc.h osdep.h rfc822.h
916smanager.o: mail.h misc.h osdep.h
917smtp.o: mail.h misc.h osdep.h smtp.h rfc822.h
918rfc822.o: mail.h misc.h osdep.h rfc822.h
919tenex.o: mail.h misc.h osdep.h dummy.h
920unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
921utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
922utf8aux.o: mail.h misc.h osdep.h utf8.h
923
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 \
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_pla.c \
935	pmatch.c scandir.c setpgrp.c strerror.c truncate.c write.c \
936	memmove.c memmove2.c memset.c \
937	tz_bsd.c tz_nul.c tz_sv4.c \
938	write.c sslstdio.c \
939	strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
940	OSCFLAGS
941	@echo Building OS-dependent module
942	@echo If you get No such file error messages for files x509.h, ssl.h,
943	@echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
944	@echo is not installed on your system.  Either install OpenSSL first
945	@echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
946	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
947
948osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
949	$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
950
951osdepbas.c:
952	@echo osdepbas.c not found...try make clean and new make
953	@false
954
955osdepckp.c:
956	@echo osdepckp.c not found...try make clean and new make
957	@false
958
959osdeplog.c:
960	@echo osdeplog.c not found...try make clean and new make
961	@false
962
963osdepssl.c:
964	@echo osdepssl.c not found...try make clean and new make
965	@false
966
967siglocal.c:
968	@echo siglocal.c not found...try make clean and new make
969	@false
970
971crexcl.c:
972	@echo crexcl.c not found...do make clean and new make
973	@false
974
975ip_unix.c:
976	@echo ip_unix.c not found...do make clean and new make
977	@false
978
979os_sol.h:
980	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'
981
982
983# Once-only environment setup
984
985once:	onceenv ckp$(PASSWDTYPE) ssl$(SSLTYPE) osdep.c
986
987onceenv:
988	@echo Once-only environment setup...
989	echo $(CC) > CCTYPE
990	echo $(BASECFLAGS) '$(EXTRACFLAGS)' -DCHUNKSIZE=$(CHUNKSIZE) > CFLAGS
991	echo -DCREATEPROTO=$(CREATEPROTO) -DEMPTYPROTO=$(EMPTYPROTO) \
992	 -DMD5ENABLE=\"$(MD5PWD)\" -DMAILSPOOL=\"$(MAILSPOOL)\" \
993	 -DANONYMOUSHOME=\"$(MAILSPOOL)/anonymous\" \
994	 -DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
995	 -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" \
996	 -DLOCKPGM1=\"$(LOCKPGM1)\" -DLOCKPGM2=\"$(LOCKPGM2)\" \
997	 -DLOCKPGM3=\"$(LOCKPGM3)\" > OSCFLAGS
998	echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
999	echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
1000	echo $(OS) > OSTYPE
1001	./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
1002	./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
1003	echo "  mail_versioncheck (CCLIENTVERSION);" >> linkage.c
1004	$(LN) os_$(OS).h osdep.h
1005	$(LN) os_$(OS).c osdepbas.c
1006	$(LN) log_$(LOGINPW).c osdeplog.c
1007	$(LN) sig_$(SIGTYPE).c siglocal.c
1008	$(LN) crx_$(CRXTYPE).c crexcl.c
1009	$(LN) ip$(IP)_unix.c ip_unix.c
1010	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'
1011
1012
1013# Password checkers
1014
1015ckpafs:	# AFS
1016	@echo AFS password authentication
1017	echo $(AFSCFLAGS) >> OSCFLAGS
1018#	echo $(AFSLDFLAGS) >> LDFLAGS
1019# Note: Steve Roseman says that AFS libraries have to be lunk before SSL
1020	echo $(AFSLDFLAGS) `$(CAT) LDFLAGS` > LDFLAGS.tmp
1021	mv LDFLAGS.tmp LDFLAGS
1022	$(LN) ckp_afs.c osdepckp.c
1023
1024ckpdce:	# DCE
1025	@echo DCE password authentication
1026	echo $(DCECFLAGS) >> OSCFLAGS
1027	echo $(DCELDFLAGS) >> LDFLAGS
1028	$(LN) ckp_dce.c osdepckp.c
1029
1030ckpgss:	# Kerberos V (must have gss EXTRAAUTHENTICATOR as well)
1031	@echo Kerberos V password authentication
1032	$(LN) ckp_gss.c osdepckp.c
1033
1034ckpnul:	# NUL authenticator (disables all plaintext authentication)
1035	@echo Plaintext authentication prohibited
1036	echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 1);" >> linkage.c
1037	$(LN) ckp_nul.c osdepckp.c
1038
1039ckppam:	# Pluggable Authentication Modules authenticator
1040	@echo PAM password authentication
1041	echo $(PAMLDFLAGS) >> LDFLAGS
1042	$(LN) ckp_pam.c osdepckp.c
1043
1044ckppmb:	# Broken (e.g. SUN) Pluggable Authentication Modules authenticator
1045	@echo Broken PAM password authentication
1046	echo $(PAMLDFLAGS) >> LDFLAGS
1047	$(LN) ckp_pmb.c osdepckp.c
1048
1049ckpstd:	# Port standard
1050	@echo Standard password authentication
1051	$(LN) ckp_$(CHECKPW).c osdepckp.c
1052
1053ckptwo:	# Something plus standard
1054	@echo $(CHECKPWALT) password authentication first, then standard
1055	$(CAT) ckp_1st.c ckp_$(CHECKPWALT).c ckp_2nd.c ckp_$(CHECKPW).c \
1056	 ckp_3rd.c > osdepckp.c
1057
1058
1059# SSL support
1060
1061sslnone:# No SSL
1062	@echo Building without SSL support
1063	$(LN) ssl_none.c osdepssl.c
1064
1065sslnopwd: sslunix snopwd
1066
1067sslunix.nopwd: sslnopwd
1068
1069sslsco.nopwd: sslsco snopwd
1070
1071sslunix: sbasic sldunix
1072
1073sslsco:	sbasic sldsco
1074
1075sbasic:	# UNIX OpenSSL
1076	@echo Building with SSL
1077	$(LN) ssl_unix.c osdepssl.c
1078	echo $(SSLCFLAGS) >> OSCFLAGS
1079	echo "  ssl_onceonlyinit ();" >> linkage.c
1080
1081snopwd:	# Plaintext disable
1082	@echo Building with SSL and plaintext passwords disabled unless SSL/TLS
1083	echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 2);" >> linkage.c
1084
1085sldunix:# Normal UNIX SSL load flags
1086	echo $(SSLLDFLAGS) >> LDFLAGS
1087
1088
1089sldsco:	# SCO SSL load flags
1090# Note: Tim Rice says that SSL has to be lunk before other libraries on SCO.
1091	echo $(SSLLDFLAGS) `cat LDFLAGS` > LDFLAGS.tmp
1092	mv LDFLAGS.tmp LDFLAGS
1093
1094
1095# A monument to a hack of long ago and far away...
1096
1097love:
1098	@echo not war?
1099