crypto-lib.com 30.4 KB
Newer Older
U
Ulf Möller 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$!
$!  CRYPTO-LIB.COM
$!  Written By:  Robert Byer
$!               Vice-President
$!               A-Com Computing, Inc.
$!               byer@mail.all-net.net
$!
$!  Changes by Richard Levitte <richard@levitte.org>
$!
$!  This command files compiles and creates the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" 
$!  library for OpenSSL.  The "xxx" denotes the machine architecture of AXP
$!  or VAX.
$!
$!  It was re-written so it would try to determine what "C" compiler to use 
$!  or you can specify which "C" compiler to use.
$!
17 18 19 20 21 22 23
$!  Specify the following as P1 to build just that part or ALL to just
$!  build everything.
$!
$!    		LIBRARY    To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
$!    		APPS       To just compile the [.xxx.EXE.CRYPTO]*.EXE
$!		ALL	   To do both LIBRARY and APPS
$!
24
$!  Specify DEBUG or NODEBUG as P2 to compile with or without debugger
U
Ulf Möller 已提交
25 26
$!  information.
$!
27
$!  Specify which compiler at P3 to try to compile under.
U
Ulf Möller 已提交
28 29 30 31 32 33 34 35
$!
$!	   VAXC	 For VAX C.
$!	   DECC	 For DEC C.
$!	   GNUC	 For GNU C.
$!
$!  If you don't speficy a compiler, it will try to determine which
$!  "C" compiler to use.
$!
36
$!  P4, if defined, sets a TCP/IP library to use, through one of the following
U
Ulf Möller 已提交
37 38 39
$!  keywords:
$!
$!	UCX		for UCX
40
$!	TCPIP		for TCPIP (post UCX)
U
Ulf Möller 已提交
41 42
$!	SOCKETSHR	for SOCKETSHR+NETLIB
$!
43
$!  P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
U
Ulf Möller 已提交
44
$!
45
$!  P6, if defined, sets a choice of crypto methods to compile.
U
Ulf Möller 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
$!  WARNING: this should only be done to recompile some part of an already
$!  fully compiled library.
$!
$!
$! Define A TCP/IP Library That We Will Need To Link To.
$! (That Is, If We Need To Link To One.)
$!
$ TCPIP_LIB = ""
$!
$! Check Which Architecture We Are Using.
$!
$ IF (F$GETSYI("CPU").GE.128)
$ THEN
$!
$!  The Architecture Is AXP
$!
$   ARCH := AXP
$!
$! Else...
$!
$ ELSE
$!
$!  The Architecture Is VAX.
$!
$   ARCH := VAX
$!
$! End The Architecture Check.
$!
$ ENDIF
$!
$! Define The Different Encryption Types.
$!
78 79 80
$ ENCRYPT_TYPES = "Basic,"+ -
		  "OBJECTS,"+ -
		  "MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
U
Ulf Möller 已提交
81
		  "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
R
Richard Levitte 已提交
82
		  "BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,AES,"+ -
83
		  "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
U
Ulf Möller 已提交
84
		  "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
85 86
		  "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
		  "STORE"
U
Ulf Möller 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
$!
$! Check To Make Sure We Have Valid Command Line Parameters.
$!
$ GOSUB CHECK_OPTIONS
$!
$! Initialise logical names and such
$!
$ GOSUB INITIALISE
$!
$! Tell The User What Kind of Machine We Run On.
$!
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
$!
$! Check To See If The Architecture Specific OBJ Directory Exists.
$!
$ IF (F$PARSE(OBJ_DIR).EQS."")
$ THEN
$!
$!  It Dosen't Exist, So Create It.
$!
$   CREATE/DIR 'OBJ_DIR'
$!
$! End The Architecture Specific OBJ Directory Check.
$!
$ ENDIF
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
$!
$! Check To See If The Architecture Specific Directory Exists.
$!
$ IF (F$PARSE(EXE_DIR).EQS."")
$ THEN
$!
$!  It Dosen't Exist, So Create It.
$!
$   CREATE/DIRECTORY 'EXE_DIR'
$!
$! End The Architecture Specific Directory Check.
$!
$ ENDIF
$!
$! Define The Library Name.
$!
$ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB
$!
138 139 140 141
$! Define The CRYPTO-LIB We Are To Use.
$!
$ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO.OLB
$!
U
Ulf Möller 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154
$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library...
$!
$ IF (F$SEARCH(LIB_NAME).EQS."")
$ THEN
$!
$! Guess Not, Create The Library.
$!
$   LIBRARY/CREATE/OBJECT 'LIB_NAME'
$!
$! End The Library Check.
$!
$ ENDIF
$!
155 156 157 158
$! Build our options file for the application
$!
$ GOSUB CHECK_OPT_FILE
$!
U
Ulf Möller 已提交
159 160
$! Define The Different Encryption "library" Strings.
$!
161 162 163
$ APPS_DES = "DES/DES,CBC3_ENC"
$ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE"
$
164
$ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,tmdiff,cpt_err,ebcdic,uid,o_time,o_str,o_dir"
U
Ulf Möller 已提交
165
$ LIB_MD2 = "md2_dgst,md2_one"
166
$ LIB_MD4 = "md4_dgst,md4_one"
U
Ulf Möller 已提交
167
$ LIB_MD5 = "md5_dgst,md5_one"
168
$ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one,sha256,sha512"
U
Ulf Möller 已提交
169 170 171 172 173 174 175
$ LIB_MDC2 = "mdc2dgst,mdc2_one"
$ LIB_HMAC = "hmac"
$ LIB_RIPEMD = "rmd_dgst,rmd_one"
$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
	"ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
	"enc_read,enc_writ,ofb64enc,"+ -
	"ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
