xref: /minix3/crypto/external/bsd/openssl/dist/apps/makeapps.com (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc$!
2ebfedea0SLionel Sambuc$!  MAKEAPPS.COM
3ebfedea0SLionel Sambuc$!  Written By:  Robert Byer
4ebfedea0SLionel Sambuc$!               Vice-President
5ebfedea0SLionel Sambuc$!               A-Com Computing, Inc.
6ebfedea0SLionel Sambuc$!               byer@mail.all-net.net
7ebfedea0SLionel Sambuc$!
8ebfedea0SLionel Sambuc$!  Changes by Richard Levitte <richard@levitte.org>
9ebfedea0SLionel Sambuc$!             Zoltan Arpadffy <zoli@polarhome.com>
10ebfedea0SLionel Sambuc$!
11ebfedea0SLionel Sambuc$!  This command files compiles and creates all the various different
12ebfedea0SLionel Sambuc$!  "application" programs for the different types of encryption for OpenSSL.
13ebfedea0SLionel Sambuc$!  The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes
14ebfedea0SLionel Sambuc$!  ALPHA, IA64 or VAX, depending on your machine architecture.
15ebfedea0SLionel Sambuc$!
16ebfedea0SLionel Sambuc$!  It was written so it would try to determine what "C" compiler to
17ebfedea0SLionel Sambuc$!  use or you can specify which "C" compiler to use.
18ebfedea0SLionel Sambuc$!
19ebfedea0SLionel Sambuc$!  Specify DEBUG or NODEBUG as P1 to compile with or without debugger
20ebfedea0SLionel Sambuc$!  information.
21ebfedea0SLionel Sambuc$!
22ebfedea0SLionel Sambuc$!  Specify which compiler at P2 to try to compile under.
23ebfedea0SLionel Sambuc$!
24ebfedea0SLionel Sambuc$!	   VAXC	 For VAX C.
25ebfedea0SLionel Sambuc$!	   DECC	 For DEC C.
26ebfedea0SLionel Sambuc$!	   GNUC	 For GNU C.
27ebfedea0SLionel Sambuc$!
28ebfedea0SLionel Sambuc$!  If you don't specify a compiler, it will try to determine which
29ebfedea0SLionel Sambuc$!  "C" compiler to use.
30ebfedea0SLionel Sambuc$!
31ebfedea0SLionel Sambuc$!  P3, if defined, sets a TCP/IP library to use, through one of the following
32ebfedea0SLionel Sambuc$!  keywords:
33ebfedea0SLionel Sambuc$!
34ebfedea0SLionel Sambuc$!	UCX		for UCX
35ebfedea0SLionel Sambuc$!	SOCKETSHR	for SOCKETSHR+NETLIB
36ebfedea0SLionel Sambuc$!	TCPIP		for TCPIP (post UCX)
37ebfedea0SLionel Sambuc$!
38ebfedea0SLionel Sambuc$!  P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
39ebfedea0SLionel Sambuc$!
40ebfedea0SLionel Sambuc$!  P5, if defined, sets a choice of programs to compile.
41ebfedea0SLionel Sambuc$!
42ebfedea0SLionel Sambuc$!  P6, if defined, specifies the C pointer size.  Ignored on VAX.
43ebfedea0SLionel Sambuc$!      ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
44ebfedea0SLionel Sambuc$!      Supported values are:
45ebfedea0SLionel Sambuc$!
46ebfedea0SLionel Sambuc$!      ""       Compile with default (/NOPOINTER_SIZE)
47ebfedea0SLionel Sambuc$!      32       Compile with /POINTER_SIZE=32 (SHORT)
48ebfedea0SLionel Sambuc$!      64       Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
49ebfedea0SLionel Sambuc$!               (Automatically select ARGV if compiler supports it.)
50ebfedea0SLionel Sambuc$!      64=      Compile with /POINTER_SIZE=64 (LONG).
51ebfedea0SLionel Sambuc$!      64=ARGV  Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
52ebfedea0SLionel Sambuc$!
53ebfedea0SLionel Sambuc$!  P7, if defined, specifies a directory where ZLIB files (zlib.h,
54ebfedea0SLionel Sambuc$!  libz.olb) may be found.  Optionally, a non-default object library
55ebfedea0SLionel Sambuc$!  name may be included ("dev:[dir]libz_64.olb", for example).
56ebfedea0SLionel Sambuc$!
57ebfedea0SLionel Sambuc$!
58ebfedea0SLionel Sambuc$! Announce/identify.
59ebfedea0SLionel Sambuc$!
60ebfedea0SLionel Sambuc$ proc = f$environment( "procedure")
61ebfedea0SLionel Sambuc$ write sys$output "@@@ "+ -
62ebfedea0SLionel Sambuc   f$parse( proc, , , "name")+ f$parse( proc, , , "type")
63ebfedea0SLionel Sambuc$!
64ebfedea0SLionel Sambuc$ on control_c then goto exit
65ebfedea0SLionel Sambuc$!
66ebfedea0SLionel Sambuc$! Define A TCP/IP Library That We Will Need To Link To.
67ebfedea0SLionel Sambuc$! (That Is, If We Need To Link To One.)
68ebfedea0SLionel Sambuc$!
69ebfedea0SLionel Sambuc$ TCPIP_LIB = ""
70ebfedea0SLionel Sambuc$ ZLIB_LIB = ""
71ebfedea0SLionel Sambuc$!
72ebfedea0SLionel Sambuc$! Check What Architecture We Are Using.
73ebfedea0SLionel Sambuc$!
74ebfedea0SLionel Sambuc$ IF (F$GETSYI("CPU").LT.128)
75ebfedea0SLionel Sambuc$ THEN
76ebfedea0SLionel Sambuc$!
77ebfedea0SLionel Sambuc$!  The Architecture Is VAX.
78ebfedea0SLionel Sambuc$!
79ebfedea0SLionel Sambuc$   ARCH = "VAX"
80ebfedea0SLionel Sambuc$!
81ebfedea0SLionel Sambuc$! Else...
82ebfedea0SLionel Sambuc$!
83ebfedea0SLionel Sambuc$ ELSE
84ebfedea0SLionel Sambuc$!
85ebfedea0SLionel Sambuc$!  The Architecture Is Alpha, IA64 or whatever comes in the future.
86ebfedea0SLionel Sambuc$!
87ebfedea0SLionel Sambuc$   ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
88ebfedea0SLionel Sambuc$   IF (ARCH .EQS. "") THEN ARCH = "UNK"
89ebfedea0SLionel Sambuc$!
90ebfedea0SLionel Sambuc$! End The Architecture Check.
91ebfedea0SLionel Sambuc$!
92ebfedea0SLionel Sambuc$ ENDIF
93ebfedea0SLionel Sambuc$!
94ebfedea0SLionel Sambuc$ ARCHD = ARCH
95ebfedea0SLionel Sambuc$ LIB32 = "32"
96ebfedea0SLionel Sambuc$ OPT_FILE = ""
97ebfedea0SLionel Sambuc$ POINTER_SIZE = ""
98ebfedea0SLionel Sambuc$!
99ebfedea0SLionel Sambuc$! Define what programs should be compiled
100ebfedea0SLionel Sambuc$!
101ebfedea0SLionel Sambuc$ PROGRAMS := OPENSSL
102ebfedea0SLionel Sambuc$!
103ebfedea0SLionel Sambuc$! Check To Make Sure We Have Valid Command Line Parameters.
104ebfedea0SLionel Sambuc$!
105ebfedea0SLionel Sambuc$ GOSUB CHECK_OPTIONS
106ebfedea0SLionel Sambuc$!
107ebfedea0SLionel Sambuc$! Define The CRYPTO Library.
108ebfedea0SLionel Sambuc$!
109ebfedea0SLionel Sambuc$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
110ebfedea0SLionel Sambuc$!
111ebfedea0SLionel Sambuc$! Define The SSL Library.
112ebfedea0SLionel Sambuc$!
113ebfedea0SLionel Sambuc$ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB
114ebfedea0SLionel Sambuc$!
115ebfedea0SLionel Sambuc$! Define The OBJ and EXE Directories.
116ebfedea0SLionel Sambuc$!
117ebfedea0SLionel Sambuc$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.APPS]
118ebfedea0SLionel Sambuc$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.APPS]
119ebfedea0SLionel Sambuc$!
120ebfedea0SLionel Sambuc$! Specify the destination directory in any /MAP option.
121ebfedea0SLionel Sambuc$!
122ebfedea0SLionel Sambuc$ if (LINKMAP .eqs. "MAP")
123ebfedea0SLionel Sambuc$ then
124ebfedea0SLionel Sambuc$   LINKMAP = LINKMAP+ "=''EXE_DIR'"
125ebfedea0SLionel Sambuc$ endif
126ebfedea0SLionel Sambuc$!
127ebfedea0SLionel Sambuc$! Add the location prefix to the linker options file name.
128ebfedea0SLionel Sambuc$!
129ebfedea0SLionel Sambuc$ if (OPT_FILE .nes. "")
130ebfedea0SLionel Sambuc$ then
131ebfedea0SLionel Sambuc$   OPT_FILE = EXE_DIR+ OPT_FILE
132ebfedea0SLionel Sambuc$ endif
133ebfedea0SLionel Sambuc$!
134ebfedea0SLionel Sambuc$! Initialise logical names and such
135ebfedea0SLionel Sambuc$!
136ebfedea0SLionel Sambuc$ GOSUB INITIALISE
137ebfedea0SLionel Sambuc$!
138ebfedea0SLionel Sambuc$! Tell The User What Kind of Machine We Run On.
139ebfedea0SLionel Sambuc$!
140ebfedea0SLionel Sambuc$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
141ebfedea0SLionel Sambuc$!
142ebfedea0SLionel Sambuc$! Check To See If The OBJ Directory Exists.
143ebfedea0SLionel Sambuc$!
144ebfedea0SLionel Sambuc$ IF (F$PARSE(OBJ_DIR).EQS."")
145ebfedea0SLionel Sambuc$ THEN
146ebfedea0SLionel Sambuc$!
147ebfedea0SLionel Sambuc$!  It Dosen't Exist, So Create It.
148ebfedea0SLionel Sambuc$!
149ebfedea0SLionel Sambuc$   CREATE/DIRECTORY 'OBJ_DIR'
150ebfedea0SLionel Sambuc$!
151ebfedea0SLionel Sambuc$! End The OBJ Directory Check.
152ebfedea0SLionel Sambuc$!
153ebfedea0SLionel Sambuc$ ENDIF
154ebfedea0SLionel Sambuc$!
155ebfedea0SLionel Sambuc$! Check To See If The EXE Directory Exists.
156ebfedea0SLionel Sambuc$!
157ebfedea0SLionel Sambuc$ IF (F$PARSE(EXE_DIR).EQS."")
158ebfedea0SLionel Sambuc$ THEN
159ebfedea0SLionel Sambuc$!
160ebfedea0SLionel Sambuc$!  It Dosen't Exist, So Create It.
161ebfedea0SLionel Sambuc$!
162ebfedea0SLionel Sambuc$   CREATE/DIRECTORY 'EXE_DIR'
163ebfedea0SLionel Sambuc$!
164ebfedea0SLionel Sambuc$! End The EXE Directory Check.
165ebfedea0SLionel Sambuc$!
166ebfedea0SLionel Sambuc$ ENDIF
167ebfedea0SLionel Sambuc$!
168ebfedea0SLionel Sambuc$! Check To See If We Have The Proper Libraries.
169ebfedea0SLionel Sambuc$!
170ebfedea0SLionel Sambuc$ GOSUB LIB_CHECK
171ebfedea0SLionel Sambuc$!
172ebfedea0SLionel Sambuc$! Check To See If We Have A Linker Option File.
173ebfedea0SLionel Sambuc$!
174ebfedea0SLionel Sambuc$ GOSUB CHECK_OPT_FILE
175ebfedea0SLionel Sambuc$!
176ebfedea0SLionel Sambuc$! Define The Application Files.
177ebfedea0SLionel Sambuc$! NOTE: Some might think this list ugly.  However, it's made this way to
178ebfedea0SLionel Sambuc$! reflect the E_OBJ variable in Makefile as closely as possible, thereby
179ebfedea0SLionel Sambuc$! making it fairly easy to verify that the lists are the same.
180ebfedea0SLionel Sambuc$!
181ebfedea0SLionel Sambuc$ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
182ebfedea0SLionel Sambuc	     	"CA,PKCS7,CRL2P7,CRL,"+-
183ebfedea0SLionel Sambuc	      	"RSA,RSAUTL,DSA,DSAPARAM,EC,ECPARAM,"+-
184ebfedea0SLionel Sambuc	      	"X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
185ebfedea0SLionel Sambuc	      	"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
186ebfedea0SLionel Sambuc	      	"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
187ebfedea0SLionel Sambuc	      	"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP"
188ebfedea0SLionel Sambuc$!
189ebfedea0SLionel Sambuc$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
190ebfedea0SLionel Sambuc$!
191ebfedea0SLionel Sambuc$ TCPIP_PROGRAMS = ",,"
192ebfedea0SLionel Sambuc$ IF COMPILER .EQS. "VAXC" THEN -
193ebfedea0SLionel Sambuc     TCPIP_PROGRAMS = ",OPENSSL,"
194ebfedea0SLionel Sambuc$!
195ebfedea0SLionel Sambuc$! Setup exceptional compilations
196ebfedea0SLionel Sambuc$!
197ebfedea0SLionel Sambuc$ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT,"
198ebfedea0SLionel Sambuc$!
199ebfedea0SLionel Sambuc$ PHASE := LIB
200ebfedea0SLionel Sambuc$!
201ebfedea0SLionel Sambuc$ RESTART:
202ebfedea0SLionel Sambuc$!
203ebfedea0SLionel Sambuc$!  Define An App Counter And Set It To "0".
204ebfedea0SLionel Sambuc$!
205ebfedea0SLionel Sambuc$ APP_COUNTER = 0
206ebfedea0SLionel Sambuc$!
207ebfedea0SLionel Sambuc$!  Top Of The App Loop.
208ebfedea0SLionel Sambuc$!
209ebfedea0SLionel Sambuc$ NEXT_APP:
210ebfedea0SLionel Sambuc$!
211ebfedea0SLionel Sambuc$!  Make The Application File Name
212ebfedea0SLionel Sambuc$!
213ebfedea0SLionel Sambuc$ CURRENT_APP = F$EDIT(F$ELEMENT(APP_COUNTER,",",PROGRAMS),"TRIM")
214ebfedea0SLionel Sambuc$!
215ebfedea0SLionel Sambuc$!  Create The Executable File Name.
216ebfedea0SLionel Sambuc$!
217ebfedea0SLionel Sambuc$   EXE_FILE = EXE_DIR + CURRENT_APP + ".EXE"
218ebfedea0SLionel Sambuc$!
219ebfedea0SLionel Sambuc$!  Check To See If We Are At The End Of The File List.
220ebfedea0SLionel Sambuc$!
221ebfedea0SLionel Sambuc$ IF (CURRENT_APP.EQS.",")
222ebfedea0SLionel Sambuc$ THEN
223ebfedea0SLionel Sambuc$   IF (PHASE.EQS."LIB")
224ebfedea0SLionel Sambuc$   THEN
225ebfedea0SLionel Sambuc$     PHASE := APP
226ebfedea0SLionel Sambuc$     GOTO RESTART
227ebfedea0SLionel Sambuc$   ELSE
228ebfedea0SLionel Sambuc$     GOTO APP_DONE
229ebfedea0SLionel Sambuc$   ENDIF
230ebfedea0SLionel Sambuc$ ENDIF
231ebfedea0SLionel Sambuc$!
232ebfedea0SLionel Sambuc$!  Increment The Counter.
233ebfedea0SLionel Sambuc$!
234ebfedea0SLionel Sambuc$ APP_COUNTER = APP_COUNTER + 1
235ebfedea0SLionel Sambuc$!
236ebfedea0SLionel Sambuc$!  Decide if we're building the object files or not.
237ebfedea0SLionel Sambuc$!
238ebfedea0SLionel Sambuc$ IF (PHASE.EQS."LIB")
239ebfedea0SLionel Sambuc$ THEN
240ebfedea0SLionel Sambuc$!
241ebfedea0SLionel Sambuc$!  Define A Library File Counter And Set It To "-1".
242ebfedea0SLionel Sambuc$!  -1 Means The Application File Name Is To Be Used.
243ebfedea0SLionel Sambuc$!
244ebfedea0SLionel Sambuc$   LIB_COUNTER = -1
245ebfedea0SLionel Sambuc$!
246ebfedea0SLionel Sambuc$!  Create a .OPT file for the object files
247ebfedea0SLionel Sambuc$!
248ebfedea0SLionel Sambuc$   OPEN /WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT
249ebfedea0SLionel Sambuc$!
250ebfedea0SLionel Sambuc$!  Top Of The File Loop.
251ebfedea0SLionel Sambuc$!
252ebfedea0SLionel Sambuc$  NEXT_LIB:
253ebfedea0SLionel Sambuc$!
254ebfedea0SLionel Sambuc$!  O.K, Extract The File Name From The File List.
255ebfedea0SLionel Sambuc$!
256ebfedea0SLionel Sambuc$   IF LIB_COUNTER .GE. 0
257ebfedea0SLionel Sambuc$   THEN
258ebfedea0SLionel Sambuc$     FILE_NAME = F$EDIT(F$ELEMENT(LIB_COUNTER,",",LIB_'CURRENT_APP'),"TRIM")
259ebfedea0SLionel Sambuc$   ELSE
260ebfedea0SLionel Sambuc$     FILE_NAME = CURRENT_APP
261ebfedea0SLionel Sambuc$   ENDIF
262ebfedea0SLionel Sambuc$!
263ebfedea0SLionel Sambuc$!  Check To See If We Are At The End Of The File List.
264ebfedea0SLionel Sambuc$!
265ebfedea0SLionel Sambuc$   IF (FILE_NAME.EQS.",")
266ebfedea0SLionel Sambuc$   THEN
267ebfedea0SLionel Sambuc$     CLOSE OBJECTS
268ebfedea0SLionel Sambuc$     GOTO NEXT_APP
269ebfedea0SLionel Sambuc$   ENDIF
270ebfedea0SLionel Sambuc$!
271ebfedea0SLionel Sambuc$!  Increment The Counter.
272ebfedea0SLionel Sambuc$!
273ebfedea0SLionel Sambuc$   LIB_COUNTER = LIB_COUNTER + 1
274ebfedea0SLionel Sambuc$!
275ebfedea0SLionel Sambuc$!  Create The Source File Name.
276ebfedea0SLionel Sambuc$!
277ebfedea0SLionel Sambuc$   SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
278ebfedea0SLionel Sambuc$!
279ebfedea0SLionel Sambuc$!  Create The Object File Name.
280ebfedea0SLionel Sambuc$!
281ebfedea0SLionel Sambuc$   OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
282ebfedea0SLionel Sambuc$   ON WARNING THEN GOTO NEXT_LIB
283ebfedea0SLionel Sambuc$!
284ebfedea0SLionel Sambuc$!  Check To See If The File We Want To Compile Actually Exists.
285ebfedea0SLionel Sambuc$!
286ebfedea0SLionel Sambuc$   IF (F$SEARCH(SOURCE_FILE).EQS."")
287ebfedea0SLionel Sambuc$   THEN
288ebfedea0SLionel Sambuc$!
289ebfedea0SLionel Sambuc$!    Tell The User That The File Dosen't Exist.
290ebfedea0SLionel Sambuc$!
291ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
292ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
293ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
294ebfedea0SLionel Sambuc$!
295ebfedea0SLionel Sambuc$!    Exit The Build.
296ebfedea0SLionel Sambuc$!
297ebfedea0SLionel Sambuc$     GOTO EXIT
298ebfedea0SLionel Sambuc$!
299ebfedea0SLionel Sambuc$!  End The File Exist Check.
300ebfedea0SLionel Sambuc$!
301ebfedea0SLionel Sambuc$   ENDIF
302ebfedea0SLionel Sambuc$!
303ebfedea0SLionel Sambuc$!  Tell The User What We Are Building.
304ebfedea0SLionel Sambuc$!
305ebfedea0SLionel Sambuc$   IF (PHASE.EQS."LIB")
306ebfedea0SLionel Sambuc$   THEN
307ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Compiling The ",FILE_NAME,".C File."
308ebfedea0SLionel Sambuc$   ELSE
309ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Building The ",FILE_NAME," Application Program."
310ebfedea0SLionel Sambuc$   ENDIF
311ebfedea0SLionel Sambuc$!
312ebfedea0SLionel Sambuc$!  Compile The File.
313ebfedea0SLionel Sambuc$!
314ebfedea0SLionel Sambuc$   ON ERROR THEN GOTO NEXT_LIB
315ebfedea0SLionel Sambuc$   IF COMPILEWITH_CC2 - FILE_NAME .NES. COMPILEWITH_CC2
316ebfedea0SLionel Sambuc$   THEN
317ebfedea0SLionel Sambuc$     CC2/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
318ebfedea0SLionel Sambuc$   ELSE
319ebfedea0SLionel Sambuc$     CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
320ebfedea0SLionel Sambuc$   ENDIF
321ebfedea0SLionel Sambuc$   WRITE OBJECTS OBJECT_FILE
322ebfedea0SLionel Sambuc$!
323ebfedea0SLionel Sambuc$   GOTO NEXT_LIB
324ebfedea0SLionel Sambuc$ ENDIF
325ebfedea0SLionel Sambuc$!
326ebfedea0SLionel Sambuc$!  Check if this program works well without a TCPIP library
327ebfedea0SLionel Sambuc$!
328ebfedea0SLionel Sambuc$ IF TCPIP_LIB .EQS. "" .AND. TCPIP_PROGRAMS - CURRENT_APP .NES. TCPIP_PROGRAMS
329ebfedea0SLionel Sambuc$ THEN
330ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT CURRENT_APP," needs a TCP/IP library.  Can't link.  Skipping..."
331ebfedea0SLionel Sambuc$   GOTO NEXT_APP
332ebfedea0SLionel Sambuc$ ENDIF
333ebfedea0SLionel Sambuc$!
334ebfedea0SLionel Sambuc$! Link The Program.
335ebfedea0SLionel Sambuc$!
336ebfedea0SLionel Sambuc$ ON WARNING THEN GOTO NEXT_APP
337ebfedea0SLionel Sambuc$!
338ebfedea0SLionel Sambuc$! Don't Link With The RSAREF Routines And TCP/IP Library.
339ebfedea0SLionel Sambuc$!
340ebfedea0SLionel Sambuc$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_FILE' -
341ebfedea0SLionel Sambuc  'EXE_DIR''CURRENT_APP'.OPT /OPTIONS, -
342ebfedea0SLionel Sambuc  'SSL_LIB' /LIBRARY, -
343ebfedea0SLionel Sambuc  'CRYPTO_LIB' /LIBRARY -
344ebfedea0SLionel Sambuc  'TCPIP_LIB' -
345ebfedea0SLionel Sambuc  'ZLIB_LIB' -
346ebfedea0SLionel Sambuc  ,'OPT_FILE' /OPTIONS
347ebfedea0SLionel Sambuc$!
348ebfedea0SLionel Sambuc$! Go Back And Do It Again.
349ebfedea0SLionel Sambuc$!
350ebfedea0SLionel Sambuc$ GOTO NEXT_APP
351ebfedea0SLionel Sambuc$!
352ebfedea0SLionel Sambuc$! All Done With This File.
353ebfedea0SLionel Sambuc$!
354ebfedea0SLionel Sambuc$ APP_DONE:
355ebfedea0SLionel Sambuc$ EXIT:
356ebfedea0SLionel Sambuc$!
357ebfedea0SLionel Sambuc$! All Done, Time To Clean Up And Exit.
358ebfedea0SLionel Sambuc$!
359ebfedea0SLionel Sambuc$ GOSUB CLEANUP
360ebfedea0SLionel Sambuc$ EXIT
361ebfedea0SLionel Sambuc$!
362ebfedea0SLionel Sambuc$! Check For The Link Option FIle.
363ebfedea0SLionel Sambuc$!
364ebfedea0SLionel Sambuc$ CHECK_OPT_FILE:
365ebfedea0SLionel Sambuc$!
366ebfedea0SLionel Sambuc$! Check To See If We Need To Make A VAX C Option File.
367ebfedea0SLionel Sambuc$!
368ebfedea0SLionel Sambuc$ IF (COMPILER.EQS."VAXC")
369ebfedea0SLionel Sambuc$ THEN
370ebfedea0SLionel Sambuc$!
371ebfedea0SLionel Sambuc$!  Check To See If We Already Have A VAX C Linker Option File.
372ebfedea0SLionel Sambuc$!
373ebfedea0SLionel Sambuc$   IF (F$SEARCH(OPT_FILE).EQS."")
374ebfedea0SLionel Sambuc$   THEN
375ebfedea0SLionel Sambuc$!
376ebfedea0SLionel Sambuc$!    We Need A VAX C Linker Option File.
377ebfedea0SLionel Sambuc$!
378ebfedea0SLionel Sambuc$     CREATE 'OPT_FILE'
379ebfedea0SLionel Sambuc$DECK
380ebfedea0SLionel Sambuc!
381ebfedea0SLionel Sambuc! Default System Options File To Link Against
382ebfedea0SLionel Sambuc! The Sharable VAX C Runtime Library.
383ebfedea0SLionel Sambuc!
384ebfedea0SLionel SambucSYS$SHARE:VAXCRTL.EXE/SHARE
385ebfedea0SLionel Sambuc$EOD
386ebfedea0SLionel Sambuc$!
387ebfedea0SLionel Sambuc$!  End The Option File Check.
388ebfedea0SLionel Sambuc$!
389ebfedea0SLionel Sambuc$   ENDIF
390ebfedea0SLionel Sambuc$!
391ebfedea0SLionel Sambuc$! End The VAXC Check.
392ebfedea0SLionel Sambuc$!
393ebfedea0SLionel Sambuc$ ENDIF
394ebfedea0SLionel Sambuc$!
395ebfedea0SLionel Sambuc$! Check To See If We Need A GNU C Option File.
396ebfedea0SLionel Sambuc$!
397ebfedea0SLionel Sambuc$ IF (COMPILER.EQS."GNUC")
398ebfedea0SLionel Sambuc$ THEN
399ebfedea0SLionel Sambuc$!
400ebfedea0SLionel Sambuc$!  Check To See If We Already Have A GNU C Linker Option File.
401ebfedea0SLionel Sambuc$!
402ebfedea0SLionel Sambuc$   IF (F$SEARCH(OPT_FILE).EQS."")
403ebfedea0SLionel Sambuc$   THEN
404ebfedea0SLionel Sambuc$!
405ebfedea0SLionel Sambuc$!    We Need A GNU C Linker Option File.
406ebfedea0SLionel Sambuc$!
407ebfedea0SLionel Sambuc$     CREATE 'OPT_FILE'
408ebfedea0SLionel Sambuc$DECK
409ebfedea0SLionel Sambuc!
410ebfedea0SLionel Sambuc! Default System Options File To Link Against
411ebfedea0SLionel Sambuc! The Sharable C Runtime Library.
412ebfedea0SLionel Sambuc!
413ebfedea0SLionel SambucGNU_CC:[000000]GCCLIB/LIBRARY
414ebfedea0SLionel SambucSYS$SHARE:VAXCRTL/SHARE
415ebfedea0SLionel Sambuc$EOD
416ebfedea0SLionel Sambuc$!
417ebfedea0SLionel Sambuc$!  End The Option File Check.
418ebfedea0SLionel Sambuc$!
419ebfedea0SLionel Sambuc$   ENDIF
420ebfedea0SLionel Sambuc$!
421ebfedea0SLionel Sambuc$! End The GNU C Check.
422ebfedea0SLionel Sambuc$!
423ebfedea0SLionel Sambuc$ ENDIF
424ebfedea0SLionel Sambuc$!
425ebfedea0SLionel Sambuc$! Check To See If We Need A DEC C Option File.
426ebfedea0SLionel Sambuc$!
427ebfedea0SLionel Sambuc$ IF (COMPILER.EQS."DECC")
428ebfedea0SLionel Sambuc$ THEN
429ebfedea0SLionel Sambuc$!
430ebfedea0SLionel Sambuc$!  Check To See If We Already Have A DEC C Linker Option File.
431ebfedea0SLionel Sambuc$!
432ebfedea0SLionel Sambuc$   IF (F$SEARCH(OPT_FILE).EQS."")
433ebfedea0SLionel Sambuc$   THEN
434ebfedea0SLionel Sambuc$!
435ebfedea0SLionel Sambuc$!    Figure Out If We Need An AXP Or A VAX Linker Option File.
436ebfedea0SLionel Sambuc$!
437ebfedea0SLionel Sambuc$     IF ARCH.EQS."VAX"
438ebfedea0SLionel Sambuc$     THEN
439ebfedea0SLionel Sambuc$!
440ebfedea0SLionel Sambuc$!      We Need A DEC C Linker Option File For VAX.
441ebfedea0SLionel Sambuc$!
442ebfedea0SLionel Sambuc$       CREATE 'OPT_FILE'
443ebfedea0SLionel Sambuc$DECK
444ebfedea0SLionel Sambuc!
445ebfedea0SLionel Sambuc! Default System Options File To Link Against
446ebfedea0SLionel Sambuc! The Sharable DEC C Runtime Library.
447ebfedea0SLionel Sambuc!
448ebfedea0SLionel SambucSYS$SHARE:DECC$SHR.EXE/SHARE
449ebfedea0SLionel Sambuc$EOD
450ebfedea0SLionel Sambuc$!
451ebfedea0SLionel Sambuc$!    Else...
452ebfedea0SLionel Sambuc$!
453ebfedea0SLionel Sambuc$     ELSE
454ebfedea0SLionel Sambuc$!
455ebfedea0SLionel Sambuc$!      Create The non-VAX Linker Option File.
456ebfedea0SLionel Sambuc$!
457ebfedea0SLionel Sambuc$       CREATE 'OPT_FILE'
458ebfedea0SLionel Sambuc$DECK
459ebfedea0SLionel Sambuc!
460ebfedea0SLionel Sambuc! Default System Options File For non-VAX To Link Against
461ebfedea0SLionel Sambuc! The Sharable C Runtime Library.
462ebfedea0SLionel Sambuc!
463ebfedea0SLionel SambucSYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
464ebfedea0SLionel SambucSYS$SHARE:CMA$OPEN_RTL/SHARE
465ebfedea0SLionel Sambuc$EOD
466ebfedea0SLionel Sambuc$!
467ebfedea0SLionel Sambuc$!    End The DEC C Option File Check.
468ebfedea0SLionel Sambuc$!
469ebfedea0SLionel Sambuc$     ENDIF
470ebfedea0SLionel Sambuc$!
471ebfedea0SLionel Sambuc$!  End The Option File Search.
472ebfedea0SLionel Sambuc$!
473ebfedea0SLionel Sambuc$   ENDIF
474ebfedea0SLionel Sambuc$!
475ebfedea0SLionel Sambuc$! End The DEC C Check.
476ebfedea0SLionel Sambuc$!
477ebfedea0SLionel Sambuc$ ENDIF
478ebfedea0SLionel Sambuc$!
479ebfedea0SLionel Sambuc$!  Tell The User What Linker Option File We Are Using.
480ebfedea0SLionel Sambuc$!
481ebfedea0SLionel Sambuc$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
482ebfedea0SLionel Sambuc$!
483ebfedea0SLionel Sambuc$! Time To RETURN.
484ebfedea0SLionel Sambuc$!
485ebfedea0SLionel Sambuc$ RETURN
486ebfedea0SLionel Sambuc$!
487ebfedea0SLionel Sambuc$! Check To See If We Have The Appropiate Libraries.
488ebfedea0SLionel Sambuc$!
489ebfedea0SLionel Sambuc$ LIB_CHECK:
490ebfedea0SLionel Sambuc$!
491ebfedea0SLionel Sambuc$! Look For The Library LIBCRYPTO.OLB.
492ebfedea0SLionel Sambuc$!
493ebfedea0SLionel Sambuc$ IF (F$SEARCH(CRYPTO_LIB).EQS."")
494ebfedea0SLionel Sambuc$ THEN
495ebfedea0SLionel Sambuc$!
496ebfedea0SLionel Sambuc$!  Tell The User We Can't Find The LIBCRYPTO.OLB Library.
497ebfedea0SLionel Sambuc$!
498ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
499ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
500ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "We Can't Link Without It."
501ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
502ebfedea0SLionel Sambuc$!
503ebfedea0SLionel Sambuc$!  Since We Can't Link Without It, Exit.
504ebfedea0SLionel Sambuc$!
505ebfedea0SLionel Sambuc$   EXIT
506ebfedea0SLionel Sambuc$!
507ebfedea0SLionel Sambuc$! End The Crypto Library Check.
508ebfedea0SLionel Sambuc$!
509ebfedea0SLionel Sambuc$ ENDIF
510ebfedea0SLionel Sambuc$!
511ebfedea0SLionel Sambuc$! Look For The Library LIBSSL.OLB.
512ebfedea0SLionel Sambuc$!
513ebfedea0SLionel Sambuc$ IF (F$SEARCH(SSL_LIB).EQS."")
514ebfedea0SLionel Sambuc$ THEN
515ebfedea0SLionel Sambuc$!
516ebfedea0SLionel Sambuc$!  Tell The User We Can't Find The LIBSSL.OLB Library.
517ebfedea0SLionel Sambuc$!
518ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
519ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
520ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It."
521ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
522ebfedea0SLionel Sambuc$!
523ebfedea0SLionel Sambuc$!  Since We Can't Link Without It, Exit.
524ebfedea0SLionel Sambuc$!
525ebfedea0SLionel Sambuc$   EXIT
526ebfedea0SLionel Sambuc$!
527ebfedea0SLionel Sambuc$! End The SSL Library Check.
528ebfedea0SLionel Sambuc$!
529ebfedea0SLionel Sambuc$ ENDIF
530ebfedea0SLionel Sambuc$!
531ebfedea0SLionel Sambuc$! Time To Return.
532ebfedea0SLionel Sambuc$!
533ebfedea0SLionel Sambuc$ RETURN
534ebfedea0SLionel Sambuc$!
535ebfedea0SLionel Sambuc$! Check The User's Options.
536ebfedea0SLionel Sambuc$!
537ebfedea0SLionel Sambuc$ CHECK_OPTIONS:
538ebfedea0SLionel Sambuc$!
539ebfedea0SLionel Sambuc$! Check To See If P1 Is Blank.
540ebfedea0SLionel Sambuc$!
541ebfedea0SLionel Sambuc$ IF (P1.EQS."NODEBUG")
542ebfedea0SLionel Sambuc$ THEN
543ebfedea0SLionel Sambuc$!
544ebfedea0SLionel Sambuc$!  P1 Is NODEBUG, So Compile Without Debugger Information.
545ebfedea0SLionel Sambuc$!
546ebfedea0SLionel Sambuc$   DEBUGGER  = "NODEBUG"
547ebfedea0SLionel Sambuc$   LINKMAP = "NOMAP"
548ebfedea0SLionel Sambuc$   TRACEBACK = "NOTRACEBACK"
549ebfedea0SLionel Sambuc$   GCC_OPTIMIZE = "OPTIMIZE"
550ebfedea0SLionel Sambuc$   CC_OPTIMIZE = "OPTIMIZE"
551ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
552ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
553ebfedea0SLionel Sambuc$!
554ebfedea0SLionel Sambuc$! Else...
555ebfedea0SLionel Sambuc$!
556ebfedea0SLionel Sambuc$ ELSE
557ebfedea0SLionel Sambuc$!
558ebfedea0SLionel Sambuc$!  Check To See If We Are To Compile With Debugger Information.
559ebfedea0SLionel Sambuc$!
560ebfedea0SLionel Sambuc$   IF (P1.EQS."DEBUG")
561ebfedea0SLionel Sambuc$   THEN
562ebfedea0SLionel Sambuc$!
563ebfedea0SLionel Sambuc$!    Compile With Debugger Information.
564ebfedea0SLionel Sambuc$!
565ebfedea0SLionel Sambuc$     DEBUGGER  = "DEBUG"
566ebfedea0SLionel Sambuc$     LINKMAP = "MAP"
567ebfedea0SLionel Sambuc$     TRACEBACK = "TRACEBACK"
568ebfedea0SLionel Sambuc$     GCC_OPTIMIZE = "NOOPTIMIZE"
569ebfedea0SLionel Sambuc$     CC_OPTIMIZE = "NOOPTIMIZE"
570ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
571ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
572ebfedea0SLionel Sambuc$   ELSE
573ebfedea0SLionel Sambuc$!
574ebfedea0SLionel Sambuc$!    Tell The User Entered An Invalid Option.
575ebfedea0SLionel Sambuc$!
576ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
577ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "The Option ",P1," Is Invalid.  The Valid Options Are:"
578ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
579ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "    DEBUG    :  Compile With The Debugger Information."
580ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "    NODEBUG  :  Compile Without The Debugger Information."
581ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
582ebfedea0SLionel Sambuc$!
583ebfedea0SLionel Sambuc$!    Time To EXIT.
584ebfedea0SLionel Sambuc$!
585ebfedea0SLionel Sambuc$     EXIT
586ebfedea0SLionel Sambuc$!
587ebfedea0SLionel Sambuc$!  End The Valid Argument Check.
588ebfedea0SLionel Sambuc$!
589ebfedea0SLionel Sambuc$   ENDIF
590ebfedea0SLionel Sambuc$!
591ebfedea0SLionel Sambuc$! End The P1 Check.
592ebfedea0SLionel Sambuc$!
593ebfedea0SLionel Sambuc$ ENDIF
594ebfedea0SLionel Sambuc$!
595ebfedea0SLionel Sambuc$! Check P6 (POINTER_SIZE).
596ebfedea0SLionel Sambuc$!
597ebfedea0SLionel Sambuc$ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX")
598ebfedea0SLionel Sambuc$ THEN
599ebfedea0SLionel Sambuc$!
600ebfedea0SLionel Sambuc$   IF (P6 .EQS. "32")
601ebfedea0SLionel Sambuc$   THEN
602ebfedea0SLionel Sambuc$     POINTER_SIZE = " /POINTER_SIZE=32"
603ebfedea0SLionel Sambuc$   ELSE
604ebfedea0SLionel Sambuc$     POINTER_SIZE = F$EDIT( P6, "COLLAPSE, UPCASE")
605ebfedea0SLionel Sambuc$     IF ((POINTER_SIZE .EQS. "64") .OR. -
606ebfedea0SLionel Sambuc       (POINTER_SIZE .EQS. "64=") .OR. -
607ebfedea0SLionel Sambuc       (POINTER_SIZE .EQS. "64=ARGV"))
608ebfedea0SLionel Sambuc$     THEN
609ebfedea0SLionel Sambuc$       ARCHD = ARCH+ "_64"
610ebfedea0SLionel Sambuc$       LIB32 = ""
611ebfedea0SLionel Sambuc$       IF (F$EXTRACT( 2, 1, POINTER_SIZE) .EQS. "=")
612ebfedea0SLionel Sambuc$       THEN
613ebfedea0SLionel Sambuc$!        Explicit user choice: "64" or "64=ARGV".
614ebfedea0SLionel Sambuc$         IF (POINTER_SIZE .EQS. "64=") THEN POINTER_SIZE = "64"
615ebfedea0SLionel Sambuc$       ELSE
616ebfedea0SLionel Sambuc$         SET NOON
617ebfedea0SLionel Sambuc$         DEFINE /USER_MODE SYS$OUTPUT NL:
618ebfedea0SLionel Sambuc$         DEFINE /USER_MODE SYS$ERROR NL:
619ebfedea0SLionel Sambuc$         CC /NOLIST /NOOBJECT /POINTER_SIZE=64=ARGV NL:
620ebfedea0SLionel Sambuc$         IF ($STATUS .AND. %X0FFF0000) .EQ. %X00030000
621ebfedea0SLionel Sambuc$         THEN
622ebfedea0SLionel Sambuc$           ! If we got here, it means DCL complained like this:
623ebfedea0SLionel Sambuc$           ! %DCL-W-NOVALU, value not allowed - remove value specification
624ebfedea0SLionel Sambuc$           !  \64=\
625ebfedea0SLionel Sambuc$           !
626ebfedea0SLionel Sambuc$           ! If the compiler was run, logicals defined in /USER would
627ebfedea0SLionel Sambuc$           ! have been deassigned automatically.  However, when DCL
628ebfedea0SLionel Sambuc$           ! complains, they aren't, so we do it here (it might be
629ebfedea0SLionel Sambuc$           ! unnecessary, but just in case there will be another error
630ebfedea0SLionel Sambuc$           ! message further on that we don't want to miss)
631ebfedea0SLionel Sambuc$           DEASSIGN /USER_MODE SYS$ERROR
632ebfedea0SLionel Sambuc$           DEASSIGN /USER_MODE SYS$OUTPUT
633ebfedea0SLionel Sambuc$         ELSE
634ebfedea0SLionel Sambuc$           POINTER_SIZE = POINTER_SIZE + "=ARGV"
635ebfedea0SLionel Sambuc$         ENDIF
636ebfedea0SLionel Sambuc$         SET ON
637ebfedea0SLionel Sambuc$       ENDIF
638ebfedea0SLionel Sambuc$       POINTER_SIZE = " /POINTER_SIZE=''POINTER_SIZE'"
639ebfedea0SLionel Sambuc$!
640ebfedea0SLionel Sambuc$     ELSE
641ebfedea0SLionel Sambuc$!
642ebfedea0SLionel Sambuc$!      Tell The User Entered An Invalid Option.
643ebfedea0SLionel Sambuc$!
644ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT ""
645ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT "The Option ", P6, -
646ebfedea0SLionel Sambuc         " Is Invalid.  The Valid Options Are:"
647ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT ""
648ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT -
649ebfedea0SLionel Sambuc         "    """"  :  Compile with default (short) pointers."
650ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT -
651ebfedea0SLionel Sambuc         "    32  :  Compile with 32-bit (short) pointers."
652ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT -
653ebfedea0SLionel Sambuc         "    64       :  Compile with 64-bit (long) pointers (auto ARGV)."
654ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT -
655ebfedea0SLionel Sambuc         "    64=      :  Compile with 64-bit (long) pointers (no ARGV)."
656ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT -
657ebfedea0SLionel Sambuc         "    64=ARGV  :  Compile with 64-bit (long) pointers (ARGV)."
658ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT ""
659ebfedea0SLionel Sambuc$!
660ebfedea0SLionel Sambuc$!      Time To EXIT.
661ebfedea0SLionel Sambuc$!
662ebfedea0SLionel Sambuc$       EXIT
663ebfedea0SLionel Sambuc$!
664ebfedea0SLionel Sambuc$     ENDIF
665ebfedea0SLionel Sambuc$!
666ebfedea0SLionel Sambuc$   ENDIF
667ebfedea0SLionel Sambuc$!
668ebfedea0SLionel Sambuc$! End The P6 (POINTER_SIZE) Check.
669ebfedea0SLionel Sambuc$!
670ebfedea0SLionel Sambuc$ ENDIF
671ebfedea0SLionel Sambuc$!
672ebfedea0SLionel Sambuc$! Set basic C compiler /INCLUDE directories.
673ebfedea0SLionel Sambuc$!
674ebfedea0SLionel Sambuc$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]"
675ebfedea0SLionel Sambuc$!
676ebfedea0SLionel Sambuc$! Check To See If P2 Is Blank.
677ebfedea0SLionel Sambuc$!
678ebfedea0SLionel Sambuc$ IF (P2.EQS."")
679ebfedea0SLionel Sambuc$ THEN
680ebfedea0SLionel Sambuc$!
681ebfedea0SLionel Sambuc$!  O.K., The User Didn't Specify A Compiler, Let's Try To
682ebfedea0SLionel Sambuc$!  Find Out Which One To Use.
683ebfedea0SLionel Sambuc$!
684ebfedea0SLionel Sambuc$!  Check To See If We Have GNU C.
685ebfedea0SLionel Sambuc$!
686ebfedea0SLionel Sambuc$   IF (F$TRNLNM("GNU_CC").NES."")
687ebfedea0SLionel Sambuc$   THEN
688ebfedea0SLionel Sambuc$!
689ebfedea0SLionel Sambuc$!    Looks Like GNUC, Set To Use GNUC.
690ebfedea0SLionel Sambuc$!
691ebfedea0SLionel Sambuc$     P2 = "GNUC"
692ebfedea0SLionel Sambuc$!
693ebfedea0SLionel Sambuc$!  Else...
694ebfedea0SLionel Sambuc$!
695ebfedea0SLionel Sambuc$   ELSE
696ebfedea0SLionel Sambuc$!
697ebfedea0SLionel Sambuc$!  Check To See If We Have VAXC Or DECC.
698ebfedea0SLionel Sambuc$!
699ebfedea0SLionel Sambuc$     IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
700ebfedea0SLionel Sambuc$     THEN
701ebfedea0SLionel Sambuc$!
702ebfedea0SLionel Sambuc$!      Looks Like DECC, Set To Use DECC.
703ebfedea0SLionel Sambuc$!
704ebfedea0SLionel Sambuc$       P2 = "DECC"
705ebfedea0SLionel Sambuc$!
706ebfedea0SLionel Sambuc$!    Else...
707ebfedea0SLionel Sambuc$!
708ebfedea0SLionel Sambuc$     ELSE
709ebfedea0SLionel Sambuc$!
710ebfedea0SLionel Sambuc$!      Looks Like VAXC, Set To Use VAXC.
711ebfedea0SLionel Sambuc$!
712ebfedea0SLionel Sambuc$       P2 = "VAXC"
713ebfedea0SLionel Sambuc$!
714ebfedea0SLionel Sambuc$!    End The VAXC Compiler Check.
715ebfedea0SLionel Sambuc$!
716ebfedea0SLionel Sambuc$     ENDIF
717ebfedea0SLionel Sambuc$!
718ebfedea0SLionel Sambuc$!  End The DECC & VAXC Compiler Check.
719ebfedea0SLionel Sambuc$!
720ebfedea0SLionel Sambuc$   ENDIF
721ebfedea0SLionel Sambuc$!
722ebfedea0SLionel Sambuc$!  End The Compiler Check.
723ebfedea0SLionel Sambuc$!
724ebfedea0SLionel Sambuc$ ENDIF
725ebfedea0SLionel Sambuc$!
726ebfedea0SLionel Sambuc$! Check To See If We Have A Option For P3.
727ebfedea0SLionel Sambuc$!
728ebfedea0SLionel Sambuc$ IF (P3.EQS."")
729ebfedea0SLionel Sambuc$ THEN
730ebfedea0SLionel Sambuc$!
731ebfedea0SLionel Sambuc$!  Find out what socket library we have available
732ebfedea0SLionel Sambuc$!
733ebfedea0SLionel Sambuc$   IF F$PARSE("SOCKETSHR:") .NES. ""
734ebfedea0SLionel Sambuc$   THEN
735ebfedea0SLionel Sambuc$!
736ebfedea0SLionel Sambuc$!    We have SOCKETSHR, and it is my opinion that it's the best to use.
737ebfedea0SLionel Sambuc$!
738ebfedea0SLionel Sambuc$     P3 = "SOCKETSHR"
739ebfedea0SLionel Sambuc$!
740ebfedea0SLionel Sambuc$!    Tell the user
741ebfedea0SLionel Sambuc$!
742ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
743ebfedea0SLionel Sambuc$!
744ebfedea0SLionel Sambuc$!    Else, let's look for something else
745ebfedea0SLionel Sambuc$!
746ebfedea0SLionel Sambuc$   ELSE
747ebfedea0SLionel Sambuc$!
748ebfedea0SLionel Sambuc$!    Like UCX (the reason to do this before Multinet is that the UCX
749ebfedea0SLionel Sambuc$!    emulation is easier to use...)
750ebfedea0SLionel Sambuc$!
751ebfedea0SLionel Sambuc$     IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
752ebfedea0SLionel Sambuc	 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
753ebfedea0SLionel Sambuc	 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
754ebfedea0SLionel Sambuc$     THEN
755ebfedea0SLionel Sambuc$!
756ebfedea0SLionel Sambuc$!	Last resort: a UCX or UCX-compatible library
757ebfedea0SLionel Sambuc$!
758ebfedea0SLionel Sambuc$	P3 = "UCX"
759ebfedea0SLionel Sambuc$!
760ebfedea0SLionel Sambuc$!      Tell the user
761ebfedea0SLionel Sambuc$!
762ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
763ebfedea0SLionel Sambuc$!
764ebfedea0SLionel Sambuc$!	That was all...
765ebfedea0SLionel Sambuc$!
766ebfedea0SLionel Sambuc$     ENDIF
767ebfedea0SLionel Sambuc$   ENDIF
768ebfedea0SLionel Sambuc$ ENDIF
769ebfedea0SLionel Sambuc$!
770ebfedea0SLionel Sambuc$! Set Up Initial CC Definitions, Possibly With User Ones
771ebfedea0SLionel Sambuc$!
772ebfedea0SLionel Sambuc$ CCDEFS = "MONOLITH"
773ebfedea0SLionel Sambuc$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
774ebfedea0SLionel Sambuc$ CCEXTRAFLAGS = ""
775ebfedea0SLionel Sambuc$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
776*0a6a1f1dSLionel Sambuc$ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
777*0a6a1f1dSLionel Sambuc$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
778*0a6a1f1dSLionel Sambuc$ THEN
779*0a6a1f1dSLionel Sambuc$     IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
780*0a6a1f1dSLionel Sambuc$     CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
781*0a6a1f1dSLionel Sambuc$ ENDIF
782ebfedea0SLionel Sambuc$!
783ebfedea0SLionel Sambuc$! Check To See If We Have A ZLIB Option.
784ebfedea0SLionel Sambuc$!
785ebfedea0SLionel Sambuc$ ZLIB = P7
786ebfedea0SLionel Sambuc$ IF (ZLIB .NES. "")
787ebfedea0SLionel Sambuc$ THEN
788ebfedea0SLionel Sambuc$!
789ebfedea0SLionel Sambuc$!  Check for expected ZLIB files.
790ebfedea0SLionel Sambuc$!
791ebfedea0SLionel Sambuc$   err = 0
792ebfedea0SLionel Sambuc$   file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
793ebfedea0SLionel Sambuc$   if (f$search( file1) .eqs. "")
794ebfedea0SLionel Sambuc$   then
795ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
796ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
797ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "    Can't find header: ''file1'"
798ebfedea0SLionel Sambuc$     err = 1
799ebfedea0SLionel Sambuc$   endif
800ebfedea0SLionel Sambuc$   file1 = f$parse( "A.;", ZLIB)- "A.;"
801ebfedea0SLionel Sambuc$!
802ebfedea0SLionel Sambuc$   file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
803ebfedea0SLionel Sambuc$   if (f$search( file2) .eqs. "")
804ebfedea0SLionel Sambuc$   then
805ebfedea0SLionel Sambuc$     if (err .eq. 0)
806ebfedea0SLionel Sambuc$     then
807ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT ""
808ebfedea0SLionel Sambuc$       WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
809ebfedea0SLionel Sambuc$     endif
810ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "    Can't find library: ''file2'"
811ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
812ebfedea0SLionel Sambuc$     err = err+ 2
813ebfedea0SLionel Sambuc$   endif
814ebfedea0SLionel Sambuc$   if (err .eq. 1)
815ebfedea0SLionel Sambuc$   then
816ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT ""
817ebfedea0SLionel Sambuc$   endif
818ebfedea0SLionel Sambuc$!
819ebfedea0SLionel Sambuc$   if (err .ne. 0)
820ebfedea0SLionel Sambuc$   then
821ebfedea0SLionel Sambuc$     EXIT
822ebfedea0SLionel Sambuc$   endif
823ebfedea0SLionel Sambuc$!
824ebfedea0SLionel Sambuc$   CCDEFS = """ZLIB=1"", "+ CCDEFS
825ebfedea0SLionel Sambuc$   CC_INCLUDES = CC_INCLUDES+ ", "+ file1
826ebfedea0SLionel Sambuc$   ZLIB_LIB = ", ''file2' /library"
827ebfedea0SLionel Sambuc$!
828ebfedea0SLionel Sambuc$!  Print info
829ebfedea0SLionel Sambuc$!
830ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "ZLIB library spec: ", file2
831ebfedea0SLionel Sambuc$!
832ebfedea0SLionel Sambuc$! End The ZLIB Check.
833ebfedea0SLionel Sambuc$!
834ebfedea0SLionel Sambuc$ ENDIF
835ebfedea0SLionel Sambuc$!
836ebfedea0SLionel Sambuc$!  Check To See If The User Entered A Valid Parameter.
837ebfedea0SLionel Sambuc$!
838ebfedea0SLionel Sambuc$ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
839ebfedea0SLionel Sambuc$ THEN
840ebfedea0SLionel Sambuc$!
841ebfedea0SLionel Sambuc$!  Check To See If The User Wanted DECC.
842ebfedea0SLionel Sambuc$!
843ebfedea0SLionel Sambuc$   IF (P2.EQS."DECC")
844ebfedea0SLionel Sambuc$   THEN
845ebfedea0SLionel Sambuc$!
846ebfedea0SLionel Sambuc$!    Looks Like DECC, Set To Use DECC.
847ebfedea0SLionel Sambuc$!
848ebfedea0SLionel Sambuc$     COMPILER = "DECC"
849ebfedea0SLionel Sambuc$!
850ebfedea0SLionel Sambuc$!    Tell The User We Are Using DECC.
851ebfedea0SLionel Sambuc$!
852ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
853ebfedea0SLionel Sambuc$!
854ebfedea0SLionel Sambuc$!    Use DECC...
855ebfedea0SLionel Sambuc$!
856ebfedea0SLionel Sambuc$     CC = "CC"
857ebfedea0SLionel Sambuc$     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
858ebfedea0SLionel Sambuc	 THEN CC = "CC/DECC"
859ebfedea0SLionel Sambuc$     CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
860ebfedea0SLionel Sambuc       "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
861ebfedea0SLionel Sambuc       " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
862ebfedea0SLionel Sambuc$!
863ebfedea0SLionel Sambuc$!    Define The Linker Options File Name.
864ebfedea0SLionel Sambuc$!
865ebfedea0SLionel Sambuc$     OPT_FILE = "VAX_DECC_OPTIONS.OPT"
866ebfedea0SLionel Sambuc$!
867ebfedea0SLionel Sambuc$!  End DECC Check.
868ebfedea0SLionel Sambuc$!
869ebfedea0SLionel Sambuc$   ENDIF
870ebfedea0SLionel Sambuc$!
871ebfedea0SLionel Sambuc$!  Check To See If We Are To Use VAXC.
872ebfedea0SLionel Sambuc$!
873ebfedea0SLionel Sambuc$   IF (P2.EQS."VAXC")
874ebfedea0SLionel Sambuc$   THEN
875ebfedea0SLionel Sambuc$!
876ebfedea0SLionel Sambuc$!    Looks Like VAXC, Set To Use VAXC.
877ebfedea0SLionel Sambuc$!
878ebfedea0SLionel Sambuc$     COMPILER = "VAXC"
879ebfedea0SLionel Sambuc$!
880ebfedea0SLionel Sambuc$!    Tell The User We Are Using VAX C.
881ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
882ebfedea0SLionel Sambuc$!
883ebfedea0SLionel Sambuc$!    Compile Using VAXC.
884ebfedea0SLionel Sambuc$!
885ebfedea0SLionel Sambuc$     CC = "CC"
886ebfedea0SLionel Sambuc$     IF ARCH.NES."VAX"
887ebfedea0SLionel Sambuc$     THEN
888ebfedea0SLionel Sambuc$	WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
889ebfedea0SLionel Sambuc$	EXIT
890ebfedea0SLionel Sambuc$     ENDIF
891ebfedea0SLionel Sambuc$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
892ebfedea0SLionel Sambuc$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
893ebfedea0SLionel Sambuc	   "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
894ebfedea0SLionel Sambuc$     CCDEFS = CCDEFS + ",""VAXC"""
895ebfedea0SLionel Sambuc$!
896ebfedea0SLionel Sambuc$!    Define <sys> As SYS$COMMON:[SYSLIB]
897ebfedea0SLionel Sambuc$!
898ebfedea0SLionel Sambuc$     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
899ebfedea0SLionel Sambuc$!
900ebfedea0SLionel Sambuc$!    Define The Linker Options File Name.
901ebfedea0SLionel Sambuc$!
902ebfedea0SLionel Sambuc$     OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
903ebfedea0SLionel Sambuc$!
904ebfedea0SLionel Sambuc$!  End VAXC Check
905ebfedea0SLionel Sambuc$!
906ebfedea0SLionel Sambuc$   ENDIF
907ebfedea0SLionel Sambuc$!
908ebfedea0SLionel Sambuc$!  Check To See If We Are To Use GNU C.
909ebfedea0SLionel Sambuc$!
910ebfedea0SLionel Sambuc$   IF (P2.EQS."GNUC")
911ebfedea0SLionel Sambuc$   THEN
912ebfedea0SLionel Sambuc$!
913ebfedea0SLionel Sambuc$!    Looks Like GNUC, Set To Use GNUC.
914ebfedea0SLionel Sambuc$!
915ebfedea0SLionel Sambuc$     COMPILER = "GNUC"
916ebfedea0SLionel Sambuc$!
917ebfedea0SLionel Sambuc$!    Tell The User We Are Using GNUC.
918ebfedea0SLionel Sambuc$!
919ebfedea0SLionel Sambuc$     WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
920ebfedea0SLionel Sambuc$!
921ebfedea0SLionel Sambuc$!    Use GNU C...
922ebfedea0SLionel Sambuc$!
923ebfedea0SLionel Sambuc$     IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
924ebfedea0SLionel Sambuc$     CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
925ebfedea0SLionel Sambuc	   "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
926ebfedea0SLionel Sambuc$!
927ebfedea0SLionel Sambuc$!    Define The Linker Options File Name.
928ebfedea0SLionel Sambuc$!
929ebfedea0SLionel Sambuc$     OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
930ebfedea0SLionel Sambuc$!
931ebfedea0SLionel Sambuc$!  End The GNU C Check.
932ebfedea0SLionel Sambuc$!
933ebfedea0SLionel Sambuc$   ENDIF
934ebfedea0SLionel Sambuc$!
935ebfedea0SLionel Sambuc$!  Set up default defines
936ebfedea0SLionel Sambuc$!
937ebfedea0SLionel Sambuc$   CCDEFS = """FLAT_INC=1""," + CCDEFS
938ebfedea0SLionel Sambuc$!
939ebfedea0SLionel Sambuc$!  Else The User Entered An Invalid Argument.
940ebfedea0SLionel Sambuc$!
941ebfedea0SLionel Sambuc$ ELSE
942ebfedea0SLionel Sambuc$!
943ebfedea0SLionel Sambuc$!  Tell The User We Don't Know What They Want.
944ebfedea0SLionel Sambuc$!
945ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
946ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "The Option ",P2," Is Invalid.  The Valid Options Are:"
947ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
948ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    VAXC  :  To Compile With VAX C."
949ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    DECC  :  To Compile With DEC C."
950ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    GNUC  :  To Compile With GNU C."
951ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
952ebfedea0SLionel Sambuc$!
953ebfedea0SLionel Sambuc$!  Time To EXIT.
954ebfedea0SLionel Sambuc$!
955ebfedea0SLionel Sambuc$   EXIT
956ebfedea0SLionel Sambuc$ ENDIF
957ebfedea0SLionel Sambuc$!
958ebfedea0SLionel Sambuc$! Time to check the contents, and to make sure we get the correct library.
959ebfedea0SLionel Sambuc$!
960ebfedea0SLionel Sambuc$ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
961ebfedea0SLionel Sambuc     .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
962ebfedea0SLionel Sambuc$ THEN
963ebfedea0SLionel Sambuc$!
964ebfedea0SLionel Sambuc$!  Check to see if SOCKETSHR was chosen
965ebfedea0SLionel Sambuc$!
966ebfedea0SLionel Sambuc$   IF P3.EQS."SOCKETSHR"
967ebfedea0SLionel Sambuc$   THEN
968ebfedea0SLionel Sambuc$!
969ebfedea0SLionel Sambuc$!    Set the library to use SOCKETSHR
970ebfedea0SLionel Sambuc$!
971ebfedea0SLionel Sambuc$     TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
972ebfedea0SLionel Sambuc$!
973ebfedea0SLionel Sambuc$!    Done with SOCKETSHR
974ebfedea0SLionel Sambuc$!
975ebfedea0SLionel Sambuc$   ENDIF
976ebfedea0SLionel Sambuc$!
977ebfedea0SLionel Sambuc$!  Check to see if MULTINET was chosen
978ebfedea0SLionel Sambuc$!
979ebfedea0SLionel Sambuc$   IF P3.EQS."MULTINET"
980ebfedea0SLionel Sambuc$   THEN
981ebfedea0SLionel Sambuc$!
982ebfedea0SLionel Sambuc$!    Set the library to use UCX emulation.
983ebfedea0SLionel Sambuc$!
984ebfedea0SLionel Sambuc$     P3 = "UCX"
985ebfedea0SLionel Sambuc$!
986ebfedea0SLionel Sambuc$!    Done with MULTINET
987ebfedea0SLionel Sambuc$!
988ebfedea0SLionel Sambuc$   ENDIF
989ebfedea0SLionel Sambuc$!
990ebfedea0SLionel Sambuc$!  Check to see if UCX was chosen
991ebfedea0SLionel Sambuc$!
992ebfedea0SLionel Sambuc$   IF P3.EQS."UCX"
993ebfedea0SLionel Sambuc$   THEN
994ebfedea0SLionel Sambuc$!
995ebfedea0SLionel Sambuc$!    Set the library to use UCX.
996ebfedea0SLionel Sambuc$!
997ebfedea0SLionel Sambuc$     TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
998ebfedea0SLionel Sambuc$     IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
999ebfedea0SLionel Sambuc$     THEN
1000ebfedea0SLionel Sambuc$       TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
1001ebfedea0SLionel Sambuc$     ELSE
1002ebfedea0SLionel Sambuc$       IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1003ebfedea0SLionel Sambuc	  TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
1004ebfedea0SLionel Sambuc$     ENDIF
1005ebfedea0SLionel Sambuc$!
1006ebfedea0SLionel Sambuc$!    Done with UCX
1007ebfedea0SLionel Sambuc$!
1008ebfedea0SLionel Sambuc$   ENDIF
1009ebfedea0SLionel Sambuc$!
1010ebfedea0SLionel Sambuc$!  Check to see if TCPIP (post UCX) was chosen
1011ebfedea0SLionel Sambuc$!
1012ebfedea0SLionel Sambuc$   IF P3.EQS."TCPIP"
1013ebfedea0SLionel Sambuc$   THEN
1014ebfedea0SLionel Sambuc$!
1015ebfedea0SLionel Sambuc$!    Set the library to use TCPIP.
1016ebfedea0SLionel Sambuc$!
1017ebfedea0SLionel Sambuc$     TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
1018ebfedea0SLionel Sambuc$!
1019ebfedea0SLionel Sambuc$!    Done with TCPIP
1020ebfedea0SLionel Sambuc$!
1021ebfedea0SLionel Sambuc$   ENDIF
1022ebfedea0SLionel Sambuc$!
1023ebfedea0SLionel Sambuc$!  Check to see if NONE was chosen
1024ebfedea0SLionel Sambuc$!
1025ebfedea0SLionel Sambuc$   IF P3.EQS."NONE"
1026ebfedea0SLionel Sambuc$   THEN
1027ebfedea0SLionel Sambuc$!
1028ebfedea0SLionel Sambuc$!    Do not use TCPIP.
1029ebfedea0SLionel Sambuc$!
1030ebfedea0SLionel Sambuc$     TCPIP_LIB = ""
1031ebfedea0SLionel Sambuc$!
1032ebfedea0SLionel Sambuc$!    Done with TCPIP
1033ebfedea0SLionel Sambuc$!
1034ebfedea0SLionel Sambuc$   ENDIF
1035ebfedea0SLionel Sambuc$!
1036ebfedea0SLionel Sambuc$!  Add TCP/IP type to CC definitions.
1037ebfedea0SLionel Sambuc$!
1038ebfedea0SLionel Sambuc$   CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'"
1039ebfedea0SLionel Sambuc$!
1040ebfedea0SLionel Sambuc$!  Print info
1041ebfedea0SLionel Sambuc$!
1042ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
1043ebfedea0SLionel Sambuc$!
1044ebfedea0SLionel Sambuc$!  Else The User Entered An Invalid Argument.
1045ebfedea0SLionel Sambuc$!
1046ebfedea0SLionel Sambuc$ ELSE
1047ebfedea0SLionel Sambuc$!
1048ebfedea0SLionel Sambuc$!  Tell The User We Don't Know What They Want.
1049ebfedea0SLionel Sambuc$!
1050ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
1051ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "The Option ",P3," Is Invalid.  The Valid Options Are:"
1052ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
1053ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    SOCKETSHR  :  To link with SOCKETSHR TCP/IP library."
1054ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    UCX        :  To link with UCX TCP/IP library."
1055ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT "    TCPIP      :  To link with TCPIP (post UCX) TCP/IP library."
1056ebfedea0SLionel Sambuc$   WRITE SYS$OUTPUT ""
1057ebfedea0SLionel Sambuc$!
1058ebfedea0SLionel Sambuc$!  Time To EXIT.
1059ebfedea0SLionel Sambuc$!
1060ebfedea0SLionel Sambuc$   EXIT
1061ebfedea0SLionel Sambuc$!
1062ebfedea0SLionel Sambuc$!  Done with TCP/IP libraries
1063ebfedea0SLionel Sambuc$!
1064ebfedea0SLionel Sambuc$ ENDIF
1065ebfedea0SLionel Sambuc$!
1066ebfedea0SLionel Sambuc$! Finish up the definition of CC.
1067ebfedea0SLionel Sambuc$!
1068ebfedea0SLionel Sambuc$ IF COMPILER .EQS. "DECC"
1069ebfedea0SLionel Sambuc$ THEN
1070*0a6a1f1dSLionel Sambuc$!  Not all compiler versions support MAYLOSEDATA3.
1071*0a6a1f1dSLionel Sambuc$   OPT_TEST = "MAYLOSEDATA3"
1072*0a6a1f1dSLionel Sambuc$   DEFINE /USER_MODE SYS$ERROR NL:
1073*0a6a1f1dSLionel Sambuc$   DEFINE /USER_MODE SYS$OUTPUT NL:
1074*0a6a1f1dSLionel Sambuc$   'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
1075*0a6a1f1dSLionel Sambuc      /WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
1076*0a6a1f1dSLionel Sambuc$   IF ($SEVERITY)
1077*0a6a1f1dSLionel Sambuc$   THEN
1078*0a6a1f1dSLionel Sambuc$     IF CCDISABLEWARNINGS .NES. "" THEN -
1079*0a6a1f1dSLionel Sambuc        CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
1080*0a6a1f1dSLionel Sambuc$     CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
1081*0a6a1f1dSLionel Sambuc$   ENDIF
1082ebfedea0SLionel Sambuc$   IF CCDISABLEWARNINGS .NES. ""
1083ebfedea0SLionel Sambuc$   THEN
1084ebfedea0SLionel Sambuc$     CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1085ebfedea0SLionel Sambuc$   ENDIF
1086ebfedea0SLionel Sambuc$ ELSE
1087ebfedea0SLionel Sambuc$   CCDISABLEWARNINGS = ""
1088ebfedea0SLionel Sambuc$ ENDIF
1089ebfedea0SLionel Sambuc$ CC2 = CC + " /DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS
1090ebfedea0SLionel Sambuc$ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1091ebfedea0SLionel Sambuc$!
1092ebfedea0SLionel Sambuc$! Show user the result
1093ebfedea0SLionel Sambuc$!
1094ebfedea0SLionel Sambuc$ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
1095ebfedea0SLionel Sambuc$!
1096ebfedea0SLionel Sambuc$! Special Threads For OpenVMS v7.1 Or Later
1097ebfedea0SLionel Sambuc$!
1098ebfedea0SLionel Sambuc$! Written By:  Richard Levitte
1099ebfedea0SLionel Sambuc$!              richard@levitte.org
1100ebfedea0SLionel Sambuc$!
1101ebfedea0SLionel Sambuc$!
1102ebfedea0SLionel Sambuc$! Check To See If We Have A Option For P4.
1103ebfedea0SLionel Sambuc$!
1104ebfedea0SLionel Sambuc$ IF (P4.EQS."")
1105ebfedea0SLionel Sambuc$ THEN
1106ebfedea0SLionel Sambuc$!
1107ebfedea0SLionel Sambuc$!  Get The Version Of VMS We Are Using.
1108ebfedea0SLionel Sambuc$!
1109ebfedea0SLionel Sambuc$   ISSEVEN :=
1110ebfedea0SLionel Sambuc$   TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
1111ebfedea0SLionel Sambuc$   TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
1112ebfedea0SLionel Sambuc$!
1113ebfedea0SLionel Sambuc$!  Check To See If The VMS Version Is v7.1 Or Later.
1114ebfedea0SLionel Sambuc$!
1115ebfedea0SLionel Sambuc$   IF (TMP.GE.71)
1116ebfedea0SLionel Sambuc$   THEN
1117ebfedea0SLionel Sambuc$!
1118ebfedea0SLionel Sambuc$!    We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
1119ebfedea0SLionel Sambuc$!
1120ebfedea0SLionel Sambuc$     ISSEVEN := ,PTHREAD_USE_D4
1121ebfedea0SLionel Sambuc$!
1122ebfedea0SLionel Sambuc$!  End The VMS Version Check.
1123ebfedea0SLionel Sambuc$!
1124ebfedea0SLionel Sambuc$   ENDIF
1125ebfedea0SLionel Sambuc$!
1126ebfedea0SLionel Sambuc$! End The P4 Check.
1127ebfedea0SLionel Sambuc$!
1128ebfedea0SLionel Sambuc$ ENDIF
1129ebfedea0SLionel Sambuc$!
1130ebfedea0SLionel Sambuc$! Check if the user wanted to compile just a subset of all the programs.
1131ebfedea0SLionel Sambuc$!
1132ebfedea0SLionel Sambuc$ IF P5 .NES. ""
1133ebfedea0SLionel Sambuc$ THEN
1134ebfedea0SLionel Sambuc$   PROGRAMS = P5
1135ebfedea0SLionel Sambuc$ ENDIF
1136ebfedea0SLionel Sambuc$!
1137ebfedea0SLionel Sambuc$!  Time To RETURN...
1138ebfedea0SLionel Sambuc$!
1139ebfedea0SLionel Sambuc$ RETURN
1140ebfedea0SLionel Sambuc$!
1141ebfedea0SLionel Sambuc$ INITIALISE:
1142ebfedea0SLionel Sambuc$!
1143ebfedea0SLionel Sambuc$! Save old value of the logical name OPENSSL
1144ebfedea0SLionel Sambuc$!
1145ebfedea0SLionel Sambuc$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1146ebfedea0SLionel Sambuc$!
1147ebfedea0SLionel Sambuc$! Save directory information
1148ebfedea0SLionel Sambuc$!
1149ebfedea0SLionel Sambuc$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1150ebfedea0SLionel Sambuc$ __HERE = F$EDIT(__HERE,"UPCASE")
1151ebfedea0SLionel Sambuc$ __TOP = __HERE - "APPS]"
1152ebfedea0SLionel Sambuc$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1153ebfedea0SLionel Sambuc$!
1154ebfedea0SLionel Sambuc$! Set up the logical name OPENSSL to point at the include directory
1155ebfedea0SLionel Sambuc$!
1156ebfedea0SLionel Sambuc$ DEFINE OPENSSL /NOLOG '__INCLUDE'
1157ebfedea0SLionel Sambuc$!
1158ebfedea0SLionel Sambuc$! Done
1159ebfedea0SLionel Sambuc$!
1160ebfedea0SLionel Sambuc$ RETURN
1161ebfedea0SLionel Sambuc$!
1162ebfedea0SLionel Sambuc$ CLEANUP:
1163ebfedea0SLionel Sambuc$!
1164ebfedea0SLionel Sambuc$! Restore the saved logical name OPENSSL, if it had a value.
1165ebfedea0SLionel Sambuc$!
1166ebfedea0SLionel Sambuc$ if (f$type( __SAVE_OPENSSL) .nes. "")
1167ebfedea0SLionel Sambuc$ then
1168ebfedea0SLionel Sambuc$   IF __SAVE_OPENSSL .EQS. ""
1169ebfedea0SLionel Sambuc$   THEN
1170ebfedea0SLionel Sambuc$     DEASSIGN OPENSSL
1171ebfedea0SLionel Sambuc$   ELSE
1172ebfedea0SLionel Sambuc$     DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL'
1173ebfedea0SLionel Sambuc$   ENDIF
1174ebfedea0SLionel Sambuc$ endif
1175ebfedea0SLionel Sambuc$!
1176ebfedea0SLionel Sambuc$! Close any open files.
1177ebfedea0SLionel Sambuc$!
1178ebfedea0SLionel Sambuc$ if (f$trnlnm( "objects", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -
1179ebfedea0SLionel Sambuc   close objects
1180ebfedea0SLionel Sambuc$!
1181ebfedea0SLionel Sambuc$! Done
1182ebfedea0SLionel Sambuc$!
1183ebfedea0SLionel Sambuc$ RETURN
1184ebfedea0SLionel Sambuc$!
1185