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 <arpadffy@polarhome.com>
11 $! This command files compiles and creates the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB"
12 $! library for OpenSSL. The "xxx" denotes the machine architecture, ALPHA,
15 $! It was re-written so it would try to determine what "C" compiler to use
16 $! or you can specify which "C" compiler to use.
18 $! Specify the following as P1 to build just that part or ALL to just
21 $! LIBRARY To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
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.
49 $! P7, if defined, specifies the C pointer size. Ignored on VAX.
50 $! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.)
51 $! Supported values are:
53 $! "" Compile with default (/NOPOINTER_SIZE)
54 $! 32 Compile with /POINTER_SIZE=32 (SHORT)
55 $! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]).
56 $! (Automatically select ARGV if compiler supports it.)
57 $! 64= Compile with /POINTER_SIZE=64 (LONG).
58 $! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV).
60 $! P8, if defined, specifies a directory where ZLIB files (zlib.h,
61 $! libz.olb) may be found. Optionally, a non-default object library
62 $! name may be included ("dev:[dir]libz_64.olb", for example).
67 $ proc = f$environment( "procedure")
68 $ write sys$output "@@@ "+ -
69 f$parse( proc, , , "name")+ f$parse( proc, , , "type")
71 $! Define A TCP/IP Library That We Will Need To Link To.
72 $! (That Is, If We Need To Link To One.)
77 $! Check Which Architecture We Are Using.
79 $ IF (F$GETSYI("CPU").LT.128)
82 $! The Architecture Is VAX
90 $! The Architecture Is Alpha, IA64 or whatever comes in the future.
92 $ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
93 $ IF (ARCH .EQS. "") THEN ARCH = "UNK"
95 $! End The Architecture Check.
104 $! Check if there's a SDIRS variable defined
106 $ IF "''SDIRS'" .NES. ""
109 $! If SDIRS was defined, define ENCRYPT_TYPES from it
111 $ ENCRYPT_TYPES = "Basic,''SDIRS'"
117 $! Define The Different Encryption Types.
118 $! NOTE: Some might think this list ugly. However, it's made this way to
119 $! reflect the SDIRS variable in [-]Makefile.org as closely as possible,
120 $! thereby making it fairly easy to verify that the lists are the same.
122 $ ET_WHIRLPOOL = "WHRLPOOL"
123 $ IF ARCH .EQS. "VAX" THEN ET_WHIRLPOOL = ""
124 $ ENCRYPT_TYPES = "Basic,"+ -
126 "MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ET_WHIRLPOOL+","+ -
127 "DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,MODES,"+ -
128 "BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,"+ -
129 "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
130 "EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,"+ -
131 "CMS,PQUEUE,TS,JPAKE,SRP,STORE,CMAC"
134 $! Check To Make Sure We Have Valid Command Line Parameters.
136 $ GOSUB CHECK_OPTIONS
138 $! Define The OBJ and EXE Directories.
140 $ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.CRYPTO]
141 $ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]
143 $! Specify the destination directory in any /MAP option.
145 $ if (LINKMAP .eqs. "MAP")
147 $ LINKMAP = LINKMAP+ "=''EXE_DIR'"
150 $! Add the location prefix to the linker options file name.
152 $ if (OPT_FILE .nes. "")
154 $ OPT_FILE = EXE_DIR+ OPT_FILE
157 $! Initialise logical names and such
161 $! Tell The User What Kind of Machine We Run On.
163 $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
166 $! Check To See If The Architecture Specific OBJ Directory Exists.
168 $ IF (F$PARSE(OBJ_DIR).EQS."")
171 $! It Dosen't Exist, So Create It.
173 $ CREATE/DIR 'OBJ_DIR'
175 $! End The Architecture Specific OBJ Directory Check.
179 $! Check To See If The Architecture Specific Directory Exists.
181 $ IF (F$PARSE(EXE_DIR).EQS."")
184 $! It Dosen't Exist, So Create It.
186 $ CREATE/DIRECTORY 'EXE_DIR'
188 $! End The Architecture Specific Directory Check.
192 $! Define The Library Name.
194 $ LIB_NAME := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB
196 $! Define The CRYPTO-LIB We Are To Use.
198 $ CRYPTO_LIB := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB
200 $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
202 $ IF (F$SEARCH(LIB_NAME).EQS."")
205 $! Guess Not, Create The Library.
207 $ LIBRARY/CREATE/OBJECT 'LIB_NAME'
209 $! End The Library Check.
213 $! Build our options file for the application
215 $ GOSUB CHECK_OPT_FILE
217 $! Define The Different Encryption "library" Strings.
219 $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,"+ -
220 "ebcdic,uid,o_time,o_str,o_dir,thr_id,lock,fips_ers,"+ -
222 $ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err,obj_xref"
223 $ LIB_MD2 = "md2_dgst,md2_one"
224 $ LIB_MD4 = "md4_dgst,md4_one"
225 $ LIB_MD5 = "md5_dgst,md5_one"
226 $ LIB_SHA = "sha1dgst,sha1_one,sha256,sha512"
227 $ LIB_MDC2 = "mdc2dgst,mdc2_one"
228 $ LIB_HMAC = "hmac,hm_ameth,hm_pmeth"
229 $ LIB_RIPEMD = "rmd_dgst,rmd_one"
230 $ LIB_WHRLPOOL = "wp_dgst,wp_block"
231 $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
232 "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
233 "enc_read,enc_writ,ofb64enc,"+ -
234 "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
235 "des_enc,fcrypt_b,"+ -
236 "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ -
238 $ LIB_AES = "aes_misc,aes_ecb,aes_cfb,aes_ofb,aes_ige,aes_wrap,"+ -
240 $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
241 $ LIB_RC4 = "rc4_enc,rc4_skey"
242 $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
243 $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
244 $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
245 $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
246 $ LIB_CAMELLIA = "cmll_ecb,cmll_ofb,cmll_cfb,cmll_ctr,camellia,cmll_misc,cmll_cbc"
247 $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb"
248 $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128,gcm128,"+ -
249 "ccm128,xts128,wrap128,ocb128"
250 $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
251 $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN -
252 LIB_BN_ASM = "bn_asm"
253 $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
254 "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
255 "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
256 "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
257 "bn_depr,bn_const,bn_x931p,bn_intern,bn_dh,bn_srp"
258 $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ -
259 "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
260 "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn,"+ -
261 "ecp_nistp224,ecp_nistp256,ecp_nistp521,ecp_nistputil,"+ -
262 "ecp_oct,ec2_oct,ec_oct"
263 $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
264 "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
265 "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ -
266 "rsa_pmeth,rsa_crpt,rsa_x931g"
267 $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ -
268 "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn"
269 $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err"
270 $ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err,dh_depr,"+ -
271 "dh_ameth,dh_pmeth,dh_prn,dh_rfc5114,dh_kdf"
272 $ LIB_ECDH = "ech_lib,ech_ossl,ech_key,ech_err,ech_kdf"
273 $ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
274 "dso_openssl,dso_win32,dso_vms"
275 $ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ -
276 "eng_table,eng_pkey,eng_fat,eng_all,"+ -
277 "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ -
278 "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ -
279 "eng_openssl,eng_cnf,eng_dyn,eng_cryptodev,"+ -
281 $ LIB_BUFFER = "buffer,buf_str,buf_err"
282 $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
283 "bss_mem,bss_null,bss_fd,"+ -
284 "bss_file,bss_sock,bss_conn,"+ -
285 "bf_null,bf_buff,b_print,b_dump,"+ -
286 "b_sock,bss_acpt,bf_nbio,bss_log,bss_bio,"+ -
288 "bf_lbuf" ! The last one is VMS specific
289 $ LIB_STACK = "stack"
290 $ LIB_LHASH = "lhash,lh_stats"
291 $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
292 "rand_win,rand_unix,rand_vms,rand_os2,rand_nw"
293 $ LIB_ERR = "err,err_all,err_prn"
294 $ LIB_EVP_1 = "encode,digest,evp_enc,evp_key,evp_acnf,evp_cnf,"+ -
295 "e_des,e_bf,e_idea,e_des3,e_camellia,"+ -
296 "e_rc4,e_aes,names,e_seed,"+ -
297 "e_xcbc_d,e_rc2,e_cast,e_rc5"
298 $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha1,m_wp," + -
299 "m_dss1,m_mdc2,m_ripemd,m_ecdsa,"+ -
300 "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
301 "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
302 "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
303 "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
304 $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver,"+ -
305 "e_aes_cbc_hmac_sha1,e_aes_cbc_hmac_sha256,e_rc4_hmac_md5"
306 $ LIB_ASN1_1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
307 "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ -
308 "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
309 "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,x_bignum,"+ -
310 "x_long,x_name,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
311 "d2i_pu,d2i_pr,i2d_pu,i2d_pr"
312 $ LIB_ASN1_2 = "t_req,t_x509,t_x509a,t_crl,t_pkey,t_spki,t_bitst,"+ -
313 "tasn_new,tasn_fre,tasn_enc,tasn_dec,tasn_utl,tasn_typ,"+ -
314 "tasn_prn,tasn_scn,ameth_lib,"+ -
315 "f_int,f_string,n_pkey,"+ -
316 "f_enum,x_pkey,a_bool,x_exten,bio_asn1,bio_ndef,asn_mime,"+ -
317 "asn1_gen,asn1_par,asn1_lib,asn1_err,a_bytes,a_strnid,"+ -
318 "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid,"+ -
320 $ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
321 "pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey,pvkfmt"
322 $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
323 "x509_obj,x509_req,x509spki,x509_vfy,"+ -
324 "x509_set,x509cset,x509rset,x509_err,"+ -
325 "x509name,x509_v3,x509_ext,x509_att,"+ -
326 "x509type,x509_lu,x_all,x509_txt,"+ -
327 "x509_trs,by_file,by_dir,x509_vpm"
328 $ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
329 "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
330 "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
331 "v3_akeya,v3_pmaps,v3_pcons,v3_ncons,v3_pcia,v3_pci,"+ -
332 "pcy_cache,pcy_node,pcy_data,pcy_map,pcy_tree,pcy_lib,"+ -
333 "v3_asid,v3_addr,v3_scts"
334 $ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
335 $ LIB_TXT_DB = "txt_db"
336 $ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
338 $ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ -
339 "p12_init,p12_key,p12_kiss,p12_mutl,"+ -
340 "p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e"
341 $ LIB_COMP = "comp_lib,comp_err,"+ -
343 $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ -
344 "ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err,v3_ocsp"
345 $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"
346 $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ -
347 "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess,"+ -
349 $ LIB_PQUEUE = "pqueue"
350 $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ -
351 "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ -
353 $ LIB_JPAKE = "jpake,jpake_err"
354 $ LIB_SRP = "srp_lib,srp_vfy"
355 $ LIB_STORE = "str_err,str_lib,str_meth,str_mem"
356 $ LIB_CMAC = "cmac,cm_ameth,cm_pmeth"
358 $! Setup exceptional compilations
365 $! The following lists must have leading and trailing commas, and no
366 $! embedded spaces. (They are scanned for ",name,".)
368 $ ! Add definitions for no threads on OpenVMS 7.1 and higher.
369 $ COMPILEWITH_CC3 = ",bss_rtcp,"
370 $ ! Disable the DOLLARID warning. Not needed with /STANDARD=RELAXED.
371 $ COMPILEWITH_CC4 = "" !!! ",a_utctm,bss_log,o_time,o_dir,"
372 $ ! Disable disjoint optimization on VAX with DECC.
373 $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
374 "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
375 $ ! Disable the MIXLINKAGE warning.
376 $ COMPILEWITH_CC6 = "" !!! ",enc_read,set_key,"
378 $! Figure Out What Other Modules We Are To Build.
382 $! Define A Module Counter.
390 $! Extract The Module Name From The Encryption List.
392 $ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
394 $! Check To See If We Are At The End Of The Module List.
396 $ IF (MODULE_NAME.EQS.",")
399 $! We Are At The End Of The Module List, Go To MODULE_DONE.
403 $! End The Module List Check.
407 $! Increment The Moudle Counter.
409 $ MODULE_COUNTER = MODULE_COUNTER + 1
411 $ IF MODULE_NAME.EQS."" THEN GOTO MODULE_NEXT
412 $ MODULE_NAME1 = MODULE_NAME
413 $ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
415 $! Check if the library module name actually is defined
418 $ IF F$TYPE(LIB_'MODULE_NAME'_1) .NES. ""
422 $ IF F$TYPE(LIB_'MODULE_NAME') .EQS. ""
425 $ WRITE SYS$ERROR "The module ",MODULE_NAME1," does not exist. Continuing..."
431 $! Tell The User What Module We Are Building.
433 $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,")"
435 $! Create The Library Module Names.
438 $ IF PART_COUNTER .EQ. 0 THEN GOTO MODULE_NEXT
440 $ IF PART_COUNTER .LT. 0
442 $ LIB_MODULE = "LIB_" + MODULE_NAME
444 $ LIB_MODULE = "LIB_" + MODULE_NAME + "_''PART_COUNTER'"
447 $! If there are no more parts, go to the next module
449 $ IF F$TYPE('LIB_MODULE') .EQS. "" THEN GOTO MODULE_NEXT
451 $! Increment The Counter.
453 $ PART_COUNTER = PART_COUNTER + 1
455 $! Define A File Counter And Set It To "0".
459 $! Top Of The File Loop.
463 $! Extract The File Name From The File List.
465 $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
467 $! Check To See If We Are At The End Of The File List.
469 $ IF (FILE_NAME.EQS.",")
472 $! We Are At The End Of The File List, Goto FILE_DONE.
476 $! End The File List Check.
480 $! Increment The Counter.
482 $ FILE_COUNTER = FILE_COUNTER + 1
484 $! Create The Source File Name.
486 $ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
487 $ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
488 $ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
489 FILE_NAME = FILE_NAME + ".c"
490 $ IF (MODULE_NAME.NES."")
492 $ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
494 $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
496 $ SOURCE_FILE = SOURCE_FILE - "]["
498 $! Create The Object File Name.
500 $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
501 $ ON WARNING THEN GOTO NEXT_FILE
503 $! Check To See If The File We Want To Compile Is Actually There.
505 $ IF (F$SEARCH(SOURCE_FILE).EQS."")
508 $! Tell The User That The File Doesn't Exist.
510 $ WRITE SYS$OUTPUT ""
511 $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
512 $ WRITE SYS$OUTPUT ""
518 $! End The File Exist Check.
522 $! Tell The User We Are Compiling The File.
524 $ WRITE SYS$OUTPUT " ",FILE_NAME,""
528 $ ON ERROR THEN GOTO NEXT_FILE
529 $ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ ","
530 $ IF FILE_NAME - ".mar" .NES. FILE_NAME
532 $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
534 $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
536 $ write sys$output " \Using special rule (3)"
537 $ if (.not. CC3_SHOWN)
541 $ write /symbol sys$output x
543 $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
545 $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
547 $ write /symbol sys$output " \Using special rule (4)"
548 $ if (.not. CC4_SHOWN)
552 $ write /symbol sys$output x
554 $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
556 $ IF CC5_DIFFERENT .AND. -
557 (COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5)
559 $ write sys$output " \Using special rule (5)"
560 $ if (.not. CC5_SHOWN)
564 $ write /symbol sys$output x
566 $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
568 $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
570 $ write sys$output " \Using special rule (6)"
571 $ if (.not. CC6_SHOWN)
575 $ write /symbol sys$output x
577 $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
579 $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
586 $! Add It To The Library.
588 $ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
590 $! Time To Clean Up The Object File.
592 $ DELETE 'OBJECT_FILE';*
594 $! Go Back And Do It Again.
598 $! All Done With This Library Part.
602 $! Go Back And Get The Next Part.
606 $! All Done With This Module.
610 $! Tell The User That We Are All Done.
612 $ WRITE SYS$OUTPUT "All Done..."
617 $! Check For The Link Option FIle.
621 $! Check To See If We Need To Make A VAX C Option File.
623 $ IF (COMPILER.EQS."VAXC")
626 $! Check To See If We Already Have A VAX C Linker Option File.
628 $ IF (F$SEARCH(OPT_FILE).EQS."")
631 $! We Need A VAX C Linker Option File.
636 ! Default System Options File To Link Against
637 ! The Sharable VAX C Runtime Library.
639 SYS$SHARE:VAXCRTL.EXE/SHARE
642 $! End The Option File Check.
646 $! End The VAXC Check.
650 $! Check To See If We Need A GNU C Option File.
652 $ IF (COMPILER.EQS."GNUC")
655 $! Check To See If We Already Have A GNU C Linker Option File.
657 $ IF (F$SEARCH(OPT_FILE).EQS."")
660 $! We Need A GNU C Linker Option File.
665 ! Default System Options File To Link Against
666 ! The Sharable C Runtime Library.
668 GNU_CC:[000000]GCCLIB/LIBRARY
669 SYS$SHARE:VAXCRTL/SHARE
672 $! End The Option File Check.
676 $! End The GNU C Check.
680 $! Check To See If We Need A DEC C Option File.
682 $ IF (COMPILER.EQS."DECC")
685 $! Check To See If We Already Have A DEC C Linker Option File.
687 $ IF (F$SEARCH(OPT_FILE).EQS."")
690 $! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
692 $ IF ARCH .EQS. "VAX"
695 $! We Need A DEC C Linker Option File For VAX.
700 ! Default System Options File To Link Against
701 ! The Sharable DEC C Runtime Library.
703 SYS$SHARE:DECC$SHR.EXE/SHARE
710 $! Create The non-VAX Linker Option File.
715 ! Default System Options File For non-VAX To Link Against
716 ! The Sharable C Runtime Library.
718 SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
719 SYS$SHARE:CMA$OPEN_RTL/SHARE
722 $! End The DEC C Option File Check.
726 $! End The Option File Search.
730 $! End The DEC C Check.
734 $! Tell The User What Linker Option File We Are Using.
736 $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
742 $! Check The User's Options.
746 $! Check To See If P1 Is Blank.
751 $! P1 Is Blank, So Build Everything.
759 $! Else, Check To See If P1 Has A Valid Argument.
761 $ IF (P1.EQS."LIBRARY")
772 $! Tell The User We Don't Know What They Want.
774 $ WRITE SYS$OUTPUT ""
775 $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
776 $ WRITE SYS$OUTPUT ""
777 $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
778 $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
779 $ WRITE SYS$OUTPUT ""
780 $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
781 $ WRITE SYS$OUTPUT ""
782 $ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture."
783 $ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture."
784 $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
785 $ WRITE SYS$OUTPUT ""
791 $! End The Valid Argument Check.
799 $! Check To See If P2 Is Blank.
801 $ IF (P2.EQS."NODEBUG")
804 $! P2 Is NODEBUG, So Compile Without The Debugger Information.
806 $ DEBUGGER = "NODEBUG"
808 $ TRACEBACK = "NOTRACEBACK"
809 $ GCC_OPTIMIZE = "OPTIMIZE"
810 $ CC_OPTIMIZE = "OPTIMIZE"
811 $ MACRO_OPTIMIZE = "OPTIMIZE"
812 $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
813 $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
816 $! Check To See If We Are To Compile With Debugger Information.
818 $ IF (P2.EQS."DEBUG")
821 $! Compile With Debugger Information.
825 $ TRACEBACK = "TRACEBACK"
826 $ GCC_OPTIMIZE = "NOOPTIMIZE"
827 $ CC_OPTIMIZE = "NOOPTIMIZE"
828 $ MACRO_OPTIMIZE = "NOOPTIMIZE"
829 $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
830 $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
833 $! They Entered An Invalid Option.
835 $ WRITE SYS$OUTPUT ""
836 $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
837 $ WRITE SYS$OUTPUT ""
838 $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
839 $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
840 $ WRITE SYS$OUTPUT ""
846 $! End The Valid Argument Check.
854 $! Special Threads For OpenVMS v7.1 Or Later
856 $! Written By: Richard Levitte
857 $! richard@levitte.org
860 $! Check To See If We Have A Option For P5.
865 $! Get The Version Of VMS We Are Using.
868 $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
869 $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
871 $! Check To See If The VMS Version Is v7.1 Or Later.
876 $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
878 $ ISSEVEN := ,PTHREAD_USE_D4
880 $! End The VMS Version Check.
888 $! Check P7 (POINTER_SIZE).
890 $ IF (P7 .NES. "") .AND. (ARCH .NES. "VAX")
895 $ POINTER_SIZE = " /POINTER_SIZE=32"
897 $ POINTER_SIZE = F$EDIT( P7, "COLLAPSE, UPCASE")
898 $ IF ((POINTER_SIZE .EQS. "64") .OR. -
899 (POINTER_SIZE .EQS. "64=") .OR. -
900 (POINTER_SIZE .EQS. "64=ARGV"))
902 $ ARCHD = ARCH+ "_64"
904 $ POINTER_SIZE = " /POINTER_SIZE=64"
907 $! Tell The User Entered An Invalid Option.
909 $ WRITE SYS$OUTPUT ""
910 $ WRITE SYS$OUTPUT "The Option ", P7, -
911 " Is Invalid. The Valid Options Are:"
912 $ WRITE SYS$OUTPUT ""
914 " """" : Compile with default (short) pointers."
916 " 32 : Compile with 32-bit (short) pointers."
918 " 64 : Compile with 64-bit (long) pointers (auto ARGV)."
920 " 64= : Compile with 64-bit (long) pointers (no ARGV)."
922 " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)."
923 $ WRITE SYS$OUTPUT ""
933 $! End The P7 (POINTER_SIZE) Check.
937 $! Set basic C compiler /INCLUDE directories.
939 $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ -
940 "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1],"+ -
943 $! Check To See If P3 Is Blank.
948 $! O.K., The User Didn't Specify A Compiler, Let's Try To
949 $! Find Out Which One To Use.
951 $! Check To See If We Have GNU C.
953 $ IF (F$TRNLNM("GNU_CC").NES."")
956 $! Looks Like GNUC, Set To Use GNUC.
964 $! Check To See If We Have VAXC Or DECC.
966 $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
969 $! Looks Like DECC, Set To Use DECC.
977 $! Looks Like VAXC, Set To Use VAXC.
981 $! End The VAXC Compiler Check.
985 $! End The DECC & VAXC Compiler Check.
989 $! End The Compiler Check.
993 $! Check To See If We Have A Option For P4.
998 $! Find out what socket library we have available
1000 $ IF F$PARSE("SOCKETSHR:") .NES. ""
1003 $! We have SOCKETSHR, and it is my opinion that it's the best to use.
1009 $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
1011 $! Else, let's look for something else
1015 $! Like UCX (the reason to do this before Multinet is that the UCX
1016 $! emulation is easier to use...)
1018 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
1019 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
1020 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
1023 $! Last resort: a UCX or UCX-compatible library
1029 $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
1037 $! Set Up Initial CC Definitions, Possibly With User Ones
1039 $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
1040 $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
1042 $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
1043 $ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
1044 $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
1045 CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
1047 $! Check To See If We Have A ZLIB Option.
1050 $ IF (ZLIB .NES. "")
1053 $! Check for expected ZLIB files.
1056 $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY")
1057 $ if (f$search( file1) .eqs. "")
1059 $ WRITE SYS$OUTPUT ""
1060 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
1061 $ WRITE SYS$OUTPUT " Can't find header: ''file1'"
1064 $ file1 = f$parse( "A.;", ZLIB)- "A.;"
1066 $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY")
1067 $ if (f$search( file2) .eqs. "")
1071 $ WRITE SYS$OUTPUT ""
1072 $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid."
1074 $ WRITE SYS$OUTPUT " Can't find library: ''file2'"
1075 $ WRITE SYS$OUTPUT ""
1080 $ WRITE SYS$OUTPUT ""
1088 $ CCDEFS = """ZLIB=1"", "+ CCDEFS
1089 $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1
1090 $ ZLIB_LIB = ", ''file2' /library"
1094 $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2
1096 $! End The ZLIB Check.
1100 $! Check To See If The User Entered A Valid Parameter.
1102 $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
1105 $! Check To See If The User Wanted DECC.
1107 $ IF (P3.EQS."DECC")
1110 $! Looks Like DECC, Set To Use DECC.
1114 $! Tell The User We Are Using DECC.
1116 $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
1121 $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
1123 $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ -
1124 "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + -
1125 " /INCLUDE=(''CC_INCLUDES')"+ -
1128 $! Define The Linker Options File Name.
1130 $ OPT_FILE = "VAX_DECC_OPTIONS.OPT"
1136 $! Check To See If We Are To Use VAXC.
1138 $ IF (P3.EQS."VAXC")
1141 $! Looks Like VAXC, Set To Use VAXC.
1145 $! Tell The User We Are Using VAX C.
1147 $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
1149 $! Compile Using VAXC.
1154 $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
1157 $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
1158 $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1159 "/INCLUDE=(''CC_INCLUDES')"+ -
1161 $ CCDEFS = """VAXC""," + CCDEFS
1163 $! Define <sys> As SYS$COMMON:[SYSLIB]
1165 $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
1167 $! Define The Linker Options File Name.
1169 $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT"
1175 $! Check To See If We Are To Use GNU C.
1177 $ IF (P3.EQS."GNUC")
1180 $! Looks Like GNUC, Set To Use GNUC.
1184 $! Tell The User We Are Using GNUC.
1186 $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
1190 $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1191 "/INCLUDE=(''CC_INCLUDES')"+ -
1194 $! Define The Linker Options File Name.
1196 $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT"
1198 $! End The GNU C Check.
1202 $! Set up default defines
1204 $ CCDEFS = """FLAT_INC=1""," + CCDEFS
1206 $! Finish up the definition of CC.
1208 $ IF COMPILER .EQS. "DECC"
1210 $ IF CCDISABLEWARNINGS .EQS. ""
1212 $ CC4DISABLEWARNINGS = "DOLLARID"
1213 $ CC6DISABLEWARNINGS = "MIXLINKAGE"
1215 $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
1216 $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
1217 $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
1219 $ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
1220 $ CC6DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
1222 $ CCDISABLEWARNINGS = ""
1223 $ CC4DISABLEWARNINGS = ""
1224 $ CC6DISABLEWARNINGS = ""
1226 $ CC3 = CC + " /DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
1227 $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1228 $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
1230 $ CC5 = CC + " /OPTIMIZE=NODISJOINT"
1236 $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
1237 $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
1239 $! Show user the result
1241 $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
1243 $! Else The User Entered An Invalid Argument.
1247 $! Tell The User We Don't Know What They Want.
1249 $ WRITE SYS$OUTPUT ""
1250 $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
1251 $ WRITE SYS$OUTPUT ""
1252 $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
1253 $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
1254 $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
1255 $ WRITE SYS$OUTPUT ""
1261 $! End The Valid Argument Check.
1265 $! Build a MACRO command for the architecture at hand
1267 $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
1268 $ IF ARCH .NES. "VAX" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
1270 $! Show user the result
1272 $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
1274 $! Time to check the contents, and to make sure we get the correct library.
1276 $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
1277 .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
1280 $! Check to see if SOCKETSHR was chosen
1282 $ IF P4.EQS."SOCKETSHR"
1285 $! Set the library to use SOCKETSHR
1287 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS"
1289 $! Done with SOCKETSHR
1293 $! Check to see if MULTINET was chosen
1295 $ IF P4.EQS."MULTINET"
1298 $! Set the library to use UCX emulation.
1302 $! Done with MULTINET
1306 $! Check to see if UCX was chosen
1311 $! Set the library to use UCX.
1313 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS"
1314 $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
1316 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS"
1318 $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1319 TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS"
1326 $! Check to see if TCPIP was chosen
1331 $! Set the library to use TCPIP (post UCX).
1333 $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS"
1339 $! Check to see if NONE was chosen
1344 $! Do not use a TCPIP library.
1354 $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- ","
1356 $! Else The User Entered An Invalid Argument.
1360 $! Tell The User We Don't Know What They Want.
1362 $ WRITE SYS$OUTPUT ""
1363 $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
1364 $ WRITE SYS$OUTPUT ""
1365 $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
1366 $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
1367 $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
1368 $ WRITE SYS$OUTPUT ""
1374 $! Done with TCP/IP libraries
1378 $! Check if the user wanted to compile just a subset of all the encryption
1383 $ ENCRYPT_TYPES = P6
1386 $! Time To RETURN...
1392 $! Save old value of the logical name OPENSSL
1394 $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
1396 $! Save directory information
1398 $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1399 $ __HERE = F$EDIT(__HERE,"UPCASE")
1400 $ __TOP = __HERE - "CRYPTO]"
1401 $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
1402 $ __INTERNAL = __TOP + "CRYPTO.INCLUDE.INTERNAL]"
1404 $! Set up the logical name OPENSSL to point at the include directory
1406 $ DEFINE OPENSSL/NOLOG '__INCLUDE'
1407 $ DEFINE INTERNAL/NOLOG '__INTERNAL'
1415 $! Restore the logical name OPENSSL if it had a value
1417 $ IF __SAVE_OPENSSL .EQS. ""
1422 $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'