176
	"des_enc,fcrypt_b,"+ -
177
	"fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ -
178
	"ede_cbcm_enc,des_old,des_old2,read2pwd"
U
Ulf Möller 已提交
179 180 181 182 183 184 185
$ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
$ LIB_RC4 = "rc4_skey,rc4_enc"
$ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
$ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
$ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
$ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
$ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
186
$ IF F$TRNLNM("OPENSSL_NO_ASM").OR.ARCH.EQS."AXP" THEN LIB_BN_ASM = "bn_asm"
187
$ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
U
Ulf Möller 已提交
188
	"bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
189
	"bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
R
Richard Levitte 已提交
190 191
	"bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
	"bn_depr"
192
$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_recp,ecp_nist,ec_cvt,ec_mult,"+ -
R
Richard Levitte 已提交
193
	"ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
194
	"ec2_smpl,ec2_mult"
U
Ulf Möller 已提交
195
$ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
196
	"rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
R
Richard Levitte 已提交
197 198 199
	"rsa_asn1,rsa_depr"
$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ -
	"dsa_err,dsa_ossl,dsa_depr"
R
Richard Levitte 已提交
200
$ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err"
R
Richard Levitte 已提交
201
$ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err,dh_depr"
R
Richard Levitte 已提交
202
$ LIB_ECDH = "ech_lib,ech_ossl,ech_key,ech_err"
203 204
$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
	"dso_openssl,dso_win32,dso_vms"
R
Richard Levitte 已提交
205 206
$ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ -
	"eng_table,eng_pkey,eng_fat,eng_all,"+ -
R
Richard Levitte 已提交
207 208
	"tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ -
	"tb_cipher,tb_digest,"+ -
209
	"eng_openssl,eng_dyn,eng_cnf,eng_cryptodev"
210
$ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr"
U
Ulf Möller 已提交
211 212 213 214 215
$ LIB_BUFFER = "buffer,buf_err"
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
	"bss_mem,bss_null,bss_fd,"+ -
	"bss_file,bss_sock,bss_conn,"+ -
	"bf_null,bf_buff,b_print,b_dump,"+ -
216 217
	"b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
	"bf_lbuf"
U
Ulf Möller 已提交
218 219
$ LIB_STACK = "stack"
$ LIB_LHASH = "lhash,lh_stats"
220 221
$ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
	"rand_vms"
U
Ulf Möller 已提交
222 223
$ LIB_ERR = "err,err_all,err_prn"
$ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err"
224
$ LIB_EVP = "encode,digest,evp_enc,evp_key,evp_acnf,"+ -
R
Richard Levitte 已提交
225
	"e_des,e_bf,e_idea,e_des3,"+ -
226
	"e_rc4,e_aes,names,"+ -
R
Richard Levitte 已提交
227
	"e_xcbc_d,e_rc2,e_cast,e_rc5"
228
$ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1," + -
229
	"m_dss,m_dss1,m_mdc2,m_ripemd,m_ecdsa,"+ -
U
Ulf Möller 已提交
230 231
	"p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
	"bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
R
Richard Levitte 已提交
232 233
	"c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
	"evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
U
Ulf Möller 已提交
234
$ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
235 236 237
	"a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ -
	"a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
	"x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,x_bignum,"+ -
R
Richard Levitte 已提交
238
	"x_long,x_name,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
U
Ulf Möller 已提交
239
	"d2i_pu,d2i_pr,i2d_pu,i2d_pr"
240
$ LIB_ASN1_2 = "t_req,t_x509,t_x509a,t_crl,t_pkey,t_spki,t_bitst,"+ -
R
Richard Levitte 已提交
241
	"tasn_new,tasn_fre,tasn_enc,tasn_dec,tasn_utl,tasn_typ,"+ -
242
	"f_int,f_string,n_pkey,"+ -
U
Ulf Möller 已提交
243
	"f_enum,a_hdr,x_pkey,a_bool,x_exten,"+ -
R
Richard Levitte 已提交
244
	"asn1_gen,asn1_par,asn1_lib,asn1_err,a_meth,a_bytes,a_strnid,"+ -
245
	"evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid"
246 247
$ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
	"pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey"
U
Ulf Möller 已提交
248
$ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
249
	"x509_obj,x509_req,x509spki,x509_vfy,"+ -
R
Richard Levitte 已提交
250
	"x509_set,x509cset,x509rset,x509_err,"+ -
251
	"x509name,x509_v3,x509_ext,x509_att,"+ -
U
Ulf Möller 已提交
252
	"x509type,x509_lu,x_all,x509_txt,"+ -
253
	"x509_trs,by_file,by_dir,x509_vpm"
U
Ulf Möller 已提交
254 255
$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
	"v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
256
	"v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
