xref: /onnv-gate/usr/src/common/openssl/crypto/des/des-lib.com (revision 0:68f95e015346)
1*0Sstevel@tonic-gate$!
2*0Sstevel@tonic-gate$!  DES-LIB.COM
3*0Sstevel@tonic-gate$!  Written By:  Robert Byer
4*0Sstevel@tonic-gate$!               Vice-President
5*0Sstevel@tonic-gate$!               A-Com Computing, Inc.
6*0Sstevel@tonic-gate$!               byer@mail.all-net.net
7*0Sstevel@tonic-gate$!
8*0Sstevel@tonic-gate$!  Changes by Richard Levitte <richard@levitte.org>
9*0Sstevel@tonic-gate$!
10*0Sstevel@tonic-gate$!  This command files compiles and creates the
11*0Sstevel@tonic-gate$!  "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" library.  The "xxx" denotes the machine
12*0Sstevel@tonic-gate$!  architecture of AXP or VAX.
13*0Sstevel@tonic-gate$!
14*0Sstevel@tonic-gate$!  It was re-written to try to determine which "C" compiler to try to use
15*0Sstevel@tonic-gate$!  or the user can specify a compiler in P3.
16*0Sstevel@tonic-gate$!
17*0Sstevel@tonic-gate$!  Specify one of the following to build just that part, specify "ALL" to
18*0Sstevel@tonic-gate$!  just build everything.
19*0Sstevel@tonic-gate$!
20*0Sstevel@tonic-gate$!         ALL       To Just Build "Everything".
21*0Sstevel@tonic-gate$!         LIBRARY   To Just Build The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library.
22*0Sstevel@tonic-gate$!         DESTEST   To Just Build The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program.
23*0Sstevel@tonic-gate$!         SPEED     To Just Build The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program.
24*0Sstevel@tonic-gate$!         RPW       To Just Build The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program.
25*0Sstevel@tonic-gate$!         DES       To Just Build The [.xxx.EXE.CRYPTO.DES]DES.EXE Program.
26*0Sstevel@tonic-gate$!         DES_OPTS  To Just Build The [.xxx.EXE.CRYPTO.DES]DES_OPTS.EXE Program.
27*0Sstevel@tonic-gate$!
28*0Sstevel@tonic-gate$!  Specify either DEBUG or NODEBUG as P2 to compile with or without
29*0Sstevel@tonic-gate$!  debugging information.
30*0Sstevel@tonic-gate$!
31*0Sstevel@tonic-gate$!  Specify which compiler at P3 to try to compile under.
32*0Sstevel@tonic-gate$!
33*0Sstevel@tonic-gate$!	   VAXC	 For VAX C.
34*0Sstevel@tonic-gate$!	   DECC	 For DEC C.
35*0Sstevel@tonic-gate$!	   GNUC	 For GNU C.
36*0Sstevel@tonic-gate$!
37*0Sstevel@tonic-gate$!  If you don't speficy a compiler, it will try to determine which
38*0Sstevel@tonic-gate$!  "C" compiler to try to use.
39*0Sstevel@tonic-gate$!
40*0Sstevel@tonic-gate$!  P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
41*0Sstevel@tonic-gate$!
42*0Sstevel@tonic-gate$!
43*0Sstevel@tonic-gate$! Make sure we know what architecture we run on.
44*0Sstevel@tonic-gate$!
45*0Sstevel@tonic-gate$!
46*0Sstevel@tonic-gate$! Check Which Architecture We Are Using.
47*0Sstevel@tonic-gate$!
48*0Sstevel@tonic-gate$ IF (F$GETSYI("CPU").GE.128)
49*0Sstevel@tonic-gate$ THEN
50*0Sstevel@tonic-gate$!
51*0Sstevel@tonic-gate$!  The Architecture Is AXP.
52*0Sstevel@tonic-gate$!
53*0Sstevel@tonic-gate$   ARCH := AXP
54*0Sstevel@tonic-gate$!
55*0Sstevel@tonic-gate$! Else...
56*0Sstevel@tonic-gate$!
57*0Sstevel@tonic-gate$ ELSE
58*0Sstevel@tonic-gate$!
59*0Sstevel@tonic-gate$!  The Architecture Is VAX.
60*0Sstevel@tonic-gate$!
61*0Sstevel@tonic-gate$   ARCH := VAX
62*0Sstevel@tonic-gate$!
63*0Sstevel@tonic-gate$! End The Architecture Check.
64*0Sstevel@tonic-gate$!
65*0Sstevel@tonic-gate$ ENDIF
66*0Sstevel@tonic-gate$!
67*0Sstevel@tonic-gate$! Check To Make Sure We Have Valid Command Line Parameters.
68*0Sstevel@tonic-gate$!
69*0Sstevel@tonic-gate$ GOSUB CHECK_OPTIONS
70*0Sstevel@tonic-gate$!
71*0Sstevel@tonic-gate$! Tell The User What Kind of Machine We Run On.
72*0Sstevel@tonic-gate$!
73*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
74*0Sstevel@tonic-gate$!
75*0Sstevel@tonic-gate$! Define The OBJ Directory Name.
76*0Sstevel@tonic-gate$!
77*0Sstevel@tonic-gate$ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES]
78*0Sstevel@tonic-gate$!
79*0Sstevel@tonic-gate$! Check To See If The Architecture Specific OBJ Directory Exists.
80*0Sstevel@tonic-gate$!
81*0Sstevel@tonic-gate$ IF (F$PARSE(OBJ_DIR).EQS."")
82*0Sstevel@tonic-gate$ THEN
83*0Sstevel@tonic-gate$!
84*0Sstevel@tonic-gate$!  It Dosen't Exist, So Create It.
85*0Sstevel@tonic-gate$!
86*0Sstevel@tonic-gate$   CREATE/DIR 'OBJ_DIR'
87*0Sstevel@tonic-gate$!
88*0Sstevel@tonic-gate$! End The Architecture Specific OBJ Directory Check.
89*0Sstevel@tonic-gate$!
90*0Sstevel@tonic-gate$ ENDIF
91*0Sstevel@tonic-gate$!
92*0Sstevel@tonic-gate$! Define The EXE Directory Name.
93*0Sstevel@tonic-gate$!
94*0Sstevel@tonic-gate$ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES]
95*0Sstevel@tonic-gate$!
96*0Sstevel@tonic-gate$! Check To See If The Architecture Specific Directory Exists.
97*0Sstevel@tonic-gate$!
98*0Sstevel@tonic-gate$ IF (F$PARSE(EXE_DIR).EQS."")
99*0Sstevel@tonic-gate$ THEN
100*0Sstevel@tonic-gate$!
101*0Sstevel@tonic-gate$!  It Dosen't Exist, So Create It.
102*0Sstevel@tonic-gate$!
103*0Sstevel@tonic-gate$   CREATE/DIR 'EXE_DIR'
104*0Sstevel@tonic-gate$!
105*0Sstevel@tonic-gate$! End The Architecture Specific Directory Check.
106*0Sstevel@tonic-gate$!
107*0Sstevel@tonic-gate$ ENDIF
108*0Sstevel@tonic-gate$!
109*0Sstevel@tonic-gate$! Define The Library Name.
110*0Sstevel@tonic-gate$!
111*0Sstevel@tonic-gate$ LIB_NAME := 'EXE_DIR'LIBDES.OLB
112*0Sstevel@tonic-gate$!
113*0Sstevel@tonic-gate$! Check To See What We Are To Do.
114*0Sstevel@tonic-gate$!
115*0Sstevel@tonic-gate$ IF (BUILDALL.EQS."TRUE")
116*0Sstevel@tonic-gate$ THEN
117*0Sstevel@tonic-gate$!
118*0Sstevel@tonic-gate$!  Since Nothing Special Was Specified, Do Everything.
119*0Sstevel@tonic-gate$!
120*0Sstevel@tonic-gate$   GOSUB LIBRARY
121*0Sstevel@tonic-gate$   GOSUB DESTEST
122*0Sstevel@tonic-gate$   GOSUB SPEED
123*0Sstevel@tonic-gate$   GOSUB RPW
124*0Sstevel@tonic-gate$   GOSUB DES
125*0Sstevel@tonic-gate$   GOSUB DES_OPTS
126*0Sstevel@tonic-gate$!
127*0Sstevel@tonic-gate$! Else...
128*0Sstevel@tonic-gate$!
129*0Sstevel@tonic-gate$ ELSE
130*0Sstevel@tonic-gate$!
131*0Sstevel@tonic-gate$!    Build Just What The User Wants Us To Build.
132*0Sstevel@tonic-gate$!
133*0Sstevel@tonic-gate$     GOSUB 'BUILDALL'
134*0Sstevel@tonic-gate$!
135*0Sstevel@tonic-gate$! End The BUILDALL Check.
136*0Sstevel@tonic-gate$!
137*0Sstevel@tonic-gate$ ENDIF
138*0Sstevel@tonic-gate$!
139*0Sstevel@tonic-gate$! Time To EXIT.
140*0Sstevel@tonic-gate$!
141*0Sstevel@tonic-gate$ EXIT
142*0Sstevel@tonic-gate$ LIBRARY:
143*0Sstevel@tonic-gate$!
144*0Sstevel@tonic-gate$! Tell The User That We Are Compiling.
145*0Sstevel@tonic-gate$!
146*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files."
147*0Sstevel@tonic-gate$!
148*0Sstevel@tonic-gate$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" Library...
149*0Sstevel@tonic-gate$!
150*0Sstevel@tonic-gate$ IF (F$SEARCH(LIB_NAME).EQS."")
151*0Sstevel@tonic-gate$ THEN
152*0Sstevel@tonic-gate$!
153*0Sstevel@tonic-gate$! Guess Not, Create The Library.
154*0Sstevel@tonic-gate$!
155*0Sstevel@tonic-gate$   LIBRARY/CREATE/OBJECT 'LIB_NAME'
156*0Sstevel@tonic-gate$!
157*0Sstevel@tonic-gate$! End The Library Exist Check.
158*0Sstevel@tonic-gate$!
159*0Sstevel@tonic-gate$ ENDIF
160*0Sstevel@tonic-gate$!
161*0Sstevel@tonic-gate$! Define The DES Library Files.
162*0Sstevel@tonic-gate$!
163*0Sstevel@tonic-gate$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
164*0Sstevel@tonic-gate		"ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
165*0Sstevel@tonic-gate		"enc_read,enc_writ,ofb64enc,"+ -
166*0Sstevel@tonic-gate		"ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
167*0Sstevel@tonic-gate		"des_enc,fcrypt_b,read2pwd,"+ -
168*0Sstevel@tonic-gate		"fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp"
169*0Sstevel@tonic-gate$!
170*0Sstevel@tonic-gate$!  Define A File Counter And Set It To "0".
171*0Sstevel@tonic-gate$!
172*0Sstevel@tonic-gate$ FILE_COUNTER = 0
173*0Sstevel@tonic-gate$!
174*0Sstevel@tonic-gate$! Top Of The File Loop.
175*0Sstevel@tonic-gate$!
176*0Sstevel@tonic-gate$ NEXT_FILE:
177*0Sstevel@tonic-gate$!
178*0Sstevel@tonic-gate$! O.K, Extract The File Name From The File List.
179*0Sstevel@tonic-gate$!
180*0Sstevel@tonic-gate$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_DES)
181*0Sstevel@tonic-gate$!
182*0Sstevel@tonic-gate$! Check To See If We Are At The End Of The File List.
183*0Sstevel@tonic-gate$!
184*0Sstevel@tonic-gate$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
185*0Sstevel@tonic-gate$!
186*0Sstevel@tonic-gate$! Increment The Counter.
187*0Sstevel@tonic-gate$!
188*0Sstevel@tonic-gate$ FILE_COUNTER = FILE_COUNTER + 1
189*0Sstevel@tonic-gate$!
190*0Sstevel@tonic-gate$! Create The Source File Name.
191*0Sstevel@tonic-gate$!
192*0Sstevel@tonic-gate$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
193*0Sstevel@tonic-gate$!
194*0Sstevel@tonic-gate$!  Tell The User We Are Compiling The Source File.
195*0Sstevel@tonic-gate$!
196*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "	",FILE_NAME,".C"
197*0Sstevel@tonic-gate$!
198*0Sstevel@tonic-gate$! Create The Object File Name.
199*0Sstevel@tonic-gate$!
200*0Sstevel@tonic-gate$ OBJECT_FILE = OBJ_DIR + FILE_NAME + "." + ARCH + "OBJ"
201*0Sstevel@tonic-gate$ ON WARNING THEN GOTO NEXT_FILE
202*0Sstevel@tonic-gate$!
203*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
204*0Sstevel@tonic-gate$!
205*0Sstevel@tonic-gate$ IF (F$SEARCH(SOURCE_FILE).EQS."")
206*0Sstevel@tonic-gate$ THEN
207*0Sstevel@tonic-gate$!
208*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
209*0Sstevel@tonic-gate$!
210*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
211*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
212*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
213*0Sstevel@tonic-gate$!
214*0Sstevel@tonic-gate$!  Exit The Build.
215*0Sstevel@tonic-gate$!
216*0Sstevel@tonic-gate$   EXIT
217*0Sstevel@tonic-gate$!
218*0Sstevel@tonic-gate$! End The File Exists Check.
219*0Sstevel@tonic-gate$!
220*0Sstevel@tonic-gate$ ENDIF
221*0Sstevel@tonic-gate$!
222*0Sstevel@tonic-gate$! Compile The File.
223*0Sstevel@tonic-gate$!
224*0Sstevel@tonic-gate$ ON ERROR THEN GOTO NEXT_FILE
225*0Sstevel@tonic-gate$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
226*0Sstevel@tonic-gate$!
227*0Sstevel@tonic-gate$! Add It To The Library.
228*0Sstevel@tonic-gate$!
229*0Sstevel@tonic-gate$ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE'
230*0Sstevel@tonic-gate$!
231*0Sstevel@tonic-gate$! Time To Clean Up The Object File.
232*0Sstevel@tonic-gate$!
233*0Sstevel@tonic-gate$ DELETE 'OBJECT_FILE';*
234*0Sstevel@tonic-gate$!
235*0Sstevel@tonic-gate$! Go Back And Do It Again.
236*0Sstevel@tonic-gate$!
237*0Sstevel@tonic-gate$ GOTO NEXT_FILE
238*0Sstevel@tonic-gate$!
239*0Sstevel@tonic-gate$! All Done With This Library Part.
240*0Sstevel@tonic-gate$!
241*0Sstevel@tonic-gate$ FILE_DONE:
242*0Sstevel@tonic-gate$!
243*0Sstevel@tonic-gate$! Tell The User That We Are All Done.
244*0Sstevel@tonic-gate$!
245*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built."
246*0Sstevel@tonic-gate$!
247*0Sstevel@tonic-gate$! All Done, Time To Return.
248*0Sstevel@tonic-gate$!
249*0Sstevel@tonic-gate$ RETURN
250*0Sstevel@tonic-gate$!
251*0Sstevel@tonic-gate$!  Compile The DESTEST Program.
252*0Sstevel@tonic-gate$!
253*0Sstevel@tonic-gate$ DESTEST:
254*0Sstevel@tonic-gate$!
255*0Sstevel@tonic-gate$! Check To See If We Have The Proper Libraries.
256*0Sstevel@tonic-gate$!
257*0Sstevel@tonic-gate$ GOSUB LIB_CHECK
258*0Sstevel@tonic-gate$!
259*0Sstevel@tonic-gate$! Check To See If We Have A Linker Option File.
260*0Sstevel@tonic-gate$!
261*0Sstevel@tonic-gate$ GOSUB CHECK_OPT_FILE
262*0Sstevel@tonic-gate$!
263*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
264*0Sstevel@tonic-gate$!
265*0Sstevel@tonic-gate$ IF (F$SEARCH("SYS$DISK:[]DESTEST.C").EQS."")
266*0Sstevel@tonic-gate$ THEN
267*0Sstevel@tonic-gate$!
268*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
269*0Sstevel@tonic-gate$!
270*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
271*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File DESTEST.C Dosen't Exist."
272*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
273*0Sstevel@tonic-gate$!
274*0Sstevel@tonic-gate$!  Exit The Build.
275*0Sstevel@tonic-gate$!
276*0Sstevel@tonic-gate$   EXIT
277*0Sstevel@tonic-gate$!
278*0Sstevel@tonic-gate$! End The DESTEST.C File Check.
279*0Sstevel@tonic-gate$!
280*0Sstevel@tonic-gate$ ENDIF
281*0Sstevel@tonic-gate$!
282*0Sstevel@tonic-gate$! Tell The User What We Are Building.
283*0Sstevel@tonic-gate$!
284*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DESTEST.EXE"
285*0Sstevel@tonic-gate$!
286*0Sstevel@tonic-gate$! Compile The DESTEST Program.
287*0Sstevel@tonic-gate$!
288*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'DESTEST.OBJ SYS$DISK:[]DESTEST.C
289*0Sstevel@tonic-gate$!
290*0Sstevel@tonic-gate$! Link The DESTEST Program.
291*0Sstevel@tonic-gate$!
292*0Sstevel@tonic-gate$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DESTEST.EXE -
293*0Sstevel@tonic-gate      'OBJ_DIR'DESTEST.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
294*0Sstevel@tonic-gate$!
295*0Sstevel@tonic-gate$! All Done, Time To Return.
296*0Sstevel@tonic-gate$!
297*0Sstevel@tonic-gate$ RETURN
298*0Sstevel@tonic-gate$!
299*0Sstevel@tonic-gate$!  Compile The SPEED Program.
300*0Sstevel@tonic-gate$!
301*0Sstevel@tonic-gate$ SPEED:
302*0Sstevel@tonic-gate$!
303*0Sstevel@tonic-gate$! Check To See If We Have The Proper Libraries.
304*0Sstevel@tonic-gate$!
305*0Sstevel@tonic-gate$ GOSUB LIB_CHECK
306*0Sstevel@tonic-gate$!
307*0Sstevel@tonic-gate$! Check To See If We Have A Linker Option File.
308*0Sstevel@tonic-gate$!
309*0Sstevel@tonic-gate$ GOSUB CHECK_OPT_FILE
310*0Sstevel@tonic-gate$!
311*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
312*0Sstevel@tonic-gate$!
313*0Sstevel@tonic-gate$ IF (F$SEARCH("SYS$DISK:[]SPEED.C").EQS."")
314*0Sstevel@tonic-gate$ THEN
315*0Sstevel@tonic-gate$!
316*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
317*0Sstevel@tonic-gate$!
318*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
319*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File SPEED.C Dosen't Exist."
320*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
321*0Sstevel@tonic-gate$!
322*0Sstevel@tonic-gate$!  Exit The Build.
323*0Sstevel@tonic-gate$!
324*0Sstevel@tonic-gate$   EXIT
325*0Sstevel@tonic-gate$!
326*0Sstevel@tonic-gate$! End The SPEED.C File Check.
327*0Sstevel@tonic-gate$!
328*0Sstevel@tonic-gate$ ENDIF
329*0Sstevel@tonic-gate$!
330*0Sstevel@tonic-gate$! Tell The User What We Are Building.
331*0Sstevel@tonic-gate$!
332*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"SPEED.EXE"
333*0Sstevel@tonic-gate$!
334*0Sstevel@tonic-gate$! Compile The SPEED Program.
335*0Sstevel@tonic-gate$!
336*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'SPEED.OBJ SYS$DISK:[]SPEED.C
337*0Sstevel@tonic-gate$!
338*0Sstevel@tonic-gate$! Link The SPEED Program.
339*0Sstevel@tonic-gate$!
340*0Sstevel@tonic-gate$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'SPEED.EXE -
341*0Sstevel@tonic-gate      'OBJ_DIR'SPEED.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
342*0Sstevel@tonic-gate$!
343*0Sstevel@tonic-gate$! All Done, Time To Return.
344*0Sstevel@tonic-gate$!
345*0Sstevel@tonic-gate$ RETURN
346*0Sstevel@tonic-gate$!
347*0Sstevel@tonic-gate$!  Compile The RPW Program.
348*0Sstevel@tonic-gate$!
349*0Sstevel@tonic-gate$ RPW:
350*0Sstevel@tonic-gate$!
351*0Sstevel@tonic-gate$! Check To See If We Have The Proper Libraries.
352*0Sstevel@tonic-gate$!
353*0Sstevel@tonic-gate$ GOSUB LIB_CHECK
354*0Sstevel@tonic-gate$!
355*0Sstevel@tonic-gate$! Check To See If We Have A Linker Option File.
356*0Sstevel@tonic-gate$!
357*0Sstevel@tonic-gate$ GOSUB CHECK_OPT_FILE
358*0Sstevel@tonic-gate$!
359*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
360*0Sstevel@tonic-gate$!
361*0Sstevel@tonic-gate$ IF (F$SEARCH("SYS$DISK:[]RPW.C").EQS."")
362*0Sstevel@tonic-gate$ THEN
363*0Sstevel@tonic-gate$!
364*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
365*0Sstevel@tonic-gate$!
366*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
367*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File RPW.C Dosen't Exist."
368*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
369*0Sstevel@tonic-gate$!
370*0Sstevel@tonic-gate$!  Exit The Build.
371*0Sstevel@tonic-gate$!
372*0Sstevel@tonic-gate$   EXIT
373*0Sstevel@tonic-gate$!
374*0Sstevel@tonic-gate$! End The RPW.C File Check.
375*0Sstevel@tonic-gate$!
376*0Sstevel@tonic-gate$ ENDIF
377*0Sstevel@tonic-gate$!
378*0Sstevel@tonic-gate$! Tell The User What We Are Building.
379*0Sstevel@tonic-gate$!
380*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RPW.EXE"
381*0Sstevel@tonic-gate$!
382*0Sstevel@tonic-gate$! Compile The RPW Program.
383*0Sstevel@tonic-gate$!
384*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'RPW.OBJ SYS$DISK:[]RPW.C
385*0Sstevel@tonic-gate$!
386*0Sstevel@tonic-gate$! Link The RPW Program.
387*0Sstevel@tonic-gate$!
388*0Sstevel@tonic-gate$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'RPW.EXE -
389*0Sstevel@tonic-gate      'OBJ_DIR'RPW.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
390*0Sstevel@tonic-gate$!
391*0Sstevel@tonic-gate$! All Done, Time To Return.
392*0Sstevel@tonic-gate$!
393*0Sstevel@tonic-gate$ RETURN
394*0Sstevel@tonic-gate$!
395*0Sstevel@tonic-gate$!  Compile The DES Program.
396*0Sstevel@tonic-gate$!
397*0Sstevel@tonic-gate$ DES:
398*0Sstevel@tonic-gate$!
399*0Sstevel@tonic-gate$! Check To See If We Have The Proper Libraries.
400*0Sstevel@tonic-gate$!
401*0Sstevel@tonic-gate$ GOSUB LIB_CHECK
402*0Sstevel@tonic-gate$!
403*0Sstevel@tonic-gate$! Check To See If We Have A Linker Option File.
404*0Sstevel@tonic-gate$!
405*0Sstevel@tonic-gate$ GOSUB CHECK_OPT_FILE
406*0Sstevel@tonic-gate$!
407*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
408*0Sstevel@tonic-gate$!
409*0Sstevel@tonic-gate$ IF (F$SEARCH("SYS$DISK:[]DES.C").EQS."")
410*0Sstevel@tonic-gate$ THEN
411*0Sstevel@tonic-gate$!
412*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
413*0Sstevel@tonic-gate$!
414*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
415*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File DES.C Dosen't Exist."
416*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
417*0Sstevel@tonic-gate$!
418*0Sstevel@tonic-gate$!  Exit The Build.
419*0Sstevel@tonic-gate$!
420*0Sstevel@tonic-gate$   EXIT
421*0Sstevel@tonic-gate$!
422*0Sstevel@tonic-gate$! End The DES.C File Check.
423*0Sstevel@tonic-gate$!
424*0Sstevel@tonic-gate$ ENDIF
425*0Sstevel@tonic-gate$!
426*0Sstevel@tonic-gate$! Tell The User What We Are Building.
427*0Sstevel@tonic-gate$!
428*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES.EXE"
429*0Sstevel@tonic-gate$!
430*0Sstevel@tonic-gate$! Compile The DES Program.
431*0Sstevel@tonic-gate$!
432*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]DES.C
433*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]CBC3_ENC.C
434*0Sstevel@tonic-gate$!
435*0Sstevel@tonic-gate$! Link The DES Program.
436*0Sstevel@tonic-gate$!
437*0Sstevel@tonic-gate$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES.EXE -
438*0Sstevel@tonic-gate      'OBJ_DIR'DES.OBJ,'OBJ_DIR'CBC3_ENC.OBJ,-
439*0Sstevel@tonic-gate      'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
440*0Sstevel@tonic-gate$!
441*0Sstevel@tonic-gate$! All Done, Time To Return.
442*0Sstevel@tonic-gate$!
443*0Sstevel@tonic-gate$ RETURN
444*0Sstevel@tonic-gate$!
445*0Sstevel@tonic-gate$!  Compile The DES_OPTS Program.
446*0Sstevel@tonic-gate$!
447*0Sstevel@tonic-gate$ DES_OPTS:
448*0Sstevel@tonic-gate$!
449*0Sstevel@tonic-gate$! Check To See If We Have The Proper Libraries.
450*0Sstevel@tonic-gate$!
451*0Sstevel@tonic-gate$ GOSUB LIB_CHECK
452*0Sstevel@tonic-gate$!
453*0Sstevel@tonic-gate$! Check To See If We Have A Linker Option File.
454*0Sstevel@tonic-gate$!
455*0Sstevel@tonic-gate$ GOSUB CHECK_OPT_FILE
456*0Sstevel@tonic-gate$!
457*0Sstevel@tonic-gate$! Check To See If The File We Want To Compile Actually Exists.
458*0Sstevel@tonic-gate$!
459*0Sstevel@tonic-gate$ IF (F$SEARCH("SYS$DISK:[]DES_OPTS.C").EQS."")
460*0Sstevel@tonic-gate$ THEN
461*0Sstevel@tonic-gate$!
462*0Sstevel@tonic-gate$!  Tell The User That The File Dosen't Exist.
463*0Sstevel@tonic-gate$!
464*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
465*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The File DES_OPTS.C Dosen't Exist."
466*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
467*0Sstevel@tonic-gate$!
468*0Sstevel@tonic-gate$!  Exit The Build.
469*0Sstevel@tonic-gate$!
470*0Sstevel@tonic-gate$   EXIT
471*0Sstevel@tonic-gate$!
472*0Sstevel@tonic-gate$! End The DES_OPTS.C File Check.
473*0Sstevel@tonic-gate$!
474*0Sstevel@tonic-gate$ ENDIF
475*0Sstevel@tonic-gate$!
476*0Sstevel@tonic-gate$! Tell The User What We Are Building.
477*0Sstevel@tonic-gate$!
478*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES_OPTS.EXE"
479*0Sstevel@tonic-gate$!
480*0Sstevel@tonic-gate$! Compile The DES_OPTS Program.
481*0Sstevel@tonic-gate$!
482*0Sstevel@tonic-gate$ CC/OBJECT='OBJ_DIR'DES_OPTS.OBJ SYS$DISK:[]DES_OPTS.C
483*0Sstevel@tonic-gate$!
484*0Sstevel@tonic-gate$! Link The DES_OPTS Program.
485*0Sstevel@tonic-gate$!
486*0Sstevel@tonic-gate$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES_OPTS.EXE -
487*0Sstevel@tonic-gate      'OBJ_DIR'DES_OPTS.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
488*0Sstevel@tonic-gate$!
489*0Sstevel@tonic-gate$! All Done, Time To Return.
490*0Sstevel@tonic-gate$!
491*0Sstevel@tonic-gate$ RETURN
492*0Sstevel@tonic-gate$ EXIT
493*0Sstevel@tonic-gate$!
494*0Sstevel@tonic-gate$! Check For The Link Option FIle.
495*0Sstevel@tonic-gate$!
496*0Sstevel@tonic-gate$ CHECK_OPT_FILE:
497*0Sstevel@tonic-gate$!
498*0Sstevel@tonic-gate$! Check To See If We Need To Make A VAX C Option File.
499*0Sstevel@tonic-gate$!
500*0Sstevel@tonic-gate$ IF (COMPILER.EQS."VAXC")
501*0Sstevel@tonic-gate$ THEN
502*0Sstevel@tonic-gate$!
503*0Sstevel@tonic-gate$!  Check To See If We Already Have A VAX C Linker Option File.
504*0Sstevel@tonic-gate$!
505*0Sstevel@tonic-gate$   IF (F$SEARCH(OPT_FILE).EQS."")
506*0Sstevel@tonic-gate$   THEN
507*0Sstevel@tonic-gate$!
508*0Sstevel@tonic-gate$!    We Need A VAX C Linker Option File.
509*0Sstevel@tonic-gate$!
510*0Sstevel@tonic-gate$     CREATE 'OPT_FILE'
511*0Sstevel@tonic-gate$DECK
512*0Sstevel@tonic-gate!
513*0Sstevel@tonic-gate! Default System Options File To Link Agianst
514*0Sstevel@tonic-gate! The Sharable VAX C Runtime Library.
515*0Sstevel@tonic-gate!
516*0Sstevel@tonic-gateSYS$SHARE:VAXCRTL.EXE/SHARE
517*0Sstevel@tonic-gate$EOD
518*0Sstevel@tonic-gate$!
519*0Sstevel@tonic-gate$!  End The Option File Check.
520*0Sstevel@tonic-gate$!
521*0Sstevel@tonic-gate$   ENDIF
522*0Sstevel@tonic-gate$!
523*0Sstevel@tonic-gate$! End The VAXC Check.
524*0Sstevel@tonic-gate$!
525*0Sstevel@tonic-gate$ ENDIF
526*0Sstevel@tonic-gate$!
527*0Sstevel@tonic-gate$! Check To See If We Need A GNU C Option File.
528*0Sstevel@tonic-gate$!
529*0Sstevel@tonic-gate$ IF (COMPILER.EQS."GNUC")
530*0Sstevel@tonic-gate$ THEN
531*0Sstevel@tonic-gate$!
532*0Sstevel@tonic-gate$!  Check To See If We Already Have A GNU C Linker Option File.
533*0Sstevel@tonic-gate$!
534*0Sstevel@tonic-gate$   IF (F$SEARCH(OPT_FILE).EQS."")
535*0Sstevel@tonic-gate$   THEN
536*0Sstevel@tonic-gate$!
537*0Sstevel@tonic-gate$!    We Need A GNU C Linker Option File.
538*0Sstevel@tonic-gate$!
539*0Sstevel@tonic-gate$     CREATE 'OPT_FILE'
540*0Sstevel@tonic-gate$DECK
541*0Sstevel@tonic-gate!
542*0Sstevel@tonic-gate! Default System Options File To Link Agianst
543*0Sstevel@tonic-gate! The Sharable C Runtime Library.
544*0Sstevel@tonic-gate!
545*0Sstevel@tonic-gateGNU_CC:[000000]GCCLIB/LIBRARY
546*0Sstevel@tonic-gateSYS$SHARE:VAXCRTL/SHARE
547*0Sstevel@tonic-gate$EOD
548*0Sstevel@tonic-gate$!
549*0Sstevel@tonic-gate$!  End The Option File Check.
550*0Sstevel@tonic-gate$!
551*0Sstevel@tonic-gate$   ENDIF
552*0Sstevel@tonic-gate$!
553*0Sstevel@tonic-gate$! End The GNU C Check.
554*0Sstevel@tonic-gate$!
555*0Sstevel@tonic-gate$ ENDIF
556*0Sstevel@tonic-gate$!
557*0Sstevel@tonic-gate$! Check To See If We Need A DEC C Option File.
558*0Sstevel@tonic-gate$!
559*0Sstevel@tonic-gate$ IF (COMPILER.EQS."DECC")
560*0Sstevel@tonic-gate$ THEN
561*0Sstevel@tonic-gate$!
562*0Sstevel@tonic-gate$!  Check To See If We Already Have A DEC C Linker Option File.
563*0Sstevel@tonic-gate$!
564*0Sstevel@tonic-gate$   IF (F$SEARCH(OPT_FILE).EQS."")
565*0Sstevel@tonic-gate$   THEN
566*0Sstevel@tonic-gate$!
567*0Sstevel@tonic-gate$!    Figure Out If We Need An AXP Or A VAX Linker Option File.
568*0Sstevel@tonic-gate$!
569*0Sstevel@tonic-gate$     IF (F$GETSYI("CPU").LT.128)
570*0Sstevel@tonic-gate$     THEN
571*0Sstevel@tonic-gate$!
572*0Sstevel@tonic-gate$!      We Need A DEC C Linker Option File For VAX.
573*0Sstevel@tonic-gate$!
574*0Sstevel@tonic-gate$       CREATE 'OPT_FILE'
575*0Sstevel@tonic-gate$DECK
576*0Sstevel@tonic-gate!
577*0Sstevel@tonic-gate! Default System Options File To Link Agianst
578*0Sstevel@tonic-gate! The Sharable DEC C Runtime Library.
579*0Sstevel@tonic-gate!
580*0Sstevel@tonic-gateSYS$SHARE:DECC$SHR.EXE/SHARE
581*0Sstevel@tonic-gate$EOD
582*0Sstevel@tonic-gate$!
583*0Sstevel@tonic-gate$!    Else...
584*0Sstevel@tonic-gate$!
585*0Sstevel@tonic-gate$     ELSE
586*0Sstevel@tonic-gate$!
587*0Sstevel@tonic-gate$!      Create The AXP Linker Option File.
588*0Sstevel@tonic-gate$!
589*0Sstevel@tonic-gate$       CREATE 'OPT_FILE'
590*0Sstevel@tonic-gate$DECK
591*0Sstevel@tonic-gate!
592*0Sstevel@tonic-gate! Default System Options File For AXP To Link Agianst
593*0Sstevel@tonic-gate! The Sharable C Runtime Library.
594*0Sstevel@tonic-gate!
595*0Sstevel@tonic-gateSYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
596*0Sstevel@tonic-gateSYS$SHARE:CMA$OPEN_RTL/SHARE
597*0Sstevel@tonic-gate$EOD
598*0Sstevel@tonic-gate$!
599*0Sstevel@tonic-gate$!    End The VAX/AXP DEC C Option File Check.
600*0Sstevel@tonic-gate$!
601*0Sstevel@tonic-gate$     ENDIF
602*0Sstevel@tonic-gate$!
603*0Sstevel@tonic-gate$!  End The Option File Search.
604*0Sstevel@tonic-gate$!
605*0Sstevel@tonic-gate$   ENDIF
606*0Sstevel@tonic-gate$!
607*0Sstevel@tonic-gate$! End The DEC C Check.
608*0Sstevel@tonic-gate$!
609*0Sstevel@tonic-gate$ ENDIF
610*0Sstevel@tonic-gate$!
611*0Sstevel@tonic-gate$!  Tell The User What Linker Option File We Are Using.
612*0Sstevel@tonic-gate$!
613*0Sstevel@tonic-gate$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
614*0Sstevel@tonic-gate$!
615*0Sstevel@tonic-gate$! Time To RETURN.
616*0Sstevel@tonic-gate$!
617*0Sstevel@tonic-gate$ RETURN
618*0Sstevel@tonic-gate$!
619*0Sstevel@tonic-gate$! Library Check.
620*0Sstevel@tonic-gate$!
621*0Sstevel@tonic-gate$ LIB_CHECK:
622*0Sstevel@tonic-gate$!
623*0Sstevel@tonic-gate$!  Look For The Library LIBDES.OLB.
624*0Sstevel@tonic-gate$!
625*0Sstevel@tonic-gate$ IF (F$SEARCH(LIB_NAME).EQS."")
626*0Sstevel@tonic-gate$ THEN
627*0Sstevel@tonic-gate$!
628*0Sstevel@tonic-gate$!    Tell The User We Can't Find The [.xxx.CRYPTO.DES]LIBDES.OLB Library.
629*0Sstevel@tonic-gate$!
630*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
631*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"."
632*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "We Can't Link Without It."
633*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
634*0Sstevel@tonic-gate$!
635*0Sstevel@tonic-gate$!    Since We Can't Link Without It, Exit.
636*0Sstevel@tonic-gate$!
637*0Sstevel@tonic-gate$   EXIT
638*0Sstevel@tonic-gate$ ENDIF
639*0Sstevel@tonic-gate$!
640*0Sstevel@tonic-gate$! Time To Return.
641*0Sstevel@tonic-gate$!
642*0Sstevel@tonic-gate$ RETURN
643*0Sstevel@tonic-gate$!
644*0Sstevel@tonic-gate$! Check The User's Options.
645*0Sstevel@tonic-gate$!
646*0Sstevel@tonic-gate$ CHECK_OPTIONS:
647*0Sstevel@tonic-gate$!
648*0Sstevel@tonic-gate$! Check To See If We Are To "Just Build Everything".
649*0Sstevel@tonic-gate$!
650*0Sstevel@tonic-gate$ IF (P1.EQS."ALL")
651*0Sstevel@tonic-gate$ THEN
652*0Sstevel@tonic-gate$!
653*0Sstevel@tonic-gate$!   P1 Is "ALL", So Build Everything.
654*0Sstevel@tonic-gate$!
655*0Sstevel@tonic-gate$    BUILDALL = "TRUE"
656*0Sstevel@tonic-gate$!
657*0Sstevel@tonic-gate$! Else...
658*0Sstevel@tonic-gate$!
659*0Sstevel@tonic-gate$ ELSE
660*0Sstevel@tonic-gate$!
661*0Sstevel@tonic-gate$!  Else, Check To See If P1 Has A Valid Arguement.
662*0Sstevel@tonic-gate$!
663*0Sstevel@tonic-gate$   IF (P1.EQS."LIBRARY").OR.(P1.EQS."DESTEST").OR.(P1.EQS."SPEED") -
664*0Sstevel@tonic-gate       .OR.(P1.EQS."RPW").OR.(P1.EQS."DES").OR.(P1.EQS."DES_OPTS")
665*0Sstevel@tonic-gate$   THEN
666*0Sstevel@tonic-gate$!
667*0Sstevel@tonic-gate$!    A Valid Arguement.
668*0Sstevel@tonic-gate$!
669*0Sstevel@tonic-gate$     BUILDALL = P1
670*0Sstevel@tonic-gate$!
671*0Sstevel@tonic-gate$!  Else...
672*0Sstevel@tonic-gate$!
673*0Sstevel@tonic-gate$   ELSE
674*0Sstevel@tonic-gate$!
675*0Sstevel@tonic-gate$!    Tell The User We Don't Know What They Want.
676*0Sstevel@tonic-gate$!
677*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
678*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "The Option ",P1," Is Invalid.  The Valid Options Are:"
679*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
680*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    ALL      :  Just Build Everything.
681*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    LIBRARY  :  To Compile Just The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library."
682*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    DESTEST  :  To Compile Just The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program."
683*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    SPEED    :  To Compile Just The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program."
684*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    RPW      :  To Compile Just The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program."
685*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    DES      :  To Compile Just The [.xxx.EXE.CRYPTO.DES]DES.EXE Program."
686*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    DES_OPTS :  To Compile Just The [.xxx.EXE.CRYTPO.DES]DES_OPTS.EXE Program."
687*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
688*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT " Where 'xxx' Stands For: "
689*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
690*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "        AXP  :  Alpha Architecture."
691*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "        VAX  :  VAX Architecture."
692*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
693*0Sstevel@tonic-gate$!
694*0Sstevel@tonic-gate$!    Time To EXIT.
695*0Sstevel@tonic-gate$!
696*0Sstevel@tonic-gate$     EXIT
697*0Sstevel@tonic-gate$!
698*0Sstevel@tonic-gate$!  End The Valid Arguement Check.
699*0Sstevel@tonic-gate$!
700*0Sstevel@tonic-gate$   ENDIF
701*0Sstevel@tonic-gate$!
702*0Sstevel@tonic-gate$! End The P1 Check.
703*0Sstevel@tonic-gate$!
704*0Sstevel@tonic-gate$ ENDIF
705*0Sstevel@tonic-gate$!
706*0Sstevel@tonic-gate$! Check To See If We Are To Compile Without Debugger Information.
707*0Sstevel@tonic-gate$!
708*0Sstevel@tonic-gate$ IF (P2.EQS."NODEBUG")
709*0Sstevel@tonic-gate$ THEN
710*0Sstevel@tonic-gate$!
711*0Sstevel@tonic-gate$!   P2 Is Blank, So Compile Without Debugger Information.
712*0Sstevel@tonic-gate$!
713*0Sstevel@tonic-gate$    DEBUGGER  = "NODEBUG"
714*0Sstevel@tonic-gate$    TRACEBACK = "NOTRACEBACK"
715*0Sstevel@tonic-gate$    GCC_OPTIMIZE = "OPTIMIZE"
716*0Sstevel@tonic-gate$    CC_OPTIMIZE = "OPTIMIZE"
717*0Sstevel@tonic-gate$    WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
718*0Sstevel@tonic-gate$    WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
719*0Sstevel@tonic-gate$!
720*0Sstevel@tonic-gate$! Else...
721*0Sstevel@tonic-gate$!
722*0Sstevel@tonic-gate$ ELSE
723*0Sstevel@tonic-gate$!
724*0Sstevel@tonic-gate$!  Check To See If We Are To Compile With Debugger Information.
725*0Sstevel@tonic-gate$!
726*0Sstevel@tonic-gate$   IF (P2.EQS."DEBUG")
727*0Sstevel@tonic-gate$   THEN
728*0Sstevel@tonic-gate$!
729*0Sstevel@tonic-gate$!    Compile With Debugger Information.
730*0Sstevel@tonic-gate$!
731*0Sstevel@tonic-gate$     DEBUGGER  = "DEBUG"
732*0Sstevel@tonic-gate$     TRACEBACK = "TRACEBACK"
733*0Sstevel@tonic-gate$     GCC_OPTIMIZE = "NOOPTIMIZE"
734*0Sstevel@tonic-gate$     CC_OPTIMIZE = "NOOPTIMIZE"
735*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
736*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
737*0Sstevel@tonic-gate$!
738*0Sstevel@tonic-gate$!  Else...
739*0Sstevel@tonic-gate$!
740*0Sstevel@tonic-gate$   ELSE
741*0Sstevel@tonic-gate$!
742*0Sstevel@tonic-gate$!    Tell The User Entered An Invalid Option..
743*0Sstevel@tonic-gate$!
744*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
745*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "The Option ",P2," Is Invalid.  The Valid Options Are:"
746*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
747*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    DEBUG    :  Compile With The Debugger Information."
748*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "    NODEBUG  :  Compile Without The Debugger Information."
749*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT ""
750*0Sstevel@tonic-gate$!
751*0Sstevel@tonic-gate$!    Time To EXIT.
752*0Sstevel@tonic-gate$!
753*0Sstevel@tonic-gate$     EXIT
754*0Sstevel@tonic-gate$!
755*0Sstevel@tonic-gate$!  End The Valid Arguement Check.
756*0Sstevel@tonic-gate$!
757*0Sstevel@tonic-gate$   ENDIF
758*0Sstevel@tonic-gate$!
759*0Sstevel@tonic-gate$! End The P2 Check.
760*0Sstevel@tonic-gate$!
761*0Sstevel@tonic-gate$ ENDIF
762*0Sstevel@tonic-gate$!
763*0Sstevel@tonic-gate$! Special Threads For OpenVMS v7.1 Or Later.
764*0Sstevel@tonic-gate$!
765*0Sstevel@tonic-gate$! Written By:  Richard Levitte
766*0Sstevel@tonic-gate$!              richard@levitte.org
767*0Sstevel@tonic-gate$!
768*0Sstevel@tonic-gate$!
769*0Sstevel@tonic-gate$! Check To See If We Have A Option For P4.
770*0Sstevel@tonic-gate$!
771*0Sstevel@tonic-gate$ IF (P4.EQS."")
772*0Sstevel@tonic-gate$ THEN
773*0Sstevel@tonic-gate$!
774*0Sstevel@tonic-gate$!  Get The Version Of VMS We Are Using.
775*0Sstevel@tonic-gate$!
776*0Sstevel@tonic-gate$   ISSEVEN := ""
777*0Sstevel@tonic-gate$   TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
778*0Sstevel@tonic-gate$   TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
779*0Sstevel@tonic-gate$!
780*0Sstevel@tonic-gate$!  Check To See If The VMS Version Is v7.1 Or Later.
781*0Sstevel@tonic-gate$!
782*0Sstevel@tonic-gate$   IF (TMP.GE.71)
783*0Sstevel@tonic-gate$   THEN
784*0Sstevel@tonic-gate$!
785*0Sstevel@tonic-gate$!    We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
786*0Sstevel@tonic-gate$!
787*0Sstevel@tonic-gate$     ISSEVEN := ,PTHREAD_USE_D4
788*0Sstevel@tonic-gate$!
789*0Sstevel@tonic-gate$!  End The VMS Version Check.
790*0Sstevel@tonic-gate$!
791*0Sstevel@tonic-gate$   ENDIF
792*0Sstevel@tonic-gate$!
793*0Sstevel@tonic-gate$! End The P4 Check.
794*0Sstevel@tonic-gate$!
795*0Sstevel@tonic-gate$ ENDIF
796*0Sstevel@tonic-gate$!
797*0Sstevel@tonic-gate$! Check To See If P3 Is Blank.
798*0Sstevel@tonic-gate$!
799*0Sstevel@tonic-gate$ IF (P3.EQS."")
800*0Sstevel@tonic-gate$ THEN
801*0Sstevel@tonic-gate$!
802*0Sstevel@tonic-gate$!  O.K., The User Didn't Specify A Compiler, Let's Try To
803*0Sstevel@tonic-gate$!  Find Out Which One To Use.
804*0Sstevel@tonic-gate$!
805*0Sstevel@tonic-gate$!  Check To See If We Have GNU C.
806*0Sstevel@tonic-gate$!
807*0Sstevel@tonic-gate$   IF (F$TRNLNM("GNU_CC").NES."")
808*0Sstevel@tonic-gate$   THEN
809*0Sstevel@tonic-gate$!
810*0Sstevel@tonic-gate$!    Looks Like GNUC, Set To Use GNUC.
811*0Sstevel@tonic-gate$!
812*0Sstevel@tonic-gate$     P3 = "GNUC"
813*0Sstevel@tonic-gate$!
814*0Sstevel@tonic-gate$!  Else...
815*0Sstevel@tonic-gate$!
816*0Sstevel@tonic-gate$   ELSE
817*0Sstevel@tonic-gate$!
818*0Sstevel@tonic-gate$!    Check To See If We Have VAXC Or DECC.
819*0Sstevel@tonic-gate$!
820*0Sstevel@tonic-gate$     IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
821*0Sstevel@tonic-gate$     THEN
822*0Sstevel@tonic-gate$!
823*0Sstevel@tonic-gate$!      Looks Like DECC, Set To Use DECC.
824*0Sstevel@tonic-gate$!
825*0Sstevel@tonic-gate$       P3 = "DECC"
826*0Sstevel@tonic-gate$!
827*0Sstevel@tonic-gate$!    Else...
828*0Sstevel@tonic-gate$!
829*0Sstevel@tonic-gate$     ELSE
830*0Sstevel@tonic-gate$!
831*0Sstevel@tonic-gate$!      Looks Like VAXC, Set To Use VAXC.
832*0Sstevel@tonic-gate$!
833*0Sstevel@tonic-gate$       P3 = "VAXC"
834*0Sstevel@tonic-gate$!
835*0Sstevel@tonic-gate$!    End The VAXC Compiler Check.
836*0Sstevel@tonic-gate$!
837*0Sstevel@tonic-gate$     ENDIF
838*0Sstevel@tonic-gate$!
839*0Sstevel@tonic-gate$!  End The DECC & VAXC Compiler Check.
840*0Sstevel@tonic-gate$!
841*0Sstevel@tonic-gate$   ENDIF
842*0Sstevel@tonic-gate$!
843*0Sstevel@tonic-gate$!  End The Compiler Check.
844*0Sstevel@tonic-gate$!
845*0Sstevel@tonic-gate$ ENDIF
846*0Sstevel@tonic-gate$!
847*0Sstevel@tonic-gate$! Set Up Initial CC Definitions, Possibly With User Ones
848*0Sstevel@tonic-gate$!
849*0Sstevel@tonic-gate$ CCDEFS = ""
850*0Sstevel@tonic-gate$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = USER_CCDEFS
851*0Sstevel@tonic-gate$ CCEXTRAFLAGS = ""
852*0Sstevel@tonic-gate$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
853*0Sstevel@tonic-gate$ CCDISABLEWARNINGS = ""
854*0Sstevel@tonic-gate$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
855*0Sstevel@tonic-gate	CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS
856*0Sstevel@tonic-gate$!
857*0Sstevel@tonic-gate$!  Check To See If The User Entered A Valid Paramter.
858*0Sstevel@tonic-gate$!
859*0Sstevel@tonic-gate$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
860*0Sstevel@tonic-gate$ THEN
861*0Sstevel@tonic-gate$!
862*0Sstevel@tonic-gate$!    Check To See If The User Wanted DECC.
863*0Sstevel@tonic-gate$!
864*0Sstevel@tonic-gate$   IF (P3.EQS."DECC")
865*0Sstevel@tonic-gate$   THEN
866*0Sstevel@tonic-gate$!
867*0Sstevel@tonic-gate$!    Looks Like DECC, Set To Use DECC.
868*0Sstevel@tonic-gate$!
869*0Sstevel@tonic-gate$     COMPILER = "DECC"
870*0Sstevel@tonic-gate$!
871*0Sstevel@tonic-gate$!    Tell The User We Are Using DECC.
872*0Sstevel@tonic-gate$!
873*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
874*0Sstevel@tonic-gate$!
875*0Sstevel@tonic-gate$!    Use DECC...
876*0Sstevel@tonic-gate$!
877*0Sstevel@tonic-gate$     CC = "CC"
878*0Sstevel@tonic-gate$     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
879*0Sstevel@tonic-gate	 THEN CC = "CC/DECC"
880*0Sstevel@tonic-gate$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
881*0Sstevel@tonic-gate           "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS
882*0Sstevel@tonic-gate$!
883*0Sstevel@tonic-gate$!    Define The Linker Options File Name.
884*0Sstevel@tonic-gate$!
885*0Sstevel@tonic-gate$     OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
886*0Sstevel@tonic-gate$!
887*0Sstevel@tonic-gate$!  End DECC Check.
888*0Sstevel@tonic-gate$!
889*0Sstevel@tonic-gate$   ENDIF
890*0Sstevel@tonic-gate$!
891*0Sstevel@tonic-gate$!  Check To See If We Are To Use VAXC.
892*0Sstevel@tonic-gate$!
893*0Sstevel@tonic-gate$   IF (P3.EQS."VAXC")
894*0Sstevel@tonic-gate$   THEN
895*0Sstevel@tonic-gate$!
896*0Sstevel@tonic-gate$!    Looks Like VAXC, Set To Use VAXC.
897*0Sstevel@tonic-gate$!
898*0Sstevel@tonic-gate$     COMPILER = "VAXC"
899*0Sstevel@tonic-gate$!
900*0Sstevel@tonic-gate$!    Tell The User We Are Using VAX C.
901*0Sstevel@tonic-gate$!
902*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
903*0Sstevel@tonic-gate$!
904*0Sstevel@tonic-gate$!    Compile Using VAXC.
905*0Sstevel@tonic-gate$!
906*0Sstevel@tonic-gate$     CC = "CC"
907*0Sstevel@tonic-gate$     IF ARCH.EQS."AXP"
908*0Sstevel@tonic-gate$     THEN
909*0Sstevel@tonic-gate$	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
910*0Sstevel@tonic-gate$	EXIT
911*0Sstevel@tonic-gate$     ENDIF
912*0Sstevel@tonic-gate$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
913*0Sstevel@tonic-gate$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
914*0Sstevel@tonic-gate$     CCDEFS = """VAXC""," + CCDEFS
915*0Sstevel@tonic-gate$!
916*0Sstevel@tonic-gate$!    Define <sys> As SYS$COMMON:[SYSLIB]
917*0Sstevel@tonic-gate$!
918*0Sstevel@tonic-gate$     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
919*0Sstevel@tonic-gate$!
920*0Sstevel@tonic-gate$!    Define The Linker Options File Name.
921*0Sstevel@tonic-gate$!
922*0Sstevel@tonic-gate$     OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
923*0Sstevel@tonic-gate$!
924*0Sstevel@tonic-gate$!  End VAXC Check
925*0Sstevel@tonic-gate$!
926*0Sstevel@tonic-gate$   ENDIF
927*0Sstevel@tonic-gate$!
928*0Sstevel@tonic-gate$!  Check To See If We Are To Use GNU C.
929*0Sstevel@tonic-gate$!
930*0Sstevel@tonic-gate$   IF (P3.EQS."GNUC")
931*0Sstevel@tonic-gate$   THEN
932*0Sstevel@tonic-gate$!
933*0Sstevel@tonic-gate$!    Looks Like GNUC, Set To Use GNUC.
934*0Sstevel@tonic-gate$!
935*0Sstevel@tonic-gate$     COMPILER = "GNUC"
936*0Sstevel@tonic-gate$!
937*0Sstevel@tonic-gate$!    Tell The User We Are Using GNUC.
938*0Sstevel@tonic-gate$!
939*0Sstevel@tonic-gate$     WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
940*0Sstevel@tonic-gate$!
941*0Sstevel@tonic-gate$!    Use GNU C...
942*0Sstevel@tonic-gate$!
943*0Sstevel@tonic-gate$     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
944*0Sstevel@tonic-gate$!
945*0Sstevel@tonic-gate$!    Define The Linker Options File Name.
946*0Sstevel@tonic-gate$!
947*0Sstevel@tonic-gate$     OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
948*0Sstevel@tonic-gate$!
949*0Sstevel@tonic-gate$!  End The GNU C Check.
950*0Sstevel@tonic-gate$!
951*0Sstevel@tonic-gate$   ENDIF
952*0Sstevel@tonic-gate$!
953*0Sstevel@tonic-gate$!  Set up default defines
954*0Sstevel@tonic-gate$!
955*0Sstevel@tonic-gate$   CCDEFS = """FLAT_INC=1""," + CCDEFS
956*0Sstevel@tonic-gate$!
957*0Sstevel@tonic-gate$!  Finish up the definition of CC.
958*0Sstevel@tonic-gate$!
959*0Sstevel@tonic-gate$   IF COMPILER .EQS. "DECC"
960*0Sstevel@tonic-gate$   THEN
961*0Sstevel@tonic-gate$     IF CCDISABLEWARNINGS .EQS. ""
962*0Sstevel@tonic-gate$     THEN
963*0Sstevel@tonic-gate$       CC4DISABLEWARNINGS = "DOLLARID"
964*0Sstevel@tonic-gate$     ELSE
965*0Sstevel@tonic-gate$       CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
966*0Sstevel@tonic-gate$       CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
967*0Sstevel@tonic-gate$     ENDIF
968*0Sstevel@tonic-gate$     CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
969*0Sstevel@tonic-gate$   ELSE
970*0Sstevel@tonic-gate$     CCDISABLEWARNINGS = ""
971*0Sstevel@tonic-gate$     CC4DISABLEWARNINGS = ""
972*0Sstevel@tonic-gate$   ENDIF
973*0Sstevel@tonic-gate$   CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
974*0Sstevel@tonic-gate$!
975*0Sstevel@tonic-gate$!  Show user the result
976*0Sstevel@tonic-gate$!
977*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "Main Compiling Command: ",CC
978*0Sstevel@tonic-gate$!
979*0Sstevel@tonic-gate$!  Else The User Entered An Invalid Arguement.
980*0Sstevel@tonic-gate$!
981*0Sstevel@tonic-gate$ ELSE
982*0Sstevel@tonic-gate$!
983*0Sstevel@tonic-gate$!  Tell The User We Don't Know What They Want.
984*0Sstevel@tonic-gate$!
985*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
986*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "The Option ",P3," Is Invalid.  The Valid Options Are:"
987*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
988*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "    VAXC  :  To Compile With VAX C."
989*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "    DECC  :  To Compile With DEC C."
990*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT "    GNUC  :  To Compile With GNU C."
991*0Sstevel@tonic-gate$   WRITE SYS$OUTPUT ""
992*0Sstevel@tonic-gate$!
993*0Sstevel@tonic-gate$!  Time To EXIT.
994*0Sstevel@tonic-gate$!
995*0Sstevel@tonic-gate$   EXIT
996*0Sstevel@tonic-gate$!
997*0Sstevel@tonic-gate$! End The P3 Check.
998*0Sstevel@tonic-gate$!
999*0Sstevel@tonic-gate$ ENDIF
1000*0Sstevel@tonic-gate$!
1001*0Sstevel@tonic-gate$!  Time To RETURN...
1002*0Sstevel@tonic-gate$!
1003*0Sstevel@tonic-gate$ RETURN
1004