3 $! Written By: Robert Byer
5 $! A-Com Computing, Inc.
6 $! byer@mail.all-net.net
8 $! Changes by Richard Levitte <richard@levitte.org>
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.
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.
18 $! Specify the following as P1 to build just that part or ALL to just
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
24 $! Specify DEBUG or NODEBUG as P2 to compile with or without debugger
27 $! Specify which compiler at P3 to try to compile under.
33 $! If you don't specify a compiler, it will try to determine which
34 $! "C" compiler to use.
36 $! P4, if defined, sets a TCP/IP library to use, through one of the following
40 $! TCPIP for TCPIP (post UCX)
41 $! SOCKETSHR for SOCKETSHR+NETLIB
43 $! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
45 $! P6, if defined, specifies the C pointer size. Ignored on VAX.
46 $! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
47 $! Supported values are:
49 $! "" Compile with default (/NOPOINTER_SIZE)
50 $! 32 Compile with /POINTER_SIZE=32 (SHORT)
51 $! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
52 $! (Automatically select ARGV if compiler supports it.)
53 $! 64= Compile with /POINTER_SIZE=64 (LONG).
54 $! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
56 $! P7, if defined, specifies a directory where ZLIB files (zlib.h,
57 $! libz.olb) may be found. Optionally, a non-default object library
58 $! name may be included ("dev:[dir]libz_64.olb", for example).
63 $ proc = f$environment( "procedure")
64 $ write sys$output "@@@ "+ -
65 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
67 $! Define A TCP/IP Library That We Will Need To Link To.
68 $! (That Is, If We Need To Link To One.)
73 $! Check What Architecture We Are Using.
75 $ IF (F$GETSYI("CPU").LT.128)
78 $! The Architecture Is VAX.
86 $! The Architecture Is Alpha, IA64 or whatever comes in the future.
88 $ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
89 $ IF (ARCH .EQS. "") THEN ARCH = "UNK"
91 $! End The Architecture Check.
100 $! Check To Make Sure We Have Valid Command Line Parameters.
102 $ GOSUB CHECK_OPTIONS
104 $! Define The OBJ and EXE Directories.
106 $ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.SSL]
107 $ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.SSL]
109 $! Specify the destination directory in any /MAP option.
111 $ if (LINKMAP .eqs. "MAP")
113 $ LINKMAP = LINKMAP+ "=''EXE_DIR'"
116 $! Add the location prefix to the linker options file name.
118 $ if (OPT_FILE .nes. "")
120 $ OPT_FILE = EXE_DIR+ OPT_FILE
123 $! Initialise logical names and such
127 $! Tell The User What Kind of Machine We Run On.
129 $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
131 $! Check To See If The Architecture Specific OBJ Directory Exists.
133 $ IF (F$PARSE(OBJ_DIR).EQS."")
136 $! It Dosen't Exist, So Create It.
138 $ CREATE/DIR 'OBJ_DIR'
140 $! End The Architecture Specific OBJ Directory Check.
144 $! Check To See If The Architecture Specific Directory Exists.
146 $ IF (F$PARSE(EXE_DIR).EQS."")
149 $! It Dosen't Exist, So Create It.
151 $ CREATE/DIR 'EXE_DIR'
153 $! End The Architecture Specific Directory Check.
157 $! Define The Library Name.
159 $ SSL_LIB := 'EXE_DIR'SSL_LIBSSL'LIB32'.OLB
161 $! Define The CRYPTO-LIB We Are To Use.
163 $ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
165 $! Set up exceptional compilations.
169 $! Check To See What We Are To Do.
171 $ IF (BUILDALL.EQS."TRUE")
174 $! Since Nothing Special Was Specified, Do Everything.
183 $! Build Just What The User Wants Us To Build.
187 $! End The BUILDALL Check.
197 $! Compile The Library.
201 $! Check To See If We Already Have A "[.xxx.EXE.SSL]SSL_LIBSSL''LIB32'.OLB" Library...
203 $ IF (F$SEARCH(SSL_LIB).EQS."")
206 $! Guess Not, Create The Library.
208 $ LIBRARY/CREATE/OBJECT 'SSL_LIB'
210 $! End The Library Exist Check.
214 $! Define The Different SSL "library" Files.
216 $ LIB_SSL = "s2_meth, s2_srvr, s2_clnt, s2_lib, s2_enc, s2_pkt,"+ -
217 "s3_meth, s3_srvr, s3_clnt, s3_lib, s3_enc, s3_pkt, s3_both, s3_cbc,"+ -
218 "s23_meth,s23_srvr,s23_clnt,s23_lib, s23_pkt,"+ -
219 "t1_meth, t1_srvr, t1_clnt, t1_lib, t1_enc,"+ -
220 "d1_meth, d1_srvr, d1_clnt, d1_lib, d1_pkt,"+ -
221 "d1_both,d1_enc,d1_srtp,"+ -
222 "ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ -
223 "ssl_ciph,ssl_stat,ssl_rsa,"+ -
224 "ssl_asn1,ssl_txt,ssl_algs,"+ -
225 "bio_ssl,ssl_err,kssl,tls_srp,t1_reneg,ssl_utst"
227 $ COMPILEWITH_CC5 = ""
229 $! Tell The User That We Are Compiling The Library.
231 $ WRITE SYS$OUTPUT "Building The ",SSL_LIB," Library."
233 $! Define A File Counter And Set It To "0"
237 $! Top Of The File Loop.
241 $! O.K, Extract The File Name From The File List.
243 $ FILE_NAME = F$EDIT(F$ELEMENT(FILE_COUNTER,",",LIB_SSL),"COLLAPSE")
245 $! Check To See If We Are At The End Of The File List.
247 $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
249 $! Increment The Counter.
251 $ FILE_COUNTER = FILE_COUNTER + 1
253 $! Create The Source File Name.
255 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
257 $! Create The Object File Name.
259 $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
260 $ ON WARNING THEN GOTO NEXT_FILE
262 $! Check To See If The File We Want To Compile Is Actually There.
264 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
267 $! Tell The User That The File Dosen't Exist.
269 $ WRITE SYS$OUTPUT ""
270 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
271 $ WRITE SYS$OUTPUT ""
277 $! End The File Exists Check.
281 $! Tell The User What File We Are Compiling.
283 $ WRITE SYS$OUTPUT " ",FILE_NAME,".c"
287 $ ON ERROR THEN GOTO NEXT_FILE
288 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
290 $! Add It To The Library.
292 $ LIBRARY/REPLACE/OBJECT 'SSL_LIB' 'OBJECT_FILE'
294 $! Time To Clean Up The Object File.
296 $ DELETE 'OBJECT_FILE';*
298 $! Go Back And Get The Next File Name.
302 $! All Done With This Library.
306 $! Tell The User That We Are All Done.
308 $ WRITE SYS$OUTPUT "Library ",SSL_LIB," Compiled."
315 $! Check To See If We Have The Proper Libraries.
319 $! Check To See If We Have A Linker Option File.
321 $ GOSUB CHECK_OPT_FILE
323 $! Check To See If The File We Want To Compile Is Actually There.
325 $ IF (F$SEARCH("SYS$DISK:[]SSL_TASK.C").EQS."")
328 $! Tell The User That The File Dosen't Exist.
330 $ WRITE SYS$OUTPUT ""
331 $ WRITE SYS$OUTPUT "The File SSL_TASK.C Dosen't Exist."
332 $ WRITE SYS$OUTPUT ""
338 $! End The SSL_TASK.C File Check.
342 $ COMPILEWITH_CC5 = "" !!! ",ssl_task,"
344 $! Tell The User We Are Creating The SSL_TASK.
346 $! Tell The User We Are Creating The SSL_TASK.
348 $ WRITE SYS$OUTPUT "Creating SSL_TASK OSU HTTP SSL Engine."
350 $! Tell The User What File We Are Compiling.
352 $ FILE_NAME = "ssl_task"
353 $ WRITE SYS$OUTPUT " ",FILE_NAME,".c"
357 $ ON ERROR THEN GOTO SSL_TASK_END
359 $ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ ","
360 $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
362 $ if (.not. CC5_SHOWN)
365 $ write sys$output " \Using special rule (5)"
367 $ write /symbol sys$output x
369 $ CC5 /OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.C
371 $ CC /OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.C
376 $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_DIR'SSL_TASK.EXE -
377 'OBJ_DIR'SSL_TASK.OBJ, -
379 'CRYPTO_LIB'/LIBRARY -
389 $! Check For The Link Option FIle.
393 $! Check To See If We Need To Make A VAX C Option File.
395 $ IF (COMPILER.EQS."VAXC")
398 $! Check To See If We Already Have A VAX C Linker Option File.
400 $ IF (F$SEARCH(OPT_FILE).EQS."")
403 $! We Need A VAX C Linker Option File.
408 ! Default System Options File To Link Against
409 ! The Sharable VAX C Runtime Library.
411 SYS$SHARE:VAXCRTL.EXE/SHARE
414 $! End The Option File Check.
418 $! End The VAXC Check.
422 $! Check To See If We Need A GNU C Option File.
424 $ IF (COMPILER.EQS."GNUC")
427 $! Check To See If We Already Have A GNU C Linker Option File.
429 $ IF (F$SEARCH(OPT_FILE).EQS."")
432 $! We Need A GNU C Linker Option File.
437 ! Default System Options File To Link Against
438 ! The Sharable C Runtime Library.
440 GNU_CC:[000000]GCCLIB/LIBRARY
441 SYS$SHARE:VAXCRTL/SHARE
444 $! End The Option File Check.
448 $! End The GNU C Check.
452 $! Check To See If We Need A DEC C Option File.
454 $ IF (COMPILER.EQS."DECC")
457 $! Check To See If We Already Have A DEC C Linker Option File.
459 $ IF (F$SEARCH(OPT_FILE).EQS."")
462 $! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
464 $ IF (ARCH.EQS."VAX")
467 $! We Need A DEC C Linker Option File For VAX.
472 ! Default System Options File To Link Against
473 ! The Sharable DEC C Runtime Library.
475 SYS$SHARE:DECC$SHR.EXE/SHARE
482 $! Create The non-VAX Linker Option File.
487 ! Default System Options File For non-VAX To Link Against
488 ! The Sharable C Runtime Library.
490 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
491 SYS$SHARE:CMA$OPEN_RTL/SHARE
494 $! End The DEC C Option File Check.
498 $! End The Option File Search.
502 $! End The DEC C Check.
506 $! Tell The User What Linker Option File We Are Using.
508 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
515 $! Look For The VAX Library LIBSSL.OLB.
517 $ IF (F$SEARCH(SSL_LIB).EQS."")
520 $! Tell The User We Can't Find The LIBSSL.OLB Library.
522 $ WRITE SYS$OUTPUT ""
523 $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
524 $ WRITE SYS$OUTPUT "We Can't Link Without It."
525 $ WRITE SYS$OUTPUT ""
527 $! Since We Can't Link Without It, Exit.
531 $! End The LIBSSL.OLB Library Check.
535 $! Look For The Library LIBCRYPTO.OLB.
537 $ IF (F$SEARCH(CRYPTO_LIB).EQS."")
540 $! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
542 $ WRITE SYS$OUTPUT ""
543 $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
544 $ WRITE SYS$OUTPUT "We Can't Link Without It."
545 $ WRITE SYS$OUTPUT ""
547 $! Since We Can't Link Without It, Exit.
551 $! End The LIBCRYPTO.OLB Library Check.
559 $! Check The User's Options.
563 $! Check To See If P1 Is Blank.
568 $! P1 Is Blank, So Build Everything.
576 $! Else, Check To See If P1 Has A Valid Argument.
578 $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."SSL_TASK")
589 $! Tell The User We Don't Know What They Want.
591 $ WRITE SYS$OUTPUT ""
592 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
593 $ WRITE SYS$OUTPUT ""
594 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
595 $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.SSL]LIBSSL.OLB Library."
596 $ WRITE SYS$OUTPUT " SSL_TASK : To Compile Just The [.xxx.EXE.SSL]SSL_TASK.EXE Program."
597 $ WRITE SYS$OUTPUT ""
598 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
599 $ WRITE SYS$OUTPUT ""
600 $ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture."
601 $ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture."
602 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
603 $ WRITE SYS$OUTPUT ""
609 $! End The Valid Argument Check.
617 $! Check To See If P2 Is Blank.
619 $ IF (P2.EQS."NODEBUG")
622 $! P2 Is NODEBUG, So Compile Without Debugger Information.
624 $ DEBUGGER = "NODEBUG"
626 $ TRACEBACK = "NOTRACEBACK"
627 $ GCC_OPTIMIZE = "OPTIMIZE"
628 $ CC_OPTIMIZE = "OPTIMIZE"
629 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
630 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
636 $! Check To See If We Are To Compile With Debugger Information.
638 $ IF (P2.EQS."DEBUG")
641 $! Compile With Debugger Information.
645 $ TRACEBACK = "TRACEBACK"
646 $ GCC_OPTIMIZE = "NOOPTIMIZE"
647 $ CC_OPTIMIZE = "NOOPTIMIZE"
648 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
649 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
652 $! Tell The User Entered An Invalid Option.
654 $ WRITE SYS$OUTPUT ""
655 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
656 $ WRITE SYS$OUTPUT ""
657 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
658 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
659 $ WRITE SYS$OUTPUT ""
665 $! End The Valid Argument Check.
673 $! Special Threads For OpenVMS v7.1 Or Later
675 $! Written By: Richard Levitte
676 $! richard@levitte.org
679 $! Check To See If We Have A Option For P5.
684 $! Get The Version Of VMS We Are Using.
687 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
688 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
690 $! Check To See If The VMS Version Is v7.1 Or Later.
695 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
697 $ ISSEVEN := ,PTHREAD_USE_D4
699 $! End The VMS Version Check.
707 $! Check P6 (POINTER_SIZE).
709 $ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX")
714 $ POINTER_SIZE = " /POINTER_SIZE=32"
716 $ POINTER_SIZE = F$EDIT( P6, "COLLAPSE, UPCASE")
717 $ IF ((POINTER_SIZE .EQS. "64") .OR. -
718 (POINTER_SIZE .EQS. "64=") .OR. -
719 (POINTER_SIZE .EQS. "64=ARGV"))
721 $ ARCHD = ARCH+ "_64"
723 $ POINTER_SIZE = " /POINTER_SIZE=64"
726 $! Tell The User Entered An Invalid Option.
728 $ WRITE SYS$OUTPUT ""
729 $ WRITE SYS$OUTPUT "The Option ", P6, -
730 " Is Invalid. The Valid Options Are:"
731 $ WRITE SYS$OUTPUT ""
733 " """" : Compile with default (short) pointers."
735 " 32 : Compile with 32-bit (short) pointers."
737 " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
739 " 64= : Compile with 64-bit (long) pointers (no ARGV)."
741 " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
742 $ WRITE SYS$OUTPUT ""
752 $! End The P6 (POINTER_SIZE) Check.
756 $! Set basic C compiler /INCLUDE directories.
758 $ CC_INCLUDES = "SYS$DISK:[-.CRYPTO],SYS$DISK:[-]"
760 $! Check To See If P3 Is Blank.
765 $! O.K., The User Didn't Specify A Compiler, Let's Try To
766 $! Find Out Which One To Use.
768 $! Check To See If We Have GNU C.
770 $ IF (F$TRNLNM("GNU_CC").NES."")
773 $! Looks Like GNUC, Set To Use GNUC.
777 $! End The GNU C Compiler Check.
781 $! Check To See If We Have VAXC Or DECC.
783 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
786 $! Looks Like DECC, Set To Use DECC.
794 $! Looks Like VAXC, Set To Use VAXC.
798 $! End The VAXC Compiler Check.
802 $! End The DECC & VAXC Compiler Check.
806 $! End The Compiler Check.
810 $! Check To See If We Have A Option For P4.
815 $! Find out what socket library we have available
817 $ IF F$PARSE("SOCKETSHR:") .NES. ""
820 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
826 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
828 $! Else, let's look for something else
832 $! Like UCX (the reason to do this before Multinet is that the UCX
833 $! emulation is easier to use...)
835 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
836 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
837 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
840 $! Last resort: a UCX or UCX-compatible library
846 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
854 $! Set Up Initial CC Definitions, Possibly With User Ones
856 $ CCDEFS = "TCPIP_TYPE_''P4'"
857 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
859 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
860 $ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
861 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
863 $ IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
864 $ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
867 $! Check To See If We Have A ZLIB Option.
873 $! Check for expected ZLIB files.
876 $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
877 $ if (f$search( file1) .eqs. "")
879 $ WRITE SYS$OUTPUT ""
880 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
881 $ WRITE SYS$OUTPUT " Can't find header: ''file1'"
884 $ file1 = f$parse( "A.;", ZLIB)- "A.;"
886 $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
887 $ if (f$search( file2) .eqs. "")
891 $ WRITE SYS$OUTPUT ""
892 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
894 $ WRITE SYS$OUTPUT " Can't find library: ''file2'"
895 $ WRITE SYS$OUTPUT ""
900 $ WRITE SYS$OUTPUT ""
908 $ CCDEFS = """ZLIB=1"", "+ CCDEFS
909 $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
910 $ ZLIB_LIB = ", ''file2' /library"
914 $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
916 $! End The ZLIB Check.
920 $! Check To See If The User Entered A Valid Parameter.
922 $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
925 $! Check To See If The User Wanted DECC.
930 $! Looks Like DECC, Set To Use DECC.
934 $! Tell The User We Are Using DECC.
936 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
941 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
943 $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
944 "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
945 " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
947 $! Define The Linker Options File Name.
949 $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
955 $! Check To See If We Are To Use VAXC.
960 $! Looks Like VAXC, Set To Use VAXC.
964 $! Tell The User We Are Using VAX C.
966 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
968 $! Compile Using VAXC.
973 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
976 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
977 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
978 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
979 $ CCDEFS = CCDEFS + ",""VAXC"""
981 $! Define <sys> As SYS$COMMON:[SYSLIB]
983 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
985 $! Define The Linker Options File Name.
987 $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
993 $! Check To See If We Are To Use GNU C.
998 $! Looks Like GNUC, Set To Use GNUC.
1002 $! Tell The User We Are Using GNUC.
1004 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
1008 $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
1009 $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1010 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
1012 $! Define The Linker Options File Name.
1014 $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
1016 $! End The GNU C Check.
1020 $! Set up default defines
1022 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
1024 $! Finish up the definition of CC.
1026 $ IF COMPILER .EQS. "DECC"
1028 $! Not all compiler versions support MAYLOSEDATA3.
1029 $ OPT_TEST = "MAYLOSEDATA3"
1030 $ DEFINE /USER_MODE SYS$ERROR NL:
1031 $ DEFINE /USER_MODE SYS$OUTPUT NL:
1032 $ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
1033 /WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
1036 $ IF CCDISABLEWARNINGS .NES. "" THEN -
1037 CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
1038 $ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
1040 $ IF CCDISABLEWARNINGS .EQS. ""
1042 $ CC4DISABLEWARNINGS = "DOLLARID"
1044 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
1045 $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1047 $ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
1049 $ CCDISABLEWARNINGS = ""
1050 $ CC4DISABLEWARNINGS = ""
1052 $ CC2 = CC + " /DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS
1053 $ CC3 = CC + " /DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
1054 $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1055 $ IF COMPILER .EQS. "DECC"
1057 $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1058 $ CC5 = CC3 - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1064 $! Show user the result
1066 $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
1068 $! Else The User Entered An Invalid Argument.
1072 $! Tell The User We Don't Know What They Want.
1074 $ WRITE SYS$OUTPUT ""
1075 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1076 $ WRITE SYS$OUTPUT ""
1077 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
1078 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
1079 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
1080 $ WRITE SYS$OUTPUT ""
1087 $! Time to check the contents, and to make sure we get the correct library.
1089 $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
1090 .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
1093 $! Check to see if SOCKETSHR was chosen
1095 $ IF P4.EQS."SOCKETSHR"
1098 $! Set the library to use SOCKETSHR
1100 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
1102 $! Done with SOCKETSHR
1106 $! Check to see if MULTINET was chosen
1108 $ IF P4.EQS."MULTINET"
1111 $! Set the library to use UCX emulation.
1115 $! Done with MULTINET
1119 $! Check to see if UCX was chosen
1124 $! Set the library to use UCX.
1126 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
1127 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1129 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
1131 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1132 TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
1139 $! Check to see if TCPIP was chosen
1144 $! Set the library to use TCPIP (post UCX).
1146 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
1152 $! Check to see if NONE was chosen
1157 $! Do not use a TCPIP library.
1167 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
1169 $! Else The User Entered An Invalid Argument.
1173 $! Tell The User We Don't Know What They Want.
1175 $ WRITE SYS$OUTPUT ""
1176 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
1177 $ WRITE SYS$OUTPUT ""
1178 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1179 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1180 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1181 $ WRITE SYS$OUTPUT ""
1187 $! Done with TCP/IP libraries
1191 $! Time To RETURN...
1197 $! Save old value of the logical name OPENSSL
1199 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1201 $! Save directory information
1203 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1204 $ __HERE = F$EDIT(__HERE,"UPCASE")
1205 $ __TOP = __HERE - "SSL]"
1206 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1208 $! Set up the logical name OPENSSL to point at the include directory
1210 $ DEFINE OPENSSL/NOLOG '__INCLUDE'
1218 $! Restore the logical name OPENSSL if it had a value
1220 $ IF __SAVE_OPENSSL .EQS. ""
1224 $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'