R
Richard Levitte 已提交
257 258
	"v3_ocsp,v3_akeya,v3_pmaps,v3_pcons,v3_ncons,pcy_cache,pcy_node,"+ -
	"pcy_data,pcy_map,pcy_tree,pcy_lib"
259
$ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def,conf_mod,conf_mall,conf_sap"
U
Ulf Möller 已提交
260
$ LIB_TXT_DB = "txt_db"
261 262 263 264
$ LIB_PKCS7 = "pk7_asn1,pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,"+ -
	"pk7_mime"
$ LIB_PKCS12 = "p12_add,p12_asn,p12_attr,p12_crpt,p12_crt,p12_decr,"+ -
	"p12_init,p12_key,p12_kiss,p12_mutl,"+ -
265
	"p12_utl,p12_npas,pk12err,p12_p8d,p12_p8e"
266
$ LIB_COMP = "comp_lib,comp_err,"+ -
U
Ulf Möller 已提交
267
	"c_rle,c_zlib"
268
$ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ -
269
	"ocsp_srv,ocsp_prn,ocsp_vfy,ocsp_err"
270 271
$ LIB_UI_COMPAT = ",ui_compat"
$ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT
272
$ LIB_KRB5 = "krb5_asn"
273
$ LIB_STORE = "str_err,str_lib,str_meth,str_mem"
U
Ulf Möller 已提交
274 275 276 277
$!
$! Setup exceptional compilations
$!
$ COMPILEWITH_CC3 = ",bss_rtcp,"
278
$ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir"
279 280
$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
                    "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
U
Ulf Möller 已提交
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
$!
$! Figure Out What Other Modules We Are To Build.
$!
$ BUILD_SET:
$!
$! Define A Module Counter.
$!
$ MODULE_COUNTER = 0
$!
$! Top Of The Loop.
$!
$ MODULE_NEXT:
$!
$! Extract The Module Name From The Encryption List.
$!
$ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
297
$ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
298
$ MODULE_NAME1 = MODULE_NAME
U
Ulf Möller 已提交
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
$!
$! Check To See If We Are At The End Of The Module List.
$!
$ IF (MODULE_NAME.EQS.",") 
$ THEN 
$!
$!  We Are At The End Of The Module List, Go To MODULE_DONE.
$!
$   GOTO MODULE_DONE
$!
$! End The Module List Check.
$!
$ ENDIF
$!
$! Increment The Moudle Counter.
$!
$ MODULE_COUNTER = MODULE_COUNTER + 1
$!
317
$! Create The Library and Apps Module Names.
U
Ulf Möller 已提交
318 319
$!
$ LIB_MODULE = "LIB_" + MODULE_NAME
320
$ APPS_MODULE = "APPS_" + MODULE_NAME
U
Ulf Möller 已提交
321 322 323 324 325 326 327 328 329
$ IF (MODULE_NAME.EQS."ASN1_2")
$ THEN
$   MODULE_NAME = "ASN1"
$ ENDIF
$ IF (MODULE_NAME.EQS."EVP_2")
$ THEN
$   MODULE_NAME = "EVP"
$ ENDIF
$!
330 331 332 333 334
$! Set state (can be LIB and APPS)
$!
$ STATE = "LIB"
$ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
$!
U
Ulf Möller 已提交
335 336 337 338 339 340 341 342 343 344
$! Check if the library module name actually is defined
$!
$ IF F$TYPE('LIB_MODULE') .EQS. ""
$ THEN
$   WRITE SYS$ERROR ""
$   WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist.  Continuing..."
$   WRITE SYS$ERROR ""
$   GOTO MODULE_NEXT
$ ENDIF
$!
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
$! Top Of The Module Loop.
$!
$ MODULE_AGAIN:
$!
$! Tell The User What Module We Are Building.
$!
$ IF (MODULE_NAME1.NES."") 
$ THEN
$   IF STATE .EQS. "LIB"
$   THEN
$     WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
$   ELSE IF F$TYPE('APPS_MODULE') .NES. ""
$     THEN
$       WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
$     ENDIF
$   ENDIF
$ ENDIF
$!
$!  Define A File Counter And Set It To "0".
$!
$ FILE_COUNTER = 0
$ APPLICATION = ""
$ APPLICATION_COUNTER = 0
$!
U
Ulf Möller 已提交
369 370 371 372
$! Top Of The File Loop.
$!
$ NEXT_FILE:
$!
373 374 375 376 377 378 379 380
$! Look in the LIB_MODULE is we're in state LIB
$!
$ IF STATE .EQS. "LIB"
$ THEN
$!
$!   O.K, Extract The File Name From The File List.
$!
$   FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
U
Ulf Möller 已提交
381
$!
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
$!   else
$!
$ ELSE
$   FILE_NAME = ","
$!
$   IF F$TYPE('APPS_MODULE') .NES. ""
$   THEN
$!
$!     Extract The File Name From The File List.
$!     This part is a bit more complicated.
$!
$     IF APPLICATION .EQS. ""
$     THEN
$       APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
$       APPLICATION_COUNTER = APPLICATION_COUNTER + 1
$       APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
$       APPLICATION = F$ELEMENT(0,"/",APPLICATION)
$       FILE_COUNTER = 0
$     ENDIF
$
$!     WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
$!     SHOW SYMBOL APPLICATION*
$!
$     IF APPLICATION .NES. ";"
$     THEN
$       FILE_NAME = F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS)
$       IF FILE_NAME .EQS. ","
$       THEN
$         APPLICATION = ""
$         GOTO NEXT_FILE
$       ENDIF
$     ENDIF
$   ENDIF
$ ENDIF
U
Ulf Möller 已提交
416 417 418 419 420 421
$!
$! Check To See If We Are At The End Of The File List.
$!
$ IF (FILE_NAME.EQS.",") 
$ THEN 
$!
422
$!  We Are At The End Of The File List, Change State Or Goto FILE_DONE.
U
Ulf Möller 已提交
423
$!
424 425 426 427 428 429 430
$   IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
$   THEN
$     STATE = "APPS"
$     GOTO MODULE_AGAIN
$   ELSE
$     GOTO FILE_DONE
$   ENDIF
U
Ulf Möller 已提交
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
$!
$! End The File List Check.
$!
$ ENDIF
$!
$! Increment The Counter.
$!
$ FILE_COUNTER = FILE_COUNTER + 1
$!
$! Create The Source File Name.
$!
$ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
$ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
$ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
	FILE_NAME = FILE_NAME + ".c"
