crypto-lib.com 32 KB

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