maketests.com 19 KB

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