makeengines.com 21 KB

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