makeapps.com 20 KB

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