crypto-lib.com 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  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,"+ -
  81. "DES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,"+ -
  82. "BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,AES,"+ -
  83. "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ -
  84. "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
  85. "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
  86. "STORE,PQUEUE"
  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,tmdiff,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_DES = "set_key,ecb_enc,cbc_enc,"+ -
  173. "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
  174. "enc_read,enc_writ,ofb64enc,"+ -
  175. "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"
  179. $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64"
  180. $ LIB_RC4 = "rc4_skey,rc4_enc"
  181. $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64"
  182. $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey"
  183. $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64"
  184. $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64"
  185. $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ -
  186. "cmll_cfb,cmll_ctr"
  187. $ LIB_SEED = "seed,seed_cbc,seed_ecb,seed_cfb,seed_ofb"
  188. $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper"
  189. $ IF F$TRNLNM("OPENSSL_NO_ASM").OR.ARCH.EQS."AXP" THEN LIB_BN_ASM = "bn_asm"
  190. $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
  191. "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
  192. "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
  193. "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
  194. "bn_depr,bn_const"
  195. $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ -
  196. "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
  197. "ec2_smpl,ec2_mult"
  198. $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
  199. "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ -
  200. "rsa_pss,rsa_x931,rsa_asn1,rsa_depr"
  201. $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ -
  202. "dsa_err,dsa_ossl,dsa_depr"
  203. $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err"
  204. $ LIB_DH = "dh_asn1,dh_gen,dh_key,dh_lib,dh_check,dh_err,dh_depr"
  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"
  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,"+ -
  214. "aes_ctr,aes_ige"
  215. $ LIB_BUFFER = "buffer,buf_err"
  216. $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
  217. "bss_mem,bss_null,bss_fd,"+ -
  218. "bss_file,bss_sock,bss_conn,"+ -
  219. "bf_null,bf_buff,b_print,b_dump,"+ -
  220. "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
  221. "bss_dgram,"+ -
  222. "bf_lbuf"
  223. $ LIB_STACK = "stack"
  224. $ LIB_LHASH = "lhash,lh_stats"
  225. $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,"+ -
  226. "rand_vms"
  227. $ LIB_ERR = "err,err_all,err_prn"
  228. $ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err"
  229. $ LIB_EVP = "encode,digest,evp_enc,evp_key,evp_acnf,"+ -
  230. "e_des,e_bf,e_idea,e_des3,e_camellia,e_seed,"+ -
  231. "e_rc4,e_aes,names,"+ -
  232. "e_xcbc_d,e_rc2,e_cast,e_rc5"
  233. $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1," + -
  234. "m_dss,m_dss1,m_mdc2,m_ripemd,m_ecdsa,"+ -
  235. "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
  236. "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
  237. "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
  238. "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
  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. "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. "f_int,f_string,n_pkey,"+ -
  248. "f_enum,a_hdr,x_pkey,a_bool,x_exten,"+ -
  249. "asn1_gen,asn1_par,asn1_lib,asn1_err,a_meth,a_bytes,a_strnid,"+ -
  250. "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey,asn_moid"
  251. $ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err,"+ -
  252. "pem_x509,pem_xaux,pem_oth,pem_pk8,pem_pkey"
  253. $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
  254. "x509_obj,x509_req,x509spki,x509_vfy,"+ -
  255. "x509_set,x509cset,x509rset,x509_err,"+ -
  256. "x509name,x509_v3,x509_ext,x509_att,"+ -
  257. "x509type,x509_lu,x_all,x509_txt,"+ -
  258. "x509_trs,by_file,by_dir,x509_vpm"
  259. $ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
  260. "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
  261. "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info,"+ -
  262. "v3_ocsp,v3_akeya,v3_pmaps,v3_pcons,v3_ncons,v3_pcia,v3_pci,"+ -
  263. "pcy_cache,pcy_node,pcy_data,pcy_map,pcy_tree,pcy_lib,"+ -
  264. "v3_asid,v3_addr"
  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. $!
  282. $! Setup exceptional compilations
  283. $!
  284. $ ! Add definitions for no threads on OpenVMS 7.1 and higher
  285. $ COMPILEWITH_CC3 = ",bss_rtcp,"
  286. $ ! Disable the DOLLARID warning
  287. $ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir"
  288. $ ! Disable disjoint optimization
  289. $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
  290. "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
  291. $ ! Disable the MIXLINKAGE warning
  292. $ COMPILEWITH_CC6 = ",enc_read,set_key,"
  293. $!
  294. $! Figure Out What Other Modules We Are To Build.
  295. $!
  296. $ BUILD_SET:
  297. $!
  298. $! Define A Module Counter.
  299. $!
  300. $ MODULE_COUNTER = 0
  301. $!
  302. $! Top Of The Loop.
  303. $!
  304. $ MODULE_NEXT:
  305. $!
  306. $! Extract The Module Name From The Encryption List.
  307. $!
  308. $ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES)
  309. $ IF MODULE_NAME.EQS."Basic" THEN MODULE_NAME = ""
  310. $ MODULE_NAME1 = MODULE_NAME
  311. $!
  312. $! Check To See If We Are At The End Of The Module List.
  313. $!
  314. $ IF (MODULE_NAME.EQS.",")
  315. $ THEN
  316. $!
  317. $! We Are At The End Of The Module List, Go To MODULE_DONE.
  318. $!
  319. $ GOTO MODULE_DONE
  320. $!
  321. $! End The Module List Check.
  322. $!
  323. $ ENDIF
  324. $!
  325. $! Increment The Moudle Counter.
  326. $!
  327. $ MODULE_COUNTER = MODULE_COUNTER + 1
  328. $!
  329. $! Create The Library and Apps Module Names.
  330. $!
  331. $ LIB_MODULE = "LIB_" + MODULE_NAME
  332. $ APPS_MODULE = "APPS_" + MODULE_NAME
  333. $ IF (MODULE_NAME.EQS."ASN1_2")
  334. $ THEN
  335. $ MODULE_NAME = "ASN1"
  336. $ ENDIF
  337. $ IF (MODULE_NAME.EQS."EVP_2")
  338. $ THEN
  339. $ MODULE_NAME = "EVP"
  340. $ ENDIF
  341. $!
  342. $! Set state (can be LIB and APPS)
  343. $!
  344. $ STATE = "LIB"
  345. $ IF BUILDALL .EQS. "APPS" THEN STATE = "APPS"
  346. $!
  347. $! Check if the library module name actually is defined
  348. $!
  349. $ IF F$TYPE('LIB_MODULE') .EQS. ""
  350. $ THEN
  351. $ WRITE SYS$ERROR ""
  352. $ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
  353. $ WRITE SYS$ERROR ""
  354. $ GOTO MODULE_NEXT
  355. $ ENDIF
  356. $!
  357. $! Top Of The Module Loop.
  358. $!
  359. $ MODULE_AGAIN:
  360. $!
  361. $! Tell The User What Module We Are Building.
  362. $!
  363. $ IF (MODULE_NAME1.NES."")
  364. $ THEN
  365. $ IF STATE .EQS. "LIB"
  366. $ THEN
  367. $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Library Files. (",BUILDALL,",",STATE,")"
  368. $ ELSE IF F$TYPE('APPS_MODULE') .NES. ""
  369. $ THEN
  370. $ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME1," Applications. (",BUILDALL,",",STATE,")"
  371. $ ENDIF
  372. $ ENDIF
  373. $ ENDIF
  374. $!
  375. $! Define A File Counter And Set It To "0".
  376. $!
  377. $ FILE_COUNTER = 0
  378. $ APPLICATION = ""
  379. $ APPLICATION_COUNTER = 0
  380. $!
  381. $! Top Of The File Loop.
  382. $!
  383. $ NEXT_FILE:
  384. $!
  385. $! Look in the LIB_MODULE is we're in state LIB
  386. $!
  387. $ IF STATE .EQS. "LIB"
  388. $ THEN
  389. $!
  390. $! O.K, Extract The File Name From The File List.
  391. $!
  392. $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE')
  393. $!
  394. $! else
  395. $!
  396. $ ELSE
  397. $ FILE_NAME = ","
  398. $!
  399. $ IF F$TYPE('APPS_MODULE') .NES. ""
  400. $ THEN
  401. $!
  402. $! Extract The File Name From The File List.
  403. $! This part is a bit more complicated.
  404. $!
  405. $ IF APPLICATION .EQS. ""
  406. $ THEN
  407. $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
  408. $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
  409. $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
  410. $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
  411. $ FILE_COUNTER = 0
  412. $ ENDIF
  413. $
  414. $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
  415. $! SHOW SYMBOL APPLICATION*
  416. $!
  417. $ IF APPLICATION .NES. ";"
  418. $ THEN
  419. $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",APPLICATION_OBJECTS)
  420. $ IF FILE_NAME .EQS. ","
  421. $ THEN
  422. $ APPLICATION = ""
  423. $ GOTO NEXT_FILE
  424. $ ENDIF
  425. $ ENDIF
  426. $ ENDIF
  427. $ ENDIF
  428. $!
  429. $! Check To See If We Are At The End Of The File List.
  430. $!
  431. $ IF (FILE_NAME.EQS.",")
  432. $ THEN
  433. $!
  434. $! We Are At The End Of The File List, Change State Or Goto FILE_DONE.
  435. $!
  436. $ IF STATE .EQS. "LIB" .AND. BUILDALL .NES. "LIBRARY"
  437. $ THEN
  438. $ STATE = "APPS"
  439. $ GOTO MODULE_AGAIN
  440. $ ELSE
  441. $ GOTO FILE_DONE
  442. $ ENDIF
  443. $!
  444. $! End The File List Check.
  445. $!
  446. $ ENDIF
  447. $!
  448. $! Increment The Counter.
  449. $!
  450. $ FILE_COUNTER = FILE_COUNTER + 1
  451. $!
  452. $! Create The Source File Name.
  453. $!
  454. $ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME)
  455. $ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME
  456. $ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN -
  457. FILE_NAME = FILE_NAME + ".c"
  458. $ IF (MODULE_NAME.NES."")
  459. $ THEN
  460. $ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME
  461. $ ELSE
  462. $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME
  463. $ ENDIF
  464. $ SOURCE_FILE = SOURCE_FILE - "]["
  465. $!
  466. $! Create The Object File Name.
  467. $!
  468. $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
  469. $ ON WARNING THEN GOTO NEXT_FILE
  470. $!
  471. $! Check To See If The File We Want To Compile Is Actually There.
  472. $!
  473. $ IF (F$SEARCH(SOURCE_FILE).EQS."")
  474. $ THEN
  475. $!
  476. $! Tell The User That The File Doesn't Exist.
  477. $!
  478. $ WRITE SYS$OUTPUT ""
  479. $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
  480. $ WRITE SYS$OUTPUT ""
  481. $!
  482. $! Exit The Build.
  483. $!
  484. $ GOTO EXIT
  485. $!
  486. $! End The File Exist Check.
  487. $!
  488. $ ENDIF
  489. $!
  490. $! Tell The User We Are Compiling The File.
  491. $!
  492. $ IF (MODULE_NAME.EQS."")
  493. $ THEN
  494. $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE,")"
  495. $ ENDIF
  496. $ IF (MODULE_NAME.NES."")
  497. $ THEN
  498. $ WRITE SYS$OUTPUT " ",FILE_NAME,""
  499. $ ENDIF
  500. $!
  501. $! Compile The File.
  502. $!
  503. $ ON ERROR THEN GOTO NEXT_FILE
  504. $ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME)
  505. $ IF FILE_NAME - ".mar" .NES. FILE_NAME
  506. $ THEN
  507. $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  508. $ ELSE
  509. $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3
  510. $ THEN
  511. $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  512. $ ELSE
  513. $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4
  514. $ THEN
  515. $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  516. $ ELSE
  517. $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5
  518. $ THEN
  519. $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  520. $ ELSE
  521. $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6
  522. $ THEN
  523. $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  524. $ ELSE
  525. $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  526. $ ENDIF
  527. $ ENDIF
  528. $ ENDIF
  529. $ ENDIF
  530. $ ENDIF
  531. $ IF STATE .EQS. "LIB"
  532. $ THEN
  533. $!
  534. $! Add It To The Library.
  535. $!
  536. $ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE'
  537. $!
  538. $! Time To Clean Up The Object File.
  539. $!
  540. $ DELETE 'OBJECT_FILE';*
  541. $ ENDIF
  542. $!
  543. $! Go Back And Do It Again.
  544. $!
  545. $ GOTO NEXT_FILE
  546. $!
  547. $! All Done With This Library Part.
  548. $!
  549. $ FILE_DONE:
  550. $!
  551. $! Time To Build Some Applications
  552. $!
  553. $ IF F$TYPE('APPS_MODULE') .NES. "" .AND. BUILDALL .NES. "LIBRARY"
  554. $ THEN
  555. $ APPLICATION_COUNTER = 0
  556. $ NEXT_APPLICATION:
  557. $ APPLICATION = F$ELEMENT(APPLICATION_COUNTER,";",'APPS_MODULE')
  558. $ IF APPLICATION .EQS. ";" THEN GOTO APPLICATION_DONE
  559. $
  560. $ APPLICATION_COUNTER = APPLICATION_COUNTER + 1
  561. $ APPLICATION_OBJECTS = F$ELEMENT(1,"/",APPLICATION)
  562. $ APPLICATION = F$ELEMENT(0,"/",APPLICATION)
  563. $
  564. $! WRITE SYS$OUTPUT "DEBUG: SHOW SYMBOL APPLICATION*"
  565. $! SHOW SYMBOL APPLICATION*
  566. $!
  567. $! Tell the user what happens
  568. $!
  569. $ WRITE SYS$OUTPUT " ",APPLICATION,".exe"
  570. $!
  571. $! Link The Program.
  572. $!
  573. $ ON ERROR THEN GOTO NEXT_APPLICATION
  574. $!
  575. $! Check To See If We Are To Link With A Specific TCP/IP Library.
  576. $!
  577. $ IF (TCPIP_LIB.NES."")
  578. $ THEN
  579. $!
  580. $! Link With A TCP/IP Library.
  581. $!
  582. $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
  583. 'OBJ_DIR''APPLICATION_OBJECTS', -
  584. 'CRYPTO_LIB'/LIBRARY, -
  585. 'TCPIP_LIB','OPT_FILE'/OPTION
  586. $!
  587. $! Else...
  588. $!
  589. $ ELSE
  590. $!
  591. $! Don't Link With A TCP/IP Library.
  592. $!
  593. $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE -
  594. 'OBJ_DIR''APPLICATION_OBJECTS',-
  595. 'CRYPTO_LIB'/LIBRARY, -
  596. 'OPT_FILE'/OPTION
  597. $!
  598. $! End The TCP/IP Library Check.
  599. $!
  600. $ ENDIF
  601. $ GOTO NEXT_APPLICATION
  602. $ APPLICATION_DONE:
  603. $ ENDIF
  604. $!
  605. $! Go Back And Get The Next Module.
  606. $!
  607. $ GOTO MODULE_NEXT
  608. $!
  609. $! All Done With This Module.
  610. $!
  611. $ MODULE_DONE:
  612. $!
  613. $! Tell The User That We Are All Done.
  614. $!
  615. $ WRITE SYS$OUTPUT "All Done..."
  616. $ EXIT:
  617. $ GOSUB CLEANUP
  618. $ EXIT
  619. $!
  620. $! Check For The Link Option FIle.
  621. $!
  622. $ CHECK_OPT_FILE:
  623. $!
  624. $! Check To See If We Need To Make A VAX C Option File.
  625. $!
  626. $ IF (COMPILER.EQS."VAXC")
  627. $ THEN
  628. $!
  629. $! Check To See If We Already Have A VAX C Linker Option File.
  630. $!
  631. $ IF (F$SEARCH(OPT_FILE).EQS."")
  632. $ THEN
  633. $!
  634. $! We Need A VAX C Linker Option File.
  635. $!
  636. $ CREATE 'OPT_FILE'
  637. $DECK
  638. !
  639. ! Default System Options File To Link Agianst
  640. ! The Sharable VAX C Runtime Library.
  641. !
  642. SYS$SHARE:VAXCRTL.EXE/SHARE
  643. $EOD
  644. $!
  645. $! End The Option File Check.
  646. $!
  647. $ ENDIF
  648. $!
  649. $! End The VAXC Check.
  650. $!
  651. $ ENDIF
  652. $!
  653. $! Check To See If We Need A GNU C Option File.
  654. $!
  655. $ IF (COMPILER.EQS."GNUC")
  656. $ THEN
  657. $!
  658. $! Check To See If We Already Have A GNU C Linker Option File.
  659. $!
  660. $ IF (F$SEARCH(OPT_FILE).EQS."")
  661. $ THEN
  662. $!
  663. $! We Need A GNU C Linker Option File.
  664. $!
  665. $ CREATE 'OPT_FILE'
  666. $DECK
  667. !
  668. ! Default System Options File To Link Agianst
  669. ! The Sharable C Runtime Library.
  670. !
  671. GNU_CC:[000000]GCCLIB/LIBRARY
  672. SYS$SHARE:VAXCRTL/SHARE
  673. $EOD
  674. $!
  675. $! End The Option File Check.
  676. $!
  677. $ ENDIF
  678. $!
  679. $! End The GNU C Check.
  680. $!
  681. $ ENDIF
  682. $!
  683. $! Check To See If We Need A DEC C Option File.
  684. $!
  685. $ IF (COMPILER.EQS."DECC")
  686. $ THEN
  687. $!
  688. $! Check To See If We Already Have A DEC C Linker Option File.
  689. $!
  690. $ IF (F$SEARCH(OPT_FILE).EQS."")
  691. $ THEN
  692. $!
  693. $! Figure Out If We Need An AXP Or A VAX Linker Option File.
  694. $!
  695. $ IF ARCH .EQS. "VAX"
  696. $ THEN
  697. $!
  698. $! We Need A DEC C Linker Option File For VAX.
  699. $!
  700. $ CREATE 'OPT_FILE'
  701. $DECK
  702. !
  703. ! Default System Options File To Link Agianst
  704. ! The Sharable DEC C Runtime Library.
  705. !
  706. SYS$SHARE:DECC$SHR.EXE/SHARE
  707. $EOD
  708. $!
  709. $! Else...
  710. $!
  711. $ ELSE
  712. $!
  713. $! Create The AXP Linker Option File.
  714. $!
  715. $ CREATE 'OPT_FILE'
  716. $DECK
  717. !
  718. ! Default System Options File For AXP To Link Agianst
  719. ! The Sharable C Runtime Library.
  720. !
  721. SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
  722. SYS$SHARE:CMA$OPEN_RTL/SHARE
  723. $EOD
  724. $!
  725. $! End The VAX/AXP DEC C Option File Check.
  726. $!
  727. $ ENDIF
  728. $!
  729. $! End The Option File Search.
  730. $!
  731. $ ENDIF
  732. $!
  733. $! End The DEC C Check.
  734. $!
  735. $ ENDIF
  736. $!
  737. $! Tell The User What Linker Option File We Are Using.
  738. $!
  739. $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
  740. $!
  741. $! Time To RETURN.
  742. $!
  743. $ RETURN
  744. $!
  745. $! Check The User's Options.
  746. $!
  747. $ CHECK_OPTIONS:
  748. $!
  749. $! Check To See If P1 Is Blank.
  750. $!
  751. $ IF (P1.EQS."ALL")
  752. $ THEN
  753. $!
  754. $! P1 Is Blank, So Build Everything.
  755. $!
  756. $ BUILDALL = "TRUE"
  757. $!
  758. $! Else...
  759. $!
  760. $ ELSE
  761. $!
  762. $! Else, Check To See If P1 Has A Valid Arguement.
  763. $!
  764. $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
  765. $ THEN
  766. $!
  767. $! A Valid Arguement.
  768. $!
  769. $ BUILDALL = P1
  770. $!
  771. $! Else...
  772. $!
  773. $ ELSE
  774. $!
  775. $! Tell The User We Don't Know What They Want.
  776. $!
  777. $ WRITE SYS$OUTPUT ""
  778. $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
  779. $ WRITE SYS$OUTPUT ""
  780. $ WRITE SYS$OUTPUT " ALL : Just Build Everything."
  781. $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library."
  782. $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.EXE Programs."
  783. $ WRITE SYS$OUTPUT ""
  784. $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
  785. $ WRITE SYS$OUTPUT ""
  786. $ WRITE SYS$OUTPUT " AXP : Alpha Architecture."
  787. $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
  788. $ WRITE SYS$OUTPUT ""
  789. $!
  790. $! Time To EXIT.
  791. $!
  792. $ EXIT
  793. $!
  794. $! End The Valid Arguement Check.
  795. $!
  796. $ ENDIF
  797. $!
  798. $! End The P1 Check.
  799. $!
  800. $ ENDIF
  801. $!
  802. $! Check To See If P2 Is Blank.
  803. $!
  804. $ IF (P2.EQS."NODEBUG")
  805. $ THEN
  806. $!
  807. $! P2 Is NODEBUG, So Compile Without The Debugger Information.
  808. $!
  809. $ DEBUGGER = "NODEBUG"
  810. $ TRACEBACK = "NOTRACEBACK"
  811. $ GCC_OPTIMIZE = "OPTIMIZE"
  812. $ CC_OPTIMIZE = "OPTIMIZE"
  813. $ MACRO_OPTIMIZE = "OPTIMIZE"
  814. $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
  815. $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
  816. $ ELSE
  817. $!
  818. $! Check To See If We Are To Compile With Debugger Information.
  819. $!
  820. $ IF (P2.EQS."DEBUG")
  821. $ THEN
  822. $!
  823. $! Compile With Debugger Information.
  824. $!
  825. $ DEBUGGER = "DEBUG"
  826. $ TRACEBACK = "TRACEBACK"
  827. $ GCC_OPTIMIZE = "NOOPTIMIZE"
  828. $ CC_OPTIMIZE = "NOOPTIMIZE"
  829. $ MACRO_OPTIMIZE = "NOOPTIMIZE"
  830. $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
  831. $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
  832. $ ELSE
  833. $!
  834. $! They Entered An Invalid Option..
  835. $!
  836. $ WRITE SYS$OUTPUT ""
  837. $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
  838. $ WRITE SYS$OUTPUT ""
  839. $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
  840. $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
  841. $ WRITE SYS$OUTPUT ""
  842. $!
  843. $! Time To EXIT.
  844. $!
  845. $ EXIT
  846. $!
  847. $! End The Valid Arguement Check.
  848. $!
  849. $ ENDIF
  850. $!
  851. $! End The P2 Check.
  852. $!
  853. $ ENDIF
  854. $!
  855. $! Special Threads For OpenVMS v7.1 Or Later
  856. $!
  857. $! Written By: Richard Levitte
  858. $! richard@levitte.org
  859. $!
  860. $!
  861. $! Check To See If We Have A Option For P5.
  862. $!
  863. $ IF (P5.EQS."")
  864. $ THEN
  865. $!
  866. $! Get The Version Of VMS We Are Using.
  867. $!
  868. $ ISSEVEN :=
  869. $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
  870. $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
  871. $!
  872. $! Check To See If The VMS Version Is v7.1 Or Later.
  873. $!
  874. $ IF (TMP.GE.71)
  875. $ THEN
  876. $!
  877. $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
  878. $!
  879. $ ISSEVEN := ,PTHREAD_USE_D4
  880. $!
  881. $! End The VMS Version Check.
  882. $!
  883. $ ENDIF
  884. $!
  885. $! End The P5 Check.
  886. $!
  887. $ ENDIF
  888. $!
  889. $! Check To See If P3 Is Blank.
  890. $!
  891. $ IF (P3.EQS."")
  892. $ THEN
  893. $!
  894. $! O.K., The User Didn't Specify A Compiler, Let's Try To
  895. $! Find Out Which One To Use.
  896. $!
  897. $! Check To See If We Have GNU C.
  898. $!
  899. $ IF (F$TRNLNM("GNU_CC").NES."")
  900. $ THEN
  901. $!
  902. $! Looks Like GNUC, Set To Use GNUC.
  903. $!
  904. $ P3 = "GNUC"
  905. $!
  906. $! Else...
  907. $!
  908. $ ELSE
  909. $!
  910. $! Check To See If We Have VAXC Or DECC.
  911. $!
  912. $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
  913. $ THEN
  914. $!
  915. $! Looks Like DECC, Set To Use DECC.
  916. $!
  917. $ P3 = "DECC"
  918. $!
  919. $! Else...
  920. $!
  921. $ ELSE
  922. $!
  923. $! Looks Like VAXC, Set To Use VAXC.
  924. $!
  925. $ P3 = "VAXC"
  926. $!
  927. $! End The VAXC Compiler Check.
  928. $!
  929. $ ENDIF
  930. $!
  931. $! End The DECC & VAXC Compiler Check.
  932. $!
  933. $ ENDIF
  934. $!
  935. $! End The Compiler Check.
  936. $!
  937. $ ENDIF
  938. $!
  939. $! Check To See If We Have A Option For P4.
  940. $!
  941. $ IF (P4.EQS."")
  942. $ THEN
  943. $!
  944. $! Find out what socket library we have available
  945. $!
  946. $ IF F$PARSE("SOCKETSHR:") .NES. ""
  947. $ THEN
  948. $!
  949. $! We have SOCKETSHR, and it is my opinion that it's the best to use.
  950. $!
  951. $ P4 = "SOCKETSHR"
  952. $!
  953. $! Tell the user
  954. $!
  955. $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
  956. $!
  957. $! Else, let's look for something else
  958. $!
  959. $ ELSE
  960. $!
  961. $! Like UCX (the reason to do this before Multinet is that the UCX
  962. $! emulation is easier to use...)
  963. $!
  964. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
  965. .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
  966. .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
  967. $ THEN
  968. $!
  969. $! Last resort: a UCX or UCX-compatible library
  970. $!
  971. $ P4 = "UCX"
  972. $!
  973. $! Tell the user
  974. $!
  975. $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
  976. $!
  977. $! That was all...
  978. $!
  979. $ ENDIF
  980. $ ENDIF
  981. $ ENDIF
  982. $!
  983. $! Set Up Initial CC Definitions, Possibly With User Ones
  984. $!
  985. $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS"
  986. $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
  987. $ CCEXTRAFLAGS = ""
  988. $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
  989. $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
  990. $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
  991. CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
  992. $!
  993. $! Check To See If The User Entered A Valid Paramter.
  994. $!
  995. $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
  996. $ THEN
  997. $!
  998. $! Check To See If The User Wanted DECC.
  999. $!
  1000. $ IF (P3.EQS."DECC")
  1001. $ THEN
  1002. $!
  1003. $! Looks Like DECC, Set To Use DECC.
  1004. $!
  1005. $ COMPILER = "DECC"
  1006. $!
  1007. $! Tell The User We Are Using DECC.
  1008. $!
  1009. $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
  1010. $!
  1011. $! Use DECC...
  1012. $!
  1013. $ CC = "CC"
  1014. $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
  1015. THEN CC = "CC/DECC"
  1016. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
  1017. "/NOLIST/PREFIX=ALL" + -
  1018. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP])" + -
  1019. CCEXTRAFLAGS
  1020. $!
  1021. $! Define The Linker Options File Name.
  1022. $!
  1023. $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
  1024. $!
  1025. $! End DECC Check.
  1026. $!
  1027. $ ENDIF
  1028. $!
  1029. $! Check To See If We Are To Use VAXC.
  1030. $!
  1031. $ IF (P3.EQS."VAXC")
  1032. $ THEN
  1033. $!
  1034. $! Looks Like VAXC, Set To Use VAXC.
  1035. $!
  1036. $ COMPILER = "VAXC"
  1037. $!
  1038. $! Tell The User We Are Using VAX C.
  1039. $!
  1040. $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
  1041. $!
  1042. $! Compile Using VAXC.
  1043. $!
  1044. $ CC = "CC"
  1045. $ IF ARCH.EQS."AXP"
  1046. $ THEN
  1047. $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
  1048. $ EXIT
  1049. $ ENDIF
  1050. $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
  1051. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
  1052. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
  1053. CCEXTRAFLAGS
  1054. $ CCDEFS = """VAXC""," + CCDEFS
  1055. $!
  1056. $! Define <sys> As SYS$COMMON:[SYSLIB]
  1057. $!
  1058. $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
  1059. $!
  1060. $! Define The Linker Options File Name.
  1061. $!
  1062. $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
  1063. $!
  1064. $! End VAXC Check
  1065. $!
  1066. $ ENDIF
  1067. $!
  1068. $! Check To See If We Are To Use GNU C.
  1069. $!
  1070. $ IF (P3.EQS."GNUC")
  1071. $ THEN
  1072. $!
  1073. $! Looks Like GNUC, Set To Use GNUC.
  1074. $!
  1075. $ COMPILER = "GNUC"
  1076. $!
  1077. $! Tell The User We Are Using GNUC.
  1078. $!
  1079. $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
  1080. $!
  1081. $! Use GNU C...
  1082. $!
  1083. $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
  1084. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
  1085. CCEXTRAFLAGS
  1086. $!
  1087. $! Define The Linker Options File Name.
  1088. $!
  1089. $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
  1090. $!
  1091. $! End The GNU C Check.
  1092. $!
  1093. $ ENDIF
  1094. $!
  1095. $! Set up default defines
  1096. $!
  1097. $ CCDEFS = """FLAT_INC=1""," + CCDEFS
  1098. $!
  1099. $! Finish up the definition of CC.
  1100. $!
  1101. $ IF COMPILER .EQS. "DECC"
  1102. $ THEN
  1103. $ IF CCDISABLEWARNINGS .EQS. ""
  1104. $ THEN
  1105. $ CC4DISABLEWARNINGS = "DOLLARID"
  1106. $ CC6DISABLEWARNINGS = "MIXLINKAGE"
  1107. $ ELSE
  1108. $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
  1109. $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE"
  1110. $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
  1111. $ ENDIF
  1112. $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
  1113. $ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))"
  1114. $ ELSE
  1115. $ CCDISABLEWARNINGS = ""
  1116. $ CC4DISABLEWARNINGS = ""
  1117. $ CC6DISABLEWARNINGS = ""
  1118. $ ENDIF
  1119. $ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS
  1120. $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
  1121. $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG"
  1122. $ THEN
  1123. $ CC5 = CC + "/OPTIMIZE=NODISJOINT"
  1124. $ ELSE
  1125. $ CC5 = CC + "/NOOPTIMIZE"
  1126. $ ENDIF
  1127. $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS
  1128. $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS
  1129. $!
  1130. $! Show user the result
  1131. $!
  1132. $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
  1133. $!
  1134. $! Else The User Entered An Invalid Arguement.
  1135. $!
  1136. $ ELSE
  1137. $!
  1138. $! Tell The User We Don't Know What They Want.
  1139. $!
  1140. $ WRITE SYS$OUTPUT ""
  1141. $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
  1142. $ WRITE SYS$OUTPUT ""
  1143. $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
  1144. $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
  1145. $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
  1146. $ WRITE SYS$OUTPUT ""
  1147. $!
  1148. $! Time To EXIT.
  1149. $!
  1150. $ EXIT
  1151. $!
  1152. $! End The Valid Arguement Check.
  1153. $!
  1154. $ ENDIF
  1155. $!
  1156. $! Build a MACRO command for the architecture at hand
  1157. $!
  1158. $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
  1159. $ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
  1160. $!
  1161. $! Show user the result
  1162. $!
  1163. $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
  1164. $!
  1165. $! Time to check the contents, and to make sure we get the correct library.
  1166. $!
  1167. $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
  1168. .OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
  1169. $ THEN
  1170. $!
  1171. $! Check to see if SOCKETSHR was chosen
  1172. $!
  1173. $ IF P4.EQS."SOCKETSHR"
  1174. $ THEN
  1175. $!
  1176. $! Set the library to use SOCKETSHR
  1177. $!
  1178. $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
  1179. $!
  1180. $! Done with SOCKETSHR
  1181. $!
  1182. $ ENDIF
  1183. $!
  1184. $! Check to see if MULTINET was chosen
  1185. $!
  1186. $ IF P4.EQS."MULTINET"
  1187. $ THEN
  1188. $!
  1189. $! Set the library to use UCX emulation.
  1190. $!
  1191. $ P4 = "UCX"
  1192. $!
  1193. $! Done with MULTINET
  1194. $!
  1195. $ ENDIF
  1196. $!
  1197. $! Check to see if UCX was chosen
  1198. $!
  1199. $ IF P4.EQS."UCX"
  1200. $ THEN
  1201. $!
  1202. $! Set the library to use UCX.
  1203. $!
  1204. $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
  1205. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
  1206. $ THEN
  1207. $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
  1208. $ ELSE
  1209. $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
  1210. TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
  1211. $ ENDIF
  1212. $!
  1213. $! Done with UCX
  1214. $!
  1215. $ ENDIF
  1216. $!
  1217. $! Check to see if TCPIP was chosen
  1218. $!
  1219. $ IF P4.EQS."TCPIP"
  1220. $ THEN
  1221. $!
  1222. $! Set the library to use TCPIP (post UCX).
  1223. $!
  1224. $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
  1225. $!
  1226. $! Done with TCPIP
  1227. $!
  1228. $ ENDIF
  1229. $!
  1230. $! Check to see if NONE was chosen
  1231. $!
  1232. $ IF P4.EQS."NONE"
  1233. $ THEN
  1234. $!
  1235. $! Do not use a TCPIP library.
  1236. $!
  1237. $ TCPIP_LIB = ""
  1238. $!
  1239. $! Done with TCPIP
  1240. $!
  1241. $ ENDIF
  1242. $!
  1243. $! Print info
  1244. $!
  1245. $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
  1246. $!
  1247. $! Else The User Entered An Invalid Arguement.
  1248. $!
  1249. $ ELSE
  1250. $!
  1251. $! Tell The User We Don't Know What They Want.
  1252. $!
  1253. $ WRITE SYS$OUTPUT ""
  1254. $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
  1255. $ WRITE SYS$OUTPUT ""
  1256. $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
  1257. $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
  1258. $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
  1259. $ WRITE SYS$OUTPUT ""
  1260. $!
  1261. $! Time To EXIT.
  1262. $!
  1263. $ EXIT
  1264. $!
  1265. $! Done with TCP/IP libraries
  1266. $!
  1267. $ ENDIF
  1268. $!
  1269. $! Check if the user wanted to compile just a subset of all the encryption
  1270. $! methods.
  1271. $!
  1272. $ IF P6 .NES. ""
  1273. $ THEN
  1274. $ ENCRYPT_TYPES = P6
  1275. $ ENDIF
  1276. $!
  1277. $! Time To RETURN...
  1278. $!
  1279. $ RETURN
  1280. $!
  1281. $ INITIALISE:
  1282. $!
  1283. $! Save old value of the logical name OPENSSL
  1284. $!
  1285. $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
  1286. $!
  1287. $! Save directory information
  1288. $!
  1289. $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
  1290. $ __HERE = F$EDIT(__HERE,"UPCASE")
  1291. $ __TOP = __HERE - "CRYPTO]"
  1292. $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
  1293. $!
  1294. $! Set up the logical name OPENSSL to point at the include directory
  1295. $!
  1296. $ DEFINE OPENSSL/NOLOG '__INCLUDE'
  1297. $!
  1298. $! Done
  1299. $!
  1300. $ RETURN
  1301. $!
  1302. $ CLEANUP:
  1303. $!
  1304. $! Restore the logical name OPENSSL if it had a value
  1305. $!
  1306. $ IF __SAVE_OPENSSL .EQS. ""
  1307. $ THEN
  1308. $ DEASSIGN OPENSSL
  1309. $ ELSE
  1310. $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
  1311. $ ENDIF
  1312. $!
  1313. $! Done
  1314. $!
  1315. $ RETURN