home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / configure.com < prev    next >
Text File  |  2000-03-16  |  82KB  |  2,460 lines

  1. $ sav_ver = 'F$VERIFY(0)'
  2. $! SET VERIFY
  3. $!
  4. $! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will 
  5. $! want to cd into the tree and execute Configure:
  6. $!
  7. $! $ SET DEFAULT [USER.PERL5_xxx]
  8. $! $ @Configure 
  9. $!
  10. $! or
  11. $!
  12. $! $ SET DEFAULT [USER.PERL5_xxx]
  13. $! $ @Configure "-des"
  14. $!
  15. $! That's it. If you get into a bind trying to build perl on VMS then 
  16. $! definitely read through the README.VMS file.
  17. $! Beyond that send email to vmsperl@perl.org
  18. $!
  19. $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. $!
  21. $! send suggestions to: 
  22. $!  Dan Sugalski <dan@sidhe.org>
  23. $! Thank you!!!!
  24. $!
  25. $! Adapted and converted from Larry Wall & Andy Dougherty's
  26. $! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
  27. $! (a Bourne sh[ell] script for configuring the installation of perl 
  28. $! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
  29. $! with much valuable help from Charles Bailey & 
  30. $! the whole VMSPerl crew.
  31. $! Extended and messed about with by Dan Sugalski
  32. $!
  33. $ sav_ver = F$VERIFY(0)
  34. $!
  35. $! VMS-isms we will need:
  36. $ echo = "write sys$output "
  37. $ cat  = "type"
  38. $ gcc_symbol = "gcc"
  39. $ ans = ""
  40. $ macros = ""
  41. $ extra_flags = ""
  42. $ user_c_flags = ""
  43. $ use_ieee_math = "n"
  44. $ be_case_sensitive = "n"
  45. $ use_vmsdebug_perl = "n"
  46. $ use64bitall = "n"
  47. $ use64bitint = "n"
  48. $ C_Compiler_Replace = "CC="
  49. $ Thread_Live_Dangerously = "MT="
  50. $ use_two_pot_malloc = "N"
  51. $ use_pack_malloc = "N"
  52. $ use_debugmalloc = "N"
  53. $ d_secintgenv = "N"
  54. $ cc_flags = ""
  55. $ use_multiplicity = "N"
  56. $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
  57. $ max_allowed_dir_depth = 3  ! e.g. [A.B.PERL5_xxx] not [A.B.C.PERL5_xxx]
  58. $! max_allowed_dir_depth = 2  ! e.g. [A.PERL5_xxx] not [A.B.PERL5_xxx]
  59. $!
  60. $ vms_filcnt = F$GETJPI ("","FILCNT")
  61. $!
  62. $!: compute my invocation name
  63. $ me = F$ENVIRONMENT("PROCEDURE")
  64. $!
  65. $! Many null statements (begin with colon ':') in the Bourne shell version of
  66. $! this script serve as comments/placeholders. I have retained some of the ones
  67. $! that will help you compare this .COM file to the sh version - as well as
  68. $! leave placeholders for future improvements to this .COM file.
  69. $! sfn = VMS "skipped for now"
  70. $!
  71. $!: Proper PATH separator                              !sfn
  72. $!: Proper PATH setting                                !sfn
  73. $!: Sanity checks                                      !sfn "Say '@''$me''"
  74. $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
  75. $!: Configure runs within the UU subdirectory          !->after find MANIFEST
  76. $!   <big long list of default values (mostly null)>
  77. $!: We must find out about Eunice early                !(?)
  78. $!: list of known cpp symbols, sorted alphabetically   !sfn
  79. $!   al = al + "..."
  80. $!: default library list                               !sfn
  81. $!   <no hints files in use (yet?)>
  82. $!: Extra object files, if any, needed on this platform. !sfn
  83. $!: Possible local include directories to search.      !sfn
  84. $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
  85. $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
  86. $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
  87. $!: no include file wanted by default                  !sfn
  88. $!inclwanted=''                                        !sfn
  89. $!: Possible local library directories to search.      !sfn
  90. $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
  91. $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
  92. $!: general looking path for locating libraries        !sfn
  93. $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
  94. $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
  95. $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
  96. $!: Private path used by Configure to find libraries.  Its value !sfn
  97. $!: is prepended to libpth. This variable takes care of special !sfn
  98. $!: machines, like the mips.  Usually, it should be empty. !sfn
  99. $!plibpth=''                                           !sfn
  100. $!: full support for void wanted by default            !sfn
  101. $!defvoidused=15                                       !sfn
  102. $!: List of libraries we want.                         !sfn
  103. $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
  104. $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
  105. $!libswanted="$libswanted ucb bsd BSD PW x"            !sfn
  106. $!: We probably want to search /usr/shlib before most other libraries. !sfn
  107. $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
  108. $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
  109. $!glibpth="/usr/shlib $glibpth"                        !sfn
  110. $!: Do not use vfork unless overridden by a hint file. !sfn
  111. $!usevfork=false                                       !sfn
  112. $!: script used to extract .SH files with variable substitutions !sfn
  113. $!: produce awk script to parse command line options   !sfn
  114. $!sfn (assume no sed awk) see below
  115. $!: process the command line options         
  116. $!
  117. $!: set up default values
  118. $ fastread=""
  119. $ reuseval="false"
  120. $ maniskip = "false"
  121. $ config_sh=""
  122. $ alldone=""
  123. $ error=""
  124. $ silent=""
  125. $ extractsh=""
  126. $ override=""
  127. $ knowitall=""
  128. $ Using_Dec_C = ""
  129. $ Using_Gnu_C = ""
  130. $ Dec_C_Version = ""
  131. $ use_threads = "F"
  132. $ use_5005_threads = "N"
  133. $ use_ithreads = "N"
  134. $!
  135. $!: option parsing
  136. $ config_args = ""
  137. $ IF (P1 .NES. "")
  138. $ THEN            !one or more switches was thrown
  139. $   i = 1
  140. $   bang = 0
  141. $Param_loop:
  142. $   IF (P'i'.NES."") 
  143. $   THEN
  144. $     bang = bang + 1
  145. $     config_args = config_args + F$FAO(" !AS",P'i')
  146. $   ENDIF
  147. $   i = i + 1
  148. $   IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
  149. $!
  150. $   i = 1
  151. $Opt_loop:
  152. $   IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
  153. $   IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
  154. $Remove_quotation_mark:
  155. $   P'i' = P'i' - """"
  156. $   IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
  157. $   gotopt      = "f" !"alse"
  158. $   gotshortopt = "f" !"alse"
  159. $   IF (F$EXTRACT(0,1,P'i') .EQS. "d")
  160. $   THEN
  161. $     fastread    = "yes"
  162. $     gotopt      = "t" !"rue"
  163. $     P'i'        = P'i' - "d"
  164. $     gotshortopt = "t" !"rue"
  165. $   ENDIF
  166. $   IF (F$EXTRACT(0,1,P'i') .EQS. "e")
  167. $   THEN
  168. $     alldone = "cont"
  169. $     gotopt = "t"
  170. $     P'i' = P'i' - "e"
  171. $     gotshortopt = "t"
  172. $   ENDIF
  173. $   IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
  174. $   THEN
  175. $     P'i' = P'i' - "f"
  176. $     config_sh = P'i'
  177. $     IF (F$SEARCH(config_sh).NES."")
  178. $     THEN
  179. $       test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
  180. $       IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh)) 
  181. $       THEN
  182. $         CONTINUE !at this point check UIC && if test allows...
  183. $                  !to be continued ?
  184. $       ELSE
  185. $         echo "''me': cannot read config file ''config_sh'."
  186. $         error="true"
  187. $       ENDIF
  188. $     ELSE
  189. $       echo "''me': cannot read config file ''config_sh'."
  190. $       error="true"
  191. $     ENDIF
  192. $     gotopt = "t"
  193. $   ENDIF
  194. $   IF (F$EXTRACT(0,1,P'i') .EQS. "h")
  195. $   THEN
  196. $     error = "true"
  197. $     gotopt = "t"
  198. $     P'i' = P'i' - "h"
  199. $     gotshortopt = "t"
  200. $   ENDIF
  201. $   IF (F$EXTRACT(0,1,P'i') .EQS. "m")
  202. $   THEN
  203. $     maniskip = "true"
  204. $     gotopt = "t"
  205. $     P'i' = P'i' - "m"
  206. $     gotshortopt = "t"
  207. $   ENDIF
  208. $   IF (F$EXTRACT(0,1,P'i') .EQS. "r")
  209. $   THEN
  210. $     reuseval = "true"
  211. $     gotopt = "t"
  212. $     P'i' = P'i' - "r"
  213. $     gotshortopt = "t"
  214. $   ENDIF
  215. $   IF (F$EXTRACT(0,1,P'i') .EQS. "s")
  216. $   THEN
  217. $     silent = "true"
  218. $     gotopt = "t"
  219. $     P'i' = P'i' - "s"
  220. $     gotshortopt = "t"
  221. $   ENDIF
  222. $   IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
  223. $   THEN
  224. $     alldone = "exit"
  225. $     gotopt = "t"
  226. $   ENDIF
  227. $   IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
  228. $   THEN
  229. $     knowitall = "true"
  230. $     gotopt = "t"
  231. $     P'i' = P'i' - "K"
  232. $     gotshortopt = "t"
  233. $   ENDIF
  234. $   IF (F$EXTRACT(0,1,P'i') .EQS. "O")
  235. $   THEN
  236. $     override = "true"
  237. $     gotopt = "t"
  238. $     P'i' = P'i' - "O"
  239. $     gotshortopt = "t"
  240. $   ENDIF
  241. $   IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
  242. $   THEN
  243. $     extractsh = "true" !VMS?
  244. $     gotopt = "t"
  245. $     P'i' = P'i' - "S"
  246. $     gotshortopt = "t"
  247. $   ENDIF
  248. $   IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
  249. $   THEN
  250. $     P'i' = P'i' - "D"
  251. $!Hmm.. this part needs work
  252. $!       P'i'
  253. $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
  254. $     THEN
  255. $       P'i' = "define"
  256. $     ELSE 
  257. $       IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
  258. $       THEN
  259. $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  260. $         echo "''me': use '-Usymbol=val' not '-Dsymbol='."
  261. $         echo "''me': ignoring -D",P'i'
  262. $       ELSE
  263. $!Hmm.. this part needs work
  264. $!           'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
  265. $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
  266. $       ENDIF
  267. $     ENDIF
  268. $     ECHO "P''i' =>",P'i',"<="  !Diag
  269. $     gotopt = "t"
  270. $   ENDIF
  271. $   IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
  272. $   THEN
  273. $     P'i' = P'i' - "U"
  274. $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
  275. $     THEN
  276. $       P'i' = ""
  277. $     ELSE 
  278. $       IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
  279. $       THEN
  280. $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  281. $         echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
  282. $         echo "''me': ignoring -U",P'i'
  283. $       ELSE
  284. $         P'i' = "undef"
  285. $       ENDIF
  286. $     ENDIF
  287. $     ECHO "P''i' =>",P'i',"<="  !Diag
  288. $     gotopt = "t"
  289. $   ENDIF
  290. $   IF (F$EXTRACT(0,1,P'i') .EQS. "V")
  291. $   THEN
  292. $     me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  293. $     echo "''me' generated by an unknown version of EDT."
  294. $     STOP
  295. $     EXIT !0
  296. $   ENDIF
  297. $   IF .NOT.gotopt 
  298. $   THEN
  299. $     echo "''me': unknown option ",P'i'
  300. $     error = "true"
  301. $   ENDIF
  302. $   IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
  303. $   i = i + 1 
  304. $   IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
  305. $!
  306. $ ENDIF  ! (P1 .NES. "")
  307. $ config_args = F$EDIT(config_args,"TRIM")
  308. $!
  309. $ IF (error)
  310. $ THEN
  311. $   me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
  312. $   echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
  313. $   echo "                [-Usymbol]  [-Usymbol=]"
  314. $   TYPE SYS$INPUT
  315.  "-d" : use defaults for all answers.
  316.  "-e" : go on without questioning past the production of config.sh.    *
  317.  "-f" : specify an alternate default configuration file.
  318.  "-h" : print this help message and exit (with an error status).
  319.  "-m" : skip the MANIFEST check to see that all files are present
  320.  "-r" : reuse C symbols value if possible (skips costly nm extraction).*
  321.  "-s" : silent mode, only echoes questions and essential information.
  322.  -"D" : define symbol to have some value:                              *
  323.          -"Dsymbol"         symbol gets the value 'define'
  324.          -"Dsymbol=value"   symbol gets the value 'value'
  325.   -E  : stop at the end of questions, after having produced config.sh. *
  326.   -K  : do not use unless you know what you are doing.
  327.   -O  : let -D and -U override definitions from loaded configuration file. *
  328.   -S  : perform variable substitutions on all .SH files (can mix with -f) *
  329.  -"U" : undefine symbol:                                               *
  330.          -"Usymbol"    symbol gets the value 'undef'
  331.          -"Usymbol="   symbol gets completely empty
  332.   -V  : print version number and exit (with a zero status).
  333. $   echo "%Config-I-VMS, lower case switches must be enclosed"
  334. $   echo "-Config-I-VMS, in double quotation marks, e.g.:"
  335. $   echo "-Config-I-VMS,   @Configure ""-des"""
  336. $   echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
  337. $   SET DEFAULT 'vms_default_directory_name' !be kind rewind
  338. $   STOP
  339. $   EXIT 3 ! $STATUS = "%X00000003" (informational)
  340. $ ENDIF
  341. $!
  342. $ GOTO Check_silence
  343. $!
  344. $Shut_up:
  345. $ IF F$Mode() .eqs. "BATCH"
  346. $ THEN
  347. $   STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
  348. $   WRITE SYS$OUTPUT "Warning: Executing in batch mode.  To avoid file locking conflicts,"
  349. $   WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
  350. $   WRITE SYS$OUTPUT STDOUT
  351. $ ELSE
  352. $   STDOUT = F$TRNLNM("SYS$OUTPUT")
  353. $ ENDIF
  354. $ DEFINE SYS$OUTPUT "_NLA0:"
  355. $ echo4 = "write STDOUT "
  356. $ cat4 = "TYPE/OUTPUT=''STDOUT'"
  357. $ open/write/share=read STDOUT 'STDOUT'
  358. $ RETURN
  359. $!
  360. $Check_silence:
  361. $ IF (silent) 
  362. $ THEN
  363. $   GOSUB Shut_up
  364. $ ELSE
  365. $   echo4 = "write SYS$OUTPUT "
  366. $   cat4 = "TYPE"
  367. $ ENDIF
  368. $!
  369. $!: run the defines and the undefines, if any, but leave the file out there...
  370. $! Unfortunately Configure.COM in DCL is not yet set up to do this - 
  371. $! maybe someday
  372. $!
  373. $!: set package name
  374. $ package = "perl5"
  375. $ packageup = F$EDIT((package - "5"),"UPCASE")
  376. $!
  377. $!: Eunice requires " " instead of "", can you believe it
  378. $ echo ""
  379. $!: Here we go...
  380. $ echo "Beginning of configuration questions for ''package'."
  381. $ echo ""
  382. $!
  383. $!: Some greps do not return status, grrr.
  384. $ contains = "SEARCH"
  385. $!
  386. $!: first determine how to suppress newline on echo command !cant DCL is record oriented
  387. $! echo "Checking ''echo' to see how to suppress newlines..."
  388. $! echo "giving up..."
  389. $! echo "The star should be here-->*"
  390. $!
  391. $!: Now test for existence of everything in MANIFEST
  392. $ echo ""
  393. $ echo4 "First let's make sure your kit is complete.  Checking..."
  394. $ manifestfound = "" 
  395. $ miss_list = "" 
  396. $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
  397. $! because the search routine simply does set def [-] if necessary.
  398. $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...] 
  399. $Research_manifest:
  400. $ manifestfound = F$SEARCH(file_2_find)
  401. $ IF (manifestfound .EQS. "")
  402. $ THEN
  403. $   IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
  404. $   THEN
  405. $     SET DEFAULT [-]
  406. $     GOTO Research_manifest
  407. $   ELSE
  408. $     echo ""
  409. $     echo "There is no MANIFEST file.  I hope your kit is complete !"
  410. $     miss_list = ""
  411. $     GOTO Beyond_manifest
  412. $   ENDIF
  413. $ ELSE
  414. $! MANIFEST. has been found and we have set def'ed there - 
  415. $! time to bail out before it's too late.
  416. $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
  417. $ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
  418. $   IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
  419. $   THEN
  420. $     TYPE SYS$INPUT:
  421. %Config-E-VMS, ERROR:
  422.  Sorry! It apears as though your perl build sub-directory is already too
  423.  deep into the VMS file system. Please try moving stuff into a shallower 
  424.  directory (or altering the "max_allowed_dir_depth" parameter).
  425. $     echo4 "ABORTING..."
  426. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  427. $     STOP
  428. $     EXIT !2 !$STATUS = "%X00000002" (error)
  429. $   ENDIF
  430. $Beyond_depth_check:
  431. $!
  432. $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
  433. $!
  434. $   IF (manifestfound .NES. "")
  435. $   THEN
  436. $     IF ( F$SEARCH("UU.DIR").EQS."" )
  437. $     THEN
  438. $       CREATE/DIRECTORY [.UU]
  439. $     ELSE
  440. $       IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
  441. $     ENDIF
  442. $!: Configure runs within the UU subdirectory
  443. $     SET DEFAULT [.UU]
  444. $!
  445. $! a little redundancy never hurt anybody?
  446. $     file_2_find = "[-]" + file_2_find
  447. $     manifestfound = F$SEARCH(file_2_find)
  448. $!
  449. $     OPEN/WRITE MISSING MISSING.
  450. $!change to "FALSE" if you wish to skip the manifest search 
  451. $!(which after all is rather slow in DCL :-)
  452. $     IF (maniskip)
  453. $     THEN
  454. $       echo "Skipping MANIFEST check as requested"
  455. $     ELSE
  456. $!
  457. $       OPEN/READ CONFIG 'manifestfound'
  458. $Read_loop_manifest:
  459. $       READ/END_OF_FILE = Done_manifest CONFIG line
  460. $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
  461. $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
  462. $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
  463. $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
  464. $       line = F$EDIT(line,"TRIM, COMPRESS")
  465. $       file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line) 
  466. $       IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find) 
  467. $       THEN 
  468. $Re_strip_line_manifest:
  469. $         loca = F$LOCATE("/",file_2_find)
  470. $         ante = F$EXTRACT(0,loca,file_2_find)
  471. $         post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
  472. $         test_this = ante + "." + (post - "/")
  473. $         IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
  474. $         THEN 
  475. $           file_2_find = ante + "." + (post - "/")
  476. $           GOTO Re_strip_line_manifest
  477. $         ELSE
  478. $           file_2_find = ante + "]" + (post - "/")
  479. $         ENDIF
  480. $           file_2_find = "[-."+file_2_find
  481. $       ELSE
  482. $         file_2_find = "[-]" + file_2_find
  483. $       ENDIF
  484. $!
  485. $       dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
  486. $       file_2_find = file_2_find - dirname
  487. $       dots = 0
  488. $Dot_loop:
  489. $       dot_ele = F$ELEMENT(dots,".",file_2_find)
  490. $       IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
  491. $       IF dots .eq. 0
  492. $       THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
  493. $       ELSE basename = basename + dot_ele + "_"
  494. $       ENDIF
  495. $       dots = dots + 1
  496. $       GOTO dot_loop
  497. $Eo_dot_loop:
  498. $       IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
  499.              (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
  500.           basename = f$extract(0,f$length(basename)-1,basename)
  501. $       file_2_find = dirname + basename
  502. $!
  503. $       found = F$SEARCH(file_2_find)
  504. $       IF (found .EQS. "" .AND. dots .GT. 2)
  505. $       THEN
  506. $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
  507. $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
  508. $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
  509. $         basename[f$locate(".",basename),1] := _
  510. $         dot_ele = F$ELEMENT(dots - 1,"_",basename)
  511. $         basename = -
  512.             f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
  513.               + "." + dot_ele
  514. $         found = F$SEARCH(dirname + basename)
  515. $         file_2_find = file_2_find + "," + basename
  516. $       ENDIF
  517. $       IF (found .EQS. "")
  518. $       THEN
  519. $         WRITE MISSING file_2_find
  520. $         IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
  521. $         THEN
  522. $           miss_list = miss_list + "," + file_2_find
  523. $         ENDIF
  524. $       ENDIF
  525. $       GOTO Read_loop_manifest
  526. $Done_manifest:
  527. $       CLOSE CONFIG
  528. $     ENDIF  !"TRUE"
  529. $     CLOSE MISSING
  530. $   ENDIF ! (manifestfound .NES. "")
  531. $Beyond_manifest:
  532. $   IF (miss_list .NES. "")
  533. $   THEN
  534. $     echo "Some of the files not found include:"
  535. $     cat4 MISSING.
  536. $   ENDIF
  537. $   IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
  538. $   THEN
  539. $     TYPE SYS$INPUT:
  540.  
  541. THIS PACKAGE SEEMS TO BE INCOMPLETE.
  542.  
  543. You have the option of continuing the configuration process, despite the
  544. distinct possibility that your kit is damaged, by typing 'y'es.  If you
  545. do, don't blame me if something goes wrong.  I advise you to type 'n'o
  546. and contact the author (dan@sidhe.org)
  547.  
  548. $     READ SYS$COMMAND/PROMPT="Continue? [n] " ans
  549. $     IF ans
  550. $     THEN
  551. $       echo4 "Continuing..."
  552. $     ELSE
  553. $       echo4 "ABORTING..."
  554. $       GOTO Clean_up
  555. $     ENDIF
  556. $   ELSE
  557. $     echo4 "Looks good..."
  558. $     DELETE/NOLOG MISSING.;
  559. $   ENDIF ! (miss_list .NES. "")
  560. $ ENDIF   ! (manifestfound .EQS. "") ELSE 
  561. $!
  562. $! after finding MANIFEST (see above)
  563. $!: Configure runs within the UU subdirectory 
  564. $!
  565. $!: compute the number of columns on the terminal for proper question formatting
  566. $! (sfn, will assume 80-ish)
  567. $!
  568. $!: set up the echo used in my read              !sfn
  569. $!: now set up to do reads with possible shell escape and default assignment !sfn
  570. $ GOTO Beyond_myread
  571. $!
  572. $myread:
  573. $ ans = ""
  574. $ If (fastread)
  575. $ Then
  576. $   echo4 "''rp'"
  577. $ Else
  578. $   If (silent)
  579. $   Then
  580. $     READ SYS$COMMAND/PROMPT="''rp'" ans
  581. $   Else
  582. $     echo ""
  583. $     READ SYS$COMMAND/PROMPT="''rp'" ans
  584. $   Endif
  585. $ Endif
  586. $ RETURN
  587. $!
  588. $Beyond_myread:
  589. $!
  590. $!: create .config dir to save info across Configure sessions
  591. $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
  592. $ THEN
  593. $   CREATE/DIRECTORY [-.CONFIG]
  594. $   OPEN/WRITE CONFIG [-.CONFIG]README.
  595. $   WRITE CONFIG -
  596.       "This directory created by Configure to save information that should"
  597. $   WRITE CONFIG -
  598.       "persist across sessions."
  599. $   WRITE CONFIG ""
  600. $   WRITE CONFIG -
  601.       "You may safely delete it if you wish."
  602. $   CLOSE CONFIG
  603. $ ENDIF
  604. $!
  605. $!: general instructions
  606. $ needman = "true"
  607. $ firsttime = "true"
  608. $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
  609. $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
  610. $ THEN
  611. $   messages = F$ENVIRONMENT("MESSAGE")
  612. $   SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
  613. $   contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
  614. $   IF .NOT.($status.EQ.%X08D78053)
  615. $   THEN
  616. $     firsttime=""
  617. $     dflt = "n"
  618. $     rp = "Would you like to see the instructions? [''dflt'] "
  619. $     GOSUB myread
  620. $     if .NOT.ans THEN needman=""
  621. $   ENDIF
  622. $   SET MESSAGE 'messages'
  623. $ ENDIF
  624. $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
  625. $!
  626. $ IF (needman)
  627. $ THEN
  628. $   TYPE SYS$INPUT:
  629.  
  630. This installation shell script will examine your system and ask you questions
  631. to determine how the perl5 package should be installed. If you get
  632. stuck on a question, you may use a ^C or ^Y shell escape to STOP this
  633. process, edit something, then restart this process as you just did.
  634. Many of the questions will have default answers in square
  635. brackets; typing carriage return will give you the default.
  636.  
  637. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  638. $   TYPE SYS$INPUT:
  639.  
  640. In a hurry? You may run '@Configure "-d"'.  This will bypass nearly all
  641. the questions and use the computed defaults (or the previous answers provided 
  642. there was already a config.sh file). Type '@Configure "-h"' for a list of 
  643. options.
  644.  
  645. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  646. $   TYPE SYS$INPUT:
  647.  
  648. Much effort has been expended to ensure that this shell script will
  649. run on any VMS system.  If despite that it blows up on yours, your
  650. best bet is to edit Configure.com and @ it again.  Whatever problems
  651. you have with Configure.com, let me (dan@sidhe.org) know how I blew
  652. it.
  653.  
  654. $!This installation script affects things in two ways:
  655. $!
  656. $!1) it may do direct variable substitutions on some of the files included
  657. $!   in this kit.
  658. $!2) it builds a config.h file for inclusion in C programs.  You may edit
  659. $!   any of these files as the need arises after running this script.
  660. $!
  661. $!If you make a mistake on a question, there is no easy way to back up to it
  662. $!currently.
  663. $!
  664. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  665. $   IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
  666. $   THEN
  667. $     OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
  668. $     WRITE CONFIG user 
  669. $     CLOSE CONFIG
  670. $   ENDIF
  671. $ ENDIF  !(needman .EQS. "true")
  672. $!
  673. $!: see if sh knows # comments             !sfn
  674. $ sharpbang = "$ "
  675. $!: figure out how to guarantee sh startup !sfn
  676. $!: find out where common programs are     !sfn
  677. $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
  678. $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
  679. $! echo "I don't know where '$file' is, and my life depends on it."
  680. $! echo "Go find a public domain implementation or fix your PATH setting!"
  681. $! echo ""
  682. $! echo "Don't worry if any of the following aren't found..."
  683. $!: determine whether symbolic links are supported !sfn
  684. $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
  685. $!: set up the translation script tr, must be called with ./tr of course !sfn
  686. $!
  687. $!: Try to determine whether config.sh was made on this system
  688. $!: Get old answers from old config file if Configure was run on the
  689. $!: same system, otherwise use the hints.
  690. $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
  691. $ i = 0
  692. $ max = 3
  693. $Config_sh_look:
  694. $ config_sh = F$ELEMENT(i,"/",config_sh_es)
  695. $ i = i + 1
  696. $ IF (config_sh.NES."/").AND.(config_sh.NES."")
  697. $ THEN
  698. $   configshfound = F$SEARCH(config_sh)
  699. $   IF (configshfound.NES."") THEN GOTO Config_sh_found
  700. $ ENDIF
  701. $ IF (i.LT.max) THEN GOTO Config_sh_look
  702. $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
  703. $Config_sh_found:
  704. $ echo ""
  705. $ echo "Fetching default answers from ''config_sh'..."
  706. $!we actually do not have "hints/" for VMS
  707. $!     TYPE SYS$INPUT:
  708. $!
  709. $!First time through, eh?  I have some defaults handy for the following systems:
  710. $!
  711. $!     echo "     ","VMS_VAX"
  712. $!     echo "     ","VMS_AXP"
  713. $!        : Now look for a hint file osname_osvers, unless one has been
  714. $!        : specified already.
  715. $!     TYPE SYS$INPUT:
  716. $!
  717. $!You may give one or more space-separated answers, or "none" if appropriate.
  718. $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
  719. $!
  720. $!     READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
  721. $!
  722. $Beyond_config_sh:
  723. $!
  724. $!: Restore computed paths          !sfn
  725. $!
  726. $! genconfig.pl has "osname='VMS'"
  727. $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE") 
  728. $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
  729. $!
  730. $ IF (osname .NES. "VMS")
  731. $ THEN
  732. $   echo4 "Hmm.. I wonder what ''osname' is (?)"
  733. $   TYPE SYS$INPUT:
  734.  
  735. %Config-E-VMS, ERROR:
  736.  
  737.            Err, you do not appear to be running VMS!
  738.  This procedure is intended to Configure the building of Perl for VMS.
  739.  
  740. $   READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
  741. $   IF ans
  742. $   THEN
  743. $     echo4 "Continuing..."
  744. $   ELSE
  745. $     echo4 "ABORTING..."
  746. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  747. $     STOP
  748. $     EXIT 2 !$STATUS = "%X00000002" (error)
  749. $   ENDIF
  750. $ ELSE           !we are on VMS huzzah!
  751. $   IF .NOT.silent 
  752. $   THEN TYPE SYS$INPUT:
  753.  
  754. Configure uses the operating system name and version to set some defaults.
  755. The default value is probably right if the name rings a bell. Otherwise,
  756. since spelling matters for me, either accept the default or answer "none"
  757. to leave it blank.
  758. $   ENDIF
  759. $   rp = "Operating system name? [''osname'] "
  760. $   GOSUB myread
  761. $   IF ans.nes.""
  762. $   THEN
  763. $     IF (ans.NES.osname) !.AND.knowitall
  764. $     THEN
  765. $       echo4 "I'll go with ''osname' anyway..."
  766. $     ENDIF
  767. $   ENDIF
  768. $ ENDIF !(osname .NES./.EQS. "VMS")
  769. $!
  770. $!: who configured the system
  771. $! see 'user' above.
  772. $ cf_by = F$EDIT(user,"LOWERCASE")
  773. $! cf_time = F$CVTIME()                 !superceded by procedure below
  774. $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
  775. $!
  776. $! Peter Prymmer has seen:
  777. $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-46800"  (sic)
  778. $!  "SYS$TIME_ZONE" = "EDT"
  779. $!
  780. $! Charles Lane recommended:
  781. $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
  782. $!  "NEWS_TIMEZONE" = "-0500"
  783. $!  "ST_TIMEZONE" = "EDT"
  784. $!  "JAN_TIME_ZONE" = "EST  "
  785. $!  "MULTINET_TIMEZONE" = "EST"
  786. $!  "DAYLIGHT_SAVINGS"  = "1"
  787. $!
  788. $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
  789. $!   "PMDF_Timezone"
  790. $!   "Multinet_Timezone"
  791. $!   "TCPware_Timezone"
  792. $!   "WIN$Time_Zone"
  793. $!
  794. $! This snippet o' DCL returns a string in default Unix `date` format,
  795. $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
  796. $! Peter Prymmer pvhp@lns62.lns.cornell.edu
  797. $!
  798. $ MIN_TZO = -840  !units are minutes here
  799. $ MAX_TZO =  840
  800. $!
  801. $ wkday  = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
  802. $ monn   = F$CVTIME(,,"MONTH")
  803. $ mday   = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
  804. $ hour   = F$CVTIME(,,"HOUR")
  805. $ min    = F$CVTIME(,,"MINUTE")
  806. $ sec    = F$CVTIME(,,"SECOND")
  807. $ year   = F$CVTIME(,,"YEAR")
  808. $!
  809. $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
  810. $ i = 0
  811. $Mon_loop:
  812. $ i = i + 1
  813. $ mon = F$ELEMENT(i,"/",months)
  814. $ IF i.LT.monn THEN GOTO Mon_loop
  815. $!
  816. $ tzneedset = "t"
  817. $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
  818. $ IF systz.NES.""
  819. $ THEN
  820. $   tzhour = F$INTEGER(systz)/3600
  821. $   tzmins = F$INTEGER(systz)/60
  822. $   tzminrem = tzmins - tzhour*60
  823. $   IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem  !keeps !2ZL happy
  824. $   IF tzhour.ge.0 
  825. $   THEN signothetime = "+" 
  826. $     IF tzhour.EQ.0.AND.tzminrem.EQ.0 
  827. $     THEN direction = "on GMT/"
  828. $     ELSE direction = "east of "
  829. $     ENDIF
  830. $   ELSE signothetime = "-"
  831. $     tzhour = -1*tzhour                          !keeps !UL happy
  832. $     direction = "west of "
  833. $   ENDIF
  834. $   echo ""
  835. $   echo "%Config-I-VMS,"
  836. $   echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
  837. $   IF tzminrem.ne.0
  838. $   THEN
  839. $     tzspan = "''tzhour' hours & ''tzminrem' minutes"
  840. $   ELSE
  841. $     tzspan = "''tzhour' hours"
  842. $   ENDIF
  843. $   dflt = "y"
  844. $   echo "Your system is ''tzspan' ''direction'UTC in England."
  845. $   rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
  846. $   GOSUB myread
  847. $   IF ans.OR.(ans.EQS."") 
  848. $   THEN 
  849. $     tzneedset = "f"
  850. $     tzd = systz
  851. $     GOTO Beyond_TimeZone
  852. $   ENDIF
  853. $ ELSE
  854. $   echo ""
  855. $   echo4 "%Config-I-VMS,"
  856. $   echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
  857. $ ENDIF
  858. $!
  859. $TZSet:
  860. $ echo ""
  861. $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
  862. $ echo "you are.  As an example Eastern (US) Standard Time is -5:00 offset, but"
  863. $ echo "Eastern Daylight Time (summer) is -4:00 offset."
  864. $ dflt = "0:00"
  865. $ rp = "Enter the Time Zone offset: [''dflt'] "
  866. $ GOSUB myread
  867. $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
  868. $ IF ans.EQS."" THEN ans = dflt
  869. $ tzhour   = F$ELEMENT(0,":","''ans'") !first
  870. $ IF tzhour.EQS."" THEN tzhour = 0
  871. $ tzhour   = F$INTEGER(tzhour)
  872. $ tzminrem = F$ELEMENT(1,":","''ans'") !second
  873. $ IF tzminrem.NES."" 
  874. $ THEN 
  875. $   tzminrem = F$INTEGER(tzminrem)
  876. $   IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
  877. $ ELSE 
  878. $   tzminrem = 0
  879. $ ENDIF
  880. $ tzmins = tzhour*60 + tzminrem
  881. $ tzd = F$STRING(tzmins*60)
  882. $ IF tzhour .GE. 0 
  883. $ THEN
  884. $   signothetime = "+" 
  885. $ ELSE
  886. $   tzhour = -1*tzhour       !keeps !UL happy
  887. $   signothetime = "-"
  888. $ ENDIF
  889. $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
  890. $ THEN
  891. $   echo ""
  892. $   echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
  893. $   goto TZSet
  894. $ ENDIF
  895. $!
  896. $Beyond_TimeZone:
  897. $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
  898. $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
  899. $!
  900. $!: determine the architecture name  
  901. $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
  902. $!
  903. $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
  904. $ THEN 
  905. $   archname = "VMS_VAX"
  906. $   otherarch = "an Alpha"
  907. $   alignbytes="8"
  908. $   arch_type = "ARCH-TYPE=__VAX__"
  909. $ ELSE
  910. $   archname = "VMS_AXP"
  911. $   otherarch = "a VAX"
  912. $   alignbytes="8"
  913. $   arch_type = "ARCH-TYPE=__AXP__"
  914. $ ENDIF
  915. $ rp = "What is your architecture name? [''archname'] "
  916. $ GOSUB myread
  917. $ IF ans.NES.""
  918. $ THEN
  919. $   ans = F$EDIT(ans,"COLLAPSE, UPCASE")
  920. $   IF (ans.NES.archname) !.AND.knowitall
  921. $   THEN
  922. $     echo4 "I'll go with ''archname' anyway..."
  923. $   ENDIF
  924. $ ENDIF
  925. $ dflt = "n"
  926. $ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
  927. $ GOSUB myread
  928. $ if ans.NES.""
  929. $ THEN
  930. $   ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
  931. $ ENDIF
  932. $ IF (ans.NES."Y")
  933. $ THEN
  934. $   sharedperl = "N"
  935. $ ELSE
  936. $   sharedperl = "Y"
  937. $   IF (archname.EQS."VMS_AXP")
  938. $   THEN
  939. $     macros = macros + """AXE=1"","
  940. $   ENDIF
  941. $ ENDIF
  942. $!
  943. $!: is AFS running?                       !sfn
  944. $!: decide how portable to be.  Allow command line overrides. !sfn
  945. $!: set up shell script to do ~ expansion !sfn
  946. $!: expand filename                       !sfn
  947. $!: now set up to get a file name         !sfn
  948. $!
  949. $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
  950. $ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
  951. $ prefixbase = prefix - "]"
  952. $ prefix = prefixbase + ".]"
  953. $!: determine root of directory hierarchy where package will be installed.
  954. $ dflt = prefix
  955. $ IF .NOT.silent 
  956. $ THEN 
  957. $   echo ""
  958. $   echo "By default, ''package' will be installed in ''dflt', pod"
  959. $   echo "pages under ''prefixbase'LIB.POD], etc..., i.e. with ''dflt' as prefix for"
  960. $   echo "all installation directories."
  961. $   echo "On ''osname' the ''prefix' is used to DEFINE the ''packageup'_ROOT prior to installation"
  962. $   echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
  963. $ ENDIF
  964. $ rp = "Installation prefix to use (for ''packageup'_ROOT)? [ ''dflt' ] "
  965. $ GOSUB myread
  966. $ IF ans.NES.""
  967. $ THEN 
  968. $   prefix = ans
  969. $   IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
  970. $ ELSE 
  971. $   prefix = dflt
  972. $ ENDIF
  973. $!
  974. $! Check here for pre-existing PERL_ROOT.
  975. $!  -> ask if removal desired.
  976. $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
  977. $!  -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
  978. $!
  979. $ vms_skip_install = "true"
  980. $ dflt = "y"
  981. $! echo ""
  982. $ rp = "%Config-I-VMS, Skip the remaining """"where install"""" questions? [''dflt'] "
  983. $ GOSUB myread
  984. $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
  985. $ IF (.NOT.vms_skip_install)
  986. $ THEN
  987. $!
  988. $!: set the prefixit variable, to compute a suitable default value
  989. $!
  990. $!: determine where private library files go
  991. $!: Usual default is /usr/local/lib/perl5.  Also allow things like 
  992. $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
  993. $   IF .NOT.silent 
  994. $   THEN TYPE SYS$INPUT:
  995.  
  996. There are some auxiliary files for perl5 that need to be put into a
  997. private library directory that is accessible by everyone.
  998. $   ENDIF
  999. $   dflt = prefix - ".]" + ".LIB]"
  1000. $   rp = "Pathname where the private library files will reside? " 
  1001. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1002. $   GOSUB myread
  1003. $   IF ans.NES.""
  1004. $   THEN privlib = ans
  1005. $   ELSE privlib = dflt
  1006. $   ENDIF
  1007. $!
  1008. $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
  1009. $!
  1010. $ perl_symbol = "true"
  1011. $ perl_verb = ""
  1012. $ dflt = "y"
  1013. $ IF .NOT.silent 
  1014. $ THEN 
  1015. $   echo ""
  1016. $   echo "%Config-I-VMS, You may choose to write ''packageup'_SETUP.COM to assign a foreign"
  1017. $   echo "-Config-I-VMS, symbol to invoke ''package', which is the usual method."
  1018. $   echO "-Config-I-VMS, If you do not do so then you would need a DCL command verb at the"
  1019. $   echo "-Config-I-VMS, process or the system wide level."
  1020. $ ENDIF
  1021. $ rp = "Invoke perl as a global symbol foreign command [''dflt'] "
  1022. $ GOSUB myread
  1023. $ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
  1024. $!
  1025. $ IF (.NOT.perl_symbol)
  1026. $ THEN
  1027. $   dflt = "y"
  1028. $   IF .NOT.silent 
  1029. $   THEN 
  1030. $     echo ""
  1031. $     echo "%Config-I-VMS, Since you won't be using a symbol you must choose to put the ''packageup'"
  1032. $     echo "-Config-I-VMS, verb in a per-process table or in the system wide DCLTABLES (which"
  1033. $     echo "-Config-I-VMS, would require write privilege)."
  1034. $   ENDIF
  1035. $   rp = "Invoke perl as a per process command verb [ ''dflt' ] "
  1036. $   GOSUB myread
  1037. $   IF (.NOT.ans).AND.(ans.NES."")
  1038. $   THEN perl_verb = "DCLTABLES"
  1039. $   ELSE perl_verb = "PROCESS"
  1040. $   ENDIF
  1041. $ ENDIF ! (.NOT.perl_symbol)
  1042. $!
  1043. $!: set the base revision
  1044. $ baserev="5.0"
  1045. $ revision = baserev - ".0"
  1046. $!: get the patchlevel
  1047. $ echo ""
  1048. $ echo4 "Getting the current patchlevel..." !>&4
  1049. $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
  1050. $ IF (patchlevel_h.NES."")
  1051. $ THEN
  1052. $   got_patch = "false"
  1053. $   got_sub   = "false"
  1054. $   got_api_revision   = "false"
  1055. $   got_api_version    = "false"
  1056. $   got_api_subversion = "false"
  1057. $   OPEN/READONLY CONFIG 'patchlevel_h' 
  1058. $Patchlevel_h_loop:
  1059. $   READ/END_Of_File=Close_patch CONFIG line
  1060. $   IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
  1061. $   THEN
  1062. $     line = F$EDIT(line,"COMPRESS, TRIM")
  1063. $     patchlevel = F$ELEMENT(2," ",line)
  1064. $     got_patch = "true"
  1065. $   ENDIF
  1066. $   IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
  1067. $   THEN
  1068. $     line = F$EDIT(line,"COMPRESS, TRIM")
  1069. $     subversion = F$ELEMENT(2," ",line)
  1070. $     got_sub = "true"
  1071. $   ENDIF
  1072. $   IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
  1073. $   THEN
  1074. $     line = F$EDIT(line,"COMPRESS, TRIM")
  1075. $     api_revision = F$ELEMENT(2," ",line)
  1076. $     got_api_revision = "true"
  1077. $   ENDIF
  1078. $   IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
  1079. $   THEN
  1080. $     line = F$EDIT(line,"COMPRESS, TRIM")
  1081. $     api_version = F$ELEMENT(2," ",line)
  1082. $     got_api_version = "true"
  1083. $   ENDIF
  1084. $   IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
  1085. $   THEN
  1086. $     line = F$EDIT(line,"COMPRESS, TRIM")
  1087. $     api_subversion = F$ELEMENT(2," ",line)
  1088. $     got_api_subversion = "true"
  1089. $   ENDIF
  1090. $   IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
  1091. $Close_patch:
  1092. $   CLOSE CONFIG
  1093. $   ELSE
  1094. $     patchlevel="0"
  1095. $     subversion="0"
  1096. $ ENDIF
  1097. $ IF (F$STRING(subversion) .NES. "0")
  1098. $ THEN
  1099. $   echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
  1100. $ ELSE
  1101. $   echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
  1102. $ ENDIF
  1103. $!
  1104. $ version = revision + "_" + patchlevel + "_" + subversion
  1105. $!
  1106. $ IF (.NOT.vms_skip_install)
  1107. $ THEN
  1108. $!: set the prefixup variable, to restore leading tilda escape !sfn
  1109. $!: set the prefixup variable, to restore leading tilde escape !sfn
  1110. $!
  1111. $!: determine where public architecture dependent libraries go
  1112. $   IF (.NOT.silent) 
  1113. $   THEN 
  1114. $     echo ""
  1115. $     echo "''package' contains architecture-dependent library files.  If you are"
  1116. $   ENDIF
  1117. $   IF (.NOT.silent) 
  1118. $   THEN TYPE SYS$INPUT:
  1119. sharing libraries in a heterogeneous environment, you might store
  1120. these files in a separate location.  Otherwise, you can just include
  1121. them with the rest of the public library files.
  1122. $   ENDIF
  1123. $   dflt = privlib - "]" + "." + archname + "." + version + "]"
  1124. $   rp = "Where do you want to put the public architecture-dependent libraries? "
  1125. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1126. $   GOSUB myread
  1127. $   IF ans.NES.""
  1128. $   THEN archlib = ans
  1129. $   ELSE archlib = dflt
  1130. $   ENDIF
  1131. $!
  1132. $!: set up the script used to warn in case of inconsistency !sfn
  1133. $!: function used to set $1 to $val                         !sfn
  1134. $!
  1135. $ ENDIF !%Config-I-VMS, skip "where install" questions
  1136. $! This quotation from Configure has to be included on VMS:
  1137. $ TYPE SYS$INPUT:
  1138.  
  1139. There is, however, a strange, musty smell in the air that reminds me of
  1140. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  1141. $ CONTINUE
  1142. $ IF (.NOT.vms_skip_install)
  1143. $ THEN
  1144. $!: it so happens the Eunice I know will not run shell scripts in Unix format
  1145. $!
  1146. $!: see if setuid scripts can be secure           !sfn
  1147. $!: now see if they want to do setuid emulation   !sfn
  1148. $!
  1149. $!: determine where site specific libraries go.
  1150. $   IF .NOT.silent 
  1151. $   THEN TYPE SYS$INPUT:
  1152.  
  1153. The installation process will also create a directory for
  1154. site-specific extensions and modules.  Some users find it convenient
  1155. to place all local files in this directory rather than in the main
  1156. distribution directory.
  1157. $   ENDIF
  1158. $   dflt = privlib - "]" + ".SITE_PERL]"
  1159. $   rp = "Pathname for the site-specific library files? "
  1160. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1161. $   GOSUB myread
  1162. $   IF ans.NES.""
  1163. $   THEN sitelib = ans
  1164. $   ELSE sitelib = dflt
  1165. $   ENDIF
  1166. $!
  1167. $!: determine where site specific architecture-dependent libraries go.
  1168. $   IF .NOT.silent 
  1169. $   THEN TYPE SYS$INPUT:
  1170.  
  1171. The installation process will also create a directory for
  1172. architecture-dependent site-specific extensions and modules.
  1173. $   ENDIF
  1174. $   dflt = sitelib - "]" + "." + archname + "]"
  1175. $   rp = "Pathname for the site-specific architecture-dependent library files? "
  1176. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1177. $   GOSUB myread
  1178. $   IF ans.NES.""
  1179. $   THEN sitearch = ans
  1180. $   ELSE sitearch = dflt
  1181. $   ENDIF
  1182. $!
  1183. $!: determine where old public architecture dependent libraries might be
  1184. $!
  1185. $!: determine where public executables go
  1186. $   dflt = prefix - ".]" + ".BIN]"
  1187. $   rp = "Pathname where the public executables will reside? "
  1188. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1189. $   GOSUB myread
  1190. $   IF ans.NES.""
  1191. $   THEN bin = ans
  1192. $   ELSE bin = dflt
  1193. $   ENDIF
  1194. $!
  1195. $!: determine where manual pages are on this system
  1196. $!: What suffix to use on installed man pages
  1197. $!: see if we can have long filenames
  1198. $!: determine where library module manual pages go
  1199. $!: What suffix to use on installed man pages
  1200. $!: see what memory models we can support
  1201. $!
  1202. $ ENDIF !%Config-I-VMS, skip "where install" questions
  1203. $!
  1204. $!: see if we need a special compiler
  1205. $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
  1206. $!
  1207. $ nocc = "f"
  1208. $ vms_cc_dflt = ""
  1209. $ vms_cc_available = ""
  1210. $!
  1211. $ OPEN/WRITE CONFIG ccvms.c
  1212. $ WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1213. $ WRITE CONFIG "#include <stdio.h>"
  1214. $ WRITE CONFIG "int main() {"
  1215. $ WRITE CONFIG "#ifdef __DECC"
  1216. $ WRITE CONFIG "        printf(""/DECC\n"");"
  1217. $ WRITE CONFIG "#else"
  1218. $ WRITE CONFIG "        printf(""/VAXC\n"");"
  1219. $ WRITE CONFIG "#endif"
  1220. $ WRITE CONFIG "        exit(0);"
  1221. $ WRITE CONFIG "}"
  1222. $ CLOSE CONFIG
  1223. $!
  1224. $! DEFINE SYS$ERROR _NLA0:
  1225. $! DEFINE SYS$OUTPUT _NLA0:
  1226. $ cc/NoObj/list=ccvms.lis ccvms.c
  1227. $ tmp = $status
  1228. $! DEASSIGN SYS$OUTPUT
  1229. $! DEASSIGN SYS$ERROR
  1230. $ IF (silent) THEN GOSUB Shut_up
  1231. $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
  1232. $!
  1233. $ IF tmp.NE.%X10B90001
  1234. $ THEN 
  1235. $  IF tmp.NE.%X10000001
  1236. $  THEN 
  1237. $    nocc = "t"  !%X10000001 is return from gcc
  1238. $    GOTO Gcc_initial_check
  1239. $  ENDIF
  1240. $ ENDIF
  1241. $!
  1242. $ GOSUB List_Parse
  1243. $ IF .NOT.silent THEN echo ""
  1244. $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'" 
  1245. $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line) 
  1246. $ THEN 
  1247. $   IF .NOT.silent
  1248. $   THEN 
  1249. $     echo "%Config-I-VMS, Will try cc/decc..."
  1250. $   ENDIF
  1251. $   DEFINE SYS$ERROR _NLA0:
  1252. $   DEFINE SYS$OUTPUT _NLA0:
  1253. $   SET NOON
  1254. $   cc/decc/NoObj/list=ccvms.lis ccvms.c
  1255. $   tmp = $status
  1256. $   DEASSIGN SYS$OUTPUT
  1257. $   DEASSIGN SYS$ERROR
  1258. $   SET ON
  1259. $   IF (silent) THEN GOSUB Shut_up
  1260. $   IF tmp.NE.%X10B90001
  1261. $   THEN
  1262. $     echo "%Config-I-VMS, Apparently you don't have that one."
  1263. $   ELSE
  1264. $     GOSUB List_parse
  1265. $     echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
  1266. $     vms_cc_available = vms_cc_available + "cc/decc "
  1267. $   ENDIF
  1268. $ ELSE
  1269. $   IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
  1270. $   THEN 
  1271. $     vms_cc_dflt = "/decc"
  1272. $     vms_cc_available = vms_cc_available + "cc/decc "
  1273. $   ENDIF
  1274. $ ENDIF
  1275. $!
  1276. $Gcc_initial_check:
  1277. $ echo "%Config-I-VMS, Checking for Gcc"
  1278. $ OPEN/WRITE CONFIG gccvers.lis
  1279. $ DEFINE SYS$ERROR CONFIG
  1280. $ DEFINE SYS$OUTPUT CONFIG
  1281. $ 'gcc_symbol'/noobj/version _nla0:
  1282. $ tmp = $status
  1283. $ DEASSIGN SYS$OUTPUT
  1284. $ DEASSIGN SYS$ERROR
  1285. $ IF (silent) THEN GOSUB Shut_up
  1286. $ CLOSE CONFIG
  1287. $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
  1288. $ THEN
  1289. $   echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
  1290. $   goto cc_cleanup
  1291. $ ENDIF
  1292. $ OPEN/READ CONFIG gccvers.lis
  1293. $GCC_List_Read:
  1294. $ READ/END_OF_FILE=GCC_List_End CONFIG line
  1295. $ GOTO GCC_List_Read
  1296. $GCC_List_End:
  1297. $ CLOSE CONFIG
  1298. $ echo line
  1299. $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
  1300. $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
  1301. $!
  1302. $CC_Cleanup:
  1303. $ DELETE/NOLOG/NOCONFIRM ccvms.*;
  1304. $CC_Desired:
  1305. $!: see if we need a special compiler
  1306. $! echo ""
  1307. $ echo "%Config-I-VMS, available compiler(s):"
  1308. $ echo "( ''vms_cc_available')"
  1309. $ IF .NOT.nocc 
  1310. $ THEN
  1311. $   dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
  1312. $ ELSE
  1313. $   dflt = gcc_symbol
  1314. $ ENDIF
  1315. $ rp = "Use which C compiler? [''dflt'] "
  1316. $ GOSUB myread
  1317. $ IF ans.NES.""
  1318. $ THEN
  1319. $   ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
  1320. $   Mcc = ans
  1321. $   IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
  1322. $   THEN
  1323. $     Mcc = "cc/decc"
  1324. $     Using_Dec_C = "Yes"
  1325. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1326. $   ENDIF
  1327. $   IF Mcc.NES.dflt
  1328. $   THEN
  1329. $     IF (F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)).or(F$LOCATE("compaq",dflt).NE.F$LENGTH(dflt))
  1330. $     THEN 
  1331. $       C_COMPILER_Replace = "CC=cc=''Mcc'"
  1332. $     ELSE
  1333. $       Using_Dec_C = "Yes"
  1334. $     ENDIF
  1335. $   ELSE
  1336. $     IF Mcc .EQS. "cc/decc"
  1337. $     THEN
  1338. $       Using_Dec_C = "Yes"
  1339. $       C_COMPILER_Replace = "CC=cc=''Mcc'"
  1340. $     ENDIF
  1341. $   ENDIF
  1342. $ ELSE 
  1343. $   Mcc = dflt
  1344. $   IF Mcc .EQS. "cc/decc"
  1345. $   THEN
  1346. $     Using_Dec_C = "Yes"
  1347. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1348. $   ENDIF
  1349. $   IF Mcc .EQS. "gcc"
  1350. $   THEN
  1351. $     Using_Gnu_C = "Yes"
  1352. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1353. $   ENDIF
  1354. $ ENDIF
  1355. $Decc_Version_check:
  1356. $ IF "''Using_Dec_C'".EQS."Yes"
  1357. $ THEN
  1358. $   echo ""
  1359. $   echo4 "Checking for Dec C's version number..." !>&4
  1360. $   OPEN/WRITE CONFIG deccvers.c
  1361. $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1362. $   WRITE CONFIG "#include <stdio.h>"
  1363. $   WRITE CONFIG "int main() {"
  1364. $   WRITE CONFIG "#ifdef __DECC"
  1365. $   WRITE CONFIG "#ifdef __DECC_VER"
  1366. $   WRITE CONFIG "        printf(""%i\n"", __DECC_VER);"
  1367. $   WRITE CONFIG "#else"
  1368. $   WRITE CONFIG "        printf(""%i\n"", ""1"");"
  1369. $   WRITE CONFIG "#endif"
  1370. $   WRITE CONFIG "#endif"
  1371. $   WRITE CONFIG "        exit(0);"
  1372. $   WRITE CONFIG "}"
  1373. $   CLOSE CONFIG
  1374. $   DEFINE SYS$ERROR _NLA0:
  1375. $   DEFINE SYS$OUTPUT _NLA0:
  1376. $   'Mcc' deccvers.c
  1377. $   tmp = $status
  1378. $   DEASSIGN SYS$ERROR _NLA0:
  1379. $   DEASSIGN SYS$OUTPUT _NLA0:
  1380. $   IF (silent) THEN GOSUB Shut_up
  1381. $   DEFINE SYS$ERROR _NLA0:
  1382. $   DEFINE SYS$OUTPUT _NLA0:
  1383. $   link deccvers.obj
  1384. $   tmp = $status
  1385. $   DEASSIGN SYS$ERROR
  1386. $   DEASSIGN SYS$OUTPUT
  1387. $   IF (silent) THEN GOSUB Shut_up
  1388. $   OPEN/WRITE CONFIG deccvers.out
  1389. $   DEFINE SYS$ERROR CONFIG
  1390. $   DEFINE SYS$OUTPUT CONFIG
  1391. $   mcr []deccvers.exe
  1392. $   tmp = $status
  1393. $   CLOSE CONFIG
  1394. $   DEASSIGN SYS$OUTPUT
  1395. $   DEASSIGN SYS$ERROR
  1396. $   IF (silent) THEN GOSUB Shut_up
  1397. $   OPEN/READ CONFIG deccvers.out
  1398. $   READ/END_OF_FILE=Dec_c_cleanup CONFIG line
  1399. $Dec_c_cleanup:
  1400. $   CLOSE CONFIG
  1401. $!   DELETE/NOLOG/NOCONFIRM deccvers.*;
  1402. $   echo "You are using Dec C ''line'"
  1403. $   Dec_C_Version = line
  1404. $   Dec_C_Version = Dec_C_Version + 0
  1405. $   if Dec_C_Version.ge.60200000 THEN CC_FLAGS = CC_FLAGS + "/NOANSI_ALIAS"
  1406. $ ENDIF
  1407. $Gcc_check:
  1408. $ if "''using_gnu_c'" .eqs. "Yes"
  1409. $ THEN
  1410. $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
  1411. $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
  1412. $ gcclib_olb  = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
  1413. $ IF gcclib_olb .EQS. "" 
  1414. $ THEN 
  1415. $! These objects/libs come w/ gcc 2.7.2 for AXP:
  1416. $   tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
  1417. $   IF tmp .NES. "" then gcclib_olb = tmp
  1418. $   tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
  1419. $   IF tmp .NES. "" 
  1420. $   THEN 
  1421. $     IF gcclib_olb .EQS. "" 
  1422. $     THEN gcclib_olb = tmp
  1423. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1424. $     ENDIF
  1425. $   ENDIF
  1426. $   tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
  1427. $   IF tmp .NES. "" 
  1428. $   THEN 
  1429. $     IF gcclib_olb .EQS. "" 
  1430. $     THEN gcclib_olb = tmp
  1431. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1432. $     ENDIF
  1433. $   ENDIF
  1434. $   tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
  1435. $   IF tmp .NES. "" 
  1436. $   THEN 
  1437. $     IF gcclib_olb .EQS. "" 
  1438. $     THEN gcclib_olb = tmp
  1439. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1440. $     ENDIF
  1441. $   ENDIF
  1442. $   IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
  1443. $ ELSE
  1444. $   gcclib_olb = gcclib_olb + "/lib"
  1445. $ ENDIF
  1446. $ IF   gcclib_olb .NES. "" .AND. -
  1447.      (vaxcrtl_olb .NES. "" .OR. -
  1448.       vaxcrtl_exe .NES. "" )
  1449. $ THEN
  1450. $   echo ""
  1451. $   echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
  1452. $   OPEN/WRITE CONFIG gccvers.c
  1453. $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1454. $   WRITE CONFIG "#include <stdio.h>"
  1455. $   WRITE CONFIG "int main() {"
  1456. $   WRITE CONFIG "#ifdef __GNUC__"
  1457. $   WRITE CONFIG "#ifdef __VERSION__"
  1458. $   WRITE CONFIG "        printf(""%s\n"", __VERSION__);"
  1459. $   WRITE CONFIG "#else"
  1460. $   WRITE CONFIG "        printf(""%s\n"", ""1"");"
  1461. $   WRITE CONFIG "#endif"
  1462. $   WRITE CONFIG "#endif"
  1463. $   WRITE CONFIG "        exit(0);"
  1464. $   WRITE CONFIG "}"
  1465. $   CLOSE CONFIG
  1466. $   DEFINE SYS$ERROR _NLA0:
  1467. $   DEFINE SYS$OUTPUT _NLA0:
  1468. $   'Mcc' gccvers.c
  1469. $   tmp = $status
  1470. $   DEASSIGN SYS$ERROR _NLA0:
  1471. $   DEASSIGN SYS$OUTPUT _NLA0:
  1472. $   IF (silent) THEN GOSUB Shut_up
  1473. $   DEFINE SYS$ERROR _NLA0:
  1474. $   DEFINE SYS$OUTPUT _NLA0:
  1475. $   IF vaxcrtl_exe .EQS. ""
  1476. $   THEN 
  1477. $     IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
  1478. $     THEN 
  1479. $       link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
  1480. $       tmp = $status
  1481. $     ELSE
  1482. $       link gccvers.obj,'gcclib_olb'
  1483. $       tmp = $status
  1484. $     ENDIF
  1485. $   ELSE
  1486. $     OPEN/WRITE CONFIG GCCVERS.OPT
  1487. $     WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
  1488. $     CLOSE CONFIG
  1489. $     link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
  1490. $     tmp = $status
  1491. $   ENDIF
  1492. $   DEASSIGN SYS$ERROR
  1493. $   DEASSIGN SYS$OUTPUT
  1494. $   IF (silent) THEN GOSUB Shut_up
  1495. $   OPEN/WRITE CONFIG gccvers.out
  1496. $   DEFINE SYS$ERROR CONFIG
  1497. $   DEFINE SYS$OUTPUT CONFIG
  1498. $   mcr []gccvers.exe
  1499. $   tmp = $status
  1500. $   CLOSE CONFIG
  1501. $   DEASSIGN SYS$OUTPUT
  1502. $   DEASSIGN SYS$ERROR
  1503. $   IF (silent) THEN GOSUB Shut_up
  1504. $   OPEN/READ CONFIG gccvers.out
  1505. $   READ/END_OF_FILE=Gcc_cleanup CONFIG line
  1506. $Gcc_cleanup:
  1507. $   CLOSE CONFIG
  1508. $   DELETE/NOLOG/NOCONFIRM gccvers.*;
  1509. $   IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
  1510. $   THEN 
  1511. $     echo "You are not using GNU cc."
  1512. $     GOTO Host_name
  1513. $   ELSE 
  1514. $     echo "You are using GNU cc ''line'"
  1515. $     Using_Gnu_C = "Yes"
  1516. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1517. $     GOTO Include_dirs
  1518. $   ENDIF
  1519. $ ENDIF
  1520. $endif
  1521. $ GOTO Host_name
  1522. $!
  1523. $List_Parse:
  1524. $ OPEN/READ CONFIG ccvms.lis
  1525. $ READ CONFIG line
  1526. $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
  1527. $ THEN
  1528. $   read CONFIG line
  1529. $   archsufx = "VAX"
  1530. $ ELSE
  1531. $   archsufx = "AXP"
  1532. $ ENDIF
  1533. $ CLOSE CONFIG
  1534. $ line = F$EDIT(line,"TRIM,COMPRESS")
  1535. $ line = line - "Page 1"           ! occurs at end all compilers
  1536. $ line = line - "CCVMS "           ! filename appears w/ VAXC
  1537. $ line = line - "Source Listing "  ! Seen w/ AXP DECC
  1538. $ tmp = F$EXTRACT(0,20,line)       !timestamp, e.g. "30-JUL-1996 21:12:54 "
  1539. $ line = line - tmp
  1540. $ line = F$EDIT(line,"TRIM")       !bit redundant but we're in no big hurry
  1541. $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
  1542. $ RETURN
  1543. $!
  1544. $Include_dirs:
  1545. $!: What should the include directory be ?
  1546. $ dflt = gcclib_olb 
  1547. $ rp = "Where are the include files you want to use? "
  1548. $ IF f$length( rp + "[''dflt'] " ).gt.76
  1549. $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
  1550. $ ELSE rp = rp + "[''dflt'] "
  1551. $ ENDIF
  1552. $ GOSUB myread
  1553. $ usrinc = ans
  1554. $!
  1555. $!: see if we have to deal with yellow pages, now NIS.
  1556. $!: now get the host name
  1557. $Host_name:
  1558. $ echo ""
  1559. $ echo4 "Figuring out host name..." !>&4
  1560. $ myhostname = ""
  1561. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
  1562. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
  1563. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
  1564. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
  1565. $  IF myhostname.eqs."".and. -
  1566.       F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
  1567.       F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN - 
  1568.      myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN") 
  1569. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
  1570. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
  1571. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
  1572. $  IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
  1573. $!: you do not want to know about this
  1574. $!: verify guess
  1575. $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
  1576. $ GOSUB myread
  1577. $ IF (.not.ans).and.(ans.NES."")
  1578. $   THEN 
  1579. $     READ SYS$COMMAND/PROMPT= - 
  1580.  "Please type the (one word) name of your host: " ans
  1581. $     myhostname = ans
  1582. $ ENDIF
  1583. $!: translate upper to lower if necessary
  1584. $ myhostname = F$EDIT(myhostname,"COLLAPSE")
  1585. $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
  1586. $ IF mylowhostname.NES.myhostname
  1587. $ THEN
  1588. $   echo "(Normalizing case in your host name)"
  1589. $   myhostname = mylowhostname
  1590. $ ENDIF
  1591. $!
  1592. $ fp = F$LOCATE(".",myhostname)
  1593. $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
  1594. $ IF mydomain.NES.""  !no periods in DECnet names like "MYDECNODE::"
  1595. $ THEN
  1596. $   rp = "What is your domain name? [''mydomain'] "
  1597. $   GOSUB myread
  1598. $   IF ans .nes. "" THEN mydomain = ans
  1599. $!: translate upper to lower if necessary
  1600. $   mydomain = F$EDIT(mydomain,"COLLAPSE")
  1601. $   mylowdomain = F$EDIT(mydomain," LOWERCASE")
  1602. $   IF mylowdomain.NES.mydomain
  1603. $   THEN
  1604. $     echo "(Normalizing case in your domain name)"
  1605. $     mydomain = mylowdomain
  1606. $   ENDIF
  1607. $ ENDIF
  1608. $ myhostname = myhostname - mydomain
  1609. $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
  1610. $ IF .NOT.silent 
  1611. $ THEN TYPE SYS$INPUT:
  1612.  
  1613. I need to get your e-mail address in Internet format if possible, i.e.
  1614. something like user@host.domain. Please answer accurately since I have
  1615. no easy means to double check it. The default value provided below
  1616. is most probably close to the reality but may not be valid from outside
  1617. your organization...
  1618. $ ENDIF
  1619. $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
  1620. $ rp = "What is your e-mail address? [''dflt'] "
  1621. $ GOSUB myread
  1622. $ IF ans .nes. ""
  1623. $ THEN cf_email = ans
  1624. $ ELSE cf_email = dflt
  1625. $ ENDIF
  1626. $!
  1627. $ IF .NOT.silent 
  1628. $ THEN TYPE SYS$INPUT:
  1629.  
  1630. If you or somebody else will be maintaining perl at your site, please
  1631. fill in the correct e-mail address here so that they may be contacted
  1632. if necessary. Currently, the "perlbug" program included with perl
  1633. will send mail to this address in addition to perlbug@perl.com. You may
  1634. enter "none" for no administrator.
  1635. $ ENDIF
  1636. $ dflt = "''cf_email'"
  1637. $ rp = "Perl administrator e-mail address [''dflt'] "
  1638. $ GOSUB myread
  1639. $ IF ans .nes. ""
  1640. $ THEN perladmin = ans
  1641. $ ELSE perladmin = dflt
  1642. $ ENDIF
  1643. $!
  1644. $!: determine where public executable scripts go
  1645. $!: determine perl absolute location
  1646. $!: figure out how to guarantee perl startup
  1647. $!
  1648. $!: see how we invoke the C preprocessor
  1649. $! echo ""
  1650. $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
  1651. $!: Set private lib path
  1652. $!: Now check and see which directories actually exist, avoiding duplicates
  1653. $!: determine optimize, if desired, or use for debug flag also
  1654. $!: We will not override a previous value, but we might want to
  1655. $!: augment a hint file
  1656. $!: the following weeds options from ccflags that are of no interest to cpp
  1657. $!: flags used in final linking phase
  1658. $!: Try to guess additional flags to pick up local libraries.
  1659. $!: coherency check
  1660. $! echo ""
  1661. $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
  1662. $!: compute shared library extension
  1663. $!: Looking for optional libraries
  1664. $!: see if nm is to be used to determine whether a symbol is defined or not
  1665. $!: get list of predefined functions in a handy place
  1666. $!: see if we have sigaction
  1667. $!: see whether socketshr exists
  1668. $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
  1669. $ THEN
  1670. $   has_socketshr     = "T"
  1671. $   echo ""
  1672. $   echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
  1673. $ endif
  1674. $ if (Dec_C_Version .ge. 50200000)
  1675. $ THEN
  1676. $   Has_Dec_C_Sockets = "T"
  1677. $   echo ""
  1678. $   echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
  1679. $ ENDIF
  1680. $ ! Hey, we've got both. Default to Dec C, then, since it's better
  1681. $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
  1682. $ THEN
  1683. $   echo ""
  1684. $   echo "You've got sockets available. Which socket stack do you want to"
  1685. $   echo "build into perl?"
  1686. $   if "''has_dec_c_sockets'".eqs."T"
  1687. $   THEN
  1688. $     dflt = "DECC"
  1689. $   else
  1690. $     dflt = "SOCKETSHR"
  1691. $   endif
  1692. $   rp = "Choose socket stack (NONE"
  1693. $   if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
  1694. $   if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
  1695. $   rp = rp + ") [''dflt'] "
  1696. $   GOSUB myread
  1697. $   IF "''ans'".eqs."" THEN ans = "''dflt'"
  1698. $   has_dec_c_sockets = "F"
  1699. $   has_socketshr = "F"
  1700. $   ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
  1701. $   IF ans.eqs."decc" then has_dec_c_sockets = "T"
  1702. $   IF ans.eqs."socketshr" then has_socketshr = "T"
  1703. $ endif
  1704. $!
  1705. $!
  1706. $! Ask if they want to build with VMS_DEBUG perl
  1707. $ echo ""
  1708. $ echo "Perl can be built to run under the VMS debugger."
  1709. $ echo "You should only select this option if you are debugging"
  1710. $ echo "perl itself.  This can be a useful feature if you are "
  1711. $ echo "embedding perl in a program."
  1712. $ dflt = "n"
  1713. $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
  1714. $ GOSUB myread
  1715. $ IF ans.eqs."" then ans = dflt
  1716. $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
  1717. $ THEN
  1718. $   use_vmsdebug_perl = "Y"
  1719. $   macros = macros + """__DEBUG__=1"","
  1720. $ ELSE
  1721. $   use_vmsdebug_perl = "N"
  1722. $ ENDIF
  1723. $!
  1724. $! Ask if they want to build with DEBUGGING
  1725. $ echo ""
  1726. $ echo "Perl can be built with extra runtime debugging enabled. This
  1727. $ echo "enables the -D switch, at the cost of some performance. It
  1728. $ echo "was mandatory on perl 5.005 and before on VMS, but is now
  1729. $ echo "optional. If you don't generally use it you should probably
  1730. $ echo "leave this off and gain a bit of extra speed.
  1731. $ dflt = "y"
  1732. $ rp = "Build a DEBUGGING version of Perl? [''dflt'] "
  1733. $ GOSUB myread
  1734. $ IF ans.eqs."" then ans = dflt
  1735. $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
  1736. $ THEN
  1737. $   use_debugging_perl = "Y"
  1738. $ ELSE
  1739. $   use_debugging_perl = "N"
  1740. $ ENDIF
  1741. $!
  1742. $! Ask if they want to build with MULTIPLICITY
  1743. $ echo ""
  1744. $ echo "The perl interpreter engine can be built in a way that makes it
  1745. $ echo "possible for a program that embeds perl into it (and yes, you can
  1746. $ echo "do that--it's pretty keen) to have multiple perl interpreters active
  1747. $ echo "at once. There is some performance overhead, however, so you
  1748. $ echo "probably don't want to choose this unless you're going to be doing
  1749. $ echo "funky perl embedding."
  1750. $ dflt = "n"
  1751. $ rp = "Build with MULTIPLICITY? [''dflt'] "
  1752. $ GOSUB myread
  1753. $ if ans.eqs."" then ans = dflt
  1754. $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
  1755. $ THEN
  1756. $   use_multiplicity="Y"
  1757. $ ELSE
  1758. $   use_multiplicity="N"
  1759. $ ENDIF
  1760. $!
  1761. $! Ask if they want to build with 64-bit support
  1762. $ IF (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
  1763. $ THEN
  1764. $   dflt = use64bitint
  1765. $   echo ""
  1766. $   echo "You can have native 64-bit long integers.
  1767. $   echo ""
  1768. $   echo "Perl can be built to take advantage of 64-bit integer types
  1769. $   echo "on some systems, which provide a much larger range for perl's 
  1770. $   echo "mathematical operations.  (Note that does *not* enable 64-bit 
  1771. $   echo "fileops at the moment, as Dec C doesn't do that yet)."
  1772. $   echo "Choosing this option will most probably introduce binary incompatibilities.
  1773. $   echo ""
  1774. $   echo "If this doesn't make any sense to you, just accept the default ''dflt'.
  1775. $   rp = "Try to use 64-bit integers, if available? [''dflt'] "
  1776. $   GOSUB myread
  1777. $   IF ans .EQS. "" THEN ans = dflt
  1778. $   IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
  1779. $   THEN
  1780. $     use64bitint="Y"
  1781. $   ELSE
  1782. $     use64bitint="N"
  1783. $   ENDIF
  1784. $   IF (use64bitint)
  1785. $   THEN
  1786. $     dflt = use64bitall
  1787. $     echo ""
  1788. $     echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
  1789. $     echo "What you have chosen is minimal 64-bitness which means just enough
  1790. $     echo "to get 64-bit integers.  The maximal means using as much 64-bitness
  1791. $     echo "as is possible on the platform.  This in turn means even more binary
  1792. $     echo "incompatibilities.  On the other hand, your platform may not have
  1793. $     echo "any more maximal 64-bitness than what you already have chosen.
  1794. $     echo ""
  1795. $     echo "If this doesn't make any sense to you, just accept the default ''dflt'.
  1796. $     rp = "Try to use full 64-bit support, if available? [''dflt'] "
  1797. $     GOSUB myread
  1798. $     IF ans .EQS. "" THEN ans = dflt
  1799. $     IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
  1800. $     THEN
  1801. $       use64bitall="Y"
  1802. $     ELSE
  1803. $       use64bitall="N"
  1804. $     ENDIF
  1805. $   ENDIF
  1806. $ ENDIF ! AXP && >= 7.1
  1807. $!
  1808. $! Ask about threads, if appropriate
  1809. $ if (Using_Dec_C.eqs."Yes")
  1810. $ THEN
  1811. $   echo ""
  1812. $   echo "This version of Perl can be built with threads. While really nifty,
  1813. $   echo "they are a beta feature, and there is a speed penalty for perl
  1814. $   echo "programs if you build with threads *even if you don't use them*
  1815. $   dflt = "n"
  1816. $   rp = "Build with threads? [''dflt'] "
  1817. $   GOSUB myread
  1818. $   if ans.eqs."" then ans = dflt
  1819. $   if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
  1820. $   THEN
  1821. $     use_threads="T"
  1822. $!
  1823. $     ! Shall we do the 5.005-stype threads, or IThreads?
  1824. $     echo "As of 5.5.640, Perl has two different internal threading
  1825. $     echo "implementations, the 5.005 version (5005threads) and an
  1826. $     echo "interpreter-based version (ithreads) that has one
  1827. $     echo "interpreter per thread.  Both are very experimental.  This
  1828. $     echo "arrangement exists to help developers work out which one
  1829. $     echo "is better.
  1830. $     echo "
  1831. $     echo "If you're a casual user, you probably don't want
  1832. $     echo "interpreter-threads at this time.  There doesn't yet exist
  1833. $     echo "a way to create threads from within Perl in this model,
  1834. $     echo "i.e., ""use Thread;"" will NOT work.
  1835. $     echo "
  1836. $     dflt = "n"
  1837. $     rp = "Build with Interpreter threads? [''dflt']
  1838. $     GOSUB myread
  1839. $     if ans.eqs."" then ans = dflt
  1840. $     if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
  1841. $     THEN
  1842. $       use_ithreads="Y"
  1843. $       use_5005_threads="N"
  1844. $     ELSE
  1845. $       use_ithreads="N"
  1846. $       use_5005_threads="Y"
  1847. $     ENDIF
  1848. $     ! Are they on VMS 7.1 on an alpha?
  1849. $     if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
  1850. $     THEN
  1851. $       echo ""
  1852. $       echo "Threaded perl can be linked to use multiple kernel threads
  1853. $       echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
  1854. $       echo "allows multiple threads to execute simultaneously on an SMP
  1855. $       echo "system as well as preventing a single thread from blocking
  1856. $       echo "all the threads in a program, even on a single-processor
  1857. $       echo "machine. Unfortunately this feature isn't safe on an
  1858. $       echo "unpatched 7.1 system. (Several OS patches were required when
  1859. $       echo "this procedure was written)
  1860. $       dflt = "n"
  1861. $       rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
  1862. $       gosub myread
  1863. $       if ans.eqs."" then ans="''dflt'"
  1864. $       if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
  1865. $       THEN
  1866. $         Thread_Live_Dangerously = "MT=MT=1"
  1867. $       ENDIF
  1868. $     ENDIF
  1869. $   ENDIF
  1870. $ ENDIF
  1871. $ if archname .eqs. "VMS_AXP"
  1872. $ then
  1873. $!
  1874. $! Case sensitive?
  1875. $ echo ""
  1876. $ echo "By default, perl (and pretty much everything else on VMS) uses
  1877. $ echo "case-insensitive linker symbols. Which is to say, when the
  1878. $ echo "underlying C code makes a call to a routine called Perl_foo in
  1879. $ echo "the source, the name in the object modules or shareable images
  1880. $ echo "is really PERL_FOO. There are some packages that use an
  1881. $ echo "embedded perl interpreter that instead require case-sensitive
  1882. $ echo "linker symbols.
  1883. $ echo ""
  1884. $ echo "If you have no idea what this means, and don't have
  1885. $ echo "any program requiring anything, choose the default.
  1886. $ dflt = be_case_sensitive
  1887. $ rp = "Case-sensitive symbols [''dflt'] "
  1888. $ gosub myread
  1889. $ if ans.eqs."" then ans="''dflt'"
  1890. $ be_case_sensitive = "''ans'"
  1891. $!
  1892. $! IEEE math?
  1893. $ echo ""
  1894. $ echo "Perl normally uses G_FLOAT format floating point numbers
  1895. $ echo "internally, as do most things on VMS. You can, however, build
  1896. $ echo "with IEEE floating point numbers instead if you need to.
  1897. $ dflt = use_ieee_math
  1898. $ rp = "Use IEEE math [''dflt'] "
  1899. $ gosub myread
  1900. $ if ans.eqs."" then ans="''dflt'"
  1901. $ use_ieee_math = "''ans'"
  1902. $ endif
  1903. $! CC Flags
  1904. $ echo ""
  1905. $ echo "You can, if you need to, pass extra flags on to the C
  1906. $ echo "compiler. In general you should only do this if you really,
  1907. $ echo "really know what you're doing.
  1908. $ dflt = user_c_flags
  1909. $ rp = "Extra C flags [''dflt'] "
  1910. $ gosub myread
  1911. $ if ans.eqs."" then ans="''dflt'"
  1912. $ user_c_flags = "''ans'"
  1913. $!
  1914. $! Ask whether they want to use secure logical translation when tainting
  1915. $ echo ""
  1916. $ echo "As Perl starts up, it checks several logical names, such as"
  1917. $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
  1918. $ echo "of its behavior.  For additional security, you may limit this"
  1919. $ echo "process to executive- and kernel-mode translation when tainting"
  1920. $ echo "is enabled.  In this case, logical names normally skipped when"
  1921. $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
  1922. $ echo "If you do not choose to do this, the usual order of access modes"
  1923. $ echo "is used for logical name translation."
  1924. $ echo ""
  1925. $ echo "This restriction does not apply to the %ENV hash or to implicit"
  1926. $ echo "logical name translation during parsing of file specifications;"
  1927. $ echo "these always use the normal sequence of access modes for logical"
  1928. $ echo "name translation."
  1929. $ dflt = "y"
  1930. $ rp = "Use secure logical name translation? [''dflt'] "
  1931. $ GOSUB myread
  1932. $ if ans.eqs."" then ans="''dflt'"
  1933. $ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
  1934. $!
  1935. $! Ask whether they want to default filetypes
  1936. $ echo ""
  1937. $ echo "When you pass the name of a program to Perl on the command line,"
  1938. $ echo "it generally doesn't supply any defaults unless the -S command"
  1939. $ echo "line switch is specified.  In keeping with the VMS tradition of"
  1940. $ echo "default file types, however, you can configure Perl to try default"
  1941. $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
  1942. $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
  1943. $ echo "finally foo.com)."
  1944. $ echo ""
  1945. $ echo "This is currently broken in some configurations. Only enable it if
  1946. $ echo "you know what you're doing. "
  1947. $ dflt = "N"
  1948. $ rp = "Always use default file types? [''dflt'] "
  1949. $ GOSUB myread
  1950. $ if ans.eqs."" then ans="''dflt'"
  1951. $ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
  1952. $!
  1953. $! Ask if they want to use perl's memory allocator
  1954. $ echo ""
  1955. $ echo "Perl has a built-in memory allocator that's tuned for perl's
  1956. $ echo "normal memory usage. It's oftentimes better than the standard
  1957. $ echo "system memory allocator. It also has the advantage of providing
  1958. $ echo "memory allocation statistics, if you choose to enable them.
  1959. $ dflt = "n"
  1960. $ rp = "Build with perl's memory allocator? [''dflt'] "
  1961. $ GOSUB myread
  1962. $ if ans.eqs."" then ans="''dflt'"
  1963. $ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
  1964. $ if mymalloc.eqs."Y"
  1965. $ THEN
  1966. $   if use_debugging_perl.eqs."Y"
  1967. $   THEN
  1968. $     echo ""
  1969. $     echo "Perl can keep statistics on memory usage if you choose to use
  1970. $     echo "them. This is useful for debugging, but does have some
  1971. $     echo "performance overhead.
  1972. $     dflt = "n"
  1973. $     rp = "Do you want the debugging memory allocator? [''dflt'] "
  1974. $     gosub myread
  1975. $     if ans.eqs."" then ans="''dflt'"
  1976. $     use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
  1977. $   ENDIF
  1978. $   ! Check which memory allocator we want
  1979. $   echo ""
  1980. $   echo "There are currently three different memory allocators: the
  1981. $   echo "default (which is a pretty good general-purpose memory manager),
  1982. $   echo "the TWO_POT allocator (which is optimized to save memory for
  1983. $   echo "larger allocations), and PACK_MALLOC (which is optimized to save
  1984. $   echo "memory for smaller allocations). They're all good, but if your
  1985. $   echo "usage tends towards larger chunks use TWO_POT, otherwise use
  1986. $   echo "PACK_MALLOC."
  1987. $   dflt = "DEFAULT"
  1988. $   rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
  1989. $   GOSUB myread
  1990. $   if ans.eqs."" then ans = "''dflt'"
  1991. $   if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
  1992. $   if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
  1993. $ ENDIF
  1994. $!
  1995. $! Ask for their default list of extensions to build
  1996. $ echo ""
  1997. $ echo "It's time to specify which modules you want to build into
  1998. $ echo "perl. Most of these are standard and should be chosen, though
  1999. $ echo "you might, for example, want to build GDBM_File instead of
  2000. $ echo "SDBM_File if you have the GDBM library built on your machine.
  2001. $ echo "Whatever you do, make sure the re module is first or things will
  2002. $ echo "break badly"
  2003. $ echo "
  2004. $ echo "Which modules do you want to build into perl?"
  2005. $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
  2006. $ dflt = "re Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs VMS::Stdio VMS::DCLsym B SDBM_File Thread Sys::Hostname"
  2007. $ if Using_Dec_C.eqs."Yes"
  2008. $ THEN
  2009. $   dflt = dflt + " POSIX"
  2010. $ ENDIF
  2011. $ rp = "[''dflt'] "
  2012. $ GOSUB myread
  2013. $ if ans.eqs."" then ans = "''dflt'"
  2014. $ a = ""
  2015. $ j = 0
  2016. $ xloop1:
  2017. $   x = f$elem(j," ",ans)
  2018. $   j = j + 1
  2019. $   if x .eqs. " " then goto exloop1
  2020. $   xloop2:
  2021. $       k = f$locate("::",x)
  2022. $       if k .ge. f$len(x) then goto exloop2
  2023. $       x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
  2024. $   goto xloop2
  2025. $   exloop2:
  2026. $   a = a + " " + x
  2027. $ goto xloop1
  2028. $ exloop1:
  2029. $ ans = f$edit(a,"trim")
  2030. $!
  2031. $ a = ""
  2032. $ j = 0
  2033. $ xloop3:
  2034. $   x = f$elem(j," ",dflt)
  2035. $   j = j + 1
  2036. $   if x .eqs. " " then goto exloop3
  2037. $   xloop4:
  2038. $       k = f$locate("::",x)
  2039. $       if k .ge. f$len(x) then goto exloop4
  2040. $       x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
  2041. $   goto xloop4
  2042. $   exloop4:
  2043. $   a = a + " " + x
  2044. $ goto xloop3
  2045. $ exloop3:
  2046. $ dflt = f$edit(a,"trim")
  2047. $!
  2048. $ extensions = "''ans'"
  2049. $ perl_known_extensions = "''dflt'"
  2050. $!
  2051. $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
  2052. $ echo ""
  2053. $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
  2054. $! If the 'build' that you use is not here add it and it's test
  2055. $! switch to the _END_ of these strings (and increment max_build)
  2056. $! (e.g. builders = builders + "/FOOMAKE" 
  2057. $!       probers  = probers + " -fooVersionSwitch"
  2058. $! ) & please let me know about it.
  2059. $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
  2060. $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
  2061. $ max_build = 7
  2062. $!
  2063. $ orig_dflt = "MMK"
  2064. $ default_set = ""
  2065. $ ok_builders = ""
  2066. $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
  2067. $ WRITE CONFIG "dont_make_anything_yet:"
  2068. $ WRITE CONFIG F$FAO("!_")
  2069. $ CLOSE CONFIG
  2070. $ n = 0
  2071. $ messages = F$ENVIRONMENT("MESSAGE")
  2072. $Build_probe:
  2073. $ build = F$ELEMENT(n,"/",builders)
  2074. $ probe  = F$ELEMENT(n,"!",probers)
  2075. $ echo "Testing whether you have ''build' on your system..."
  2076. $ SET NOON
  2077. $ ON CONTROL_Y THEN GOTO Reenable_messages_build
  2078. $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
  2079. $ 'build' 'probe'
  2080. $ IF ($SEVERITY .EQ. 1)
  2081. $ THEN 
  2082. $   echo "OK."
  2083. $   IF (build .EQS. orig_dflt) 
  2084. $   THEN 
  2085. $     default_set = "TRUE"
  2086. $     dflt = build
  2087. $   ENDIF
  2088. $   ok_builders = ok_builders + " " + build
  2089. $   IF (.NOT. default_set) THEN dflt = build
  2090. $ ELSE 
  2091. $   echo "Nope."
  2092. $ ENDIF
  2093. $Reenable_messages_build:
  2094. $ SET MESSAGE 'messages'
  2095. $ SET ON
  2096. $ n = n + 1
  2097. $ IF (n .LT. max_build) THEN GOTO Build_probe
  2098. $!
  2099. $ echo ""
  2100. $ IF (ok_builders .NES. "") 
  2101. $ THEN
  2102. $   echo "Here is the list of builders you can apparently use:"
  2103. $   echo "(",ok_builders," )"
  2104. $   rp = "Which """"make"""" utility do you wish to use [''dflt']? "
  2105. $   GOSUB myread
  2106. $   ans = F$EDIT(ans,"TRIM, COMPRESS")
  2107. $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
  2108. $   IF (ans .EQS. "") 
  2109. $   THEN build = dflt
  2110. $   ELSE build = ans
  2111. $   ENDIF
  2112. $ ELSE
  2113. $   TYPE SYS$INPUT:
  2114.  
  2115. %Config-E-VMS, ERROR:
  2116.  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
  2117.  utility of some sort and after checking my "builders" list I cannot find
  2118.  the symbol or command you use on your system to compile programs.
  2119.  
  2120. $   READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
  2121. $   ans = F$EDIT(ans,"TRIM, COMPRESS")
  2122. $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
  2123. $   IF (ans .EQS. "") 
  2124. $   THEN build = dflt
  2125. $     echo "I don't know where 'make' is, and my life depends on it."
  2126. $     echo "Go find a make program or fix your DCL$PATH setting!"
  2127. $     echo "ABORTING..."
  2128. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  2129. $     STOP
  2130. $     EXIT 2 !$STATUS = "%X00000002" (error)
  2131. $   ELSE 
  2132. $     build = ans
  2133. $   ENDIF
  2134. $ ENDIF
  2135. $!
  2136. $ DELETE/NOLOG Makefile.;
  2137. $ GOTO Beyond_open
  2138. $Open_error:
  2139. $ TYPE SYS$INPUT:
  2140.  
  2141.  There seems to be trouble. I just tried to create a file in
  2142. $ echo4 'F$ENVIRONMENT("DEFAULT")'
  2143. $ TYPE SYS$INPUT:
  2144.  but was unsuccessful. I am stopping now. Please check that directories'
  2145.  PROTECTION bits. I will leave you in the directory where you started
  2146.  Configure.com
  2147. $ echo4 "ABORTING..."
  2148. $ GOTO Clean_up
  2149. $ STOP
  2150. $ EXIT
  2151. $!
  2152. $Beyond_open:
  2153. $! echo " Very well I will proceed with ""''build'"""
  2154. $ make = F$EDIT(build,"UPCASE")
  2155. $!
  2156. $!: locate the preferred pager for this system
  2157. $!pagers = "most|more|less|type/page"
  2158. $!rp='What pager is used on your system?'
  2159. $!
  2160. $! update [.vms]config.vms here
  2161. $!
  2162. $! update makefile here
  2163. $! echo4 "Updating makefile..."
  2164. $!
  2165. $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
  2166. $ THEN 
  2167. $   makefile    = ""            !wrt MANIFEST dir
  2168. $   UUmakefile  = "[-]DESCRIP.MMS" !wrt CWD dir
  2169. $   DEFmakefile = "DESCRIP.MMS"    !wrt DEF dir (?)
  2170. $ ELSE
  2171. $   makefile    = " -f Makefile."  !wrt MANIFEST dir
  2172. $   UUmakefile  = "[-]Makefile."   !wrt CWD dir
  2173. $   DEFmakefile = "Makefile."      !wrt DEF dir (?)
  2174. $ ENDIF
  2175. $!
  2176. $ IF macros.NES."" 
  2177. $ THEN 
  2178. $   tmp = F$LENGTH(macros)
  2179. $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
  2180. $   macros = "/macro=(" + macros  + ")"
  2181. $ ENDIF
  2182. $! Build up the extra C flags
  2183. $!
  2184. $ if use_ieee_math
  2185. $ then
  2186. $   extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
  2187. $ endif
  2188. $ if be_case_sensitive
  2189. $ then
  2190. $   extra_flags = "''extra_flags'" + "/Names=As_Is"
  2191. $ endif
  2192. $ extra_flags = "''extra_flags'" + "''user_c_flags'"
  2193. $!
  2194. $! Invoke the subconfig piece
  2195. $!
  2196. $ echo ""
  2197. $ echo4 "Checking the C run-time library"
  2198. $ dflt = F$ENVIRONMENT("DEFAULT")
  2199. $ SET DEFAULT [-.vms]
  2200. $ @subconfigure
  2201. $ SET DEFAULT 'dflt
  2202. $!
  2203. $!  Warn of dangerous symbols or logical names
  2204. $!
  2205. $Bad_environment: SUBROUTINE
  2206. $   Bad_env = ""
  2207. $   IF p2 .eqs. "SYMBOL"
  2208. $   THEN
  2209. $     IF f$type('p1) .nes. "" THEN  Bad_env := SYMBOL
  2210. $   ELSE
  2211. $     IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
  2212. $   ENDIF
  2213. $   IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
  2214. $   THEN
  2215. $     IF f$search("config.msg") .nes. ""
  2216. $     THEN
  2217. $       OPEN/APPEND CONFIG config.msg
  2218. $     ELSE
  2219. $       OPEN/WRITE CONFIG config.msg
  2220. $     ENDIF
  2221. $     IF Bad_env .eqs. "SYMBOL"
  2222. $     THEN
  2223. $       WRITE CONFIG ""
  2224. $       WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
  2225. $       WRITE CONFIG " delete before building ''package' via:"
  2226. $       WRITE CONFIG "     $ DELETE/SYMBOL/GLOBAL ''p1'"
  2227. $       IF f$locate("""",&p1) .ge. f$length(&p1)
  2228. $       THEN
  2229. $       WRITE CONFIG " after building, testing, and installing ''package'
  2230. $       WRITE CONFIG " restore the symbol with:"
  2231. $       WRITE CONFIG "     $ ''p1' == """ + &p1 + """"
  2232. $       ENDIF
  2233. $     ENDIF
  2234. $     IF Bad_env .eqs. "LOGICAL"
  2235. $     THEN
  2236. $       WRITE CONFIG ""
  2237. $       WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
  2238. $       WRITE CONFIG " deassign before building ''package'"
  2239. $     ENDIF
  2240. $     CLOSE CONFIG
  2241. $     Bad_env = ""
  2242. $   ENDIF
  2243. $ EXIT
  2244. $ ENDSUBROUTINE ! Bad_environment
  2245. $ echo ""
  2246. $ echo4 "%Config-I-VMS, Checking for dangerous pre-existing global symbols and logical names."
  2247. $ CALL Bad_environment "TMP"
  2248. $ CALL Bad_environment "LIB"
  2249. $ CALL Bad_environment "T"
  2250. $ CALL Bad_environment "FOO"
  2251. $ CALL Bad_environment "EXT"
  2252. $ CALL Bad_environment "TEST" "SYMBOL"
  2253. $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
  2254. $!
  2255. $! %Config-I-VMS, write perl_setup.com here
  2256. $!
  2257. $ IF (.NOT.perl_symbol)
  2258. $ THEN
  2259. $   file_2_find = "[-]''packageup'.cld"
  2260. $   echo ""
  2261. $   echo4 "%Config-I-VMS, The perl.cld file is now being written..."
  2262. $   OPEN/WRITE CONFIG 'file_2_find'
  2263. $   ext = ".exe"
  2264. $   IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
  2265. $   IF (use_vmsdebug_perl)
  2266. $   THEN
  2267. $     WRITE CONFIG "define verb dbgperl"
  2268. $     WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]dbgperl''ext'")
  2269. $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
  2270. $     WRITE CONFIG ""
  2271. $     WRITE CONFIG "define verb perl"
  2272. $     WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]ndbgPerl''ext'")
  2273. $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
  2274. $   ELSE
  2275. $     WRITE CONFIG "define verb perl"
  2276. $     WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]perl''ext'")
  2277. $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
  2278. $   ENDIF
  2279. $   CLOSE CONFIG
  2280. $ ENDIF ! (.NOT.perl_symbol)
  2281. $ echo ""
  2282. $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
  2283. $ file_2_find = "[-]perl_setup.com"
  2284. $ OPEN/WRITE CONFIG 'file_2_find'
  2285. $ WRITE CONFIG "$!"
  2286. $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
  2287. $ IF cf_email.NES.perladmin
  2288. $ THEN
  2289. $ WRITE CONFIG "$! perl configured by ''cf_email'"
  2290. $ ELSE
  2291. $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
  2292. $ ENDIF
  2293. $ WRITE CONFIG "$!"
  2294. $ prefix = prefix - "000000."
  2295. $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
  2296.     prefix = prefix - "]" + ".]" 
  2297. $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
  2298. $ WRITE CONFIG "$ ext = "".exe"""
  2299. $ IF sharedperl .EQS. "Y"
  2300. $ THEN
  2301. $   write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
  2302. $ ENDIF
  2303. $ IF (perl_symbol)
  2304. $ THEN
  2305. $   IF (use_vmsdebug_perl)
  2306. $   THEN
  2307. $     WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
  2308. $     WRITE CONFIG "$ perl    :== $Perl_Root:[000000]ndbgPerl'ext'"
  2309. $     WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
  2310. $   ELSE
  2311. $     WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
  2312. $     WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
  2313. $   ENDIF
  2314. $ ELSE ! .NOT.perl_symbol
  2315. $   IF (use_vmsdebug_perl)
  2316. $   THEN
  2317. $     WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
  2318. $   ELSE
  2319. $     WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
  2320. $   ENDIF
  2321. $   IF perl_verb .EQS. "PROCESS"
  2322. $   THEN
  2323. $     WRITE CONFIG "$ set command ''packagup'_ROOT:[000000]''packageup'.CLD"
  2324. $   ENDIF
  2325. $ ENDIF !  perl_symbol
  2326. $ WRITE CONFIG "$ define/nolog pod2text Perl_Root:[lib.pod]pod2text.com"
  2327. $ WRITE CONFIG "$ define/nolog pod2html Perl_Root:[lib.pod]pod2html.com"
  2328. $ WRITE CONFIG "$ define/nolog pod2man  Perl_Root:[lib.pod]pod2man.com"
  2329. $!
  2330. $ IF (tzneedset)
  2331. $ THEN
  2332. $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
  2333. $ ELSE    !leave in but commented out (in case setting was from perl :-)
  2334. $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
  2335. $ ENDIF
  2336. $ WRITE CONFIG "$!"
  2337. $ WRITE CONFIG "$! Symbols for commonly used scripts:"
  2338. $ WRITE CONFIG "$!"
  2339. $ IF (perl_symbol)
  2340. $ THEN
  2341. $   WRITE CONFIG "$ Perldoc  == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
  2342. $   WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
  2343. $   WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
  2344. $   WRITE CONFIG "$ pod2latex == ""'"+"'Perl' Perl_Root:[lib.pod]pod2latex.com"""
  2345. $   WRITE CONFIG "$!pod2man  == ""'"+"'Perl' pod2man"""
  2346. $   WRITE CONFIG "$!Perlbug  == ""'"+"'Perl' Perl_Root:[lib]Perlbug.com"""
  2347. $   WRITE CONFIG "$ c2ph     == ""'"+"'Perl' Perl_Root:[utils]c2ph.com"""
  2348. $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
  2349. $   THEN
  2350. $     WRITE CONFIG "$ dprofpp     == ""'"+"'Perl' Perl_Root:[utils]dprofpp.com"""
  2351. $   ENDIF 
  2352. $   WRITE CONFIG "$ h2ph     == ""'"+"'Perl' Perl_Root:[utils]h2ph.com"""
  2353. $   WRITE CONFIG "$ h2xs     == ""'"+"'Perl' Perl_Root:[utils]h2xs.com"""
  2354. $   WRITE CONFIG "$!perlcc   == ""'"+"'Perl' Perl_Root:[utils]perlcc.com"""
  2355. $   WRITE CONFIG "$ splain   == ""'"+"'Perl' Perl_Root:[utils]splain.com"""
  2356. $ ELSE
  2357. $   WRITE CONFIG "$ Perldoc  == ""Perl Perl_Root:[lib.pod]Perldoc.com -t"""
  2358. $   WRITE CONFIG "$ pod2text == ""Perl pod2text"""
  2359. $   WRITE CONFIG "$ pod2html == ""Perl pod2html"""
  2360. $   WRITE CONFIG "$ pod2latex == ""Perl Perl_Root:[lib.pod]pod2latex.com"""
  2361. $   WRITE CONFIG "$!pod2man  == ""Perl pod2man"""
  2362. $   WRITE CONFIG "$!Perlbug  == ""Perl Perl_Root:[lib]Perlbug.com"""
  2363. $   WRITE CONFIG "$ c2ph     == ""Perl Perl_Root:[utils]c2ph.com"""
  2364. $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
  2365. $   THEN
  2366. $     WRITE CONFIG "$ dprofpp     == ""Perl Perl_Root:[utils]dprofpp.com"""
  2367. $   ENDIF 
  2368. $   WRITE CONFIG "$ h2ph     == ""Perl Perl_Root:[utils]h2ph.com"""
  2369. $   WRITE CONFIG "$ h2xs     == ""Perl Perl_Root:[utils]h2xs.com"""
  2370. $   WRITE CONFIG "$!perlcc   == ""Perl Perl_Root:[utils]perlcc.com"""
  2371. $   WRITE CONFIG "$ splain   == ""Perl Perl_Root:[utils]splain.com"""
  2372. $ ENDIF
  2373. $ CLOSE CONFIG
  2374. $!
  2375. $ echo  ""
  2376. $ echo  "%Config-I-VMS, The file can be found at:"
  2377. $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
  2378. $ echo  "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
  2379. $ echo  "-Config-I-VMS, when you are satisfied with a successful compilation,"
  2380. $ echo  "-Config-I-VMS, testing, and installation of your perl."
  2381. $ echo  ""
  2382. $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
  2383. $ THEN
  2384. $   file_2_find = "[-]''packageup'_install.com"
  2385. $   OPEN/WRITE CONFIG 'file_2_find
  2386. $   WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
  2387. $   WRITE CONFIG "    /output=sys$common:[syslib]dcltables.exe"
  2388. $   WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
  2389. $   CLOSE CONFIG
  2390. $   echo4 ""
  2391. $   echo4 "%Config-I-VMS, In order to install the ''packageup' verb into DCLTABLES run:"
  2392. $   echo4 "-Config-I-VMS, @ ''F$SEARCH(file_2_find)'"
  2393. $   echo4 "-Config-I-VMS, after a successful build, test, and install.  Do so with CMKRNL privilege."
  2394. $   echo4 ""
  2395. $ ENDIF
  2396. $!
  2397. $!figure out where we "are" by parsing 'vms_default_directory_name' 
  2398. $!
  2399. $ set_def_command = ""
  2400. $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
  2401. $ tmp = vms_default_directory_name - dflt - "]"
  2402. $ i = 0
  2403. $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
  2404. $Set_def_loop:
  2405. $ tmp1 = F$ELEMENT(i,".",tmp)
  2406. $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
  2407. $ IF i .EQ. 0 
  2408. $ THEN set_def_command = "set default [-"
  2409. $ ELSE set_def_command = set_def_command + "-"
  2410. $ ENDIF
  2411. $ i = i + 1
  2412. $ GOTO Set_def_loop
  2413. $Beyond_set_def_loop:
  2414. $ IF set_def_command.NES.""
  2415. $ THEN
  2416. $   set_def_command = set_def_command - "-" + "]"
  2417. $   echo4 ""
  2418. $   echo4 "In order to build ''package' you must now issue the commands:"
  2419. $   echo4 ""
  2420. $   echo4 " ''set_def_command'"
  2421. $ ELSE
  2422. $   echo4 ""
  2423. $   echo4 "In order to build ''package' you must now issue the command:"
  2424. $   echo4 ""
  2425. $ ENDIF
  2426. $ echo4 " ''make'''makefile'", macros
  2427. $ echo4 ""
  2428. $!
  2429. $ IF ( F$SEARCH("config.msg").NES."" ) 
  2430. $ THEN
  2431. $   echo "Hmm.  I also noted the following information while running:"
  2432. $   echo ""
  2433. $   type config.msg
  2434. $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
  2435. $   DELETE/NOLOG/NOCONFIRM config.msg;
  2436. $ ENDIF
  2437. $!
  2438. $Clean_up:
  2439. $ IF (silent)
  2440. $ THEN
  2441. $   DEASSIGN SYS$OUTPUT
  2442. $!   DEASSIGN SYS$ERROR
  2443. $ ENDIF
  2444. $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
  2445. $ IF F$GETJPI("","FILCNT").NE.vms_filcnt 
  2446. $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
  2447. $ ENDIF
  2448. $ dflt = F$ENVIRONMENT("DEFAULT")
  2449. $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
  2450. $ THEN
  2451. $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
  2452. $   SET DEFAULT [-]
  2453. $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
  2454. $   DELETE/NOLOG/NOCONFIRM UU.DIR;
  2455. $ ENDIF
  2456. $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
  2457. $ STOP
  2458. $ EXIT
  2459. $!: End of Configure
  2460.