$ IF (MODULE_NAME.NES."")
$ THEN
$   SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
$ ELSE
$   SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
$ ENDIF
$ SOURCE_FILE = SOURCE_FILE - "]["
$!
$! Create The Object File Name.
$!
$ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
$ ON WARNING THEN GOTO NEXT_FILE
$!
$! Check To See If The File We Want To Compile Is Actually There.
$!
$ IF (F$SEARCH(SOURCE_FILE).EQS."")
$ THEN
$!
R
Richard Levitte 已提交
464
$!  Tell The User That The File Doesn't Exist.
U
Ulf Möller 已提交
465 466
$!
$   WRITE SYS$OUTPUT ""
R
Richard Levitte 已提交
467
$   WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
U
Ulf Möller 已提交
468 469 470 471 472 473 474 475 476 477 478 479 480 481
$   WRITE SYS$OUTPUT ""
$!
$!  Exit The Build.
$!
$   GOTO EXIT
$!
$! End The File Exist Check.
$!
$ ENDIF
$!
$! Tell The User We Are Compiling The File.
$!
$ IF (MODULE_NAME.EQS."")
$ THEN
482
$   WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File.  (",BUILDALL,",",STATE,")"
U
Ulf Möller 已提交
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
$ ENDIF
$ IF (MODULE_NAME.NES."")
$ THEN 
$   WRITE SYS$OUTPUT "	",FILE_NAME,""
$ ENDIF
$!
$! Compile The File.
$!
$ ON ERROR THEN GOTO NEXT_FILE
$ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME)
$ IF FILE_NAME - ".mar" .NES. FILE_NAME
$ THEN
$   MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$ ELSE
$   IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
$   THEN
$     CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$   ELSE
$     IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
$     THEN
$       CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$     ELSE
$       IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
$       THEN
$         CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$       ELSE
$         CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$       ENDIF
$     ENDIF
$   ENDIF
$ ENDIF
514 515
$ IF STATE .EQS. "LIB"
$ THEN 
U
Ulf Möller 已提交
516
$!
517
$!   Add It To The Library.
U
Ulf Möller 已提交
518
$!
519
$   LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
U
Ulf Möller 已提交
520
$!
521
$!   Time To Clean Up The Object File.
U
Ulf Möller 已提交
522
$!
523 524
$   DELETE 'OBJECT_FILE';*
$ ENDIF
U
Ulf Möller 已提交
525 526 527 528 529 530 531 532 533
$!
$! Go Back And Do It Again.
$!
$ GOTO NEXT_FILE
$!
$! All Done With This Library Part.
$!
$ FILE_DONE:
$!
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
$! Time To Build Some Applications
$!
$ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
$ THEN
$   APPLICATION_COUNTER = 0
$ NEXT_APPLICATION:
$   APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
$   IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
$
$   APPLICATION_COUNTER = APPLICATION_COUNTER + 1
$   APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
$   APPLICATION = F$ELEMENT(0,"/",APPLICATION)
$
$!   WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
$!   SHOW SYMBOL APPLICATION*
$!
$! Tell the user what happens
$!
$   WRITE SYS$OUTPUT "	",APPLICATION,".exe"
$!
554
$! Link The Program.
555
$!
556
$   ON ERROR THEN GOTO NEXT_APPLICATION
557
$!
558
$! Check To See If We Are To Link With A Specific TCP/IP Library.
559
$!
560 561
$   IF (TCPIP_LIB.NES."")
$   THEN
562
$!
563
$!    Link With A TCP/IP Library.
564
$!
565 566 567 568
$     LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
          'OBJ_DIR''APPLICATION_OBJECTS', -
	  'CRYPTO_LIB'/LIBRARY, -
          'TCPIP_LIB','OPT_FILE'/OPTION
569
$!
570
$! Else...
571 572 573
$!
$   ELSE
$!
574
$!    Don't Link With A TCP/IP Library.
575
$!
576 577 578 579
$     LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
          'OBJ_DIR''APPLICATION_OBJECTS',-
	  'CRYPTO_LIB'/LIBRARY, -
          'OPT_FILE'/OPTION
