home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / ARCHIE-1.2 / MAKE.COM < prev    next >
Encoding:
Text File  |  1992-01-20  |  13.5 KB  |  431 lines

  1. $! --- MAKE.COM ---                        !x='f$verify(0)'
  2. $! Description:
  3. $!  build the Archie client for VAX/VMS
  4. $!
  5. $! Written by Luke Brennan <brennan@coco.cchs.su.oz.au>
  6. $!
  7. $! Modifications:
  8. $!    Date    Programmer    Reason for modification.
  9. $! 20-Jan-92       ldcb        Initial coding.
  10. $!
  11. $!
  12. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  13. $ Archie_EXECUTABLE := "archie.exe"
  14. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  15. $! add a new call here with the appropriate new Archie server host(s)
  16. $!
  17. $ arg == 1
  18. $ Call AddHost "archie.ans.net"        "(USA [NY])"
  19. $ Call AddHost "archie.rutgers.edu"    "(USA [NJ])"
  20. $ Call AddHost "archie.sura.net"    "(USA [MD])"
  21. $ Call AddHost "archie.unl.edu"        "(USA [NE])"
  22. $ Call AddHost "archie.mcgill.ca"    "(Canada)"
  23. $ Call AddHost "archie.funet.fi"    "(Finland/Mainland Europe)"
  24. $ Call AddHost "archie.au"        "(Australia)"
  25. $ Call AddHost "archie.doc.ic.ac.uk"    "(Great Britain/Ireland)"
  26. $ MAXHOSTS = arg - 1
  27. $!
  28. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. $! add a new call here with any new source file(s)
  30. $! (P2 should be "SUPPORT" if intended for supporting an unknown TCPIP)
  31. $!
  32. $ arg == 1
  33. $ Call AddSource "AQUERY"
  34. $ Call AddSource "ARCHIE"
  35. $ Call AddSource "ATALLOC"
  36. $ Call AddSource "DIRSEND"
  37. $ Call AddSource "GET_PAUTH"
  38. $ Call AddSource "GET_VDIR"
  39. $ Call AddSource "PERRMESG"
  40. $ Call AddSource "PROCQUERY"
  41. $ Call AddSource "PTALLOC"
  42. $ Call AddSource "REGEX"
  43. $ Call AddSource "STCOPY"
  44. $ Call AddSource "SUPPORT"
  45. $ Call AddSource "VLALLOC"
  46. $ Call AddSource "VL_COMP"
  47. $ Call AddSource "VMS_SUPPORT" "SUPPORT"
  48. $ MAXSOURCEFILES = arg - 1
  49. $!
  50. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  51. $! add a call here with any supported TCP/IP implementations
  52. $!  P1 = name of TCP/IP product, P2 = cc/define to set,
  53. $!  P3 = logical to look for,    P4 = location of link/OPT,
  54. $!  P5 = MINIMUM VERSION of TCP/IP to support
  55. $!
  56. $!  Multinet should be last, as it can 'fake' a UCX if you want it to, so
  57. $!  UCX would come up as the 'real' net even though Multinet is used.
  58. $!
  59. $ arg == 1
  60. $ Call AddTCPIP "UCX"        "UCX"         "UCX$DEVICE" "[.vms]ucx.opt"
  61. $ Call AddTCPIP "WOLLONGONG" "WOLLONGONG"  "TWG$TCP"    "[.vms]woll.opt"
  62. $ Call AddTCPIP "MULTINET"   "MULTINET_30" "MULTINET"   "[.vms]multi.opt" "V3.0"
  63. $ MAXTCPIPTYPES = arg - 1
  64. $!
  65. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  66. $!
  67. $ YES = (1.eq.1)
  68. $ NO  = (1.eq.0)
  69. $!
  70. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  71. $!
  72. $ GoSub get_command_line_args
  73. $ GoSub check_for_GNU_cc
  74. $ GoSub check_which_TCPIP
  75. $ GoSub ask_nearest_ARCHIE_HOST
  76. $ GoSub check_for_strings_H
  77. $ GoSub set_cc_defines
  78. $ GoSub do_compiles
  79. $ If (LINKAGE_REQUIRED)
  80. $ Then GoSub do_link
  81. $ Else Write Sys$OutPut "ARCHIE is up to date."
  82. $ EndIF
  83. $ Exit
  84. $!
  85. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  86. $!
  87. $get_command_line_args:
  88. $ cmdline = P1 + P2 + P3 + P4 + P5 + P6 + P7 + P8
  89. $ If ((f$locate("DEBUG",cmdline) .ne. f$length(cmdline)) -
  90.  .or. (f$locate("DBG",cmdline)   .ne. f$length(cmdline)))
  91. $ Then debug := "/DeBug"
  92. $ Else debug := "/NOdebug"
  93. $ EndIF
  94. $ If (f$locate("FORCE",cmdline) .ne. f$length(cmdline))
  95. $ Then FORCEBUILD = YES
  96. $ Else FORCEBUILD = NO
  97. $ EndIF
  98. $ If (f$locate("LINK",cmdline) .ne. f$length(cmdline))
  99. $ Then FORCELINK = YES
  100. $ Else FORCELINK = NO
  101. $ EndIF
  102. $ If ((f$locate("?",cmdline) .ne. f$length(cmdline)) -
  103.  .or. (f$locate("H",cmdline) .ne. f$length(cmdline)))
  104. $ Then
  105. $   Write Sys$Output "Usage:"
  106. $   Write Sys$OutPut "     @MAKE [<debug>|<force>|<link>|<help>]
  107. $   EXIT
  108. $ EndIF
  109. $ RETURN
  110. $!
  111. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  112. $!
  113. $CHECK_FOR_GNU_CC:
  114. $ If (f$trnlnm("GNU_CC") .nes. "")
  115. $ Then
  116. $   cc := "GCC/Optimize/Include=([])"
  117. $   gnu_cc = YES
  118. $ Else
  119. $   cc := "CC/Optimize=NOinline/Include=([])"
  120. $   gnu_cc = NO
  121. $ EndIF
  122. $!
  123. $ RETURN
  124. $!
  125. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  126. $! for product P1, cc/define=P2 if logical P3 present on system.
  127. $! Libs/option = P4 if present. ALL get disregarded if less than version P5
  128. $!
  129. $CHECK_WHICH_TCPIP:
  130. $ tcpip_flag :=
  131. $ tcpip_libs :=
  132. $ NO_TCPIP_SUPPORT = YES
  133. $ i = 1
  134. $tcp_loop:
  135. $ If (i .gt. MAXTCPIPTYPES) Then GoTo tcp_check_done
  136. $ If (f$type(tcpip_P2_'i') .eqs. "") Then GoTo tcp_check_done
  137. $ If (f$type(tcpip_P3_'i') .nes. "")
  138. $ Then
  139. $   tcpip_logical = tcpip_P3_'i'
  140. $   If (tcpip_logical .nes. "")
  141. $   Then                    ! logical to look for
  142. $     If (f$logical(tcpip_logical) .nes. "")
  143. $     Then
  144. $       tcpip_flag = tcpip_P2_'i'
  145. $       tcpip_flag = f$fao(",!AS=1",tcpip_flag)
  146. $       NO_TCPIP_SUPPORT = NO
  147. $       If (f$type(tcpip_P4_'i') .nes. "")
  148. $       Then                    ! link/OPT file location
  149. $        tcpip_linkOPTs = tcpip_P4_'i'
  150. $         If (tcpip_linkOPTs .nes. "")
  151. $         Then
  152. $           If (f$search(tcpip_linkOPTs) .nes. "")
  153. $           Then
  154. $             tcpip_libs = tcpip_P4_'i'
  155. $             tcpip_libs = f$fao("!AS/Option",tcpip_libs)
  156. $           EndIF
  157. $         EndIF
  158. $       EndIF
  159. $       If (f$type(tcpip_P5_'i') .nes. "")
  160. $       Then                    ! minimum version specified
  161. $         If (tcpip_P5_'i' .nes. "")
  162. $         Then
  163. $           GoSub CheckIfVersionOK
  164. $           If VERSION_TOO_EARLY
  165. $           Then                ! too early.. use SUPPORT files
  166. $             tcpip_flag :=
  167. $             tcpip_libs :=
  168. $             NO_TCPIP_SUPPORT = YES
  169. $          tcp_ver = tcpip_P5_'i'
  170. $             tcp_name = tcpip_P1_'i'
  171. $             Write Sys$OutPut f$fao( -
  172.            "Your version of !AS is earlier than !AS.",tcp_name,tcp_ver)
  173.           Write Sys$OutPut "MAKE will use STD support files instead."
  174. $           EndIF
  175. $         EndIF
  176. $       EndIF
  177. $     EndIF
  178. $   EndIF
  179. $ EndIF
  180. $ i = i + 1
  181. $ Goto tcp_loop
  182. $tcp_check_done:
  183. $ RETURN
  184. $!
  185. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  186. $!
  187. $ASK_NEAREST_ARCHIE_HOST:
  188. $GoSub CLRSCN
  189. $ Write Sys$OutPut f$fao("!AS!/!/", -
  190.     "           Enter the number of the ARCHIE HOST nearest you.")
  191. $!
  192. $ i = 1
  193. $_display_loop:
  194. $ If (i .gt. MAXHOSTS) Then GoTo _display_done
  195. $  Write Sys$OutPut f$fao("!2SL) !25AS  !AS",i,host_P1_'i',host_P2_'i')
  196. $  i = i + 1
  197. $ GoTo _display_loop
  198. $_display_done:
  199. $!
  200. $ Assign/User_Mode/NOlog Sys$Command Sys$InPut
  201. $_select_loop:                ! get their selection
  202. $ Read     Sys$Command selection    -
  203.     /End=_selection_made    -
  204.     /Prompt="Enter number of your selection: "
  205. $ If (selection .gt. MAXHOSTS)
  206. $ Then
  207. $   Write Sys$OutPut f$fao("!AS !2SL", "error: Options only go to", MAXHOSTS)
  208. $   GoTo _select_loop
  209. $ EndIF
  210. $ ascii_string = f$edit(selection,"COLLAPSE,UPCASE")
  211. $ ascii_char = f$extract(0,1,ascii_string)
  212. $ If (.NOT. ("0" .les. ascii_char) .and. (ascii_char .les. "9"))
  213. $ Then
  214. $   Write Sys$OutPut -
  215.     f$fao("error: Enter option NUMBER (up to !2SL)", MAXHOSTS)
  216. $   Goto _select_loop
  217. $ EndIF
  218. $!
  219. $ local_archie = host_P1_'selection'
  220. $!
  221. $ RETURN
  222. $!
  223. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  224. $! If we're using VAXC then we need to grab STRINGS.H from SYS$LIBRARY.
  225. $CHECK_FOR_STRINGS_H:
  226. $ delete := delete
  227. $ copy   := copy
  228. $ If (f$search("strings.h") .nes. "") Then delete/nolog/noconfirm []strings.h;*
  229. $ If .NOT. (GNU_CC) Then copy/noconfirm sys$library:string.h []strings.h
  230. $!
  231. $ RETURN
  232. $!
  233. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  234. $! **NOTE** use of global symbol!!!
  235. $! **NOTE** this is the only way I could pass it to the compile subroutine
  236. $! **NOTE** without DCL and/or CC stripping off too many layers of quotes..
  237. $! **NOTE** yeah.. I know.. It's ugly...  you work it out!! :-)
  238. $SET_CC_DEFINES:
  239. $ archie_host = " """"""ARCHIE_HOST=""""""""''local_archie'"""""""" """""" "
  240. $ cflags :== /define=(debug=1,funcs=1,noregex=1'tcpip_flag','archie_host')
  241. $!
  242. $RETURN
  243. $!
  244. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  245. $!
  246. $DO_COMPILES:
  247. $ GoSub CLRSCN
  248. $ LINKAGE_REQUIRED == NO
  249. $ If ("''f$type(Archie_EXECUTABLE)'" .nes. "")
  250. $ Then
  251. $   If (Archie_EXECUTABLE .nes. "")
  252. $   Then If (f$search(Archie_EXECUTABLE) .eqs. "") Then LINKAGE_REQUIRED == YES
  253. $   Else If (f$search("Archie.exe") .eqs. "") Then LINKAGE_REQUIRED == YES
  254. $   EndIF
  255. $ Else
  256. $   If (f$search("Archie.exe") .nes. "") Then LINKAGE_REQUIRED == YES
  257. $ EndIF
  258. $ i = 1
  259. $cc_loop:
  260. $ If (i .gt. MAXSOURCEFILES) Then GoTo cc_done
  261. $ source_file = source_P1_'i'
  262. $ If ((f$type(source_P2_'i') .eqs. "") .or. (source_P2_'i' .eqs. ""))
  263. $ Then Call Compile "''cc'" "''source_file'" "''debug'" 'FORCEBUILD'
  264. $ Else
  265. $   If ((NO_TCPIP_SUPPORT) .and. (source_P2_'i' .eqs. "SUPPORT"))
  266. $   Then Call Compile "''cc'" "''source_file'" "''debug'" 'FORCEBUILD'
  267. $   EndIF
  268. $ EndIF
  269. $ i = i + 1
  270. $ GoTo cc_loop
  271. $cc_done:
  272. $ If (FORCELINK) Then LINKAGE_REQUIRED == YES
  273. $!
  274. $ RETURN
  275. $!
  276. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  277. $!
  278. $DO_LINK:
  279. $ If (f$type(Archie_EXECUTABLE) .nes. "")
  280. $ Then
  281. $   If (Archie_EXECUTABLE .nes. "")
  282. $   Then executable := /Exec='Archie_EXECUTABLE'
  283. $   Else executable := /Exec=Archie.exe
  284. $   EndIF
  285. $ Else
  286. $   executable := /Exec=Archie.exe
  287. $ EndIF
  288. $ i = 1
  289. $ object_files :=
  290. $object_files_loop:
  291. $ If (i .gt. MAXSOURCEFILES) Then GoTo object_files_done
  292. $ object_file = source_P1_'i'
  293. $ If ((f$type(source_P2_'i') .eqs. "") .or. (source_P2_'i' .eqs. ""))
  294. $ Then object_files := 'object_files'+'object_file'
  295. $ Else
  296. $   If ((NO_TCPIP_SUPPORT) .and. (source_P2_'i' .eqs. "SUPPORT"))
  297. $   Then object_files := 'object_files'+'object_file'
  298. $   EndIF
  299. $ EndIF
  300. $ i = i + 1
  301. $ GoTo object_files_loop
  302. $object_files_done:
  303. $ If (f$extract(0,1,object_files) .eqs. "+")
  304. $ Then object_files = f$extract(1,f$length(object_files),object_files)
  305. $ EndIF
  306. $ If (tcpip_libs .nes. "")
  307. $ Then object_files = object_files + ","
  308. $ EndIF
  309. $!
  310. $ Set Verify
  311. $ Link'debug''executable' 'object_files''tcpip_libs'
  312. $ x='f$verify(0)'
  313. $!
  314. $ Write Sys$OutPut " "
  315. $ Write Sys$OutPut " "
  316. $ Write Sys$OutPut "Done! Define the symbol ARCHIE & fire away."
  317. $!
  318. $ RETURN
  319. $!
  320. $! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  321. $!
  322. $CLRSCN:
  323. $If (f$GetDVI("TT:","TT_ANSICRT"))            ! ANSI compatible?
  324. $Then
  325. $  CSI = "x["
  326. $  CSI[0,8] = 27
  327. $  CLS = CSI + "H" + CSI +"2J"
  328. $  Write Sys$OutPut CLS
  329. $Else
  330. $  Write Sys$Output "''f$fao("!/!/!/!/!/!/!/!/!/!/!/")
  331. $  Write Sys$Output "''f$fao("!/!/!/!/!/!/!/!/!/!/!/!/")
  332. $EndIF
  333. $Return
  334. $!
  335. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  336. $!
  337. $AddHOST: SUBROUTINE
  338. $ host_P1_'arg' :== "''P1'"
  339. $ host_P2_'arg' :== "''P2'"
  340. $ arg == arg + 1    ! *NOTE* global symbols used...
  341. $ENDSUBROUTINE
  342. $!
  343. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  344. $!
  345. $AddSOURCE: SUBROUTINE
  346. $ source_P1_'arg' :== "''P1'"
  347. $ source_P2_'arg' :== "''P2'"
  348. $ arg == arg + 1    ! *NOTE* global symbols used...
  349. $ENDSUBROUTINE
  350. $!
  351. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  352. $!
  353. $AddTCPIP: SUBROUTINE
  354. $ tcpip_P1_'arg' :== "''P1'"
  355. $ tcpip_P2_'arg' :== "''P2'"
  356. $ tcpip_P3_'arg' :== "''P3'"
  357. $ tcpip_P4_'arg' :== "''P4'"
  358. $ tcpip_P5_'arg' :== "''P5'"
  359. $ arg == arg + 1    ! *NOTE* global symbols used...
  360. $ENDSUBROUTINE
  361. $!
  362. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  363. $! **NOTE** cflags is a GLOBAL symbol due to problems with quoted /Defines
  364. $! **NOTE** not passing down correctly.. (I gave up!)
  365. $Compile: SUBROUTINE
  366. $ YES = (1.eq.1)
  367. $! --- do a Make of only that source which has been modified since its
  368. $!     object code was generated or that is missing its object code.
  369. $ cc       = "''P1'"
  370. $ source   = "''P2'"
  371. $ dbg      = "''P3'"
  372. $ FORCED   = P4
  373. $!
  374. $source = source - ".C" + ".C"
  375. $ t1 = f$search("''source'")                ! source exists?
  376. $  If (t1 .eqs. "") Then GoTo _error_source_missing    ! YIPE!
  377. $   source = source - ".C"
  378. $    if (FORCED) Then GoTo _compile_the_source        ! forced to compile
  379. $     t1 = f$search("''source'.OBJ")            ! object exist?
  380. $     If (t1 .eqs. "") Then GoTo _compile_the_source    ! object missing
  381. $     t1 = f$file_attributes("''source'.OBJ","RDT")    ! when was the OBJECT
  382. $    t1 = f$cvtime(t1)                    ! produced? (rev date)
  383. $   t2 = f$file_attributes("''source'.C","RDT")        ! when was source last
  384. $  t2 = f$cvtime(t2)                    ! modified?
  385. $ If (t1 .ges. t2) Then GoTo _bypass_compile        ! object still current
  386. $_compile_the_source:
  387. $ set verify
  388. $ 'cc -
  389.   'cflags -
  390.   'dbg 'source
  391. $ x='f$verify(0)'
  392. $ LINKAGE_REQUIRED == YES
  393. $  GoTo _cc_done
  394. $_bypass_compile:                    ! didn't need to
  395. $  GoTo _cc_done                    ! generate new OBJ file
  396. $_error_source_missing:
  397. $ Write Sys$OutPut "ERROR: unable to locate source file ''source'.C"
  398. $_cc_done:
  399. $ENDSUBROUTINE
  400. $!
  401. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  402. $!
  403. $CHECKIFVERSIONOK:
  404. $ required_version = tcpip_P5_'i'
  405. $ tcpip_type = tcpip_P1_'i'
  406. $ If ("MULTINET" .eqs. tcpip_type)
  407. $ Then                        ! I know how to check MULTINET
  408. $   If (f$search("MULTINET:MULTINET_VERSION.;") .nes. "")
  409. $   Then
  410. $     Open/share=READ fd MULTINET:MULTINET_VERSION.;
  411. $     Read fd buffer
  412. $     Close fd
  413. $     v = buffer - "VERSION"
  414. $     v = f$edit(V,"TRIM,COMPRESS")
  415. $     If (v .ges. required_version)
  416. $     Then VERSION_TOO_EARLY = NO
  417. $     Else VERSION_TOO_EARLY = YES
  418. $     EndIF
  419. $   Else
  420. $     VERSION_TOO_EARLY = YES
  421. $   EndIF
  422. $ Else                        ! don't know, so assume current
  423. $   VERSION_TOO_EARLY = NO
  424. $ EndIF
  425. $!
  426. $ RETURN
  427. $!
  428. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  429.  
  430.  
  431.