freebsd-dev/contrib/perl5/configure.com

2034 lines
64 KiB
Plaintext

$ sav_ver = 'F$VERIFY(0)'
$! SET VERIFY
$!
$! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will
$! want to cd into the tree and execute Configure:
$!
$! $ SET DEFAULT [USER.PERL5_00n]
$! $ @Configure
$!
$! or
$!
$! $ SET DEFAULT [USER.PERL5_00n]
$! $ @Configure "-des"
$!
$! That's it. If you get into a bind trying to build perl on VMS then
$! definitely read through the README.VMS file.
$! Beyond that send email to VMSPerl@cor.newman.upenn.edu
$!
$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$!
$! send suggestions to:
$! Dan Sugalski <sugalskd@ous.edu>
$! Thank you!!!!
$!
$! Adapted and converted from Larry Wall & Andy Dougherty's
$! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
$! (a Bourne sh[ell] script for configuring the installation of perl on VMS)
$! in the perl5.002|3 epoch (spring/summer 1996)
$! with much valuable help from Charles Bailey &
$! the whole VMSPerl crew.
$! Extended and messed about with by Dan Sugalski
$!
$! SET NOVERIFY
$ sav_ver = F$VERIFY(sav_ver)
$!
$! VMS-isms we will need:
$ echo = "write sys$output "
$ cat = "type"
$ gcc_symbol = "gcc"
$ ans = ""
$ macros = ""
$ use_debugging_perl = "Y"
$ C_Compiler_Replace = "CC="
$ Thread_Live_Dangerously = "MT="
$ use_two_pot_malloc = "N"
$ use_pack_malloc = "N"
$ use_debugmalloc = "N"
$ preload_env = "N"
$ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
$! max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_00n] not [A.B.C.PERL5_00n]
$ max_allowed_dir_depth = 2 ! e.g. [FOO.PERL5_00n] not [FOO.BAR.PERL5_00n]
$!
$ vms_filcnt = F$GETJPI ("","FILCNT")
$!
$!: compute my invocation name
$ me = F$ENVIRONMENT("PROCEDURE")
$!
$! Many null statements (begin with colon ':') in the Bourne shell version of
$! this script serve as comments/placeholders. I have retained some of the ones
$! that will help you compare this .COM file to the sh version - as well as
$! leave placeholders for future improvements to this .COM file.
$! sfn = VMS "skipped for now"
$!
$!: Proper PATH separator !sfn
$!: Proper PATH setting !sfn
$!: Sanity checks !sfn "Say '@''$me''"
$!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
$!: Configure runs within the UU subdirectory !->after find MANIFEST
$! <big long list of default values (mostly null)>
$!: We must find out about Eunice early !(?)
$!: list of known cpp symbols, sorted alphabetically !sfn
$! al = al + "..."
$!: default library list !sfn
$! <no hints files in use (yet?)>
$!: Extra object files, if any, needed on this platform. !sfn
$!: Possible local include directories to search. !sfn
$!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
$!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
$!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
$!: no include file wanted by default !sfn
$!inclwanted='' !sfn
$!: Possible local library directories to search. !sfn
$!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
$!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
$!: general looking path for locating libraries !sfn
$!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
$!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
$!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
$!: Private path used by Configure to find libraries. Its value !sfn
$!: is prepended to libpth. This variable takes care of special !sfn
$!: machines, like the mips. Usually, it should be empty. !sfn
$!plibpth='' !sfn
$!: full support for void wanted by default !sfn
$!defvoidused=15 !sfn
$!: List of libraries we want. !sfn
$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
$!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
$!libswanted="$libswanted ucb bsd BSD PW x" !sfn
$!: We probably want to search /usr/shlib before most other libraries. !sfn
$!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
$!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
$!glibpth="/usr/shlib $glibpth" !sfn
$!: Do not use vfork unless overridden by a hint file. !sfn
$!usevfork=false !sfn
$!: script used to extract .SH files with variable substitutions !sfn
$!: produce awk script to parse command line options !sfn
$!sfn (assume no sed awk) see below
$!: process the command line options
$!
$!: set up default values
$ fastread=""
$ reuseval="false"
$ config_sh=""
$ alldone=""
$ error=""
$ silent=""
$ extractsh=""
$ override=""
$ knowitall=""
$ Using_Dec_C = ""
$ Using_Vax_C = ""
$ Using_Gnu_C = ""
$ Dec_C_Version = ""
$ use_threads = "F"
$!
$!: option parsing
$ IF (P1 .NES. "")
$ THEN !one or more switches was thrown
$ i = 1
$ bang = 0
$Param_loop:
$ IF (P'i'.NES."") THEN bang = bang + 1
$ i = i + 1
$ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
$!
$ i = 1
$Opt_loop:
$ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
$ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
$Remove_quotation_mark:
$ P'i' = P'i' - """"
$ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
$ gotopt = "f" !"alse"
$ gotshortopt = "f" !"alse"
$ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
$ THEN
$ fastread = "yes"
$ gotopt = "t" !"rue"
$ P'i' = P'i' - "d"
$ gotshortopt = "t" !"rue"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
$ THEN
$ alldone = "cont"
$ gotopt = "t"
$ P'i' = P'i' - "e"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
$ THEN
$ P'i' = P'i' - "f"
$ config_sh = P'i'
$ IF (F$SEARCH(config_sh).NES."")
$ THEN
$ test = F$FILE_ATTRIBUTES(config_sh,"PRO")
$ IF (F$LOCATE("R",test).NE.F$LENGTH(test))
$ THEN
$ CONTINUE !at this point check UIC && if test allows...
$ !to be continued ?
$ ELSE
$ echo "''me': cannot read config file ''config_sh'."
$ error="true"
$ ENDIF
$ ELSE
$ echo "''me': cannot read config file ''config_sh'."
$ error="true"
$ ENDIF
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
$ THEN
$ error = "true"
$ gotopt = "t"
$ P'i' = P'i' - "h"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
$ THEN
$ reuseval = "true"
$ gotopt = "t"
$ P'i' = P'i' - "r"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
$ THEN
$ silent = "true"
$ gotopt = "t"
$ P'i' = P'i' - "s"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
$ THEN
$ alldone = "exit"
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
$ THEN
$ knowitall = "true"
$ gotopt = "t"
$ P'i' = P'i' - "K"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
$ THEN
$ override = "true"
$ gotopt = "t"
$ P'i' = P'i' - "O"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
$ THEN
$ extractsh = "true" !VMS?
$ gotopt = "t"
$ P'i' = P'i' - "S"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
$ THEN
$ P'i' = P'i' - "D"
$!Hmm.. this part needs work
$! P'i'
$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
$ THEN
$ P'i' = "define"
$ ELSE
$ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
$ echo "''me': ignoring -D",P'i'
$ ELSE
$!Hmm.. this part needs work
$! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
$! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
$ ENDIF
$ ENDIF
$ ECHO "P''i' =>",P'i',"<=" !Diag
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
$ THEN
$ P'i' = P'i' - "U"
$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
$ THEN
$ P'i' = ""
$ ELSE
$ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
$ echo "''me': ignoring -U",P'i'
$ ELSE
$ P'i' = "undef"
$ ENDIF
$ ENDIF
$ ECHO "P''i' =>",P'i',"<=" !Diag
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me' generated by an unknown version of EDT."
$ STOP
$ EXIT !0
$ ENDIF
$ IF .NOT.gotopt
$ THEN
$ echo "''me': unknown option ",P'i'
$ error = "true"
$ ENDIF
$ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
$ i = i + 1
$ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
$!
$ ENDIF ! (P1 .NES. "")
$!
$ IF (error)
$ THEN
$ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
$ echo "Usage: @''me' [-dehrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
$ echo " [-Usymbol] [-Usymbol=]"
$ TYPE SYS$INPUT
"-d" : use defaults for all answers.
"-e" : go on without questioning past the production of config.sh. *
"-f" : specify an alternate default configuration file.
"-h" : print this help message and exit (with an error status).
"-r" : reuse C symbols value if possible (skips costly nm extraction).*
"-s" : silent mode, only echoes questions and essential information.
-"D" : define symbol to have some value: *
-"Dsymbol" symbol gets the value 'define'
-"Dsymbol=value" symbol gets the value 'value'
-E : stop at the end of questions, after having produced config.sh. *
-K : do not use unless you know what you are doing.
-O : let -D and -U override definitions from loaded configuration file. *
-S : perform variable substitutions on all .SH files (can mix with -f) *
-"U" : undefine symbol: *
-"Usymbol" symbol gets the value 'undef'
-"Usymbol=" symbol gets completely empty
-V : print version number and exit (with a zero status).
$ echo "%Config-I-VMS, lower case switches must be enclosed"
$ echo "-Config-I-VMS, in double quotation marks, e.g.:"
$ echo "-Config-I-VMS, @Configure ""-des"""
$ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT 3 ! $STATUS = "%X00000003" (informational)
$ ENDIF
$!
$ GOTO Check_silence
$!
$Shut_up:
$ STDOUT = F$TRNLNM("SYS$OUTPUT")
$ DEFINE SYS$OUTPUT "_NLA0:"
$ echo4 = "write STDOUT "
$ cat4 = "TYPE/OUTPUT=''STDOUT'"
$ open/write STDOUT 'STDOUT'
$ RETURN
$!
$Check_silence:
$ IF (silent)
$ THEN
$ GOSUB Shut_up
$ ELSE
$ echo4 = "write SYS$OUTPUT "
$ cat4 = "TYPE"
$ ENDIF
$!
$!: run the defines and the undefines, if any, but leave the file out there...
$! Unfortunately Configure.COM in DCL is not yet set up to do this -
$! maybe someday
$!
$!: set package name
$ package = "perl5"
$!
$!: Eunice requires " " instead of "", can you believe it
$ echo ""
$!: Here we go...
$ echo "Beginning of configuration questions for ''package'."
$ echo ""
$!
$!: Some greps do not return status, grrr.
$ contains = "SEARCH"
$!
$!: first determine how to suppress newline on echo command !cant DCL is record oriented
$! echo "Checking ''echo' to see how to suppress newlines..."
$! echo "giving up..."
$! echo "The star should be here-->*"
$!
$!: Now test for existence of everything in MANIFEST
$ echo ""
$ echo4 "First let's make sure your kit is complete. Checking..."
$ manifestfound = ""
$ miss_list = ""
$! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
$! because the search routine simply does set def [-] if necessary.
$ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
$Research_manifest:
$ manifestfound = F$SEARCH(file_2_find)
$ IF (manifestfound .EQS. "")
$ THEN
$ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
$ THEN
$ SET DEFAULT [-]
$ GOTO Research_manifest
$ ELSE
$ echo ""
$ echo "There is no MANIFEST file. I hope your kit is complete !"
$ miss_list = ""
$ GOTO Beyond_manifest
$ ENDIF
$ ELSE
$! MANIFEST. has been found and we have set def'ed there -
$! time to bail out before it's too late.
$ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
$ IF tmp .GES. "7.2" THEN GOTO Beyond_depth_check
$ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
$ THEN
$ TYPE SYS$INPUT:
%Config-E-VMS, ERROR:
Sorry! It apears as though your perl build sub-directory is already too
deep into the VMS file system. Please try moving stuff into a shallower
directory (or altering the "max_allowed_dir_depth" parameter).
$ echo4 "ABORTING..."
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT !2 !$STATUS = "%X00000002" (error)
$ ENDIF
$Beyond_depth_check:
$!
$! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
$!
$ IF (manifestfound .NES. "")
$ THEN
$ IF ( F$SEARCH("UU.DIR").EQS."" )
$ THEN
$ CREATE/DIRECTORY [.UU]
$ ELSE
$ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
$ ENDIF
$!: Configure runs within the UU subdirectory
$ SET DEFAULT [.UU]
$!
$! a little redundancy never hurt anybody?
$ file_2_find = "[-]" + file_2_find
$ manifestfound = F$SEARCH(file_2_find)
$!
$ OPEN/WRITE MISSING MISSING.
$!change to "FALSE" if you wish to skip the manifest search
$!(which after all is rather slow in DCL :-)
$ IF ("TRUE")
$ THEN
$ OPEN/READ CONFIG 'manifestfound'
$Read_loop_manifest:
$ READ/END_OF_FILE = Done_manifest CONFIG line
$! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
$! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
$! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
$! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
$ line = F$EDIT(line,"TRIM, COMPRESS")
$ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
$ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
$ THEN
$Re_strip_line_manifest:
$ loca = F$LOCATE("/",file_2_find)
$ ante = F$EXTRACT(0,loca,file_2_find)
$ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
$ test_this = ante + "." + (post - "/")
$ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
$ THEN
$ file_2_find = ante + "." + (post - "/")
$ GOTO Re_strip_line_manifest
$ ELSE
$ file_2_find = ante + "]" + (post - "/")
$ ENDIF
$ file_2_find = "[-."+file_2_find
$ ELSE
$ file_2_find = "[-]" + file_2_find
$ ENDIF
$!
$ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
$ file_2_find = file_2_find - dirname
$ dots = 0
$Dot_loop:
$ dot_ele = F$ELEMENT(dots,".",file_2_find)
$ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
$ IF dots .eq. 0
$ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
$ ELSE basename = basename + dot_ele + "_"
$ ENDIF
$ dots = dots + 1
$ GOTO dot_loop
$Eo_dot_loop:
$ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
(f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
basename = f$extract(0,f$length(basename)-1,basename)
$ file_2_find = dirname + basename
$!
$ found = F$SEARCH(file_2_find)
$ IF (found .EQS. "")
$ THEN
$ WRITE MISSING file_2_find
$ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
$ THEN
$ miss_list = miss_list + "," + file_2_find
$ ENDIF
$ ENDIF
$ GOTO Read_loop_manifest
$Done_manifest:
$ CLOSE CONFIG
$ ENDIF !"TRUE"
$ CLOSE MISSING
$ ENDIF ! (manifestfound .NES. "")
$Beyond_manifest:
$ IF (miss_list .NES. "")
$ THEN
$ echo "Some of the files not found include:"
$ cat4 MISSING.
$ ENDIF
$ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
$ THEN
$ TYPE SYS$INPUT:
THIS PACKAGE SEEMS TO BE INCOMPLETE.
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
and contact the author (sugalskd@ous.edu).
$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
$ IF ans
$ THEN
$ echo4 "Continuing..."
$ ELSE
$ echo4 "ABORTING..."
$ GOTO Clean_up
$ ENDIF
$ ELSE
$ echo4 "Looks good..."
$ DELETE/NOLOG MISSING.;
$ ENDIF ! (miss_list .NES. "")
$ ENDIF ! (manifestfound .EQS. "") ELSE
$!
$! after finding MANIFEST (see above)
$!: Configure runs within the UU subdirectory
$!
$!: compute the number of columns on the terminal for proper question formatting
$! (sfn, will assume 80-ish)
$!
$!: set up the echo used in my read !sfn
$!: now set up to do reads with possible shell escape and default assignment !sfn
$ GOTO Beyond_myread
$!
$myread:
$ ans = ""
$ If (fastread)
$ Then
$ echo4 "''rp'"
$ Else
$ If (silent)
$ Then
$ READ SYS$COMMAND/PROMPT="''rp'" ans
$ Else
$ echo ""
$ READ SYS$COMMAND/PROMPT="''rp'" ans
$ Endif
$ Endif
$ RETURN
$!
$Beyond_myread:
$!
$!: create .config dir to save info across Configure sessions
$ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
$ THEN
$ CREATE/DIRECTORY [-.CONFIG]
$ OPEN/WRITE CONFIG [-.CONFIG]README.
$ WRITE CONFIG -
"This directory created by Configure to save information that should"
$ WRITE CONFIG -
"persist across sessions."
$ WRITE CONFIG ""
$ WRITE CONFIG -
"You may safely delete it if you wish."
$ CLOSE CONFIG
$ ENDIF
$!
$!: general instructions
$ needman = "true"
$ firsttime = "true"
$ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
$ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
$ THEN
$ messages = F$ENVIRONMENT("MESSAGE")
$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
$ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
$ IF .NOT.($status.EQ.%X08D78053)
$ THEN
$ firsttime=""
$ dflt = "n"
$ rp = "Would you like to see the instructions? [''dflt'] "
$ GOSUB myread
$ if .NOT.ans THEN needman=""
$ ENDIF
$ SET MESSAGE 'messages' !hope you made it here :-)
$ ENDIF
$ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
$!
$ IF (needman)
$ THEN
$ TYPE SYS$INPUT:
This installation shell script will examine your system and ask you questions
to determine how the perl5 package should be installed. If you get
stuck on a question, you may use a ^C or ^Y shell escape to STOP this
process, edit something, then restart this process as you just did.
Many of the questions will have default answers in square
brackets; typing carriage return will give you the default.
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ TYPE SYS$INPUT:
In a hurry? You may run '@Configure -d'. This will bypass nearly all
the questions and use the computed defaults (or the previous answers provided
there was already a config.sh file). Type '@Configure -h' for a list of
options.
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ TYPE SYS$INPUT:
Much effort has been expended to ensure that this shell script will
run on any VMS system. If despite that it blows up on yours, your
best bet is to edit Configure.com and @ it again. Whatever problems
you have with Configure.com, let me (sugalskd@ous.edu) know how I blew
it.
$!This installation script affects things in two ways:
$!
$!1) it may do direct variable substitutions on some of the files included
$! in this kit.
$!2) it builds a config.h file for inclusion in C programs. You may edit
$! any of these files as the need arises after running this script.
$!
$!If you make a mistake on a question, there is no easy way to back up to it
$!currently.
$!
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
$ THEN
$ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
$ WRITE CONFIG user
$ CLOSE CONFIG
$ ENDIF
$ ENDIF !(needman .EQS. "true")
$!
$!: see if sh knows # comments !sfn
$ sharpbang = "$ "
$!: figure out how to guarantee sh startup !sfn
$!: find out where common programs are !sfn
$!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
$!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
$! echo "I don't know where '$file' is, and my life depends on it."
$! echo "Go find a public domain implementation or fix your PATH setting!"
$! echo ""
$! echo "Don't worry if any of the following aren't found..."
$!: determine whether symbolic links are supported !sfn
$!: see whether [:lower:] and [:upper:] are supported character classes !sfn
$!: set up the translation script tr, must be called with ./tr of course !sfn
$!
$!: Try to determine whether config.sh was made on this system
$!: Get old answers from old config file if Configure was run on the
$!: same system, otherwise use the hints.
$ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
$ i = 0
$ max = 3
$Config_sh_look:
$ config_sh = F$ELEMENT(i,"/",config_sh_es)
$ i = i + 1
$ IF (config_sh.NES."/").AND.(config_sh.NES."")
$ THEN
$ configshfound = F$SEARCH(config_sh)
$ IF (configshfound.NES."") THEN GOTO Config_sh_found
$ ENDIF
$ IF (i.LT.max) THEN GOTO Config_sh_look
$ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
$Config_sh_found:
$ echo ""
$ echo "Fetching default answers from ''config_sh'..."
$!we actually do not have "hints/" for VMS
$! TYPE SYS$INPUT:
$!
$!First time through, eh? I have some defaults handy for the following systems:
$!
$! echo " ","VMS_VAX"
$! echo " ","VMS_AXP"
$! : Now look for a hint file osname_osvers, unless one has been
$! : specified already.
$! TYPE SYS$INPUT:
$!
$!You may give one or more space-separated answers, or "none" if appropriate.
$!If your OS version has no hints, DO NOT give a wrong version -- say "none".
$!
$! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
$!
$Beyond_config_sh:
$!
$!: Restore computed paths !sfn
$!
$! genconfig.pl has "osname='VMS'"
$ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
$! %Config-I-VMS, a necessary error trap (could be PC running VCL)
$!
$ IF (osname .NES. "VMS")
$ THEN
$ echo4 "Hmm.. I wonder what ''osname' is (?)"
$ TYPE SYS$INPUT:
%Config-E-VMS, ERROR:
Err, you do not appear to be running VMS!
This package is intended to Configure the building of Perl for VMS.
$ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
$ IF ans
$ THEN
$ echo4 "Continuing..."
$ ELSE
$ echo4 "ABORTING..."
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT 2 !$STATUS = "%X00000002" (error)
$ ENDIF
$ ELSE !we are on VMS huzzah!
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
Configure uses the operating system name and version to set some defaults.
The default value is probably right if the name rings a bell. Otherwise,
since spelling matters for me, either accept the default or answer "none"
to leave it blank.
$ ENDIF
$ rp = "Operating system name? [''osname'] "
$ GOSUB myread
$ IF ans.nes.""
$ THEN
$ IF (ans.NES.osname) !.AND.knowitall
$ THEN
$ echo4 "I'll go with ''osname' anyway..."
$ ENDIF
$ ENDIF
$ ENDIF !(osname .NES./.EQS. "VMS")
$!
$!: who configured the system
$! see 'user' above.
$ cf_by = F$EDIT(user,"LOWERCASE")
$! cf_time = F$CVTIME() !superceded by procedure below
$ osvers = F$GETSYI("VERSION")
$!
$! Peter Prymmer has seen:
$! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
$! "SYS$TIME_ZONE" = "EDT"
$!
$! Charles Lane recommended:
$! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
$! "NEWS_TIMEZONE" = "-0500"
$! "ST_TIMEZONE" = "EDT"
$! "JAN_TIME_ZONE" = "EST "
$! "MULTINET_TIMEZONE" = "EST"
$! "DAYLIGHT_SAVINGS" = "1"
$!
$! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
$! "PMDF_Timezone"
$! "Multinet_Timezone"
$! "TCPware_Timezone"
$! "WIN$Time_Zone"
$!
$! This snippet o' DCL returns a string in default Unix `date` format,
$! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
$! Peter Prymmer pvhp@lns62.lns.cornell.edu
$!
$ MIN_TZO = -840 !units are minutes here
$ MAX_TZO = 840
$!
$ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
$ monn = F$CVTIME(,,"MONTH")
$ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
$ hour = F$CVTIME(,,"HOUR")
$ min = F$CVTIME(,,"MINUTE")
$ sec = F$CVTIME(,,"SECOND")
$ year = F$CVTIME(,,"YEAR")
$!
$ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
$ i = 0
$Mon_loop:
$ i = i + 1
$ mon = F$ELEMENT(i,"/",months)
$ IF i.LT.monn THEN GOTO Mon_loop
$!
$ tzneedset = "t"
$ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
$ IF systz.NES.""
$ THEN
$ tzhour = F$INTEGER(systz)/3600
$ tzmins = F$INTEGER(systz)/60
$ tzminrem = tzmins - tzhour*60
$ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
$ IF tzhour.ge.0
$ THEN signothetime = "+"
$ IF tzhour.EQ.0.AND.tzminrem.EQ.0
$ THEN direction = "on GMT/"
$ ELSE direction = "east of "
$ ENDIF
$ ELSE signothetime = "-"
$ tzhour = -1*tzhour !keeps !UL happy
$ direction = "west of "
$ ENDIF
$ echo ""
$ echo "%Config-I-VMS,"
$ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
$ IF tzminrem.ne.0
$ THEN
$ tzspan = "''tzhour' hours & ''tzminrem' minutes"
$ ELSE
$ tzspan = "''tzhour' hours"
$ ENDIF
$ dflt = "y"
$ echo "Your system is ''tzspan' ''direction'UTC in England."
$ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
$ GOSUB myread
$ IF ans.OR.(ans.EQS."")
$ THEN
$ tzneedset = "f"
$ tzd = systz
$ GOTO Beyond_TimeZone
$ ENDIF
$ ELSE
$ echo ""
$ echo4 "%Config-I-VMS,"
$ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
$ ENDIF
$!
$TZSet:
$ echo ""
$ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
$ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
$ echo "Eastern Daylight Time (summer) is -4:00 offset."
$ dflt = "0:00"
$ rp = "Enter the Time Zone offset: [''dflt'] "
$ GOSUB myread
$ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
$ IF ans.EQS."" THEN ans = dflt
$ tzhour = F$ELEMENT(0,":","''ans'") !first
$ IF tzhour.EQS."" THEN tzhour = 0
$ tzhour = F$INTEGER(tzhour)
$ tzminrem = F$ELEMENT(1,":","''ans'") !second
$ IF tzminrem.NES.""
$ THEN
$ tzminrem = F$INTEGER(tzminrem)
$ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
$ ELSE
$ tzminrem = 0
$ ENDIF
$ tzmins = tzhour*60 + tzminrem
$ tzd = F$STRING(tzmins*60)
$ IF tzhour .GE. 0
$ THEN
$ signothetime = "+"
$ ELSE
$ tzhour = -1*tzhour !keeps !UL happy
$ signothetime = "-"
$ ENDIF
$ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
$ THEN
$ echo ""
$ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
$ goto TZSet
$ ENDIF
$!
$Beyond_TimeZone:
$ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
$ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
$!
$!: determine the architecture name
$! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
$!
$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
$ THEN
$ archname = "VMS_VAX"
$ ELSE
$ archname = "VMS_AXP"
$ ENDIF
$ rp = "What is your architecture name? [''archname'] "
$ GOSUB myread
$ IF ans.NES.""
$ THEN
$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
$ IF (ans.NES.archname) !.AND.knowitall
$ THEN
$ echo4 "I'll go with ''archname' anyway..."
$ ENDIF
$ ENDIF
$ IF (archname.EQS."VMS_AXP")
$ THEN
$ dflt = "n"
$ rp = "Are you sharing your PERL_ROOT with a VAX? [''dflt'] "
$ GOSUB myread
$ if ans.NES.""
$ THEN
$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
$ ENDIF
$ IF (ans.NES."Y")
$ THEN
$ sharedperl = "N"
$ ELSE
$ sharedperl = "Y"
$ macros = macros + """AXE=1"","
$ ENDIF
$ ELSE
$ sharedperl = "N"
$ ENDIF
$!
$!: is AFS running? !sfn
$!: decide how portable to be. Allow command line overrides. !sfn
$!: set up shell script to do ~ expansion !sfn
$!: expand filename !sfn
$!: now set up to get a file name !sfn
$!
$ vms_skip_install = "true"
$ dflt = "y"
$! echo ""
$ rp = "%Config-I-VMS, Do you wish to skip the """"where install"""" questions? [''dflt'] "
$ GOSUB myread
$ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
$ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
$ prefix = f$parse(prefix,,,,"NO_CONCEAL") - "][" - ".;"
$ prefix = prefix - "]" + ".]"
$ IF (.NOT.vms_skip_install)
$ THEN
$!: determine root of directory hierarchy where package will be installed.
$ dflt = "default"
$ IF .NOT.silent
$ THEN
$ echo ""
$ echo "By default, ''package' will be installed in ''dflt'/bin, manual"
$ echo "pages under ''dflt'/man, etc..., i.e. with ''dflt' as prefix for"
$ echo "all installation directories. Typically set to /usr/local, but you"
$ echo "may choose /usr if you wish to install ''package' among your system
$ ENDIF
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
binaries. If you wish to have binaries under /bin but manual pages
under /usr/local/man, that's ok: you will be prompted separately
for each of the installation directories, the prefix being only used
to set the defaults.
$ ENDIF
$ dflt = prefix
$ rp = "Installation prefix to use? [ ''dflt' ] "
$ GOSUB myread
$ IF ans.NES.""
$ THEN
$ prefix = ans
$ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
$ ELSE
$ prefix = dflt
$ ENDIF
$!
$!: set the prefixit variable, to compute a suitable default value
$!
$!: determine where private library files go
$!: Usual default is /usr/local/lib/perl5. Also allow things like
$!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
There are some auxiliary files for perl5 that need to be put into a
private library directory that is accessible by everyone.
$ ENDIF
$ dflt = prefix - ".]" + ".LIB]"
$ rp = "Pathname where the private library files will reside? "
$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
$ GOSUB myread
$ IF ans.NES.""
$ THEN privlib = ans
$ ELSE privlib = dflt
$ ENDIF
$!
$ ENDIF !%Config-I-VMS, skip "where install" questions
$!
$!: set the base revision
$ baserev="5.0"
$!: get the patchlevel
$ echo ""
$ echo4 "Getting the current patchlevel..." !>&4
$ patchlevel_h = F$SEARCH("[-]patchlevel.h")
$ IF (patchlevel_h.NES."")
$ THEN
$ got_patch = "false"
$ got_sub = "false"
$ OPEN/READONLY CONFIG 'patchlevel_h'
$Patchlevel_h_loop:
$ READ/END_Of_File=Close_patch CONFIG line
$ IF ((F$LOCATE("#define PATCHLEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
$ THEN
$ line = F$EDIT(line,"COMPRESS, TRIM")
$ patchlevel = F$EXTRACT(18,F$LENGTH(line)-18,line)
$ got_patch = "true"
$ ENDIF
$ IF ((F$LOCATE("SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
$ THEN
$ line = F$EDIT(line,"COMPRESS, TRIM")
$ subversion = F$EXTRACT(18,F$LENGTH(line)-18,line)
$ got_sub = "true"
$ ENDIF
$ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
$Close_patch:
$ CLOSE CONFIG
$ ELSE
$ patchlevel="0"
$ subversion="0"
$ ENDIF
$ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
$! This whole thing needs replacing w/ F$FAO() calls:
$ patchlevel = F$INTEGER(patchlevel)
$ IF patchlevel.LT.10
$ THEN patchlevel = "00" + F$STRING(patchlevel)
$ ELSE patchlevel = "0" + F$STRING(patchlevel)
$ ENDIF
$ subversion = F$INTEGER(subversion)
$ IF subversion.GT.0
$ THEN
$ IF subversion.LT.10
$ THEN subversion = "0" + F$STRING(subversion)
$ ELSE subversion = F$STRING(subversion)
$ ENDIF
$ ELSE subversion = ""
$ ENDIF
$!
$ version = F$EXTRACT(0,1,baserev) + "_" + patchlevel + subversion
$!
$ IF (.NOT.vms_skip_install)
$ THEN
$!: set the prefixup variable, to restore leading tilda escape !sfn
$!: set the prefixup variable, to restore leading tilde escape !sfn
$!
$!: determine where public architecture dependent libraries go
$ IF (.NOT.silent)
$ THEN
$ echo ""
$ echo "''package' contains architecture-dependent library files. If you are"
$ ENDIF
$ IF (.NOT.silent)
$ THEN TYPE SYS$INPUT:
sharing libraries in a heterogeneous environment, you might store
these files in a separate location. Otherwise, you can just include
them with the rest of the public library files.
$ ENDIF
$ dflt = privlib - "]" + "." + archname + "." + version + "]"
$ rp = "Where do you want to put the public architecture-dependent libraries? "
$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
$ GOSUB myread
$ IF ans.NES.""
$ THEN archlib = ans
$ ELSE archlib = dflt
$ ENDIF
$!
$!: set up the script used to warn in case of inconsistency !sfn
$!: function used to set $1 to $val !sfn
$!
$ ENDIF !%Config-I-VMS, skip "where install" questions
$! This quotation from Configure has to be included on VMS:
$ TYPE SYS$INPUT:
There is, however, a strange, musty smell in the air that reminds me of
something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
$ CONTINUE
$ IF (.NOT.vms_skip_install)
$ THEN
$!: it so happens the Eunice I know will not run shell scripts in Unix format
$!
$!: see if setuid scripts can be secure !sfn
$!: now see if they want to do setuid emulation !sfn
$!
$!: determine where site specific libraries go.
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
The installation process will also create a directory for
site-specific extensions and modules. Some users find it convenient
to place all local files in this directory rather than in the main
distribution directory.
$ ENDIF
$ dflt = privlib - "]" + ".SITE_PERL]"
$ rp = "Pathname for the site-specific library files? "
$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
$ GOSUB myread
$ IF ans.NES.""
$ THEN sitelib = ans
$ ELSE sitelib = dflt
$ ENDIF
$!
$!: determine where site specific architecture-dependent libraries go.
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
The installation process will also create a directory for
architecture-dependent site-specific extensions and modules.
$ ENDIF
$ dflt = sitelib - "]" + "." + archname + "]"
$ rp = "Pathname for the site-specific architecture-dependent library files? "
$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
$ GOSUB myread
$ IF ans.NES.""
$ THEN sitearch = ans
$ ELSE sitearch = dflt
$ ENDIF
$!
$!: determine where old public architecture dependent libraries might be
$!
$!: determine where public executables go
$ dflt = prefix - ".]" + ".BIN]"
$ rp = "Pathname where the public executables will reside? "
$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
$ GOSUB myread
$ IF ans.NES.""
$ THEN bin = ans
$ ELSE bin = dflt
$ ENDIF
$!
$!: determine where manual pages are on this system
$!: What suffix to use on installed man pages
$!: see if we can have long filenames
$!: determine where library module manual pages go
$!: What suffix to use on installed man pages
$!: see what memory models we can support
$!
$ ENDIF !%Config-I-VMS, skip "where install" questions
$!
$!: see if we need a special compiler
$! cc_list = "cc/vaxc|cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
$!
$ nocc = "f"
$ vms_cc_dflt = ""
$ vms_cc_available = ""
$!
$ OPEN/WRITE CONFIG ccvms.c
$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
$ WRITE CONFIG "#include <stdio.h>"
$ WRITE CONFIG "int main() {"
$ WRITE CONFIG "#ifdef __DECC"
$ WRITE CONFIG " printf(""/DECC\n"");"
$ WRITE CONFIG "#else"
$ WRITE CONFIG " printf(""/VAXC\n"");"
$ WRITE CONFIG "#endif"
$ WRITE CONFIG " exit(0);"
$ WRITE CONFIG "}"
$ CLOSE CONFIG
$!
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ cc/NoObj/list=ccvms.lis ccvms.c
$ tmp = $status
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ IF (silent) THEN GOSUB Shut_up
$! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
$!
$ IF tmp.NE.%X10B90001
$ THEN
$ IF tmp.NE.%X10000001
$ THEN
$ nocc = "t" !%X10000001 is return from gcc
$ GOTO Gcc_initial_check
$ ENDIF
$ ENDIF
$!
$ GOSUB List_Parse
$ IF .NOT.silent THEN echo ""
$ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
$ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
$ THEN
$ vms_cc_dflt = "/vaxc"
$ vms_cc_available = vms_cc_available + "cc/vaxc "
$ IF .NOT.silent
$ THEN
$ echo "%Config-I-VMS, Will try cc/decc..."
$ ENDIF
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ SET NOON
$ cc/decc/NoObj/list=ccvms.lis ccvms.c
$ tmp = $status
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ SET ON
$ IF (silent) THEN GOSUB Shut_up
$ IF tmp.NE.%X10B90001
$ THEN
$ echo "%Config-I-VMS, Apparently you don't have that one."
$ ELSE
$ GOSUB List_parse
$ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
$ vms_cc_available = vms_cc_available + "cc/decc "
$ ENDIF
$ ELSE
$ IF F$LOCATE("DEC",line).NE.F$LENGTH(line)
$ THEN
$ vms_cc_dflt = "/decc"
$ vms_cc_available = vms_cc_available + "cc/decc "
$ echo "%Config-I-VMS, Will try cc/vaxc..."
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ SET NOON
$ cc/vaxc/NoObj/list=ccvms.lis ccvms.c
$ tmp = $status
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ SET ON
$ IF (silent) THEN GOSUB Shut_up
$ IF tmp.NE.%X10B90001
$ THEN
$ echo "%Config-I-VMS, Apparently you don't have that one."
$ ELSE
$ GOSUB List_parse
$ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
$ vms_cc_available = vms_cc_available + "cc/vaxc "
$ ENDIF
$ ENDIF
$ ENDIF
$!
$Gcc_initial_check:
$ echo "%Config-I-VMS, Checking for Gcc"
$ OPEN/WRITE CONFIG gccvers.lis
$ DEFINE SYS$ERROR CONFIG
$ DEFINE SYS$OUTPUT CONFIG
$ 'gcc_symbol'/noobj/version _nla0:
$ tmp = $status
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ IF (silent) THEN GOSUB Shut_up
$ CLOSE CONFIG
$ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
$ THEN
$ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
$ goto cc_cleanup
$ ENDIF
$ OPEN/READ CONFIG gccvers.lis
$GCC_List_Read:
$ READ/END_OF_FILE=GCC_List_End CONFIG line
$ GOTO GCC_List_Read
$GCC_List_End:
$ CLOSE CONFIG
$ echo line
$ vms_cc_available = vms_cc_available + "''gcc_symbol' "
$ DELETE/NOLOG/NOCONFIRM gccvers.lis;
$!
$CC_Cleanup:
$ DELETE/NOLOG/NOCONFIRM ccvms.*;
$CC_Desired:
$!: see if we need a special compiler
$! echo ""
$ echo "%Config-I-VMS, available compiler(s):"
$ echo "( ''vms_cc_available')"
$ IF .NOT.nocc
$ THEN
$ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
$ ELSE
$ dflt = gcc_symbol
$ ENDIF
$ rp = "Use which C compiler? [''dflt'] "
$ GOSUB myread
$ IF ans.NES.""
$ THEN
$ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
$ Mcc = ans
$ IF F$LOCATE("dec",ans).NE.F$LENGTH(ans)
$ THEN
$ Mcc = "cc/decc"
$ Using_Dec_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ IF F$LOCATE("vax",ans).NE.F$LENGTH(ans)
$ THEN
$ Mcc = "cc/vaxc"
$ Using_Vax_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ IF Mcc.NES.dflt
$ THEN
$ IF F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)
$ THEN
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ELSE
$ Using_Dec_C = "Yes"
$ IF F$LOCATE("vax",dflt).NE.F$LENGTH(dflt)
$ THEN
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ ENDIF
$ ELSE
$ IF Mcc .EQS. "cc/decc"
$ THEN
$ Using_Dec_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ ENDIF
$ ELSE
$ Mcc = dflt
$ IF Mcc .EQS. "cc/decc"
$ THEN
$ Using_Dec_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ IF Mcc .EQS. "cc/vaxc"
$ THEN
$ Using_Vax_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ IF Mcc .EQS. "gcc"
$ THEN
$ Using_Gnu_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ ENDIF
$ ENDIF
$Decc_Version_check:
$ IF "''Using_Dec_C'".EQS."Yes"
$ THEN
$ echo ""
$ echo4 "Checking for Dec C's version number..." !>&4
$ OPEN/WRITE CONFIG deccvers.c
$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
$ WRITE CONFIG "#include <stdio.h>"
$ WRITE CONFIG "int main() {"
$ WRITE CONFIG "#ifdef __DECC"
$ WRITE CONFIG "#ifdef __DECC_VER"
$ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
$ WRITE CONFIG "#else"
$ WRITE CONFIG " printf(""%i\n"", ""1"");"
$ WRITE CONFIG "#endif"
$ WRITE CONFIG "#endif"
$ WRITE CONFIG " exit(0);"
$ WRITE CONFIG "}"
$ CLOSE CONFIG
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ 'Mcc' deccvers.c
$ tmp = $status
$ DEASSIGN SYS$ERROR _NLA0:
$ DEASSIGN SYS$OUTPUT _NLA0:
$ IF (silent) THEN GOSUB Shut_up
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ link deccvers.obj
$ tmp = $status
$ DEASSIGN SYS$ERROR
$ DEASSIGN SYS$OUTPUT
$ IF (silent) THEN GOSUB Shut_up
$ OPEN/WRITE CONFIG deccvers.out
$ DEFINE SYS$ERROR CONFIG
$ DEFINE SYS$OUTPUT CONFIG
$ mcr []deccvers.exe
$ tmp = $status
$ CLOSE CONFIG
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ IF (silent) THEN GOSUB Shut_up
$ OPEN/READ CONFIG deccvers.out
$ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
$Dec_c_cleanup:
$ CLOSE CONFIG
$! DELETE/NOLOG/NOCONFIRM deccvers.*;
$ echo "You are using Dec C ''line'"
$ Dec_C_Version = line
$ ENDIF
$Vaxc_Invoke_check:
$ IF "''Using_Vax_C'".EQS."Yes"
$ THEN
$ echo ""
$ echo4 "Checking to see how to invoke Vax C..."
$ OPEN/WRITE CONFIG vaxcchk.c
$ WRITE CONFIG "#include <stdio.h>"
$ WRITE CONFIG "int main() {"
$ WRITE CONFIG " printf(""%i\n"", ""1"");"
$ WRITE CONFIG " exit(0);"
$ WRITE CONFIG "}"
$ CLOSE CONFIG
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ SET NOON
$ cc/vaxc/NoObj vaxcchk.c
$ tmp = $status
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ SET ON
$ IF (silent) THEN GOSUB Shut_up
$ IF tmp.NE.%X10B90001
$ THEN
$ Mcc = "cc"
$ ELSE
$ Mcc = "cc/vaxc"
$ ENDIF
$Vax_c_cleanup:
$ DELETE/NOLOG/NOCONFIRM vaxcchk.*;
$ ENDIF
$Gcc_check:
$ if "''using_gnu_c'" .eqs. "Yes"
$ THEN
$ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
$ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
$ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
$ IF gcclib_olb .EQS. ""
$ THEN
$! These objects/libs come w/ gcc 2.7.2 for AXP:
$ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
$ IF tmp .NES. "" then gcclib_olb = tmp
$ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
$ IF tmp .NES. ""
$ THEN
$ IF gcclib_olb .EQS. ""
$ THEN gcclib_olb = tmp
$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
$ ENDIF
$ ENDIF
$ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
$ IF tmp .NES. ""
$ THEN
$ IF gcclib_olb .EQS. ""
$ THEN gcclib_olb = tmp
$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
$ ENDIF
$ ENDIF
$ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
$ IF tmp .NES. ""
$ THEN
$ IF gcclib_olb .EQS. ""
$ THEN gcclib_olb = tmp
$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
$ ENDIF
$ ENDIF
$ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
$ ELSE
$ gcclib_olb = gcclib_olb + "/lib"
$ ENDIF
$ IF gcclib_olb .NES. "" .AND. -
(vaxcrtl_olb .NES. "" .OR. -
vaxcrtl_exe .NES. "" )
$ THEN
$ echo ""
$ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
$ OPEN/WRITE CONFIG gccvers.c
$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
$ WRITE CONFIG "#include <stdio.h>"
$ WRITE CONFIG "int main() {"
$ WRITE CONFIG "#ifdef __GNUC__"
$ WRITE CONFIG "#ifdef __VERSION__"
$ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
$ WRITE CONFIG "#else"
$ WRITE CONFIG " printf(""%s\n"", ""1"");"
$ WRITE CONFIG "#endif"
$ WRITE CONFIG "#endif"
$ WRITE CONFIG " exit(0);"
$ WRITE CONFIG "}"
$ CLOSE CONFIG
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ 'Mcc' gccvers.c
$ tmp = $status
$ DEASSIGN SYS$ERROR _NLA0:
$ DEASSIGN SYS$OUTPUT _NLA0:
$ IF (silent) THEN GOSUB Shut_up
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ IF vaxcrtl_exe .EQS. ""
$ THEN
$ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
$ THEN
$ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
$ tmp = $status
$ ELSE
$ link gccvers.obj,'gcclib_olb'
$ tmp = $status
$ ENDIF
$ ELSE
$ OPEN/WRITE CONFIG GCCVERS.OPT
$ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
$ CLOSE CONFIG
$ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
$ tmp = $status
$ ENDIF
$ DEASSIGN SYS$ERROR
$ DEASSIGN SYS$OUTPUT
$ IF (silent) THEN GOSUB Shut_up
$ OPEN/WRITE CONFIG gccvers.out
$ DEFINE SYS$ERROR CONFIG
$ DEFINE SYS$OUTPUT CONFIG
$ mcr []gccvers.exe
$ tmp = $status
$ CLOSE CONFIG
$ DEASSIGN SYS$OUTPUT
$ DEASSIGN SYS$ERROR
$ IF (silent) THEN GOSUB Shut_up
$ OPEN/READ CONFIG gccvers.out
$ READ/END_OF_FILE=Gcc_cleanup CONFIG line
$Gcc_cleanup:
$ CLOSE CONFIG
$ DELETE/NOLOG/NOCONFIRM gccvers.*;
$ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
$ THEN
$ echo "You are not using GNU cc."
$ GOTO Host_name
$ ELSE
$ echo "You are using GNU cc ''line'"
$ Using_Gnu_C = "Yes"
$ C_COMPILER_Replace = "CC=cc=''Mcc'"
$ GOTO Include_dirs
$ ENDIF
$ ENDIF
$endif
$ GOTO Host_name
$!
$List_Parse:
$ OPEN/READ CONFIG ccvms.lis
$ READ CONFIG line
$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
$ THEN
$ read CONFIG line
$ archsufx = "VAX"
$ ELSE
$ archsufx = "AXP"
$ ENDIF
$ CLOSE CONFIG
$ line = F$EDIT(line,"TRIM,COMPRESS")
$ line = line - "Page 1" ! occurs at end all compilers
$ line = line - "CCVMS " ! filename appears w/ VAXC
$ line = line - "Source Listing " ! Seen w/ AXP DECC
$ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
$ line = line - tmp
$ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
$ DELETE/NOLOG/NOCONFIRM ccvms.lis;
$ RETURN
$!
$Include_dirs:
$!: What should the include directory be ?
$ dflt = gcclib_olb
$ rp = "Where are the include files you want to use? "
$ IF f$length( rp + "[''dflt'] " ).gt.76
$ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
$ ELSE rp = rp + "[''dflt'] "
$ ENDIF
$ GOSUB myread
$ usrinc = ans
$!
$!: see if we have to deal with yellow pages, now NIS.
$!: now get the host name
$Host_name:
$ echo ""
$ echo4 "Figuring out host name..." !>&4
$ myhostname = ""
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
$ IF myhostname.eqs."".and. -
F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
$ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
$!: you do not want to know about this
$!: verify guess
$ rp = "Your host name appears to be """"''myhostname'"""". Right? "
$ GOSUB myread
$ IF (.not.ans).and.(ans.NES."")
$ THEN
$ READ SYS$COMMAND/PROMPT= -
"Please type the (one word) name of your host: " ans
$ myhostname = ans
$ ENDIF
$!: translate upper to lower if necessary
$ myhostname = F$EDIT(myhostname,"COLLAPSE")
$ mylowhostname = F$EDIT(myhostname," LOWERCASE")
$ IF mylowhostname.NES.myhostname
$ THEN
$ echo "(Normalizing case in your host name)"
$ myhostname = mylowhostname
$ ENDIF
$!
$ fp = F$LOCATE(".",myhostname)
$ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
$ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
$ THEN
$ rp = "What is your domain name? [''mydomain'] "
$ GOSUB myread
$ IF ans THEN mydomain = ans
$!: translate upper to lower if necessary
$ mydomain = F$EDIT(mydomain,"COLLAPSE")
$ mylowdomain = F$EDIT(mydomain," LOWERCASE")
$ IF mylowdomain.NES.mydomain
$ THEN
$ echo "(Normalizing case in your domain name)"
$ mydomain = mylowdomain
$ ENDIF
$ ENDIF
$ myhostname = myhostname - mydomain
$ echo "(Trimming domain name from host name--host name is now ''myhostname')"
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
I need to get your e-mail address in Internet format if possible, i.e.
something like user@host.domain. Please answer accurately since I have
no easy means to double check it. The default value provided below
is most probably close to the reality but may not be valid from outside
your organization...
$ ENDIF
$ dflt = "''cf_by@''myhostname'"+"''mydomain'"
$ rp = "What is your e-mail address? [''dflt'] "
$ GOSUB myread
$ IF ans
$ THEN cf_email = ans
$ ELSE cf_email = dflt
$ ENDIF
$!
$ IF .NOT.silent
$ THEN TYPE SYS$INPUT:
If you or somebody else will be maintaining perl at your site, please
fill in the correct e-mail address here so that they may be contacted
if necessary. Currently, the "perlbug" program included with perl
will send mail to this address in addition to perlbug@perl.com. You may
enter "none" for no administrator.
$ ENDIF
$ dflt = "''cf_email'"
$ rp = "Perl administrator e-mail address [''dflt'] "
$ GOSUB myread
$ IF ans
$ THEN perladmin = ans
$ ELSE perladmin = dflt
$ ENDIF
$!
$!: determine where public executable scripts go
$!: determine perl absolute location
$!: figure out how to guarantee perl startup
$!
$!: see how we invoke the C preprocessor
$! echo ""
$! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
$!: Set private lib path
$!: Now check and see which directories actually exist, avoiding duplicates
$!: determine optimize, if desired, or use for debug flag also
$!: We will not override a previous value, but we might want to
$!: augment a hint file
$!: the following weeds options from ccflags that are of no interest to cpp
$!: flags used in final linking phase
$!: Try to guess additional flags to pick up local libraries.
$!: coherency check
$! echo ""
$! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
$!: compute shared library extension
$!: Looking for optional libraries
$!: see if nm is to be used to determine whether a symbol is defined or not
$!: get list of predefined functions in a handy place
$!: see if we have sigaction
$!: see whether socketshr exists
$ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
$ THEN
$ has_socketshr = "T"
$ echo ""
$ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
$ endif
$ if (Dec_C_Version .ge. 50200000)
$ THEN
$ Has_Dec_C_Sockets = "T"
$ echo ""
$ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
$ ENDIF
$ ! Hey, we've got both. Default to Dec C, then, since it's better
$ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
$ THEN
$ echo ""
$ echo "You've got sockets available. Which socket stack do you want to"
$ echo "build into perl?"
$ if "''has_dec_c_sockets'".eqs."T"
$ THEN
$ dflt = "DECC"
$ else
$ dflt = "SOCKETSHR"
$ endif
$ rp = "Choose socket stack (NONE"
$ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
$ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
$ rp = rp + ") [''dflt'] "
$ GOSUB myread
$ IF "''ans'".eqs."" THEN ans = "''dflt'"
$ has_dec_c_sockets = "F"
$ has_socketshr = "F"
$ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
$ IF ans.eqs."decc" then has_dec_c_sockets = "T"
$ IF ans.eqs."socketshr" then has_socketshr = "T"
$ endif
$!
$!
$! Ask about threads, if appropriate
$ if (Using_Dec_C.eqs."Yes")
$ THEN
$ echo "This version of Perl can be built with threads. While really nifty,
$ echo "they are a beta feature, and there is a speed penalty for perl
$ echo "programs if you build with threads *even if you don't use them*
$ echo ""
$ dflt = "n"
$ rp = "Build with threads? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans = dflt
$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
$ THEN
$ use_threads="T"
$ ! Are they on VMS 7.1 on an alpha?
$ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
$ THEN
$ echo ""
$ echo "Threaded perl can be linked to use multiple kernel threads
$ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
$ echo "allows multiple threads to execute simultaneously on an SMP
$ echo "system as well as preventing a single thread from blocking
$ echo "all the threads in a program, even on a single-processor
$ echo "machine. Unfortunately this feature isn't safe on an
$ echo "unpatched 7.1 system. (Several OS patches were required when
$ echo "this procedure was written)
$ echo ""
$ dflt = "n"
$ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
$ gosub myread
$ if ans.eqs."" then ans="''dflt'"
$ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
$ THEN
$ Thread_Live_Dangerously = "MT=MT=1"
$ ENDIF
$ ENDIF
$ ENDIF
$ ENDIF
$!
$! Pre-load %ENV?
$ echo ""
$ echo "Because of the way perl fetches the list of logical names
$ echo "for the %ENV hash (we spawn a subprocess that does a
$ echo "SHOW LOGICALS *, which is expensive), we defer fetching it
$ echo "until the first time a program iterates over the %ENV hash.
$ echo "This means things like 'exists($ENV{'SYS$MANAGER'})' will
$ echo "return false unless you've already accessed $ENV{SYS$MANAGER}
$ echo "or done something like a keys %ENV."
$ echo ""
$ echo "If you choose, perl can populate the %ENV hash at startup.
$ echo "This will exact both a memory penalty (to store the keys) and
$ echo "a time penalty (to spawn the subprocess) every time you invoke
$ echo "perl. Depending on your system, this might not be a big deal.
$ echo ""
$ dflt = "n"
$ rp = "Populate %ENV at startup time? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans="''dflt'"
$ preload_env = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
$!
$! Ask if they want to use perl's memory allocator
$ echo ""
$ echo "Perl has a built-in memory allocator that's tuned for perl's
$ echo "normal memory usage. It's oftentimes better than the standard
$ echo "system memory allocator. It also has the advantage of providing
$ echo "memory allocation statistics, if you choose to enable them.
$ echo ""
$ dflt = "n"
$ rp = "Build with perl's memory allocator? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans="''dflt'"
$ mymalloc = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
$ if mymalloc.eqs."Y"
$ THEN
$ if use_debugging_perl.eqs."Y"
$ THEN
$ echo ""
$ echo "Perl can keep statistics on memory usage if you choose to use
$ echo "them. This is useful for debugging, but does have some
$ echo "performance overhead.
$ echo ""
$ dflt = "n"
$ rp = "Do you want the debugging memory allocator? [''dflt'] "
$ gosub myread
$ if ans.eqs."" then ans="''dflt'"
$ use_debugmalloc = f$extract(0, 1, f$edit(ans, "TRIM,COMPRESS,UPCASE"))
$ ENDIF
$ ! Check which memory allocator we want
$ echo ""
$ echo "There are currently three different memory allocators: the
$ echo "default (which is a pretty good general-purpose memory manager),
$ echo "the TWO_POT allocator (which is optimized to save memory for
$ echo "larger allocations), and PACK_MALLOC (which is optimized to save
$ echo "memory for smaller allocations). They're all good, but if your
$ echo "usage tends towards larger chunks use TWO_POT, otherwise use
$ echo "PACK_MALLOC."
$ echo ""
$ dflt = "DEFAULT"
$ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans = "''dflt'"
$ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
$ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
$ ENDIF
$!
$! Ask for their default list of extensions to build
$ echo ""
$ echo "It's time to specify which modules you want to build into
$ echo "perl. Most of these are standard and should be chosen, though
$ echo "you might, for example, want to build GDBM_File instead of
$ echo "SDBM_File if you have the GDBM library built on your machine
$ echo "
$ echo "Which modules do you want to build into perl?"
$ dflt = "Fcntl Errno IO Opcode Dumper attrs re Stdio DCLsym B SDBM_File"
$ if Using_Dec_C.eqs."Yes"
$ THEN
$ dflt = dflt + " POSIX"
$ if Use_Threads.eqs."T"
$ THEN
$ dflt = dflt + " Thread"
$ ENDIF
$ ENDIF
$ rp = "[''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans = "''dflt'"
$ extensions = "''ans'"
$!
$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
$ echo ""
$ echo "%Config-I-VMS, Checking your ""make"" utilities..."
$! If the 'build' that you use is not here add it and it's test
$! switch to the _END_ of these strings (and increment max_build)
$! (e.g. builders = builders + "/FOOMAKE"
$! probers = probers + " -fooVersionSwitch"
$! ) & please let me know about it.
$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
$ max_build = 7
$!
$ orig_dflt = "MMK"
$ default_set = ""
$ ok_builders = ""
$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
$ WRITE CONFIG "dont_make_anything_yet:"
$ WRITE CONFIG F$FAO("!_")
$ CLOSE CONFIG
$ n = 0
$ messages = F$ENVIRONMENT("MESSAGE")
$Build_probe:
$ build = F$ELEMENT(n,"/",builders)
$ probe = F$ELEMENT(n,"!",probers)
$ echo "Testing whether you have ''build' on your system..."
$ SET NOON !sorry :-(
$ ON CONTROL_Y THEN GOTO Reenable_messages_build !sorry :-(
$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
$ 'build' 'probe'
$ IF ($SEVERITY .EQ. 1)
$ THEN
$ echo "OK."
$ IF (build .EQS. orig_dflt)
$ THEN
$ default_set = "TRUE"
$ dflt = build
$ ENDIF
$ ok_builders = ok_builders + " " + build
$ IF (.NOT. default_set) THEN dflt = build
$ ELSE
$ echo "Nope."
$ ENDIF
$Reenable_messages_build: !hope you made it here :-)
$ SET MESSAGE 'messages' !hope you made it here :-)
$ SET ON !hope you made it here :-)
$ n = n + 1
$ IF (n .LT. max_build) THEN GOTO Build_probe
$!
$ echo ""
$ IF (ok_builders .NES. "")
$ THEN
$ echo "Here is the list of builders you can apparently use:"
$ echo "(",ok_builders," )"
$ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
$ GOSUB myread
$ ans = F$EDIT(ans,"TRIM, COMPRESS")
$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
$ IF (ans .EQS. "")
$ THEN build = dflt
$ ELSE build = ans
$ ENDIF
$ ELSE
$ TYPE SYS$INPUT:
%Config-E-VMS, ERROR:
Well this looks pretty serious. Perl5 cannot be compiled without a "make"
utility of some sort and after checking my "builders" list I cannot find
the symbol or command you use on your system to compile programs.
$ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
$ ans = F$EDIT(ans,"TRIM, COMPRESS")
$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
$ IF (ans .EQS. "")
$ THEN build = dflt
$ echo "I don't know where 'make' is, and my life depends on it."
$ echo "Go find a make program or fix your DCL$PATH setting!"
$ echo "ABORTING..."
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT 2 !$STATUS = "%X00000002" (error)
$ ELSE
$ build = ans
$ ENDIF
$ ENDIF
$!
$ DELETE/NOLOG Makefile.;
$ GOTO Beyond_open
$Open_error:
$ TYPE SYS$INPUT:
There seems to be trouble. I just tried to create a file in
$ echo4 'F$ENVIRONMENT("DEFAULT")'
$ TYPE SYS$INPUT:
but was unsuccessful. I am stopping now. Please check that directories'
PROTECTION bits. I will leave you in the directory where you started
Configure.com
$ echo4 "ABORTING..."
$ GOTO Clean_up
$ STOP
$ EXIT
$!
$Beyond_open:
$! echo " Very well I will proceed with ""''build'"""
$ make = F$EDIT(build,"UPCASE")
$!
$!: locate the preferred pager for this system
$!pagers = "most|more|less|type/page"
$!rp='What pager is used on your system?'
$!
$! update [.vms]config.vms here
$!
$! update makefile here
$! echo4 "Updating makefile..."
$!
$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
$ THEN
$ makefile = "" !wrt MANIFEST dir
$ UUmakefile = "DESCRIP.MMS" !wrt CWD dir
$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
$ ELSE
$ makefile = " -f [.VMS]Makefile." !wrt MANIFEST dir
$ UUmakefile = "[-.VMS]Makefile." !wrt CWD dir
$ DEFmakefile = "[-.VMS]Makefile." !wrt DEF dir (?)
$ ENDIF
$!
$ IF macros.NES.""
$ THEN
$ tmp = F$LENGTH(macros)
$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
$ macros = "/macro=(" + macros + ")"
$ ENDIF
$!
$! Invoke the subconfig piece
$!
$ echo ""
$ echo4 "Checking the C Run time library"
$ dflt = F$ENVIRONMENT("DEFAULT")
$ SET DEFAULT [-.vms]
$ @subconfigure
$ SET DEFAULT 'dflt
$!
$! %Config-I-VMS, write perl_setup.com here
$!
$ echo ""
$ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
$ file_2_find = "[-.vms]perl_setup.com"
$ OPEN/WRITE CONFIG 'file_2_find'
$ WRITE CONFIG "$!"
$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
$ IF cf_email.NES.perladmin
$ THEN
$ WRITE CONFIG "$! perl configured by ''cf_email'"
$ ELSE
$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
$ ENDIF
$ WRITE CONFIG "$!"
$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
prefix = prefix - "]" + ".]"
$ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
$ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl"
$ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr.Exe"
$ IF (tzneedset)
$ THEN
$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
$ ELSE !leave in but commented out (in case setting was from perl :-)
$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
$ ENDIF
$ WRITE CONFIG "$!"
$ WRITE CONFIG "$! Symbols for commonly used scripts:"
$ WRITE CONFIG "$!"
$ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
$ CLOSE CONFIG
$!
$ echo ""
$ echo "%Config-I-VMS, The file can be found at:"
$ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
$ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
$ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
$ echo "-Config-I-VMS, testing, and installation of your perl."
$ echo ""
$!
$!figure out where we "are" by parsing 'vms_default_directory_name'
$!
$ set_def_command = ""
$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
$ tmp = vms_default_directory_name - dflt - "]"
$ i = 0
$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
$Set_def_loop:
$ tmp1 = F$ELEMENT(i,".",tmp)
$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
$ IF i .EQ. 0
$ THEN set_def_command = "set default [-"
$ ELSE set_def_command = set_def_command + "-"
$ ENDIF
$ i = i + 1
$ GOTO Set_def_loop
$Beyond_set_def_loop:
$ IF set_def_command.NES.""
$ THEN
$ set_def_command = set_def_command - "-" + "]"
$ echo4 ""
$ echo4 "In order to build ''package' you must now issue the commands:"
$ echo4 ""
$ echo4 " ''set_def_command'"
$ ELSE
$ echo4 ""
$ echo4 "In order to build ''package' you must now issue the command:"
$ echo4 ""
$ ENDIF
$ echo4 " ''make'''makefile'", macros
$ echo4 ""
$!
$Clean_up:
$ IF (silent)
$ THEN
$ DEASSIGN SYS$OUTPUT
$! DEASSIGN SYS$ERROR
$ ENDIF
$ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
$ IF F$GETJPI("","FILCNT").NE.vms_filcnt
$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
$ ENDIF
$ dflt = F$ENVIRONMENT("DEFAULT")
$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
$ THEN
$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
$ SET DEFAULT [-]
$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
$ DELETE/NOLOG/NOCONFIRM UU.DIR;
$ ENDIF
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT
$!: End of Configure