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