580
$!
581
$! End The TCP/IP Library Check.
582 583 584 585 586 587
$!
$   ENDIF
$   GOTO NEXT_APPLICATION
$  APPLICATION_DONE:
$ ENDIF
$!
U
Ulf Möller 已提交
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727
$! Go Back And Get The Next Module.
$!
$ GOTO MODULE_NEXT
$!
$! All Done With This Module.
$!
$ MODULE_DONE:
$!
$! Tell The User That We Are All Done.
$!
$ WRITE SYS$OUTPUT "All Done..."
$ EXIT:
$ GOSUB CLEANUP
$ EXIT
$!
$! Check For The Link Option FIle.
$!
$ CHECK_OPT_FILE:
$!
$! Check To See If We Need To Make A VAX C Option File.
$!
$ IF (COMPILER.EQS."VAXC")
$ THEN
$!
$!  Check To See If We Already Have A VAX C Linker Option File.
$!
$   IF (F$SEARCH(OPT_FILE).EQS."")
$   THEN
$!
$!    We Need A VAX C Linker Option File.
$!
$     CREATE 'OPT_FILE'
$DECK
!
! Default System Options File To Link Agianst 
! The Sharable VAX C Runtime Library.
!
SYS$SHARE:VAXCRTL.EXE/SHARE
$EOD
$!
$!  End The Option File Check.
$!
$   ENDIF
$!
$! End The VAXC Check.
$!
$ ENDIF
$!
$! Check To See If We Need A GNU C Option File.
$!
$ IF (COMPILER.EQS."GNUC")
$ THEN
$!
$!  Check To See If We Already Have A GNU C Linker Option File.
$!
$   IF (F$SEARCH(OPT_FILE).EQS."")
$   THEN
$!
$!    We Need A GNU C Linker Option File.
$!
$     CREATE 'OPT_FILE'
$DECK
!
! Default System Options File To Link Agianst 
! The Sharable C Runtime Library.
!
GNU_CC:[000000]GCCLIB/LIBRARY
SYS$SHARE:VAXCRTL/SHARE
$EOD
$!
$!  End The Option File Check.
$!
$   ENDIF
$!
$! End The GNU C Check.
$!
$ ENDIF
$!
$! Check To See If We Need A DEC C Option File.
$!
$ IF (COMPILER.EQS."DECC")
$ THEN
$!
$!  Check To See If We Already Have A DEC C Linker Option File.
$!
$   IF (F$SEARCH(OPT_FILE).EQS."")
$   THEN
$!
$!    Figure Out If We Need An AXP Or A VAX Linker Option File.
$!
$     IF ARCH .EQS. "VAX"
$     THEN
$!
$!      We Need A DEC C Linker Option File For VAX.
$!
$       CREATE 'OPT_FILE'
$DECK
!
! Default System Options File To Link Agianst 
! The Sharable DEC C Runtime Library.
!
SYS$SHARE:DECC$SHR.EXE/SHARE
$EOD
$!
$!    Else...
$!
$     ELSE
$!
$!      Create The AXP Linker Option File.
$!
$       CREATE 'OPT_FILE'
$DECK
!
! Default System Options File For AXP To Link Agianst 
! The Sharable C Runtime Library.
!
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
SYS$SHARE:CMA$OPEN_RTL/SHARE
$EOD
$!
$!    End The VAX/AXP DEC C Option File Check.
$!
$     ENDIF
$!
$!  End The Option File Search.
$!
$   ENDIF
$!
$! End The DEC C Check.
$!
$ ENDIF
$!
$!  Tell The User What Linker Option File We Are Using.
$!
$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."	
$!
$! Time To RETURN.
$!
$ RETURN
$!
R
Richard Levitte 已提交
728 729 730 731
$! Check The User's Options.
$!
$ CHECK_OPTIONS:
$!
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763
$! Check To See If P1 Is Blank.
$!
$ IF (P1.EQS."ALL")
$ THEN
$!
$!   P1 Is Blank, So Build Everything.
$!
$    BUILDALL = "TRUE"
$!
$! Else...
$!
$ ELSE
$!
$!  Else, Check To See If P1 Has A Valid Arguement.
$!
$   IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
$   THEN
$!
$!    A Valid Arguement.
$!
$     BUILDALL = P1
$!
$!  Else...
$!
$   ELSE
$!
$!    Tell The User We Don't Know What They Want.
$!
$     WRITE SYS$OUTPUT ""
$     WRITE SYS$OUTPUT "The Option ",P1," Is Invalid.  The Valid Options Are:"
$     WRITE SYS$OUTPUT ""
$     WRITE SYS$OUTPUT "    ALL      :  Just Build Everything."
764 765
$     WRITE SYS$OUTPUT "    LIBRARY  :  To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
$     WRITE SYS$OUTPUT "    APPS     :  To Compile Just The [.xxx.EXE.CRYPTO]*.EXE Programs."
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785
$     WRITE SYS$OUTPUT ""
$     WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
$     WRITE SYS$OUTPUT ""
$     WRITE SYS$OUTPUT "        AXP  :  Alpha Architecture."
$     WRITE SYS$OUTPUT "        VAX  :  VAX Architecture."
$     WRITE SYS$OUTPUT ""
$!
$!    Time To EXIT.
$!
$     EXIT
$!
$!  End The Valid Arguement Check.
$!
$   ENDIF
$!
$! End The P1 Check.
$!
$ ENDIF
$!
$! Check To See If P2 Is Blank.
U
Ulf Möller 已提交
786
$!
787
$ IF (P2.EQS."NODEBUG")
U
Ulf Möller 已提交
788 789
$ THEN
$!
790
$!   P2 Is NODEBUG, So Compile Without The Debugger Information.
U
Ulf Möller 已提交
791 792 793 794 795 796 797 798 799 800 801 802
$!
$    DEBUGGER = "NODEBUG"
$    TRACEBACK = "NOTRACEBACK" 
$    GCC_OPTIMIZE = "OPTIMIZE"
$    CC_OPTIMIZE = "OPTIMIZE"
$    MACRO_OPTIMIZE = "OPTIMIZE"
$    WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
$    WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
$ ELSE
$!
$!  Check To See If We Are To Compile With Debugger Information.
$!
803
$   IF (P2.EQS."DEBUG")
U
Ulf Möller 已提交
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
$   THEN
$!
$!    Compile With Debugger Information.
$!
$     DEBUGGER = "DEBUG"
$     TRACEBACK = "TRACEBACK"
$     GCC_OPTIMIZE = "NOOPTIMIZE"
$     CC_OPTIMIZE = "NOOPTIMIZE"
$     MACRO_OPTIMIZE = "NOOPTIMIZE"
$     WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
$     WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
$   ELSE 
$!
$!    They Entered An Invalid Option..
$!
$     WRITE SYS$OUTPUT ""
820
$     WRITE SYS$OUTPUT "The Option ",P2," Is Invalid.  The Valid Options Are:"
U
Ulf Möller 已提交
821 822 823 824 825 826 827 828 829 830 831 832 833
$     WRITE SYS$OUTPUT ""
$     WRITE SYS$OUTPUT "     DEBUG   :  Compile With The Debugger Information."
$     WRITE SYS$OUTPUT "     NODEBUG :  Compile Without The Debugger Information."
$     WRITE SYS$OUTPUT ""
$!
$!    Time To EXIT.
$!
$     EXIT
$!
$!  End The Valid Arguement Check.
$!
$   ENDIF
$!
834
$! End The P2 Check.
U
Ulf Möller 已提交
835 836 837 838 839 840 841 842 843
$!
$ ENDIF
$!
$! Special Threads For OpenVMS v7.1 Or Later
$!
$! Written By:  Richard Levitte
$!              richard@levitte.org
$!
$!
844
$! Check To See If We Have A Option For P5.
U
Ulf Möller 已提交
845
$!
846
$ IF (P5.EQS."")
U
Ulf Möller 已提交
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867
$ THEN
$!
$!  Get The Version Of VMS We Are Using.
$!
$   ISSEVEN :=
$   TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
$   TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
$!
$!  Check To See If The VMS Version Is v7.1 Or Later.
$!
$   IF (TMP.GE.71)
$   THEN
$!
$!    We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
$!
$     ISSEVEN := ,PTHREAD_USE_D4
$!
$!  End The VMS Version Check.
$!
$   ENDIF
$!
868
$! End The P5 Check.
U
Ulf Möller 已提交
869 870 871
$!
$ ENDIF
$!
872
$! Check To See If P3 Is Blank.
U
Ulf Möller 已提交
873
$!
874
$ IF (P3.EQS."")
U
Ulf Möller 已提交
875 876 877 878 879 880 881 882 883 884 885 886
$ THEN
$!
$!  O.K., The User Didn't Specify A Compiler, Let's Try To
$!  Find Out Which One To Use.
$!
$!  Check To See If We Have GNU C.
$!
$   IF (F$TRNLNM("GNU_CC").NES."")
$   THEN
$!
$!    Looks Like GNUC, Set To Use GNUC.
$!
887
$     P3 = "GNUC"
U
Ulf Möller 已提交
888 889 890 891 892 893 894 895 896 897 898 899
$!
$!  Else...
$!
$   ELSE
$!
$!    Check To See If We Have VAXC Or DECC.
$!
$     IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
$     THEN 
$!
$!      Looks Like DECC, Set To Use DECC.
$!
900
$       P3 = "DECC"
U
Ulf Möller 已提交
901 902 903 904 905 906 907
$!
$!    Else...
$!
$     ELSE
$!
$!      Looks Like VAXC, Set To Use VAXC.
$!
908
$       P3 = "VAXC"
U
Ulf Möller 已提交
909 910 911 912 913 914 915 916 917 918 919 920 921
$!
$!    End The VAXC Compiler Check.
$!
$     ENDIF
$!
$!  End The DECC & VAXC Compiler Check.
$!
$   ENDIF
$!
$!  End The Compiler Check.
$!
$ ENDIF
$!
922
$! Check To See If We Have A Option For P4.
U
Ulf Möller 已提交
923
$!
924
$ IF (P4.EQS."")
U
Ulf Möller 已提交
925 926 927 928 929 930 931 932 933
$ THEN
$!
$!  Find out what socket library we have available
$!
$   IF F$PARSE("SOCKETSHR:") .NES. ""
$   THEN
$!
$!    We have SOCKETSHR, and it is my opinion that it's the best to use.
$!
934
$     P4 = "SOCKETSHR"
U
Ulf Möller 已提交
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953
$!
$!    Tell the user
$!
$     WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
$!
$!    Else, let's look for something else
$!
$   ELSE
$!
$!    Like UCX (the reason to do this before Multinet is that the UCX
$!    emulation is easier to use...)
$!
$     IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
	 .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
	 .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
