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,V3NAMETEST,HEARTBEAT_TEST,"+ -
153 $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well?
155 $! Additional directory information.
156 $ T_D_BNTEST := [-.crypto.bn]
157 $ T_D_ECTEST := [-.crypto.ec]
158 $ T_D_ECDSATEST := [-.crypto.ecdsa]
159 $ T_D_ECDHTEST := [-.crypto.ecdh]
160 $ T_D_IDEATEST := [-.crypto.idea]
161 $ T_D_MD2TEST := [-.crypto.md2]
162 $ T_D_MD4TEST := [-.crypto.md4]
163 $ T_D_MD5TEST := [-.crypto.md5]
164 $ T_D_HMACTEST := [-.crypto.hmac]
165 $ T_D_WP_TEST := [-.crypto.whrlpool]
166 $ T_D_RC2TEST := [-.crypto.rc2]
167 $ T_D_RC4TEST := [-.crypto.rc4]
168 $ T_D_RC5TEST := [-.crypto.rc5]
169 $ T_D_DESTEST := [-.crypto.des]
170 $ T_D_SHATEST := [-.crypto.sha]
171 $ T_D_SHA1TEST := [-.crypto.sha]
172 $ T_D_SHA256T := [-.crypto.sha]
173 $ T_D_SHA512T := [-.crypto.sha]
174 $ T_D_MDC2TEST := [-.crypto.mdc2]
175 $ T_D_RMDTEST := [-.crypto.ripemd]
176 $ T_D_RANDTEST := [-.crypto.rand]
177 $ T_D_DHTEST := [-.crypto.dh]
178 $ T_D_ENGINETEST := [-.crypto.engine]
179 $ T_D_BFTEST := [-.crypto.bf]
180 $ T_D_CASTTEST := [-.crypto.cast]
181 $ T_D_SSLTEST := [-.ssl]
182 $ T_D_EXPTEST := [-.crypto.bn]
183 $ T_D_DSATEST := [-.crypto.dsa]
184 $ T_D_RSA_TEST := [-.crypto.rsa]
185 $ T_D_EVP_TEST := [-.crypto.evp]
186 $ T_D_IGETEST := [-.test]
187 $ T_D_JPAKETEST := [-.crypto.jpake]
188 $ T_D_SRPTEST := [-.crypto.srp]
189 $ T_D_V3NAMETEST := [-.crypto.x509v3]
190 $ T_D_ASN1TEST := [-.test]
191 $ T_D_HEARTBEAT_TEST := [-.ssl]
192 $ T_D_CONSTANT_TIME_TEST := [-.crypto]
194 $ TCPIP_PROGRAMS = ",,"
195 $ IF COMPILER .EQS. "VAXC" THEN -
196 TCPIP_PROGRAMS = ",SSLTEST,"
198 $! Define A File Counter And Set It To "0".
202 $! Top Of The File Loop.
206 $! O.K, Extract The File Name From The File List.
208 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES)
210 $! Check To See If We Are At The End Of The File List.
212 $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
214 $! Increment The Counter.
216 $ FILE_COUNTER = FILE_COUNTER + 1
218 $! Create The Source File Name.
220 $ SOURCE_FILE = "SYS$DISK:" + T_D_'FILE_NAME' + FILE_NAME + ".C"
222 $! Create The Object File Name.
224 $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
226 $! Create The Executable File Name.
228 $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE"
229 $ ON WARNING THEN GOTO NEXT_FILE
231 $! Check To See If The File We Want To Compile Actually Exists.
233 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
236 $! Tell The User That The File Dosen't Exist.
238 $ WRITE SYS$OUTPUT ""
239 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
240 $ WRITE SYS$OUTPUT ""
247 $! Tell The User What We Are Building.
249 $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program."
253 $ ON ERROR THEN GOTO NEXT_FILE
254 $ CC /OBJECT='OBJECT_FILE' 'SOURCE_FILE'
255 $ ON WARNING THEN GOTO NEXT_FILE
257 $! Check If What We Are About To Compile Works Without A TCP/IP Library.
259 $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS))
262 $! Inform The User That A TCP/IP Library Is Needed To Compile This Program.
265 FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..."
268 $! End The TCP/IP Library Check.
272 $! Link The Program, Check To See If We Need To Link With RSAREF Or Not.
273 $! Check To See If We Are To Link With A Specific TCP/IP Library.
275 $! Don't Link With The RSAREF Routines And TCP/IP Library.
277 $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' -
279 'SSL_LIB' /LIBRARY, -
280 'CRYPTO_LIB' /LIBRARY -
285 $! Go Back And Do It Again.
289 $! All Done With This Library Part.
293 $! All Done, Time To Exit.
299 $! Check For The Link Option FIle.
303 $! Check To See If We Need To Make A VAX C Option File.
305 $ IF (COMPILER.EQS."VAXC")
308 $! Check To See If We Already Have A VAX C Linker Option File.
310 $ IF (F$SEARCH(OPT_FILE).EQS."")
313 $! We Need A VAX C Linker Option File.
318 ! Default System Options File To Link Against
319 ! The Sharable VAX C Runtime Library.
321 SYS$SHARE:VAXCRTL.EXE /SHAREABLE
324 $! End The Option File Check.
328 $! End The VAXC Check.
332 $! Check To See If We Need A GNU C Option File.
334 $ IF (COMPILER.EQS."GNUC")
337 $! Check To See If We Already Have A GNU C Linker Option File.
339 $ IF (F$SEARCH(OPT_FILE).EQS."")
342 $! We Need A GNU C Linker Option File.
347 ! Default System Options File To Link Against
348 ! The Sharable C Runtime Library.
350 GNU_CC:[000000]GCCLIB.OLB /LIBRARY
351 SYS$SHARE:VAXCRTL.EXE /SHAREABLE
354 $! End The Option File Check.
358 $! End The GNU C Check.
362 $! Check To See If We Need A DEC C Option File.
364 $ IF (COMPILER.EQS."DECC")
367 $! Check To See If We Already Have A DEC C Linker Option File.
369 $ IF (F$SEARCH(OPT_FILE).EQS."")
372 $! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
374 $ IF (ARCH.EQS."VAX")
377 $! We Need A DEC C Linker Option File For VAX.
382 ! Default System Options File To Link Against
383 ! The Sharable DEC C Runtime Library.
385 SYS$SHARE:DECC$SHR.EXE /SHAREABLE
392 $! Create The non-VAX Linker Option File.
397 ! Default System Options File For non-VAX To Link Against
398 ! The Sharable C Runtime Library.
400 SYS$SHARE:CMA$OPEN_LIB_SHR.EXE /SHAREABLE
401 SYS$SHARE:CMA$OPEN_RTL.EXE /SHAREABLE
404 $! End The DEC C Option File Check.
408 $! End The Option File Search.
412 $! End The DEC C Check.
416 $! Tell The User What Linker Option File We Are Using.
418 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
424 $! Check To See If We Have The Appropiate Libraries.
428 $! Look For The Library LIBCRYPTO.OLB.
430 $ IF (F$SEARCH(CRYPTO_LIB).EQS."")
433 $! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
435 $ WRITE SYS$OUTPUT ""
436 $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
437 $ WRITE SYS$OUTPUT "We Can't Link Without It."
438 $ WRITE SYS$OUTPUT ""
440 $! Since We Can't Link Without It, Exit.
444 $! End The Crypto Library Check.
448 $! Look For The Library LIBSSL.OLB.
450 $ IF (F$SEARCH(SSL_LIB).EQS."")
453 $! Tell The User We Can't Find The LIBSSL.OLB Library.
455 $ WRITE SYS$OUTPUT ""
456 $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
457 $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It."
458 $ WRITE SYS$OUTPUT ""
460 $! Since We Can't Link Without It, Exit.
464 $! End The SSL Library Check.
472 $! Check The User's Options.
476 $! Set basic C compiler /INCLUDE directories.
478 $ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]"
480 $! Check To See If P1 Is Blank.
482 $ IF (P1.EQS."NODEBUG")
485 $! P1 Is NODEBUG, So Compile Without Debugger Information.
487 $ DEBUGGER = "NODEBUG"
489 $ TRACEBACK = "NOTRACEBACK"
490 $ GCC_OPTIMIZE = "OPTIMIZE"
491 $ CC_OPTIMIZE = "OPTIMIZE"
492 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
493 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
499 $! Check To See If We Are To Compile With Debugger Information.
501 $ IF (P1.EQS."DEBUG")
504 $! Compile With Debugger Information.
508 $ TRACEBACK = "TRACEBACK"
509 $ GCC_OPTIMIZE = "NOOPTIMIZE"
510 $ CC_OPTIMIZE = "NOOPTIMIZE"
511 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
512 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
518 $! Tell The User Entered An Invalid Option.
520 $ WRITE SYS$OUTPUT ""
521 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
522 $ WRITE SYS$OUTPUT ""
523 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
524 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
525 $ WRITE SYS$OUTPUT ""
531 $! End The Valid Argument Check.
539 $! Check P5 (POINTER_SIZE).
541 $ IF (P5 .NES. "") .AND. (ARCH .NES. "VAX")
546 $ POINTER_SIZE = " /POINTER_SIZE=32"
548 $ POINTER_SIZE = F$EDIT( P5, "COLLAPSE, UPCASE")
549 $ IF ((POINTER_SIZE .EQS. "64") .OR. -
550 (POINTER_SIZE .EQS. "64=") .OR. -
551 (POINTER_SIZE .EQS. "64=ARGV"))
553 $ ARCHD = ARCH+ "_64"
555 $ IF (F$EXTRACT( 2, 1, POINTER_SIZE) .EQS. "=")
557 $! Explicit user choice: "64" or "64=ARGV".
558 $ IF (POINTER_SIZE .EQS. "64=") THEN POINTER_SIZE = "64"
561 $ DEFINE /USER_MODE SYS$OUTPUT NL:
562 $ DEFINE /USER_MODE SYS$ERROR NL:
563 $ CC /NOLIST /NOOBJECT /POINTER_SIZE=64=ARGV NL:
564 $ IF ($STATUS .AND. %X0FFF0000) .EQ. %X00030000
566 $ ! If we got here, it means DCL complained like this:
567 $ ! %DCL-W-NOVALU, value not allowed - remove value specification
570 $ ! If the compiler was run, logicals defined in /USER would
571 $ ! have been deassigned automatically. However, when DCL
572 $ ! complains, they aren't, so we do it here (it might be
573 $ ! unnecessary, but just in case there will be another error
574 $ ! message further on that we don't want to miss)
575 $ DEASSIGN /USER_MODE SYS$ERROR
576 $ DEASSIGN /USER_MODE SYS$OUTPUT
578 $ POINTER_SIZE = POINTER_SIZE + "=ARGV"
582 $ POINTER_SIZE = " /POINTER_SIZE=''POINTER_SIZE'"
585 $! Tell The User Entered An Invalid Option.
587 $ WRITE SYS$OUTPUT ""
588 $ WRITE SYS$OUTPUT "The Option ", P5, -
589 " Is Invalid. The Valid Options Are:"
590 $ WRITE SYS$OUTPUT ""
592 " """" : Compile with default (short) pointers."
594 " 32 : Compile with 32-bit (short) pointers."
596 " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
598 " 64= : Compile with 64-bit (long) pointers (no ARGV)."
600 " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
601 $ WRITE SYS$OUTPUT ""
611 $! End The P5 (POINTER_SIZE) Check.
615 $! Check To See If P2 Is Blank.
620 $! O.K., The User Didn't Specify A Compiler, Let's Try To
621 $! Find Out Which One To Use.
623 $! Check To See If We Have GNU C.
625 $ IF (F$TRNLNM("GNU_CC").NES."")
628 $! Looks Like GNUC, Set To Use GNUC.
632 $! End The GNU C Compiler Check.
636 $! Check To See If We Have VAXC Or DECC.
638 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
641 $! Looks Like DECC, Set To Use DECC.
649 $! Looks Like VAXC, Set To Use VAXC.
653 $! End The VAXC Compiler Check.
657 $! End The DECC & VAXC Compiler Check.
661 $! End The Compiler Check.
665 $! Check To See If We Have A Option For P3.
670 $! Find out what socket library we have available
672 $ IF F$PARSE("SOCKETSHR:") .NES. ""
675 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
681 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
683 $! Else, let's look for something else
687 $! Like UCX (the reason to do this before Multinet is that the UCX
688 $! emulation is easier to use...)
690 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
691 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
692 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
695 $! Last resort: a UCX or UCX-compatible library
701 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
709 $! Set Up Initial CC Definitions, Possibly With User Ones
711 $ CCDEFS = "TCPIP_TYPE_''P3'"
712 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
714 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
715 $ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
716 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
717 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
719 $! Check To See If We Have A ZLIB Option.
725 $! Check for expected ZLIB files.
728 $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
729 $ if (f$search( file1) .eqs. "")
731 $ WRITE SYS$OUTPUT ""
732 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
733 $ WRITE SYS$OUTPUT " Can't find header: ''file1'"
736 $ file1 = f$parse( "A.;", ZLIB)- "A.;"
738 $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
739 $ if (f$search( file2) .eqs. "")
743 $ WRITE SYS$OUTPUT ""
744 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
746 $ WRITE SYS$OUTPUT " Can't find library: ''file2'"
747 $ WRITE SYS$OUTPUT ""
752 $ WRITE SYS$OUTPUT ""
760 $ CCDEFS = """ZLIB=1"", "+ CCDEFS
761 $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
762 $ ZLIB_LIB = ", ''file2' /library"
766 $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
772 $! Check To See If The User Entered A Valid Parameter.
774 $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
777 $! Check To See If The User Wanted DECC.
782 $! Looks Like DECC, Set To Use DECC.
786 $! Tell The User We Are Using DECC.
788 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
793 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
795 $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
796 "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
797 " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
799 $! Define The Linker Options File Name.
801 $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
807 $! Check To See If We Are To Use VAXC.
812 $! Looks Like VAXC, Set To Use VAXC.
816 $! Tell The User We Are Using VAX C.
818 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
820 $! Compile Using VAXC.
825 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
828 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC /VAXC"
829 $ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /NOLIST" + -
830 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
831 $ CCDEFS = CCDEFS + ",""VAXC"""
833 $! Define <sys> As SYS$COMMON:[SYSLIB]
835 $ DEFINE /NOLOG SYS SYS$COMMON:[SYSLIB]
837 $! Define The Linker Options File Name.
839 $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
845 $! Check To See If We Are To Use GNU C.
850 $! Looks Like GNUC, Set To Use GNUC.
854 $! Tell The User We Are Using GNUC.
856 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
860 $ CC = "GCC /NOCASE_HACK /''GCC_OPTIMIZE' /''DEBUGGER' /NOLIST" + -
861 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
863 $! Define The Linker Options File Name.
865 $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
867 $! End The GNU C Check.
871 $! Set up default defines
873 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
875 $! Finish up the definition of CC.
877 $ IF COMPILER .EQS. "DECC"
879 $ IF CCDISABLEWARNINGS .EQS. ""
881 $ CC4DISABLEWARNINGS = "DOLLARID"
883 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
884 $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
886 $ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
888 $ CCDISABLEWARNINGS = ""
889 $ CC4DISABLEWARNINGS = ""
891 $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
893 $! Show user the result
895 $ WRITE /SYMBOL SYS$OUTPUT "Main Compiling Command: ", CC
897 $! Else The User Entered An Invalid Argument.
901 $! Tell The User We Don't Know What They Want.
903 $ WRITE SYS$OUTPUT ""
904 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
905 $ WRITE SYS$OUTPUT ""
906 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
907 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
908 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
909 $ WRITE SYS$OUTPUT ""
916 $! Time to check the contents, and to make sure we get the correct library.
918 $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
919 .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
922 $! Check to see if SOCKETSHR was chosen
924 $ IF P3.EQS."SOCKETSHR"
927 $! Set the library to use SOCKETSHR
929 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
931 $! Done with SOCKETSHR
935 $! Check to see if MULTINET was chosen
937 $ IF P3.EQS."MULTINET"
940 $! Set the library to use UCX emulation.
944 $! Done with MULTINET
948 $! Check to see if UCX was chosen
953 $! Set the library to use UCX.
955 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
956 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
958 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
960 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
961 TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
968 $! Check to see if TCPIP was chosen
973 $! Set the library to use TCPIP (post UCX).
975 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
981 $! Check to see if NONE was chosen
986 $! Do not use a TCPIP library.
996 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
998 $! Else The User Entered An Invalid Argument.
1002 $! Tell The User We Don't Know What They Want.
1004 $ WRITE SYS$OUTPUT ""
1005 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1006 $ WRITE SYS$OUTPUT ""
1007 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1008 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1009 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1010 $ WRITE SYS$OUTPUT ""
1016 $! Done with TCP/IP libraries
1020 $! Special Threads For OpenVMS v7.1 Or Later
1022 $! Written By: Richard Levitte
1023 $! richard@levitte.org
1026 $! Check To See If We Have A Option For P4.
1031 $! Get The Version Of VMS We Are Using.
1034 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
1035 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
1037 $! Check To See If The VMS Version Is v7.1 Or Later.
1042 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
1044 $ ISSEVEN := ,PTHREAD_USE_D4
1046 $! End The VMS Version Check.
1050 $! End The P4 Check.
1054 $! Time To RETURN...
1060 $! Save old value of the logical name OPENSSL
1062 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1064 $! Save directory information
1066 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1067 $ __HERE = F$EDIT(__HERE,"UPCASE")
1068 $ __TOP = __HERE - "TEST]"
1069 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1071 $! Set up the logical name OPENSSL to point at the include directory
1073 $ DEFINE OPENSSL /NOLOG '__INCLUDE'
1081 $! Restore the logical name OPENSSL if it had a value
1083 $ IF __SAVE_OPENSSL .EQS. ""
1087 $ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL'