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 "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB"
11 $! library for OpenSSL. The "xxx" denotes the machine architecture of AXP
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,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
79 "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
80 "BN,EC,RSA,DSA,DH,DSO,ENGINE,AES,"+ -
81 "BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ -
82 "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
83 "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5"
85 $! Check To Make Sure We Have Valid Command Line Parameters.
89 $! Initialise logical names and such
93 $! Tell The User What Kind of Machine We Run On.
95 $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
97 $! Define The OBJ Directory.
99 $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
101 $! Check To See If The Architecture Specific OBJ Directory Exists.
103 $ IF (F$PARSE(OBJ_DIR).EQS."")
106 $! It Dosen't Exist, So Create It.
108 $ CREATE/DIR 'OBJ_DIR'
110 $! End The Architecture Specific OBJ Directory Check.
114 $! Define The EXE Directory.
116 $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
118 $! Check To See If The Architecture Specific Directory Exists.
120 $ IF (F$PARSE(EXE_DIR).EQS."")
123 $! It Dosen't Exist, So Create It.
125 $ CREATE/DIRECTORY 'EXE_DIR'
127 $! End The Architecture Specific Directory Check.
131 $! Define The Library Name.
133 $ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB
135 $! Define The CRYPTO-LIB We Are To Use.
137 $ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO.OLB
139 $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
141 $ IF (F$SEARCH(LIB_NAME).EQS."")
144 $! Guess Not, Create The Library.
146 $ LIBRARY/CREATE/OBJECT 'LIB_NAME'
148 $! End The Library Check.
152 $! Build our options file for the application
154 $ GOSUB CHECK_OPT_FILE
156 $! Define The Different Encryption "library" Strings.
158 $ APPS_DES = "DES/DES,CBC3_ENC"
159 $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE"
161 $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,tmdiff,cpt_err,ebcdic,uid,o_time,o_str"
162 $ LIB_MD2 = "md2_dgst,md2_one"
163 $ LIB_MD4 = "md4_dgst,md4_one"
164 $ LIB_MD5 = "md5_dgst,md5_one"
165 $ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one"
166 $ LIB_MDC2 = "mdc2dgst,mdc2_one"
168 $ LIB_RIPEMD = "rmd_dgst,rmd_one"
169 $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
170 "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
171 "enc_read,enc_writ,ofb64enc,"+ -
172 "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
173 "des_enc,fcrypt_b,"+ -
174 "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ -
175 "ede_cbcm_enc,des_old,des_old2,read2pwd"
176 $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
177 $ LIB_RC4 = "rc4_skey,rc4_enc"
178 $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
179 $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
180 $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
181 $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
182 $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
183 $ IF F$TRNLNM("OPENSSL_NO_ASM").OR.ARCH.EQS."AXP" THEN LIB_BN_ASM = "bn_asm"
184 $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
185 "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
186 "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
187 "bn_recp,bn_mont,bn_mpi,bn_exp2"
188 $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
189 "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
191 $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_recp,ecp_nist,ec_cvt,ec_mult,"+ -
193 $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
194 $ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err"
195 $ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
196 "dso_openssl,dso_win32,dso_vms"
197 $ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ -
198 "eng_table,eng_pkey,eng_fat,eng_all,"+ -
199 "tb_rsa,tb_dsa,tb_dh,tb_rand,tb_cipher,tb_digest,"+ -
200 "eng_openssl,eng_dyn,eng_cnf,"+ -
201 "hw_atalla,hw_cswift,hw_ncipher,hw_nuron,hw_ubsec,"+ -
202 "hw_cryptodev,hw_aep,hw_sureware,hw_4758_cca"
203 $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr"
204 $ LIB_BUFFER = "buffer,buf_err"
205 $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
206 "bss_mem,bss_null,bss_fd,"+ -
207 "bss_file,bss_sock,bss_conn,"+ -
208 "bf_null,bf_buff,b_print,b_dump,"+ -
209 "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
211 $ LIB_STACK = "stack"
212 $ LIB_LHASH = "lhash,lh_stats"
213 $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
215 $ LIB_ERR = "err,err_all,err_prn"
216 $ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err"
217 $ LIB_EVP = "encode,digest,evp_enc,evp_key,evp_acnf,"+ -
218 "e_des,e_bf,e_idea,e_des3,"+ -
219 "e_rc4,e_aes,names,"+ -
220 "e_xcbc_d,e_rc2,e_cast,e_rc5"
221 $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1," + -
222 "m_dss,m_dss1,m_mdc2,m_ripemd,"+ -
223 "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
224 "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
225 "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
226 "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
227 $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
228 "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ -
229 "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
230 "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,x_bignum,"+ -
231 "x_long,x_name,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
232 "d2i_pu,d2i_pr,i2d_pu,i2d_pr"
233 $ LIB_ASN1_2 = "t_req,t_x509,t_x509a,t_crl,t_pkey,t_spki,t_bitst,"+ -
234 "tasn_new,tasn_fre,tasn_enc,tasn_dec,tasn_utl,tasn_typ,"+ -
235 "f_int,f_string,n_pkey,"+ -
236 "f_enum,a_hdr,x_pkey,a_bool,x_exten,"+ -
237 "asn1_par,asn1_lib,asn1_err,a_meth,a_bytes,a_strnid,"+ -
238 "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid"
239 $ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
240 "pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey"
241 $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
242 "x509_obj,x509_req,x509spki,x509_vfy,"+ -
243 "x509_set,x509cset,x509rset,x509_err,"+ -
244 "x509name,x509_v3,x509_ext,x509_att,"+ -
245 "x509type,x509_lu,x_all,x509_txt,"+ -
246 "x509_trs,by_file,by_dir"
247 $ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
248 "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
249 "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
251 $ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
252 $ LIB_TXT_DB = "txt_db"
253 $ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
255 $ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ -
256 "p12_init,p12_key,p12_kiss,p12_mutl,"+ -
257 "p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e"
258 $ LIB_COMP = "comp_lib,comp_err,"+ -
260 $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ -
261 "ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err"
262 $ LIB_UI_COMPAT = ",ui_compat"
263 $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT
264 $ LIB_KRB5 = "krb5_asn"
266 $! Setup exceptional compilations
268 $ COMPILEWITH_CC3 = ",bss_rtcp,"
269 $ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,"
270 $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
271 "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
273 $! Figure Out What Other Modules We Are To Build.
277 $! Define A Module Counter.
285 $! Extract The Module Name From The Encryption List.
287 $ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
288 $ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
289 $ MODULE_NAME1 = MODULE_NAME
291 $! Check To See If We Are At The End Of The Module List.
293 $ IF (MODULE_NAME.EQS.",")
296 $! We Are At The End Of The Module List, Go To MODULE_DONE.
300 $! End The Module List Check.
304 $! Increment The Moudle Counter.
306 $ MODULE_COUNTER = MODULE_COUNTER + 1
308 $! Create The Library and Apps Module Names.
310 $ LIB_MODULE = "LIB_" + MODULE_NAME
311 $ APPS_MODULE = "APPS_" + MODULE_NAME
312 $ IF (MODULE_NAME.EQS."ASN1_2")
314 $ MODULE_NAME = "ASN1"
316 $ IF (MODULE_NAME.EQS."EVP_2")
318 $ MODULE_NAME = "EVP"
321 $! Set state (can be LIB and APPS)
324 $ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
326 $! Check if the library module name actually is defined
328 $ IF F$TYPE('LIB_MODULE') .EQS. ""
331 $ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
336 $! Top Of The Module Loop.
340 $! Tell The User What Module We Are Building.
342 $ IF (MODULE_NAME1.NES."")
344 $ IF STATE .EQS. "LIB"
346 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
347 $ ELSE IF F$TYPE('APPS_MODULE') .NES. ""
349 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
354 $! Define A File Counter And Set It To "0".
358 $ APPLICATION_COUNTER = 0
360 $! Top Of The File Loop.
364 $! Look in the LIB_MODULE is we're in state LIB
366 $ IF STATE .EQS. "LIB"
369 $! O.K, Extract The File Name From The File List.
371 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
378 $ IF F$TYPE('APPS_MODULE') .NES. ""
381 $! Extract The File Name From The File List.
382 $! This part is a bit more complicated.
384 $ IF APPLICATION .EQS. ""
386 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
387 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
388 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
389 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
393 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
394 $! SHOW SYMBOL APPLICATION*
396 $ IF APPLICATION .NES. ";"
398 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS)
399 $ IF FILE_NAME .EQS. ","
408 $! Check To See If We Are At The End Of The File List.
410 $ IF (FILE_NAME.EQS.",")
413 $! We Are At The End Of The File List, Change State Or Goto FILE_DONE.
415 $ IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
423 $! End The File List Check.
427 $! Increment The Counter.
429 $ FILE_COUNTER = FILE_COUNTER + 1
431 $! Create The Source File Name.
433 $ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
434 $ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
435 $ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
436 FILE_NAME = FILE_NAME + ".c"
437 $ IF (MODULE_NAME.NES."")
439 $ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
441 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
443 $ SOURCE_FILE = SOURCE_FILE - "]["
445 $! Create The Object File Name.
447 $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
448 $ ON WARNING THEN GOTO NEXT_FILE
450 $! Check To See If The File We Want To Compile Is Actually There.
452 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
455 $! Tell The User That The File Doesn't Exist.
457 $ WRITE SYS$OUTPUT ""
458 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
459 $ WRITE SYS$OUTPUT ""
465 $! End The File Exist Check.
469 $! Tell The User We Are Compiling The File.
471 $ IF (MODULE_NAME.EQS."")
473 $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE,")"
475 $ IF (MODULE_NAME.NES."")
477 $ WRITE SYS$OUTPUT " ",FILE_NAME,""
482 $ ON ERROR THEN GOTO NEXT_FILE
483 $ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME)
484 $ IF FILE_NAME - ".mar" .NES. FILE_NAME
486 $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
488 $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
490 $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
492 $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
494 $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
496 $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
498 $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
500 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
505 $ IF STATE .EQS. "LIB"
508 $! Add It To The Library.
510 $ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
512 $! Time To Clean Up The Object File.
514 $ DELETE 'OBJECT_FILE';*
517 $! Go Back And Do It Again.
521 $! All Done With This Library Part.
525 $! Time To Build Some Applications
527 $ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
529 $ APPLICATION_COUNTER = 0
531 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
532 $ IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
534 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
535 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
536 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
538 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
539 $! SHOW SYMBOL APPLICATION*
541 $! Tell the user what happens
543 $ WRITE SYS$OUTPUT " ",APPLICATION,".exe"
547 $ ON ERROR THEN GOTO NEXT_APPLICATION
549 $! Check To See If We Are To Link With A Specific TCP/IP Library.
551 $ IF (TCPIP_LIB.NES."")
554 $! Link With A TCP/IP Library.
556 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
557 'OBJ_DIR''APPLICATION_OBJECTS', -
558 'CRYPTO_LIB'/LIBRARY, -
559 'TCPIP_LIB','OPT_FILE'/OPTION
565 $! Don't Link With A TCP/IP Library.
567 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
568 'OBJ_DIR''APPLICATION_OBJECTS',-
569 'CRYPTO_LIB'/LIBRARY, -
572 $! End The TCP/IP Library Check.
575 $ GOTO NEXT_APPLICATION
579 $! Go Back And Get The Next Module.
583 $! All Done With This Module.
587 $! Tell The User That We Are All Done.
589 $ WRITE SYS$OUTPUT "All Done..."
594 $! Check For The Link Option FIle.
598 $! Check To See If We Need To Make A VAX C Option File.
600 $ IF (COMPILER.EQS."VAXC")
603 $! Check To See If We Already Have A VAX C Linker Option File.
605 $ IF (F$SEARCH(OPT_FILE).EQS."")
608 $! We Need A VAX C Linker Option File.
613 ! Default System Options File To Link Agianst
614 ! The Sharable VAX C Runtime Library.
616 SYS$SHARE:VAXCRTL.EXE/SHARE
619 $! End The Option File Check.
623 $! End The VAXC Check.
627 $! Check To See If We Need A GNU C Option File.
629 $ IF (COMPILER.EQS."GNUC")
632 $! Check To See If We Already Have A GNU C Linker Option File.
634 $ IF (F$SEARCH(OPT_FILE).EQS."")
637 $! We Need A GNU C Linker Option File.
642 ! Default System Options File To Link Agianst
643 ! The Sharable C Runtime Library.
645 GNU_CC:[000000]GCCLIB/LIBRARY
646 SYS$SHARE:VAXCRTL/SHARE
649 $! End The Option File Check.
653 $! End The GNU C Check.
657 $! Check To See If We Need A DEC C Option File.
659 $ IF (COMPILER.EQS."DECC")
662 $! Check To See If We Already Have A DEC C Linker Option File.
664 $ IF (F$SEARCH(OPT_FILE).EQS."")
667 $! Figure Out If We Need An AXP Or A VAX Linker Option File.
669 $ IF ARCH .EQS. "VAX"
672 $! We Need A DEC C Linker Option File For VAX.
677 ! Default System Options File To Link Agianst
678 ! The Sharable DEC C Runtime Library.
680 SYS$SHARE:DECC$SHR.EXE/SHARE
687 $! Create The AXP Linker Option File.
692 ! Default System Options File For AXP To Link Agianst
693 ! The Sharable C Runtime Library.
695 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
696 SYS$SHARE:CMA$OPEN_RTL/SHARE
699 $! End The VAX/AXP DEC C Option File Check.
703 $! End The Option File Search.
707 $! End The DEC C Check.
711 $! Tell The User What Linker Option File We Are Using.
713 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
719 $! Check The User's Options.
723 $! Check To See If P1 Is Blank.
728 $! P1 Is Blank, So Build Everything.
736 $! Else, Check To See If P1 Has A Valid Arguement.
738 $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
741 $! A Valid Arguement.
749 $! Tell The User We Don't Know What They Want.
751 $ WRITE SYS$OUTPUT ""
752 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
753 $ WRITE SYS$OUTPUT ""
754 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
755 $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.SSL]LIBCRYPTO.OLB Library."
756 $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.SSL]*.EXE Programs."
757 $ WRITE SYS$OUTPUT ""
758 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
759 $ WRITE SYS$OUTPUT ""
760 $ WRITE SYS$OUTPUT " AXP : Alpha Architecture."
761 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
762 $ WRITE SYS$OUTPUT ""
768 $! End The Valid Arguement Check.
776 $! Check To See If P2 Is Blank.
778 $ IF (P2.EQS."NODEBUG")
781 $! P2 Is NODEBUG, So Compile Without The Debugger Information.
783 $ DEBUGGER = "NODEBUG"
784 $ TRACEBACK = "NOTRACEBACK"
785 $ GCC_OPTIMIZE = "OPTIMIZE"
786 $ CC_OPTIMIZE = "OPTIMIZE"
787 $ MACRO_OPTIMIZE = "OPTIMIZE"
788 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
789 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
792 $! Check To See If We Are To Compile With Debugger Information.
794 $ IF (P2.EQS."DEBUG")
797 $! Compile With Debugger Information.
800 $ TRACEBACK = "TRACEBACK"
801 $ GCC_OPTIMIZE = "NOOPTIMIZE"
802 $ CC_OPTIMIZE = "NOOPTIMIZE"
803 $ MACRO_OPTIMIZE = "NOOPTIMIZE"
804 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
805 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
808 $! They Entered An Invalid Option..
810 $ WRITE SYS$OUTPUT ""
811 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
812 $ WRITE SYS$OUTPUT ""
813 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
814 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
815 $ WRITE SYS$OUTPUT ""
821 $! End The Valid Arguement Check.
829 $! Special Threads For OpenVMS v7.1 Or Later
831 $! Written By: Richard Levitte
832 $! richard@levitte.org
835 $! Check To See If We Have A Option For P5.
840 $! Get The Version Of VMS We Are Using.
843 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
844 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
846 $! Check To See If The VMS Version Is v7.1 Or Later.
851 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
853 $ ISSEVEN := ,PTHREAD_USE_D4
855 $! End The VMS Version Check.
863 $! Check To See If P3 Is Blank.
868 $! O.K., The User Didn't Specify A Compiler, Let's Try To
869 $! Find Out Which One To Use.
871 $! Check To See If We Have GNU C.
873 $ IF (F$TRNLNM("GNU_CC").NES."")
876 $! Looks Like GNUC, Set To Use GNUC.
884 $! Check To See If We Have VAXC Or DECC.
886 $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
889 $! Looks Like DECC, Set To Use DECC.
897 $! Looks Like VAXC, Set To Use VAXC.
901 $! End The VAXC Compiler Check.
905 $! End The DECC & VAXC Compiler Check.
909 $! End The Compiler Check.
913 $! Check To See If We Have A Option For P4.
918 $! Find out what socket library we have available
920 $ IF F$PARSE("SOCKETSHR:") .NES. ""
923 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
929 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
931 $! Else, let's look for something else
935 $! Like UCX (the reason to do this before Multinet is that the UCX
936 $! emulation is easier to use...)
938 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
939 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
940 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
943 $! Last resort: a UCX or UCX-compatible library
949 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
957 $! Set Up Initial CC Definitions, Possibly With User Ones
959 $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
960 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
962 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
963 $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
964 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
965 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
967 $! Check To See If The User Entered A Valid Paramter.
969 $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
972 $! Check To See If The User Wanted DECC.
977 $! Looks Like DECC, Set To Use DECC.
981 $! Tell The User We Are Using DECC.
983 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
988 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
990 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
991 "/NOLIST/PREFIX=ALL" + -
992 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP])" + -
995 $! Define The Linker Options File Name.
997 $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
1003 $! Check To See If We Are To Use VAXC.
1005 $ IF (P3.EQS."VAXC")
1008 $! Looks Like VAXC, Set To Use VAXC.
1012 $! Tell The User We Are Using VAX C.
1014 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
1016 $! Compile Using VAXC.
1021 $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
1024 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
1025 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1026 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1028 $ CCDEFS = """VAXC""," + CCDEFS
1030 $! Define <sys> As SYS$COMMON:[SYSLIB]
1032 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
1034 $! Define The Linker Options File Name.
1036 $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
1042 $! Check To See If We Are To Use GNU C.
1044 $ IF (P3.EQS."GNUC")
1047 $! Looks Like GNUC, Set To Use GNUC.
1051 $! Tell The User We Are Using GNUC.
1053 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
1057 $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1058 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1061 $! Define The Linker Options File Name.
1063 $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
1065 $! End The GNU C Check.
1069 $! Set up default defines
1071 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
1073 $! Finish up the definition of CC.
1075 $ IF COMPILER .EQS. "DECC"
1077 $ IF CCDISABLEWARNINGS .EQS. ""
1079 $ CC4DISABLEWARNINGS = "DOLLARID"
1081 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
1082 $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1084 $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
1086 $ CCDISABLEWARNINGS = ""
1087 $ CC4DISABLEWARNINGS = ""
1089 $ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
1090 $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1091 $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
1093 $ CC5 = CC + "/OPTIMIZE=NODISJOINT"
1095 $ CC5 = CC + "/NOOPTIMIZE"
1097 $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1099 $! Show user the result
1101 $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
1103 $! Else The User Entered An Invalid Arguement.
1107 $! Tell The User We Don't Know What They Want.
1109 $ WRITE SYS$OUTPUT ""
1110 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1111 $ WRITE SYS$OUTPUT ""
1112 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
1113 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
1114 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
1115 $ WRITE SYS$OUTPUT ""
1121 $! End The Valid Arguement Check.
1125 $! Build a MACRO command for the architecture at hand
1127 $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
1128 $ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
1130 $! Show user the result
1132 $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
1134 $! Time to check the contents, and to make sure we get the correct library.
1136 $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
1137 .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
1140 $! Check to see if SOCKETSHR was chosen
1142 $ IF P4.EQS."SOCKETSHR"
1145 $! Set the library to use SOCKETSHR
1147 $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
1149 $! Done with SOCKETSHR
1153 $! Check to see if MULTINET was chosen
1155 $ IF P4.EQS."MULTINET"
1158 $! Set the library to use UCX emulation.
1162 $! Done with MULTINET
1166 $! Check to see if UCX was chosen
1171 $! Set the library to use UCX.
1173 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
1174 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1176 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
1178 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1179 TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
1186 $! Check to see if TCPIP was chosen
1191 $! Set the library to use TCPIP (post UCX).
1193 $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
1199 $! Check to see if NONE was chosen
1204 $! Do not use a TCPIP library.
1214 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
1216 $! Else The User Entered An Invalid Arguement.
1220 $! Tell The User We Don't Know What They Want.
1222 $ WRITE SYS$OUTPUT ""
1223 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
1224 $ WRITE SYS$OUTPUT ""
1225 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1226 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1227 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1228 $ WRITE SYS$OUTPUT ""
1234 $! Done with TCP/IP libraries
1238 $! Check if the user wanted to compile just a subset of all the encryption
1243 $ ENCRYPT_TYPES = P6
1246 $! Time To RETURN...
1252 $! Save old value of the logical name OPENSSL
1254 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1256 $! Save directory information
1258 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1259 $ __HERE = F$EDIT(__HERE,"UPCASE")
1260 $ __TOP = __HERE - "CRYPTO]"
1261 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1263 $! Set up the logical name OPENSSL to point at the include directory
1265 $ DEFINE OPENSSL/NOLOG '__INCLUDE'
1273 $! Restore the logical name OPENSSL if it had a value
1275 $ IF __SAVE_OPENSSL .EQS. ""
1279 $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'