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 files compiles and creates the FIPS parts of the
11 $! "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library for OpenSSL. The "xxx"
12 $! denotes the machine architecture of AXP or VAX.
14 $! It was re-written so it would try to determine what "C" compiler to use
15 $! or you can specify which "C" compiler to use.
17 $! Specify the following as P1 to build just that part or ALL to just
20 $! LIBRARY To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
21 $! APPS To just compile the [.xxx.EXE.CRYPTO]*.EXE
22 $! ALL To do both LIBRARY and APPS
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 speficy 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, sets a choice of crypto methods to compile.
46 $! WARNING: this should only be done to recompile some part of an already
47 $! fully compiled library.
50 $! Define A TCP/IP Library That We Will Need To Link To.
51 $! (That Is, If We Need To Link To One.)
55 $! Check Which Architecture We Are Using.
57 $ IF (F$GETSYI("CPU").GE.128)
60 $! The Architecture Is AXP
68 $! The Architecture Is VAX.
72 $! End The Architecture Check.
76 $! Define The Different Encryption Types.
78 $ ENCRYPT_TYPES = "Basic,SHA,RAND,DES,AES,DSA,RSA,DH,HMAC"
80 $! Check To Make Sure We Have Valid Command Line Parameters.
84 $! Initialise logical names and such
88 $! Tell The User What Kind of Machine We Run On.
90 $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
92 $! Define The OBJ Directory.
94 $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
96 $! Check To See If The Architecture Specific OBJ Directory Exists.
98 $ IF (F$PARSE(OBJ_DIR).EQS."")
101 $! It Dosen't Exist, So Create It.
103 $ CREATE/DIR 'OBJ_DIR'
105 $! End The Architecture Specific OBJ Directory Check.
109 $! Define The EXE Directory.
111 $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
113 $! Check To See If The Architecture Specific Directory Exists.
115 $ IF (F$PARSE(EXE_DIR).EQS."")
118 $! It Dosen't Exist, So Create It.
120 $ CREATE/DIRECTORY 'EXE_DIR'
122 $! End The Architecture Specific Directory Check.
126 $! Define The Library Name.
128 $ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB
130 $! Define The CRYPTO-LIB We Are To Use.
132 $ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO.OLB
134 $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
136 $ IF (F$SEARCH(LIB_NAME).EQS."")
139 $! Guess Not, Create The Library.
141 $ LIBRARY/CREATE/OBJECT 'LIB_NAME'
143 $! End The Library Check.
147 $! Build our options file for the application
149 $ GOSUB CHECK_OPT_FILE
151 $! Define The Different Encryption "library" Strings.
153 $ LIB_ = "fips,fips_err_wrapper"
154 $ LIB_SHA = "fips_sha1dgst,fips_sha1_selftest,fips_sha256,fips_sha512"
155 $ LIB_RAND = "fips_rand,fips_rand_selftest"
156 $ LIB_DES = "fips_des_enc,fips_des_selftest,fips_set_key"
157 $ LIB_AES = "fips_aes_core,fips_aes_selftest"
158 $ LIB_DSA = "fips_dsa_ossl,fips_dsa_gen,fips_dsa_selftest"
159 $ LIB_RSA = "fips_rsa_eay,fips_rsa_gen,fips_rsa_selftest,fips_rsa_x931g"
160 $ LIB_DH = "fips_dh_check,fips_dh_gen,fips_dh_key"
161 $ LIB_HMAC = "fips_hmac,fips_hmac_selftest"
163 $! Setup exceptional compilations
165 $ ! Add definitions for no threads on OpenVMS 7.1 and higher
166 $ COMPILEWITH_CC3 = ",bss_rtcp,"
167 $ ! Disable the DOLLARID warning
168 $ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,"
169 $ ! Disable disjoint optimization
170 $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
171 "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
172 $ ! Disable the MIXLINKAGE warning
173 $ COMPILEWITH_CC6 = ",fips_set_key,"
175 $! Figure Out What Other Modules We Are To Build.
179 $! Define A Module Counter.
187 $! Extract The Module Name From The Encryption List.
189 $ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
190 $ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
191 $ MODULE_NAME1 = MODULE_NAME
193 $! Check To See If We Are At The End Of The Module List.
195 $ IF (MODULE_NAME.EQS.",")
198 $! We Are At The End Of The Module List, Go To MODULE_DONE.
202 $! End The Module List Check.
206 $! Increment The Moudle Counter.
208 $ MODULE_COUNTER = MODULE_COUNTER + 1
210 $! Create The Library and Apps Module Names.
212 $ LIB_MODULE = "LIB_" + MODULE_NAME
213 $ APPS_MODULE = "APPS_" + MODULE_NAME
214 $ IF (MODULE_NAME.EQS."ASN1_2")
216 $ MODULE_NAME = "ASN1"
218 $ IF (MODULE_NAME.EQS."EVP_2")
220 $ MODULE_NAME = "EVP"
223 $! Set state (can be LIB and APPS)
226 $ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
228 $! Check if the library module name actually is defined
230 $ IF F$TYPE('LIB_MODULE') .EQS. ""
233 $ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
238 $! Top Of The Module Loop.
242 $! Tell The User What Module We Are Building.
244 $ IF (MODULE_NAME1.NES."")
246 $ IF STATE .EQS. "LIB"
248 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
249 $ ELSE IF F$TYPE('APPS_MODULE') .NES. ""
251 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
256 $! Define A File Counter And Set It To "0".
260 $ APPLICATION_COUNTER = 0
262 $! Top Of The File Loop.
266 $! Look in the LIB_MODULE is we're in state LIB
268 $ IF STATE .EQS. "LIB"
271 $! O.K, Extract The File Name From The File List.
273 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
280 $ IF F$TYPE('APPS_MODULE') .NES. ""
283 $! Extract The File Name From The File List.
284 $! This part is a bit more complicated.
286 $ IF APPLICATION .EQS. ""
288 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
289 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
290 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
291 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
295 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
296 $! SHOW SYMBOL APPLICATION*
298 $ IF APPLICATION .NES. ";"
300 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS)
301 $ IF FILE_NAME .EQS. ","
310 $! Check To See If We Are At The End Of The File List.
312 $ IF (FILE_NAME.EQS.",")
315 $! We Are At The End Of The File List, Change State Or Goto FILE_DONE.
317 $ IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
325 $! End The File List Check.
329 $! Increment The Counter.
331 $ FILE_COUNTER = FILE_COUNTER + 1
333 $! Create The Source File Name.
335 $ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
336 $ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
337 $ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
338 FILE_NAME = FILE_NAME + ".c"
339 $ IF (MODULE_NAME.NES."")
341 $ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
343 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
345 $ SOURCE_FILE = SOURCE_FILE - "]["
347 $! Create The Object File Name.
349 $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
350 $ ON WARNING THEN GOTO NEXT_FILE
352 $! Check To See If The File We Want To Compile Is Actually There.
354 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
357 $! Tell The User That The File Doesn't Exist.
359 $ WRITE SYS$OUTPUT ""
360 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
361 $ WRITE SYS$OUTPUT ""
367 $! End The File Exist Check.
371 $! Tell The User We Are Compiling The File.
373 $ IF (MODULE_NAME.EQS."")
375 $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE,")"
377 $ IF (MODULE_NAME.NES."")
379 $ WRITE SYS$OUTPUT " ",FILE_NAME,""
384 $ ON ERROR THEN GOTO NEXT_FILE
385 $ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME)
386 $ IF FILE_NAME - ".mar" .NES. FILE_NAME
388 $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
390 $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
392 $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
394 $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
396 $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
398 $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
400 $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
402 $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
404 $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
406 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
412 $ IF STATE .EQS. "LIB"
415 $! Add It To The Library.
417 $ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
419 $! Time To Clean Up The Object File.
421 $ DELETE 'OBJECT_FILE';*
424 $! Go Back And Do It Again.
428 $! All Done With This Library Part.
432 $! Time To Build Some Applications
434 $ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
436 $ APPLICATION_COUNTER = 0
438 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
439 $ IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
441 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
442 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
443 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
445 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
446 $! SHOW SYMBOL APPLICATION*
448 $! Tell the user what happens
450 $ WRITE SYS$OUTPUT " ",APPLICATION,".exe"
454 $ ON ERROR THEN GOTO NEXT_APPLICATION
456 $! Check To See If We Are To Link With A Specific TCP/IP Library.
458 $ IF (TCPIP_LIB.NES."")
461 $! Link With A TCP/IP Library.
463 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
464 'OBJ_DIR''APPLICATION_OBJECTS', -
465 'CRYPTO_LIB'/LIBRARY, -
466 'TCPIP_LIB','OPT_FILE'/OPTION
472 $! Don't Link With A TCP/IP Library.
474 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
475 'OBJ_DIR''APPLICATION_OBJECTS',-
476 'CRYPTO_LIB'/LIBRARY, -
479 $! End The TCP/IP Library Check.
482 $ GOTO NEXT_APPLICATION
486 $! Go Back And Get The Next Module.
490 $! All Done With This Module.
494 $! Tell The User That We Are All Done.
496 $ WRITE SYS$OUTPUT "All Done..."
501 $! Check For The Link Option FIle.
505 $! Check To See If We Need To Make A VAX C Option File.
507 $ IF (COMPILER.EQS."VAXC")
510 $! Check To See If We Already Have A VAX C Linker Option File.
512 $ IF (F$SEARCH(OPT_FILE).EQS."")
515 $! We Need A VAX C Linker Option File.
520 ! Default System Options File To Link Agianst
521 ! The Sharable VAX C Runtime Library.
523 SYS$SHARE:VAXCRTL.EXE/SHARE
526 $! End The Option File Check.
530 $! End The VAXC Check.
534 $! Check To See If We Need A GNU C Option File.
536 $ IF (COMPILER.EQS."GNUC")
539 $! Check To See If We Already Have A GNU C Linker Option File.
541 $ IF (F$SEARCH(OPT_FILE).EQS."")
544 $! We Need A GNU C Linker Option File.
549 ! Default System Options File To Link Agianst
550 ! The Sharable C Runtime Library.
552 GNU_CC:[000000]GCCLIB/LIBRARY
553 SYS$SHARE:VAXCRTL/SHARE
556 $! End The Option File Check.
560 $! End The GNU C Check.
564 $! Check To See If We Need A DEC C Option File.
566 $ IF (COMPILER.EQS."DECC")
569 $! Check To See If We Already Have A DEC C Linker Option File.
571 $ IF (F$SEARCH(OPT_FILE).EQS."")
574 $! Figure Out If We Need An AXP Or A VAX Linker Option File.
576 $ IF ARCH .EQS. "VAX"
579 $! We Need A DEC C Linker Option File For VAX.
584 ! Default System Options File To Link Agianst
585 ! The Sharable DEC C Runtime Library.
587 SYS$SHARE:DECC$SHR.EXE/SHARE
594 $! Create The AXP Linker Option File.
599 ! Default System Options File For AXP To Link Agianst
600 ! The Sharable C Runtime Library.
602 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
603 SYS$SHARE:CMA$OPEN_RTL/SHARE
606 $! End The VAX/AXP DEC C Option File Check.
610 $! End The Option File Search.
614 $! End The DEC C Check.
618 $! Tell The User What Linker Option File We Are Using.
620 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
626 $! Check The User's Options.
630 $! Check To See If P1 Is Blank.
635 $! P1 Is Blank, So Build Everything.
643 $! Else, Check To See If P1 Has A Valid Arguement.
645 $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
648 $! A Valid Arguement.
656 $! Tell The User We Don't Know What They Want.
658 $ WRITE SYS$OUTPUT ""
659 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
660 $ WRITE SYS$OUTPUT ""
661 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
662 $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
663 $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.EXE Programs."
664 $ WRITE SYS$OUTPUT ""
665 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
666 $ WRITE SYS$OUTPUT ""
667 $ WRITE SYS$OUTPUT " AXP : Alpha Architecture."
668 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
669 $ WRITE SYS$OUTPUT ""
675 $! End The Valid Arguement Check.
683 $! Check To See If P2 Is Blank.
685 $ IF (P2.EQS."NODEBUG")
688 $! P2 Is NODEBUG, So Compile Without The Debugger Information.
690 $ DEBUGGER = "NODEBUG"
691 $ TRACEBACK = "NOTRACEBACK"
692 $ GCC_OPTIMIZE = "OPTIMIZE"
693 $ CC_OPTIMIZE = "OPTIMIZE"
694 $ MACRO_OPTIMIZE = "OPTIMIZE"
695 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
696 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
699 $! Check To See If We Are To Compile With Debugger Information.
701 $ IF (P2.EQS."DEBUG")
704 $! Compile With Debugger Information.
707 $ TRACEBACK = "TRACEBACK"
708 $ GCC_OPTIMIZE = "NOOPTIMIZE"
709 $ CC_OPTIMIZE = "NOOPTIMIZE"
710 $ MACRO_OPTIMIZE = "NOOPTIMIZE"
711 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
712 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
715 $! They Entered An Invalid Option..
717 $ WRITE SYS$OUTPUT ""
718 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
719 $ WRITE SYS$OUTPUT ""
720 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
721 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
722 $ WRITE SYS$OUTPUT ""
728 $! End The Valid Arguement Check.
736 $! Special Threads For OpenVMS v7.1 Or Later
738 $! Written By: Richard Levitte
739 $! richard@levitte.org
742 $! Check To See If We Have A Option For P5.
747 $! Get The Version Of VMS We Are Using.
750 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
751 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
753 $! Check To See If The VMS Version Is v7.1 Or Later.
758 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
760 $ ISSEVEN := ,PTHREAD_USE_D4
762 $! End The VMS Version Check.
770 $! Check To See If P3 Is Blank.
775 $! O.K., The User Didn't Specify A Compiler, Let's Try To
776 $! Find Out Which One To Use.
778 $! Check To See If We Have GNU C.
780 $ IF (F$TRNLNM("GNU_CC").NES."")
783 $! Looks Like GNUC, Set To Use GNUC.
791 $! Check To See If We Have VAXC Or DECC.
793 $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
796 $! Looks Like DECC, Set To Use DECC.
804 $! Looks Like VAXC, Set To Use VAXC.
808 $! End The VAXC Compiler Check.
812 $! End The DECC & VAXC Compiler Check.
816 $! End The Compiler Check.
820 $! Check To See If We Have A Option For P4.
825 $! Find out what socket library we have available
827 $ IF F$PARSE("SOCKETSHR:") .NES. ""
830 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
836 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
838 $! Else, let's look for something else
842 $! Like UCX (the reason to do this before Multinet is that the UCX
843 $! emulation is easier to use...)
845 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
846 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
847 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
850 $! Last resort: a UCX or UCX-compatible library
856 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
864 $! Set Up Initial CC Definitions, Possibly With User Ones
866 $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
867 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
869 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
870 $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
871 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
872 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
874 $! Check To See If The User Entered A Valid Paramter.
876 $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
879 $! Check To See If The User Wanted DECC.
884 $! Looks Like DECC, Set To Use DECC.
888 $! Tell The User We Are Using DECC.
890 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
895 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
897 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
898 "/NOLIST/PREFIX=ALL" + -
899 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + -
902 $! Define The Linker Options File Name.
904 $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
910 $! Check To See If We Are To Use VAXC.
915 $! Looks Like VAXC, Set To Use VAXC.
919 $! Tell The User We Are Using VAX C.
921 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
923 $! Compile Using VAXC.
928 $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
931 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
932 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
933 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + -
935 $ CCDEFS = """VAXC""," + CCDEFS
937 $! Define <sys> As SYS$COMMON:[SYSLIB]
939 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
941 $! Define The Linker Options File Name.
943 $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
949 $! Check To See If We Are To Use GNU C.
954 $! Looks Like GNUC, Set To Use GNUC.
958 $! Tell The User We Are Using GNUC.
960 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
964 $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
965 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + -
968 $! Define The Linker Options File Name.
970 $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
972 $! End The GNU C Check.
976 $! Set up default defines
978 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
980 $! Finish up the definition of CC.
982 $ IF COMPILER .EQS. "DECC"
984 $ IF CCDISABLEWARNINGS .EQS. ""
986 $ CC4DISABLEWARNINGS = "DOLLARID"
987 $ CC6DISABLEWARNINGS = "MIXLINKAGE"
989 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
990 $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
991 $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
993 $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
994 $ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
996 $ CCDISABLEWARNINGS = ""
997 $ CC4DISABLEWARNINGS = ""
998 $ CC6DISABLEWARNINGS = ""
1000 $ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
1001 $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1002 $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
1004 $ CC5 = CC + "/OPTIMIZE=NODISJOINT"
1006 $ CC5 = CC + "/NOOPTIMIZE"
1008 $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1009 $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
1011 $! Show user the result
1013 $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
1015 $! Else The User Entered An Invalid Arguement.
1019 $! Tell The User We Don't Know What They Want.
1021 $ WRITE SYS$OUTPUT ""
1022 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1023 $ WRITE SYS$OUTPUT ""
1024 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
1025 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
1026 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
1027 $ WRITE SYS$OUTPUT ""
1033 $! End The Valid Arguement Check.
1037 $! Build a MACRO command for the architecture at hand
1039 $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
1040 $ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
1042 $! Show user the result
1044 $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
1046 $! Time to check the contents, and to make sure we get the correct library.
1048 $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
1049 .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
1052 $! Check to see if SOCKETSHR was chosen
1054 $ IF P4.EQS."SOCKETSHR"
1057 $! Set the library to use SOCKETSHR
1059 $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
1061 $! Done with SOCKETSHR
1065 $! Check to see if MULTINET was chosen
1067 $ IF P4.EQS."MULTINET"
1070 $! Set the library to use UCX emulation.
1074 $! Done with MULTINET
1078 $! Check to see if UCX was chosen
1083 $! Set the library to use UCX.
1085 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
1086 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1088 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
1090 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1091 TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
1098 $! Check to see if TCPIP was chosen
1103 $! Set the library to use TCPIP (post UCX).
1105 $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
1111 $! Check to see if NONE was chosen
1116 $! Do not use a TCPIP library.
1126 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
1128 $! Else The User Entered An Invalid Arguement.
1132 $! Tell The User We Don't Know What They Want.
1134 $ WRITE SYS$OUTPUT ""
1135 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
1136 $ WRITE SYS$OUTPUT ""
1137 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1138 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1139 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1140 $ WRITE SYS$OUTPUT ""
1146 $! Done with TCP/IP libraries
1150 $! Check if the user wanted to compile just a subset of all the encryption
1155 $ ENCRYPT_TYPES = P6
1158 $! Time To RETURN...
1164 $! Save old value of the logical name OPENSSL
1166 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1168 $! Save directory information
1170 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1171 $ __HERE = F$EDIT(__HERE,"UPCASE")
1172 $ __TOP = __HERE - "FIPS-1_0]"
1173 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1175 $! Set up the logical name OPENSSL to point at the include directory
1177 $ DEFINE OPENSSL/NOLOG '__INCLUDE'
1185 $! Restore the logical name OPENSSL if it had a value
1187 $ IF __SAVE_OPENSSL .EQS. ""
1191 $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'