maketests.com 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  1. $!
  2. $! MAKETESTS.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 all the various different
  11. $! "test" programs for the different types of encryption for OpenSSL.
  12. $! It was written so it would try to determine what "C" compiler to
  13. $! use or you can specify which "C" compiler to use.
  14. $!
  15. $! The test "executeables" will be placed in a directory called
  16. $! [.xxx.EXE.TEST] where "xxx" denotes AXP or VAX depending on your machines
  17. $! architecture.
  18. $!
  19. $! Specify RSAREF as P1 to compile with the RSAREF library instead of
  20. $! the regular one. If you specify NORSAREF it will compile with the
  21. $! regular RSAREF routines. (Note: If you are in the United States
  22. $! you MUST compile with RSAREF unless you have a license from RSA).
  23. $!
  24. $! Note: The RSAREF libraries are NOT INCLUDED and you have to
  25. $! download it from "ftp://ftp.rsa.com/rsaref". You have to
  26. $! get the ".tar-Z" file as the ".zip" file dosen't have the
  27. $! directory structure stored. You have to extract the file
  28. $! into the [.RSAREF] directory under the root directory as that
  29. $! is where the scripts will look for the files.
  30. $!
  31. $! Specify DEBUG or NODEBUG P2 to compile with or without debugger
  32. $! information.
  33. $!
  34. $! Specify which compiler at P3 to try to compile under.
  35. $!
  36. $! VAXC For VAX C.
  37. $! DECC For DEC C.
  38. $! GNUC For GNU C.
  39. $!
  40. $! If you don't speficy a compiler, it will try to determine which
  41. $! "C" compiler to use.
  42. $!
  43. $! P4, if defined, sets a TCP/IP library to use, through one of the following
  44. $! keywords:
  45. $!
  46. $! UCX for UCX
  47. $! SOCKETSHR for SOCKETSHR+NETLIB
  48. $!
  49. $! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
  50. $!
  51. $!
  52. $! Define A TCP/IP Library That We Will Need To Link To.
  53. $! (That is, If Wee Need To Link To One.)
  54. $!
  55. $ TCPIP_LIB = ""
  56. $!
  57. $! Check Which Architecture We Are Using.
  58. $!
  59. $ IF (F$GETSYI("CPU").GE.128)
  60. $ THEN
  61. $!
  62. $! The Architecture Is AXP.
  63. $!
  64. $ ARCH := AXP
  65. $!
  66. $! Else...
  67. $!
  68. $ ELSE
  69. $!
  70. $! The Architecture Is VAX.
  71. $!
  72. $ ARCH := VAX
  73. $!
  74. $! End The Architecture Check.
  75. $!
  76. $ ENDIF
  77. $!
  78. $! Check To Make Sure We Have Valid Command Line Parameters.
  79. $!
  80. $ GOSUB CHECK_OPTIONS
  81. $!
  82. $! Initialise logical names and such
  83. $!
  84. $ GOSUB INITIALISE
  85. $!
  86. $! Tell The User What Kind of Machine We Run On.
  87. $!
  88. $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
  89. $!
  90. $! Define The CRYPTO-LIB We Are To Use.
  91. $!
  92. $ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
  93. $!
  94. $! Define The RSAREF-LIB We Are To Use.
  95. $!
  96. $ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB
  97. $!
  98. $! Define The SSL We Are To Use.
  99. $!
  100. $ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
  101. $!
  102. $! Define The OBJ Directory.
  103. $!
  104. $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST]
  105. $!
  106. $! Check To See If The Architecture Specific OBJ Directory Exists.
  107. $!
  108. $ IF (F$PARSE(OBJ_DIR).EQS."")
  109. $ THEN
  110. $!
  111. $! The EXE Directory Dosen't Exist, So Create It.
  112. $!
  113. $ CREATE/DIRECTORY 'OBJ_DIR'
  114. $!
  115. $! End The Architecture Specific OBJ Directory Check.
  116. $!
  117. $ ENDIF
  118. $!
  119. $! Define The EXE Directory.
  120. $!
  121. $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST]
  122. $!
  123. $! Check To See If The Architecture Specific EXE Directory Exists.
  124. $!
  125. $ IF (F$PARSE(EXE_DIR).EQS."")
  126. $ THEN
  127. $!
  128. $! The EXE Directory Dosen't Exist, So Create It.
  129. $!
  130. $ CREATE/DIRECTORY 'EXE_DIR'
  131. $!
  132. $! End The Architecture Specific EXE Directory Check.
  133. $!
  134. $ ENDIF
  135. $!
  136. $! Check To See If We Have The Proper Libraries.
  137. $!
  138. $ GOSUB LIB_CHECK
  139. $!
  140. $! Check To See If We Have A Linker Option File.
  141. $!
  142. $ GOSUB CHECK_OPT_FILE
  143. $!
  144. $! Define The TEST Files.
  145. $!
  146. $ TEST_FILES = "BNTEST,IDEATEST,MD2TEST,MD4TEST,MD5TEST,HMACTEST,"+ -
  147. "RC2TEST,RC4TEST,RC5TEST,"+ -
  148. "DESTEST,SHATEST,SHA1TEST,MDC2TEST,RMDTEST,"+ -
  149. "RANDTEST,DHTEST,"+ -
  150. "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST"
  151. $ TCPIP_PROGRAMS = ",,"
  152. $ IF COMPILER .EQS. "VAXC" THEN -
  153. TCPIP_PROGRAMS = ",SSLTEST,"
  154. $!
  155. $! Define A File Counter And Set It To "0".
  156. $!
  157. $ FILE_COUNTER = 0
  158. $!
  159. $! Top Of The File Loop.
  160. $!
  161. $ NEXT_FILE:
  162. $!
  163. $! O.K, Extract The File Name From The File List.
  164. $!
  165. $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES)
  166. $!
  167. $! Check To See If We Are At The End Of The File List.
  168. $!
  169. $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
  170. $!
  171. $! Increment The Counter.
  172. $!
  173. $ FILE_COUNTER = FILE_COUNTER + 1
  174. $!
  175. $! Create The Source File Name.
  176. $!
  177. $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C"
  178. $!
  179. $! Create The Object File Name.
  180. $!
  181. $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
  182. $!
  183. $! Create The Executable File Name.
  184. $!
  185. $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE"
  186. $ ON WARNING THEN GOTO NEXT_FILE
  187. $!
  188. $! Check To See If The File We Want To Compile Actually Exists.
  189. $!
  190. $ IF (F$SEARCH(SOURCE_FILE).EQS."")
  191. $ THEN
  192. $!
  193. $! Tell The User That The File Dosen't Exist.
  194. $!
  195. $ WRITE SYS$OUTPUT ""
  196. $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist."
  197. $ WRITE SYS$OUTPUT ""
  198. $!
  199. $! Exit The Build.
  200. $!
  201. $ GOTO EXIT
  202. $ ENDIF
  203. $!
  204. $! Tell The User What We Are Building.
  205. $!
  206. $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program."
  207. $!
  208. $! Compile The File.
  209. $!
  210. $ ON ERROR THEN GOTO NEXT_FILE
  211. $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  212. $ ON WARNING THEN GOTO NEXT_FILE
  213. $!
  214. $! Check If What We Are About To Compile Works Without A TCP/IP Library.
  215. $!
  216. $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS))
  217. $ THEN
  218. $!
  219. $! Inform The User That A TCP/IP Library Is Needed To Compile This Program.
  220. $!
  221. $ WRITE SYS$OUTPUT FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..."
  222. $ GOTO NEXT_FILE
  223. $!
  224. $! End The TCP/IP Library Check.
  225. $!
  226. $ ENDIF
  227. $!
  228. $! Link The Program, Check To See If We Need To Link With RSAREF Or Not.
  229. $!
  230. $ IF (RSAREF.EQS."TRUE")
  231. $ THEN
  232. $!
  233. $! Check To See If We Are To Link With A Specific TCP/IP Library.
  234. $!
  235. $ IF (TCPIP_LIB.NES."")
  236. $ THEN
  237. $!
  238. $! Link With The RSAREF Library And A Specific TCP/IP Library.
  239. $!
  240. $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
  241. 'OBJECT_FILE',-
  242. 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
  243. 'TCPIP_LIB','OPT_FILE'/OPTION
  244. $!
  245. $! Else...
  246. $!
  247. $ ELSE
  248. $!
  249. $! Link With The RSAREF Library And NO TCP/IP Library.
  250. $!
  251. $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
  252. 'OBJECT_FILE', -
  253. 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
  254. 'OPT_FILE'/OPTION
  255. $!
  256. $! End The TCP/IP Library Check.
  257. $!
  258. $ ENDIF
  259. $!
  260. $! Else...
  261. $!
  262. $ ELSE
  263. $!
  264. $! Don't Link With The RSAREF Routines.
  265. $!
  266. $!
  267. $! Check To See If We Are To Link With A Specific TCP/IP Library.
  268. $!
  269. $ IF (TCPIP_LIB.NES."")
  270. $ THEN
  271. $!
  272. $! Don't Link With The RSAREF Routines And TCP/IP Library.
  273. $!
  274. $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
  275. 'OBJECT_FILE', -
  276. 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
  277. 'TCPIP_LIB','OPT_FILE'/OPTION
  278. $!
  279. $! Else...
  280. $!
  281. $ ELSE
  282. $!
  283. $! Don't Link With The RSAREF Routines And Link With A TCP/IP Library.
  284. $!
  285. $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
  286. 'OBJECT_FILE', -
  287. 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
  288. 'OPT_FILE'/OPTION
  289. $!
  290. $! End The TCP/IP Library Check.
  291. $!
  292. $ ENDIF
  293. $!
  294. $! End The RSAREF Link Check.
  295. $!
  296. $ ENDIF
  297. $!
  298. $! Go Back And Do It Again.
  299. $!
  300. $ GOTO NEXT_FILE
  301. $!
  302. $! All Done With This Library Part.
  303. $!
  304. $ FILE_DONE:
  305. $!
  306. $! All Done, Time To Exit.
  307. $!
  308. $ EXIT:
  309. $ GOSUB CLEANUP
  310. $ EXIT
  311. $!
  312. $! Check For The Link Option FIle.
  313. $!
  314. $ CHECK_OPT_FILE:
  315. $!
  316. $! Check To See If We Need To Make A VAX C Option File.
  317. $!
  318. $ IF (COMPILER.EQS."VAXC")
  319. $ THEN
  320. $!
  321. $! Check To See If We Already Have A VAX C Linker Option File.
  322. $!
  323. $ IF (F$SEARCH(OPT_FILE).EQS."")
  324. $ THEN
  325. $!
  326. $! We Need A VAX C Linker Option File.
  327. $!
  328. $ CREATE 'OPT_FILE'
  329. $DECK
  330. !
  331. ! Default System Options File To Link Agianst
  332. ! The Sharable VAX C Runtime Library.
  333. !
  334. SYS$SHARE:VAXCRTL.EXE/SHARE
  335. $EOD
  336. $!
  337. $! End The Option File Check.
  338. $!
  339. $ ENDIF
  340. $!
  341. $! End The VAXC Check.
  342. $!
  343. $ ENDIF
  344. $!
  345. $! Check To See If We Need A GNU C Option File.
  346. $!
  347. $ IF (COMPILER.EQS."GNUC")
  348. $ THEN
  349. $!
  350. $! Check To See If We Already Have A GNU C Linker Option File.
  351. $!
  352. $ IF (F$SEARCH(OPT_FILE).EQS."")
  353. $ THEN
  354. $!
  355. $! We Need A GNU C Linker Option File.
  356. $!
  357. $ CREATE 'OPT_FILE'
  358. $DECK
  359. !
  360. ! Default System Options File To Link Agianst
  361. ! The Sharable C Runtime Library.
  362. !
  363. GNU_CC:[000000]GCCLIB/LIBRARY
  364. SYS$SHARE:VAXCRTL/SHARE
  365. $EOD
  366. $!
  367. $! End The Option File Check.
  368. $!
  369. $ ENDIF
  370. $!
  371. $! End The GNU C Check.
  372. $!
  373. $ ENDIF
  374. $!
  375. $! Check To See If We Need A DEC C Option File.
  376. $!
  377. $ IF (COMPILER.EQS."DECC")
  378. $ THEN
  379. $!
  380. $! Check To See If We Already Have A DEC C Linker Option File.
  381. $!
  382. $ IF (F$SEARCH(OPT_FILE).EQS."")
  383. $ THEN
  384. $!
  385. $! Figure Out If We Need An AXP Or A VAX Linker Option File.
  386. $!
  387. $ IF (ARCH.EQS."VAX")
  388. $ THEN
  389. $!
  390. $! We Need A DEC C Linker Option File For VAX.
  391. $!
  392. $ CREATE 'OPT_FILE'
  393. $DECK
  394. !
  395. ! Default System Options File To Link Agianst
  396. ! The Sharable DEC C Runtime Library.
  397. !
  398. SYS$SHARE:DECC$SHR.EXE/SHARE
  399. $EOD
  400. $!
  401. $! Else...
  402. $!
  403. $ ELSE
  404. $!
  405. $! Create The AXP Linker Option File.
  406. $!
  407. $ CREATE 'OPT_FILE'
  408. $DECK
  409. !
  410. ! Default System Options File For AXP To Link Agianst
  411. ! The Sharable C Runtime Library.
  412. !
  413. SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
  414. SYS$SHARE:CMA$OPEN_RTL/SHARE
  415. $EOD
  416. $!
  417. $! End The VAX/AXP DEC C Option File Check.
  418. $!
  419. $ ENDIF
  420. $!
  421. $! End The Option File Search.
  422. $!
  423. $ ENDIF
  424. $!
  425. $! End The DEC C Check.
  426. $!
  427. $ ENDIF
  428. $!
  429. $! Tell The User What Linker Option File We Are Using.
  430. $!
  431. $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
  432. $!
  433. $! Time To RETURN.
  434. $!
  435. $ RETURN
  436. $!
  437. $! Check To See If We Have The Appropiate Libraries.
  438. $!
  439. $ LIB_CHECK:
  440. $!
  441. $! Look For The Library LIBCRYPTO.OLB.
  442. $!
  443. $ IF (F$SEARCH(CRYPTO_LIB).EQS."")
  444. $ THEN
  445. $!
  446. $! Tell The User We Can't Find The LIBCRYPTO.OLB Library.
  447. $!
  448. $ WRITE SYS$OUTPUT ""
  449. $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"."
  450. $ WRITE SYS$OUTPUT "We Can't Link Without It."
  451. $ WRITE SYS$OUTPUT ""
  452. $!
  453. $! Since We Can't Link Without It, Exit.
  454. $!
  455. $ EXIT
  456. $!
  457. $! End The Crypto Library Check.
  458. $!
  459. $ ENDIF
  460. $!
  461. $! See If We Need The RSAREF Library...
  462. $!
  463. $ IF (RSAREF.EQS."TRUE")
  464. $ THEN
  465. $!
  466. $! Look For The Library LIBRSAGLUE.OLB.
  467. $!
  468. $ IF (F$SEARCH(RSAREF_LIB).EQS."")
  469. $ THEN
  470. $!
  471. $! Tell The User We Can't Find The LIBRSAGLUE.OLB Library.
  472. $!
  473. $ WRITE SYS$OUTPUT ""
  474. $ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"."
  475. $ WRITE SYS$OUTPUT "We Can't Link Without It."
  476. $ WRITE SYS$OUTPUT ""
  477. $!
  478. $! Since We Can't Link Without It, Exit.
  479. $!
  480. $ EXIT
  481. $ ENDIF
  482. $!
  483. $! End The RSAREF Library Check.
  484. $!
  485. $ ENDIF
  486. $!
  487. $! Look For The Library LIBSSL.OLB.
  488. $!
  489. $ IF (F$SEARCH(SSL_LIB).EQS."")
  490. $ THEN
  491. $!
  492. $! Tell The User We Can't Find The LIBSSL.OLB Library.
  493. $!
  494. $ WRITE SYS$OUTPUT ""
  495. $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"."
  496. $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It."
  497. $ WRITE SYS$OUTPUT ""
  498. $!
  499. $! Since We Can't Link Without It, Exit.
  500. $!
  501. $ EXIT
  502. $!
  503. $! End The SSL Library Check.
  504. $!
  505. $ ENDIF
  506. $!
  507. $! Time To Return.
  508. $!
  509. $ RETURN
  510. $!
  511. $! Check The User's Options.
  512. $!
  513. $ CHECK_OPTIONS:
  514. $!
  515. $! Check To See If P1 Is Blank.
  516. $!
  517. $ IF (P1.EQS."NORSAREF")
  518. $ THEN
  519. $!
  520. $! P1 Is NORSAREF, So Compile With The Regular RSA Libraries.
  521. $!
  522. $ RSAREF = "FALSE"
  523. $ ELSE
  524. $!
  525. $! Check To See If We Are To Use The RSAREF Library.
  526. $!
  527. $ IF (P1.EQS."RSAREF")
  528. $ THEN
  529. $!
  530. $! Check To Make Sure We Have The RSAREF Source Code Directory.
  531. $!
  532. $ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."")
  533. $ THEN
  534. $!
  535. $! We Don't Have The RSAREF Souce Code Directory, So Tell The
  536. $! User This.
  537. $!
  538. $ WRITE SYS$OUTPUT ""
  539. $ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code."
  540. $ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to"
  541. $ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the"
  542. $ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file"
  543. $ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory"
  544. $ WRITE SYS$OUTPUT "as that is where the scripts will look for the files."
  545. $ WRITE SYS$OUTPUT ""
  546. $!
  547. $! Time To Exit.
  548. $!
  549. $ EXIT
  550. $!
  551. $! Else, Compile Using The RSAREF Library.
  552. $!
  553. $ ELSE
  554. $ RSAREF = "TRUE"
  555. $ ENDIF
  556. $ ELSE
  557. $!
  558. $! They Entered An Invalid Option..
  559. $!
  560. $ WRITE SYS$OUTPUT ""
  561. $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
  562. $ WRITE SYS$OUTPUT ""
  563. $ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library."
  564. $ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library."
  565. $ WRITE SYS$OUTPUT ""
  566. $!
  567. $! Time To EXIT.
  568. $!
  569. $ EXIT
  570. $!
  571. $! End The Valid Arguement Check.
  572. $!
  573. $ ENDIF
  574. $!
  575. $! End The P1 Check.
  576. $!
  577. $ ENDIF
  578. $!
  579. $! Check To See If P2 Is Blank.
  580. $!
  581. $ IF (P2.EQS."NODEBUG")
  582. $ THEN
  583. $!
  584. $! P2 Is NODEBUG, So Compile Without Debugger Information.
  585. $!
  586. $ DEBUGGER = "NODEBUG"
  587. $ TRACEBACK = "NOTRACEBACK"
  588. $ GCC_OPTIMIZE = "OPTIMIZE"
  589. $ CC_OPTIMIZE = "OPTIMIZE"
  590. $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
  591. $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
  592. $!
  593. $! Else...
  594. $!
  595. $ ELSE
  596. $!
  597. $! Check To See If We Are To Compile With Debugger Information.
  598. $!
  599. $ IF (P2.EQS."DEBUG")
  600. $ THEN
  601. $!
  602. $! Compile With Debugger Information.
  603. $!
  604. $ DEBUGGER = "DEBUG"
  605. $ TRACEBACK = "TRACEBACK"
  606. $ GCC_OPTIMIZE = "NOOPTIMIZE"
  607. $ CC_OPTIMIZE = "NOOPTIMIZE"
  608. $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
  609. $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
  610. $!
  611. $! Else...
  612. $!
  613. $ ELSE
  614. $!
  615. $! Tell The User Entered An Invalid Option..
  616. $!
  617. $ WRITE SYS$OUTPUT ""
  618. $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
  619. $ WRITE SYS$OUTPUT ""
  620. $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
  621. $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
  622. $ WRITE SYS$OUTPUT ""
  623. $!
  624. $! Time To EXIT.
  625. $!
  626. $ EXIT
  627. $!
  628. $! End The Valid Arguement Check.
  629. $!
  630. $ ENDIF
  631. $!
  632. $! End The P3 Check.
  633. $!
  634. $ ENDIF
  635. $!
  636. $! Check To See If P3 Is Blank.
  637. $!
  638. $ IF (P3.EQS."")
  639. $ THEN
  640. $!
  641. $! O.K., The User Didn't Specify A Compiler, Let's Try To
  642. $! Find Out Which One To Use.
  643. $!
  644. $! Check To See If We Have GNU C.
  645. $!
  646. $ IF (F$TRNLNM("GNU_CC").NES."")
  647. $ THEN
  648. $!
  649. $! Looks Like GNUC, Set To Use GNUC.
  650. $!
  651. $ P3 = "GNUC"
  652. $!
  653. $! End The GNU C Compiler Check.
  654. $!
  655. $ ELSE
  656. $!
  657. $! Check To See If We Have VAXC Or DECC.
  658. $!
  659. $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
  660. $ THEN
  661. $!
  662. $! Looks Like DECC, Set To Use DECC.
  663. $!
  664. $ P3 = "DECC"
  665. $!
  666. $! Else...
  667. $!
  668. $ ELSE
  669. $!
  670. $! Looks Like VAXC, Set To Use VAXC.
  671. $!
  672. $ P3 = "VAXC"
  673. $!
  674. $! End The VAXC Compiler Check.
  675. $!
  676. $ ENDIF
  677. $!
  678. $! End The DECC & VAXC Compiler Check.
  679. $!
  680. $ ENDIF
  681. $!
  682. $! End The Compiler Check.
  683. $!
  684. $ ENDIF
  685. $!
  686. $! Check To See If We Have A Option For P4.
  687. $!
  688. $ IF (P4.EQS."")
  689. $ THEN
  690. $!
  691. $! Find out what socket library we have available
  692. $!
  693. $ IF F$PARSE("SOCKETSHR:") .NES. ""
  694. $ THEN
  695. $!
  696. $! We have SOCKETSHR, and it is my opinion that it's the best to use.
  697. $!
  698. $ P4 = "SOCKETSHR"
  699. $!
  700. $! Tell the user
  701. $!
  702. $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
  703. $!
  704. $! Else, let's look for something else
  705. $!
  706. $ ELSE
  707. $!
  708. $! Like UCX (the reason to do this before Multinet is that the UCX
  709. $! emulation is easier to use...)
  710. $!
  711. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
  712. .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
  713. .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
  714. $ THEN
  715. $!
  716. $! Last resort: a UCX or UCX-compatible library
  717. $!
  718. $ P4 = "UCX"
  719. $!
  720. $! Tell the user
  721. $!
  722. $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
  723. $!
  724. $! That was all...
  725. $!
  726. $ ENDIF
  727. $ ENDIF
  728. $ ENDIF
  729. $!
  730. $! Set Up Initial CC Definitions, Possibly With User Ones
  731. $!
  732. $ CCDEFS = "VMS=1,TCPIP_TYPE_''P4',THREADS"
  733. $ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM"
  734. $ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA"
  735. $ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA"
  736. $ IF F$TRNLNM("OPENSSL_NO_DH") THEN CCDEFS = CCDEFS + ",NO_DH"
  737. $ IF F$TRNLNM("OPENSSL_NO_MD2") THEN CCDEFS = CCDEFS + ",NO_MD2"
  738. $ IF F$TRNLNM("OPENSSL_NO_MD5") THEN CCDEFS = CCDEFS + ",NO_MD5"
  739. $ IF F$TRNLNM("OPENSSL_NO_RIPEMD") THEN CCDEFS = CCDEFS + ",NO_RIPEMD"
  740. $ IF F$TRNLNM("OPENSSL_NO_SHA") THEN CCDEFS = CCDEFS + ",NO_SHA"
  741. $ IF F$TRNLNM("OPENSSL_NO_SHA0") THEN CCDEFS = CCDEFS + ",NO_SHA0"
  742. $ IF F$TRNLNM("OPENSSL_NO_SHA1") THEN CCDEFS = CCDEFS + ",NO_SHA1"
  743. $ IF F$TRNLNM("OPENSSL_NO_DES")
  744. $ THEN
  745. $ CCDEFS = CCDEFS + ",NO_DES,NO_MDC2"
  746. $ ELSE
  747. $ IF F$TRNLNM("OPENSSL_NO_MDC2") THEN CCDEFS = CCDEFS + ",NO_MDC2"
  748. $ ENDIF
  749. $ IF F$TRNLNM("OPENSSL_NO_RC2") THEN CCDEFS = CCDEFS + ",NO_RC2"
  750. $ IF F$TRNLNM("OPENSSL_NO_RC4") THEN CCDEFS = CCDEFS + ",NO_RC4"
  751. $ IF F$TRNLNM("OPENSSL_NO_RC5") THEN CCDEFS = CCDEFS + ",NO_RC5"
  752. $ IF F$TRNLNM("OPENSSL_NO_IDEA") THEN CCDEFS = CCDEFS + ",NO_IDEA"
  753. $ IF F$TRNLNM("OPENSSL_NO_BF") THEN CCDEFS = CCDEFS + ",NO_BF"
  754. $ IF F$TRNLNM("OPENSSL_NO_CAST") THEN CCDEFS = CCDEFS + ",NO_CAST"
  755. $ IF F$TRNLNM("OPENSSL_NO_HMAC") THEN CCDEFS = CCDEFS + ",NO_HMAC"
  756. $ IF F$TRNLNM("OPENSSL_NO_SSL2") THEN CCDEFS = CCDEFS + ",NO_SSL2"
  757. $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
  758. $ CCEXTRAFLAGS = ""
  759. $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
  760. $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
  761. $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
  762. CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
  763. $!
  764. $! Check To See If The User Entered A Valid Paramter.
  765. $!
  766. $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
  767. $ THEN
  768. $!
  769. $! Check To See If The User Wanted DECC.
  770. $!
  771. $ IF (P3.EQS."DECC")
  772. $ THEN
  773. $!
  774. $! Looks Like DECC, Set To Use DECC.
  775. $!
  776. $ COMPILER = "DECC"
  777. $!
  778. $! Tell The User We Are Using DECC.
  779. $!
  780. $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
  781. $!
  782. $! Use DECC...
  783. $!
  784. $ CC = "CC"
  785. $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
  786. THEN CC = "CC/DECC"
  787. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
  788. "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS
  789. $!
  790. $! Define The Linker Options File Name.
  791. $!
  792. $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
  793. $!
  794. $! End DECC Check.
  795. $!
  796. $ ENDIF
  797. $!
  798. $! Check To See If We Are To Use VAXC.
  799. $!
  800. $ IF (P3.EQS."VAXC")
  801. $ THEN
  802. $!
  803. $! Looks Like VAXC, Set To Use VAXC.
  804. $!
  805. $ COMPILER = "VAXC"
  806. $!
  807. $! Tell The User We Are Using VAX C.
  808. $!
  809. $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
  810. $!
  811. $! Compile Using VAXC.
  812. $!
  813. $ CC = "CC"
  814. $ IF ARCH.EQS."AXP"
  815. $ THEN
  816. $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
  817. $ EXIT
  818. $ ENDIF
  819. $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
  820. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
  821. $ CCDEFS = CCDEFS + ",""VAXC"""
  822. $!
  823. $! Define <sys> As SYS$COMMON:[SYSLIB]
  824. $!
  825. $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
  826. $!
  827. $! Define The Linker Options File Name.
  828. $!
  829. $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
  830. $!
  831. $! End VAXC Check
  832. $!
  833. $ ENDIF
  834. $!
  835. $! Check To See If We Are To Use GNU C.
  836. $!
  837. $ IF (P3.EQS."GNUC")
  838. $ THEN
  839. $!
  840. $! Looks Like GNUC, Set To Use GNUC.
  841. $!
  842. $ COMPILER = "GNUC"
  843. $!
  844. $! Tell The User We Are Using GNUC.
  845. $!
  846. $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
  847. $!
  848. $! Use GNU C...
  849. $!
  850. $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
  851. $!
  852. $! Define The Linker Options File Name.
  853. $!
  854. $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
  855. $!
  856. $! End The GNU C Check.
  857. $!
  858. $ ENDIF
  859. $!
  860. $! Set up default defines
  861. $!
  862. $ CCDEFS = """FLAT_INC=1""," + CCDEFS
  863. $!
  864. $! Check To See If We Are To Compile With RSAREF Routines.
  865. $!
  866. $ IF (RSAREF.EQS."TRUE")
  867. $ THEN
  868. $!
  869. $! Compile With RSAREF.
  870. $!
  871. $ CCDEFS = CCDEFS + ",""RSAref=1"""
  872. $!
  873. $! Tell The User This.
  874. $!
  875. $ WRITE SYS$OUTPUT "Compiling With RSAREF Routines."
  876. $!
  877. $! Else, We Don't Care. Compile Without The RSAREF Library.
  878. $!
  879. $ ELSE
  880. $!
  881. $! Tell The User We Are Compile Without The RSAREF Routines.
  882. $!
  883. $ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines.
  884. $!
  885. $! End The RSAREF Check.
  886. $!
  887. $ ENDIF
  888. $!
  889. $! Finish up the definition of CC.
  890. $!
  891. $ IF COMPILER .EQS. "DECC"
  892. $ THEN
  893. $ IF CCDISABLEWARNINGS .EQS. ""
  894. $ THEN
  895. $ CC4DISABLEWARNINGS = "DOLLARID"
  896. $ ELSE
  897. $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID"
  898. $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
  899. $ ENDIF
  900. $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))"
  901. $ ELSE
  902. $ CCDISABLEWARNINGS = ""
  903. $ CC4DISABLEWARNINGS = ""
  904. $ ENDIF
  905. $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
  906. $!
  907. $! Show user the result
  908. $!
  909. $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
  910. $!
  911. $! Else The User Entered An Invalid Arguement.
  912. $!
  913. $ ELSE
  914. $!
  915. $! Tell The User We Don't Know What They Want.
  916. $!
  917. $ WRITE SYS$OUTPUT ""
  918. $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
  919. $ WRITE SYS$OUTPUT ""
  920. $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
  921. $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
  922. $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
  923. $ WRITE SYS$OUTPUT ""
  924. $!
  925. $! Time To EXIT.
  926. $!
  927. $ EXIT
  928. $ ENDIF
  929. $!
  930. $! Time to check the contents, and to make sure we get the correct library.
  931. $!
  932. $ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX"
  933. $ THEN
  934. $!
  935. $! Check to see if SOCKETSHR was chosen
  936. $!
  937. $ IF P4.EQS."SOCKETSHR"
  938. $ THEN
  939. $!
  940. $! Set the library to use SOCKETSHR
  941. $!
  942. $ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT"
  943. $!
  944. $! Done with SOCKETSHR
  945. $!
  946. $ ENDIF
  947. $!
  948. $! Check to see if MULTINET was chosen
  949. $!
  950. $ IF P4.EQS."MULTINET"
  951. $ THEN
  952. $!
  953. $! Set the library to use UXC emulation.
  954. $!
  955. $ P4 = "UCX"
  956. $!
  957. $! Done with MULTINET
  958. $!
  959. $ ENDIF
  960. $!
  961. $! Check to see if UCX was chosen
  962. $!
  963. $ IF P4.EQS."UCX"
  964. $ THEN
  965. $!
  966. $! Set the library to use UCX.
  967. $!
  968. $ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT"
  969. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
  970. $ THEN
  971. $ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
  972. $ ELSE
  973. $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
  974. TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT"
  975. $ ENDIF
  976. $!
  977. $! Done with UCX
  978. $!
  979. $ ENDIF
  980. $!
  981. $! Print info
  982. $!
  983. $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
  984. $!
  985. $! Else The User Entered An Invalid Arguement.
  986. $!
  987. $ ELSE
  988. $!
  989. $! Tell The User We Don't Know What They Want.
  990. $!
  991. $ WRITE SYS$OUTPUT ""
  992. $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
  993. $ WRITE SYS$OUTPUT ""
  994. $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
  995. $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
  996. $ WRITE SYS$OUTPUT ""
  997. $!
  998. $! Time To EXIT.
  999. $!
  1000. $ EXIT
  1001. $!
  1002. $! Done with TCP/IP libraries
  1003. $!
  1004. $ ENDIF
  1005. $!
  1006. $! Special Threads For OpenVMS v7.1 Or Later
  1007. $!
  1008. $! Written By: Richard Levitte
  1009. $! richard@levitte.org
  1010. $!
  1011. $!
  1012. $! Check To See If We Have A Option For P5.
  1013. $!
  1014. $ IF (P5.EQS."")
  1015. $ THEN
  1016. $!
  1017. $! Get The Version Of VMS We Are Using.
  1018. $!
  1019. $ ISSEVEN :=
  1020. $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
  1021. $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
  1022. $!
  1023. $! Check To See If The VMS Version Is v7.1 Or Later.
  1024. $!
  1025. $ IF (TMP.GE.71)
  1026. $ THEN
  1027. $!
  1028. $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
  1029. $!
  1030. $ ISSEVEN := ,PTHREAD_USE_D4
  1031. $!
  1032. $! End The VMS Version Check.
  1033. $!
  1034. $ ENDIF
  1035. $!
  1036. $! End The P5 Check.
  1037. $!
  1038. $ ENDIF
  1039. $!
  1040. $! Time To RETURN...
  1041. $!
  1042. $ RETURN
  1043. $!
  1044. $ INITIALISE:
  1045. $!
  1046. $! Save old value of the logical name OPENSSL
  1047. $!
  1048. $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
  1049. $!
  1050. $! Save directory information
  1051. $!
  1052. $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
  1053. $ __HERE = F$EDIT(__HERE,"UPCASE")
  1054. $ __TOP = __HERE - "TEST]"
  1055. $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
  1056. $!
  1057. $! Set up the logical name OPENSSL to point at the include directory
  1058. $!
  1059. $ DEFINE OPENSSL/NOLOG '__INCLUDE'
  1060. $!
  1061. $! Done
  1062. $!
  1063. $ RETURN
  1064. $!
  1065. $ CLEANUP:
  1066. $!
  1067. $! Restore the logical name OPENSSL if it had a value
  1068. $!
  1069. $ IF __SAVE_OPENSSL .EQS. ""
  1070. $ THEN
  1071. $ DEASSIGN OPENSSL
  1072. $ ELSE
  1073. $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
  1074. $ ENDIF
  1075. $!
  1076. $! Done
  1077. $!
  1078. $ RETURN