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