$     THEN
$!
$!	Last resort: a UCX or UCX-compatible library
$!
954
$	P4 = "UCX"
U
Ulf Möller 已提交
955 956 957 958 959 960 961 962 963 964 965 966 967
$!
$!      Tell the user
$!
$       WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
$!
$!	That was all...
$!
$     ENDIF
$   ENDIF
$ ENDIF
$!
$! Set Up Initial CC Definitions, Possibly With User Ones
$!
968
$ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
U
Ulf Möller 已提交
969 970 971
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
$ CCEXTRAFLAGS = ""
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
972
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
U
Ulf Möller 已提交
973
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
974
	CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
U
Ulf Möller 已提交
975 976 977
$!
$!  Check To See If The User Entered A Valid Paramter.
$!
978
$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
U
Ulf Möller 已提交
979 980 981 982
$ THEN
$!
$!    Check To See If The User Wanted DECC.
$!
983
$   IF (P3.EQS."DECC")
U
Ulf Möller 已提交
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999
$   THEN
$!
$!    Looks Like DECC, Set To Use DECC.
$!
$     COMPILER = "DECC"
$!
$!    Tell The User We Are Using DECC.
$!
$     WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
$!
$!    Use DECC...
$!
$     CC = "CC"
$     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
	 THEN CC = "CC/DECC"
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
1000
           "/NOLIST/PREFIX=ALL" + -
