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
33 $ sav_ver = F$VERIFY(0)
35 $! VMS-isms we will need:
36 $ echo = "write sys$output "
43 $ use_debugging_perl = "y"
45 $ be_case_sensitive = "n"
46 $ use_vmsdebug_perl = "n"
49 $ C_Compiler_Replace = "CC="
50 $ Thread_Live_Dangerously = "MT="
51 $ use_two_pot_malloc = "N"
52 $ use_pack_malloc = "N"
53 $ use_debugmalloc = "N"
56 $ use_multiplicity = "N"
57 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
58 $ max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_xxx] not [A.B.C.PERL5_xxx]
59 $! max_allowed_dir_depth = 2 ! e.g. [A.PERL5_xxx] not [A.B.PERL5_xxx]
61 $ vms_filcnt = F$GETJPI ("","FILCNT")
63 $!: compute my invocation name
64 $ me = F$ENVIRONMENT("PROCEDURE")
66 $! Many null statements (begin with colon ':') in the Bourne shell version of
67 $! this script serve as comments/placeholders. I have retained some of the ones
68 $! that will help you compare this .COM file to the sh version - as well as
69 $! leave placeholders for future improvements to this .COM file.
70 $! sfn = VMS "skipped for now"
72 $!: Proper PATH separator !sfn
73 $!: Proper PATH setting !sfn
74 $!: Sanity checks !sfn "Say '@''$me''"
75 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
76 $!: Configure runs within the UU subdirectory !->after find MANIFEST
77 $! <big long list of default values (mostly null)>
78 $!: We must find out about Eunice early !(?)
79 $!: list of known cpp symbols, sorted alphabetically !sfn
81 $!: default library list !sfn
82 $! <no hints files in use (yet?)>
83 $!: Extra object files, if any, needed on this platform. !sfn
84 $!: Possible local include directories to search. !sfn
85 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
86 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
87 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
88 $!: no include file wanted by default !sfn
90 $!: Possible local library directories to search. !sfn
91 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
92 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
93 $!: general looking path for locating libraries !sfn
94 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
95 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
96 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
97 $!: Private path used by Configure to find libraries. Its value !sfn
98 $!: is prepended to libpth. This variable takes care of special !sfn
99 $!: machines, like the mips. Usually, it should be empty. !sfn
101 $!: full support for void wanted by default !sfn
102 $!defvoidused=15 !sfn
103 $!: List of libraries we want. !sfn
104 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
105 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
106 $!libswanted="$libswanted ucb bsd BSD PW x" !sfn
107 $!: We probably want to search /usr/shlib before most other libraries. !sfn
108 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
109 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
110 $!glibpth="/usr/shlib $glibpth" !sfn
111 $!: Do not use vfork unless overridden by a hint file. !sfn
112 $!usevfork=false !sfn
113 $!: script used to extract .SH files with variable substitutions !sfn
114 $!: produce awk script to parse command line options !sfn
115 $!sfn (assume no sed awk) see below
116 $!: process the command line options
118 $!: set up default values
133 $ use_5005_threads = "N"
139 $ THEN !one or more switches was thrown
146 $ config_args = config_args + F$FAO(" !AS",P'i')
149 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
153 $ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
154 $ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
155 $Remove_quotation_mark:
157 $ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
158 $ gotopt = "f" !"alse"
159 $ gotshortopt = "f" !"alse"
160 $ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
163 $ gotopt = "t" !"rue"
165 $ gotshortopt = "t" !"rue"
167 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
174 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
178 $ IF (F$SEARCH(config_sh).NES."")
180 $ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
181 $ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
183 $ CONTINUE !at this point check UIC && if test allows...
186 $ echo "''me': cannot read config file ''config_sh'."
190 $ echo "''me': cannot read config file ''config_sh'."
195 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
202 $ IF (F$EXTRACT(0,1,P'i') .EQS. "m")
209 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
216 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
223 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
228 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
235 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
242 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
244 $ extractsh = "true" !VMS?
249 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
252 $!Hmm.. this part needs work
254 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
258 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
260 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
261 $ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
262 $ echo "''me': ignoring -D",P'i'
264 $!Hmm.. this part needs work
265 $! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
266 $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
269 $ ECHO "P''i' =>",P'i',"<=" !Diag
272 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
275 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
279 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
281 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
282 $ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
283 $ echo "''me': ignoring -U",P'i'
288 $ ECHO "P''i' =>",P'i',"<=" !Diag
291 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
293 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
294 $ echo "''me' generated by an unknown version of EDT."
300 $ echo "''me': unknown option ",P'i'
303 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
305 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
307 $ ENDIF ! (P1 .NES. "")
308 $ config_args = F$EDIT(config_args,"TRIM")
312 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
313 $ echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
314 $ echo " [-Usymbol] [-Usymbol=]"
316 "-d" : use defaults for all answers.
317 "-e" : go on without questioning past the production of config.sh. *
318 "-f" : specify an alternate default configuration file.
319 "-h" : print this help message and exit (with an error status).
320 "-m" : skip the MANIFEST check to see that all files are present
321 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
322 "-s" : silent mode, only echoes questions and essential information.
323 -"D" : define symbol to have some value: *
324 -"Dsymbol" symbol gets the value 'define'
325 -"Dsymbol=value" symbol gets the value 'value'
326 -E : stop at the end of questions, after having produced config.sh. *
327 -K : do not use unless you know what you are doing.
328 -O : let -D and -U override definitions from loaded configuration file. *
329 -S : perform variable substitutions on all .SH files (can mix with -f) *
330 -"U" : undefine symbol: *
331 -"Usymbol" symbol gets the value 'undef'
332 -"Usymbol=" symbol gets completely empty
333 -V : print version number and exit (with a zero status).
334 $ echo "%Config-I-VMS, lower case switches must be enclosed"
335 $ echo "-Config-I-VMS, in double quotation marks, e.g.:"
336 $ echo "-Config-I-VMS, @Configure ""-des"""
337 $ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
338 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
340 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
346 $ IF F$Mode() .eqs. "BATCH"
348 $ STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
349 $ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid file locking conflicts,"
350 $ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
351 $ WRITE SYS$OUTPUT STDOUT
353 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
355 $ DEFINE SYS$OUTPUT "_NLA0:"
356 $ echo4 = "write STDOUT "
357 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
358 $ open/write/share=read STDOUT 'STDOUT'
366 $ echo4 = "write SYS$OUTPUT "
370 $!: run the defines and the undefines, if any, but leave the file out there...
371 $! Unfortunately Configure.COM in DCL is not yet set up to do this -
376 $ packageup = F$EDIT((package - "5"),"UPCASE")
378 $!: Eunice requires " " instead of "", can you believe it
381 $ echo "Beginning of configuration questions for ''package'."
384 $!: Some greps do not return status, grrr.
385 $ contains = "SEARCH"
387 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
388 $! echo "Checking ''echo' to see how to suppress newlines..."
389 $! echo "giving up..."
390 $! echo "The star should be here-->*"
392 $!: Now test for existence of everything in MANIFEST
394 $ echo4 "First let's make sure your kit is complete. Checking..."
397 $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
398 $! because the search routine simply does set def [-] if necessary.
399 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
401 $ manifestfound = F$SEARCH(file_2_find)
402 $ IF (manifestfound .EQS. "")
404 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
407 $ GOTO Research_manifest
410 $ echo "There is no MANIFEST file. I hope your kit is complete !"
412 $ GOTO Beyond_manifest
415 $! MANIFEST. has been found and we have set def'ed there -
416 $! time to bail out before it's too late.
417 $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
418 $ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
419 $ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
422 %Config-E-VMS, ERROR:
423 Sorry! It apears as though your perl build sub-directory is already too
424 deep into the VMS file system. Please try moving stuff into a shallower
425 directory (or altering the "max_allowed_dir_depth" parameter).
426 $ echo4 "ABORTING..."
427 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
429 $ EXIT !2 !$STATUS = "%X00000002" (error)
433 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
435 $ IF (manifestfound .NES. "")
437 $ IF ( F$SEARCH("UU.DIR").EQS."" )
439 $ CREATE/DIRECTORY [.UU]
441 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
443 $!: Configure runs within the UU subdirectory
446 $! a little redundancy never hurt anybody?
447 $ file_2_find = "[-]" + file_2_find
448 $ manifestfound = F$SEARCH(file_2_find)
450 $ OPEN/WRITE MISSING MISSING.
451 $!change to "FALSE" if you wish to skip the manifest search
452 $!(which after all is rather slow in DCL :-)
455 $ echo "Skipping MANIFEST check as requested"
458 $ OPEN/READ CONFIG 'manifestfound'
460 $ READ/END_OF_FILE = Done_manifest CONFIG line
461 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
462 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
463 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
464 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
465 $ line = F$EDIT(line,"TRIM, COMPRESS")
466 $ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
467 $ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
469 $Re_strip_line_manifest:
470 $ loca = F$LOCATE("/",file_2_find)
471 $ ante = F$EXTRACT(0,loca,file_2_find)
472 $ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
473 $ test_this = ante + "." + (post - "/")
474 $ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
476 $ file_2_find = ante + "." + (post - "/")
477 $ GOTO Re_strip_line_manifest
479 $ file_2_find = ante + "]" + (post - "/")
481 $ file_2_find = "[-."+file_2_find
483 $ file_2_find = "[-]" + file_2_find
486 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
487 $ file_2_find = file_2_find - dirname
490 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
491 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
493 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
494 $ ELSE basename = basename + dot_ele + "_"
499 $ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
500 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
501 basename = f$extract(0,f$length(basename)-1,basename)
502 $ file_2_find = dirname + basename
504 $ found = F$SEARCH(file_2_find)
505 $ IF (found .EQS. "" .AND. dots .GT. 2)
507 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
508 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
509 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
510 $ basename[f$locate(".",basename),1] := _
511 $ dot_ele = F$ELEMENT(dots - 1,"_",basename)
513 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
515 $ found = F$SEARCH(dirname + basename)
516 $ file_2_find = file_2_find + "," + basename
518 $ IF (found .EQS. "")
520 $ WRITE MISSING file_2_find
521 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
523 $ miss_list = miss_list + "," + file_2_find
526 $ GOTO Read_loop_manifest
531 $ ENDIF ! (manifestfound .NES. "")
533 $ IF (miss_list .NES. "")
535 $ echo "Some of the files not found include:"
538 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
542 THIS PACKAGE SEEMS TO BE INCOMPLETE.
544 You have the option of continuing the configuration process, despite the
545 distinct possibility that your kit is damaged, by typing 'y'es. If you
546 do, don't blame me if something goes wrong. I advise you to type 'n'o
547 and contact the author (dan@sidhe.org)
549 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
552 $ echo4 "Continuing..."
554 $ echo4 "ABORTING..."
558 $ echo4 "Looks good..."
559 $ DELETE/NOLOG MISSING.;
560 $ ENDIF ! (miss_list .NES. "")
561 $ ENDIF ! (manifestfound .EQS. "") ELSE
563 $! after finding MANIFEST (see above)
564 $!: Configure runs within the UU subdirectory
566 $!: compute the number of columns on the terminal for proper question formatting
567 $! (sfn, will assume 80-ish)
569 $!: set up the echo used in my read !sfn
570 $!: now set up to do reads with possible shell escape and default assignment !sfn
581 $ READ SYS$COMMAND/PROMPT="''rp'" ans
584 $ READ SYS$COMMAND/PROMPT="''rp'" ans
591 $!: create .config dir to save info across Configure sessions
592 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
594 $ CREATE/DIRECTORY [-.CONFIG]
595 $ OPEN/WRITE CONFIG [-.CONFIG]README.
597 "This directory created by Configure to save information that should"
599 "persist across sessions."
602 "You may safely delete it if you wish."
606 $!: general instructions
609 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
610 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
612 $ messages = F$ENVIRONMENT("MESSAGE")
613 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
614 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
615 $ IF .NOT.($status.EQ.%X08D78053)
619 $ rp = "Would you like to see the instructions? [''dflt'] "
621 $ if .NOT.ans THEN needman=""
623 $ SET MESSAGE 'messages'
625 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
631 This installation shell script will examine your system and ask you questions
632 to determine how the perl5 package should be installed. If you get
633 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
634 process, edit something, then restart this process as you just did.
635 Many of the questions will have default answers in square
636 brackets; typing carriage return will give you the default.
638 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
641 In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
642 the questions and use the computed defaults (or the previous answers provided
643 there was already a config.sh file). Type '@Configure "-h"' for a list of
646 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
649 Much effort has been expended to ensure that this shell script will
650 run on any VMS system. If despite that it blows up on yours, your
651 best bet is to edit Configure.com and @ it again. Whatever problems
652 you have with Configure.com, let me (dan@sidhe.org) know how I blew
655 $!This installation script affects things in two ways:
657 $!1) it may do direct variable substitutions on some of the files included
659 $!2) it builds a config.h file for inclusion in C programs. You may edit
660 $! any of these files as the need arises after running this script.
662 $!If you make a mistake on a question, there is no easy way to back up to it
665 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
666 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
668 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
672 $ ENDIF !(needman .EQS. "true")
674 $!: see if sh knows # comments !sfn
676 $!: figure out how to guarantee sh startup !sfn
677 $!: find out where common programs are !sfn
678 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
679 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
680 $! echo "I don't know where '$file' is, and my life depends on it."
681 $! echo "Go find a public domain implementation or fix your PATH setting!"
683 $! echo "Don't worry if any of the following aren't found..."
684 $!: determine whether symbolic links are supported !sfn
685 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
686 $!: set up the translation script tr, must be called with ./tr of course !sfn
688 $!: Try to determine whether config.sh was made on this system
689 $!: Get old answers from old config file if Configure was run on the
690 $!: same system, otherwise use the hints.
691 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
695 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
697 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
699 $ configshfound = F$SEARCH(config_sh)
700 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
702 $ IF (i.LT.max) THEN GOTO Config_sh_look
703 $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
706 $ echo "Fetching default answers from ''config_sh'..."
707 $!we actually do not have "hints/" for VMS
710 $!First time through, eh? I have some defaults handy for the following systems:
712 $! echo " ","VMS_VAX"
713 $! echo " ","VMS_AXP"
714 $! : Now look for a hint file osname_osvers, unless one has been
715 $! : specified already.
718 $!You may give one or more space-separated answers, or "none" if appropriate.
719 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
721 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
725 $!: Restore computed paths !sfn
727 $! genconfig.pl has "osname='VMS'"
728 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
729 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
731 $ IF (osname .NES. "VMS")
733 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
736 %Config-E-VMS, ERROR:
738 Err, you do not appear to be running VMS!
739 This procedure is intended to Configure the building of Perl for VMS.
741 $ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
744 $ echo4 "Continuing..."
746 $ echo4 "ABORTING..."
747 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
749 $ EXIT 2 !$STATUS = "%X00000002" (error)
751 $ ELSE !we are on VMS huzzah!
753 $ THEN TYPE SYS$INPUT:
755 Configure uses the operating system name and version to set some defaults.
756 The default value is probably right if the name rings a bell. Otherwise,
757 since spelling matters for me, either accept the default or answer "none"
760 $ rp = "Operating system name? [''osname'] "
764 $ IF (ans.NES.osname) !.AND.knowitall
766 $ echo4 "I'll go with ''osname' anyway..."
769 $ ENDIF !(osname .NES./.EQS. "VMS")
771 $!: who configured the system
773 $ cf_by = F$EDIT(user,"LOWERCASE")
774 $! cf_time = F$CVTIME() !superceded by procedure below
775 $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
777 $! Peter Prymmer has seen:
778 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
779 $! "SYS$TIME_ZONE" = "EDT"
781 $! Charles Lane recommended:
782 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
783 $! "NEWS_TIMEZONE" = "-0500"
784 $! "ST_TIMEZONE" = "EDT"
785 $! "JAN_TIME_ZONE" = "EST "
786 $! "MULTINET_TIMEZONE" = "EST"
787 $! "DAYLIGHT_SAVINGS" = "1"
789 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
791 $! "Multinet_Timezone"
792 $! "TCPware_Timezone"
795 $! This snippet o' DCL returns a string in default Unix `date` format,
796 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
797 $! Peter Prymmer pvhp@lns62.lns.cornell.edu
799 $ MIN_TZO = -840 !units are minutes here
802 $ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
803 $ monn = F$CVTIME(,,"MONTH")
804 $ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
805 $ hour = F$CVTIME(,,"HOUR")
806 $ min = F$CVTIME(,,"MINUTE")
807 $ sec = F$CVTIME(,,"SECOND")
808 $ year = F$CVTIME(,,"YEAR")
810 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
814 $ mon = F$ELEMENT(i,"/",months)
815 $ IF i.LT.monn THEN GOTO Mon_loop
818 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
821 $ tzhour = F$INTEGER(systz)/3600
822 $ tzmins = F$INTEGER(systz)/60
823 $ tzminrem = tzmins - tzhour*60
824 $ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
826 $ THEN signothetime = "+"
827 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
828 $ THEN direction = "on GMT/"
829 $ ELSE direction = "east of "
831 $ ELSE signothetime = "-"
832 $ tzhour = -1*tzhour !keeps !UL happy
833 $ direction = "west of "
836 $ echo "%Config-I-VMS,"
837 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
840 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
842 $ tzspan = "''tzhour' hours"
845 $ echo "Your system is ''tzspan' ''direction'UTC in England."
846 $ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
848 $ IF ans.OR.(ans.EQS."")
852 $ GOTO Beyond_TimeZone
856 $ echo4 "%Config-I-VMS,"
857 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
862 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
863 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
864 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
866 $ rp = "Enter the Time Zone offset: [''dflt'] "
868 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
869 $ IF ans.EQS."" THEN ans = dflt
870 $ tzhour = F$ELEMENT(0,":","''ans'") !first
871 $ IF tzhour.EQS."" THEN tzhour = 0
872 $ tzhour = F$INTEGER(tzhour)
873 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
876 $ tzminrem = F$INTEGER(tzminrem)
877 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
881 $ tzmins = tzhour*60 + tzminrem
882 $ tzd = F$STRING(tzmins*60)
887 $ tzhour = -1*tzhour !keeps !UL happy
890 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
893 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
898 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
899 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
901 $!: determine the architecture name
902 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
904 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
906 $ archname = "VMS_VAX"
907 $ otherarch = "an Alpha"
909 $ arch_type = "ARCH-TYPE=__VAX__"
911 $ archname = "VMS_AXP"
912 $ otherarch = "a VAX"
914 $ arch_type = "ARCH-TYPE=__AXP__"
916 $ rp = "What is your architecture name? [''archname'] "
920 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
921 $ IF (ans.NES.archname) !.AND.knowitall
923 $ echo4 "I'll go with ''archname' anyway..."
927 $ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
931 $ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
938 $ IF (archname.EQS."VMS_AXP")
940 $ macros = macros + """AXE=1"","
944 $!: is AFS running? !sfn
945 $!: decide how portable to be. Allow command line overrides. !sfn
946 $!: set up shell script to do ~ expansion !sfn
947 $!: expand filename !sfn
948 $!: now set up to get a file name !sfn
950 $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
951 $ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
952 $ prefixbase = prefix - "]"
953 $ prefix = prefixbase + ".]"
954 $!: determine root of directory hierarchy where package will be installed.
959 $ echo "By default, ''package' will be installed in ''dflt', pod"
960 $ echo "pages under ''prefixbase'LIB.POD], etc..., i.e. with ''dflt' as prefix for"
961 $ echo "all installation directories."
962 $ echo "On ''osname' the ''prefix' is used to DEFINE the ''packageup'_ROOT prior to installation"
963 $ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
965 $ rp = "Installation prefix to use (for ''packageup'_ROOT)? [ ''dflt' ] "
970 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
975 $! Check here for pre-existing PERL_ROOT.
976 $! -> ask if removal desired.
977 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
978 $! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
980 $ vms_skip_install = "true"
983 $ rp = "%Config-I-VMS, Skip the remaining """"where install"""" questions? [''dflt'] "
985 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
986 $ IF (.NOT.vms_skip_install)
989 $!: set the prefixit variable, to compute a suitable default value
991 $!: determine where private library files go
992 $!: Usual default is /usr/local/lib/perl5. Also allow things like
993 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
995 $ THEN TYPE SYS$INPUT:
997 There are some auxiliary files for perl5 that need to be put into a
998 private library directory that is accessible by everyone.
1000 $ dflt = prefix - ".]" + ".LIB]"
1001 $ rp = "Pathname where the private library files will reside? "
1002 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1005 $ THEN privlib = ans
1006 $ ELSE privlib = dflt
1009 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
1011 $ perl_symbol = "true"
1017 $ echo "%Config-I-VMS, You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1018 $ echo "-Config-I-VMS, symbol to invoke ''package', which is the usual method."
1019 $ echO "-Config-I-VMS, If you do not do so then you would need a DCL command verb at the"
1020 $ echo "-Config-I-VMS, process or the system wide level."
1022 $ rp = "Invoke perl as a global symbol foreign command [''dflt'] "
1024 $ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
1026 $ IF (.NOT.perl_symbol)
1032 $ echo "%Config-I-VMS, Since you won't be using a symbol you must choose to put the ''packageup'"
1033 $ echo "-Config-I-VMS, verb in a per-process table or in the system wide DCLTABLES (which"
1034 $ echo "-Config-I-VMS, would require write privilege)."
1036 $ rp = "Invoke perl as a per process command verb [ ''dflt' ] "
1038 $ IF (.NOT.ans).AND.(ans.NES."")
1039 $ THEN perl_verb = "DCLTABLES"
1040 $ ELSE perl_verb = "PROCESS"
1042 $ ENDIF ! (.NOT.perl_symbol)
1044 $!: set the base revision
1046 $ revision = baserev - ".0"
1047 $!: get the patchlevel
1049 $ echo4 "Getting the current patchlevel..." !>&4
1050 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1051 $ IF (patchlevel_h.NES."")
1053 $ got_patch = "false"
1055 $ got_api_revision = "false"
1056 $ got_api_version = "false"
1057 $ got_api_subversion = "false"
1058 $ OPEN/READONLY CONFIG 'patchlevel_h'
1060 $ READ/END_Of_File=Close_patch CONFIG line
1061 $ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1063 $ line = F$EDIT(line,"COMPRESS, TRIM")
1064 $ patchlevel = F$ELEMENT(2," ",line)
1065 $ got_patch = "true"
1067 $ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1069 $ line = F$EDIT(line,"COMPRESS, TRIM")
1070 $ subversion = F$ELEMENT(2," ",line)
1073 $ IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1075 $ line = F$EDIT(line,"COMPRESS, TRIM")
1076 $ api_revision = F$ELEMENT(2," ",line)
1077 $ got_api_revision = "true"
1079 $ IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1081 $ line = F$EDIT(line,"COMPRESS, TRIM")
1082 $ api_version = F$ELEMENT(2," ",line)
1083 $ got_api_version = "true"
1085 $ IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1087 $ line = F$EDIT(line,"COMPRESS, TRIM")
1088 $ api_subversion = F$ELEMENT(2," ",line)
1089 $ got_api_subversion = "true"
1091 $ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1098 $ IF (F$STRING(subversion) .NES. "0")
1100 $ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
1102 $ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
1105 $ version = revision + "_" + patchlevel + "_" + subversion
1107 $ IF (.NOT.vms_skip_install)
1109 $!: set the prefixup variable, to restore leading tilda escape !sfn
1110 $!: set the prefixup variable, to restore leading tilde escape !sfn
1112 $!: determine where public architecture dependent libraries go
1116 $ echo "''package' contains architecture-dependent library files. If you are"
1119 $ THEN TYPE SYS$INPUT:
1120 sharing libraries in a heterogeneous environment, you might store
1121 these files in a separate location. Otherwise, you can just include
1122 them with the rest of the public library files.
1124 $ dflt = privlib - "]" + "." + archname + "." + version + "]"
1125 $ rp = "Where do you want to put the public architecture-dependent libraries? "
1126 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1129 $ THEN archlib = ans
1130 $ ELSE archlib = dflt
1133 $!: set up the script used to warn in case of inconsistency !sfn
1134 $!: function used to set $1 to $val !sfn
1136 $ ENDIF !%Config-I-VMS, skip "where install" questions
1137 $! This quotation from Configure has to be included on VMS:
1140 There is, however, a strange, musty smell in the air that reminds me of
1141 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1143 $ IF (.NOT.vms_skip_install)
1145 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1147 $!: see if setuid scripts can be secure !sfn
1148 $!: now see if they want to do setuid emulation !sfn
1150 $!: determine where site specific libraries go.
1152 $ THEN TYPE SYS$INPUT:
1154 The installation process will also create a directory for
1155 site-specific extensions and modules. Some users find it convenient
1156 to place all local files in this directory rather than in the main
1157 distribution directory.
1159 $ dflt = privlib - "]" + ".SITE_PERL]"
1160 $ rp = "Pathname for the site-specific library files? "
1161 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1164 $ THEN sitelib = ans
1165 $ ELSE sitelib = dflt
1168 $!: determine where site specific architecture-dependent libraries go.
1170 $ THEN TYPE SYS$INPUT:
1172 The installation process will also create a directory for
1173 architecture-dependent site-specific extensions and modules.
1175 $ dflt = sitelib - "]" + "." + archname + "]"
1176 $ rp = "Pathname for the site-specific architecture-dependent library files? "
1177 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1180 $ THEN sitearch = ans
1181 $ ELSE sitearch = dflt
1184 $!: determine where old public architecture dependent libraries might be
1186 $!: determine where public executables go
1187 $ dflt = prefix - ".]" + ".BIN]"
1188 $ rp = "Pathname where the public executables will reside? "
1189 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1196 $!: determine where manual pages are on this system
1197 $!: What suffix to use on installed man pages
1198 $!: see if we can have long filenames
1199 $!: determine where library module manual pages go
1200 $!: What suffix to use on installed man pages
1201 $!: see what memory models we can support
1203 $ ENDIF !%Config-I-VMS, skip "where install" questions
1205 $!: see if we need a special compiler
1206 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1210 $ vms_cc_available = ""
1212 $ OPEN/WRITE CONFIG ccvms.c
1213 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1214 $ WRITE CONFIG "#include <stdio.h>"
1215 $ WRITE CONFIG "int main() {"
1216 $ WRITE CONFIG "#ifdef __DECC"
1217 $ WRITE CONFIG " printf(""/DECC\n"");"
1218 $ WRITE CONFIG "#else"
1219 $ WRITE CONFIG " printf(""/VAXC\n"");"
1220 $ WRITE CONFIG "#endif"
1221 $ WRITE CONFIG " exit(0);"
1225 $! DEFINE SYS$ERROR _NLA0:
1226 $! DEFINE SYS$OUTPUT _NLA0:
1227 $ cc/NoObj/list=ccvms.lis ccvms.c
1229 $! DEASSIGN SYS$OUTPUT
1230 $! DEASSIGN SYS$ERROR
1231 $ IF (silent) THEN GOSUB Shut_up
1232 $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1234 $ IF tmp.NE.%X10B90001
1236 $ IF tmp.NE.%X10000001
1238 $ nocc = "t" !%X10000001 is return from gcc
1239 $ GOTO Gcc_initial_check
1244 $ IF .NOT.silent THEN echo ""
1245 $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1246 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1250 $ echo "%Config-I-VMS, Will try cc/decc..."
1252 $ DEFINE SYS$ERROR _NLA0:
1253 $ DEFINE SYS$OUTPUT _NLA0:
1255 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1257 $ DEASSIGN SYS$OUTPUT
1258 $ DEASSIGN SYS$ERROR
1260 $ IF (silent) THEN GOSUB Shut_up
1261 $ IF tmp.NE.%X10B90001
1263 $ echo "%Config-I-VMS, Apparently you don't have that one."
1266 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1267 $ vms_cc_available = vms_cc_available + "cc/decc "
1270 $ IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
1272 $ vms_cc_dflt = "/decc"
1273 $ vms_cc_available = vms_cc_available + "cc/decc "
1278 $ echo "%Config-I-VMS, Checking for Gcc"
1279 $ OPEN/WRITE CONFIG gccvers.lis
1280 $ DEFINE SYS$ERROR CONFIG
1281 $ DEFINE SYS$OUTPUT CONFIG
1282 $ 'gcc_symbol'/noobj/version _nla0:
1284 $ DEASSIGN SYS$OUTPUT
1285 $ DEASSIGN SYS$ERROR
1286 $ IF (silent) THEN GOSUB Shut_up
1288 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1290 $ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1293 $ OPEN/READ CONFIG gccvers.lis
1295 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1296 $ GOTO GCC_List_Read
1300 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1301 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1304 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1306 $!: see if we need a special compiler
1308 $ echo "%Config-I-VMS, available compiler(s):"
1309 $ echo "( ''vms_cc_available')"
1312 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1316 $ rp = "Use which C compiler? [''dflt'] "
1320 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1322 $ IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
1325 $ Using_Dec_C = "Yes"
1326 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1330 $ IF (F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)).or(F$LOCATE("compaq",dflt).NE.F$LENGTH(dflt))
1332 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1334 $ Using_Dec_C = "Yes"
1337 $ IF Mcc .EQS. "cc/decc"
1339 $ Using_Dec_C = "Yes"
1340 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1345 $ IF Mcc .EQS. "cc/decc"
1347 $ Using_Dec_C = "Yes"
1348 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1350 $ IF Mcc .EQS. "gcc"
1352 $ Using_Gnu_C = "Yes"
1353 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1356 $Decc_Version_check:
1357 $ IF "''Using_Dec_C'".EQS."Yes"
1360 $ echo4 "Checking for Dec C's version number..." !>&4
1361 $ OPEN/WRITE CONFIG deccvers.c
1362 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1363 $ WRITE CONFIG "#include <stdio.h>"
1364 $ WRITE CONFIG "int main() {"
1365 $ WRITE CONFIG "#ifdef __DECC"
1366 $ WRITE CONFIG "#ifdef __DECC_VER"
1367 $ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1368 $ WRITE CONFIG "#else"
1369 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1370 $ WRITE CONFIG "#endif"
1371 $ WRITE CONFIG "#endif"
1372 $ WRITE CONFIG " exit(0);"
1375 $ DEFINE SYS$ERROR _NLA0:
1376 $ DEFINE SYS$OUTPUT _NLA0:
1379 $ DEASSIGN SYS$ERROR _NLA0:
1380 $ DEASSIGN SYS$OUTPUT _NLA0:
1381 $ IF (silent) THEN GOSUB Shut_up
1382 $ DEFINE SYS$ERROR _NLA0:
1383 $ DEFINE SYS$OUTPUT _NLA0:
1386 $ DEASSIGN SYS$ERROR
1387 $ DEASSIGN SYS$OUTPUT
1388 $ IF (silent) THEN GOSUB Shut_up
1389 $ OPEN/WRITE CONFIG deccvers.out
1390 $ DEFINE SYS$ERROR CONFIG
1391 $ DEFINE SYS$OUTPUT CONFIG
1392 $ mcr []deccvers.exe
1395 $ DEASSIGN SYS$OUTPUT
1396 $ DEASSIGN SYS$ERROR
1397 $ IF (silent) THEN GOSUB Shut_up
1398 $ OPEN/READ CONFIG deccvers.out
1399 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1402 $! DELETE/NOLOG/NOCONFIRM deccvers.*;
1403 $ echo "You are using Dec C ''line'"
1404 $ Dec_C_Version = line
1405 $ Dec_C_Version = Dec_C_Version + 0
1406 $ if Dec_C_Version.ge.60200000 THEN CC_FLAGS = CC_FLAGS + "/NOANSI_ALIAS"
1409 $ if "''using_gnu_c'" .eqs. "Yes"
1411 $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1412 $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1413 $ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1414 $ IF gcclib_olb .EQS. ""
1416 $! These objects/libs come w/ gcc 2.7.2 for AXP:
1417 $ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1418 $ IF tmp .NES. "" then gcclib_olb = tmp
1419 $ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1422 $ IF gcclib_olb .EQS. ""
1423 $ THEN gcclib_olb = tmp
1424 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1427 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1430 $ IF gcclib_olb .EQS. ""
1431 $ THEN gcclib_olb = tmp
1432 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1435 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1438 $ IF gcclib_olb .EQS. ""
1439 $ THEN gcclib_olb = tmp
1440 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1443 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1445 $ gcclib_olb = gcclib_olb + "/lib"
1447 $ IF gcclib_olb .NES. "" .AND. -
1448 (vaxcrtl_olb .NES. "" .OR. -
1449 vaxcrtl_exe .NES. "" )
1452 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1453 $ OPEN/WRITE CONFIG gccvers.c
1454 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1455 $ WRITE CONFIG "#include <stdio.h>"
1456 $ WRITE CONFIG "int main() {"
1457 $ WRITE CONFIG "#ifdef __GNUC__"
1458 $ WRITE CONFIG "#ifdef __VERSION__"
1459 $ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1460 $ WRITE CONFIG "#else"
1461 $ WRITE CONFIG " printf(""%s\n"", ""1"");"
1462 $ WRITE CONFIG "#endif"
1463 $ WRITE CONFIG "#endif"
1464 $ WRITE CONFIG " exit(0);"
1467 $ DEFINE SYS$ERROR _NLA0:
1468 $ DEFINE SYS$OUTPUT _NLA0:
1471 $ DEASSIGN SYS$ERROR _NLA0:
1472 $ DEASSIGN SYS$OUTPUT _NLA0:
1473 $ IF (silent) THEN GOSUB Shut_up
1474 $ DEFINE SYS$ERROR _NLA0:
1475 $ DEFINE SYS$OUTPUT _NLA0:
1476 $ IF vaxcrtl_exe .EQS. ""
1478 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1480 $ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1483 $ link gccvers.obj,'gcclib_olb'
1487 $ OPEN/WRITE CONFIG GCCVERS.OPT
1488 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1490 $ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1493 $ DEASSIGN SYS$ERROR
1494 $ DEASSIGN SYS$OUTPUT
1495 $ IF (silent) THEN GOSUB Shut_up
1496 $ OPEN/WRITE CONFIG gccvers.out
1497 $ DEFINE SYS$ERROR CONFIG
1498 $ DEFINE SYS$OUTPUT CONFIG
1502 $ DEASSIGN SYS$OUTPUT
1503 $ DEASSIGN SYS$ERROR
1504 $ IF (silent) THEN GOSUB Shut_up
1505 $ OPEN/READ CONFIG gccvers.out
1506 $ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1509 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1510 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1512 $ echo "You are not using GNU cc."
1515 $ echo "You are using GNU cc ''line'"
1516 $ Using_Gnu_C = "Yes"
1517 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1525 $ OPEN/READ CONFIG ccvms.lis
1527 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1535 $ line = F$EDIT(line,"TRIM,COMPRESS")
1536 $ line = line - "Page 1" ! occurs at end all compilers
1537 $ line = line - "CCVMS " ! filename appears w/ VAXC
1538 $ line = line - "Source Listing " ! Seen w/ AXP DECC
1539 $ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1541 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1542 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1546 $!: What should the include directory be ?
1548 $ rp = "Where are the include files you want to use? "
1549 $ IF f$length( rp + "[''dflt'] " ).gt.76
1550 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1551 $ ELSE rp = rp + "[''dflt'] "
1556 $!: see if we have to deal with yellow pages, now NIS.
1557 $!: now get the host name
1560 $ echo4 "Figuring out host name..." !>&4
1562 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1563 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1564 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1565 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1566 $ IF myhostname.eqs."".and. -
1567 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1568 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1569 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1570 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1571 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1572 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1573 $ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1574 $!: you do not want to know about this
1576 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1578 $ IF (.not.ans).and.(ans.NES."")
1580 $ READ SYS$COMMAND/PROMPT= -
1581 "Please type the (one word) name of your host: " ans
1584 $!: translate upper to lower if necessary
1585 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1586 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1587 $ IF mylowhostname.NES.myhostname
1589 $ echo "(Normalizing case in your host name)"
1590 $ myhostname = mylowhostname
1593 $ fp = F$LOCATE(".",myhostname)
1594 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1595 $ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1597 $ rp = "What is your domain name? [''mydomain'] "
1599 $ IF ans .nes. "" THEN mydomain = ans
1600 $!: translate upper to lower if necessary
1601 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1602 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1603 $ IF mylowdomain.NES.mydomain
1605 $ echo "(Normalizing case in your domain name)"
1606 $ mydomain = mylowdomain
1609 $ myhostname = myhostname - mydomain
1610 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1612 $ THEN TYPE SYS$INPUT:
1614 I need to get your e-mail address in Internet format if possible, i.e.
1615 something like user@host.domain. Please answer accurately since I have
1616 no easy means to double check it. The default value provided below
1617 is most probably close to the reality but may not be valid from outside
1618 your organization...
1620 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1621 $ rp = "What is your e-mail address? [''dflt'] "
1624 $ THEN cf_email = ans
1625 $ ELSE cf_email = dflt
1629 $ THEN TYPE SYS$INPUT:
1631 If you or somebody else will be maintaining perl at your site, please
1632 fill in the correct e-mail address here so that they may be contacted
1633 if necessary. Currently, the "perlbug" program included with perl
1634 will send mail to this address in addition to perlbug@perl.com. You may
1635 enter "none" for no administrator.
1637 $ dflt = "''cf_email'"
1638 $ rp = "Perl administrator e-mail address [''dflt'] "
1641 $ THEN perladmin = ans
1642 $ ELSE perladmin = dflt
1645 $!: determine where public executable scripts go
1646 $!: determine perl absolute location
1647 $!: figure out how to guarantee perl startup
1649 $!: see how we invoke the C preprocessor
1651 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1652 $!: Set private lib path
1653 $!: Now check and see which directories actually exist, avoiding duplicates
1654 $!: determine optimize, if desired, or use for debug flag also
1655 $!: We will not override a previous value, but we might want to
1656 $!: augment a hint file
1657 $!: the following weeds options from ccflags that are of no interest to cpp
1658 $!: flags used in final linking phase
1659 $!: Try to guess additional flags to pick up local libraries.
1662 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1663 $!: compute shared library extension
1664 $!: Looking for optional libraries
1665 $!: see if nm is to be used to determine whether a symbol is defined or not
1666 $!: get list of predefined functions in a handy place
1667 $!: see if we have sigaction
1668 $!: see whether socketshr exists
1669 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1671 $ has_socketshr = "T"
1673 $ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1675 $ if (Dec_C_Version .ge. 50200000)
1677 $ Has_Dec_C_Sockets = "T"
1679 $ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1681 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1682 $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1685 $ echo "You've got sockets available. Which socket stack do you want to"
1686 $ echo "build into perl?"
1687 $ if "''has_dec_c_sockets'".eqs."T"
1691 $ dflt = "SOCKETSHR"
1693 $ rp = "Choose socket stack (NONE"
1694 $ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1695 $ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1696 $ rp = rp + ") [''dflt'] "
1698 $ IF "''ans'".eqs."" THEN ans = "''dflt'"
1699 $ has_dec_c_sockets = "F"
1700 $ has_socketshr = "F"
1701 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1702 $ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1703 $ IF ans.eqs."socketshr" then has_socketshr = "T"
1707 $! Ask if they want to build with VMS_DEBUG perl
1709 $ echo "Perl can be built to run under the VMS debugger."
1710 $ echo "You should only select this option if you are debugging"
1711 $ echo "perl itself. This can be a useful feature if you are "
1712 $ echo "embedding perl in a program."
1714 $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1716 $ IF ans.eqs."" then ans = dflt
1717 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1719 $ use_vmsdebug_perl = "Y"
1720 $ macros = macros + """__DEBUG__=1"","
1722 $ use_vmsdebug_perl = "N"
1725 $! Ask if they want to build with MULTIPLICITY
1727 $ echo "The perl interpreter engine can be built in a way that makes it
1728 $ echo "possible for a program that embeds perl into it (and yes, you can
1729 $ echo "do that--it's pretty keen) to have multiple perl interpreters active
1730 $ echo "at once. There is some performance overhead, however, so you
1731 $ echo "probably don't want to choose this unless you're going to be doing
1732 $ echo "funky perl embedding."
1734 $ rp = "Build with MULTIPLICITY? [''dflt'] "
1736 $ if ans.eqs."" then ans = dflt
1737 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1739 $ use_multiplicity="Y"
1741 $ use_multiplicity="N"
1744 $! Ask if they want to build with 64-bit support
1745 $ IF (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1747 $ dflt = use64bitint
1749 $ echo "You can have native 64-bit long integers.
1751 $ echo "Perl can be built to take advantage of 64-bit integer types
1752 $ echo "on some systems, which provide a much larger range for perl's
1753 $ echo "mathematical operations. (Note that does *not* enable 64-bit
1754 $ echo "fileops at the moment, as Dec C doesn't do that yet)."
1755 $ echo "Choosing this option will most probably introduce binary incompatibilities.
1757 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1758 $ rp = "Try to use 64-bit integers, if available? [''dflt'] "
1760 $ IF ans .EQS. "" THEN ans = dflt
1761 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1769 $ dflt = use64bitall
1771 $ echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
1772 $ echo "What you have chosen is minimal 64-bitness which means just enough
1773 $ echo "to get 64-bit integers. The maximal means using as much 64-bitness
1774 $ echo "as is possible on the platform. This in turn means even more binary
1775 $ echo "incompatibilities. On the other hand, your platform may not have
1776 $ echo "any more maximal 64-bitness than what you already have chosen.
1778 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1779 $ rp = "Try to use full 64-bit support, if available? [''dflt'] "
1781 $ IF ans .EQS. "" THEN ans = dflt
1782 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1789 $ ENDIF ! AXP && >= 7.1
1791 $! Ask about threads, if appropriate
1792 $ if (Using_Dec_C.eqs."Yes")
1795 $ echo "This version of Perl can be built with threads. While really nifty,
1796 $ echo "they are a beta feature, and there is a speed penalty for perl
1797 $ echo "programs if you build with threads *even if you don't use them*
1799 $ rp = "Build with 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")
1806 $ ! Shall we do the 5.005-stype threads, or IThreads?
1807 $ echo "As of 5.5.640, Perl has two different internal threading
1808 $ echo "implementations, the 5.005 version (5005threads) and an
1809 $ echo "interpreter-based version (ithreads) that has one
1810 $ echo "interpreter per thread. Both are very experimental. This
1811 $ echo "arrangement exists to help developers work out which one
1814 $ echo "If you're a casual user, you probably don't want
1815 $ echo "interpreter-threads at this time. There doesn't yet exist
1816 $ echo "a way to create threads from within Perl in this model,
1817 $ echo "i.e., ""use Thread;"" will NOT work.
1820 $ rp = "Build with Interpreter threads? [''dflt']
1822 $ if ans.eqs."" then ans = dflt
1823 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1826 $ use_5005_threads="N"
1829 $ use_5005_threads="Y"
1831 $ ! Are they on VMS 7.1 on an alpha?
1832 $ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1835 $ echo "Threaded perl can be linked to use multiple kernel threads
1836 $ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
1837 $ echo "allows multiple threads to execute simultaneously on an SMP
1838 $ echo "system as well as preventing a single thread from blocking
1839 $ echo "all the threads in a program, even on a single-processor
1840 $ echo "machine. Unfortunately this feature isn't safe on an
1841 $ echo "unpatched 7.1 system. (Several OS patches were required when
1842 $ echo "this procedure was written)
1844 $ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
1846 $ if ans.eqs."" then ans="''dflt'"
1847 $ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
1849 $ Thread_Live_Dangerously = "MT=MT=1"
1854 $ if archname .eqs. "VMS_AXP"
1859 $ echo "By default, perl (and pretty much everything else on VMS) uses
1860 $ echo "case-insensitive linker symbols. Which is to say, when the
1861 $ echo "underlying C code makes a call to a routine called Perl_foo in
1862 $ echo "the source, the name in the object modules or shareable images
1863 $ echo "is really PERL_FOO. There are some packages that use an
1864 $ echo "embedded perl interpreter that instead require case-sensitive
1865 $ echo "linker symbols.
1867 $ echo "If you have no idea what this means, and don't have
1868 $ echo "any program requiring anything, choose the default.
1869 $ dflt = be_case_sensitive
1870 $ rp = "Case-sensitive symbols [''dflt'] "
1872 $ if ans.eqs."" then ans="''dflt'"
1873 $ be_case_sensitive = "''ans'"
1877 $ echo "Perl normally uses G_FLOAT format floating point numbers
1878 $ echo "internally, as do most things on VMS. You can, however, build
1879 $ echo "with IEEE floating point numbers instead if you need to.
1880 $ dflt = use_ieee_math
1881 $ rp = "Use IEEE math [''dflt'] "
1883 $ if ans.eqs."" then ans="''dflt'"
1884 $ use_ieee_math = "''ans'"
1888 $ echo "You can, if you need to, pass extra flags on to the C
1889 $ echo "compiler. In general you should only do this if you really,
1890 $ echo "really know what you're doing.
1891 $ dflt = user_c_flags
1892 $ rp = "Extra C flags [''dflt'] "
1894 $ if ans.eqs."" then ans="''dflt'"
1895 $ user_c_flags = "''ans'"
1897 $! Ask whether they want to use secure logical translation when tainting
1899 $ echo "As Perl starts up, it checks several logical names, such as"
1900 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
1901 $ echo "of its behavior. For additional security, you may limit this"
1902 $ echo "process to executive- and kernel-mode translation when tainting"
1903 $ echo "is enabled. In this case, logical names normally skipped when"
1904 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
1905 $ echo "If you do not choose to do this, the usual order of access modes"
1906 $ echo "is used for logical name translation."
1908 $ echo "This restriction does not apply to the %ENV hash or to implicit"
1909 $ echo "logical name translation during parsing of file specifications;"
1910 $ echo "these always use the normal sequence of access modes for logical"
1911 $ echo "name translation."
1913 $ rp = "Use secure logical name translation? [''dflt'] "
1915 $ if ans.eqs."" then ans="''dflt'"
1916 $ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1918 $! Ask whether they want to default filetypes
1920 $ echo "When you pass the name of a program to Perl on the command line,"
1921 $ echo "it generally doesn't supply any defaults unless the -S command"
1922 $ echo "line switch is specified. In keeping with the VMS tradition of"
1923 $ echo "default file types, however, you can configure Perl to try default"
1924 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
1925 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
1926 $ echo "finally foo.com)."
1928 $ rp = "Always use default file types? [''dflt'] "
1930 $ if ans.eqs."" then ans="''dflt'"
1931 $ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1933 $! Ask if they want to use perl's memory allocator
1935 $ echo "Perl has a built-in memory allocator that's tuned for perl's
1936 $ echo "normal memory usage. It's oftentimes better than the standard
1937 $ echo "system memory allocator. It also has the advantage of providing
1938 $ echo "memory allocation statistics, if you choose to enable them.
1940 $ rp = "Build with perl's memory allocator? [''dflt'] "
1942 $ if ans.eqs."" then ans="''dflt'"
1943 $ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1944 $ if mymalloc.eqs."Y"
1946 $ if use_debugging_perl.eqs."Y"
1949 $ echo "Perl can keep statistics on memory usage if you choose to use
1950 $ echo "them. This is useful for debugging, but does have some
1951 $ echo "performance overhead.
1953 $ rp = "Do you want the debugging memory allocator? [''dflt'] "
1955 $ if ans.eqs."" then ans="''dflt'"
1956 $ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
1958 $ ! Check which memory allocator we want
1960 $ echo "There are currently three different memory allocators: the
1961 $ echo "default (which is a pretty good general-purpose memory manager),
1962 $ echo "the TWO_POT allocator (which is optimized to save memory for
1963 $ echo "larger allocations), and PACK_MALLOC (which is optimized to save
1964 $ echo "memory for smaller allocations). They're all good, but if your
1965 $ echo "usage tends towards larger chunks use TWO_POT, otherwise use
1966 $ echo "PACK_MALLOC."
1968 $ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
1970 $ if ans.eqs."" then ans = "''dflt'"
1971 $ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
1972 $ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
1975 $! Ask for their default list of extensions to build
1977 $ echo "It's time to specify which modules you want to build into
1978 $ echo "perl. Most of these are standard and should be chosen, though
1979 $ echo "you might, for example, want to build GDBM_File instead of
1980 $ echo "SDBM_File if you have the GDBM library built on your machine.
1981 $ echo "Whatever you do, make sure the re module is first or things will
1982 $ echo "break badly"
1984 $ echo "Which modules do you want to build into perl?"
1985 $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
1986 $ 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"
1987 $ if Using_Dec_C.eqs."Yes"
1989 $ dflt = dflt + " POSIX"
1993 $ if ans.eqs."" then ans = "''dflt'"
1997 $ x = f$elem(j," ",ans)
1999 $ if x .eqs. " " then goto exloop1
2001 $ k = f$locate("::",x)
2002 $ if k .ge. f$len(x) then goto exloop2
2003 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2009 $ ans = f$edit(a,"trim")
2014 $ x = f$elem(j," ",dflt)
2016 $ if x .eqs. " " then goto exloop3
2018 $ k = f$locate("::",x)
2019 $ if k .ge. f$len(x) then goto exloop4
2020 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2026 $ dflt = f$edit(a,"trim")
2028 $ extensions = "''ans'"
2029 $ perl_known_extensions = "''dflt'"
2031 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2033 $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
2034 $! If the 'build' that you use is not here add it and it's test
2035 $! switch to the _END_ of these strings (and increment max_build)
2036 $! (e.g. builders = builders + "/FOOMAKE"
2037 $! probers = probers + " -fooVersionSwitch"
2038 $! ) & please let me know about it.
2039 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2040 $ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2046 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2047 $ WRITE CONFIG "dont_make_anything_yet:"
2048 $ WRITE CONFIG F$FAO("!_")
2051 $ messages = F$ENVIRONMENT("MESSAGE")
2053 $ build = F$ELEMENT(n,"/",builders)
2054 $ probe = F$ELEMENT(n,"!",probers)
2055 $ echo "Testing whether you have ''build' on your system..."
2057 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2058 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2060 $ IF ($SEVERITY .EQ. 1)
2063 $ IF (build .EQS. orig_dflt)
2065 $ default_set = "TRUE"
2068 $ ok_builders = ok_builders + " " + build
2069 $ IF (.NOT. default_set) THEN dflt = build
2073 $Reenable_messages_build:
2074 $ SET MESSAGE 'messages'
2077 $ IF (n .LT. max_build) THEN GOTO Build_probe
2080 $ IF (ok_builders .NES. "")
2082 $ echo "Here is the list of builders you can apparently use:"
2083 $ echo "(",ok_builders," )"
2084 $ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
2086 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2087 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2095 %Config-E-VMS, ERROR:
2096 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2097 utility of some sort and after checking my "builders" list I cannot find
2098 the symbol or command you use on your system to compile programs.
2100 $ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
2101 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2102 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2105 $ echo "I don't know where 'make' is, and my life depends on it."
2106 $ echo "Go find a make program or fix your DCL$PATH setting!"
2107 $ echo "ABORTING..."
2108 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2110 $ EXIT 2 !$STATUS = "%X00000002" (error)
2116 $ DELETE/NOLOG Makefile.;
2121 There seems to be trouble. I just tried to create a file in
2122 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2124 but was unsuccessful. I am stopping now. Please check that directories'
2125 PROTECTION bits. I will leave you in the directory where you started
2127 $ echo4 "ABORTING..."
2133 $! echo " Very well I will proceed with ""''build'"""
2134 $ make = F$EDIT(build,"UPCASE")
2136 $!: locate the preferred pager for this system
2137 $!pagers = "most|more|less|type/page"
2138 $!rp='What pager is used on your system?'
2140 $! update [.vms]config.vms here
2142 $! update makefile here
2143 $! echo4 "Updating makefile..."
2145 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2147 $ makefile = "" !wrt MANIFEST dir
2148 $ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
2149 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
2151 $ makefile = " -f Makefile." !wrt MANIFEST dir
2152 $ UUmakefile = "[-]Makefile." !wrt CWD dir
2153 $ DEFmakefile = "Makefile." !wrt DEF dir (?)
2158 $ tmp = F$LENGTH(macros)
2159 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2160 $ macros = "/macro=(" + macros + ")"
2162 $! Build up the extra C flags
2166 $ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2168 $ if be_case_sensitive
2170 $ extra_flags = "''extra_flags'" + "/Names=As_Is"
2172 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
2174 $! Invoke the subconfig piece
2177 $ echo4 "Checking the C run-time library"
2178 $ dflt = F$ENVIRONMENT("DEFAULT")
2179 $ SET DEFAULT [-.vms]
2183 $! Warn of dangerous symbols or logical names
2185 $Bad_environment: SUBROUTINE
2187 $ IF p2 .eqs. "SYMBOL"
2189 $ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
2191 $ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
2193 $ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
2195 $ IF f$search("config.msg") .nes. ""
2197 $ OPEN/APPEND CONFIG config.msg
2199 $ OPEN/WRITE CONFIG config.msg
2201 $ IF Bad_env .eqs. "SYMBOL"
2204 $ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
2205 $ WRITE CONFIG " delete before building ''package' via:"
2206 $ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
2207 $ IF f$locate("""",&p1) .ge. f$length(&p1)
2209 $ WRITE CONFIG " after building, testing, and installing ''package'
2210 $ WRITE CONFIG " restore the symbol with:"
2211 $ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
2214 $ IF Bad_env .eqs. "LOGICAL"
2217 $ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
2218 $ WRITE CONFIG " deassign before building ''package'"
2224 $ ENDSUBROUTINE ! Bad_environment
2226 $ echo4 "%Config-I-VMS, Checking for dangerous pre-existing global symbols and logical names."
2227 $ CALL Bad_environment "TMP"
2228 $ CALL Bad_environment "LIB"
2229 $ CALL Bad_environment "T"
2230 $ CALL Bad_environment "FOO"
2231 $ CALL Bad_environment "EXT"
2232 $ CALL Bad_environment "TEST" "SYMBOL"
2233 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
2235 $! %Config-I-VMS, write perl_setup.com here
2237 $ IF (.NOT.perl_symbol)
2239 $ file_2_find = "[-]''packageup'.cld"
2241 $ echo4 "%Config-I-VMS, The perl.cld file is now being written..."
2242 $ OPEN/WRITE CONFIG 'file_2_find'
2244 $ IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
2245 $ IF (use_vmsdebug_perl)
2247 $ WRITE CONFIG "define verb dbgperl"
2248 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]dbgperl''ext'")
2249 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2251 $ WRITE CONFIG "define verb perl"
2252 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]ndbgPerl''ext'")
2253 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2255 $ WRITE CONFIG "define verb perl"
2256 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]perl''ext'")
2257 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2260 $ ENDIF ! (.NOT.perl_symbol)
2262 $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
2263 $ file_2_find = "[-]perl_setup.com"
2264 $ OPEN/WRITE CONFIG 'file_2_find'
2266 $ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
2267 $ IF cf_email.NES.perladmin
2269 $ WRITE CONFIG "$! perl configured by ''cf_email'"
2271 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
2274 $ prefix = prefix - "000000."
2275 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
2276 prefix = prefix - "]" + ".]"
2277 $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
2278 $ WRITE CONFIG "$ ext = "".exe"""
2279 $ IF sharedperl .EQS. "Y"
2281 $ write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
2285 $ IF (use_vmsdebug_perl)
2287 $ WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
2288 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]ndbgPerl'ext'"
2289 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2291 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
2292 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2294 $ ELSE ! .NOT.perl_symbol
2295 $ IF (use_vmsdebug_perl)
2297 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2299 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2301 $ IF perl_verb .EQS. "PROCESS"
2303 $ WRITE CONFIG "$ set command ''packagup'_ROOT:[000000]''packageup'.CLD"
2305 $ ENDIF ! perl_symbol
2306 $ WRITE CONFIG "$ define/nolog pod2text Perl_Root:[lib.pod]pod2text.com"
2307 $ WRITE CONFIG "$ define/nolog pod2html Perl_Root:[lib.pod]pod2html.com"
2308 $ WRITE CONFIG "$ define/nolog pod2man Perl_Root:[lib.pod]pod2man.com"
2312 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2313 $ ELSE !leave in but commented out (in case setting was from perl :-)
2314 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2317 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
2321 $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
2322 $ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
2323 $ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
2324 $ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' Perl_Root:[lib.pod]pod2latex.com"""
2325 $ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
2326 $ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' Perl_Root:[lib]Perlbug.com"""
2327 $ WRITE CONFIG "$ c2ph == ""'"+"'Perl' Perl_Root:[utils]c2ph.com"""
2328 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2330 $ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' Perl_Root:[utils]dprofpp.com"""
2332 $ WRITE CONFIG "$ h2ph == ""'"+"'Perl' Perl_Root:[utils]h2ph.com"""
2333 $ WRITE CONFIG "$ h2xs == ""'"+"'Perl' Perl_Root:[utils]h2xs.com"""
2334 $ WRITE CONFIG "$!perlcc == ""'"+"'Perl' Perl_Root:[utils]perlcc.com"""
2335 $ WRITE CONFIG "$ splain == ""'"+"'Perl' Perl_Root:[utils]splain.com"""
2337 $ WRITE CONFIG "$ Perldoc == ""Perl Perl_Root:[lib.pod]Perldoc.com -t"""
2338 $ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
2339 $ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
2340 $ WRITE CONFIG "$ pod2latex == ""Perl Perl_Root:[lib.pod]pod2latex.com"""
2341 $ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
2342 $ WRITE CONFIG "$!Perlbug == ""Perl Perl_Root:[lib]Perlbug.com"""
2343 $ WRITE CONFIG "$ c2ph == ""Perl Perl_Root:[utils]c2ph.com"""
2344 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2346 $ WRITE CONFIG "$ dprofpp == ""Perl Perl_Root:[utils]dprofpp.com"""
2348 $ WRITE CONFIG "$ h2ph == ""Perl Perl_Root:[utils]h2ph.com"""
2349 $ WRITE CONFIG "$ h2xs == ""Perl Perl_Root:[utils]h2xs.com"""
2350 $ WRITE CONFIG "$!perlcc == ""Perl Perl_Root:[utils]perlcc.com"""
2351 $ WRITE CONFIG "$ splain == ""Perl Perl_Root:[utils]splain.com"""
2356 $ echo "%Config-I-VMS, The file can be found at:"
2357 $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
2358 $ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
2359 $ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
2360 $ echo "-Config-I-VMS, testing, and installation of your perl."
2362 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
2364 $ file_2_find = "[-]''packageup'_install.com"
2365 $ OPEN/WRITE CONFIG 'file_2_find
2366 $ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
2367 $ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
2368 $ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
2371 $ echo4 "%Config-I-VMS, In order to install the ''packageup' verb into DCLTABLES run:"
2372 $ echo4 "-Config-I-VMS, @ ''F$SEARCH(file_2_find)'"
2373 $ echo4 "-Config-I-VMS, after a successful build, test, and install. Do so with CMKRNL privilege."
2377 $!figure out where we "are" by parsing 'vms_default_directory_name'
2379 $ set_def_command = ""
2380 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
2381 $ tmp = vms_default_directory_name - dflt - "]"
2383 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
2385 $ tmp1 = F$ELEMENT(i,".",tmp)
2386 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
2388 $ THEN set_def_command = "set default [-"
2389 $ ELSE set_def_command = set_def_command + "-"
2393 $Beyond_set_def_loop:
2394 $ IF set_def_command.NES.""
2396 $ set_def_command = set_def_command - "-" + "]"
2398 $ echo4 "In order to build ''package' you must now issue the commands:"
2400 $ echo4 " ''set_def_command'"
2403 $ echo4 "In order to build ''package' you must now issue the command:"
2406 $ echo4 " ''make'''makefile'", macros
2409 $ IF ( F$SEARCH("config.msg").NES."" )
2411 $ echo "Hmm. I also noted the following information while running:"
2414 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
2415 $ DELETE/NOLOG/NOCONFIRM config.msg;
2421 $ DEASSIGN SYS$OUTPUT
2422 $! DEASSIGN SYS$ERROR
2424 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
2425 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt
2426 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
2428 $ dflt = F$ENVIRONMENT("DEFAULT")
2429 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
2431 $ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
2433 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
2434 $ DELETE/NOLOG/NOCONFIRM UU.DIR;
2436 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2439 $!: End of Configure