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 "
44 $ be_case_sensitive = "n"
45 $ use_vmsdebug_perl = "n"
48 $ C_Compiler_Replace = "CC="
49 $ Thread_Live_Dangerously = "MT="
50 $ use_two_pot_malloc = "N"
51 $ use_pack_malloc = "N"
52 $ use_debugmalloc = "N"
55 $ use_multiplicity = "N"
56 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
57 $ max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_xxx] not [A.B.C.PERL5_xxx]
58 $! max_allowed_dir_depth = 2 ! e.g. [A.PERL5_xxx] not [A.B.PERL5_xxx]
60 $ vms_filcnt = F$GETJPI ("","FILCNT")
62 $!: compute my invocation name
63 $ me = F$ENVIRONMENT("PROCEDURE")
65 $! Many null statements (begin with colon ':') in the Bourne shell version of
66 $! this script serve as comments/placeholders. I have retained some of the ones
67 $! that will help you compare this .COM file to the sh version - as well as
68 $! leave placeholders for future improvements to this .COM file.
69 $! sfn = VMS "skipped for now"
71 $!: Proper PATH separator !sfn
72 $!: Proper PATH setting !sfn
73 $!: Sanity checks !sfn "Say '@''$me''"
74 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
75 $!: Configure runs within the UU subdirectory !->after find MANIFEST
76 $! <big long list of default values (mostly null)>
77 $!: We must find out about Eunice early !(?)
78 $!: list of known cpp symbols, sorted alphabetically !sfn
80 $!: default library list !sfn
81 $! <no hints files in use (yet?)>
82 $!: Extra object files, if any, needed on this platform. !sfn
83 $!: Possible local include directories to search. !sfn
84 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
85 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
86 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
87 $!: no include file wanted by default !sfn
89 $!: Possible local library directories to search. !sfn
90 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
91 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
92 $!: general looking path for locating libraries !sfn
93 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
94 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
95 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
96 $!: Private path used by Configure to find libraries. Its value !sfn
97 $!: is prepended to libpth. This variable takes care of special !sfn
98 $!: machines, like the mips. Usually, it should be empty. !sfn
100 $!: full support for void wanted by default !sfn
101 $!defvoidused=15 !sfn
102 $!: List of libraries we want. !sfn
103 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
104 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
105 $!libswanted="$libswanted ucb bsd BSD PW x" !sfn
106 $!: We probably want to search /usr/shlib before most other libraries. !sfn
107 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
108 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
109 $!glibpth="/usr/shlib $glibpth" !sfn
110 $!: Do not use vfork unless overridden by a hint file. !sfn
111 $!usevfork=false !sfn
112 $!: script used to extract .SH files with variable substitutions !sfn
113 $!: produce awk script to parse command line options !sfn
114 $!sfn (assume no sed awk) see below
115 $!: process the command line options
117 $!: set up default values
132 $ use_5005_threads = "N"
138 $ THEN !one or more switches was thrown
145 $ config_args = config_args + F$FAO(" !AS",P'i')
148 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
152 $ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
153 $ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
154 $Remove_quotation_mark:
156 $ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
157 $ gotopt = "f" !"alse"
158 $ gotshortopt = "f" !"alse"
159 $ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
162 $ gotopt = "t" !"rue"
164 $ gotshortopt = "t" !"rue"
166 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
173 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
177 $ IF (F$SEARCH(config_sh).NES."")
179 $ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
180 $ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
182 $ CONTINUE !at this point check UIC && if test allows...
185 $ echo "''me': cannot read config file ''config_sh'."
189 $ echo "''me': cannot read config file ''config_sh'."
194 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
201 $ IF (F$EXTRACT(0,1,P'i') .EQS. "m")
208 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
215 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
222 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
227 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
234 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
241 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
243 $ extractsh = "true" !VMS?
248 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
251 $!Hmm.. this part needs work
253 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
257 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
259 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
260 $ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
261 $ echo "''me': ignoring -D",P'i'
263 $!Hmm.. this part needs work
264 $! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
265 $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
268 $ ECHO "P''i' =>",P'i',"<=" !Diag
271 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
274 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
278 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
280 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
281 $ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
282 $ echo "''me': ignoring -U",P'i'
287 $ ECHO "P''i' =>",P'i',"<=" !Diag
290 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
292 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
293 $ echo "''me' generated by an unknown version of EDT."
299 $ echo "''me': unknown option ",P'i'
302 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
304 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
306 $ ENDIF ! (P1 .NES. "")
307 $ config_args = F$EDIT(config_args,"TRIM")
311 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
312 $ echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
313 $ echo " [-Usymbol] [-Usymbol=]"
315 "-d" : use defaults for all answers.
316 "-e" : go on without questioning past the production of config.sh. *
317 "-f" : specify an alternate default configuration file.
318 "-h" : print this help message and exit (with an error status).
319 "-m" : skip the MANIFEST check to see that all files are present
320 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
321 "-s" : silent mode, only echoes questions and essential information.
322 -"D" : define symbol to have some value: *
323 -"Dsymbol" symbol gets the value 'define'
324 -"Dsymbol=value" symbol gets the value 'value'
325 -E : stop at the end of questions, after having produced config.sh. *
326 -K : do not use unless you know what you are doing.
327 -O : let -D and -U override definitions from loaded configuration file. *
328 -S : perform variable substitutions on all .SH files (can mix with -f) *
329 -"U" : undefine symbol: *
330 -"Usymbol" symbol gets the value 'undef'
331 -"Usymbol=" symbol gets completely empty
332 -V : print version number and exit (with a zero status).
333 $ echo "%Config-I-VMS, lower case switches must be enclosed"
334 $ echo "-Config-I-VMS, in double quotation marks, e.g.:"
335 $ echo "-Config-I-VMS, @Configure ""-des"""
336 $ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
337 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
339 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
345 $ IF F$Mode() .eqs. "BATCH"
347 $ STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
348 $ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid file locking conflicts,"
349 $ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
350 $ WRITE SYS$OUTPUT STDOUT
352 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
354 $ DEFINE SYS$OUTPUT "_NLA0:"
355 $ echo4 = "write STDOUT "
356 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
357 $ open/write/share=read STDOUT 'STDOUT'
365 $ echo4 = "write SYS$OUTPUT "
369 $!: run the defines and the undefines, if any, but leave the file out there...
370 $! Unfortunately Configure.COM in DCL is not yet set up to do this -
375 $ packageup = F$EDIT((package - "5"),"UPCASE")
377 $!: Eunice requires " " instead of "", can you believe it
380 $ echo "Beginning of configuration questions for ''package'."
383 $!: Some greps do not return status, grrr.
384 $ contains = "SEARCH"
386 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
387 $! echo "Checking ''echo' to see how to suppress newlines..."
388 $! echo "giving up..."
389 $! echo "The star should be here-->*"
391 $!: Now test for existence of everything in MANIFEST
393 $ echo4 "First let's make sure your kit is complete. Checking..."
396 $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
397 $! because the search routine simply does set def [-] if necessary.
398 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
400 $ manifestfound = F$SEARCH(file_2_find)
401 $ IF (manifestfound .EQS. "")
403 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
406 $ GOTO Research_manifest
409 $ echo "There is no MANIFEST file. I hope your kit is complete !"
411 $ GOTO Beyond_manifest
414 $! MANIFEST. has been found and we have set def'ed there -
415 $! time to bail out before it's too late.
416 $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
417 $ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
418 $ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
421 %Config-E-VMS, ERROR:
422 Sorry! It apears as though your perl build sub-directory is already too
423 deep into the VMS file system. Please try moving stuff into a shallower
424 directory (or altering the "max_allowed_dir_depth" parameter).
425 $ echo4 "ABORTING..."
426 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
428 $ EXIT !2 !$STATUS = "%X00000002" (error)
432 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
434 $ IF (manifestfound .NES. "")
436 $ IF ( F$SEARCH("UU.DIR").EQS."" )
438 $ CREATE/DIRECTORY [.UU]
440 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
442 $!: Configure runs within the UU subdirectory
445 $! a little redundancy never hurt anybody?
446 $ file_2_find = "[-]" + file_2_find
447 $ manifestfound = F$SEARCH(file_2_find)
449 $ OPEN/WRITE MISSING MISSING.
450 $!change to "FALSE" if you wish to skip the manifest search
451 $!(which after all is rather slow in DCL :-)
454 $ echo "Skipping MANIFEST check as requested"
457 $ OPEN/READ CONFIG 'manifestfound'
459 $ READ/END_OF_FILE = Done_manifest CONFIG line
460 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
461 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
462 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
463 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
464 $ line = F$EDIT(line,"TRIM, COMPRESS")
465 $ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
466 $ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
468 $Re_strip_line_manifest:
469 $ loca = F$LOCATE("/",file_2_find)
470 $ ante = F$EXTRACT(0,loca,file_2_find)
471 $ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
472 $ test_this = ante + "." + (post - "/")
473 $ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
475 $ file_2_find = ante + "." + (post - "/")
476 $ GOTO Re_strip_line_manifest
478 $ file_2_find = ante + "]" + (post - "/")
480 $ file_2_find = "[-."+file_2_find
482 $ file_2_find = "[-]" + file_2_find
485 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
486 $ file_2_find = file_2_find - dirname
489 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
490 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
492 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
493 $ ELSE basename = basename + dot_ele + "_"
498 $ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
499 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
500 basename = f$extract(0,f$length(basename)-1,basename)
501 $ file_2_find = dirname + basename
503 $ found = F$SEARCH(file_2_find)
504 $ IF (found .EQS. "" .AND. dots .GT. 2)
506 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
507 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
508 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
509 $ basename[f$locate(".",basename),1] := _
510 $ dot_ele = F$ELEMENT(dots - 1,"_",basename)
512 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
514 $ found = F$SEARCH(dirname + basename)
515 $ file_2_find = file_2_find + "," + basename
517 $ IF (found .EQS. "")
519 $ WRITE MISSING file_2_find
520 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
522 $ miss_list = miss_list + "," + file_2_find
525 $ GOTO Read_loop_manifest
530 $ ENDIF ! (manifestfound .NES. "")
532 $ IF (miss_list .NES. "")
534 $ echo "Some of the files not found include:"
537 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
541 THIS PACKAGE SEEMS TO BE INCOMPLETE.
543 You have the option of continuing the configuration process, despite the
544 distinct possibility that your kit is damaged, by typing 'y'es. If you
545 do, don't blame me if something goes wrong. I advise you to type 'n'o
546 and contact the author (dan@sidhe.org)
548 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
551 $ echo4 "Continuing..."
553 $ echo4 "ABORTING..."
557 $ echo4 "Looks good..."
558 $ DELETE/NOLOG MISSING.;
559 $ ENDIF ! (miss_list .NES. "")
560 $ ENDIF ! (manifestfound .EQS. "") ELSE
562 $! after finding MANIFEST (see above)
563 $!: Configure runs within the UU subdirectory
565 $!: compute the number of columns on the terminal for proper question formatting
566 $! (sfn, will assume 80-ish)
568 $!: set up the echo used in my read !sfn
569 $!: now set up to do reads with possible shell escape and default assignment !sfn
580 $ READ SYS$COMMAND/PROMPT="''rp'" ans
583 $ READ SYS$COMMAND/PROMPT="''rp'" ans
590 $!: create .config dir to save info across Configure sessions
591 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
593 $ CREATE/DIRECTORY [-.CONFIG]
594 $ OPEN/WRITE CONFIG [-.CONFIG]README.
596 "This directory created by Configure to save information that should"
598 "persist across sessions."
601 "You may safely delete it if you wish."
605 $!: general instructions
608 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
609 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
611 $ messages = F$ENVIRONMENT("MESSAGE")
612 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
613 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
614 $ IF .NOT.($status.EQ.%X08D78053)
618 $ rp = "Would you like to see the instructions? [''dflt'] "
620 $ if .NOT.ans THEN needman=""
622 $ SET MESSAGE 'messages'
624 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
630 This installation shell script will examine your system and ask you questions
631 to determine how the perl5 package should be installed. If you get
632 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
633 process, edit something, then restart this process as you just did.
634 Many of the questions will have default answers in square
635 brackets; typing carriage return will give you the default.
637 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
640 In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
641 the questions and use the computed defaults (or the previous answers provided
642 there was already a config.sh file). Type '@Configure "-h"' for a list of
645 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
648 Much effort has been expended to ensure that this shell script will
649 run on any VMS system. If despite that it blows up on yours, your
650 best bet is to edit Configure.com and @ it again. Whatever problems
651 you have with Configure.com, let me (dan@sidhe.org) know how I blew
654 $!This installation script affects things in two ways:
656 $!1) it may do direct variable substitutions on some of the files included
658 $!2) it builds a config.h file for inclusion in C programs. You may edit
659 $! any of these files as the need arises after running this script.
661 $!If you make a mistake on a question, there is no easy way to back up to it
664 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
665 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
667 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
671 $ ENDIF !(needman .EQS. "true")
673 $!: see if sh knows # comments !sfn
675 $!: figure out how to guarantee sh startup !sfn
676 $!: find out where common programs are !sfn
677 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
678 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
679 $! echo "I don't know where '$file' is, and my life depends on it."
680 $! echo "Go find a public domain implementation or fix your PATH setting!"
682 $! echo "Don't worry if any of the following aren't found..."
683 $!: determine whether symbolic links are supported !sfn
684 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
685 $!: set up the translation script tr, must be called with ./tr of course !sfn
687 $!: Try to determine whether config.sh was made on this system
688 $!: Get old answers from old config file if Configure was run on the
689 $!: same system, otherwise use the hints.
690 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
694 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
696 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
698 $ configshfound = F$SEARCH(config_sh)
699 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
701 $ IF (i.LT.max) THEN GOTO Config_sh_look
702 $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
705 $ echo "Fetching default answers from ''config_sh'..."
706 $!we actually do not have "hints/" for VMS
709 $!First time through, eh? I have some defaults handy for the following systems:
711 $! echo " ","VMS_VAX"
712 $! echo " ","VMS_AXP"
713 $! : Now look for a hint file osname_osvers, unless one has been
714 $! : specified already.
717 $!You may give one or more space-separated answers, or "none" if appropriate.
718 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
720 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
724 $!: Restore computed paths !sfn
726 $! genconfig.pl has "osname='VMS'"
727 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
728 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
730 $ IF (osname .NES. "VMS")
732 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
735 %Config-E-VMS, ERROR:
737 Err, you do not appear to be running VMS!
738 This procedure is intended to Configure the building of Perl for VMS.
740 $ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
743 $ echo4 "Continuing..."
745 $ echo4 "ABORTING..."
746 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
748 $ EXIT 2 !$STATUS = "%X00000002" (error)
750 $ ELSE !we are on VMS huzzah!
752 $ THEN TYPE SYS$INPUT:
754 Configure uses the operating system name and version to set some defaults.
755 The default value is probably right if the name rings a bell. Otherwise,
756 since spelling matters for me, either accept the default or answer "none"
759 $ rp = "Operating system name? [''osname'] "
763 $ IF (ans.NES.osname) !.AND.knowitall
765 $ echo4 "I'll go with ''osname' anyway..."
768 $ ENDIF !(osname .NES./.EQS. "VMS")
770 $!: who configured the system
772 $ cf_by = F$EDIT(user,"LOWERCASE")
773 $! cf_time = F$CVTIME() !superceded by procedure below
774 $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
776 $! Peter Prymmer has seen:
777 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
778 $! "SYS$TIME_ZONE" = "EDT"
780 $! Charles Lane recommended:
781 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
782 $! "NEWS_TIMEZONE" = "-0500"
783 $! "ST_TIMEZONE" = "EDT"
784 $! "JAN_TIME_ZONE" = "EST "
785 $! "MULTINET_TIMEZONE" = "EST"
786 $! "DAYLIGHT_SAVINGS" = "1"
788 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
790 $! "Multinet_Timezone"
791 $! "TCPware_Timezone"
794 $! This snippet o' DCL returns a string in default Unix `date` format,
795 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
796 $! Peter Prymmer pvhp@lns62.lns.cornell.edu
798 $ MIN_TZO = -840 !units are minutes here
801 $ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
802 $ monn = F$CVTIME(,,"MONTH")
803 $ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
804 $ hour = F$CVTIME(,,"HOUR")
805 $ min = F$CVTIME(,,"MINUTE")
806 $ sec = F$CVTIME(,,"SECOND")
807 $ year = F$CVTIME(,,"YEAR")
809 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
813 $ mon = F$ELEMENT(i,"/",months)
814 $ IF i.LT.monn THEN GOTO Mon_loop
817 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
820 $ tzhour = F$INTEGER(systz)/3600
821 $ tzmins = F$INTEGER(systz)/60
822 $ tzminrem = tzmins - tzhour*60
823 $ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
825 $ THEN signothetime = "+"
826 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
827 $ THEN direction = "on GMT/"
828 $ ELSE direction = "east of "
830 $ ELSE signothetime = "-"
831 $ tzhour = -1*tzhour !keeps !UL happy
832 $ direction = "west of "
835 $ echo "%Config-I-VMS,"
836 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
839 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
841 $ tzspan = "''tzhour' hours"
844 $ echo "Your system is ''tzspan' ''direction'UTC in England."
845 $ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
847 $ IF ans.OR.(ans.EQS."")
851 $ GOTO Beyond_TimeZone
855 $ echo4 "%Config-I-VMS,"
856 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
861 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
862 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
863 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
865 $ rp = "Enter the Time Zone offset: [''dflt'] "
867 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
868 $ IF ans.EQS."" THEN ans = dflt
869 $ tzhour = F$ELEMENT(0,":","''ans'") !first
870 $ IF tzhour.EQS."" THEN tzhour = 0
871 $ tzhour = F$INTEGER(tzhour)
872 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
875 $ tzminrem = F$INTEGER(tzminrem)
876 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
880 $ tzmins = tzhour*60 + tzminrem
881 $ tzd = F$STRING(tzmins*60)
886 $ tzhour = -1*tzhour !keeps !UL happy
889 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
892 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
897 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
898 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
900 $!: determine the architecture name
901 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
903 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
905 $ archname = "VMS_VAX"
906 $ otherarch = "an Alpha"
908 $ arch_type = "ARCH-TYPE=__VAX__"
910 $ archname = "VMS_AXP"
911 $ otherarch = "a VAX"
913 $ arch_type = "ARCH-TYPE=__AXP__"
915 $ rp = "What is your architecture name? [''archname'] "
919 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
920 $ IF (ans.NES.archname) !.AND.knowitall
922 $ echo4 "I'll go with ''archname' anyway..."
926 $ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
930 $ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
937 $ IF (archname.EQS."VMS_AXP")
939 $ macros = macros + """AXE=1"","
943 $!: is AFS running? !sfn
944 $!: decide how portable to be. Allow command line overrides. !sfn
945 $!: set up shell script to do ~ expansion !sfn
946 $!: expand filename !sfn
947 $!: now set up to get a file name !sfn
949 $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
950 $ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
951 $ prefixbase = prefix - "]"
952 $ prefix = prefixbase + ".]"
953 $!: determine root of directory hierarchy where package will be installed.
958 $ echo "By default, ''package' will be installed in ''dflt', pod"
959 $ echo "pages under ''prefixbase'LIB.POD], etc..., i.e. with ''dflt' as prefix for"
960 $ echo "all installation directories."
961 $ echo "On ''osname' the ''prefix' is used to DEFINE the ''packageup'_ROOT prior to installation"
962 $ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
964 $ rp = "Installation prefix to use (for ''packageup'_ROOT)? [ ''dflt' ] "
969 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
974 $! Check here for pre-existing PERL_ROOT.
975 $! -> ask if removal desired.
976 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
977 $! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
979 $ vms_skip_install = "true"
982 $ rp = "%Config-I-VMS, Skip the remaining """"where install"""" questions? [''dflt'] "
984 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
985 $ IF (.NOT.vms_skip_install)
988 $!: set the prefixit variable, to compute a suitable default value
990 $!: determine where private library files go
991 $!: Usual default is /usr/local/lib/perl5. Also allow things like
992 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
994 $ THEN TYPE SYS$INPUT:
996 There are some auxiliary files for perl5 that need to be put into a
997 private library directory that is accessible by everyone.
999 $ dflt = prefix - ".]" + ".LIB]"
1000 $ rp = "Pathname where the private library files will reside? "
1001 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1004 $ THEN privlib = ans
1005 $ ELSE privlib = dflt
1008 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
1010 $ perl_symbol = "true"
1016 $ echo "%Config-I-VMS, You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1017 $ echo "-Config-I-VMS, symbol to invoke ''package', which is the usual method."
1018 $ echO "-Config-I-VMS, If you do not do so then you would need a DCL command verb at the"
1019 $ echo "-Config-I-VMS, process or the system wide level."
1021 $ rp = "Invoke perl as a global symbol foreign command [''dflt'] "
1023 $ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
1025 $ IF (.NOT.perl_symbol)
1031 $ echo "%Config-I-VMS, Since you won't be using a symbol you must choose to put the ''packageup'"
1032 $ echo "-Config-I-VMS, verb in a per-process table or in the system wide DCLTABLES (which"
1033 $ echo "-Config-I-VMS, would require write privilege)."
1035 $ rp = "Invoke perl as a per process command verb [ ''dflt' ] "
1037 $ IF (.NOT.ans).AND.(ans.NES."")
1038 $ THEN perl_verb = "DCLTABLES"
1039 $ ELSE perl_verb = "PROCESS"
1041 $ ENDIF ! (.NOT.perl_symbol)
1043 $!: set the base revision
1045 $ revision = baserev - ".0"
1046 $!: get the patchlevel
1048 $ echo4 "Getting the current patchlevel..." !>&4
1049 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1050 $ IF (patchlevel_h.NES."")
1052 $ got_patch = "false"
1054 $ got_api_revision = "false"
1055 $ got_api_version = "false"
1056 $ got_api_subversion = "false"
1057 $ OPEN/READONLY CONFIG 'patchlevel_h'
1059 $ READ/END_Of_File=Close_patch CONFIG line
1060 $ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1062 $ line = F$EDIT(line,"COMPRESS, TRIM")
1063 $ patchlevel = F$ELEMENT(2," ",line)
1064 $ got_patch = "true"
1066 $ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1068 $ line = F$EDIT(line,"COMPRESS, TRIM")
1069 $ subversion = F$ELEMENT(2," ",line)
1072 $ IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1074 $ line = F$EDIT(line,"COMPRESS, TRIM")
1075 $ api_revision = F$ELEMENT(2," ",line)
1076 $ got_api_revision = "true"
1078 $ IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1080 $ line = F$EDIT(line,"COMPRESS, TRIM")
1081 $ api_version = F$ELEMENT(2," ",line)
1082 $ got_api_version = "true"
1084 $ IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1086 $ line = F$EDIT(line,"COMPRESS, TRIM")
1087 $ api_subversion = F$ELEMENT(2," ",line)
1088 $ got_api_subversion = "true"
1090 $ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1097 $ IF (F$STRING(subversion) .NES. "0")
1099 $ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
1101 $ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
1104 $ version = revision + "_" + patchlevel + "_" + subversion
1106 $ IF (.NOT.vms_skip_install)
1108 $!: set the prefixup variable, to restore leading tilda escape !sfn
1109 $!: set the prefixup variable, to restore leading tilde escape !sfn
1111 $!: determine where public architecture dependent libraries go
1115 $ echo "''package' contains architecture-dependent library files. If you are"
1118 $ THEN TYPE SYS$INPUT:
1119 sharing libraries in a heterogeneous environment, you might store
1120 these files in a separate location. Otherwise, you can just include
1121 them with the rest of the public library files.
1123 $ dflt = privlib - "]" + "." + archname + "." + version + "]"
1124 $ rp = "Where do you want to put the public architecture-dependent libraries? "
1125 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1128 $ THEN archlib = ans
1129 $ ELSE archlib = dflt
1132 $!: set up the script used to warn in case of inconsistency !sfn
1133 $!: function used to set $1 to $val !sfn
1135 $ ENDIF !%Config-I-VMS, skip "where install" questions
1136 $! This quotation from Configure has to be included on VMS:
1139 There is, however, a strange, musty smell in the air that reminds me of
1140 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1142 $ IF (.NOT.vms_skip_install)
1144 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1146 $!: see if setuid scripts can be secure !sfn
1147 $!: now see if they want to do setuid emulation !sfn
1149 $!: determine where site specific libraries go.
1151 $ THEN TYPE SYS$INPUT:
1153 The installation process will also create a directory for
1154 site-specific extensions and modules. Some users find it convenient
1155 to place all local files in this directory rather than in the main
1156 distribution directory.
1158 $ dflt = privlib - "]" + ".SITE_PERL]"
1159 $ rp = "Pathname for the site-specific library files? "
1160 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1163 $ THEN sitelib = ans
1164 $ ELSE sitelib = dflt
1167 $!: determine where site specific architecture-dependent libraries go.
1169 $ THEN TYPE SYS$INPUT:
1171 The installation process will also create a directory for
1172 architecture-dependent site-specific extensions and modules.
1174 $ dflt = sitelib - "]" + "." + archname + "]"
1175 $ rp = "Pathname for the site-specific architecture-dependent library files? "
1176 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1179 $ THEN sitearch = ans
1180 $ ELSE sitearch = dflt
1183 $!: determine where old public architecture dependent libraries might be
1185 $!: determine where public executables go
1186 $ dflt = prefix - ".]" + ".BIN]"
1187 $ rp = "Pathname where the public executables will reside? "
1188 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1195 $!: determine where manual pages are on this system
1196 $!: What suffix to use on installed man pages
1197 $!: see if we can have long filenames
1198 $!: determine where library module manual pages go
1199 $!: What suffix to use on installed man pages
1200 $!: see what memory models we can support
1202 $ ENDIF !%Config-I-VMS, skip "where install" questions
1204 $!: see if we need a special compiler
1205 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1209 $ vms_cc_available = ""
1211 $ OPEN/WRITE CONFIG ccvms.c
1212 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1213 $ WRITE CONFIG "#include <stdio.h>"
1214 $ WRITE CONFIG "int main() {"
1215 $ WRITE CONFIG "#ifdef __DECC"
1216 $ WRITE CONFIG " printf(""/DECC\n"");"
1217 $ WRITE CONFIG "#else"
1218 $ WRITE CONFIG " printf(""/VAXC\n"");"
1219 $ WRITE CONFIG "#endif"
1220 $ WRITE CONFIG " exit(0);"
1224 $! DEFINE SYS$ERROR _NLA0:
1225 $! DEFINE SYS$OUTPUT _NLA0:
1226 $ cc/NoObj/list=ccvms.lis ccvms.c
1228 $! DEASSIGN SYS$OUTPUT
1229 $! DEASSIGN SYS$ERROR
1230 $ IF (silent) THEN GOSUB Shut_up
1231 $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1233 $ IF tmp.NE.%X10B90001
1235 $ IF tmp.NE.%X10000001
1237 $ nocc = "t" !%X10000001 is return from gcc
1238 $ GOTO Gcc_initial_check
1243 $ IF .NOT.silent THEN echo ""
1244 $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1245 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1249 $ echo "%Config-I-VMS, Will try cc/decc..."
1251 $ DEFINE SYS$ERROR _NLA0:
1252 $ DEFINE SYS$OUTPUT _NLA0:
1254 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1256 $ DEASSIGN SYS$OUTPUT
1257 $ DEASSIGN SYS$ERROR
1259 $ IF (silent) THEN GOSUB Shut_up
1260 $ IF tmp.NE.%X10B90001
1262 $ echo "%Config-I-VMS, Apparently you don't have that one."
1265 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1266 $ vms_cc_available = vms_cc_available + "cc/decc "
1269 $ IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
1271 $ vms_cc_dflt = "/decc"
1272 $ vms_cc_available = vms_cc_available + "cc/decc "
1277 $ echo "%Config-I-VMS, Checking for Gcc"
1278 $ OPEN/WRITE CONFIG gccvers.lis
1279 $ DEFINE SYS$ERROR CONFIG
1280 $ DEFINE SYS$OUTPUT CONFIG
1281 $ 'gcc_symbol'/noobj/version _nla0:
1283 $ DEASSIGN SYS$OUTPUT
1284 $ DEASSIGN SYS$ERROR
1285 $ IF (silent) THEN GOSUB Shut_up
1287 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1289 $ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1292 $ OPEN/READ CONFIG gccvers.lis
1294 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1295 $ GOTO GCC_List_Read
1299 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1300 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1303 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1305 $!: see if we need a special compiler
1307 $ echo "%Config-I-VMS, available compiler(s):"
1308 $ echo "( ''vms_cc_available')"
1311 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1315 $ rp = "Use which C compiler? [''dflt'] "
1319 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1321 $ IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
1324 $ Using_Dec_C = "Yes"
1325 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1329 $ IF (F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)).or(F$LOCATE("compaq",dflt).NE.F$LENGTH(dflt))
1331 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1333 $ Using_Dec_C = "Yes"
1336 $ IF Mcc .EQS. "cc/decc"
1338 $ Using_Dec_C = "Yes"
1339 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1344 $ IF Mcc .EQS. "cc/decc"
1346 $ Using_Dec_C = "Yes"
1347 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1349 $ IF Mcc .EQS. "gcc"
1351 $ Using_Gnu_C = "Yes"
1352 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1355 $Decc_Version_check:
1356 $ IF "''Using_Dec_C'".EQS."Yes"
1359 $ echo4 "Checking for Dec C's version number..." !>&4
1360 $ OPEN/WRITE CONFIG deccvers.c
1361 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1362 $ WRITE CONFIG "#include <stdio.h>"
1363 $ WRITE CONFIG "int main() {"
1364 $ WRITE CONFIG "#ifdef __DECC"
1365 $ WRITE CONFIG "#ifdef __DECC_VER"
1366 $ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1367 $ WRITE CONFIG "#else"
1368 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1369 $ WRITE CONFIG "#endif"
1370 $ WRITE CONFIG "#endif"
1371 $ WRITE CONFIG " exit(0);"
1374 $ DEFINE SYS$ERROR _NLA0:
1375 $ DEFINE SYS$OUTPUT _NLA0:
1378 $ DEASSIGN SYS$ERROR _NLA0:
1379 $ DEASSIGN SYS$OUTPUT _NLA0:
1380 $ IF (silent) THEN GOSUB Shut_up
1381 $ DEFINE SYS$ERROR _NLA0:
1382 $ DEFINE SYS$OUTPUT _NLA0:
1385 $ DEASSIGN SYS$ERROR
1386 $ DEASSIGN SYS$OUTPUT
1387 $ IF (silent) THEN GOSUB Shut_up
1388 $ OPEN/WRITE CONFIG deccvers.out
1389 $ DEFINE SYS$ERROR CONFIG
1390 $ DEFINE SYS$OUTPUT CONFIG
1391 $ mcr []deccvers.exe
1394 $ DEASSIGN SYS$OUTPUT
1395 $ DEASSIGN SYS$ERROR
1396 $ IF (silent) THEN GOSUB Shut_up
1397 $ OPEN/READ CONFIG deccvers.out
1398 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1401 $! DELETE/NOLOG/NOCONFIRM deccvers.*;
1402 $ echo "You are using Dec C ''line'"
1403 $ Dec_C_Version = line
1404 $ Dec_C_Version = Dec_C_Version + 0
1405 $ if Dec_C_Version.ge.60200000 THEN CC_FLAGS = CC_FLAGS + "/NOANSI_ALIAS"
1408 $ if "''using_gnu_c'" .eqs. "Yes"
1410 $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1411 $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1412 $ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1413 $ IF gcclib_olb .EQS. ""
1415 $! These objects/libs come w/ gcc 2.7.2 for AXP:
1416 $ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1417 $ IF tmp .NES. "" then gcclib_olb = tmp
1418 $ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1421 $ IF gcclib_olb .EQS. ""
1422 $ THEN gcclib_olb = tmp
1423 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1426 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1429 $ IF gcclib_olb .EQS. ""
1430 $ THEN gcclib_olb = tmp
1431 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1434 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1437 $ IF gcclib_olb .EQS. ""
1438 $ THEN gcclib_olb = tmp
1439 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1442 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1444 $ gcclib_olb = gcclib_olb + "/lib"
1446 $ IF gcclib_olb .NES. "" .AND. -
1447 (vaxcrtl_olb .NES. "" .OR. -
1448 vaxcrtl_exe .NES. "" )
1451 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1452 $ OPEN/WRITE CONFIG gccvers.c
1453 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1454 $ WRITE CONFIG "#include <stdio.h>"
1455 $ WRITE CONFIG "int main() {"
1456 $ WRITE CONFIG "#ifdef __GNUC__"
1457 $ WRITE CONFIG "#ifdef __VERSION__"
1458 $ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1459 $ WRITE CONFIG "#else"
1460 $ WRITE CONFIG " printf(""%s\n"", ""1"");"
1461 $ WRITE CONFIG "#endif"
1462 $ WRITE CONFIG "#endif"
1463 $ WRITE CONFIG " exit(0);"
1466 $ DEFINE SYS$ERROR _NLA0:
1467 $ DEFINE SYS$OUTPUT _NLA0:
1470 $ DEASSIGN SYS$ERROR _NLA0:
1471 $ DEASSIGN SYS$OUTPUT _NLA0:
1472 $ IF (silent) THEN GOSUB Shut_up
1473 $ DEFINE SYS$ERROR _NLA0:
1474 $ DEFINE SYS$OUTPUT _NLA0:
1475 $ IF vaxcrtl_exe .EQS. ""
1477 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1479 $ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1482 $ link gccvers.obj,'gcclib_olb'
1486 $ OPEN/WRITE CONFIG GCCVERS.OPT
1487 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1489 $ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1492 $ DEASSIGN SYS$ERROR
1493 $ DEASSIGN SYS$OUTPUT
1494 $ IF (silent) THEN GOSUB Shut_up
1495 $ OPEN/WRITE CONFIG gccvers.out
1496 $ DEFINE SYS$ERROR CONFIG
1497 $ DEFINE SYS$OUTPUT CONFIG
1501 $ DEASSIGN SYS$OUTPUT
1502 $ DEASSIGN SYS$ERROR
1503 $ IF (silent) THEN GOSUB Shut_up
1504 $ OPEN/READ CONFIG gccvers.out
1505 $ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1508 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1509 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1511 $ echo "You are not using GNU cc."
1514 $ echo "You are using GNU cc ''line'"
1515 $ Using_Gnu_C = "Yes"
1516 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1524 $ OPEN/READ CONFIG ccvms.lis
1526 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1534 $ line = F$EDIT(line,"TRIM,COMPRESS")
1535 $ line = line - "Page 1" ! occurs at end all compilers
1536 $ line = line - "CCVMS " ! filename appears w/ VAXC
1537 $ line = line - "Source Listing " ! Seen w/ AXP DECC
1538 $ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1540 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1541 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1545 $!: What should the include directory be ?
1547 $ rp = "Where are the include files you want to use? "
1548 $ IF f$length( rp + "[''dflt'] " ).gt.76
1549 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1550 $ ELSE rp = rp + "[''dflt'] "
1555 $!: see if we have to deal with yellow pages, now NIS.
1556 $!: now get the host name
1559 $ echo4 "Figuring out host name..." !>&4
1561 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1562 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1563 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1564 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1565 $ IF myhostname.eqs."".and. -
1566 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1567 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1568 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1569 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1570 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1571 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1572 $ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1573 $!: you do not want to know about this
1575 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1577 $ IF (.not.ans).and.(ans.NES."")
1579 $ READ SYS$COMMAND/PROMPT= -
1580 "Please type the (one word) name of your host: " ans
1583 $!: translate upper to lower if necessary
1584 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1585 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1586 $ IF mylowhostname.NES.myhostname
1588 $ echo "(Normalizing case in your host name)"
1589 $ myhostname = mylowhostname
1592 $ fp = F$LOCATE(".",myhostname)
1593 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1594 $ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1596 $ rp = "What is your domain name? [''mydomain'] "
1598 $ IF ans .nes. "" THEN mydomain = ans
1599 $!: translate upper to lower if necessary
1600 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1601 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1602 $ IF mylowdomain.NES.mydomain
1604 $ echo "(Normalizing case in your domain name)"
1605 $ mydomain = mylowdomain
1608 $ myhostname = myhostname - mydomain
1609 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1611 $ THEN TYPE SYS$INPUT:
1613 I need to get your e-mail address in Internet format if possible, i.e.
1614 something like user@host.domain. Please answer accurately since I have
1615 no easy means to double check it. The default value provided below
1616 is most probably close to the reality but may not be valid from outside
1617 your organization...
1619 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1620 $ rp = "What is your e-mail address? [''dflt'] "
1623 $ THEN cf_email = ans
1624 $ ELSE cf_email = dflt
1628 $ THEN TYPE SYS$INPUT:
1630 If you or somebody else will be maintaining perl at your site, please
1631 fill in the correct e-mail address here so that they may be contacted
1632 if necessary. Currently, the "perlbug" program included with perl
1633 will send mail to this address in addition to perlbug@perl.com. You may
1634 enter "none" for no administrator.
1636 $ dflt = "''cf_email'"
1637 $ rp = "Perl administrator e-mail address [''dflt'] "
1640 $ THEN perladmin = ans
1641 $ ELSE perladmin = dflt
1644 $!: determine where public executable scripts go
1645 $!: determine perl absolute location
1646 $!: figure out how to guarantee perl startup
1648 $!: see how we invoke the C preprocessor
1650 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1651 $!: Set private lib path
1652 $!: Now check and see which directories actually exist, avoiding duplicates
1653 $!: determine optimize, if desired, or use for debug flag also
1654 $!: We will not override a previous value, but we might want to
1655 $!: augment a hint file
1656 $!: the following weeds options from ccflags that are of no interest to cpp
1657 $!: flags used in final linking phase
1658 $!: Try to guess additional flags to pick up local libraries.
1661 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1662 $!: compute shared library extension
1663 $!: Looking for optional libraries
1664 $!: see if nm is to be used to determine whether a symbol is defined or not
1665 $!: get list of predefined functions in a handy place
1666 $!: see if we have sigaction
1667 $!: see whether socketshr exists
1668 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1670 $ has_socketshr = "T"
1672 $ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1674 $ if (Dec_C_Version .ge. 50200000)
1676 $ Has_Dec_C_Sockets = "T"
1678 $ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1680 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1681 $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1684 $ echo "You've got sockets available. Which socket stack do you want to"
1685 $ echo "build into perl?"
1686 $ if "''has_dec_c_sockets'".eqs."T"
1690 $ dflt = "SOCKETSHR"
1692 $ rp = "Choose socket stack (NONE"
1693 $ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1694 $ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1695 $ rp = rp + ") [''dflt'] "
1697 $ IF "''ans'".eqs."" THEN ans = "''dflt'"
1698 $ has_dec_c_sockets = "F"
1699 $ has_socketshr = "F"
1700 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1701 $ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1702 $ IF ans.eqs."socketshr" then has_socketshr = "T"
1706 $! Ask if they want to build with VMS_DEBUG perl
1708 $ echo "Perl can be built to run under the VMS debugger."
1709 $ echo "You should only select this option if you are debugging"
1710 $ echo "perl itself. This can be a useful feature if you are "
1711 $ echo "embedding perl in a program."
1713 $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1715 $ IF ans.eqs."" then ans = dflt
1716 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1718 $ use_vmsdebug_perl = "Y"
1719 $ macros = macros + """__DEBUG__=1"","
1721 $ use_vmsdebug_perl = "N"
1724 $! Ask if they want to build with DEBUGGING
1726 $ echo "Perl can be built with extra runtime debugging enabled. This
1727 $ echo "enables the -D switch, at the cost of some performance. It
1728 $ echo "was mandatory on perl 5.005 and before on VMS, but is now
1729 $ echo "optional. If you don't generally use it you should probably
1730 $ echo "leave this off and gain a bit of extra speed.
1732 $ rp = "Build a DEBUGGING version of Perl? [''dflt'] "
1734 $ IF ans.eqs."" then ans = dflt
1735 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1737 $ use_debugging_perl = "Y"
1739 $ use_debugging_perl = "N"
1742 $! Ask if they want to build with MULTIPLICITY
1744 $ echo "The perl interpreter engine can be built in a way that makes it
1745 $ echo "possible for a program that embeds perl into it (and yes, you can
1746 $ echo "do that--it's pretty keen) to have multiple perl interpreters active
1747 $ echo "at once. There is some performance overhead, however, so you
1748 $ echo "probably don't want to choose this unless you're going to be doing
1749 $ echo "funky perl embedding."
1751 $ rp = "Build with MULTIPLICITY? [''dflt'] "
1753 $ if ans.eqs."" then ans = dflt
1754 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1756 $ use_multiplicity="Y"
1758 $ use_multiplicity="N"
1761 $! Ask if they want to build with 64-bit support
1762 $ IF (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1764 $ dflt = use64bitint
1766 $ echo "You can have native 64-bit long integers.
1768 $ echo "Perl can be built to take advantage of 64-bit integer types
1769 $ echo "on some systems, which provide a much larger range for perl's
1770 $ echo "mathematical operations. (Note that does *not* enable 64-bit
1771 $ echo "fileops at the moment, as Dec C doesn't do that yet)."
1772 $ echo "Choosing this option will most probably introduce binary incompatibilities.
1774 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1775 $ rp = "Try to use 64-bit integers, if available? [''dflt'] "
1777 $ IF ans .EQS. "" THEN ans = dflt
1778 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1786 $ dflt = use64bitall
1788 $ echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
1789 $ echo "What you have chosen is minimal 64-bitness which means just enough
1790 $ echo "to get 64-bit integers. The maximal means using as much 64-bitness
1791 $ echo "as is possible on the platform. This in turn means even more binary
1792 $ echo "incompatibilities. On the other hand, your platform may not have
1793 $ echo "any more maximal 64-bitness than what you already have chosen.
1795 $ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1796 $ rp = "Try to use full 64-bit support, if available? [''dflt'] "
1798 $ IF ans .EQS. "" THEN ans = dflt
1799 $ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1806 $ ENDIF ! AXP && >= 7.1
1808 $! Ask about threads, if appropriate
1809 $ if (Using_Dec_C.eqs."Yes")
1812 $ echo "This version of Perl can be built with threads. While really nifty,
1813 $ echo "they are a beta feature, and there is a speed penalty for perl
1814 $ echo "programs if you build with threads *even if you don't use them*
1816 $ rp = "Build with threads? [''dflt'] "
1818 $ if ans.eqs."" then ans = dflt
1819 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1823 $ ! Shall we do the 5.005-stype threads, or IThreads?
1824 $ echo "As of 5.5.640, Perl has two different internal threading
1825 $ echo "implementations, the 5.005 version (5005threads) and an
1826 $ echo "interpreter-based version (ithreads) that has one
1827 $ echo "interpreter per thread. Both are very experimental. This
1828 $ echo "arrangement exists to help developers work out which one
1831 $ echo "If you're a casual user, you probably don't want
1832 $ echo "interpreter-threads at this time. There doesn't yet exist
1833 $ echo "a way to create threads from within Perl in this model,
1834 $ echo "i.e., ""use Thread;"" will NOT work.
1837 $ rp = "Build with Interpreter threads? [''dflt']
1839 $ if ans.eqs."" then ans = dflt
1840 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1843 $ use_5005_threads="N"
1846 $ use_5005_threads="Y"
1848 $ ! Are they on VMS 7.1 on an alpha?
1849 $ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1852 $ echo "Threaded perl can be linked to use multiple kernel threads
1853 $ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
1854 $ echo "allows multiple threads to execute simultaneously on an SMP
1855 $ echo "system as well as preventing a single thread from blocking
1856 $ echo "all the threads in a program, even on a single-processor
1857 $ echo "machine. Unfortunately this feature isn't safe on an
1858 $ echo "unpatched 7.1 system. (Several OS patches were required when
1859 $ echo "this procedure was written)
1861 $ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
1863 $ if ans.eqs."" then ans="''dflt'"
1864 $ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
1866 $ Thread_Live_Dangerously = "MT=MT=1"
1871 $ if archname .eqs. "VMS_AXP"
1876 $ echo "By default, perl (and pretty much everything else on VMS) uses
1877 $ echo "case-insensitive linker symbols. Which is to say, when the
1878 $ echo "underlying C code makes a call to a routine called Perl_foo in
1879 $ echo "the source, the name in the object modules or shareable images
1880 $ echo "is really PERL_FOO. There are some packages that use an
1881 $ echo "embedded perl interpreter that instead require case-sensitive
1882 $ echo "linker symbols.
1884 $ echo "If you have no idea what this means, and don't have
1885 $ echo "any program requiring anything, choose the default.
1886 $ dflt = be_case_sensitive
1887 $ rp = "Case-sensitive symbols [''dflt'] "
1889 $ if ans.eqs."" then ans="''dflt'"
1890 $ be_case_sensitive = "''ans'"
1894 $ echo "Perl normally uses G_FLOAT format floating point numbers
1895 $ echo "internally, as do most things on VMS. You can, however, build
1896 $ echo "with IEEE floating point numbers instead if you need to.
1897 $ dflt = use_ieee_math
1898 $ rp = "Use IEEE math [''dflt'] "
1900 $ if ans.eqs."" then ans="''dflt'"
1901 $ use_ieee_math = "''ans'"
1905 $ echo "You can, if you need to, pass extra flags on to the C
1906 $ echo "compiler. In general you should only do this if you really,
1907 $ echo "really know what you're doing.
1908 $ dflt = user_c_flags
1909 $ rp = "Extra C flags [''dflt'] "
1911 $ if ans.eqs."" then ans="''dflt'"
1912 $ user_c_flags = "''ans'"
1914 $! Ask whether they want to use secure logical translation when tainting
1916 $ echo "As Perl starts up, it checks several logical names, such as"
1917 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
1918 $ echo "of its behavior. For additional security, you may limit this"
1919 $ echo "process to executive- and kernel-mode translation when tainting"
1920 $ echo "is enabled. In this case, logical names normally skipped when"
1921 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
1922 $ echo "If you do not choose to do this, the usual order of access modes"
1923 $ echo "is used for logical name translation."
1925 $ echo "This restriction does not apply to the %ENV hash or to implicit"
1926 $ echo "logical name translation during parsing of file specifications;"
1927 $ echo "these always use the normal sequence of access modes for logical"
1928 $ echo "name translation."
1930 $ rp = "Use secure logical name translation? [''dflt'] "
1932 $ if ans.eqs."" then ans="''dflt'"
1933 $ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1935 $! Ask whether they want to default filetypes
1937 $ echo "When you pass the name of a program to Perl on the command line,"
1938 $ echo "it generally doesn't supply any defaults unless the -S command"
1939 $ echo "line switch is specified. In keeping with the VMS tradition of"
1940 $ echo "default file types, however, you can configure Perl to try default"
1941 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
1942 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
1943 $ echo "finally foo.com)."
1945 $ rp = "Always use default file types? [''dflt'] "
1947 $ if ans.eqs."" then ans="''dflt'"
1948 $ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1950 $! Ask if they want to use perl's memory allocator
1952 $ echo "Perl has a built-in memory allocator that's tuned for perl's
1953 $ echo "normal memory usage. It's oftentimes better than the standard
1954 $ echo "system memory allocator. It also has the advantage of providing
1955 $ echo "memory allocation statistics, if you choose to enable them.
1957 $ rp = "Build with perl's memory allocator? [''dflt'] "
1959 $ if ans.eqs."" then ans="''dflt'"
1960 $ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1961 $ if mymalloc.eqs."Y"
1963 $ if use_debugging_perl.eqs."Y"
1966 $ echo "Perl can keep statistics on memory usage if you choose to use
1967 $ echo "them. This is useful for debugging, but does have some
1968 $ echo "performance overhead.
1970 $ rp = "Do you want the debugging memory allocator? [''dflt'] "
1972 $ if ans.eqs."" then ans="''dflt'"
1973 $ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
1975 $ ! Check which memory allocator we want
1977 $ echo "There are currently three different memory allocators: the
1978 $ echo "default (which is a pretty good general-purpose memory manager),
1979 $ echo "the TWO_POT allocator (which is optimized to save memory for
1980 $ echo "larger allocations), and PACK_MALLOC (which is optimized to save
1981 $ echo "memory for smaller allocations). They're all good, but if your
1982 $ echo "usage tends towards larger chunks use TWO_POT, otherwise use
1983 $ echo "PACK_MALLOC."
1985 $ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
1987 $ if ans.eqs."" then ans = "''dflt'"
1988 $ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
1989 $ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
1992 $! Ask for their default list of extensions to build
1994 $ echo "It's time to specify which modules you want to build into
1995 $ echo "perl. Most of these are standard and should be chosen, though
1996 $ echo "you might, for example, want to build GDBM_File instead of
1997 $ echo "SDBM_File if you have the GDBM library built on your machine.
1998 $ echo "Whatever you do, make sure the re module is first or things will
1999 $ echo "break badly"
2001 $ echo "Which modules do you want to build into perl?"
2002 $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
2003 $ 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"
2004 $ if Using_Dec_C.eqs."Yes"
2006 $ dflt = dflt + " POSIX"
2010 $ if ans.eqs."" then ans = "''dflt'"
2014 $ x = f$elem(j," ",ans)
2016 $ if x .eqs. " " then goto exloop1
2018 $ k = f$locate("::",x)
2019 $ if k .ge. f$len(x) then goto exloop2
2020 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2026 $ ans = f$edit(a,"trim")
2031 $ x = f$elem(j," ",dflt)
2033 $ if x .eqs. " " then goto exloop3
2035 $ k = f$locate("::",x)
2036 $ if k .ge. f$len(x) then goto exloop4
2037 $ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2043 $ dflt = f$edit(a,"trim")
2045 $ extensions = "''ans'"
2046 $ perl_known_extensions = "''dflt'"
2048 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2050 $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
2051 $! If the 'build' that you use is not here add it and it's test
2052 $! switch to the _END_ of these strings (and increment max_build)
2053 $! (e.g. builders = builders + "/FOOMAKE"
2054 $! probers = probers + " -fooVersionSwitch"
2055 $! ) & please let me know about it.
2056 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2057 $ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2063 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2064 $ WRITE CONFIG "dont_make_anything_yet:"
2065 $ WRITE CONFIG F$FAO("!_")
2068 $ messages = F$ENVIRONMENT("MESSAGE")
2070 $ build = F$ELEMENT(n,"/",builders)
2071 $ probe = F$ELEMENT(n,"!",probers)
2072 $ echo "Testing whether you have ''build' on your system..."
2074 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2075 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2077 $ IF ($SEVERITY .EQ. 1)
2080 $ IF (build .EQS. orig_dflt)
2082 $ default_set = "TRUE"
2085 $ ok_builders = ok_builders + " " + build
2086 $ IF (.NOT. default_set) THEN dflt = build
2090 $Reenable_messages_build:
2091 $ SET MESSAGE 'messages'
2094 $ IF (n .LT. max_build) THEN GOTO Build_probe
2097 $ IF (ok_builders .NES. "")
2099 $ echo "Here is the list of builders you can apparently use:"
2100 $ echo "(",ok_builders," )"
2101 $ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
2103 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2104 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2112 %Config-E-VMS, ERROR:
2113 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2114 utility of some sort and after checking my "builders" list I cannot find
2115 the symbol or command you use on your system to compile programs.
2117 $ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
2118 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2119 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2122 $ echo "I don't know where 'make' is, and my life depends on it."
2123 $ echo "Go find a make program or fix your DCL$PATH setting!"
2124 $ echo "ABORTING..."
2125 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2127 $ EXIT 2 !$STATUS = "%X00000002" (error)
2133 $ DELETE/NOLOG Makefile.;
2138 There seems to be trouble. I just tried to create a file in
2139 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2141 but was unsuccessful. I am stopping now. Please check that directories'
2142 PROTECTION bits. I will leave you in the directory where you started
2144 $ echo4 "ABORTING..."
2150 $! echo " Very well I will proceed with ""''build'"""
2151 $ make = F$EDIT(build,"UPCASE")
2153 $!: locate the preferred pager for this system
2154 $!pagers = "most|more|less|type/page"
2155 $!rp='What pager is used on your system?'
2157 $! update [.vms]config.vms here
2159 $! update makefile here
2160 $! echo4 "Updating makefile..."
2162 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2164 $ makefile = "" !wrt MANIFEST dir
2165 $ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
2166 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
2168 $ makefile = " -f Makefile." !wrt MANIFEST dir
2169 $ UUmakefile = "[-]Makefile." !wrt CWD dir
2170 $ DEFmakefile = "Makefile." !wrt DEF dir (?)
2175 $ tmp = F$LENGTH(macros)
2176 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2177 $ macros = "/macro=(" + macros + ")"
2179 $! Build up the extra C flags
2183 $ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2185 $ if be_case_sensitive
2187 $ extra_flags = "''extra_flags'" + "/Names=As_Is"
2189 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
2191 $! Invoke the subconfig piece
2194 $ echo4 "Checking the C run-time library"
2195 $ dflt = F$ENVIRONMENT("DEFAULT")
2196 $ SET DEFAULT [-.vms]
2200 $! Warn of dangerous symbols or logical names
2202 $Bad_environment: SUBROUTINE
2204 $ IF p2 .eqs. "SYMBOL"
2206 $ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
2208 $ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
2210 $ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
2212 $ IF f$search("config.msg") .nes. ""
2214 $ OPEN/APPEND CONFIG config.msg
2216 $ OPEN/WRITE CONFIG config.msg
2218 $ IF Bad_env .eqs. "SYMBOL"
2221 $ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
2222 $ WRITE CONFIG " delete before building ''package' via:"
2223 $ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
2224 $ IF f$locate("""",&p1) .ge. f$length(&p1)
2226 $ WRITE CONFIG " after building, testing, and installing ''package'
2227 $ WRITE CONFIG " restore the symbol with:"
2228 $ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
2231 $ IF Bad_env .eqs. "LOGICAL"
2234 $ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
2235 $ WRITE CONFIG " deassign before building ''package'"
2241 $ ENDSUBROUTINE ! Bad_environment
2243 $ echo4 "%Config-I-VMS, Checking for dangerous pre-existing global symbols and logical names."
2244 $ CALL Bad_environment "TMP"
2245 $ CALL Bad_environment "LIB"
2246 $ CALL Bad_environment "T"
2247 $ CALL Bad_environment "FOO"
2248 $ CALL Bad_environment "EXT"
2249 $ CALL Bad_environment "TEST" "SYMBOL"
2250 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
2252 $! %Config-I-VMS, write perl_setup.com here
2254 $ IF (.NOT.perl_symbol)
2256 $ file_2_find = "[-]''packageup'.cld"
2258 $ echo4 "%Config-I-VMS, The perl.cld file is now being written..."
2259 $ OPEN/WRITE CONFIG 'file_2_find'
2261 $ IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
2262 $ IF (use_vmsdebug_perl)
2264 $ WRITE CONFIG "define verb dbgperl"
2265 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]dbgperl''ext'")
2266 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2268 $ WRITE CONFIG "define verb perl"
2269 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]ndbgPerl''ext'")
2270 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2272 $ WRITE CONFIG "define verb perl"
2273 $ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]perl''ext'")
2274 $ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2277 $ ENDIF ! (.NOT.perl_symbol)
2279 $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
2280 $ file_2_find = "[-]perl_setup.com"
2281 $ OPEN/WRITE CONFIG 'file_2_find'
2283 $ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
2284 $ IF cf_email.NES.perladmin
2286 $ WRITE CONFIG "$! perl configured by ''cf_email'"
2288 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
2291 $ prefix = prefix - "000000."
2292 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
2293 prefix = prefix - "]" + ".]"
2294 $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
2295 $ WRITE CONFIG "$ ext = "".exe"""
2296 $ IF sharedperl .EQS. "Y"
2298 $ write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
2302 $ IF (use_vmsdebug_perl)
2304 $ WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
2305 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]ndbgPerl'ext'"
2306 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2308 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
2309 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2311 $ ELSE ! .NOT.perl_symbol
2312 $ IF (use_vmsdebug_perl)
2314 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2316 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2318 $ IF perl_verb .EQS. "PROCESS"
2320 $ WRITE CONFIG "$ set command ''packagup'_ROOT:[000000]''packageup'.CLD"
2322 $ ENDIF ! perl_symbol
2323 $ WRITE CONFIG "$ define/nolog pod2text Perl_Root:[lib.pod]pod2text.com"
2324 $ WRITE CONFIG "$ define/nolog pod2html Perl_Root:[lib.pod]pod2html.com"
2325 $ WRITE CONFIG "$ define/nolog pod2man Perl_Root:[lib.pod]pod2man.com"
2329 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2330 $ ELSE !leave in but commented out (in case setting was from perl :-)
2331 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2334 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
2338 $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
2339 $ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
2340 $ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
2341 $ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' Perl_Root:[lib.pod]pod2latex.com"""
2342 $ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
2343 $ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' Perl_Root:[lib]Perlbug.com"""
2344 $ WRITE CONFIG "$ c2ph == ""'"+"'Perl' Perl_Root:[utils]c2ph.com"""
2345 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2347 $ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' Perl_Root:[utils]dprofpp.com"""
2349 $ WRITE CONFIG "$ h2ph == ""'"+"'Perl' Perl_Root:[utils]h2ph.com"""
2350 $ WRITE CONFIG "$ h2xs == ""'"+"'Perl' Perl_Root:[utils]h2xs.com"""
2351 $ WRITE CONFIG "$!perlcc == ""'"+"'Perl' Perl_Root:[utils]perlcc.com"""
2352 $ WRITE CONFIG "$ splain == ""'"+"'Perl' Perl_Root:[utils]splain.com"""
2354 $ WRITE CONFIG "$ Perldoc == ""Perl Perl_Root:[lib.pod]Perldoc.com -t"""
2355 $ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
2356 $ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
2357 $ WRITE CONFIG "$ pod2latex == ""Perl Perl_Root:[lib.pod]pod2latex.com"""
2358 $ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
2359 $ WRITE CONFIG "$!Perlbug == ""Perl Perl_Root:[lib]Perlbug.com"""
2360 $ WRITE CONFIG "$ c2ph == ""Perl Perl_Root:[utils]c2ph.com"""
2361 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2363 $ WRITE CONFIG "$ dprofpp == ""Perl Perl_Root:[utils]dprofpp.com"""
2365 $ WRITE CONFIG "$ h2ph == ""Perl Perl_Root:[utils]h2ph.com"""
2366 $ WRITE CONFIG "$ h2xs == ""Perl Perl_Root:[utils]h2xs.com"""
2367 $ WRITE CONFIG "$!perlcc == ""Perl Perl_Root:[utils]perlcc.com"""
2368 $ WRITE CONFIG "$ splain == ""Perl Perl_Root:[utils]splain.com"""
2373 $ echo "%Config-I-VMS, The file can be found at:"
2374 $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
2375 $ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
2376 $ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
2377 $ echo "-Config-I-VMS, testing, and installation of your perl."
2379 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
2381 $ file_2_find = "[-]''packageup'_install.com"
2382 $ OPEN/WRITE CONFIG 'file_2_find
2383 $ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
2384 $ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
2385 $ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
2388 $ echo4 "%Config-I-VMS, In order to install the ''packageup' verb into DCLTABLES run:"
2389 $ echo4 "-Config-I-VMS, @ ''F$SEARCH(file_2_find)'"
2390 $ echo4 "-Config-I-VMS, after a successful build, test, and install. Do so with CMKRNL privilege."
2394 $!figure out where we "are" by parsing 'vms_default_directory_name'
2396 $ set_def_command = ""
2397 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
2398 $ tmp = vms_default_directory_name - dflt - "]"
2400 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
2402 $ tmp1 = F$ELEMENT(i,".",tmp)
2403 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
2405 $ THEN set_def_command = "set default [-"
2406 $ ELSE set_def_command = set_def_command + "-"
2410 $Beyond_set_def_loop:
2411 $ IF set_def_command.NES.""
2413 $ set_def_command = set_def_command - "-" + "]"
2415 $ echo4 "In order to build ''package' you must now issue the commands:"
2417 $ echo4 " ''set_def_command'"
2420 $ echo4 "In order to build ''package' you must now issue the command:"
2423 $ echo4 " ''make'''makefile'", macros
2426 $ IF ( F$SEARCH("config.msg").NES."" )
2428 $ echo "Hmm. I also noted the following information while running:"
2431 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
2432 $ DELETE/NOLOG/NOCONFIRM config.msg;
2438 $ DEASSIGN SYS$OUTPUT
2439 $! DEASSIGN SYS$ERROR
2441 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
2442 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt
2443 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
2445 $ dflt = F$ENVIRONMENT("DEFAULT")
2446 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
2448 $ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
2450 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
2451 $ DELETE/NOLOG/NOCONFIRM UU.DIR;
2453 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2456 $!: End of Configure