ssl-lib.com 22 KB

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