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_00n]
12 $! $ SET DEFAULT [USER.PERL5_00n]
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 <sugalskd@ous.edu>
25 $! Adapted and converted from Larry Wall & Andy Dougherty's
26 $! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
27 $! (a Bourne sh[ell] script for configuring the installation of perl
28 $! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
29 $! with much valuable help from Charles Bailey &
30 $! the whole VMSPerl crew.
31 $! Extended and messed about with by Dan Sugalski
34 $ sav_ver = F$VERIFY(sav_ver)
36 $! VMS-isms we will need:
37 $ echo = "write sys$output "
42 $ use_vmsdebug_perl = "N"
43 $ use_debugging_perl = "Y"
45 $ C_Compiler_Replace = "CC="
46 $ Thread_Live_Dangerously = "MT="
47 $ use_two_pot_malloc = "N"
48 $ use_pack_malloc = "N"
49 $ use_debugmalloc = "N"
51 $ use_multiplicity = "N"
52 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
53 $ max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_00n] not [A.B.C.PERL5_00n]
54 $! max_allowed_dir_depth = 2 ! e.g. [FOO.PERL5_00n] not [FOO.BAR.PERL5_00n]
56 $ vms_filcnt = F$GETJPI ("","FILCNT")
58 $!: compute my invocation name
59 $ me = F$ENVIRONMENT("PROCEDURE")
61 $! Many null statements (begin with colon ':') in the Bourne shell version of
62 $! this script serve as comments/placeholders. I have retained some of the ones
63 $! that will help you compare this .COM file to the sh version - as well as
64 $! leave placeholders for future improvements to this .COM file.
65 $! sfn = VMS "skipped for now"
67 $!: Proper PATH separator !sfn
68 $!: Proper PATH setting !sfn
69 $!: Sanity checks !sfn "Say '@''$me''"
70 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
71 $!: Configure runs within the UU subdirectory !->after find MANIFEST
72 $! <big long list of default values (mostly null)>
73 $!: We must find out about Eunice early !(?)
74 $!: list of known cpp symbols, sorted alphabetically !sfn
76 $!: default library list !sfn
77 $! <no hints files in use (yet?)>
78 $!: Extra object files, if any, needed on this platform. !sfn
79 $!: Possible local include directories to search. !sfn
80 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
81 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
82 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
83 $!: no include file wanted by default !sfn
85 $!: Possible local library directories to search. !sfn
86 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
87 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
88 $!: general looking path for locating libraries !sfn
89 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
90 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
91 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
92 $!: Private path used by Configure to find libraries. Its value !sfn
93 $!: is prepended to libpth. This variable takes care of special !sfn
94 $!: machines, like the mips. Usually, it should be empty. !sfn
96 $!: full support for void wanted by default !sfn
98 $!: List of libraries we want. !sfn
99 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
100 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
101 $!libswanted="$libswanted ucb bsd BSD PW x" !sfn
102 $!: We probably want to search /usr/shlib before most other libraries. !sfn
103 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
104 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
105 $!glibpth="/usr/shlib $glibpth" !sfn
106 $!: Do not use vfork unless overridden by a hint file. !sfn
107 $!usevfork=false !sfn
108 $!: script used to extract .SH files with variable substitutions !sfn
109 $!: produce awk script to parse command line options !sfn
110 $!sfn (assume no sed awk) see below
111 $!: process the command line options
113 $!: set up default values
132 $ THEN !one or more switches was thrown
136 $ IF (P'i'.NES."") THEN bang = bang + 1
138 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
142 $ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
143 $ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
144 $Remove_quotation_mark:
146 $ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
147 $ gotopt = "f" !"alse"
148 $ gotshortopt = "f" !"alse"
149 $ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
152 $ gotopt = "t" !"rue"
154 $ gotshortopt = "t" !"rue"
156 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
163 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
167 $ IF (F$SEARCH(config_sh).NES."")
169 $ test = F$FILE_ATTRIBUTES(config_sh,"PRO")
170 $ IF (F$LOCATE("R",test).NE.F$LENGTH(test))
172 $ CONTINUE !at this point check UIC && if test allows...
175 $ echo "''me': cannot read config file ''config_sh'."
179 $ echo "''me': cannot read config file ''config_sh'."
184 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
191 $ IF (F$EXTRACT(0,1,P'i') .EQS. "m")
198 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
205 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
212 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
217 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
224 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
231 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
233 $ extractsh = "true" !VMS?
238 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
241 $!Hmm.. this part needs work
243 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
247 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
249 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
250 $ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
251 $ echo "''me': ignoring -D",P'i'
253 $!Hmm.. this part needs work
254 $! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
255 $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
258 $ ECHO "P''i' =>",P'i',"<=" !Diag
261 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
264 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
268 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
270 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
271 $ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
272 $ echo "''me': ignoring -U",P'i'
277 $ ECHO "P''i' =>",P'i',"<=" !Diag
280 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
282 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
283 $ echo "''me' generated by an unknown version of EDT."
289 $ echo "''me': unknown option ",P'i'
292 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
294 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
296 $ ENDIF ! (P1 .NES. "")
300 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
301 $ echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
302 $ echo " [-Usymbol] [-Usymbol=]"
304 "-d" : use defaults for all answers.
305 "-e" : go on without questioning past the production of config.sh. *
306 "-f" : specify an alternate default configuration file.
307 "-h" : print this help message and exit (with an error status).
308 "-m" : skip the MANIFEST check to see that all files are present
309 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
310 "-s" : silent mode, only echoes questions and essential information.
311 -"D" : define symbol to have some value: *
312 -"Dsymbol" symbol gets the value 'define'
313 -"Dsymbol=value" symbol gets the value 'value'
314 -E : stop at the end of questions, after having produced config.sh. *
315 -K : do not use unless you know what you are doing.
316 -O : let -D and -U override definitions from loaded configuration file. *
317 -S : perform variable substitutions on all .SH files (can mix with -f) *
318 -"U" : undefine symbol: *
319 -"Usymbol" symbol gets the value 'undef'
320 -"Usymbol=" symbol gets completely empty
321 -V : print version number and exit (with a zero status).
322 $ echo "%Config-I-VMS, lower case switches must be enclosed"
323 $ echo "-Config-I-VMS, in double quotation marks, e.g.:"
324 $ echo "-Config-I-VMS, @Configure ""-des"""
325 $ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
326 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
328 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
334 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
335 $ DEFINE SYS$OUTPUT "_NLA0:"
336 $ echo4 = "write STDOUT "
337 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
338 $ open/write STDOUT 'STDOUT'
346 $ echo4 = "write SYS$OUTPUT "
350 $!: run the defines and the undefines, if any, but leave the file out there...
351 $! Unfortunately Configure.COM in DCL is not yet set up to do this -
357 $!: Eunice requires " " instead of "", can you believe it
360 $ echo "Beginning of configuration questions for ''package'."
363 $!: Some greps do not return status, grrr.
364 $ contains = "SEARCH"
366 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
367 $! echo "Checking ''echo' to see how to suppress newlines..."
368 $! echo "giving up..."
369 $! echo "The star should be here-->*"
371 $!: Now test for existence of everything in MANIFEST
373 $ echo4 "First let's make sure your kit is complete. Checking..."
376 $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
377 $! because the search routine simply does set def [-] if necessary.
378 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
380 $ manifestfound = F$SEARCH(file_2_find)
381 $ IF (manifestfound .EQS. "")
383 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
386 $ GOTO Research_manifest
389 $ echo "There is no MANIFEST file. I hope your kit is complete !"
391 $ GOTO Beyond_manifest
394 $! MANIFEST. has been found and we have set def'ed there -
395 $! time to bail out before it's too late.
396 $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
397 $ IF tmp .GES. "7.2" THEN GOTO Beyond_depth_check
398 $ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
401 %Config-E-VMS, ERROR:
402 Sorry! It apears as though your perl build sub-directory is already too
403 deep into the VMS file system. Please try moving stuff into a shallower
404 directory (or altering the "max_allowed_dir_depth" parameter).
405 $ echo4 "ABORTING..."
406 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
408 $ EXIT !2 !$STATUS = "%X00000002" (error)
412 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
414 $ IF (manifestfound .NES. "")
416 $ IF ( F$SEARCH("UU.DIR").EQS."" )
418 $ CREATE/DIRECTORY [.UU]
420 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
422 $!: Configure runs within the UU subdirectory
425 $! a little redundancy never hurt anybody?
426 $ file_2_find = "[-]" + file_2_find
427 $ manifestfound = F$SEARCH(file_2_find)
429 $ OPEN/WRITE MISSING MISSING.
430 $!change to "FALSE" if you wish to skip the manifest search
431 $!(which after all is rather slow in DCL :-)
434 $ echo "Skipping MANIFEST check as requested"
437 $ OPEN/READ CONFIG 'manifestfound'
439 $ READ/END_OF_FILE = Done_manifest CONFIG line
440 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
441 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
442 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
443 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
444 $ line = F$EDIT(line,"TRIM, COMPRESS")
445 $ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
446 $ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
448 $Re_strip_line_manifest:
449 $ loca = F$LOCATE("/",file_2_find)
450 $ ante = F$EXTRACT(0,loca,file_2_find)
451 $ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
452 $ test_this = ante + "." + (post - "/")
453 $ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
455 $ file_2_find = ante + "." + (post - "/")
456 $ GOTO Re_strip_line_manifest
458 $ file_2_find = ante + "]" + (post - "/")
460 $ file_2_find = "[-."+file_2_find
462 $ file_2_find = "[-]" + file_2_find
465 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
466 $ file_2_find = file_2_find - dirname
469 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
470 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
472 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
473 $ ELSE basename = basename + dot_ele + "_"
478 $ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
479 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
480 basename = f$extract(0,f$length(basename)-1,basename)
481 $ file_2_find = dirname + basename
483 $ found = F$SEARCH(file_2_find)
484 $ IF (found .EQS. "" .AND. dots .GT. 2)
486 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
487 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
488 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
489 $ basename[f$locate(".",basename),1] := _
490 $ dot_ele = F$ELEMENT(dots - 1,"_",basename)
492 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
494 $ found = F$SEARCH(dirname + basename)
495 $ file_2_find = file_2_find + "," + basename
497 $ IF (found .EQS. "")
499 $ WRITE MISSING file_2_find
500 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
502 $ miss_list = miss_list + "," + file_2_find
505 $ GOTO Read_loop_manifest
510 $ ENDIF ! (manifestfound .NES. "")
512 $ IF (miss_list .NES. "")
514 $ echo "Some of the files not found include:"
517 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
521 THIS PACKAGE SEEMS TO BE INCOMPLETE.
523 You have the option of continuing the configuration process, despite the
524 distinct possibility that your kit is damaged, by typing 'y'es. If you
525 do, don't blame me if something goes wrong. I advise you to type 'n'o
526 and contact the author (sugalskd@ous.edu).
528 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
531 $ echo4 "Continuing..."
533 $ echo4 "ABORTING..."
537 $ echo4 "Looks good..."
538 $ DELETE/NOLOG MISSING.;
539 $ ENDIF ! (miss_list .NES. "")
540 $ ENDIF ! (manifestfound .EQS. "") ELSE
542 $! after finding MANIFEST (see above)
543 $!: Configure runs within the UU subdirectory
545 $!: compute the number of columns on the terminal for proper question formatting
546 $! (sfn, will assume 80-ish)
548 $!: set up the echo used in my read !sfn
549 $!: now set up to do reads with possible shell escape and default assignment !sfn
560 $ READ SYS$COMMAND/PROMPT="''rp'" ans
563 $ READ SYS$COMMAND/PROMPT="''rp'" ans
570 $!: create .config dir to save info across Configure sessions
571 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
573 $ CREATE/DIRECTORY [-.CONFIG]
574 $ OPEN/WRITE CONFIG [-.CONFIG]README.
576 "This directory created by Configure to save information that should"
578 "persist across sessions."
581 "You may safely delete it if you wish."
585 $!: general instructions
588 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
589 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
591 $ messages = F$ENVIRONMENT("MESSAGE")
592 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
593 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
594 $ IF .NOT.($status.EQ.%X08D78053)
598 $ rp = "Would you like to see the instructions? [''dflt'] "
600 $ if .NOT.ans THEN needman=""
602 $ SET MESSAGE 'messages' !hope you made it here :-)
604 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
610 This installation shell script will examine your system and ask you questions
611 to determine how the perl5 package should be installed. If you get
612 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
613 process, edit something, then restart this process as you just did.
614 Many of the questions will have default answers in square
615 brackets; typing carriage return will give you the default.
617 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
620 In a hurry? You may run '@Configure -d'. This will bypass nearly all
621 the questions and use the computed defaults (or the previous answers provided
622 there was already a config.sh file). Type '@Configure -h' for a list of
625 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
628 Much effort has been expended to ensure that this shell script will
629 run on any VMS system. If despite that it blows up on yours, your
630 best bet is to edit Configure.com and @ it again. Whatever problems
631 you have with Configure.com, let me (sugalskd@ous.edu) know how I blew
634 $!This installation script affects things in two ways:
636 $!1) it may do direct variable substitutions on some of the files included
638 $!2) it builds a config.h file for inclusion in C programs. You may edit
639 $! any of these files as the need arises after running this script.
641 $!If you make a mistake on a question, there is no easy way to back up to it
644 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
645 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
647 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
651 $ ENDIF !(needman .EQS. "true")
653 $!: see if sh knows # comments !sfn
655 $!: figure out how to guarantee sh startup !sfn
656 $!: find out where common programs are !sfn
657 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
658 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
659 $! echo "I don't know where '$file' is, and my life depends on it."
660 $! echo "Go find a public domain implementation or fix your PATH setting!"
662 $! echo "Don't worry if any of the following aren't found..."
663 $!: determine whether symbolic links are supported !sfn
664 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
665 $!: set up the translation script tr, must be called with ./tr of course !sfn
667 $!: Try to determine whether config.sh was made on this system
668 $!: Get old answers from old config file if Configure was run on the
669 $!: same system, otherwise use the hints.
670 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
674 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
676 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
678 $ configshfound = F$SEARCH(config_sh)
679 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
681 $ IF (i.LT.max) THEN GOTO Config_sh_look
682 $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
685 $ echo "Fetching default answers from ''config_sh'..."
686 $!we actually do not have "hints/" for VMS
689 $!First time through, eh? I have some defaults handy for the following systems:
691 $! echo " ","VMS_VAX"
692 $! echo " ","VMS_AXP"
693 $! : Now look for a hint file osname_osvers, unless one has been
694 $! : specified already.
697 $!You may give one or more space-separated answers, or "none" if appropriate.
698 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
700 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
704 $!: Restore computed paths !sfn
706 $! genconfig.pl has "osname='VMS'"
707 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
708 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
710 $ IF (osname .NES. "VMS")
712 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
715 %Config-E-VMS, ERROR:
717 Err, you do not appear to be running VMS!
718 This procedure is intended to Configure the building of Perl for VMS.
720 $ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
723 $ echo4 "Continuing..."
725 $ echo4 "ABORTING..."
726 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
728 $ EXIT 2 !$STATUS = "%X00000002" (error)
730 $ ELSE !we are on VMS huzzah!
732 $ THEN TYPE SYS$INPUT:
734 Configure uses the operating system name and version to set some defaults.
735 The default value is probably right if the name rings a bell. Otherwise,
736 since spelling matters for me, either accept the default or answer "none"
739 $ rp = "Operating system name? [''osname'] "
743 $ IF (ans.NES.osname) !.AND.knowitall
745 $ echo4 "I'll go with ''osname' anyway..."
748 $ ENDIF !(osname .NES./.EQS. "VMS")
750 $!: who configured the system
752 $ cf_by = F$EDIT(user,"LOWERCASE")
753 $! cf_time = F$CVTIME() !superceded by procedure below
754 $ osvers = F$GETSYI("VERSION")
756 $! Peter Prymmer has seen:
757 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
758 $! "SYS$TIME_ZONE" = "EDT"
760 $! Charles Lane recommended:
761 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
762 $! "NEWS_TIMEZONE" = "-0500"
763 $! "ST_TIMEZONE" = "EDT"
764 $! "JAN_TIME_ZONE" = "EST "
765 $! "MULTINET_TIMEZONE" = "EST"
766 $! "DAYLIGHT_SAVINGS" = "1"
768 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
770 $! "Multinet_Timezone"
771 $! "TCPware_Timezone"
774 $! This snippet o' DCL returns a string in default Unix `date` format,
775 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
776 $! Peter Prymmer pvhp@lns62.lns.cornell.edu
778 $ MIN_TZO = -840 !units are minutes here
781 $ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
782 $ monn = F$CVTIME(,,"MONTH")
783 $ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
784 $ hour = F$CVTIME(,,"HOUR")
785 $ min = F$CVTIME(,,"MINUTE")
786 $ sec = F$CVTIME(,,"SECOND")
787 $ year = F$CVTIME(,,"YEAR")
789 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
793 $ mon = F$ELEMENT(i,"/",months)
794 $ IF i.LT.monn THEN GOTO Mon_loop
797 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
800 $ tzhour = F$INTEGER(systz)/3600
801 $ tzmins = F$INTEGER(systz)/60
802 $ tzminrem = tzmins - tzhour*60
803 $ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
805 $ THEN signothetime = "+"
806 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
807 $ THEN direction = "on GMT/"
808 $ ELSE direction = "east of "
810 $ ELSE signothetime = "-"
811 $ tzhour = -1*tzhour !keeps !UL happy
812 $ direction = "west of "
815 $ echo "%Config-I-VMS,"
816 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
819 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
821 $ tzspan = "''tzhour' hours"
824 $ echo "Your system is ''tzspan' ''direction'UTC in England."
825 $ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
827 $ IF ans.OR.(ans.EQS."")
831 $ GOTO Beyond_TimeZone
835 $ echo4 "%Config-I-VMS,"
836 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
841 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
842 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
843 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
845 $ rp = "Enter the Time Zone offset: [''dflt'] "
847 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
848 $ IF ans.EQS."" THEN ans = dflt
849 $ tzhour = F$ELEMENT(0,":","''ans'") !first
850 $ IF tzhour.EQS."" THEN tzhour = 0
851 $ tzhour = F$INTEGER(tzhour)
852 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
855 $ tzminrem = F$INTEGER(tzminrem)
856 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
860 $ tzmins = tzhour*60 + tzminrem
861 $ tzd = F$STRING(tzmins*60)
866 $ tzhour = -1*tzhour !keeps !UL happy
869 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
872 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
877 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
878 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
880 $!: determine the architecture name
881 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
883 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
885 $ archname = "VMS_VAX"
886 $ otherarch = "an Alpha"
888 $ archname = "VMS_AXP"
889 $ otherarch = "a VAX"
891 $ rp = "What is your architecture name? [''archname'] "
895 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
896 $ IF (ans.NES.archname) !.AND.knowitall
898 $ echo4 "I'll go with ''archname' anyway..."
902 $ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
906 $ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
913 $ IF (archname.EQS."VMS_AXP")
915 $ macros = macros + """AXE=1"","
919 $!: is AFS running? !sfn
920 $!: decide how portable to be. Allow command line overrides. !sfn
921 $!: set up shell script to do ~ expansion !sfn
922 $!: expand filename !sfn
923 $!: now set up to get a file name !sfn
925 $ vms_skip_install = "true"
928 $ rp = "%Config-I-VMS, Do you wish to skip the """"where install"""" questions? [''dflt'] "
930 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
931 $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
932 $ prefix = f$parse(prefix,,,,"NO_CONCEAL") - "][" - ".;"
933 $ prefix = prefix - "]" + ".]"
934 $ IF (.NOT.vms_skip_install)
936 $!: determine root of directory hierarchy where package will be installed.
941 $ echo "By default, ''package' will be installed in ''dflt'/bin, manual"
942 $ echo "pages under ''dflt'/man, etc..., i.e. with ''dflt' as prefix for"
943 $ echo "all installation directories. Typically set to /usr/local, but you"
944 $ echo "may choose /usr if you wish to install ''package' among your system
947 $ THEN TYPE SYS$INPUT:
948 binaries. If you wish to have binaries under /bin but manual pages
949 under /usr/local/man, that's ok: you will be prompted separately
950 for each of the installation directories, the prefix being only used
954 $ rp = "Installation prefix to use? [ ''dflt' ] "
959 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
964 $!: set the prefixit variable, to compute a suitable default value
966 $!: determine where private library files go
967 $!: Usual default is /usr/local/lib/perl5. Also allow things like
968 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
970 $ THEN TYPE SYS$INPUT:
972 There are some auxiliary files for perl5 that need to be put into a
973 private library directory that is accessible by everyone.
975 $ dflt = prefix - ".]" + ".LIB]"
976 $ rp = "Pathname where the private library files will reside? "
977 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
981 $ ELSE privlib = dflt
984 $ ENDIF !%Config-I-VMS, skip "where install" questions
986 $!: set the base revision
988 $!: get the patchlevel
990 $ echo4 "Getting the current patchlevel..." !>&4
991 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
992 $ IF (patchlevel_h.NES."")
994 $ got_patch = "false"
996 $ OPEN/READONLY CONFIG 'patchlevel_h'
998 $ READ/END_Of_File=Close_patch CONFIG line
999 $ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1001 $ line = F$EDIT(line,"COMPRESS, TRIM")
1002 $ patchlevel = F$ELEMENT(2," ",line)
1003 $ got_patch = "true"
1005 $ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1007 $ line = F$EDIT(line,"COMPRESS, TRIM")
1008 $ subversion = F$ELEMENT(2," ",line)
1011 $ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1018 $ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
1019 $! This whole thing needs replacing w/ F$FAO() calls:
1020 $ patchlevel = F$INTEGER(patchlevel)
1021 $ IF patchlevel.LT.10
1022 $ THEN patchlevel = "00" + F$STRING(patchlevel)
1023 $ ELSE patchlevel = "0" + F$STRING(patchlevel)
1025 $ subversion = F$INTEGER(subversion)
1026 $ IF subversion.GT.0
1028 $ IF subversion.LT.10
1029 $ THEN subversion = "0" + F$STRING(subversion)
1030 $ ELSE subversion = F$STRING(subversion)
1032 $ ELSE subversion = ""
1035 $ version = baserev + "_" + patchlevel + "_" + subversion
1037 $ IF (.NOT.vms_skip_install)
1039 $!: set the prefixup variable, to restore leading tilda escape !sfn
1040 $!: set the prefixup variable, to restore leading tilde escape !sfn
1042 $!: determine where public architecture dependent libraries go
1046 $ echo "''package' contains architecture-dependent library files. If you are"
1049 $ THEN TYPE SYS$INPUT:
1050 sharing libraries in a heterogeneous environment, you might store
1051 these files in a separate location. Otherwise, you can just include
1052 them with the rest of the public library files.
1054 $ dflt = privlib - "]" + "." + archname + "." + version + "]"
1055 $ rp = "Where do you want to put the public architecture-dependent libraries? "
1056 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1059 $ THEN archlib = ans
1060 $ ELSE archlib = dflt
1063 $!: set up the script used to warn in case of inconsistency !sfn
1064 $!: function used to set $1 to $val !sfn
1066 $ ENDIF !%Config-I-VMS, skip "where install" questions
1067 $! This quotation from Configure has to be included on VMS:
1070 There is, however, a strange, musty smell in the air that reminds me of
1071 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1073 $ IF (.NOT.vms_skip_install)
1075 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1077 $!: see if setuid scripts can be secure !sfn
1078 $!: now see if they want to do setuid emulation !sfn
1080 $!: determine where site specific libraries go.
1082 $ THEN TYPE SYS$INPUT:
1084 The installation process will also create a directory for
1085 site-specific extensions and modules. Some users find it convenient
1086 to place all local files in this directory rather than in the main
1087 distribution directory.
1089 $ dflt = privlib - "]" + ".SITE_PERL]"
1090 $ rp = "Pathname for the site-specific library files? "
1091 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1094 $ THEN sitelib = ans
1095 $ ELSE sitelib = dflt
1098 $!: determine where site specific architecture-dependent libraries go.
1100 $ THEN TYPE SYS$INPUT:
1102 The installation process will also create a directory for
1103 architecture-dependent site-specific extensions and modules.
1105 $ dflt = sitelib - "]" + "." + archname + "]"
1106 $ rp = "Pathname for the site-specific architecture-dependent library files? "
1107 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1110 $ THEN sitearch = ans
1111 $ ELSE sitearch = dflt
1114 $!: determine where old public architecture dependent libraries might be
1116 $!: determine where public executables go
1117 $ dflt = prefix - ".]" + ".BIN]"
1118 $ rp = "Pathname where the public executables will reside? "
1119 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1126 $!: determine where manual pages are on this system
1127 $!: What suffix to use on installed man pages
1128 $!: see if we can have long filenames
1129 $!: determine where library module manual pages go
1130 $!: What suffix to use on installed man pages
1131 $!: see what memory models we can support
1133 $ ENDIF !%Config-I-VMS, skip "where install" questions
1135 $!: see if we need a special compiler
1136 $! cc_list = "cc/vaxc|cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1140 $ vms_cc_available = ""
1142 $ OPEN/WRITE CONFIG ccvms.c
1143 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1144 $ WRITE CONFIG "#include <stdio.h>"
1145 $ WRITE CONFIG "int main() {"
1146 $ WRITE CONFIG "#ifdef __DECC"
1147 $ WRITE CONFIG " printf(""/DECC\n"");"
1148 $ WRITE CONFIG "#else"
1149 $ WRITE CONFIG " printf(""/VAXC\n"");"
1150 $ WRITE CONFIG "#endif"
1151 $ WRITE CONFIG " exit(0);"
1155 $ DEFINE SYS$ERROR _NLA0:
1156 $ DEFINE SYS$OUTPUT _NLA0:
1157 $ cc/NoObj/list=ccvms.lis ccvms.c
1159 $ DEASSIGN SYS$OUTPUT
1160 $ DEASSIGN SYS$ERROR
1161 $ IF (silent) THEN GOSUB Shut_up
1162 $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1164 $ IF tmp.NE.%X10B90001
1166 $ IF tmp.NE.%X10000001
1168 $ nocc = "t" !%X10000001 is return from gcc
1169 $ GOTO Gcc_initial_check
1174 $ IF .NOT.silent THEN echo ""
1175 $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1176 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1178 $ vms_cc_dflt = "/vaxc"
1179 $ vms_cc_available = vms_cc_available + "cc/vaxc "
1182 $ echo "%Config-I-VMS, Will try cc/decc..."
1184 $ DEFINE SYS$ERROR _NLA0:
1185 $ DEFINE SYS$OUTPUT _NLA0:
1187 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1189 $ DEASSIGN SYS$OUTPUT
1190 $ DEASSIGN SYS$ERROR
1192 $ IF (silent) THEN GOSUB Shut_up
1193 $ IF tmp.NE.%X10B90001
1195 $ echo "%Config-I-VMS, Apparently you don't have that one."
1198 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1199 $ vms_cc_available = vms_cc_available + "cc/decc "
1202 $ IF F$LOCATE("DEC",line).NE.F$LENGTH(line)
1204 $ vms_cc_dflt = "/decc"
1205 $ vms_cc_available = vms_cc_available + "cc/decc "
1206 $ echo "%Config-I-VMS, Will try cc/vaxc..."
1207 $ DEFINE SYS$ERROR _NLA0:
1208 $ DEFINE SYS$OUTPUT _NLA0:
1210 $ cc/vaxc/NoObj/list=ccvms.lis ccvms.c
1212 $ DEASSIGN SYS$OUTPUT
1213 $ DEASSIGN SYS$ERROR
1215 $ IF (silent) THEN GOSUB Shut_up
1216 $ IF tmp.NE.%X10B90001
1218 $ echo "%Config-I-VMS, Apparently you don't have that one."
1221 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1222 $ vms_cc_available = vms_cc_available + "cc/vaxc "
1228 $ echo "%Config-I-VMS, Checking for Gcc"
1229 $ OPEN/WRITE CONFIG gccvers.lis
1230 $ DEFINE SYS$ERROR CONFIG
1231 $ DEFINE SYS$OUTPUT CONFIG
1232 $ 'gcc_symbol'/noobj/version _nla0:
1234 $ DEASSIGN SYS$OUTPUT
1235 $ DEASSIGN SYS$ERROR
1236 $ IF (silent) THEN GOSUB Shut_up
1238 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1240 $ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1243 $ OPEN/READ CONFIG gccvers.lis
1245 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1246 $ GOTO GCC_List_Read
1250 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1251 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1254 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1256 $!: see if we need a special compiler
1258 $ echo "%Config-I-VMS, available compiler(s):"
1259 $ echo "( ''vms_cc_available')"
1262 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1266 $ rp = "Use which C compiler? [''dflt'] "
1270 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1272 $ IF F$LOCATE("dec",ans).NE.F$LENGTH(ans)
1275 $ Using_Dec_C = "Yes"
1276 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1278 $ IF F$LOCATE("vax",ans).NE.F$LENGTH(ans)
1281 $ Using_Vax_C = "Yes"
1282 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1286 $ IF F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)
1288 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1290 $ Using_Dec_C = "Yes"
1291 $ IF F$LOCATE("vax",dflt).NE.F$LENGTH(dflt)
1293 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1297 $ IF Mcc .EQS. "cc/decc"
1299 $ Using_Dec_C = "Yes"
1300 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1305 $ IF Mcc .EQS. "cc/decc"
1307 $ Using_Dec_C = "Yes"
1308 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1310 $ IF Mcc .EQS. "cc/vaxc"
1312 $ Using_Vax_C = "Yes"
1313 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1315 $ IF Mcc .EQS. "gcc"
1317 $ Using_Gnu_C = "Yes"
1318 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1321 $Decc_Version_check:
1322 $ IF "''Using_Dec_C'".EQS."Yes"
1325 $ echo4 "Checking for Dec C's version number..." !>&4
1326 $ OPEN/WRITE CONFIG deccvers.c
1327 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1328 $ WRITE CONFIG "#include <stdio.h>"
1329 $ WRITE CONFIG "int main() {"
1330 $ WRITE CONFIG "#ifdef __DECC"
1331 $ WRITE CONFIG "#ifdef __DECC_VER"
1332 $ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1333 $ WRITE CONFIG "#else"
1334 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1335 $ WRITE CONFIG "#endif"
1336 $ WRITE CONFIG "#endif"
1337 $ WRITE CONFIG " exit(0);"
1340 $ DEFINE SYS$ERROR _NLA0:
1341 $ DEFINE SYS$OUTPUT _NLA0:
1344 $ DEASSIGN SYS$ERROR _NLA0:
1345 $ DEASSIGN SYS$OUTPUT _NLA0:
1346 $ IF (silent) THEN GOSUB Shut_up
1347 $ DEFINE SYS$ERROR _NLA0:
1348 $ DEFINE SYS$OUTPUT _NLA0:
1351 $ DEASSIGN SYS$ERROR
1352 $ DEASSIGN SYS$OUTPUT
1353 $ IF (silent) THEN GOSUB Shut_up
1354 $ OPEN/WRITE CONFIG deccvers.out
1355 $ DEFINE SYS$ERROR CONFIG
1356 $ DEFINE SYS$OUTPUT CONFIG
1357 $ mcr []deccvers.exe
1360 $ DEASSIGN SYS$OUTPUT
1361 $ DEASSIGN SYS$ERROR
1362 $ IF (silent) THEN GOSUB Shut_up
1363 $ OPEN/READ CONFIG deccvers.out
1364 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1367 $! DELETE/NOLOG/NOCONFIRM deccvers.*;
1368 $ echo "You are using Dec C ''line'"
1369 $ Dec_C_Version = line
1372 $ IF "''Using_Vax_C'".EQS."Yes"
1375 $ echo4 "Checking to see how to invoke Vax C..."
1376 $ OPEN/WRITE CONFIG vaxcchk.c
1377 $ WRITE CONFIG "#include <stdio.h>"
1378 $ WRITE CONFIG "int main() {"
1379 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1380 $ WRITE CONFIG " exit(0);"
1383 $ DEFINE SYS$ERROR _NLA0:
1384 $ DEFINE SYS$OUTPUT _NLA0:
1386 $ cc/vaxc/NoObj vaxcchk.c
1388 $ DEASSIGN SYS$OUTPUT
1389 $ DEASSIGN SYS$ERROR
1391 $ IF (silent) THEN GOSUB Shut_up
1392 $ IF tmp.NE.%X10B90001
1399 $ DELETE/NOLOG/NOCONFIRM vaxcchk.*;
1402 $ if "''using_gnu_c'" .eqs. "Yes"
1404 $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1405 $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1406 $ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1407 $ IF gcclib_olb .EQS. ""
1409 $! These objects/libs come w/ gcc 2.7.2 for AXP:
1410 $ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1411 $ IF tmp .NES. "" then gcclib_olb = tmp
1412 $ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1415 $ IF gcclib_olb .EQS. ""
1416 $ THEN gcclib_olb = tmp
1417 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1420 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1423 $ IF gcclib_olb .EQS. ""
1424 $ THEN gcclib_olb = tmp
1425 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1428 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1431 $ IF gcclib_olb .EQS. ""
1432 $ THEN gcclib_olb = tmp
1433 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1436 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1438 $ gcclib_olb = gcclib_olb + "/lib"
1440 $ IF gcclib_olb .NES. "" .AND. -
1441 (vaxcrtl_olb .NES. "" .OR. -
1442 vaxcrtl_exe .NES. "" )
1445 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1446 $ OPEN/WRITE CONFIG gccvers.c
1447 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1448 $ WRITE CONFIG "#include <stdio.h>"
1449 $ WRITE CONFIG "int main() {"
1450 $ WRITE CONFIG "#ifdef __GNUC__"
1451 $ WRITE CONFIG "#ifdef __VERSION__"
1452 $ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1453 $ WRITE CONFIG "#else"
1454 $ WRITE CONFIG " printf(""%s\n"", ""1"");"
1455 $ WRITE CONFIG "#endif"
1456 $ WRITE CONFIG "#endif"
1457 $ WRITE CONFIG " exit(0);"
1460 $ DEFINE SYS$ERROR _NLA0:
1461 $ DEFINE SYS$OUTPUT _NLA0:
1464 $ DEASSIGN SYS$ERROR _NLA0:
1465 $ DEASSIGN SYS$OUTPUT _NLA0:
1466 $ IF (silent) THEN GOSUB Shut_up
1467 $ DEFINE SYS$ERROR _NLA0:
1468 $ DEFINE SYS$OUTPUT _NLA0:
1469 $ IF vaxcrtl_exe .EQS. ""
1471 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1473 $ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1476 $ link gccvers.obj,'gcclib_olb'
1480 $ OPEN/WRITE CONFIG GCCVERS.OPT
1481 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1483 $ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1486 $ DEASSIGN SYS$ERROR
1487 $ DEASSIGN SYS$OUTPUT
1488 $ IF (silent) THEN GOSUB Shut_up
1489 $ OPEN/WRITE CONFIG gccvers.out
1490 $ DEFINE SYS$ERROR CONFIG
1491 $ DEFINE SYS$OUTPUT CONFIG
1495 $ DEASSIGN SYS$OUTPUT
1496 $ DEASSIGN SYS$ERROR
1497 $ IF (silent) THEN GOSUB Shut_up
1498 $ OPEN/READ CONFIG gccvers.out
1499 $ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1502 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1503 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1505 $ echo "You are not using GNU cc."
1508 $ echo "You are using GNU cc ''line'"
1509 $ Using_Gnu_C = "Yes"
1510 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1518 $ OPEN/READ CONFIG ccvms.lis
1520 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1528 $ line = F$EDIT(line,"TRIM,COMPRESS")
1529 $ line = line - "Page 1" ! occurs at end all compilers
1530 $ line = line - "CCVMS " ! filename appears w/ VAXC
1531 $ line = line - "Source Listing " ! Seen w/ AXP DECC
1532 $ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1534 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1535 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1539 $!: What should the include directory be ?
1541 $ rp = "Where are the include files you want to use? "
1542 $ IF f$length( rp + "[''dflt'] " ).gt.76
1543 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1544 $ ELSE rp = rp + "[''dflt'] "
1549 $!: see if we have to deal with yellow pages, now NIS.
1550 $!: now get the host name
1553 $ echo4 "Figuring out host name..." !>&4
1555 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1556 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1557 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1558 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1559 $ IF myhostname.eqs."".and. -
1560 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1561 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1562 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1563 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1564 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1565 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1566 $ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1567 $!: you do not want to know about this
1569 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1571 $ IF (.not.ans).and.(ans.NES."")
1573 $ READ SYS$COMMAND/PROMPT= -
1574 "Please type the (one word) name of your host: " ans
1577 $!: translate upper to lower if necessary
1578 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1579 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1580 $ IF mylowhostname.NES.myhostname
1582 $ echo "(Normalizing case in your host name)"
1583 $ myhostname = mylowhostname
1586 $ fp = F$LOCATE(".",myhostname)
1587 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1588 $ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1590 $ rp = "What is your domain name? [''mydomain'] "
1592 $ IF ans .nes. "" THEN mydomain = ans
1593 $!: translate upper to lower if necessary
1594 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1595 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1596 $ IF mylowdomain.NES.mydomain
1598 $ echo "(Normalizing case in your domain name)"
1599 $ mydomain = mylowdomain
1602 $ myhostname = myhostname - mydomain
1603 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1605 $ THEN TYPE SYS$INPUT:
1607 I need to get your e-mail address in Internet format if possible, i.e.
1608 something like user@host.domain. Please answer accurately since I have
1609 no easy means to double check it. The default value provided below
1610 is most probably close to the reality but may not be valid from outside
1611 your organization...
1613 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1614 $ rp = "What is your e-mail address? [''dflt'] "
1617 $ THEN cf_email = ans
1618 $ ELSE cf_email = dflt
1622 $ THEN TYPE SYS$INPUT:
1624 If you or somebody else will be maintaining perl at your site, please
1625 fill in the correct e-mail address here so that they may be contacted
1626 if necessary. Currently, the "perlbug" program included with perl
1627 will send mail to this address in addition to perlbug@perl.com. You may
1628 enter "none" for no administrator.
1630 $ dflt = "''cf_email'"
1631 $ rp = "Perl administrator e-mail address [''dflt'] "
1634 $ THEN perladmin = ans
1635 $ ELSE perladmin = dflt
1638 $!: determine where public executable scripts go
1639 $!: determine perl absolute location
1640 $!: figure out how to guarantee perl startup
1642 $!: see how we invoke the C preprocessor
1644 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1645 $!: Set private lib path
1646 $!: Now check and see which directories actually exist, avoiding duplicates
1647 $!: determine optimize, if desired, or use for debug flag also
1648 $!: We will not override a previous value, but we might want to
1649 $!: augment a hint file
1650 $!: the following weeds options from ccflags that are of no interest to cpp
1651 $!: flags used in final linking phase
1652 $!: Try to guess additional flags to pick up local libraries.
1655 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1656 $!: compute shared library extension
1657 $!: Looking for optional libraries
1658 $!: see if nm is to be used to determine whether a symbol is defined or not
1659 $!: get list of predefined functions in a handy place
1660 $!: see if we have sigaction
1661 $!: see whether socketshr exists
1662 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1664 $ has_socketshr = "T"
1666 $ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1668 $ if (Dec_C_Version .ge. 50200000)
1670 $ Has_Dec_C_Sockets = "T"
1672 $ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1674 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1675 $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1678 $ echo "You've got sockets available. Which socket stack do you want to"
1679 $ echo "build into perl?"
1680 $ if "''has_dec_c_sockets'".eqs."T"
1684 $ dflt = "SOCKETSHR"
1686 $ rp = "Choose socket stack (NONE"
1687 $ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1688 $ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1689 $ rp = rp + ") [''dflt'] "
1691 $ IF "''ans'".eqs."" THEN ans = "''dflt'"
1692 $ has_dec_c_sockets = "F"
1693 $ has_socketshr = "F"
1694 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1695 $ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1696 $ IF ans.eqs."socketshr" then has_socketshr = "T"
1700 $! Ask if they want to build with VMS_DEBUG perl
1702 $ echo "Perl can be built to run under the VMS debugger."
1703 $ echo "You should only select this option if you are debugging"
1704 $ echo "perl itself. This can be a useful feature if you are "
1705 $ echo "embedding perl in a program."
1707 $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1709 $ IF ans.eqs."" then ans = dflt
1710 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1712 $ use_vmsdebug_perl = "Y"
1713 $ macros = macros + """__DEBUG__=1"","
1715 $ use_vmsdebug_perl = "N"
1718 $! Ask if they want to build with MULTIPLICITY
1720 $ echo "The perl interpreter engine can be built in a way that makes it
1721 $ echo "possible for a program that embeds perl into it (and yes, you can
1722 $ echo "do that--it's pretty keen) to have multiple perl interpreters active
1723 $ echo "at once. There is some performance overhead, however, so you
1724 $ echo "probably don't want to choose this unless you're going to be doing
1725 $ echo "funky perl embedding."
1727 $ rp = "Build with MULTIPLICITY? [''dflt'] "
1729 $ if ans.eqs."" then ans = dflt
1730 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1732 $ use_multiplicity="Y"
1734 $ use_multiplicity="N"
1737 $! Ask if they want to build with 64-bit support
1738 $ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1741 $ echo "This version of perl has experimental support for building with
1742 $ echo "64 bit integers and 128 bit floating point variables. This gives
1743 $ echo "a much larger range for perl's mathematical operations. (Note that
1744 $ echo "does *not* enable 64-bit fileops at the moment, as Dec C doesn't
1745 $ echo "do that yet)"
1747 $ rp = "Build with 64 bits? [''dflt'] "
1749 $ if ans.eqs."" then ans = dflt
1750 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1758 $! Ask about threads, if appropriate
1759 $ if (Using_Dec_C.eqs."Yes")
1762 $ echo "This version of Perl can be built with threads. While really nifty,
1763 $ echo "they are a beta feature, and there is a speed penalty for perl
1764 $ echo "programs if you build with threads *even if you don't use them*
1766 $ rp = "Build with threads? [''dflt'] "
1768 $ if ans.eqs."" then ans = dflt
1769 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1772 $ ! Are they on VMS 7.1 on an alpha?
1773 $ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1776 $ echo "Threaded perl can be linked to use multiple kernel threads
1777 $ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
1778 $ echo "allows multiple threads to execute simultaneously on an SMP
1779 $ echo "system as well as preventing a single thread from blocking
1780 $ echo "all the threads in a program, even on a single-processor
1781 $ echo "machine. Unfortunately this feature isn't safe on an
1782 $ echo "unpatched 7.1 system. (Several OS patches were required when
1783 $ echo "this procedure was written)
1785 $ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
1787 $ if ans.eqs."" then ans="''dflt'"
1788 $ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
1790 $ Thread_Live_Dangerously = "MT=MT=1"
1796 $! Ask whether they want to use secure logical translation when tainting
1798 $ echo "As Perl starts up, it checks several logical names, such as"
1799 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
1800 $ echo "of its behavior. For additional security, you may limit this"
1801 $ echo "process to executive- and kernel-mode translation when tainting"
1802 $ echo "is enabled. In this case, logical names normally skipped when"
1803 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
1804 $ echo "If you do not choose to do this, the usual order of access modes"
1805 $ echo "is used for logical name translation."
1807 $ echo "This restriction does not apply to the %ENV hash or to implicit"
1808 $ echo "logical name translation during parsing of file specifications;"
1809 $ echo "these always use the normal sequence of access modes for logical"
1810 $ echo "name translation."
1812 $ rp = "Use secure logical name translation? [''dflt'] "
1814 $ if ans.eqs."" then ans="''dflt'"
1815 $ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1817 $! Ask whether they want to default filetypes
1819 $ echo "When you pass the name of a program to Perl on the command line,"
1820 $ echo "it generally doesn't supply any defaults unless the -S command"
1821 $ echo "line switch is specified. In keeping with the VMS tradition of"
1822 $ echo "default file types, however, you can configure Perl to try default"
1823 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
1824 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
1825 $ echo "finally foo.com)."
1827 $ rp = "Always use default file types? [''dflt'] "
1829 $ if ans.eqs."" then ans="''dflt'"
1830 $ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1832 $! Ask if they want to use perl's memory allocator
1834 $ echo "Perl has a built-in memory allocator that's tuned for perl's
1835 $ echo "normal memory usage. It's oftentimes better than the standard
1836 $ echo "system memory allocator. It also has the advantage of providing
1837 $ echo "memory allocation statistics, if you choose to enable them.
1839 $ rp = "Build with perl's memory allocator? [''dflt'] "
1841 $ if ans.eqs."" then ans="''dflt'"
1842 $ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
1843 $ if mymalloc.eqs."Y"
1845 $ if use_debugging_perl.eqs."Y"
1848 $ echo "Perl can keep statistics on memory usage if you choose to use
1849 $ echo "them. This is useful for debugging, but does have some
1850 $ echo "performance overhead.
1852 $ rp = "Do you want the debugging memory allocator? [''dflt'] "
1854 $ if ans.eqs."" then ans="''dflt'"
1855 $ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
1857 $ ! Check which memory allocator we want
1859 $ echo "There are currently three different memory allocators: the
1860 $ echo "default (which is a pretty good general-purpose memory manager),
1861 $ echo "the TWO_POT allocator (which is optimized to save memory for
1862 $ echo "larger allocations), and PACK_MALLOC (which is optimized to save
1863 $ echo "memory for smaller allocations). They're all good, but if your
1864 $ echo "usage tends towards larger chunks use TWO_POT, otherwise use
1865 $ echo "PACK_MALLOC."
1867 $ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
1869 $ if ans.eqs."" then ans = "''dflt'"
1870 $ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
1871 $ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
1874 $! Ask for their default list of extensions to build
1876 $ echo "It's time to specify which modules you want to build into
1877 $ echo "perl. Most of these are standard and should be chosen, though
1878 $ echo "you might, for example, want to build GDBM_File instead of
1879 $ echo "SDBM_File if you have the GDBM library built on your machine
1881 $ echo "Which modules do you want to build into perl?"
1882 $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
1883 $ dflt = "Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
1884 $ if Using_Dec_C.eqs."Yes"
1886 $ dflt = dflt + " POSIX"
1887 $ if Use_Threads.eqs."T"
1889 $ dflt = dflt + " Thread"
1894 $ if ans.eqs."" then ans = "''dflt'"
1895 $ extensions = "''ans'"
1897 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
1899 $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
1900 $! If the 'build' that you use is not here add it and it's test
1901 $! switch to the _END_ of these strings (and increment max_build)
1902 $! (e.g. builders = builders + "/FOOMAKE"
1903 $! probers = probers + " -fooVersionSwitch"
1904 $! ) & please let me know about it.
1905 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
1906 $ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
1912 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
1913 $ WRITE CONFIG "dont_make_anything_yet:"
1914 $ WRITE CONFIG F$FAO("!_")
1917 $ messages = F$ENVIRONMENT("MESSAGE")
1919 $ build = F$ELEMENT(n,"/",builders)
1920 $ probe = F$ELEMENT(n,"!",probers)
1921 $ echo "Testing whether you have ''build' on your system..."
1922 $ SET NOON !sorry :-(
1923 $ ON CONTROL_Y THEN GOTO Reenable_messages_build !sorry :-(
1924 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
1926 $ IF ($SEVERITY .EQ. 1)
1929 $ IF (build .EQS. orig_dflt)
1931 $ default_set = "TRUE"
1934 $ ok_builders = ok_builders + " " + build
1935 $ IF (.NOT. default_set) THEN dflt = build
1939 $Reenable_messages_build: !hope you made it here :-)
1940 $ SET MESSAGE 'messages' !hope you made it here :-)
1941 $ SET ON !hope you made it here :-)
1943 $ IF (n .LT. max_build) THEN GOTO Build_probe
1946 $ IF (ok_builders .NES. "")
1948 $ echo "Here is the list of builders you can apparently use:"
1949 $ echo "(",ok_builders," )"
1950 $ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
1952 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
1953 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1961 %Config-E-VMS, ERROR:
1962 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
1963 utility of some sort and after checking my "builders" list I cannot find
1964 the symbol or command you use on your system to compile programs.
1966 $ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
1967 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
1968 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1971 $ echo "I don't know where 'make' is, and my life depends on it."
1972 $ echo "Go find a make program or fix your DCL$PATH setting!"
1973 $ echo "ABORTING..."
1974 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1976 $ EXIT 2 !$STATUS = "%X00000002" (error)
1982 $ DELETE/NOLOG Makefile.;
1987 There seems to be trouble. I just tried to create a file in
1988 $ echo4 'F$ENVIRONMENT("DEFAULT")'
1990 but was unsuccessful. I am stopping now. Please check that directories'
1991 PROTECTION bits. I will leave you in the directory where you started
1993 $ echo4 "ABORTING..."
1999 $! echo " Very well I will proceed with ""''build'"""
2000 $ make = F$EDIT(build,"UPCASE")
2002 $!: locate the preferred pager for this system
2003 $!pagers = "most|more|less|type/page"
2004 $!rp='What pager is used on your system?'
2006 $! update [.vms]config.vms here
2008 $! update makefile here
2009 $! echo4 "Updating makefile..."
2011 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2013 $ makefile = "" !wrt MANIFEST dir
2014 $ UUmakefile = "DESCRIP.MMS" !wrt CWD dir
2015 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
2017 $ makefile = " -f [.VMS]Makefile." !wrt MANIFEST dir
2018 $ UUmakefile = "[-.VMS]Makefile." !wrt CWD dir
2019 $ DEFmakefile = "[-.VMS]Makefile." !wrt DEF dir (?)
2024 $ tmp = F$LENGTH(macros)
2025 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2026 $ macros = "/macro=(" + macros + ")"
2029 $! Invoke the subconfig piece
2032 $ echo4 "Checking the C run-time library"
2033 $ dflt = F$ENVIRONMENT("DEFAULT")
2034 $ SET DEFAULT [-.vms]
2038 $! Warn of dangerous symbols or logical names
2040 $Bad_environment: SUBROUTINE
2042 $ IF p2 .eqs. "SYMBOL"
2044 $ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
2046 $ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
2048 $ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
2050 $ IF f$search("config.msg") .nes. ""
2052 $ OPEN/APPEND CONFIG config.msg
2054 $ OPEN/WRITE CONFIG config.msg
2056 $ IF Bad_env .eqs. "SYMBOL"
2059 $ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
2060 $ WRITE CONFIG " delete before building ''package' via:"
2061 $ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
2062 $ IF f$locate("""",&p1) .ge. f$length(&p1)
2064 $ WRITE CONFIG " after building, testing, and installing ''package'
2065 $ WRITE CONFIG " restore the symbol with:"
2066 $ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
2069 $ IF Bad_env .eqs. "LOGICAL"
2072 $ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
2073 $ WRITE CONFIG " deassign before building ''package'"
2079 $ ENDSUBROUTINE ! Bad_environment
2081 $ echo4 "%Config-I-VMS, Checking for dangerous pre extant global symbols and logical names."
2082 $ CALL Bad_environment "TMP"
2083 $ CALL Bad_environment "LIB"
2084 $ CALL Bad_environment "T"
2085 $ CALL Bad_environment "FOO"
2086 $ CALL Bad_environment "EXT"
2087 $ CALL Bad_environment "TEST" "SYMBOL"
2088 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
2090 $! %Config-I-VMS, write perl_setup.com here
2093 $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
2094 $ file_2_find = "[-.vms]perl_setup.com"
2095 $ OPEN/WRITE CONFIG 'file_2_find'
2097 $ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
2098 $ IF cf_email.NES.perladmin
2100 $ WRITE CONFIG "$! perl configured by ''cf_email'"
2102 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
2105 $ prefix = prefix - "000000."
2106 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
2107 prefix = prefix - "]" + ".]"
2108 $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
2109 $ write config "$ ext = "".exe"""
2110 $ if sharedperl .eqs. "Y"
2112 $ write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
2114 $ IF use_vmsdebug_perl .eqs. "Y"
2116 $ WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
2117 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]ndbgPerl'ext'"
2118 $ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2120 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
2121 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2126 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2127 $ ELSE !leave in but commented out (in case setting was from perl :-)
2128 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2131 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
2133 $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
2137 $ echo "%Config-I-VMS, The file can be found at:"
2138 $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
2139 $ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
2140 $ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
2141 $ echo "-Config-I-VMS, testing, and installation of your perl."
2144 $!figure out where we "are" by parsing 'vms_default_directory_name'
2146 $ set_def_command = ""
2147 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
2148 $ tmp = vms_default_directory_name - dflt - "]"
2150 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
2152 $ tmp1 = F$ELEMENT(i,".",tmp)
2153 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
2155 $ THEN set_def_command = "set default [-"
2156 $ ELSE set_def_command = set_def_command + "-"
2160 $Beyond_set_def_loop:
2161 $ IF set_def_command.NES.""
2163 $ set_def_command = set_def_command - "-" + "]"
2165 $ echo4 "In order to build ''package' you must now issue the commands:"
2167 $ echo4 " ''set_def_command'"
2170 $ echo4 "In order to build ''package' you must now issue the command:"
2173 $ echo4 " ''make'''makefile'", macros
2176 $ IF ( F$SEARCH("config.msg").NES."" )
2178 $ echo "Hmm. I also noted the following information while running:"
2181 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
2182 $ DELETE/NOLOG/NOCONFIRM config.msg;
2188 $ DEASSIGN SYS$OUTPUT
2189 $! DEASSIGN SYS$ERROR
2191 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
2192 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt
2193 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
2195 $ dflt = F$ENVIRONMENT("DEFAULT")
2196 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
2198 $ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
2200 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
2201 $ DELETE/NOLOG/NOCONFIRM UU.DIR;
2203 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2206 $!: End of Configure