$! the whole VMSPerl crew.
$! Extended and messed about with by Dan Sugalski
$!
-$! SET NOVERIFY
-$ sav_ver = F$VERIFY(sav_ver)
+$ sav_ver = F$VERIFY(0)
$!
$! VMS-isms we will need:
$ echo = "write sys$output "
$ gcc_symbol = "gcc"
$ ans = ""
$ macros = ""
-$ extra_fags = ""
+$ extra_flags = ""
$ user_c_flags = ""
-$ use_debugging_perl = "y"
$ use_ieee_math = "n"
$ be_case_sensitive = "n"
$ use_vmsdebug_perl = "n"
$ use_ithreads = "N"
$!
$!: option parsing
+$ config_args = ""
$ IF (P1 .NES. "")
$ THEN !one or more switches was thrown
$ i = 1
$ bang = 0
$Param_loop:
-$ IF (P'i'.NES."") THEN bang = bang + 1
+$ IF (P'i'.NES."")
+$ THEN
+$ bang = bang + 1
+$ config_args = config_args + F$FAO(" !AS",P'i')
+$ ENDIF
$ i = i + 1
$ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
$!
$ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
$!
$ ENDIF ! (P1 .NES. "")
+$ config_args = F$EDIT(config_args,"TRIM")
$!
$ IF (error)
$ THEN
$! see 'user' above.
$ cf_by = F$EDIT(user,"LOWERCASE")
$! cf_time = F$CVTIME() !superceded by procedure below
-$ osvers = F$GETSYI("VERSION")
+$ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
$!
$! Peter Prymmer has seen:
$! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
$ THEN
$ archname = "VMS_VAX"
$ otherarch = "an Alpha"
+$ alignbytes="8"
+$ arch_type = "ARCH-TYPE=__VAX__"
$ ELSE
$ archname = "VMS_AXP"
$ otherarch = "a VAX"
+$ alignbytes="8"
+$ arch_type = "ARCH-TYPE=__AXP__"
$ ENDIF
$ rp = "What is your architecture name? [''archname'] "
$ GOSUB myread
$ vms_skip_install = "true"
$ dflt = "y"
$! echo ""
-$ rp = "%Config-I-VMS, Do you wish to skip the remaining """"where install"""" questions? [''dflt'] "
+$ rp = "%Config-I-VMS, Skip the remaining """"where install"""" questions? [''dflt'] "
$ GOSUB myread
$ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
$ IF (.NOT.vms_skip_install)
$ ENDIF ! (.NOT.perl_symbol)
$!
$!: set the base revision
-$ baserev="5"
+$ baserev="5.0"
+$ revision = baserev - ".0"
$!: get the patchlevel
$ echo ""
$ echo4 "Getting the current patchlevel..." !>&4
$ THEN
$ got_patch = "false"
$ got_sub = "false"
+$ got_api_revision = "false"
+$ got_api_version = "false"
+$ got_api_subversion = "false"
$ OPEN/READONLY CONFIG 'patchlevel_h'
$Patchlevel_h_loop:
$ READ/END_Of_File=Close_patch CONFIG line
$ subversion = F$ELEMENT(2," ",line)
$ got_sub = "true"
$ ENDIF
+$ IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
+$ THEN
+$ line = F$EDIT(line,"COMPRESS, TRIM")
+$ api_revision = F$ELEMENT(2," ",line)
+$ got_api_revision = "true"
+$ ENDIF
+$ IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
+$ THEN
+$ line = F$EDIT(line,"COMPRESS, TRIM")
+$ api_version = F$ELEMENT(2," ",line)
+$ got_api_version = "true"
+$ ENDIF
+$ IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
+$ THEN
+$ line = F$EDIT(line,"COMPRESS, TRIM")
+$ api_subversion = F$ELEMENT(2," ",line)
+$ got_api_subversion = "true"
+$ ENDIF
$ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
$Close_patch:
$ CLOSE CONFIG
$ 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
+$ IF (F$STRING(subversion) .NES. "0")
$ THEN
-$ IF subversion.LT.10
-$ THEN subversion = "0" + F$STRING(subversion)
-$ ELSE subversion = F$STRING(subversion)
-$ ENDIF
-$ ELSE subversion = ""
+$ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
+$ ELSE
+$ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
$ ENDIF
$!
-$ version = baserev + "_" + patchlevel + "_" + subversion
+$ version = revision + "_" + patchlevel + "_" + subversion
$!
$ IF (.NOT.vms_skip_install)
$ THEN
$ use_vmsdebug_perl = "N"
$ ENDIF
$!
+$! Ask if they want to build with DEBUGGING
+$ echo ""
+$ echo "Perl can be built with extra runtime debugging enabled. This
+$ echo "enables the -D switch, at the cost of some performance. It
+$ echo "was mandatory on perl 5.005 and before on VMS, but is now
+$ echo "optional. If you don't generally use it you should probably
+$ echo "leave this off and gain a bit of extra speed.
+$ dflt = "y"
+$ rp = "Build a DEBUGGING version of Perl? [''dflt'] "
+$ GOSUB myread
+$ IF ans.eqs."" then ans = dflt
+$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
+$ THEN
+$ use_debugging_perl = "Y"
+$ ELSE
+$ use_debugging_perl = "N"
+$ ENDIF
+$!
$! Ask if they want to build with MULTIPLICITY
$ echo ""
$ echo "The perl interpreter engine can be built in a way that makes it
$ echo "If you're a casual user, you probably don't want
$ echo "interpreter-threads at this time. There doesn't yet exist
$ echo "a way to create threads from within Perl in this model,
-$ echo "i.e., "use Thread;" will NOT work.
+$ echo "i.e., ""use Thread;"" will NOT work.
$ echo "
$ dflt = "n"
$ rp = "Build with Interpreter 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
$ 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)."
-$ dflt = "n"
+$ echo ""
+$ echo "This is currently broken in some configurations. Only enable it if
+$ echo "you know what you're doing. "
+$ dflt = "N"
$ rp = "Always use default file types? [''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans="''dflt'"
$ rp = "[''dflt'] "
$ GOSUB myread
$ if ans.eqs."" then ans = "''dflt'"
+$ a = ""
+$ j = 0
+$ xloop1:
+$ x = f$elem(j," ",ans)
+$ j = j + 1
+$ if x .eqs. " " then goto exloop1
+$ xloop2:
+$ k = f$locate("::",x)
+$ if k .ge. f$len(x) then goto exloop2
+$ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
+$ goto xloop2
+$ exloop2:
+$ a = a + " " + x
+$ goto xloop1
+$ exloop1:
+$ ans = f$edit(a,"trim")
+$!
+$ a = ""
+$ j = 0
+$ xloop3:
+$ x = f$elem(j," ",dflt)
+$ j = j + 1
+$ if x .eqs. " " then goto exloop3
+$ xloop4:
+$ k = f$locate("::",x)
+$ if k .ge. f$len(x) then goto exloop4
+$ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
+$ goto xloop4
+$ exloop4:
+$ a = a + " " + x
+$ goto xloop3
+$ exloop3:
+$ dflt = f$edit(a,"trim")
+$!
$ extensions = "''ans'"
$ perl_known_extensions = "''dflt'"
$!
$!
$ 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 (?)
+$ 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 (?)
+$ makefile = " -f Makefile." !wrt MANIFEST dir
+$ UUmakefile = "[-]Makefile." !wrt CWD dir
+$ DEFmakefile = "Makefile." !wrt DEF dir (?)
$ ENDIF
$!
$ IF macros.NES.""
$ echo ""
$ echo4 "%Config-I-VMS, The perl.cld file is now being written..."
$ OPEN/WRITE CONFIG 'file_2_find'
+$ ext = ".exe"
+$ IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
$ IF (use_vmsdebug_perl)
$ THEN
$ WRITE CONFIG "define verb dbgperl"