1 $ sav_ver = 'F$VERIFY(0)'
4 $! Installation and usage: COPY this file into you perl source tree - at or
5 $! below where the main MANIFEST. file is located.
7 $! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will
10 $! $ COPY Configure.com [USER.PERL5_00n.VMS]
12 $! Now cd into the tree and execute Configure:
14 $! $ SET DEFAULT [USER.PERL5_00n]
19 $! $ SET DEFAULT [USER.PERL5_00n]
20 $! $ @[.vms]Configure "-des"
22 $! That's it. If you get into a bind trying to build perl on VMS then
23 $! definitely read through the README.VMS file as well as the top of the
24 $! [.VMS]DESCRIP.MMS file.
25 $! Beyond that send email to VMSPerl@cor.newman.upenn.edu
27 $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 $! This CONFIGURE.COM prototype is available from:
30 $! http://w4.lns.cornell.edu/~pvhp/perl/vms/devel/configure.com
31 $! send suggestions to:
32 $! Peter Prymmer pvhp@lns62.lns.cornell.edu or pvhp@forte.com
35 $! Adapted and converted from Larry Wall & Andy Dougherty's
36 $! "Configure generated by metaconfig 3.0 PL60."
37 $! (a Bourne sh[ell] script for configuring the installation of perl on VMS)
38 $! in the perl5.002|3 epoch (spring/summer 1996)
39 $! with much valuable help from Charles Bailey &
40 $! the whole VMSPerl crew.
43 $ sav_ver = F$VERIFY(sav_ver)
45 $! VMS-isms we will need:
46 $ echo = "write sys$output "
51 $ C_Compiler_Replace = "CC="
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
131 $ THEN !one or more switches was thrown
135 $ IF (P'i'.NES."") THEN bang = bang + 1
137 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
141 $ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
142 $ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
143 $Remove_quotation_mark:
145 $ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
146 $ gotopt = "f" !"alse"
147 $ gotshortopt = "f" !"alse"
148 $ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
151 $ gotopt = "t" !"rue"
153 $ gotshortopt = "t" !"rue"
155 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
162 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
166 $ IF (F$SEARCH(config_sh).NES."")
168 $ test = F$FILE_ATTRIBUTES(config_sh,"PRO")
169 $ IF (F$LOCATE("R",test).NE.F$LENGTH(test))
171 $ CONTINUE !at this point check UIC && if test allows...
174 $ echo "''me': cannot read config file ''config_sh'."
178 $ echo "''me': cannot read config file ''config_sh'."
183 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
190 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
197 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
204 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
209 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
216 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
223 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
225 $ extractsh = "true" !VMS?
230 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
233 $!Hmm.. this part needs work
235 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
239 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
241 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
242 $ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
243 $ echo "''me': ignoring -D",P'i'
245 $!Hmm.. this part needs work
246 $! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
247 $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
250 $ ECHO "P''i' =>",P'i',"<=" !Diag
253 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
256 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
260 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
262 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
263 $ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
264 $ echo "''me': ignoring -U",P'i'
269 $ ECHO "P''i' =>",P'i',"<=" !Diag
272 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
274 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
275 $ echo "''me' generated by an unknown version of EDT."
281 $ echo "''me': unknown option ",P'i'
284 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
286 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
288 $ ENDIF ! (P1 .NES. "")
292 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
293 $ echo "Usage: @''me' [-dehrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
294 $ echo " [-Usymbol] [-Usymbol=]"
296 "-d" : use defaults for all answers.
297 "-e" : go on without questioning past the production of config.sh. *
298 "-f" : specify an alternate default configuration file.
299 "-h" : print this help message and exit (with an error status).
300 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
301 "-s" : silent mode, only echoes questions and essential information.
302 -"D" : define symbol to have some value: *
303 -"Dsymbol" symbol gets the value 'define'
304 -"Dsymbol=value" symbol gets the value 'value'
305 -E : stop at the end of questions, after having produced config.sh. *
306 -K : do not use unless you know what you are doing.
307 -O : let -D and -U override definitions from loaded configuration file. *
308 -S : perform variable substitutions on all .SH files (can mix with -f) *
309 -"U" : undefine symbol: *
310 -"Usymbol" symbol gets the value 'undef'
311 -"Usymbol=" symbol gets completely empty
312 -V : print version number and exit (with a zero status).
313 $ echo "%Config-I-VMS, lower case switches must be enclosed"
314 $ echo "-Config-I-VMS, in double quotation marks, e.g.:"
315 $ echo "-Config-I-VMS, @Configure ""-des"""
316 $ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
317 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
319 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
325 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
326 $ DEFINE SYS$OUTPUT "_NLA0:"
327 $ echo4 = "write STDOUT "
328 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
329 $ open/write STDOUT 'STDOUT'
337 $ echo4 = "write SYS$OUTPUT "
341 $!: run the defines and the undefines, if any, but leave the file out there...
342 $! Unfortunately Configure.COM in DCL is not yet set up to do this -
348 $!: Eunice requires " " instead of "", can you believe it
351 $ echo "Beginning of configuration questions for ''package'."
354 $!: Some greps do not return status, grrr.
355 $ contains = "SEARCH"
357 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
358 $! echo "Checking ''echo' to see how to suppress newlines..."
359 $! echo "giving up..."
360 $! echo "The star should be here-->*"
362 $!: Now test for existence of everything in MANIFEST
364 $ echo4 "First let's make sure your kit is complete. Checking..."
367 $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
368 $! because the search routine simply does set def [-] if necessary.
369 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
371 $ manifestfound = F$SEARCH(file_2_find)
372 $ IF (manifestfound .EQS. "")
374 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
377 $ GOTO Research_manifest
380 $ echo "There is no MANIFEST file. I hope your kit is complete !"
382 $ GOTO Beyond_manifest
385 $! MANIFEST. has been found and we have set def'ed there -
386 $! time to bail out before it's too late.
387 $ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
390 %Config-E-VMS, ERROR:
391 Sorry! It apears as though your perl build sub-directory is already too
392 deep into the VMS file system. Please try moving stuff into a shallower
393 directory (or altering the "max_allowed_dir_depth" parameter).
394 $ echo4 "ABORTING..."
395 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
397 $ EXIT !2 !$STATUS = "%X00000002" (error)
400 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
402 $ IF (manifestfound .NES. "")
404 $ IF ( F$SEARCH("UU.DIR").EQS."" )
406 $ CREATE/DIRECTORY [.UU]
408 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
410 $!: Configure runs within the UU subdirectory
413 $! a little redundancy never hurt anybody?
414 $ file_2_find = "[-]" + file_2_find
415 $ manifestfound = F$SEARCH(file_2_find)
417 $ OPEN/WRITE MISSING MISSING.
418 $!change to "FALSE" if you wish to skip the manifest search
419 $!(which after all is rather slow in DCL :-)
422 $ OPEN/READ CONFIG 'manifestfound'
424 $ READ/END_OF_FILE = Done_manifest CONFIG line
425 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
426 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
427 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
428 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
429 $ line = F$EDIT(line,"TRIM, COMPRESS")
430 $ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
431 $ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
433 $Re_strip_line_manifest:
434 $ loca = F$LOCATE("/",file_2_find)
435 $ ante = F$EXTRACT(0,loca,file_2_find)
436 $ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
437 $ test_this = ante + "." + (post - "/")
438 $ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
440 $ file_2_find = ante + "." + (post - "/")
441 $ GOTO Re_strip_line_manifest
443 $ file_2_find = ante + "]" + (post - "/")
445 $ file_2_find = "[-."+file_2_find
447 $ file_2_find = "[-]" + file_2_find
450 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
451 $ file_2_find = file_2_find - dirname
454 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
455 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
457 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
458 $ ELSE basename = basename + dot_ele + "_"
463 $ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
464 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
465 basename = f$extract(0,f$length(basename)-1,basename)
466 $ file_2_find = dirname + basename
468 $ found = F$SEARCH(file_2_find)
469 $ IF (found .EQS. "")
471 $ WRITE MISSING file_2_find
472 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
474 $ miss_list = miss_list + "," + file_2_find
477 $ GOTO Read_loop_manifest
482 $ ENDIF ! (manifestfound .NES. "")
484 $ IF (miss_list .NES. "")
486 $ echo "Some of the files not found include:"
489 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
493 THIS PACKAGE SEEMS TO BE INCOMPLETE.
495 You have the option of continuing the configuration process, despite the
496 distinct possibility that your kit is damaged, by typing 'y'es. If you
497 do, don't blame me if something goes wrong. I advise you to type 'n'o
498 and contact the author (pvhp@lns62.lns.cornell.edu).
500 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
503 $ echo4 "Continuing..."
505 $ echo4 "ABORTING..."
509 $ echo4 "Looks good..."
510 $ DELETE/NOLOG MISSING.;
511 $ ENDIF ! (miss_list .NES. "")
512 $ ENDIF ! (manifestfound .EQS. "") ELSE
514 $! after finding MANIFEST (see above)
515 $!: Configure runs within the UU subdirectory
517 $!: compute the number of columns on the terminal for proper question formatting
518 $! (sfn, will assume 80-ish)
520 $!: set up the echo used in my read !sfn
521 $!: now set up to do reads with possible shell escape and default assignment !sfn
532 $ READ SYS$COMMAND/PROMPT="''rp'" ans
535 $ READ SYS$COMMAND/PROMPT="''rp'" ans
542 $!: create .config dir to save info across Configure sessions
543 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
545 $ CREATE/DIRECTORY [-.CONFIG]
546 $ OPEN/WRITE CONFIG [-.CONFIG]README.
548 "This directory created by Configure to save information that should"
550 "persist across sessions."
553 "You may safely delete it if you wish."
557 $!: general instructions
560 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
561 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
563 $ messages = F$ENVIRONMENT("MESSAGE")
564 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
565 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
566 $ IF .NOT.($status.EQ.%X08D78053)
570 $ rp = "Would you like to see the instructions? [''dflt'] "
572 $ if .NOT.ans THEN needman=""
574 $ SET MESSAGE 'messages' !hope you made it here :-)
576 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
582 This installation shell script will examine your system and ask you questions
583 to determine how the perl5 package should be installed. If you get
584 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
585 process, edit something, then restart this process as you just did.
586 Many of the questions will have default answers in square
587 brackets; typing carriage return will give you the default.
589 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
592 In a hurry? You may run '@Configure -d'. This will bypass nearly all
593 the questions and use the computed defaults (or the previous answers provided
594 there was already a config.sh file). Type '@Configure -h' for a list of
597 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
600 Much effort has been expended to ensure that this shell script will
601 run on any VMS system. If despite that it blows up on yours, your
602 best bet is to edit Configure.com and @ it again. Whatever problems
603 you have with Configure.com, let me (sugalskd@ous.edu) know how I blew
606 $!This installation script affects things in two ways:
608 $!1) it may do direct variable substitutions on some of the files included
610 $!2) it builds a config.h file for inclusion in C programs. You may edit
611 $! any of these files as the need arises after running this script.
613 $!If you make a mistake on a question, there is no easy way to back up to it
616 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
617 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
619 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
623 $ ENDIF !(needman .EQS. "true")
625 $!: see if sh knows # comments !sfn
627 $!: figure out how to guarantee sh startup !sfn
628 $!: find out where common programs are !sfn
629 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
630 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
631 $! echo "I don't know where '$file' is, and my life depends on it."
632 $! echo "Go find a public domain implementation or fix your PATH setting!"
634 $! echo "Don't worry if any of the following aren't found..."
635 $!: determine whether symbolic links are supported !sfn
636 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
637 $!: set up the translation script tr, must be called with ./tr of course !sfn
639 $!: Try to determine whether config.sh was made on this system
640 $!: Get old answers from old config file if Configure was run on the
641 $!: same system, otherwise use the hints.
642 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
646 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
648 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
650 $ configshfound = F$SEARCH(config_sh)
651 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
653 $ IF (i.LT.max) THEN GOTO Config_sh_look
654 $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
657 $ echo "Fetching default answers from ''config_sh'..."
658 $!we actually do not have "hints/" for VMS
661 $!First time through, eh? I have some defaults handy for the following systems:
663 $! echo " ","VMS_VAX"
664 $! echo " ","VMS_AXP"
665 $! : Now look for a hint file osname_osvers, unless one has been
666 $! : specified already.
669 $!You may give one or more space-separated answers, or "none" if appropriate.
670 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
672 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
676 $!: Restore computed paths !sfn
678 $! genconfig.pl has "osname='VMS'"
679 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
680 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
682 $ IF (osname .NES. "VMS")
684 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
687 %Config-E-VMS, ERROR:
689 Err, you do not appear to be running VMS!
690 This package is intended to Configure the building of Perl for VMS.
692 $ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
695 $ echo4 "Continuing..."
697 $ echo4 "ABORTING..."
698 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
700 $ EXIT 2 !$STATUS = "%X00000002" (error)
702 $ ELSE !we are on VMS huzzah!
704 $ THEN TYPE SYS$INPUT:
706 Configure uses the operating system name and version to set some defaults.
707 The default value is probably right if the name rings a bell. Otherwise,
708 since spelling matters for me, either accept the default or answer "none"
711 $ rp = "Operating system name? [''osname'] "
715 $ IF (ans.NES.osname) !.AND.knowitall
717 $ echo4 "I'll go with ''osname' anyway..."
720 $ ENDIF !(osname .NES./.EQS. "VMS")
722 $!: who configured the system
724 $ cf_by = F$EDIT(user,"LOWERCASE")
725 $! cf_time = F$CVTIME() !superceded by procedure below
726 $ osvers = F$GETSYI("VERSION")
728 $! Peter Prymmer has seen:
729 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
730 $! "SYS$TIME_ZONE" = "EDT"
732 $! Charles Lane recommended:
733 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
734 $! "NEWS_TIMEZONE" = "-0500"
735 $! "ST_TIMEZONE" = "EDT"
736 $! "JAN_TIME_ZONE" = "EST "
737 $! "MULTINET_TIMEZONE" = "EST"
738 $! "DAYLIGHT_SAVINGS" = "1"
740 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
742 $! "Multinet_Timezone"
743 $! "TCPware_Timezone"
746 $! This snippet o' DCL returns a string in default Unix `date` format,
747 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
748 $! Peter Prymmer pvhp@lns62.lns.cornell.edu
750 $ MIN_TZO = -840 !units are minutes here
753 $ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
754 $ monn = F$CVTIME(,,"MONTH")
755 $ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
756 $ hour = F$CVTIME(,,"HOUR")
757 $ min = F$CVTIME(,,"MINUTE")
758 $ sec = F$CVTIME(,,"SECOND")
759 $ year = F$CVTIME(,,"YEAR")
761 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
765 $ mon = F$ELEMENT(i,"/",months)
766 $ IF i.LT.monn THEN GOTO Mon_loop
769 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
772 $ tzhour = F$INTEGER(systz)/3600
773 $ tzmins = F$INTEGER(systz)/60
774 $ tzminrem = tzmins - tzhour*60
775 $ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
777 $ THEN signothetime = "+"
778 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
779 $ THEN direction = "on GMT/"
780 $ ELSE direction = "east of "
782 $ ELSE signothetime = "-"
783 $ tzhour = -1*tzhour !keeps !UL happy
784 $ direction = "west of "
787 $ echo "%Config-I-VMS,"
788 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
791 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
793 $ tzspan = "''tzhour' hours"
796 $ echo "Your system is ''tzspan' ''direction'UTC in England."
797 $ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
799 $ IF ans.OR.(ans.EQS."")
803 $ GOTO Beyond_TimeZone
807 $ echo4 "%Config-I-VMS,"
808 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
813 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
814 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
815 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
817 $ rp = "Enter the Time Zone offset: [''dflt'] "
819 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
820 $ IF ans.EQS."" THEN ans = dflt
821 $ tzhour = F$ELEMENT(0,":","''ans'") !first
822 $ IF tzhour.EQS."" THEN tzhour = 0
823 $ tzhour = F$INTEGER(tzhour)
824 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
827 $ tzminrem = F$INTEGER(tzminrem)
828 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
832 $ tzmins = tzhour*60 + tzminrem
833 $ tzd = F$STRING(tzmins*60)
838 $ tzhour = -1*tzhour !keeps !UL happy
841 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
844 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
849 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
850 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
852 $!: determine the architecture name
853 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
855 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
857 $ archname = "VMS_VAX"
859 $ archname = "VMS_AXP"
861 $ rp = "What is your architecture name? [''archname'] "
865 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
866 $ IF (ans.NES.archname) !.AND.knowitall
868 $ echo4 "I'll go with ''archname' anyway..."
871 $ IF (archname.EQS."VMS_AXP")
874 $ rp = "Are you sharing your PERL_ROOT with a VAX? [''dflt'] "
878 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
885 $ macros = macros + """AXE=1"","
891 $!: is AFS running? !sfn
892 $!: decide how portable to be. Allow command line overrides. !sfn
893 $!: set up shell script to do ~ expansion !sfn
894 $!: expand filename !sfn
895 $!: now set up to get a file name !sfn
897 $ vms_skip_install = "true"
900 $ rp = "%Config-I-VMS, Do you wish to skip the """"where install"""" questions? [''dflt'] "
902 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
903 $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
904 $ prefix = f$parse(prefix,,,,"NO_CONCEAL") - "][" - ".;"
905 $ prefix = prefix - "]" + ".]"
906 $ IF (.NOT.vms_skip_install)
908 $!: determine root of directory hierarchy where package will be installed.
913 $ echo "By default, ''package' will be installed in ''dflt'/bin, manual"
914 $ echo "pages under ''dflt'/man, etc..., i.e. with ''dflt' as prefix for"
915 $ echo "all installation directories. Typically set to /usr/local, but you"
916 $ echo "may choose /usr if you wish to install ''package' among your system
919 $ THEN TYPE SYS$INPUT:
920 binaries. If you wish to have binaries under /bin but manual pages
921 under /usr/local/man, that's ok: you will be prompted separately
922 for each of the installation directories, the prefix being only used
926 $ rp = "Installation prefix to use? [ ''dflt' ] "
931 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
936 $!: set the prefixit variable, to compute a suitable default value
938 $!: determine where private library files go
939 $!: Usual default is /usr/local/lib/perl5. Also allow things like
940 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
942 $ THEN TYPE SYS$INPUT:
944 There are some auxiliary files for perl5 that need to be put into a
945 private library directory that is accessible by everyone.
947 $ dflt = prefix - ".]" + ".LIB]"
948 $ rp = "Pathname where the private library files will reside? "
949 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
953 $ ELSE privlib = dflt
956 $ ENDIF !%Config-I-VMS, skip "where install" questions
958 $!: set the base revision
960 $!: get the patchlevel
962 $ echo4 "Getting the current patchlevel..." !>&4
963 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
964 $ IF (patchlevel_h.NES."")
966 $ got_patch = "false"
968 $ OPEN/READONLY CONFIG 'patchlevel_h'
970 $ READ/END_Of_File=Close_patch CONFIG line
971 $ IF ((F$LOCATE("#define PATCHLEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
973 $ line = F$EDIT(line,"COMPRESS, TRIM")
974 $ patchlevel = F$EXTRACT(18,F$LENGTH(line)-18,line)
977 $ IF ((F$LOCATE("SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
979 $ line = F$EDIT(line,"COMPRESS, TRIM")
980 $ subversion = F$EXTRACT(18,F$LENGTH(line)-18,line)
983 $ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
990 $ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
991 $! This whole thing needs replacing w/ F$FAO() calls:
992 $ patchlevel = F$INTEGER(patchlevel)
993 $ IF patchlevel.LT.10
994 $ THEN patchlevel = "00" + F$STRING(patchlevel)
995 $ ELSE patchlevel = "0" + F$STRING(patchlevel)
997 $ subversion = F$INTEGER(subversion)
1000 $ IF subversion.LT.10
1001 $ THEN subversion = "0" + F$STRING(subversion)
1002 $ ELSE subversion = F$STRING(subversion)
1004 $ ELSE subversion = ""
1007 $ version = F$EXTRACT(0,1,baserev) + "_" + patchlevel + subversion
1009 $ IF (.NOT.vms_skip_install)
1011 $!: set the prefixup variable, to restore leading tilda escape !sfn
1012 $!: set the prefixup variable, to restore leading tilde escape !sfn
1014 $!: determine where public architecture dependent libraries go
1018 $ echo "''package' contains architecture-dependent library files. If you are"
1021 $ THEN TYPE SYS$INPUT:
1022 sharing libraries in a heterogeneous environment, you might store
1023 these files in a separate location. Otherwise, you can just include
1024 them with the rest of the public library files.
1026 $ dflt = privlib - "]" + "." + archname + "." + version + "]"
1027 $ rp = "Where do you want to put the public architecture-dependent libraries? "
1028 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1031 $ THEN archlib = ans
1032 $ ELSE archlib = dflt
1035 $!: set up the script used to warn in case of inconsistency !sfn
1036 $!: function used to set $1 to $val !sfn
1038 $ ENDIF !%Config-I-VMS, skip "where install" questions
1039 $! This quotation from Configure has to be included on VMS:
1042 There is, however, a strange, musty smell in the air that reminds me of
1043 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1045 $ IF (.NOT.vms_skip_install)
1047 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1049 $!: see if setuid scripts can be secure !sfn
1050 $!: now see if they want to do setuid emulation !sfn
1052 $!: determine where site specific libraries go.
1054 $ THEN TYPE SYS$INPUT:
1056 The installation process will also create a directory for
1057 site-specific extensions and modules. Some users find it convenient
1058 to place all local files in this directory rather than in the main
1059 distribution directory.
1061 $ dflt = privlib - "]" + ".SITE_PERL]"
1062 $ rp = "Pathname for the site-specific library files? "
1063 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1066 $ THEN sitelib = ans
1067 $ ELSE sitelib = dflt
1070 $!: determine where site specific architecture-dependent libraries go.
1072 $ THEN TYPE SYS$INPUT:
1074 The installation process will also create a directory for
1075 architecture-dependent site-specific extensions and modules.
1077 $ dflt = sitelib - "]" + "." + archname + "]"
1078 $ rp = "Pathname for the site-specific architecture-dependent library files? "
1079 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1082 $ THEN sitearch = ans
1083 $ ELSE sitearch = dflt
1086 $!: determine where old public architecture dependent libraries might be
1088 $!: determine where public executables go
1089 $ dflt = prefix - ".]" + ".BIN]"
1090 $ rp = "Pathname where the public executables will reside? "
1091 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1098 $!: determine where manual pages are on this system
1099 $!: What suffix to use on installed man pages
1100 $!: see if we can have long filenames
1101 $!: determine where library module manual pages go
1102 $!: What suffix to use on installed man pages
1103 $!: see what memory models we can support
1105 $ ENDIF !%Config-I-VMS, skip "where install" questions
1107 $!: see if we need a special compiler
1108 $! cc_list = "cc/vaxc|cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1112 $ vms_cc_available = ""
1114 $ OPEN/WRITE CONFIG ccvms.c
1115 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1116 $ WRITE CONFIG "#include <stdio.h>"
1117 $ WRITE CONFIG "int main() {"
1118 $ WRITE CONFIG "#ifdef __DECC"
1119 $ WRITE CONFIG " printf(""/DECC\n"");"
1120 $ WRITE CONFIG "#else"
1121 $ WRITE CONFIG " printf(""/VAXC\n"");"
1122 $ WRITE CONFIG "#endif"
1123 $ WRITE CONFIG " exit(0);"
1127 $ DEFINE SYS$ERROR _NLA0:
1128 $ DEFINE SYS$OUTPUT _NLA0:
1129 $ cc/NoObj/list=ccvms.lis ccvms.c
1131 $ DEASSIGN SYS$OUTPUT
1132 $ DEASSIGN SYS$ERROR
1133 $ IF (silent) THEN GOSUB Shut_up
1134 $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1136 $ IF tmp.NE.%X10B90001
1138 $ IF tmp.NE.%X10000001
1140 $ nocc = "t" !%X10000001 is return from gcc
1141 $ GOTO Gcc_initial_check
1146 $ IF .NOT.silent THEN echo ""
1147 $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1148 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1150 $ vms_cc_dflt = "/vaxc"
1151 $ vms_cc_available = vms_cc_available + "cc/vaxc "
1154 $ echo "%Config-I-VMS, Will try cc/decc..."
1156 $ DEFINE SYS$ERROR _NLA0:
1157 $ DEFINE SYS$OUTPUT _NLA0:
1159 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1161 $ DEASSIGN SYS$OUTPUT
1162 $ DEASSIGN SYS$ERROR
1164 $ IF (silent) THEN GOSUB Shut_up
1165 $ IF tmp.NE.%X10B90001
1167 $ echo "%Config-I-VMS, Apparently you don't have that one."
1170 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1171 $ vms_cc_available = vms_cc_available + "cc/decc "
1174 $ IF F$LOCATE("DEC",line).NE.F$LENGTH(line)
1176 $ vms_cc_dflt = "/decc"
1177 $ vms_cc_available = vms_cc_available + "cc/decc "
1178 $ echo "%Config-I-VMS, Will try cc/vaxc..."
1179 $ DEFINE SYS$ERROR _NLA0:
1180 $ DEFINE SYS$OUTPUT _NLA0:
1182 $ cc/vaxc/NoObj/list=ccvms.lis ccvms.c
1184 $ DEASSIGN SYS$OUTPUT
1185 $ DEASSIGN SYS$ERROR
1187 $ IF (silent) THEN GOSUB Shut_up
1188 $ IF tmp.NE.%X10B90001
1190 $ echo "%Config-I-VMS, Apparently you don't have that one."
1193 $ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1194 $ vms_cc_available = vms_cc_available + "cc/vaxc "
1200 $ echo "%Config-I-VMS, Checking for Gcc"
1201 $ OPEN/WRITE CONFIG gccvers.lis
1202 $ DEFINE SYS$ERROR CONFIG
1203 $ DEFINE SYS$OUTPUT CONFIG
1204 $ 'gcc_symbol'/noobj/version _nla0:
1206 $ DEASSIGN SYS$OUTPUT
1207 $ DEASSIGN SYS$ERROR
1208 $ IF (silent) THEN GOSUB Shut_up
1210 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1212 $ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1215 $ OPEN/READ CONFIG gccvers.lis
1217 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1218 $ GOTO GCC_List_Read
1222 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1223 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1226 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1228 $!: see if we need a special compiler
1230 $ echo "%Config-I-VMS, available compiler(s):"
1231 $ echo "( ''vms_cc_available')"
1234 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1238 $ rp = "Use which C compiler? [''dflt'] "
1242 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1244 $ IF F$LOCATE("dec",ans).NE.F$LENGTH(ans)
1247 $ Using_Dec_C = "Yes"
1249 $ IF F$LOCATE("vax",ans).NE.F$LENGTH(ans)
1252 $ Using_Vax_C = "Yes"
1256 $ IF F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)
1258 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1260 $ Using_Dec_C = "Yes"
1261 $ IF F$LOCATE("vax",dflt).NE.F$LENGTH(dflt)
1263 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1267 $ IF Mcc .EQS. "cc/decc"
1269 $ Using_Dec_C = "Yes"
1274 $ IF Mcc .EQS. "cc/decc"
1276 $ Using_Dec_C = "Yes"
1278 $ IF Mcc .EQS. "cc/vaxc"
1280 $ Using_Vax_C = "Yes"
1282 $ IF Mcc .EQS. "gcc"
1284 $ Using_Gnu_C = "Yes"
1287 $Decc_Version_check:
1288 $ IF "''Using_Dec_C'".EQS."Yes"
1291 $ echo4 "Checking for Dec C's version number..." !>&4
1292 $ OPEN/WRITE CONFIG deccvers.c
1293 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1294 $ WRITE CONFIG "#include <stdio.h>"
1295 $ WRITE CONFIG "int main() {"
1296 $ WRITE CONFIG "#ifdef __DECC"
1297 $ WRITE CONFIG "#ifdef __DECC_VER"
1298 $ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1299 $ WRITE CONFIG "#else"
1300 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1301 $ WRITE CONFIG "#endif"
1302 $ WRITE CONFIG "#endif"
1303 $ WRITE CONFIG " exit(0);"
1306 $ DEFINE SYS$ERROR _NLA0:
1307 $ DEFINE SYS$OUTPUT _NLA0:
1310 $ DEASSIGN SYS$ERROR _NLA0:
1311 $ DEASSIGN SYS$OUTPUT _NLA0:
1312 $ IF (silent) THEN GOSUB Shut_up
1313 $ DEFINE SYS$ERROR _NLA0:
1314 $ DEFINE SYS$OUTPUT _NLA0:
1317 $ DEASSIGN SYS$ERROR
1318 $ DEASSIGN SYS$OUTPUT
1319 $ IF (silent) THEN GOSUB Shut_up
1320 $ OPEN/WRITE CONFIG deccvers.out
1321 $ DEFINE SYS$ERROR CONFIG
1322 $ DEFINE SYS$OUTPUT CONFIG
1323 $ mcr []deccvers.exe
1326 $ DEASSIGN SYS$OUTPUT
1327 $ DEASSIGN SYS$ERROR
1328 $ IF (silent) THEN GOSUB Shut_up
1329 $ OPEN/READ CONFIG deccvers.out
1330 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1333 $! DELETE/NOLOG/NOCONFIRM deccvers.*;
1334 $ echo "You are using Dec C ''line'"
1335 $ Dec_C_Version = line
1338 $ IF "''Using_Vax_C'".EQS."Yes"
1341 $ echo4 "Checking to see how to invoke Vax C..."
1342 $ OPEN/WRITE CONFIG vaxcchk.c
1343 $ WRITE CONFIG "#include <stdio.h>"
1344 $ WRITE CONFIG "int main() {"
1345 $ WRITE CONFIG " printf(""%i\n"", ""1"");"
1346 $ WRITE CONFIG " exit(0);"
1349 $ DEFINE SYS$ERROR _NLA0:
1350 $ DEFINE SYS$OUTPUT _NLA0:
1352 $ cc/vaxc/NoObj vaxcchk.c
1354 $ DEASSIGN SYS$OUTPUT
1355 $ DEASSIGN SYS$ERROR
1357 $ IF (silent) THEN GOSUB Shut_up
1358 $ IF tmp.NE.%X10B90001
1365 $ DELETE/NOLOG/NOCONFIRM vaxcchk.*;
1368 $ if "''using_gnu_c'" .eqs. "Yes"
1370 $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1371 $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1372 $ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1373 $ IF gcclib_olb .EQS. ""
1375 $! These objects/libs come w/ gcc 2.7.2 for AXP:
1376 $ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1377 $ IF tmp .NES. "" then gcclib_olb = tmp
1378 $ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1381 $ IF gcclib_olb .EQS. ""
1382 $ THEN gcclib_olb = tmp
1383 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1386 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1389 $ IF gcclib_olb .EQS. ""
1390 $ THEN gcclib_olb = tmp
1391 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1394 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1397 $ IF gcclib_olb .EQS. ""
1398 $ THEN gcclib_olb = tmp
1399 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1402 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1404 $ gcclib_olb = gcclib_olb + "/lib"
1406 $ IF gcclib_olb .NES. "" .AND. -
1407 (vaxcrtl_olb .NES. "" .OR. -
1408 vaxcrtl_exe .NES. "" )
1411 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1412 $ OPEN/WRITE CONFIG gccvers.c
1413 $ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1414 $ WRITE CONFIG "#include <stdio.h>"
1415 $ WRITE CONFIG "int main() {"
1416 $ WRITE CONFIG "#ifdef __GNUC__"
1417 $ WRITE CONFIG "#ifdef __VERSION__"
1418 $ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1419 $ WRITE CONFIG "#else"
1420 $ WRITE CONFIG " printf(""%s\n"", ""1"");"
1421 $ WRITE CONFIG "#endif"
1422 $ WRITE CONFIG "#endif"
1423 $ WRITE CONFIG " exit(0);"
1426 $ DEFINE SYS$ERROR _NLA0:
1427 $ DEFINE SYS$OUTPUT _NLA0:
1430 $ DEASSIGN SYS$ERROR _NLA0:
1431 $ DEASSIGN SYS$OUTPUT _NLA0:
1432 $ IF (silent) THEN GOSUB Shut_up
1433 $ DEFINE SYS$ERROR _NLA0:
1434 $ DEFINE SYS$OUTPUT _NLA0:
1435 $ IF vaxcrtl_exe .EQS. ""
1437 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1439 $ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1442 $ link gccvers.obj,'gcclib_olb'
1446 $ OPEN/WRITE CONFIG GCCVERS.OPT
1447 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1449 $ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1452 $ DEASSIGN SYS$ERROR
1453 $ DEASSIGN SYS$OUTPUT
1454 $ IF (silent) THEN GOSUB Shut_up
1455 $ OPEN/WRITE CONFIG gccvers.out
1456 $ DEFINE SYS$ERROR CONFIG
1457 $ DEFINE SYS$OUTPUT CONFIG
1461 $ DEASSIGN SYS$OUTPUT
1462 $ DEASSIGN SYS$ERROR
1463 $ IF (silent) THEN GOSUB Shut_up
1464 $ OPEN/READ CONFIG gccvers.out
1465 $ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1468 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1469 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1471 $ echo "You are not using GNU cc."
1474 $ echo "You are using GNU cc ''line'"
1475 $ Using_Gnu_C = "Yes"
1476 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1484 $ OPEN/READ CONFIG ccvms.lis
1486 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1494 $ line = F$EDIT(line,"TRIM,COMPRESS")
1495 $ line = line - "Page 1" ! occurs at end all compilers
1496 $ line = line - "CCVMS " ! filename appears w/ VAXC
1497 $ line = line - "Source Listing " ! Seen w/ AXP DECC
1498 $ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1500 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1501 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1505 $!: What should the include directory be ?
1507 $ rp = "Where are the include files you want to use? "
1508 $ IF f$length( rp + "[''dflt'] " ).gt.76
1509 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1510 $ ELSE rp = rp + "[''dflt'] "
1515 $!: see if we have to deal with yellow pages, now NIS.
1516 $!: now get the host name
1519 $ echo4 "Figuring out host name..." !>&4
1521 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1522 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1523 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1524 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1525 $ IF myhostname.eqs."".and. -
1526 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1527 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1528 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1529 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1530 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1531 $ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1532 $ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1533 $!: you do not want to know about this
1535 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1537 $ IF (.not.ans).and.(ans.NES."")
1539 $ READ SYS$COMMAND/PROMPT= -
1540 "Please type the (one word) name of your host: " ans
1543 $!: translate upper to lower if necessary
1544 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1545 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1546 $ IF mylowhostname.NES.myhostname
1548 $ echo "(Normalizing case in your host name)"
1549 $ myhostname = mylowhostname
1552 $ fp = F$LOCATE(".",myhostname)
1553 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1554 $ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1556 $ rp = "What is your domain name? [''mydomain'] "
1558 $ IF ans THEN mydomain = ans
1559 $!: translate upper to lower if necessary
1560 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1561 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1562 $ IF mylowdomain.NES.mydomain
1564 $ echo "(Normalizing case in your domain name)"
1565 $ mydomain = mylowdomain
1568 $ myhostname = myhostname - mydomain
1569 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1571 $ THEN TYPE SYS$INPUT:
1573 I need to get your e-mail address in Internet format if possible, i.e.
1574 something like user@host.domain. Please answer accurately since I have
1575 no easy means to double check it. The default value provided below
1576 is most probably close to the reality but may not be valid from outside
1577 your organization...
1579 $ dflt = "''cf_by@''myhostname'"+"''mydomain'"
1580 $ rp = "What is your e-mail address? [''dflt'] "
1583 $ THEN cf_email = ans
1584 $ ELSE cf_email = dflt
1588 $ THEN TYPE SYS$INPUT:
1590 If you or somebody else will be maintaining perl at your site, please
1591 fill in the correct e-mail address here so that they may be contacted
1592 if necessary. Currently, the "perlbug" program included with perl
1593 will send mail to this address in addition to perlbug@perl.com. You may
1594 enter "none" for no administrator.
1596 $ dflt = "''cf_email'"
1597 $ rp = "Perl administrator e-mail address [''dflt'] "
1600 $ THEN perladmin = ans
1601 $ ELSE perladmin = dflt
1604 $!: determine where public executable scripts go
1605 $!: determine perl absolute location
1606 $!: figure out how to guarantee perl startup
1608 $!: see how we invoke the C preprocessor
1610 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1611 $!: Set private lib path
1612 $!: Now check and see which directories actually exist, avoiding duplicates
1613 $!: determine optimize, if desired, or use for debug flag also
1614 $!: We will not override a previous value, but we might want to
1615 $!: augment a hint file
1616 $!: the following weeds options from ccflags that are of no interest to cpp
1617 $!: flags used in final linking phase
1618 $!: Try to guess additional flags to pick up local libraries.
1621 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1622 $!: compute shared library extension
1623 $!: Looking for optional libraries
1624 $!: see if nm is to be used to determine whether a symbol is defined or not
1625 $!: get list of predefined functions in a handy place
1626 $!: see if we have sigaction
1627 $!: see whether socketshr exists
1628 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1630 $ has_socketshr = "T"
1632 $ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1634 $ if (Dec_C_Version .ge. 50200000)
1636 $ Has_Dec_C_Sockets = "T"
1638 $ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1640 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1641 $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1644 $ echo "You've got sockets available. Which socket stack do you want to"
1645 $ echo "build into perl?"
1646 $ if "''has_dec_c_sockets'".eqs."T"
1650 $ dlft = "SOCKETSHR"
1652 $ rp = "Choose socket stack (NONE"
1653 $ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1654 $ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1655 $ rp = rp + ") [''dflt'] "
1657 $ IF "''ans'".eqs."" THEN ans = "''dflt'"
1658 $ has_dec_c_sockets = "F"
1659 $ has_socketshr = "F"
1660 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1661 $ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1662 $ IF ans.eqs."socketshr" then has_socketshr = "T"
1666 $! Ask about threads, if appropriate
1667 $ if (Using_Dec_C.eqs."Yes")
1669 $ echo "This version of Perl can be built with threads. While really nifty,
1670 $ echo "they are a beta feature, and there is a speed penalty for perl
1671 $ echo "programs if you build with threads *even if you don't use them*
1674 $ rp = "Build with threads? [''dflt'] "
1676 $ if ans.eqs."" then ans = dflt
1677 $ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1683 $! Ask if they want to use perl's memory allocator
1685 $ echo "Perl has a built-in memory allocator that's tuned for perl's
1686 $ echo "normal memory usage. It's oftentimes better than the standard
1687 $ echo "system memory allocator. It also has the advantage of providing
1688 $ echo "memory allocation statistics.
1691 $ rp = "Build with perl's memory allocator? [''dflt'] "
1693 $ if ans.eqs."" then ans="''dflt'"
1694 $ mymalloc = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1696 $! Ask for their default list of extensions to build
1698 $ echo "It's time to specify which modules you want to build into
1699 $ echo "perl. Most of these are standard and should be chosen, though
1700 $ echo "you might, for example, want to build GDBM_File instead of
1701 $ echo "SDBM_File if you have the GDBM library built on your machine
1703 $ echo "Which modules do you want to build into perl?"
1704 $ dflt = "Fcntl IO Opcode attrs Stdio DCLsym B SDBM_File"
1705 $ if Using_Dec_C.eqs."Yes"
1707 $ dflt = dflt + " POSIX"
1708 $ if Use_Threads.eqs."T"
1710 $ dflt = dflt + " Thread"
1715 $ if ans.eqs."" then ans = "''dflt'"
1716 $ extensions = "''ans'"
1718 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
1720 $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
1721 $! If the 'build' that you use is not here add it and it's test
1722 $! switch to the _END_ of these strings (and increment max_build)
1723 $! (e.g. builders = builders + "/FOOMAKE"
1724 $! probers = probers + " -fooVersionSwitch"
1725 $! ) & please let me know about it.
1726 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
1727 $ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
1733 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
1734 $ WRITE CONFIG "dont_make_anything_yet:"
1735 $ WRITE CONFIG F$FAO("!_")
1738 $ messages = F$ENVIRONMENT("MESSAGE")
1740 $ build = F$ELEMENT(n,"/",builders)
1741 $ probe = F$ELEMENT(n,"!",probers)
1742 $ echo "Testing whether you have ''build' on your system..."
1743 $ SET NOON !sorry :-(
1744 $ ON CONTROL_Y THEN GOTO Reenable_messages_build !sorry :-(
1745 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
1747 $ IF ($SEVERITY .EQ. 1)
1750 $ IF (build .EQS. orig_dflt)
1752 $ default_set = "TRUE"
1755 $ ok_builders = ok_builders + " " + build
1756 $ IF (.NOT. default_set) THEN dflt = build
1760 $Reenable_messages_build: !hope you made it here :-)
1761 $ SET MESSAGE 'messages' !hope you made it here :-)
1762 $ SET ON !hope you made it here :-)
1764 $ IF (n .LT. max_build) THEN GOTO Build_probe
1767 $ IF (ok_builders .NES. "")
1769 $ echo "Here is the list of builders you can apparently use:"
1770 $ echo "(",ok_builders," )"
1771 $ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
1773 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
1774 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1782 %Config-E-VMS, ERROR:
1783 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
1784 utility of some sort and after checking my "builders" list I cannot find
1785 the symbol or command you use on your system to compile programs.
1787 $ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
1788 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
1789 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1792 $ echo "I don't know where 'make' is, and my life depends on it."
1793 $ echo "Go find a make program or fix your DCL$PATH setting!"
1794 $ echo "ABORTING..."
1795 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1797 $ EXIT 2 !$STATUS = "%X00000002" (error)
1803 $ DELETE/NOLOG Makefile.;
1808 There seems to be trouble. I just tried to create a file in
1809 $ echo4 'F$ENVIRONMENT("DEFAULT")'
1811 but was unsuccessful. I am stopping now. Please check that directories'
1812 PROTECTION bits. I will leave you in the directory where you started
1814 $ echo4 "ABORTING..."
1820 $! echo " Very well I will proceed with ""''build'"""
1821 $ make = F$EDIT(build,"UPCASE")
1823 $!: locate the preferred pager for this system
1824 $!pagers = "most|more|less|type/page"
1825 $!rp='What pager is used on your system?'
1827 $! update [.vms]config.vms here
1829 $! update makefile here
1830 $! echo4 "Updating makefile..."
1832 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
1834 $ makefile = "" !wrt MANIFEST dir
1835 $ UUmakefile = "DESCRIP.MMS" !wrt CWD dir
1836 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
1838 $ makefile = " -f [.VMS]Makefile." !wrt MANIFEST dir
1839 $ UUmakefile = "[-.VMS]Makefile." !wrt CWD dir
1840 $ DEFmakefile = "[-.VMS]Makefile." !wrt DEF dir (?)
1845 $ tmp = F$LENGTH(macros)
1846 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
1847 $ macros = "/macro=(" + macros + ")"
1850 $! Invoke the subconfig piece
1853 $ echo4 "Generating config.h"
1854 $ dflt = F$ENVIRONMENT("DEFAULT")
1855 $ SET DEFAULT [-.vms]
1859 $! %Config-I-VMS, write perl_setup.com here
1862 $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
1863 $ file_2_find = "[-.vms]perl_setup.com"
1864 $ OPEN/WRITE CONFIG 'file_2_find'
1866 $ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
1867 $ IF cf_email.NES.perladmin
1869 $ WRITE CONFIG "$! perl configured by ''cf_email'"
1871 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
1874 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
1875 prefix = prefix - "]" + ".]"
1876 $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
1877 $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl"
1878 $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr.Exe"
1881 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
1882 $ ELSE !leave in but commented out (in case setting was from perl :-)
1883 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
1886 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
1888 $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
1892 $ echo "%Config-I-VMS, The file can be found at:"
1893 $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
1894 $ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
1895 $ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
1896 $ echo "-Config-I-VMS, testing, and installation of your perl."
1899 $!figure out where we "are" by parsing 'vms_default_directory_name'
1901 $ set_def_command = ""
1902 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
1903 $ tmp = vms_default_directory_name - dflt - "]"
1905 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
1907 $ tmp1 = F$ELEMENT(i,".",tmp)
1908 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
1910 $ THEN set_def_command = "set default [-"
1911 $ ELSE set_def_command = set_def_command + "-"
1915 $Beyond_set_def_loop:
1916 $ IF set_def_command.NES.""
1918 $ set_def_command = set_def_command - "-" + "]"
1920 $ echo4 "In order to build ''package' you must now issue the commands:"
1922 $ echo4 " ''set_def_command'"
1925 $ echo4 "In order to build ''package' you must now issue the command:"
1928 $ echo4 " ''make'''makefile'", macros
1934 $ DEASSIGN SYS$OUTPUT
1935 $! DEASSIGN SYS$ERROR
1937 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
1938 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt
1939 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
1941 $ dflt = F$ENVIRONMENT("DEFAULT")
1942 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
1944 $ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
1946 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
1947 $ DELETE/NOLOG/NOCONFIRM UU.DIR;
1949 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1952 $!: End of Configure