makeengines.com 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. $!
  2. $! MAKEAPPS.COM
  3. $! Written By: Richard Levitte
  4. $! richard@levitte.org
  5. $!
  6. $! This command file compiles and creates the various engines in form
  7. $! of shared images. They are placed in [.xxx.EXE.ENGINES], where "xxx"
  8. $! is either AXP or VAX depending on your hardware.
  9. $!
  10. $! P1 if this is ENGINES or ALL, the engines will build, otherwise not.
  11. $!
  12. $! P2 DEBUG or NODEBUG to compile with or without debugger information.
  13. $!
  14. $! P3 VAXC for VAX C
  15. $! DECC for DEC C
  16. $! GNUC for GNU C (untested)
  17. $!
  18. $! P4 if defined, sets the TCP/IP libraries to use. UCX or TCPIP is
  19. $! used by default since most other implementations come with a
  20. $! compatibility library. The value must be one of the following:
  21. $!
  22. $! UCX for UCX
  23. $! SOCKETSHR for SOCKETSHR+NETLIB
  24. $! TCPIP for TCPIP (post UCX)
  25. $!
  26. $! P5 if defined, tells the compiler not to use special threads.
  27. $!
  28. $! P6 if defined, denotes which engines to build. If not defined,
  29. $! all available engines are built.
  30. $!
  31. $!-----------------------------------------------------------------------------
  32. $!
  33. $! Set the names of the engines we want to build
  34. $!
  35. $ ENGINES = "," + P6
  36. $ IF ENGINES .EQS. "," THEN -
  37. ENGINES = ",4758cca,aep,atalla,cswift,chil,nuron,sureware,ubsec"
  38. $!
  39. $! Set the default TCP/IP library to link against if needed
  40. $!
  41. $ TCPIP_LIB = ""
  42. $!
  43. $! Set the architecture name
  44. $!
  45. $ ARCH := VAX
  46. $ IF F$GETSYI("CPU") .GE. 128 THEN ARCH := AXP
  47. $!
  48. $! Set the goal directories, and creat them if necessary
  49. $!
  50. $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.ENGINES]
  51. $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.ENGINES]
  52. $ IF F$PARSE(OBJ_DIR) .EQS. "" THEN CREATE/DIRECTORY 'OBJ_DIR'
  53. $ IF F$PARSE(EXE_DIR) .EQS. "" THEN CREATE/DIRECTORY 'EXE_DIR'
  54. $!
  55. $! Set the goal files, and create them if necessary
  56. $!
  57. $ CRYPTO_LIB :=SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
  58. $ CRYPTO_EXE :=SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.EXE
  59. $ IF F$SEARCH(CRYPTO_LIB) .EQS. "" THEN LIBRARY/CREATE/OBJECT 'CRYPTO_LIB'
  60. $!
  61. $! OK, time to check options and initialise
  62. $!
  63. $ OPT_PHASE = P1
  64. $ ACCEPT_PHASE = "ALL,ENGINES"
  65. $ OPT_DEBUG = P2
  66. $ OPT_COMPILER = P3
  67. $ OPT_TCPIP_LIB = P4
  68. $ OPT_SPECIAL_THREADS = P5
  69. $
  70. $ GOSUB CHECK_OPTIONS
  71. $ GOSUB INITIALISE
  72. $ GOSUB CHECK_OPT_FILE
  73. $!
  74. $! Define what goes into each engine
  75. $!
  76. $ ENGINE_ = ""
  77. $ IF ARCH .EQS. "VAX"
  78. $ THEN
  79. $ ENGINE_ = "engine_vector.mar"
  80. $ EXTRA_OBJ := ,'OBJ_DIR'ENGINE_VECTOR.OBJ
  81. $ ENDIF
  82. $ ENGINE_4758CCA = "e_4758cca"
  83. $ ENGINE_aep = "e_aep"
  84. $ ENGINE_atalla = "e_atalla"
  85. $ ENGINE_cswift = "e_cswift"
  86. $ ENGINE_chil = "e_chil"
  87. $ ENGINE_nuron = "e_nuron"
  88. $ ENGINE_sureware = "e_sureware"
  89. $ ENGINE_ubsec = "e_ubsec"
  90. $!
  91. $! Define which programs need to be linked with a TCP/IP library
  92. $!
  93. $ TCPIP_ENGINES = ",,"
  94. $ IF COMPILER .EQS. "VAXC" THEN -
  95. TCPIP_ENGINES = ",,"
  96. $!
  97. $! Set up two loops, one that keeps track of the engines,
  98. $! and one that keeps track of all the files going into
  99. $! the current engine.
  100. $!
  101. $! Here's the start of the engine loop.
  102. $!
  103. $ ENGINE_COUNTER = 0
  104. $ ENGINE_NEXT:
  105. $!
  106. $! Extract the current engine name, and if we've reached the end, stop
  107. $!
  108. $ ENGINE_NAME = F$ELEMENT(ENGINE_COUNTER,",",ENGINES)
  109. $ IF (ENGINE_NAME.EQS.",") THEN GOTO ENGINE_DONE
  110. $!
  111. $ ENGINE_COUNTER = ENGINE_COUNTER + 1
  112. $!
  113. $! Set up the engine library names.
  114. $!
  115. $ LIB_ENGINE = "ENGINE_" + ENGINE_NAME
  116. $!
  117. $! Check if the library module name actually is defined
  118. $!
  119. $ IF F$TYPE('LIB_ENGINE') .EQS. ""
  120. $ THEN
  121. $ WRITE SYS$ERROR ""
  122. $ WRITE SYS$ERROR "The module ",ENGINE_NAME," does not exist. Continuing..."
  123. $ WRITE SYS$ERROR ""
  124. $ GOTO ENGINE_NEXT
  125. $ ENDIF
  126. $!
  127. $! Talk to the user
  128. $!
  129. $ IF ENGINE_NAME .NES. ""
  130. $ THEN
  131. $ WRITE SYS$OUTPUT "Compiling The ",ENGINE_NAME," Library Files. (",BUILDALL,")"
  132. $ ELSE
  133. $ WRITE SYS$OUTPUT "Compiling Support Files. (",BUILDALL,")"
  134. $ ENDIF
  135. $!
  136. $! Here's the start of per-engine module loop.
  137. $!
  138. $ FILE_COUNTER = 0
  139. $ FILE_NEXT:
  140. $!
  141. $! Extract the file name from the file list, and if we've reached the end, stop
  142. $!
  143. $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_ENGINE')
  144. $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE
  145. $!
  146. $ FILE_COUNTER = FILE_COUNTER + 1
  147. $!
  148. $ IF FILE_NAME .EQS. "" THEN GOTO FILE_NEXT
  149. $!
  150. $! Set up the source and object reference
  151. $!
  152. $ SOURCE_FILE = F$PARSE(FILE_NAME,"SYS$DISK:[].C",,,"SYNTAX_ONLY")
  153. $ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ"
  154. $!
  155. $! If we get some problem, we just go on trying to build the next module.
  156. $ ON WARNING THEN GOTO FILE_NEXT
  157. $!
  158. $! Check if the module we want to compile is actually there.
  159. $!
  160. $ IF F$SEARCH(SOURCE_FILE) .EQS. ""
  161. $ THEN
  162. $ WRITE SYS$OUTPUT ""
  163. $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
  164. $ WRITE SYS$OUTPUT ""
  165. $ GOTO EXIT
  166. $ ENDIF
  167. $!
  168. $! Talk to the user.
  169. $!
  170. $ WRITE SYS$OUTPUT " ",FILE_NAME,""
  171. $!
  172. $! Do the dirty work.
  173. $!
  174. $ ON ERROR THEN GOTO FILE_NEXT
  175. $ IF FILE_NAME - ".MAR" .NES. FILE_NAME
  176. $ THEN
  177. $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  178. $ ELSE
  179. $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
  180. $ ENDIF
  181. $!
  182. $! Now, there are two ways to handle this. We can either build
  183. $! shareable images or stick the engine object file into libcrypto.
  184. $! For now, the latter is NOT supported.
  185. $!
  186. $!!!!! LIBRARY/REPLACE 'CRYPTO_LIB' 'OBJECT_FILE'
  187. $!
  188. $! For shareable libraries, we need to do things a little differently
  189. $! depending on if we link with a TCP/IP library or not.
  190. $!
  191. $ ENGINE_OPT := SYS$DISK:[]'ARCH'.OPT
  192. $ IF TCPIP_LIB .NES. ""
  193. $ THEN
  194. $ LINK/'DEBUGGER'/'TRACEBACK' /SHARE='EXE_DIR''ENGINE_NAME'.EXE -
  195. 'OBJECT_FILE''EXTRA_OBJ', -
  196. 'CRYPTO_LIB'/LIBRARY, -
  197. 'ENGINE_OPT'/OPTION,'TCPIP_LIB','OPT_FILE'/OPTION
  198. $ ELSE
  199. $ LINK/'DEBUGGER'/'TRACEBACK' /SHARE='EXE_DIR''ENGINE_NAME'.EXE -
  200. 'OBJECT_FILE''EXTRA_OBJ', -
  201. 'CRYPTO_LIB'/LIBRARY, -
  202. 'ENGINE_OPT'/OPTION,'OPT_FILE'/OPTION
  203. $ ENDIF
  204. $!
  205. $! Clean up
  206. $!
  207. $ DELETE 'OBJECT_FILE';*
  208. $!
  209. $! Next file
  210. $!
  211. $ GOTO FILE_NEXT
  212. $!
  213. $ FILE_DONE:
  214. $!
  215. $! Next engine
  216. $!
  217. $ GOTO ENGINE_NEXT
  218. $!
  219. $ ENGINE_DONE:
  220. $!
  221. $! Talk to the user
  222. $!
  223. $ WRITE SYS$OUTPUT "All Done..."
  224. $ EXIT:
  225. $ GOSUB CLEANUP
  226. $ EXIT
  227. $!
  228. $! Check For The Link Option FIle.
  229. $!
  230. $ CHECK_OPT_FILE:
  231. $!
  232. $! Check To See If We Need To Make A VAX C Option File.
  233. $!
  234. $ IF (COMPILER.EQS."VAXC")
  235. $ THEN
  236. $!
  237. $! Check To See If We Already Have A VAX C Linker Option File.
  238. $!
  239. $ IF (F$SEARCH(OPT_FILE).EQS."")
  240. $ THEN
  241. $!
  242. $! We Need A VAX C Linker Option File.
  243. $!
  244. $ CREATE 'OPT_FILE'
  245. $DECK
  246. !
  247. ! Default System Options File To Link Agianst
  248. ! The Sharable VAX C Runtime Library.
  249. !
  250. SYS$SHARE:VAXCRTL.EXE/SHARE
  251. $EOD
  252. $!
  253. $! End The Option File Check.
  254. $!
  255. $ ENDIF
  256. $!
  257. $! End The VAXC Check.
  258. $!
  259. $ ENDIF
  260. $!
  261. $! Check To See If We Need A GNU C Option File.
  262. $!
  263. $ IF (COMPILER.EQS."GNUC")
  264. $ THEN
  265. $!
  266. $! Check To See If We Already Have A GNU C Linker Option File.
  267. $!
  268. $ IF (F$SEARCH(OPT_FILE).EQS."")
  269. $ THEN
  270. $!
  271. $! We Need A GNU C Linker Option File.
  272. $!
  273. $ CREATE 'OPT_FILE'
  274. $DECK
  275. !
  276. ! Default System Options File To Link Agianst
  277. ! The Sharable C Runtime Library.
  278. !
  279. GNU_CC:[000000]GCCLIB/LIBRARY
  280. SYS$SHARE:VAXCRTL/SHARE
  281. $EOD
  282. $!
  283. $! End The Option File Check.
  284. $!
  285. $ ENDIF
  286. $!
  287. $! End The GNU C Check.
  288. $!
  289. $ ENDIF
  290. $!
  291. $! Check To See If We Need A DEC C Option File.
  292. $!
  293. $ IF (COMPILER.EQS."DECC")
  294. $ THEN
  295. $!
  296. $! Check To See If We Already Have A DEC C Linker Option File.
  297. $!
  298. $ IF (F$SEARCH(OPT_FILE).EQS."")
  299. $ THEN
  300. $!
  301. $! Figure Out If We Need An AXP Or A VAX Linker Option File.
  302. $!
  303. $ IF ARCH .EQS. "VAX"
  304. $ THEN
  305. $!
  306. $! We Need A DEC C Linker Option File For VAX.
  307. $!
  308. $ CREATE 'OPT_FILE'
  309. $DECK
  310. !
  311. ! Default System Options File To Link Agianst
  312. ! The Sharable DEC C Runtime Library.
  313. !
  314. SYS$SHARE:DECC$SHR.EXE/SHARE
  315. $EOD
  316. $!
  317. $! Else...
  318. $!
  319. $ ELSE
  320. $!
  321. $! Create The AXP Linker Option File.
  322. $!
  323. $ CREATE 'OPT_FILE'
  324. $DECK
  325. !
  326. ! Default System Options File For AXP To Link Agianst
  327. ! The Sharable C Runtime Library.
  328. !
  329. SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
  330. SYS$SHARE:CMA$OPEN_RTL/SHARE
  331. $EOD
  332. $!
  333. $! End The VAX/AXP DEC C Option File Check.
  334. $!
  335. $ ENDIF
  336. $!
  337. $! End The Option File Search.
  338. $!
  339. $ ENDIF
  340. $!
  341. $! End The DEC C Check.
  342. $!
  343. $ ENDIF
  344. $!
  345. $! Tell The User What Linker Option File We Are Using.
  346. $!
  347. $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"."
  348. $!
  349. $! Time To RETURN.
  350. $!
  351. $ RETURN
  352. $!
  353. $! Check The User's Options.
  354. $!
  355. $ CHECK_OPTIONS:
  356. $!
  357. $! Check To See If OPT_PHASE Is Blank.
  358. $!
  359. $ IF (OPT_PHASE.EQS."ALL")
  360. $ THEN
  361. $!
  362. $! OPT_PHASE Is Blank, So Build Everything.
  363. $!
  364. $ BUILDALL = "ALL"
  365. $!
  366. $! Else...
  367. $!
  368. $ ELSE
  369. $!
  370. $! Else, Check To See If OPT_PHASE Has A Valid Arguement.
  371. $!
  372. $ IF ("," + ACCEPT_PHASE + ",") - ("," + OPT_PHASE + ",") -
  373. .NES. ("," + ACCEPT_PHASE + ",")
  374. $ THEN
  375. $!
  376. $! A Valid Arguement.
  377. $!
  378. $ BUILDALL = OPT_PHASE
  379. $!
  380. $! Else...
  381. $!
  382. $ ELSE
  383. $!
  384. $! Tell The User We Don't Know What They Want.
  385. $!
  386. $ WRITE SYS$OUTPUT ""
  387. $ WRITE SYS$OUTPUT "The option ",OPT_PHASE," is invalid. The valid options are:"
  388. $ WRITE SYS$OUTPUT ""
  389. $ IF ("," + ACCEPT_PHASE + ",") - ",ALL," -
  390. .NES. ("," + ACCEPT_PHASE + ",") THEN -
  391. WRITE SYS$OUTPUT " ALL : just build everything."
  392. $ IF ("," + ACCEPT_PHASE + ",") - ",ENGINES," -
  393. .NES. ("," + ACCEPT_PHASE + ",") THEN -
  394. WRITE SYS$OUTPUT " ENGINES : to compile just the [.xxx.EXE.ENGINES]*.EXE hareable images."
  395. $ WRITE SYS$OUTPUT ""
  396. $ WRITE SYS$OUTPUT " where 'xxx' stands for:"
  397. $ WRITE SYS$OUTPUT ""
  398. $ WRITE SYS$OUTPUT " AXP : Alpha architecture."
  399. $ WRITE SYS$OUTPUT " VAX : VAX architecture."
  400. $ WRITE SYS$OUTPUT ""
  401. $!
  402. $! Time To EXIT.
  403. $!
  404. $ EXIT
  405. $!
  406. $! End The Valid Arguement Check.
  407. $!
  408. $ ENDIF
  409. $!
  410. $! End The OPT_PHASE Check.
  411. $!
  412. $ ENDIF
  413. $!
  414. $! Check To See If OPT_DEBUG Is Blank.
  415. $!
  416. $ IF (OPT_DEBUG.EQS."NODEBUG")
  417. $ THEN
  418. $!
  419. $! OPT_DEBUG Is NODEBUG, So Compile Without The Debugger Information.
  420. $!
  421. $ DEBUGGER = "NODEBUG"
  422. $ TRACEBACK = "NOTRACEBACK"
  423. $ GCC_OPTIMIZE = "OPTIMIZE"
  424. $ CC_OPTIMIZE = "OPTIMIZE"
  425. $ MACRO_OPTIMIZE = "OPTIMIZE"
  426. $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile."
  427. $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization."
  428. $ ELSE
  429. $!
  430. $! Check To See If We Are To Compile With Debugger Information.
  431. $!
  432. $ IF (OPT_DEBUG.EQS."DEBUG")
  433. $ THEN
  434. $!
  435. $! Compile With Debugger Information.
  436. $!
  437. $ DEBUGGER = "DEBUG"
  438. $ TRACEBACK = "TRACEBACK"
  439. $ GCC_OPTIMIZE = "NOOPTIMIZE"
  440. $ CC_OPTIMIZE = "NOOPTIMIZE"
  441. $ MACRO_OPTIMIZE = "NOOPTIMIZE"
  442. $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile."
  443. $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization."
  444. $ ELSE
  445. $!
  446. $! They Entered An Invalid Option..
  447. $!
  448. $ WRITE SYS$OUTPUT ""
  449. $ WRITE SYS$OUTPUT "The Option ",OPT_DEBUG," Is Invalid. The Valid Options Are:"
  450. $ WRITE SYS$OUTPUT ""
  451. $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
  452. $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
  453. $ WRITE SYS$OUTPUT ""
  454. $!
  455. $! Time To EXIT.
  456. $!
  457. $ EXIT
  458. $!
  459. $! End The Valid Arguement Check.
  460. $!
  461. $ ENDIF
  462. $!
  463. $! End The OPT_DEBUG Check.
  464. $!
  465. $ ENDIF
  466. $!
  467. $! Special Threads For OpenVMS v7.1 Or Later
  468. $!
  469. $! Written By: Richard Levitte
  470. $! richard@levitte.org
  471. $!
  472. $!
  473. $! Check To See If We Have A Option For OPT_SPECIAL_THREADS.
  474. $!
  475. $ IF (OPT_SPECIAL_THREADS.EQS."")
  476. $ THEN
  477. $!
  478. $! Get The Version Of VMS We Are Using.
  479. $!
  480. $ ISSEVEN :=
  481. $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION")))
  482. $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP))
  483. $!
  484. $! Check To See If The VMS Version Is v7.1 Or Later.
  485. $!
  486. $ IF (TMP.GE.71)
  487. $ THEN
  488. $!
  489. $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads.
  490. $!
  491. $ ISSEVEN := ,PTHREAD_USE_D4
  492. $!
  493. $! End The VMS Version Check.
  494. $!
  495. $ ENDIF
  496. $!
  497. $! End The OPT_SPECIAL_THREADS Check.
  498. $!
  499. $ ENDIF
  500. $!
  501. $! Check To See If OPT_COMPILER Is Blank.
  502. $!
  503. $ IF (OPT_COMPILER.EQS."")
  504. $ THEN
  505. $!
  506. $! O.K., The User Didn't Specify A Compiler, Let's Try To
  507. $! Find Out Which One To Use.
  508. $!
  509. $! Check To See If We Have GNU C.
  510. $!
  511. $ IF (F$TRNLNM("GNU_CC").NES."")
  512. $ THEN
  513. $!
  514. $! Looks Like GNUC, Set To Use GNUC.
  515. $!
  516. $ OPT_COMPILER = "GNUC"
  517. $!
  518. $! Else...
  519. $!
  520. $ ELSE
  521. $!
  522. $! Check To See If We Have VAXC Or DECC.
  523. $!
  524. $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
  525. $ THEN
  526. $!
  527. $! Looks Like DECC, Set To Use DECC.
  528. $!
  529. $ OPT_COMPILER = "DECC"
  530. $!
  531. $! Else...
  532. $!
  533. $ ELSE
  534. $!
  535. $! Looks Like VAXC, Set To Use VAXC.
  536. $!
  537. $ OPT_COMPILER = "VAXC"
  538. $!
  539. $! End The VAXC Compiler Check.
  540. $!
  541. $ ENDIF
  542. $!
  543. $! End The DECC & VAXC Compiler Check.
  544. $!
  545. $ ENDIF
  546. $!
  547. $! End The Compiler Check.
  548. $!
  549. $ ENDIF
  550. $!
  551. $! Check To See If We Have A Option For OPT_TCPIP_LIB.
  552. $!
  553. $ IF (OPT_TCPIP_LIB.EQS."")
  554. $ THEN
  555. $!
  556. $! Find out what socket library we have available
  557. $!
  558. $ IF F$PARSE("SOCKETSHR:") .NES. ""
  559. $ THEN
  560. $!
  561. $! We have SOCKETSHR, and it is my opinion that it's the best to use.
  562. $!
  563. $ OPT_TCPIP_LIB = "SOCKETSHR"
  564. $!
  565. $! Tell the user
  566. $!
  567. $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP"
  568. $!
  569. $! Else, let's look for something else
  570. $!
  571. $ ELSE
  572. $!
  573. $! Like UCX (the reason to do this before Multinet is that the UCX
  574. $! emulation is easier to use...)
  575. $!
  576. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" -
  577. .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" -
  578. .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. ""
  579. $ THEN
  580. $!
  581. $! Last resort: a UCX or UCX-compatible library
  582. $!
  583. $ OPT_TCPIP_LIB = "UCX"
  584. $!
  585. $! Tell the user
  586. $!
  587. $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP"
  588. $!
  589. $! That was all...
  590. $!
  591. $ ENDIF
  592. $ ENDIF
  593. $ ENDIF
  594. $!
  595. $! Set Up Initial CC Definitions, Possibly With User Ones
  596. $!
  597. $ CCDEFS = "TCPIP_TYPE_''OPT_TCPIP_LIB',DSO_VMS"
  598. $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
  599. $ CCEXTRAFLAGS = ""
  600. $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
  601. $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
  602. $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
  603. CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
  604. $!
  605. $! Check To See If The User Entered A Valid Paramter.
  606. $!
  607. $ IF (OPT_COMPILER.EQS."VAXC").OR.(OPT_COMPILER.EQS."DECC").OR.(OPT_COMPILER.EQS."GNUC")
  608. $ THEN
  609. $!
  610. $! Check To See If The User Wanted DECC.
  611. $!
  612. $ IF (OPT_COMPILER.EQS."DECC")
  613. $ THEN
  614. $!
  615. $! Looks Like DECC, Set To Use DECC.
  616. $!
  617. $ COMPILER = "DECC"
  618. $!
  619. $! Tell The User We Are Using DECC.
  620. $!
  621. $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler."
  622. $!
  623. $! Use DECC...
  624. $!
  625. $ CC = "CC"
  626. $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
  627. THEN CC = "CC/DECC"
  628. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
  629. "/NOLIST/PREFIX=ALL" + -
  630. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.VENDOR_DEFNS])" + -
  631. CCEXTRAFLAGS
  632. $!
  633. $! Define The Linker Options File Name.
  634. $!
  635. $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
  636. $!
  637. $! End DECC Check.
  638. $!
  639. $ ENDIF
  640. $!
  641. $! Check To See If We Are To Use VAXC.
  642. $!
  643. $ IF (OPT_COMPILER.EQS."VAXC")
  644. $ THEN
  645. $!
  646. $! Looks Like VAXC, Set To Use VAXC.
  647. $!
  648. $ COMPILER = "VAXC"
  649. $!
  650. $! Tell The User We Are Using VAX C.
  651. $!
  652. $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler."
  653. $!
  654. $! Compile Using VAXC.
  655. $!
  656. $ CC = "CC"
  657. $ IF ARCH.EQS."AXP"
  658. $ THEN
  659. $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
  660. $ EXIT
  661. $ ENDIF
  662. $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
  663. $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
  664. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
  665. CCEXTRAFLAGS
  666. $ CCDEFS = """VAXC""," + CCDEFS
  667. $!
  668. $! Define <sys> As SYS$COMMON:[SYSLIB]
  669. $!
  670. $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
  671. $!
  672. $! Define The Linker Options File Name.
  673. $!
  674. $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
  675. $!
  676. $! End VAXC Check
  677. $!
  678. $ ENDIF
  679. $!
  680. $! Check To See If We Are To Use GNU C.
  681. $!
  682. $ IF (OPT_COMPILER.EQS."GNUC")
  683. $ THEN
  684. $!
  685. $! Looks Like GNUC, Set To Use GNUC.
  686. $!
  687. $ COMPILER = "GNUC"
  688. $!
  689. $! Tell The User We Are Using GNUC.
  690. $!
  691. $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler."
  692. $!
  693. $! Use GNU C...
  694. $!
  695. $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
  696. "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
  697. CCEXTRAFLAGS
  698. $!
  699. $! Define The Linker Options File Name.
  700. $!
  701. $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
  702. $!
  703. $! End The GNU C Check.
  704. $!
  705. $ ENDIF
  706. $!
  707. $! Set up default defines
  708. $!
  709. $ CCDEFS = """FLAT_INC=1""," + CCDEFS
  710. $!
  711. $! Finish up the definition of CC.
  712. $!
  713. $ IF COMPILER .EQS. "DECC"
  714. $ THEN
  715. $ IF CCDISABLEWARNINGS .NES. ""
  716. $ THEN
  717. $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))"
  718. $ ENDIF
  719. $ ELSE
  720. $ CCDISABLEWARNINGS = ""
  721. $ ENDIF
  722. $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
  723. $!
  724. $! Show user the result
  725. $!
  726. $ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
  727. $!
  728. $! Else The User Entered An Invalid Arguement.
  729. $!
  730. $ ELSE
  731. $!
  732. $! Tell The User We Don't Know What They Want.
  733. $!
  734. $ WRITE SYS$OUTPUT ""
  735. $ WRITE SYS$OUTPUT "The Option ",OPT_COMPILER," Is Invalid. The Valid Options Are:"
  736. $ WRITE SYS$OUTPUT ""
  737. $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
  738. $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
  739. $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C."
  740. $ WRITE SYS$OUTPUT ""
  741. $!
  742. $! Time To EXIT.
  743. $!
  744. $ EXIT
  745. $!
  746. $! End The Valid Arguement Check.
  747. $!
  748. $ ENDIF
  749. $!
  750. $! Build a MACRO command for the architecture at hand
  751. $!
  752. $ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
  753. $ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
  754. $!
  755. $! Show user the result
  756. $!
  757. $ WRITE/SYMBOL SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO
  758. $!
  759. $! Time to check the contents, and to make sure we get the correct library.
  760. $!
  761. $ IF OPT_TCPIP_LIB.EQS."SOCKETSHR" .OR. OPT_TCPIP_LIB.EQS."MULTINET" -
  762. .OR. OPT_TCPIP_LIB.EQS."UCX" .OR. OPT_TCPIP_LIB.EQS."TCPIP" -
  763. .OR. OPT_TCPIP_LIB.EQS."NONE"
  764. $ THEN
  765. $!
  766. $! Check to see if SOCKETSHR was chosen
  767. $!
  768. $ IF OPT_TCPIP_LIB.EQS."SOCKETSHR"
  769. $ THEN
  770. $!
  771. $! Set the library to use SOCKETSHR
  772. $!
  773. $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
  774. $!
  775. $! Done with SOCKETSHR
  776. $!
  777. $ ENDIF
  778. $!
  779. $! Check to see if MULTINET was chosen
  780. $!
  781. $ IF OPT_TCPIP_LIB.EQS."MULTINET"
  782. $ THEN
  783. $!
  784. $! Set the library to use UCX emulation.
  785. $!
  786. $ OPT_TCPIP_LIB = "UCX"
  787. $!
  788. $! Done with MULTINET
  789. $!
  790. $ ENDIF
  791. $!
  792. $! Check to see if UCX was chosen
  793. $!
  794. $ IF OPT_TCPIP_LIB.EQS."UCX"
  795. $ THEN
  796. $!
  797. $! Set the library to use UCX.
  798. $!
  799. $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
  800. $ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
  801. $ THEN
  802. $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
  803. $ ELSE
  804. $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
  805. TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
  806. $ ENDIF
  807. $!
  808. $! Done with UCX
  809. $!
  810. $ ENDIF
  811. $!
  812. $! Check to see if TCPIP was chosen
  813. $!
  814. $ IF OPT_TCPIP_LIB.EQS."TCPIP"
  815. $ THEN
  816. $!
  817. $! Set the library to use TCPIP (post UCX).
  818. $!
  819. $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
  820. $!
  821. $! Done with TCPIP
  822. $!
  823. $ ENDIF
  824. $!
  825. $! Check to see if NONE was chosen
  826. $!
  827. $ IF OPT_TCPIP_LIB.EQS."NONE"
  828. $ THEN
  829. $!
  830. $! Do not use a TCPIP library.
  831. $!
  832. $ TCPIP_LIB = ""
  833. $!
  834. $! Done with TCPIP
  835. $!
  836. $ ENDIF
  837. $!
  838. $! Print info
  839. $!
  840. $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB
  841. $!
  842. $! Else The User Entered An Invalid Arguement.
  843. $!
  844. $ ELSE
  845. $!
  846. $! Tell The User We Don't Know What They Want.
  847. $!
  848. $ WRITE SYS$OUTPUT ""
  849. $ WRITE SYS$OUTPUT "The Option ",OPT_TCPIP_LIB," Is Invalid. The Valid Options Are:"
  850. $ WRITE SYS$OUTPUT ""
  851. $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
  852. $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
  853. $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
  854. $ WRITE SYS$OUTPUT ""
  855. $!
  856. $! Time To EXIT.
  857. $!
  858. $ EXIT
  859. $!
  860. $! Done with TCP/IP libraries
  861. $!
  862. $ ENDIF
  863. $!
  864. $! Time To RETURN...
  865. $!
  866. $ RETURN
  867. $!
  868. $ INITIALISE:
  869. $!
  870. $! Save old value of the logical name OPENSSL
  871. $!
  872. $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE")
  873. $!
  874. $! Save directory information
  875. $!
  876. $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
  877. $ __HERE = F$EDIT(__HERE,"UPCASE")
  878. $ __TOP = __HERE - "ENGINES]"
  879. $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
  880. $!
  881. $! Set up the logical name OPENSSL to point at the include directory
  882. $!
  883. $ DEFINE OPENSSL/NOLOG '__INCLUDE'
  884. $!
  885. $! Done
  886. $!
  887. $ RETURN
  888. $!
  889. $ CLEANUP:
  890. $!
  891. $! Restore the logical name OPENSSL if it had a value
  892. $!
  893. $ IF __SAVE_OPENSSL .EQS. ""
  894. $ THEN
  895. $ DEASSIGN OPENSSL
  896. $ ELSE
  897. $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL'
  898. $ ENDIF
  899. $!
  900. $! Done
  901. $!
  902. $ RETURN