ssl-lib.com 22 KB

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