2
0

makeapps.com 21 KB

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