+$! Ask whether they want to use secure logical translation when tainting
+$ echo ""
+$ echo "As Perl starts up, it checks several logical names, such as"
+$ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
+$ echo "of its behavior. For additional security, you may limit this"
+$ echo "process to executive- and kernel-mode translation when tainting"
+$ echo "is enabled. In this case, logical names normally skipped when"
+$ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
+$ echo "If you do not choose to do this, the usual order of access modes"
+$ echo "is used for logical name translation."
+$ echo ""
+$ echo "This restriction does not apply to the %ENV hash or to implicit"
+$ echo "logical name translation during parsing of file specifications;"
+$ echo "these always use the normal sequence of access modes for logical"
+$ echo "name translation."
+$ bool_dflt = "y"
+$ if f$type(usesecurelog) .nes. ""
+$ then
+$ if f$extract(0,1,f$edit(usesecurelog,"collapse,upcase")).eqs."N" .or. usesecurelog .eqs. "undef" then bool_dflt = "n"
+$ endif
+$ rp = "Use secure logical name translation? [''bool_dflt'] "
+$ GOSUB myread
+$ d_secintgenv = ans
+$ usesecurelog = "undef"
+$ if (d_secintgenv) then usesecurelog = "define"
+$!
+$! Ask whether they want to default filetypes
+$ echo ""
+$ echo "When you pass the name of a program to Perl on the command line,"
+$ echo "it generally doesn't supply any defaults unless the -S command"
+$ echo "line switch is specified. In keeping with the VMS tradition of"
+$ echo "default file types, however, you can configure Perl to try default"
+$ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
+$ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
+$ echo "finally foo.com)."
+$ echo ""
+$ echo "This is currently broken in some configurations. Only enable it if"
+$ echo "you know what you are doing."
+$ bool_dflt = "n"
+$ if f$type(usedefaulttypes) .nes. ""
+$ then
+$ if usedefaulttypes .or. usedefaulttypes .eqs. "define" then bool_dflt="y"
+$ endif
+$ rp = "Always use default file types? [''bool_dflt'] "
+$ GOSUB myread
+$ d_alwdeftype = ans
+$ usedefaulttypes = "undef"
+$ if (d_alwdeftype) then usedefaulttypes = "define"
+$!
+$ dflt = archname
+$ 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 usethreads .OR. usethreads .EQS. "define"
+$ THEN
+$ echo4 "Threads selected."
+$ IF F$LOCATE("-thread", archname) .EQ. F$LENGTH(archname)
+$ THEN
+$ archname = "''archname'-thread"
+$ echo4 "...setting architecture name to ''archname'."
+$ ELSE
+$ echo4 "...and architecture name already has -thread."
+$ ENDIF
+$ ENDIF
+$!
+$ IF usemultiplicity .OR. usemultiplicity .EQS. "define"
+$ THEN
+$ echo4 "Multiplicity selected."
+$ IF F$LOCATE("-multi", archname) .EQ. F$LENGTH(archname)
+$ THEN
+$ archname = "''archname'-multi"
+$ echo4 "...setting architecture name to ''archname'."
+$ ELSE
+$ echo4 "...and architecture name already has -multi."
+$ ENDIF
+$ ENDIF
+$!
+$ IF uselongdouble .OR. uselongdouble .EQS. "define"
+$ THEN
+$ echo4 "Long doubles selected."
+$ IF F$LOCATE("-ld", archname) .EQ. F$LENGTH(archname)
+$ THEN
+$ archname = "''archname'-ld"
+$ echo4 "...setting architecture name to ''archname'."
+$ ELSE
+$ echo4 "...and architecture name already has -ld."
+$ ENDIF
+$ ENDIF
+$!
+$ bool_dflt = "n"
+$ vms_prefix = "perl_root"
+$ vms_prefixup = F$EDIT(vms_prefix,"UPCASE")
+$ rp = "Will you be sharing your ''vms_prefixup' with ''otherarch'? [''bool_dflt'] "
+$ GOSUB myread
+$ IF .NOT. ans
+$ THEN
+$ sharedperl = "N"
+$ ELSE
+$ sharedperl = "Y"
+$ IF (F$ELEMENT(0, "-", archname).EQS."VMS_AXP")
+$ THEN
+$ macros = macros + """AXE=1"","
+$ ENDIF
+$ IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
+$ THEN
+$ macros = macros + """IXE=1"","
+$ ENDIF
+$ 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
+$!
+$ IF F$TYPE(prefix) .EQS. ""
+$ THEN
+$ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
+$ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - "000000." - ".000000" - ".;"
+$ prefixbase = prefix - "]"
+$! Add _ROOT to make install PERL_ROOT differ from build directory.
+$ prefix = prefixbase + "_ROOT.]"
+$ ENDIF
+$ ! more redundant scrubbing of values
+$ prefix = prefix - "000000."
+$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
+$ src = prefix
+$!: determine root of directory hierarchy where package will be installed.
+$ dflt = prefix
+$ IF .NOT.silent
+$ THEN
+$ echo ""
+$ echo "By default, ''package' will be installed in ''dflt', pod"
+$ echo "pages under ''prefixbase'.LIB.POD], etc..., i.e. with ''dflt' as prefix for"
+$ echo "all installation directories."
+$ echo "On ''osname' the prefix is used to DEFINE the ''vms_prefixup' prior to installation"
+$ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
+$ ENDIF
+$ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
+$ GOSUB myread
+$ IF ans.NES.""
+$ THEN
+$ prefix = ans
+$ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
+$ ELSE
+$ prefix = dflt
+$ ENDIF
+$ perl_root = prefix
+$!
+$! Check here for pre-existing PERL_ROOT.
+$! -> ask if removal desired.
+$! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
+$! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
+$!
+$ tmp = perl_root - ".]" + "]"
+$ dflt = f$parse(tmp,,,,)
+$ IF dflt .eqs. ""
+$ THEN
+$ echo4 "''tmp' does not yet exist."
+$! create/directory 'tmp'
+$ ELSE
+$ echo4 "''tmp' already exists."
+$ ENDIF
+$!
+$ vms_skip_install = "true"
+$ bool_dflt = "y"
+$! echo ""
+$ rp = "Skip the remaining """"where install"""" questions? [''bool_dflt'] "
+$ GOSUB myread
+$ IF (.NOT.ans) THEN vms_skip_install = "false"
+$ IF (.NOT.vms_skip_install)
+$ THEN
+$!
+$!: 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:
+$ DECK
+
+There are some auxiliary files for perl5 that need to be put into a
+private library directory that is accessible by everyone.
+$ EOD
+$ ENDIF
+$ IF F$TYPE(privlib) .NES. ""
+$ THEN dflt = privlib
+$ ELSE dflt = "''vms_prefix':[lib]"
+$ ENDIF
+$ rp = "Pathname where the private library files will reside? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ privlib = ans
+$!
+$ ENDIF !%Config-I-VMS, skip remaining "where install" questions
+$!
+$ IF F$TYPE(perl_symbol) .EQS. "" THEN perl_symbol := true
+$ IF F$TYPE(perl_verb) .EQS. "" THEN perl_verb = ""
+$ IF perl_symbol
+$ THEN bool_dflt = "y"
+$ ELSE bool_dflt = "n"
+$ ENDIF
+$ IF .NOT.silent
+$ THEN
+$ echo ""
+$ echo "You may choose to write ''packageup'_SETUP.COM to assign a foreign"
+$ echo "symbol to invoke ''package', which is the usual method."
+$ echO "If you do not do so then you would need a DCL command verb at the"
+$ echo "process or the system wide level."
+$ ENDIF
+$ rp = "Invoke perl as a global symbol foreign command? [''bool_dflt'] "
+$ GOSUB myread
+$ IF (.NOT.ans) THEN perl_symbol = "false"
+$!
+$ IF (.NOT.perl_symbol)
+$ THEN
+$ IF perl_verb .EQS. "DCLTABLES"
+$ THEN bool_dflt = "n"
+$ ELSE bool_dflt = "y"
+$ ENDIF
+$ IF .NOT.silent
+$ THEN
+$ echo ""
+$ echo "Since you won't be using a symbol you must choose to put the ''packageup'"
+$ echo "verb in a per-process table or in the system wide DCLTABLES (which"
+$ echo "would require write privilege)."
+$ ENDIF
+$ rp = "Invoke perl as a per process command verb? [ ''bool_dflt' ] "
+$ GOSUB myread
+$ IF (.NOT.ans)
+$ THEN perl_verb = "DCLTABLES"
+$ ELSE perl_verb = "PROCESS"
+$ ENDIF
+$ ENDIF ! (.NOT.perl_symbol)
+$!
+$ IF (.NOT.vms_skip_install)
+$ THEN
+$!: 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:
+$ DECK
+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.
+$ EOD
+$ ENDIF
+$ IF F$TYPE(archlib) .NES. ""
+$ THEN dflt = archlib
+$ ELSE dflt = privlib - "]" + "." + archname + "." + version + "]"
+$ ENDIF
+$ rp = "Where do you want to put the public architecture-dependent libraries? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ archlib = ans
+$!
+$ ENDIF !%Config-I-VMS, skip "where install" questions
+$ 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:
+$ DECK
+
+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.
+$ EOD
+$ ENDIF
+$ IF F$TYPE(sitelib) .NES. ""
+$ THEN dflt = sitelib
+$ ELSE dflt = privlib - "]" + ".SITE_PERL]"
+$ ENDIF
+$ rp = "Pathname for the site-specific library files? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ sitelib = ans
+$!
+$!: determine where site specific architecture-dependent libraries go.
+$ IF .NOT.silent
+$ THEN TYPE SYS$INPUT:
+$ DECK
+
+The installation process will also create a directory for
+architecture-dependent site-specific extensions and modules.
+$ EOD
+$ ENDIF
+$ IF F$TYPE(sitearch) .NES. ""
+$ THEN dflt = sitearch
+$ ELSE dflt = sitelib - "]" + "." + archname + "]"
+$ ENDIF
+$ rp = "Pathname for the site-specific architecture-dependent library files? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ sitearch = ans
+$!
+$!: determine where old public architecture dependent libraries might be
+$!
+$!: determine where public executables go
+$ IF F$TYPE(bin) .NES. ""
+$ THEN dflt = bin
+$! ELSE dflt = prefix - ".]" + ".BIN]"
+$ ELSE dflt = "/''vms_prefix'"
+$ ENDIF
+$ rp = "Pathname where the public executables will reside? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ bin = ans
+$!
+$!: determine where add-on public executables go
+$ IF F$TYPE(sitebin) .NES. ""
+$ THEN dflt = sitebin
+$ ELSE dflt = "''vms_prefix':[bin.''archname']"
+$ ENDIF
+$ rp = "Pathname where the add-on public executables should be installed? "
+$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
+$ GOSUB myread
+$ sitebin = ans
+$!
+$!: 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
+$!
+$ ELSE ! skipping "where install" questions, we must set some symbols
+$ IF F$TYPE(archlib).EQS."" THEN -
+ archlib="''vms_prefix':[lib.''archname'.''version']"
+$ IF F$TYPE(bin) .EQS. "" THEN -
+ bin="/''vms_prefix'"
+$ IF F$TYPE(privlib) .EQS. "" THEN -
+ privlib ="''vms_prefix':[lib]"
+$ IF F$TYPE(sitearch) .EQS. "" THEN -
+ sitearch="''vms_prefix':[lib.site_perl.''archname']"
+$ IF F$TYPE(sitelib) .EQS. "" THEN -
+ sitelib ="''vms_prefix':[lib.site_perl]"
+$ IF F$TYPE(sitebin) .EQS. "" THEN -
+ sitebin="''vms_prefix':[bin.''archname']"
+$ ENDIF !%Config-I-VMS, skip "where install" questions