makeapps.com 20 KB

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