crypto-lib.com 30 KB

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