2
0

crypto-lib.com 32 KB

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