maketests.com 19 KB

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