1001
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP])" + -
1002
	   CCEXTRAFLAGS
U
Ulf Möller 已提交
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
$!
$!    Define The Linker Options File Name.
$!
$     OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
$!
$!  End DECC Check.
$!
$   ENDIF
$!
$!  Check To See If We Are To Use VAXC.
$!
1014
$   IF (P3.EQS."VAXC")
U
Ulf Möller 已提交
1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
$   THEN
$!
$!    Looks Like VAXC, Set To Use VAXC.
$!
$     COMPILER = "VAXC"
$!
$!    Tell The User We Are Using VAX C.
$!
$     WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
$!
$!    Compile Using VAXC.
$!
$     CC = "CC"
$     IF ARCH.EQS."AXP"
$     THEN
$	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
$	EXIT
$     ENDIF
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
1034
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1035
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
U
Ulf Möller 已提交
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052
	   CCEXTRAFLAGS
$     CCDEFS = """VAXC""," + CCDEFS
$!
$!    Define <sys> As SYS$COMMON:[SYSLIB]
$!
$     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
$!
$!    Define The Linker Options File Name.
$!
$     OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
$!
$!  End VAXC Check
$!
$   ENDIF
$!
$!  Check To See If We Are To Use GNU C.
$!
1053
$   IF (P3.EQS."GNUC")
U
Ulf Möller 已提交
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066
$   THEN
$!
$!    Looks Like GNUC, Set To Use GNUC.
$!
$     COMPILER = "GNUC"
$!
$!    Tell The User We Are Using GNUC.
$!
$     WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
$!
$!    Use GNU C...
$!
$     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1067
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1068
	   CCEXTRAFLAGS
U
Ulf Möller 已提交
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
$!
$!    Define The Linker Options File Name.
$!
$     OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
$!
$!  End The GNU C Check.
$!
$   ENDIF
$!
$!  Set up default defines
$!
$   CCDEFS = """FLAT_INC=1""," + CCDEFS
$!
$!  Finish up the definition of CC.
$!
$   IF COMPILER .EQS. "DECC"
$   THEN
$     IF CCDISABLEWARNINGS .EQS. ""
$     THEN
$       CC4DISABLEWARNINGS = "DOLLARID"
$     ELSE
$       CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
$       CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
$     ENDIF
$     CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
$   ELSE
$     CCDISABLEWARNINGS = ""
$     CC4DISABLEWARNINGS = ""
$   ENDIF
$   CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
$   CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
1100
$   IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
U
Ulf Möller 已提交
1101 1102 1103 1104 1105 1106 1107 1108 1109
$   THEN
$     CC5 = CC + "/OPTIMIZE=NODISJOINT"
$   ELSE
$     CC5 = CC + "/NOOPTIMIZE"
$   ENDIF
$   CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
$!
$!  Show user the result
$!
1110
$   WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
U
Ulf Möller 已提交
1111 1112 1113 1114 1115 1116 1117 1118
$!
$!  Else The User Entered An Invalid Arguement.
$!
$ ELSE
$!
$!  Tell The User We Don't Know What They Want.
$!
$   WRITE SYS$OUTPUT ""
1119
$   WRITE SYS$OUTPUT "The Option ",P3," Is Invalid.  The Valid Options Are:"
U
Ulf Möller 已提交
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140
$   WRITE SYS$OUTPUT ""
$   WRITE SYS$OUTPUT "    VAXC  :  To Compile With VAX C."
$   WRITE SYS$OUTPUT "    DECC  :  To Compile With DEC C."
$   WRITE SYS$OUTPUT "    GNUC  :  To Compile With GNU C."
$   WRITE SYS$OUTPUT ""
$!
$!  Time To EXIT.
$!
$   EXIT
$!
$! End The Valid Arguement Check.
$!
$ ENDIF
$!
$! Build a MACRO command for the architecture at hand
$!
$ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
$ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
$!
$!  Show user the result
$!
1141
$   WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
U
Ulf Möller 已提交
1142 1143 1144
$!
$! Time to check the contents, and to make sure we get the correct library.
$!
1145 1146
$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
     .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
