maketests.com 19 KB

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