3 $! Original Author: UNKNOWN
4 $! Rewritten By: Robert Byer
6 $! A-Com Computing, Inc.
7 $! byer@mail.all-net.net
9 $! Changes by Richard Levitte <richard@levitte.org>
11 $! This procedure creates the SSL libraries of "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB"
12 $! "[.xxx.EXE.SSL]LIBSSL.OLB" and if specified "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB".
13 $! The "xxx" denotes the machine architecture of AXP or VAX.
15 $! This procedures accepts two command line options listed below.
17 $! Specify one of the following build options for P1.
19 $! ALL Just build "everything".
20 $! DATE Just build the "[.INCLUDE.OPENSSL]DATE.H" file.
21 $! SOFTLINKS Just fix the Unix soft links.
22 $! RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library.
23 $! CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
24 $! SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library.
25 $! SSL_TASK Just build the "[.xxx.EXE.SSL]SSL_TASK.EXE" program.
26 $! TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL.
27 $! APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL.
30 $! Specify RSAREF as P2 to compile using the RSAREF Library.
31 $! If you specify NORSAREF, it will compile without using RSAREF.
32 $! (If in the United States, You Must Compile Using RSAREF).
34 $! Note: The RSAREF libraries are NOT INCLUDED and you have to
35 $! download it from "ftp://ftp.rsa.com/rsaref". You have to
36 $! get the ".tar-Z" file as the ".zip" file dosen't have the
37 $! directory structure stored. You have to extract the file
38 $! into the [.RSAREF] directory as that is where the scripts
39 $! will look for the files.
41 $! Speficy DEBUG or NODEBUG as P3 to compile with or without debugging
44 $! Specify which compiler at P4 to try to compile under.
49 $! LINK To only link the programs from existing object files.
50 $! (not yet implemented)
52 $! If you don't speficy a compiler, it will try to determine which
53 $! "C" compiler to use.
55 $! P5, if defined, sets a TCP/IP library to use, through one of the following
58 $! UCX for UCX or UCX emulation
59 $! SOCKETSHR for SOCKETSHR+NETLIB
61 $! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
64 $! Check Which Architecture We Are Using.
66 $ IF (F$GETSYI("CPU").GE.128)
69 $! The Architecture Is AXP.
77 $! The Architecture Is VAX.
81 $! End The Architecture Check.
85 $! Check To Make Sure We Have Valid Command Line Parameters.
89 $! Check To See What We Are To Do.
91 $ IF (BUILDALL.EQS."TRUE")
94 $! Since Nothing Special Was Specified, Do Everything.
95 $! First, Fix The Unix Softlinks.
99 $! Create The "DATE.H" Include File.
103 $! Check To See If We Are Going To Be Building The
104 $! [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library.
106 $ IF (RSAREF.EQS."RSAREF")
109 $! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library.
113 $! End The RSAREF Check.
117 $! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
121 $! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library.
125 $! Build The [.xxx.EXE.SSL]SSL_TASK.EXE DECNet SSL Engine.
129 $! Build The [.xxx.EXE.TEST] OpenSSL Test Utilities.
133 $! Build The [.xxx.EXE.APPS] OpenSSL Application Utilities.
141 $! Build Just What The User Wants Us To Build.
150 $! Rebuild The "[.INCLUDE.OPENSSL]DATE.H" file.
154 $! Tell The User We Are Creating The [.CRYPTO]DATE.H File.
156 $ WRITE SYS$OUTPUT "Creating [.CRYPTO]DATE.H Include File."
158 $! Create The [.CRYPTO]DATE.H File.
160 $ OPEN/WRITE H_FILE SYS$DISK:[.CRYPTO]DATE.H
162 $! Get The Current Date & Time.
166 $! Write The [.CRYPTO]DATE.H File.
168 $ WRITE H_FILE "#define DATE ""''TIME'"" "
170 $! Close The [.CRYPTO]DATE.H File.
174 $! That's All, Time To RETURN.
178 $! Copy a lot of files around.
182 $! Tell The User We Are Partly Rebuilding The [.TEST] Directory.
184 $ WRITE SYS$OUTPUT "Rebuilding The '[.APPS]MD5.C' And '[.APPS]RMD160.C' Files."
186 $ DELETE SYS$DISK:[.APPS]MD5.C;*,RMD160.C;*
188 $! Copy MD5.C from [.CRYPTO.MD5] into [.APPS]
190 $ COPY SYS$DISK:[.CRYPTO.MD5]MD5.C SYS$DISK:[.APPS]
192 $! Copy RMD160.C from [.CRYPTO.RIPEMD] into [.APPS]
194 $ COPY SYS$DISK:[.CRYPTO.RIPEMD]RMD160.C SYS$DISK:[.APPS]
196 $! Tell The User We Are Partly Rebuilding The [.TEST] Directory.
198 $ WRITE SYS$OUTPUT "Rebuilding The '[.TEST]*.C' Files."
200 $! First, We Have To "Rebuild" The "[.TEST]" Directory, So Delete
201 $! All The "C" Files That Are Currently There Now.
203 $ DELETE SYS$DISK:[.TEST]*.C;*
205 $! Copy all the *TEST.C files from [.CRYPTO...] into [.TEST]
207 $ COPY SYS$DISK:[.CRYPTO.*]%*TEST.C SYS$DISK:[.TEST]
209 $! Copy all the *TEST.C files from [.SSL...] into [.TEST]
211 $ COPY SYS$DISK:[.SSL]%*TEST.C SYS$DISK:[.TEST]
213 $! Tell The User We Are Rebuilding The [.INCLUDE.OPENSSL] Directory.
215 $ WRITE SYS$OUTPUT "Rebuilding The '[.INCLUDE.OPENSSL]' Directory."
217 $! First, make sure the directory exists
219 $ IF F$PARSE("SYS$DISK:[.INCLUDE.OPENSSL]") .EQS. "" THEN -
220 CREATE/DIRECTORY SYS$DISK:[.INCLUDE.OPENSSL]
222 $! Copy All The ".H" Files From The Main Directory.
224 $ EXHEADER := e_os.h,e_os2.h
225 $ COPY 'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL]
227 $! Copy All The ".H" Files From The [.CRYPTO] Directory Tree.
229 $ SDIRS := ,MD2,MD5,SHA,MDC2,HMAC,RIPEMD,-
230 DES,RC2,RC4,RC5,IDEA,BF,CAST,-
232 BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,-
233 EVP,ASN1,PEM,X509,X509V3,-
234 CONF,TXT_DB,PKCS7,PKCS12,COMP
235 $ EXHEADER_ := crypto.h,tmdiff.h,opensslv.h,opensslconf.h
236 $ EXHEADER_MD2 := md2.h
237 $ EXHEADER_MD5 := md5.h
238 $ EXHEADER_SHA := sha.h
239 $ EXHEADER_MDC2 := mdc2.h
240 $ EXHEADER_HMAC := hmac.h
241 $ EXHEADER_RIPEMD := ripemd.h
242 $ EXHEADER_DES := des.h
243 $ EXHEADER_RC2 := rc2.h
244 $ EXHEADER_RC4 := rc4.h
245 $ EXHEADER_RC5 := rc5.h
246 $ EXHEADER_IDEA := idea.h
247 $ EXHEADER_BF := blowfish.h
248 $ EXHEADER_CAST := cast.h
249 $ EXHEADER_BN := bn.h
250 $ EXHEADER_RSA := rsa.h
251 $ EXHEADER_DSA := dsa.h
252 $ EXHEADER_DH := dh.h
253 $ EXHEADER_BUFFER := buffer.h
254 $ EXHEADER_BIO := bio.h
255 $ EXHEADER_STACK := stack.h,safestack.h
256 $ EXHEADER_LHASH := lhash.h
257 $ EXHEADER_RAND := rand.h
258 $ EXHEADER_ERR := err.h
259 $ EXHEADER_OBJECTS := objects.h
260 $ EXHEADER_EVP := evp.h
261 $ EXHEADER_ASN1 := asn1.h,asn1_mac.h
262 $ EXHEADER_PEM := pem.h,pem2.h
263 $ EXHEADER_X509 := x509.h,x509_vfy.h
264 $ EXHEADER_X509V3 := x509v3.h
265 $ EXHEADER_CONF := conf.h
266 $ EXHEADER_TXT_DB := txt_db.h
267 $ EXHEADER_PKCS7 := pkcs7.h
268 $ EXHEADER_PKCS12 := pkcs12.h
269 $ EXHEADER_COMP := comp.h
273 $ D = F$EDIT(F$ELEMENT(I, ",", SDIRS),"TRIM")
275 $ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END
279 $ COPY [.CRYPTO]'tmp' SYS$DISK:[.INCLUDE.OPENSSL] /LOG
281 $ COPY [.CRYPTO.'D']'tmp' SYS$DISK:[.INCLUDE.OPENSSL] /LOG
286 $! Copy All The ".H" Files From The [.RSAREF] Directory.
288 $ EXHEADER := rsaref.h
289 $ COPY SYS$DISK:[.RSAREF]'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL]
291 $! Copy All The ".H" Files From The [.SSL] Directory.
293 $ EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h
294 $ COPY SYS$DISK:[.SSL]'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL]
298 $ PURGE SYS$DISK:[.INCLUDE.OPENSSL]*.H
300 $! That's All, Time To RETURN.
304 $! Build The "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library.
308 $! Tell The User What We Are Doing.
310 $ WRITE SYS$OUTPUT ""
311 $ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.CRYPTO]LIBCRYPTO.OLB Library."
313 $! Go To The [.CRYPTO] Directory.
315 $ SET DEFAULT SYS$DISK:[.CRYPTO]
317 $! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
319 $ @CRYPTO-LIB 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN'
321 $! Go Back To The Main Directory.
329 $! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE Library.
333 $! Tell The User What We Are Doing.
335 $ WRITE SYS$OUTPUT ""
336 $ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.RSAREF]LIBRSAGLUE.OLB Library."
338 $! Go To The [.RSAREF] Directory.
340 $ SET DEFAULT SYS$DISK:[.RSAREF]
342 $! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library.
344 $ @RSAREF-LIB LIBRARY 'DEBUGGER' "''COMPILER'" 'ISSEVEN'
346 $! Go Back To The Main Directory.
354 $! Build The "[.xxx.EXE.SSL]LIBSSL.OLB" Library.
358 $! Tell The User What We Are Doing.
360 $ WRITE SYS$OUTPUT ""
361 $ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.SSL]LIBSSL.OLB Library."
363 $! Go To The [.SSL] Directory.
365 $ SET DEFAULT SYS$DISK:[.SSL]
367 $! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library.
369 $ @SSL-LIB LIBRARY 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN'
371 $! Go Back To The Main Directory.
379 $! Build The "[.xxx.EXE.SSL]SSL_TASK.EXE" Program.
383 $! Tell The User What We Are Doing.
385 $ WRITE SYS$OUTPUT ""
386 $ WRITE SYS$OUTPUT "Building DECNet Based SSL Engine, [.",ARCH,".EXE.SSL]SSL_TASK.EXE"
388 $! Go To The [.SSL] Directory.
390 $ SET DEFAULT SYS$DISK:[.SSL]
392 $! Build The [.xxx.EXE.SSL]SSL_TASK.EXE
394 $ @SSL-LIB SSL_TASK 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN'
396 $! Go Back To The Main Directory.
400 $! That's All, Time To RETURN.
404 $! Build The OpenSSL Test Programs.
408 $! Tell The User What We Are Doing.
410 $ WRITE SYS$OUTPUT ""
411 $ WRITE SYS$OUTPUT "Building The OpenSSL [.",ARCH,".EXE.TEST] Test Utilities."
413 $! Go To The [.TEST] Directory.
415 $ SET DEFAULT SYS$DISK:[.TEST]
417 $! Build The Test Programs.
419 $ @MAKETESTS 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN'
421 $! Go Back To The Main Directory.
425 $! That's All, Time To RETURN.
429 $! Build The OpenSSL Application Programs.
433 $! Tell The User What We Are Doing.
435 $ WRITE SYS$OUTPUT ""
436 $ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCH,".EXE.APPS] Applications."
438 $! Go To The [.APPS] Directory.
440 $ SET DEFAULT SYS$DISK:[.APPS]
442 $! Build The Application Programs.
444 $ @MAKEAPPS 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN'
446 $! Go Back To The Main Directory.
450 $! That's All, Time To RETURN.
454 $! Check The User's Options.
458 $! Check To See If P1 Is Blank.
463 $! P1 Is ALL, So Build Everything.
471 $! Else, Check To See If P1 Has A Valid Arguement.
473 $ IF (P1.EQS."DATE").OR.(P1.EQS."SOFTLINKS").OR.(P1.EQS."CRYPTO") -
474 .OR.(P1.EQS."SSL").OR.(P1.EQS."RSAREF").OR.(P1.EQS."SSL_TASK") -
475 .OR.(P1.EQS."TEST").OR.(P1.EQS."APPS")
478 $! A Valid Arguement.
486 $! Tell The User We Don't Know What They Want.
488 $ WRITE SYS$OUTPUT ""
489 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
490 $ WRITE SYS$OUTPUT ""
491 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
492 $ WRITE SYS$OUTPUT " DATE : Just build the [.INCLUDE.OPENSSL]DATE.H file."
493 $ WRITE SYS$OUTPUT " SOFTLINKS: Just Fix The Unix soft links."
494 $ WRITE SYS$OUTPUT " RSAREF : To Build Just The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library."
495 $ WRITE SYS$OUTPUT " CRYPTO : To Build Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
496 $ WRITE SYS$OUTPUT " SSL : To Build Just The [.xxx.EXE.SSL]LIBSSL.OLB Library."
497 $ WRITE SYS$OUTPUT " SSL_TASK : To Build Just The [.xxx.EXE.SSL]SSL_TASK.EXE Program."
498 $ WRITE SYS$OUTPUT " TEST : To Build Just The OpenSSL Test Programs."
499 $ WRITE SYS$OUTPUT " APPS : To Build Just The OpenSSL Application Programs."
500 $ WRITE SYS$OUTPUT ""
501 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
502 $ WRITE SYS$OUTPUT ""
503 $ WRITE SYS$OUTPUT " AXP : Alpha Architecture."
504 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
505 $ WRITE SYS$OUTPUT ""
511 $! End The Valid Argument Check.
519 $! Check To See If P2 Is Blank.
521 $ IF (P2.EQS."NORSAREF")
524 $! P2 Is NORSAREF, So Compile Without RSAREF.
526 $ RSAREF = "NORSAREF"
532 $! Check To See If We Are To Compile Using The RSAREF Library.
534 $ IF (P2.EQS."RSAREF")
537 $! Compile With RSAREF Library.
545 $! Tell The User Entered An Invalid Option..
547 $ WRITE SYS$OUTPUT ""
548 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
549 $ WRITE SYS$OUTPUT ""
550 $ WRITE SYS$OUTPUT " RSAREF : To Compile With The RSAREF Library."
551 $ WRITE SYS$OUTPUT " NORSAREF : To Compile With The Regular RSA Library."
552 $ WRITE SYS$OUTPUT ""
558 $! End The Valid Arguemnt Check.
566 $! Check To See If P3 Is Blank.
568 $ IF (P3.EQS."NODEBUG")
571 $! P3 Is NODEBUG, So Compile Without Debugger Information.
573 $ DEBUGGER = "NODEBUG"
579 $! Check To See If We Are To Compile With Debugger Information.
581 $ IF (P3.EQS."DEBUG")
584 $! Compile With Debugger Information.
592 $! Tell The User Entered An Invalid Option..
594 $ WRITE SYS$OUTPUT ""
595 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
596 $ WRITE SYS$OUTPUT ""
597 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
598 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
599 $ WRITE SYS$OUTPUT ""
605 $! End The Valid Arguement Check.
613 $! Check To See If P4 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 $! Tell The User We Are Using GNUC.
632 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
634 $! End The GNU C Compiler Check.
638 $! Check To See If We Have VAXC Or DECC.
640 $ IF (F$GETSYI("CPU").GE.128).OR.(F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC")
643 $! Looks Like DECC, Set To Use DECC.
647 $! Tell The User We Are Using DECC.
649 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
655 $! Looks Like VAXC, Set To Use VAXC.
659 $! Tell The User We Are Using VAX C.
661 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
663 $! End The DECC & VAXC Compiler Check.
671 $! Check To See If The User Entered A Valid Paramter.
673 $ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC")!.OR.(P4.EQS."LINK")
676 $! Check To See If The User Wanted To Just LINK.
681 $! Looks Like LINK-only
685 $! Tell The User We Are Only Linking.
687 $ WRITE SYS$OUTPUT "LINK Only. This actually NOT YET SUPPORTED!"
693 $! Check To See If The User Wanted DECC.
698 $! Looks Like DECC, Set To Use DECC.
702 $! Tell The User We Are Using DECC.
704 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
710 $! Check To See If We Are To Use VAXC.
715 $! Looks Like VAXC, Set To Use VAXC.
719 $! Tell The User We Are Using VAX C.
721 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
727 $! Check To See If We Are To Use GNU C.
732 $! Looks Like GNUC, Set To Use GNUC.
736 $! Tell The User We Are Using GNUC.
738 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
740 $! End The GNU C Check.
744 $! Else The User Entered An Invalid Arguement.
748 $! Tell The User We Don't Know What They Want.
750 $ WRITE SYS$OUTPUT ""
751 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
752 $ WRITE SYS$OUTPUT ""
753 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
754 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
755 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
756 $ WRITE SYS$OUTPUT ""
762 $! End The Valid Arguement Check.
770 $! Time to check the contents of P5, and to make sure we get the correct library.
772 $ IF P5.EQS."SOCKETSHR" .OR. P5.EQS."MULTINET" .OR. P5.EQS."UCX"
775 $! Check to see if SOCKETSHR was chosen
777 $ IF P5.EQS."SOCKETSHR"
780 $! Set the library to use SOCKETSHR
782 $ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT"
786 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
788 $! Done with SOCKETSHR
792 $! Check to see if MULTINET was chosen
794 $ IF P5.EQS."MULTINET"
797 $! Set the library to use UCX emulation.
803 $ WRITE SYS$OUTPUT "Using MultiNet via UCX emulation for TCP/IP"
805 $! Done with MULTINET
809 $! Check to see if UCX was chosen
814 $! Set the library to use UCX.
816 $ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT"
820 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
826 $! Set the TCPIP_TYPE symbol
832 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
834 $! Else The User Entered An Invalid Arguement.
840 $! Tell The User We Don't Know What They Want.
842 $ WRITE SYS$OUTPUT ""
843 $ WRITE SYS$OUTPUT "The Option ",P5," Is Invalid. The Valid Options Are:"
844 $ WRITE SYS$OUTPUT ""
845 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
846 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
847 $ WRITE SYS$OUTPUT ""
854 $! Set the TCPIP_TYPE symbol
859 $! Done with TCP/IP libraries
863 $! Special Threads For OpenVMS v7.1 Or Later
865 $! Written By: Richard Levitte
866 $! richard@levitte.org
869 $! Check To See If We Have A Option For P6.
874 $! Get The Version Of VMS We Are Using.
877 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
878 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
880 $! Check To See If The VMS Version Is v7.1 Or Later.
885 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
887 $ ISSEVEN := ,PTHREAD_USE_D4
889 $! End The VMS Version Check.