U
Ulf Möller 已提交
1147 1148 1149 1150
$ THEN
$!
$!  Check to see if SOCKETSHR was chosen
$!
1151
$   IF P4.EQS."SOCKETSHR"
U
Ulf Möller 已提交
1152 1153 1154 1155
$   THEN
$!
$!    Set the library to use SOCKETSHR
$!
1156
$     TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
U
Ulf Möller 已提交
1157 1158 1159 1160 1161 1162 1163
$!
$!    Done with SOCKETSHR
$!
$   ENDIF
$!
$!  Check to see if MULTINET was chosen
$!
1164
$   IF P4.EQS."MULTINET"
U
Ulf Möller 已提交
1165 1166 1167 1168
$   THEN
$!
$!    Set the library to use UCX emulation.
$!
1169
$     P4 = "UCX"
U
Ulf Möller 已提交
1170 1171 1172 1173 1174 1175 1176
$!
$!    Done with MULTINET
$!
$   ENDIF
$!
$!  Check to see if UCX was chosen
$!
1177
$   IF P4.EQS."UCX"
U
Ulf Möller 已提交
1178 1179 1180 1181
$   THEN
$!
$!    Set the library to use UCX.
$!
1182
$     TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
U
Ulf Möller 已提交
1183 1184
$     IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
$     THEN
1185
$       TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
U
Ulf Möller 已提交
1186 1187
$     ELSE
$       IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
1188
	  TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
U
Ulf Möller 已提交
1189 1190 1191 1192 1193 1194
$     ENDIF
$!
$!    Done with UCX
$!
$   ENDIF
$!
1195 1196
$!  Check to see if TCPIP was chosen
$!
1197
$   IF P4.EQS."TCPIP"
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
$   THEN
$!
$!    Set the library to use TCPIP (post UCX).
$!
$     TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
$!
$!    Done with TCPIP
$!
$   ENDIF
$!
$!  Check to see if NONE was chosen
$!
1210
$   IF P4.EQS."NONE"
1211 1212 1213 1214 1215 1216 1217 1218 1219 1220
$   THEN
$!
$!    Do not use a TCPIP library.
$!
$     TCPIP_LIB = ""
$!
$!    Done with TCPIP
$!
$   ENDIF
$!
U
Ulf Möller 已提交
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
$!  Print info
$!
$   WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
$!
$!  Else The User Entered An Invalid Arguement.
$!
$ ELSE
$!
$!  Tell The User We Don't Know What They Want.
$!
$   WRITE SYS$OUTPUT ""
1232
$   WRITE SYS$OUTPUT "The Option ",P4," Is Invalid.  The Valid Options Are:"
U
Ulf Möller 已提交
1233 1234 1235
$   WRITE SYS$OUTPUT ""
$   WRITE SYS$OUTPUT "    SOCKETSHR  :  To link with SOCKETSHR TCP/IP library."
$   WRITE SYS$OUTPUT "    UCX        :  To link with UCX TCP/IP library."
1236
$   WRITE SYS$OUTPUT "    TCPIP      :  To link with TCPIP (post UCX) TCP/IP library."
U
Ulf Möller 已提交
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249
$   WRITE SYS$OUTPUT ""
$!
$!  Time To EXIT.
$!
$   EXIT
$!
$!  Done with TCP/IP libraries
$!
$ ENDIF
$!
$! Check if the user wanted to compile just a subset of all the encryption
$! methods.
$!
1250
$ IF P6 .NES. ""
U
Ulf Möller 已提交
1251
$ THEN
1252
$   ENCRYPT_TYPES = P6
U
Ulf Möller 已提交
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
$ ENDIF
$!
$!  Time To RETURN...
$!
$ RETURN
$!
$ INITIALISE:
$!
$! Save old value of the logical name OPENSSL
$!
$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
$!
$! Save directory information
$!
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
1268
$ __HERE = F$EDIT(__HERE,"UPCASE")
U
Ulf Möller 已提交
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
$ __TOP = __HERE - "CRYPTO]"
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
$!
$! Set up the logical name OPENSSL to point at the include directory
$!
$ DEFINE OPENSSL/NOLOG '__INCLUDE'
$!
$! Done
$!
$ RETURN
$!
$ CLEANUP:
$!
$! Restore the logical name OPENSSL if it had a value
$!
$ IF __SAVE_OPENSSL .EQS. ""
$ THEN
$   DEASSIGN OPENSSL
$ ELSE
$   DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
$ ENDIF
$!
$! Done
$!
$ RETURN