3 $! Written By: Robert Byer
5 $! A-Com Computing, Inc.
6 $! byer@mail.all-net.net
8 $! Changes by Richard Levitte <richard@levitte.org>
9 $! Zoltan Arpadffy <arpadffy@polarhome.com>
11 $! This command files compiles and creates all the various different
12 $! "test" programs for the different types of encryption for OpenSSL.
13 $! It was written so it would try to determine what "C" compiler to
14 $! use or you can specify which "C" compiler to use.
16 $! The test "executables" will be placed in a directory called
17 $! [.xxx.EXE.TEST] where "xxx" denotes ALPHA, IA64, or VAX, depending
18 $! on your machine architecture.
20 $! Specify DEBUG or NODEBUG P1 to compile with or without debugger
23 $! Specify which compiler at P2 to try to compile under.
29 $! If you don't specify a compiler, it will try to determine which
30 $! "C" compiler to use.
32 $! P3, if defined, sets a TCP/IP library to use, through one of the following
36 $! SOCKETSHR for SOCKETSHR+NETLIB
38 $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
41 $! P5, if defined, specifies the C pointer size. Ignored on VAX.
42 $! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
43 $! Supported values are:
45 $! "" Compile with default (/NOPOINTER_SIZE)
46 $! 32 Compile with /POINTER_SIZE=32 (SHORT)
47 $! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
48 $! (Automatically select ARGV if compiler supports it.)
49 $! 64= Compile with /POINTER_SIZE=64 (LONG).
50 $! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
52 $! P6, if defined, specifies a directory where ZLIB files (zlib.h,
53 $! libz.olb) may be found. Optionally, a non-default object library
54 $! name may be included ("dev:[dir]libz_64.olb", for example).
59 $ proc = f$environment( "procedure")
60 $ write sys$output "@@@ "+ -
61 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
63 $! Define A TCP/IP Library That We Will Need To Link To.
64 $! (That is, If We Need To Link To One.)
69 $! Check Which Architecture We Are Using.
71 $ if (f$getsyi( "cpu") .lt. 128)
75 $ ARCH = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
76 $ if (ARCH .eqs. "") then ARCH = "UNK"
84 $! Check To Make Sure We Have Valid Command Line Parameters.
88 $! Define The OBJ and EXE Directories.
90 $ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.TEST]
91 $ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.TEST]
93 $! Specify the destination directory in any /MAP option.
95 $ if (LINKMAP .eqs. "MAP")
97 $ LINKMAP = LINKMAP+ "=''EXE_DIR'"
100 $! Add the location prefix to the linker options file name.
102 $ if (OPT_FILE .nes. "")
104 $ OPT_FILE = EXE_DIR+ OPT_FILE
107 $! Initialise logical names and such
111 $! Tell The User What Kind of Machine We Run On.
113 $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
115 $! Define The CRYPTO-LIB We Are To Use.
117 $ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
119 $! Define The SSL We Are To Use.
121 $ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB
123 $! Create the OBJ and EXE Directories, if needed.
125 $ IF (F$PARSE(OBJ_DIR).EQS."") THEN -
126 CREATE /DIRECTORY 'OBJ_DIR'
127 $ IF (F$PARSE(EXE_DIR).EQS."") THEN -
128 CREATE /DIRECTORY 'EXE_DIR'
130 $! Check To See If We Have The Proper Libraries.
134 $! Check To See If We Have A Linker Option File.
136 $ GOSUB CHECK_OPT_FILE
138 $! Define The TEST Files.
139 $! NOTE: Some might think this list ugly. However, it's made this way to
140 $! reflect the EXE variable in Makefile as closely as possible,
141 $! thereby making it fairly easy to verify that the lists are the same.
143 $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ -
144 "MD2TEST,MD4TEST,MD5TEST,HMACTEST,WP_TEST,"+ -
145 "RC2TEST,RC4TEST,RC5TEST,"+ -
146 "DESTEST,SHATEST,SHA1TEST,SHA256T,SHA512T,"+ -
147 "MDC2TEST,RMDTEST,"+ -
148 "RANDTEST,DHTEST,ENGINETEST,"+ -
149 "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ -
150 "EVP_TEST,IGETEST,JPAKETEST,SRPTEST,"+ -
151 "ASN1TEST,HEARTBEAT_TEST,CONSTANT_TIME_TEST"
152 $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well?
154 $! Additional directory information.
155 $ T_D_BNTEST := [-.crypto.bn]
156 $ T_D_ECTEST := [-.crypto.ec]
157 $ T_D_ECDSATEST := [-.crypto.ecdsa]
158 $ T_D_ECDHTEST := [-.crypto.ecdh]
159 $ T_D_IDEATEST := [-.crypto.idea]
160 $ T_D_MD2TEST := [-.crypto.md2]
161 $ T_D_MD4TEST := [-.crypto.md4]
162 $ T_D_MD5TEST := [-.crypto.md5]
163 $ T_D_HMACTEST := [-.crypto.hmac]
164 $ T_D_WP_TEST := [-.crypto.whrlpool]
165 $ T_D_RC2TEST := [-.crypto.rc2]
166 $ T_D_RC4TEST := [-.crypto.rc4]
167 $ T_D_RC5TEST := [-.crypto.rc5]
168 $ T_D_DESTEST := [-.crypto.des]
169 $ T_D_SHATEST := [-.crypto.sha]
170 $ T_D_SHA1TEST := [-.crypto.sha]
171 $ T_D_SHA256T := [-.crypto.sha]
172 $ T_D_SHA512T := [-.crypto.sha]
173 $ T_D_MDC2TEST := [-.crypto.mdc2]
174 $ T_D_RMDTEST := [-.crypto.ripemd]
175 $ T_D_RANDTEST := [-.crypto.rand]
176 $ T_D_DHTEST := [-.crypto.dh]
177 $ T_D_ENGINETEST := [-.crypto.engine]
178 $ T_D_BFTEST := [-.crypto.bf]
179 $ T_D_CASTTEST := [-.crypto.cast]
180 $ T_D_SSLTEST := [-.ssl]
181 $ T_D_EXPTEST := [-.crypto.bn]
182 $ T_D_DSATEST := [-.crypto.dsa]
183 $ T_D_RSA_TEST := [-.crypto.rsa]
184 $ T_D_EVP_TEST := [-.crypto.evp]
185 $ T_D_IGETEST := [-.test]
186 $ T_D_JPAKETEST := [-.crypto.jpake]
187 $ T_D_SRPTEST := [-.crypto.srp]
188 $ T_D_ASN1TEST := [-.test]
189 $ T_D_HEARTBEAT_TEST := [-.ssl]
190 $ T_D_CONSTANT_TIME_TEST := [-.crypto]
192 $ TCPIP_PROGRAMS = ",,"
193 $ IF COMPILER .EQS. "VAXC" THEN -
194 TCPIP_PROGRAMS = ",SSLTEST,"
196 $! Define A File Counter And Set It To "0".
200 $! Top Of The File Loop.
204 $! O.K, Extract The File Name From The File List.
206 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES)
208 $! Check To See If We Are At The End Of The File List.
210 $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
212 $! Increment The Counter.
214 $ FILE_COUNTER = FILE_COUNTER + 1
216 $! Create The Source File Name.
218 $ SOURCE_FILE = "SYS$DISK:" + T_D_'FILE_NAME' + FILE_NAME + ".C"
220 $! Create The Object File Name.
222 $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
224 $! Create The Executable File Name.
226 $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE"
227 $ ON WARNING THEN GOTO NEXT_FILE
229 $! Check To See If The File We Want To Compile Actually Exists.
231 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
234 $! Tell The User That The File Dosen't Exist.
236 $ WRITE SYS$OUTPUT ""
237 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
238 $ WRITE SYS$OUTPUT ""
245 $! Tell The User What We Are Building.
247 $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program."
251 $ ON ERROR THEN GOTO NEXT_FILE
252 $ CC /OBJECT='OBJECT_FILE' 'SOURCE_FILE'
253 $ ON WARNING THEN GOTO NEXT_FILE
255 $! Check If What We Are About To Compile Works Without A TCP/IP Library.
257 $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS))
260 $! Inform The User That A TCP/IP Library Is Needed To Compile This Program.
263 FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..."
266 $! End The TCP/IP Library Check.
270 $! Link The Program, Check To See If We Need To Link With RSAREF Or Not.
271 $! Check To See If We Are To Link With A Specific TCP/IP Library.
273 $! Don't Link With The RSAREF Routines And TCP/IP Library.
275 $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' -
277 'SSL_LIB' /LIBRARY, -
278 'CRYPTO_LIB' /LIBRARY -
283 $! Go Back And Do It Again.
287 $! All Done With This Library Part.
291 $! All Done, Time To Exit.
297 $! Check For The Link Option FIle.
301 $! Check To See If We Need To Make A VAX C Option File.
303 $ IF (COMPILER.EQS."VAXC")
306 $! Check To See If We Already Have A VAX C Linker Option File.
308 $ IF (F$SEARCH(OPT_FILE).EQS."")
311 $! We Need A VAX C Linker Option File.
316 ! Default System Options File To Link Against
317 ! The Sharable VAX C Runtime Library.
319 SYS$SHARE:VAXCRTL.EXE /SHAREABLE
322 $! End The Option File Check.
326 $! End The VAXC Check.
330 $! Check To See If We Need A GNU C Option File.
332 $ IF (COMPILER.EQS."GNUC")
335 $! Check To See If We Already Have A GNU C Linker Option File.
337 $ IF (F$SEARCH(OPT_FILE).EQS."")
340 $! We Need A GNU C Linker Option File.
345 ! Default System Options File To Link Against
346 ! The Sharable C Runtime Library.
348 GNU_CC:[000000]GCCLIB.OLB /LIBRARY
349 SYS$SHARE:VAXCRTL.EXE /SHAREABLE
352 $! End The Option File Check.
356 $! End The GNU C Check.
360 $! Check To See If We Need A DEC C Option File.
362 $ IF (COMPILER.EQS."DECC")
365 $! Check To See If We Already Have A DEC C Linker Option File.
367 $ IF (F$SEARCH(OPT_FILE).EQS."")
370 $! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
372 $ IF (ARCH.EQS."VAX")
375 $! We Need A DEC C Linker Option File For VAX.
380 ! Default System Options File To Link Against
381 ! The Sharable DEC C Runtime Library.
383 SYS$SHARE:DECC$SHR.EXE /SHAREABLE
390 $! Create The non-VAX Linker Option File.
395 ! Default System Options File For non-VAX To Link Against
396 ! The Sharable C Runtime Library.
398 SYS$SHARE:CMA$OPEN_LIB_SHR.EXE /SHAREABLE
399 SYS$SHARE:CMA$OPEN_RTL.EXE /SHAREABLE
402 $! End The DEC C Option File Check.
406 $! End The Option File Search.
410 $! End The DEC C Check.
414 $! Tell The User What Linker Option File We Are Using.
416 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
422 $! Check To See If We Have The Appropiate Libraries.
426 $! Look For The Library LIBCRYPTO.OLB.
428 $ IF (F$SEARCH(CRYPTO_LIB).EQS."")
431 $! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
433 $ WRITE SYS$OUTPUT ""
434 $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
435 $ WRITE SYS$OUTPUT "We Can't Link Without It."
436 $ WRITE SYS$OUTPUT ""
438 $! Since We Can't Link Without It, Exit.
442 $! End The Crypto Library Check.
446 $! Look For The Library LIBSSL.OLB.
448 $ IF (F$SEARCH(SSL_LIB).EQS."")
451 $! Tell The User We Can't Find The LIBSSL.OLB Library.
453 $ WRITE SYS$OUTPUT ""
454 $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
455 $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It."
456 $ WRITE SYS$OUTPUT ""
458 $! Since We Can't Link Without It, Exit.
462 $! End The SSL Library Check.
470 $! Check The User's Options.
474 $! Set basic C compiler /INCLUDE directories.
476 $ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]"
478 $! Check To See If P1 Is Blank.
480 $ IF (P1.EQS."NODEBUG")
483 $! P1 Is NODEBUG, So Compile Without Debugger Information.
485 $ DEBUGGER = "NODEBUG"
487 $ TRACEBACK = "NOTRACEBACK"
488 $ GCC_OPTIMIZE = "OPTIMIZE"
489 $ CC_OPTIMIZE = "OPTIMIZE"
490 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
491 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
497 $! Check To See If We Are To Compile With Debugger Information.
499 $ IF (P1.EQS."DEBUG")
502 $! Compile With Debugger Information.
506 $ TRACEBACK = "TRACEBACK"
507 $ GCC_OPTIMIZE = "NOOPTIMIZE"
508 $ CC_OPTIMIZE = "NOOPTIMIZE"
509 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
510 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
516 $! Tell The User Entered An Invalid Option.
518 $ WRITE SYS$OUTPUT ""
519 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
520 $ WRITE SYS$OUTPUT ""
521 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
522 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
523 $ WRITE SYS$OUTPUT ""
529 $! End The Valid Argument Check.
537 $! Check P5 (POINTER_SIZE).
539 $ IF (P5 .NES. "") .AND. (ARCH .NES. "VAX")
544 $ POINTER_SIZE = " /POINTER_SIZE=32"
546 $ POINTER_SIZE = F$EDIT( P5, "COLLAPSE, UPCASE")
547 $ IF ((POINTER_SIZE .EQS. "64") .OR. -
548 (POINTER_SIZE .EQS. "64=") .OR. -
549 (POINTER_SIZE .EQS. "64=ARGV"))
551 $ ARCHD = ARCH+ "_64"
553 $ IF (F$EXTRACT( 2, 1, POINTER_SIZE) .EQS. "=")
555 $! Explicit user choice: "64" or "64=ARGV".
556 $ IF (POINTER_SIZE .EQS. "64=") THEN POINTER_SIZE = "64"
559 $ DEFINE /USER_MODE SYS$OUTPUT NL:
560 $ DEFINE /USER_MODE SYS$ERROR NL:
561 $ CC /NOLIST /NOOBJECT /POINTER_SIZE=64=ARGV NL:
562 $ IF ($STATUS .AND. %X0FFF0000) .EQ. %X00030000
564 $ ! If we got here, it means DCL complained like this:
565 $ ! %DCL-W-NOVALU, value not allowed - remove value specification
568 $ ! If the compiler was run, logicals defined in /USER would
569 $ ! have been deassigned automatically. However, when DCL
570 $ ! complains, they aren't, so we do it here (it might be
571 $ ! unnecessary, but just in case there will be another error
572 $ ! message further on that we don't want to miss)
573 $ DEASSIGN /USER_MODE SYS$ERROR
574 $ DEASSIGN /USER_MODE SYS$OUTPUT
576 $ POINTER_SIZE = POINTER_SIZE + "=ARGV"
580 $ POINTER_SIZE = " /POINTER_SIZE=''POINTER_SIZE'"
583 $! Tell The User Entered An Invalid Option.
585 $ WRITE SYS$OUTPUT ""
586 $ WRITE SYS$OUTPUT "The Option ", P5, -
587 " Is Invalid. The Valid Options Are:"
588 $ WRITE SYS$OUTPUT ""
590 " """" : Compile with default (short) pointers."
592 " 32 : Compile with 32-bit (short) pointers."
594 " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
596 " 64= : Compile with 64-bit (long) pointers (no ARGV)."
598 " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
599 $ WRITE SYS$OUTPUT ""
609 $! End The P5 (POINTER_SIZE) Check.
613 $! Check To See If P2 Is Blank.
618 $! O.K., The User Didn't Specify A Compiler, Let's Try To
619 $! Find Out Which One To Use.
621 $! Check To See If We Have GNU C.
623 $ IF (F$TRNLNM("GNU_CC").NES."")
626 $! Looks Like GNUC, Set To Use GNUC.
630 $! End The GNU C Compiler Check.
634 $! Check To See If We Have VAXC Or DECC.
636 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
639 $! Looks Like DECC, Set To Use DECC.
647 $! Looks Like VAXC, Set To Use VAXC.
651 $! End The VAXC Compiler Check.
655 $! End The DECC & VAXC Compiler Check.
659 $! End The Compiler Check.
663 $! Check To See If We Have A Option For P3.
668 $! Find out what socket library we have available
670 $ IF F$PARSE("SOCKETSHR:") .NES. ""
673 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
679 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
681 $! Else, let's look for something else
685 $! Like UCX (the reason to do this before Multinet is that the UCX
686 $! emulation is easier to use...)
688 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
689 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
690 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
693 $! Last resort: a UCX or UCX-compatible library
699 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
707 $! Set Up Initial CC Definitions, Possibly With User Ones
709 $ CCDEFS = "TCPIP_TYPE_''P3'"
710 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
712 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
713 $ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
714 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
715 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
717 $! Check To See If We Have A ZLIB Option.
723 $! Check for expected ZLIB files.
726 $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
727 $ if (f$search( file1) .eqs. "")
729 $ WRITE SYS$OUTPUT ""
730 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
731 $ WRITE SYS$OUTPUT " Can't find header: ''file1'"
734 $ file1 = f$parse( "A.;", ZLIB)- "A.;"
736 $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
737 $ if (f$search( file2) .eqs. "")
741 $ WRITE SYS$OUTPUT ""
742 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
744 $ WRITE SYS$OUTPUT " Can't find library: ''file2'"
745 $ WRITE SYS$OUTPUT ""
750 $ WRITE SYS$OUTPUT ""
758 $ CCDEFS = """ZLIB=1"", "+ CCDEFS
759 $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
760 $ ZLIB_LIB = ", ''file2' /library"
764 $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
770 $! Check To See If The User Entered A Valid Parameter.
772 $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
775 $! Check To See If The User Wanted DECC.
780 $! Looks Like DECC, Set To Use DECC.
784 $! Tell The User We Are Using DECC.
786 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
791 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
793 $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
794 "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
795 " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
797 $! Define The Linker Options File Name.
799 $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
805 $! Check To See If We Are To Use VAXC.
810 $! Looks Like VAXC, Set To Use VAXC.
814 $! Tell The User We Are Using VAX C.
816 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
818 $! Compile Using VAXC.
823 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
826 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC /VAXC"
827 $ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /NOLIST" + -
828 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
829 $ CCDEFS = CCDEFS + ",""VAXC"""
831 $! Define <sys> As SYS$COMMON:[SYSLIB]
833 $ DEFINE /NOLOG SYS SYS$COMMON:[SYSLIB]
835 $! Define The Linker Options File Name.
837 $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
843 $! Check To See If We Are To Use GNU C.
848 $! Looks Like GNUC, Set To Use GNUC.
852 $! Tell The User We Are Using GNUC.
854 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
858 $ CC = "GCC /NOCASE_HACK /''GCC_OPTIMIZE' /''DEBUGGER' /NOLIST" + -
859 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
861 $! Define The Linker Options File Name.
863 $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
865 $! End The GNU C Check.
869 $! Set up default defines
871 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
873 $! Finish up the definition of CC.
875 $ IF COMPILER .EQS. "DECC"
877 $ IF CCDISABLEWARNINGS .EQS. ""
879 $ CC4DISABLEWARNINGS = "DOLLARID"
881 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
882 $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
884 $ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
886 $ CCDISABLEWARNINGS = ""
887 $ CC4DISABLEWARNINGS = ""
889 $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
891 $! Show user the result
893 $ WRITE /SYMBOL SYS$OUTPUT "Main Compiling Command: ", CC
895 $! Else The User Entered An Invalid Argument.
899 $! Tell The User We Don't Know What They Want.
901 $ WRITE SYS$OUTPUT ""
902 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
903 $ WRITE SYS$OUTPUT ""
904 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
905 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
906 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
907 $ WRITE SYS$OUTPUT ""
914 $! Time to check the contents, and to make sure we get the correct library.
916 $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
917 .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
920 $! Check to see if SOCKETSHR was chosen
922 $ IF P3.EQS."SOCKETSHR"
925 $! Set the library to use SOCKETSHR
927 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
929 $! Done with SOCKETSHR
933 $! Check to see if MULTINET was chosen
935 $ IF P3.EQS."MULTINET"
938 $! Set the library to use UCX emulation.
942 $! Done with MULTINET
946 $! Check to see if UCX was chosen
951 $! Set the library to use UCX.
953 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
954 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
956 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
958 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
959 TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
966 $! Check to see if TCPIP was chosen
971 $! Set the library to use TCPIP (post UCX).
973 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
979 $! Check to see if NONE was chosen
984 $! Do not use a TCPIP library.
994 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
996 $! Else The User Entered An Invalid Argument.
1000 $! Tell The User We Don't Know What They Want.
1002 $ WRITE SYS$OUTPUT ""
1003 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1004 $ WRITE SYS$OUTPUT ""
1005 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1006 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1007 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1008 $ WRITE SYS$OUTPUT ""
1014 $! Done with TCP/IP libraries
1018 $! Special Threads For OpenVMS v7.1 Or Later
1020 $! Written By: Richard Levitte
1021 $! richard@levitte.org
1024 $! Check To See If We Have A Option For P4.
1029 $! Get The Version Of VMS We Are Using.
1032 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
1033 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
1035 $! Check To See If The VMS Version Is v7.1 Or Later.
1040 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
1042 $ ISSEVEN := ,PTHREAD_USE_D4
1044 $! End The VMS Version Check.
1048 $! End The P4 Check.
1052 $! Time To RETURN...
1058 $! Save old value of the logical name OPENSSL
1060 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1062 $! Save directory information
1064 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1065 $ __HERE = F$EDIT(__HERE,"UPCASE")
1066 $ __TOP = __HERE - "TEST]"
1067 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1069 $! Set up the logical name OPENSSL to point at the include directory
1071 $ DEFINE OPENSSL /NOLOG '__INCLUDE'
1079 $! Restore the logical name OPENSSL if it had a value
1081 $ IF __SAVE_OPENSSL .EQS. ""
1085 $ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL'