ssl-lib.com 23 KB

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