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 <zoli@polarhome.com>
11 $! This command files compiles and creates all the various different
12 $! "application" programs for the different types of encryption for OpenSSL.
13 $! The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes
14 $! ALPHA, IA64 or VAX, depending on your machine architecture.
16 $! It was written so it would try to determine what "C" compiler to
17 $! use or you can specify which "C" compiler to use.
19 $! Specify DEBUG or NODEBUG as P1 to compile with or without debugger
22 $! Specify which compiler at P2 to try to compile under.
28 $! If you don't specify a compiler, it will try to determine which
29 $! "C" compiler to use.
31 $! P3, if defined, sets a TCP/IP library to use, through one of the following
35 $! SOCKETSHR for SOCKETSHR+NETLIB
36 $! TCPIP for TCPIP (post UCX)
38 $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
40 $! P5, if defined, sets a choice of programs to compile.
42 $! P6, if defined, specifies the C pointer size. Ignored on VAX.
43 $! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
44 $! Supported values are:
46 $! "" Compile with default (/NOPOINTER_SIZE)
47 $! 32 Compile with /POINTER_SIZE=32 (SHORT)
48 $! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV])
49 $! (Automatically select ARGV if compiler supports it.)
50 $! 64= Compile with /POINTER_SIZE=64 (LONG).
51 $! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
53 $! P7, if defined, specifies a directory where ZLIB files (zlib.h,
54 $! libz.olb) may be found. Optionally, a non-default object library
55 $! name may be included ("dev:[dir]libz_64.olb", for example).
60 $ proc = f$environment( "procedure")
61 $ write sys$output "@@@ "+ -
62 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
64 $ on control_c then goto exit
66 $! Define A TCP/IP Library That We Will Need To Link To.
67 $! (That Is, If We Need To Link To One.)
72 $! Check What Architecture We Are Using.
74 $ IF (F$GETSYI("CPU").LT.128)
77 $! The Architecture Is VAX.
85 $! The Architecture Is Alpha, IA64 or whatever comes in the future.
87 $ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
88 $ IF (ARCH .EQS. "") THEN ARCH = "UNK"
90 $! End The Architecture Check.
99 $! Define what programs should be compiled
101 $ PROGRAMS := OPENSSL
103 $! Check To Make Sure We Have Valid Command Line Parameters.
105 $ GOSUB CHECK_OPTIONS
107 $! Define The CRYPTO Library.
109 $ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
111 $! Define The SSL Library.
113 $ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB
115 $! Define The OBJ and EXE Directories.
117 $ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.APPS]
118 $ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.APPS]
120 $! Specify the destination directory in any /MAP option.
122 $ if (LINKMAP .eqs. "MAP")
124 $ LINKMAP = LINKMAP+ "=''EXE_DIR'"
127 $! Add the location prefix to the linker options file name.
129 $ if (OPT_FILE .nes. "")
131 $ OPT_FILE = EXE_DIR+ OPT_FILE
134 $! Initialise logical names and such
138 $! Tell The User What Kind of Machine We Run On.
140 $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
142 $! Check To See If The OBJ Directory Exists.
144 $ IF (F$PARSE(OBJ_DIR).EQS."")
147 $! It Dosen't Exist, So Create It.
149 $ CREATE/DIRECTORY 'OBJ_DIR'
151 $! End The OBJ Directory Check.
155 $! Check To See If The EXE Directory Exists.
157 $ IF (F$PARSE(EXE_DIR).EQS."")
160 $! It Dosen't Exist, So Create It.
162 $ CREATE/DIRECTORY 'EXE_DIR'
164 $! End The EXE Directory Check.
168 $! Check To See If We Have The Proper Libraries.
172 $! Check To See If We Have A Linker Option File.
174 $ GOSUB CHECK_OPT_FILE
176 $! Define The Application Files.
177 $! NOTE: Some might think this list ugly. However, it's made this way to
178 $! reflect the E_OBJ variable in Makefile as closely as possible, thereby
179 $! making it fairly easy to verify that the lists are the same.
181 $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
182 "CA,PKCS7,CRL2P7,CRL,"+-
183 "RSA,RSAUTL,DSA,DSAPARAM,EC,ECPARAM,"+-
184 "X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
185 "S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
186 "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
187 "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP"
189 $ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
191 $ TCPIP_PROGRAMS = ",,"
192 $ IF COMPILER .EQS. "VAXC" THEN -
193 TCPIP_PROGRAMS = ",OPENSSL,"
195 $! Setup exceptional compilations
197 $ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT,"
203 $! Define An App Counter And Set It To "0".
207 $! Top Of The App Loop.
211 $! Make The Application File Name
213 $ CURRENT_APP = F$EDIT(F$ELEMENT(APP_COUNTER,",",PROGRAMS),"TRIM")
215 $! Create The Executable File Name.
217 $ EXE_FILE = EXE_DIR + CURRENT_APP + ".EXE"
219 $! Check To See If We Are At The End Of The File List.
221 $ IF (CURRENT_APP.EQS.",")
223 $ IF (PHASE.EQS."LIB")
232 $! Increment The Counter.
234 $ APP_COUNTER = APP_COUNTER + 1
236 $! Decide if we're building the object files or not.
238 $ IF (PHASE.EQS."LIB")
241 $! Define A Library File Counter And Set It To "-1".
242 $! -1 Means The Application File Name Is To Be Used.
246 $! Create a .OPT file for the object files
248 $ OPEN /WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT
250 $! Top Of The File Loop.
254 $! O.K, Extract The File Name From The File List.
256 $ IF LIB_COUNTER .GE. 0
258 $ FILE_NAME = F$EDIT(F$ELEMENT(LIB_COUNTER,",",LIB_'CURRENT_APP'),"TRIM")
260 $ FILE_NAME = CURRENT_APP
263 $! Check To See If We Are At The End Of The File List.
265 $ IF (FILE_NAME.EQS.",")
271 $! Increment The Counter.
273 $ LIB_COUNTER = LIB_COUNTER + 1
275 $! Create The Source File Name.
277 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
279 $! Create The Object File Name.
281 $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
282 $ ON WARNING THEN GOTO NEXT_LIB
284 $! Check To See If The File We Want To Compile Actually Exists.
286 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
289 $! Tell The User That The File Dosen't Exist.
291 $ WRITE SYS$OUTPUT ""
292 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
293 $ WRITE SYS$OUTPUT ""
299 $! End The File Exist Check.
303 $! Tell The User What We Are Building.
305 $ IF (PHASE.EQS."LIB")
307 $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME,".C File."
309 $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Application Program."
314 $ ON ERROR THEN GOTO NEXT_LIB
315 $ IF COMPILEWITH_CC2 - FILE_NAME .NES. COMPILEWITH_CC2
317 $ CC2/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
319 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
321 $ WRITE OBJECTS OBJECT_FILE
326 $! Check if this program works well without a TCPIP library
328 $ IF TCPIP_LIB .EQS. "" .AND. TCPIP_PROGRAMS - CURRENT_APP .NES. TCPIP_PROGRAMS
330 $ WRITE SYS$OUTPUT CURRENT_APP," needs a TCP/IP library. Can't link. Skipping..."
336 $ ON WARNING THEN GOTO NEXT_APP
338 $! Don't Link With The RSAREF Routines And TCP/IP Library.
340 $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_FILE' -
341 'EXE_DIR''CURRENT_APP'.OPT /OPTIONS, -
342 'SSL_LIB' /LIBRARY, -
343 'CRYPTO_LIB' /LIBRARY -
348 $! Go Back And Do It Again.
352 $! All Done With This File.
357 $! All Done, Time To Clean Up And Exit.
362 $! Check For The Link Option FIle.
366 $! Check To See If We Need To Make A VAX C Option File.
368 $ IF (COMPILER.EQS."VAXC")
371 $! Check To See If We Already Have A VAX C Linker Option File.
373 $ IF (F$SEARCH(OPT_FILE).EQS."")
376 $! We Need A VAX C Linker Option File.
381 ! Default System Options File To Link Against
382 ! The Sharable VAX C Runtime Library.
384 SYS$SHARE:VAXCRTL.EXE/SHARE
387 $! End The Option File Check.
391 $! End The VAXC Check.
395 $! Check To See If We Need A GNU C Option File.
397 $ IF (COMPILER.EQS."GNUC")
400 $! Check To See If We Already Have A GNU C Linker Option File.
402 $ IF (F$SEARCH(OPT_FILE).EQS."")
405 $! We Need A GNU C Linker Option File.
410 ! Default System Options File To Link Against
411 ! The Sharable C Runtime Library.
413 GNU_CC:[000000]GCCLIB/LIBRARY
414 SYS$SHARE:VAXCRTL/SHARE
417 $! End The Option File Check.
421 $! End The GNU C Check.
425 $! Check To See If We Need A DEC C Option File.
427 $ IF (COMPILER.EQS."DECC")
430 $! Check To See If We Already Have A DEC C Linker Option File.
432 $ IF (F$SEARCH(OPT_FILE).EQS."")
435 $! Figure Out If We Need An AXP Or A VAX Linker Option File.
440 $! We Need A DEC C Linker Option File For VAX.
445 ! Default System Options File To Link Against
446 ! The Sharable DEC C Runtime Library.
448 SYS$SHARE:DECC$SHR.EXE/SHARE
455 $! Create The non-VAX Linker Option File.
460 ! Default System Options File For non-VAX To Link Against
461 ! The Sharable C Runtime Library.
463 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
464 SYS$SHARE:CMA$OPEN_RTL/SHARE
467 $! End The DEC C Option File Check.
471 $! End The Option File Search.
475 $! End The DEC C Check.
479 $! Tell The User What Linker Option File We Are Using.
481 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
487 $! Check To See If We Have The Appropiate Libraries.
491 $! Look For The Library LIBCRYPTO.OLB.
493 $ IF (F$SEARCH(CRYPTO_LIB).EQS."")
496 $! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
498 $ WRITE SYS$OUTPUT ""
499 $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
500 $ WRITE SYS$OUTPUT "We Can't Link Without It."
501 $ WRITE SYS$OUTPUT ""
503 $! Since We Can't Link Without It, Exit.
507 $! End The Crypto Library Check.
511 $! Look For The Library LIBSSL.OLB.
513 $ IF (F$SEARCH(SSL_LIB).EQS."")
516 $! Tell The User We Can't Find The LIBSSL.OLB Library.
518 $ WRITE SYS$OUTPUT ""
519 $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
520 $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It."
521 $ WRITE SYS$OUTPUT ""
523 $! Since We Can't Link Without It, Exit.
527 $! End The SSL Library Check.
535 $! Check The User's Options.
539 $! Check To See If P1 Is Blank.
541 $ IF (P1.EQS."NODEBUG")
544 $! P1 Is NODEBUG, So Compile Without Debugger Information.
546 $ DEBUGGER = "NODEBUG"
548 $ TRACEBACK = "NOTRACEBACK"
549 $ GCC_OPTIMIZE = "OPTIMIZE"
550 $ CC_OPTIMIZE = "OPTIMIZE"
551 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
552 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
558 $! Check To See If We Are To Compile With Debugger Information.
560 $ IF (P1.EQS."DEBUG")
563 $! Compile With Debugger Information.
567 $ TRACEBACK = "TRACEBACK"
568 $ GCC_OPTIMIZE = "NOOPTIMIZE"
569 $ CC_OPTIMIZE = "NOOPTIMIZE"
570 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
571 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
574 $! Tell The User Entered An Invalid Option.
576 $ WRITE SYS$OUTPUT ""
577 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
578 $ WRITE SYS$OUTPUT ""
579 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
580 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
581 $ WRITE SYS$OUTPUT ""
587 $! End The Valid Argument Check.
595 $! Check P6 (POINTER_SIZE).
597 $ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX")
602 $ POINTER_SIZE = " /POINTER_SIZE=32"
604 $ POINTER_SIZE = F$EDIT( P6, "COLLAPSE, UPCASE")
605 $ IF ((POINTER_SIZE .EQS. "64") .OR. -
606 (POINTER_SIZE .EQS. "64=") .OR. -
607 (POINTER_SIZE .EQS. "64=ARGV"))
609 $ ARCHD = ARCH+ "_64"
611 $ IF (F$EXTRACT( 2, 1, POINTER_SIZE) .EQS. "=")
613 $! Explicit user choice: "64" or "64=ARGV".
614 $ IF (POINTER_SIZE .EQS. "64=") THEN POINTER_SIZE = "64"
617 $ DEFINE /USER_MODE SYS$OUTPUT NL:
618 $ DEFINE /USER_MODE SYS$ERROR NL:
619 $ CC /NOLIST /NOOBJECT /POINTER_SIZE=64=ARGV NL:
620 $ IF ($STATUS .AND. %X0FFF0000) .EQ. %X00030000
622 $ ! If we got here, it means DCL complained like this:
623 $ ! %DCL-W-NOVALU, value not allowed - remove value specification
626 $ ! If the compiler was run, logicals defined in /USER would
627 $ ! have been deassigned automatically. However, when DCL
628 $ ! complains, they aren't, so we do it here (it might be
629 $ ! unnecessary, but just in case there will be another error
630 $ ! message further on that we don't want to miss)
631 $ DEASSIGN /USER_MODE SYS$ERROR
632 $ DEASSIGN /USER_MODE SYS$OUTPUT
634 $ POINTER_SIZE = POINTER_SIZE + "=ARGV"
638 $ POINTER_SIZE = " /POINTER_SIZE=''POINTER_SIZE'"
642 $! Tell The User Entered An Invalid Option.
644 $ WRITE SYS$OUTPUT ""
645 $ WRITE SYS$OUTPUT "The Option ", P6, -
646 " Is Invalid. The Valid Options Are:"
647 $ WRITE SYS$OUTPUT ""
649 " """" : Compile with default (short) pointers."
651 " 32 : Compile with 32-bit (short) pointers."
653 " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
655 " 64= : Compile with 64-bit (long) pointers (no ARGV)."
657 " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
658 $ WRITE SYS$OUTPUT ""
668 $! End The P6 (POINTER_SIZE) Check.
672 $! Set basic C compiler /INCLUDE directories.
674 $ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]"
676 $! Check To See If P2 Is Blank.
681 $! O.K., The User Didn't Specify A Compiler, Let's Try To
682 $! Find Out Which One To Use.
684 $! Check To See If We Have GNU C.
686 $ IF (F$TRNLNM("GNU_CC").NES."")
689 $! Looks Like GNUC, Set To Use GNUC.
697 $! Check To See If We Have VAXC Or DECC.
699 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
702 $! Looks Like DECC, Set To Use DECC.
710 $! Looks Like VAXC, Set To Use VAXC.
714 $! End The VAXC Compiler Check.
718 $! End The DECC & VAXC Compiler Check.
722 $! End The Compiler Check.
726 $! Check To See If We Have A Option For P3.
731 $! Find out what socket library we have available
733 $ IF F$PARSE("SOCKETSHR:") .NES. ""
736 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
742 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
744 $! Else, let's look for something else
748 $! Like UCX (the reason to do this before Multinet is that the UCX
749 $! emulation is easier to use...)
751 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
752 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
753 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
756 $! Last resort: a UCX or UCX-compatible library
762 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
770 $! Set Up Initial CC Definitions, Possibly With User Ones
772 $ CCDEFS = "MONOLITH"
773 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
775 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
776 $ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
777 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
779 $ IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
780 $ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
783 $! Check To See If We Have A ZLIB Option.
789 $! Check for expected ZLIB files.
792 $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
793 $ if (f$search( file1) .eqs. "")
795 $ WRITE SYS$OUTPUT ""
796 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
797 $ WRITE SYS$OUTPUT " Can't find header: ''file1'"
800 $ file1 = f$parse( "A.;", ZLIB)- "A.;"
802 $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
803 $ if (f$search( file2) .eqs. "")
807 $ WRITE SYS$OUTPUT ""
808 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
810 $ WRITE SYS$OUTPUT " Can't find library: ''file2'"
811 $ WRITE SYS$OUTPUT ""
816 $ WRITE SYS$OUTPUT ""
824 $ CCDEFS = """ZLIB=1"", "+ CCDEFS
825 $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
826 $ ZLIB_LIB = ", ''file2' /library"
830 $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
832 $! End The ZLIB Check.
836 $! Check To See If The User Entered A Valid Parameter.
838 $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
841 $! Check To See If The User Wanted DECC.
846 $! Looks Like DECC, Set To Use DECC.
850 $! Tell The User We Are Using DECC.
852 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
857 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
859 $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
860 "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
861 " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS
863 $! Define The Linker Options File Name.
865 $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
871 $! Check To See If We Are To Use VAXC.
876 $! Looks Like VAXC, Set To Use VAXC.
880 $! Tell The User We Are Using VAX C.
881 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
883 $! Compile Using VAXC.
888 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
891 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
892 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
893 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
894 $ CCDEFS = CCDEFS + ",""VAXC"""
896 $! Define <sys> As SYS$COMMON:[SYSLIB]
898 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
900 $! Define The Linker Options File Name.
902 $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
908 $! Check To See If We Are To Use GNU C.
913 $! Looks Like GNUC, Set To Use GNUC.
917 $! Tell The User We Are Using GNUC.
919 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
923 $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
924 $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
925 "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS
927 $! Define The Linker Options File Name.
929 $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
931 $! End The GNU C Check.
935 $! Set up default defines
937 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
939 $! Else The User Entered An Invalid Argument.
943 $! Tell The User We Don't Know What They Want.
945 $ WRITE SYS$OUTPUT ""
946 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
947 $ WRITE SYS$OUTPUT ""
948 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
949 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
950 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
951 $ WRITE SYS$OUTPUT ""
958 $! Time to check the contents, and to make sure we get the correct library.
960 $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
961 .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
964 $! Check to see if SOCKETSHR was chosen
966 $ IF P3.EQS."SOCKETSHR"
969 $! Set the library to use SOCKETSHR
971 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
973 $! Done with SOCKETSHR
977 $! Check to see if MULTINET was chosen
979 $ IF P3.EQS."MULTINET"
982 $! Set the library to use UCX emulation.
986 $! Done with MULTINET
990 $! Check to see if UCX was chosen
995 $! Set the library to use UCX.
997 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
998 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1000 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
1002 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1003 TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
1010 $! Check to see if TCPIP (post UCX) was chosen
1015 $! Set the library to use TCPIP.
1017 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
1023 $! Check to see if NONE was chosen
1028 $! Do not use TCPIP.
1036 $! Add TCP/IP type to CC definitions.
1038 $ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'"
1042 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
1044 $! Else The User Entered An Invalid Argument.
1048 $! Tell The User We Don't Know What They Want.
1050 $ WRITE SYS$OUTPUT ""
1051 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1052 $ WRITE SYS$OUTPUT ""
1053 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1054 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1055 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1056 $ WRITE SYS$OUTPUT ""
1062 $! Done with TCP/IP libraries
1066 $! Finish up the definition of CC.
1068 $ IF COMPILER .EQS. "DECC"
1070 $! Not all compiler versions support MAYLOSEDATA3.
1071 $ OPT_TEST = "MAYLOSEDATA3"
1072 $ DEFINE /USER_MODE SYS$ERROR NL:
1073 $ DEFINE /USER_MODE SYS$OUTPUT NL:
1074 $ 'CC' /NOCROSS_REFERENCE /NOLIST /NOOBJECT -
1075 /WARNINGS = DISABLE = ('OPT_TEST', EMPTYFILE) NL:
1078 $ IF CCDISABLEWARNINGS .NES. "" THEN -
1079 CCDISABLEWARNINGS = CCDISABLEWARNINGS+ ","
1080 $ CCDISABLEWARNINGS = CCDISABLEWARNINGS+ OPT_TEST
1082 $ IF CCDISABLEWARNINGS .NES. ""
1084 $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1087 $ CCDISABLEWARNINGS = ""
1089 $ CC2 = CC + " /DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS
1090 $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1092 $! Show user the result
1094 $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
1096 $! Special Threads For OpenVMS v7.1 Or Later
1098 $! Written By: Richard Levitte
1099 $! richard@levitte.org
1102 $! Check To See If We Have A Option For P4.
1107 $! Get The Version Of VMS We Are Using.
1110 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
1111 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
1113 $! Check To See If The VMS Version Is v7.1 Or Later.
1118 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
1120 $ ISSEVEN := ,PTHREAD_USE_D4
1122 $! End The VMS Version Check.
1126 $! End The P4 Check.
1130 $! Check if the user wanted to compile just a subset of all the programs.
1137 $! Time To RETURN...
1143 $! Save old value of the logical name OPENSSL
1145 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1147 $! Save directory information
1149 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1150 $ __HERE = F$EDIT(__HERE,"UPCASE")
1151 $ __TOP = __HERE - "APPS]"
1152 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1154 $! Set up the logical name OPENSSL to point at the include directory
1156 $ DEFINE OPENSSL /NOLOG '__INCLUDE'
1164 $! Restore the saved logical name OPENSSL, if it had a value.
1166 $ if (f$type( __SAVE_OPENSSL) .nes. "")
1168 $ IF __SAVE_OPENSSL .EQS. ""
1172 $ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL'
1176 $! Close any open files.
1178 $ if (f$trnlnm( "objects", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then -