des-lib.com 21 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. $!
  2. $! DES-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
  11. $! "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" library. The "xxx" denotes the machine
  12. $! architecture of AXP or VAX.
  13. $!
  14. $! It was re-written to try to determine which "C" compiler to try to use
  15. $! or the user can specify a compiler in P3.
  16. $!
  17. $! Specify one of the following to build just that part, specify "ALL" to
  18. $! just build everything.
  19. $!
  20. $! ALL To Just Build "Everything".
  21. $! LIBRARY To Just Build The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library.
  22. $! DESTEST To Just Build The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program.
  23. $! SPEED To Just Build The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program.
  24. $! RPW To Just Build The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program.
  25. $! DES To Just Build The [.xxx.EXE.CRYPTO.DES]DES.EXE Program.
  26. $! DES_OPTS To Just Build The [.xxx.EXE.CRYPTO.DES]DES_OPTS.EXE Program.
  27. $!
  28. $! Specify either DEBUG or NODEBUG as P2 to compile with or without
  29. $! debugging information.
  30. $!
  31. $! Specify which compiler at P3 to try to compile under.
  32. $!
  33. $! VAXC For VAX C.
  34. $! DECC For DEC C.
  35. $! GNUC For GNU C.
  36. $!
  37. $! If you don't speficy a compiler, it will try to determine which
  38. $! "C" compiler to try to use.
  39. $!
  40. $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
  41. $!
  42. $!
  43. $! Make sure we know what architecture we run on.
  44. $!
  45. $!
  46. $! Check Which Architecture We Are Using.
  47. $!
  48. $ IF (F$GETSYI("CPU").GE.128)
  49. $ THEN
  50. $!
  51. $! The Architecture Is AXP.
  52. $!
  53. $ ARCH := AXP
  54. $!
  55. $! Else...
  56. $!
  57. $ ELSE
  58. $!
  59. $! The Architecture Is VAX.
  60. $!
  61. $ ARCH := VAX
  62. $!
  63. $! End The Architecture Check.
  64. $!
  65. $ ENDIF
  66. $!
  67. $! Check To Make Sure We Have Valid Command Line Parameters.
  68. $!
  69. $ GOSUB CHECK_OPTIONS
  70. $!
  71. $! Tell The User What Kind of Machine We Run On.
  72. $!
  73. $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
  74. $!
  75. $! Define The OBJ Directory Name.
  76. $!
  77. $ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES]
  78. $!
  79. $! Check To See If The Architecture Specific OBJ Directory Exists.
  80. $!
  81. $ IF (F$PARSE(OBJ_DIR).EQS."")
  82. $ THEN
  83. $!
  84. $! It Dosen't Exist, So Create It.
  85. $!
  86. $ CREATE/DIR 'OBJ_DIR'
  87. $!
  88. $! End The Architecture Specific OBJ Directory Check.
  89. $!
  90. $ ENDIF
  91. $!
  92. $! Define The EXE Directory Name.
  93. $!
  94. $ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES]
  95. $!
  96. $! Check To See If The Architecture Specific Directory Exists.
  97. $!
  98. $ IF (F$PARSE(EXE_DIR).EQS."")
  99. $ THEN
  100. $!
  101. $! It Dosen't Exist, So Create It.
  102. $!
  103. $ CREATE/DIR 'EXE_DIR'
  104. $!
  105. $! End The Architecture Specific Directory Check.
  106. $!
  107. $ ENDIF
  108. $!
  109. $! Define The Library Name.
  110. $!
  111. $ LIB_NAME := 'EXE_DIR'LIBDES.OLB
  112. $!
  113. $! Check To See What We Are To Do.
  114. $!
  115. $ IF (BUILDALL.EQS."TRUE")
  116. $ THEN
  117. $!
  118. $! Since Nothing Special Was Specified, Do Everything.
  119. $!
  120. $ GOSUB LIBRARY
  121. $ GOSUB DESTEST
  122. $ GOSUB SPEED
  123. $ GOSUB RPW
  124. $ GOSUB DES
  125. $ GOSUB DES_OPTS
  126. $!
  127. $! Else...
  128. $!
  129. $ ELSE
  130. $!
  131. $! Build Just What The User Wants Us To Build.
  132. $!
  133. $ GOSUB 'BUILDALL'
  134. $!
  135. $! End The BUILDALL Check.
  136. $!
  137. $ ENDIF
  138. $!
  139. $! Time To EXIT.
  140. $!
  141. $ EXIT
  142. $ LIBRARY:
  143. $!
  144. $! Tell The User That We Are Compiling.
  145. $!
  146. $ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files."
  147. $!
  148. $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" Library...
  149. $!
  150. $ IF (F$SEARCH(LIB_NAME).EQS."")
  151. $ THEN
  152. $!
  153. $! Guess Not, Create The Library.
  154. $!
  155. $ LIBRARY/CREATE/OBJECT 'LIB_NAME'
  156. $!
  157. $! End The Library Exist Check.
  158. $!
  159. $ ENDIF
  160. $!
  161. $! Define The DES Library Files.
  162. $!
  163. $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ -
  164. "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ -
  165. "enc_read,enc_writ,ofb64enc,"+ -
  166. "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ -
  167. "des_enc,fcrypt_b,read2pwd,"+ -
  168. "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp"
  169. $!
  170. $! Define A File Counter And Set It To "0".
  171. $!
  172. $ FILE_COUNTER = 0
  173. $!
  174. $! Top Of The File Loop.
  175. $!
  176. $ NEXT_FILE:
  177. $!
  178. $! O.K, Extract The File Name From The File List.
  179. $!
  180. $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_DES)
  181. $!
  182. $! Check To See If We Are At The End Of The File List.
  183. $!
  184. $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
  185. $!
  186. $! Increment The Counter.
  187. $!
  188. $ FILE_COUNTER = FILE_COUNTER + 1
  189. $!
  190. $! Create The Source File Name.
  191. $!
  192. $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
  193. $!
  194. $! Tell The User We Are Compiling The Source File.
  195. $!
  196. $ WRITE SYS$OUTPUT " ",FILE_NAME,".C"
  197. $!
  198. $! Create The Object File Name.
  199. $!
  200. $ OBJECT_FILE = OBJ_DIR + FILE_NAME + "." + ARCH + "OBJ"
  201. $ ON WARNING THEN GOTO NEXT_FILE
  202. $!
  203. $! Check To See If The File We Want To Compile Actually Exists.
  204. $!
  205. $ IF (F$SEARCH(SOURCE_FILE).EQS."")
  206. $ THEN
  207. $!
  208. $! Tell The User That The File Dosen't Exist.
  209. $!
  210. $ WRITE SYS$OUTPUT ""
  211. $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
  212. $ WRITE SYS$OUTPUT ""
  213. $!
  214. $! Exit The Build.
  215. $!
  216. $ EXIT
  217. $!
  218. $! End The File Exists Check.
  219. $!
  220. $ ENDIF
  221. $!
  222. $! Compile The File.
  223. $!
  224. $ ON ERROR THEN GOTO NEXT_FILE
  225. $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  226. $!
  227. $! Add It To The Library.
  228. $!
  229. $ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE'
  230. $!
  231. $! Time To Clean Up The Object File.
  232. $!
  233. $ DELETE 'OBJECT_FILE';*
  234. $!
  235. $! Go Back And Do It Again.
  236. $!
  237. $ GOTO NEXT_FILE
  238. $!
  239. $! All Done With This Library Part.
  240. $!
  241. $ FILE_DONE:
  242. $!
  243. $! Tell The User That We Are All Done.
  244. $!
  245. $ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built."
  246. $!
  247. $! All Done, Time To Return.
  248. $!
  249. $ RETURN
  250. $!
  251. $! Compile The DESTEST Program.
  252. $!
  253. $ DESTEST:
  254. $!
  255. $! Check To See If We Have The Proper Libraries.
  256. $!
  257. $ GOSUB LIB_CHECK
  258. $!
  259. $! Check To See If We Have A Linker Option File.
  260. $!
  261. $ GOSUB CHECK_OPT_FILE
  262. $!
  263. $! Check To See If The File We Want To Compile Actually Exists.
  264. $!
  265. $ IF (F$SEARCH("SYS$DISK:[]DESTEST.C").EQS."")
  266. $ THEN
  267. $!
  268. $! Tell The User That The File Dosen't Exist.
  269. $!
  270. $ WRITE SYS$OUTPUT ""
  271. $ WRITE SYS$OUTPUT "The File DESTEST.C Dosen't Exist."
  272. $ WRITE SYS$OUTPUT ""
  273. $!
  274. $! Exit The Build.
  275. $!
  276. $ EXIT
  277. $!
  278. $! End The DESTEST.C File Check.
  279. $!
  280. $ ENDIF
  281. $!
  282. $! Tell The User What We Are Building.
  283. $!
  284. $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DESTEST.EXE"
  285. $!
  286. $! Compile The DESTEST Program.
  287. $!
  288. $ CC/OBJECT='OBJ_DIR'DESTEST.OBJ SYS$DISK:[]DESTEST.C
  289. $!
  290. $! Link The DESTEST Program.
  291. $!
  292. $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DESTEST.EXE -
  293. 'OBJ_DIR'DESTEST.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
  294. $!
  295. $! All Done, Time To Return.
  296. $!
  297. $ RETURN
  298. $!
  299. $! Compile The SPEED Program.
  300. $!
  301. $ SPEED:
  302. $!
  303. $! Check To See If We Have The Proper Libraries.
  304. $!
  305. $ GOSUB LIB_CHECK
  306. $!
  307. $! Check To See If We Have A Linker Option File.
  308. $!
  309. $ GOSUB CHECK_OPT_FILE
  310. $!
  311. $! Check To See If The File We Want To Compile Actually Exists.
  312. $!
  313. $ IF (F$SEARCH("SYS$DISK:[]SPEED.C").EQS."")
  314. $ THEN
  315. $!
  316. $! Tell The User That The File Dosen't Exist.
  317. $!
  318. $ WRITE SYS$OUTPUT ""
  319. $ WRITE SYS$OUTPUT "The File SPEED.C Dosen't Exist."
  320. $ WRITE SYS$OUTPUT ""
  321. $!
  322. $! Exit The Build.
  323. $!
  324. $ EXIT
  325. $!
  326. $! End The SPEED.C File Check.
  327. $!
  328. $ ENDIF
  329. $!
  330. $! Tell The User What We Are Building.
  331. $!
  332. $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"SPEED.EXE"
  333. $!
  334. $! Compile The SPEED Program.
  335. $!
  336. $ CC/OBJECT='OBJ_DIR'SPEED.OBJ SYS$DISK:[]SPEED.C
  337. $!
  338. $! Link The SPEED Program.
  339. $!
  340. $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'SPEED.EXE -
  341. 'OBJ_DIR'SPEED.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
  342. $!
  343. $! All Done, Time To Return.
  344. $!
  345. $ RETURN
  346. $!
  347. $! Compile The RPW Program.
  348. $!
  349. $ RPW:
  350. $!
  351. $! Check To See If We Have The Proper Libraries.
  352. $!
  353. $ GOSUB LIB_CHECK
  354. $!
  355. $! Check To See If We Have A Linker Option File.
  356. $!
  357. $ GOSUB CHECK_OPT_FILE
  358. $!
  359. $! Check To See If The File We Want To Compile Actually Exists.
  360. $!
  361. $ IF (F$SEARCH("SYS$DISK:[]RPW.C").EQS."")
  362. $ THEN
  363. $!
  364. $! Tell The User That The File Dosen't Exist.
  365. $!
  366. $ WRITE SYS$OUTPUT ""
  367. $ WRITE SYS$OUTPUT "The File RPW.C Dosen't Exist."
  368. $ WRITE SYS$OUTPUT ""
  369. $!
  370. $! Exit The Build.
  371. $!
  372. $ EXIT
  373. $!
  374. $! End The RPW.C File Check.
  375. $!
  376. $ ENDIF
  377. $!
  378. $! Tell The User What We Are Building.
  379. $!
  380. $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RPW.EXE"
  381. $!
  382. $! Compile The RPW Program.
  383. $!
  384. $ CC/OBJECT='OBJ_DIR'RPW.OBJ SYS$DISK:[]RPW.C
  385. $!
  386. $! Link The RPW Program.
  387. $!
  388. $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'RPW.EXE -
  389. 'OBJ_DIR'RPW.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
  390. $!
  391. $! All Done, Time To Return.
  392. $!
  393. $ RETURN
  394. $!
  395. $! Compile The DES Program.
  396. $!
  397. $ DES:
  398. $!
  399. $! Check To See If We Have The Proper Libraries.
  400. $!
  401. $ GOSUB LIB_CHECK
  402. $!
  403. $! Check To See If We Have A Linker Option File.
  404. $!
  405. $ GOSUB CHECK_OPT_FILE
  406. $!
  407. $! Check To See If The File We Want To Compile Actually Exists.
  408. $!
  409. $ IF (F$SEARCH("SYS$DISK:[]DES.C").EQS."")
  410. $ THEN
  411. $!
  412. $! Tell The User That The File Dosen't Exist.
  413. $!
  414. $ WRITE SYS$OUTPUT ""
  415. $ WRITE SYS$OUTPUT "The File DES.C Dosen't Exist."
  416. $ WRITE SYS$OUTPUT ""
  417. $!
  418. $! Exit The Build.
  419. $!
  420. $ EXIT
  421. $!
  422. $! End The DES.C File Check.
  423. $!
  424. $ ENDIF
  425. $!
  426. $! Tell The User What We Are Building.
  427. $!
  428. $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES.EXE"
  429. $!
  430. $! Compile The DES Program.
  431. $!
  432. $ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]DES.C
  433. $ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]CBC3_ENC.C
  434. $!
  435. $! Link The DES Program.
  436. $!
  437. $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES.EXE -
  438. 'OBJ_DIR'DES.OBJ,'OBJ_DIR'CBC3_ENC.OBJ,-
  439. 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
  440. $!
  441. $! All Done, Time To Return.
  442. $!
  443. $ RETURN
  444. $!
  445. $! Compile The DES_OPTS Program.
  446. $!
  447. $ DES_OPTS:
  448. $!
  449. $! Check To See If We Have The Proper Libraries.
  450. $!
  451. $ GOSUB LIB_CHECK
  452. $!
  453. $! Check To See If We Have A Linker Option File.
  454. $!
  455. $ GOSUB CHECK_OPT_FILE
  456. $!
  457. $! Check To See If The File We Want To Compile Actually Exists.
  458. $!
  459. $ IF (F$SEARCH("SYS$DISK:[]DES_OPTS.C").EQS."")
  460. $ THEN
  461. $!
  462. $! Tell The User That The File Dosen't Exist.
  463. $!
  464. $ WRITE SYS$OUTPUT ""
  465. $ WRITE SYS$OUTPUT "The File DES_OPTS.C Dosen't Exist."
  466. $ WRITE SYS$OUTPUT ""
  467. $!
  468. $! Exit The Build.
  469. $!
  470. $ EXIT
  471. $!
  472. $! End The DES_OPTS.C File Check.
  473. $!
  474. $ ENDIF
  475. $!
  476. $! Tell The User What We Are Building.
  477. $!
  478. $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES_OPTS.EXE"
  479. $!
  480. $! Compile The DES_OPTS Program.
  481. $!
  482. $ CC/OBJECT='OBJ_DIR'DES_OPTS.OBJ SYS$DISK:[]DES_OPTS.C
  483. $!
  484. $! Link The DES_OPTS Program.
  485. $!
  486. $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES_OPTS.EXE -
  487. 'OBJ_DIR'DES_OPTS.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION
  488. $!
  489. $! All Done, Time To Return.
  490. $!
  491. $ RETURN
  492. $ EXIT
  493. $!
  494. $! Check For The Link Option FIle.
  495. $!
  496. $ CHECK_OPT_FILE:
  497. $!
  498. $! Check To See If We Need To Make A VAX C Option File.
  499. $!
  500. $ IF (COMPILER.EQS."VAXC")
  501. $ THEN
  502. $!
  503. $! Check To See If We Already Have A VAX C Linker Option File.
  504. $!
  505. $ IF (F$SEARCH(OPT_FILE).EQS."")
  506. $ THEN
  507. $!
  508. $! We Need A VAX C Linker Option File.
  509. $!
  510. $ CREATE 'OPT_FILE'
  511. $DECK
  512. !
  513. ! Default System Options File To Link Agianst
  514. ! The Sharable VAX C Runtime Library.
  515. !
  516. SYS$SHARE:VAXCRTL.EXE/SHARE
  517. $EOD
  518. $!
  519. $! End The Option File Check.
  520. $!
  521. $ ENDIF
  522. $!
  523. $! End The VAXC Check.
  524. $!
  525. $ ENDIF
  526. $!
  527. $! Check To See If We Need A GNU C Option File.
  528. $!
  529. $ IF (COMPILER.EQS."GNUC")
  530. $ THEN
  531. $!
  532. $! Check To See If We Already Have A GNU C Linker Option File.
  533. $!
  534. $ IF (F$SEARCH(OPT_FILE).EQS."")
  535. $ THEN
  536. $!
  537. $! We Need A GNU C Linker Option File.
  538. $!
  539. $ CREATE 'OPT_FILE'
  540. $DECK
  541. !
  542. ! Default System Options File To Link Agianst
  543. ! The Sharable C Runtime Library.
  544. !
  545. GNU_CC:[000000]GCCLIB/LIBRARY
  546. SYS$SHARE:VAXCRTL/SHARE
  547. $EOD
  548. $!
  549. $! End The Option File Check.
  550. $!
  551. $ ENDIF
  552. $!
  553. $! End The GNU C Check.
  554. $!
  555. $ ENDIF
  556. $!
  557. $! Check To See If We Need A DEC C Option File.
  558. $!
  559. $ IF (COMPILER.EQS."DECC")
  560. $ THEN
  561. $!
  562. $! Check To See If We Already Have A DEC C Linker Option File.
  563. $!
  564. $ IF (F$SEARCH(OPT_FILE).EQS."")
  565. $ THEN
  566. $!
  567. $! Figure Out If We Need An AXP Or A VAX Linker Option File.
  568. $!
  569. $ IF (F$GETSYI("CPU").LT.128)
  570. $ THEN
  571. $!
  572. $! We Need A DEC C Linker Option File For VAX.
  573. $!
  574. $ CREATE 'OPT_FILE'
  575. $DECK
  576. !
  577. ! Default System Options File To Link Agianst
  578. ! The Sharable DEC C Runtime Library.
  579. !
  580. SYS$SHARE:DECC$SHR.EXE/SHARE
  581. $EOD
  582. $!
  583. $! Else...
  584. $!
  585. $ ELSE
  586. $!
  587. $! Create The AXP Linker Option File.
  588. $!
  589. $ CREATE 'OPT_FILE'
  590. $DECK
  591. !
  592. ! Default System Options File For AXP To Link Agianst
  593. ! The Sharable C Runtime Library.
  594. !
  595. SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
  596. SYS$SHARE:CMA$OPEN_RTL/SHARE
  597. $EOD
  598. $!
  599. $! End The VAX/AXP DEC C Option File Check.
  600. $!
  601. $ ENDIF
  602. $!
  603. $! End The Option File Search.
  604. $!
  605. $ ENDIF
  606. $!
  607. $! End The DEC C Check.
  608. $!
  609. $ ENDIF
  610. $!
  611. $! Tell The User What Linker Option File We Are Using.
  612. $!
  613. $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
  614. $!
  615. $! Time To RETURN.
  616. $!
  617. $ RETURN
  618. $!
  619. $! Library Check.
  620. $!
  621. $ LIB_CHECK:
  622. $!
  623. $! Look For The Library LIBDES.OLB.
  624. $!
  625. $ IF (F$SEARCH(LIB_NAME).EQS."")
  626. $ THEN
  627. $!
  628. $! Tell The User We Can't Find The [.xxx.CRYPTO.DES]LIBDES.OLB Library.
  629. $!
  630. $ WRITE SYS$OUTPUT ""
  631. $ WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"."
  632. $ WRITE SYS$OUTPUT "We Can't Link Without It."
  633. $ WRITE SYS$OUTPUT ""
  634. $!
  635. $! Since We Can't Link Without It, Exit.
  636. $!
  637. $ EXIT
  638. $ ENDIF
  639. $!
  640. $! Time To Return.
  641. $!
  642. $ RETURN
  643. $!
  644. $! Check The User's Options.
  645. $!
  646. $ CHECK_OPTIONS:
  647. $!
  648. $! Check To See If We Are To "Just Build Everything".
  649. $!
  650. $ IF (P1.EQS."ALL")
  651. $ THEN
  652. $!
  653. $! P1 Is "ALL", So Build Everything.
  654. $!
  655. $ BUILDALL = "TRUE"
  656. $!
  657. $! Else...
  658. $!
  659. $ ELSE
  660. $!
  661. $! Else, Check To See If P1 Has A Valid Arguement.
  662. $!
  663. $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DESTEST").OR.(P1.EQS."SPEED") -
  664. .OR.(P1.EQS."RPW").OR.(P1.EQS."DES").OR.(P1.EQS."DES_OPTS")
  665. $ THEN
  666. $!
  667. $! A Valid Arguement.
  668. $!
  669. $ BUILDALL = P1
  670. $!
  671. $! Else...
  672. $!
  673. $ ELSE
  674. $!
  675. $! Tell The User We Don't Know What They Want.
  676. $!
  677. $ WRITE SYS$OUTPUT ""
  678. $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
  679. $ WRITE SYS$OUTPUT ""
  680. $ WRITE SYS$OUTPUT " ALL : Just Build Everything.
  681. $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library."
  682. $ WRITE SYS$OUTPUT " DESTEST : To Compile Just The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program."
  683. $ WRITE SYS$OUTPUT " SPEED : To Compile Just The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program."
  684. $ WRITE SYS$OUTPUT " RPW : To Compile Just The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program."
  685. $ WRITE SYS$OUTPUT " DES : To Compile Just The [.xxx.EXE.CRYPTO.DES]DES.EXE Program."
  686. $ WRITE SYS$OUTPUT " DES_OPTS : To Compile Just The [.xxx.EXE.CRYTPO.DES]DES_OPTS.EXE Program."
  687. $ WRITE SYS$OUTPUT ""
  688. $ WRITE SYS$OUTPUT " Where 'xxx' Stands For: "
  689. $ WRITE SYS$OUTPUT ""
  690. $ WRITE SYS$OUTPUT " AXP : Alpha Architecture."
  691. $ WRITE SYS$OUTPUT " VAX : VAX Architecture."
  692. $ WRITE SYS$OUTPUT ""
  693. $!
  694. $! Time To EXIT.
  695. $!
  696. $ EXIT
  697. $!
  698. $! End The Valid Arguement Check.
  699. $!
  700. $ ENDIF
  701. $!
  702. $! End The P1 Check.
  703. $!
  704. $ ENDIF
  705. $!
  706. $! Check To See If We Are To Compile Without Debugger Information.
  707. $!
  708. $ IF (P2.EQS."NODEBUG")
  709. $ THEN
  710. $!
  711. $! P2 Is Blank, So Compile Without Debugger Information.
  712. $!
  713. $ DEBUGGER = "NODEBUG"
  714. $ TRACEBACK = "NOTRACEBACK"
  715. $ GCC_OPTIMIZE = "OPTIMIZE"
  716. $ CC_OPTIMIZE = "OPTIMIZE"
  717. $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
  718. $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
  719. $!
  720. $! Else...
  721. $!
  722. $ ELSE
  723. $!
  724. $! Check To See If We Are To Compile With Debugger Information.
  725. $!
  726. $ IF (P2.EQS."DEBUG")
  727. $ THEN
  728. $!
  729. $! Compile With Debugger Information.
  730. $!
  731. $ DEBUGGER = "DEBUG"
  732. $ TRACEBACK = "TRACEBACK"
  733. $ GCC_OPTIMIZE = "NOOPTIMIZE"
  734. $ CC_OPTIMIZE = "NOOPTIMIZE"
  735. $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
  736. $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
  737. $!
  738. $! Else...
  739. $!
  740. $ ELSE
  741. $!
  742. $! Tell The User Entered An Invalid Option..
  743. $!
  744. $ WRITE SYS$OUTPUT ""
  745. $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
  746. $ WRITE SYS$OUTPUT ""
  747. $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
  748. $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
  749. $ WRITE SYS$OUTPUT ""
  750. $!
  751. $! Time To EXIT.
  752. $!
  753. $ EXIT
  754. $!
  755. $! End The Valid Arguement Check.
  756. $!
  757. $ ENDIF
  758. $!
  759. $! End The P2 Check.
  760. $!
  761. $ ENDIF
  762. $!
  763. $! Special Threads For OpenVMS v7.1 Or Later.
  764. $!
  765. $! Written By: Richard Levitte
  766. $! richard@levitte.org
  767. $!
  768. $!
  769. $! Check To See If We Have A Option For P4.
  770. $!
  771. $ IF (P4.EQS."")
  772. $ THEN
  773. $!
  774. $! Get The Version Of VMS We Are Using.
  775. $!
  776. $ ISSEVEN := ""
  777. $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
  778. $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
  779. $!
  780. $! Check To See If The VMS Version Is v7.1 Or Later.
  781. $!
  782. $ IF (TMP.GE.71)
  783. $ THEN
  784. $!
  785. $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
  786. $!
  787. $ ISSEVEN := ,PTHREAD_USE_D4
  788. $!
  789. $! End The VMS Version Check.
  790. $!
  791. $ ENDIF
  792. $!
  793. $! End The P4 Check.
  794. $!
  795. $ ENDIF
  796. $!
  797. $! Check To See If P3 Is Blank.
  798. $!
  799. $ IF (P3.EQS."")
  800. $ THEN
  801. $!
  802. $! O.K., The User Didn't Specify A Compiler, Let's Try To
  803. $! Find Out Which One To Use.
  804. $!
  805. $! Check To See If We Have GNU C.
  806. $!
  807. $ IF (F$TRNLNM("GNU_CC").NES."")
  808. $ THEN
  809. $!
  810. $! Looks Like GNUC, Set To Use GNUC.
  811. $!
  812. $ P3 = "GNUC"
  813. $!
  814. $! Else...
  815. $!
  816. $ ELSE
  817. $!
  818. $! Check To See If We Have VAXC Or DECC.
  819. $!
  820. $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
  821. $ THEN
  822. $!
  823. $! Looks Like DECC, Set To Use DECC.
  824. $!
  825. $ P3 = "DECC"
  826. $!
  827. $! Else...
  828. $!
  829. $ ELSE
  830. $!
  831. $! Looks Like VAXC, Set To Use VAXC.
  832. $!
  833. $ P3 = "VAXC"
  834. $!
  835. $! End The VAXC Compiler Check.
  836. $!
  837. $ ENDIF
  838. $!
  839. $! End The DECC & VAXC Compiler Check.
  840. $!
  841. $ ENDIF
  842. $!
  843. $! End The Compiler Check.
  844. $!
  845. $ ENDIF
  846. $!
  847. $! Set Up Initial CC Definitions, Possibly With User Ones
  848. $!
  849. $ CCDEFS = ""
  850. $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = USER_CCDEFS
  851. $ CCEXTRAFLAGS = ""
  852. $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
  853. $ CCDISABLEWARNINGS = ""
  854. $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
  855. CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS
  856. $!
  857. $! Check To See If The User Entered A Valid Paramter.
  858. $!
  859. $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
  860. $ THEN
  861. $!
  862. $! Check To See If The User Wanted DECC.
  863. $!
  864. $ IF (P3.EQS."DECC")
  865. $ THEN
  866. $!
  867. $! Looks Like DECC, Set To Use DECC.
  868. $!
  869. $ COMPILER = "DECC"
  870. $!
  871. $! Tell The User We Are Using DECC.
  872. $!
  873. $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
  874. $!
  875. $! Use DECC...
  876. $!
  877. $ CC = "CC"
  878. $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
  879. THEN CC = "CC/DECC"
  880. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
  881. "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS
  882. $!
  883. $! Define The Linker Options File Name.
  884. $!
  885. $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
  886. $!
  887. $! End DECC Check.
  888. $!
  889. $ ENDIF
  890. $!
  891. $! Check To See If We Are To Use VAXC.
  892. $!
  893. $ IF (P3.EQS."VAXC")
  894. $ THEN
  895. $!
  896. $! Looks Like VAXC, Set To Use VAXC.
  897. $!
  898. $ COMPILER = "VAXC"
  899. $!
  900. $! Tell The User We Are Using VAX C.
  901. $!
  902. $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
  903. $!
  904. $! Compile Using VAXC.
  905. $!
  906. $ CC = "CC"
  907. $ IF ARCH.EQS."AXP"
  908. $ THEN
  909. $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
  910. $ EXIT
  911. $ ENDIF
  912. $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
  913. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
  914. $ CCDEFS = """VAXC""," + CCDEFS
  915. $!
  916. $! Define <sys> As SYS$COMMON:[SYSLIB]
  917. $!
  918. $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
  919. $!
  920. $! Define The Linker Options File Name.
  921. $!
  922. $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
  923. $!
  924. $! End VAXC Check
  925. $!
  926. $ ENDIF
  927. $!
  928. $! Check To See If We Are To Use GNU C.
  929. $!
  930. $ IF (P3.EQS."GNUC")
  931. $ THEN
  932. $!
  933. $! Looks Like GNUC, Set To Use GNUC.
  934. $!
  935. $ COMPILER = "GNUC"
  936. $!
  937. $! Tell The User We Are Using GNUC.
  938. $!
  939. $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
  940. $!
  941. $! Use GNU C...
  942. $!
  943. $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
  944. $!
  945. $! Define The Linker Options File Name.
  946. $!
  947. $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
  948. $!
  949. $! End The GNU C Check.
  950. $!
  951. $ ENDIF
  952. $!
  953. $! Set up default defines
  954. $!
  955. $ CCDEFS = """FLAT_INC=1""," + CCDEFS
  956. $!
  957. $! Finish up the definition of CC.
  958. $!
  959. $ IF COMPILER .EQS. "DECC"
  960. $ THEN
  961. $ IF CCDISABLEWARNINGS .EQS. ""
  962. $ THEN
  963. $ CC4DISABLEWARNINGS = "DOLLARID"
  964. $ ELSE
  965. $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
  966. $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
  967. $ ENDIF
  968. $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
  969. $ ELSE
  970. $ CCDISABLEWARNINGS = ""
  971. $ CC4DISABLEWARNINGS = ""
  972. $ ENDIF
  973. $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
  974. $!
  975. $! Show user the result
  976. $!
  977. $ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
  978. $!
  979. $! Else The User Entered An Invalid Arguement.
  980. $!
  981. $ ELSE
  982. $!
  983. $! Tell The User We Don't Know What They Want.
  984. $!
  985. $ WRITE SYS$OUTPUT ""
  986. $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
  987. $ WRITE SYS$OUTPUT ""
  988. $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
  989. $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
  990. $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
  991. $ WRITE SYS$OUTPUT ""
  992. $!
  993. $! Time To EXIT.
  994. $!
  995. $ EXIT
  996. $!
  997. $! End The P3 Check.
  998. $!
  999. $ ENDIF
  1000. $!
  1001. $! Time To RETURN...
  1002. $!
  1003. $ RETURN