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, ALPHA,
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 specify 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").LT.128)
60 $! The Architecture Is VAX
68 $! The Architecture Is Alpha, IA64 or whatever comes in the future.
70 $ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
71 $ IF (ARCH .EQS. "") THEN ARCH = "UNK"
73 $! End The Architecture Check.
77 $! Define The Different Encryption Types.
78 $! NOTE: Some might think this list ugly. However, it's made this way to
79 $! reflect the SDIRS variable in [-]Makefile.org as closely as possible,
80 $! thereby making it fairly easy to verify that the lists are the same.
82 $ ENCRYPT_TYPES = "Basic,"+ -
84 "MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,"+ -
85 "DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,MODES,"+ -
86 "BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,"+ -
87 "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
88 "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
89 "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
90 "STORE,CMS,PQUEUE,TS,JPAKE"
91 $! Define The OBJ Directory.
93 $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
95 $! Define The EXE Directory.
97 $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
99 $! Check To Make Sure We Have Valid Command Line Parameters.
101 $ GOSUB CHECK_OPTIONS
103 $! Initialise logical names and such
107 $! Tell The User What Kind of Machine We Run On.
109 $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
112 $! Check To See If The Architecture Specific OBJ Directory Exists.
114 $ IF (F$PARSE(OBJ_DIR).EQS."")
117 $! It Dosen't Exist, So Create It.
119 $ CREATE/DIR 'OBJ_DIR'
121 $! End The Architecture Specific OBJ Directory Check.
125 $! Check To See If The Architecture Specific Directory Exists.
127 $ IF (F$PARSE(EXE_DIR).EQS."")
130 $! It Dosen't Exist, So Create It.
132 $ CREATE/DIRECTORY 'EXE_DIR'
134 $! End The Architecture Specific Directory Check.
138 $! Define The Library Name.
140 $ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB
142 $! Define The CRYPTO-LIB We Are To Use.
144 $ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO.OLB
146 $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
148 $ IF (F$SEARCH(LIB_NAME).EQS."")
151 $! Guess Not, Create The Library.
153 $ LIBRARY/CREATE/OBJECT 'LIB_NAME'
155 $! End The Library Check.
159 $! Build our options file for the application
161 $ GOSUB CHECK_OPT_FILE
163 $! Define The Different Encryption "library" Strings.
165 $ APPS_DES = "DES/DES,CBC3_ENC"
166 $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE"
168 $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,ebcdic,uid,o_time,o_str,o_dir"
169 $ LIB_MD2 = "md2_dgst,md2_one"
170 $ LIB_MD4 = "md4_dgst,md4_one"
171 $ LIB_MD5 = "md5_dgst,md5_one"
172 $ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one,sha256,sha512"
173 $ LIB_MDC2 = "mdc2dgst,mdc2_one"
174 $ LIB_HMAC = "hmac,hm_ameth,hm_pmeth"
175 $ LIB_RIPEMD = "rmd_dgst,rmd_one"
176 $ LIB_WHRLPOOL = "wp_dgst,wp_block"
177 $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
178 "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
179 "enc_read,enc_writ,ofb64enc,"+ -
180 "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
181 "des_enc,fcrypt_b,"+ -
182 "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ -
183 "ede_cbcm_enc,des_old,des_old2,read2pwd"
184 $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
185 $ LIB_RC4 = "rc4_skey,rc4_enc"
186 $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
187 $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
188 $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
189 $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
190 $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ -
192 $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb"
193 $ LIB_MODES = "cbc128,ctr128,cfb128,ofb128"
194 $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
195 $ IF F$TRNLNM("OPENSSL_NO_ASM").OR.ARCH.NES."VAX" THEN LIB_BN_ASM = "bn_asm"
196 $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
197 "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
198 "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
199 "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
201 $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ -
202 "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
203 "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn"
204 $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
205 "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
206 "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ -
208 $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ -
209 "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn"
210 $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err"
211 $ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err,dh_depr,"+ -
212 "dh_ameth,dh_pmeth,dh_prn"
213 $ LIB_ECDH = "ech_lib,ech_ossl,ech_key,ech_err"
214 $ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
215 "dso_openssl,dso_win32,dso_vms,dso_beos"
216 $ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ -
217 "eng_table,eng_pkey,eng_fat,eng_all,"+ -
218 "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ -
219 "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ -
220 "eng_openssl,eng_dyn,eng_cnf,eng_cryptodev,"+ -
222 $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr,"+ -
224 $ LIB_BUFFER = "buffer,buf_err"
225 $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
226 "bss_mem,bss_null,bss_fd,"+ -
227 "bss_file,bss_sock,bss_conn,"+ -
228 "bf_null,bf_buff,b_print,b_dump,"+ -
229 "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
232 $ LIB_STACK = "stack"
233 $ LIB_LHASH = "lhash,lh_stats"
234 $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
236 $ LIB_ERR = "err,err_all,err_prn"
237 $ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err,obj_xref"
238 $ LIB_EVP = "encode,digest,evp_enc,evp_key,evp_acnf,"+ -
239 "e_des,e_bf,e_idea,e_des3,e_camellia,"+ -
240 "e_rc4,e_aes,names,e_seed,"+ -
241 "e_xcbc_d,e_rc2,e_cast,e_rc5"
242 $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1,m_wp," + -
243 "m_dss,m_dss1,m_mdc2,m_ripemd,m_ecdsa,"+ -
244 "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
245 "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
246 "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
247 "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
248 $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver"
249 $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
250 "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ -
251 "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
252 "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,x_bignum,"+ -
253 "x_long,x_name,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
254 "x_nx509,d2i_pu,d2i_pr,i2d_pu,i2d_pr"
255 $ LIB_ASN1_2 = "t_req,t_x509,t_x509a,t_crl,t_pkey,t_spki,t_bitst,"+ -
256 "tasn_new,tasn_fre,tasn_enc,tasn_dec,tasn_utl,tasn_typ,"+ -
257 "tasn_prn,ameth_lib,"+ -
258 "f_int,f_string,n_pkey,"+ -
259 "f_enum,x_pkey,a_bool,x_exten,bio_asn1,bio_ndef,asn_mime,"+ -
260 "asn1_gen,asn1_par,asn1_lib,asn1_err,a_bytes,a_strnid,"+ -
261 "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid"
262 $ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
263 "pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey,pvkfmt"
264 $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
265 "x509_obj,x509_req,x509spki,x509_vfy,"+ -
266 "x509_set,x509cset,x509rset,x509_err,"+ -
267 "x509name,x509_v3,x509_ext,x509_att,"+ -
268 "x509type,x509_lu,x_all,x509_txt,"+ -
269 "x509_trs,by_file,by_dir,x509_vpm"
270 $ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
271 "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
272 "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
273 "v3_ocsp,v3_akeya,v3_pmaps,v3_pcons,v3_ncons,v3_pcia,v3_pci,"+ -
274 "pcy_cache,pcy_node,pcy_data,pcy_map,pcy_tree,pcy_lib,"+ -
276 $ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
277 $ LIB_TXT_DB = "txt_db"
278 $ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
280 $ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ -
281 "p12_init,p12_key,p12_kiss,p12_mutl,"+ -
282 "p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e"
283 $ LIB_COMP = "comp_lib,comp_err,"+ -
285 $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ -
286 "ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err"
287 $ LIB_UI_COMPAT = ",ui_compat"
288 $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT
289 $ LIB_KRB5 = "krb5_asn"
290 $ LIB_STORE = "str_err,str_lib,str_meth,str_mem"
291 $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ -
292 "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess"
293 $ LIB_PQUEUE = "pqueue"
294 $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ -
295 "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ -
297 $ LIB_JPAKE = "jpake,jpake_err"
299 $! Setup exceptional compilations
301 $ ! Add definitions for no threads on OpenVMS 7.1 and higher
302 $ COMPILEWITH_CC3 = ",bss_rtcp,"
303 $ ! Disable the DOLLARID warning
304 $ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir"
305 $ ! Disable disjoint optimization
306 $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
307 "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
308 $ ! Disable the MIXLINKAGE warning
309 $ COMPILEWITH_CC6 = ",enc_read,set_key,"
311 $! Figure Out What Other Modules We Are To Build.
315 $! Define A Module Counter.
323 $! Extract The Module Name From The Encryption List.
325 $ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
326 $ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
327 $ MODULE_NAME1 = MODULE_NAME
329 $! Check To See If We Are At The End Of The Module List.
331 $ IF (MODULE_NAME.EQS.",")
334 $! We Are At The End Of The Module List, Go To MODULE_DONE.
338 $! End The Module List Check.
342 $! Increment The Moudle Counter.
344 $ MODULE_COUNTER = MODULE_COUNTER + 1
346 $! Create The Library and Apps Module Names.
348 $ LIB_MODULE = "LIB_" + MODULE_NAME
349 $ APPS_MODULE = "APPS_" + MODULE_NAME
350 $ IF (F$EXTRACT(0,5,MODULE_NAME).EQS."ASN1_")
352 $ MODULE_NAME = "ASN1"
354 $ IF (F$EXTRACT(0,4,MODULE_NAME).EQS."EVP_")
356 $ MODULE_NAME = "EVP"
359 $! Set state (can be LIB and APPS)
362 $ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
364 $! Check if the library module name actually is defined
366 $ IF F$TYPE('LIB_MODULE') .EQS. ""
369 $ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
374 $! Top Of The Module Loop.
378 $! Tell The User What Module We Are Building.
380 $ IF (MODULE_NAME1.NES."")
382 $ IF STATE .EQS. "LIB"
384 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
385 $ ELSE IF F$TYPE('APPS_MODULE') .NES. ""
387 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
392 $! Define A File Counter And Set It To "0".
396 $ APPLICATION_COUNTER = 0
398 $! Top Of The File Loop.
402 $! Look in the LIB_MODULE is we're in state LIB
404 $ IF STATE .EQS. "LIB"
407 $! O.K, Extract The File Name From The File List.
409 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
416 $ IF F$TYPE('APPS_MODULE') .NES. ""
419 $! Extract The File Name From The File List.
420 $! This part is a bit more complicated.
422 $ IF APPLICATION .EQS. ""
424 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
425 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
426 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
427 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
431 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
432 $! SHOW SYMBOL APPLICATION*
434 $ IF APPLICATION .NES. ";"
436 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS)
437 $ IF FILE_NAME .EQS. ","
446 $! Check To See If We Are At The End Of The File List.
448 $ IF (FILE_NAME.EQS.",")
451 $! We Are At The End Of The File List, Change State Or Goto FILE_DONE.
453 $ IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
461 $! End The File List Check.
465 $! Increment The Counter.
467 $ FILE_COUNTER = FILE_COUNTER + 1
469 $! Create The Source File Name.
471 $ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
472 $ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
473 $ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
474 FILE_NAME = FILE_NAME + ".c"
475 $ IF (MODULE_NAME.NES."")
477 $ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
479 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
481 $ SOURCE_FILE = SOURCE_FILE - "]["
483 $! Create The Object File Name.
485 $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
486 $ ON WARNING THEN GOTO NEXT_FILE
488 $! Check To See If The File We Want To Compile Is Actually There.
490 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
493 $! Tell The User That The File Doesn't Exist.
495 $ WRITE SYS$OUTPUT ""
496 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
497 $ WRITE SYS$OUTPUT ""
503 $! End The File Exist Check.
507 $! Tell The User We Are Compiling The File.
509 $ IF (MODULE_NAME.EQS."")
511 $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE,")"
513 $ IF (MODULE_NAME.NES."")
515 $ WRITE SYS$OUTPUT " ",FILE_NAME,""
520 $ ON ERROR THEN GOTO NEXT_FILE
521 $ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME)
522 $ IF FILE_NAME - ".mar" .NES. FILE_NAME
524 $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
526 $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
528 $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
530 $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
532 $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
534 $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
536 $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
538 $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
540 $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
542 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
548 $ IF STATE .EQS. "LIB"
551 $! Add It To The Library.
553 $ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
555 $! Time To Clean Up The Object File.
557 $ DELETE 'OBJECT_FILE';*
560 $! Go Back And Do It Again.
564 $! All Done With This Library Part.
568 $! Time To Build Some Applications
570 $ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
572 $ APPLICATION_COUNTER = 0
574 $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
575 $ IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
577 $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
578 $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
579 $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
581 $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
582 $! SHOW SYMBOL APPLICATION*
584 $! Tell the user what happens
586 $ WRITE SYS$OUTPUT " ",APPLICATION,".exe"
590 $ ON ERROR THEN GOTO NEXT_APPLICATION
592 $! Check To See If We Are To Link With A Specific TCP/IP Library.
594 $ IF (TCPIP_LIB.NES."")
597 $! Link With A TCP/IP Library.
599 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
600 'OBJ_DIR''APPLICATION_OBJECTS', -
601 'CRYPTO_LIB'/LIBRARY, -
602 'TCPIP_LIB','OPT_FILE'/OPTION
608 $! Don't Link With A TCP/IP Library.
610 $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
611 'OBJ_DIR''APPLICATION_OBJECTS',-
612 'CRYPTO_LIB'/LIBRARY, -
615 $! End The TCP/IP Library Check.
618 $ GOTO NEXT_APPLICATION
622 $! Go Back And Get The Next Module.
626 $! All Done With This Module.
630 $! Tell The User That We Are All Done.
632 $ WRITE SYS$OUTPUT "All Done..."
637 $! Check For The Link Option FIle.
641 $! Check To See If We Need To Make A VAX C Option File.
643 $ IF (COMPILER.EQS."VAXC")
646 $! Check To See If We Already Have A VAX C Linker Option File.
648 $ IF (F$SEARCH(OPT_FILE).EQS."")
651 $! We Need A VAX C Linker Option File.
656 ! Default System Options File To Link Agianst
657 ! The Sharable VAX C Runtime Library.
659 SYS$SHARE:VAXCRTL.EXE/SHARE
662 $! End The Option File Check.
666 $! End The VAXC Check.
670 $! Check To See If We Need A GNU C Option File.
672 $ IF (COMPILER.EQS."GNUC")
675 $! Check To See If We Already Have A GNU C Linker Option File.
677 $ IF (F$SEARCH(OPT_FILE).EQS."")
680 $! We Need A GNU C Linker Option File.
685 ! Default System Options File To Link Agianst
686 ! The Sharable C Runtime Library.
688 GNU_CC:[000000]GCCLIB/LIBRARY
689 SYS$SHARE:VAXCRTL/SHARE
692 $! End The Option File Check.
696 $! End The GNU C Check.
700 $! Check To See If We Need A DEC C Option File.
702 $ IF (COMPILER.EQS."DECC")
705 $! Check To See If We Already Have A DEC C Linker Option File.
707 $ IF (F$SEARCH(OPT_FILE).EQS."")
710 $! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
712 $ IF ARCH .EQS. "VAX"
715 $! We Need A DEC C Linker Option File For VAX.
720 ! Default System Options File To Link Agianst
721 ! The Sharable DEC C Runtime Library.
723 SYS$SHARE:DECC$SHR.EXE/SHARE
730 $! Create The non-VAX Linker Option File.
735 ! Default System Options File For non-VAX To Link Agianst
736 ! The Sharable C Runtime Library.
738 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
739 SYS$SHARE:CMA$OPEN_RTL/SHARE
742 $! End The DEC C Option File Check.
746 $! End The Option File Search.
750 $! End The DEC C Check.
754 $! Tell The User What Linker Option File We Are Using.
756 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
762 $! Check The User's Options.
766 $! Check To See If P1 Is Blank.
771 $! P1 Is Blank, So Build Everything.
779 $! Else, Check To See If P1 Has A Valid Arguement.
781 $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
784 $! A Valid Arguement.
792 $! Tell The User We Don't Know What They Want.
794 $ WRITE SYS$OUTPUT ""
795 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
796 $ WRITE SYS$OUTPUT ""
797 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
798 $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
799 $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.EXE Programs."
800 $ WRITE SYS$OUTPUT ""
801 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
802 $ WRITE SYS$OUTPUT ""
803 $ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture."
804 $ WRITE SYS$OUTPUT " IA64 : IA64 Architecture."
805 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
806 $ WRITE SYS$OUTPUT ""
812 $! End The Valid Arguement Check.
820 $! Check To See If P2 Is Blank.
822 $ IF (P2.EQS."NODEBUG")
825 $! P2 Is NODEBUG, So Compile Without The Debugger Information.
827 $ DEBUGGER = "NODEBUG"
828 $ TRACEBACK = "NOTRACEBACK"
829 $ GCC_OPTIMIZE = "OPTIMIZE"
830 $ CC_OPTIMIZE = "OPTIMIZE"
831 $ MACRO_OPTIMIZE = "OPTIMIZE"
832 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
833 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
836 $! Check To See If We Are To Compile With Debugger Information.
838 $ IF (P2.EQS."DEBUG")
841 $! Compile With Debugger Information.
844 $ TRACEBACK = "TRACEBACK"
845 $ GCC_OPTIMIZE = "NOOPTIMIZE"
846 $ CC_OPTIMIZE = "NOOPTIMIZE"
847 $ MACRO_OPTIMIZE = "NOOPTIMIZE"
848 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
849 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
852 $! They Entered An Invalid Option..
854 $ WRITE SYS$OUTPUT ""
855 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
856 $ WRITE SYS$OUTPUT ""
857 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
858 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
859 $ WRITE SYS$OUTPUT ""
865 $! End The Valid Arguement Check.
873 $! Special Threads For OpenVMS v7.1 Or Later
875 $! Written By: Richard Levitte
876 $! richard@levitte.org
879 $! Check To See If We Have A Option For P5.
884 $! Get The Version Of VMS We Are Using.
887 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
888 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
890 $! Check To See If The VMS Version Is v7.1 Or Later.
895 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
897 $ ISSEVEN := ,PTHREAD_USE_D4
899 $! End The VMS Version Check.
907 $! Check To See If P3 Is Blank.
912 $! O.K., The User Didn't Specify A Compiler, Let's Try To
913 $! Find Out Which One To Use.
915 $! Check To See If We Have GNU C.
917 $ IF (F$TRNLNM("GNU_CC").NES."")
920 $! Looks Like GNUC, Set To Use GNUC.
928 $! Check To See If We Have VAXC Or DECC.
930 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
933 $! Looks Like DECC, Set To Use DECC.
941 $! Looks Like VAXC, Set To Use VAXC.
945 $! End The VAXC Compiler Check.
949 $! End The DECC & VAXC Compiler Check.
953 $! End The Compiler Check.
957 $! Check To See If We Have A Option For P4.
962 $! Find out what socket library we have available
964 $ IF F$PARSE("SOCKETSHR:") .NES. ""
967 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
973 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
975 $! Else, let's look for something else
979 $! Like UCX (the reason to do this before Multinet is that the UCX
980 $! emulation is easier to use...)
982 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
983 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
984 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
987 $! Last resort: a UCX or UCX-compatible library
993 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
1001 $! Set Up Initial CC Definitions, Possibly With User Ones
1003 $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
1004 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
1006 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
1007 $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
1008 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
1009 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
1011 $! Check To See If The User Entered A Valid Paramter.
1013 $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
1016 $! Check To See If The User Wanted DECC.
1018 $ IF (P3.EQS."DECC")
1021 $! Looks Like DECC, Set To Use DECC.
1025 $! Tell The User We Are Using DECC.
1027 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
1032 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
1034 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
1035 "/NOLIST/PREFIX=ALL" + -
1036 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
1039 $! Define The Linker Options File Name.
1041 $ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
1047 $! Check To See If We Are To Use VAXC.
1049 $ IF (P3.EQS."VAXC")
1052 $! Looks Like VAXC, Set To Use VAXC.
1056 $! Tell The User We Are Using VAX C.
1058 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
1060 $! Compile Using VAXC.
1065 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
1068 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
1069 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1070 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
1072 $ CCDEFS = """VAXC""," + CCDEFS
1074 $! Define <sys> As SYS$COMMON:[SYSLIB]
1076 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
1078 $! Define The Linker Options File Name.
1080 $ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
1086 $! Check To See If We Are To Use GNU C.
1088 $ IF (P3.EQS."GNUC")
1091 $! Looks Like GNUC, Set To Use GNUC.
1095 $! Tell The User We Are Using GNUC.
1097 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
1101 $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1102 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
1105 $! Define The Linker Options File Name.
1107 $ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
1109 $! End The GNU C Check.
1113 $! Set up default defines
1115 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
1117 $! Finish up the definition of CC.
1119 $ IF COMPILER .EQS. "DECC"
1121 $ IF CCDISABLEWARNINGS .EQS. ""
1123 $ CC4DISABLEWARNINGS = "DOLLARID"
1124 $ CC6DISABLEWARNINGS = "MIXLINKAGE"
1126 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
1127 $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
1128 $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1130 $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
1131 $ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
1133 $ CCDISABLEWARNINGS = ""
1134 $ CC4DISABLEWARNINGS = ""
1135 $ CC6DISABLEWARNINGS = ""
1137 $ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
1138 $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1139 $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
1141 $ CC5 = CC + "/OPTIMIZE=NODISJOINT"
1143 $ CC5 = CC + "/NOOPTIMIZE"
1145 $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1146 $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
1148 $! Show user the result
1150 $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
1152 $! Else The User Entered An Invalid Arguement.
1156 $! Tell The User We Don't Know What They Want.
1158 $ WRITE SYS$OUTPUT ""
1159 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1160 $ WRITE SYS$OUTPUT ""
1161 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
1162 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
1163 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
1164 $ WRITE SYS$OUTPUT ""
1170 $! End The Valid Arguement Check.
1174 $! Build a MACRO command for the architecture at hand
1176 $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
1177 $ IF ARCH .NES. "VAX" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
1179 $! Show user the result
1181 $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
1183 $! Time to check the contents, and to make sure we get the correct library.
1185 $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
1186 .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
1189 $! Check to see if SOCKETSHR was chosen
1191 $ IF P4.EQS."SOCKETSHR"
1194 $! Set the library to use SOCKETSHR
1196 $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
1198 $! Done with SOCKETSHR
1202 $! Check to see if MULTINET was chosen
1204 $ IF P4.EQS."MULTINET"
1207 $! Set the library to use UCX emulation.
1211 $! Done with MULTINET
1215 $! Check to see if UCX was chosen
1220 $! Set the library to use UCX.
1222 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
1223 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1225 $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
1227 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1228 TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
1235 $! Check to see if TCPIP was chosen
1240 $! Set the library to use TCPIP (post UCX).
1242 $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
1248 $! Check to see if NONE was chosen
1253 $! Do not use a TCPIP library.
1263 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
1265 $! Else The User Entered An Invalid Arguement.
1269 $! Tell The User We Don't Know What They Want.
1271 $ WRITE SYS$OUTPUT ""
1272 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
1273 $ WRITE SYS$OUTPUT ""
1274 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1275 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1276 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1277 $ WRITE SYS$OUTPUT ""
1283 $! Done with TCP/IP libraries
1287 $! Check if the user wanted to compile just a subset of all the encryption
1292 $ ENCRYPT_TYPES = P6
1295 $! Time To RETURN...
1301 $! Save old value of the logical name OPENSSL
1303 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1305 $! Save directory information
1307 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1308 $ __HERE = F$EDIT(__HERE,"UPCASE")
1309 $ __TOP = __HERE - "CRYPTO]"
1310 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1312 $! Set up the logical name OPENSSL to point at the include directory
1314 $ DEFINE OPENSSL/NOLOG '__INCLUDE'
1322 $! Restore the logical name OPENSSL if it had a value
1324 $ IF __SAVE_OPENSSL .EQS. ""
1328 $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'