1 $ sav_ver = 'F$VERIFY(0)'
4 $! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will
5 $! want to cd into the tree and execute Configure:
7 $! $ SET DEFAULT [USER.PERL5_xxx]
12 $! $ SET DEFAULT [USER.PERL5_xxx]
13 $! $ @Configure "-des"
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
19 $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 $! send suggestions to:
22 $! Dan Sugalski <dan@sidhe.org>
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
34 $ sav_ver = F$VERIFY(sav_ver)
36 $! VMS-isms we will need:
37 $ echo = "write sys$output "
44 $ use_debugging_perl = "y"
46 $ be_case_sensitive = "n"
47 $ use_vmsdebug_perl = "n"
50 $ C_Compiler_Replace = "CC="
51 $ Thread_Live_Dangerously = "MT="
52 $ use_two_pot_malloc = "N"
53 $ use_pack_malloc = "N"
54 $ use_debugmalloc = "N"
57 $ use_multiplicity = "N"
58 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
59 $ max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_xxx] not [A.B.C.PERL5_xxx]
60 $! max_allowed_dir_depth = 2 ! e.g. [A.PERL5_xxx] not [A.B.PERL5_xxx]
62 $ vms_filcnt = F$GETJPI ("","FILCNT")
64 $!: compute my invocation name
65 $ me = F$ENVIRONMENT("PROCEDURE")
67 $! Many null statements (begin with colon ':') in the Bourne shell version of
68 $! this script serve as comments/placeholders. I have retained some of the ones
69 $! that will help you compare this .COM file to the sh version - as well as
70 $! leave placeholders for future improvements to this .COM file.
71 $! sfn = VMS "skipped for now"
73 $!: Proper PATH separator !sfn
74 $!: Proper PATH setting !sfn
75 $!: Sanity checks !sfn "Say '@''$me''"
76 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
77 $!: Configure runs within the UU subdirectory !->after find MANIFEST
78 $! <big long list of default values (mostly null)>
79 $!: We must find out about Eunice early !(?)
80 $!: list of known cpp symbols, sorted alphabetically !sfn
82 $!: default library list !sfn
83 $! <no hints files in use (yet?)>
84 $!: Extra object files, if any, needed on this platform. !sfn
85 $!: Possible local include directories to search. !sfn
86 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
87 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
88 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
89 $!: no include file wanted by default !sfn
91 $!: Possible local library directories to search. !sfn
92 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
93 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
94 $!: general looking path for locating libraries !sfn
95 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
96 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
97 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
98 $!: Private path used by Configure to find libraries. Its value !sfn
99 $!: is prepended to libpth. This variable takes care of special !sfn
100 $!: machines, like the mips. Usually, it should be empty. !sfn
102 $!: full support for void wanted by default !sfn
103 $!defvoidused=15 !sfn
104 $!: List of libraries we want. !sfn
105 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
106 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
107 $!libswanted="$libswanted ucb bsd BSD PW x" !sfn
108 $!: We probably want to search /usr/shlib before most other libraries. !sfn
109 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
110 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
111 $!glibpth="/usr/shlib $glibpth" !sfn
112 $!: Do not use vfork unless overridden by a hint file. !sfn
113 $!usevfork=false !sfn
114 $!: script used to extract .SH files with variable substitutions !sfn
115 $!: produce awk script to parse command line options !sfn
116 $!sfn (assume no sed awk) see below
117 $!: process the command line options
119 $!: set up default values
134 $ use_5005_threads = "N"
139 $ THEN !one or more switches was thrown
143 $ IF (P'i'.NES."") THEN bang = bang + 1
145 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
149 $ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
150 $ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
151 $Remove_quotation_mark:
153 $ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
154 $ gotopt = "f" !"alse"
155 $ gotshortopt = "f" !"alse"
156 $ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
159 $ gotopt = "t" !"rue"
161 $ gotshortopt = "t" !"rue"
163 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
170 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
174 $ IF (F$SEARCH(config_sh).NES."")
176 $ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
177 $ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
179 $ CONTINUE !at this point check UIC && if test allows...
182 $ echo "''me': cannot read config file ''config_sh'."
186 $ echo "''me': cannot read config file ''config_sh'."
191 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
198 $ IF (F$EXTRACT(0,1,P'i') .EQS. "m")
205 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
212 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
219 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
224 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
231 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
238 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
240 $ extractsh = "true" !VMS?
245 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
248 $!Hmm.. this part needs work
250 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
254 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
256 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
257 $ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
258 $ echo "''me': ignoring -D",P'i'
260 $!Hmm.. this part needs work
261 $! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
262 $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
265 $ ECHO "P''i' =>",P'i',"<=" !Diag
268 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
271 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
275 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
277 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
278 $ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
279 $ echo "''me': ignoring -U",P'i'
284 $ ECHO "P''i' =>",P'i',"<=" !Diag
287 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
289 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
290 $ echo "''me' generated by an unknown version of EDT."
296 $ echo "''me': unknown option ",P'i'
299 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
301 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
303 $ ENDIF ! (P1 .NES. "")
307 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
308 $ echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
309 $ echo " [-Usymbol] [-Usymbol=]"
311 "-d" : use defaults for all answers.
312 "-e" : go on without questioning past the production of config.sh. *
313 "-f" : specify an alternate default configuration file.
314 "-h" : print this help message and exit (with an error status).
315 "-m" : skip the MANIFEST check to see that all files are present
316 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
317 "-s" : silent mode, only echoes questions and essential information.
318 -"D" : define symbol to have some value: *
319 -"Dsymbol" symbol gets the value 'define'
320 -"Dsymbol=value" symbol gets the value 'value'
321 -E : stop at the end of questions, after having produced config.sh. *
322 -K : do not use unless you know what you are doing.
323 -O : let -D and -U override definitions from loaded configuration file. *
324 -S : perform variable substitutions on all .SH files (can mix with -f) *
325 -"U" : undefine symbol: *
326 -"Usymbol" symbol gets the value 'undef'
327 -"Usymbol=" symbol gets completely empty
328 -V : print version number and exit (with a zero status).
329 $ echo "%Config-I-VMS, lower case switches must be enclosed"
330 $ echo "-Config-I-VMS, in double quotation marks, e.g.:"
331 $ echo "-Config-I-VMS, @Configure ""-des"""
332 $ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
333 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
335 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
341 $ IF F$Mode() .eqs. "BATCH"
343 $ STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
344 $ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid file locking conflicts,"
345 $ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
346 $ WRITE SYS$OUTPUT STDOUT
348 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
350 $ DEFINE SYS$OUTPUT "_NLA0:"
351 $ echo4 = "write STDOUT "
352 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
353 $ open/write/share=read STDOUT 'STDOUT'
361 $ echo4 = "write SYS$OUTPUT "
365 $!: run the defines and the undefines, if any, but leave the file out there...
366 $! Unfortunately Configure.COM in DCL is not yet set up to do this -
371 $ packageup = F$EDIT((package - "5"),"UPCASE")
373 $!: Eunice requires " " instead of "", can you believe it
376 $ echo "Beginning of configuration questions for ''package'."
379 $!: Some greps do not return status, grrr.
380 $ contains = "SEARCH"
382 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
383 $! echo "Checking ''echo' to see how to suppress newlines..."
384 $! echo "giving up..."
385 $! echo "The star should be here-->*"
387 $!: Now test for existence of everything in MANIFEST
389 $ echo4 "First let's make sure your kit is complete. Checking..."
392 $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
393 $! because the search routine simply does set def [-] if necessary.
394 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
396 $ manifestfound = F$SEARCH(file_2_find)
397 $ IF (manifestfound .EQS. "")
399 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
402 $ GOTO Research_manifest
405 $ echo "There is no MANIFEST file. I hope your kit is complete !"
407 $ GOTO Beyond_manifest
410 $! MANIFEST. has been found and we have set def'ed there -
411 $! time to bail out before it's too late.
412 $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
413 $ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
414 $ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
417 %Config-E-VMS, ERROR:
418 Sorry! It apears as though your perl build sub-directory is already too
419 deep into the VMS file system. Please try moving stuff into a shallower
420 directory (or altering the "max_allowed_dir_depth" parameter).
421 $ echo4 "ABORTING..."
422 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
424 $ EXIT !2 !$STATUS = "%X00000002" (error)
428 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
430 $ IF (manifestfound .NES. "")
432 $ IF ( F$SEARCH("UU.DIR").EQS."" )
434 $ CREATE/DIRECTORY [.UU]
436 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
438 $!: Configure runs within the UU subdirectory
441 $! a little redundancy never hurt anybody?
442 $ file_2_find = "[-]" + file_2_find
443 $ manifestfound = F$SEARCH(file_2_find)
445 $ OPEN/WRITE MISSING MISSING.
446 $!change to "FALSE" if you wish to skip the manifest search
447 $!(which after all is rather slow in DCL :-)
450 $ echo "Skipping MANIFEST check as requested"
453 $ OPEN/READ CONFIG 'manifestfound'
455 $ READ/END_OF_FILE = Done_manifest CONFIG line
456 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
457 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
458 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
459 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
460 $ line = F$EDIT(line,"TRIM, COMPRESS")
461 $ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
462 $ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
464 $Re_strip_line_manifest:
465 $ loca = F$LOCATE("/",file_2_find)
466 $ ante = F$EXTRACT(0,loca,file_2_find)
467 $ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
468 $ test_this = ante + "." + (post - "/")
469 $ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
471 $ file_2_find = ante + "." + (post - "/")
472 $ GOTO Re_strip_line_manifest
474 $ file_2_find = ante + "]" + (post - "/")
476 $ file_2_find = "[-."+file_2_find
478 $ file_2_find = "[-]" + file_2_find
481 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
482 $ file_2_find = file_2_find - dirname
485 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
486 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
488 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
489 $ ELSE basename = basename + dot_ele + "_"
494 $ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
495 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
496 basename = f$extract(0,f$length(basename)-1,basename)
497 $ file_2_find = dirname + basename
499 $ found = F$SEARCH(file_2_find)
500 $ IF (found .EQS. "" .AND. dots .GT. 2)
502 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
503 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
504 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
505 $ basename[f$locate(".",basename),1] := _
506 $ dot_ele = F$ELEMENT(dots - 1,"_",basename)
508 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
510 $ found = F$SEARCH(dirname + basename)
511 $ file_2_find = file_2_find + "," + basename
513 $ IF (found .EQS. "")
515 $ WRITE MISSING file_2_find
516 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
518 $ miss_list = miss_list + "," + file_2_find
521 $ GOTO Read_loop_manifest
526 $ ENDIF ! (manifestfound .NES. "")
528 $ IF (miss_list .NES. "")
530 $ echo "Some of the files not found include:"
533 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
537 THIS PACKAGE SEEMS TO BE INCOMPLETE.
539 You have the option of continuing the configuration process, despite the
540 distinct possibility that your kit is damaged, by typing 'y'es. If you
541 do, don't blame me if something goes wrong. I advise you to type 'n'o
542 and contact the author (dan@sidhe.org)
544 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
547 $ echo4 "Continuing..."
549 $ echo4 "ABORTING..."
553 $ echo4 "Looks good..."
554 $ DELETE/NOLOG MISSING.;
555 $ ENDIF ! (miss_list .NES. "")
556 $ ENDIF ! (manifestfound .EQS. "") ELSE
558 $! after finding MANIFEST (see above)
559 $!: Configure runs within the UU subdirectory
561 $!: compute the number of columns on the terminal for proper question formatting
562 $! (sfn, will assume 80-ish)
564 $!: set up the echo used in my read !sfn
565 $!: now set up to do reads with possible shell escape and default assignment !sfn
576 $ READ SYS$COMMAND/PROMPT="''rp'" ans
579 $ READ SYS$COMMAND/PROMPT="''rp'" ans
586 $!: create .config dir to save info across Configure sessions
587 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
589 $ CREATE/DIRECTORY [-.CONFIG]
590 $ OPEN/WRITE CONFIG [-.CONFIG]README.
592 "This directory created by Configure to save information that should"
594 "persist across sessions."
597 "You may safely delete it if you wish."
601 $!: general instructions
604 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
605 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
607 $ messages = F$ENVIRONMENT("MESSAGE")
608 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
609 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
610 $ IF .NOT.($status.EQ.%X08D78053)
614 $ rp = "Would you like to see the instructions? [''dflt'] "
616 $ if .NOT.ans THEN needman=""
618 $ SET MESSAGE 'messages'
620 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
626 This installation shell script will examine your system and ask you questions
627 to determine how the perl5 package should be installed. If you get
628 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
629 process, edit something, then restart this process as you just did.
630 Many of the questions will have default answers in square
631 brackets; typing carriage return will give you the default.
633 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
636 In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
637 the questions and use the computed defaults (or the previous answers provided
638 there was already a config.sh file). Type '@Configure "-h"' for a list of
641 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
644 Much effort has been expended to ensure that this shell script will
645 run on any VMS system. If despite that it blows up on yours, your
646 best bet is to edit Configure.com and @ it again. Whatever problems
647 you have with Configure.com, let me (dan@sidhe.org) know how I blew
650 $!This installation script affects things in two ways:
652 $!1) it may do direct variable substitutions on some of the files included
654 $!2) it builds a config.h file for inclusion in C programs. You may edit
655 $! any of these files as the need arises after running this script.
657 $!If you make a mistake on a question, there is no easy way to back up to it
660 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
661 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
663 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
667 $ ENDIF !(needman .EQS. "true")
669 $!: see if sh knows # comments !sfn
671 $!: figure out how to guarantee sh startup !sfn
672 $!: find out where common programs are !sfn
673 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
674 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
675 $! echo "I don't know where '$file' is, and my life depends on it."
676 $! echo "Go find a public domain implementation or fix your PATH setting!"
678 $! echo "Don't worry if any of the following aren't found..."
679 $!: determine whether symbolic links are supported !sfn
680 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
681 $!: set up the translation script tr, must be called with ./tr of course !sfn
683 $!: Try to determine whether config.sh was made on this system
684 $!: Get old answers from old config file if Configure was run on the
685 $!: same system, otherwise use the hints.
686 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
690 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
692 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
694 $ configshfound = F$SEARCH(config_sh)
695 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
697 $ IF (i.LT.max) THEN GOTO Config_sh_look
698 $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
701 $ echo "Fetching default answers from ''config_sh'..."
702 $!we actually do not have "hints/" for VMS
705 $!First time through, eh? I have some defaults handy for the following systems:
707 $! echo " ","VMS_VAX"
708 $! echo " ","VMS_AXP"
709 $! : Now look for a hint file osname_osvers, unless one has been
710 $! : specified already.
713 $!You may give one or more space-separated answers, or "none" if appropriate.
714 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
716 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
720 $!: Restore computed paths !sfn
722 $! genconfig.pl has "osname='VMS'"
723 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
724 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
726 $ IF (osname .NES. "VMS")
728 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
731 %Config-E-VMS, ERROR:
733 Err, you do not appear to be running VMS!
734 This procedure is intended to Configure the building of Perl for VMS.
736 $ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
739 $ echo4 "Continuing..."
741 $ echo4 "ABORTING..."
742 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
744 $ EXIT 2 !$STATUS = "%X00000002" (error)
746 $ ELSE !we are on VMS huzzah!
748 $ THEN TYPE SYS$INPUT:
750 Configure uses the operating system name and version to set some defaults.
751 The default value is probably right if the name rings a bell. Otherwise,
752 since spelling matters for me, either accept the default or answer "none"
755 $ rp = "Operating system name? [''osname'] "
759 $ IF (ans.NES.osname) !.AND.knowitall
761 $ echo4 "I'll go with ''osname' anyway..."
764 $ ENDIF !(osname .NES./.EQS. "VMS")
766 $!: who configured the system
768 $ cf_by = F$EDIT(user,"LOWERCASE")
769 $! cf_time = F$CVTIME() !superceded by procedure below
770 $ osvers = F$GETSYI("VERSION")
772 $! Peter Prymmer has seen:
773 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
774 $! "SYS$TIME_ZONE" = "EDT"
776 $! Charles Lane recommended:
777 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
778 $! "NEWS_TIMEZONE" = "-0500"
779 $! "ST_TIMEZONE" = "EDT"
780 $! "JAN_TIME_ZONE" = "EST "
781 $! "MULTINET_TIMEZONE" = "EST"
782 $! "DAYLIGHT_SAVINGS" = "1"
784 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
786 $! "Multinet_Timezone"
787 $! "TCPware_Timezone"
790 $! This snippet o' DCL returns a string in default Unix `date` format,
791 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
792 $! Peter Prymmer pvhp@lns62.lns.cornell.edu
794 $ MIN_TZO = -840 !units are minutes here
797 $ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
798 $ monn = F$CVTIME(,,"MONTH")
799 $ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
800 $ hour = F$CVTIME(,,"HOUR")
801 $ min = F$CVTIME(,,"MINUTE")
802 $ sec = F$CVTIME(,,"SECOND")
803 $ year = F$CVTIME(,,"YEAR")
805 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
809 $ mon = F$ELEMENT(i,"/",months)
810 $ IF i.LT.monn THEN GOTO Mon_loop
813 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
816 $ tzhour = F$INTEGER(systz)/3600
817 $ tzmins = F$INTEGER(systz)/60
818 $ tzminrem = tzmins - tzhour*60
819 $ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
821 $ THEN signothetime = "+"
822 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
823 $ THEN direction = "on GMT/"
824 $ ELSE direction = "east of "
826 $ ELSE signothetime = "-"
827 $ tzhour = -1*tzhour !keeps !UL happy
828 $ direction = "west of "
831 $ echo "%Config-I-VMS,"
832 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
835 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
837 $ tzspan = "''tzhour' hours"
840 $ echo "Your system is ''tzspan' ''direction'UTC in England."
841 $ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
843 $ IF ans.OR.(ans.EQS."")
847 $ GOTO Beyond_TimeZone
851 $ echo4 "%Config-I-VMS,"
852 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
857 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
858 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
859 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
861 $ rp = "Enter the Time Zone offset: [''dflt'] "
863 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
864 $ IF ans.EQS."" THEN ans = dflt
865 $ tzhour = F$ELEMENT(0,":","''ans'") !first
866 $ IF tzhour.EQS."" THEN tzhour = 0
867 $ tzhour = F$INTEGER(tzhour)
868 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
871 $ tzminrem = F$INTEGER(tzminrem)
872 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
876 $ tzmins = tzhour*60 + tzminrem
877 $ tzd = F$STRING(tzmins*60)
882 $ tzhour = -1*tzhour !keeps !UL happy
885 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
888 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
893 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
894 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
896 $!: determine the architecture name
897 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
899 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
901 $ archname = "VMS_VAX"
902 $ otherarch = "an Alpha"
904 $ archname = "VMS_AXP"
905 $ otherarch = "a VAX"
907 $ rp = "What is your architecture name? [''archname'] "
911 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
912 $ IF (ans.NES.archname) !.AND.knowitall
914 $ echo4 "I'll go with ''archname' anyway..."
918 $ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
922 $ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
929 $ IF (archname.EQS."VMS_AXP")
931 $ macros = macros + """AXE=1"","
935 $!: is AFS running? !sfn
936 $!: decide how portable to be. Allow command line overrides. !sfn
937 $!: set up shell script to do ~ expansion !sfn
938 $!: expand filename !sfn
939 $!: now set up to get a file name !sfn
941 $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
942 $ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
943 $ prefixbase = prefix - "]"
944 $ prefix = prefixbase + ".]"
945 $!: determine root of directory hierarchy where package will be installed.
950 $ echo "By default, ''package' will be installed in ''dflt', pod"
951 $ echo "pages under ''prefixbase'LIB.POD], etc..., i.e. with ''dflt' as prefix for"
952 $ echo "all installation directories."
953 $ echo "On ''osname' the ''prefix' is used to DEFINE the ''packageup'_ROOT prior to installation"
954 $ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
956 $ rp = "Installation prefix to use (for ''packageup'_ROOT)? [ ''dflt' ] "
961 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
966 $! Check here for pre-existing PERL_ROOT.
967 $! -> ask if removal desired.
968 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
969 $! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
971 $ vms_skip_install = "true"
974 $ rp = "%Config-I-VMS, Do you wish to skip the remaining """"where install"""" questions? [''dflt'] "
976 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
977 $ IF (.NOT.vms_skip_install)
980 $!: set the prefixit variable, to compute a suitable default value
982 $!: determine where private library files go
983 $!: Usual default is /usr/local/lib/perl5. Also allow things like
984 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
986 $ THEN TYPE SYS$INPUT:
988 There are some auxiliary files for perl5 that need to be put into a
989 private library directory that is accessible by everyone.
991 $ dflt = prefix - ".]" + ".LIB]"
992 $ rp = "Pathname where the private library files will reside? "
993 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
997 $ ELSE privlib = dflt
1000 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
1002 $ perl_symbol = "true"
1008 $ echo "%Config-I-VMS, You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1009 $ echo "-Config-I-VMS, symbol to invoke ''package', which is the usual method."
1010 $ echO "-Config-I-VMS, If you do not do so then you would need a DCL command verb at the"
1011 $ echo "-Config-I-VMS, process or the system wide level."
1013 $ rp = "Invoke perl as a global symbol foreign command [''dflt'] "
1015 $ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
1017 $ IF (.NOT.perl_symbol)
1023 $ echo "%Config-I-VMS, Since you won't be using a symbol you must choose to put the ''packageup'"
1024 $ echo "-Config-I-VMS, verb in a per-process table or in the system wide DCLTABLES (which"
1025 $ echo "-Config-I-VMS, would require write privilege)."
1027 $ rp = "Invoke perl as a per process command verb [ ''dflt' ] "
1029 $ IF (.NOT.ans).AND.(ans.NES."")
1030 $ THEN perl_verb = "DCLTABLES"
1031 $ ELSE perl_verb = "PROCESS"
1033 $ ENDIF ! (.NOT.perl_symbol)
1035 $!: set the base revision
1037 $!: get the patchlevel
1039 $ echo4 "Getting the current patchlevel..." !>&4
1040 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1041 $ IF (patchlevel_h.NES."")
1043 $ got_patch = "false"
1045 $ OPEN/READONLY CONFIG 'patchlevel_h'
1047 $ READ/END_Of_File=Close_patch CONFIG line
1048 $ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1050 $ line = F$EDIT(line,"COMPRESS, TRIM")
1051 $ patchlevel = F$ELEMENT(2," ",line)
1052 $ got_patch = "true"
1054 $ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1056 $ line = F$EDIT(line,"COMPRESS, TRIM")
1057 $ subversion = F$ELEMENT(2," ",line)
1060 $ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1067 $ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
1068 $! This whole thing needs replacing w/ F$FAO() calls:
1069 $ patchlevel = F$INTEGER(patchlevel)
1070 $ IF patchlevel.LT.10
1071 $ THEN patchlevel = "00" + F$STRING(patchlevel)
1072 $ ELSE patchlevel = "0" + F$STRING(patchlevel)
1074 $ subversion = F$INTEGER(subversion)
1075 $ IF subversion.GT.0
1077 $ IF subversion.LT.10
1078 $ THEN subversion = "0" + F$STRING(subversion)
1079 $ ELSE subversion = F$STRING(subversion)
1081 $ ELSE subversion = ""
1084 $ version = baserev + "_" + patchlevel + "_" + subversion
1086 $ IF (.NOT.vms_skip_install)
1088 $!: set the prefixup variable, to restore leading tilda escape !sfn
1089 $!: set the prefixup variable, to restore leading tilde escape !sfn
1091 $!: determine where public architecture dependent libraries go
1095 $ echo "''package' contains architecture-dependent library files. If you are"
1098 $ THEN TYPE SYS$INPUT:
1099 sharing libraries in a heterogeneous environment, you might store
1100 these files in a separate location. Otherwise, you can just include
1101 them with the rest of the public library files.
1103 $ dflt = privlib - "]" + "." + archname + "." + version + "]"
1104 $ rp = "Where do you want to put the public architecture-dependent libraries? "
1105 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1108 $ THEN archlib = ans
1109 $ ELSE archlib = dflt
1112 $!: set up the script used to warn in case of inconsistency !sfn
1113 $!: function used to set $1 to $val !sfn
1115 $ ENDIF !%Config-I-VMS, skip "where install" questions
1116 $! This quotation from Configure has to be included on VMS:
1119 There is, however, a strange, musty smell in the air that reminds me of
1120 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1122 $ IF (.NOT.vms_skip_install)
1124 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1126 $!: see if setuid scripts can be secure !sfn
1127 $!: now see if they want to do setuid emulation !sfn
1129 $!: determine where site specific libraries go.
1131 $ THEN TYPE SYS$INPUT:
1133 The installation process will also create a directory for
1134 site-specific extensions and modules. Some users find it convenient
1135 to place all local files in this directory rather than in the main
1136 distribution directory.
1138 $ dflt = privlib - "]" + ".SITE_PERL]"
1139 $ rp = "Pathname for the site-specific library files? "
1140 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1143 $ THEN sitelib = ans
1144 $ ELSE sitelib = dflt
1147 $!: determine where site specific architecture-dependent libraries go.
1149 $ THEN TYPE SYS$INPUT:
1151 The installation process will also create a directory for
1152 architecture-dependent site-specific extensions and modules.
1154 $ dflt = sitelib - "]" + "." + archname + "]"
1155 $ rp = "Pathname for the site-specific architecture-dependent library files? "
1156 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1159 $ THEN sitearch = ans
1160 $ ELSE sitearch = dflt
1163 $!: determine where old public architecture dependent libraries might be
1165 $!: determine where public executables go
1166 $ dflt = prefix - ".]" + ".BIN]"
1167 $ rp = "Pathname where the public executables will reside? "
1168 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1175 $!: determine where manual pages are on this system
1176 $!: What suffix to use on installed man pages
1177 $!: see if we can have long filenames
1178 $!: determine where library module manual pages go
1179 $!: What suffix to use on installed man pages
1180 $!: see what memory models we can support
1182 $ ENDIF !%Config-I-VMS, skip "where install" questions
1184 $!: see if we need a special compiler
1185 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1189 $ vms_cc_available = ""
1191 $ OPEN/WRITE CONFIG ccvms.c
1192 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1193 $ WRITE CONFIG "#include <stdio.h>"
1194 $ WRITE CONFIG "int main() {"
1195 $ WRITE CONFIG "#ifdef __DECC"
1196 $ WRITE CONFIG " printf(""/DECC\n"");"
1197 $ WRITE CONFIG "#else"
1198 $ WRITE CONFIG " printf(""/VAXC\n"");"
1199 $ WRITE CONFIG "#endif"
1200 $ WRITE CONFIG " exit(0);"
1204 $! DEFINE SYS$ERROR _NLA0:
1205 $! DEFINE SYS$OUTPUT _NLA0:
1206 $ cc/NoObj/list=ccvms.lis ccvms.c
1208 $! DEASSIGN SYS$OUTPUT
1209 $! DEASSIGN SYS$ERROR
1210 $ IF (silent) THEN GOSUB Shut_up
1211 $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1213 $ IF tmp.NE.%X10B90001
1215 $ IF tmp.NE.%X10000001
1217 $ nocc = "t" !%X10000001 is return from gcc
1218 $ GOTO Gcc_initial_check
1223 $ IF .NOT.silent THEN echo ""
1224 $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1225 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1229 $ echo "%Config-I-VMS, Will try cc/decc..."
1231 $ DEFINE SYS$ERROR _NLA0:
1232 $ DEFINE SYS$OUTPUT _NLA0:
1234 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1236 $ DEASSIGN SYS$OUTPUT
1237 $ DEASSIGN SYS$ERROR
1239 $ IF (silent) THEN GOSUB Shut_up
1240 $ IF tmp.NE.%X10B90001
1242 $ echo "%Config-I-VMS, Apparently you don't have that one."
1245 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1246 $ vms_cc_available = vms_cc_available + "cc/decc "
1249 $ IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
1251 $ vms_cc_dflt = "/decc"
1252 $ vms_cc_available = vms_cc_available + "cc/decc "
1257 $ echo "%Config-I-VMS, Checking for Gcc"
1258 $ OPEN/WRITE CONFIG gccvers.lis
1259 $ DEFINE SYS$ERROR CONFIG
1260 $ DEFINE SYS$OUTPUT CONFIG
1261 $ 'gcc_symbol'/noobj/version _nla0:
1263 $ DEASSIGN SYS$OUTPUT
1264 $ DEASSIGN SYS$ERROR
1265 $ IF (silent) THEN GOSUB Shut_up
1267 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1269 $ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1272 $ OPEN/READ CONFIG gccvers.lis
1274 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1275 $ GOTO GCC_List_Read
1279 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1280 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1283 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1285 $!: see if we need a special compiler
1287 $ echo "%Config-I-VMS, available compiler(s):"
1288 $ echo "( ''vms_cc_available')"
1291 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1295 $ rp = "Use which C compiler? [''dflt'] "
1299 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1301 $ IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
1304 $ Using_Dec_C = "Yes"
1305 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1309 $ IF (F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)).or(F$LOCATE("compaq",dflt).NE.F$LENGTH(dflt))
1311 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1313 $ Using_Dec_C = "Yes"
1316 $ IF Mcc .EQS. "cc/decc"
1318 $ Using_Dec_C = "Yes"
1319 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1324 $ IF Mcc .EQS. "cc/decc"
1326 $ Using_Dec_C = "Yes"
1327 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1329 $ IF Mcc .EQS. "gcc"
1331 $ Using_Gnu_C = "Yes"
1332 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1335 $Decc_Version_check:
1336 $ IF "''Using_Dec_C'".EQS."Yes"
1339 $ echo4 "Checking for Dec C's version number..." !>&4
1340 $ OPEN/WRITE CONFIG deccvers.c
1341 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1342 $ WRITE CONFIG "#include <stdio.h>"
1343 $ WRITE CONFIG "int main() {"
1344 $ WRITE CONFIG "#ifdef __DECC"
1345 $ WRITE CONFIG "#ifdef __DECC_VER"
1346 $ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1347 $ WRITE CONFIG "#else"
1348 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1349 $ WRITE CONFIG "#endif"
1350 $ WRITE CONFIG "#endif"
1351 $ WRITE CONFIG " exit(0);"
1354 $ DEFINE SYS$ERROR _NLA0:
1355 $ DEFINE SYS$OUTPUT _NLA0:
1358 $ DEASSIGN SYS$ERROR _NLA0:
1359 $ DEASSIGN SYS$OUTPUT _NLA0:
1360 $ IF (silent) THEN GOSUB Shut_up
1361 $ DEFINE SYS$ERROR _NLA0:
1362 $ DEFINE SYS$OUTPUT _NLA0:
1365 $ DEASSIGN SYS$ERROR
1366 $ DEASSIGN SYS$OUTPUT
1367 $ IF (silent) THEN GOSUB Shut_up
1368 $ OPEN/WRITE CONFIG deccvers.out
1369 $ DEFINE SYS$ERROR CONFIG
1370 $ DEFINE SYS$OUTPUT CONFIG
1371 $ mcr []deccvers.exe
1374 $ DEASSIGN SYS$OUTPUT
1375 $ DEASSIGN SYS$ERROR
1376 $ IF (silent) THEN GOSUB Shut_up
1377 $ OPEN/READ CONFIG deccvers.out
1378 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1381 $! DELETE/NOLOG/NOCONFIRM deccvers.*;
1382 $ echo "You are using Dec C ''line'"
1383 $ Dec_C_Version = line
1384 $ Dec_C_Version = Dec_C_Version + 0
1385 $ if Dec_C_Version.ge.60200000 THEN CC_FLAGS = CC_FLAGS + "/NOANSI_ALIAS"
1388 $ if "''using_gnu_c'" .eqs. "Yes"
1390 $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1391 $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1392 $ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1393 $ IF gcclib_olb .EQS. ""
1395 $! These objects/libs come w/ gcc 2.7.2 for AXP:
1396 $ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1397 $ IF tmp .NES. "" then gcclib_olb = tmp
1398 $ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1401 $ IF gcclib_olb .EQS. ""
1402 $ THEN gcclib_olb = tmp
1403 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1406 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1409 $ IF gcclib_olb .EQS. ""
1410 $ THEN gcclib_olb = tmp
1411 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1414 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1417 $ IF gcclib_olb .EQS. ""
1418 $ THEN gcclib_olb = tmp
1419 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1422 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1424 $ gcclib_olb = gcclib_olb + "/lib"
1426 $ IF gcclib_olb .NES. "" .AND. -
1427 (vaxcrtl_olb .NES. "" .OR. -
1428 vaxcrtl_exe .NES. "" )
1431 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1432 $ OPEN/WRITE CONFIG gccvers.c
1433 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1434 $ WRITE CONFIG "#include <stdio.h>"
1435 $ WRITE CONFIG "int main() {"
1436 $ WRITE CONFIG "#ifdef __GNUC__"
1437 $ WRITE CONFIG "#ifdef __VERSION__"
1438 $ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1439 $ WRITE CONFIG "#else"
1440 $ WRITE CONFIG " printf(""%s\n"", ""1"");"
1441 $ WRITE CONFIG "#endif"
1442 $ WRITE CONFIG "#endif"
1443 $ WRITE CONFIG " exit(0);"
1446 $ DEFINE SYS$ERROR _NLA0:
1447 $ DEFINE SYS$OUTPUT _NLA0:
1450 $ DEASSIGN SYS$ERROR _NLA0:
1451 $ DEASSIGN SYS$OUTPUT _NLA0:
1452 $ IF (silent) THEN GOSUB Shut_up
1453 $ DEFINE SYS$ERROR _NLA0:
1454 $ DEFINE SYS$OUTPUT _NLA0:
1455 $ IF vaxcrtl_exe .EQS. ""
1457 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1459 $ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1462 $ link gccvers.obj,'gcclib_olb'
1466 $ OPEN/WRITE CONFIG GCCVERS.OPT
1467 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1469 $ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1472 $ DEASSIGN SYS$ERROR
1473 $ DEASSIGN SYS$OUTPUT
1474 $ IF (silent) THEN GOSUB Shut_up
1475 $ OPEN/WRITE CONFIG gccvers.out
1476 $ DEFINE SYS$ERROR CONFIG
1477 $ DEFINE SYS$OUTPUT CONFIG
1481 $ DEASSIGN SYS$OUTPUT
1482 $ DEASSIGN SYS$ERROR
1483 $ IF (silent) THEN GOSUB Shut_up
1484 $ OPEN/READ CONFIG gccvers.out
1485 $ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1488 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1489 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1491 $ echo "You are not using GNU cc."
1494 $ echo "You are using GNU cc ''line'"
1495 $ Using_Gnu_C = "Yes"
1496 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1504 $ OPEN/READ CONFIG ccvms.lis
1506 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1514 $ line = F$EDIT(line,"TRIM,COMPRESS")
1515 $ line = line - "Page 1" ! occurs at end all compilers
1516 $ line = line - "CCVMS " ! filename appears w/ VAXC
1517 $ line = line - "Source Listing " ! Seen w/ AXP DECC
1518 $ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1520 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1521 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1525 $!: What should the include directory be ?
1527 $ rp = "Where are the include files you want to use? "
1528 $ IF f$length( rp + "[''dflt'] " ).gt.76
1529 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1530 $ ELSE rp = rp + "[''dflt'] "
1535 $!: see if we have to deal with yellow pages, now NIS.
1536 $!: now get the host name
1539 $ echo4 "Figuring out host name..." !>&4
1541 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1542 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1543 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1544 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1545 $ IF myhostname.eqs."".and. -
1546 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1547 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1548 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1549 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1550 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1551 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1552 $ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1553 $!: you do not want to know about this
1555 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1557 $ IF (.not.ans).and.(ans.NES."")
1559 $ READ SYS$COMMAND/PROMPT= -
1560 "Please type the (one word) name of your host: " ans
1563 $!: translate upper to lower if necessary
1564 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1565 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1566 $ IF mylowhostname.NES.myhostname
1568 $ echo "(Normalizing case in your host name)"
1569 $ myhostname = mylowhostname
1572 $ fp = F$LOCATE(".",myhostname)
1573 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1574 $ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1576 $ rp = "What is your domain name? [''mydomain'] "
1578 $ IF ans .nes. "" THEN mydomain = ans
1579 $!: translate upper to lower if necessary
1580 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1581 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1582 $ IF mylowdomain.NES.mydomain
1584 $ echo "(Normalizing case in your domain name)"
1585 $ mydomain = mylowdomain
1588 $ myhostname = myhostname - mydomain
1589 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1591 $ THEN TYPE SYS$INPUT:
1593 I need to get your e-mail address in Internet format if possible, i.e.
1594 something like user@host.domain. Please answer accurately since I have
1595 no easy means to double check it. The default value provided below
1596 is most probably close to the reality but may not be valid from outside
1597 your organization...
1599 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1600 $ rp = "What is your e-mail address? [''dflt'] "
1603 $ THEN cf_email = ans
1604 $ ELSE cf_email = dflt
1608 $ THEN TYPE SYS$INPUT:
1610 If you or somebody else will be maintaining perl at your site, please
1611 fill in the correct e-mail address here so that they may be contacted
1612 if necessary. Currently, the "perlbug" program included with perl
1613 will send mail to this address in addition to perlbug@perl.com. You may
1614 enter "none" for no administrator.
1616 $ dflt = "''cf_email'"
1617 $ rp = "Perl administrator e-mail address [''dflt'] "
1620 $ THEN perladmin = ans
1621 $ ELSE perladmin = dflt
1624 $!: determine where public executable scripts go
1625 $!: determine perl absolute location
1626 $!: figure out how to guarantee perl startup
1628 $!: see how we invoke the C preprocessor
1630 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1631 $!: Set private lib path
1632 $!: Now check and see which directories actually exist, avoiding duplicates
1633 $!: determine optimize, if desired, or use for debug flag also
1634 $!: We will not override a previous value, but we might want to
1635 $!: augment a hint file
1636 $!: the following weeds options from ccflags that are of no interest to cpp
1637 $!: flags used in final linking phase
1638 $!: Try to guess additional flags to pick up local libraries.
1641 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1642 $!: compute shared library extension
1643 $!: Looking for optional libraries
1644 $!: see if nm is to be used to determine whether a symbol is defined or not
1645 $!: get list of predefined functions in a handy place
1646 $!: see if we have sigaction
1647 $!: see whether socketshr exists
1648 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1650 $ has_socketshr = "T"
1652 $ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1654 $ if (Dec_C_Version .ge. 50200000)
1656 $ Has_Dec_C_Sockets = "T"
1658 $ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1660 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1661 $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1664 $ echo "You've got sockets available. Which socket stack do you want to"
1665 $ echo "build into perl?"
1666 $ if "''has_dec_c_sockets'".eqs."T"
1670 $ dflt = "SOCKETSHR"
1672 $ rp = "Choose socket stack (NONE"
1673 $ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1674 $ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1675 $ rp = rp + ") [''dflt'] "
1677 $ IF "''ans'".eqs."" THEN ans = "''dflt'"
1678 $ has_dec_c_sockets = "F"
1679 $ has_socketshr = "F"
1680 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1681 $ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1682 $ IF ans.eqs."socketshr" then has_socketshr = "T"
1686 $! Ask if they want to build with VMS_DEBUG perl
1688 $ echo "Perl can be built to run under the VMS debugger."
1689 $ echo "You should only select this option if you are debugging"
1690 $ echo "perl itself. This can be a useful feature if you are "
1691 $ echo "embedding perl in a program."
1693 $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1695 $ IF ans.eqs."" then ans = dflt
1696 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1698 $ use_vmsdebug_perl = "Y"
1699 $ macros = macros + """__DEBUG__=1"","
1701 $ use_vmsdebug_perl = "N"
1704 $! Ask if they want to build with MULTIPLICITY
1706 $ echo "The perl interpreter engine can be built in a way that makes it
1707 $ echo "possible for a program that embeds perl into it (and yes, you can
1708 $ echo "do that--it's pretty keen) to have multiple perl interpreters active
1709 $ echo "at once. There is some performance overhead, however, so you
1710 $ echo "probably don't want to choose this unless you're going to be doing
1711 $ echo "funky perl embedding."
1713 $ rp = "Build with MULTIPLICITY? [''dflt'] "
1715 $ if ans.eqs."" then ans = dflt
1716 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1718 $ use_multiplicity="Y"
1720 $ use_multiplicity="N"
1723 $! Ask if they want to build with 64-bit support
1724 $ IF (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1726 $ dflt = use64bitint
1728 $ echo "You can have native 64-bit long integers.
1730 $ echo "Perl can be built to take advantage of 64-bit integer types
1731 $ echo "on some systems, which provide a much larger range for perl's
1732 $ echo "mathematical operations. (Note that does *not* enable 64-bit
1733 $ echo "fileops at the moment, as Dec C doesn't do that yet)."
1734 $ echo "Choosing this option will most probably introduce binary incompatibilities.
1736 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1737 $ rp = "Try to use 64-bit integers, if available? [''dflt'] "
1739 $ IF ans .EQS. "" THEN ans = dflt
1740 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1748 $ dflt = use64bitall
1750 $ echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
1751 $ echo "What you have chosen is minimal 64-bitness which means just enough
1752 $ echo "to get 64-bit integers. The maximal means using as much 64-bitness
1753 $ echo "as is possible on the platform. This in turn means even more binary
1754 $ echo "incompatibilities. On the other hand, your platform may not have
1755 $ echo "any more maximal 64-bitness than what you already have chosen.
1757 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1758 $ rp = "Try to use full 64-bit support, if available? [''dflt'] "
1760 $ IF ans .EQS. "" THEN ans = dflt
1761 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1768 $ ENDIF ! AXP && >= 7.1
1770 $! Ask about threads, if appropriate
1771 $ if (Using_Dec_C.eqs."Yes")
1774 $ echo "This version of Perl can be built with threads. While really nifty,
1775 $ echo "they are a beta feature, and there is a speed penalty for perl
1776 $ echo "programs if you build with threads *even if you don't use them*
1778 $ rp = "Build with threads? [''dflt'] "
1780 $ if ans.eqs."" then ans = dflt
1781 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1785 $ ! Shall we do the 5.005-stype threads, or IThreads?
1786 $ echo "As of 5.5.640, Perl has two different internal threading
1787 $ echo "implementations, the 5.005 version (5005threads) and an
1788 $ echo "interpreter-based version (ithreads) that has one
1789 $ echo "interpreter per thread. Both are very experimental. This
1790 $ echo "arrangement exists to help developers work out which one
1793 $ echo "If you're a casual user, you probably don't want
1794 $ echo "interpreter-threads at this time. There doesn't yet exist
1795 $ echo "a way to create threads from within Perl in this model,
1796 $ echo "i.e., ""use Thread;"" will NOT work.
1799 $ rp = "Build with Interpreter threads? [''dflt']
1801 $ if ans.eqs."" then ans = dflt
1802 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1805 $ use_5005_threads="N"
1808 $ use_5005_threads="Y"
1810 $ ! Are they on VMS 7.1 on an alpha?
1811 $ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1814 $ echo "Threaded perl can be linked to use multiple kernel threads
1815 $ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
1816 $ echo "allows multiple threads to execute simultaneously on an SMP
1817 $ echo "system as well as preventing a single thread from blocking
1818 $ echo "all the threads in a program, even on a single-processor
1819 $ echo "machine. Unfortunately this feature isn't safe on an
1820 $ echo "unpatched 7.1 system. (Several OS patches were required when
1821 $ echo "this procedure was written)
1823 $ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
1825 $ if ans.eqs."" then ans="''dflt'"
1826 $ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
1828 $ Thread_Live_Dangerously = "MT=MT=1"
1833 $ if archname .eqs. "VMS_AXP"
1838 $ echo "By default, perl (and pretty much everything else on VMS) uses
1839 $ echo "case-insensitive linker symbols. Which is to say, when the
1840 $ echo "underlying C code makes a call to a routine called Perl_foo in
1841 $ echo "the source, the name in the object modules or shareable images
1842 $ echo "is really PERL_FOO. There are some packages that use an
1843 $ echo "embedded perl interpreter that instead require case-sensitive
1844 $ echo "linker symbols.
1846 $ echo "If you have no idea what this means, and don't have
1847 $ echo "any program requiring anything, choose the default.
1848 $ dflt = be_case_sensitive
1849 $ rp = "Case-sensitive symbols [''dflt'] "
1851 $ if ans.eqs."" then ans="''dflt'"
1852 $ be_case_sensitive = "''ans'"
1856 $ echo "Perl normally uses G_FLOAT format floating point numbers
1857 $ echo "internally, as do most things on VMS. You can, however, build
1858 $ echo "with IEEE floating point numbers instead if you need to.
1859 $ dflt = use_ieee_math
1860 $ rp = "Use IEEE math [''dflt'] "
1862 $ if ans.eqs."" then ans="''dflt'"
1863 $ use_ieee_math = "''ans'"
1867 $ echo "You can, if you need to, pass extra flags on to the C
1868 $ echo "compiler. In general you should only do this if you really,
1869 $ echo "really know what you're doing.
1870 $ dflt = user_c_flags
1871 $ rp = "Extra C flags [''dflt'] "
1873 $ if ans.eqs."" then ans="''dflt'"
1874 $ user_c_flags = "''ans'"
1876 $! Ask whether they want to use secure logical translation when tainting
1878 $ echo "As Perl starts up, it checks several logical names, such as"
1879 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
1880 $ echo "of its behavior. For additional security, you may limit this"
1881 $ echo "process to executive- and kernel-mode translation when tainting"
1882 $ echo "is enabled. In this case, logical names normally skipped when"
1883 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
1884 $ echo "If you do not choose to do this, the usual order of access modes"
1885 $ echo "is used for logical name translation."
1887 $ echo "This restriction does not apply to the %ENV hash or to implicit"
1888 $ echo "logical name translation during parsing of file specifications;"
1889 $ echo "these always use the normal sequence of access modes for logical"
1890 $ echo "name translation."
1892 $ rp = "Use secure logical name translation? [''dflt'] "
1894 $ if ans.eqs."" then ans="''dflt'"
1895 $ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1897 $! Ask whether they want to default filetypes
1899 $ echo "When you pass the name of a program to Perl on the command line,"
1900 $ echo "it generally doesn't supply any defaults unless the -S command"
1901 $ echo "line switch is specified. In keeping with the VMS tradition of"
1902 $ echo "default file types, however, you can configure Perl to try default"
1903 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
1904 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
1905 $ echo "finally foo.com)."
1907 $ rp = "Always use default file types? [''dflt'] "
1909 $ if ans.eqs."" then ans="''dflt'"
1910 $ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1912 $! Ask if they want to use perl's memory allocator
1914 $ echo "Perl has a built-in memory allocator that's tuned for perl's
1915 $ echo "normal memory usage. It's oftentimes better than the standard
1916 $ echo "system memory allocator. It also has the advantage of providing
1917 $ echo "memory allocation statistics, if you choose to enable them.
1919 $ rp = "Build with perl's memory allocator? [''dflt'] "
1921 $ if ans.eqs."" then ans="''dflt'"
1922 $ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1923 $ if mymalloc.eqs."Y"
1925 $ if use_debugging_perl.eqs."Y"
1928 $ echo "Perl can keep statistics on memory usage if you choose to use
1929 $ echo "them. This is useful for debugging, but does have some
1930 $ echo "performance overhead.
1932 $ rp = "Do you want the debugging memory allocator? [''dflt'] "
1934 $ if ans.eqs."" then ans="''dflt'"
1935 $ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
1937 $ ! Check which memory allocator we want
1939 $ echo "There are currently three different memory allocators: the
1940 $ echo "default (which is a pretty good general-purpose memory manager),
1941 $ echo "the TWO_POT allocator (which is optimized to save memory for
1942 $ echo "larger allocations), and PACK_MALLOC (which is optimized to save
1943 $ echo "memory for smaller allocations). They're all good, but if your
1944 $ echo "usage tends towards larger chunks use TWO_POT, otherwise use
1945 $ echo "PACK_MALLOC."
1947 $ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
1949 $ if ans.eqs."" then ans = "''dflt'"
1950 $ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
1951 $ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
1954 $! Ask for their default list of extensions to build
1956 $ echo "It's time to specify which modules you want to build into
1957 $ echo "perl. Most of these are standard and should be chosen, though
1958 $ echo "you might, for example, want to build GDBM_File instead of
1959 $ echo "SDBM_File if you have the GDBM library built on your machine.
1960 $ echo "Whatever you do, make sure the re module is first or things will
1961 $ echo "break badly"
1963 $ echo "Which modules do you want to build into perl?"
1964 $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
1965 $ 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"
1966 $ if Using_Dec_C.eqs."Yes"
1968 $ dflt = dflt + " POSIX"
1972 $ if ans.eqs."" then ans = "''dflt'"
1976 $ x = f$elem(j," ",ans)
1978 $ if x .eqs. " " then goto exloop1
1980 $ k = f$locate("::",x)
1981 $ if k .ge. f$len(x) then goto exloop2
1982 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
1988 $ ans = f$edit(a,"trim")
1993 $ x = f$elem(j," ",dflt)
1995 $ if x .eqs. " " then goto exloop3
1997 $ k = f$locate("::",x)
1998 $ if k .ge. f$len(x) then goto exloop4
1999 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2005 $ dflt = f$edit(a,"trim")
2007 $ extensions = "''ans'"
2008 $ perl_known_extensions = "''dflt'"
2010 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2012 $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
2013 $! If the 'build' that you use is not here add it and it's test
2014 $! switch to the _END_ of these strings (and increment max_build)
2015 $! (e.g. builders = builders + "/FOOMAKE"
2016 $! probers = probers + " -fooVersionSwitch"
2017 $! ) & please let me know about it.
2018 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2019 $ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2025 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2026 $ WRITE CONFIG "dont_make_anything_yet:"
2027 $ WRITE CONFIG F$FAO("!_")
2030 $ messages = F$ENVIRONMENT("MESSAGE")
2032 $ build = F$ELEMENT(n,"/",builders)
2033 $ probe = F$ELEMENT(n,"!",probers)
2034 $ echo "Testing whether you have ''build' on your system..."
2036 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2037 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2039 $ IF ($SEVERITY .EQ. 1)
2042 $ IF (build .EQS. orig_dflt)
2044 $ default_set = "TRUE"
2047 $ ok_builders = ok_builders + " " + build
2048 $ IF (.NOT. default_set) THEN dflt = build
2052 $Reenable_messages_build:
2053 $ SET MESSAGE 'messages'
2056 $ IF (n .LT. max_build) THEN GOTO Build_probe
2059 $ IF (ok_builders .NES. "")
2061 $ echo "Here is the list of builders you can apparently use:"
2062 $ echo "(",ok_builders," )"
2063 $ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
2065 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2066 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2074 %Config-E-VMS, ERROR:
2075 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2076 utility of some sort and after checking my "builders" list I cannot find
2077 the symbol or command you use on your system to compile programs.
2079 $ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
2080 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2081 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2084 $ echo "I don't know where 'make' is, and my life depends on it."
2085 $ echo "Go find a make program or fix your DCL$PATH setting!"
2086 $ echo "ABORTING..."
2087 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2089 $ EXIT 2 !$STATUS = "%X00000002" (error)
2095 $ DELETE/NOLOG Makefile.;
2100 There seems to be trouble. I just tried to create a file in
2101 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2103 but was unsuccessful. I am stopping now. Please check that directories'
2104 PROTECTION bits. I will leave you in the directory where you started
2106 $ echo4 "ABORTING..."
2112 $! echo " Very well I will proceed with ""''build'"""
2113 $ make = F$EDIT(build,"UPCASE")
2115 $!: locate the preferred pager for this system
2116 $!pagers = "most|more|less|type/page"
2117 $!rp='What pager is used on your system?'
2119 $! update [.vms]config.vms here
2121 $! update makefile here
2122 $! echo4 "Updating makefile..."
2124 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2126 $ makefile = "" !wrt MANIFEST dir
2127 $ UUmakefile = "DESCRIP.MMS" !wrt CWD dir
2128 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
2130 $ makefile = " -f [.VMS]Makefile." !wrt MANIFEST dir
2131 $ UUmakefile = "[-.VMS]Makefile." !wrt CWD dir
2132 $ DEFmakefile = "[-.VMS]Makefile." !wrt DEF dir (?)
2137 $ tmp = F$LENGTH(macros)
2138 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2139 $ macros = "/macro=(" + macros + ")"
2141 $! Build up the extra C flags
2145 $ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2147 $ if be_case_sensitive
2149 $ extra_flags = "''extra_flags'" + "/Names=As_Is"
2151 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
2153 $! Invoke the subconfig piece
2156 $ echo4 "Checking the C run-time library"
2157 $ dflt = F$ENVIRONMENT("DEFAULT")
2158 $ SET DEFAULT [-.vms]
2162 $! Warn of dangerous symbols or logical names
2164 $Bad_environment: SUBROUTINE
2166 $ IF p2 .eqs. "SYMBOL"
2168 $ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
2170 $ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
2172 $ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
2174 $ IF f$search("config.msg") .nes. ""
2176 $ OPEN/APPEND CONFIG config.msg
2178 $ OPEN/WRITE CONFIG config.msg
2180 $ IF Bad_env .eqs. "SYMBOL"
2183 $ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
2184 $ WRITE CONFIG " delete before building ''package' via:"
2185 $ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
2186 $ IF f$locate("""",&p1) .ge. f$length(&p1)
2188 $ WRITE CONFIG " after building, testing, and installing ''package'
2189 $ WRITE CONFIG " restore the symbol with:"
2190 $ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
2193 $ IF Bad_env .eqs. "LOGICAL"
2196 $ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
2197 $ WRITE CONFIG " deassign before building ''package'"
2203 $ ENDSUBROUTINE ! Bad_environment
2205 $ echo4 "%Config-I-VMS, Checking for dangerous pre-existing global symbols and logical names."
2206 $ CALL Bad_environment "TMP"
2207 $ CALL Bad_environment "LIB"
2208 $ CALL Bad_environment "T"
2209 $ CALL Bad_environment "FOO"
2210 $ CALL Bad_environment "EXT"
2211 $ CALL Bad_environment "TEST" "SYMBOL"
2212 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
2214 $! %Config-I-VMS, write perl_setup.com here
2216 $ IF (.NOT.perl_symbol)
2218 $ file_2_find = "[-]''packageup'.cld"
2220 $ echo4 "%Config-I-VMS, The perl.cld file is now being written..."
2221 $ OPEN/WRITE CONFIG 'file_2_find'
2223 $ IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
2224 $ IF (use_vmsdebug_perl)
2226 $ WRITE CONFIG "define verb dbgperl"
2227 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]dbgperl''ext'")
2228 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2230 $ WRITE CONFIG "define verb perl"
2231 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]ndbgPerl''ext'")
2232 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2234 $ WRITE CONFIG "define verb perl"
2235 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]perl''ext'")
2236 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2239 $ ENDIF ! (.NOT.perl_symbol)
2241 $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
2242 $ file_2_find = "[-]perl_setup.com"
2243 $ OPEN/WRITE CONFIG 'file_2_find'
2245 $ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
2246 $ IF cf_email.NES.perladmin
2248 $ WRITE CONFIG "$! perl configured by ''cf_email'"
2250 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
2253 $ prefix = prefix - "000000."
2254 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
2255 prefix = prefix - "]" + ".]"
2256 $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
2257 $ WRITE CONFIG "$ ext = "".exe"""
2258 $ IF sharedperl .EQS. "Y"
2260 $ write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
2264 $ IF (use_vmsdebug_perl)
2266 $ WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
2267 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]ndbgPerl'ext'"
2268 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2270 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
2271 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2273 $ ELSE ! .NOT.perl_symbol
2274 $ IF (use_vmsdebug_perl)
2276 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2278 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2280 $ IF perl_verb .EQS. "PROCESS"
2282 $ WRITE CONFIG "$ set command ''packagup'_ROOT:[000000]''packageup'.CLD"
2284 $ ENDIF ! perl_symbol
2285 $ WRITE CONFIG "$ define/nolog pod2text Perl_Root:[lib.pod]pod2text.com"
2286 $ WRITE CONFIG "$ define/nolog pod2html Perl_Root:[lib.pod]pod2html.com"
2287 $ WRITE CONFIG "$ define/nolog pod2man Perl_Root:[lib.pod]pod2man.com"
2291 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2292 $ ELSE !leave in but commented out (in case setting was from perl :-)
2293 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2296 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
2300 $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
2301 $ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
2302 $ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
2303 $ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' Perl_Root:[lib.pod]pod2latex.com"""
2304 $ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
2305 $ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' Perl_Root:[lib]Perlbug.com"""
2306 $ WRITE CONFIG "$ c2ph == ""'"+"'Perl' Perl_Root:[utils]c2ph.com"""
2307 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2309 $ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' Perl_Root:[utils]dprofpp.com"""
2311 $ WRITE CONFIG "$ h2ph == ""'"+"'Perl' Perl_Root:[utils]h2ph.com"""
2312 $ WRITE CONFIG "$ h2xs == ""'"+"'Perl' Perl_Root:[utils]h2xs.com"""
2313 $ WRITE CONFIG "$!perlcc == ""'"+"'Perl' Perl_Root:[utils]perlcc.com"""
2314 $ WRITE CONFIG "$ splain == ""'"+"'Perl' Perl_Root:[utils]splain.com"""
2316 $ WRITE CONFIG "$ Perldoc == ""Perl Perl_Root:[lib.pod]Perldoc.com -t"""
2317 $ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
2318 $ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
2319 $ WRITE CONFIG "$ pod2latex == ""Perl Perl_Root:[lib.pod]pod2latex.com"""
2320 $ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
2321 $ WRITE CONFIG "$!Perlbug == ""Perl Perl_Root:[lib]Perlbug.com"""
2322 $ WRITE CONFIG "$ c2ph == ""Perl Perl_Root:[utils]c2ph.com"""
2323 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2325 $ WRITE CONFIG "$ dprofpp == ""Perl Perl_Root:[utils]dprofpp.com"""
2327 $ WRITE CONFIG "$ h2ph == ""Perl Perl_Root:[utils]h2ph.com"""
2328 $ WRITE CONFIG "$ h2xs == ""Perl Perl_Root:[utils]h2xs.com"""
2329 $ WRITE CONFIG "$!perlcc == ""Perl Perl_Root:[utils]perlcc.com"""
2330 $ WRITE CONFIG "$ splain == ""Perl Perl_Root:[utils]splain.com"""
2335 $ echo "%Config-I-VMS, The file can be found at:"
2336 $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
2337 $ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
2338 $ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
2339 $ echo "-Config-I-VMS, testing, and installation of your perl."
2341 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
2343 $ file_2_find = "[-]''packageup'_install.com"
2344 $ OPEN/WRITE CONFIG 'file_2_find
2345 $ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
2346 $ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
2347 $ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
2350 $ echo4 "%Config-I-VMS, In order to install the ''packageup' verb into DCLTABLES run:"
2351 $ echo4 "-Config-I-VMS, @ ''F$SEARCH(file_2_find)'"
2352 $ echo4 "-Config-I-VMS, after a successful build, test, and install. Do so with CMKRNL privilege."
2356 $!figure out where we "are" by parsing 'vms_default_directory_name'
2358 $ set_def_command = ""
2359 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
2360 $ tmp = vms_default_directory_name - dflt - "]"
2362 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
2364 $ tmp1 = F$ELEMENT(i,".",tmp)
2365 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
2367 $ THEN set_def_command = "set default [-"
2368 $ ELSE set_def_command = set_def_command + "-"
2372 $Beyond_set_def_loop:
2373 $ IF set_def_command.NES.""
2375 $ set_def_command = set_def_command - "-" + "]"
2377 $ echo4 "In order to build ''package' you must now issue the commands:"
2379 $ echo4 " ''set_def_command'"
2382 $ echo4 "In order to build ''package' you must now issue the command:"
2385 $ echo4 " ''make'''makefile'", macros
2388 $ IF ( F$SEARCH("config.msg").NES."" )
2390 $ echo "Hmm. I also noted the following information while running:"
2393 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
2394 $ DELETE/NOLOG/NOCONFIRM config.msg;
2400 $ DEASSIGN SYS$OUTPUT
2401 $! DEASSIGN SYS$ERROR
2403 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
2404 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt
2405 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
2407 $ dflt = F$ENVIRONMENT("DEFAULT")
2408 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
2410 $ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
2412 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
2413 $ DELETE/NOLOG/NOCONFIRM UU.DIR;
2415 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2418 $!: End of Configure