update local_patches entry for RC2
[p5sagit/p5-mst-13.2.git] / configure.com
CommitLineData
97abc6ad 1$ sav_ver = 'F$VERIFY(0)'
2$! SET VERIFY
3$!
97abc6ad 4$! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will
e6df7ed1 5$! want to cd into the tree and execute Configure:
97abc6ad 6$!
a3ef2c6f 7$! $ SET DEFAULT [USER.PERL5_xxx]
e6df7ed1 8$! $ @Configure
97abc6ad 9$!
10$! or
11$!
a3ef2c6f 12$! $ SET DEFAULT [USER.PERL5_xxx]
e6df7ed1 13$! $ @Configure "-des"
97abc6ad 14$!
15$! That's it. If you get into a bind trying to build perl on VMS then
429a5e67 16$! definitely read through the README.VMS file.
146174a9 17$! Beyond that send email to vmsperl@perl.org
97abc6ad 18$!
19$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20$!
97abc6ad 21$! send suggestions to:
a3ef2c6f 22$! Dan Sugalski <dan@sidhe.org>
97abc6ad 23$! Thank you!!!!
24$!
25$! Adapted and converted from Larry Wall & Andy Dougherty's
429a5e67 26$! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
146174a9 27$! (a Bourne sh[ell] script for configuring the installation of perl
28$! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
97abc6ad 29$! with much valuable help from Charles Bailey &
30$! the whole VMSPerl crew.
429a5e67 31$! Extended and messed about with by Dan Sugalski
97abc6ad 32$!
ccc2aad8 33$ sav_ver = F$VERIFY(0)
97abc6ad 34$!
35$! VMS-isms we will need:
36$ echo = "write sys$output "
37$ cat = "type"
38$ gcc_symbol = "gcc"
39$ ans = ""
40$ macros = ""
c645ec3f 41$ extra_flags = ""
498336ed 42$ user_c_flags = ""
43$ use_debugging_perl = "y"
44$ use_ieee_math = "n"
45$ be_case_sensitive = "n"
a3ef2c6f 46$ use_vmsdebug_perl = "n"
f53b4005 47$ use64bitall = "n"
48$ use64bitint = "n"
97abc6ad 49$ C_Compiler_Replace = "CC="
429a5e67 50$ Thread_Live_Dangerously = "MT="
51$ use_two_pot_malloc = "N"
52$ use_pack_malloc = "N"
53$ use_debugmalloc = "N"
cc391245 54$ d_secintgenv = "N"
5af06f0d 55$ cc_flags = ""
3937c24e 56$ use_multiplicity = "N"
97abc6ad 57$ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
f53b4005 58$ max_allowed_dir_depth = 3 ! e.g. [A.B.PERL5_xxx] not [A.B.C.PERL5_xxx]
59$! max_allowed_dir_depth = 2 ! e.g. [A.PERL5_xxx] not [A.B.PERL5_xxx]
97abc6ad 60$!
61$ vms_filcnt = F$GETJPI ("","FILCNT")
62$!
63$!: compute my invocation name
64$ me = F$ENVIRONMENT("PROCEDURE")
65$!
66$! Many null statements (begin with colon ':') in the Bourne shell version of
67$! this script serve as comments/placeholders. I have retained some of the ones
68$! that will help you compare this .COM file to the sh version - as well as
69$! leave placeholders for future improvements to this .COM file.
70$! sfn = VMS "skipped for now"
71$!
72$!: Proper PATH separator !sfn
73$!: Proper PATH setting !sfn
74$!: Sanity checks !sfn "Say '@''$me''"
75$!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
76$!: Configure runs within the UU subdirectory !->after find MANIFEST
77$! <big long list of default values (mostly null)>
78$!: We must find out about Eunice early !(?)
79$!: list of known cpp symbols, sorted alphabetically !sfn
80$! al = al + "..."
81$!: default library list !sfn
82$! <no hints files in use (yet?)>
83$!: Extra object files, if any, needed on this platform. !sfn
84$!: Possible local include directories to search. !sfn
85$!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
86$!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
87$!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
88$!: no include file wanted by default !sfn
89$!inclwanted='' !sfn
90$!: Possible local library directories to search. !sfn
91$!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
92$!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
93$!: general looking path for locating libraries !sfn
94$!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
95$!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
96$!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
97$!: Private path used by Configure to find libraries. Its value !sfn
98$!: is prepended to libpth. This variable takes care of special !sfn
99$!: machines, like the mips. Usually, it should be empty. !sfn
100$!plibpth='' !sfn
101$!: full support for void wanted by default !sfn
102$!defvoidused=15 !sfn
103$!: List of libraries we want. !sfn
104$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
105$!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
106$!libswanted="$libswanted ucb bsd BSD PW x" !sfn
107$!: We probably want to search /usr/shlib before most other libraries. !sfn
108$!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
109$!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
110$!glibpth="/usr/shlib $glibpth" !sfn
111$!: Do not use vfork unless overridden by a hint file. !sfn
112$!usevfork=false !sfn
113$!: script used to extract .SH files with variable substitutions !sfn
114$!: produce awk script to parse command line options !sfn
115$!sfn (assume no sed awk) see below
116$!: process the command line options
117$!
118$!: set up default values
119$ fastread=""
120$ reuseval="false"
c886fb20 121$ maniskip = "false"
97abc6ad 122$ config_sh=""
123$ alldone=""
124$ error=""
125$ silent=""
126$ extractsh=""
127$ override=""
128$ knowitall=""
129$ Using_Dec_C = ""
97abc6ad 130$ Using_Gnu_C = ""
131$ Dec_C_Version = ""
132$ use_threads = "F"
498336ed 133$ use_5005_threads = "N"
134$ use_ithreads = "N"
97abc6ad 135$!
136$!: option parsing
08c7cbbb 137$ config_args = ""
97abc6ad 138$ IF (P1 .NES. "")
139$ THEN !one or more switches was thrown
140$ i = 1
141$ bang = 0
142$Param_loop:
08c7cbbb 143$ IF (P'i'.NES."")
144$ THEN
145$ bang = bang + 1
146$ config_args = config_args + F$FAO(" !AS",P'i')
147$ ENDIF
97abc6ad 148$ i = i + 1
149$ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
150$!
151$ i = 1
152$Opt_loop:
153$ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
154$ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
155$Remove_quotation_mark:
156$ P'i' = P'i' - """"
157$ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
158$ gotopt = "f" !"alse"
159$ gotshortopt = "f" !"alse"
160$ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
161$ THEN
162$ fastread = "yes"
163$ gotopt = "t" !"rue"
164$ P'i' = P'i' - "d"
165$ gotshortopt = "t" !"rue"
166$ ENDIF
167$ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
168$ THEN
169$ alldone = "cont"
170$ gotopt = "t"
171$ P'i' = P'i' - "e"
172$ gotshortopt = "t"
173$ ENDIF
174$ IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
175$ THEN
176$ P'i' = P'i' - "f"
177$ config_sh = P'i'
178$ IF (F$SEARCH(config_sh).NES."")
179$ THEN
8560c20d 180$ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
181$ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
97abc6ad 182$ THEN
183$ CONTINUE !at this point check UIC && if test allows...
184$ !to be continued ?
185$ ELSE
186$ echo "''me': cannot read config file ''config_sh'."
187$ error="true"
188$ ENDIF
189$ ELSE
190$ echo "''me': cannot read config file ''config_sh'."
191$ error="true"
192$ ENDIF
193$ gotopt = "t"
194$ ENDIF
195$ IF (F$EXTRACT(0,1,P'i') .EQS. "h")
196$ THEN
197$ error = "true"
198$ gotopt = "t"
199$ P'i' = P'i' - "h"
200$ gotshortopt = "t"
201$ ENDIF
c886fb20 202$ IF (F$EXTRACT(0,1,P'i') .EQS. "m")
203$ THEN
204$ maniskip = "true"
205$ gotopt = "t"
206$ P'i' = P'i' - "m"
207$ gotshortopt = "t"
208$ ENDIF
97abc6ad 209$ IF (F$EXTRACT(0,1,P'i') .EQS. "r")
210$ THEN
211$ reuseval = "true"
212$ gotopt = "t"
213$ P'i' = P'i' - "r"
214$ gotshortopt = "t"
215$ ENDIF
216$ IF (F$EXTRACT(0,1,P'i') .EQS. "s")
217$ THEN
218$ silent = "true"
219$ gotopt = "t"
220$ P'i' = P'i' - "s"
221$ gotshortopt = "t"
222$ ENDIF
223$ IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
224$ THEN
225$ alldone = "exit"
226$ gotopt = "t"
227$ ENDIF
228$ IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
229$ THEN
230$ knowitall = "true"
231$ gotopt = "t"
232$ P'i' = P'i' - "K"
233$ gotshortopt = "t"
234$ ENDIF
235$ IF (F$EXTRACT(0,1,P'i') .EQS. "O")
236$ THEN
237$ override = "true"
238$ gotopt = "t"
239$ P'i' = P'i' - "O"
240$ gotshortopt = "t"
241$ ENDIF
242$ IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
243$ THEN
244$ extractsh = "true" !VMS?
245$ gotopt = "t"
246$ P'i' = P'i' - "S"
247$ gotshortopt = "t"
248$ ENDIF
249$ IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
250$ THEN
251$ P'i' = P'i' - "D"
252$!Hmm.. this part needs work
253$! P'i'
254$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
255$ THEN
256$ P'i' = "define"
257$ ELSE
258$ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
259$ THEN
260$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
261$ echo "''me': use '-Usymbol=val' not '-Dsymbol='."
262$ echo "''me': ignoring -D",P'i'
263$ ELSE
264$!Hmm.. this part needs work
265$! 'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
266$! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
267$ ENDIF
268$ ENDIF
269$ ECHO "P''i' =>",P'i',"<=" !Diag
270$ gotopt = "t"
271$ ENDIF
272$ IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
273$ THEN
274$ P'i' = P'i' - "U"
275$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
276$ THEN
277$ P'i' = ""
278$ ELSE
279$ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
280$ THEN
281$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
282$ echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
283$ echo "''me': ignoring -U",P'i'
284$ ELSE
285$ P'i' = "undef"
286$ ENDIF
287$ ENDIF
288$ ECHO "P''i' =>",P'i',"<=" !Diag
289$ gotopt = "t"
290$ ENDIF
291$ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
292$ THEN
293$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
294$ echo "''me' generated by an unknown version of EDT."
295$ STOP
296$ EXIT !0
297$ ENDIF
298$ IF .NOT.gotopt
299$ THEN
300$ echo "''me': unknown option ",P'i'
301$ error = "true"
302$ ENDIF
303$ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
304$ i = i + 1
305$ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
306$!
307$ ENDIF ! (P1 .NES. "")
08c7cbbb 308$ config_args = F$EDIT(config_args,"TRIM")
97abc6ad 309$!
310$ IF (error)
311$ THEN
312$ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
c886fb20 313$ echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
314$ echo " [-Usymbol] [-Usymbol=]"
97abc6ad 315$ TYPE SYS$INPUT
316 "-d" : use defaults for all answers.
317 "-e" : go on without questioning past the production of config.sh. *
318 "-f" : specify an alternate default configuration file.
319 "-h" : print this help message and exit (with an error status).
c886fb20 320 "-m" : skip the MANIFEST check to see that all files are present
97abc6ad 321 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
322 "-s" : silent mode, only echoes questions and essential information.
323 -"D" : define symbol to have some value: *
324 -"Dsymbol" symbol gets the value 'define'
325 -"Dsymbol=value" symbol gets the value 'value'
326 -E : stop at the end of questions, after having produced config.sh. *
327 -K : do not use unless you know what you are doing.
328 -O : let -D and -U override definitions from loaded configuration file. *
329 -S : perform variable substitutions on all .SH files (can mix with -f) *
330 -"U" : undefine symbol: *
331 -"Usymbol" symbol gets the value 'undef'
332 -"Usymbol=" symbol gets completely empty
333 -V : print version number and exit (with a zero status).
334$ echo "%Config-I-VMS, lower case switches must be enclosed"
335$ echo "-Config-I-VMS, in double quotation marks, e.g.:"
336$ echo "-Config-I-VMS, @Configure ""-des"""
337$ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
338$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
339$ STOP
340$ EXIT 3 ! $STATUS = "%X00000003" (informational)
341$ ENDIF
342$!
343$ GOTO Check_silence
344$!
345$Shut_up:
01792a70 346$ IF F$Mode() .eqs. "BATCH"
347$ THEN
348$ STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
349$ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid file locking conflicts,"
350$ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
351$ WRITE SYS$OUTPUT STDOUT
352$ ELSE
353$ STDOUT = F$TRNLNM("SYS$OUTPUT")
354$ ENDIF
97abc6ad 355$ DEFINE SYS$OUTPUT "_NLA0:"
356$ echo4 = "write STDOUT "
357$ cat4 = "TYPE/OUTPUT=''STDOUT'"
01792a70 358$ open/write/share=read STDOUT 'STDOUT'
97abc6ad 359$ RETURN
360$!
361$Check_silence:
362$ IF (silent)
363$ THEN
364$ GOSUB Shut_up
365$ ELSE
366$ echo4 = "write SYS$OUTPUT "
367$ cat4 = "TYPE"
368$ ENDIF
369$!
370$!: run the defines and the undefines, if any, but leave the file out there...
371$! Unfortunately Configure.COM in DCL is not yet set up to do this -
372$! maybe someday
373$!
374$!: set package name
375$ package = "perl5"
f53b4005 376$ packageup = F$EDIT((package - "5"),"UPCASE")
97abc6ad 377$!
378$!: Eunice requires " " instead of "", can you believe it
379$ echo ""
380$!: Here we go...
381$ echo "Beginning of configuration questions for ''package'."
382$ echo ""
383$!
384$!: Some greps do not return status, grrr.
385$ contains = "SEARCH"
386$!
387$!: first determine how to suppress newline on echo command !cant DCL is record oriented
388$! echo "Checking ''echo' to see how to suppress newlines..."
389$! echo "giving up..."
390$! echo "The star should be here-->*"
391$!
392$!: Now test for existence of everything in MANIFEST
393$ echo ""
394$ echo4 "First let's make sure your kit is complete. Checking..."
395$ manifestfound = ""
396$ miss_list = ""
397$! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
398$! because the search routine simply does set def [-] if necessary.
399$ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
400$Research_manifest:
401$ manifestfound = F$SEARCH(file_2_find)
402$ IF (manifestfound .EQS. "")
403$ THEN
404$ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
405$ THEN
406$ SET DEFAULT [-]
407$ GOTO Research_manifest
408$ ELSE
409$ echo ""
410$ echo "There is no MANIFEST file. I hope your kit is complete !"
411$ miss_list = ""
412$ GOTO Beyond_manifest
413$ ENDIF
414$ ELSE
415$! MANIFEST. has been found and we have set def'ed there -
416$! time to bail out before it's too late.
e6df7ed1 417$ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
a3ef2c6f 418$ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
97abc6ad 419$ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
420$ THEN
421$ TYPE SYS$INPUT:
422%Config-E-VMS, ERROR:
423 Sorry! It apears as though your perl build sub-directory is already too
424 deep into the VMS file system. Please try moving stuff into a shallower
425 directory (or altering the "max_allowed_dir_depth" parameter).
426$ echo4 "ABORTING..."
427$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
428$ STOP
429$ EXIT !2 !$STATUS = "%X00000002" (error)
430$ ENDIF
e6df7ed1 431$Beyond_depth_check:
97abc6ad 432$!
433$! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
434$!
435$ IF (manifestfound .NES. "")
436$ THEN
437$ IF ( F$SEARCH("UU.DIR").EQS."" )
438$ THEN
439$ CREATE/DIRECTORY [.UU]
440$ ELSE
441$ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
442$ ENDIF
443$!: Configure runs within the UU subdirectory
444$ SET DEFAULT [.UU]
445$!
446$! a little redundancy never hurt anybody?
447$ file_2_find = "[-]" + file_2_find
448$ manifestfound = F$SEARCH(file_2_find)
449$!
450$ OPEN/WRITE MISSING MISSING.
451$!change to "FALSE" if you wish to skip the manifest search
452$!(which after all is rather slow in DCL :-)
c886fb20 453$ IF (maniskip)
97abc6ad 454$ THEN
c886fb20 455$ echo "Skipping MANIFEST check as requested"
456$ ELSE
457$!
97abc6ad 458$ OPEN/READ CONFIG 'manifestfound'
459$Read_loop_manifest:
460$ READ/END_OF_FILE = Done_manifest CONFIG line
461$! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
462$! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
463$! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
464$! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
465$ line = F$EDIT(line,"TRIM, COMPRESS")
466$ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
467$ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
468$ THEN
469$Re_strip_line_manifest:
470$ loca = F$LOCATE("/",file_2_find)
471$ ante = F$EXTRACT(0,loca,file_2_find)
472$ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
473$ test_this = ante + "." + (post - "/")
474$ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
475$ THEN
476$ file_2_find = ante + "." + (post - "/")
477$ GOTO Re_strip_line_manifest
478$ ELSE
479$ file_2_find = ante + "]" + (post - "/")
480$ ENDIF
481$ file_2_find = "[-."+file_2_find
482$ ELSE
483$ file_2_find = "[-]" + file_2_find
484$ ENDIF
485$!
486$ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
487$ file_2_find = file_2_find - dirname
488$ dots = 0
489$Dot_loop:
490$ dot_ele = F$ELEMENT(dots,".",file_2_find)
491$ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
492$ IF dots .eq. 0
493$ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
494$ ELSE basename = basename + dot_ele + "_"
495$ ENDIF
496$ dots = dots + 1
497$ GOTO dot_loop
498$Eo_dot_loop:
499$ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
500 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
501 basename = f$extract(0,f$length(basename)-1,basename)
502$ file_2_find = dirname + basename
503$!
504$ found = F$SEARCH(file_2_find)
146174a9 505$ IF (found .EQS. "" .AND. dots .GT. 2)
506$ THEN
507$! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
508$! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
509$! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
510$ basename[f$locate(".",basename),1] := _
511$ dot_ele = F$ELEMENT(dots - 1,"_",basename)
512$ basename = -
513 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
514 + "." + dot_ele
515$ found = F$SEARCH(dirname + basename)
516$ file_2_find = file_2_find + "," + basename
517$ ENDIF
97abc6ad 518$ IF (found .EQS. "")
519$ THEN
520$ WRITE MISSING file_2_find
521$ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
522$ THEN
523$ miss_list = miss_list + "," + file_2_find
524$ ENDIF
525$ ENDIF
526$ GOTO Read_loop_manifest
527$Done_manifest:
528$ CLOSE CONFIG
529$ ENDIF !"TRUE"
530$ CLOSE MISSING
531$ ENDIF ! (manifestfound .NES. "")
532$Beyond_manifest:
533$ IF (miss_list .NES. "")
534$ THEN
535$ echo "Some of the files not found include:"
536$ cat4 MISSING.
537$ ENDIF
538$ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
539$ THEN
540$ TYPE SYS$INPUT:
541
542THIS PACKAGE SEEMS TO BE INCOMPLETE.
543
544You have the option of continuing the configuration process, despite the
545distinct possibility that your kit is damaged, by typing 'y'es. If you
546do, don't blame me if something goes wrong. I advise you to type 'n'o
498336ed 547and contact the author (dan@sidhe.org)
97abc6ad 548
549$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
550$ IF ans
551$ THEN
552$ echo4 "Continuing..."
553$ ELSE
554$ echo4 "ABORTING..."
555$ GOTO Clean_up
556$ ENDIF
557$ ELSE
558$ echo4 "Looks good..."
559$ DELETE/NOLOG MISSING.;
560$ ENDIF ! (miss_list .NES. "")
561$ ENDIF ! (manifestfound .EQS. "") ELSE
562$!
563$! after finding MANIFEST (see above)
564$!: Configure runs within the UU subdirectory
565$!
566$!: compute the number of columns on the terminal for proper question formatting
567$! (sfn, will assume 80-ish)
568$!
569$!: set up the echo used in my read !sfn
570$!: now set up to do reads with possible shell escape and default assignment !sfn
571$ GOTO Beyond_myread
572$!
573$myread:
574$ ans = ""
575$ If (fastread)
576$ Then
577$ echo4 "''rp'"
578$ Else
579$ If (silent)
580$ Then
581$ READ SYS$COMMAND/PROMPT="''rp'" ans
582$ Else
583$ echo ""
584$ READ SYS$COMMAND/PROMPT="''rp'" ans
585$ Endif
586$ Endif
587$ RETURN
588$!
589$Beyond_myread:
590$!
591$!: create .config dir to save info across Configure sessions
592$ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
593$ THEN
594$ CREATE/DIRECTORY [-.CONFIG]
595$ OPEN/WRITE CONFIG [-.CONFIG]README.
596$ WRITE CONFIG -
597 "This directory created by Configure to save information that should"
598$ WRITE CONFIG -
599 "persist across sessions."
600$ WRITE CONFIG ""
601$ WRITE CONFIG -
602 "You may safely delete it if you wish."
603$ CLOSE CONFIG
604$ ENDIF
605$!
606$!: general instructions
607$ needman = "true"
608$ firsttime = "true"
609$ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
610$ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
611$ THEN
612$ messages = F$ENVIRONMENT("MESSAGE")
a3ef2c6f 613$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
97abc6ad 614$ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
615$ IF .NOT.($status.EQ.%X08D78053)
616$ THEN
617$ firsttime=""
618$ dflt = "n"
619$ rp = "Would you like to see the instructions? [''dflt'] "
620$ GOSUB myread
621$ if .NOT.ans THEN needman=""
622$ ENDIF
a3ef2c6f 623$ SET MESSAGE 'messages'
97abc6ad 624$ ENDIF
625$ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
626$!
627$ IF (needman)
628$ THEN
629$ TYPE SYS$INPUT:
630
631This installation shell script will examine your system and ask you questions
632to determine how the perl5 package should be installed. If you get
633stuck on a question, you may use a ^C or ^Y shell escape to STOP this
634process, edit something, then restart this process as you just did.
635Many of the questions will have default answers in square
636brackets; typing carriage return will give you the default.
637
638$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
639$ TYPE SYS$INPUT:
640
a3ef2c6f 641In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
97abc6ad 642the questions and use the computed defaults (or the previous answers provided
a3ef2c6f 643there was already a config.sh file). Type '@Configure "-h"' for a list of
97abc6ad 644options.
645
646$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
647$ TYPE SYS$INPUT:
648
649Much effort has been expended to ensure that this shell script will
650run on any VMS system. If despite that it blows up on yours, your
651best bet is to edit Configure.com and @ it again. Whatever problems
498336ed 652you have with Configure.com, let me (dan@sidhe.org) know how I blew
97abc6ad 653it.
654
655$!This installation script affects things in two ways:
656$!
657$!1) it may do direct variable substitutions on some of the files included
658$! in this kit.
659$!2) it builds a config.h file for inclusion in C programs. You may edit
660$! any of these files as the need arises after running this script.
661$!
662$!If you make a mistake on a question, there is no easy way to back up to it
663$!currently.
664$!
665$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
666$ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
667$ THEN
668$ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
669$ WRITE CONFIG user
670$ CLOSE CONFIG
671$ ENDIF
672$ ENDIF !(needman .EQS. "true")
673$!
674$!: see if sh knows # comments !sfn
675$ sharpbang = "$ "
676$!: figure out how to guarantee sh startup !sfn
677$!: find out where common programs are !sfn
678$!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
679$!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
680$! echo "I don't know where '$file' is, and my life depends on it."
681$! echo "Go find a public domain implementation or fix your PATH setting!"
682$! echo ""
683$! echo "Don't worry if any of the following aren't found..."
684$!: determine whether symbolic links are supported !sfn
685$!: see whether [:lower:] and [:upper:] are supported character classes !sfn
686$!: set up the translation script tr, must be called with ./tr of course !sfn
687$!
688$!: Try to determine whether config.sh was made on this system
689$!: Get old answers from old config file if Configure was run on the
690$!: same system, otherwise use the hints.
691$ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
692$ i = 0
693$ max = 3
694$Config_sh_look:
695$ config_sh = F$ELEMENT(i,"/",config_sh_es)
696$ i = i + 1
697$ IF (config_sh.NES."/").AND.(config_sh.NES."")
698$ THEN
699$ configshfound = F$SEARCH(config_sh)
700$ IF (configshfound.NES."") THEN GOTO Config_sh_found
701$ ENDIF
702$ IF (i.LT.max) THEN GOTO Config_sh_look
703$ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
704$Config_sh_found:
705$ echo ""
706$ echo "Fetching default answers from ''config_sh'..."
707$!we actually do not have "hints/" for VMS
708$! TYPE SYS$INPUT:
709$!
710$!First time through, eh? I have some defaults handy for the following systems:
711$!
712$! echo " ","VMS_VAX"
713$! echo " ","VMS_AXP"
714$! : Now look for a hint file osname_osvers, unless one has been
715$! : specified already.
716$! TYPE SYS$INPUT:
717$!
718$!You may give one or more space-separated answers, or "none" if appropriate.
719$!If your OS version has no hints, DO NOT give a wrong version -- say "none".
720$!
721$! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
722$!
723$Beyond_config_sh:
724$!
725$!: Restore computed paths !sfn
726$!
727$! genconfig.pl has "osname='VMS'"
728$ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
729$! %Config-I-VMS, a necessary error trap (could be PC running VCL)
730$!
731$ IF (osname .NES. "VMS")
732$ THEN
733$ echo4 "Hmm.. I wonder what ''osname' is (?)"
734$ TYPE SYS$INPUT:
735
736%Config-E-VMS, ERROR:
737
738 Err, you do not appear to be running VMS!
146174a9 739 This procedure is intended to Configure the building of Perl for VMS.
97abc6ad 740
741$ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
742$ IF ans
743$ THEN
744$ echo4 "Continuing..."
745$ ELSE
746$ echo4 "ABORTING..."
747$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
748$ STOP
749$ EXIT 2 !$STATUS = "%X00000002" (error)
750$ ENDIF
751$ ELSE !we are on VMS huzzah!
752$ IF .NOT.silent
753$ THEN TYPE SYS$INPUT:
754
755Configure uses the operating system name and version to set some defaults.
756The default value is probably right if the name rings a bell. Otherwise,
757since spelling matters for me, either accept the default or answer "none"
758to leave it blank.
759$ ENDIF
760$ rp = "Operating system name? [''osname'] "
761$ GOSUB myread
762$ IF ans.nes.""
763$ THEN
764$ IF (ans.NES.osname) !.AND.knowitall
765$ THEN
766$ echo4 "I'll go with ''osname' anyway..."
767$ ENDIF
768$ ENDIF
769$ ENDIF !(osname .NES./.EQS. "VMS")
770$!
771$!: who configured the system
772$! see 'user' above.
773$ cf_by = F$EDIT(user,"LOWERCASE")
774$! cf_time = F$CVTIME() !superceded by procedure below
08c7cbbb 775$ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
97abc6ad 776$!
777$! Peter Prymmer has seen:
778$! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
779$! "SYS$TIME_ZONE" = "EDT"
780$!
781$! Charles Lane recommended:
782$! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
783$! "NEWS_TIMEZONE" = "-0500"
784$! "ST_TIMEZONE" = "EDT"
785$! "JAN_TIME_ZONE" = "EST "
786$! "MULTINET_TIMEZONE" = "EST"
787$! "DAYLIGHT_SAVINGS" = "1"
788$!
789$! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
790$! "PMDF_Timezone"
791$! "Multinet_Timezone"
792$! "TCPware_Timezone"
793$! "WIN$Time_Zone"
794$!
795$! This snippet o' DCL returns a string in default Unix `date` format,
796$! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
797$! Peter Prymmer pvhp@lns62.lns.cornell.edu
798$!
799$ MIN_TZO = -840 !units are minutes here
800$ MAX_TZO = 840
801$!
802$ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
803$ monn = F$CVTIME(,,"MONTH")
804$ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
805$ hour = F$CVTIME(,,"HOUR")
806$ min = F$CVTIME(,,"MINUTE")
807$ sec = F$CVTIME(,,"SECOND")
808$ year = F$CVTIME(,,"YEAR")
809$!
810$ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
811$ i = 0
812$Mon_loop:
813$ i = i + 1
814$ mon = F$ELEMENT(i,"/",months)
815$ IF i.LT.monn THEN GOTO Mon_loop
816$!
817$ tzneedset = "t"
818$ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
819$ IF systz.NES.""
820$ THEN
821$ tzhour = F$INTEGER(systz)/3600
822$ tzmins = F$INTEGER(systz)/60
823$ tzminrem = tzmins - tzhour*60
824$ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
825$ IF tzhour.ge.0
826$ THEN signothetime = "+"
827$ IF tzhour.EQ.0.AND.tzminrem.EQ.0
828$ THEN direction = "on GMT/"
829$ ELSE direction = "east of "
830$ ENDIF
831$ ELSE signothetime = "-"
832$ tzhour = -1*tzhour !keeps !UL happy
833$ direction = "west of "
834$ ENDIF
835$ echo ""
836$ echo "%Config-I-VMS,"
837$ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
838$ IF tzminrem.ne.0
839$ THEN
840$ tzspan = "''tzhour' hours & ''tzminrem' minutes"
841$ ELSE
842$ tzspan = "''tzhour' hours"
843$ ENDIF
844$ dflt = "y"
845$ echo "Your system is ''tzspan' ''direction'UTC in England."
846$ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
847$ GOSUB myread
848$ IF ans.OR.(ans.EQS."")
849$ THEN
850$ tzneedset = "f"
851$ tzd = systz
852$ GOTO Beyond_TimeZone
853$ ENDIF
854$ ELSE
855$ echo ""
856$ echo4 "%Config-I-VMS,"
857$ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
858$ ENDIF
859$!
860$TZSet:
861$ echo ""
862$ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
146174a9 863$ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
97abc6ad 864$ echo "Eastern Daylight Time (summer) is -4:00 offset."
865$ dflt = "0:00"
866$ rp = "Enter the Time Zone offset: [''dflt'] "
867$ GOSUB myread
868$ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
869$ IF ans.EQS."" THEN ans = dflt
870$ tzhour = F$ELEMENT(0,":","''ans'") !first
871$ IF tzhour.EQS."" THEN tzhour = 0
872$ tzhour = F$INTEGER(tzhour)
873$ tzminrem = F$ELEMENT(1,":","''ans'") !second
874$ IF tzminrem.NES.""
875$ THEN
876$ tzminrem = F$INTEGER(tzminrem)
877$ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
878$ ELSE
879$ tzminrem = 0
880$ ENDIF
881$ tzmins = tzhour*60 + tzminrem
882$ tzd = F$STRING(tzmins*60)
883$ IF tzhour .GE. 0
884$ THEN
885$ signothetime = "+"
886$ ELSE
887$ tzhour = -1*tzhour !keeps !UL happy
888$ signothetime = "-"
889$ ENDIF
890$ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
891$ THEN
892$ echo ""
893$ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
894$ goto TZSet
895$ ENDIF
896$!
897$Beyond_TimeZone:
898$ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
899$ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
900$!
901$!: determine the architecture name
902$! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
903$!
904$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
905$ THEN
906$ archname = "VMS_VAX"
146174a9 907$ otherarch = "an Alpha"
08c7cbbb 908$ alignbytes="8"
909$ arch_type = "ARCH-TYPE=__VAX__"
97abc6ad 910$ ELSE
911$ archname = "VMS_AXP"
146174a9 912$ otherarch = "a VAX"
08c7cbbb 913$ alignbytes="8"
914$ arch_type = "ARCH-TYPE=__AXP__"
97abc6ad 915$ ENDIF
916$ rp = "What is your architecture name? [''archname'] "
917$ GOSUB myread
918$ IF ans.NES.""
919$ THEN
920$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
921$ IF (ans.NES.archname) !.AND.knowitall
922$ THEN
923$ echo4 "I'll go with ''archname' anyway..."
924$ ENDIF
925$ ENDIF
146174a9 926$ dflt = "n"
927$ rp = "Will you be sharing your PERL_ROOT with ''otherarch'? [''dflt'] "
928$ GOSUB myread
929$ if ans.NES.""
97abc6ad 930$ THEN
146174a9 931$ ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
932$ ENDIF
933$ IF (ans.NES."Y")
934$ THEN
935$ sharedperl = "N"
936$ ELSE
937$ sharedperl = "Y"
938$ IF (archname.EQS."VMS_AXP")
97abc6ad 939$ THEN
97abc6ad 940$ macros = macros + """AXE=1"","
941$ ENDIF
97abc6ad 942$ ENDIF
943$!
944$!: is AFS running? !sfn
945$!: decide how portable to be. Allow command line overrides. !sfn
946$!: set up shell script to do ~ expansion !sfn
947$!: expand filename !sfn
948$!: now set up to get a file name !sfn
949$!
f53b4005 950$ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
951$ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
952$ prefixbase = prefix - "]"
953$ prefix = prefixbase + ".]"
954$!: determine root of directory hierarchy where package will be installed.
955$ dflt = prefix
956$ IF .NOT.silent
957$ THEN
958$ echo ""
959$ echo "By default, ''package' will be installed in ''dflt', pod"
960$ echo "pages under ''prefixbase'LIB.POD], etc..., i.e. with ''dflt' as prefix for"
961$ echo "all installation directories."
962$ echo "On ''osname' the ''prefix' is used to DEFINE the ''packageup'_ROOT prior to installation"
963$ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
964$ ENDIF
965$ rp = "Installation prefix to use (for ''packageup'_ROOT)? [ ''dflt' ] "
966$ GOSUB myread
967$ IF ans.NES.""
968$ THEN
969$ prefix = ans
970$ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
971$ ELSE
972$ prefix = dflt
973$ ENDIF
974$!
975$! Check here for pre-existing PERL_ROOT.
976$! -> ask if removal desired.
977$! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
978$! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
979$!
97abc6ad 980$ vms_skip_install = "true"
981$ dflt = "y"
982$! echo ""
08c7cbbb 983$ rp = "%Config-I-VMS, Skip the remaining """"where install"""" questions? [''dflt'] "
97abc6ad 984$ GOSUB myread
985$ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
97abc6ad 986$ IF (.NOT.vms_skip_install)
987$ THEN
97abc6ad 988$!
989$!: set the prefixit variable, to compute a suitable default value
990$!
991$!: determine where private library files go
992$!: Usual default is /usr/local/lib/perl5. Also allow things like
993$!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
994$ IF .NOT.silent
995$ THEN TYPE SYS$INPUT:
996
997There are some auxiliary files for perl5 that need to be put into a
998private library directory that is accessible by everyone.
999$ ENDIF
1000$ dflt = prefix - ".]" + ".LIB]"
1001$ rp = "Pathname where the private library files will reside? "
1002$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1003$ GOSUB myread
1004$ IF ans.NES.""
1005$ THEN privlib = ans
1006$ ELSE privlib = dflt
1007$ ENDIF
1008$!
f53b4005 1009$ ENDIF !%Config-I-VMS, skip remaining "where install" questions
97abc6ad 1010$!
86fced14 1011$ perl_symbol = "true"
1012$ perl_verb = ""
1013$ dflt = "y"
1014$ IF .NOT.silent
1015$ THEN
1016$ echo ""
1017$ echo "%Config-I-VMS, You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1018$ echo "-Config-I-VMS, symbol to invoke ''package', which is the usual method."
1019$ echO "-Config-I-VMS, If you do not do so then you would need a DCL command verb at the"
1020$ echo "-Config-I-VMS, process or the system wide level."
1021$ ENDIF
1022$ rp = "Invoke perl as a global symbol foreign command [''dflt'] "
1023$ GOSUB myread
1024$ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
1025$!
1026$ IF (.NOT.perl_symbol)
1027$ THEN
1028$ dflt = "y"
1029$ IF .NOT.silent
1030$ THEN
1031$ echo ""
1032$ echo "%Config-I-VMS, Since you won't be using a symbol you must choose to put the ''packageup'"
1033$ echo "-Config-I-VMS, verb in a per-process table or in the system wide DCLTABLES (which"
1034$ echo "-Config-I-VMS, would require write privilege)."
1035$ ENDIF
1036$ rp = "Invoke perl as a per process command verb [ ''dflt' ] "
1037$ GOSUB myread
1038$ IF (.NOT.ans).AND.(ans.NES."")
1039$ THEN perl_verb = "DCLTABLES"
1040$ ELSE perl_verb = "PROCESS"
1041$ ENDIF
1042$ ENDIF ! (.NOT.perl_symbol)
1043$!
97abc6ad 1044$!: set the base revision
08c7cbbb 1045$ baserev="5.0"
1046$ revision = baserev - ".0"
97abc6ad 1047$!: get the patchlevel
1048$ echo ""
1049$ echo4 "Getting the current patchlevel..." !>&4
1050$ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1051$ IF (patchlevel_h.NES."")
1052$ THEN
1053$ got_patch = "false"
1054$ got_sub = "false"
08c7cbbb 1055$ got_api_revision = "false"
1056$ got_api_version = "false"
1057$ got_api_subversion = "false"
97abc6ad 1058$ OPEN/READONLY CONFIG 'patchlevel_h'
1059$Patchlevel_h_loop:
1060$ READ/END_Of_File=Close_patch CONFIG line
cceca5ed 1061$ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
97abc6ad 1062$ THEN
1063$ line = F$EDIT(line,"COMPRESS, TRIM")
cc391245 1064$ patchlevel = F$ELEMENT(2," ",line)
97abc6ad 1065$ got_patch = "true"
1066$ ENDIF
cceca5ed 1067$ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
97abc6ad 1068$ THEN
1069$ line = F$EDIT(line,"COMPRESS, TRIM")
cc391245 1070$ subversion = F$ELEMENT(2," ",line)
97abc6ad 1071$ got_sub = "true"
1072$ ENDIF
08c7cbbb 1073$ IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1074$ THEN
1075$ line = F$EDIT(line,"COMPRESS, TRIM")
1076$ api_revision = F$ELEMENT(2," ",line)
1077$ got_api_revision = "true"
1078$ ENDIF
1079$ IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1080$ THEN
1081$ line = F$EDIT(line,"COMPRESS, TRIM")
1082$ api_version = F$ELEMENT(2," ",line)
1083$ got_api_version = "true"
1084$ ENDIF
1085$ IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1086$ THEN
1087$ line = F$EDIT(line,"COMPRESS, TRIM")
1088$ api_subversion = F$ELEMENT(2," ",line)
1089$ got_api_subversion = "true"
1090$ ENDIF
97abc6ad 1091$ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1092$Close_patch:
1093$ CLOSE CONFIG
1094$ ELSE
1095$ patchlevel="0"
1096$ subversion="0"
1097$ ENDIF
08c7cbbb 1098$ IF (F$STRING(subversion) .NES. "0")
97abc6ad 1099$ THEN
08c7cbbb 1100$ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
1101$ ELSE
1102$ echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
97abc6ad 1103$ ENDIF
1104$!
08c7cbbb 1105$ version = revision + "_" + patchlevel + "_" + subversion
97abc6ad 1106$!
1107$ IF (.NOT.vms_skip_install)
1108$ THEN
1109$!: set the prefixup variable, to restore leading tilda escape !sfn
1110$!: set the prefixup variable, to restore leading tilde escape !sfn
1111$!
1112$!: determine where public architecture dependent libraries go
1113$ IF (.NOT.silent)
1114$ THEN
1115$ echo ""
1116$ echo "''package' contains architecture-dependent library files. If you are"
1117$ ENDIF
1118$ IF (.NOT.silent)
1119$ THEN TYPE SYS$INPUT:
1120sharing libraries in a heterogeneous environment, you might store
1121these files in a separate location. Otherwise, you can just include
1122them with the rest of the public library files.
1123$ ENDIF
1124$ dflt = privlib - "]" + "." + archname + "." + version + "]"
1125$ rp = "Where do you want to put the public architecture-dependent libraries? "
1126$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1127$ GOSUB myread
1128$ IF ans.NES.""
1129$ THEN archlib = ans
1130$ ELSE archlib = dflt
1131$ ENDIF
1132$!
1133$!: set up the script used to warn in case of inconsistency !sfn
1134$!: function used to set $1 to $val !sfn
1135$!
1136$ ENDIF !%Config-I-VMS, skip "where install" questions
1137$! This quotation from Configure has to be included on VMS:
1138$ TYPE SYS$INPUT:
1139
1140There is, however, a strange, musty smell in the air that reminds me of
1141something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1142$ CONTINUE
1143$ IF (.NOT.vms_skip_install)
1144$ THEN
1145$!: it so happens the Eunice I know will not run shell scripts in Unix format
1146$!
1147$!: see if setuid scripts can be secure !sfn
1148$!: now see if they want to do setuid emulation !sfn
1149$!
1150$!: determine where site specific libraries go.
1151$ IF .NOT.silent
1152$ THEN TYPE SYS$INPUT:
1153
1154The installation process will also create a directory for
1155site-specific extensions and modules. Some users find it convenient
1156to place all local files in this directory rather than in the main
1157distribution directory.
1158$ ENDIF
1159$ dflt = privlib - "]" + ".SITE_PERL]"
1160$ rp = "Pathname for the site-specific library files? "
1161$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1162$ GOSUB myread
1163$ IF ans.NES.""
1164$ THEN sitelib = ans
1165$ ELSE sitelib = dflt
1166$ ENDIF
1167$!
1168$!: determine where site specific architecture-dependent libraries go.
1169$ IF .NOT.silent
1170$ THEN TYPE SYS$INPUT:
1171
1172The installation process will also create a directory for
1173architecture-dependent site-specific extensions and modules.
1174$ ENDIF
1175$ dflt = sitelib - "]" + "." + archname + "]"
1176$ rp = "Pathname for the site-specific architecture-dependent library files? "
1177$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1178$ GOSUB myread
1179$ IF ans.NES.""
1180$ THEN sitearch = ans
1181$ ELSE sitearch = dflt
1182$ ENDIF
1183$!
1184$!: determine where old public architecture dependent libraries might be
1185$!
1186$!: determine where public executables go
1187$ dflt = prefix - ".]" + ".BIN]"
1188$ rp = "Pathname where the public executables will reside? "
1189$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1190$ GOSUB myread
1191$ IF ans.NES.""
1192$ THEN bin = ans
1193$ ELSE bin = dflt
1194$ ENDIF
1195$!
1196$!: determine where manual pages are on this system
1197$!: What suffix to use on installed man pages
1198$!: see if we can have long filenames
1199$!: determine where library module manual pages go
1200$!: What suffix to use on installed man pages
1201$!: see what memory models we can support
1202$!
1203$ ENDIF !%Config-I-VMS, skip "where install" questions
1204$!
1205$!: see if we need a special compiler
01792a70 1206$! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
97abc6ad 1207$!
1208$ nocc = "f"
1209$ vms_cc_dflt = ""
1210$ vms_cc_available = ""
1211$!
1212$ OPEN/WRITE CONFIG ccvms.c
1213$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1214$ WRITE CONFIG "#include <stdio.h>"
1215$ WRITE CONFIG "int main() {"
1216$ WRITE CONFIG "#ifdef __DECC"
1217$ WRITE CONFIG " printf(""/DECC\n"");"
1218$ WRITE CONFIG "#else"
1219$ WRITE CONFIG " printf(""/VAXC\n"");"
1220$ WRITE CONFIG "#endif"
1221$ WRITE CONFIG " exit(0);"
1222$ WRITE CONFIG "}"
1223$ CLOSE CONFIG
1224$!
5af06f0d 1225$! DEFINE SYS$ERROR _NLA0:
1226$! DEFINE SYS$OUTPUT _NLA0:
97abc6ad 1227$ cc/NoObj/list=ccvms.lis ccvms.c
1228$ tmp = $status
5af06f0d 1229$! DEASSIGN SYS$OUTPUT
1230$! DEASSIGN SYS$ERROR
97abc6ad 1231$ IF (silent) THEN GOSUB Shut_up
1232$! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1233$!
1234$ IF tmp.NE.%X10B90001
1235$ THEN
1236$ IF tmp.NE.%X10000001
1237$ THEN
1238$ nocc = "t" !%X10000001 is return from gcc
1239$ GOTO Gcc_initial_check
1240$ ENDIF
1241$ ENDIF
1242$!
1243$ GOSUB List_Parse
1244$ IF .NOT.silent THEN echo ""
1245$ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1246$ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1247$ THEN
97abc6ad 1248$ IF .NOT.silent
1249$ THEN
1250$ echo "%Config-I-VMS, Will try cc/decc..."
1251$ ENDIF
1252$ DEFINE SYS$ERROR _NLA0:
1253$ DEFINE SYS$OUTPUT _NLA0:
1254$ SET NOON
1255$ cc/decc/NoObj/list=ccvms.lis ccvms.c
1256$ tmp = $status
1257$ DEASSIGN SYS$OUTPUT
1258$ DEASSIGN SYS$ERROR
1259$ SET ON
1260$ IF (silent) THEN GOSUB Shut_up
1261$ IF tmp.NE.%X10B90001
1262$ THEN
1263$ echo "%Config-I-VMS, Apparently you don't have that one."
1264$ ELSE
1265$ GOSUB List_parse
1266$ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1267$ vms_cc_available = vms_cc_available + "cc/decc "
1268$ ENDIF
1269$ ELSE
5af06f0d 1270$ IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
97abc6ad 1271$ THEN
1272$ vms_cc_dflt = "/decc"
1273$ vms_cc_available = vms_cc_available + "cc/decc "
97abc6ad 1274$ ENDIF
1275$ ENDIF
1276$!
1277$Gcc_initial_check:
1278$ echo "%Config-I-VMS, Checking for Gcc"
1279$ OPEN/WRITE CONFIG gccvers.lis
1280$ DEFINE SYS$ERROR CONFIG
1281$ DEFINE SYS$OUTPUT CONFIG
1282$ 'gcc_symbol'/noobj/version _nla0:
1283$ tmp = $status
1284$ DEASSIGN SYS$OUTPUT
1285$ DEASSIGN SYS$ERROR
1286$ IF (silent) THEN GOSUB Shut_up
1287$ CLOSE CONFIG
1288$ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1289$ THEN
1290$ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1291$ goto cc_cleanup
1292$ ENDIF
1293$ OPEN/READ CONFIG gccvers.lis
1294$GCC_List_Read:
1295$ READ/END_OF_FILE=GCC_List_End CONFIG line
1296$ GOTO GCC_List_Read
1297$GCC_List_End:
1298$ CLOSE CONFIG
1299$ echo line
1300$ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1301$ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1302$!
1303$CC_Cleanup:
1304$ DELETE/NOLOG/NOCONFIRM ccvms.*;
1305$CC_Desired:
1306$!: see if we need a special compiler
1307$! echo ""
1308$ echo "%Config-I-VMS, available compiler(s):"
1309$ echo "( ''vms_cc_available')"
1310$ IF .NOT.nocc
1311$ THEN
1312$ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1313$ ELSE
1314$ dflt = gcc_symbol
1315$ ENDIF
1316$ rp = "Use which C compiler? [''dflt'] "
1317$ GOSUB myread
1318$ IF ans.NES.""
1319$ THEN
1320$ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1321$ Mcc = ans
5af06f0d 1322$ IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
97abc6ad 1323$ THEN
1324$ Mcc = "cc/decc"
1325$ Using_Dec_C = "Yes"
429a5e67 1326$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1327$ ENDIF
97abc6ad 1328$ IF Mcc.NES.dflt
1329$ THEN
5af06f0d 1330$ IF (F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)).or(F$LOCATE("compaq",dflt).NE.F$LENGTH(dflt))
97abc6ad 1331$ THEN
1332$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1333$ ELSE
1334$ Using_Dec_C = "Yes"
97abc6ad 1335$ ENDIF
1336$ ELSE
1337$ IF Mcc .EQS. "cc/decc"
1338$ THEN
1339$ Using_Dec_C = "Yes"
429a5e67 1340$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1341$ ENDIF
1342$ ENDIF
1343$ ELSE
1344$ Mcc = dflt
1345$ IF Mcc .EQS. "cc/decc"
1346$ THEN
1347$ Using_Dec_C = "Yes"
429a5e67 1348$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1349$ ENDIF
97abc6ad 1350$ IF Mcc .EQS. "gcc"
1351$ THEN
1352$ Using_Gnu_C = "Yes"
429a5e67 1353$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1354$ ENDIF
1355$ ENDIF
1356$Decc_Version_check:
1357$ IF "''Using_Dec_C'".EQS."Yes"
1358$ THEN
1359$ echo ""
1360$ echo4 "Checking for Dec C's version number..." !>&4
1361$ OPEN/WRITE CONFIG deccvers.c
1362$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1363$ WRITE CONFIG "#include <stdio.h>"
1364$ WRITE CONFIG "int main() {"
1365$ WRITE CONFIG "#ifdef __DECC"
1366$ WRITE CONFIG "#ifdef __DECC_VER"
1367$ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1368$ WRITE CONFIG "#else"
1369$ WRITE CONFIG " printf(""%i\n"", ""1"");"
1370$ WRITE CONFIG "#endif"
1371$ WRITE CONFIG "#endif"
1372$ WRITE CONFIG " exit(0);"
1373$ WRITE CONFIG "}"
1374$ CLOSE CONFIG
1375$ DEFINE SYS$ERROR _NLA0:
1376$ DEFINE SYS$OUTPUT _NLA0:
1377$ 'Mcc' deccvers.c
1378$ tmp = $status
1379$ DEASSIGN SYS$ERROR _NLA0:
1380$ DEASSIGN SYS$OUTPUT _NLA0:
1381$ IF (silent) THEN GOSUB Shut_up
1382$ DEFINE SYS$ERROR _NLA0:
1383$ DEFINE SYS$OUTPUT _NLA0:
1384$ link deccvers.obj
1385$ tmp = $status
1386$ DEASSIGN SYS$ERROR
1387$ DEASSIGN SYS$OUTPUT
1388$ IF (silent) THEN GOSUB Shut_up
1389$ OPEN/WRITE CONFIG deccvers.out
1390$ DEFINE SYS$ERROR CONFIG
1391$ DEFINE SYS$OUTPUT CONFIG
1392$ mcr []deccvers.exe
1393$ tmp = $status
1394$ CLOSE CONFIG
1395$ DEASSIGN SYS$OUTPUT
1396$ DEASSIGN SYS$ERROR
1397$ IF (silent) THEN GOSUB Shut_up
1398$ OPEN/READ CONFIG deccvers.out
1399$ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1400$Dec_c_cleanup:
1401$ CLOSE CONFIG
1402$! DELETE/NOLOG/NOCONFIRM deccvers.*;
1403$ echo "You are using Dec C ''line'"
1404$ Dec_C_Version = line
5af06f0d 1405$ Dec_C_Version = Dec_C_Version + 0
1406$ if Dec_C_Version.ge.60200000 THEN CC_FLAGS = CC_FLAGS + "/NOANSI_ALIAS"
97abc6ad 1407$ ENDIF
97abc6ad 1408$Gcc_check:
1409$ if "''using_gnu_c'" .eqs. "Yes"
1410$ THEN
1411$ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1412$ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1413$ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1414$ IF gcclib_olb .EQS. ""
1415$ THEN
1416$! These objects/libs come w/ gcc 2.7.2 for AXP:
1417$ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1418$ IF tmp .NES. "" then gcclib_olb = tmp
1419$ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1420$ IF tmp .NES. ""
1421$ THEN
1422$ IF gcclib_olb .EQS. ""
1423$ THEN gcclib_olb = tmp
1424$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1425$ ENDIF
1426$ ENDIF
1427$ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1428$ IF tmp .NES. ""
1429$ THEN
1430$ IF gcclib_olb .EQS. ""
1431$ THEN gcclib_olb = tmp
1432$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1433$ ENDIF
1434$ ENDIF
1435$ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1436$ IF tmp .NES. ""
1437$ THEN
1438$ IF gcclib_olb .EQS. ""
1439$ THEN gcclib_olb = tmp
1440$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1441$ ENDIF
1442$ ENDIF
1443$ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1444$ ELSE
1445$ gcclib_olb = gcclib_olb + "/lib"
1446$ ENDIF
1447$ IF gcclib_olb .NES. "" .AND. -
1448 (vaxcrtl_olb .NES. "" .OR. -
1449 vaxcrtl_exe .NES. "" )
1450$ THEN
1451$ echo ""
1452$ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1453$ OPEN/WRITE CONFIG gccvers.c
1454$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1455$ WRITE CONFIG "#include <stdio.h>"
1456$ WRITE CONFIG "int main() {"
1457$ WRITE CONFIG "#ifdef __GNUC__"
1458$ WRITE CONFIG "#ifdef __VERSION__"
1459$ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1460$ WRITE CONFIG "#else"
1461$ WRITE CONFIG " printf(""%s\n"", ""1"");"
1462$ WRITE CONFIG "#endif"
1463$ WRITE CONFIG "#endif"
1464$ WRITE CONFIG " exit(0);"
1465$ WRITE CONFIG "}"
1466$ CLOSE CONFIG
1467$ DEFINE SYS$ERROR _NLA0:
1468$ DEFINE SYS$OUTPUT _NLA0:
1469$ 'Mcc' gccvers.c
1470$ tmp = $status
1471$ DEASSIGN SYS$ERROR _NLA0:
1472$ DEASSIGN SYS$OUTPUT _NLA0:
1473$ IF (silent) THEN GOSUB Shut_up
1474$ DEFINE SYS$ERROR _NLA0:
1475$ DEFINE SYS$OUTPUT _NLA0:
1476$ IF vaxcrtl_exe .EQS. ""
1477$ THEN
1478$ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1479$ THEN
1480$ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1481$ tmp = $status
1482$ ELSE
1483$ link gccvers.obj,'gcclib_olb'
1484$ tmp = $status
1485$ ENDIF
1486$ ELSE
1487$ OPEN/WRITE CONFIG GCCVERS.OPT
1488$ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1489$ CLOSE CONFIG
1490$ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1491$ tmp = $status
1492$ ENDIF
1493$ DEASSIGN SYS$ERROR
1494$ DEASSIGN SYS$OUTPUT
1495$ IF (silent) THEN GOSUB Shut_up
1496$ OPEN/WRITE CONFIG gccvers.out
1497$ DEFINE SYS$ERROR CONFIG
1498$ DEFINE SYS$OUTPUT CONFIG
1499$ mcr []gccvers.exe
1500$ tmp = $status
1501$ CLOSE CONFIG
1502$ DEASSIGN SYS$OUTPUT
1503$ DEASSIGN SYS$ERROR
1504$ IF (silent) THEN GOSUB Shut_up
1505$ OPEN/READ CONFIG gccvers.out
1506$ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1507$Gcc_cleanup:
1508$ CLOSE CONFIG
1509$ DELETE/NOLOG/NOCONFIRM gccvers.*;
1510$ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1511$ THEN
1512$ echo "You are not using GNU cc."
1513$ GOTO Host_name
1514$ ELSE
1515$ echo "You are using GNU cc ''line'"
1516$ Using_Gnu_C = "Yes"
1517$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1518$ GOTO Include_dirs
1519$ ENDIF
1520$ ENDIF
1521$endif
1522$ GOTO Host_name
1523$!
1524$List_Parse:
1525$ OPEN/READ CONFIG ccvms.lis
1526$ READ CONFIG line
1527$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1528$ THEN
1529$ read CONFIG line
1530$ archsufx = "VAX"
1531$ ELSE
1532$ archsufx = "AXP"
1533$ ENDIF
1534$ CLOSE CONFIG
1535$ line = F$EDIT(line,"TRIM,COMPRESS")
1536$ line = line - "Page 1" ! occurs at end all compilers
1537$ line = line - "CCVMS " ! filename appears w/ VAXC
1538$ line = line - "Source Listing " ! Seen w/ AXP DECC
1539$ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1540$ line = line - tmp
1541$ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1542$ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1543$ RETURN
1544$!
1545$Include_dirs:
1546$!: What should the include directory be ?
1547$ dflt = gcclib_olb
1548$ rp = "Where are the include files you want to use? "
1549$ IF f$length( rp + "[''dflt'] " ).gt.76
1550$ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1551$ ELSE rp = rp + "[''dflt'] "
1552$ ENDIF
1553$ GOSUB myread
1554$ usrinc = ans
1555$!
1556$!: see if we have to deal with yellow pages, now NIS.
1557$!: now get the host name
1558$Host_name:
1559$ echo ""
1560$ echo4 "Figuring out host name..." !>&4
1561$ myhostname = ""
1562$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1563$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1564$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1565$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1566$ IF myhostname.eqs."".and. -
1567 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1568 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1569 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1570$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1571$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1572$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1573$ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1574$!: you do not want to know about this
1575$!: verify guess
1576$ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1577$ GOSUB myread
1578$ IF (.not.ans).and.(ans.NES."")
1579$ THEN
1580$ READ SYS$COMMAND/PROMPT= -
1581 "Please type the (one word) name of your host: " ans
1582$ myhostname = ans
1583$ ENDIF
1584$!: translate upper to lower if necessary
1585$ myhostname = F$EDIT(myhostname,"COLLAPSE")
1586$ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1587$ IF mylowhostname.NES.myhostname
1588$ THEN
1589$ echo "(Normalizing case in your host name)"
1590$ myhostname = mylowhostname
1591$ ENDIF
1592$!
1593$ fp = F$LOCATE(".",myhostname)
1594$ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1595$ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1596$ THEN
1597$ rp = "What is your domain name? [''mydomain'] "
1598$ GOSUB myread
cc391245 1599$ IF ans .nes. "" THEN mydomain = ans
97abc6ad 1600$!: translate upper to lower if necessary
1601$ mydomain = F$EDIT(mydomain,"COLLAPSE")
1602$ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1603$ IF mylowdomain.NES.mydomain
1604$ THEN
1605$ echo "(Normalizing case in your domain name)"
1606$ mydomain = mylowdomain
1607$ ENDIF
1608$ ENDIF
1609$ myhostname = myhostname - mydomain
1610$ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1611$ IF .NOT.silent
1612$ THEN TYPE SYS$INPUT:
1613
1614I need to get your e-mail address in Internet format if possible, i.e.
1615something like user@host.domain. Please answer accurately since I have
1616no easy means to double check it. The default value provided below
1617is most probably close to the reality but may not be valid from outside
1618your organization...
1619$ ENDIF
146174a9 1620$ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
97abc6ad 1621$ rp = "What is your e-mail address? [''dflt'] "
1622$ GOSUB myread
cc391245 1623$ IF ans .nes. ""
97abc6ad 1624$ THEN cf_email = ans
1625$ ELSE cf_email = dflt
1626$ ENDIF
1627$!
1628$ IF .NOT.silent
1629$ THEN TYPE SYS$INPUT:
1630
1631If you or somebody else will be maintaining perl at your site, please
1632fill in the correct e-mail address here so that they may be contacted
1633if necessary. Currently, the "perlbug" program included with perl
1634will send mail to this address in addition to perlbug@perl.com. You may
1635enter "none" for no administrator.
1636$ ENDIF
1637$ dflt = "''cf_email'"
1638$ rp = "Perl administrator e-mail address [''dflt'] "
1639$ GOSUB myread
cc391245 1640$ IF ans .nes. ""
97abc6ad 1641$ THEN perladmin = ans
1642$ ELSE perladmin = dflt
1643$ ENDIF
1644$!
1645$!: determine where public executable scripts go
1646$!: determine perl absolute location
1647$!: figure out how to guarantee perl startup
1648$!
1649$!: see how we invoke the C preprocessor
1650$! echo ""
1651$! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1652$!: Set private lib path
1653$!: Now check and see which directories actually exist, avoiding duplicates
1654$!: determine optimize, if desired, or use for debug flag also
1655$!: We will not override a previous value, but we might want to
1656$!: augment a hint file
1657$!: the following weeds options from ccflags that are of no interest to cpp
1658$!: flags used in final linking phase
1659$!: Try to guess additional flags to pick up local libraries.
1660$!: coherency check
1661$! echo ""
1662$! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1663$!: compute shared library extension
1664$!: Looking for optional libraries
1665$!: see if nm is to be used to determine whether a symbol is defined or not
1666$!: get list of predefined functions in a handy place
1667$!: see if we have sigaction
1668$!: see whether socketshr exists
1669$ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1670$ THEN
1671$ has_socketshr = "T"
1672$ echo ""
1673$ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1674$ endif
1675$ if (Dec_C_Version .ge. 50200000)
1676$ THEN
1677$ Has_Dec_C_Sockets = "T"
1678$ echo ""
1679$ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1680$ ENDIF
1681$ ! Hey, we've got both. Default to Dec C, then, since it's better
1682$ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1683$ THEN
1684$ echo ""
1685$ echo "You've got sockets available. Which socket stack do you want to"
1686$ echo "build into perl?"
1687$ if "''has_dec_c_sockets'".eqs."T"
1688$ THEN
1689$ dflt = "DECC"
1690$ else
e6df7ed1 1691$ dflt = "SOCKETSHR"
97abc6ad 1692$ endif
1693$ rp = "Choose socket stack (NONE"
1694$ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1695$ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1696$ rp = rp + ") [''dflt'] "
1697$ GOSUB myread
1698$ IF "''ans'".eqs."" THEN ans = "''dflt'"
1699$ has_dec_c_sockets = "F"
1700$ has_socketshr = "F"
1701$ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1702$ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1703$ IF ans.eqs."socketshr" then has_socketshr = "T"
1704$ endif
1705$!
1706$!
3eeba6fb 1707$! Ask if they want to build with VMS_DEBUG perl
146174a9 1708$ echo ""
3eeba6fb 1709$ echo "Perl can be built to run under the VMS debugger."
1710$ echo "You should only select this option if you are debugging"
1711$ echo "perl itself. This can be a useful feature if you are "
1712$ echo "embedding perl in a program."
146174a9 1713$ dflt = "n"
3eeba6fb 1714$ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1715$ GOSUB myread
146174a9 1716$ IF ans.eqs."" then ans = dflt
1717$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
3eeba6fb 1718$ THEN
1719$ use_vmsdebug_perl = "Y"
1720$ macros = macros + """__DEBUG__=1"","
1721$ ELSE
1722$ use_vmsdebug_perl = "N"
1723$ ENDIF
1724$!
3937c24e 1725$! Ask if they want to build with MULTIPLICITY
146174a9 1726$ echo ""
3937c24e 1727$ echo "The perl interpreter engine can be built in a way that makes it
146174a9 1728$ echo "possible for a program that embeds perl into it (and yes, you can
3937c24e 1729$ echo "do that--it's pretty keen) to have multiple perl interpreters active
1730$ echo "at once. There is some performance overhead, however, so you
1731$ echo "probably don't want to choose this unless you're going to be doing
1732$ echo "funky perl embedding."
3937c24e 1733$ dflt = "n"
1734$ rp = "Build with MULTIPLICITY? [''dflt'] "
1735$ GOSUB myread
146174a9 1736$ if ans.eqs."" then ans = dflt
1737$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
3937c24e 1738$ THEN
1739$ use_multiplicity="Y"
1740$ ELSE
1741$ use_multiplicity="N"
1742$ ENDIF
fafa4fee 1743$!
1744$! Ask if they want to build with 64-bit support
f53b4005 1745$ IF (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
fafa4fee 1746$ THEN
f53b4005 1747$ dflt = use64bitint
fafa4fee 1748$ echo ""
f53b4005 1749$ echo "You can have native 64-bit long integers.
1750$ echo ""
1751$ echo "Perl can be built to take advantage of 64-bit integer types
1752$ echo "on some systems, which provide a much larger range for perl's
1753$ echo "mathematical operations. (Note that does *not* enable 64-bit
1754$ echo "fileops at the moment, as Dec C doesn't do that yet)."
1755$ echo "Choosing this option will most probably introduce binary incompatibilities.
1756$ echo ""
1757$ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1758$ rp = "Try to use 64-bit integers, if available? [''dflt'] "
5e4ba136 1759$ GOSUB myread
f53b4005 1760$ IF ans .EQS. "" THEN ans = dflt
1761$ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
5e4ba136 1762$ THEN
f53b4005 1763$ use64bitint="Y"
5e4ba136 1764$ ELSE
f53b4005 1765$ use64bitint="N"
5e4ba136 1766$ ENDIF
f53b4005 1767$ IF (use64bitint)
1768$ THEN
1769$ dflt = use64bitall
1770$ echo ""
1771$ echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
1772$ echo "What you have chosen is minimal 64-bitness which means just enough
1773$ echo "to get 64-bit integers. The maximal means using as much 64-bitness
1774$ echo "as is possible on the platform. This in turn means even more binary
1775$ echo "incompatibilities. On the other hand, your platform may not have
1776$ echo "any more maximal 64-bitness than what you already have chosen.
1777$ echo ""
1778$ echo "If this doesn't make any sense to you, just accept the default ''dflt'.
1779$ rp = "Try to use full 64-bit support, if available? [''dflt'] "
1780$ GOSUB myread
1781$ IF ans .EQS. "" THEN ans = dflt
1782$ IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
1783$ THEN
1784$ use64bitall="Y"
1785$ ELSE
1786$ use64bitall="N"
1787$ ENDIF
1788$ ENDIF
1789$ ENDIF ! AXP && >= 7.1
146174a9 1790$!
97abc6ad 1791$! Ask about threads, if appropriate
1792$ if (Using_Dec_C.eqs."Yes")
1793$ THEN
146174a9 1794$ echo ""
97abc6ad 1795$ echo "This version of Perl can be built with threads. While really nifty,
1796$ echo "they are a beta feature, and there is a speed penalty for perl
1797$ echo "programs if you build with threads *even if you don't use them*
429a5e67 1798$ dflt = "n"
97abc6ad 1799$ rp = "Build with threads? [''dflt'] "
1800$ GOSUB myread
1801$ if ans.eqs."" then ans = dflt
1802$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1803$ THEN
1804$ use_threads="T"
498336ed 1805$!
1806$ ! Shall we do the 5.005-stype threads, or IThreads?
1807$ echo "As of 5.5.640, Perl has two different internal threading
1808$ echo "implementations, the 5.005 version (5005threads) and an
1809$ echo "interpreter-based version (ithreads) that has one
1810$ echo "interpreter per thread. Both are very experimental. This
1811$ echo "arrangement exists to help developers work out which one
1812$ echo "is better.
1813$ echo "
1814$ echo "If you're a casual user, you probably don't want
1815$ echo "interpreter-threads at this time. There doesn't yet exist
1816$ echo "a way to create threads from within Perl in this model,
2974eb71 1817$ echo "i.e., ""use Thread;"" will NOT work.
498336ed 1818$ echo "
1819$ dflt = "n"
1820$ rp = "Build with Interpreter threads? [''dflt']
2974eb71 1821$ GOSUB myread
498336ed 1822$ if ans.eqs."" then ans = dflt
1823$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1824$ THEN
1825$ use_ithreads="Y"
1826$ use_5005_threads="N"
1827$ ELSE
1828$ use_ithreads="N"
1829$ use_5005_threads="Y"
1830$ ENDIF
429a5e67 1831$ ! Are they on VMS 7.1 on an alpha?
1832$ if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
1833$ THEN
1834$ echo ""
1835$ echo "Threaded perl can be linked to use multiple kernel threads
1836$ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
1837$ echo "allows multiple threads to execute simultaneously on an SMP
1838$ echo "system as well as preventing a single thread from blocking
1839$ echo "all the threads in a program, even on a single-processor
1840$ echo "machine. Unfortunately this feature isn't safe on an
1841$ echo "unpatched 7.1 system. (Several OS patches were required when
1842$ echo "this procedure was written)
e6df7ed1 1843$ dflt = "n"
429a5e67 1844$ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
1845$ gosub myread
1846$ if ans.eqs."" then ans="''dflt'"
1847$ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
1848$ THEN
1849$ Thread_Live_Dangerously = "MT=MT=1"
1850$ ENDIF
1851$ ENDIF
97abc6ad 1852$ ENDIF
1853$ ENDIF
498336ed 1854$ if archname .eqs. "VMS_AXP"
1855$ then
1856$!
1857$! Case sensitive?
1858$ echo ""
1859$ echo "By default, perl (and pretty much everything else on VMS) uses
1860$ echo "case-insensitive linker symbols. Which is to say, when the
1861$ echo "underlying C code makes a call to a routine called Perl_foo in
1862$ echo "the source, the name in the object modules or shareable images
1863$ echo "is really PERL_FOO. There are some packages that use an
1864$ echo "embedded perl interpreter that instead require case-sensitive
1865$ echo "linker symbols.
1866$ echo ""
f53b4005 1867$ echo "If you have no idea what this means, and don't have
498336ed 1868$ echo "any program requiring anything, choose the default.
498336ed 1869$ dflt = be_case_sensitive
1870$ rp = "Case-sensitive symbols [''dflt'] "
1871$ gosub myread
1872$ if ans.eqs."" then ans="''dflt'"
1873$ be_case_sensitive = "''ans'"
1874$!
1875$! IEEE math?
1876$ echo ""
1877$ echo "Perl normally uses G_FLOAT format floating point numbers
1878$ echo "internally, as do most things on VMS. You can, however, build
1879$ echo "with IEEE floating point numbers instead if you need to.
498336ed 1880$ dflt = use_ieee_math
1881$ rp = "Use IEEE math [''dflt'] "
1882$ gosub myread
1883$ if ans.eqs."" then ans="''dflt'"
1884$ use_ieee_math = "''ans'"
1885$ endif
1886$! CC Flags
1887$ echo ""
1888$ echo "You can, if you need to, pass extra flags on to the C
1889$ echo "compiler. In general you should only do this if you really,
1890$ echo "really know what you're doing.
498336ed 1891$ dflt = user_c_flags
f53b4005 1892$ rp = "Extra C flags [''dflt'] "
498336ed 1893$ gosub myread
1894$ if ans.eqs."" then ans="''dflt'"
1895$ user_c_flags = "''ans'"
97abc6ad 1896$!
cc391245 1897$! Ask whether they want to use secure logical translation when tainting
1898$ echo ""
1899$ echo "As Perl starts up, it checks several logical names, such as"
1900$ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
1901$ echo "of its behavior. For additional security, you may limit this"
1902$ echo "process to executive- and kernel-mode translation when tainting"
1903$ echo "is enabled. In this case, logical names normally skipped when"
1904$ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
1905$ echo "If you do not choose to do this, the usual order of access modes"
1906$ echo "is used for logical name translation."
1907$ echo ""
1908$ echo "This restriction does not apply to the %ENV hash or to implicit"
1909$ echo "logical name translation during parsing of file specifications;"
1910$ echo "these always use the normal sequence of access modes for logical"
1911$ echo "name translation."
01792a70 1912$ dflt = "y"
cc391245 1913$ rp = "Use secure logical name translation? [''dflt'] "
1914$ GOSUB myread
1915$ if ans.eqs."" then ans="''dflt'"
1916$ d_secintgenv = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1917$!
1918$! Ask whether they want to default filetypes
1919$ echo ""
1920$ echo "When you pass the name of a program to Perl on the command line,"
1921$ echo "it generally doesn't supply any defaults unless the -S command"
1922$ echo "line switch is specified. In keeping with the VMS tradition of"
1923$ echo "default file types, however, you can configure Perl to try default"
1924$ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
1925$ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
1926$ echo "finally foo.com)."
08c7cbbb 1927$ dflt = "y"
cc391245 1928$ rp = "Always use default file types? [''dflt'] "
1929$ GOSUB myread
1930$ if ans.eqs."" then ans="''dflt'"
146174a9 1931$ d_alwdeftype = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
cc391245 1932$!
97abc6ad 1933$! Ask if they want to use perl's memory allocator
1934$ echo ""
1935$ echo "Perl has a built-in memory allocator that's tuned for perl's
1936$ echo "normal memory usage. It's oftentimes better than the standard
1937$ echo "system memory allocator. It also has the advantage of providing
429a5e67 1938$ echo "memory allocation statistics, if you choose to enable them.
e6df7ed1 1939$ dflt = "n"
97abc6ad 1940$ rp = "Build with perl's memory allocator? [''dflt'] "
1941$ GOSUB myread
1942$ if ans.eqs."" then ans="''dflt'"
146174a9 1943$ mymalloc = f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE"))
429a5e67 1944$ if mymalloc.eqs."Y"
1945$ THEN
1946$ if use_debugging_perl.eqs."Y"
1947$ THEN
1948$ echo ""
1949$ echo "Perl can keep statistics on memory usage if you choose to use
1950$ echo "them. This is useful for debugging, but does have some
1951$ echo "performance overhead.
e6df7ed1 1952$ dflt = "n"
429a5e67 1953$ rp = "Do you want the debugging memory allocator? [''dflt'] "
1954$ gosub myread
1955$ if ans.eqs."" then ans="''dflt'"
146174a9 1956$ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
429a5e67 1957$ ENDIF
1958$ ! Check which memory allocator we want
1959$ echo ""
1960$ echo "There are currently three different memory allocators: the
1961$ echo "default (which is a pretty good general-purpose memory manager),
1962$ echo "the TWO_POT allocator (which is optimized to save memory for
1963$ echo "larger allocations), and PACK_MALLOC (which is optimized to save
1964$ echo "memory for smaller allocations). They're all good, but if your
1965$ echo "usage tends towards larger chunks use TWO_POT, otherwise use
1966$ echo "PACK_MALLOC."
429a5e67 1967$ dflt = "DEFAULT"
1968$ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
1969$ GOSUB myread
1970$ if ans.eqs."" then ans = "''dflt'"
1971$ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
1972$ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
1973$ ENDIF
97abc6ad 1974$!
1975$! Ask for their default list of extensions to build
1976$ echo ""
1977$ echo "It's time to specify which modules you want to build into
1978$ echo "perl. Most of these are standard and should be chosen, though
1979$ echo "you might, for example, want to build GDBM_File instead of
cb50131a 1980$ echo "SDBM_File if you have the GDBM library built on your machine.
1981$ echo "Whatever you do, make sure the re module is first or things will
1982$ echo "break badly"
97abc6ad 1983$ echo "
1984$ echo "Which modules do you want to build into perl?"
146174a9 1985$! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
f53b4005 1986$ dflt = "re Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs VMS::Stdio VMS::DCLsym B SDBM_File Thread Sys::Hostname"
97abc6ad 1987$ if Using_Dec_C.eqs."Yes"
1988$ THEN
1989$ dflt = dflt + " POSIX"
97abc6ad 1990$ ENDIF
1991$ rp = "[''dflt'] "
1992$ GOSUB myread
1993$ if ans.eqs."" then ans = "''dflt'"
8f6c6e69 1994$ a = ""
1995$ j = 0
1996$ xloop1:
1997$ x = f$elem(j," ",ans)
1998$ j = j + 1
1999$ if x .eqs. " " then goto exloop1
2000$ xloop2:
2001$ k = f$locate("::",x)
2002$ if k .ge. f$len(x) then goto exloop2
2003$ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2004$ goto xloop2
2005$ exloop2:
2006$ a = a + " " + x
2007$ goto xloop1
2008$ exloop1:
2009$ ans = f$edit(a,"trim")
2010$!
2011$ a = ""
2012$ j = 0
2013$ xloop3:
2014$ x = f$elem(j," ",dflt)
2015$ j = j + 1
2016$ if x .eqs. " " then goto exloop3
2017$ xloop4:
2018$ k = f$locate("::",x)
2019$ if k .ge. f$len(x) then goto exloop4
2020$ x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2021$ goto xloop4
2022$ exloop4:
2023$ a = a + " " + x
2024$ goto xloop3
2025$ exloop3:
2026$ dflt = f$edit(a,"trim")
2027$!
97abc6ad 2028$ extensions = "''ans'"
237671e5 2029$ perl_known_extensions = "''dflt'"
97abc6ad 2030$!
2031$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2032$ echo ""
2033$ echo "%Config-I-VMS, Checking your ""make"" utilities..."
2034$! If the 'build' that you use is not here add it and it's test
2035$! switch to the _END_ of these strings (and increment max_build)
2036$! (e.g. builders = builders + "/FOOMAKE"
2037$! probers = probers + " -fooVersionSwitch"
2038$! ) & please let me know about it.
2039$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2040$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2041$ max_build = 7
2042$!
2043$ orig_dflt = "MMK"
2044$ default_set = ""
2045$ ok_builders = ""
2046$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2047$ WRITE CONFIG "dont_make_anything_yet:"
2048$ WRITE CONFIG F$FAO("!_")
2049$ CLOSE CONFIG
2050$ n = 0
2051$ messages = F$ENVIRONMENT("MESSAGE")
2052$Build_probe:
2053$ build = F$ELEMENT(n,"/",builders)
2054$ probe = F$ELEMENT(n,"!",probers)
2055$ echo "Testing whether you have ''build' on your system..."
a3ef2c6f 2056$ SET NOON
2057$ ON CONTROL_Y THEN GOTO Reenable_messages_build
2058$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
97abc6ad 2059$ 'build' 'probe'
2060$ IF ($SEVERITY .EQ. 1)
2061$ THEN
2062$ echo "OK."
2063$ IF (build .EQS. orig_dflt)
2064$ THEN
2065$ default_set = "TRUE"
2066$ dflt = build
2067$ ENDIF
2068$ ok_builders = ok_builders + " " + build
2069$ IF (.NOT. default_set) THEN dflt = build
2070$ ELSE
2071$ echo "Nope."
2072$ ENDIF
a3ef2c6f 2073$Reenable_messages_build:
2074$ SET MESSAGE 'messages'
2075$ SET ON
97abc6ad 2076$ n = n + 1
2077$ IF (n .LT. max_build) THEN GOTO Build_probe
2078$!
2079$ echo ""
2080$ IF (ok_builders .NES. "")
2081$ THEN
2082$ echo "Here is the list of builders you can apparently use:"
2083$ echo "(",ok_builders," )"
2084$ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
2085$ GOSUB myread
2086$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2087$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2088$ IF (ans .EQS. "")
2089$ THEN build = dflt
2090$ ELSE build = ans
2091$ ENDIF
2092$ ELSE
2093$ TYPE SYS$INPUT:
2094
2095%Config-E-VMS, ERROR:
2096 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2097 utility of some sort and after checking my "builders" list I cannot find
2098 the symbol or command you use on your system to compile programs.
2099
2100$ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
2101$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2102$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2103$ IF (ans .EQS. "")
2104$ THEN build = dflt
2105$ echo "I don't know where 'make' is, and my life depends on it."
2106$ echo "Go find a make program or fix your DCL$PATH setting!"
2107$ echo "ABORTING..."
2108$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2109$ STOP
2110$ EXIT 2 !$STATUS = "%X00000002" (error)
2111$ ELSE
2112$ build = ans
2113$ ENDIF
2114$ ENDIF
2115$!
2116$ DELETE/NOLOG Makefile.;
2117$ GOTO Beyond_open
2118$Open_error:
2119$ TYPE SYS$INPUT:
2120
2121 There seems to be trouble. I just tried to create a file in
2122$ echo4 'F$ENVIRONMENT("DEFAULT")'
2123$ TYPE SYS$INPUT:
2124 but was unsuccessful. I am stopping now. Please check that directories'
2125 PROTECTION bits. I will leave you in the directory where you started
2126 Configure.com
2127$ echo4 "ABORTING..."
2128$ GOTO Clean_up
2129$ STOP
2130$ EXIT
2131$!
2132$Beyond_open:
2133$! echo " Very well I will proceed with ""''build'"""
2134$ make = F$EDIT(build,"UPCASE")
2135$!
2136$!: locate the preferred pager for this system
2137$!pagers = "most|more|less|type/page"
2138$!rp='What pager is used on your system?'
2139$!
2140$! update [.vms]config.vms here
2141$!
2142$! update makefile here
2143$! echo4 "Updating makefile..."
2144$!
2145$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2146$ THEN
08c7cbbb 2147$ makefile = "" !wrt MANIFEST dir
2148$ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
2149$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
97abc6ad 2150$ ELSE
08c7cbbb 2151$ makefile = " -f Makefile." !wrt MANIFEST dir
2152$ UUmakefile = "[-]Makefile." !wrt CWD dir
2153$ DEFmakefile = "Makefile." !wrt DEF dir (?)
97abc6ad 2154$ ENDIF
2155$!
2156$ IF macros.NES.""
2157$ THEN
2158$ tmp = F$LENGTH(macros)
2159$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2160$ macros = "/macro=(" + macros + ")"
2161$ ENDIF
498336ed 2162$! Build up the extra C flags
2163$!
2164$ if use_ieee_math
2165$ then
2166$ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2167$ endif
2168$ if be_case_sensitive
2169$ then
2170$ extra_flags = "''extra_flags'" + "/Names=As_Is"
2171$ endif
2172$ extra_flags = "''extra_flags'" + "''user_c_flags'"
97abc6ad 2173$!
2174$! Invoke the subconfig piece
2175$!
2176$ echo ""
cc391245 2177$ echo4 "Checking the C run-time library"
97abc6ad 2178$ dflt = F$ENVIRONMENT("DEFAULT")
2179$ SET DEFAULT [-.vms]
2180$ @subconfigure
2181$ SET DEFAULT 'dflt
2182$!
146174a9 2183$! Warn of dangerous symbols or logical names
a4521476 2184$!
146174a9 2185$Bad_environment: SUBROUTINE
2186$ Bad_env = ""
2187$ IF p2 .eqs. "SYMBOL"
2188$ THEN
2189$ IF f$type('p1) .nes. "" THEN Bad_env := SYMBOL
2190$ ELSE
2191$ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
2192$ ENDIF
2193$ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
a4521476 2194$ THEN
2195$ IF f$search("config.msg") .nes. ""
2196$ THEN
2197$ OPEN/APPEND CONFIG config.msg
2198$ ELSE
2199$ OPEN/WRITE CONFIG config.msg
2200$ ENDIF
146174a9 2201$ IF Bad_env .eqs. "SYMBOL"
2202$ THEN
2203$ WRITE CONFIG ""
2204$ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
2205$ WRITE CONFIG " delete before building ''package' via:"
2206$ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
2207$ IF f$locate("""",&p1) .ge. f$length(&p1)
2208$ THEN
2209$ WRITE CONFIG " after building, testing, and installing ''package'
2210$ WRITE CONFIG " restore the symbol with:"
2211$ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
2212$ ENDIF
2213$ ENDIF
2214$ IF Bad_env .eqs. "LOGICAL"
2215$ THEN
2216$ WRITE CONFIG ""
2217$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
2218$ WRITE CONFIG " deassign before building ''package'"
2219$ ENDIF
a4521476 2220$ CLOSE CONFIG
146174a9 2221$ Bad_env = ""
a4521476 2222$ ENDIF
2223$ EXIT
146174a9 2224$ ENDSUBROUTINE ! Bad_environment
a4521476 2225$ echo ""
8560c20d 2226$ echo4 "%Config-I-VMS, Checking for dangerous pre-existing global symbols and logical names."
146174a9 2227$ CALL Bad_environment "TMP"
2228$ CALL Bad_environment "LIB"
2229$ CALL Bad_environment "T"
2230$ CALL Bad_environment "FOO"
2231$ CALL Bad_environment "EXT"
2232$ CALL Bad_environment "TEST" "SYMBOL"
a4521476 2233$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
2234$!
97abc6ad 2235$! %Config-I-VMS, write perl_setup.com here
2236$!
86fced14 2237$ IF (.NOT.perl_symbol)
2238$ THEN
2239$ file_2_find = "[-]''packageup'.cld"
2240$ echo ""
2241$ echo4 "%Config-I-VMS, The perl.cld file is now being written..."
2242$ OPEN/WRITE CONFIG 'file_2_find'
c645ec3f 2243$ ext = ".exe"
2244$ IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
86fced14 2245$ IF (use_vmsdebug_perl)
2246$ THEN
2247$ WRITE CONFIG "define verb dbgperl"
2248$ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]dbgperl''ext'")
2249$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2250$ WRITE CONFIG ""
2251$ WRITE CONFIG "define verb perl"
2252$ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]ndbgPerl''ext'")
2253$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2254$ ELSE
2255$ WRITE CONFIG "define verb perl"
2256$ WRITE CONFIG F$FAO("!_!AS","image ''packageup'_root:[000000]perl''ext'")
2257$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
2258$ ENDIF
2259$ CLOSE CONFIG
2260$ ENDIF ! (.NOT.perl_symbol)
97abc6ad 2261$ echo ""
2262$ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
a3ef2c6f 2263$ file_2_find = "[-]perl_setup.com"
97abc6ad 2264$ OPEN/WRITE CONFIG 'file_2_find'
2265$ WRITE CONFIG "$!"
2266$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
2267$ IF cf_email.NES.perladmin
2268$ THEN
2269$ WRITE CONFIG "$! perl configured by ''cf_email'"
2270$ ELSE
2271$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
2272$ ENDIF
2273$ WRITE CONFIG "$!"
3eeba6fb 2274$ prefix = prefix - "000000."
97abc6ad 2275$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
2276 prefix = prefix - "]" + ".]"
2277$ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
86fced14 2278$ WRITE CONFIG "$ ext = "".exe"""
2279$ IF sharedperl .EQS. "Y"
2280$ THEN
3eeba6fb 2281$ write config "$ if f$getsyi(""ARCH_NAME"") .nes. ""VAX"" then ext = "".AXE"""
86fced14 2282$ ENDIF
2283$ IF (perl_symbol)
2284$ THEN
2285$ IF (use_vmsdebug_perl)
2286$ THEN
2287$ WRITE CONFIG "$ dbgperl :== $Perl_Root:[000000]dbgPerl'ext'"
2288$ WRITE CONFIG "$ perl :== $Perl_Root:[000000]ndbgPerl'ext'"
2289$ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2290$ ELSE
2291$ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl'ext'"
2292$ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2293$ ENDIF
2294$ ELSE ! .NOT.perl_symbol
2295$ IF (use_vmsdebug_perl)
2296$ THEN
2297$ WRITE CONFIG "$ define dbgPerlShr Perl_Root:[000000]dbgPerlShr'ext'"
2298$ ELSE
2299$ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr'ext'"
2300$ ENDIF
2301$ IF perl_verb .EQS. "PROCESS"
2302$ THEN
2303$ WRITE CONFIG "$ set command ''packagup'_ROOT:[000000]''packageup'.CLD"
2304$ ENDIF
2305$ ENDIF ! perl_symbol
a3ef2c6f 2306$ WRITE CONFIG "$ define/nolog pod2text Perl_Root:[lib.pod]pod2text.com"
2307$ WRITE CONFIG "$ define/nolog pod2html Perl_Root:[lib.pod]pod2html.com"
2308$ WRITE CONFIG "$ define/nolog pod2man Perl_Root:[lib.pod]pod2man.com"
3eeba6fb 2309$!
97abc6ad 2310$ IF (tzneedset)
2311$ THEN
2312$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2313$ ELSE !leave in but commented out (in case setting was from perl :-)
2314$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
2315$ ENDIF
2316$ WRITE CONFIG "$!"
2317$ WRITE CONFIG "$! Symbols for commonly used scripts:"
2318$ WRITE CONFIG "$!"
86fced14 2319$ IF (perl_symbol)
2320$ THEN
2321$ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
2322$ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
2323$ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
2324$ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' Perl_Root:[lib.pod]pod2latex.com"""
2325$ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
2326$ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' Perl_Root:[lib]Perlbug.com"""
2327$ WRITE CONFIG "$ c2ph == ""'"+"'Perl' Perl_Root:[utils]c2ph.com"""
2328$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2329$ THEN
2330$ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' Perl_Root:[utils]dprofpp.com"""
2331$ ENDIF
2332$ WRITE CONFIG "$ h2ph == ""'"+"'Perl' Perl_Root:[utils]h2ph.com"""
2333$ WRITE CONFIG "$ h2xs == ""'"+"'Perl' Perl_Root:[utils]h2xs.com"""
2334$ WRITE CONFIG "$!perlcc == ""'"+"'Perl' Perl_Root:[utils]perlcc.com"""
2335$ WRITE CONFIG "$ splain == ""'"+"'Perl' Perl_Root:[utils]splain.com"""
2336$ ELSE
2337$ WRITE CONFIG "$ Perldoc == ""Perl Perl_Root:[lib.pod]Perldoc.com -t"""
2338$ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
2339$ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
2340$ WRITE CONFIG "$ pod2latex == ""Perl Perl_Root:[lib.pod]pod2latex.com"""
2341$ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
2342$ WRITE CONFIG "$!Perlbug == ""Perl Perl_Root:[lib]Perlbug.com"""
2343$ WRITE CONFIG "$ c2ph == ""Perl Perl_Root:[utils]c2ph.com"""
2344$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
2345$ THEN
2346$ WRITE CONFIG "$ dprofpp == ""Perl Perl_Root:[utils]dprofpp.com"""
2347$ ENDIF
2348$ WRITE CONFIG "$ h2ph == ""Perl Perl_Root:[utils]h2ph.com"""
2349$ WRITE CONFIG "$ h2xs == ""Perl Perl_Root:[utils]h2xs.com"""
2350$ WRITE CONFIG "$!perlcc == ""Perl Perl_Root:[utils]perlcc.com"""
2351$ WRITE CONFIG "$ splain == ""Perl Perl_Root:[utils]splain.com"""
2352$ ENDIF
97abc6ad 2353$ CLOSE CONFIG
2354$!
2355$ echo ""
2356$ echo "%Config-I-VMS, The file can be found at:"
2357$ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
2358$ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
2359$ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
2360$ echo "-Config-I-VMS, testing, and installation of your perl."
2361$ echo ""
86fced14 2362$ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
2363$ THEN
2364$ file_2_find = "[-]''packageup'_install.com"
2365$ OPEN/WRITE CONFIG 'file_2_find
2366$ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
2367$ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
2368$ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
2369$ CLOSE CONFIG
2370$ echo4 ""
2371$ echo4 "%Config-I-VMS, In order to install the ''packageup' verb into DCLTABLES run:"
2372$ echo4 "-Config-I-VMS, @ ''F$SEARCH(file_2_find)'"
2373$ echo4 "-Config-I-VMS, after a successful build, test, and install. Do so with CMKRNL privilege."
2374$ echo4 ""
2375$ ENDIF
97abc6ad 2376$!
2377$!figure out where we "are" by parsing 'vms_default_directory_name'
2378$!
2379$ set_def_command = ""
2380$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
2381$ tmp = vms_default_directory_name - dflt - "]"
2382$ i = 0
2383$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
2384$Set_def_loop:
2385$ tmp1 = F$ELEMENT(i,".",tmp)
2386$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
2387$ IF i .EQ. 0
2388$ THEN set_def_command = "set default [-"
2389$ ELSE set_def_command = set_def_command + "-"
2390$ ENDIF
2391$ i = i + 1
2392$ GOTO Set_def_loop
2393$Beyond_set_def_loop:
2394$ IF set_def_command.NES.""
2395$ THEN
2396$ set_def_command = set_def_command - "-" + "]"
2397$ echo4 ""
2398$ echo4 "In order to build ''package' you must now issue the commands:"
2399$ echo4 ""
2400$ echo4 " ''set_def_command'"
2401$ ELSE
2402$ echo4 ""
2403$ echo4 "In order to build ''package' you must now issue the command:"
2404$ echo4 ""
2405$ ENDIF
2406$ echo4 " ''make'''makefile'", macros
2407$ echo4 ""
2408$!
a4521476 2409$ IF ( F$SEARCH("config.msg").NES."" )
2410$ THEN
2411$ echo "Hmm. I also noted the following information while running:"
2412$ echo ""
2413$ type config.msg
2414$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
2415$ DELETE/NOLOG/NOCONFIRM config.msg;
2416$ ENDIF
2417$!
97abc6ad 2418$Clean_up:
2419$ IF (silent)
2420$ THEN
2421$ DEASSIGN SYS$OUTPUT
2422$! DEASSIGN SYS$ERROR
2423$ ENDIF
2424$ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
2425$ IF F$GETJPI("","FILCNT").NE.vms_filcnt
2426$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
2427$ ENDIF
2428$ dflt = F$ENVIRONMENT("DEFAULT")
2429$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
2430$ THEN
2431$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
2432$ SET DEFAULT [-]
2433$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
2434$ DELETE/NOLOG/NOCONFIRM UU.DIR;
2435$ ENDIF
2436$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2437$ STOP
2438$ EXIT
2439$!: End of Configure